]> git.ipfire.org Git - thirdparty/cups.git/blame - cgi-bin/cgi.h
Fix source file header text duplication text duplication.
[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 *
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
57b7b66b 11 * 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
39extern "C" {
40# endif /* __cplusplus */
41
ef416fc2 42/*
43 * Types...
44 */
45
46typedef 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
60extern void cgiAbort(const char *title, const char *stylesheet,
61 const char *format, ...);
62extern int cgiCheckVariables(const char *names);
ef55b745 63extern void cgiClearVariables(void);
ef416fc2 64extern void *cgiCompileSearch(const char *query);
65extern void cgiCopyTemplateFile(FILE *out, const char *tmpl);
66extern void cgiCopyTemplateLang(const char *tmpl);
67extern int cgiDoSearch(void *search, const char *text);
68extern void cgiEndHTML(void);
58dc1933 69extern void cgiEndMultipart(void);
f8b3a85b
MS
70extern char *cgiFormEncode(char *dst, const char *src,
71 size_t dstsize);
ef416fc2 72extern void cgiFreeSearch(void *search);
73extern const char *cgiGetArray(const char *name, int element);
74extern void cgiGetAttributes(ipp_t *request, const char *tmpl);
f8b3a85b 75extern const char *cgiGetCookie(const char *name);
ef416fc2 76extern const cgi_file_t *cgiGetFile(void);
77extern cups_array_t *cgiGetIPPObjects(ipp_t *response, void *search);
78extern int cgiGetSize(const char *name);
79extern char *cgiGetTemplateDir(void);
80extern const char *cgiGetVariable(const char *name);
81extern int cgiInitialize(void);
82extern int cgiIsPOST(void);
fa73b229 83extern void cgiMoveJobs(http_t *http, const char *dest, int job_id);
58dc1933
MS
84extern void cgiPrintCommand(http_t *http, const char *dest,
85 const char *command, const char *title);
fa73b229 86extern void cgiPrintTestPage(http_t *http, const char *dest);
ef416fc2 87extern char *cgiRewriteURL(const char *uri, char *url, int urlsize,
88 const char *newresource);
89extern void cgiSetArray(const char *name, int element,
90 const char *value);
91extern void cgiSetCookie(const char *name, const char *value,
92 const char *path, const char *domain,
93 time_t expires, int secure);
94extern ipp_attribute_t *cgiSetIPPObjectVars(ipp_attribute_t *obj,
95 const char *prefix, int element);
96extern int cgiSetIPPVars(ipp_t *response, const char *filter_name,
97 const char *filter_value,
98 const char *prefix, int parent_el);
99extern void cgiSetServerVersion(void);
100extern void cgiSetSize(const char *name, int size);
101extern void cgiSetVariable(const char *name, const char *value);
fa73b229 102extern void cgiShowIPPError(const char *message);
ef416fc2 103extern void cgiShowJobs(http_t *http, const char *dest);
104extern void cgiStartHTML(const char *title);
58dc1933 105extern void cgiStartMultipart(void);
d2354e63 106extern int cgiSupportsMultipart(void);
fa73b229 107extern const char *cgiText(const char *message);
ef416fc2 108
ef55b745
MS
109# ifdef __cplusplus
110}
111# endif /* __cplusplus */
112
ef416fc2 113#endif /* !_CUPS_CGI_H_ */