Changeset 19
- Timestamp:
- Apr 17, 2010, 6:33:31 PM (15 years ago)
- Location:
- branches/1.0/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/src/de/readme.txt
r7 r19 3 3 Build _BUILD_ 4 4 ________________________________ 5 5 preliminary readme 6 6 CONTENTS 7 7 ________ … … 15 15 _______________ 16 16 17 add some text 17 The eCS (OS/2) Universal Port Driver (UNI.PDR) redirects the datastream 18 from a printer port to a program. It has been tested to work with ePDF 19 successfully, but should work with any program being capable to accept a 20 file as an argument on the commandline. 21 22 uni.pdr is (like smb.pdr and cups.pdr) based upon Serge Starcks lpr32.pdr. 23 Unlike the above 2 pdrs, which have the program to service hardcoded into 24 the driver, both program and parameters may be configured individually in 25 uni.pdr. 26 27 When configuring the parameter field, make sure to have the %file% token 28 on the commandline as a placeholder where the pdr will put the real filename 29 during operation. 30 31 By and large uni.pdr has the same functionality that eRedMan provides. However 32 while eRedMan has a smarter GUI right now and some nice assistant to create 33 proper commandlines, uni.pdr is much more robust in operation. Especially 34 uni.pdr honors the order of the jobs being sent to the port, while eRedMan 35 does not. 18 36 19 37 2. License 20 38 __________ 21 39 22 40 Same as smb.pdr, cups.pdr and lpr32.pdr. To be specified yet. 23 41 24 42 … … 28 46 v1.0 alpha1: 29 47 - changelog created 30 - internal versional network interfaces on one system48 - got it working -
branches/1.0/src/de/uni.dlg
r14 r19 6 6 DLGTEMPLATE IDD_UNI LOADONCALL MOVEABLE DISCARDABLE 7 7 BEGIN 8 DIALOG "Port Properties - ", IDD_UNI, 19, 37, 233, 156, FS_NOBYTEALIGN |8 DIALOG "Port Properties - ", IDD_UNI, 19, 122, 237, 71, FS_NOBYTEALIGN | 9 9 WS_VISIBLE | WS_SYNCPAINT, FCF_SYSMENU | FCF_TITLEBAR | 10 10 FCF_NOBYTEALIGN … … 13 13 DEFPUSHBUTTON "OK", DID_OK, 5, 5, 76, 14 14 14 PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold" 15 PUSHBUTTON "Cancel ", DID_CANCEL, 1 49, 5, 76, 1415 PUSHBUTTON "Cancel ", DID_CANCEL, 150, 5, 76, 14 16 16 PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold" 17 GROUPBOX "Universal port driver properties", GB_UNICFG, 5, 96,18 220, 54,17 GROUPBOX "Universal port driver properties", GB_UNICFG, 5, 23, 18 220, 42 19 19 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00000000L 20 20 PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold" 21 GROUPBOX "Login as", 1024, 5, 53, 220, 40, NOT WS_VISIBLE 22 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00000000L 23 PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold" 24 LTEXT "Program:", DT_PROGRAM, 13, 130, 53, 8, DT_VCENTER 25 ENTRYFIELD "", ID_PROGRAM, 71, 131, 142, 8, ES_MARGIN 26 LTEXT "Parameters:", DT_PARAMETERS, 13, 116, 53, 8, 21 LTEXT "Program:", DT_PROGRAM, 13, 45, 53, 8, DT_VCENTER 22 ENTRYFIELD "", ID_PROGRAM, 71, 46, 142, 8, ES_MARGIN 23 LTEXT "Parameters:", DT_PARAMETERS, 13, 31, 53, 8, 27 24 DT_VCENTER 28 ENTRYFIELD "", ID_PARAMETERS, 71, 103, 142, 8, ES_MARGIN 29 LTEXT "Printer:", DT_UNIQUEUE, 13, 102, 53, 8, DT_VCENTER | 30 NOT WS_VISIBLE 31 ENTRYFIELD "", ID_UNIQUEUE, 71, 103, 142, 8, ES_MARGIN | NOT 32 WS_VISIBLE 33 AUTOCHECKBOX "Send as binary file", ID_BINARY, 115, 148, 75, 8, 25 ENTRYFIELD "", ID_PARAMETERS, 71, 32, 142, 8, ES_MARGIN 26 AUTOCHECKBOX "Send as binary file", ID_BINARY, 115, 63, 75, 8, 34 27 NOT WS_VISIBLE | WS_DISABLED 35 GROUPBOX "Number of copies", GB_COPIES, 5, 24, 220, 26, NOT28 GROUPBOX "Number of copies", GB_COPIES, 230, 43, 5, 26, NOT 36 29 WS_VISIBLE 37 30 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00000000L 38 31 PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold" 39 LTEXT "Spool this job", DT_COPIES, 13, 30, 54, 8,32 LTEXT "Spool this job", DT_COPIES, 230, 33, 7, 8, 40 33 DT_VCENTER | NOT WS_VISIBLE 41 LTEXT "times to the server", DT_COPIES2, 104, 30, 83, 8,34 LTEXT "times to the server", DT_COPIES2, 229, 23, 7, 8, 42 35 DT_VCENTER | NOT WS_VISIBLE 43 ENTRYFIELD "", ID_COPIES, 71, 31, 23, 8, ES_MARGIN | NOT36 ENTRYFIELD "", ID_COPIES, 101, 7, 23, 8, ES_MARGIN | NOT 44 37 WS_VISIBLE 45 38 END -
branches/1.0/src/uni.c
r18 r19 61 61 62 62 /* replace one string by another */ 63 char * searchReplace(char *search, char *replace, char *string) 63 /* 64 int main() 65 { 66 char string[100] = "ich bin ein file: %file%"; 67 char search[] = "%file%"; 68 char replace[] = "datei___datei"; 69 char *replaced; 70 71 // allocate needed space for the returning string 72 replaced = malloc((strlen(string) - strlen(search) + strlen(replace)) * sizeof(char)); 73 74 printf("vorher: %s\n", string); 75 searchReplace(search, replace, string, replaced); 76 printf("nachher: %s\n", replaced); 77 78 free(replaced); 79 return 0; 80 } 81 */ 82 83 BOOL searchReplace(const UCHAR *search, const UCHAR *replace, const UCHAR *string, UCHAR *replaced) 64 84 { 65 85 // creat init some variables 66 char * tempString,*searchStart;86 UCHAR *searchStart; 67 87 int len = 0; 68 88 … … 71 91 if (searchStart == NULL) 72 92 { 73 return string; 93 strncpy(replaced, string, strlen(replaced)); 94 return FALSE; 74 95 } 75 76 // allocate needed space for the tempstring77 tempString = malloc((strlen(string) - strlen(search) + strlen(replace)) * sizeof(char));78 96 79 97 // copy first part 80 98 len = searchStart - string; 81 strncpy( tempString, string, len);99 strncpy(replaced, string, len); 82 100 83 101 // add the replaced string 84 strcat( tempString, replace);102 strcat(replaced, replace); 85 103 86 104 // add the last part 87 105 len += strlen(search); 88 strcat(tempString, string+len); 89 90 // memory leek!!! free(tempString); 91 return tempString; 106 strcat(replaced, string+len); 107 108 return TRUE; 92 109 } 93 110 … … 265 282 { 266 283 case DID_OK: 267 sprintf(szDesc," \\");284 sprintf(szDesc," "); 268 285 /* Program */ 269 286 WinQueryDlgItemText (hDlg, ID_PROGRAM, sizeof(szTemp), szTemp ); … … 271 288 strcat(pLprData->szSaveLprSetting,"#"); 272 289 273 /*if (strlen(szTemp) > 0) {274 strncat(szDesc, " \\", STR_LEN_PORTDESC - 1);290 if (strlen(szTemp) > 0) { 291 strncat(szDesc, " ", STR_LEN_PORTDESC - 1); 275 292 strncat(szDesc, szTemp, STR_LEN_PORTDESC - 1); 276 293 } 277 strncat(szDesc, " \\", STR_LEN_PORTDESC - 1);278 strncat(szDesc, szShareName, STR_LEN_PORTDESC - 1); */294 strncat(szDesc, " ", STR_LEN_PORTDESC - 1); 295 strncat(szDesc, szShareName, STR_LEN_PORTDESC - 1); 279 296 280 297 /* Parameters */ … … 282 299 strcat(pLprData->szSaveLprSetting,szTemp); 283 300 strncpy(szShareName, szTemp, STR_LEN_PORTDESC - 1); 301 if (strlen(szTemp) > 0) { 302 strncat(szShareName, " ", STR_LEN_PORTDESC - 1); 303 strncat(szShareName, szTemp, STR_LEN_PORTDESC - 1); 304 } 284 305 285 306 /* Printername | Queue */ … … 988 1009 UCHAR arg[256]; 989 1010 UCHAR j_parms[256] ; 1011 UCHAR *f_parms; 990 1012 UCHAR j_id[3]; 991 1013 UCHAR parameters[256]; … … 1070 1092 1071 1093 1072 sprintf(j_parms,parameters); 1073 searchReplace("%file%",filename,j_parms); 1094 f_parms = malloc((strlen(parameters) - strlen("%file%") + strlen(filename)) * sizeof(UCHAR)); 1095 1096 searchReplace("%file%", filename, parameters, f_parms); 1097 1098 sprintf(j_parms,f_parms); 1099 free(f_parms); 1074 1100 1075 1101 rc = spawnlp(P_WAIT,binfile,binfile,j_parms,NULL);
Note:
See TracChangeset
for help on using the changeset viewer.