]> git.ipfire.org Git - thirdparty/cups.git/blame - cgi-bin/cgi.h
Sandboxed applications were not able to get the default printer (Issue #5676)
[thirdparty/cups.git] / cgi-bin / cgi.h
CommitLineData
ef416fc2 1/*
503b54c9 2 * CGI support library definitions for CUPS.
ef416fc2 3 *
507c4adc
MS
4 * Copyright © 2007-2019 by Apple Inc.
5 * Copyright © 1997-2006 by Easy Software Products.
ef416fc2 6 *
507c4adc
MS
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more
8 * information.
ef416fc2 9 */
10
11#ifndef _CUPS_CGI_H_
12# define _CUPS_CGI_H_
13
14# include <stdio.h>
15# include <stdlib.h>
16# include <time.h>
17# include <sys/stat.h>
18
24a06ed3 19# ifdef _WIN32
ef416fc2 20# include <direct.h>
21# include <io.h>
22# else
23# include <unistd.h>
24a06ed3 24# endif /* _WIN32 */
ef416fc2 25
26# include <cups/cups.h>
27# include <cups/array.h>
28# include "help-index.h"
29
30
ef55b745
MS
31/*
32 * C++ magic...
33 */
34
35# ifdef __cplusplus
36extern "C" {
37# endif /* __cplusplus */
38
ef416fc2 39/*
40 * Types...
41 */
42
43typedef struct cgi_file_s /**** Uploaded file data ****/
44{
45 char tempfile[1024], /* Temporary file containing data */
46 *name, /* Variable name */
47 *filename, /* Original filename */
48 *mimetype; /* MIME media type */
49 size_t filesize; /* Size of uploaded file */
50} cgi_file_t;
51
52
53/*
54 * Prototypes...
55 */
56
57extern void cgiAbort(const char *title, const char *stylesheet,
58 const char *format, ...);
59extern int cgiCheckVariables(const char *names);
ef55b745 60extern void cgiClearVariables(void);
ef416fc2 61extern void *cgiCompileSearch(const char *query);
62extern void cgiCopyTemplateFile(FILE *out, const char *tmpl);
63extern void cgiCopyTemplateLang(const char *tmpl);
64extern int cgiDoSearch(void *search, const char *text);
65extern void cgiEndHTML(void);
58dc1933 66extern void cgiEndMultipart(void);
f8b3a85b
MS
67extern char *cgiFormEncode(char *dst, const char *src,
68 size_t dstsize);
ef416fc2 69extern void cgiFreeSearch(void *search);
507c4adc 70extern char *cgiGetArray(const char *name, int element);
ef416fc2 71extern void cgiGetAttributes(ipp_t *request, const char *tmpl);
f8b3a85b 72extern const char *cgiGetCookie(const char *name);
ef416fc2 73extern const cgi_file_t *cgiGetFile(void);
74extern cups_array_t *cgiGetIPPObjects(ipp_t *response, void *search);
75extern int cgiGetSize(const char *name);
76extern char *cgiGetTemplateDir(void);
507c4adc 77extern char *cgiGetVariable(const char *name);
ef416fc2 78extern int cgiInitialize(void);
79extern int cgiIsPOST(void);
fa73b229 80extern void cgiMoveJobs(http_t *http, const char *dest, int job_id);
58dc1933
MS
81extern void cgiPrintCommand(http_t *http, const char *dest,
82 const char *command, const char *title);
fa73b229 83extern void cgiPrintTestPage(http_t *http, const char *dest);
ef416fc2 84extern char *cgiRewriteURL(const char *uri, char *url, int urlsize,
85 const char *newresource);
86extern void cgiSetArray(const char *name, int element,
87 const char *value);
88extern void cgiSetCookie(const char *name, const char *value,
89 const char *path, const char *domain,
90 time_t expires, int secure);
91extern ipp_attribute_t *cgiSetIPPObjectVars(ipp_attribute_t *obj,
92 const char *prefix, int element);
93extern int cgiSetIPPVars(ipp_t *response, const char *filter_name,
94 const char *filter_value,
95 const char *prefix, int parent_el);
96extern void cgiSetServerVersion(void);
97extern void cgiSetSize(const char *name, int size);
98extern void cgiSetVariable(const char *name, const char *value);
fa73b229 99extern void cgiShowIPPError(const char *message);
ef416fc2 100extern void cgiShowJobs(http_t *http, const char *dest);
101extern void cgiStartHTML(const char *title);
58dc1933 102extern void cgiStartMultipart(void);
d2354e63 103extern int cgiSupportsMultipart(void);
fa73b229 104extern const char *cgiText(const char *message);
ef416fc2 105
ef55b745
MS
106# ifdef __cplusplus
107}
108# endif /* __cplusplus */
109
ef416fc2 110#endif /* !_CUPS_CGI_H_ */