Debian Codegraph @

fax/filters/cdmfax/hpcupscdmfax.h

raw symbols SCIP
1 /*****************************************************************************\
2 hpcupscdmfax.h : HP Cups Fax Filter
3
4 Copyright (c) 2001 - 2015, HP Co.
5 All rights reserved.
6
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
9 are met:
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. Neither the name of the Hewlett-Packard nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 NOT LIMITED TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR
25 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
28 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 POSSIBILITY OF SUCH DAMAGE.
30 \*****************************************************************************/
31
32 #ifndef HPCUPSCDMFAX_H
33 #define HPCUPSCDMFAX_H
34 #include <cups/ppd.h>
35 #include "jetlib.h"
36
37 extern "C"
38 {
39 #ifndef JPEGLIB_H
40 #include "jpeglib.h"
41 #endif
42 }
43
44 extern "C"
45 {
46 #include <stddef.h>
47 #include <stdio.h>
48 #include <setjmp.h>
49 }
50
51 #define STORE_JPEG
52 #define PRINT_CUPS_HEADER
53
54 typedef unsigned char BYTE;
55 typedef BYTE *PBYTE;
56
57 #define CUPS_TMP_DIR getenv("TMPDIR") ? : getenv("HOME") ?:"/tmp"
58
59 #define FILE_NAME_SIZE 128
60 #define MAX_FILE_PATH_LEN 128
61 #define MAX_BUFF_SIZE 409600
62
63 unsigned long m_ulCookie;
64 HP_StreamHandleType m_ptJetlibStream;
65 const unsigned int QTABLE_SIZE = 64;
66 const BYTE JREndPageSeq[] = {0x44};
67 const BYTE JREndSessionSeq[] = {0x42};
68 const BYTE JRCloseDataSourceSeq[] = {0x49};
69
70 const char pstrFaxGroupJAType[] = "GROUP";
71 const char pstrFaxStringJAType[] = "STRING";
72 const char pstrFaxEnumJAType[] = "ENUM";
73
74 const char pstrFaxDestGroupJANamePrefix[] = "fax.faxDest";
75 const char pstrFaxDestJANameNumberSuffix[] = "number";
76 const char pstrFaxDestJANameBillingCodeSuffix[] = "billingCode";
77
78 const char pstrFaxDestJANameBillingCode[] = "fax.faxDest.billingCode";
79 const char pstrFaxDestJANameResMode[] = "fax.attachment.resMode";
80 const char pstrFaxDestJANameNotificationType[] = "fax.notification.notifyOn";
81 const char pstrFaxDestJANameNotificationMethod[] = "fax.notification.notifyType";
82 const char pstrFaxEMailDestGroupJANamePrefix[] = "fax.notification.emailDest";
83 const char pstrFaxEMailDestGroupJANameAddressSuffix[] = "address";
84 const char pstrFaxThumbnailOnConfirmationPage[] = "fax.thumbnailconfirmation";
85 const char PJLExit[] = "\x1b%-12345X@PJL EOJ\012\x1b%-12345X";
86
87 void clearStream();
88 int send_data_to_stdout(int fromFD);
89 int createTempFile(char *szFileName, FILE **pFilePtr);
90
91 typedef struct _QTABLEINFO
92 {
93
94 unsigned int qtable0[QTABLE_SIZE];
95 unsigned int qtable1[QTABLE_SIZE];
96 unsigned int qtable2[QTABLE_SIZE];
97 int qFactor;
98
99 } QTABLEINFO, *PQTABLEINFO;
100
101 BYTE *fpJPEGBuffer; // This is passed destination JPEG buffer
102
103 JSAMPROW fRow_array[1]; // JPEG processing routine expects an
104 // array of pointers. We always send
105 // 1 row at a time.
106
107 unsigned long fBufferSize;
108 struct jpeg_compress_struct cinfo;
109 struct jpeg_decompress_struct dinfo;
110 struct jpeg_error_mgr jerr;
111 struct jpeg_destination_mgr dest;
112 jmp_buf setjmp_buffer; // for return to caller
113
114
115
116 #endif /* hpcupscdmfax_H */