home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / src / gopher / gopher1.01 / mindexd / gopherstruct.h < prev    next >
C/C++ Source or Header  |  1992-04-08  |  2KB  |  68 lines

  1. /** Our Gopher Object Type **/
  2.  
  3. struct g_struct
  4. {
  5.      char    sFileType;     /* The type of object (A_FILE, A_CSO, etc)*/
  6.      char    sTitle[256];   /* User-displayed title of object         */
  7.      char    sPath[256];    /* Internal pathname to object on host    */
  8.      char    sHost[100];    /* Internet name of host                  */
  9.      int     iPort;         /* Port number on host                    */
  10.      
  11.      int     iItemnum;      /* The number of the item in the directory*/
  12. };
  13.  
  14. typedef struct g_struct GopherStruct;
  15. typedef struct g_struct GopherObj;
  16.  
  17. #define GSgetType(a) ((a)->sFileType)
  18. #define GSsetType(a,b) (a)->sFileType=(b)
  19.  
  20. #define GSgetTitle(a) ((a)->sTitle)
  21. #define GSsetTitle(a,b) strncpy((a)->sTitle,(b),255)
  22.  
  23. #define GSgetPath(a) ((a)->sPath)
  24. #define GSsetPath(a,b) strncpy((a)->sPath,(b),255)
  25.  
  26. #define GSgetHost(a) ((a)->sHost)
  27. #define GSsetHost(a,b) strncpy((a)->sHost,(b),99)
  28.  
  29. #define GSgetPort(a) ((a)->iPort)
  30. #define GSsetPort(a,b) (a)->iPort=(b)
  31.  
  32. #define GSgetNum(a) ((a)->iItemnum)
  33. #define GSsetNum(a,b) (a)->iItemnum=(b)
  34.  
  35.  
  36. /*** Real live functions defined in gopherstruct.c ***/
  37.  
  38. void GSinit();
  39. void GStoNet();
  40.  
  41.  
  42. /****************************************************************
  43. ** A Gopher directory structure  You don't want to have too many
  44. ** of these defined in a program (they're biiiiiiggggg!)
  45. **
  46. *****************************************************************/
  47.  
  48. #define MAXGOPHERS 256
  49.  
  50.  
  51. struct g_dir_struct {
  52.      GopherStruct Gophers[MAXGOPHERS];
  53.      
  54.      int Top;
  55. };
  56.  
  57. typedef struct g_dir_struct GopherDirObj;
  58. typedef struct g_dir_struct *GopherDirObjp;
  59.  
  60. #define GDgetEntry(a,b)  (&((a)->Gophers[b]))
  61. #define GDgetTop(a)  ((a)->Top)
  62. #define GDsetTop(a,b)  ((a)->Top = (b))
  63.  
  64. /*** Real live functions declared in gopherstruct.c ***/
  65.  
  66. void GDaddGS();
  67. void GDsort();
  68.