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