]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/cgi.h
4 * CGI support library definitions.
6 * Copyright 1997-2000 by Easy Software Products.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35 # define strcasecmp(s,t) stricmp((s),(t))
36 # define strncasecmp(s,t,n) strnicmp((s),(t),(n))
46 extern int cgiInitialize(void);
47 extern void cgiAbort(const char *title
, const char *stylesheet
,
48 const char *format
, ...);
49 extern int cgiCheckVariables(const char *names
);
50 extern const char *cgiGetArray(const char *name
, int element
);
51 extern int cgiGetSize(const char *name
);
52 extern void cgiSetSize(const char *name
, int size
);
53 extern const char *cgiGetVariable(const char *name
);
54 extern void cgiSetArray(const char *name
, int element
,
56 extern void cgiSetVariable(const char *name
, const char *value
);
57 extern void cgiCopyTemplateFile(FILE *out
, const char *tmpl
);
58 extern void cgiCopyTemplateLang(FILE *out
, const char *directory
,
59 const char *tmpl
, const char *lang
);
61 extern void cgiStartHTML(FILE *out
, const char *author
,
62 const char *stylesheet
,
64 const char *description
,
65 const char *title
, ...);
66 extern void cgiEndHTML(FILE *out
);
68 extern FILE *cgiEMailOpen(const char *from
, const char *to
,
69 const char *cc
, const char *subject
,
71 extern void cgiEMailPart(FILE *mail
, const char *type
,
72 const char *charset
, const char *encoding
);
73 extern void cgiEMailClose(FILE *mail
);
75 extern char *cgiGetCookie(const char *name
, char *buf
, int buflen
);
76 extern void cgiSetCookie(const char *name
, const char *value
,
77 const char *path
, const char *domain
,
78 time_t expires
, int secure
);
80 # define cgiGetUser() getenv("REMOTE_USER")
81 # define cgiGetHost() (getenv("REMOTE_HOST") == NULL ? getenv("REMOTE_ADDR") : getenv("REMOTE_HOST"))