]> git.ipfire.org Git - thirdparty/cups.git/blame - cgi-bin/cgi.h
Update svn:keyword properties.
[thirdparty/cups.git] / cgi-bin / cgi.h
CommitLineData
ef416fc2 1/*
f2d18633 2 * "$Id$"
ef416fc2 3 *
f8b3a85b 4 * CGI support library definitions for CUPS.
ef416fc2 5 *
f8b3a85b 6 * Copyright 2007-2010 by Apple Inc.
ef416fc2 7 * Copyright 1997-2006 by Easy Software Products.
8 *
9 * These coded instructions, statements, and computer programs are the
bc44d920 10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 14 */
15
16#ifndef _CUPS_CGI_H_
17# define _CUPS_CGI_H_
18
19# include <stdio.h>
20# include <stdlib.h>
21# include <time.h>
22# include <sys/stat.h>
23
24# ifdef WIN32
25# include <direct.h>
26# include <io.h>
27# else
28# include <unistd.h>
29# endif /* WIN32 */
30
31# include <cups/cups.h>
32# include <cups/array.h>
33# include "help-index.h"
34
35
ef55b745
MS
36/*
37 * C++ magic...
38 */
39
40# ifdef __cplusplus
41extern "C" {
42# endif /* __cplusplus */
43
ef416fc2 44/*
45 * Types...
46 */
47
48typedef struct cgi_file_s /**** Uploaded file data ****/
49{
50 char tempfile[1024], /* Temporary file containing data */
51 *name, /* Variable name */
52 *filename, /* Original filename */
53 *mimetype; /* MIME media type */
54 size_t filesize; /* Size of uploaded file */
55} cgi_file_t;
56
57
58/*
59 * Prototypes...
60 */
61
62extern void cgiAbort(const char *title, const char *stylesheet,
63 const char *format, ...);
64extern int cgiCheckVariables(const char *names);
ef55b745 65extern void cgiClearVariables(void);
ef416fc2 66extern void *cgiCompileSearch(const char *query);
67extern void cgiCopyTemplateFile(FILE *out, const char *tmpl);
68extern void cgiCopyTemplateLang(const char *tmpl);
69extern int cgiDoSearch(void *search, const char *text);
70extern void cgiEndHTML(void);
58dc1933 71extern void cgiEndMultipart(void);
f8b3a85b
MS
72extern char *cgiFormEncode(char *dst, const char *src,
73 size_t dstsize);
ef416fc2 74extern void cgiFreeSearch(void *search);
75extern const char *cgiGetArray(const char *name, int element);
76extern void cgiGetAttributes(ipp_t *request, const char *tmpl);
f8b3a85b 77extern const char *cgiGetCookie(const char *name);
ef416fc2 78extern const cgi_file_t *cgiGetFile(void);
79extern cups_array_t *cgiGetIPPObjects(ipp_t *response, void *search);
80extern int cgiGetSize(const char *name);
81extern char *cgiGetTemplateDir(void);
82extern const char *cgiGetVariable(const char *name);
83extern int cgiInitialize(void);
84extern int cgiIsPOST(void);
fa73b229 85extern void cgiMoveJobs(http_t *http, const char *dest, int job_id);
58dc1933
MS
86extern void cgiPrintCommand(http_t *http, const char *dest,
87 const char *command, const char *title);
fa73b229 88extern void cgiPrintTestPage(http_t *http, const char *dest);
ef416fc2 89extern char *cgiRewriteURL(const char *uri, char *url, int urlsize,
90 const char *newresource);
91extern void cgiSetArray(const char *name, int element,
92 const char *value);
93extern void cgiSetCookie(const char *name, const char *value,
94 const char *path, const char *domain,
95 time_t expires, int secure);
96extern ipp_attribute_t *cgiSetIPPObjectVars(ipp_attribute_t *obj,
97 const char *prefix, int element);
98extern int cgiSetIPPVars(ipp_t *response, const char *filter_name,
99 const char *filter_value,
100 const char *prefix, int parent_el);
101extern void cgiSetServerVersion(void);
102extern void cgiSetSize(const char *name, int size);
103extern void cgiSetVariable(const char *name, const char *value);
fa73b229 104extern void cgiShowIPPError(const char *message);
ef416fc2 105extern void cgiShowJobs(http_t *http, const char *dest);
106extern void cgiStartHTML(const char *title);
58dc1933 107extern void cgiStartMultipart(void);
d2354e63 108extern int cgiSupportsMultipart(void);
fa73b229 109extern const char *cgiText(const char *message);
ef416fc2 110
ef55b745
MS
111# ifdef __cplusplus
112}
113# endif /* __cplusplus */
114
ef416fc2 115#endif /* !_CUPS_CGI_H_ */
116
117/*
f2d18633 118 * End of "$Id$".
ef416fc2 119 */