Commit | Line | Data |
---|---|---|
a33962ba | 1 | /* |
ca2efed5 | 2 | * Copyright 1996-2013,2016 Ian Jackson <ijackson@chiark.greenend.org.uk> |
9028e234 IJ |
3 | * Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk> |
4 | * Copyright 1999,2003 | |
5 | * Chancellor Masters and Scholars of the University of Cambridge | |
6 | * Copyright 2010 Tony Finch <fanf@dotat.at> | |
93733bee | 7 | * Copyright 2013,2016 Mark Wooding <mdw@distorted.org.uk> |
a33962ba | 8 | * |
9 | * This is free software; you can redistribute it and/or modify it | |
10 | * under the terms of the GNU General Public License as published by | |
9028e234 | 11 | * the Free Software Foundation; either version 3 of the License, or |
a33962ba | 12 | * (at your option) any later version. |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, but | |
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | * General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
9028e234 | 20 | * along with userv-utils; if not, see http://www.gnu.org/licenses/. |
a33962ba | 21 | */ |
6a580c17 | 22 | |
23 | #ifndef UCGI_H | |
24 | #define UCGI_H | |
25 | ||
26 | #include <stdlib.h> | |
27 | ||
6a3086f1 MW |
28 | #ifdef DEBUG |
29 | # define D(x) x | |
30 | #else | |
31 | # define D(x) | |
32 | #endif | |
33 | ||
6a580c17 | 34 | #define MAX_ARGS 1024 |
35 | #define MAX_USERNAME_LEN 1024 | |
36 | #define MAX_SCRIPTPATH_LEN 1024 | |
f601a2c6 | 37 | #define MAX_ENVVAR_NAME 128 |
6a580c17 | 38 | #define MAX_ENVVAR_VALUE (1024*1024) |
f601a2c6 | 39 | #define MAX_ENVVARS 256 |
6a580c17 | 40 | |
41 | void syserror(const char *m); | |
0cd9d59d | 42 | void error(const char *m, int st); |
6a580c17 | 43 | void *xmalloc(size_t sz); |
44 | void xsetenv(const char *en, const char *ev, int overwrite); | |
44a77f48 | 45 | void *xrealloc(void *ptr, size_t sz); |
6a580c17 | 46 | |
f7b4be5a MW |
47 | const char **load_filters(unsigned flags, const char *first, ...); |
48 | #define LOADF_MUST 1u | |
49 | #define LF_END ((const char *)0) | |
50 | ||
f601a2c6 MW |
51 | void filter_environment(unsigned flags, const char *prefix_in, |
52 | const char *const *patv, | |
aa0bce91 | 53 | const char *const *defaults, |
f601a2c6 MW |
54 | void (*foundone)(const char *fulln, const char *en, |
55 | const char *ev, void *p), | |
56 | void *p); | |
57 | #define FILTF_WILDCARD 1u | |
6a580c17 | 58 | |
6a580c17 | 59 | extern int debugmode; |
60 | ||
61 | #endif |