1 /* 2 * Backend support definitions for OpenPrinting CUPS Filters. 3 * 4 * Copyright 2007-2011 by Apple Inc. 5 * Copyright 1997-2007 by Easy Software Products, all rights reserved. 6 * 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 "COPYING" 10 * which should have been included with this file. 11 */ 12 13 #ifndef _CUPSFILTERS_BACKEND_PRIVATE_H_ 14 # define _CUPSFILTERS_BACKEND_PRIVATE_H_ 15 16 17 /* 18 * Include necessary headers. 19 */ 20 21 # include <config.h> 22 # include <cups/cups.h> 23 # include <cups/ppd.h> 24 # include <cups/backend.h> 25 # include <cups/sidechannel.h> 26 # include <string.h> 27 # include <stdlib.h> 28 # include <errno.h> 29 # include <signal.h> 30 # include <unistd.h> 31 # include <fcntl.h> 32 33 # ifdef __linux 34 # include <sys/ioctl.h> 35 # include <linux/lp.h> 36 # define IOCNR_GET_DEVICE_ID 1 37 # define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len) 38 # include <linux/parport.h> 39 # include <linux/ppdev.h> 40 # endif /* __linux */ 41 42 # ifdef __sun 43 # ifdef __sparc 44 # include <sys/ecppio.h> 45 # else 46 # include <sys/ioccom.h> 47 # include <sys/ecppsys.h> 48 # endif /* __sparc */ 49 # endif /* __sun */ 50 51 52 /* 53 * C++ magic... 54 */ 55 56 # ifdef __cplusplus 57 extern "C" { 58 # endif /* __cplusplus */ 59 60 61 /* 62 * Prototypes... 63 */ 64 65 extern int backendDrainOutput(int print_fd, int device_fd); 66 extern int backendGetDeviceID(int fd, char *device_id, 67 int device_id_size, 68 char *make_model, 69 int make_model_size, 70 const char *scheme, char *uri, 71 int uri_size); 72 extern int backendGetMakeModel(const char *device_id, 73 char *make_model, 74 int make_model_size); 75 76 77 # ifdef __cplusplus 78 } 79 # endif /* __cplusplus */ 80 #endif /* !_CUPSFILTERS_BACKEND_PRIVATE_H_ */ 81 82