1 /*_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
5 * Function:..WorldWideWeb-X.500-Gateway MAIN-Routine *
6 * Based on web500gw.c 1.3 written by Frank Richter, TU Chemmniz *
7 * which is based on go500gw by Tim Howes, University of *
8 * Michigan - All rights reserved *
10 * Authors:...Dr. Kurt Spanier & Bernhard Winkler, *
11 * Zentrum fuer Datenverarbeitung, Bereich Entwicklung *
12 * neuer Dienste, Universitaet Tuebingen, GERMANY *
15 * Creation date: Z D D V V *
16 * August 16 1995 Z D D V V *
17 * Last modification: Z D D V V *
18 * December 31 1996 ZZZZ DDD V *
20 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_*/
23 * $Id: tweb.c,v 1.6 1999/09/10 15:01:20 zrnsk01 Exp $
29 * redesign BW 94/08/16
30 * patched for HPUX 9.x by /KSp, 94/04/28
31 * patched for AMBIX-D and use at University of Tuebingen by /KSp,
32 * patched for always-assume-nonleaf-behaviour-and-reread-on-demand; /KSp
33 * patched for restricted listing of Tuebinger students; /KSp
34 * patched for mailto HREF in mail attribute; /KSp
35 * patched for automatic referral to Chemnitz in case of ROOT access
36 * (AMBIX version only); /KSp
37 * patched for correct response in case of not found error; /MCl
38 * neg patched: subtree search below locality removed; /KSp
39 * patched for automatic referral to AMBIX in case of l=DFN access
40 * (non-AMBIX version only); /KSp
41 * patched for lower case compare during access control; /KSp
42 * patched for menu-'seeAlso' in AMBIXGW; /KSp
43 * patched for pgpPubKey formatting as MULTILINE; /KSP
44 * correction of MULTILINE handling; /KSp
45 * objectClass deleted from menu list entry in html-code; /KSp
46 * patched for "Selbsteintrag" needed by AMBIX-Project /mc
47 * last update: 95/07/07
49 * 95/07/17 changed to ANSI-C, deleted lots of compiletime-options. /mc
52 * Redistribution and use in source and binary forms are permitted
53 * provided that this notice is preserved and that due credit is given
54 * to the University of Tuebingen. The name of the University
55 * may not be used to endorse or promote products derived from this
56 * software without specific prior written permission. This software
57 * is provided ``as is'' without express or implied warranty.
59 * ----------------------------------------------------------------------
64 PUBLIC int main (argc, argv)
69 /* The Glob-structure is NOT a global variable, but is stored here for
70 all other functions !!! */
75 /* make glob global available */
78 /* first of all the language-parameter is scanned from the command-line
79 and is written as first value to the Glob-structure */
80 get_lang(argc, argv, lang);
81 bzero((char *) &glob, sizeof(GLOB_STRUCT));
82 glob.olang = strdup(lang);
84 /* Now start a process for each language and terminate the super-process */
85 for(i=0; i<strlen(lang); i++){
87 /* memorize the sub-process-language */
90 switch( pid = fork() ) {
94 do_child(argc, argv,lang, &glob);
97 /* A Sub-Process could not be created !!! */
102 /* the Parent-Process */
105 fprintf( stderr, "forked child %d\n", pid );
112 /* end of function: main */
118 ** Main-Function for the working-processes; until now only the
119 ** language is initialized. The rest of the configuration
120 ** must be scanned now.
123 PRIVATE void do_child(argc, argv,lang, glob)
131 char filename[BUFSIZ];
133 /* read language-independent (.rc) and -dependent (.conf) configuration */
134 init(argv, lang, glob);
136 /* read commandline-parameter (they overwrite conf) */
137 getopts (argc, argv, glob);
139 /* If debug-Mode: Configuration Output */
142 sprintf(filename, "%s.debug", glob->myname);
143 fp =fopen(filename, "a");
144 fprintf(fp, "\n\n\n#####%s.%s-log Date: %s\n\n",
145 glob->myname, glob->lang, format_time(NULL));
146 output(fp, glob, FALSE);
150 /* read language-strings (from .lang) and write out if desired */
155 langoutput(fp, glob, FALSE);
160 /* Final Configuration-Test */
163 /* If dynamic Gateway-Switching is enabled the language-dependent
164 recognition-string for the meta-Syntax must be fixed
165 (language-independent recognition-string is given in Macro GWS ) */
166 if(glob->gw_switch->dynamic) {
169 sprintf(strbuf, GWS_FORMAT, glob->la[0]);
170 glob->gw_switch->lagws = strdup(strbuf);
173 /* and now start the Gateway ... */
177 /* end of function: do_child */