Changeset 31 for branches/1.0


Ignore:
Timestamp:
May 8, 2010, 6:13:50 PM (15 years ago)
Author:
herwigb
Message:

Streamline code

Location:
branches/1.0/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/src/build.cmd

    r30 r31  
    2020echo Done.
    2121echo Attaching EAS.
    22 ea2 -e DEFAULT_PORT=UNI uni.pdr >>build.log
     22call ea2 -e DEFAULT_PORT=UNI uni.pdr >>build.log
    2323echo Done.
    2424d:
  • branches/1.0/src/de/readme.txt

    r19 r31  
    1616
    1717The 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
     18from a printer port to a program. It has been tested to work with
     19
     20  - ePDF.exe
     21  - smbspool.exe
     22 
    1923successfully, but should work with any program being capable to accept a
    2024file as an argument on the commandline.
     
    2226uni.pdr is (like smb.pdr and cups.pdr) based upon Serge Starcks lpr32.pdr.
    2327Unlike 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.
     28the driver, uni.pdr allows program, parameters and working directory to be
     29configured individually.
    2630
    2731When configuring the parameter field, make sure to have the %file% token
     
    4751   - changelog created
    4852   - got it working
     53   
     54 v1.0 alpha2:
     55   - find button added
     56   - working directory added
     57   
     58 v1.0 alpha3:
     59   - parameters are split into separate parameters internally
     60     (as required by smbspool.exe and most likely other programs, too)
     61   - fixed token replacement logic (diver)
  • branches/1.0/src/de/uni.dlg

    r30 r31  
    1919                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00000000L
    2020                        PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold"
    21         LTEXT           "Path amd file:", DT_PROGRAM, 13, 118, 53, 8, DT_VCENTER
     21        LTEXT           "Path and file:", DT_PROGRAM, 13, 118, 53, 8, DT_VCENTER
    2222        ENTRYFIELD      "", ID_PROGRAM, 15, 106, 200, 8, ES_MARGIN
    2323        LTEXT           "Parameters:", DT_PARAMETERS, 13, 71, 204, 8,
  • branches/1.0/src/splpd.c

    r30 r31  
    507507        char        spool_dir[256];
    508508        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;
     509        char        *p_arg[10];
    518510
    519511        rc = PrfQueryProfileString (HINI_SYSTEMPROFILE,
     
    587579
    588580//  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, " ");
     581        p_arg[0] = binfile;
     582        for (i=1; i < 10; i++) {
     583                if ( i == 1) {
     584                        p_arg[i] = strtok(j_parms, " ");
     585                } else {
     586                        p_arg[i] = strtok(NULL, " ");
     587                }
     588        };
     589        p_arg[10] = NULL;
    598590
    599591        if (strlen(workingdir) > 0)
     
    602594        };
    603595
    604         rc = spawnlp(P_WAIT,binfile,binfile,p1,p2,p3,p4,p5,p6,p7,p8,p9,NULL);
     596        rc = spawnvp(P_WAIT,p_arg[0],p_arg);
    605597
    606598        while (rc != 0)
    607599        {
    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);
     600                sprintf(errorstr,"Error during spooling to %s %s ",binfile,j_parms,NULL);
    609601
    610602                resp = WinMessageBox (HWND_DESKTOP,
     
    615607                if (resp != MBID_CANCEL )
    616608                {
    617                         rc = spawnlp(P_WAIT,binfile,binfile,p1,p2,p3,p4,p5,p6,p7,p8,p9,NULL);
     609                        rc = spawnvp(P_WAIT,p_arg[0],p_arg);
    618610                }
    619611                else rc = 0;
     
    639631        return rc;
    640632}
    641 
Note: See TracChangeset for help on using the changeset viewer.