Changeset 30
- Timestamp:
- May 7, 2010, 6:49:10 PM (15 years ago)
- Location:
- branches/1.0/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/src/build.cmd
r29 r30 3 3 @del uni.o 4 4 @del uni.pdr 5 @del .\en\uni.res 5 6 @del .\de\uni.res 6 7 echo Done. 7 8 echo Compiling. 8 gcc -o utils.o utils.c -c >build.log9 gcc -o splpd.o splpd.c -c >>build.log10 gcc -o uni.o uni.c -c >>build.log9 gcc -o utils.o utils.c -c >build.log 10 gcc -o splpd.o splpd.c -c >>build.log 11 gcc -o uni.o uni.c -c >>build.log 11 12 echo Done. 12 13 echo Compiling resources. 13 14 cd de 14 RC -r uni. RC uni.RES >>build.log15 RC -r uni.rc uni.res >>..\build.log 15 16 cd .. 16 17 echo Done. … … 21 22 ea2 -e DEFAULT_PORT=UNI uni.pdr >>build.log 22 23 echo Done. 23 remd:24 remcd \OS2\DLL25 remlxunlock uni.pdr24 d: 25 cd \OS2\DLL 26 lxunlock uni.pdr -
branches/1.0/src/de/uni.dlg
r29 r30 13 13 DEFPUSHBUTTON "OK", DID_OK, 5, 5, 76, 14 14 14 PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold" 15 PUSHBUTTON "Cancel 15 PUSHBUTTON "Cancel", DID_CANCEL, 149, 5, 76, 14 16 16 PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold" 17 17 GROUPBOX "Universal port driver properties", GB_UNICFG, 5, 24, … … 19 19 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00000000L 20 20 PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold" 21 LTEXT "P rogram:", DT_PROGRAM, 13, 118, 53, 8, DT_VCENTER21 LTEXT "Path amd file:", DT_PROGRAM, 13, 118, 53, 8, DT_VCENTER 22 22 ENTRYFIELD "", ID_PROGRAM, 15, 106, 200, 8, ES_MARGIN 23 23 LTEXT "Parameters:", DT_PARAMETERS, 13, 71, 204, 8, … … 26 26 LTEXT "Working directory:", DT_DIRECTORY, 13, 45, 203, 8 27 27 ENTRYFIELD "", ID_DIRECTORY, 15, 33, 200, 8, ES_MARGIN 28 PUSHBUTTON " Find", DID_FIND, 13, 86, 62, 1428 PUSHBUTTON "~Find...", DID_FIND, 13, 86, 62, 14 29 29 PUSHBUTTON "Setup Wizard", DID_SETUPWIZARD, 155, 86, 62, 14 30 30 END -
branches/1.0/src/splpd.c
r28 r30 489 489 char arg[256]; 490 490 char *j_parms; 491 int allocSize = 0; 491 492 char j_id[3]; 492 493 char parameters[256]; … … 506 507 char spool_dir[256]; 507 508 ULONG ulBootDrive; 509 char *p1 = NULL; 510 char *p2 = NULL; 511 char *p3 = NULL; 512 char *p4 = NULL; 513 char *p5 = NULL; 514 char *p6 = NULL; 515 char *p7 = NULL; 516 char *p8 = NULL; 517 char *p9 = NULL; 508 518 509 519 rc = PrfQueryProfileString (HINI_SYSTEMPROFILE, … … 568 578 // decryptPassword(password_enc,password_dec); 569 579 570 j_parms = malloc((strlen(parameters) - strlen("%file%") + strlen(filename)) * sizeof(char)); 571 572 searchReplace("%file%", filename, parameters, j_parms); 580 // allocate needed space for the returning string +1 (for string terminator) 581 allocSize = strlen(parameters) - strlen("%file%") + strlen(filename); 582 583 j_parms = malloc((allocSize +1) * sizeof(char)); 584 585 // searchReplace(search, replace, string, replaced, allocSize); 586 searchReplace("%file%", filename, parameters, j_parms, allocSize); 587 588 // split into single paramters 589 p1 = strtok (j_parms, " "); 590 p2 = strtok (NULL, " "); 591 p3 = strtok (NULL, " "); 592 p4 = strtok (NULL, " "); 593 p5 = strtok (NULL, " "); 594 p6 = strtok (NULL, " "); 595 p7 = strtok (NULL, " "); 596 p8 = strtok (NULL, " "); 597 p9 = strtok (NULL, " "); 573 598 574 599 if (strlen(workingdir) > 0) … … 576 601 chdir(workingdir); 577 602 }; 578 rc = spawnlp(P_WAIT,binfile,binfile,j_parms,NULL); 603 604 rc = spawnlp(P_WAIT,binfile,binfile,p1,p2,p3,p4,p5,p6,p7,p8,p9,NULL); 579 605 580 606 while (rc != 0) 581 607 { 582 sprintf(errorstr,"Error during spooling to %s %s",binfile,j_parms); 608 sprintf(errorstr,"Error during spooling to %s %s %s %s %s %s %s %s %s %s ",binfile,p1,p2,p3,p4,p5,p6,p7,p8,p9,NULL); 609 583 610 resp = WinMessageBox (HWND_DESKTOP, 584 611 HWND_DESKTOP, … … 588 615 if (resp != MBID_CANCEL ) 589 616 { 590 rc = spawnlp(P_WAIT,binfile,binfile, j_parms,NULL);617 rc = spawnlp(P_WAIT,binfile,binfile,p1,p2,p3,p4,p5,p6,p7,p8,p9,NULL); 591 618 } 592 619 else rc = 0; … … 594 621 595 622 free(j_parms); 623 596 624 strcpy(filename,&szTemp[pos]); 597 625 DosDelete(filename); -
branches/1.0/src/utils.c
r26 r30 8 8 9 9 /* replace one string by another */ 10 BOOL searchReplace(const char *search, const char *replace, const char *string, char *replaced) 11 { 12 /* create init some variables */ 13 char *searchStart; 14 int len = 0; 15 16 /* do we find the searched string at all */ 17 searchStart = strstr(string, search); 18 if (searchStart == NULL) 19 { 20 strncpy(replaced, string, strlen(replaced)); 21 return FALSE; 22 } 23 24 /* copy first part */ 25 len = searchStart - string; 26 strncpy(replaced, string, len); 27 28 /* add the replaced string */ 29 strcat(replaced, replace); 30 31 /* add the last part */ 32 len += strlen(search); 33 strcat(replaced, string+len); 34 35 return TRUE; 10 BOOL searchReplace(const char *search, const char *replace, const char *string, char *replaced, int size) 11 { 12 // create/init some variables 13 char *searchStart; 14 char *p; 15 int len = 0; 16 17 // some sanity check 18 if (replaced == NULL || replace == NULL) 19 { 20 return FALSE; 21 } 22 23 // do we find the searched string at all 24 searchStart = strstr(string, search); 25 if (searchStart == NULL) 26 { 27 strncpy(replaced, string, size); 28 p = replaced+size; 29 *p = '\0'; 30 return FALSE; 31 } 32 33 // copy first part 34 len = searchStart - string; 35 strncpy(replaced, string, len); 36 p = replaced+len; 37 *p = '\0'; 38 39 // add the replaced string 40 strcat(replaced, replace); 41 42 // add the last part 43 len += strlen(search); 44 strcat(replaced, string+len); 45 46 return TRUE; 47 } 48 49 /* convert a string to uppercase */ 50 void uppercase( char *sPtr ) 51 { 52 while( *sPtr != '\0' ) { 53 *sPtr = toupper( ( unsigned char ) *sPtr ); 54 } 36 55 } 37 56 -
branches/1.0/src/utils.h
r26 r30 22 22 #define __UTILS_H__ 23 23 24 BOOL searchReplace(const char *search, const char *replace, const char * org_string, char *replaced_string);24 BOOL searchReplace(const char *search, const char *replace, const char *string, char *replaced, int size); 25 25 void decryptPassword(const char *pszCrypt, char *pszPlain); 26 26 void encryptPassword(const char *pszPlain, char *pszCrypt);
Note:
See TracChangeset
for help on using the changeset viewer.