00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #if 0
00034 #define DEBUG 1
00035 #endif
00036
00037 #ifdef DEBUG
00038 #define DODEBUG(a) uprint_debug a
00039 void uprint_debug(const char *string, ...);
00040 #else
00041 #define DODEBUG(a)
00042 #endif
00043
00044
00045 #define LPR_CONNECT_TIMEOUT 20
00046
00047
00048 #define LPR_PREVID_FILE RUNDIR"/lastid_uprint_lpr"
00049
00050
00051 #define UPRINT_LOGFILE LOGDIR"/uprint"
00052
00053
00054 #define UPRINT_SIGNITURE 0x8391
00055
00056
00057 int uprint_parse_lp_interface_options(void *p);
00058 int uprint_parse_lp_filter_modes(void *p);
00059
00060
00061 #define MAX_MAILADDR 127
00062 #define MAX_PRINCIPAL 127
00063 #define MAX_FOR 127
00064
00065
00066 #define UPRINT_RFC1179 HOMEDIR"/lib/uprint_rfc1179"
00067
00068
00069 struct UPRINT
00070 {
00071 int signiture;
00072
00073 const char *fakername;
00074 const char **argv;
00075 int argc;
00076
00077 const char *dest;
00078 const char **files;
00079
00080 uid_t uid;
00081 gid_t gid;
00082 const char *user;
00083 const char *from_format;
00084 const char *lpr_mailto;
00085 const char *lpr_mailto_host;
00086 const char *fromhost;
00087 const char *proxy_class;
00088 const char *lpr_class;
00089 const char *jobname;
00090 const char *pr_title;
00091
00092 const char *content_type_lp;
00093 char content_type_lpr;
00094 int copies;
00095 gu_boolean banner;
00096 gu_boolean nobanner;
00097 gu_boolean filebreak;
00098 int priority;
00099 gu_boolean immediate_copy;
00100
00101 const char *form;
00102 const char *charset;
00103 const char *width;
00104 const char *length;
00105 const char *indent;
00106 const char *cpi;
00107 const char *lpi;
00108 const char *troff_1;
00109 const char *troff_2;
00110 const char *troff_3;
00111 const char *troff_4;
00112
00113
00114 char *lp_interface_options;
00115 char *lp_filter_modes;
00116 const char *lp_pagelist;
00117 const char *lp_handling;
00118
00119
00120 const char *osf_LT_inputtray;
00121 const char *osf_GT_outputtray;
00122 const char *osf_O_orientation;
00123 const char *osf_K_duplex;
00124 int nup;
00125
00126 gu_boolean unlink;
00127 gu_boolean show_jobid;
00128 gu_boolean notify_email;
00129 gu_boolean notify_write;
00130
00131
00132 const char *ppr_responder;
00133 const char *ppr_responder_address;
00134 const char *ppr_responder_options;
00135
00136
00137 char str_numcopies[5];
00138 char str_typeswitch[3];
00139 char str_mailaddr[MAX_MAILADDR + 1];
00140 char str_principal[MAX_PRINCIPAL + 1];
00141 char str_for[MAX_FOR + 1];
00142 char str_pr_title[11 + (LPR_MAX_T * 2) + 1];
00143 char str_width[12];
00144 char str_length[12];
00145 char str_lpi[12];
00146 char str_cpi[12];
00147 char str_priority[3];
00148 char str_inputtray[sizeof("*InputSlot ") + LPR_MAX_DEC + 1];
00149 char str_outputtray[sizeof("*OutputBin ") + LPR_MAX_DEC + 1];
00150 char str_orientation[sizeof("orientation=") + LPR_MAX_DEC + 1];
00151 char str_nup[4];
00152 } ;
00153
00154
00155 struct LP_LPR_TYPE_XLATE
00156 {
00157 const char *lpname;
00158 char lprcode;
00159 } ;
00160
00161 extern struct LP_LPR_TYPE_XLATE lp_lpr_type_xlate[];
00162
00163
00164 const char *uprint_lpr_printcap(void);
00165 const char *uprint_lp_printers(void);
00166 const char *uprint_lp_classes(void);
00167 gu_boolean uprint_lp_printers_conf(void);
00168
00169
00170 char uprint_get_content_type_lpr(void *p);
00171
00172
00173 int uprint_run_rfc1179(const char exepath[], const char *const argv[]);
00174
00175
00176