home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / KA9Q212.ZIP / SESSION.H < prev    next >
C/C++ Source or Header  |  1993-03-07  |  3KB  |  99 lines

  1. #ifndef    _SESSION_H
  2. #define    _SESSION_H
  3.  
  4. #include <stdio.h>
  5.  
  6. #ifndef    _GLOBAL_H
  7. #include "global.h"
  8. #endif
  9.  
  10. #ifndef    _PROC_H
  11. #include "proc.h"
  12. #endif
  13.  
  14. #ifndef _HARDWARE_H
  15. #include "hardware.h"
  16. #endif
  17.  
  18. #ifndef    _FTPCLI_H
  19. #include "ftpcli.h"
  20. #endif
  21.  
  22. #ifndef    _TELNET_H
  23. #include "telnet.h"
  24. #endif
  25.  
  26. #define    MOREROWS    24    /* rows on screen before --more-- */
  27.  
  28. struct ttystate {
  29.     struct mbuf *line;    /* Line buffer */
  30.     int echo;        /* Keyboard local echoing? */
  31.     int edit;        /* Local editing? */
  32.     int crnl;        /* Translate cr to lf? */
  33. };
  34.  
  35. /* Session control structure; only one entry is used at a time */
  36. struct session {
  37.     int type;
  38. #define    FREE    0
  39. #define    TELNET    1
  40. #define    FTP    2
  41. #define    AX25TNC    3
  42. #define    FINGER    4
  43. #define    PING    5
  44. #define NRSESSION 6
  45. #define    COMMAND    7
  46. #define    MORE    8
  47. #define    HOP    9
  48. #define    TIP    10
  49. #define    PPPPASS    11
  50. #define DIAL    12
  51. #define DQUERY    13
  52. #define DCLIST    14
  53. #define RLOGIN    15
  54.  
  55.     char *name;    /* Name of remote host */
  56.     union {
  57.         struct ftpcli *ftp;
  58.         struct telnet *telnet;
  59.     } cb;
  60.     struct proc *proc;    /* Primary session process (e.g., tn recv) */
  61.     struct proc *proc1;    /* Secondary session process (e.g., tn xmit) */
  62.     struct proc *proc2;    /* Tertiary session process (e.g., upload) */
  63.     int s;                /* Primary network socket (control for FTP) */
  64.     FILE *record;        /* Receive record file */
  65.     char *rfile;        /* Record file name */
  66.     FILE *upload;        /* Send file */
  67.     char *ufile;        /* Upload file name */
  68.     struct ttystate ttystate;
  69.     struct screen *screen;
  70.     int input;            /* Input socket */
  71.     int output;            /* Output socket */
  72.     int flowmode;        /* control "more" mode */
  73.     int row;            /* Rows remaining until "more" */
  74.     int morewait;        /* Output driver is waiting on us */
  75.     int cur_pos;        /* Cursor position within input buffer */
  76. };
  77. #define    NULLSESSION    (struct session *)0
  78.  
  79. extern char *Sestypes[];
  80. extern unsigned Nsessions;        /* Maximum number of sessions */
  81. extern struct session *Sessions;    /* Session descriptors themselves */
  82. extern struct session *Current;        /* Always points to current session */
  83. extern struct session *Lastcurr;    /* Last non-command session */
  84. extern struct session *Command;        /* Pointer to command session */
  85.  
  86. /* In session.c: */
  87. void freesession __ARGS((struct session *sp));
  88. struct session *sessptr __ARGS((char *cp));
  89. struct session *newsession __ARGS((char *name,int type));
  90. void upload __ARGS((int unused,void *sp1,void *p));
  91.  
  92. /* In pc.c: */
  93. void swapscreen __ARGS((struct session *old,struct session *new));
  94.  
  95. extern int16 Lport;
  96. #define    ALERT_EOF    1
  97.  
  98. #endif  /* _SESSION_H */
  99.