/********************************************************************
* wilkinson
* 3.13VMS
* 1996/01/24 11:00
* gopher_root1:[gopher.g2.vms2_13.gopherd]globals.h,v
* Exp
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: globals.h
* Global variables for gopher server
*********************************************************************
* Revision History:
* globals.h,v
* Revision 3.13VMS-1 1996/01/24 11:00 wilkinson
* Made OPCOM message console selection configurable
*
* Revision 3.13VMS 1995/09/25 11:30 wilkinson
* Consolodate VMS/Unix source code for server as well as client
* - prototypes for vms_popen(), vms_pclose()
*
* Revision 3.13 1995/02/11 06:20:55 lindner
* Add variables to do common statistics
*
* Revision 3.12 1995/02/06 22:27:54 lindner
* Use dynamic space for Data_Dir, remove RunLS
*
* Revision 3.11 1994/06/29 05:26:17 lindner
* Add Gticket and CurrentUser
*
* Revision 3.10 1994/04/01 04:58:47 lindner
* Fix for gopher- client error messages
*
* Revision 3.9 1994/03/31 22:45:49 lindner
* Generate gopher- error responses for gopher- clients
*
* Revision 3.8 1994/03/17 04:26:40 lindner
* Add errorfile fd
*
* Revision 3.7 1993/10/04 06:41:10 lindner
* Removed gindexd functionality
*
* Revision 3.6 1993/08/04 22:12:37 lindner
* Mods to use Gpopen
*
* Revision 3.5 1993/07/27 05:27:44 lindner
* Mondo Debug overhaul from Mitra
*
* Revision 3.4 1993/07/26 17:23:43 lindner
* Mods for send_binary
*
* Revision 3.3 1993/07/20 23:56:21 lindner
* Added Argv vars, peername, etc.
*
* Revision 3.2 1993/07/07 19:38:01 lindner
* none
*
* Revision 3.1.1.1 1993/02/11 18:02:51 lindner
* Gopher+1.2beta release
*
* Revision 1.3 1993/01/30 23:57:44 lindner
* New global "ASKfile
*
* Revision 1.2 1992/12/16 05:07:23 lindner
* Removed SortDir, moved it into listdir() where it belongs.
*
* Revision 1.1 1992/12/10 23:13:27 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef GOPHERD_GLOBALS_H_
#define GOPHERD_GLOBALS_H_
/*
* This is some funky defines that assures that global variables are
* declared only once. (when globals.c includes this file with EXTERN
* defined.
*/
#ifndef EXTERN
#define EXTERN extern
#define INIT(x)
#else
#define EXTERN
#define INIT(x) = (x)
#ifdef VMS_SERVER
#define INIT_WILL_INIT
#endif
#endif
#include "boolean.h"
/**** Defines ****/
#define MAXLINE 512
/**** Globals. ****/
EXTERN GDCobj *Config;
EXTERN boolean RunFromInetd INIT(FALSE);
#ifndef VMS_SERVER
EXTERN boolean Caching INIT(TRUE);
EXTERN boolean UsingHTML INIT(FALSE);
EXTERN int LOGFileDesc INIT(-1);
EXTERN int ERRORFileDesc INIT(-1);
EXTERN char *Data_Dir INIT(NULL);
EXTERN char *pname INIT(NULL);
EXTERN int dochroot INIT(TRUE); /*** Should we use chroot?? ***/
EXTERN char *Zehostname INIT(NULL); /** Holds name and domain **/
EXTERN int GopherPort INIT(GOPHER_PORT);
#else
EXTERN boolean Caching INIT(FALSE);
EXTERN boolean UsingHTML INIT(FALSE);
EXTERN FILE *LOGFileDesc INIT(NULL);
EXTERN char log_alq[10];
EXTERN char log_deq[10];
EXTERN FILE *ERRORFileDesc INIT(NULL);
EXTERN char *pname INIT(NULL);
EXTERN GopherDirObj *SortDir;
EXTERN int dochroot INIT(FALSE); /*** VMS doesn't use chroot ***/
#define Zehostname GDCgetHostname(Config)
#define Data_Dir GDCgetDatadir(Config)
#define GopherPort GDCgetPort(Config)
#endif
EXTERN char *EXECargs INIT(NULL); /** used with exec type **/
#ifndef VMS_SERVER
/** For statistics **/
#include <sys/types.h>
#include <sys/time.h>
#else
#include "command.h"
#endif
EXTERN unsigned long Connections INIT(0);
EXTERN int ActiveSessions INIT(0);
EXTERN time_t ServerStarted INIT(0);
/*** What's being run ***/
EXTERN boolean RunServer INIT(TRUE); /** Run server as default **/
EXTERN boolean IsGplus INIT(FALSE);
EXTERN char ** Argv;
EXTERN char * LastArgv;
/*** Incoming data from the client ***/
EXTERN char *ASKfile INIT(NULL);
/*** Who's querying us.. ***/
EXTERN char CurrentPeerName[256];
EXTERN char CurrentPeerIP[16];
EXTERN char *CurrentUser INIT(NULL);
/*** The ticket value.. ****/
EXTERN char *Gticket INIT(NULL);
#ifdef VMS_SERVER
/*** VMS version needs these ***/
EXTERN CMDobj *cmd;
EXTERN char ClientWentAway[20];
EXTERN int vaxc$errno_stv;
EXTERN char vms_pipe_file[256];
EXTERN int vms_pipe_status;
EXTERN char TooBusy[256];
EXTERN char BadHostData[256];
EXTERN char IOErr[256];
EXTERN char NothingThere[256];
EXTERN char RangeErr[256];
EXTERN char BaddirMsg[256];
EXTERN char BummerMsg[256];
EXTERN char IndexErr[256];
EXTERN char NoSuchFile[256];
EXTERN char SyntaxErr[256];
EXTERN char BumClient[256];
EXTERN char *AbortMsg;
EXTERN GopherObj *AbortGS;
EXTERN boolean discardAbortGS;
EXTERN char *AbortString;
#define KeepAbrtGS FALSE
#define DstrAbrtGS TRUE
#define SetAbrtFile(a,b,c,d) {AbortMsg=(a); AbortGS=(b); \
discardAbortGS=(c);AbortString=(d);}
#define SetAbrtFileIf(a,b,c,d) if (!AbortMsg) SetAbrtFile(a,b,c,d)
#define SetAbrtMsg(a,b) sprintf(a,"0%sserver_error.%s", \
GDCgetSupportDir(Config),b);
#ifdef popen
#undef popen
#define popen(a,b) vms_popen(a,b)
FILE *vms_popen(char *, char*);
#endif
#ifdef pclose
#undef pclose
#define pclose(a) vms_pclose(a)
int vms_close(FILE *);
#endif
#define STRerror(a) ((char *)strerror(EVMSERR, vaxc$errno))
#define STRerror_stv() (vaxc$errno_stv?(STRerror(vaxc$errno_stv)):"")
boolean AddFiletoDir();
int vms_OPC$M_num INIT(21);
#ifndef INIT_WILL_INIT
int vms_OPC$M_NM[21];
char *vms_OPC$M_TXT[21];
#else
#include <opcdef.h>
int vms_OPC$M_NM[21] = {OPC$M_NM_CARDS, OPC$M_NM_CENTRL, OPC$M_NM_CLUSTER,
OPC$M_NM_DEVICE, OPC$M_NM_DISKS, OPC$M_NM_NTWORK,
OPC$M_NM_TAPES, OPC$M_NM_PRINT, OPC$M_NM_SECURITY,
OPC$M_NM_OPER1, OPC$M_NM_OPER2, OPC$M_NM_OPER3,
OPC$M_NM_OPER4, OPC$M_NM_OPER5, OPC$M_NM_OPER6,
OPC$M_NM_OPER7, OPC$M_NM_OPER8, OPC$M_NM_OPER9,
OPC$M_NM_OPER10, OPC$M_NM_OPER11, OPC$M_NM_OPER12};
char *vms_OPC$M_TXT[21] = {"Cards", "Central", "Cluster", "Device", "Disks",
"Network", "Tapes", "Print", "Security",
"Oper1", "Oper2", "Oper3", "Oper4", "Oper5", "Oper6",
"Oper7", "Oper8", "Oper9", "Oper10", "Oper11",
"Oper12"};
#endif
#endif
/*** Prototypes n' externals ****/
extern char *parse_input();
extern int do_command();
void intro_mesg(/* int */);
void listdir();
void printfile();
void send_binary();
FILE *specialfile();
char *fixfile();
FILE *Gpopen();
/*** From index.c ***/
void NeXTIndexQuery();
void WaisIndexQuery();
void GrepIndexQuery();
void ShellIndexQuery();
#ifdef VMS_SERVER
void CMD1IndexQuery();
#endif
#include "serverutil.h"
/*** from ftp.c ***/
void TranslateResults();
int SendFtpQuery();
#endif /* GOPHERD_GLOBALS_H_ */
.
Response:
text/plain