]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/backend-private.h
Full sweep of all Clang warnings, plus some bug fixes for incorrect memcpy usage.
[thirdparty/cups.git] / backend / backend-private.h
index 1b2204aadd78d5dc03e2c6de997b6a1e008c24a2..1d211e3ed31fc5d92013896582e424fdcdbe9edf 100644 (file)
@@ -1,18 +1,18 @@
 /*
- * "$Id: backend-private.h 6649 2007-07-11 21:46:42Z mike $"
+ * "$Id$"
  *
- *   Backend support definitions for the Common UNIX Printing System (CUPS).
+ * Backend support definitions for CUPS.
  *
- *   Copyright 2007-2008 by Apple Inc.
- *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ * Copyright 2007-2014 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- *   "LICENSE" which should have been included with this file.  If this
- *   file is missing or damaged, see the license at "http://www.cups.org/".
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ * "LICENSE" which should have been included with this file.  If this
+ * file is missing or damaged, see the license at "http://www.cups.org/".
  *
- *   This file is subject to the Apple OS-Developed Software exception.
+ * This file is subject to the Apple OS-Developed Software exception.
  */
 
 #ifndef _CUPS_BACKEND_PRIVATE_H_
  * Include necessary headers.
  */
 
+#  include <cups/cups-private.h>
+#  include <cups/snmp-private.h>
 #  include <cups/backend.h>
 #  include <cups/sidechannel.h>
-#  include <cups/cups.h>
-#  include <cups/debug.h>
-#  include <cups/i18n.h>
-#  include <cups/snmp-private.h>
-#  include <stdlib.h>
-#  include <errno.h>
-#  include <cups/string.h>
 #  include <signal.h>
 
+#  ifdef __linux
+#    include <sys/ioctl.h>
+#    include <linux/lp.h>
+#    define IOCNR_GET_DEVICE_ID                1
+#    define LPIOC_GET_DEVICE_ID(len)   _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
+#    include <linux/parport.h>
+#    include <linux/ppdev.h>
+#    include <unistd.h>
+#    include <fcntl.h>
+#  endif /* __linux */
+
+#  ifdef __sun
+#    ifdef __sparc
+#      include <sys/ecppio.h>
+#    else
+#      include <sys/ioccom.h>
+#      include <sys/ecppsys.h>
+#    endif /* __sparc */
+#  endif /* __sun */
+
 
 /*
  * C++ magic...
@@ -51,6 +66,9 @@ extern "C" {
 /* Host MIB */
 #define CUPS_OID_mib2                          1,3,6,1,2,1
 
+#define CUPS_OID_system                                CUPS_OID_mib2,1
+#define CUPS_OID_sysLocation                   CUPS_OID_system,6
+
 #define CUPS_OID_host                          CUPS_OID_mib2,25
 
 #define CUPS_OID_hrSystem                      CUPS_OID_host,1
