commit fc884748369383f5cb2ba026c2988c53c55e3f58
parent 3f794f5fedfbf253b5876e491b30fe5d47d30c6e
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Wed, 25 Aug 2021 16:26:45 -0700
Replace leading spaces with tabs
Diffstat:
8 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/aps/aps.c b/aps/aps.c
@@ -162,30 +162,30 @@ aps_update(struct aps *aps)
char *
aps_read(struct aps *aps, int s)
{
- char *end;
- int len;
- struct buf *buf;
+ char *end;
+ int len;
+ struct buf *buf;
- buf = aps->clients[s].request;
- if (buf->len == buf->size) {
+ buf = aps->clients[s].request;
+ if (buf->len == buf->size) {
if (buf->size == UINT_MAX || bufresize(buf,
(buf->size > UINT_MAX / 4) ? UINT_MAX : (MAX(128, buf->size) * 4))) {
aps_errordrop(aps, s, errstr);
- return NULL;
+ return NULL;
}
- }
+ }
- len = recv(s, buf->data + buf->len, buf->size - buf->len, 0);
- if (len == -1)
- return NULL;
- buf->len += len;
+ len = recv(s, buf->data + buf->len, buf->size - buf->len, 0);
+ if (len == -1)
+ return NULL;
+ buf->len += len;
- end = memchr(buf->data + (buf->len - len), '\n', len);
- if (end == NULL)
- return NULL; /* not a full command yet */
- *end = 0;
+ end = memchr(buf->data + (buf->len - len), '\n', len);
+ if (end == NULL)
+ return NULL; /* not a full command yet */
+ *end = 0;
- return end + 1;
+ return end + 1;
}
int
diff --git a/aps/asplit.c b/aps/asplit.c
@@ -24,18 +24,18 @@
char **
asplit(char *s, char *sep)
{
- char **args, *copy;
- unsigned int len;
+ char **args, *copy;
+ unsigned int len;
- copy = strdup(s);
- if (copy == NULL)
- return NULL;
- len = split(NULL, 0, copy, sep);
- free(copy);
+ copy = strdup(s);
+ if (copy == NULL)
+ return NULL;
+ len = split(NULL, 0, copy, sep);
+ free(copy);
- args = calloc(++len, sizeof(*args));
- if (args == NULL)
- return NULL;
- split(args, len, s, sep);
- return args;
+ args = calloc(++len, sizeof(*args));
+ if (args == NULL)
+ return NULL;
+ split(args, len, s, sep);
+ return args;
}
diff --git a/aps/command.c b/aps/command.c
@@ -80,14 +80,14 @@ aps_remove(struct aps *aps, int s, int argc, char **argv)
return NULL;
}
- item = aps->queue;
- while ((item = finddir(findnext, item, aps->queue, argv, argc, 0))) {
+ item = aps->queue;
+ while ((item = finddir(findnext, item, aps->queue, argv, argc, 0))) {
next = findnext(item);
if (next == item)
next = NULL;
queue_remove(aps, item);
item = next;
- }
+ }
return NULL;
}
diff --git a/aps/find.c b/aps/find.c
@@ -30,13 +30,13 @@
struct item *
findnext(struct item *item)
{
- return item->next;
+ return item->next;
}
struct item *
findprev(struct item *item)
{
- return item->prev;
+ return item->prev;
}
struct item *
diff --git a/aps/log.c b/aps/log.c
@@ -52,7 +52,7 @@ aps_logfmt(struct aps *aps, int level, int fd, char *fmt, ...)
{
va_list ap;
- if (fmt == NULL || (aps && !(level & aps->logmask)))
+ if (fmt == NULL || (aps && !(level & aps->logmask)))
return;
fprintf(stderr, "ap(%d): %s: ", fd, apstrll(level));
diff --git a/aps/main.c b/aps/main.c
@@ -39,18 +39,18 @@
static struct aps *aps;
static struct command commands[] = {
- { "add", aps_add },
- { "list", aps_list },
- { "name", aps_name },
- { "next", aps_next },
- { "pause", aps_pause },
- { "play", aps_play },
- { "previous", aps_previous },
- { "remove", aps_remove },
- { "seek", aps_seek },
- { "status", aps_status },
- { "stop", aps_stop },
- { "toggle", aps_toggle }
+ { "add", aps_add },
+ { "list", aps_list },
+ { "name", aps_name },
+ { "next", aps_next },
+ { "pause", aps_pause },
+ { "play", aps_play },
+ { "previous", aps_previous },
+ { "remove", aps_remove },
+ { "seek", aps_seek },
+ { "status", aps_status },
+ { "stop", aps_stop },
+ { "toggle", aps_toggle }
};
void
diff --git a/aps/response.c b/aps/response.c
@@ -56,7 +56,7 @@ respfree(struct aps *aps, int fd)
int
respadd(struct aps *aps, int fd, char *item)
{
- if (bufappend(RESP->buf, item, strlen(item)) ||
+ if (bufappend(RESP->buf, item, strlen(item)) ||
bufappend(RESP->buf, "\n", 1))
return 1;
return 0;
@@ -65,7 +65,7 @@ respadd(struct aps *aps, int fd, char *item)
int
respfinish(struct aps *aps, int fd, char *error)
{
- if (error == NULL) {
+ if (error == NULL) {
/* NOTE: Perhaps it should return an error? */
if (respadd(aps, fd, "ok"))
respfinish(aps, fd, errstr);
@@ -76,10 +76,10 @@ respfinish(struct aps *aps, int fd, char *error)
bufappend(RESP->buf, error, strlen(error)) ||
bufappend(RESP->buf, "\n", 1))
return 1;
- }
+ }
- aps->clients[fd].resp->lock = 1;
- return 0;
+ aps->clients[fd].resp->lock = 1;
+ return 0;
}
int
diff --git a/aps/split.c b/aps/split.c
@@ -33,5 +33,5 @@ split(char **ap, unsigned int len, char *s, char *sep)
if (len)
ap[MIN(len - 1, i)] = NULL;
- return i;
+ return i;
}