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