diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-09-28 17:13:21 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-09-28 17:13:21 +0200 |
commit | 4ab19268268cd96b9706625d42a16d2a629134eb (patch) | |
tree | 0894a92709675955abb1b15647e8fe2911d89c7f /include | |
parent | 96cf8dffe4f7b0b910f790066ae622dc429eb522 (diff) |
update to version 25
Diffstat (limited to 'include')
-rw-r--r-- | include/alloc.h | 6 | ||||
-rw-r--r-- | include/base64.h | 6 | ||||
-rw-r--r-- | include/byte.h | 23 | ||||
-rw-r--r-- | include/cdbmake.h | 9 | ||||
-rw-r--r-- | include/constmap.h | 6 | ||||
-rw-r--r-- | include/exit.h | 8 | ||||
-rw-r--r-- | include/fifo.h | 8 | ||||
-rw-r--r-- | include/fmt.h | 14 | ||||
-rw-r--r-- | include/genalloc.h | 4 | ||||
-rw-r--r-- | include/getoptb.h | 4 | ||||
-rw-r--r-- | include/lock.h | 8 | ||||
-rw-r--r-- | include/ndelay.h | 8 | ||||
-rw-r--r-- | include/open.h | 8 | ||||
-rw-r--r-- | include/select.h | 2 | ||||
-rw-r--r-- | include/sig.h | 67 | ||||
-rw-r--r-- | include/str.h | 4 | ||||
-rw-r--r-- | include/uint_t.h | 24 | ||||
-rw-r--r-- | include/wait.h | 8 |
18 files changed, 115 insertions, 102 deletions
diff --git a/include/alloc.h b/include/alloc.h index 56a4a52..daac8a5 100644 --- a/include/alloc.h +++ b/include/alloc.h @@ -1,9 +1,9 @@ #ifndef ALLOC_H #define ALLOC_H -extern /*@null@*//*@out@*/char *alloc(); -extern void alloc_free(); -extern int alloc_re(); +extern void *alloc(unsigned int); +extern void alloc_free(void *); +extern int alloc_re(void **, unsigned int, unsigned int); /* use these names in the future */ #define qfree alloc_free diff --git a/include/base64.h b/include/base64.h index a9164c0..0f318c4 100644 --- a/include/base64.h +++ b/include/base64.h @@ -1,7 +1,9 @@ #ifndef BASE64_H #define BASE64_H -extern int b64decode(); -extern int b64encode(); +#include "stralloc.h" + +extern int b64decode(const unsigned char *in, int l, stralloc *out); +extern int b64encode(stralloc *in, stralloc *out); #endif diff --git a/include/byte.h b/include/byte.h index f437341..3ce3b31 100644 --- a/include/byte.h +++ b/include/byte.h @@ -2,19 +2,18 @@ #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 + * @authors djb, feh, jmh + * @ref s/qmail + */ -extern unsigned int byte_chr(); -extern unsigned int byte_rchr(); -extern void byte_copy(); -extern void byte_copyr(); -extern int byte_diff(); -extern void byte_zero(); -extern void byte_fill(); +extern unsigned int byte_chr(char *, unsigned int, int); +extern unsigned int byte_rchr(char *, unsigned int, int); +extern void byte_copy(void *, unsigned int, const void *); +extern void byte_copyr(void *, unsigned int, const void *); +extern int byte_diff(const void *, unsigned int, const void *); +extern void byte_zero(void *, unsigned int); +extern void byte_fill(void *, unsigned int, int); #define byte_equal(s,n,t) (!byte_diff((s),(n),(t))) diff --git a/include/cdbmake.h b/include/cdbmake.h index 9c20d2d..565e7ef 100644 --- a/include/cdbmake.h +++ b/include/cdbmake.h @@ -8,13 +8,16 @@ #define CDB_HPLIST 1000 -struct cdb_hp { uint32 h; uint32 p; } ; +struct cdb_hp { + uint32 h; + uint32 p; +}; struct cdb_hplist { struct cdb_hp hp[CDB_HPLIST]; struct cdb_hplist *next; int num; -} ; +}; struct cdb_make { char bspace[8192]; @@ -28,7 +31,7 @@ struct cdb_make { buffer b; uint32 pos; int fd; -} ; +}; extern int cdb_make_start(struct cdb_make *,int); extern int cdb_make_addbegin(struct cdb_make *,unsigned int,unsigned int); diff --git a/include/constmap.h b/include/constmap.h index 750702e..26d945d 100644 --- a/include/constmap.h +++ b/include/constmap.h @@ -11,11 +11,11 @@ struct constmap { int *next; char **input; int *inputlen; -} ; +}; int constmap_init(struct constmap *,char *,int,int); int constmap_init_char(struct constmap *,char *,int,int,char); -void constmap_free(); -char *constmap(); +void constmap_free(struct constmap *); +char *constmap(struct constmap *,char *,int); #endif diff --git a/include/exit.h b/include/exit.h index f74b741..e41b993 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 + * @ref qmail + * @brief convenience header */ extern void _exit(int); diff --git a/include/fifo.h b/include/fifo.h index 3c1bf68..d9a1b95 100644 --- a/include/fifo.h +++ b/include/fifo.h @@ -2,10 +2,10 @@ #define FIFO_H /** - @file fifo.h - @author djb, feh - @source s/qmail -*/ + * @file fifo.h + * @author djb + * @ref s/qmail + */ int fifo_make(char *,int); diff --git a/include/fmt.h b/include/fmt.h index 6e68d60..62eeefb 100644 --- a/include/fmt.h +++ b/include/fmt.h @@ -2,17 +2,17 @@ #define FMT_H /** - @file fmt.h - @author djb, kp, feh - @source qmail - @brief conversion function declarations - */ + * @file fmt.h + * @authors djb, kp, feh + * @ref 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 */ -extern unsigned int fmt_str(char *,char *); -extern unsigned int fmt_strn(char *,char *,unsigned int); +extern unsigned int fmt_str(char *,const char *); +extern unsigned int fmt_strn(char *,const char *,unsigned int); extern unsigned int fmt_uint(char *,unsigned int); extern unsigned int fmt_uint0(char *,unsigned int,unsigned int); extern unsigned int fmt_ulong(char *,unsigned long); diff --git a/include/genalloc.h b/include/genalloc.h index ee489af..aaa17f3 100644 --- a/include/genalloc.h +++ b/include/genalloc.h @@ -48,7 +48,7 @@ int ta_ready(x,n) register ta *x; register unsigned int n; \ i = x->a; \ if (n > i) { \ x->a = base + n + (n >> 3); \ - if (alloc_re(&x->field,i * sizeof(type),x->a * sizeof(type))) return 1; \ + if (alloc_re((void **)&x->field,i * sizeof(type),x->a * sizeof(type))) return 1; \ x->a = i; return 0; } \ return 1; } \ x->len = 0; \ @@ -61,7 +61,7 @@ int ta_rplus(x,n) register ta *x; register unsigned int n; \ i = x->a; n += x->len; \ if (n > i) { \ x->a = base + n + (n >> 3); \ - if (alloc_re(&x->field,i * sizeof(type),x->a * sizeof(type))) return 1; \ + if (alloc_re((void **)&x->field,i * sizeof(type),x->a * sizeof(type))) return 1; \ x->a = i; return 0; } \ return 1; } \ x->len = 0; \ diff --git a/include/getoptb.h b/include/getoptb.h index 0338a15..33e7cc4 100644 --- a/include/getoptb.h +++ b/include/getoptb.h @@ -2,6 +2,8 @@ #define BGETOPT_H /* + * Revision 20240731, Erwin Hoffmann + * - added getoptb() prototype * Revision 20160714, Kai Peter * - consolidated 'sgetopt.h' and 'subgetopt.h' into '(b)getopt.h' */ @@ -15,6 +17,8 @@ #define SUBGETOPTDONE -1 +extern int getoptb(int,char **,char *); + extern int subgetopt(int,char **,char *); extern char *subgetoptarg; extern int subgetoptind; diff --git a/include/lock.h b/include/lock.h index 74df4c9..71c01fa 100644 --- a/include/lock.h +++ b/include/lock.h @@ -2,10 +2,10 @@ #define LOCK_H /** - @file lock.h - @author djb, feh - @source s/qmail -*/ + * @file lock.h + * @author djb + * @ref s/qmail + */ int lock_ex(int); int lock_un(int); diff --git a/include/ndelay.h b/include/ndelay.h index 7a03a8d..4ef04c1 100644 --- a/include/ndelay.h +++ b/include/ndelay.h @@ -2,10 +2,10 @@ #define NDELAY_H /** - @brief ndelay.h - @author djb, feh - @source s/qmail -*/ + * @file ndelay.h + * @author djb + * @ref s/qmail + */ int ndelay_on(int); int ndelay_off(int); diff --git a/include/open.h b/include/open.h index 428ebfb..2629a4d 100644 --- a/include/open.h +++ b/include/open.h @@ -2,10 +2,10 @@ #define OPEN_H /** - @file open.h - @author djb, feh - @source s/qmail -*/ + * @file open.h + * @authors djb, feh + * @ref s/qmail + */ int open_read(const char *); int open_excl(const char *); diff --git a/include/select.h b/include/select.h index 646dd50..b2fe69e 100644 --- a/include/select.h +++ b/include/select.h @@ -8,6 +8,6 @@ #include <sys/select.h> #endif -extern int select(); +extern int select(int,fd_set *,fd_set *,fd_set *,struct timeval *); #endif diff --git a/include/sig.h b/include/sig.h index 3efdd32..b4879b8 100644 --- a/include/sig.h +++ b/include/sig.h @@ -2,6 +2,7 @@ #define SIG_H /* + * Revision 20240720, Erwin Hoffmann, jmh * Revision 20160714, Kai Peter * - updated some declarations no new(er) one's from ucspi-tcp-0.88 */ @@ -14,10 +15,10 @@ extern int sig_hangup; extern int sig_pipe; extern int sig_term; -extern void (*sig_defaulthandler)(); -extern void (*sig_ignorehandler)(); +extern void (*sig_defaulthandler)(int); +extern void (*sig_ignorehandler)(int); -extern void sig_catch(int,void (*)()); +extern void sig_catch(int,void (*)(int)); #define sig_ignore(s) (sig_catch((s),sig_ignorehandler)) #define sig_uncatch(s) (sig_catch((s),sig_defaulthandler)) @@ -29,35 +30,35 @@ extern void sig_pause(void); extern void sig_dfl(int); /* declaration of (net)qmail package (untouched) */ -extern void sig_miscignore(); -extern void sig_bugcatch(); - -extern void sig_pipeignore(); -extern void sig_pipedefault(); - -extern void sig_contblock(); -extern void sig_contunblock(); -extern void sig_contcatch(); -extern void sig_contdefault(); - -extern void sig_termblock(); -extern void sig_termunblock(); -extern void sig_termcatch(); -extern void sig_termdefault(); - -extern void sig_alarmblock(); -extern void sig_alarmunblock(); -extern void sig_alarmcatch(); -extern void sig_alarmdefault(); - -extern void sig_childblock(); -extern void sig_childunblock(); -extern void sig_childcatch(); -extern void sig_childdefault(); - -extern void sig_hangupblock(); -extern void sig_hangupunblock(); -extern void sig_hangupcatch(); -extern void sig_hangupdefault(); +extern void sig_miscignore(void); +extern void sig_bugcatch(void (*)(int)); + +extern void sig_pipeignore(void); +extern void sig_pipedefault(void); + +extern void sig_contblock(void); +extern void sig_contunblock(void); +extern void sig_contcatch(void (*)(int)); +extern void sig_contdefault(void); + +extern void sig_termblock(void); +extern void sig_termunblock(void); +extern void sig_termcatch(void (*)(int)); +extern void sig_termdefault(void); + +extern void sig_alarmblock(void); +extern void sig_alarmunblock(void); +extern void sig_alarmcatch(void (*)(int)); +extern void sig_alarmdefault(void); + +extern void sig_childblock(void); +extern void sig_childunblock(void); +extern void sig_childcatch(void (*)(int)); +extern void sig_childdefault(void); + +extern void sig_hangupblock(void); +extern void sig_hangupunblock(void); +extern void sig_hangupcatch(void (*)(int)); +extern void sig_hangupdefault(void); #endif diff --git a/include/str.h b/include/str.h index fe36d0b..4e3fc49 100644 --- a/include/str.h +++ b/include/str.h @@ -12,8 +12,8 @@ extern unsigned int str_copy(char *,const char *); extern unsigned int str_copyb(char *,const char *,unsigned int); extern int str_diff(const char *,const char *); extern int str_diffn(const char *,const char *,unsigned int); -//extern unsigned int str_len(char *); // --> this produces lot of warnings !!! -extern unsigned int str_len(); +extern unsigned int str_len(const char *); // --> this produces lot of warnings !!! +//extern unsigned int str_len(); extern unsigned int str_chr(const char *,int); extern unsigned int str_rchr(const char *,int); extern int str_start(const char *,const char *); diff --git a/include/uint_t.h b/include/uint_t.h index 84eb06e..aec9ed5 100644 --- a/include/uint_t.h +++ b/include/uint_t.h @@ -1,12 +1,12 @@ #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 + * @authors djb, kp, feh + * @ref qmail, djbdns6 + * @brief additional types and pack routines + * @brief define basic integer types and size through <stdint.h> + */ #ifndef UINT8_H #define UINT8_H @@ -17,6 +17,10 @@ typedef uint8_t uint8; typedef unsigned char uint8; #endif +extern void uint8_pack(char *,uint8); +extern void uint8_pack_big(char *,uint8); +extern void uint8_unpack(char *,uint8 *); +extern void uint8_unpack_big(char *,uint8 *); #endif #ifndef UINT16_H @@ -24,10 +28,10 @@ typedef unsigned char uint8; typedef uint16_t uint16; -extern void uint16_pack(char *,uint16); -extern void uint16_pack_big(char *,uint16); -extern void uint16_unpack(char *,uint16 *); -extern void uint16_unpack_big(char *,uint16 *); +extern void uint16_pack(char [16],uint16); +extern void uint16_pack_big(char [16],uint16); +extern void uint16_unpack(char [16],uint16 *); +extern void uint16_unpack_big(char [16],uint16 *); #endif #ifndef UINT32_H diff --git a/include/wait.h b/include/wait.h index f7cfc60..846b838 100644 --- a/include/wait.h +++ b/include/wait.h @@ -2,10 +2,10 @@ #define WAIT_H /** - @file wait.h - @author djb - @source s/qmail -*/ + * @file wait.h + * @author djb + * @ref s/qmail + */ int wait_pid(int *,int); int wait_nohang(int *); |