home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / PLST_132.SZH / TYPES.H < prev   
Text File  |  1991-04-11  |  8KB  |  253 lines

  1. /*
  2.                               Nodelist Parser
  3.  
  4.               This module was originally written by Bob Hartman
  5.                        Sysop of FidoNet node 1:132/101
  6.  
  7.    Spark Software, 427-3 Amherst St, CS 2032, Suite 232, Nashua, NH 03061
  8.  
  9.  This program source code is being released with the following provisions:
  10.  
  11.  1.  You are  free to make  changes to this source  code for use on your own
  12.  machine,  however,  altered source files may not be distributed without the
  13.  consent of Spark Software.
  14.  
  15.  2.  You may distribute "patches"  or  "diff" files for any changes that you
  16.  have made, provided that the "patch" or "diff" files are also sent to Spark
  17.  Software for inclusion in future releases of the entire package.   A "diff"
  18.  file for the source archives may also contain a compiled version,  provided
  19.  it is  clearly marked as not  being created  from the original source code.
  20.  No other  executable  versions may be  distributed without  the  consent of
  21.  Spark Software.
  22.  
  23.  3.  You are free to include portions of this source code in any program you
  24.  develop, providing:  a) Credit is given to Spark Software for any code that
  25.  may is used, and  b) The resulting program is free to anyone wanting to use
  26.  it, including commercial and government users.
  27.  
  28.  4.  There is  NO  technical support  available for dealing with this source
  29.  code, or the accompanying executable files.  This source  code  is provided
  30.  as is, with no warranty expressed or implied (I hate legalease).   In other
  31.  words, if you don't know what to do with it,  don't use it,  and if you are
  32.  brave enough to use it, you're on your own.
  33.  
  34.  Spark Software may be contacted by modem at (603) 888-8179 (node 1:132/101)
  35.  on the public FidoNet network, or at the address given above.
  36.  
  37. */
  38.  
  39. typedef struct SC {
  40.    int zone;
  41.    int net;
  42.    int node;
  43.    char *script;
  44.    struct SC *next;
  45. } SCTR, *SCTRP;
  46.  
  47. typedef struct PW {
  48.    int zone;
  49.    int net;
  50.    int node;
  51.    char *pw;
  52.    struct PW *next;
  53. } PWTR, *PWTRP;
  54.  
  55. typedef struct PH {
  56.    int zone;
  57.    int net;
  58.    int node;
  59.    char *num;
  60.    struct PH *next;
  61. } PHTR, *PHTRP;
  62.  
  63. typedef struct BD {
  64.    int zone;
  65.    int net;
  66.    int node;
  67.    int baud;
  68.    struct BD *next;
  69. } BDTR, *BDTRP;
  70.  
  71. typedef struct DL {
  72.    char *mstr;
  73.    int mlen;
  74.    char *pre;
  75.    char *post;
  76.    struct DL *next;
  77. } DLTR, *DLTRP;
  78.  
  79. typedef struct CO {
  80.    char *mstr;
  81.    int mlen;
  82.    int cost;
  83.    int baud;
  84.    struct CO *next;
  85. } COTR, *COTRP;
  86.  
  87. typedef struct FN {
  88.    char *fname;
  89.    int private;
  90.    struct FN *next;
  91. } FNLST, *FNLSTP;
  92.  
  93. typedef struct ET {
  94.    int zone;
  95.    int net;
  96.    int node;
  97.    char etype;
  98.    struct ET *next;
  99. } ETTR, *ETTRP;
  100.  
  101. typedef struct CM {
  102.    int zone;
  103.    int net;
  104.    int node;
  105.    struct CM *next;
  106. } CMTR, *CMTRP;
  107.  
  108.   struct _oldnode {
  109.     int number;         /* node number */
  110.     int net;            /* net number */
  111.     int cost;           /* cost per minute to call */
  112.     int rate;           /* baud rate */
  113.     char name[20];          /* node name */
  114.     char phone[40];         /* phone number */
  115.     char city[40];          /* city and state */
  116.    };
  117.  
  118.   struct _node {
  119.     int  net;               /* net number */
  120.     int  number;           /* node number, */
  121.     int  cost;              /* cost per minute to call */
  122.     char name[34];         /* node name */
  123.     char phone[40];        /* phone number */
  124.     char city[30];         /* city and state, */
  125.  
  126.     char password[8];      /* warning, not necessarily null terminated */
  127.     int  realcost;        /* phone company's charge */
  128.     int  hubnode;          /* node # of this node's hub or 0 if none */
  129.     unsigned char rate;    /* actual baud rate divided by 300 */
  130.     char modem;              /* modem type code (see below) */
  131.     unsigned int flags1;   /* set of flags (see below) */
  132.     int  reserved;         /* reserved */
  133.    };
  134.  
  135. #ifndef OS2
  136. #define BIGSIZE 8192
  137. #endif
  138.  
  139. /*------------------------------------------------------------------------*/
  140. /* Values for the `flags1' field                                          */
  141. /*------------------------------------------------------------------------*/
  142. #define B_hub      0x0001  /* node is a net hub       0000 0000 0000 0001 */
  143. #define B_host     0x0002  /* node is a net host      0000 0000 0000 0010 */
  144. #define B_region   0x0004  /* node is region coord    0000 0000 0000 0100 */
  145. #define B_zone     0x0008  /* node is a zone coord    0000 0000 0000 1000 */
  146. #define B_CM       0x0010  /* runs continuous mail    0000 0000 0001 0000 */
  147. #define B_ores1    0x0020  /* reserved for Opus       0000 0000 0010 0000 */
  148. #define B_ores2    0x0040  /* reserved for Opus       0000 0000 0100 0000 */
  149. #define B_ores3    0x0080  /* reserved for Opus       0000 0000 1000 0000 */
  150. #define B_ores4    0x0100  /* reserved for Opus       0000 0001 0000 0000 */
  151. #define B_ores5    0x0200  /* reserved for Opus       0000 0010 0000 0000 */
  152. #define B_res1     0x0400  /* reserved for non-Opus   0000 0100 0000 0000 */
  153. #define B_res2     0x0800  /* reserved for non-Opus   0000 1000 0000 0000 */
  154. #define B_res3     0x1000  /* reserved for non-Opus   0001 0000 0000 0000 */
  155. #define B_res4     0x2000  /* reserved for non-Opus   0010 0000 0000 0000 */
  156. #define B_res5     0x4000  /* reserved for non-Opus   0100 0000 0000 0000 */
  157. #define B_res6     0x8000  /* reserved for non-Opus   1000 0000 0000 0000 */
  158.  
  159. /*------------------------------------------------------------------------*/
  160. /* Values for the `modem' field                                           */
  161. /*------------------------------------------------------------------------*/
  162. #define M_HST      0x01    /* node uses an HST                  0000 0001 */
  163. #define M_PEP      0x02    /* node uses a PEP modem             0000 0010 */
  164. #define M_V32      0x04    /* node uses a V.32 modem            0000 0100 */
  165. #define M_V32B     0x08    /* node uses a V.32b modem           0000 1000 */
  166. #define M_H96      0x10    /* node uses a Hayes V9600           0001 0000 */
  167.  
  168. /*--------------------------------------------------------------------------*/
  169. /* Nodelist.Idx                                                             */
  170. /* (File is terminated by EOF)                                              */
  171. /*--------------------------------------------------------------------------*/
  172. struct _ndi {
  173.       int   node;          /* node number  */
  174.       int   net;           /* net number   */
  175. };
  176.  
  177. /* SEAdog NETLIST.DOG format */
  178. struct netls {
  179.    int netnum;
  180.    char netname[14];
  181.    char netcity[40];
  182.    int havehost;
  183.    int nethost;
  184.    int havegate;
  185.    int netgate;
  186.    long nodeptr;
  187.    int numnodes;
  188. };
  189.  
  190. /* SEAdog NODELIST.DOG format */
  191. struct nodels {
  192.    int nodenum;
  193.    char nodename[14];
  194.    char nodecity[40];
  195.    char nodephone[40];
  196.    int havehub;
  197.    int nodehub;
  198.    int nodecost;
  199.    int nodebaud;
  200. };
  201.  
  202. /* SEAdog INDEX.DOG format */
  203. struct nidxs {
  204.    int idxnet;
  205.    int idxnode;
  206.    long netlptr;
  207.    long nodelptr;
  208.    long idxspace;
  209. };
  210.  
  211. /* Things most nodelists don't contain, but Binkley likes to have */
  212. struct extrastuff {
  213.    char password[8];
  214.    unsigned int flags1;
  215.    char extra[6]; /* for future expansion */
  216. };
  217.  
  218. /* QuickBBS v2.01 QNL_IDX.BBS format */
  219. struct qidx {
  220.    int zone;
  221.    int net;
  222.    int node;
  223.    char nodetype;
  224. };
  225.  
  226. /* QuickBBS v2.01 QNL_DAT.BBS format */
  227. struct qdat {
  228.    char nodetype;
  229.    int zone;
  230.    int net;
  231.    int node;
  232.    char namesize;
  233.    char name[20];
  234.    char citysize;
  235.    char city[40];
  236.    char phonesize;
  237.    char phone[40];
  238.    char passwordsize;
  239.    char password[8];
  240.    unsigned int flags;
  241.    int baudrate;
  242.    int cost;
  243. };
  244.  
  245. /* Used for low-level I/O routines */
  246. typedef struct {
  247.    char far *wbuff;
  248.    char far *wptr;
  249.    unsigned int wsize;
  250. } WBUFFER, *WBUFFPTR;
  251.  
  252.  
  253.