X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=innduct.git;a=blobdiff_plain;f=innduct.h;h=231524d04b0fdaaa54d5687fe10d474a66f71904;hp=ddd17e69c59050b979bec2e8c131bd4869e11221;hb=a34c62479ae1f91aac7b30d3d5f1a5106a6635f5;hpb=bcec484fa50155589573470c14fe63fc94d6438a diff --git a/innduct.h b/innduct.h index ddd17e6..231524d 100644 --- a/innduct.h +++ b/innduct.h @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -71,7 +72,7 @@ #define INNDCOMMCHILD_ESTATUS_FAIL 26 #define INNDCOMMCHILD_ESTATUS_NONESUCH 27 -#define MAX_LINE_FEEDFILE (NNTP_MSGID_MAXLEN + sizeof(TOKEN)*2 + 10) +#define MAX_LINE_FEEDFILE (NNTP_MAXLEN_MSGID + sizeof(TOKEN)*2 + 10) #define MAX_CLI_COMMAND 1000 #define VA va_list al; va_start(al,fmt) @@ -84,8 +85,10 @@ #define DUMPV(fmt,pfx,v) fprintf(f, " " #v "=" fmt, pfx v); -#define FOR_CONN(conn) \ - for ((conn)=LIST_HEAD(conns); (conn); (conn)=LIST_NEXT((conn))) +#define FOR_LIST_NODE(nodevar, list) \ + for ((nodevar)=LIST_HEAD(list); (nodevar); (nodevar)=LIST_NEXT((nodevar))) + +#define FOR_CONN(conn) FOR_LIST_NODE(conn, conns) /*----- doubly linked lists -----*/ @@ -184,7 +187,7 @@ extern double max_bad_data_ratio; extern int max_bad_data_initial; -/*----- statistics -----*/ +/*----- article states, and statistics -----*/ typedef enum { /* in queue in conn->sent */ art_Unchecked, /* not checked, not sent checking */ @@ -321,8 +324,8 @@ void dbg(const char *fmt, ...) PRINTF(1,2); void logv(int sysloglevel, const char *pfx, int errnoval, const char *fmt, va_list al) PRINTF(5,0); -char *xvasprintf(const char *fmt, va_list al) PRINTF(1,0); -char *xasprintf(const char *fmt, ...) PRINTF(1,2); +char *mvasprintf(const char *fmt, va_list al) PRINTF(1,0); +char *masprintf(const char *fmt, ...) PRINTF(1,2); int close_perhaps(int *fd); void xclose(int fd, const char *what, const char *what2); @@ -366,7 +369,7 @@ static inline int isewouldblock(int errnoval) { INNLOGSET(die, "fatal", LOG_ERR) \ INNLOGSET(warn, "warning", LOG_WARNING) \ INNLOGSET(notice, "notice", LOG_NOTICE) \ - INNLOGSET(trace, "trace", LOG_NOTICE) + INNLOGSET(debug, "debug", LOG_DEBUG) #define INNLOGSET_DECLARE(fn, pfx, sysloglevel) \ void duct_log_##fn(int l, const char *fmt, va_list al, int errval) \ PRINTF(3,0);