diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-09 15:50:21 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-09 15:50:21 +0200 |
commit | 795ffc5e62e8ba383575dbcd9943a580d4bd3358 (patch) | |
tree | c128889056202b255e2f22afeb7717894d350862 /include | |
parent | 5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (diff) |
formatting changes
Manual format adjustments.
Comment adjustments.
Remove usage of the register keyword.
Diffstat (limited to 'include')
-rw-r--r-- | include/buffer.h | 10 | ||||
-rw-r--r-- | include/byte.h | 8 | ||||
-rw-r--r-- | include/dnsresolv.h | 4 | ||||
-rw-r--r-- | include/env.h | 12 | ||||
-rw-r--r-- | include/error.h | 12 | ||||
-rw-r--r-- | include/exit.h | 8 | ||||
-rw-r--r-- | include/fifo.h | 6 | ||||
-rw-r--r-- | include/fmt.h | 10 | ||||
-rw-r--r-- | include/genalloc.h | 50 | ||||
-rw-r--r-- | include/getoptb.h | 6 | ||||
-rw-r--r-- | include/lock.h | 6 | ||||
-rw-r--r-- | include/ndelay.h | 6 | ||||
-rw-r--r-- | include/open.h | 6 | ||||
-rw-r--r-- | include/uint_t.h | 10 | ||||
-rw-r--r-- | include/wait.h | 6 |
15 files changed, 79 insertions, 81 deletions
diff --git a/include/buffer.h b/include/buffer.h index 4f513e7..b7e0c8a 100644 --- a/include/buffer.h +++ b/include/buffer.h @@ -1,5 +1,6 @@ #ifndef BUFFER_H #define BUFFER_H + #include <sys/types.h> /* need type: ssize_t */ typedef struct buffer { @@ -11,10 +12,11 @@ typedef struct buffer { } buffer; #define BUFFER_INIT(op, fd, buf, len) {(buf), 0, (len), (fd), (op)} -#define BUFFER_SMALL 256 -#define BUFFER_INSIZE 8192 -#define BUFFER_OUTSIZE 8192 -#define BUFFER_MTUSIZE 1450 + +#define BUFFER_SMALL 256 +#define BUFFER_INSIZE 8192 +#define BUFFER_OUTSIZE 8192 +#define BUFFER_MTUSIZE 1450 extern void buffer_init(buffer *, ssize_t (*op)(), int, char *, size_t); diff --git a/include/byte.h b/include/byte.h index 04337e8..3886127 100644 --- a/include/byte.h +++ b/include/byte.h @@ -2,10 +2,10 @@ #define BYTE_H /** - @file byte.h - @author djb, feh - @source s/qmail - @comment no declaration of argument types; too many compiler errors + @file byte.h + @author djb, feh + @source s/qmail + @comment no declaration of argument types; too many compiler errors */ extern unsigned int byte_chr(); diff --git a/include/dnsresolv.h b/include/dnsresolv.h index 0d01a87..ba388b5 100644 --- a/include/dnsresolv.h +++ b/include/dnsresolv.h @@ -22,7 +22,7 @@ * Revision 20180222, Erwin Hoffmann * - we consider in total 32 NS IPs (IPv4 + IPv6) * - added dns_transmit_start6 - * - added uint32 scope_ids[32], + * - added uint32 scope_ids[32], * the initial NS scopes read from /etc/resolv.conf et al. * Revision 20180118, Erwin Hoffmann * - included MSGSIZE for DNS messages (instead of MTUSIZE) @@ -31,7 +31,7 @@ * Revision 20170902, Erwin Hoffmann * - added old definitions from *qmail for (temp) backwards compatibility * - added more DNS RR definitions -*/ + */ #include "iopause.h" #include "stralloc.h" diff --git a/include/env.h b/include/env.h index 88566cf..26f44b5 100644 --- a/include/env.h +++ b/include/env.h @@ -2,12 +2,12 @@ #define ENV_H /* - * Revision 20171220, Erwin Hoffmann - * - removed variable names - * Revision 20160628, Kai Peter - * - updated code (*env_get) like in ucspi-tcp-0.88 - * - commented out 'env_pick' and 'env_clear' -*/ + * Revision 20171220, Erwin Hoffmann + * - removed variable names + * Revision 20160628, Kai Peter + * - updated code (*env_get) like in ucspi-tcp-0.88 + * - commented out 'env_pick' and 'env_clear' + */ extern char **environ; diff --git a/include/error.h b/include/error.h index 63132ff..0640d71 100644 --- a/include/error.h +++ b/include/error.h @@ -10,14 +10,14 @@ #define error_str(i) errstr(i) extern char *error_str(int); -/* Exception handling notes: +/* Exception handling notes: (1) system errors RECEIVED according to <errno.h> during operation and handed over (2) application errors DEFINED internally and ennumerated alongside with <errno.h> */ /* djb backwards compatibility - deprecated form of system errors */ -/* Comparison of error codes and constants: - intern Linux FreeBSD OmniOS */ +/* Comparison of error codes and constants: + intern Linux FreeBSD OmniOS */ #define error_intr EINTR /* -1 4 4 4 */ #define error_nomem ENOMEM /* -2 12 12 12 */ #define error_noent ENOENT /* -3 2 2 2 */ @@ -35,9 +35,9 @@ extern char *error_str(int); #define error_proto EPROTO /* -15 71 92 71 */ #define error_isdir EISDIR /* -16 21 21 21 */ #define error_connrefused ECONNREFUSED /* -17 111 61 146 */ -//extern int error_notdir; /* -18 20 20 20 */ -#define error_rofs EROFS /* -19 30 30 30 */ -#define error_connreset ECONNRESET /* -20 104 54 131 */ +#define error_rofs EROFS /* -19 30 30 30 */ +#define error_connreset ECONNRESET /* -20 104 54 131 */ +//extern int error_notdir; /* -18 20 20 20 */ /* djb uses some internal application error and class definitions -- revised (feh) */ #define CAT -10 /* raw message w/o terminating \n */ diff --git a/include/exit.h b/include/exit.h index f74b741..8e54239 100644 --- a/include/exit.h +++ b/include/exit.h @@ -2,10 +2,10 @@ #define EXIT_H /** - @file exit.h - @author djb, feh - @source qmail - @brief convenience header + @file exit.h + @author djb, feh + @source qmail + @brief convenience header */ extern void _exit(int); diff --git a/include/fifo.h b/include/fifo.h index 7e7e0f1..ad3d15e 100644 --- a/include/fifo.h +++ b/include/fifo.h @@ -2,9 +2,9 @@ #define FIFO_H /** - @file fifo.h - @author djb, feh - @source s/qmail + @file fifo.h + @author djb, feh + @source s/qmail */ int fifo_make(char *, int); diff --git a/include/fmt.h b/include/fmt.h index e6de428..eb8b8b8 100644 --- a/include/fmt.h +++ b/include/fmt.h @@ -2,11 +2,11 @@ #define FMT_H /** - @file fmt.h - @author djb, kp, feh - @source qmail - @brief conversion function declarations - */ + @file fmt.h + @author djb, kp, feh + @source qmail + @brief conversion function declarations +*/ #define FMT_ULONG 40 /* enough space to hold 2^128 - 1 in decimal, plus \0 */ #define FMT_LEN ((char *)0) /* convenient abbreviation */ diff --git a/include/genalloc.h b/include/genalloc.h index d27c6b1..351fb98 100644 --- a/include/genalloc.h +++ b/include/genalloc.h @@ -2,28 +2,31 @@ #define GENALLOC_H /* - * Revision 20210307, Erwin Hoffmann - * - -*/ + * Revision 20210307, Erwin Hoffmann + * - + */ #include <sys/types.h> -/* GEN_ALLOC demystified: - - GEN_ALLOC generates a list of self-defined types (structs) in an - allocated contiguous heap chunk while copying the content of the - entire field members or appending the existing field. - GEN_ALLOC types care of currently used and/or allocated bytes of field. +#include "alloc.h" + +/* + GEN_ALLOC demystified: -Macros: - GEN_ALLOC_ready (ta,type,field,len,a,i,n,x,base,ta_ready) - GEN_ALLOC_readyplus(ta,type,field,len,a,i,n,x,base,ta_rplus) - GEN_ALLOC_append (ta,type,field,len,a,i,n,x,base,ta_rplus,ta_append) + GEN_ALLOC generates a list of self-defined types (structs) in an + allocated contiguous heap chunk while copying the content of the + entire field members or appending the existing field. + GEN_ALLOC types care of currently used and/or allocated bytes of field. + + Macros: + GEN_ALLOC_ready (ta,type,field,len,a,i,n,x,base,ta_ready) + GEN_ALLOC_readyplus(ta,type,field,len,a,i,n,x,base,ta_rplus) + GEN_ALLOC_append (ta,type,field,len,a,i,n,x,base,ta_rplus,ta_append) 0. ta: 'type alloc' - typedef'ed struct name (aka ipalloc et al.) - 1. type: defined struct (used for size information) + 1. type: defined struct (used for size information) 2. field: declared public name of struct - 2. len: used length of string + 2. len: used length of string 4. a: allocated size 5. i: current allocated size for member x 6. n: bytes to allocate; in 'ready' mode: +size of one entry; @@ -32,7 +35,6 @@ Macros: 8. base: size of single entry 9. ta_ready/ta_readyplus (operation) 10. ta_append (operation) - */ /* file: gen_alloc.h */ @@ -46,11 +48,9 @@ Macros: /* file: gen_allocdefs.h (deprecated) */ // used in: ipalloc, prioq, qmail-remote, qmail-inject, token822 #define GEN_ALLOC_ready(ta, type, field, len, a, i, n, x, base, ta_ready) \ - int ta_ready(x, n) \ - register ta *x; \ - register unsigned int n; \ + int ta_ready(ta *x, unsigned int n) \ { \ - register unsigned int i; \ + unsigned int i; \ if (x->field) { \ i = x->a; \ if (n > i) { \ @@ -66,11 +66,9 @@ Macros: } #define GEN_ALLOC_readyplus(ta, type, field, len, a, i, n, x, base, ta_rplus) \ - int ta_rplus(x, n) \ - register ta *x; \ - register unsigned int n; \ + int ta_rplus(ta *x, unsigned int n) \ { \ - register unsigned int i; \ + unsigned int i; \ if (x->field) { \ i = x->a; \ n += x->len; \ @@ -87,9 +85,7 @@ Macros: } #define GEN_ALLOC_append(ta, type, field, len, a, i, n, x, base, ta_rplus, ta_append) \ - int ta_append(x, i) \ - register ta *x; \ - register type *i; \ + int ta_append(ta *x, type *i) \ { \ if (!ta_rplus(x, 1)) return 0; \ x->field[x->len++] = *i; \ diff --git a/include/getoptb.h b/include/getoptb.h index 61fa7aa..426567d 100644 --- a/include/getoptb.h +++ b/include/getoptb.h @@ -2,9 +2,9 @@ #define BGETOPT_H /* - * Revision 20160714, Kai Peter - * - consolidated 'sgetopt.h' and 'subgetopt.h' into '(b)getopt.h' -*/ + * Revision 20160714, Kai Peter + * - consolidated 'sgetopt.h' and 'subgetopt.h' into '(b)getopt.h' + */ #define optarg subgetoptarg #define optind subgetoptind diff --git a/include/lock.h b/include/lock.h index 74df4c9..6abecb7 100644 --- a/include/lock.h +++ b/include/lock.h @@ -2,9 +2,9 @@ #define LOCK_H /** - @file lock.h - @author djb, feh - @source s/qmail + @file lock.h + @author djb, feh + @source s/qmail */ int lock_ex(int); diff --git a/include/ndelay.h b/include/ndelay.h index 7a03a8d..6791c5b 100644 --- a/include/ndelay.h +++ b/include/ndelay.h @@ -2,9 +2,9 @@ #define NDELAY_H /** - @brief ndelay.h - @author djb, feh - @source s/qmail + @brief ndelay.h + @author djb, feh + @source s/qmail */ int ndelay_on(int); diff --git a/include/open.h b/include/open.h index 428ebfb..c2f272b 100644 --- a/include/open.h +++ b/include/open.h @@ -2,9 +2,9 @@ #define OPEN_H /** - @file open.h - @author djb, feh - @source s/qmail + @file open.h + @author djb, feh + @source s/qmail */ int open_read(const char *); diff --git a/include/uint_t.h b/include/uint_t.h index aba0f38..7bf32c8 100644 --- a/include/uint_t.h +++ b/include/uint_t.h @@ -1,11 +1,11 @@ #include <stdint.h> /** - @file uint_t.h - @author djb, kp, feh - @source qmail, djbdns6 - @brief additional types and pack routines - @brief define basic integer types and size through <stdint.h> + @file uint_t.h + @author djb, kp, feh + @source qmail, djbdns6 + @brief additional types and pack routines + @brief define basic integer types and size through <stdint.h> */ #ifndef UINT8_H diff --git a/include/wait.h b/include/wait.h index af8a979..dd059d9 100644 --- a/include/wait.h +++ b/include/wait.h @@ -2,9 +2,9 @@ #define WAIT_H /** - @file wait.h - @author djb - @source s/qmail + @file wait.h + @author djb + @source s/qmail */ int wait_pid(int *, int); |