home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 024 / psi110g.zip / SESSION.H < prev    next >
C/C++ Source or Header  |  1994-04-17  |  4KB  |  116 lines

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