home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / s / slurp103.zip / SLURP.H < prev    next >
C/C++ Source or Header  |  1992-12-20  |  3KB  |  138 lines

  1. /*
  2.  * slurp.h - common definitions for slurp
  3.  *
  4.  * Copyright (C) 1992 Stephen Hebditch. All rights reserved.
  5.  * TQM Communications, BCM Box 225, London, WC1N 3XX.
  6.  * steveh@orbital.demon.co.uk  +44 836 825962
  7.  *
  8.  * See README for more information and disclaimers
  9.  *
  10.  * 1.00  29 Sep 92  SH  Initial coding.
  11.  * 1.01   6 Dec 92  SH  Added no_time_flag
  12.  * 1.03  15 Dec 92  SH  Added SYS_ERRLIST
  13.  *
  14.  */
  15.  
  16. /* Local header files */
  17.  
  18. #include "conf.h"
  19. #include "nntp.h"
  20.  
  21.  
  22. /* Standard header files */
  23.  
  24. #include <sys/types.h>
  25. #include <stdio.h>
  26. #include <stdlib.h>
  27. #include <limits.h>
  28. #include <ctype.h>
  29.  
  30. #ifdef SYSLOG
  31.   #ifdef FAKESYSLOG
  32.     #include "fakesyslog.h"
  33.   #else
  34.     #include <syslog.h>
  35.   #endif
  36. #endif
  37.  
  38. #ifdef USG
  39.   #include <string.h>
  40.   #include <time.h>
  41. #else
  42.   #include <strings.h>
  43.   #include <sys/time.h>
  44. #endif
  45.  
  46.  
  47. /* Important variables */
  48.  
  49. extern char *hostname;        /* Name of current NNTP server host */
  50. extern char *pname;            /* Name of this program */
  51. extern int  debug_flag;        /* Write extra debugging output to screen */
  52. extern int  no_time_flag;    /* Don't update slurp.tim */
  53.  
  54. /* Article counters */
  55.  
  56. extern int  dupart;            /* Number of duplicate articles */
  57. extern int  misart;            /* Number of missing articles */
  58. extern int  newart;            /* Number of new articles */
  59.  
  60. extern long totalsize;        /* Total size of articles tranferred */
  61.  
  62. /* Details for NEWNEWS */
  63.  
  64. extern char *nn_newsgroups;
  65. extern char *nn_time;
  66. extern char *nn_distributions;
  67.  
  68. /* Binary tree holding message ids */
  69.  
  70. struct mnode
  71.     {
  72.     struct mnode *left;
  73.     struct mnode *right;
  74.     char msgid [MSGIDMAX];
  75.     };
  76.                           
  77. extern struct mnode *root;
  78. extern int entries;
  79.  
  80.  
  81. /* Slurp function prototypes */
  82.  
  83. extern int  open_history ();                        /* history.c */
  84. extern void close_history ();
  85. extern int  check_id (char *message_id);
  86.  
  87. extern long server_time ();                            /* time.c */
  88.  
  89. extern void get_ids ();                                /* newnews.c */
  90.  
  91. extern void get_articles ();                        /* articles.c */
  92. extern void enqueue_batch ();
  93.  
  94. extern int  space (int min_free);                    /* space.c */
  95.  
  96. extern int  tcp_open (char *host, char *service);    /* sockets.c */
  97. extern int  server_init (char *hostname);
  98. extern void close_server ();
  99. extern int  get_server (char *buf, int size);
  100. extern void put_server (char *buf);
  101.  
  102. extern void log_ret (const char *fmt, ...);            /* misc.c */
  103. extern void log_sys (const char *fmt, ...);
  104. extern void log_msg (const char *fmt, ...);
  105.  
  106.  
  107. /* The inevitable... */
  108.  
  109. #if !defined(TRUE) || ((TRUE) != 1)
  110.   #define TRUE (1)
  111. #endif
  112.  
  113. #if !defined(FALSE) || ((FALSE) != 0)
  114.   #define FALSE (0)
  115. #endif
  116.  
  117. #ifdef USG
  118.   #define FCNTL
  119.   #ifndef bcopy
  120.     #define bcopy(a,b,c) (void)memcpy((char*)b,(char*)a,(int)c)
  121.   #endif
  122.   #ifndef bzero
  123.     #define bzero(a,b) (void)memset((char*)a,0,(int)b)
  124.   #endif
  125. #endif
  126.  
  127. #ifndef PATH_MAX
  128.   #define PATH_MAX 1024
  129. #endif
  130.  
  131. #ifdef SYS_ERRLIST
  132.   extern const char sys_errlist[];
  133.   #define strerror(x) (sys_errlist[x])
  134. #endif
  135.  
  136.  
  137. /* END-OF-FILE */
  138.