]> git.ipfire.org Git - thirdparty/cups.git/blame - cgi-bin/cgi.h
License change: Apache License, Version 2.0.
[thirdparty/cups.git] / cgi-bin / cgi.h
CommitLineData
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 *
e3101897 7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
ef416fc2 8 */
9
10#ifndef _CUPS_CGI_H_
11# define _CUPS_CGI_H_
12
13# include <stdio.h>
14# include <stdlib.h>
15# include <time.h>
16# include <sys/stat.h>
17
18# ifdef WIN32
19# include <direct.h>
20# include <io.h>
21# else
22# include <unistd.h>
23# endif /* WIN32 */
24
25# include <cups/cups.h>
26# include <cups/array.h>
27# include "help-index.h"
28
29
ef55b745
MS
30/*
31 * C++ magic...
32 */
33
34# ifdef __cplusplus
35extern "C" {
36# endif /* __cplusplus */
37
ef416fc2 38/*
39 * Types...
40 */
41
42typedef struct cgi_file_s /**** Uploaded file data ****/
43{
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 */
49} cgi_file_t;
50
51
52/*
53 * Prototypes...
54 */
55
56extern void cgiAbort(const char *title, const char *stylesheet,
57 const char *format, ...);
58extern int cgiCheckVariables(const char *names);
ef55b745 59extern void cgiClearVariables(void);
ef416fc2 60extern void *cgiCompileSearch(const char *query);
61extern void cgiCopyTemplateFile(FILE *out, const char *tmpl);
62extern void cgiCopyTemplateLang(const char *tmpl);
63extern int cgiDoSearch(void *search, const char *text);
64extern void cgiEndHTML(void);
58dc1933 65extern void cgiEndMultipart(void);
f8b3a85b
MS
66extern char *cgiFormEncode(char *dst, const char *src,
67 size_t dstsize);
ef416fc2 68extern void cgiFreeSearch(void *search);
69extern const char *cgiGetArray(const char *name, int element);
70extern void cgiGetAttributes(ipp_t *request, const char *tmpl);
f8b3a85b 71extern const char *cgiGetCookie(const char *name);
ef416fc2 72extern const cgi_file_t *cgiGetFile(void);
73extern cups_array_t *cgiGetIPPObjects(ipp_t *response, void *search);
74extern int cgiGetSize(const char *name);
75extern char *cgiGetTemplateDir(void);
76extern const char *cgiGetVariable(const char *name);
77extern int cgiInitialize(void);
78extern int cgiIsPOST(void);
fa73b229 79extern void cgiMoveJobs(http_t *http, const char *dest, int job_id);
58dc1933
MS
80extern void cgiPrintCommand(http_t *http, const char *dest,
81 const char *command, const char *title);
fa73b229 82extern void cgiPrintTestPage(http_t *http, const char *dest);
ef416fc2 83extern char *cgiRewriteURL(const char *uri, char *url, int urlsize,
84 const char *newresource);
85extern void cgiSetArray(const char *name, int element,
86 const char *value);
87extern void cgiSetCookie(const char *name, const char *value,
88 const char *path, const char *domain,
89 time_t expires, int secure);
90extern ipp_attribute_t *cgiSetIPPObjectVars(ipp_attribute_t *obj,
91 const char *prefix, int element);
92extern int cgiSetIPPVars(ipp_t *response, const char *filter_name,
93 const char *filter_value,
94 const char *prefix, int parent_el);
95extern void cgiSetServerVersion(void);
96extern void cgiSetSize(const char *name, int size);
97extern void cgiSetVariable(const char *name, const char *value);
fa73b229 98extern void cgiShowIPPError(const char *message);
ef416fc2 99extern void cgiShowJobs(http_t *http, const char *dest);
100extern void cgiStartHTML(const char *title);
58dc1933 101extern void cgiStartMultipart(void);
d2354e63 102extern int cgiSupportsMultipart(void);
fa73b229 103extern const char *cgiText(const char *message);
ef416fc2 104
ef55b745
MS
105# ifdef __cplusplus
106}
107# endif /* __cplusplus */
108
ef416fc2 109#endif /* !_CUPS_CGI_H_ */