1/* 2 * "$Id: ppdx.h 3835 2012-05-23 22:57:19Z msweet $" 3 * 4 * Header for PPD data encoding example code. 5 * 6 * Copyright 2012 by Apple Inc. 7 * 8 * These coded instructions, statements, and computer programs are the 9 * property of Apple Inc. and are protected by Federal copyright 10 * law. Distribution and use rights are outlined in the file "LICENSE.txt" 11 * which should have been included with this file. If this file is 12 * file is missing or damaged, see the license at "http://www.cups.org/". 13 * 14 * This file is subject to the Apple OS-Developed Software exception. 15 * 16 */ 17 18#ifndef _PPDX_H_ 19# define _PPDX_H_ 20 21 22/* 23 * Include necessary headers... 24 */ 25 26# include <cups/ppd.h> 27 28 29/* 30 * C++ magic... 31 */ 32 33# ifdef __cplusplus 34extern "C" { 35# endif /* __cplusplus */ 36 37 38/* 39 * Maximum amount of data to encode/decode... 40 */ 41 42# define PPDX_MAX_STATUS 1024 /* Limit on log messages in 10.6 */ 43# define PPDX_MAX_DATA 16777216/* 16MiB */ 44 45 46/* 47 * 'ppdxReadData()' - Read encoded data from a ppd_file_t *. 48 * 49 * Reads chunked data in the PPD file "ppd" using the prefix "name". Returns 50 * an allocated pointer to the data (which is nul-terminated for convenience) 51 * along with the length of the data in the variable pointed to by "datasize", 52 * which can be NULL to indicate the caller doesn't need the length. 53 * 54 * Returns NULL if no data is present in the PPD with the prefix. 55 */ 56 57extern void *ppdxReadData(ppd_file_t *ppd, const char *name, 58 size_t *datasize); 59 60 61/* 62 * 'ppdxWriteData()' - Writes encoded data to stderr using PPD: messages. 63 * 64 * Writes chunked data to the PPD file using PPD: messages sent to stderr for 65 * cupsd. "name" must be a valid PPD keyword string whose length is less than 66 * 37 characters to allow for chunk numbering. "data" provides a pointer to the 67 * data to be written, and "datasize" provides the length. 68 */ 69 70extern void ppdxWriteData(const char *name, const void *data, 71 size_t datasize); 72 73 74# ifdef __cplusplus 75} 76# endif /* __cplusplus */ 77 78#endif /* !_PPDX_H */ 79 80/* 81 * End of "$Id: ppdx.h 3835 2012-05-23 22:57:19Z msweet $". 82 */ 83