| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 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; |
| 102 |
|
| 103 |
JSAMPROW fRow_array[1]; |
| 104 |
|
| 105 |
|
| 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; |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
#endif |