Terminate a freshly allocated string as well.
[infodrom/cgilib] / cgiInit.3
1 .\" cgiInit - Initializes CGI library
2 .\" Copyright (c) 1998,9,2007,8 by Martin Schulze <joey@infodrom.org>
3 .\" 
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU General Public License as published by
6 .\" the Free Software Foundation; either version 2 of the License, or
7 .\" (at your option) any later version.
8 .\" 
9 .\" This program is distributed in the hope that it will be useful,
10 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 .\" GNU General Public License for more details.
13 .\" 
14 .\" You should have received a copy of the GNU General Public License
15 .\" along with this program; if not, write to the Free Software Foundation
16 .\" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 .\"
18 .TH cgiInit 3 "6 April 2008" "CGI Library" "Programmer's Manual"
19 .SH NAME
20 cgiInit \- Initializes CGI library
21 .SH SYNOPSYS
22 .nf
23 .B #include <cgi.h>
24 .sp
25 .B s_cgi *cgiInit ();
26 .fi
27 .SH DESCRIPTION
28 This routine initializes the CGI routines.  Mainly it reads in and
29 decodes CGI data for later processing.  If the program is not called
30 via CGI interface the user is prompted to type in CGI variable
31 bindings via stdin - just like CGI.pm does.  There is no limit in the
32 number of variable bindings.
33
34 If HTTP Cookies are used (through the variable HTTP_COOKIE) this
35 routine will parse them as well and assign them to internal variables.
36 There is no limit in the number of cookies.
37
38 To set a cookie you'll have to use the
39 .BR cgiSetHeader (3)
40 routine.  Some clients allow 4kB of Cookies while others only allow
41 short ones.  Some clients may also allow only 200 Cookies for a
42 certain domain/path pair.
43
44 This routine normally is the first or second that is called from this
45 library.  Only
46 .BR cgiDebug ()
47 may be called before.  If debugging is enabled this routine produces
48 some additional output.
49
50 The library supports both the regular GET and POST methods as well as
51 multipart/form-data.
52
53 Memory allocated by this library is freed with the
54 .BR cgiFree (3)
55 function.
56 .SH "RETURN VALUE"
57 On success a set of CGI variable bindings is returned that is needed
58 for later processing.  If an error occurs NULL is returned.
59
60 .SH "AUTHOR"
61 This CGI library is written by Martin Schulze
62 <joey@infodrom.org>.  If you have additions or improvements
63 please get in touch with him.
64
65 .SH "SEE ALSO"
66 .BR cgiDebug (3),
67 .BR cgiSetType (3),
68 .BR cgiSetHeader (3),
69 .BR cgiHeader (3),
70 .BR cgiGetValue (3),
71 .BR cgiGetVariables (3)
72 .BR cgiGetCookie (3),
73 .BR cgiGetCookies (3),
74 .BR cgiFree (3),
75 .BR cgi (5).