]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/cgi.h
2 * CGI support library definitions for CUPS.
4 * Copyright 2007-2010 by Apple Inc.
5 * Copyright 1997-2006 by Easy Software Products.
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
16 # include <sys/stat.h>
25 # include <cups/cups.h>
26 # include <cups/array.h>
27 # include "help-index.h"
36 # endif /* __cplusplus */
42 typedef struct cgi_file_s
/**** Uploaded file data ****/
44 char tempfile
[1024], /* Temporary file containing data */
45 *name
, /* Variable name */
46 *filename
, /* Original filename */
47 *mimetype
; /* MIME media type */
48 size_t filesize
; /* Size of uploaded file */
56 extern void cgiAbort(const char *title
, const char *stylesheet
,
57 const char *format
, ...);
58 extern int cgiCheckVariables(const char *names
);
59 extern void cgiClearVariables(void);
60 extern void *cgiCompileSearch(const char *query
);
61 extern void cgiCopyTemplateFile(FILE *out
, const char *tmpl
);
62 extern void cgiCopyTemplateLang(const char *tmpl
);
63 extern int cgiDoSearch(void *search
, const char *text
);
64 extern void cgiEndHTML(void);
65 extern void cgiEndMultipart(void);
66 extern char *cgiFormEncode(char *dst
, const char *src
,
68 extern void cgiFreeSearch(void *search
);
69 extern const char *cgiGetArray(const char *name
, int element
);
70 extern void cgiGetAttributes(ipp_t
*request
, const char *tmpl
);
71 extern const char *cgiGetCookie(const char *name
);
72 extern const cgi_file_t
*cgiGetFile(void);
73 extern cups_array_t
*cgiGetIPPObjects(ipp_t
*response
, void *search
);
74 extern int cgiGetSize(const char *name
);
75 extern char *cgiGetTemplateDir(void);
76 extern const char *cgiGetVariable(const char *name
);
77 extern int cgiInitialize(void);
78 extern int cgiIsPOST(void);
79 extern void cgiMoveJobs(http_t
*http
, const char *dest
, int job_id
);
80 extern void cgiPrintCommand(http_t
*http
, const char *dest
,
81 const char *command
, const char *title
);
82 extern void cgiPrintTestPage(http_t
*http
, const char *dest
);
83 extern char *cgiRewriteURL(const char *uri
, char *url
, int urlsize
,
84 const char *newresource
);
85 extern void cgiSetArray(const char *name
, int element
,
87 extern void cgiSetCookie(const char *name
, const char *value
,
88 const char *path
, const char *domain
,
89 time_t expires
, int secure
);
90 extern ipp_attribute_t
*cgiSetIPPObjectVars(ipp_attribute_t
*obj
,
91 const char *prefix
, int element
);
92 extern int cgiSetIPPVars(ipp_t
*response
, const char *filter_name
,
93 const char *filter_value
,
94 const char *prefix
, int parent_el
);
95 extern void cgiSetServerVersion(void);
96 extern void cgiSetSize(const char *name
, int size
);
97 extern void cgiSetVariable(const char *name
, const char *value
);
98 extern void cgiShowIPPError(const char *message
);
99 extern void cgiShowJobs(http_t
*http
, const char *dest
);
100 extern void cgiStartHTML(const char *title
);
101 extern void cgiStartMultipart(void);
102 extern int cgiSupportsMultipart(void);
103 extern const char *cgiText(const char *message
);
107 # endif /* __cplusplus */
109 #endif /* !_CUPS_CGI_H_ */