chiark / gitweb /
Add innduct-forall
[innduct.git] / innduct.h
index 00be640f73a33aca2e15ab2202cee214d6dab8df..5a337cde6b5b55b8f3010c32dba444de1a8c35e6 100644 (file)
--- a/innduct.h
+++ b/innduct.h
 
 #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 +186,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                */
@@ -327,7 +329,8 @@ char *xasprintf(const char *fmt, ...) PRINTF(1,2);
 int close_perhaps(int *fd);
 void xclose(int fd, const char *what, const char *what2);
 void xclose_perhaps(int *fd, const char *what, const char *what2);
-pid_t xfork(const char *what);
+pid_t xfork(const char *what); /* also runs postfork in child */
+pid_t xfork_bare(const char *what);
 
 void on_fd_read_except(int fd, oop_call_fd callback);
 void cancel_fd_read_except(int fd);