Changeset 19


Ignore:
Timestamp:
Apr 17, 2010, 6:33:31 PM (15 years ago)
Author:
herwigb
Message:

Working 1.0 alpha 1

Location:
branches/1.0/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/src/de/readme.txt

    r7 r19  
    33                           Build _BUILD_
    44                           ________________________________
    5 
     5                                  preliminary readme
    66CONTENTS
    77________
     
    1515_______________
    1616
    17 add some text
     17The eCS (OS/2) Universal Port Driver (UNI.PDR) redirects the datastream
     18from a printer port to a program. It has been tested to work with ePDF
     19successfully, but should work with any program being capable to accept a
     20file as an argument on the commandline.
     21
     22uni.pdr is (like smb.pdr and cups.pdr) based upon Serge Starcks lpr32.pdr.
     23Unlike the above 2 pdrs, which have the program to service hardcoded into
     24the driver, both program and parameters may be configured individually in
     25uni.pdr.
     26
     27When configuring the parameter field, make sure to have the %file% token
     28on the commandline as a placeholder where the pdr will put the real filename
     29during operation.
     30
     31By and large uni.pdr has the same functionality that eRedMan provides. However
     32while eRedMan has a smarter GUI right now and some nice assistant to create
     33proper commandlines, uni.pdr is much more robust in operation. Especially
     34uni.pdr honors the order of the jobs being sent to the port, while eRedMan
     35does not.
    1836
    19372. License
    2038__________
    2139
    22 
     40Same as smb.pdr, cups.pdr and lpr32.pdr. To be specified yet.
    2341
    2442
     
    2846 v1.0 alpha1:
    2947   - changelog created
    30    - internal versional network interfaces on one system
     48   - got it working
  • branches/1.0/src/de/uni.dlg

    r14 r19  
    66DLGTEMPLATE IDD_UNI LOADONCALL MOVEABLE DISCARDABLE
    77BEGIN
    8     DIALOG  "Port Properties - ", IDD_UNI, 19, 37, 233, 156, FS_NOBYTEALIGN |
     8    DIALOG  "Port Properties - ", IDD_UNI, 19, 122, 237, 71, FS_NOBYTEALIGN |
    99            WS_VISIBLE | WS_SYNCPAINT, FCF_SYSMENU | FCF_TITLEBAR |
    1010            FCF_NOBYTEALIGN
     
    1313        DEFPUSHBUTTON   "OK", DID_OK, 5, 5, 76, 14
    1414                        PRESPARAMS PP_FONTNAMESIZE, "9.WarpSans Bold"
    15         PUSHBUTTON      "Cancel ", DID_CANCEL, 149, 5, 76, 14
     15        PUSHBUTTON      "Cancel ", DID_CANCEL, 150, 5, 76, 14
    1616                        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
    1919                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00000000L
    2020                        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,
    2724                        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,
    3427                        NOT WS_VISIBLE | WS_DISABLED
    35         GROUPBOX        "Number of copies", GB_COPIES, 5, 24, 220, 26, NOT
     28        GROUPBOX        "Number of copies", GB_COPIES, 230, 43, 5, 26, NOT
    3629                        WS_VISIBLE
    3730                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00000000L
    3831                        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,
    4033                        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,
    4235                        DT_VCENTER | NOT WS_VISIBLE
    43         ENTRYFIELD      "", ID_COPIES, 71, 31, 23, 8, ES_MARGIN | NOT
     36        ENTRYFIELD      "", ID_COPIES, 101, 7, 23, 8, ES_MARGIN | NOT
    4437                        WS_VISIBLE
    4538    END
  • branches/1.0/src/uni.c

    r18 r19  
    6161
    6262/*  replace one string by another */
    63 char * searchReplace(char *search, char *replace, char *string)
     63/*
     64int 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
     83BOOL searchReplace(const UCHAR *search, const UCHAR *replace, const UCHAR *string, UCHAR *replaced)
    6484{
    6585// creat init some variables
    66         char * tempString, *searchStart;
     86        UCHAR *searchStart;
    6787        int len = 0;
    6888
     
    7191        if (searchStart == NULL)
    7292        {
    73                 return string;
     93                strncpy(replaced, string, strlen(replaced));
     94                return FALSE;
    7495        }
    75 
    76 // allocate needed space for the tempstring
    77         tempString = malloc((strlen(string) - strlen(search) + strlen(replace)) * sizeof(char));
    7896
    7997// copy first part
    8098        len = searchStart - string;
    81         strncpy(tempString, string, len);
     99        strncpy(replaced, string, len);
    82100
    83101// add the replaced string
    84         strcat(tempString, replace);
     102        strcat(replaced, replace);
    85103
    86104// add the last part
    87105        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;
    92109}
    93110
     
    265282                        {
    266283                                case DID_OK:
    267                                         sprintf(szDesc,"\\");
     284                                        sprintf(szDesc," ");
    268285                                        /* Program */
    269286                                        WinQueryDlgItemText (hDlg, ID_PROGRAM, sizeof(szTemp), szTemp );
     
    271288                                        strcat(pLprData->szSaveLprSetting,"#");
    272289
    273 /*                                      if (strlen(szTemp) > 0) {
    274                                                 strncat(szDesc, "\\", STR_LEN_PORTDESC - 1);
     290                                        if (strlen(szTemp) > 0) {
     291                                                strncat(szDesc, " ", STR_LEN_PORTDESC - 1);
    275292                                                strncat(szDesc, szTemp, STR_LEN_PORTDESC - 1);
    276293                                        }
    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);
    279296                                       
    280297                                        /* Parameters */
     
    282299                                        strcat(pLprData->szSaveLprSetting,szTemp);
    283300                                        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                                        }
    284305                                       
    285306                                        /* Printername | Queue */
     
    9881009        UCHAR       arg[256];
    9891010        UCHAR       j_parms[256] ;
     1011        UCHAR       *f_parms;
    9901012        UCHAR       j_id[3];
    9911013        UCHAR       parameters[256];
     
    10701092
    10711093
    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);
    10741100       
    10751101        rc = spawnlp(P_WAIT,binfile,binfile,j_parms,NULL);
Note: See TracChangeset for help on using the changeset viewer.