sacc

sacc (saccomys): simple gopher client.
Log | Files | Refs | LICENSE

commit bd20bcb8514e6ba476aa608197c97f2614196682
parent 95e8694bc8a23e1e027783b3e2e0db56f8a634f1
Author: Quentin Rameau <quinq@fifth.space>
Date:   Fri, 23 Jun 2017 20:44:09 +0200

Make functions static

Diffstat:
sacc.c | 40+++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/sacc.c b/sacc.c @@ -32,9 +32,7 @@ struct dir { size_t nitems; }; -static void die(const char *, ...); - -void +static void die(const char *fmt, ...) { va_list arg; @@ -47,7 +45,7 @@ die(const char *fmt, ...) exit(1); } -void * +static void * xreallocarray(void *m, const size_t n, const size_t s) { void *nm; @@ -61,7 +59,7 @@ xreallocarray(void *m, const size_t n, const size_t s) return nm; } -void * +static void * xmalloc(const size_t n) { void *m = malloc(n); @@ -73,7 +71,7 @@ xmalloc(const size_t n) return m; } -char * +static char * xstrdup(const char *str) { char *s; @@ -85,13 +83,13 @@ xstrdup(const char *str) return s; } -void +static void usage(void) { die("usage: sacc URL"); } -void +static void help(void) { puts("Commands:\n" @@ -104,7 +102,7 @@ help(void) "h: this help."); } -int +static int termlines(void) { struct winsize ws; @@ -117,7 +115,7 @@ termlines(void) return ws.ws_row-1; } -const char * +static const char * typedisplay(char t) { switch (t) { @@ -160,7 +158,7 @@ typedisplay(char t) } } -void +static void display(Item *item) { Item **items; @@ -195,7 +193,7 @@ display(Item *item) } } -char * +static char * pickfield(char **raw, char sep) { char *c, *f = *raw; @@ -221,7 +219,7 @@ pickfield(char **raw, char sep) return f; } -Item * +static Item * molditem(char **raw) { Item *item; @@ -253,7 +251,7 @@ molditem(char **raw) return item; } -Dir * +static Dir * molddiritem(char *raw) { Item *item, **items = NULL; @@ -291,7 +289,7 @@ molddiritem(char *raw) return dir; } -char * +static char * getrawitem(int sock) { char *raw, *buf; @@ -319,7 +317,7 @@ getrawitem(int sock) return raw; } -void +static void sendselector(int sock, const char *selector) { char *msg, *p; @@ -339,7 +337,7 @@ sendselector(int sock, const char *selector) die("Can't send message: %s", strerror(errno)); } -int +static int connectto(const char *host, const char *port) { static const struct addrinfo hints = { @@ -375,7 +373,7 @@ connectto(const char *host, const char *port) return sock; } -int +static int dig(Item *entry, Item *item) { int sock; @@ -412,7 +410,7 @@ dig(Item *entry, Item *item) return 1; } -Item * +static Item * selectitem(Item *entry) { char buf[BUFSIZ], nl; @@ -472,7 +470,7 @@ selectitem(Item *entry) return entry->entry; } -void +static void delve(Item *hole) { Item *entry = hole; @@ -489,7 +487,7 @@ delve(Item *hole) } } -Item * +static Item * moldentry(char *url) { Item *entry;