home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / src_1218.zip / SESSION.H < prev    next >
C/C++ Source or Header  |  1991-09-22  |  3KB  |  97 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.  
  54.     char *name;    /* Name of remote host */
  55.     union {
  56.         struct ftpcli *ftp;
  57.         struct telnet *telnet;
  58.     } cb;
  59.     struct proc *proc;    /* Primary session process (e.g., tn recv) */
  60.     struct proc *proc1;    /* Secondary session process (e.g., tn xmit) */
  61.     struct proc *proc2;    /* Tertiary session process (e.g., upload) */
  62.     int s;            /* Primary network socket (control for FTP) */
  63.     FILE *record;        /* Receive record file */
  64.     char *rfile;        /* Record file name */
  65.     FILE *upload;        /* Send file */
  66.     char *ufile;        /* Upload file name */
  67.     struct ttystate ttystate;
  68.     struct screen *screen;
  69.     int input;        /* Input socket */
  70.     int output;        /* Output socket */
  71.     int flowmode;        /* control "more" mode */
  72.     int row;        /* Rows remaining until "more" */
  73.     int morewait;        /* Output driver is waiting on us */
  74. };
  75. #define    NULLSESSION    (struct session *)0
  76.  
  77. extern char *Sestypes[];
  78. extern unsigned Nsessions;        /* Maximum number of sessions */
  79. extern struct session *Sessions;    /* Session descriptors themselves */
  80. extern struct session *Current;        /* Always points to current session */
  81. extern struct session *Lastcurr;    /* Last non-command session */
  82. extern struct session *Command;        /* Pointer to command session */
  83.  
  84. /* In session.c: */
  85. void freesession __ARGS((struct session *sp));
  86. struct session *sessptr __ARGS((char *cp));
  87. struct session *newsession __ARGS((char *name,int type));
  88. void upload __ARGS((int unused,void *sp1,void *p));
  89.  
  90. /* In pc.c: */
  91. void swapscreen __ARGS((struct session *old,struct session *new));
  92.  
  93. extern int16 Lport;
  94. #define    ALERT_EOF    1
  95.  
  96. #endif  /* _SESSION_H */
  97.