#ifndef _CUPS_CUPS_H_
# define _CUPS_CUPS_H_
# include <sys/types.h>
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# define __CUPS_SSIZE_T_DEFINED
typedef off_t ssize_t;
# endif
# include "ipp.h"
# include "ppd.h"
# include "language.h"
# if defined(__GNUC__) && __GNUC__ > 2
# define _CUPS_DEPRECATED __attribute__ ((__deprecated__))
# else
# define _CUPS_DEPRECATED
# endif
# ifdef __cplusplus
extern "C" {
# endif
# define CUPS_VERSION 1.0305
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 3
# define CUPS_VERSION_PATCH 5
# define CUPS_DATE_ANY -1
typedef unsigned cups_ptype_t;
enum cups_ptype_e
{
CUPS_PRINTER_LOCAL = 0x0000,
CUPS_PRINTER_CLASS = 0x0001,
CUPS_PRINTER_REMOTE = 0x0002,
CUPS_PRINTER_BW = 0x0004,
CUPS_PRINTER_COLOR = 0x0008,
CUPS_PRINTER_DUPLEX = 0x0010,
CUPS_PRINTER_STAPLE = 0x0020,
CUPS_PRINTER_COPIES = 0x0040,
CUPS_PRINTER_COLLATE = 0x0080,
CUPS_PRINTER_PUNCH = 0x0100,
CUPS_PRINTER_COVER = 0x0200,
CUPS_PRINTER_BIND = 0x0400,
CUPS_PRINTER_SORT = 0x0800,
CUPS_PRINTER_SMALL = 0x1000,
CUPS_PRINTER_MEDIUM = 0x2000,
CUPS_PRINTER_LARGE = 0x4000,
CUPS_PRINTER_VARIABLE = 0x8000,
CUPS_PRINTER_IMPLICIT = 0x10000,
CUPS_PRINTER_DEFAULT = 0x20000,
CUPS_PRINTER_FAX = 0x40000,
CUPS_PRINTER_REJECTING = 0x80000,
CUPS_PRINTER_DELETE = 0x100000,
CUPS_PRINTER_NOT_SHARED = 0x200000,
CUPS_PRINTER_AUTHENTICATED = 0x400000,
CUPS_PRINTER_COMMANDS = 0x800000,
CUPS_PRINTER_DISCOVERED = 0x1000000,
CUPS_PRINTER_OPTIONS = 0x6fffc
};
typedef const char *(*cups_password_cb_t)(const char *);
typedef struct cups_option_s
{
char *name;
char *value;
} cups_option_t;
typedef struct cups_dest_s
{
char *name,
*instance;
int is_default;
int num_options;
cups_option_t *options;
} cups_dest_t;
typedef struct cups_job_s
{
int id;
char *dest;
char *title;
char *user;
char *format;
ipp_jstate_t state;
int size;
int priority;
time_t completed_time;
time_t creation_time;
time_t processing_time;
} cups_job_t;
extern int cupsCancelJob(const char *printer, int job);
extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
const char *resource,
const char *filename);
extern ipp_t *cupsDoRequest(http_t *http, ipp_t *request,
const char *resource);
extern http_encryption_t cupsEncryption(void);
extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED;
extern const char *cupsGetDefault(void);
extern int cupsGetJobs(cups_job_t **jobs, const char *dest,
int myjobs, int completed);
extern const char *cupsGetPPD(const char *printer);
extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED;
extern ipp_status_t cupsLastError(void);
extern int cupsPrintFile(const char *printer, const char *filename,
const char *title, int num_options,
cups_option_t *options);
extern int cupsPrintFiles(const char *printer, int num_files,
const char **files, const char *title,
int num_options, cups_option_t *options);
extern char *cupsTempFile(char *filename, int len) _CUPS_DEPRECATED;
extern int cupsTempFd(char *filename, int len);
extern int cupsAddDest(const char *name, const char *instance,
int num_dests, cups_dest_t **dests);
extern void cupsFreeDests(int num_dests, cups_dest_t *dests);
extern cups_dest_t *cupsGetDest(const char *name, const char *instance,
int num_dests, cups_dest_t *dests);
extern int cupsGetDests(cups_dest_t **dests);
extern void cupsSetDests(int num_dests, cups_dest_t *dests);
extern int cupsAddOption(const char *name, const char *value,
int num_options, cups_option_t **options);
extern void cupsEncodeOptions(ipp_t *ipp, int num_options,
cups_option_t *options);
extern void cupsFreeOptions(int num_options, cups_option_t *options);
extern const char *cupsGetOption(const char *name, int num_options,
cups_option_t *options);
extern int cupsMarkOptions(ppd_file_t *ppd, int num_options,
cups_option_t *options);
extern int cupsParseOptions(const char *arg, int num_options,
cups_option_t **options);
extern const char *cupsGetPassword(const char *prompt);
extern const char *cupsServer(void);
extern void cupsSetEncryption(http_encryption_t e);
extern void cupsSetPasswordCB(cups_password_cb_t cb);
extern void cupsSetServer(const char *server);
extern void cupsSetUser(const char *user);
extern const char *cupsUser(void);
extern int cupsDoAuthentication(http_t *http, const char *method,
const char *resource);
extern http_status_t cupsGetFile(http_t *http, const char *resource,
const char *filename);
extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd);
extern http_status_t cupsPutFile(http_t *http, const char *resource,
const char *filename);
extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd);
extern const char *cupsGetDefault2(http_t *http);
extern int cupsGetDests2(http_t *http, cups_dest_t **dests);
extern int cupsGetJobs2(http_t *http, cups_job_t **jobs,
const char *dest, int myjobs,
int completed);
extern const char *cupsGetPPD2(http_t *http, const char *printer);
extern int cupsPrintFile2(http_t *http, const char *printer,
const char *filename,
const char *title, int num_options,
cups_option_t *options);
extern int cupsPrintFiles2(http_t *http, const char *printer,
int num_files, const char **files,
const char *title, int num_options,
cups_option_t *options);
extern int cupsSetDests2(http_t *http, int num_dests,
cups_dest_t *dests);
extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
double timeout);
extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
double timeout);
extern void cupsEncodeOptions2(ipp_t *ipp, int num_options,
cups_option_t *options,
ipp_tag_t group_tag);
extern const char *cupsLastErrorString(void);
extern char *cupsNotifySubject(cups_lang_t *lang, ipp_t *event);
extern char *cupsNotifyText(cups_lang_t *lang, ipp_t *event);
extern int cupsRemoveOption(const char *name, int num_options,
cups_option_t **options);
extern cups_file_t *cupsTempFile2(char *filename, int len);
extern ipp_t *cupsDoIORequest(http_t *http, ipp_t *request,
const char *resource, int infile,
int outfile);
extern char *cupsGetServerPPD(http_t *http, const char *name);
extern int cupsRemoveDest(const char *name,
const char *instance,
int num_dests, cups_dest_t **dests);
extern void cupsSetDefaultDest(const char *name,
const char *instance,
int num_dests,
cups_dest_t *dests);
# ifdef __cplusplus
}
# endif
#endif