chiark / gitweb /
split program compiles
[inn-innduct.git] / xmit.c
diff --git a/xmit.c b/xmit.c
index dd909e41128a20d6e6df89b0ba4a1a1fba8b67d6..4f873f3872300466566b4b7177afa0d6142f5c49 100644 (file)
--- a/xmit.c
+++ b/xmit.c
@@ -1,3 +1,34 @@
+/*
+ *  innduct
+ *  tailing reliable realtime streaming feeder for inn
+ *  xmit.c - transmitting checks and articles, flow control, expiry
+ *
+ *  Copyright (C) 2010 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ * 
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ * 
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  (I believe that when you compile and link this as part of the inn2
+ *  build, with the Makefile runes I have provided, all the libraries
+ *  and files which end up included in innduct are licence-compatible
+ *  with GPLv3.  If not then please let me know.  -Ian Jackson.)
+ */
+
+#include "innduct.h"
+
+const char *const artstate_names[]=
+  { "Unchecked", "Wanted", "Unsolicited", 0 };
+
 /*---------- assigning articles to conns, and transmitting ----------*/
 
 static Article *dequeue_from(int peek, InputFile *ipf) {
@@ -18,7 +49,7 @@ static Article *dequeue(int peek) {
   return 0;
 }
 
-static void check_assign_articles(void) {
+void check_assign_articles(void) {
   for (;;) {
     if (!dequeue(1))
       break;
@@ -66,7 +97,7 @@ static void *conn_writeable(oop_source *l, int fd, oop_event ev, void *u) {
   return OOP_CONTINUE;
 }
 
-static void conn_maybe_write(Conn *conn)  {
+void conn_maybe_write(Conn *conn) {
   for (;;) {
     conn_make_some_xmits(conn);
     if (!conn->xmitu) {
@@ -114,14 +145,14 @@ static void conn_maybe_write(Conn *conn)  {
  *     pause/resume inputfile tailing
  */
 
-static void check_reading_pause_resume(InputFile *ipf) {
+void check_reading_pause_resume(InputFile *ipf) {
   if (ipf->queue.count >= max_queue_per_ipf)
     inputfile_reading_pause(ipf);
   else
     inputfile_reading_resume(ipf);
 }
 
-static void article_defer(Article *art /* not on a queue */, int whichcount) {
+void article_defer(Article *art /* not on a queue */, int whichcount) {
   open_defer();
   if (fprintf(defer, "%s %s\n", TokenToText(art->token), art->messageid) <0
       || fflush(defer))
@@ -129,7 +160,7 @@ static void article_defer(Article *art /* not on a queue */, int whichcount) {
   article_done(art, whichcount);
 }
 
-static int article_check_expired(Article *art /* must be queued, not conn */) {
+int article_check_expired(Article *art /* must be queued, not conn */) {
   ARTHANDLE *artdata= SMretrieve(art->token, RETR_STAT);
   if (artdata) { SMfreearticle(artdata); return 0; }
 
@@ -151,7 +182,7 @@ void inputfile_queue_check_expired(InputFile *ipf) {
   check_reading_pause_resume(ipf);
 }
 
-static void article_autodefer(InputFile *ipf, Article *art) {
+void article_autodefer(InputFile *ipf, Article *art) {
   ipf->autodefer++;
   article_defer(art,-1);
 }
@@ -169,7 +200,7 @@ static void autodefer_input_file_articles(InputFile *ipf) {
     article_autodefer(ipf, art);
 }
 
-static void autodefer_input_file(InputFile *ipf) {
+void autodefer_input_file(InputFile *ipf) {
   static const char *const abandon= "stuck";
   ipf->autodefer= 0;
 
@@ -220,7 +251,7 @@ static void xmit_artbody(Conn *conn, ARTHANDLE *ah /* consumed */) {
   d->info.sm_art= ah;
 }
 
-static void xmit_free(XmitDetails *d) {
+void xmit_free(XmitDetails *d) {
   switch (d->kind) {
   case xk_Artdata: SMfreearticle(d->info.sm_art); break;
   case xk_Const:                                  break;
@@ -228,7 +259,7 @@ static void xmit_free(XmitDetails *d) {
   }
 }
 
-static void *conn_write_some_xmits(Conn *conn) {
+void *conn_write_some_xmits(Conn *conn) {
   /* return values:
    *      0:            nothing more to write, no need to call us again
    *      OOP_CONTINUE: more to write but fd not writeable
@@ -270,7 +301,7 @@ static void *conn_write_some_xmits(Conn *conn) {
   }
 }
 
-static void conn_make_some_xmits(Conn *conn) {
+void conn_make_some_xmits(Conn *conn) {
   for (;;) {
     if (conn->xmitu+5 > CONNIOVS)
       break;