@@ -75,6 +93,7 @@ extern "C" {
 #define CUPS_OID_prtGeneral                    CUPS_OID_printmib,5
 #define CUPS_OID_prtGeneralTable               CUPS_OID_prtGeneral,1
 #define CUPS_OID_prtGeneralEntry               CUPS_OID_prtGeneralTable,1
+#define CUPS_OID_prtGeneralCurrentLocalization CUPS_OID_prtGeneralEntry,2
 #define CUPS_OID_prtGeneralPrinterName         CUPS_OID_prtGeneralEntry,16
 #define CUPS_OID_prtGeneralSerialNumber                CUPS_OID_prtGeneralEntry,17
 
@@ -84,6 +103,11 @@ extern "C" {
 #define CUPS_OID_prtCoverDescription           CUPS_OID_prtCoverEntry,2
 #define CUPS_OID_prtCoverStatus                        CUPS_OID_prtCoverEntry,3
 
+#define CUPS_OID_prtLocalization               CUPS_OID_printmib,7
+#define CUPS_OID_prtLocalizationTable          CUPS_OID_prtLocalization,1
+#define CUPS_OID_prtLocalizationEntry          CUPS_OID_prtLocalizationTable,1
+#define CUPS_OID_prtLocalizationCharacterSet   CUPS_OID_prtLocalizationEntry,4
+
 #define CUPS_OID_prtMarker                     CUPS_OID_printmib,10
 #define CUPS_OID_prtMarkerTable                        CUPS_OID_prtMarker,2
 #define CUPS_OID_prtMarkerEntry                        CUPS_OID_prtMarkerTable,1
@@ -235,6 +259,45 @@ extern "C" {
 #define CUPS_TC_inserts                                33
 #define CUPS_TC_covers                         34
 
+#define CUPS_TC_tenThousandthsOfInches         3
+#define CUPS_TC_micrometers                    4
+#define CUPS_TC_impressions                    7
+#define CUPS_TC_sheets                         8
+#define CUPS_TC_hours                          11
+#define CUPS_TC_thousandthsOfOunces            12
+#define CUPS_TC_tenthsOfGrams                  13
+#define CUPS_TC_hundrethsOfFluidOunces         14
+#define CUPS_TC_tenthsOfMilliliters            15
+#define CUPS_TC_feet                           16
+#define CUPS_TC_meters                         17
+#define CUPS_TC_items                          18
+#define CUPS_TC_percent                                19
+
+/* These come from RFC 3808 to define character sets we support */
+/* Also see http://www.iana.org/assignments/character-sets */
+#define CUPS_TC_csASCII                                3
+#define CUPS_TC_csISOLatin1                    4
+#define CUPS_TC_csShiftJIS                     17
+#define CUPS_TC_csUTF8                         106
+#define CUPS_TC_csUnicode                      1000 /* UCS2 BE */
+#define CUPS_TC_csUCS4                         1001 /* UCS4 BE */
+#define CUPS_TC_csUnicodeASCII                 1002
+#define CUPS_TC_csUnicodeLatin1                        1003
+#define CUPS_TC_csUTF16BE                      1013
+#define CUPS_TC_csUTF16LE                      1014
+#define CUPS_TC_csUTF32                                1017
+#define CUPS_TC_csUTF32BE                      1018
+#define CUPS_TC_csUTF32LE                      1019
+#define CUPS_TC_csWindows31J                   2024
+
+
+/*
+ * Types...
+ */
+
+typedef int (*_cups_sccb_t)(int print_fd, int device_fd, int snmp_fd,
+                           http_addr_t *addr, int use_bc);
+
 
 /*
  * Prototypes...
@@ -250,20 +313,19 @@ extern int                backendGetDeviceID(int fd, char *device_id,
                                           int uri_size);
 extern int             backendGetMakeModel(const char *device_id,
                                            char *make_model,
-                                           int make_model_size);
-extern void            backendNetworkSideCB(int print_fd, int device_fd,
+                                           size_t make_model_size);
+extern int             backendNetworkSideCB(int print_fd, int device_fd,
                                             int snmp_fd, http_addr_t *addr,
                                             int use_bc);
 extern ssize_t         backendRunLoop(int print_fd, int device_fd, int snmp_fd,
                                       http_addr_t *addr, int use_bc,
-                                      void (*side_cb)(int print_fd,
-                                                      int device_fd,
-                                                      int snmp_fd,
-                                                      http_addr_t *addr,
-                                                      int use_bc));
+                                      int update_state, _cups_sccb_t side_cb);
 extern int             backendSNMPSupplies(int snmp_fd, http_addr_t *addr,
                                            int *page_count,
                                            int *printer_state);
+extern int             backendWaitLoop(int snmp_fd, http_addr_t *addr,
+                                       int use_bc, _cups_sccb_t side_cb);
+
 
 #  ifdef __cplusplus
 }
@@ -272,5 +334,5 @@ extern int          backendSNMPSupplies(int snmp_fd, http_addr_t *addr,
 
 
 /*
- * End of "$Id: backend-private.h 6649 2007-07-11 21:46:42Z mike $".
+ * End of "$Id$".
  */