home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / gopher1.12 / gopherd / gopherdconf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-21  |  4.1 KB  |  113 lines

  1. /********************************************************************
  2.  * $Author: lindner $
  3.  * $Revision: 1.1 $
  4.  * $Date: 1992/12/10 23:13:27 $
  5.  * $Source: /home/mudhoney/GopherSrc/release1.11/gopherd/RCS/gopherdconf.h,v $
  6.  * $Status: $
  7.  *
  8.  * Paul Lindner, University of Minnesota CIS.
  9.  *
  10.  * Copyright 1991, 1992 by the Regents of the University of Minnesota
  11.  * see the file "Copyright" in the distribution for conditions of use.
  12.  *********************************************************************
  13.  * MODULE: gopherdconf.h
  14.  * Header file for routines in gopherdconf.c
  15.  *********************************************************************
  16.  * Revision History:
  17.  * $Log: gopherdconf.h,v $
  18.  * Revision 1.1  1992/12/10  23:13:27  lindner
  19.  * gopher 1.1 release
  20.  *
  21.  *
  22.  *********************************************************************/
  23.  
  24.  
  25.  
  26. #ifndef GOPHERDCONF_H
  27. #define GOPHERDCONF_H
  28.  
  29. #include "boolean.h"
  30. #include "STRstring.h"
  31. #include "ext.h"       /** Filename extensions **/
  32. #include "site.h"      /** Hostname/IP security **/
  33.  
  34.  
  35. /**************************************************************************
  36.  * A structure that defines all the changable parameters of a gopher server
  37.  * Read from the file gopherd.conf
  38.  */
  39.  
  40. struct gdconf_struct {
  41.      ExtArray     *Extensions;
  42.      SiteArray    *Sites;
  43.      Accesslevel  Defaccess;       /*** Default access level for unknowns **/
  44.  
  45.      boolean      RunFromInetd;    /*** -I option **/
  46.      boolean      Caching;         /*** -C option **/
  47.      String       *Logfile;        /*** The filename for the logfile **/
  48.      String       *BummerMsg;      /*** Message given to non-secure sites **/
  49.      String       *Data_Dir;       /*** Where our data directory is **/
  50.      String       *Hostname;       /*** A FQDN for the host **/
  51.      int          Port;            /*** The Port we're running at **/
  52.      boolean      chroot;          /*** Are we chroot()ing? **/
  53.  
  54.      boolean      Securityon;      /*** Are we restricting access or not? **/
  55.  
  56.      String       *Admin;          /*** Administrator info **/
  57.      String       *AdminEmail;     /*** E-mail address of administrator **/
  58.      
  59.      String       *Site;           /*** Description of site **/
  60.      String       *Org;            /*** Name of Organization **/
  61.      String       *Loc;            /*** Location of site **/
  62.      String       *Geog;           /*** Latitude and Longitude **/
  63.      int          TZ;              /*** Timezone **/
  64. };
  65.  
  66. typedef struct gdconf_struct GDCobj;
  67.  
  68. #define GDCgetDefAccess(a)      ((a)->Defaccess)
  69. #define GDCgetInetdActive(a)    ((a)->RunFromInetd)
  70. #define GDCsetInetdActive(a,b)  ((a)->RunFromInetd=(b))
  71. #define GDCgetCaching(a)        ((a)->Caching)
  72.  
  73. #define GDCgetLogfile(a)        STRget((a)->Logfile)
  74. #define GDCsetLogfile(a,b)      STRset((a)->Logfile,(b))
  75. #define GDCgetDatadir(a)        STRget((a)->Data_Dir)
  76. #define GDCgetHostname(a)       STRget((a)->Hostname)
  77. #define GDCsetHostname(a,b)     STRset((a)->Hostname,(b))
  78. #define GDCgetPort(a)           ((a)->Port)
  79. #define GDCgetchroot(a)         ((a)->chroot)
  80. #define GDCgetBummerMsg(a)      STRget((a)->BummerMsg)
  81. #define GDCsetBummerMsg(a,b)    STRset((a)->BummerMsg,(b))
  82.  
  83. #define GDCgetAdmin(a)       STRget((a)->Admin)
  84. #define GDCsetAdmin(a,b)     STRset((a)->Admin,(b))
  85. #define GDCgetAdminEmail(a)  STRget((a)->AdminEmail)
  86. #define GDCsetAdminEmail(a,b) STRset((a)->AdminEmail,(b))
  87. #define GDCgetSite(a)        STRget((a)->Site)
  88. #define GDCsetSite(a,b)      STRset((a)->Site,(b))
  89. #define GDCgetOrg(a)         STRget((a)->Org)
  90. #define GDCsetOrg(a,b)       STRset((a)->Org,(b))
  91. #define GDCgetLoc(a)         STRget((a)->Loc)
  92. #define GDCsetLoc(a,b)       STRset((a)->Loc,(b))
  93. #define GDCgetTZ(a)          (a)->TZ
  94.  
  95. /*
  96.  * Real live functions in gopherdconf.c
  97.  */
  98.  
  99. GDCobj       *GDCnew();
  100. void         GDCinit(/* gdc, FILE* gdc.conf file */);
  101. void         GDCdestroy(/* gdc */);
  102.  
  103. boolean      GDCignore(/* gdc, char *filename */);
  104.  
  105. boolean      GDCCanRead(/* gdc, hostname, ipnum */);
  106. boolean      GDCCanBrowse(/* gdc, hostname, ipnum */);
  107. boolean      GDCCanSearch(/* gdc, hostname, ipnum */);
  108.  
  109. boolean      GDCExtension(/*gdc, ext, Gtype, Prefix*/);
  110.  
  111.  
  112. #endif /* GOPHERDCONF_H */
  113.