home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / SBBS1B00.ZIP / XTRN.EXE / XTRN / SDK / XSDKDEFS.H < prev    next >
C/C++ Source or Header  |  1992-09-02  |  6KB  |  154 lines

  1. /* XSDKDEFS.H */
  2.  
  3. #ifndef _XSDKDEFS_H
  4. #define _XSDKDEFS_H
  5.  
  6. /**********/
  7. /* Macros */
  8. /**********/
  9.                             /* Various Character/Ctrl-Code Definitions    */
  10. #define SP            32        /* Space bar                                */
  11. #define ESC            27        /* ESC Char                                 */
  12. #define    CR            13        /* Carriage Return                            */
  13. #define FF          12      /* Form Feed                                */
  14. #define    LF            10        /* Line Feed                                */
  15. #define TAB            9        /* Horizontal Tabulation                    */
  16. #define BS            8        /* Back Space                                */
  17. #define STX         2        /* Start of text                            */
  18. #define ETX         3       /* End of text                              */
  19.  
  20. #define DCD    0x8000        /* Data carrier detect bit in msr            */
  21.  
  22. #define TABSIZE     4        /* Tabs will expand to 4 chars upon input    */
  23.  
  24. #define SAVE_LINES     4        /* Maximum number of lines to save            */
  25. #define LINE_BUFSIZE 512    /* Size of line output buffer               */
  26.  
  27. #define HIGH 8                /* High intensity attribute bit */
  28.  
  29.                             /* user_misc bits */
  30. #define ANSI    (1<<0)        /* user has ANSI capability */
  31. #define COLOR    (1<<1)        /* user has monochrome ANSI display */
  32.  
  33. #ifndef uchar                /* Short-hand for unsigned data types */
  34. #define uchar unsigned char
  35. #endif
  36. #ifndef uint
  37. #define uint unsigned int
  38. #endif
  39. #ifndef ulong
  40. #define ulong unsigned long
  41. #endif
  42.  
  43.                             /* Bits in 'mode' for getkey and getstr     */
  44. #define K_UPPER        (1<<0)    /* Converts all letters to upper case         */
  45. #define K_UPRLWR    (1<<1)  /* Upper/Lower case automatically           */
  46. #define K_NUMBER    (1<<2)  /* Allow numbers only                       */
  47. #define K_WRAP        (1<<3)  /* Allows word wrap                            */
  48. #define K_MSG        (1<<4)  /* Allows ANSI, ^N ^A ^G                    */
  49. #define K_SPIN      (1<<5)  /* Spinning cursor (same as SPIN)           */
  50. #define K_LINE      (1<<6)  /* Input line (inverse color)               */
  51. #define K_EDIT      (1<<7)  /* Edit string passed                       */
  52. #define K_CHAT        (1<<8)    /* In chat multi-chat                         */
  53. #define K_NOCRLF    (1<<9)    /* Don't print CRLF after string input      */
  54. #define K_ALPHA     (1<<10) /* Only allow alphabetic characters         */
  55.  
  56.                             /* Miscellaneous Modem Settings (mdm_misc)    */
  57. #define MDM_FLOWCTRL (1<<0)    /* Use flow control with modem                */
  58. #define MDM_STAYHIGH (1<<1) /* Stay at highest DTE rate                 */
  59.  
  60. #define LOOP_NOPEN   50        /* Retries before file access denied        */
  61. #define LOOP_NODEDAB 100    /* Retries on NODE.DAB locking/unlocking    */
  62.  
  63. #define MAX_NODES    250     /* Maximum number of nodes                    */
  64.  
  65. enum {                                /* Node Status */
  66.      NODE_WFC                        /* Waiting for Call */
  67.     ,NODE_LOGON                      /* at logon prompt */
  68.     ,NODE_NEWUSER                     /* New user applying */
  69.     ,NODE_INUSE                         /* In Use */
  70.     ,NODE_QUIET                         /* In Use - quiet mode */
  71.     ,NODE_OFFLINE                     /* Offline */
  72.     ,NODE_NETTING                     /* Networking */
  73.     ,NODE_EVENT_WAITING                /* Waiting for all nodes to be inactive */
  74.     ,NODE_EVENT_RUNNING                /* Running an external event */
  75.     ,NODE_EVENT_LIMBO                /* Allowing another node to run an event */
  76.     };
  77.  
  78.                                     /* Bit values for node.misc */
  79. #define    NODE_ANON    (1<<0)            /* Anonymous User */
  80. #define    NODE_LOCK    (1<<1)            /* Locked for sysops only */
  81. #define    NODE_INTR    (1<<2)            /* Interrupted - hang up */
  82. #define NODE_MSGW   (1<<3)            /* Message is waiting */
  83. #define NODE_POFF   (1<<4)            /* Page disabled */
  84. #define NODE_AOFF    (1<<5)            /* Activity Alert disabled */
  85. #define NODE_UDAT    (1<<6)            /* User data has been updated */
  86. #define NODE_RRUN    (1<<7)            /* Re-run this node when log off */
  87. #define NODE_EVENT    (1<<8)            /* Must run node event after log off */
  88. #define NODE_DOWN    (1<<9)            /* Down this node after logoff */
  89.  
  90. enum {                                /* Node Action */
  91.      NODE_MAIN                        /* Main Prompt */
  92.     ,NODE_RMSG                         /* Reading Messages */
  93.     ,NODE_RMAL                        /* Reading Mail */
  94.     ,NODE_SMAL                         /* Sending Mail */
  95.     ,NODE_RTXT                         /* Reading G-Files */
  96.     ,NODE_RSML                         /* Reading Sent Mail */
  97.     ,NODE_PMSG                         /* Posting Message */
  98.     ,NODE_AMSG                         /* Auto-message */
  99.     ,NODE_XTRN                          /* Running External Program */
  100.     ,NODE_DFLT                          /* Main Defaults Section */
  101.     ,NODE_XFER                           /* Transfer Prompt */
  102.     ,NODE_DLNG                        /* Downloading File */
  103.     ,NODE_ULNG                        /* Uploading File */
  104.     ,NODE_BXFR                        /* Bidirectional Transfer */
  105.     ,NODE_LFIL                        /* Listing Files */
  106.     ,NODE_LOGN                        /* Logging on */
  107.     ,NODE_LCHT                        /* In Local Chat with Sysop */
  108.     ,NODE_MCHT                         /* In Multi-Chat with Other Nodes */
  109.     ,NODE_GCHT                           /* In Local Chat with Guru */
  110.     ,NODE_CHAT                           /* In Chat Section */
  111.     ,NODE_SYSP                         /* Sysop Activity */
  112.     ,NODE_TQWK                        /* Transferring QWK packet */
  113.     ,NODE_PCHT                        /* Private node-to-node chat */
  114.     };
  115.  
  116. #if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
  117. #define MALLOC    farmalloc
  118. #define FREE    farfree
  119. #else
  120. #define MALLOC    malloc
  121. #define FREE    free
  122. #endif
  123.  
  124. #define KEY_BUFSIZE 256
  125.  
  126. #define CRLF;  outchar(LF);
  127.  
  128. #define SYSOP (user_ml>=90) /* Is current user sysop true/false macro    */
  129.  
  130. #define bgotoxy(x,y)    printf("\x1b[%d;%dH",y,x)   /* place the cursor at   */
  131.                                                     /* location x,y via ANSI */
  132.  
  133. #define SAVELINE        slatr[slcnt]=latr; \
  134.                         sprintf(slbuf[slcnt<SAVE_LINES ? slcnt++ : slcnt] \
  135.                             ,"%.*s",lbuflen,lbuf)
  136. #define RESTORELINE     attr(slatr[--slcnt]); bputs(slbuf[slcnt])
  137.  
  138. /************/
  139. /* Typedefs */
  140. /************/
  141.  
  142. typedef struct {                        /* Node information kept in NODE.DAB */
  143.     uchar    status,                        /* Current Status of Node */
  144.             errors,                        /* Number of Critical Errors */
  145.             action;                        /* Action User is doing on Node */
  146.     uint    useron,                        /* User on Node */
  147.             connection,                    /* Connection rate of Node */
  148.             misc,                        /* Miscellaneous bits for node */
  149.             aux;                        /* Auxillary word for node */
  150.     ulong    extaux;                        /* Extended aux dword for node */
  151.             } node_t;
  152.  
  153. #endif    /* Don't add anything after this endif */
  154.