config.h 3.7 KB
Newer Older
Linus Tolke's avatar
Linus Tolke committed
1
/*
2
 * $Id: config.h,v 0.13 1994/06/18 18:48:14 ceder Exp $
Per Cederqvist's avatar
Per Cederqvist committed
3
 * Copyright (C) 1991, 1992, 1993, 1994  Lysator Academic Computer Association.
Linus Tolke's avatar
Linus Tolke committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 *
 * This file is part of the LysKOM server.
 * 
 * LysKOM is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 1, or (at your option) 
 * any later version.
 * 
 * LysKOM is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with LysKOM; see the file COPYING.  If not, write to
 * Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
 * or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
 * MA 02139, USA.
 *
 * Please mail bug reports to bug-lyskom@lysator.liu.se. 
 */
Per Cederqvist's avatar
.    
Per Cederqvist committed
25
26
27
28
29
30
31
/*
 *  config.h
 *
 *  Configuration parameters for compiling.  Contains among other
 *  things all the stupid limits you really want to be without, all the
 *  smart limits that has to be there to make it impossible to crash
 *  the server, and lots of constants and configuration options.
32
33
34
 *
 *  Almost all of this can currently be set in a configuration file.
 *  There is normally no reason to change anything in this file.
Per Cederqvist's avatar
.    
Per Cederqvist committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 */

/* Collating sequence used. */
#define DEFAULT_COLLAT_TAB	swedish_collate_tab



/* The file kom_perror prints to.  */
/* Yes! This should be stdout. At least during testing and debugging! /ceder */

#define kom_errout	stdout

/*
 * The following are constants which can not be changed without rewriting
 * some of the code.
 */
#define PROTOCOL_NUMBER_BASE 10	/* The number base used in all communication
				 * between server and clients. */


extern const char *DEFAULT_DBASE_DIR;
Per Cederqvist's avatar
Per Cederqvist committed
56
57
extern const char *CONFIG_FILE;

Per Cederqvist's avatar
.    
Per Cederqvist committed
58
59
/* Communications */

60
61
62
63
/*
 * MAX_NO_OF_CONNECTIONS must be small enough. Each connection takes one
 * file descriptor, and it is important that there are a few descriptors
 * left so that it is possible to save the data base. lyskomd might crash
Per Cederqvist's avatar
Per Cederqvist committed
64
 * if this number is too big and that many connection attempts are made
65
66
67
68
69
70
71
72
 * simultaneously.
 *
 * The following descriptors are open by LysKOM:
 *   stdin, stdout, stderr   (stdin and stdout could probably be closed.
 *			      The log() function prints to stderr.)
 *   TEXTFILE_NAME	     (always open)
 *   DATAFILE_NAME	     (often open)
 *   STATISTIC_NAME	     (open after a SIGUSR1)
Per Cederqvist's avatar
Per Cederqvist committed
73
74
 *   Two TCP/IP ports	     (normal connections and mux-connections)
 *   One UDP/IP port	     (probably from -lresolv, but I'm not sure)
Per Cederqvist's avatar
Per Cederqvist committed
75
 *   One TCP/IP port	     (if HAVE_LIBAUTHUSER is defined)
76
 * Thus, the max number of connections is the number of available file
77
 * descriptors minus ten. This has not been fully tested for a long
Per Cederqvist's avatar
Per Cederqvist committed
78
79
80
 * while, so we subtract twelve just to be on the safe side. That still
 * gives 52 simultaneous users on a sun4, and that is enough for the
 * time beeing. (If you need more connections you can run a mux. Send
81
 * mail to kom@lysator.liu.se for more info.)
Per Cederqvist's avatar
Per Cederqvist committed
82
 *
83
84
 * Machines where less or more files are open should set this in the 
 * configure script.
85
86
 */

Per Cederqvist's avatar
Per Cederqvist committed
87
88
89
#ifndef PROTECTED_FDS
#define PROTECTED_FDS 12
#endif
90
91
92
93
94
95
96

/*
 * An upper limit of how many connections to LysKOM that can be opened
 * simultaneously. If we HAVE_GETDTABLESIZE this is set once and for
 * all at the beginning of main(). Otherwise it is determined at
 * compile-time.
 */
97
#if defined(HAVE_GETDTABLESIZE) || defined(HAVE_SYSCONF)
98
99
100
101
102
extern int MAX_NO_OF_CONNECTIONS;
#else
extern const int MAX_NO_OF_CONNECTIONS;
#endif

Per Cederqvist's avatar
.    
Per Cederqvist committed
103
104
/* What is whitespace? */
extern const unsigned char *WHITESPACE;