Changeset 172


Ignore:
Timestamp:
May 29, 2001, 5:41:22 PM (24 years ago)
Author:
tahola
Message:

* empty log message *

Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/include/wicpm/gui_helpers.h

    r128 r172  
    1 
    21/*
    32 * gui_helpers.h
     
    5655USHORT guiSetEntryFieldTextLimit(HWND hwndParent, ULONG ulEFId, SHORT sTextLimit);
    5756USHORT guiShowFileDialog (HWND, USHORT, PSZ, PAPSZ, PSZ, PSZ *, PAPSZ *, ULONG *);
     57USHORT guiLoadString(HAB, ULONG, PSZ *);
    5858
    5959
  • TabularUnified trunk/include/wicpm/gui_notebook.h

    r128 r172  
    1 
    21/*
    32 * gui_notebook.h
  • TabularUnified trunk/include/wicpm/gui_objwnd.h

    r128 r172  
    11
    2 /*
    3  * gui_objwnd.h
    4  *
    5  *  Copyright (C) 1999-2000 Teemu Ahola.
    6  *
    7  */
    82
    93#ifndef _GUI_OBJWND_H_
  • TabularUnified trunk/include/wicpm/gui_trad_cntr.h

    r128 r172  
    1 
    21/*
    32 * gui_trad_cntr.h
  • TabularUnified trunk/include/wicpm/gui_trad_nb_dlgproc.h

    r128 r172  
    1 
    21/*
    32 * gui_trad_nb_dlgproc.h
     
    4342#define TEXT_SETUPSTRING_EXENAME            "EXENAME="
    4443#define TEXT_SETUPSTRING_OBJECTID           "OBJECTID="
     44    // Target combo box.
     45#define TEXT_TARGET_DEFAPPPATH              "$(WARPIN_DEFAULTAPPSPATH)\\"
     46#define TEXT_TARGET_DEFTOOLPATH             "$(WARPIN_DEFAULTTOOLSPATH)\\"
     47#define TEXT_TARGET_BOOTDRIVER              "?:\\"
     48#define TEXT_TARGET_PCKINDEX                "$(i)"
     49#define TEXT_TARGET_PCK                     "$(vendor\\application\\package)"
     50#define TEXT_TARGET_ENV                     "$(enviromental variable)"
     51
    4552
    4653
     
    5966    HWND hwndObjWnd;
    6067    } SCRIPTDLGINFO, *PSCRIPTDLGINFO;
     68
     69typedef struct
     70    {
     71    PFNWP OldProc;
     72    } OLDPROC;
    6173
    6274
     
    95107MRESULT EXPENTRY fnTradCntrDlgProc(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
    96108MRESULT EXPENTRY fnTradCnfgDlgProc(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
     109MRESULT EXPENTRY fnCnfgLbox(HWND hwndWnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    97110
    98111
  • TabularUnified trunk/include/wicpm/gui_wicpm.h

    r128 r172  
    1 
    21/*
    32 * gui_wicpm.h
     
    6867 *  General window info structure for storing windows information
    6968 */
    70 typedef struct _WICPMINFO
     69struct _WICPMINFO
    7170    {
    7271    HAB                 hab;                        // Handle to an anchor block.
     
    9594        strcpy(szWicPMPath, "e:\\testi");
    9695        }
    97     } WICPMINFO, *PWICPMINFO;
     96    };
     97typedef _WICPMINFO WICPMINFO, *PWICPMINFO;
    9898
    9999struct StatusDlgInfo
  • TabularUnified trunk/include/wicpm/script.hpp

    r125 r172  
    33 *                  (c) Copyright Teemu Ahola 2000
    44 *
    5  *              WarpIN Script Class 0.9.3
     5 *              WarpIN Script Class 0.9.5
    66 *
    7  * script.hpp
     7 *@@script.hpp
    88 *  Header file for script.cpp.
    99 *  This file contains class headers for script classes.
     
    1717#define _SCRIPT_HPP
    1818
    19 #define MAXCHILDREN                         20
    20 
    21 #define MAXAPPNAMELENGTH                    64
    22 #define MAXVENDORNAMELENGTH                 64
    23 #define MAXPCKNAMELENGTH                    32
    24 #define MAXINETADDRESSLENGTH                128
    25 #define MAXVERSIONLENGTH                    10
    26 #define MAXTITLELENGTH                      128
    27 #define MAXSTATEMENTLENGTH                  128
    28 #define MAXSEARCHSTRINGLENGTH               128
    29 #define MAXCLASSNAMELENGTH                  256
    30 #define MAXCLASSTITLELENGTH                 256
    31 #define MAXCLASSCONFIGLENGTH                256
    32 #define MAXSCRIPTLENGTH                     4096
    33 #define MAXSCRIPTLINELENGTH                 256
    34 #define MAXSCRIPTSTRINGLENGTH               256
    35 #define MAXPROFILEAPPLICATIONLENGTH         256
    36 #define MAXPROFILEKEYLENGTH                 256
    37 #define MAXPAGETEXTLENGTH                   1024
    38 #define MAXPAGETITLELENGTH                  256
    39 #define MAXNEXTBTNTEXTLENGTH                256
    40 #define MAXMESSAGELENGTH                    256
    41 #define MAXOPERATIGSYSTEMLENGTH             64
    42 #define MAXTARGETLENGTH                     256
    43 #define MAXTAGLENGTH                        256
    44 #define MAXATTRIBUTELENGTH                  256
     19#define MAXCHILDREN                                     20
     20
     21#define MAXAPPNAMELENGTH                                64
     22#define MAXVENDORNAMELENGTH                             64
     23#define MAXPCKNAMELENGTH                                32
     24#define MAXINETADDRESSLENGTH                            128
     25#define MAXVERSIONLENGTH                                10
     26#define MAXTITLELENGTH                                  128
     27#define MAXSTATEMENTLENGTH                              128
     28#define MAXSEARCHSTRINGLENGTH                           128
     29#define MAXCLASSNAMELENGTH                              256
     30#define MAXCLASSTITLELENGTH                             256
     31#define MAXCLASSCONFIGLENGTH                            256
     32#define MAXSCRIPTLENGTH                                 4096
     33#define MAXSCRIPTLINELENGTH                             256
     34#define MAXSCRIPTSTRINGLENGTH                           256
     35#define MAXPROFILEAPPLICATIONLENGTH                     256
     36#define MAXPROFILEKEYLENGTH                             256
     37#define MAXPAGETEXTLENGTH                               1024
     38#define MAXPAGETITLELENGTH                              256
     39#define MAXNEXTBTNTEXTLENGTH                            256
     40#define MAXMESSAGELENGTH                                256
     41#define MAXOPERATIGSYSTEMLENGTH                         64
     42#define MAXTARGETLENGTH                                 256
     43#define MAXTAGLENGTH                                    256
     44#define MAXATTRIBUTELENGTH                              256
    4545
    4646// Keyword attributes.
    47 #define KEYWORD_BASE                                1
    48 #define KEYWORD_FIXED                               2
    49 #define KEYWORD_SELECT                              4
    50 #define KEYWORD_NODESELECT                          8
     47#define KEYWORD_BASE                                    1
     48#define KEYWORD_FIXED                                   2
     49#define KEYWORD_SELECT                                  4
     50#define KEYWORD_NODESELECT                              8
    5151
    5252// ConfigSys modifiers.
    53 #define MODIFIER_NONE                               0
    54 #define MODIFIER_UNIQUE                             1
    55 #define MODIFIER_ADDRIGHT                           2
    56 #define MODIFIER_ADDLEFT                            4
    57 #define MODIFIER_ADDTOP                             8
    58 #define MODIFIER_ADDAFTER                           16
    59 #define MODIFIER_ADDBEFORE                          32
    60 #define MODIFIER_REMOVELINE                         64
    61 #define MODIFIER_REMOVEPART                         128
     53#define MODIFIER_NONE                                   0
     54#define MODIFIER_UNIQUE                                 1
     55#define MODIFIER_ADDRIGHT                               2
     56#define MODIFIER_ADDLEFT                                4
     57#define MODIFIER_ADDTOP                                 8
     58#define MODIFIER_ADDAFTER                               16
     59#define MODIFIER_ADDBEFORE                              32
     60#define MODIFIER_REMOVELINE                             64
     61#define MODIFIER_REMOVEPART                             128
    6262
    6363// Execute context flags
    64 #define FLAG_NOCONTEXT                              0
    65 #define FLAG_CONFIGSYS                              1
    66 #define FLAG_REGISTERCLASS                          2
    67 #define FLAG_CREATEOBJECT                           3
     64#define FLAG_NOCONTEXT                                  0
     65#define FLAG_CONFIGSYS                                  1
     66#define FLAG_REGISTERCLASS                              2
     67#define FLAG_CREATEOBJECT                               3
    6868
    6969// ReadMe formats.
    70 #define README_FORMAT_NONE                          0
    71 #define README_FORMAT_PLAIN                         1
    72 #define README_FORMAT_FLOW                          2
    73 #define README_FORMAT_HTML                          3
     70#define README_FORMAT_NONE                              0
     71#define README_FORMAT_PLAIN                             1
     72#define README_FORMAT_FLOW                              2
     73#define README_FORMAT_HTML                              3
    7474
    7575// Page types.
    76 #define PAGE_TYPES_TEXT                             0
    77 #define PAGE_TYPES_README                           1
    78 #define PAGE_TYPES_CONTAINER                        2
    79 #define PAGE_TYPES_CONFIGURE                        3
     76#define PAGE_TYPES_TEXT                                 0
     77#define PAGE_TYPES_README                               1
     78#define PAGE_TYPES_CONTAINER                            2
     79#define PAGE_TYPES_CONFIGURE                            3
    8080
    8181// Operating system
    82 #define OS_OS2_2X                                   0
    83 #define OS_OS2_3X                                   1
    84 #define OS_OS2_4X                                   2
     82#define OS_OS2_2X                                       0
     83#define OS_OS2_3X                                       1
     84#define OS_OS2_4X                                       2
    8585
    8686
    8787// Error codes
    88 #define NO_ERROR                                    0
     88#define NO_ERROR                                        0
     89#define STRING_TOO_LONG                                 1
     90#define MEM_ALLOC_ERROR                                 2
    8991
    9092    // Configsys error codes
    91 #define ERR_CONFIGSYS_ADDRIGHT_SETTED               1
    92 #define ERR_CONFIGSYS_ADDLEFT_SETTED                2
    93 #define ERR_CONFIGSYS_UNIQUE_SETTED                 4
    94 #define ERR_CONFIGSYS_ADDTOP_SETTED                 8
    95 #define ERR_CONFIGSYS_ADDAFTER_SETTED               16
    96 #define ERR_CONFIGSYS_ADDBEFORE_SETTED              32
    97 #define ERR_CONFIGSYS_REMOVELINE_SETTED             64
    98 #define ERR_CONFIGSYS_REMOVEPART_SETTED             128
     93#define ERR_CONFIGSYS_ADDRIGHT_SETTED                   1
     94#define ERR_CONFIGSYS_ADDLEFT_SETTED                    2
     95#define ERR_CONFIGSYS_UNIQUE_SETTED                     4
     96#define ERR_CONFIGSYS_ADDTOP_SETTED                     8
     97#define ERR_CONFIGSYS_ADDAFTER_SETTED                   16
     98#define ERR_CONFIGSYS_ADDBEFORE_SETTED                  32
     99#define ERR_CONFIGSYS_REMOVELINE_SETTED                 64
     100#define ERR_CONFIGSYS_REMOVEPART_SETTED                 128
    99101
    100102    // Script parsing errors
    101 #define ERR_PARSE_NOERROR                           0
    102 #define ERR_PARSE_NULLPOINTER                       1
    103 #define ERR_PARSE_PCK_NOTFOUND                      2
    104 #define ERR_PARSE_INDEX_NOTFOUND                    3
    105 #define ERR_PARSE_PCKID_NOTFOUND                    4
    106 #define ERR_PARSE_TITLE_NOTFOUND                    5
    107 #define ERR_PARSE_TARGET_NOTFOUND                   6
    108 #define ERR_PARSE_KEYWORD_NOTFOUND                  7
    109 #define ERR_PARSE_REQUIRES_NOTFOUND                 8
    110 #define ERR_PARSE_REQUIRES_MAJOR_NOTFOUND           9
    111 #define ERR_PARSE_REQUIRES_PACKAGE_NOTFOUND         10
    112 #define ERR_PARSE_REQUIRES_VENDOR_NOTFOUND          11
    113 #define ERR_PARSE_REQUIRES_APP_NOTFOUND             12
    114 #define ERR_PARSE_EXECUTE_NOTFOUND                  13
    115 #define ERR_PARSE_CLEARPROFILE_NOTFOUND             14
    116 #define ERR_PARSE_CLEARPROFILE_STRINGTOOLONG        15
    117 #define ERR_PARSE_CONFIGSYS_NOTFOUND                16
    118 #define ERR_PARSE_REGISTERCLASS_NOTFOUND            17
    119 #define ERR_PARSE_REPLACECLASS_NOTFOUND             18
    120 #define ERR_PARSE_CREATEOBJECT_NOTFOUND             19
    121 #define ERR_PARSE_CREATEOBJECT_LOCATION_NOTFOUND    20
    122 #define ERR_PARSE_CREATEOBJECT_TITLE_NOTFOUND       21
    123 #define ERR_PARSE_CREATEOBJECT_CLASSNAME_NOTFOUND   22
    124 #define ERR_PARSE_KILLPROCESS_NOTFOUND              23
    125 #define ERR_PARSE_WRITEPROFILE_NOTFOUND             24
    126 #define ERR_PARSE_WRITEPROFILE_STRINGTOOLONG        25
    127 #define ERR_PARSE_WRITEPROFILE_APP_NOTFOUND         26
    128 #define ERR_PARSE_WRITEPROFILE_KEY_NOTFOUND         27
    129 #define ERR_PARSE_WRITEPROFILE_STRING_NOTFOUND      28
     103#define ERR_PARSE_NOERROR                               0
     104#define ERR_PARSE_NULLPOINTER                           1
     105#define ERR_PARSE_PCK_NOTFOUND                          2
     106#define ERR_PARSE_INDEX_NOTFOUND                        3
     107#define ERR_PARSE_PCKID_NOTFOUND                        4
     108#define ERR_PARSE_TITLE_NOTFOUND                        5
     109#define ERR_PARSE_TARGET_NOTFOUND                       6
     110#define ERR_PARSE_KEYWORD_NOTFOUND                      7
     111#define ERR_PARSE_REQUIRES_NOTFOUND                     8
     112#define ERR_PARSE_REQUIRES_MAJOR_NOTFOUND               9
     113#define ERR_PARSE_REQUIRES_PACKAGE_NOTFOUND             10
     114#define ERR_PARSE_REQUIRES_VENDOR_NOTFOUND              11
     115#define ERR_PARSE_REQUIRES_APP_NOTFOUND                 12
     116#define ERR_PARSE_EXECUTE_NOTFOUND                      13
     117#define ERR_PARSE_CLEARPROFILE_NOTFOUND                 14
     118#define ERR_PARSE_CLEARPROFILE_STRINGTOOLONG            15
     119#define ERR_PARSE_CONFIGSYS_NOTFOUND                    16
     120#define ERR_PARSE_REGISTERCLASS_NOTFOUND                17
     121#define ERR_PARSE_REPLACECLASS_NOTFOUND                 18
     122#define ERR_PARSE_CREATEOBJECT_NOTFOUND                 19
     123#define ERR_PARSE_CREATEOBJECT_LOCATION_NOTFOUND        20
     124#define ERR_PARSE_CREATEOBJECT_TITLE_NOTFOUND           21
     125#define ERR_PARSE_CREATEOBJECT_CLASSNAME_NOTFOUND       22
     126#define ERR_PARSE_KILLPROCESS_NOTFOUND                  23
     127#define ERR_PARSE_WRITEPROFILE_NOTFOUND                 24
     128#define ERR_PARSE_WRITEPROFILE_STRINGTOOLONG            25
     129#define ERR_PARSE_WRITEPROFILE_APP_NOTFOUND             26
     130#define ERR_PARSE_WRITEPROFILE_KEY_NOTFOUND             27
     131#define ERR_PARSE_WRITEPROFILE_STRING_NOTFOUND          28
     132
     133// Message class types:
     134#define MSG_TYPE_UNDEF                                  0
     135#define MSG_TYPE_INFO                                   1
     136#define MSG_TYPE_WARNING                                2
     137#define MSG_TYPE_ERROR                                  3
     138
     139// Message values.
     140#define MSG_VALUE_UNDEF                                 0
     141#define MSG_ATTRIBUTE_INDEX_NOTFOUND                    1
     142#define MSG_ATTRIBUTE_PACKAGEID_NOTFOUND                2
     143#define MSG_ATTRIBUTE_PACKAGEID_MAJOR_NOTFOUND          3
     144#define MSG_ATTRIBUTE_PACKAGEID_MINOR_NOTFOUND          4
     145#define MSG_ATTRIBUTE_PACKAGEID_PACKAGE_NOTFOUND        5
     146#define MSG_ATTRIBUTE_PACKAGEID_APPL_NOTFOUND           6
     147#define MSG_ATTRIBUTE_PACKAGEID_VENDOR_NOTFOUND         7
     148#define MSG_ATTRIBUTE_PACKAGEID_PACKAGE_STRTOOLONG      8
     149#define MSG_ATTRIBUTE_PACKAGEID_APPL_STRTOOLONG         9
     150#define MSG_ATTRIBUTE_PACKAGEID_VENDOR_STRTOOLONG       10
     151#define MSG_ATTRIBUTE_TITLE_TITLE_STRTOOLONG            11
     152#define MSG_ATTRIBUTE_TITLE_TITLE_NOTFOUND              12
     153#define MSG_ATTRIBUTE_TARGET_TARGET_STRTOOLONG          13
     154#define MSG_ATTRIBUTE_TARGET_TARGET_NOTFOUND            14
     155#define MSG_KEYWORD_PCKKW_NOTFOUND                      15
     156#define MSG_ATTRIBUTE_REQUIRES_NOTFOUND                 16
     157#define MSG_ATTRIBUTE_REQUIRES_MINOR_NOTFOUND           17
     158#define MSG_ATTRIBUTE_REQUIRES_MAJOR_NOTFOUND           18
     159#define MSG_ATTRIBUTE_REQUIRES_PACKAGE_NOTFOUND         19
     160#define MSG_ATTRIBUTE_REQUIRES_APPL_NOTFOUND            20
     161#define MSG_ATTRIBUTE_REQUIRES_VENDOR_NOTFOUND          21
     162#define MSG_ATTRIBUTE_REQUIRES_REV_NOTFOUND             22
     163#define MSG_ATTRIBUTE_REQUIRES_VENDOR_STRTOOLONG        23
     164#define MSG_ATTRIBUTE_REQUIRES_APPL_STRTOOLONG          24
     165#define MSG_ATTRIBUTE_REQUIRES_PACKAGE_STRTOOLONG       25
     166#define MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB         26
     167#define MSG_ATTRIBUTE_CFGSYS_STATEMENT_STRTOOLONG       27
     168#define MSG_ATTRIBUTE_CFGSYS_NOTFOUND                   28
     169#define MSG_ATTRIBUTE_REGISTER_NOTFOUND                 29
     170#define MSG_ATTRIBUTE_REGISTER_CLASSNAME_NOTFOUND       30
     171#define MSG_ATTRIBUTE_REGISTER_DLLPATH_NOTFOUND         31
     172#define MSG_ATTRIBUTE_REGISTER_CLASSNAME_STRTOOLONG     32
     173#define MSG_ATTRIBUTE_REGISTER_DLLPATH_STRTOOLONG       33
     174#define MSG_ATTRIBUTE_REPLACE_CLASSNAME_STRTOOLONG      34
     175#define MSG_ATTRIBUTE_REPLACE_NEWNAME_STRTOOLONG        35
     176#define MSG_ATTRIBUTE_REPLACE_NOTFOUND                  36
     177#define MSG_ATTRIBUTE_REGISTER_CLASSNAME_MISSING        37
     178#define MSG_ATTRIBUTE_CREATE_CLASSNAME_STRTOOLONG       38
     179#define MSG_ATTRIBUTE_CREATE_TITLE_STRTOOLONG           39
     180#define MSG_ATTRIBUTE_CREATE_LOCATION_STRTOOLONG        40
     181#define MSG_ATTRIBUTE_CREATE_CONFIG_STRTOOLONG          41
     182#define MSG_ATTRIBUTE_CREATE_NOTFOUND                   42
     183#define MSG_ATTRIBUTE_CREATE_LOCATION_MISSING           43
     184#define MSG_ATTRIBUTE_CREATE_TITLE_MISSING              44
     185#define MSG_ATTRIBUTE_CREATE_CLASSNAME_MISSING          45
     186#define MSG_ATTRIBUTE_EXECUTE_EXEFILEPARAM_STRTOOLONG   46
     187#define MSG_ATTRIBUTE_EXECUTE_MISSING                   47
     188#define MSG_ATTRIBUTE_EXECUTE_EXEFILEPARAM_MISSING      48
     189#define MSG_ATTRIBUTE_EXECUTE_CONTEXT_MISSING           49
     190#define MSG_ATTRIBUTE_CLRPROFILE_PROFILE_STRTOOLONG     50
     191#define MSG_ATTRIBUTE_CLRPROFILE_APPL_STRTOOLONG        51
     192#define MSG_ATTRIBUTE_CLRPROFILE_KEY_STRTOOLONG         52
     193#define MSG_ATTRIBUTE_CLRPROFILE_PROFILE_MISSING        53
     194#define MSG_ATTRIBUTE_CLRPROFILE_APPL_MISSING           54
     195#define MSG_ATTRIBUTE_CLRPROFILE_KEY_MISSING            55
     196#define MSG_ATTRIBUTE_CLRPROFILE_MISSING                56
     197
     198#define MSG_ATTRIBUTE_WRITEPROFILE_PROFILE_STRTOOLONG   57
     199#define MSG_ATTRIBUTE_WRITEPROFILE_APPL_STRTOOLONG      58
     200#define MSG_ATTRIBUTE_WRITEPROFILE_KEY_STRTOOLONG       59
     201#define MSG_ATTRIBUTE_WRITEPROFILE_PROFILE_MISSING      60
     202#define MSG_ATTRIBUTE_WRITEPROFILE_APPL_MISSING         61
     203#define MSG_ATTRIBUTE_WRITEPROFILE_KEY_MISSING          62
     204#define MSG_ATTRIBUTE_WRITEPROFILE_MISSING              63
     205#define MSG_ATTRIBUTE_WRITEPROFILE_STRING_MISSING       64
     206#define MSG_ATTRIBUTE_KILLPROCESS_FILENAME_STRTOOLONG   65
     207#define MSG_ATTRIBUTE_KILLPROCESS_MISSING               66
     208
     209#define MSG_TAG_PCK_NOTFOUND                            70
     210
    130211
    131212
     
    216297/*
    217298 *@@INDEX structure
    218  * This structure is for indexes in script classes. Because script class
    219  * needs a way to locate different objects this structure is designed for
    220  * it.
    221299 */
    222300struct INDEX
     
    233311
    234312/*
    235  *@@ ScriptIndex class
     313 *@@Message
     314 *  This class is the message class used in MessageLogger.
     315 */
     316class Message
     317    {
     318    USHORT      _usType;// MSG_TYPE_INFO
     319                        // MSG_TYPE_WARNING
     320                        // MSG_TYPE_ERROR
     321    BSString    _strMessageText;
     322    ULONG       _ulLineNumber;
     323    USHORT      _usMessageValue;
     324    public:
     325        Message();
     326        virtual ~Message();
     327        USHORT SetType(USHORT);
     328        USHORT SetMessageText(const BSString &);
     329        USHORT SetMessageText(const PSZ);
     330        USHORT SetLineNumber(ULONG);
     331        USHORT SetMessageValue(USHORT);
     332        USHORT ReturnType();
     333        BSString &ReturnMessageText();
     334        ULONG ReturnLineNumber();
     335        USHORT ReturnMessageValue();
     336        BSString &ComposeMessage();
     337   };
     338
     339
     340
     341/*
     342 *@@MessageLogger
     343 *  This class is for logging of messages occurred during manipulating of script
     344 *  objects or during building of script text. There are different types of messages
     345 *  such as informative, warning and error in WarpINScript.
     346 */
     347class MessageLogger
     348    {
     349    list<Message*>          _lstMessage;
     350    USHORT                  _usMessages;
     351    MessageLogger           *_pParentLogger;
     352    public:
     353        MessageLogger();
     354        MessageLogger(MessageLogger&);
     355        ~MessageLogger();
     356        MessageLogger &operator=(MessageLogger &);
     357        USHORT SetParentLogger(MessageLogger&);
     358        USHORT LogMessage(Message &);
     359        USHORT ReturnMessageCount();
     360        const list<Message*> ReturnMessageList();
     361        BSString &ReturnComposedMessageString();
     362        USHORT DeleteLogs();
     363    };
     364
     365
     366
     367
     368/*
     369 *@@WarpINScriptBase
     370 *  This class is base class (super class) for all other classes which belongs to
     371 *  the script classes except for message logger class which is base class for
     372 *  WarpINScriptBase class. There are few virtual functions which must be definited in
     373 *  sub class (derived class) in order to script classes actually work.
     374 */
     375class WarpINScriptBase
     376    {
     377    USHORT              _usIndex;
     378    public:
     379        MessageLogger   _messageLogger;
     380
     381        //WarpINScriptBase();
     382        ~WarpINScriptBase();
     383        USHORT SetIndex(const USHORT);
     384        USHORT ReturnIndex();
     385        virtual PSZ MakeScriptText(BOOL = TRUE){return NULL;}
     386        virtual PSZ BuildFromText(PSZ, ULONG){return NULL;}
     387    };
     388
     389
     390/*
     391 *@@ScriptIndex class
    236392 *  This class is used in ScriptPackage and ScriptPage classes and it contains datas used
    237393 *  while creating INDEX attribute.
    238394 */
    239 class ScriptIndex
    240     {
    241     USHORT              usIndex;
    242 
    243     USHORT              usIndexAttribute;
    244 
    245     public:
    246         ScriptIndex(USHORT usIndex = 1);
     395class ScriptIndex : public WarpINScriptBase
     396    {
     397    USHORT usIndexAttribute;
     398
     399    public:
     400        ScriptIndex(USHORT = 1);
    247401        ~ScriptIndex();
    248 
    249         void SetIndexAttribute(USHORT usIndexAttribute);
    250 
    251         void SetIndex(USHORT usIndex);
     402        ScriptIndex &operator=(ScriptIndex &);
     403
     404        USHORT SetIndexAttribute(USHORT);
     405
     406        //void SetIndex(USHORT usIndex);
    252407
    253408        USHORT ReturnIndexAttribute();
    254409
    255         USHORT ReturnIndex();
    256 
    257         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    258 
    259         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **pScriptError,
    260                          USHORT *usErrorTableSize, ULONG ulLineNumber);
    261     };
    262 
    263 
    264 
    265 
    266 /*
    267  *@@ ScriptPackageID class
     410        //USHORT ReturnIndex();
     411
     412        PSZ MakeScriptText(BOOL = TRUE);
     413
     414        PSZ BuildFromText(PSZ, ULONG);
     415    };
     416
     417
     418
     419
     420/*
     421 *@@ScriptPackageID class
    268422 *  This class is used in ScriptPackage class and it contains datas used
    269423 *  while creating package ID attribute.
    270424 */
    271 class ScriptPackageID
    272     {
    273     // Identifier number of packageID. Can be used to determine which
    274     // package ID is this.
    275     USHORT              usIndex;
    276 
    277     CHAR                szVendor[MAXVENDORNAMELENGTH];
    278     CHAR                szApplication[MAXAPPNAMELENGTH];
    279     CHAR                szPackage[MAXPCKNAMELENGTH];
    280     USHORT              usMajor;
    281     USHORT              usMinor;
    282     USHORT              usRevision;
     425class ScriptPackageID : public WarpINScriptBase
     426    {
     427    CHAR                _szVendor[MAXVENDORNAMELENGTH];
     428    CHAR                _szApplication[MAXAPPNAMELENGTH];
     429    CHAR                _szPackage[MAXPCKNAMELENGTH];
     430    USHORT              _usMajor;
     431    USHORT              _usMinor;
     432    USHORT              _usRevision;
    283433
    284434    public:
    285435        // Constructor for the class
    286         ScriptPackageID(USHORT usIndex = 1);
     436        ScriptPackageID(USHORT = 1);
    287437        // Destructor for the class
    288438        ~ScriptPackageID();
    289439
    290         void SetIndex(USHORT usIndex);
    291 
    292440        // Sets datas to strings
    293         void SetVendor(const PSZ pszVendor);
    294         void SetApplication(const PSZ pszApplication);
    295         void SetPackage(const PSZ pszPackage);
    296         void SetMajor(USHORT usMajor);
    297         void SetMinor(USHORT usMinor);
    298         void SetRevision(USHORT usRevision);
    299         void SetPackageID(PACKAGEIDDATA packageIDData);
     441        USHORT SetVendor(const PSZ);
     442        USHORT SetApplication(const PSZ);
     443        USHORT SetPackage(const PSZ);
     444        USHORT SetMajor(USHORT);
     445        USHORT SetMinor(USHORT);
     446        USHORT SetRevision(USHORT);
     447        USHORT SetPackageID(PACKAGEIDDATA);
    300448
    301449        const PSZ ReturnVendor();
     
    307455        PACKAGEIDDATA ReturnPackageID();
    308456
    309         USHORT ReturnIndex();
    310 
    311         PSZ MakeScriptText(BOOL bShowAttribute = TRUE);
    312         PSZ BuildFromText(PSZ pszAttrText, SCRIPTERROR **pScriptError,
    313                          USHORT *usErrorTableSize, ULONG ulLineNumber);
     457        PSZ MakeScriptText(BOOL = TRUE);
     458        PSZ BuildFromText(PSZ, ULONG);
    314459    };
    315460
     
    321466 *  while creating title attribute.
    322467 */
    323 class ScriptTitle
    324     {
    325     USHORT              usIndex;
    326 
    327     CHAR                szTitle[MAXTITLELENGTH];
    328 
    329     public:
    330         ScriptTitle(USHORT usIndex = 1);
     468class ScriptTitle : public WarpINScriptBase
     469    {
     470    CHAR        _szTitle[MAXTITLELENGTH];
     471
     472    public:
     473        ScriptTitle(USHORT = 1);
    331474        ~ScriptTitle();
    332475
    333         void SetTitle(const PSZ pszTitle);
    334 
    335         void SetIndex(USHORT usIndex);
     476        USHORT SetTitle(const PSZ);
    336477
    337478        const PSZ ReturnTitle();
    338479
    339         USHORT ReturnIndex();
    340 
    341         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    342 
    343         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **pScriptError,
    344                          USHORT *usErrorTableSize, ULONG ulLineNumber);
     480        PSZ MakeScriptText(BOOL = TRUE);
     481
     482        PSZ BuildFromText(PSZ, ULONG);
    345483    };
    346484
     
    352490 *  while creating target attribute.
    353491 */
    354 class ScriptTarget
    355     {
    356     USHORT              usIndex;
    357 
    358     CHAR                szTarget[CCHMAXPATH];
    359 
    360     public:
    361         ScriptTarget(USHORT usIndex = 1);
     492class ScriptTarget : public WarpINScriptBase
     493    {
     494    CHAR                _szTarget[CCHMAXPATH];
     495
     496    public:
     497        ScriptTarget(USHORT = 1);
    362498        ~ScriptTarget();
    363499
    364         void SetTarget(const PSZ pszTarget);
    365 
    366         void SetIndex(USHORT usIndex);
     500        USHORT SetTarget(const PSZ);
    367501
    368502        const PSZ ReturnTarget();
    369503
    370         USHORT ReturnIndex();
    371 
    372         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    373 
    374         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **pScriptError,
    375                          USHORT *usErrorTableSize, ULONG ulLineNumber);
    376     };
    377 
    378 
    379 
    380 /*
    381  *@@ ScriptKeyWord class
     504        PSZ MakeScriptText(BOOL = TRUE);
     505
     506        PSZ BuildFromText(PSZ, ULONG);
     507    };
     508
     509
     510
     511/*
     512 *@@ScriptKeyWord:
    382513 *  This class is used in ScriptPackage class and it contains datas used
    383514 *  while creating keyword attribute.
    384515 */
    385 class ScriptKeyWord
    386     {
    387     USHORT              usIndex;
    388 
    389     BOOL                bBase;
    390     BOOL                bFixed;
    391     BOOL                bSelect;
    392     BOOL                bNoDeselect;
    393 
    394     public:
    395         ScriptKeyWord(USHORT usIndex = 1);
     516class ScriptKeyWord : public WarpINScriptBase
     517    {
     518    BOOL                _bBase;
     519    BOOL                _bFixed;
     520    BOOL                _bSelect;
     521    BOOL                _bNoDeselect;
     522
     523    public:
     524        ScriptKeyWord(USHORT = 1);
    396525        ~ScriptKeyWord();
    397526
    398         void SetBase(BOOL bBase);
    399         void SetFixed(BOOL bFixed);
    400         void SetSelect(BOOL bSelect);
    401         void SetNoDeselect(BOOL bNoDeselect);
    402             // Old way. Sometimes usefull and is needed on some part of WicPM.
    403         void SetKeyWord(USHORT usKeyWords);
    404 
    405         void SetIndex(USHORT usIndex);
     527        USHORT SetBase(BOOL);
     528        USHORT SetFixed(BOOL);
     529        USHORT SetSelect(BOOL);
     530        USHORT SetNoDeselect(BOOL);
     531        USHORT SetKeyWord(USHORT);
    406532
    407533        BOOL ReturnBase();
     
    411537        USHORT ReturnKeyWord();
    412538
    413         USHORT ReturnIndex();
    414 
    415539        PSZ MakeScriptText(BOOL bAttribute = TRUE, BOOL bLineFeed = FALSE);
    416         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **ppScriptError,
    417                           USHORT *pusErrorTableSize, ULONG ulLineNumber);
    418     };
    419 
    420 
    421 
    422 
    423 /*
    424  *@@ ScriptRequires class
     540        PSZ BuildFromText(PSZ, ULONG);
     541    };
     542
     543
     544
     545
     546/*
     547 *@@ScriptRequires:
    425548 *  This class is used in ScriptPackage class and it contains datas used
    426549 *  while creating requires attribute.
    427550 */
    428 class ScriptRequires
    429     {
    430     USHORT              usIndex;
    431 
    432     CHAR                szVendor[MAXVENDORNAMELENGTH];
    433     CHAR                szApplication[MAXAPPNAMELENGTH];
    434     CHAR                szPackage[MAXPCKNAMELENGTH];
    435     USHORT              usMajor;
    436     USHORT              usMinor;
    437     USHORT              usRevision;
    438     USHORT              usPckIndex;
     551class ScriptRequires : public WarpINScriptBase
     552    {
     553    CHAR                _szVendor[MAXVENDORNAMELENGTH];
     554    CHAR                _szApplication[MAXAPPNAMELENGTH];
     555    CHAR                _szPackage[MAXPCKNAMELENGTH];
     556    USHORT              _usMajor;
     557    USHORT              _usMinor;
     558    USHORT              _usRevision;
     559    USHORT              _usPckIndex;
    439560
    440561    public:
    441562        // Constructor for the class
    442         ScriptRequires(USHORT usIndex = 1);
     563        ScriptRequires(USHORT = 1);
    443564        // Destructor for the class
    444565        ~ScriptRequires();
    445566
    446567        // Sets datas to strings
    447         void SetVendor(const PSZ pszVendor);
    448         void SetApplication(const PSZ pszApplication);
    449         void SetPackage(const PSZ pszPackage);
    450         void SetMajor(USHORT usMajor);
    451         void SetMinor(USHORT usMinor);
    452         void SetRevision(USHORT usRevision);
    453         void SetPckIndex(USHORT usPckIndex);
    454         void SetRequires(REQUIRESDATA requiresData);
    455 
    456         void SetIndex(USHORT usIndex);
     568        USHORT SetVendor(const PSZ);
     569        USHORT SetApplication(const PSZ);
     570        USHORT SetPackage(const PSZ);
     571        USHORT SetMajor(USHORT);
     572        USHORT SetMinor(USHORT);
     573        USHORT SetRevision(USHORT);
     574        USHORT SetPckIndex(USHORT);
     575        USHORT SetRequires(REQUIRESDATA);
    457576
    458577        const PSZ ReturnVendor();
     
    465584        REQUIRESDATA ReturnRequires();
    466585
    467         USHORT ReturnIndex();
    468 
    469         PSZ MakeScriptText(BOOL bShowAttribute = TRUE);
    470         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **ppScriptError,
    471                           USHORT *pusErrorTableSize, ULONG ulLineNumber);
    472     };
    473 
    474 
    475 
    476 /*
    477  *@@ ScriptConfigSys class
     586        PSZ MakeScriptText(BOOL = TRUE);
     587        PSZ BuildFromText(PSZ, ULONG);
     588    };
     589
     590
     591
     592/*
     593 *@@ScriptConfigSys:
    478594 *  This class is used in ScriptPackage class and it contains datas used
    479595 *  while creating configsys attribute.
    480596 */
    481 class ScriptConfigSys
    482     {
    483     USHORT              usIndex;
    484 
    485     CHAR                szStatement[MAXSTATEMENTLENGTH];
    486     BOOL                bUnique;
    487     BOOL                bAddRight;
    488     BOOL                bAddLeft;
    489     BOOL                bAddTop;
    490     BOOL                bAddAfter;
    491     BOOL                bAddBefore;
    492     BOOL                bRemoveLine;
    493     BOOL                bRemovePart;
    494     CHAR                szSearchString[MAXSEARCHSTRINGLENGTH];
    495 
    496     public:
    497         ScriptConfigSys(USHORT usIndex = 1);
     597class ScriptConfigSys : public WarpINScriptBase
     598    {
     599    CHAR                _szStatement[MAXSTATEMENTLENGTH];
     600    BOOL                _bUnique;
     601    BOOL                _bAddRight;
     602    BOOL                _bAddLeft;
     603    BOOL                _bAddTop;
     604    BOOL                _bAddAfter;
     605    BOOL                _bAddBefore;
     606    BOOL                _bRemoveLine;
     607    BOOL                _bRemovePart;
     608    CHAR                _szSearchString[MAXSEARCHSTRINGLENGTH];
     609
     610    public:
     611        ScriptConfigSys(USHORT = 1);
    498612        ~ScriptConfigSys();
    499613
    500         void SetStatement(const PSZ pszStatement);
    501         USHORT SetUnique(BOOL bUnique);
    502         USHORT SetAddRight(BOOL bAddRight);
    503         USHORT SetAddLeft(BOOL bAddLeft);
    504         USHORT SetAddTop(BOOL bAddTop);
    505         USHORT SetAddAfter(BOOL bAddAfter);
    506         USHORT SetAddBefore(BOOL bAddBefore);
    507         USHORT SetRemoveLine(BOOL bRemoveLine);
    508         USHORT SetRemovePart(BOOL bRemovePart);
    509         void SetSearchString(const PSZ pszSearchString);
    510         USHORT SetConfigSys(CONFIGSYSDATA configSys);
    511 
    512         void SetIndex(USHORT usIndex);
     614        USHORT SetStatement(const PSZ);
     615        USHORT SetUnique(BOOL);
     616        USHORT SetAddRight(BOOL);
     617        USHORT SetAddLeft(BOOL);
     618        USHORT SetAddTop(BOOL);
     619        USHORT SetAddAfter(BOOL);
     620        USHORT SetAddBefore(BOOL);
     621        USHORT SetRemoveLine(BOOL);
     622        USHORT SetRemovePart(BOOL);
     623        USHORT SetSearchString(const PSZ);
     624        USHORT SetConfigSys(CONFIGSYSDATA);
    513625
    514626        const PSZ ReturnStatement();
     
    524636        CONFIGSYSDATA ReturnConfigSys();
    525637
    526         USHORT ReturnIndex();
    527 
    528         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    529 
    530         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **ppScriptError,
    531                           USHORT *pusErrorTableSize, ULONG ulLineNumber);
    532 
    533     };
    534 
    535 
    536 
    537 
    538 /*
    539  *@@ ScriptRegisterClass class
     638        PSZ MakeScriptText(BOOL = TRUE);
     639
     640        PSZ BuildFromText(PSZ, ULONG);
     641    };
     642
     643
     644
     645
     646/*
     647 *@@ScriptRegisterClass:
    540648 *  This class is used in ScriptPackage class and it contains datas used
    541649 *  while creating register class attribute.
    542650 */
    543 class ScriptRegisterClass
    544     {
    545     USHORT              usIndex;
    546 
    547     CHAR                szClassName[MAXCLASSNAMELENGTH];
    548     CHAR                szDLLPath[CCHMAXPATH];
    549 
    550     public:
    551         ScriptRegisterClass(USHORT usIndex = 1);
     651class ScriptRegisterClass : public WarpINScriptBase
     652    {
     653    CHAR                _szClassName[MAXCLASSNAMELENGTH];
     654    CHAR                _szDLLPath[CCHMAXPATH];
     655
     656    public:
     657        ScriptRegisterClass(USHORT = 1);
    552658        ~ScriptRegisterClass();
    553659
    554         void SetClassName(const PSZ pszClassName);
    555         void SetDLLPath(const PSZ pszDLLPath);
    556         void SetRegisterClass(REGISTERCLASSDATA registerClass);
    557 
    558         void SetIndex(USHORT usIndex);
     660        USHORT SetClassName(const PSZ);
     661        USHORT SetDLLPath(const PSZ);
     662        USHORT SetRegisterClass(REGISTERCLASSDATA);
    559663
    560664        const PSZ ReturnClassName();
     
    562666        REGISTERCLASSDATA ReturnRegisterClass();
    563667
    564         USHORT ReturnIndex();
    565 
    566         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    567 
    568         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **ppScriptError,
    569                           USHORT *pusErrorTableSize, ULONG ulLineNumber);
    570 
    571 
    572     };
    573 
    574 
    575 
    576 /*
    577  *@@ ScriptReplaceClass class
     668        PSZ MakeScriptText(BOOL = TRUE);
     669
     670        PSZ BuildFromText(PSZ, ULONG);
     671
     672
     673    };
     674
     675
     676
     677/*
     678 *@@ScriptReplaceClass:
    578679 *  This class is used in ScriptPackage class and it contains datas used
    579680 *  while creating replace class attribute.
    580681 */
    581 class ScriptReplaceClass
    582     {
    583     USHORT              usIndex;
    584 
    585     CHAR                szClassName[MAXCLASSNAMELENGTH];
    586     CHAR                szNewClassName[MAXCLASSNAMELENGTH];
    587 
    588     public:
    589         ScriptReplaceClass(USHORT usIndex = 1);
     682class ScriptReplaceClass : public WarpINScriptBase
     683    {
     684    CHAR                _szClassName[MAXCLASSNAMELENGTH];
     685    CHAR                _szNewClassName[MAXCLASSNAMELENGTH];
     686
     687    public:
     688        ScriptReplaceClass(USHORT = 1);
    590689        ~ScriptReplaceClass();
    591690
    592         void SetClassName(const PSZ pszClassName);
    593         void SetNewClassName(const PSZ pszNewClassName);
    594         void SetReplaceClass(REPLACECLASSDATA replaceClass);
    595 
    596         void SetIndex(USHORT usIndex);
     691        USHORT SetClassName(const PSZ);
     692        USHORT SetNewClassName(const PSZ);
     693        USHORT SetReplaceClass(REPLACECLASSDATA);
    597694
    598695        const PSZ ReturnClassName();
     
    600697        REPLACECLASSDATA ReturnReplaceClass();
    601698
    602         USHORT ReturnIndex();
    603 
    604         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    605 
    606         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **ppScriptError,
    607                           USHORT *pusErrorTableSize, ULONG ulLineNumber);
    608 
    609     };
    610 
    611 
    612 
    613 /*
    614  *@@ ScriptCreateObject class
     699        PSZ MakeScriptText(BOOL = TRUE);
     700
     701        PSZ BuildFromText(PSZ, ULONG);
     702
     703    };
     704
     705
     706
     707/*
     708 *@@ScriptCreateObject:
    615709 *  This class is used in ScriptPackage class and it contains datas used
    616710 *  while creating create object attribute.
    617711 */
    618 class ScriptCreateObject
    619     {
    620     USHORT              usIndex;
    621 
    622     CHAR                szClassName[MAXCLASSNAMELENGTH];
    623     CHAR                szTitle[MAXCLASSTITLELENGTH];
    624     CHAR                szLocation[CCHMAXPATH];
    625     CHAR                szConfig[MAXCLASSCONFIGLENGTH];
    626     BOOL                bReplace;
    627 
    628     public:
    629         ScriptCreateObject(USHORT usIndex = 1);
     712class ScriptCreateObject : public WarpINScriptBase
     713    {
     714    CHAR                _szClassName[MAXCLASSNAMELENGTH];
     715    CHAR                _szTitle[MAXCLASSTITLELENGTH];
     716    CHAR                _szLocation[CCHMAXPATH];
     717    CHAR                _szConfig[MAXCLASSCONFIGLENGTH];
     718    BOOL                _bReplace;
     719
     720    public:
     721        ScriptCreateObject(USHORT = 1);
    630722        ~ScriptCreateObject();
    631723
    632         void SetClassName(const PSZ pszClassName);
    633         void SetTitle(const PSZ pszTitle);
    634         void SetLocation(const PSZ pszLocation);
    635         void SetConfig(const PSZ pszConfig);
    636         void SetReplace(BOOL bReplace);
    637         void SetCreateObject(CREATEOBJECTDATA createObject);
    638 
    639         void SetIndex(USHORT usIndex);
     724        USHORT SetClassName(const PSZ);
     725        USHORT SetTitle(const PSZ);
     726        USHORT SetLocation(const PSZ);
     727        USHORT SetConfig(const PSZ);
     728        USHORT SetReplace(BOOL);
     729        USHORT SetCreateObject(CREATEOBJECTDATA);
    640730
    641731        const PSZ ReturnClassName();
     
    646736        CREATEOBJECTDATA ReturnCreateObject();
    647737
    648         USHORT ReturnIndex();
    649 
    650         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    651 
    652         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **ppScriptError,
    653                           USHORT *pusErrorTableSize, ULONG ulLineNumber);
    654 
    655     };
    656 
    657 
    658 
    659 
    660 /*
    661  *@@ ScriptExecute class
     738        PSZ MakeScriptText(BOOL = TRUE);
     739
     740        PSZ BuildFromText(PSZ, ULONG);
     741
     742    };
     743
     744
     745
     746
     747/*
     748 *@@ScriptExecute:
    662749 *  This class is used in ScriptPackage class and it contains datas used
    663750 *  while creating execute attribute.
    664751 */
    665 class ScriptExecute
    666     {
    667     USHORT              usIndex;
    668 
    669     CHAR                szExecFileParams[CCHMAXPATH];
    670     USHORT              fusContext;
    671 
    672     public:
    673         ScriptExecute(USHORT usIndex = 1);
     752class ScriptExecute : public WarpINScriptBase
     753    {
     754    CHAR                _szExecFileParams[CCHMAXPATH];
     755    USHORT              _usContext;
     756
     757    public:
     758        ScriptExecute(USHORT = 1);
    674759        ~ScriptExecute();
    675760
    676         void SetExecFileParams(const PSZ pszExecFileParams);
    677         void SetContext(USHORT fusContext);
    678 
    679         void SetIndex(USHORT usIndex);
    680 
    681         void SetExecute(EXECUTEDATA execData);
     761        USHORT SetExecFileParams(const PSZ);
     762        USHORT SetContext(USHORT);
     763
     764        USHORT SetExecute(EXECUTEDATA);
    682765
    683766        const PSZ ReturnExecFileParams();
    684767        USHORT ReturnContext();
    685768
    686         USHORT ReturnIndex();
    687 
    688          EXECUTEDATA ReturnExecute();
    689 
    690         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    691 
    692         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **pScriptError,
    693                          USHORT *usErrorTableSize, ULONG ulLineNumber);
    694 
    695     };
    696 
    697 
    698 
    699 /*
    700  *@@ ScriptClearProfile class
     769        EXECUTEDATA ReturnExecute();
     770
     771        PSZ MakeScriptText(BOOL = TRUE);
     772
     773        PSZ BuildFromText(PSZ, ULONG);
     774
     775    };
     776
     777
     778
     779/*
     780 *@@ScriptClearProfile:
    701781 *  This class is used in ScriptPackage class and it contains datas used
    702782 *  while creating clearprofile attribute.
    703783 */
    704 class ScriptClearProfile
    705     {
    706     USHORT              usIndex;
    707 
    708     CHAR                szProfileString[CCHMAXPATH];
    709     CHAR                szApplication[MAXPROFILEAPPLICATIONLENGTH];
    710     CHAR                szKey[MAXPROFILEKEYLENGTH];
    711 
    712     public:
    713         ScriptClearProfile(USHORT usIndex = 1);
     784class ScriptClearProfile : public WarpINScriptBase
     785    {
     786    CHAR                _szProfileString[CCHMAXPATH];
     787    CHAR                _szApplication[MAXPROFILEAPPLICATIONLENGTH];
     788    CHAR                _szKey[MAXPROFILEKEYLENGTH];
     789
     790    public:
     791        ScriptClearProfile(USHORT = 1);
    714792        ~ScriptClearProfile();
    715793
    716         void SetProfileString(const PSZ pszProfile);
    717         void SetApplication(const PSZ pszApplication);
    718         void SetKey(const PSZ pszKey);
    719         void SetProfile(PROFILEDATA profile);
    720 
    721         void SetIndex(USHORT usIndex);
     794        USHORT SetProfileString(const PSZ);
     795        USHORT SetApplication(const PSZ);
     796        USHORT SetKey(const PSZ);
     797        USHORT SetProfile(PROFILEDATA);
    722798
    723799        const PSZ ReturnProfileString();
     
    726802        PROFILEDATA ReturnProfile();
    727803
    728         USHORT ReturnIndex();
    729 
    730         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    731 
    732         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **ppScriptError,
    733                           USHORT *pusErrorTableSize, ULONG ulLineNumber);
     804        PSZ MakeScriptText(BOOL = TRUE);
     805
     806        PSZ BuildFromText(PSZ, ULONG);
    734807
    735808    };
     
    743816 *  while creating writeprofile attribute.
    744817 */
    745 class ScriptWriteProfile
    746     {
    747     USHORT              usIndex;
    748 
    749     CHAR                szProfileString[CCHMAXPATH];
    750     CHAR                szApplication[MAXPROFILEAPPLICATIONLENGTH];
    751     CHAR                szKey[MAXPROFILEKEYLENGTH];
    752     PSZ                 pszString;
    753 
    754     public:
    755         ScriptWriteProfile(USHORT usIndex = 1);
     818class ScriptWriteProfile : public WarpINScriptBase
     819    {
     820    CHAR                _szProfileString[CCHMAXPATH];
     821    CHAR                _szApplication[MAXPROFILEAPPLICATIONLENGTH];
     822    CHAR                _szKey[MAXPROFILEKEYLENGTH];
     823    PSZ                 _pszString;
     824
     825    public:
     826        ScriptWriteProfile(USHORT = 1);
    756827        ~ScriptWriteProfile();
    757         ScriptWriteProfile &operator=(const ScriptWriteProfile &writeProfile);
    758 
    759         void SetProfileString(const PSZ pszProfile);
    760         void SetApplication(const PSZ pszApplication);
    761         void SetKey(const PSZ pszKey);
    762         void SetProfile(PROFILEDATA profile);
    763         void SetString(const PSZ pszString);
    764 
    765         void SetIndex(USHORT usIndex);
    766 
    767         const PSZ ReturnProfileString();
    768         const PSZ ReturnApplication();
    769         const PSZ ReturnKey();
    770         const PSZ ReturnString();
     828        ScriptWriteProfile &operator=(ScriptWriteProfile &);
     829
     830        USHORT SetProfileString(const PSZ);
     831        USHORT SetApplication(const PSZ);
     832        USHORT SetKey(const PSZ);
     833        USHORT SetProfile(PROFILEDATA);
     834        USHORT SetString(const PSZ);
     835
     836        const PSZ ReturnProfileString() const;
     837        const PSZ ReturnApplication() const;
     838        const PSZ ReturnKey() const;
     839        const PSZ ReturnString() const;
    771840        PROFILEDATA ReturnProfile();
    772841
    773         USHORT ReturnIndex();
    774 
    775         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    776 
    777         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **ppScriptError,
    778                           USHORT *pusErrorTableSize, ULONG ulLineNumber);
     842        PSZ MakeScriptText(BOOL = TRUE);
     843
     844        PSZ BuildFromText(PSZ, ULONG);
    779845
    780846    };
     
    788854 *  while creating KILLPROCESS attribute.
    789855 */
    790 class ScriptKillProcess
    791     {
    792     USHORT              usIndex;
    793 
    794     CHAR                szFileName[CCHMAXPATH];
    795 
    796     public:
    797         ScriptKillProcess(USHORT usIndex = 1);
     856class ScriptKillProcess : public WarpINScriptBase
     857    {
     858    CHAR                _szFileName[CCHMAXPATH];
     859
     860    public:
     861        ScriptKillProcess(USHORT = 1);
    798862        ~ScriptKillProcess();
    799863
    800         void SetFileName(const PSZ pszFileName);
    801 
    802         void SetIndex(USHORT usIndex);
     864        USHORT SetFileName(const PSZ);
    803865
    804866        const PSZ ReturnFileName();
    805867
    806         USHORT ReturnIndex();
    807 
    808         PSZ MakeScriptText(BOOL bAttribute = TRUE);
    809 
    810         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **pScriptError,
    811                          USHORT *usErrorTableSize, ULONG ulLineNumber);
     868        PSZ MakeScriptText(BOOL = TRUE);
     869
     870        PSZ BuildFromText(PSZ, ULONG);
    812871    };
    813872
     
    822881 *  related to package. There are two different index ordering modes...
    823882 */
    824 class ScriptPackage
    825     {
    826     USHORT              usIndex;
    827 
     883class ScriptPackage : public WarpINScriptBase
     884    {
    828885        // Used when removing object from table. If TRUE object indexes are
    829         // automatically ordered.
     886        // automatically reordered.
    830887        //  Ex. 0, 1, 2, 3, 4
    831888        //  Number 3 is removed -> indexing: 0, 1, 2, 3
    832889        //  New object -> indexing: 0, 1, 2, 3, 4
    833890        //  => New object is now number 4.
    834         // If FALSE object indexes are not ordered.
     891        // If FALSE object indexes are not reordered.
    835892        //  Ex. 0, 1, 2, 3, 4
    836893        //  Number 3 is removed -> indexing: 0, 1, 2, 4
    837894        //  New object -> indexing: 0, 1, 2, 4, 3
    838895        //  => New object is now number 3.
    839     BOOL                bAllowIndexArrangement;
    840 
    841     ScriptIndex         Index;
    842     PSZ                 pszDescription;
    843     ScriptPackageID     PckID;
    844     ScriptTitle         Title;
    845     ScriptTarget        Target;
    846     ScriptKeyWord       KeyWords;
    847 
    848     ScriptRequires      *pRequires;
    849     USHORT              usRequiresCount;
    850 
    851     ScriptConfigSys     *pConfigSys;
    852     USHORT              usConfigSysCount;
    853 
    854     ScriptRegisterClass *pRegisterClass;
    855     USHORT              usRegisterClassCount;
    856 
    857     ScriptReplaceClass  *pReplaceClass;
    858     USHORT              usReplaceClassCount;
    859 
    860     ScriptCreateObject  *pCreateObject;
    861     USHORT              usCreateObjectCount;
    862 
    863     ScriptExecute       *pExecute;
    864     USHORT              usExecuteCount;
    865 
    866     ScriptWriteProfile  *pWriteProfile;
    867     USHORT              usWriteProfileCount;
    868 
    869     ScriptClearProfile  *pProfile;
    870     USHORT              usProfileCount;
    871 
    872     ScriptKillProcess   *pKillProcess;
    873     USHORT              usKillProcessCount;
    874 
    875     // Functions for finding of unused indexes.
    876     // Function for copying table to another table.
    877         // ScriptRequires
    878     ScriptRequires *CopyTable(ScriptRequires *DestTable, ScriptRequires *SrcTable,
    879         USHORT usSize, USHORT usSkipIndex = 0);
    880     void ReBuildIndexes(ScriptRequires *Table, USHORT usTableSize);
    881     USHORT FindUnusedIndex(ScriptRequires *Table, USHORT usTableSize);
    882          // ScriptConfigSys
    883     ScriptConfigSys *CopyTable(ScriptConfigSys *DestTable, ScriptConfigSys *SrcTable,
    884         USHORT usSize, USHORT usSkipIndex = 0);
    885     void ReBuildIndexes(ScriptConfigSys *Table, USHORT usTableSize);
    886     USHORT FindUnusedIndex(ScriptConfigSys *Table, USHORT usTableSize);
    887          // ScriptRegisterClass
    888     ScriptRegisterClass *CopyTable(ScriptRegisterClass *DestTable, ScriptRegisterClass *SrcTable,
    889         USHORT usSize, USHORT usSkipIndex = 0);
    890     void ReBuildIndexes(ScriptRegisterClass *Table, USHORT usTableSize);
    891     USHORT FindUnusedIndex(ScriptRegisterClass *Table, USHORT usTableSize);
    892          // ScriptReplaceClass
    893     ScriptReplaceClass *CopyTable(ScriptReplaceClass *DestTable, ScriptReplaceClass *SrcTable,
    894         USHORT usSize, USHORT usSkipIndex = 0);
    895     void ReBuildIndexes(ScriptReplaceClass *Table, USHORT usTableSize);
    896     USHORT FindUnusedIndex(ScriptReplaceClass *Table, USHORT usTableSize);
    897          // ScriptCreateObject
    898     ScriptCreateObject *CopyTable(ScriptCreateObject *DestTable, ScriptCreateObject *SrcTable,
    899         USHORT usSize, USHORT usSkipIndex = 0);
    900     void ReBuildIndexes(ScriptCreateObject *Table, USHORT usTableSize);
    901     USHORT FindUnusedIndex(ScriptCreateObject *Table, USHORT usTableSize);
    902          // ScriptClearProfile
    903     ScriptClearProfile *CopyTable(ScriptClearProfile *DestTable, ScriptClearProfile *SrcTable,
    904         USHORT usSize, USHORT usSkipIndex = 0);
    905     void ReBuildIndexes(ScriptClearProfile *Table, USHORT usTableSize);
    906     USHORT FindUnusedIndex(ScriptClearProfile *Table, USHORT usTableSize);
    907          // ScriptWriteProfile
    908     ScriptWriteProfile *CopyTable(ScriptWriteProfile *DestTable, ScriptWriteProfile *SrcTable,
    909         USHORT usSize, USHORT usSkipIndex = 0);
    910     void ReBuildIndexes(ScriptWriteProfile *Table, USHORT usTableSize);
    911     USHORT FindUnusedIndex(ScriptWriteProfile *Table, USHORT usTableSize);
    912          // ScriptExecuteClass
    913     ScriptExecute *CopyTable(ScriptExecute *DestTable, ScriptExecute *SrcTable,
    914         USHORT usSize, USHORT usSkipIndex = 0);
    915     void ReBuildIndexes(ScriptExecute *Table, USHORT usTableSize);
    916     USHORT FindUnusedIndex(ScriptExecute *Table, USHORT usTableSize);
    917          // ScriptKillProcess
    918     ScriptKillProcess *CopyTable(ScriptKillProcess *DestTable, ScriptKillProcess *SrcTable,
    919         USHORT usSize, USHORT usSkipIndex = 0);
    920     void ReBuildIndexes(ScriptKillProcess *Table, USHORT usTableSize);
    921     USHORT FindUnusedIndex(ScriptKillProcess *Table, USHORT usTableSize);
    922     public:
    923         ScriptPackage(USHORT usIndex = 1, BOOL bAllowIndexArrangement = TRUE);
     896    BOOL                _bAllowIndexArrangement;
     897
     898    ScriptIndex         _Index;
     899    PSZ                 _pszDescription;
     900    ScriptPackageID     _PckID;
     901    ScriptTitle         _Title;
     902    ScriptTarget        _Target;
     903    ScriptKeyWord       _KeyWords;
     904
     905    ScriptRequires      *_pRequires;
     906    USHORT              _usRequiresCount;
     907
     908    ScriptConfigSys     *_pConfigSys;
     909    USHORT              _usConfigSysCount;
     910
     911    ScriptRegisterClass *_pRegisterClass;
     912    USHORT              _usRegisterClassCount;
     913
     914    ScriptReplaceClass  *_pReplaceClass;
     915    USHORT              _usReplaceClassCount;
     916
     917    ScriptCreateObject  *_pCreateObject;
     918    USHORT              _usCreateObjectCount;
     919
     920    ScriptExecute       *_pExecute;
     921    USHORT              _usExecuteCount;
     922
     923    ScriptWriteProfile  *_pWriteProfile;
     924    USHORT              _usWriteProfileCount;
     925
     926    ScriptClearProfile  *_pProfile;
     927    USHORT              _usProfileCount;
     928
     929    ScriptKillProcess   *_pKillProcess;
     930    USHORT              _usKillProcessCount;
     931
     932    public:
     933        ScriptPackage(USHORT = 1, BOOL = TRUE);
    924934        ~ScriptPackage();
    925935        // Copy constructor. Needed when adding, removing or moving objects
     
    927937        ScriptPackage(ScriptPackage &);
    928938        // Assignment operator. Needed when adding, removing or moving objects.
    929         ScriptPackage &operator=(const ScriptPackage &);
    930 
    931         USHORT SetDescription(const PSZ pszDescription);
     939        ScriptPackage &operator=(ScriptPackage &);
     940        // Clear all.
     941        USHORT ClearAll();
     942
     943        USHORT SetDescription(const PSZ);
    932944        //SetPackageData(PACKAGEDATA package);
    933 
    934         void SetIndex(USHORT usIndex);
    935945
    936946        const PSZ ReturnDescription();
    937947        //PACKAGEDATA ReturnPackageData();
    938948
    939         void SetPackageIndex(USHORT usPckIndex);
    940         void SetPackageID(PACKAGEIDDATA);
    941         void SetTitle(const PSZ pszTitle);
    942         void SetTarget(const PSZ pszTarget);
    943         void SetKeyWords(USHORT usKeyWords);
     949        USHORT SetPackageIndex(USHORT);
     950        USHORT SetPackageID(PACKAGEIDDATA);
     951        USHORT SetTitle(const PSZ);
     952        USHORT SetTarget(const PSZ);
     953        USHORT SetKeyWords(USHORT);
    944954        ScriptIndex *ReturnPackageIndex();
    945955        USHORT ReturnPackageIndexNumber();
     
    951961        ScriptKeyWord *ReturnKeyWordObject();
    952962
    953         USHORT ReturnIndex();
    954 
    955         PSZ MakeScriptText(BOOL bAttribute = TRUE);
     963        PSZ MakeScriptText(BOOL = TRUE);
    956964
    957965        // Build package accordingly to pszScriptText. If there is any errors
    958966        // in script text, error information is returned in *pScriptError table.
    959         PSZ BuildFromText(PSZ pszScriptText, SCRIPTERROR **pScriptError,
    960                          USHORT *usErrorTableSize, ULONG ulLineNumber);
     967        PSZ BuildFromText(PSZ, ULONG);
    961968
    962969        // Functions for handling of requires class
     
    964971            // pointer to the new object.
    965972        ScriptRequires *CreateRequiresObject();
    966         ScriptRequires *CreateRequiresObject(REQUIRESDATA requiresData);
     973        ScriptRequires *CreateRequiresObject(REQUIRESDATA);
    967974            // Returns address of ScriptRequires object which index is usIndex.
    968         ScriptRequires *ReturnRequiresObject(USHORT usIndex);
     975        ScriptRequires *ReturnRequiresObject(USHORT);
    969976            // Deletes ScriptRequires object which index is usIndex.
    970         USHORT DeleteRequiresObject(USHORT usIndex);
     977        USHORT DeleteRequiresObject(USHORT);
    971978            // Deletes ScriptRequires object which address is
    972979            // *ScriptRequiresClass.
    973         USHORT DeleteRequiresObject(ScriptRequires *ScriptRequiresObject);
     980        USHORT DeleteRequiresObject(ScriptRequires *);
    974981            // Returns how many ScriptRequires objectes belongs to ScriptPackage
    975982            // (this) object.
     
    982989            // pointer to the new object.
    983990        ScriptConfigSys *CreateConfigSysObject();
    984          ScriptConfigSys *CreateConfigSysObject(CONFIGSYSDATA data);
     991         ScriptConfigSys *CreateConfigSysObject(CONFIGSYSDATA);
    985992            // Returns address of ScriptConfigSys object which index is usIndex.
    986         ScriptConfigSys *ReturnConfigSysObject(USHORT usIndex);
     993        ScriptConfigSys *ReturnConfigSysObject(USHORT);
    987994            // Deletes ScriptConfigSys object which index is usIndex.
    988         USHORT DeleteConfigSysObject(USHORT usIndex);
     995        USHORT DeleteConfigSysObject(USHORT);
    989996            // Deletes ScriptConfigSys object which address is
    990997            // *ScriptConfigSysObject.
    991         USHORT DeleteConfigSysObject(ScriptConfigSys *ScriptConfigSysObject);
     998        USHORT DeleteConfigSysObject(ScriptConfigSys *);
    992999            // Returns index of object which address is *ScriptConfigSysObject.
    993         USHORT ReturnIndexOfConfigSysObject(ScriptConfigSys *ScriptConfigSysObject);
     1000        USHORT ReturnIndexOfConfigSysObject(ScriptConfigSys *);
    9941001            // Returns how many ScriptConfigSys objectes belongs to ScriptPackage
    9951002            // (this) object.
     
    10021009            // pointer to the new object.
    10031010        ScriptRegisterClass *CreateRegisterClassObject();
    1004         ScriptRegisterClass *CreateRegisterClassObject(REGISTERCLASSDATA data);
     1011        ScriptRegisterClass *CreateRegisterClassObject(REGISTERCLASSDATA);
    10051012            // Returns address of ScriptRegisterClass object which index is
    10061013            // usIndex.
    1007         ScriptRegisterClass *ReturnRegisterClassObject(USHORT usIndex);
     1014        ScriptRegisterClass *ReturnRegisterClassObject(USHORT);
    10081015            // Deletes ScriptRegisterClass object which index is usIndex.
    1009         USHORT DeleteRegisterClassObject(USHORT usIndex);
     1016        USHORT DeleteRegisterClassObject(USHORT);
    10101017            // Deletes ScriptRegisterClass object which address is
    10111018            // *ScriptRegisterClassObject.
    1012         USHORT DeleteRegisterClassObject(ScriptRegisterClass
    1013                                         *ScriptRegisterClassObject);
     1019        USHORT DeleteRegisterClassObject(ScriptRegisterClass *);
    10141020            // Returns how many ScriptRegisterClass objectes belongs to ScriptPackage
    10151021            // (this) object.
     
    10221028            // pointer to the new object.
    10231029        ScriptReplaceClass *CreateReplaceClassObject();
    1024         ScriptReplaceClass *CreateReplaceClassObject(REPLACECLASSDATA data);
     1030        ScriptReplaceClass *CreateReplaceClassObject(REPLACECLASSDATA);
    10251031            // Returns address of ScriptReplaceClass object which index is
    10261032            // usIndex.
    1027         ScriptReplaceClass *ReturnReplaceClassObject(USHORT usIndex);
     1033        ScriptReplaceClass *ReturnReplaceClassObject(USHORT);
    10281034            // Deletes ScriptReplaceClass object which index is usIndex.
    1029         USHORT DeleteReplaceClassObject(USHORT usIndex);
     1035        USHORT DeleteReplaceClassObject(USHORT);
    10301036            // Deletes ScriptReplaceClass object which address is
    10311037            // *ScriptReplaceClassObject.
    1032         USHORT DeleteReplaceClassObject(ScriptReplaceClass
    1033                                       *ScriptReplaceClassObject);
     1038        USHORT DeleteReplaceClassObject(ScriptReplaceClass *);
    10341039            // Returns how many ScriptReplaceClass objectes belongs to ScriptPackage
    10351040            // (this) object.
     
    10421047            // pointer to the new object.
    10431048        ScriptCreateObject *CreateCreateObjectObject();
    1044         ScriptCreateObject *CreateCreateObjectObject(CREATEOBJECTDATA data);
     1049        ScriptCreateObject *CreateCreateObjectObject(CREATEOBJECTDATA);
    10451050            // Returns address of ScriptCreateObject object which index is
    10461051            // usIndex.
    1047         ScriptCreateObject *ReturnCreateObjectObject(USHORT usIndex);
     1052        ScriptCreateObject *ReturnCreateObjectObject(USHORT);
    10481053            // Deletes ScriptCreateObject object which index is usIndex.
    1049         USHORT DeleteCreateObjectObject(USHORT usIndex);
     1054        USHORT DeleteCreateObjectObject(USHORT);
    10501055            // Deletes ScriptCreateObject object which address is
    10511056            // *ScriptCreateObjectObject.
    1052         USHORT DeleteCreateObjectObject(ScriptCreateObject
    1053                                       *ScriptCreateObjectObject);
     1057        USHORT DeleteCreateObjectObject(ScriptCreateObject *);
    10541058            // Returns how many ScriptCreateObject objectes belongs to ScriptPackage
    10551059            // (this) object.
     
    10621066            // pointer to the new object.
    10631067        ScriptExecute *CreateExecuteObject();
    1064         ScriptExecute *CreateExecuteObject(PSZ pszExecute);
     1068        ScriptExecute *CreateExecuteObject(PSZ);
    10651069            // Returns address of ScriptExecute object which index is
    10661070            // usIndex.
    1067         ScriptExecute *ReturnExecuteObject(USHORT usIndex);
     1071        ScriptExecute *ReturnExecuteObject(USHORT);
    10681072            // Deletes ScriptExecute object which index is usIndex.
    1069         USHORT DeleteExecuteObject(USHORT usIndex);
     1073        USHORT DeleteExecuteObject(USHORT);
    10701074            // Deletes ScriptExecute object which address is
    10711075            // *ScriptExecuteObject.
    1072         USHORT DeleteExecuteObject(ScriptExecute
    1073                                   *ScriptExecuteObject);
     1076        USHORT DeleteExecuteObject(ScriptExecute *);
    10741077            // Returns how many ScriptCreateObject objectes belongs to ScriptPackage
    10751078            // (this) object.
     
    10821085            // pointer to the new object.
    10831086        ScriptClearProfile *CreateClearProfileObject();
    1084         ScriptClearProfile *CreateClearProfileObject(PROFILEDATA data);
     1087        ScriptClearProfile *CreateClearProfileObject(PROFILEDATA);
    10851088            // Returns address of ScriptClearProfile object which index is
    10861089            // usIndex.
    1087         ScriptClearProfile *ReturnClearProfileObject(USHORT usIndex);
     1090        ScriptClearProfile *ReturnClearProfileObject(USHORT);
    10881091            // Deletes ScriptClearProfile object which index is usIndex.
    1089         USHORT DeleteClearProfileObject(USHORT usIndex);
     1092        USHORT DeleteClearProfileObject(USHORT);
    10901093            // Deletes ScriptClearProfile object which address is
    10911094            // *ScriptClearProfileObject.
    1092         USHORT DeleteClearProfileObject(ScriptClearProfile
    1093                                        *ScriptClearProfileObject);
     1095        USHORT DeleteClearProfileObject(ScriptClearProfile *);
    10941096            // Returns how many ScriptCreateObject objectes belongs to ScriptPackage
    10951097            // (this) object.
    10961098        USHORT ReturnClearProfileObjectCount();
     1099
    10971100
    10981101
     
    11011104            // pointer to the new object.
    11021105        ScriptWriteProfile *CreateWriteProfileObject();
    1103         ScriptWriteProfile *CreateWriteProfileObject(PROFILEDATA data);
     1106        ScriptWriteProfile *CreateWriteProfileObject(PROFILEDATA);
    11041107            // Returns address of ScriptWriteProfile object which index is
    11051108            // usIndex.
    1106         ScriptWriteProfile *ReturnWriteProfileObject(USHORT usIndex);
     1109        ScriptWriteProfile *ReturnWriteProfileObject(USHORT);
    11071110            // Deletes ScriptWriteProfile object which index is usIndex.
    1108         USHORT DeleteWriteProfileObject(USHORT usIndex);
     1111        USHORT DeleteWriteProfileObject(USHORT);
    11091112            // Deletes ScriptWriteProfile object which address is
    11101113            // *ScriptWriteProfileObject.
    1111         USHORT DeleteWriteProfileObject(ScriptWriteProfile
    1112                                        *ScriptWriteProfileObject);
     1114        USHORT DeleteWriteProfileObject(ScriptWriteProfile *);
    11131115            // Returns how many ScriptCreateObject objectes belongs to ScriptPackage
    11141116            // (this) object.
    11151117        USHORT ReturnWriteProfileObjectCount();
     1118
    11161119
    11171120
     
    11201123            // pointer to the new object.
    11211124        ScriptKillProcess *CreateKillProcessObject();
    1122         ScriptKillProcess *CreateKillProcessObject(const PSZ pszFileName);
     1125        ScriptKillProcess *CreateKillProcessObject(const PSZ);
    11231126            // Returns address of ScriptKillProcess object which index is
    11241127            // usIndex.
    1125         ScriptKillProcess *ReturnKillProcessObject(USHORT usIndex);
     1128        ScriptKillProcess *ReturnKillProcessObject(USHORT);
    11261129            // Deletes ScriptKillProcess object which index is usIndex.
    1127         USHORT DeleteKillProcessObject(USHORT usIndex);
     1130        USHORT DeleteKillProcessObject(USHORT);
    11281131            // Deletes ScriptKillProcess object which address is
    11291132            // *ScriptKillProcessObject.
    1130         USHORT DeleteKillProcessObject(ScriptKillProcess
    1131                                        *ScriptKillProcessObject);
     1133        USHORT DeleteKillProcessObject(ScriptKillProcess *);
    11321134            // Returns how many ScriptCreateObject objectes belongs to ScriptPackage
    11331135            // (this) object.
     
    12131215                   BOOL bAllowIndexArrangement = TRUE);
    12141216        ~ScriptGroup();
    1215         ScriptGroup(const ScriptGroup &);
    1216         ScriptGroup &operator=(const ScriptGroup &);
     1217        ScriptGroup(ScriptGroup &);
     1218        USHORT ClearAll();
     1219        ScriptGroup &operator=(ScriptGroup &);
    12171220
    12181221        void SetVirtual(BOOL bVirtual);
     
    12381241            // pointer to the new object.
    12391242        ScriptPackage *CreatePackageObject();
    1240         ScriptPackage *CreatePackageObject(const ScriptPackage *pPck);
     1243        ScriptPackage *CreatePackageObject(ScriptPackage *pPck);
    12411244            // Returns address of ScriptPackage object which index is
    12421245            // usIndex.
     
    13471350/*
    13481351 *@@ ScriptHead class
    1349  *  This class is used in WarpINScript class and it contains datas used
     1352 *  This class is used in WarpINScriptBase class and it contains datas used
    13501353 *  while creating head tag. This class contains all other classes
    13511354 *  related to head attribute including group, title and message. Although
     
    15631566/*
    15641567 *@@ ScriptBody class
    1565  *  This class is used in WarpINScript class and it contains datas used
     1568 *  This class is used in WarpINScriptBase class and it contains datas used
    15661569 *  while creating body tag. This class contains page class.
    15671570 */
     
    16201623/*
    16211624 *@@ ScriptVersion class
    1622  *  This class is used in WarpINScript class and it contains datas used
     1625 *  This class is used in WarpINScriptBase class and it contains datas used
    16231626 *  while creating version attribute. This class contains no other classes.
    16241627 */
     
    16581661/*
    16591662 *@@ ScriptOS class
    1660  *  This class is used in WarpINScript class and it contains datas used
     1663 *  This class is used in WarpINScriptBase class and it contains datas used
    16611664 *  while creating operating system attribute. This class contains no other
    16621665 *  classes.
     
    16971700/*
    16981701 *@@ ScriptCodePage class
    1699  *  This class is used in WarpINScript class and it contains datas used
     1702 *  This class is used in WarpINScriptBase class and it contains datas used
    17001703 *  while creating codepage attribute. This class contains no other
    17011704 *  classes.
  • TabularUnified trunk/include/wicpm/trad_arc_thread.h

    r128 r172  
    1 
    2 /*
    3  * trad_arc_thread.h
    4  *
    5  *  Copyright (C) 1999-2000 Teemu Ahola.
    6  *
    7  */
    81
    92
  • TabularUnified trunk/src/wicpm/gui_helpers.cpp

    r116 r172  
    324324    }
    325325
     326
     327USHORT guiLoadString(HAB habThread, ULONG ulID, PSZ *ppsz)
     328    {
     329    CHAR szBuf[255];
     330    USHORT rc = 0;
     331
     332    if (*ppsz)
     333        free(*ppsz);
     334    if (WinLoadString(habThread, NULLHANDLE, ulID ,
     335                      sizeof(szBuf), szBuf))
     336        *ppsz = strdup(szBuf);
     337    else
     338        {
     339        *ppsz = strdup("Error: String resource not found");
     340        rc = 1;
     341        }
     342
     343    return rc;
     344    }
  • TabularUnified trunk/src/wicpm/gui_notebook.cpp

    r116 r172  
    1313#include <stdlib.h>
    1414#include "setup.h"
     15#include "helpers\dosh.h"
    1516
    1617#include "wicpm\gui_notebook.h"
     
    172173    /*ulNBStyle = WinQueryWindowULong (hwndNotebook, QWL_STYLE);
    173174    ulNBStyle &= 0xffff0000;
    174     ulNBStyle |= BKS_SOLIDBIND | BKS_BACKPAGESBR | BKS_MAJORTABTOP |
    175                  BKS_SQUARETABS | BKS_TABTEXTCENTER | BKS_STATUSTEXTLEFT |
    176                  WS_GROUP;
     175
     176    if (doshIsWarp4())
     177        ulNBStyle |= 0x800 | BKS_BACKPAGESBR | BKS_TABTEXTCENTER | WS_GROUP;
     178    else
     179        ulNBStyle |= BKS_SOLIDBIND | BKS_BACKPAGESBR | BKS_MAJORTABTOP |
     180                     BKS_SQUARETABS | BKS_TABTEXTCENTER | BKS_STATUSTEXTLEFT |
     181                     WS_GROUP;
     182
    177183    WinSetWindowULong (hwndNotebook, QWL_STYLE, ulNBStyle);
    178184    WinInvalidateRect (hwndNotebook, NULL, TRUE);*/
    179 
    180185
    181186    if (!SizeTabs (hwndNotebook))
  • TabularUnified trunk/src/wicpm/gui_objwnd.cpp

    r116 r172  
    2626#include "helpers\dosh.h"
    2727#include "helpers\stringh.h"
     28#include <list>
     29#include "helpers\stringh.h"
     30#include "helpers\xstring.h"
     31#include "base\bs_string.h"
    2832
    2933#include "wicpm\script.hpp"
  • TabularUnified trunk/src/wicpm/gui_trad_cntr.cpp

    r116 r172  
    2929#include "helpers\cnrh.h"
    3030#include "helpers\linklist.h"
     31#include <list>
     32#include "helpers\stringh.h"
     33#include "helpers\xstring.h"
     34#include "base\bs_string.h"
    3135
    3236#include "wicpm\script.hpp"
  • TabularUnified trunk/src/wicpm/gui_trad_nb_dlgproc.cpp

    r155 r172  
    2323#include "helpers\linklist.h"
    2424#include "helpers\cnrh.h"
     25#include "helpers\stringh.h"
     26#include "helpers\xstring.h"
     27#include "base\bs_string.h"
     28
    2529
    2630#include "wiarchive\wiarchive.h" // WIArchive created by Jens B„ckman.
     
    7781    {
    7882    MRESULT mrc = 0;
     83    static BOOL bSelectedFromList = FALSE;
    7984
    8085    switch (msg)
     
    110115            sprintf(szNumber, "%d", pPckID->ReturnRevision());
    111116            WinSetDlgItemText(hwndDlg, IDD_NB_GENERAL_VERSIONREVISION, szNumber);
     117
     118            // Insert target combo box list items.
     119            /*HWND hwndTarget = WinWindowFromID(hwndDlg, IDD_NB_GENERAL_TARGETPATH);
     120            WinInsertLboxItem(hwndTarget, LIT_END, TEXT_TARGET_DEFAPPPATH);
     121            WinInsertLboxItem(hwndTarget, LIT_END, TEXT_TARGET_DEFTOOLPATH);
     122            WinInsertLboxItem(hwndTarget, LIT_END, TEXT_TARGET_BOOTDRIVER);
     123            WinInsertLboxItem(hwndTarget, LIT_END, TEXT_TARGET_PCKINDEX);
     124            WinInsertLboxItem(hwndTarget, LIT_END, TEXT_TARGET_PCK);
     125            WinInsertLboxItem(hwndTarget, LIT_END, TEXT_TARGET_ENV);*/
     126
    112127            break;
    113128            }
     
    142157                        case IDD_NB_GENERAL_PCKNAME:
    143158                            {
    144                             WinQueryDlgItemText (hwndDlg, IDD_NB_GENERAL_PCKNAME,
    145                                                 MAXPCKNAMELENGTH, szString);
     159                            WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_PCKNAME,
     160                                               MAXPCKNAMELENGTH, szString);
    146161                            pPckID->SetPackage(szString);
    147162
     
    150165                        case IDD_NB_GENERAL_AUTHORNAME:
    151166                            {
    152                             WinQueryDlgItemText (hwndDlg, IDD_NB_GENERAL_AUTHORNAME,
    153                                                 MAXVENDORNAMELENGTH, szString);
     167                            WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_AUTHORNAME,
     168                                               MAXVENDORNAMELENGTH, szString);
    154169                            pPckID->SetVendor(szString);
    155170                            break;
     
    157172                        case IDD_NB_GENERAL_APPNAME:
    158173                            {
    159                             WinQueryDlgItemText (hwndDlg, IDD_NB_GENERAL_APPNAME,
    160                                                 MAXAPPNAMELENGTH, szString);
     174                            WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_APPNAME,
     175                                               MAXAPPNAMELENGTH, szString);
    161176                            pPckID->SetApplication(szString);
    162177                            break;
     
    164179                        case IDD_NB_GENERAL_VERSIONMAJOR:
    165180                            {
    166                             WinQueryDlgItemText (hwndDlg, IDD_NB_GENERAL_VERSIONMAJOR,
    167                                                 MAXVERSIONLENGTH, szString);
     181                            WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_VERSIONMAJOR,
     182                                               MAXVERSIONLENGTH, szString);
    168183                            pPckID->SetMajor(atoi(szString));
    169184                            break;
     
    171186                        case IDD_NB_GENERAL_VERSIONMINOR:
    172187                            {
    173                             WinQueryDlgItemText (hwndDlg, IDD_NB_GENERAL_VERSIONMINOR,
    174                                                 MAXVERSIONLENGTH, szString);
     188                            WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_VERSIONMINOR,
     189                                               MAXVERSIONLENGTH, szString);
    175190                            pPckID->SetMinor(atoi(szString));
    176191                            break;
     
    178193                        case IDD_NB_GENERAL_VERSIONREVISION:
    179194                            {
    180                             WinQueryDlgItemText (hwndDlg, IDD_NB_GENERAL_VERSIONREVISION,
    181                                                 MAXVERSIONLENGTH, szString);
     195                            WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_VERSIONREVISION,
     196                                               MAXVERSIONLENGTH, szString);
    182197                            pPckID->SetRevision(atoi(szString));
    183198                            break;
     
    185200                        case IDD_NB_GENERAL_TITLE:
    186201                            {
    187                             WinQueryDlgItemText (hwndDlg, IDD_NB_GENERAL_TITLE,
    188                                                 MAXTITLELENGTH, szString);
     202                            WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_TITLE,
     203                                               MAXTITLELENGTH, szString);
    189204                            pPckDlgInfo->pPackage->SetTitle(szString);
    190                             break;
    191                             }
     205                            //break;
     206                          //  }
     207                        //case IDD_NB_GENERAL_TARGETPATH:
     208                            //{
     209                            WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_TARGETPATH,
     210                                               CCHMAXPATH, szString);
     211                            pPckDlgInfo->pPackage->SetTarget(szString);
     212                            break;
     213                            }
     214                        }
     215                    break;
     216                    } // endcase EN_KILLFOCUS.
     217                /*case CBN_LBSELECT:
     218                    {
     219                    switch (SHORT1FROMMP(mp1))
     220                        {
    192221                        case IDD_NB_GENERAL_TARGETPATH:
    193222                            {
    194                             WinQueryDlgItemText (hwndDlg, IDD_NB_GENERAL_TARGETPATH,
    195                                                 CCHMAXPATH, szString);
    196                             pPckDlgInfo->pPackage->SetTarget(szString);
    197                             break;
    198                             }
    199                         }
    200                     break;
    201                     } // endcase EN_KILLFOCUS.
     223                            // An item has been selected from list.
     224                            //bSelectedFromList = TRUE;
     225                            break;
     226                            }
     227                        }
     228                    break;
     229                    }*/
     230                /*case CBN_LBSELECT:
     231                    {
     232                    switch (SHORT1FROMMP(mp1))
     233                        {
     234                        case IDD_NB_GENERAL_TARGETPATH:
     235                            {
     236                            CHAR szTemp[CCHMAXPATH];
     237                            PSZ pszFirst = NULL, pszLast = NULL, pszTemp = NULL;
     238                            USHORT usFirst = 0, usLast = 0;
     239                            HWND hwndEF = (HWND)LONGFROMMP(mp2);
     240
     241                            // Check that the text was selected from the list.
     242                            // If not, break.
     243                            if (bSelectedFromList == FALSE)
     244                                break;
     245                            bSelectedFromList = FALSE;
     246
     247                            WinQueryWindowText(hwndEF, CCHMAXPATH, szTemp);
     248
     249                            // Check if there is '(' somewhere.
     250                            pszFirst = strchr(szTemp, '(');
     251                            // If there is '(', try to find ending ')'.
     252                            if (pszFirst)
     253                                {
     254                                pszLast = strchr(szTemp, ')');
     255                                // There is no ')' in the string. Leave.
     256                                if (!pszLast)
     257                                    break;
     258                                // Get first ('s index.
     259                                pszTemp = szTemp;
     260                                while (pszTemp != pszFirst)
     261                                    {
     262                                    usFirst ++;
     263                                    pszTemp ++;
     264                                    }
     265                                // Get last )'s index.
     266                                pszTemp = szTemp;
     267                                while (pszTemp != pszLast)
     268                                    {
     269                                    usLast ++;
     270                                    pszTemp ++;
     271                                    }
     272                                // Select the text between '(' and ')'.
     273                                WinSendMsg(hwndEF, EM_SETSEL,
     274                                           MPFROM2SHORT(usFirst + 1, usLast - 1), 0);
     275                                }
     276                            break;
     277                            }
     278                        }
     279                    break;
     280                    }*/
    202281                }
    203282            break;
     
    847926 *  Dialog procedure for object page dialog in the package notebook.
    848927 */
    849 MRESULT EXPENTRY fnTradObjectPageProc (HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
     928MRESULT EXPENTRY fnTradObjectPageProc(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
    850929    {
    851930    MRESULT mrc = 0;
     
    865944            HWND hwndClassLbox = WinWindowFromID (hwndDlg, IDD_NB_OBJECT_CLASSNAME);
    866945            HWND hwndConfigLbox = WinWindowFromID (hwndDlg, IDD_NB_OBJECT_CONFIG);
     946
     947            /*  // Subclass config listbox's window procedure with fnCnfgLbox.
     948                // This way we can modify the function of the listbox.
     949                PFNWP OldLboxProc = WinSubclassWindow(hwndConfigLbox, fnCnfgLbox);
     950                if (OldLboxProc)
     951                    {
     952                    OLDPROC *pData = (OLDPROC*)malloc(sizeof(OLDPROC));
     953                    pData->OldProc = OldLboxProc;
     954                    WinSetWindowULong(hwndConfigLbox, QWL_USER, (ULONG)pData);
     955                    }
     956            */
    867957
    868958            pMsgData = new MSGDATA;
     
    9781068                case IDD_NB_OBJECT_REMOVE:
    9791069                    {
    980                     PPCKDLGINFO pPckDlgInfo = (PPCKDLGINFO)WinQueryWindowPtr (hwndDlg, 0);
    981                     HWND hwndLbox = WinWindowFromID (hwndDlg,
     1070                    PPCKDLGINFO pPckDlgInfo = (PPCKDLGINFO)WinQueryWindowPtr(hwndDlg, 0);
     1071                    HWND hwndLbox = WinWindowFromID(hwndDlg,
    9821072                        IDD_NB_OBJECT_LIST);
    9831073                    ScriptPackage *pPck = pPckDlgInfo->pPackage;
     
    9881078                        pPck->DeleteCreateObjectObject((USHORT)sSelected);
    9891079                            // Clear entry fields.
    990                         WinSetDlgItemText (hwndDlg, IDD_NB_OBJECT_CLASSNAME, "");
    991                         WinSetDlgItemText (hwndDlg, IDD_NB_OBJECT_TITLE, "");
    992                         WinSetDlgItemText (hwndDlg, IDD_NB_OBJECT_LOCATION, "");
    993                         WinSetDlgItemText (hwndDlg, IDD_NB_OBJECT_CONFIG, "");
     1080                        WinSetDlgItemText(hwndDlg, IDD_NB_OBJECT_CLASSNAME, "");
     1081                        WinSetDlgItemText(hwndDlg, IDD_NB_OBJECT_TITLE, "");
     1082                        WinSetDlgItemText(hwndDlg, IDD_NB_OBJECT_LOCATION, "");
     1083                        WinSetDlgItemText(hwndDlg, IDD_NB_OBJECT_CONFIG, "");
    9941084                            // Uncheck replace check button.
    995                         WinCheckButton (hwndDlg, IDD_NB_OBJECT_REPLACE, FALSE);
     1085                        WinCheckButton(hwndDlg, IDD_NB_OBJECT_REPLACE, FALSE);
    9961086                        }
    9971087                    sSelected = 0;
    9981088                    if (pPck->ReturnCreateObjectObjectCount() == 0)
    999                         WinEnableControl (hwndDlg, IDD_NB_OBJECT_REMOVE, FALSE);
    1000                     WinEnableControl (hwndDlg, IDD_NB_OBJECT_UP, FALSE);
    1001                     WinEnableControl (hwndDlg, IDD_NB_OBJECT_DOWN, FALSE);
     1089                        WinEnableControl(hwndDlg, IDD_NB_OBJECT_REMOVE, FALSE);
     1090                    WinEnableControl(hwndDlg, IDD_NB_OBJECT_UP, FALSE);
     1091                    WinEnableControl(hwndDlg, IDD_NB_OBJECT_DOWN, FALSE);
     1092                    break;
     1093                    }
     1094                case IDD_NB_OBJECT_UP:
     1095                    {
     1096                    PPCKDLGINFO pPckDlgInfo = (PPCKDLGINFO)WinQueryWindowPtr (hwndDlg, 0);
     1097                    HWND hwndLbox = WinWindowFromID (hwndDlg,
     1098                        IDD_NB_OBJECT_LIST);
     1099                    ScriptCreateObject *pObject = NULL, *pDestination = NULL, temp;
     1100                    ScriptPackage *pPck = pPckDlgInfo->pPackage;
     1101                    PSZ pszScript = NULL;
     1102
     1103                    // If user has selected an list box item and it is not the first
     1104                    // one, it can be moved upwards.
     1105                    if (sSelected > 1)
     1106                        {
     1107                        // Get selected entity.
     1108                        pObject = pPck->ReturnCreateObjectObject(sSelected);
     1109                        // Get entity before selected entity.
     1110                        pDestination = pPck->ReturnCreateObjectObject(sSelected - 1);
     1111                        // Swap the contents of the entities.
     1112                        temp = *pObject;
     1113                        *pObject = *pDestination;
     1114                        *pDestination = temp;
     1115                        // Swap indexes.
     1116                        pDestination->SetIndex(pObject->ReturnIndex());
     1117                        pObject->SetIndex(temp.ReturnIndex());
     1118                        // Delete old list box items. We have to substract 1 and 2
     1119                        // because indexing in script class doesn't start from 0
     1120                        // but it starts from 1 and sSelected tells which object
     1121                        // is selected and not which list index is selected.
     1122                        WinSendMsg(hwndLbox, LM_DELETEITEM, MPFROMSHORT(sSelected - 1),
     1123                                   0);
     1124                        WinSendMsg(hwndLbox, LM_DELETEITEM, MPFROMSHORT(sSelected - 2),
     1125                                   0);
     1126                        // Set proper script texts to the list box.
     1127                        pszScript = pDestination->MakeScriptText(FALSE);
     1128                        WinInsertLboxItem(hwndLbox, pDestination->ReturnIndex() - 1,
     1129                                          pszScript);
     1130                        delete [] pszScript;
     1131                        pszScript = pObject->MakeScriptText(FALSE);
     1132                        WinInsertLboxItem(hwndLbox, pObject->ReturnIndex() - 1,
     1133                                          pszScript);
     1134                        delete [] pszScript;
     1135                        // Select object which was selected before.
     1136                        WinSendMsg(hwndLbox, LM_SELECTITEM, MPFROMSHORT(sSelected - 2),
     1137                                   MPFROMSHORT(TRUE));
     1138                        }
     1139                    break;
     1140                    }
     1141                case IDD_NB_OBJECT_DOWN:
     1142                    {
     1143                    PPCKDLGINFO pPckDlgInfo = (PPCKDLGINFO)WinQueryWindowPtr (hwndDlg, 0);
     1144                    HWND hwndLbox = WinWindowFromID (hwndDlg,
     1145                        IDD_NB_OBJECT_LIST);
     1146                    ScriptCreateObject *pObject = NULL, *pDestination = NULL, temp;
     1147                    ScriptPackage *pPck = pPckDlgInfo->pPackage;
     1148                    PSZ pszScript = NULL;
     1149
     1150                    // If user has selected an list box item and it is not the last
     1151                    // one, it can be moved downwards.
     1152                    if (sSelected < pPck->ReturnCreateObjectObjectCount())
     1153                        {
     1154                        // Get selected entity.
     1155                        pObject = pPck->ReturnCreateObjectObject(sSelected);
     1156                        // Get entity after selected entity.
     1157                        pDestination = pPck->ReturnCreateObjectObject(sSelected + 1);
     1158                        // Swap the contents of the entities.
     1159                        temp = *pObject;
     1160                        *pObject = *pDestination;
     1161                        *pDestination = temp;
     1162                        // Swap indexes.
     1163                        pDestination->SetIndex(pObject->ReturnIndex());
     1164                        pObject->SetIndex(temp.ReturnIndex());
     1165                        // Delete old list box items. We have to subtract 1
     1166                        // because indexing in script class doesn't start from 0
     1167                        // but it starts from 1 and sSelected tells which object
     1168                        // is selected and not which list index is selected.
     1169                        WinSendMsg(hwndLbox, LM_DELETEITEM, MPFROMSHORT(sSelected),
     1170                                   0);
     1171                        WinSendMsg(hwndLbox, LM_DELETEITEM, MPFROMSHORT(sSelected - 1),
     1172                                   0);
     1173                        // Set proper script texts to the list box.
     1174                        pszScript = pObject->MakeScriptText(FALSE);
     1175                        WinInsertLboxItem(hwndLbox, pObject->ReturnIndex() - 1,
     1176                                          pszScript);
     1177                        delete [] pszScript;
     1178                        pszScript = pDestination->MakeScriptText(FALSE);
     1179                        WinInsertLboxItem(hwndLbox, pDestination->ReturnIndex() - 1,
     1180                                          pszScript);
     1181                        delete [] pszScript;
     1182                        // Select object which was selected before.
     1183                        WinSendMsg(hwndLbox, LM_SELECTITEM, MPFROMSHORT(sSelected),
     1184                                   MPFROMSHORT(TRUE));
     1185                        }
    10021186                    break;
    10031187                    }
     
    10211205                            SHORT sCount = SHORT1FROMMR(WinSendDlgItemMsg(hwndDlg,
    10221206                                IDD_NB_OBJECT_LIST, LM_QUERYITEMCOUNT, 0, 0));
     1207                            // If something is selected.
    10231208                            if (sRet != LIT_NONE)
    10241209                                {
    10251210                                sSelected = sRet + 1;
     1211                                // Send message to this dialog, which is actually
     1212                                // converted to function call, to set controls.
    10261213                                WinSendMsg(hwndDlg, USER_OBJECT_SETDLGITEMS, NULL,
    10271214                                           NULL);
     
    10391226                        }
    10401227                    break;
    1041                     }
     1228                    } // endof LN_SELECT
    10421229                }
    10431230            break;
     
    31623349    return mrc;
    31633350    }
     3351
     3352
     3353/*
     3354 *@@fnCnfgLbox:
     3355 *      This is the window procedure for the config listbox control.
     3356 *
     3357 *      This is not a stand-alone window procedure, but must only
     3358 *      be used with config listbox control subclassed in
     3359 *      fnTradObjectPageProc.
     3360 *
     3361 */
     3362MRESULT EXPENTRY fnCnfgLbox(HWND hwndWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     3363    {
     3364    OLDPROC *pOldProc = (OLDPROC*)WinQueryWindowULong(hwndWnd, QWL_USER);
     3365
     3366    MRESULT mrc = NULL;
     3367
     3368    if (pOldProc)
     3369        {
     3370        PFNWP OldLboxProc = pOldProc->OldProc;
     3371        switch(msg)
     3372            {
     3373            case WM_DESTROY:
     3374                {
     3375                mrc = OldLboxProc(hwndWnd, msg, mp1, mp2);
     3376                free(pOldProc);
     3377                break;
     3378                }
     3379            case WM_CONTROL:
     3380                {
     3381                switch (SHORT2FROMMP(mp1))
     3382                    {
     3383                    case CBN_EFCHANGE:
     3384                        {
     3385                        CHAR szTemp[256];
     3386                        CHAR szTemp1[256];
     3387                        CHAR szTemp2[512];
     3388                        SHORT sItem = SHORT1FROMMR(WinSendMsg(hwndWnd,
     3389                                                             LM_QUERYSELECTION,
     3390                                                             MPFROMSHORT(LIT_FIRST),
     3391                                                             MPFROMSHORT(0)));
     3392                        WinSendMsg(hwndWnd, LM_QUERYITEMTEXT, MPFROM2SHORT(sItem, 256),
     3393                                   MPFROMP(szTemp));
     3394                        WinQueryWindowText(hwndWnd, 256, szTemp1);
     3395                        sprintf(szTemp2, "%s|%s", szTemp1, szTemp);
     3396                        WinSetWindowText(hwndWnd, szTemp2);
     3397                        break;
     3398                        }
     3399                    }
     3400                break;
     3401                }
     3402            default:
     3403                {
     3404                mrc = OldLboxProc(hwndWnd, msg, mp1, mp2);
     3405                break;
     3406                }
     3407            }
     3408        }
     3409    return(mrc);
     3410    }
     3411
  • TabularUnified trunk/src/wicpm/gui_wicpm.cpp

    r155 r172  
    2626#include "helpers\linklist.h"
    2727#include "helpers\cnrh.h"
     28#include <list>
     29#include "helpers\stringh.h"
    2830#include "helpers\xstring.h"
     31#include "base\bs_string.h"
    2932
    3033#include "wicpm\script.hpp"
     
    343346                    PMAINWINDOWINFO pWinInfo =
    344347                        (PMAINWINDOWINFO) WinQueryWindowPtr(hwndWnd, 0);
     348
     349
    345350                    break;
    346351                    }
     
    408413                    if (WinProcessDlg(hwndAdd)) // Processing of the main window procedure
    409414                        {                       // stops while proessing Add package dialog.
    410                         *pPckTemp1 = *pPckTemp;
     415
     416                        *pPckTemp1 = *pPckTemp; // Update original package object.
    411417                        pDBPck->usPckIndexAttr = pPckTemp1->ReturnPackageIndexNumber();
    412418                        pPckIDTemp = pPckTemp1->ReturnPackageIDObject();
     
    493499                    break;
    494500                    }
     501                case IDM_MAIN_EDIT_REMOVE_PCK:
    495502                case IDM_PCKCONTAINER_REMOVE:
    496503                    {
     
    559566                    break;
    560567                    }
     568                case IDM_MAIN_EDIT_REMOVE_FILE:
    561569                case IDM_FILECONTAINER_REMOVE:
    562570                    {
     
    630638                    pTradArcThInfo->pszArchiveFileName = pszFileName;
    631639                    pTradArcThInfo->pWarpIN = &(pWinInfo->WarpIN);
    632                     //DosCreateEventSem(SEM_STATUSDLGREADY,
    633                     //                  &pTradArcThInfo->hevStatusDlgReady,
    634                     //                  0L,
    635                     //                  FALSE);
     640                    DosCreateEventSem(SEM_STATUSDLGREADY,
     641                                      &pTradArcThInfo->hevStatusDlgReady,
     642                                      0L,
     643                                      FALSE);
    636644                    PLISTNODE pNode = lstQueryFirstNode(pWinInfo->plPackageList);
    637645                    DBPackage *pDBPackage;
     
    665673
    666674                    WinProcessDlg(pTradArcThInfo->hwndStatusDlg);
    667                     //DosCloseEventSem(pTradArcThInfo->hevStatusDlgReady);
     675                    DosCloseEventSem(pTradArcThInfo->hevStatusDlgReady);
    668676                    delete pTradArcThInfo;
    669677                    delete pSDlgInfo;
     
    741749                                    pWinInfo->fileContainerInfo.hwndContextMenu,
    742750                                    IDM_FILECONTAINER_ADD, TRUE);
     751                                WinEnableMenuItem(
     752                                    pWinInfo->hwndMainMenu,
     753                                    IDM_MAIN_EDIT_ADD_FILE, TRUE);
    743754                                }
    744755                            break;
     
    792803                                         // selected pointer to point to it.
    793804                            PNOTIFYRECORDEMPHASIS pEmphasis = (PNOTIFYRECORDEMPHASIS)mp2;
     805                            PMAINWINDOWINFO pWinInfo =
     806                                (PMAINWINDOWINFO)WinQueryWindowPtr(hwndWnd, 0);
     807                            if ((pEmphasis->fEmphasisMask & CRA_SELECTED) &&
     808                                (pEmphasis->pRecord) &&
     809                                (G_pSelectedFileRecord != (PFILERECORD)pEmphasis->pRecord))
     810                                {
     811                                WinEnableMenuItem(
     812                                    pWinInfo->hwndMainMenu,
     813                                    IDM_MAIN_EDIT_REMOVE_FILE, TRUE);
     814                                }
    794815                            }
    795816                        } // endswitch
     
    12501271                              MPFROMSHORT(usMaxPercentage));
    12511272            WinSetDlgItemText(hwndDlg, IDD_CREATING_FILE, (PSZ)mp2);
    1252             break;
    1253             }
     1273            // Post semaphore so WIArchive can continue it's work.
     1274            DosPostEventSem(pSDlgInfo->hevStatusDlgReady);
     1275            break;
     1276            }
     1277        // A file has been added to archive so insert information
     1278        // to MLE.
    12541279        case USER_ARCTM_FILE_UPDATING:
    12551280            {
    1256             XSTRING strStatus;
    1257             xstrInit(&strStatus, 100);
     1281            XSTRING xstrStatus;
    12581282            CHAR szRation[4];
    12591283            USHORT usCompRation = SHORT1FROMMP(mp1);
    1260             xstrcat(&strStatus, "File ", 0);
    1261             xstrcat(&strStatus, (PSZ)mp2, 0);
    1262             xstrcat(&strStatus, " has been compressed.\n", 0);
     1284            xstrInit(&xstrStatus, 0);
     1285            xstrcat(&xstrStatus, "File ", 0);
     1286            xstrcat(&xstrStatus, (PSZ)mp2, 0);
     1287            xstrcat(&xstrStatus, " has been compressed.\n", 0);
    12631288            sprintf(szRation, "%i", usCompRation);
    1264             xstrcat(&strStatus, "\t-> ", 0);
    1265             xstrcat(&strStatus, szRation, 0);
    1266             xstrcat(&strStatus, "% compression ratio.\n", 0);
     1289            xstrcat(&xstrStatus, "\t-> ", 0);
     1290            xstrcat(&xstrStatus, szRation, 0);
     1291            xstrcat(&xstrStatus, "% compression ratio.\n", 0);
    12671292            WinSendMsg(WinWindowFromID(hwndDlg, IDD_CREATING_REPORT),
    12681293                       MLM_INSERT,
    1269                        (MPARAM)(strStatus.psz),
     1294                       (MPARAM)xstrStatus.psz,
    12701295                       MPNULL);
    1271             xstrClear(&strStatus);
     1296            xstrClear(&xstrStatus);
     1297            // Post semaphore so WIArchive can continue it's work.
     1298            DosPostEventSem(pSDlgInfo->hevStatusDlgReady);
    12721299            break;
    12731300            }
  • TabularUnified trunk/src/wicpm/makefile

    r147 r172  
    124124                            $(HLPINC)\comctl.h \
    125125                            $(HLPINC)\except.h \
     126                            $(FEINC)\gui_wicpm.h \
    126127                            $(INC)\setup.h
    127128
  • TabularUnified trunk/src/wicpm/script.cpp

    r155 r172  
    33 *                  (c) Copyright Teemu Ahola 2000
    44 *
    5  *              WarpINScript Class 0.9.4
     5 *              WarpIN Script Handling Class 0.9.6
    66 *
    77 *  Special thanks to Ulrich M”ller about his great helper functions for
     
    99 *
    1010 *
    11  *@@ sourcefile: script.cpp
     11 *@@sourcefile: script.cpp
    1212 *  Source code file for Script C++ class.
    13  *  This file contains source codes for WarpINScript class.
    14  *  This file is not platform independent. More detailed information about
     13 *  This file contains source codes for WarpIN Script handling class.
     14 *  This file <U>is</U> platform independent. More detailed information about
    1515 *  WarpIN script can be found from WarpIN programmer guide.
    1616 *
     
    2121 * script can be created and script text can be parsed back to objects.
    2222 *
     23 *@todo:
     24 *  - Inlining and optimization. The classes are terribly slow so in older
     25 *    computers script parsing and generating takes a lot of time.
     26 *
     27 *@added v.0.9.5 [tahola]: Message logging system.
     28 *@changed v.0.9.6 [tahola]: New conding conversion.
    2329 */
    2430
     
    3036#include <direct.h>
    3137
    32 #include "setup.h"      // Teemu, this must be first V0.9.7 (2000-12-08) [umoeller]
    33 
     38#include "setup.h"
     39#include <list>
    3440#include "helpers\stringh.h"
    3541#include "helpers\xstring.h"
     42#include "base\bs_string.h"
    3643#include "wicpm\script.hpp"
     44
     45
    3746
    3847// Script tags and attributes
     
    133142#define SZ_TAG_ENDWARPIN                "/WARPIN"
    134143
     144// Message types.
     145#define SZ_MESSAGE_INFO                 "Informative"
     146#define SZ_MESSAGE_WARNING              "Warning"
     147#define SZ_MESSAGE_ERROR                "Error"
     148#define SZ_MESSAGE_MSG                  "Message"
     149
    135150
    136151
     
    144159
    145160
    146 
    147 /***************************************************************************
    148  *@@ AddErrorToTable
     161//
     162//
     163//  Templates:
     164//
     165//
     166
     167/*
     168 *@@CopyTables:
     169 *  This is a function template for copying table of classes to another table. This
     170 *  way we don't have to create so much overloaded CopyTable functions.
     171 *
     172 *@@added v.0.9.5 (2000-08-22) [tahola]
     173 */
     174template <class T>
     175T *CopyTable(T *p_destTable,//in: Pointer to destination table.
     176              T *p_srcTable,//in: Pointer to source table.
     177              USHORT p_usSize,//in: Size of source table.
     178              USHORT p_usSkipIndex//in: Index to be skipped. If 0 no skipping.
     179              )
     180    {
     181    USHORT srcIndex, destIndex;
     182    if (!p_destTable)
     183        return NULL;
     184    if (!p_srcTable)
     185        return p_destTable;
     186    for (srcIndex = 0, destIndex = 0; srcIndex < p_usSize; srcIndex ++, destIndex ++)
     187        {
     188        if (p_srcTable[srcIndex].ReturnIndex() == p_usSkipIndex)
     189            if (srcIndex < p_usSize - 1)
     190                srcIndex ++;
     191            else
     192                break;
     193        p_destTable[destIndex] = p_srcTable[srcIndex];
     194        }
     195
     196    return p_destTable;
     197    }
     198
     199
     200/*
     201 *@@RebuildIndexes:
     202 *  Rebuilds indexes after deletion. The order of the indexes does not matter.
     203 *  Example:
     204 *      Old indexing: 1, 4, 3, 5
     205 *      New indexing: 1, 3, 2, 4
     206 *
     207 *@@added v.0.9.5 (2000-08-22) [tahola]
     208 */
     209template <class T>
     210USHORT RebuildIndexes(T *p_table, // A pointer to a table of objects.
     211                      USHORT p_usTableSize // The size of the table.
     212                      )
     213    {
     214    USHORT usIndex, usIndex2, usIndex3, usMissing, usMax = 0, i;
     215    BOOL bFinded = FALSE, bReady = FALSE;
     216
     217    // First find largest index number.
     218    for (usIndex = 0; usIndex < p_usTableSize; usIndex ++)
     219        if (p_table[usIndex].ReturnIndex() > usMax)
     220            usMax = p_table[usIndex].ReturnIndex();
     221
     222    // Do this until it is sure that there is no skipped indexes left.
     223    while (!bReady)
     224        {
     225        bReady = TRUE;
     226        // Go through all index values from 1 to usMax.
     227        for (usIndex = 1; usIndex <= usMax; usIndex ++)
     228            {
     229            // Check that Index number will be found.
     230            for (usIndex2 = 0; usIndex2 < p_usTableSize; usIndex2 ++)
     231                if (usIndex == p_table[usIndex2].ReturnIndex())
     232                    bFinded = TRUE;
     233            // If it did not found sub 1 from every index number above
     234            // the index number which did not found.
     235            if (bFinded == FALSE)
     236                {
     237                for (usIndex3 = usIndex + 1; usIndex3 <= usMax; usIndex3 ++)
     238                    for (usIndex2 = 0; usIndex2 < p_usTableSize; usIndex2 ++)
     239                        if (usIndex3 == p_table[usIndex2].ReturnIndex())
     240                            p_table[usIndex2].SetIndex(usIndex3 - 1);
     241                usMax --;
     242                }
     243            if (bFinded == FALSE)
     244                bReady = FALSE;
     245            bFinded = FALSE;
     246            }
     247        }
     248    return NO_ERROR;
     249    }
     250
     251
     252/*
     253 *@@FindUnusedIndex:
     254 *  Returns first unused index number.
     255 *  Ex. 1, 2, 4, 5
     256 *      returns: 3
     257 *
     258 *@@added v.0.9.5 (2000-08-22) [tahola]
     259 */
     260template <class T>
     261USHORT FindUnusedIndex(T *p_table, // A pointer to a table of objects.
     262                       USHORT p_usTableSize // The size of the table.
     263                       )
     264    {
     265    USHORT usIndex, usIndex2, usMax = 0;
     266    BOOL bFinded = FALSE;
     267
     268    // First find the largest index number.
     269    for (usIndex = 0; usIndex < p_usTableSize; usIndex ++)
     270        if (p_table[usIndex].ReturnIndex() > usMax)
     271            usMax = p_table[usIndex].ReturnIndex();
     272
     273    for (usIndex = 1; usIndex <= usMax; usIndex ++)
     274        {
     275        // Go through all the objects on the table.
     276        for (usIndex2 = 0; usIndex2 < p_usTableSize; usIndex2 ++)
     277            if (usIndex == p_table[usIndex2].ReturnIndex())
     278                {
     279                bFinded = TRUE;
     280                break;
     281                }
     282        // If Index found from the table, continue.
     283        if (bFinded == TRUE)
     284            bFinded = FALSE;
     285        // If not break.
     286        else
     287            break;
     288        }
     289
     290    return usIndex;
     291    }
     292
     293
     294//
     295//
     296//  Handy functions.
     297//
     298//
     299
     300
     301/*
     302 *@@AddErrorToTable:
    149303 *  Adds error information structure to table. Returns error code if
    150304 *  necessary.
     
    176330
    177331
    178 /***************************************************************************
    179  *@@ AddCharacterAfterEOL
    180  *  This function adds character (ex. \t, \n)  before each line.
     332/*
     333 *@@AddCharacterAfterEOL:
     334 *  This function adds character (ex. \t, \n)  before each line in the string.
    181335 */
    182336void AddCharacterAfterEOL(PSZ *pszText, // Pointer to PSZ pointer.
     
    190344        return;
    191345
    192     pszTemp1 = strhins(pszTemp, ulOffset, &szCharacter);
     346    // Add the character to the beginning of the string.
     347    pszTemp1 = strhins(pszTemp, 0, &szCharacter);
    193348    delete [] pszTemp;
    194349    pszTemp = pszTemp1;
     350    // Repeat.
    195351    while (TRUE)
    196352        {
     353        // Find next line.
    197354        pszReturn = strhFindNextLine(pszTemp + ulOffset, &ulOffset);
     355        // If no more lines, break.
    198356        if (*pszReturn == '\0')
    199357            break;
     358        // Set ulOffset to beginning of next line.
    200359        ulOffset += ulTempOffset;
    201360        ulTempOffset = ulOffset;
     361        // Add the character.
    202362        pszTemp1 = strhins(pszTemp, ulOffset, &szCharacter);
    203363        delete [] pszTemp;
     
    288448
    289449
     450/****************************************************************************
     451 ****************************************************************************
     452        @@Message class:
     453
     454    <B>Description:</B>
     455        Message class is a simple message data handling class which is used
     456        in MessageLogger and all script classes.
     457
     458    Member functions:
     459        Message()                           Constructor.
     460        virtual ~Message()                  Virtual destructor.
     461        USHORT SetType(USHORT)              Sets message type. In Script
     462                                            classes there are three different
     463                                            types: informative, warning and
     464                                            error.
     465        USHORT SetMessageString(BSString &) Sets message string.
     466        USHORT SetLineNumber(ULONG)         Sets line number of script where
     467                                            message is related to. Can also
     468                                            be 0.
     469        USHORT SetMessageValue(USHORT)      Sets message value.
     470        USHORT ReturnType()                 Returns message type.
     471        BSString &ReturnMessageString()     Returns message string.
     472        ULONG ReturnLineNumber()            Returns Line number.
     473        USHORT ReturnMessageValue()         Returns message valuer.
     474
     475****************************************************************************/
     476
     477
     478
     479/*
     480 *@@Message:
     481 *      Constructor for Message class.Initializes _usType and _usLineNumber
     482 *      variables.
     483 */
     484Message::Message()
     485    {
     486    _usType = MSG_TYPE_UNDEF;
     487    _ulLineNumber = 0;
     488    };
     489
     490
     491/*
     492 *@@~Message:
     493 *      Destructor for Message class. Sets variables to zero and clears
     494 *      message string.
     495 */
     496Message::~Message()
     497    {
     498    _usType = MSG_TYPE_UNDEF;
     499    _ulLineNumber = 0;
     500    _usMessageValue = 0;
     501    _strMessageText = ""; // Clear text string.
     502    };
     503
     504
     505/*
     506 *@@SetType:
     507 *      Sets message type. In Script classes only three defined types are
     508 *      used: MSG_TYPE_INFO, MSG_TYPE_WARNING and MSG_TYPE_ERROR.
     509 */
     510USHORT Message::SetType(USHORT p_usType // Message type number.
     511                       )
     512    {
     513    _usType = p_usType;
     514    return NO_ERROR;
     515    }
     516
     517
     518/*
     519 *@@SetMessageString:
     520 *      Sets message string.
     521 */
     522USHORT Message::
     523        SetMessageText(const BSString &p_strMsgText // Reference to message string.
     524                      )
     525    {
     526    _strMessageText = p_strMsgText;
     527    return NO_ERROR;
     528    }
     529
     530
     531/*
     532 *@@SetMessageText:
     533 *      Sets message string.
     534 */
     535USHORT Message::SetMessageText(const PSZ p_pszMsgText // Pointer to message text.
     536                              )
     537    {
     538    _strMessageText = p_pszMsgText;
     539    return NO_ERROR;
     540    }
     541
     542
     543/*
     544 *@@SetLineNumber:
     545 *      Sets line number. Some messages may need line number for example
     546 *      there is a syntax error in a script and the line number of the
     547 *      syntax error is in _ulLineNumber.
     548 */
     549USHORT Message::SetLineNumber(ULONG p_ulLineNumber // Line number.
     550                             )
     551    {
     552    _ulLineNumber = p_ulLineNumber;
     553    return NO_ERROR;
     554    }
     555
     556
     557/*
     558 *@@SetMessageValue:
     559 *      Sets message value. Gives more detailed information about message.
     560 */
     561USHORT Message::SetMessageValue(USHORT p_usMsgValue // Message value.
     562                               )
     563    {
     564    _usMessageValue = p_usMsgValue;
     565    return NO_ERROR;
     566    }
     567
     568
     569/*
     570 *@@ReturnType:
     571 *      Return message type. (See SetType)
     572 */
     573USHORT Message::ReturnType()
     574    {
     575    return _usType;
     576    }
     577
     578
     579/*
     580 *@@ ReturnLineNumber
     581 *      Return line number. (See SetLineNumber)
     582 */
     583ULONG Message::ReturnLineNumber()
     584    {
     585    return _ulLineNumber;
     586    }
     587
     588
     589/*
     590 *@@ReturnMessageValue:
     591 *      Returns message value.
     592 */
     593USHORT Message::ReturnMessageValue()
     594    {
     595    return _usMessageValue;
     596    }
     597
     598
     599/*
     600 *@@ReturnMessageString:
     601 *      Return message string. (See SetMessageText)
     602 */
     603BSString &Message::ReturnMessageText()
     604    {
     605    return _strMessageText;
     606    }
     607
     608
     609/*
     610 *@@ComposeMessage:
     611 *      Composes message. New BSString is allocated.
     612 *      Formats the string to "message type": "message text".
     613 */
     614BSString &Message::ComposeMessage()
     615    {
     616    BSString *strMsg = new BSString;
     617
     618    switch(_usType)
     619        {
     620        case MSG_TYPE_INFO:
     621            {
     622            *strMsg += SZ_MESSAGE_INFO;
     623            break;
     624            }
     625        case MSG_TYPE_WARNING:
     626            {
     627            *strMsg += SZ_MESSAGE_WARNING;
     628            break;
     629            }
     630        case MSG_TYPE_ERROR:
     631            {
     632            *strMsg += SZ_MESSAGE_ERROR;
     633            break;
     634            }
     635        default:
     636            {
     637            *strMsg += SZ_MESSAGE_MSG;
     638            break;
     639            }
     640        }
     641
     642    *strMsg += ": ";
     643    CHAR szValue[128];
     644    sprintf(szValue, "Message value: %i", _usMessageValue);
     645    *strMsg += szValue;
     646    *strMsg += "  " + _strMessageText;
     647    if (_ulLineNumber > 0)
     648        {
     649        CHAR szLineNumber[256];
     650        sprintf(szLineNumber, "at line: %i", _ulLineNumber);
     651        *strMsg += szLineNumber;
     652        }
     653    return *strMsg;
     654    }
     655
     656
     657
     658
     659
     660/****************************************************************************
     661 ****************************************************************************
     662        @@MessageLogger class:
     663
     664    Member functions:
     665
     666****************************************************************************/
     667
     668
     669/*
     670 *@@MessageLogger:
     671 *  Default constructor for MessageLogger class.
     672 *  Initializes variables.
     673 */
     674MessageLogger::MessageLogger()
     675    {
     676    _pParentLogger = NULL;
     677    _usMessages = 0;
     678    }
     679
     680
     681/*
     682 *@@MessageLogger:
     683 *  Copy constructor for MessageLogger class.
     684 */
     685MessageLogger::MessageLogger(MessageLogger &p_pLogger // Reference to a object.
     686                            )
     687    {
     688    _pParentLogger = &p_pLogger;
     689    _usMessages = 0;
     690    }
     691
     692
     693/*
     694 *@@~MessageLogger:
     695 *  Destructor for MessageLogger class.
     696 *  Deletes all logged messages and clears other variables.
     697 */
     698MessageLogger::~MessageLogger()
     699    {
     700    DeleteLogs();
     701    _pParentLogger = NULL;
     702    _usMessages = 0;
     703    }
     704
     705
     706/*
     707 *@@operator=:
     708 *  Assignment operator for MessageLogger.
     709 */
     710MessageLogger &MessageLogger::operator=(MessageLogger &p_msgLog // Reference to a object.
     711                                       )
     712    {
     713    list<Message*>::iterator start, end;
     714    Message *pMsg;
     715
     716    // Delete current logged messages.
     717    DeleteLogs();
     718
     719    _pParentLogger = p_msgLog._pParentLogger;
     720    _usMessages = p_msgLog._usMessages;
     721
     722    // Query list of messages from object logger and log all messages to
     723    // local message list.
     724    list<Message*> lstMsg = p_msgLog.ReturnMessageList();
     725    start = lstMsg.begin(); end = lstMsg.end();
     726    for (; start != end; start++)
     727        {
     728        pMsg = *start;
     729        LogMessage(*pMsg);
     730        }
     731
     732    return (*this);
     733    }
     734
     735
     736/*
     737 *@@ReturnMessageList:
     738 *  Return constant list of pointers to messages.
     739 */
     740const list<Message*> MessageLogger::ReturnMessageList()
     741    {
     742    return _lstMessage;
     743    }
     744
     745
     746USHORT MessageLogger::DeleteLogs()
     747    {
     748    // Go through all messages in the list and delete them.
     749    /*if (_usMessages == 0)
     750        return NO_ERROR;*/
     751    list<Message*>::iterator start, end;
     752    start = _lstMessage.begin();  end = _lstMessage.end();
     753    _lstMessage.erase(start, end);
     754    _usMessages = 0;
     755    return NO_ERROR;
     756    }
     757
     758
     759USHORT MessageLogger::LogMessage(Message &p_Msg)
     760    {
     761    if (_pParentLogger)
     762        // If there is a parent logger, use it to log a message.
     763        _pParentLogger->LogMessage(p_Msg);
     764    else
     765        {
     766        // If not, put the message to local message list.
     767        Message *msg = new(Message);
     768        *msg = p_Msg;
     769        _lstMessage.push_back(msg);
     770        _usMessages ++;
     771        }
     772    return NO_ERROR;
     773    }
     774
     775
     776USHORT MessageLogger::SetParentLogger(MessageLogger &p_MsgLog)
     777    {
     778    list<Message*>::iterator start, end;
     779    Message *pMsg = NULL;
     780    start = _lstMessage.begin ();  end = _lstMessage.end ();
     781
     782    _pParentLogger = &p_MsgLog;
     783
     784    if (_pParentLogger)
     785        {
     786        for (; start != end; start++)
     787            {
     788            pMsg = *start;
     789            _pParentLogger->LogMessage(*pMsg);
     790            }
     791        DeleteLogs();
     792        _usMessages = 0;
     793        }
     794
     795    return NO_ERROR;
     796    }
     797
     798
     799/*
     800 *@@ReturnComposedMessageString:
     801 *      Returns string which is composed from message text and line number
     802 *      in Message objects which are in message list. Every line is
     803 *      string is formatted as follow: MESSAGE_TYPE: MESSAGE_TEXT LINE_NBR.
     804 *@@changed v.0.9.6 [tahola]: Do not use parent message logger any more.
     805 */
     806BSString &MessageLogger::ReturnComposedMessageString()
     807    {
     808    // If there is a parent logger, use it.
     809    //if (_pParentLogger)
     810    //    return _pParentLogger->ReturnComposedMessageString();
     811
     812    BSString *MsgString = new BSString;
     813    Message *pMsg = NULL;
     814    list<Message*>::iterator start, end;
     815
     816    // Go through local list of messages and compose them to string.
     817    start = _lstMessage.begin ();  end = _lstMessage.end ();
     818    for (; start != end; start++)
     819        {
     820        pMsg = *start;
     821        *MsgString += pMsg->ComposeMessage() + "\n";
     822        }
     823    return *MsgString;
     824    }
     825
     826
     827
     828
     829/****************************************************************************
     830 ****************************************************************************
     831        @@ WarpINScriptBase class:
     832
     833    <B>Description:</B>
     834        Base class for all script classes. Includes some virtual functions
     835        which must be implemented in derived classes.
     836
     837    Member functions:
     838        USHORT SetIndex(USHORT)     Sets index number.
     839*****************************************************************************/
     840
     841/*
     842 *@@SetIndex:
     843 *      Sets usIndex number.
     844 */
     845USHORT WarpINScriptBase::SetIndex(const USHORT p_usIndex)
     846    {
     847    _usIndex = p_usIndex;
     848    }
     849
     850
     851/*
     852 *@@ReturnIndex:
     853 *      Returns UsIndex number.
     854 */
     855
     856USHORT WarpINScriptBase::ReturnIndex()
     857    {
     858    return _usIndex;
     859    }
     860
     861
     862WarpINScriptBase::~WarpINScriptBase()
     863    {
     864
     865    }
     866
     867
     868
    290869
    291870/****************************************************************************
    292871 ****************************************************************************
    293872        ScriptIndex class:
    294 
    295  ****************************************************************************
    296  *  ScriptIndex class member functions:
    297  *  ScripitIndex        Constructor.
    298  *  ~ScriptIndex        Destructor.
    299  *  SetIndexAttribute   Sets title attribute.
    300  *  SetIndex            Sets title object ID. Should be used for identification.
    301  *  ReturnIndexAttributeReturns index attribute.
    302  *  ReturnIndex         Returns object ID number.
    303  *  MakeScriptText      Returns pointer to script text.
    304  *  BuildFromText       Builds object accordingly to script text.
    305  ***************************************************************************/
    306 
    307 
    308 /***************************************************************************
    309  *@@ ScriptIndex::ScriptIndex
    310  *  Constructor for ScriptIndex class. Initializes usIndex  by setting
    311  *  it to 0.
     873            :public WarpINScriptBase
     874
     875    Member functions:
     876        ScripitIndex()              Constructor.
     877        ~ScriptIndex()              Destructor.
     878        SetIndexAttribute(USHORT)   Sets title attribute.
     879        ReturnIndexAttribute        Returns index attribute.
     880        ReturnIndex                 Returns object ID number.
     881        MakeScriptText              Returns pointer to script text.
     882        BuildFromText               Builds object accordingly to script text.
     883****************************************************************************/
     884
     885
     886/*
     887 *@@ScriptIndex:
     888 *      Constructor for ScriptIndex class. Initializes usIndex  by setting
     889 *      it to 0.
    312890 */
    313891ScriptIndex::ScriptIndex(USHORT usIndex)
    314892    {
    315     usIndex = 0;
    316     this->usIndex = usIndex;
    317     }
    318 
    319 
    320 
    321 /***************************************************************************
    322  *@@ ScriptIndex::~ScriptIndex
    323  *  destructor for ScriptIndex class. Does nothing special.
     893    usIndexAttribute = 0;
     894    SetIndex(usIndex);
     895    }
     896
     897
     898
     899/*
     900 *@@~ScriptIndex:
     901 *      Destructor for ScriptIndex class. Does nothing special.
    324902 */
    325903
     
    329907
    330908
    331 /***************************************************************************
    332  *@@ ScriptIndex::SetIndex
    333  *  Sets usIndexAttribute.
    334  */
    335 
    336 void ScriptIndex::SetIndexAttribute(USHORT usIndexAttribute)
     909/*
     910 *@@operator=:
     911 *@@added v.0.9.5 (2000-08-20) [tahola]
     912 */
     913ScriptIndex &ScriptIndex::operator=(ScriptIndex &p_index)
     914    {
     915    SetIndex(p_index.ReturnIndex());
     916    usIndexAttribute = p_index.usIndexAttribute;
     917    return (*this);
     918    }
     919
     920
     921/*
     922 *@@SetIndexAttribute:
     923 *      Sets usIndexAttribute.
     924 */
     925
     926USHORT ScriptIndex::SetIndexAttribute(USHORT usIndexAttribute)
    337927    {
    338928    this->usIndexAttribute = usIndexAttribute;
    339     }
    340 
    341 
    342 
    343 /***************************************************************************
    344  *@@ ScriptIndex::SetIndex
    345  *  Sets usIndex number.
    346  */
    347 
    348 void ScriptIndex::SetIndex(USHORT usIndex)
    349     {
    350     this->usIndex = usIndex;
    351     }
    352 
    353 
    354 
    355 /***************************************************************************
    356  *@@ ScriptIndex::ReturnIndex
     929    return NO_ERROR;
     930    }
     931
     932
     933/*
     934 *@@ReturnIndex:
    357935 *  Returns usIndexAttribute number.
    358936 */
     
    364942
    365943
    366 
    367 /***************************************************************************
    368  *@@ ScriptIndex::ReturnIndex
    369  *  Returns UsIndex number.
    370  */
    371 
    372 USHORT ScriptIndex::ReturnIndex()
    373     {
    374     return usIndex;
    375     }
    376 
    377 
    378 
    379 
    380 /***************************************************************************
    381  *@@ ScriptIndex::MakeScriptText
    382  *  Returns pointer to script text.
     944/*
     945 *@@MakeScriptText:
     946 *      Returns pointer to script text.
    383947 */
    384948PSZ ScriptIndex::MakeScriptText(BOOL bAttribute)
     
    386950    ULONG ulTextLength = 0;
    387951    PSZ pszScriptText = NULL;
    388     ulTextLength = LtoALength((LONG) usIndexAttribute);
     952    ulTextLength = LtoALength((LONG)usIndexAttribute);
    389953
    390954    if (bAttribute)
     
    404968
    405969
    406 /***************************************************************************
    407  *@@ScriptIndex::BuildFromText
     970/*
     971 *@@BuildFromText:
    408972 *  Builds INDEX accordingly to script text. If any errors is found in script
    409973 *  text, error informations are returned in table where to *pScriptError
    410974 *  points. Pointer to after end of tag is returned so multiple searches can be
    411975 *  done.
     976 *@@changed v.0.9.5 (2000-08-30) [tahola]: modified message logging.
    412977 */
    413978PSZ ScriptIndex::BuildFromText(PSZ pszScriptText,
    414                                SCRIPTERROR **ppScriptError,
    415                                USHORT *pusErrorTableSize,
    416979                               ULONG ulLineNumber)
    417980    {
    418     SCRIPTERROR Error;
     981    Message msg;
    419982    PSZ pszTemp = NULL;
    420983    PSZ pszAttr = NULL;
     
    427990    else
    428991        {
    429         Error.usErrorCode = ERR_PARSE_INDEX_NOTFOUND;
    430         Error.ulLineNumber = ulLineNumber;
    431         Error.pszStart = strhdup(pszScriptText);
    432         Error.ulLength = 0;
    433         if (ppScriptError)
    434             *pusErrorTableSize =
    435                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     992        msg.SetType(MSG_TYPE_WARNING);
     993        msg.SetMessageValue(MSG_ATTRIBUTE_INDEX_NOTFOUND);
     994        msg.SetLineNumber(ulLineNumber);
     995        _messageLogger.LogMessage(msg);
    436996        return NULL;
    437997        }
     
    4461006/****************************************************************************
    4471007 ****************************************************************************
    448         ScriptPackageID class:
    449     This class is for PACKAGEID attribute in PCK tag. This attribute contains
    450     information from vendor , application name, package identifier
    451     and version numbering. Different ScriptPackageID objects are identified
    452     from each others by usIndex. So when creating new object unique index
    453     number should be used. This class does not check if index is not valid ie.
    454     if same index number is already in use.
    455 
    456  ****************************************************************************
    457  *  ScriptPackageID class member functions:
    458  *      ScriptPackageID     constructor
    459  *      ~ScriptPackageID    destructor
    460  *      SetVendor           sets vendor text
    461  *      SetApplication      sets application text
    462  *      SetMajor            sets major version number
    463  *      SetMinor            sets minor version number
    464  *      SetRevision         sets revision version number
    465  *      ReturnVendor        returns const pointer to vendor string
    466  *      ReturnApplication   returns const pointer to application string
    467  *      ReturnPackage       returns const pointer to package string
    468  *      ReturnMajor         returns value of major version number
    469  *      ReturnMinor         returns value of minor version number
    470  *      ReturnRevision      returns value of revision version number
    471  *      MakeScriptText      returns pointer to script text
    472  *      BuildFromText       builds package ID datas from text
     1008        @@ScriptPackageID class:
     1009
     1010    <B>Description:</B>
     1011        This class is for PACKAGEID attribute in PCK tag. This attribute
     1012        contains information from vendor , application name, package identifier
     1013        and version numbering. Different ScriptPackageID objects are identified
     1014        from each others by usIndex. So when creating new object unique index
     1015        number should be used. This class does not check if index is not
     1016        valid ie. if same index number is already in use.
     1017
     1018    Member functions:
     1019        ScriptPackageID     constructor
     1020        ~ScriptPackageID    destructor
     1021        SetVendor           sets vendor text
     1022        SetApplication      sets application text
     1023        SetMajor            sets major version number
     1024        SetMinor            sets minor version number
     1025        SetRevision         sets revision version number
     1026        ReturnVendor        returns const pointer to vendor string
     1027        ReturnApplication   returns const pointer to application string
     1028        ReturnPackage       returns const pointer to package string
     1029        ReturnMajor         returns value of major version number
     1030        ReturnMinor         returns value of minor version number
     1031        ReturnRevision      returns value of revision version number
     1032        MakeScriptText      returns pointer to script text
     1033        BuildFromText       builds package ID datas from text
    4731034 ****************************************************************************/
    4741035
    4751036
    476 /****************************************************************************
    477  *@@ScriptPackageID::ScriptPackageID
     1037/*
     1038 *@@ScriptPackageID:
    4781039 *  This is default constructor for ScriptPackageID class. This initializes
    4791040 *  all local variables.
    4801041 */
    481 ScriptPackageID::ScriptPackageID(USHORT usIndex)
     1042ScriptPackageID::ScriptPackageID(USHORT p_usIndex)
    4821043    {
    4831044    // Set first character is char tables to '\0' (end of line).
    484     *szVendor = '\0';
    485     *szApplication = '\0';
    486     *szPackage = '\0';
    487 
    488     usMajor = 0;
    489     usMinor = 0;
    490     usRevision = 0;
    491 
    492     this->usIndex = usIndex;
    493     }
    494 
    495 /****************************************************************************
    496  *@@ScriptPackageID::~ScriptPackageID
     1045    *_szVendor = '\0';
     1046    *_szApplication = '\0';
     1047    *_szPackage = '\0';
     1048
     1049    _usMajor = 0;
     1050    _usMinor = 0;
     1051    _usRevision = 0;
     1052
     1053    SetIndex(p_usIndex);
     1054    }
     1055
     1056/*
     1057 *@@~ScriptPackageID:
    4971058 *  This is default destructor for ScriptPackageID class. This does not do
    4981059 *  anything special.
     
    5041065
    5051066
    506 /****************************************************************************
    507  *@@ScriptPackageID::SetVendor
     1067/*
     1068 *@@SetVendor:
    5081069 *  This function sets vendor string.
    5091070 */
    510 void ScriptPackageID::SetVendor(const PSZ pszVendor)
    511     {
    512     if (strlen(pszVendor) < MAXVENDORNAMELENGTH)
    513         strcpy(this->szVendor, pszVendor);
    514     }
    515 
    516 
    517 
    518 /****************************************************************************
    519  *@@ScriptPackageID::SetApplication
     1071USHORT ScriptPackageID::SetVendor(const PSZ p_pszVendor)
     1072    {
     1073    Message msg;
     1074    USHORT rc = NO_ERROR;
     1075    if (strlen(p_pszVendor) < MAXVENDORNAMELENGTH)
     1076        strcpy(this->_szVendor, p_pszVendor);
     1077    else
     1078        {
     1079        msg.SetType(MSG_TYPE_ERROR);
     1080        msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_VENDOR_STRTOOLONG);
     1081        msg.SetMessageText(p_pszVendor);
     1082        _messageLogger.LogMessage(msg);
     1083        rc = STRING_TOO_LONG;
     1084        }
     1085    return rc;
     1086    }
     1087
     1088
     1089
     1090/*
     1091 *@@SetApplication:
    5201092 *  This function sets application string.
    5211093 */
    522 void ScriptPackageID::SetApplication(const PSZ pszApplication)
    523     {
    524     if (strlen(szApplication) < MAXAPPNAMELENGTH)
    525         strcpy(this->szApplication, pszApplication);
    526     }
    527 
    528 /****************************************************************************
    529  *@@ScriptPackageID::SetPackage
     1094USHORT ScriptPackageID::SetApplication(const PSZ p_pszApplication)
     1095    {
     1096    Message msg;
     1097    USHORT rc = NO_ERROR;
     1098    if (strlen(p_pszApplication) < MAXAPPNAMELENGTH)
     1099        strcpy(this->_szApplication, p_pszApplication);
     1100    else
     1101        {
     1102        msg.SetType(MSG_TYPE_ERROR);
     1103        msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_APPL_STRTOOLONG);
     1104        msg.SetMessageText(p_pszApplication);
     1105        _messageLogger.LogMessage(msg);
     1106        rc = STRING_TOO_LONG;
     1107        }
     1108    return rc;
     1109    }
     1110
     1111/*
     1112 *@@SetPackage:
    5301113 *  This function sets package string.
    5311114 */
    532 void ScriptPackageID::SetPackage(const PSZ pszPackage)
    533     {
    534     if (strlen(szPackage) < MAXPCKNAMELENGTH)
    535         strcpy(this->szPackage, pszPackage);
    536     }
    537 
    538 
    539 
    540 /****************************************************************************
    541  *@@ScriptPackageID::SetMajor
     1115USHORT ScriptPackageID::SetPackage(const PSZ p_pszPackage)
     1116    {
     1117    Message msg;
     1118    USHORT rc = NO_ERROR;
     1119    if (strlen(p_pszPackage) < MAXPCKNAMELENGTH)
     1120        strcpy(this->_szPackage, p_pszPackage);
     1121    else
     1122        {
     1123        msg.SetType(MSG_TYPE_ERROR);
     1124        msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_PACKAGE_STRTOOLONG);
     1125        msg.SetMessageText(p_pszPackage);
     1126        _messageLogger.LogMessage(msg);
     1127        rc = STRING_TOO_LONG;
     1128        }
     1129    return rc;
     1130    }
     1131
     1132
     1133
     1134/*
     1135 *@@SetMajor:
    5421136 *  This function sets major number.
    5431137 */
    544 void ScriptPackageID::SetMajor(USHORT usMajor)
    545     {
    546     this->usMajor = usMajor;
    547     }
    548 
    549 
    550 
    551 /****************************************************************************
    552  *@@ScriptPackageID::SetMinor
     1138USHORT ScriptPackageID::SetMajor(USHORT p_usMajor)
     1139    {
     1140    this->_usMajor = p_usMajor;
     1141    return NO_ERROR;
     1142    }
     1143
     1144
     1145/*
     1146 *@@SetMinor:
    5531147 *  This function sets minor number.
    5541148 */
    555 void ScriptPackageID::SetMinor(USHORT usMinor)
    556     {
    557     this->usMinor = usMinor;
    558     }
    559 
    560 
    561 
    562 /****************************************************************************
    563  *@@ScriptPackageID::SetRevision
     1149USHORT ScriptPackageID::SetMinor(USHORT p_usMinor)
     1150    {
     1151    this->_usMinor = p_usMinor;
     1152    return NO_ERROR;
     1153    }
     1154
     1155
     1156
     1157/*
     1158 *@@SetRevision:
    5641159 *  This function sets revision number.
    5651160 */
    566 void ScriptPackageID::SetRevision(USHORT usRevision)
    567     {
    568     this->usRevision = usRevision;
    569     }
    570 
    571 
    572 
    573 /****************************************************************************
    574  *@@ScriptPackageID::SetIndex
    575  *  This function sets index number.
    576  */
    577 void ScriptPackageID::SetIndex(USHORT usIndex)
    578     {
    579     this->usIndex = usIndex;
    580     }
    581 
    582 
    583 
    584 /****************************************************************************
    585  *@@ScriptPackageID::SetPackageID
    586  */
    587 void ScriptPackageID::SetPackageID(PACKAGEIDDATA packageIDData)
    588     {
    589 
    590     }
    591 
    592 
    593 
    594 
    595 /****************************************************************************
    596  *@@ScriptPackageID::ReturnVendor
     1161USHORT ScriptPackageID::SetRevision(USHORT p_usRevision)
     1162    {
     1163    this->_usRevision = p_usRevision;
     1164    return NO_ERROR;
     1165    }
     1166
     1167
     1168/*
     1169 *@@SetPackageID:
     1170 *  For compatibility only. Does actually nothing. Must be removed at some point.
     1171 *  Useless. No need anymore. Nobody will need it. Nobody cares about it.
     1172 */
     1173USHORT ScriptPackageID::SetPackageID(PACKAGEIDDATA packageIDData)
     1174    {
     1175    return NO_ERROR;
     1176    }
     1177
     1178
     1179/*
     1180 *@@ReturnVendor:
    5971181 *  This function returns const pointer to vendor string.
    5981182 */
    5991183const PSZ ScriptPackageID::ReturnVendor()
    6001184    {
    601     return (PSZ)szVendor;
    602     }
    603 
    604 
    605 
    606 /****************************************************************************
    607  *@@ScriptPackageID::ReturnApplication
     1185    return (PSZ)_szVendor;
     1186    }
     1187
     1188
     1189
     1190/*
     1191 *@@ReturnApplication:
    6081192 *  This function returns const pointer to application string.
    6091193 */
    6101194const PSZ ScriptPackageID::ReturnApplication()
    6111195    {
    612     return (PSZ)szApplication;
    613     }
    614 
    615 
    616 
    617 /****************************************************************************
    618  *@@ScriptPackageID::ReturnPackage
     1196    return (PSZ)_szApplication;
     1197    }
     1198
     1199
     1200
     1201/*
     1202 *@@ReturnPackage:
    6191203 *  This function returns const pointer to package string.
    6201204 */
    6211205const PSZ ScriptPackageID::ReturnPackage()
    6221206    {
    623     return (PSZ)szPackage;
    624     }
    625 
    626 
    627 /****************************************************************************
    628  *@@ScriptPackageID::ReturnMajor
     1207    return (PSZ)_szPackage;
     1208    }
     1209
     1210
     1211/*
     1212 *@@ReturnMajor:
    6291213 *  This function returns major version number.
    6301214 */
    6311215USHORT ScriptPackageID::ReturnMajor()
    6321216    {
    633     return usMajor;
    634     }
    635 
    636 
    637 
    638 /****************************************************************************
    639  *@@ScriptPackageID::ReturnMinor
     1217    return _usMajor;
     1218    }
     1219
     1220
     1221/*
     1222 *@@ReturnMinor:
    6401223 *  This function returns minor version number.
    6411224 */
    6421225USHORT ScriptPackageID::ReturnMinor()
    6431226    {
    644     return usMinor;
    645     }
    646 
    647 
    648 /****************************************************************************
    649  *@@ScriptPackageID::ReturnRevision
     1227    return _usMinor;
     1228    }
     1229
     1230
     1231/*
     1232 *@@ReturnRevision:
    6501233 *  This function returns revision version number.
    6511234 */
    6521235USHORT ScriptPackageID::ReturnRevision()
    6531236    {
    654     return usRevision;
    655     }
    656 
    657 
    658 /****************************************************************************
    659  *@@ScriptPackageID::ReturnIndex
    660  *  This function returns index number.
    661  */
    662 USHORT ScriptPackageID::ReturnIndex()
    663     {
    664     return usIndex;
    665     }
    666 
    667 
    668 
    669 /****************************************************************************
    670  *@@ScriptPackageID::MakeScriptText
     1237    return _usRevision;
     1238    }
     1239
     1240
     1241/*
     1242 *@@MakeScriptText:
    6711243 *  This function returns pointer to script text. If bShowAttribute is FALSE
    6721244 *  PACKAGEID="" text will not be included to the script text.
    6731245 */
    674 PSZ ScriptPackageID::MakeScriptText(BOOL bShowAttribute)
     1246PSZ ScriptPackageID::MakeScriptText(BOOL p_bShowAttribute)
    6751247    {
    6761248    ULONG ulTextLength = 0;
    677     XSTRING strScriptText;
     1249    XSTRING xstrScriptText;
    6781250    CHAR szTemp[1024];
    679     xstrInit(&strScriptText, 0);
     1251
     1252    xstrInit(&xstrScriptText, 0);
    6801253    szTemp[0]='\0';
    681     ulTextLength = strlen(szVendor) + strlen(szApplication) + sizeof(szPackage);
    682     ulTextLength += LtoALength(usMajor) + LtoALength(usMinor) +
    683         LtoALength(usRevision);
     1254    ulTextLength = strlen(_szVendor) + strlen(_szApplication) + sizeof(_szPackage);
     1255    ulTextLength += LtoALength(_usMajor) + LtoALength(_usMinor) +
     1256        LtoALength(_usRevision);
    6841257    ulTextLength += 5;
    6851258
    686     if (bShowAttribute)
     1259    if (p_bShowAttribute)
    6871260        // Length of the attribute, =, " and "
    6881261        ulTextLength += strlen(SZ_ATTRIBUTE_PACKAGEID) + 3;
    6891262
    690     //pszScriptText = new CHAR[ulTextLength + 1];
    691     //*pszScriptText = '\0';
    692 
    693     if (bShowAttribute)
     1263    if (p_bShowAttribute)
    6941264        sprintf(szTemp, "%s=\"%s\\%s\\%s\\%i\\%i\\%i\"", SZ_ATTRIBUTE_PACKAGEID,
    695             szVendor, szApplication, szPackage, usMajor, usMinor, usRevision);
     1265            _szVendor, _szApplication, _szPackage, _usMajor, _usMinor, _usRevision);
    6961266    else
    6971267        sprintf(szTemp, "%s\\%s\\%s\\%i\\%i\\%i",
    698             szVendor, szApplication, szPackage, usMajor, usMinor, usRevision);
    699 
    700     xstrcat(&strScriptText, szTemp, 0);
    701     return strScriptText.psz;
    702     }
    703 
    704 
    705 /***************************************************************************
    706  *@@ScriptPackageID:: BuildFromText
     1268            _szVendor, _szApplication, _szPackage, _usMajor, _usMinor, _usRevision);
     1269
     1270    xstrcat(&xstrScriptText, szTemp, 0);
     1271    return xstrScriptText.psz;
     1272    }
     1273
     1274
     1275/*
     1276 *@@BuildFromText:
    7071277 *  Builds package ID accordingly to script text. If any errors is found in script
    7081278 *  text, error informations are returned in table where to *pScriptError
     
    7111281 */
    7121282PSZ ScriptPackageID::BuildFromText(PSZ pszScriptText,
    713                                    SCRIPTERROR **ppScriptError,
    714                                    USHORT *pusErrorTableSize,
    7151283                                   ULONG ulLineNumber)
    7161284    {
    717     SCRIPTERROR Error;
     1285    Message msg;
    7181286    PSZ pszTemp = NULL, pszTemp2 = NULL, pszTemp3 = NULL;
    7191287    PSZ pszAttr = NULL;
     
    7241292    pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_PACKAGEID, &ulOffset);
    7251293
    726     if (!pszAttr && ppScriptError)
    727         {
    728         Error.usErrorCode = ERR_PARSE_PCKID_NOTFOUND;
    729         Error.ulLineNumber = ulLineNumber;
    730         Error.pszStart = strhdup(pszScriptText);
    731         Error.ulLength = 0;
    732         if (ppScriptError)
    733             *pusErrorTableSize =
    734                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     1294    if (!pszAttr)
     1295        {
     1296        msg.SetType(MSG_TYPE_WARNING);
     1297        msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_NOTFOUND);
     1298        msg.SetLineNumber(ulLineNumber);
     1299        _messageLogger.LogMessage(msg);
    7351300        return NULL;
    7361301        }
     
    7411306        {
    7421307        pszTemp3 = strhSubstr(pszTemp2, pszTemp);
     1308        if (strlen(pszTemp3) == 0)
     1309            {
     1310            // There is no vendor string so report it.
     1311            msg.SetType(MSG_TYPE_WARNING);
     1312            msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_VENDOR_NOTFOUND);
     1313            msg.SetLineNumber(ulLineNumber);
     1314            _messageLogger.LogMessage(msg);
     1315            }
    7431316        this->SetVendor(pszTemp3);
    7441317        delete [] pszTemp3;
     
    7481321            {
    7491322            pszTemp3 = strhSubstr(pszTemp2, pszTemp);
     1323            if (strlen(pszTemp3) == 0)
     1324                {
     1325                // There is no application string so report it.
     1326                msg.SetType(MSG_TYPE_WARNING);
     1327                msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_APPL_NOTFOUND);
     1328                msg.SetLineNumber(ulLineNumber);
     1329                _messageLogger.LogMessage(msg);
     1330                }
    7501331            this->SetApplication(pszTemp3);
    7511332            delete [] pszTemp3;
     
    7551336                {
    7561337                pszTemp3 = strhSubstr(pszTemp2, pszTemp);
     1338                if (strlen(pszTemp3) == 0)
     1339                    {
     1340                    // There is no package string so report it.
     1341                    msg.SetType(MSG_TYPE_WARNING);
     1342                    msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_PACKAGE_NOTFOUND);
     1343                    msg.SetLineNumber(ulLineNumber);
     1344                    _messageLogger.LogMessage(msg);
     1345                    }
    7571346                this->SetPackage(pszTemp3);
    7581347                delete [] pszTemp3;
     
    7621351                    {
    7631352                    pszTemp3 = strhSubstr(pszTemp2, pszTemp);
     1353                    if (strlen(pszTemp3) == 0)
     1354                        {
     1355                        // There is no major number so report it.
     1356                        msg.SetType(MSG_TYPE_WARNING);
     1357                        msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_MAJOR_NOTFOUND);
     1358                        msg.SetLineNumber(ulLineNumber);
     1359                        _messageLogger.LogMessage(msg);
     1360                        }
    7641361                    sscanf(pszTemp3, "%d", &ulVersion);
    7651362                    this->SetMajor((USHORT)ulVersion);
     
    7701367                        {
    7711368                        pszTemp3 = strhSubstr(pszTemp2, pszTemp);
     1369                        if (strlen(pszTemp3) == 0)
     1370                            {
     1371                            // There is no minor number so report it.
     1372                            msg.SetType(MSG_TYPE_WARNING);
     1373                            msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_MINOR_NOTFOUND);
     1374                            msg.SetLineNumber(ulLineNumber);
     1375                            _messageLogger.LogMessage(msg);
     1376                            }
    7721377                        sscanf(pszTemp3, "%d", &ulVersion);
    7731378                        this->SetMinor((USHORT)ulVersion);
     
    7951400                        }
    7961401                    }
    797                 else // Major
     1402                else // Major warning.
    7981403                    {
    799                     // Error
     1404                    msg.SetType(MSG_TYPE_WARNING);
     1405                    msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_NOTFOUND);
     1406                    msg.SetLineNumber(ulLineNumber);
     1407                    _messageLogger.LogMessage(msg);
    8001408                    }
    8011409                }
    802             else // Package
     1410            else // Package warning.
    8031411                {
    804                 // Error
     1412                msg.SetType(MSG_TYPE_WARNING);
     1413                msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_PACKAGE_NOTFOUND);
     1414                msg.SetLineNumber(ulLineNumber);
     1415                _messageLogger.LogMessage(msg);
    8051416                }
    8061417            }
    807         else // Application
     1418        else // Application warning.
    8081419            {
    809             // Error
     1420            msg.SetType(MSG_TYPE_WARNING);
     1421            msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_APPL_NOTFOUND);
     1422            msg.SetLineNumber(ulLineNumber);
     1423            _messageLogger.LogMessage(msg);
    8101424            }
    8111425        }
    812     else // Vendor
    813         {
    814         // Error
    815         }
    816 
    817 
     1426    else // Vendor warning.
     1427        {
     1428        msg.SetType(MSG_TYPE_WARNING);
     1429        msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_VENDOR_NOTFOUND);
     1430        msg.SetLineNumber(ulLineNumber);
     1431        _messageLogger.LogMessage(msg);
     1432        }
    8181433
    8191434    ulAttrLen = strlen(pszAttr);
     
    8281443/****************************************************************************
    8291444 ****************************************************************************
    830         ScriptTitle class:
    831 
    832  ****************************************************************************
    833  *  ScriptTitle class member functions:
    834  *  ScripitTitle    Constructor.
    835  *  ~ScriptTitle    Destructor.
    836  *  SetTitle        Sets title text.
    837  *  SetIndex        Sets title object ID. Should be used for identification.
    838  *  ReturnTitle     Returns const pointer to title text.
    839  *  ReturnIndex     Returns object ID number.
    840  *  MakeScriptText  Returns pointer to script text.
    841  *  BuildFromText   Builds object accordingly to script text.
    842  ***************************************************************************/
    843 
    844 
    845 /***************************************************************************
    846  *@@ ScriptTitle::ScriptTitle
     1445        @@ScriptTitle class:
     1446
     1447    <B>Description:</B>
     1448        This class is for TITLE attribute in PCK tag. This class contains
     1449        information about title. Title is used to specify what will be
     1450        displayed in WarpIN's container page.
     1451
     1452    Class member functions:
     1453        ScripitTitle(USHORT)            Constructor.
     1454        ~ScriptTitle()                  Destructor.
     1455        USHORT SetTitle(const PSZ)      Sets title text.
     1456        PSZ ReturnTitle()               Returns const pointer to title text.
     1457        PSZ MakeScriptText()            Returns pointer to script text.
     1458        PSZ BuildFromText(PSZ, ULONG)   Builds object accordingly to script text.
     1459 ****************************************************************************/
     1460
     1461
     1462/*
     1463 *@@ScriptTitle:
    8471464 *  Constructor for ScriptTitle class. Initializes szTitle string by setting
    8481465 *  first char to '\0'.
    8491466 */
    850 ScriptTitle::ScriptTitle(USHORT usIndex)
    851     {
    852     *szTitle = '\0';
    853     this->usIndex = usIndex;
    854     }
    855 
    856 
    857 
    858 /***************************************************************************
    859  *@@ ScriptTitle::~ScriptTitle
     1467ScriptTitle::ScriptTitle(USHORT p_usIndex)
     1468    {
     1469    *_szTitle = '\0';
     1470    SetIndex(p_usIndex);
     1471    }
     1472
     1473
     1474/*
     1475 *@@~ScriptTitle:
    8601476 *  destructor for ScriptTitle class. Does nothing special.
    8611477 */
     
    8661482
    8671483
    868 /***************************************************************************
    869  *@@ ScriptTitle::SetTitle
     1484/*
     1485 *@@SetTitle:
    8701486 *  Sets title text.
    8711487 */
    872 
    873 void ScriptTitle::SetTitle(const PSZ pszTitle)
    874     {
    875     if (strlen(szTitle) < MAXTITLELENGTH)
    876         strcpy(this->szTitle, pszTitle);
    877     }
    878 
    879 
    880 
    881 /***************************************************************************
    882  *@@ ScriptTitle::SetIndex
    883  *  Sets title text.
    884  */
    885 
    886 void ScriptTitle::SetIndex(USHORT usIndex)
    887     {
    888     this->usIndex = usIndex;
    889     }
    890 
    891 
    892 
    893 /***************************************************************************
    894  *@@ ScriptTitle::ReturnTitle
     1488USHORT ScriptTitle::SetTitle(const PSZ p_pszTitle)
     1489    {
     1490    Message msg;
     1491    USHORT rc = NO_ERROR;
     1492
     1493    if (strlen(p_pszTitle) < MAXTITLELENGTH)
     1494        strcpy(this->_szTitle, p_pszTitle);
     1495    else
     1496        {
     1497        msg.SetType(MSG_TYPE_ERROR);
     1498        msg.SetMessageValue(MSG_ATTRIBUTE_TITLE_TITLE_STRTOOLONG);
     1499        msg.SetMessageText(p_pszTitle);
     1500        _messageLogger.LogMessage(msg);
     1501        rc = STRING_TOO_LONG;
     1502        }
     1503    return rc;
     1504    }
     1505
     1506
     1507/*
     1508 *@@ReturnTitle:
    8951509 *  Returns const pointer to title text.
    8961510 */
    897 
    8981511const PSZ ScriptTitle::ReturnTitle()
    8991512    {
    900     return szTitle;
    901     }
    902 
    903 
    904 
    905 /***************************************************************************
    906  *@@ ScriptTitle::ReturnIndex
    907  *  Sets title text.
    908  */
    909 
    910 USHORT ScriptTitle::ReturnIndex()
    911     {
    912     return usIndex;
    913     }
    914 
    915 
    916 
    917 
    918 /***************************************************************************
    919  *@@ ScriptTitle::MakeScriptText
     1513    return _szTitle;
     1514    }
     1515
     1516/*
     1517 *@@MakeScriptText:
    9201518 *  Returns pointer to script text.
    9211519 */
    922 PSZ ScriptTitle::MakeScriptText(BOOL bAttribute)
     1520PSZ ScriptTitle::MakeScriptText(BOOL p_bAttribute)
    9231521    {
    9241522    ULONG ulTextLength = 0;
    9251523    PSZ pszScriptText = NULL;
    926     ulTextLength = strlen(szTitle);
     1524    ulTextLength = strlen(_szTitle);
    9271525    CHAR szTemp[1024];
    9281526    szTemp[0]='\0';
    9291527
    930     if (bAttribute)
     1528    if (p_bAttribute)
    9311529        // Length of the attribute, =, " and "
    932         ulTextLength += strlen("TITLE") + 3;
     1530        ulTextLength += strlen(SZ_ATTRIBUTE_TITLE) + 3;
    9331531
    9341532    pszScriptText = new CHAR[ulTextLength + 1];
    9351533    *pszScriptText = '\0';
    9361534
    937     if (bAttribute)
    938         sprintf(pszScriptText, "%s=\"%s\"", SZ_ATTRIBUTE_TITLE, szTitle);
     1535    if (p_bAttribute)
     1536        sprintf(pszScriptText, "%s=\"%s\"", SZ_ATTRIBUTE_TITLE, _szTitle);
    9391537    else
    940         sprintf(pszScriptText, "%s", szTitle);
     1538        sprintf(pszScriptText, "%s", _szTitle);
    9411539
    9421540    return pszScriptText;
     
    9441542
    9451543
    946 /***************************************************************************
    947  *@@ScriptTitle::BuildFromText
     1544/*
     1545 *@@BuildFromText:
    9481546 *  Builds package ID accordingly to script text. If any errors is found in script
    9491547 *  text, error informations are returned in table where to *pScriptError
     
    9521550 */
    9531551PSZ ScriptTitle::BuildFromText(PSZ pszScriptText,
    954                                SCRIPTERROR **ppScriptError,
    955                                USHORT *pusErrorTableSize,
    956                                ULONG ulLineNumber)
    957     {
    958     SCRIPTERROR Error;
     1552                               ULONG p_ulLineNumber)
     1553    {
     1554    Message msg;
    9591555    PSZ pszTemp = NULL;
    9601556    PSZ pszAttr = NULL;
     
    9681564    else
    9691565        {
    970         Error.usErrorCode = ERR_PARSE_TITLE_NOTFOUND;
    971         Error.ulLineNumber = ulLineNumber;
    972         Error.pszStart = strhdup(pszScriptText);
    973         Error.ulLength = 0;
    974         if (ppScriptError)
    975             *pusErrorTableSize =
    976                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     1566        msg.SetType(MSG_TYPE_WARNING);
     1567        msg.SetMessageValue(MSG_ATTRIBUTE_TITLE_TITLE_NOTFOUND);
     1568        msg.SetLineNumber(p_ulLineNumber);
     1569        _messageLogger.LogMessage(msg);
    9771570        return NULL;
    9781571        }
     
    9881581/****************************************************************************
    9891582 ****************************************************************************
    990         ScriptTarget class:
    991 
    992  ****************************************************************************
    993  *  ScriptTarget class member functions:
    994  *  ScripitTarget   Constructor.
    995  *  ~ScriptTarget   Destructor.
    996  *  SetTarget       Sets title text.
    997  *  SetIndex        Sets target object ID. Should be used for identification.
    998  *  ReturnTarget    Returns const pointer to title text.
    999  *  ReturnIndex     Returns object ID number.
    1000  *  MakeScriptText  Returns pointer to script text.
    1001  *  BuildFromText   Construct object from script text.
     1583        @@ScriptTarget class:
     1584
     1585    <B>Description:</B>
     1586        This class is for TARGET attribute in PCK tag. This class contains
     1587        information about target path where files will be installed by
     1588        default. Same path will be displayed in WarpIN's container page.
     1589
     1590
     1591    Member functions:
     1592        ScripitTarget(USHORT)           Constructor.
     1593        ~ScriptTarget()                 Destructor.
     1594        USHORT SetTarget(const PSZ)     Sets title text.
     1595        const PSZ ReturnTarget()        Returns const pointer to title text.
     1596        PSZ MakeScriptText(BOOL)        Returns pointer to script text.
     1597        PSZ BuildFromText(PSZ, ULONG)   Construct object from script text.
    10021598 ***************************************************************************/
    10031599
    10041600
    1005 /***************************************************************************
    1006  *@@ ScriptTarget::ScriptTarget
     1601/*
     1602 *@@ScriptTarget:
    10071603 *  Constructor for ScriptTarget class. Initializes szTarget string by
    10081604 *  setting first char to '\0'.
    10091605 */
    1010 ScriptTarget::ScriptTarget(USHORT usIndex)
    1011     {
    1012     *szTarget = '\0';
    1013     this->usIndex = usIndex;
    1014     }
    1015 
    1016 
    1017 
    1018 /***************************************************************************
    1019  *@@ ScriptTarget::~ScriptTarget
    1020  *  destructor for ScriptTarget class. Does nothing special.
     1606ScriptTarget::ScriptTarget(USHORT p_usIndex)
     1607    {
     1608    *_szTarget = '\0';
     1609    SetIndex(p_usIndex);
     1610    }
     1611
     1612
     1613
     1614/*
     1615 *@@~ScriptTarget:
     1616 *  destructor for ScriptTarget class.
    10211617 */
    10221618ScriptTarget::~ScriptTarget()
    10231619    {
    1024     }
    1025 
    1026 
    1027 /***************************************************************************
    1028  *@@ ScriptTarget::SetTarget
     1620    *_szTarget = '\0';
     1621    }
     1622
     1623
     1624/*
     1625 *@@SetTarget:
    10291626 *  Sets target text.
    10301627 */
    1031 void ScriptTarget::SetTarget(const PSZ pszTarget)
    1032     {
    1033     if (strlen(szTarget) < MAXTARGETLENGTH)
    1034         strcpy(this->szTarget, pszTarget);
    1035     }
    1036 
    1037 
    1038 
    1039 /***************************************************************************
    1040  *@@ ScriptTarget::SetIndex
    1041  *  Sets object's index.
    1042  */
    1043 void ScriptTarget::SetIndex(USHORT usIndex)
    1044     {
    1045     this->usIndex = usIndex;
    1046     }
    1047 
    1048 
    1049 
    1050 /***************************************************************************
    1051  *@@ ScriptTarget::ReturnTitle
     1628USHORT ScriptTarget::SetTarget(const PSZ p_pszTarget)
     1629    {
     1630    Message msg;
     1631    USHORT rc = NO_ERROR;
     1632    if (strlen(p_pszTarget) < MAXTARGETLENGTH)
     1633        strcpy(this->_szTarget, p_pszTarget);
     1634    else
     1635        {
     1636        msg.SetType(MSG_TYPE_ERROR);
     1637        msg.SetMessageValue(MSG_ATTRIBUTE_TARGET_TARGET_STRTOOLONG);
     1638        msg.SetMessageText(p_pszTarget);
     1639        _messageLogger.LogMessage(msg);
     1640        rc = STRING_TOO_LONG;
     1641        }
     1642    return rc;
     1643    }
     1644
     1645
     1646/*
     1647 *@@ReturnTitle:
    10521648 *  Returns const pointer to target text.
    10531649 */
    10541650const PSZ ScriptTarget::ReturnTarget()
    10551651    {
    1056     return szTarget;
    1057     }
    1058 
    1059 
    1060 
    1061 /***************************************************************************
    1062  *@@ ScriptTarget::ReturnIndex
    1063  *  Returns object's index number.
    1064  */
    1065 USHORT ScriptTarget::ReturnIndex()
    1066     {
    1067     return usIndex;
    1068     }
    1069 
    1070 
    1071 
    1072 
    1073 /***************************************************************************
    1074  *@@ ScriptTarget::MakeScriptText
     1652    return _szTarget;
     1653    }
     1654
     1655
     1656/*
     1657 *@@MakeScriptText:
    10751658 *  Returns pointer to script text.
    10761659 */
    1077 PSZ ScriptTarget::MakeScriptText(BOOL bAttribute)
    1078     {
    1079     ULONG ulTextLength = 0;
    1080     XSTRING strScriptText;
    1081     xstrInit(&strScriptText, 0);
    1082     ulTextLength = strlen(szTarget);
     1660PSZ ScriptTarget::MakeScriptText(BOOL p_bAttribute)
     1661    {
     1662    XSTRING xstrScriptText;
    10831663    CHAR szTemp[1024];
    10841664    szTemp[0]='\0';
    1085 
    1086     if (bAttribute)
    1087         // Length of the attribute, =, " and "
    1088         ulTextLength += strlen("TARGET") + 3;
    1089 
    1090     //pszScriptText = new CHAR[ulTextLength + 1];
    1091     //*pszScriptText = '\0';
    1092 
    1093     if (bAttribute)
    1094         sprintf(szTemp, "%s=\"%s\"", SZ_ATTRIBUTE_TARGET, szTarget);
     1665    xstrInit(&xstrScriptText, 0);
     1666
     1667    if (p_bAttribute)
     1668        sprintf(szTemp, "%s=\"%s\"", SZ_ATTRIBUTE_TARGET, _szTarget);
    10951669    else
    1096         sprintf(szTemp, "%s\"", szTarget);
    1097 
    1098     xstrcat(&strScriptText, szTemp, 0);
    1099     return strScriptText.psz;
    1100     }
    1101 
    1102 
    1103 
    1104 /***************************************************************************
    1105  *@@ScriptTarget::BuildFromText
     1670        sprintf(szTemp, "%s\"", _szTarget);
     1671
     1672    xstrcat(&xstrScriptText, szTemp, 0);
     1673    return xstrScriptText.psz;
     1674    }
     1675
     1676
     1677
     1678/*
     1679 *@@BuildFromText:
    11061680 *  Builds target object accordingly to script text. If any errors is found
    1107  *  in script text, error informations are returned in table where to
    1108  *  *pScriptError points. Pointer to after end of tag is returned so multiple
    1109  *  searches can be done.
    1110  */
    1111 PSZ ScriptTarget::BuildFromText(PSZ pszScriptText,
    1112                                SCRIPTERROR **ppScriptError,
    1113                                USHORT *pusErrorTableSize,
    1114                                ULONG ulLineNumber)
    1115     {
    1116     SCRIPTERROR Error;
     1681 *  NULL pointer is returned.If no errors occurred, pointer to after end of
     1682 *  tag is returned so multiple searches can be done.
     1683 */
     1684PSZ ScriptTarget::BuildFromText(PSZ p_pszScriptText,
     1685                               ULONG p_ulLineNumber)
     1686    {
     1687    Message msg;
    11171688    PSZ pszTemp = NULL;
    11181689    PSZ pszAttr = NULL;
     
    11211692
    11221693
    1123     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_TARGET, &ulOffset);
     1694    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_TARGET, &ulOffset);
    11241695    if (pszAttr)
    11251696        this->SetTarget(pszAttr);
    11261697    else
    11271698        {
    1128         Error.usErrorCode = ERR_PARSE_TITLE_NOTFOUND;
    1129         Error.ulLineNumber = ulLineNumber;
    1130         Error.pszStart = strhdup(pszScriptText);
    1131         Error.ulLength = 0;
    1132         if (ppScriptError)
    1133             *pusErrorTableSize =
    1134                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     1699        msg.SetType(MSG_TYPE_WARNING);
     1700        msg.SetMessageValue(MSG_ATTRIBUTE_TARGET_TARGET_NOTFOUND);
     1701        msg.SetLineNumber(p_ulLineNumber);
     1702        _messageLogger.LogMessage(msg);
    11351703        return NULL;
    11361704        }
     
    11381706    ulAttrLen = strlen(pszAttr);
    11391707    delete [] pszAttr;
    1140     return pszScriptText + ulOffset + ulAttrLen + 1;
     1708    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    11411709    }
    11421710
     
    11451713/****************************************************************************
    11461714 ****************************************************************************
    1147         ScriptKeyWord class:
    1148 
    1149  ****************************************************************************
    1150  *  ScriptKeyWord class member functions:
    1151  *  ScripitKeyWord  Constructor.
    1152  *  ~ScriptKeyWord  Destructor.
    1153  *  SetBase         Sets BASE keyword.
    1154  *  SetFixed        Sets FIXED keyword.
    1155  *  SetSelect       Sets SELECT keyword.
    1156  *  SetNoDeselect   Sets BODESELECT keyword.
    1157  *  SetKeyWord      Sets all keywords simultaniously.
    1158  *  SetIndex        Sets object ID. Should be used for identification.
    1159  *  ReturnBase      Returns BASE keyword state.
    1160  *  ReturnFixed     Returns FIXED keyword state.
    1161  *  ReturnSelect    Returns SELECT keyword state.
    1162  *  ReturnNoDeselect Returns NODESELECT keyword state.
    1163  *  ReturnIndex     Returns object ID number.
    1164  *  MakeScriptText  Returns pointer to script text.
    1165  *  BuildFromText   Builds object from text.
     1715        @@ScriptKeyWord class:
     1716
     1717    <B>Description:</B>
     1718        This class is for keywords in PCK tag. This class contains
     1719        all four keywords: BASE, FIXED, SELECT and NODESELECT. Detailed
     1720        information about the meaning of the keywords can be found from
     1721        <I>WarpIN Programmer's Guide and Reference</I>.
     1722
     1723
     1724    Member functions:
     1725        ScripitKeyWord(USHORT)          Constructor.
     1726        ~ScriptKeyWord                  Destructor.
     1727        USHORT SetBase(BOOL)            Sets BASE keyword.
     1728        USHORT SetFixed(BOOL)           Sets FIXED keyword.
     1729        USHORT SetSelect(BOOL)          Sets SELECT keyword.
     1730        USHORT SetNoDeselect(BOOL)      Sets BODESELECT keyword.
     1731        USHORT SetKeyWord(USHORT)       Sets all keywords simultaniously.
     1732        BOOL ReturnBase()               Returns BASE keyword state.
     1733        BOOL ReturnFixed()              Returns FIXED keyword state.
     1734        BOOL ReturnSelect()             Returns SELECT keyword state.
     1735        BOOL ReturnNoDeselect()         Returns NODESELECT keyword state.
     1736        PSZ MakeScriptText(BOOL)        Returns pointer to script text.
     1737        PSZ BuildFromText(PSZ, ULONG)   Builds object from text.
    11661738 ***************************************************************************/
    11671739
    11681740
    1169 /***************************************************************************
    1170  *@@ ScriptKeyWord::ScriptKeyWord
     1741/*
     1742 *@@ScriptKeyWord:
    11711743 *  Constructor for ScriptKeyWord class. Initializes object by setting
    11721744 *  usIndex to given value on uses default value (1).
    11731745 */
    1174 ScriptKeyWord::ScriptKeyWord(USHORT usIndex)
    1175     {
    1176     this->usIndex = usIndex;
    1177     bBase = FALSE;
    1178     bFixed = FALSE;
    1179     bSelect = FALSE;
    1180     bNoDeselect = FALSE;
    1181     }
    1182 
    1183 
    1184 
    1185 
    1186 /***************************************************************************
    1187  *@@ ScriptKeyWord::~ScriptKeyWord
     1746ScriptKeyWord::ScriptKeyWord(USHORT p_usIndex)
     1747    {
     1748    SetIndex(p_usIndex);
     1749    _bBase = FALSE;
     1750    _bFixed = FALSE;
     1751    _bSelect = FALSE;
     1752    _bNoDeselect = FALSE;
     1753    }
     1754
     1755
     1756/*
     1757 *@@~ScriptKeyWord:
    11881758 *  Destructor for ScriptKeyWord class.
    11891759 */
    11901760ScriptKeyWord::~ScriptKeyWord()
    11911761    {
    1192     }
    1193 
    1194 
    1195 
    1196 /***************************************************************************
    1197  *@@ ScriptKeyWord::SetBase
     1762    _bBase = FALSE;
     1763    _bFixed = FALSE;
     1764    _bSelect = FALSE;
     1765    _bNoDeselect = FALSE;
     1766    }
     1767
     1768
     1769/*
     1770 *@@SetBase:
    11981771 *  Sets BASE keyword state.
    11991772 */
    1200 void ScriptKeyWord::SetBase(BOOL bBase)
    1201     {
    1202     this->bBase = bBase;
    1203     }
    1204 
    1205 
    1206 
    1207 /***************************************************************************
     1773USHORT ScriptKeyWord::SetBase(BOOL p_bBase)
     1774    {
     1775    _bBase = p_bBase;
     1776    return NO_ERROR;
     1777    }
     1778
     1779
     1780/*
    12081781 *@@ ScriptKeyWord::SetFixed
    12091782 *  Sets FIXED keyword state.
    12101783 */
    1211 void ScriptKeyWord::SetFixed(BOOL bFixed)
    1212     {
    1213     this->bFixed = bFixed;
    1214     }
    1215 
    1216 
    1217 
    1218 /***************************************************************************
    1219  *@@ ScriptKeyWord::SetSelect
     1784USHORT ScriptKeyWord::SetFixed(BOOL p_bFixed)
     1785    {
     1786    _bFixed = p_bFixed;
     1787    return NO_ERROR;
     1788    }
     1789
     1790
     1791/*
     1792 *@@SetSelect:
    12201793 *  Sets SELECT keyword state.
    12211794 */
    1222 void ScriptKeyWord::SetSelect(BOOL bSelect)
    1223     {
    1224     this->bSelect = bSelect;
    1225     }
    1226 
    1227 
    1228 
    1229 /***************************************************************************
    1230  *@@ ScriptKeyWord::SetNoDeselect
     1795USHORT ScriptKeyWord::SetSelect(BOOL p_bSelect)
     1796    {
     1797    _bSelect = p_bSelect;
     1798    return NO_ERROR;
     1799    }
     1800
     1801
     1802/*
     1803 *@@SetNoDeselect:
    12311804 *  Sets NODESELECT keyword state.
    12321805 */
    1233 void ScriptKeyWord::SetNoDeselect(BOOL bNoDeselect)
    1234     {
    1235     this->bNoDeselect = bNoDeselect;
    1236     }
    1237 
    1238 
    1239 
    1240 
    1241 /***************************************************************************
    1242  *@@ ScriptKeyWord::SetKeyWord
     1806USHORT ScriptKeyWord::SetNoDeselect(BOOL p_bNoDeselect)
     1807    {
     1808    _bNoDeselect = p_bNoDeselect;
     1809    return NO_ERROR;
     1810    }
     1811
     1812
     1813/*
     1814 *@@SetKeyWord:
    12431815 *  Sets all keyword states acconding to usKeyWords. Different keywords can
    12441816 *  be combined with OR. Example: KEYWORD_BASE | KEYWORD_FIXED.
    12451817 */
    1246 void ScriptKeyWord::SetKeyWord(USHORT usKeyWords)
    1247     {
    1248     if (usKeyWords & KEYWORD_BASE)
    1249         bBase = TRUE;
     1818USHORT ScriptKeyWord::SetKeyWord(USHORT p_usKeyWords)
     1819    {
     1820    if (p_usKeyWords & KEYWORD_BASE)
     1821        _bBase = TRUE;
    12501822    else
    1251         bBase = FALSE;
    1252 
    1253     if (usKeyWords & KEYWORD_FIXED)
    1254         bFixed = TRUE;
     1823        _bBase = FALSE;
     1824
     1825    if (p_usKeyWords & KEYWORD_FIXED)
     1826        _bFixed = TRUE;
    12551827    else
    1256         bFixed = FALSE;
    1257 
    1258     if (usKeyWords & KEYWORD_SELECT)
    1259         bSelect = TRUE;
     1828        _bFixed = FALSE;
     1829
     1830    if (p_usKeyWords & KEYWORD_SELECT)
     1831        _bSelect = TRUE;
    12601832    else
    1261         bSelect = FALSE;
    1262 
    1263     if (usKeyWords & KEYWORD_NODESELECT)
    1264         bNoDeselect = TRUE;
     1833        _bSelect = FALSE;
     1834
     1835    if (p_usKeyWords & KEYWORD_NODESELECT)
     1836        _bNoDeselect = TRUE;
    12651837    else
    1266         bNoDeselect = FALSE;
    1267     }
    1268 
    1269 
    1270 
    1271 /***************************************************************************
    1272  *@@ ScriptKeyWord::SetIndex
    1273  *  Sets object's index.
    1274  */
    1275 void ScriptKeyWord::SetIndex(USHORT usIndex)
    1276     {
    1277     this->usIndex = usIndex;
    1278     }
    1279 
    1280 
    1281 
    1282 /***************************************************************************
    1283  *@@ ScriptKeyWord::ReturnBase
     1838        _bNoDeselect = FALSE;
     1839
     1840    return NO_ERROR;
     1841    }
     1842
     1843
     1844/*
     1845 *@@ReturnBase:
    12841846 *  Returns bBase state.
    12851847 */
    12861848BOOL ScriptKeyWord::ReturnBase()
    12871849    {
    1288     return bBase;
    1289     }
    1290 
    1291 
    1292 
    1293 /***************************************************************************
    1294  *@@ ScriptKeyWord::ReturnFixed
     1850    return _bBase;
     1851    }
     1852
     1853
     1854/*
     1855 *@@ReturnFixed:
    12951856 *  Returns bFixed state.
    12961857 */
    12971858BOOL ScriptKeyWord::ReturnFixed()
    12981859    {
    1299     return bFixed;
    1300     }
    1301 
    1302 
    1303 
    1304 /***************************************************************************
    1305  *@@ ScriptKeyWord::ReturnSelect
     1860    return _bFixed;
     1861    }
     1862
     1863
     1864/*
     1865 *@@ReturnSelect:
    13061866 *  Returns bSelect state.
    13071867 */
    13081868BOOL ScriptKeyWord::ReturnSelect()
    13091869    {
    1310     return bSelect;
    1311     }
    1312 
    1313 
    1314 
    1315 /***************************************************************************
    1316  *@@ ScriptKeyWord::ReturnNoDeselect
     1870    return _bSelect;
     1871    }
     1872
     1873
     1874/*
     1875 *@@ReturnNoDeselect:
    13171876 *  Returns bBase state.
    13181877 */
    13191878BOOL ScriptKeyWord::ReturnNoDeselect()
    13201879    {
    1321     return bNoDeselect;
    1322     }
    1323 
    1324 
    1325 
    1326 /***************************************************************************
    1327  *@@ ScriptKeyWord::ReturnKeyWord
     1880    return _bNoDeselect;
     1881    }
     1882
     1883
     1884/*
     1885 *@@ReturnKeyWord:
    13281886 *  Returns all keyword states.
    13291887 */
     
    13321890    USHORT usReturnValue = 0;
    13331891
    1334     if (bBase)
     1892    if (_bBase)
    13351893        usReturnValue |= KEYWORD_BASE;
    1336     if (bFixed)
     1894    if (_bFixed)
    13371895        usReturnValue |= KEYWORD_FIXED;
    1338     if (bSelect)
     1896    if (_bSelect)
    13391897        usReturnValue |= KEYWORD_SELECT;
    1340     if (bNoDeselect)
     1898    if (_bNoDeselect)
    13411899        usReturnValue |= KEYWORD_NODESELECT;
    13421900
     
    13451903
    13461904
    1347 
    1348 
    1349 /***************************************************************************
    1350  *@@ ScriptKeyWord::ReturnIndex
    1351  *  Returns index of current object.
    1352  */
    1353 USHORT ScriptKeyWord::ReturnIndex()
    1354     {
    1355     return usIndex;
    1356     }
    1357 
    1358 
    1359 
    1360 /***************************************************************************
    1361  *@@ ScriptKeyWords::MakeScriptText
     1905/*
     1906 *@@MakeScriptText:
    13621907 *  Returns pointer to script text.
    13631908 */
    1364 PSZ ScriptKeyWord::MakeScriptText(BOOL bAttribute, BOOL bLineFeed)
    1365     {
    1366     ULONG ulTextLength = 0;
     1909PSZ ScriptKeyWord::MakeScriptText(BOOL p_bAttribute, BOOL p_bLineFeed)
     1910    {
    13671911    ULONG ulSpaces = 0;
    1368     PSZ pszScriptText = NULL;
    1369 
    1370     if (bBase)
    1371         {
    1372         ulTextLength += strlen(SZ_KEYWORD_BASE);
     1912    XSTRING xstrScriptText;
     1913    xstrInit(&xstrScriptText, 0);
     1914
     1915    if (_bBase)
    13731916        ulSpaces ++;
    1374         }
    1375     if (bFixed)
    1376         {
    1377         ulTextLength += strlen(SZ_KEYWORD_FIXED);
     1917    if (_bFixed)
    13781918        ulSpaces ++;
    1379         }
    1380     if (bSelect)
    1381         {
    1382         ulTextLength += strlen(SZ_KEYWORD_SELECT);
     1919    if (_bSelect)
    13831920        ulSpaces ++;
    1384         }
    1385     if (bNoDeselect)
    1386         {
    1387         ulTextLength += strlen(SZ_KEYWORD_NODESELECT);
     1921    if (_bNoDeselect)
    13881922        ulSpaces ++;
    1389         }
    1390 
    1391     pszScriptText = new CHAR[ulTextLength + (--ulSpaces) + 1];
    1392     *pszScriptText = '\0';
    1393 
    1394     if (bBase)
    1395         {
    1396         strcat(pszScriptText, SZ_KEYWORD_BASE);
    1397         if (bLineFeed && ulSpaces > 0)
    1398             strcat(pszScriptText, "\n");
     1923
     1924    if (_bBase)
     1925        {
     1926        xstrcat(&xstrScriptText, SZ_KEYWORD_BASE, 0);
     1927        if (p_bLineFeed && ulSpaces > 0)
     1928            xstrcat(&xstrScriptText, "\n", 0);
    13991929        else if (ulSpaces > 0)
    1400             strcat(pszScriptText, " ");
     1930            xstrcat(&xstrScriptText, " ", 0);
    14011931        ulSpaces--;
    14021932        }
    1403     if (bFixed)
    1404         {
    1405         strcat(pszScriptText, SZ_KEYWORD_FIXED);
    1406         if (bLineFeed && ulSpaces > 0)
    1407             strcat(pszScriptText, "\n");
     1933    if (_bFixed)
     1934        {
     1935        xstrcat(&xstrScriptText, SZ_KEYWORD_FIXED, 0);
     1936        if (p_bLineFeed && ulSpaces > 0)
     1937            xstrcat(&xstrScriptText, "\n", 0);
    14081938        else if (ulSpaces > 0)
    1409             strcat(pszScriptText, " ");
     1939            xstrcat(&xstrScriptText, " ", 0);
    14101940        ulSpaces--;
    14111941        }
    1412     if (bSelect)
    1413         {
    1414         strcat(pszScriptText, SZ_KEYWORD_SELECT);
    1415         if (bLineFeed && ulSpaces > 0)
    1416             strcat(pszScriptText, "\n");
     1942    if (_bSelect)
     1943        {
     1944        xstrcat(&xstrScriptText, SZ_KEYWORD_SELECT, 0);
     1945        if (p_bLineFeed && ulSpaces > 0)
     1946           xstrcat(&xstrScriptText, "\n", 0);
    14171947        else if (ulSpaces > 0)
    1418             strcat(pszScriptText, " ");
     1948            xstrcat(&xstrScriptText, " ", 0);
    14191949        ulSpaces--;
    14201950        }
    1421     if (bNoDeselect)
    1422         {
    1423         strcat(pszScriptText, SZ_KEYWORD_NODESELECT);
    1424         if (bLineFeed && ulSpaces > 0)
    1425             strcat(pszScriptText, "\n");
     1951    if (_bNoDeselect)
     1952        {
     1953        xstrcat(&xstrScriptText, SZ_KEYWORD_NODESELECT, 0);
     1954        if (p_bLineFeed && ulSpaces > 0)
     1955            xstrcat(&xstrScriptText, "\n", 0);
    14261956        else if (ulSpaces > 0)
    1427             strcat(pszScriptText, " ");
     1957            xstrcat(&xstrScriptText, " ", 0);
    14281958        ulSpaces--;
    14291959        }
    14301960
    1431     return pszScriptText;
    1432     }
    1433 
    1434 
    1435 
    1436 /***************************************************************************
    1437  *@@ScriptKeyWord::BuildFromText
     1961    return xstrScriptText.psz;
     1962    }
     1963
     1964
     1965/*
     1966 *@@BuildFromText:
    14381967 *  Builds keyword object accordingly to script text. If any errors is found
    1439  *  in script text, error informations are returned in table where to
    1440  *  *pScriptError points. Pointer to after end of tag is returned so multiple
    1441  *  searches can be done.
    1442  */
    1443 PSZ ScriptKeyWord::BuildFromText(PSZ pszScriptText,
    1444                                SCRIPTERROR **ppScriptError,
    1445                                USHORT *pusErrorTableSize,
    1446                                ULONG ulLineNumber)
    1447     {
    1448     SCRIPTERROR Error;
     1968 *  NULL is returned otherwice pointer to just after end of tag is returned so
     1969 *  multiple searches can be done.
     1970 */
     1971PSZ ScriptKeyWord::BuildFromText(PSZ p_pszScriptText,
     1972                               ULONG p_ulLineNumber)
     1973    {
     1974    Message msg;
    14491975    PSZ pszKWord = NULL;
    14501976    BOOL KWFound = FALSE;
    14511977
    14521978
    1453     pszKWord = strhFindWord(pszScriptText, SZ_KEYWORD_BASE, "\x0d\x0a ()/\\-,.",
     1979    pszKWord = strhFindWord(p_pszScriptText, SZ_KEYWORD_BASE, "\x0d\x0a ()/\\-,.",
    14541980                            "\x0d\x0a ()/\\-,.:;");
    14551981    if (pszKWord)
     
    14611987        this->SetBase(FALSE);
    14621988
    1463     pszKWord = strhFindWord(pszScriptText, SZ_KEYWORD_FIXED, "\x0d\x0a ()/\\-,.",
     1989    pszKWord = strhFindWord(p_pszScriptText, SZ_KEYWORD_FIXED, "\x0d\x0a ()/\\-,.",
    14641990                            "\x0d\x0a ()/\\-,.:;");
    14651991    if (pszKWord)
     
    14711997        this->SetFixed(FALSE);
    14721998
    1473     pszKWord = strhFindWord(pszScriptText, SZ_KEYWORD_SELECT, "\x0d\x0a ()/\\-,.",
     1999    pszKWord = strhFindWord(p_pszScriptText, SZ_KEYWORD_SELECT, "\x0d\x0a ()/\\-,.",
    14742000                            "\x0d\x0a ()/\\-,.:;");
    14752001    if (pszKWord)
     
    14812007        this->SetSelect(FALSE);
    14822008
    1483     pszKWord = strhFindWord(pszScriptText, SZ_KEYWORD_NODESELECT, "\x0d\x0a ()/\\-,.",
     2009    pszKWord = strhFindWord(p_pszScriptText, SZ_KEYWORD_NODESELECT, "\x0d\x0a ()/\\-,.",
    14842010                            "\x0d\x0a ()/\\-,.:;");
    14852011    if (pszKWord)
     
    14932019    if (KWFound)
    14942020        {
    1495         Error.usErrorCode = ERR_PARSE_KEYWORD_NOTFOUND;
    1496         Error.ulLineNumber = ulLineNumber;
    1497         Error.pszStart = strhdup(pszScriptText);
    1498         Error.ulLength = 0;
    1499         if (ppScriptError)
    1500             *pusErrorTableSize =
    1501                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     2021        msg.SetType(MSG_TYPE_INFO);
     2022        msg.SetMessageValue(MSG_KEYWORD_PCKKW_NOTFOUND);
     2023        msg.SetLineNumber(p_ulLineNumber);
     2024        _messageLogger.LogMessage(msg);
    15022025        return NULL;
    15032026        }
    15042027
    1505     return pszScriptText;
     2028    return p_pszScriptText;
    15062029    }
    15072030
     
    15112034/****************************************************************************
    15122035 ****************************************************************************
    1513         ScriptRequires class:
    1514 
    1515  ****************************************************************************
    1516  *  ScriptRequires class member functions:
    1517  *  ScripitRequires Constructor.
    1518  *  ~ScriptRequires Destructor.
    1519  *  SetVendor       Sets vendor text.
    1520  *  SetApplication  Sets application text.
    1521  *  SetPackage      Sets package text.
    1522  *  SetMajor        Sets major number.
    1523  *  SetMinor        Sets minor number.
    1524  *  SetIndex        Sets index number. Used for identifying.
    1525  *  SetRevision     Sets revision number.
    1526  *  SetRequires     Sets all fields simultaneously.
    1527  *  ReturnVendor    Returns const pointer to vendor string.
    1528  *  ReturnApplication Returns const pointer to application string.
    1529  *  ReturnPackage   Returns const pointer to package string.
    1530  *  ReturnMajor     Returns major number.
    1531  *  ReturnMinor     Returns minor number.
    1532  *  ReturnRevision  Returns revision number.
    1533  *  ReturnRequires  Returns all fields.
    1534  *  ReturnIndex     Returns index number.
    1535  *  MakeScriptText  Returns pointer to script text.
     2036        @@ScriptRequires class:
     2037
     2038    <B>Description:</B>
     2039        This class is for REQUIRES attribute in PCK tag. This class contains
     2040        Detailed information about the meaning of the attribute can be found
     2041        from <I>WarpIN Programmer's Guide and Reference</I>.
     2042
     2043    Member functions:
     2044        ScripitRequires(USHORT)     Constructor.
     2045        ~ScriptRequires()           Destructor.
     2046        SetVendor                   Sets vendor text.
     2047        SetApplication              Sets application text.
     2048        SetPackage                  Sets package text.
     2049        SetMajor                    Sets major number.
     2050        SetMinor                    Sets minor number.
     2051        SetRevision                 Sets revision number.
     2052        SetRequires                 Sets all fields simultaneously.
     2053        ReturnVendor                Returns const pointer to vendor string.
     2054        ReturnApplication           Returns const pointer to application string.
     2055        ReturnPackage               Returns const pointer to package string.
     2056        ReturnMajor                 Returns major number.
     2057        ReturnMinor                 Returns minor number.
     2058        ReturnRevision              Returns revision number.
     2059        ReturnRequires              Returns all fields.
     2060        MakeScriptText              Returns pointer to script text.
    15362061 ***************************************************************************/
    15372062
    15382063
    1539 /***************************************************************************
    1540  *@@ ScriptRequires::ScriptRequires
     2064/*
     2065 *@@ScriptRequires:
    15412066 *  Constructor for ScriptRequires class. Initializes object by setting
    15422067 *  fields to zero.
    15432068 */
    1544 ScriptRequires::ScriptRequires(USHORT usIndex)
    1545     {
    1546     this->usIndex = usIndex;
    1547     *szVendor = '\0';
    1548     *szApplication = '\0';
    1549     *szPackage = '\0';
    1550     usMajor = 0;
    1551     usMinor = 0;
    1552     usRevision = 0;
    1553     usPckIndex = 0;
    1554     }
    1555 
    1556 
    1557 
    1558 /***************************************************************************
    1559  *@@ ScriptRequires::~ScriptRequires
     2069ScriptRequires::ScriptRequires(USHORT p_usIndex)
     2070    {
     2071    SetIndex(p_usIndex);
     2072    *_szVendor = '\0';
     2073    *_szApplication = '\0';
     2074    *_szPackage = '\0';
     2075    _usMajor = 0;
     2076    _usMinor = 0;
     2077    _usRevision = 0;
     2078    _usPckIndex = 0;
     2079    }
     2080
     2081
     2082/*
     2083 *@@~ScriptRequires:
    15602084 *  Destructor for ScriptRequires class.
    15612085 */
    15622086ScriptRequires::~ScriptRequires()
    15632087    {
    1564     }
    1565 
    1566 
    1567 
    1568 /***************************************************************************
    1569  *@@ ScriptRequires::SetVendor
     2088    *_szVendor = '\0';
     2089    *_szApplication = '\0';
     2090    *_szPackage = '\0';
     2091    _usMajor = 0;
     2092    _usMinor = 0;
     2093    _usRevision = 0;
     2094    _usPckIndex = 0;
     2095    }
     2096
     2097
     2098/*
     2099 *@@SetVendor:
    15702100 *  Sets vendor text.
    15712101 */
    1572 void ScriptRequires::SetVendor(const PSZ pszVendor)
    1573     {
    1574     if (strlen(szVendor) < MAXVENDORNAMELENGTH);
    1575         strcpy(this->szVendor, pszVendor);
    1576     }
    1577 
    1578 
    1579 
    1580 /***************************************************************************
    1581  *@@ ScriptRequires::SetApplication
     2102USHORT ScriptRequires::SetVendor(const PSZ p_pszVendor)
     2103    {
     2104    Message msg;
     2105    USHORT rc = NO_ERROR;
     2106    if (strlen(p_pszVendor) < MAXVENDORNAMELENGTH)
     2107        strcpy(this->_szVendor, p_pszVendor);
     2108    else
     2109        {
     2110        msg.SetType(MSG_TYPE_ERROR);
     2111        msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_VENDOR_STRTOOLONG);
     2112        msg.SetMessageText(p_pszVendor);
     2113        _messageLogger.LogMessage(msg);
     2114        rc = STRING_TOO_LONG;
     2115        }
     2116    return rc;
     2117    }
     2118
     2119
     2120/*
     2121 *@@SetApplication:
    15822122 *  Sets application text.
    15832123 */
    1584 void ScriptRequires::SetApplication(const PSZ pszApplication)
    1585     {
    1586     if (strlen(szApplication) < MAXAPPNAMELENGTH);
    1587         strcpy(this->szApplication, pszApplication);
    1588     }
    1589 
    1590 
    1591 
    1592 
    1593 /***************************************************************************
    1594  *@@ ScriptRequires::SetPackage
     2124USHORT ScriptRequires::SetApplication(const PSZ p_pszApplication)
     2125    {
     2126    Message msg;
     2127    USHORT rc = NO_ERROR;
     2128    if (strlen(p_pszApplication) < MAXAPPNAMELENGTH)
     2129        strcpy(this->_szApplication, p_pszApplication);
     2130    else
     2131        {
     2132        msg.SetType(MSG_TYPE_ERROR);
     2133        msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_APPL_STRTOOLONG);
     2134        msg.SetMessageText(p_pszApplication);
     2135        _messageLogger.LogMessage(msg);
     2136        rc = STRING_TOO_LONG;
     2137        }
     2138    return rc;
     2139    }
     2140
     2141
     2142/*
     2143 *@@SetPackage:
    15952144 *  Sets package text.
    15962145 */
    1597 void ScriptRequires::SetPackage(const PSZ pszPackage)
    1598     {
    1599     if (strlen(szPackage) < MAXPCKNAMELENGTH);
    1600         strcpy(this->szPackage, pszPackage);
    1601     }
    1602 
    1603 
    1604 
    1605 
    1606 /****************************************************************************
    1607  *@@ScriptRequires::SetMajor
     2146USHORT ScriptRequires::SetPackage(const PSZ p_pszPackage)
     2147    {
     2148    Message msg;
     2149    USHORT rc = NO_ERROR;
     2150    if (strlen(p_pszPackage) < MAXPCKNAMELENGTH)
     2151        strcpy(this->_szPackage, p_pszPackage);
     2152    else
     2153        {
     2154        msg.SetType(MSG_TYPE_ERROR);
     2155        msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_PACKAGE_STRTOOLONG);
     2156        msg.SetMessageText(p_pszPackage);
     2157        _messageLogger.LogMessage(msg);
     2158        rc = STRING_TOO_LONG;
     2159        }
     2160    return rc;
     2161    }
     2162
     2163
     2164/*
     2165 *@@SetMajor
    16082166 *  This function sets major number.
    16092167 */
    1610 void ScriptRequires::SetMajor(USHORT usMajor)
    1611     {
    1612     this->usMajor = usMajor;
    1613     }
    1614 
    1615 
    1616 
    1617 /****************************************************************************
    1618  *@@ScriptRequires::SetMinor
     2168USHORT ScriptRequires::SetMajor(USHORT p_usMajor)
     2169    {
     2170    this->_usMajor = p_usMajor;
     2171    return NO_ERROR;
     2172    }
     2173
     2174
     2175/*
     2176 *@@SetMinor:
    16192177 *  This function sets minor number.
    16202178 */
    1621 void ScriptRequires::SetMinor(USHORT usMinor)
    1622     {
    1623     this->usMinor = usMinor;
    1624     }
    1625 
    1626 
    1627 
    1628 /****************************************************************************
    1629  *@@ScriptRequires::SetRevision
     2179USHORT ScriptRequires::SetMinor(USHORT p_usMinor)
     2180    {
     2181    this->_usMinor = p_usMinor;
     2182    return NO_ERROR;
     2183    }
     2184
     2185
     2186/*
     2187 *@@SetRevision:
    16302188 *  This function sets revision number.
    16312189 */
    1632 void ScriptRequires::SetRevision(USHORT usRevision)
    1633     {
    1634     this->usRevision = usRevision;
    1635     }
    1636 
    1637 
    1638 
    1639 /****************************************************************************
    1640  *@@ScriptRequires::SetPckIndex
     2190USHORT ScriptRequires::SetRevision(USHORT p_usRevision)
     2191    {
     2192    this->_usRevision = p_usRevision;
     2193    return NO_ERROR;
     2194    }
     2195
     2196
     2197/*
     2198 *@@SetPckIndex:
    16412199 *  This function sets required package number.
    16422200 */
    1643 void ScriptRequires::SetPckIndex(USHORT usPckIndex)
    1644     {
    1645     this->usPckIndex = usPckIndex;
    1646     }
    1647 
    1648 
    1649 
    1650 
    1651 /****************************************************************************
    1652  *@@ScriptRequires::SetRequires
     2201USHORT ScriptRequires::SetPckIndex(USHORT p_usPckIndex)
     2202    {
     2203    this->_usPckIndex = p_usPckIndex;
     2204    return NO_ERROR;
     2205    }
     2206
     2207
     2208/*
     2209 *@@SetRequires:
    16532210 *  This function sets all datas.
    16542211 */
    1655 void ScriptRequires::SetRequires(REQUIRESDATA requiresData)
    1656     {
    1657     if (strlen(requiresData.szVendor) < MAXVENDORNAMELENGTH);
    1658         strcpy(this->szVendor, requiresData.szVendor);
    1659     if (strlen(requiresData.szApplication) < MAXAPPNAMELENGTH);
    1660         strcpy(this->szApplication, requiresData.szApplication);
    1661     if (strlen(requiresData.szPackage) < MAXPCKNAMELENGTH);
    1662         strcpy(this->szPackage, requiresData.szPackage);
    1663     this->usMajor = requiresData.usMajor;
    1664     this->usMinor = requiresData.usMinor;
    1665     this->usRevision = requiresData.usRevision;
    1666     }
    1667 
    1668 
    1669 
    1670 /***************************************************************************
    1671  *@@ ScriptRequires::SetIndex
    1672  *  Sets object's index.
    1673  */
    1674 void ScriptRequires::SetIndex(USHORT usIndex)
    1675     {
    1676     this->usIndex = usIndex;
    1677     }
    1678 
    1679 
    1680 
    1681 /***************************************************************************
    1682  *@@ ScriptRequires::ReturnVendor
     2212USHORT ScriptRequires::SetRequires(REQUIRESDATA p_requiresData)
     2213    {
     2214    USHORT rc = NO_ERROR;
     2215
     2216    if (SetVendor(p_requiresData.szVendor) != NO_ERROR)
     2217        rc = STRING_TOO_LONG;
     2218    if (SetApplication(p_requiresData.szApplication) != NO_ERROR)
     2219        rc = STRING_TOO_LONG;
     2220    if (SetPackage(p_requiresData.szPackage) != NO_ERROR)
     2221        rc = STRING_TOO_LONG;
     2222    SetMajor(p_requiresData.usMajor);
     2223    SetMinor(p_requiresData.usMinor);
     2224    SetRevision(p_requiresData.usRevision);
     2225
     2226    return rc;
     2227    }
     2228
     2229
     2230/*
     2231 *@@ReturnVendor:
    16832232 *  Returns const pointer to vendor text.
    16842233 */
    16852234const PSZ ScriptRequires::ReturnVendor()
    16862235    {
    1687     return szVendor;
    1688     }
    1689 
    1690 
    1691 
    1692 /***************************************************************************
    1693  *@@ ScriptRequires::ReturnApplication
     2236    return _szVendor;
     2237    }
     2238
     2239
     2240/*
     2241 *@@ReturnApplication:
    16942242 *  Returns const pointer to application text.
    16952243 */
    16962244const PSZ ScriptRequires::ReturnApplication()
    16972245    {
    1698     return szApplication;
    1699     }
    1700 
    1701 
    1702 
    1703 /***************************************************************************
    1704  *@@ ScriptRequires::ReturnPackage
     2246    return _szApplication;
     2247    }
     2248
     2249
     2250/*
     2251 *@@ReturnPackage:
    17052252 *  Returns const pointer to package text.
    17062253 */
    17072254const PSZ ScriptRequires::ReturnPackage()
    17082255    {
    1709     return szPackage;
    1710     }
    1711 
    1712 
    1713 
    1714 /***************************************************************************
    1715  *@@ ScriptRequires::ReturnMajor
     2256    return _szPackage;
     2257    }
     2258
     2259
     2260/*
     2261 *@@ReturnMajor:
    17162262 *  Returns major number.
    17172263 */
    17182264USHORT ScriptRequires::ReturnMajor()
    17192265    {
    1720     return usMajor;
    1721     }
    1722 
    1723 
    1724 
    1725 
    1726 /***************************************************************************
    1727  *@@ ScriptRequires::ReturnMinor
     2266    return _usMajor;
     2267    }
     2268
     2269
     2270/*
     2271 *@@ReturnMinor:
    17282272 *  Returns minor number.
    17292273 */
    17302274USHORT ScriptRequires::ReturnMinor()
    17312275    {
    1732     return usMinor;
    1733     }
    1734 
    1735 
    1736 
    1737 /***************************************************************************
    1738  *@@ ScriptRequires::ReturnRevision
     2276    return _usMinor;
     2277    }
     2278
     2279
     2280/*
     2281 *@@ReturnRevision:
    17392282 *  Returns revision number.
    17402283 */
    17412284USHORT ScriptRequires::ReturnRevision()
    17422285    {
    1743     return usRevision;
    1744     }
    1745 
    1746 
    1747 
    1748 /***************************************************************************
     2286    return _usRevision;
     2287    }
     2288
     2289
     2290/*
    17492291 *@@ ScriptRequires::ReturnPckIndex
    17502292 *  Returns revision number.
     
    17522294USHORT ScriptRequires::ReturnPckIndex()
    17532295    {
    1754     return usPckIndex;
    1755     }
    1756 
    1757 
    1758 
    1759 
    1760 /****************************************************************************
    1761  *@@ScriptRequires::ReturnRequires
     2296    return _usPckIndex;
     2297    }
     2298
     2299
     2300/*
     2301 *@@ReturnRequires:
    17622302 *  This function returns all datas.
    17632303 */
     
    17652305    {
    17662306    REQUIRESDATA requiresData;
    1767     strcpy(requiresData.szVendor, this->szVendor);
    1768     strcpy(requiresData.szApplication, this->szApplication);
    1769     strcpy(requiresData.szPackage, this->szPackage);
    1770     requiresData.usMajor = this->usMajor;
    1771     requiresData.usMinor = this->usMinor;
    1772     requiresData.usRevision = this->usRevision;
     2307    strcpy(requiresData.szVendor, this->_szVendor);
     2308    strcpy(requiresData.szApplication, this->_szApplication);
     2309    strcpy(requiresData.szPackage, this->_szPackage);
     2310    requiresData.usMajor = this->_usMajor;
     2311    requiresData.usMinor = this->_usMinor;
     2312    requiresData.usRevision = this->_usRevision;
    17732313    return requiresData;
    17742314    }
    17752315
    17762316
    1777 
    1778 /***************************************************************************
    1779  *@@ ScriptRequires::ReturnIndex
    1780  *  Returns index of current object.
    1781  */
    1782 USHORT ScriptRequires::ReturnIndex()
    1783     {
    1784     return usIndex;
    1785     }
    1786 
    1787 
    1788 
    1789 /***************************************************************************
    1790  *@@ ScriptRequires::MakeScriptText
     2317/*
     2318 *@@MakeScriptText:
    17912319 *  Returns pointer to script text.
    17922320 */
    1793 PSZ ScriptRequires::MakeScriptText(BOOL bAttribute)
     2321PSZ ScriptRequires::MakeScriptText(BOOL p_bAttribute)
    17942322    {
    17952323    ULONG ulTextLength = 0;
    17962324    PSZ pszScriptText = NULL;
    17972325
    1798     ulTextLength = strlen(szVendor) + strlen(szApplication) +
    1799                     strlen(szPackage);
    1800     ulTextLength += LtoALength(usMajor) + LtoALength(usMinor) +
    1801                     LtoALength(usRevision);
     2326    ulTextLength = strlen(_szVendor) + strlen(_szApplication) +
     2327                    strlen(_szPackage);
     2328    ulTextLength += LtoALength(_usMajor) + LtoALength(_usMinor) +
     2329                    LtoALength(_usRevision);
    18022330    ulTextLength += 5;
    18032331
    1804     if (bAttribute)
    1805         ulTextLength += strlen("REQUIRES") + 3;
     2332    if (p_bAttribute)
     2333        ulTextLength += strlen(SZ_ATTRIBUTE_REQUIRES) + 3;
    18062334
    18072335    pszScriptText = new CHAR[ulTextLength + 1];
    18082336    *pszScriptText = '\0';
    18092337
    1810     if (bAttribute)
     2338    if (p_bAttribute)
    18112339        sprintf(pszScriptText, "%s=\"%s\\%s\\%s\\%i\\%i\\%i\"",
    1812             SZ_ATTRIBUTE_REQUIRES, szVendor, szApplication, szPackage,
    1813             usMajor, usMinor, usRevision);
     2340            SZ_ATTRIBUTE_REQUIRES, _szVendor, _szApplication, _szPackage,
     2341            _usMajor, _usMinor, _usRevision);
    18142342    else
    18152343        sprintf(pszScriptText, "%s\\%s\\%s\\%i\\%i\\%i",
    1816             szVendor, szApplication, szPackage, usMajor, usMinor,
    1817             usRevision);
     2344            _szVendor, _szApplication, _szPackage, _usMajor, _usMinor,
     2345            _usRevision);
    18182346    return pszScriptText;
    18192347    }
     
    18212349
    18222350
    1823 /***************************************************************************
    1824  *@@ScriptRequires:: BuildFromText
     2351/*
     2352 *@@BuildFromText:
    18252353 *  Builds requires accordingly to script text. If any errors is found in script
    1826  *  text, error informations are returned in table where to *pScriptError
    1827  *  points. Pointer to after end of tag is returned so multiple searches can be
    1828  *  done.
    1829  */
    1830 PSZ ScriptRequires::BuildFromText(PSZ pszScriptText,
    1831                                   SCRIPTERROR **ppScriptError,
    1832                                   USHORT *pusErrorTableSize,
    1833                                   ULONG ulLineNumber)
    1834     {
    1835     SCRIPTERROR Error;
     2354 *  text, NULL is returned otherwice pointer to after end of tag is returned so
     2355 *  multiple searches can be done.
     2356 */
     2357PSZ ScriptRequires::BuildFromText(PSZ p_pszScriptText,
     2358                                  ULONG p_ulLineNumber)
     2359    {
     2360    Message msg;
    18362361    PSZ pszTemp = NULL, pszTemp2 = NULL, pszTemp3 = NULL;
    18372362    PSZ pszAttr = NULL;
     
    18412366    ULONG ulAttrLen = 0;
    18422367
    1843     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_REQUIRES, &ulOffset);
     2368    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_REQUIRES, &ulOffset);
    18442369
    18452370    if (!pszAttr)
    18462371        {
    1847         Error.usErrorCode = ERR_PARSE_REQUIRES_NOTFOUND;
    1848         Error.ulLineNumber = ulLineNumber;
    1849         Error.pszStart = strhdup(pszScriptText);
    1850         Error.ulLength = 0;
    1851         if (ppScriptError)
    1852             *pusErrorTableSize =
    1853                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     2372        msg.SetType(MSG_TYPE_INFO);
     2373        msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_NOTFOUND);
     2374        msg.SetLineNumber(p_ulLineNumber);
     2375        _messageLogger.LogMessage(msg);
    18542376        return NULL;
    18552377        }
     
    18692391            this->SetApplication(pszTemp3);
    18702392            delete [] pszTemp3;
    1871             pszTemp2 = ++pszTemp;
     2393            pszTemp2 =  ++pszTemp;
    18722394            pszTemp = strchr(pszTemp, '\\');
    18732395            if (pszTemp) // Set package
     
    18882410                    if (pszTemp) // Set minor and revision
    18892411                        {
    1890                         pszTemp3 = strhSubstr(pszTemp2, pszTemp);
    1891                         sscanf(pszTemp3, "%d", &ulVersion);
    1892                         this->SetMinor((USHORT)ulVersion);
    1893                         delete [] pszTemp3;
    1894                         pszTemp2 = ++pszTemp;
     2412                        if (pszTemp3 = strhSubstr(pszTemp2, pszTemp))
     2413                            {
     2414                            sscanf(pszTemp3, "%d", &ulVersion);
     2415                            this->SetMinor((USHORT)ulVersion);
     2416                            delete [] pszTemp3;
     2417                            pszTemp2 = ++pszTemp;
     2418                            }
     2419                        else
     2420                            {
     2421                            msg.SetType(MSG_TYPE_ERROR);
     2422                            msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_MINOR_NOTFOUND);
     2423                            msg.SetLineNumber(p_ulLineNumber);
     2424                            _messageLogger.LogMessage(msg);
     2425                            bError = TRUE;
     2426                            }
    18952427
    18962428                        // Set revision
    18972429                        if (strlen(pszTemp) == 0) // There is \\ but no value.
     2430                            {
     2431                            msg.SetType(MSG_TYPE_INFO);
     2432                            msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_REV_NOTFOUND);
     2433                            msg.SetLineNumber(p_ulLineNumber);
     2434                            _messageLogger.LogMessage(msg);
    18982435                            this->SetRevision(0);
     2436                            }
    18992437                        else
    19002438                            {
     
    19072445                    else // Minor and revision
    19082446                        {
    1909                         pszTemp3 = strhSubstr(pszTemp2, pszTemp2 + strlen(pszTemp2));
    1910                         sscanf(pszTemp3, "%d", &ulVersion);
    1911                         this->SetMinor((USHORT)ulVersion);
    1912                         delete [] pszTemp3;
    1913                         this->SetRevision(0);
     2447                        if (pszTemp3 =
     2448                            strhSubstr(pszTemp2, pszTemp2 + strlen(pszTemp2)))
     2449                            {
     2450                            sscanf(pszTemp3, "%d", &ulVersion);
     2451                            this->SetMinor((USHORT)ulVersion);
     2452                            delete [] pszTemp3;
     2453                            this->SetRevision(0);
     2454                            }
     2455                        else
     2456                            {
     2457                            msg.SetType(MSG_TYPE_ERROR);
     2458                            msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_MINOR_NOTFOUND);
     2459                            msg.SetLineNumber(p_ulLineNumber);
     2460                            _messageLogger.LogMessage(msg);
     2461                            bError = TRUE;
     2462                            }
    19142463                        }
    19152464                    }
    19162465                else // Major error
    19172466                    {
    1918                     Error.usErrorCode = ERR_PARSE_REQUIRES_MAJOR_NOTFOUND;
    1919                     Error.ulLineNumber = ulLineNumber;
    1920                     Error.pszStart = strhdup(pszAttr);
    1921                     Error.ulLength = 0;
    1922                     if (ppScriptError)
    1923                         *pusErrorTableSize =
    1924                             AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     2467                    msg.SetType(MSG_TYPE_ERROR);
     2468                    msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_MAJOR_NOTFOUND);
     2469                    msg.SetLineNumber(p_ulLineNumber);
     2470                    _messageLogger.LogMessage(msg);
    19252471                    bError = TRUE;
    19262472                    }
     
    19282474            else // Package error
    19292475                {
    1930                 Error.usErrorCode = ERR_PARSE_REQUIRES_PACKAGE_NOTFOUND;
    1931                 Error.ulLineNumber = ulLineNumber;
    1932                 Error.pszStart = strhdup(pszAttr);
    1933                 Error.ulLength = 0;
    1934                 if (ppScriptError)
    1935                     *pusErrorTableSize =
    1936                         AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     2476                msg.SetType(MSG_TYPE_ERROR);
     2477                msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_PACKAGE_NOTFOUND);
     2478                msg.SetLineNumber(p_ulLineNumber);
     2479                _messageLogger.LogMessage(msg);
    19372480                bError = TRUE;
    19382481                }
     
    19402483        else // Application error
    19412484            {
    1942             Error.usErrorCode = ERR_PARSE_REQUIRES_APP_NOTFOUND;
    1943             Error.ulLineNumber = ulLineNumber;
    1944             Error.pszStart = strhdup(pszAttr);
    1945             Error.ulLength = 0;
    1946             if (ppScriptError)
    1947                 *pusErrorTableSize =
    1948                     AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     2485            msg.SetType(MSG_TYPE_ERROR);
     2486            msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_APPL_NOTFOUND);
     2487            msg.SetLineNumber(p_ulLineNumber);
     2488            _messageLogger.LogMessage(msg);
    19492489            bError = TRUE;
    19502490            }
     
    19522492    else // Vendor error
    19532493        {
    1954         Error.usErrorCode = ERR_PARSE_REQUIRES_VENDOR_NOTFOUND;
    1955         Error.ulLineNumber = ulLineNumber;
    1956         Error.pszStart = strhdup(pszAttr);
    1957         Error.ulLength = 0;
    1958         if (ppScriptError)
    1959             *pusErrorTableSize =
    1960                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     2494        msg.SetType(MSG_TYPE_ERROR);
     2495        msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_VENDOR_NOTFOUND);
     2496        msg.SetLineNumber(p_ulLineNumber);
     2497        _messageLogger.LogMessage(msg);
    19612498        bError = TRUE;
    19622499        }
     
    19662503    ulAttrLen = strlen(pszAttr);
    19672504    delete [] pszAttr;
    1968     return pszScriptText + ulOffset + ulAttrLen + 1;
     2505    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    19692506    }
    19702507
     
    19752512/****************************************************************************
    19762513 ****************************************************************************
    1977         ScriptConfigSys class:
    1978 
    1979  ****************************************************************************
    1980  *  ScriptConfigSys class member functions:
    1981  *  ScriptConfigSys Constructor.
    1982  *  ~ScriptConfigSys Destructor.
    1983  *  SetStatement    Sets statement text.
    1984  *  SetUnique       Sets unique modifier state.
    1985  *  SetAddRight     Sets addright state.
    1986  *  SetAddLeft      Sets addleft state.
    1987  *  SetAddAfter     Sets addafter state.
    1988  *  SetAddBefore    Sets addbefore state.
    1989  *  SetRemoveLine   Sets removeline state.
    1990  *  SetRemovePart   Sets removepart state.
    1991  *  SetSearchString Sets search string.
    1992  *  SetConfigSys    Sets all fields.
    1993  *  SetIndex        Sets index number.
    1994  *  ReturnStatement Returns const pointer to statement string.
    1995  *  ReturnUnique    Returns state of unique modifier.
    1996  *  ReturnAddRight  Returns state of addright modifier.
    1997  *  ReturnAddLeft   Returns addleft modifier state.
    1998  *  ReturnAddAfter  Returns addafter state.
    1999  *  ReturnAddBefore Returns addbefore state.
    2000  *  ReturnRemoveLine Returns removeline state.
    2001  *  ReturnRemovePart Returns removepart state.
    2002  *  ReturnSearchString Returns const pointer to search string.
    2003  *  ReturnIndex     Returns index number.
    2004  *  MakeScriptText  Returns pointer to script text.
    2005  *  BuildFromText   Builds object from text.
     2514        @@ScriptConfigSys class:
     2515
     2516    <B>Description:</B>
     2517        This class is for CONFIGSYS attributes in PCK tag. Detailed
     2518        information about the meaning of the attribute can be found
     2519        from <I>WarpIN Programmer's Guide and Reference</I>.
     2520
     2521
     2522    Member functions:
     2523        ScriptConfigSys Constructor.
     2524        ~ScriptConfigSys Destructor.
     2525        SetStatement    Sets statement text.
     2526        SetUnique       Sets unique modifier state.
     2527        SetAddRight     Sets addright state.
     2528        SetAddLeft      Sets addleft state.
     2529        SetAddAfter     Sets addafter state.
     2530        SetAddBefore    Sets addbefore state.
     2531        SetRemoveLine   Sets removeline state.
     2532        SetRemovePart   Sets removepart state.
     2533        SetSearchString Sets search string.
     2534        SetConfigSys    Sets all fields.
     2535        ReturnStatement Returns const pointer to statement string.
     2536        ReturnUnique    Returns state of unique modifier.
     2537        ReturnAddRight  Returns state of addright modifier.
     2538        ReturnAddLeft   Returns addleft modifier state.
     2539        ReturnAddAfter  Returns addafter state.
     2540        ReturnAddBefore Returns addbefore state.
     2541        ReturnRemoveLine Returns removeline state.
     2542        ReturnRemovePart Returns removepart state.
     2543        ReturnSearchString Returns const pointer to search string.
     2544        MakeScriptText  Returns pointer to script text.
     2545        BuildFromText   Builds object from text.
    20062546 ***************************************************************************/
    20072547
    20082548
    2009 /***************************************************************************
    2010  *@@ ScriptConfigSys::ScriptConfigSys
     2549/*
     2550 *@@ScriptConfigSys:
    20112551 *  Constructor for ScriptConfigSys class. Initializes object by setting
    20122552 *  fields to zero.
    20132553 */
    2014 ScriptConfigSys::ScriptConfigSys(USHORT usIndex)
    2015     {
    2016     this->usIndex = usIndex;
    2017     *szStatement = '\0';
    2018     *szSearchString = '\0';
    2019     bUnique = FALSE;
    2020     bAddRight = FALSE;
    2021     bAddLeft = FALSE;
    2022     bAddRight = FALSE;
    2023     bAddTop = FALSE;
    2024     bAddAfter = FALSE;
    2025     bAddBefore = FALSE;
    2026     bRemoveLine = FALSE;
    2027     bRemovePart = FALSE;
    2028     }
    2029 
    2030 
    2031 
    2032 /***************************************************************************
    2033  *@@ ScriptConfigSys::~ScriptConfigSys
     2554ScriptConfigSys::ScriptConfigSys(USHORT p_usIndex)
     2555    {
     2556    SetIndex(p_usIndex);
     2557    *_szStatement = '\0';
     2558    *_szSearchString = '\0';
     2559    _bUnique = FALSE;
     2560    _bAddRight = FALSE;
     2561    _bAddLeft = FALSE;
     2562    _bAddRight = FALSE;
     2563    _bAddTop = FALSE;
     2564    _bAddAfter = FALSE;
     2565    _bAddBefore = FALSE;
     2566    _bRemoveLine = FALSE;
     2567    _bRemovePart = FALSE;
     2568    }
     2569
     2570
     2571/*
     2572 *@@~ScriptConfigSys:
    20342573 *  Destructor for ScriptConfigSys class.
    20352574 */
    20362575ScriptConfigSys::~ScriptConfigSys()
    20372576    {
    2038     }
    2039 
    2040 
    2041 
    2042 
    2043 /****************************************************************************
    2044  *@@ScriptConfigSys::SetStatement
     2577    *_szStatement = '\0';
     2578    *_szSearchString = '\0';
     2579    _bUnique = FALSE;
     2580    _bAddRight = FALSE;
     2581    _bAddLeft = FALSE;
     2582    _bAddRight = FALSE;
     2583    _bAddTop = FALSE;
     2584    _bAddAfter = FALSE;
     2585    _bAddBefore = FALSE;
     2586    _bRemoveLine = FALSE;
     2587    _bRemovePart = FALSE;
     2588    }
     2589
     2590
     2591/*
     2592 *@@~SetStatement:
    20452593 *  This function sets statement string.
    20462594 */
    2047 void ScriptConfigSys::SetStatement(const PSZ pszStatement)
    2048     {
    2049     if (strlen(szStatement) < MAXSTATEMENTLENGTH)
    2050         strcpy(this->szStatement, pszStatement);
    2051     }
    2052 
    2053 
    2054 
    2055 /****************************************************************************
    2056  *@@ScriptConfigSys::SetUnique
     2595USHORT ScriptConfigSys::SetStatement(const PSZ p_pszStatement)
     2596    {
     2597    Message msg;
     2598    USHORT rc = NO_ERROR;
     2599    if (strlen(p_pszStatement) < MAXSTATEMENTLENGTH)
     2600        strcpy(this->_szStatement, p_pszStatement);
     2601    else
     2602        {
     2603        msg.SetType(MSG_TYPE_ERROR);
     2604        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_STATEMENT_STRTOOLONG);
     2605        msg.SetMessageText(p_pszStatement);
     2606        _messageLogger.LogMessage(msg);
     2607        rc = STRING_TOO_LONG;
     2608        }
     2609    return rc;
     2610    }
     2611
     2612
     2613/*
     2614 *@@SetUnique:
    20572615 *  This function sets unique state. Returns error code if error occurred.
    2058  *  Error codes:
    20592616 *
    2060  */
    2061 USHORT ScriptConfigSys::SetUnique(BOOL bUnique)
    2062     {
     2617 *  <B>Return codes:</B>
     2618 *      ERR_CONFIGSYS_ADDRIGHT_SETTED:      ADDRIGHT modifier cannot
     2619 *                                          be used with UNIQUE.
     2620 *      ERR_CONFIGSYS_ADDLEFT_SETTED:       ADDLEFT modifier cannot
     2621 *                                          be used with UNIQUE.
     2622 *      ERR_CONFIGSYS_REMOVELINE_SETTED:    REMOVELINE modifier cannot
     2623 *                                          be used with UNIQUE.
     2624 *      ERR_CONFIGSYS_REMOVEPART_SETTED:    REMOVEPART modifier cannot
     2625 *                                          be used with UNOQUE.
     2626 *      The codes can be ORed with each others.
     2627 */
     2628USHORT ScriptConfigSys::SetUnique(BOOL p_bUnique)
     2629    {
     2630    Message msg;
     2631    BSString string = SZ_MODIFIER_UNIQUE;
     2632    string += "|";
    20632633    USHORT usRc = NO_ERROR;
    2064     if (bUnique)
    2065         {
    2066         if (bAddRight)
     2634    if (p_bUnique)
     2635        {
     2636        if (_bAddRight)
     2637            {
    20672638            usRc |= ERR_CONFIGSYS_ADDRIGHT_SETTED;
    2068         if (bAddLeft)
     2639            string += SZ_MODIFIER_ADDRIGHT;
     2640            string += "|";
     2641            }
     2642        if (_bAddLeft)
     2643            {
    20692644            usRc |= ERR_CONFIGSYS_ADDLEFT_SETTED;
    2070         if (bRemoveLine)
     2645            string += SZ_MODIFIER_ADDLEFT;
     2646            string += "|";
     2647            }
     2648        if (_bRemoveLine)
     2649            {
    20712650            usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED;
    2072         if (bRemovePart)
     2651            string += SZ_MODIFIER_REMOVELINE;
     2652            string += "|";
     2653            }
     2654        if (_bRemovePart)
     2655            {
    20732656            usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED;
     2657            string += SZ_MODIFIER_REMOVEPART;
     2658            }
    20742659        }
    20752660    if (usRc)
     2661        {
     2662        msg.SetType(MSG_TYPE_ERROR);
     2663        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     2664        msg.SetMessageText(string);
     2665        _messageLogger.LogMessage(msg);
    20762666        return usRc;
    2077 
    2078     this->bUnique = bUnique;
     2667        }
     2668
     2669    this->_bUnique = p_bUnique;
    20792670
    20802671    return usRc;
     
    20822673
    20832674
    2084 
    2085 
    2086 /****************************************************************************
    2087  *@@ScriptConfigSys::SetAddRight
     2675/*
     2676 *@@SetAddRight:
    20882677 *  This function sets addright state. Returns error code if error occurred.
    20892678 *
    20902679 */
    2091 USHORT ScriptConfigSys::SetAddRight(BOOL bAddRight)
    2092     {
     2680USHORT ScriptConfigSys::SetAddRight(BOOL p_bAddRight)
     2681    {
     2682    Message msg;
     2683    BSString string = SZ_MODIFIER_ADDRIGHT;
     2684    string += "|";
    20932685    USHORT usRc = NO_ERROR;
    2094     if (bAddRight)
    2095         {
    2096         if (bUnique)
     2686    if (p_bAddRight)
     2687        {
     2688        if (_bUnique)
     2689            {
    20972690            usRc |= ERR_CONFIGSYS_UNIQUE_SETTED;
    2098         if (bAddLeft)
     2691            string += SZ_MODIFIER_UNIQUE;
     2692            string += "|";
     2693            }
     2694        if (_bAddLeft)
     2695            {
    20992696            usRc |= ERR_CONFIGSYS_ADDLEFT_SETTED;
    2100         if (bRemoveLine)
     2697            string += SZ_MODIFIER_ADDLEFT;
     2698            string += "|";
     2699            }
     2700        if (_bRemoveLine)
     2701            {
    21012702            usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED;
    2102         if (bRemovePart)
     2703            string += SZ_MODIFIER_REMOVELINE;
     2704            string += "|";
     2705            }
     2706        if (_bRemovePart)
     2707            {
    21032708            usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED;
     2709            string += SZ_MODIFIER_REMOVEPART;
     2710            string += "|";
     2711            }
    21042712        }
    21052713    if (usRc)
     2714        {
     2715        msg.SetType(MSG_TYPE_ERROR);
     2716        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     2717        msg.SetMessageText(string);
     2718        _messageLogger.LogMessage(msg);
    21062719        return usRc;
    2107 
    2108     this->bAddRight = bAddRight;
     2720        }
     2721
     2722    this->_bAddRight = p_bAddRight;
    21092723
    21102724    return usRc;
     
    21122726
    21132727
    2114 
    2115 
    2116 
    2117 /****************************************************************************
    2118  *@@ScriptConfigSys::SetAddLeft
     2728/*
     2729 *@@SetAddLeft:
    21192730 *  This function sets addleft state. Returns error code if error occurred.
    2120  *
    2121  */
    2122 USHORT ScriptConfigSys::SetAddLeft(BOOL bAddLeft)
    2123     {
     2731 */
     2732USHORT ScriptConfigSys::SetAddLeft(BOOL p_bAddLeft)
     2733    {
     2734    Message msg;
     2735    BSString string = SZ_MODIFIER_ADDLEFT;
     2736    string += "|";
    21242737    USHORT usRc = NO_ERROR;
    2125     if (bAddLeft)
    2126         {
    2127         if (bUnique)
     2738    if (p_bAddLeft)
     2739        {
     2740        if (_bUnique)
     2741            {
    21282742            usRc |= ERR_CONFIGSYS_UNIQUE_SETTED;
    2129         if (bAddRight)
     2743            string += SZ_MODIFIER_UNIQUE;
     2744            string += "|";
     2745            }
     2746        if (_bAddRight)
     2747            {
    21302748            usRc |= ERR_CONFIGSYS_ADDRIGHT_SETTED;
    2131         if (bRemoveLine)
     2749            string += SZ_MODIFIER_ADDRIGHT;
     2750            string += "|";
     2751            }
     2752        if (_bRemoveLine)
     2753            {
    21322754            usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED;
    2133         if (bRemovePart)
     2755            string += SZ_MODIFIER_REMOVELINE;
     2756            string += "|";
     2757            }
     2758        if (_bRemovePart)
     2759            {
    21342760            usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED;
     2761            string += SZ_MODIFIER_REMOVEPART;
     2762            string += "|";
     2763            }
    21352764        }
    21362765    if (usRc)
     2766        {
     2767        msg.SetType(MSG_TYPE_ERROR);
     2768        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     2769        msg.SetMessageText(string);
     2770        _messageLogger.LogMessage(msg);
    21372771        return usRc;
    2138 
    2139     this->bAddLeft = bAddLeft;
     2772        }
     2773
     2774    this->_bAddLeft = p_bAddLeft;
    21402775
    21412776    return usRc;
    21422777    }
    21432778
    2144 
    2145 
    2146 /****************************************************************************
    2147  *@@ScriptConfigSys::SetAddAfter
     2779/*
     2780 *@@SetAddAfter:
    21482781 *  This function sets addafter state. Returns error code if error occurred.
    2149  *
    2150  */
    2151 USHORT ScriptConfigSys::SetAddAfter(BOOL bAddAfter)
    2152     {
     2782 */
     2783USHORT ScriptConfigSys::SetAddAfter(BOOL p_bAddAfter)
     2784    {
     2785    Message msg;
     2786    BSString string = SZ_MODIFIER_ADDAFTER;
     2787    string += "|";
    21532788    USHORT usRc = NO_ERROR;
    2154     if (bAddAfter)
    2155         {
    2156         if (bRemoveLine)
     2789    if (p_bAddAfter)
     2790        {
     2791        if (_bRemoveLine)
     2792            {
    21572793            usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED;
    2158         if (bRemovePart)
     2794            string += SZ_MODIFIER_REMOVELINE;
     2795            string += "|";
     2796            }
     2797        if (_bRemovePart)
     2798            {
    21592799            usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED;
     2800            string += SZ_MODIFIER_REMOVEPART;
     2801            string += "|";
     2802            }
    21602803        }
    21612804    if (usRc)
     2805        {
     2806        msg.SetType(MSG_TYPE_ERROR);
     2807        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     2808        msg.SetMessageText(string);
     2809        _messageLogger.LogMessage(msg);
    21622810        return usRc;
    2163 
    2164     this->bAddAfter = bAddAfter;
     2811        }
     2812
     2813    this->_bAddAfter = p_bAddAfter;
    21652814
    21662815    return usRc;
     
    21682817
    21692818
    2170 
    2171 
    2172 /****************************************************************************
    2173  *@@ScriptConfigSys::SetAddTop
     2819/*
     2820 *@@SetAddTop:
    21742821 *  This function sets addtop state. Returns error code if error occurred.
    21752822 *
    21762823 */
    2177 USHORT ScriptConfigSys::SetAddTop(BOOL bAddTop)
    2178     {
     2824USHORT ScriptConfigSys::SetAddTop(BOOL p_bAddTop)
     2825    {
     2826    Message msg;
     2827    BSString string = SZ_MODIFIER_ADDTOP;
     2828    string += "|";
    21792829    USHORT usRc = NO_ERROR;
    2180     if (bAddTop)
    2181         {
    2182         if (bRemoveLine)
     2830    if (p_bAddTop)
     2831        {
     2832        if (_bRemoveLine)
     2833            {
    21832834            usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED;
    2184         if (bRemovePart)
     2835            string += SZ_MODIFIER_REMOVELINE;
     2836            string += "|";
     2837            }
     2838        if (_bRemovePart)
     2839            {
    21852840            usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED;
     2841            string += SZ_MODIFIER_REMOVEPART;
     2842            string += "|";
     2843            }
    21862844        }
    21872845    if (usRc)
     2846        {
     2847        msg.SetType(MSG_TYPE_ERROR);
     2848        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     2849        msg.SetMessageText(string);
     2850        _messageLogger.LogMessage(msg);
    21882851        return usRc;
    2189 
    2190     this->bAddTop = bAddTop;
     2852        }
     2853
     2854    this->_bAddTop = p_bAddTop;
    21912855
    21922856    return usRc;
     
    21942858
    21952859
    2196 
    2197 
    2198 /****************************************************************************
    2199  *@@ScriptConfigSys::SetAddBefore
     2860/*
     2861 *@@SetAddBefore:
    22002862 *  This function sets addbefore state. Returns error code if error occurred.
    2201  *
    2202  */
    2203 USHORT ScriptConfigSys::SetAddBefore(BOOL bAddBefore)
    2204     {
     2863 */
     2864USHORT ScriptConfigSys::SetAddBefore(BOOL p_bAddBefore)
     2865    {
     2866    Message msg;
     2867    BSString string = SZ_MODIFIER_ADDBEFORE;
     2868    string += "|";
    22052869    USHORT usRc = NO_ERROR;
    2206     if (bAddBefore)
    2207         {
    2208         if (bRemoveLine)
     2870    if (p_bAddBefore)
     2871        {
     2872        if (_bRemoveLine)
     2873            {
    22092874            usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED;
    2210         if (bRemovePart)
     2875            string += SZ_MODIFIER_REMOVELINE;
     2876            string += "|";
     2877            }
     2878        if (_bRemovePart)
     2879            {
    22112880            usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED;
     2881            string += SZ_MODIFIER_REMOVEPART;
     2882            string += "|";
     2883            }
    22122884        }
    22132885    if (usRc)
     2886        {
     2887        msg.SetType(MSG_TYPE_ERROR);
     2888        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     2889        msg.SetMessageText(string);
     2890        _messageLogger.LogMessage(msg);
    22142891        return usRc;
    2215 
    2216     this->bAddBefore = bAddBefore;
     2892        }
     2893
     2894    this->_bAddBefore = p_bAddBefore;
    22172895
    22182896    return usRc;
     
    22202898
    22212899
    2222 
    2223 /****************************************************************************
    2224  *@@ScriptConfigSys::SetRemoveLine
     2900/*
     2901 *@@SetRemoveLine:
    22252902 *  This function sets removeline state. Returns error code if error occurred.
    2226  *
    2227  */
    2228 USHORT ScriptConfigSys::SetRemoveLine(BOOL bRemoveLine)
    2229     {
     2903 */
     2904USHORT ScriptConfigSys::SetRemoveLine(BOOL p_bRemoveLine)
     2905    {
     2906    Message msg;
     2907    BSString string = SZ_MODIFIER_REMOVELINE;
     2908    string += "|";
    22302909    USHORT usRc = NO_ERROR;
    2231     if (bRemoveLine)
    2232         {
    2233         if (bRemovePart)
     2910    if (p_bRemoveLine)
     2911        {
     2912        if (_bRemovePart)
     2913            {
    22342914            usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED;
    2235         if (bUnique)
     2915            string += SZ_MODIFIER_REMOVEPART;
     2916            string += "|";
     2917            }
     2918        if (_bUnique)
     2919            {
    22362920            usRc |= ERR_CONFIGSYS_UNIQUE_SETTED;
    2237         if (bAddRight)
     2921            string += SZ_MODIFIER_UNIQUE;
     2922            string += "|";
     2923            }
     2924        if (_bAddRight)
     2925            {
    22382926            usRc |= ERR_CONFIGSYS_ADDRIGHT_SETTED;
    2239         if (bAddLeft)
     2927            string += SZ_MODIFIER_ADDRIGHT;
     2928            string += "|";
     2929            }
     2930        if (_bAddLeft)
     2931            {
    22402932            usRc |= ERR_CONFIGSYS_ADDLEFT_SETTED;
     2933            string += SZ_MODIFIER_ADDLEFT;
     2934            string += "|";
     2935            }
    22412936        }
    22422937    if (usRc)
     2938        {
     2939        msg.SetType(MSG_TYPE_ERROR);
     2940        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     2941        msg.SetMessageText(string);
     2942        _messageLogger.LogMessage(msg);
    22432943        return usRc;
    2244 
    2245     this->bRemoveLine = bRemoveLine;
     2944        }
     2945
     2946    this->_bRemoveLine = p_bRemoveLine;
    22462947
    22472948    return usRc;
     
    22492950
    22502951
    2251 
    2252 /****************************************************************************
     2952/*
    22532953 *@@ScriptConfigSys::SetRemovePart
    22542954 *  This function sets removepart state. Returns error code if error occurred.
    2255  *
    2256  */
    2257 USHORT ScriptConfigSys::SetRemovePart(BOOL bRemovePart)
    2258     {
     2955 */
     2956USHORT ScriptConfigSys::SetRemovePart(BOOL p_bRemovePart)
     2957    {
     2958    Message msg;
     2959    BSString string = SZ_MODIFIER_REMOVEPART;
     2960    string += "|";
    22592961    USHORT usRc = NO_ERROR;
    2260     if (bRemovePart)
    2261         {
    2262         if (bRemoveLine)
     2962    if (p_bRemovePart)
     2963        {
     2964        if (_bRemoveLine)
     2965            {
    22632966            usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED;
    2264         if (bUnique)
     2967            string += SZ_MODIFIER_REMOVELINE;
     2968            string += "|";
     2969            }
     2970        if (_bUnique)
     2971            {
    22652972            usRc |= ERR_CONFIGSYS_UNIQUE_SETTED;
    2266         if (bAddRight)
     2973            string += SZ_MODIFIER_UNIQUE;
     2974            string += "|";
     2975            }
     2976        if (_bAddRight)
     2977            {
    22672978            usRc |= ERR_CONFIGSYS_ADDRIGHT_SETTED;
    2268         if (bAddLeft)
     2979            string += SZ_MODIFIER_ADDRIGHT;
     2980            string += "|";
     2981            }
     2982        if (_bAddLeft)
     2983            {
    22692984            usRc |= ERR_CONFIGSYS_ADDLEFT_SETTED;
     2985            string += SZ_MODIFIER_ADDLEFT;
     2986            string += "|";
     2987            }
    22702988        }
    22712989    if (usRc)
     2990        {
     2991        msg.SetType(MSG_TYPE_ERROR);
     2992        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     2993        msg.SetMessageText(string);
     2994        _messageLogger.LogMessage(msg);
    22722995        return usRc;
    2273 
    2274     this->bRemovePart = bRemovePart;
     2996        }
     2997
     2998    this->_bRemovePart = p_bRemovePart;
    22752999
    22763000    return usRc;
     
    22783002
    22793003
    2280 
    2281 
    2282 /****************************************************************************
    2283  *@@ScriptConfigSys::SetSearchString
     3004/*
     3005 *@@SetSearchString:
    22843006 *  This function sets search string.
    22853007 */
    2286 void ScriptConfigSys::SetSearchString(const PSZ pszSearchString)
    2287     {
    2288     if (strlen(szSearchString) < MAXSEARCHSTRINGLENGTH)
    2289         strcpy(this->szSearchString, pszSearchString);
    2290     }
    2291 
    2292 
    2293 
    2294 /****************************************************************************
    2295  *@@ScriptConfigSys::SetConfigSys
     3008USHORT ScriptConfigSys::SetSearchString(const PSZ p_pszSearchString)
     3009    {
     3010    Message msg;
     3011    USHORT rc = NO_ERROR;
     3012    if (strlen(p_pszSearchString) < MAXSEARCHSTRINGLENGTH)
     3013        strcpy(this->_szSearchString, p_pszSearchString);
     3014    else
     3015        {
     3016        msg.SetType(MSG_TYPE_ERROR);
     3017        msg.SetMessageValue(MSG_ATTRIBUTE_REQUIRES_PACKAGE_STRTOOLONG);
     3018        msg.SetMessageText(p_pszSearchString);
     3019        _messageLogger.LogMessage(msg);
     3020        rc = STRING_TOO_LONG;
     3021        }
     3022
     3023    return rc;
     3024    }
     3025
     3026
     3027/*
     3028 *@@SetConfigSys:
    22963029 *  This function sets statement string.
    22973030 */
    22983031USHORT ScriptConfigSys::SetConfigSys(CONFIGSYSDATA configSys)
    22993032    {
    2300     if (strlen(szStatement) < MAXSTATEMENTLENGTH)
    2301         strcpy(this->szStatement, configSys.szStatement);
    2302     if (strlen(configSys.szSearchString) < MAXSEARCHSTRINGLENGTH)
    2303         strcpy(this->szSearchString, configSys.szSearchString);
     3033    USHORT rc = NO_ERROR;
     3034
     3035    if (SetStatement(configSys.szStatement) != NO_ERROR)
     3036        rc = STRING_TOO_LONG;
     3037    if (SetSearchString(configSys.szSearchString) != NO_ERROR)
     3038        rc = STRING_TOO_LONG;
    23043039    SetUnique(FALSE);
    23053040    SetAddRight(FALSE);
     
    23273062    if (configSys.usModifiers & MODIFIER_REMOVEPART)
    23283063        SetRemovePart(TRUE);
    2329     return 0;
    2330     }
    2331 
    2332 
    2333 /***************************************************************************
    2334  *@@ ScriptConfigSys::SetIndex
    2335  *  Sets object's index.
    2336  */
    2337 void ScriptConfigSys::SetIndex(USHORT usIndex)
    2338     {
    2339     this->usIndex = usIndex;
    2340     }
    2341 
    2342 
    2343 
    2344 
    2345 /***************************************************************************
    2346  *@@ ScriptConfigSys::ReturnStatement
     3064    return rc;
     3065    }
     3066
     3067
     3068/*
     3069 *@@ReturnStatement:
    23473070 *  Returns const pointer to statement string.
    23483071 */
    23493072const PSZ ScriptConfigSys::ReturnStatement()
    23503073    {
    2351     return szStatement;
    2352     }
    2353 
    2354 
    2355 
    2356 
    2357 /***************************************************************************
    2358  *@@ ScriptConfigSys::ReturnUnique
     3074    return _szStatement;
     3075    }
     3076
     3077
     3078/*
     3079 *@@ReturnUnique:
    23593080 *  Returns the state of the unique modifier.
    23603081 */
    23613082BOOL ScriptConfigSys::ReturnUnique()
    23623083    {
    2363     return bUnique;
    2364     }
    2365 
    2366 
    2367 
    2368 
    2369 /***************************************************************************
    2370  *@@ ScriptConfigSys::ReturnAddRight
     3084    return _bUnique;
     3085    }
     3086
     3087
     3088/*
     3089 *@@ReturnAddRight:
    23713090 *  Returns the state of the addright modifier.
    23723091 */
    23733092BOOL ScriptConfigSys::ReturnAddRight()
    23743093    {
    2375     return bAddRight;
    2376     }
    2377 
    2378 
    2379 
    2380 
    2381 /***************************************************************************
    2382  *@@ ScriptConfigSys::ReturnAddLeft
     3094    return _bAddRight;
     3095    }
     3096
     3097
     3098/*
     3099 *@@ReturnAddLeft:
    23833100 *  Returns the state of the addleft modifier.
    23843101 */
    23853102BOOL ScriptConfigSys::ReturnAddLeft()
    23863103    {
    2387     return bAddLeft;
    2388     }
    2389 
    2390 
    2391 
    2392 /***************************************************************************
    2393  *@@ ScriptConfigSys::ReturnAddAfter
     3104    return _bAddLeft;
     3105    }
     3106
     3107
     3108
     3109/*
     3110 *@@ReturnAddAfter:
    23943111 *  Returns the state of the addafter modifier.
    23953112 */
    23963113BOOL ScriptConfigSys::ReturnAddAfter()
    23973114    {
    2398     return bAddAfter;
    2399     }
    2400 
    2401 
    2402 
    2403 /***************************************************************************
    2404  *@@ ScriptConfigSys::ReturnAddTop
     3115    return _bAddAfter;
     3116    }
     3117
     3118
     3119/*
     3120 *@@ReturnAddTop:
    24053121 *  Returns the state of the addtop modifier.
    24063122 */
    24073123BOOL ScriptConfigSys::ReturnAddTop()
    24083124    {
    2409     return bAddTop;
    2410     }
    2411 
    2412 
    2413 
    2414 
    2415 /***************************************************************************
    2416  *@@ ScriptConfigSys::ReturnAddBefore
     3125    return _bAddTop;
     3126    }
     3127
     3128
     3129/*
     3130 *@@ReturnAddBefore:
    24173131 *  Returns the state of the addbefore modifier.
    24183132 */
    24193133BOOL ScriptConfigSys::ReturnAddBefore()
    24203134    {
    2421     return bAddBefore;
    2422     }
    2423 
    2424 
    2425 
    2426 
    2427 /***************************************************************************
    2428  *@@ ScriptConfigSys::ReturnRemoveLine
     3135    return _bAddBefore;
     3136    }
     3137
     3138
     3139
     3140
     3141/*
     3142 *@@ReturnRemoveLine:
    24293143 *  Returns the state of the removeline modifier.
    24303144 */
    24313145BOOL ScriptConfigSys::ReturnRemoveLine()
    24323146    {
    2433     return bRemoveLine;
    2434     }
    2435 
    2436 
    2437 
    2438 
    2439 /***************************************************************************
    2440  *@@ ScriptConfigSys::ReturnRemovePart
     3147    return _bRemoveLine;
     3148    }
     3149
     3150
     3151
     3152
     3153/*
     3154 *@@ReturnRemovePart:
    24413155 *  Returns the state of the removepart modifier.
    24423156 */
    24433157BOOL ScriptConfigSys::ReturnRemovePart()
    24443158    {
    2445     return bRemovePart;
    2446     }
    2447 
    2448 
    2449 
    2450 /***************************************************************************
    2451  *@@ ScriptConfigSys::ReturnSearchString
     3159    return _bRemovePart;
     3160    }
     3161
     3162
     3163
     3164/*
     3165 *@@ReturnSearchString:
    24523166 *  Returns const pointer to search string string.
    24533167 */
    24543168const PSZ ScriptConfigSys::ReturnSearchString()
    24553169    {
    2456     return szSearchString;
    2457     }
    2458 
    2459 
    2460 
    2461 
    2462 /****************************************************************************
    2463  *@@ScriptConfigSys::ReturnConfigSys
     3170    return _szSearchString;
     3171    }
     3172
     3173
     3174
     3175
     3176/*
     3177 *@@ReturnConfigSys:
    24643178 *  This function returns statement string.
    24653179 */
     
    24673181    {
    24683182    CONFIGSYSDATA configSys;
    2469     strcpy(configSys.szStatement, this->szStatement);
    2470     strcpy(configSys.szSearchString, this->szSearchString);
    2471 
    2472     if (bUnique)
     3183    strcpy(configSys.szStatement, this->_szStatement);
     3184    strcpy(configSys.szSearchString, this->_szSearchString);
     3185
     3186    if (_bUnique)
    24733187        configSys.usModifiers |= MODIFIER_UNIQUE;
    2474     if (bAddRight)
     3188    if (_bAddRight)
    24753189        configSys.usModifiers |= MODIFIER_ADDRIGHT;
    2476     if (bAddLeft)
     3190    if (_bAddLeft)
    24773191        configSys.usModifiers |= MODIFIER_ADDLEFT;
    2478     if (bAddAfter)
     3192    if (_bAddAfter)
    24793193        configSys.usModifiers |= MODIFIER_ADDAFTER;
    2480     if (bAddBefore)
     3194    if (_bAddBefore)
    24813195        configSys.usModifiers |= MODIFIER_ADDBEFORE;
    2482     if (bAddTop)
     3196    if (_bAddTop)
    24833197        configSys.usModifiers |= MODIFIER_ADDTOP;
    2484     if (bRemoveLine)
     3198    if (_bRemoveLine)
    24853199        configSys.usModifiers |= MODIFIER_REMOVELINE;
    2486     if (bRemovePart)
     3200    if (_bRemovePart)
    24873201        configSys.usModifiers |= MODIFIER_REMOVEPART;
     3202
    24883203    return configSys;
    24893204    }
    24903205
    24913206
    2492 
    2493 /***************************************************************************
    2494  *@@ ScriptConfigSys::ReturnIndex
    2495  *  Returns index number.
    2496  */
    2497 USHORT ScriptConfigSys::ReturnIndex()
    2498     {
    2499     return usIndex;
    2500     }
    2501 
    2502 
    2503 
    2504 /***************************************************************************
    2505  *@@ ScriptConfigSys::MakeScriptText
     3207/*
     3208 *@@MakeScriptText:
    25063209 *  Returns pointer to script text.
    25073210 */
    2508 PSZ ScriptConfigSys::MakeScriptText(BOOL bAttribute)
     3211PSZ ScriptConfigSys::MakeScriptText(BOOL p_bAttribute)
    25093212    {
    25103213    ULONG ulTextLength = 0;
    2511     XSTRING strScriptText;
    2512     xstrInit(&strScriptText, 0);
     3214    XSTRING xstrScriptText;
    25133215    PSZ pszFirstModifier = NULL;
    25143216    PSZ pszSecondModifier = NULL;
    25153217    USHORT ulSpaces = 0;
    25163218    CHAR szTemp[1024];
    2517 
    2518     ulTextLength = strlen(szStatement);
    2519 
    2520     if (bUnique)
     3219    xstrInit(&xstrScriptText, 0);
     3220
     3221    ulTextLength = strlen(_szStatement);
     3222
     3223    if (_bUnique)
    25213224        {
    25223225        ulTextLength += strlen(SZ_MODIFIER_UNIQUE);
     
    25243227        pszFirstModifier = SZ_MODIFIER_UNIQUE;
    25253228        }
    2526     if (bAddRight)
     3229    if (_bAddRight)
    25273230        {
    25283231        ulTextLength += strlen(SZ_MODIFIER_ADDRIGHT);
     
    25303233        pszFirstModifier = SZ_MODIFIER_ADDRIGHT;
    25313234        }
    2532     if (bAddLeft)
     3235    if (_bAddLeft)
    25333236        {
    25343237        ulTextLength += strlen(SZ_MODIFIER_ADDLEFT);
     
    25363239        pszFirstModifier = SZ_MODIFIER_ADDLEFT;
    25373240        }
    2538     if (bAddTop)
     3241    if (_bAddTop)
    25393242        {
    25403243        ulTextLength += strlen(SZ_MODIFIER_ADDTOP);
     
    25453248            pszFirstModifier = SZ_MODIFIER_ADDTOP;
    25463249        }
    2547     if (bAddAfter)
     3250    if (_bAddAfter)
    25483251        {
    25493252        ulTextLength += strlen(SZ_MODIFIER_ADDAFTER);
    25503253        ulSpaces += 3;
    2551         ulTextLength += strlen(szSearchString);
     3254        ulTextLength += strlen(_szSearchString);
    25523255        if (pszFirstModifier)
    25533256            pszSecondModifier = SZ_MODIFIER_ADDAFTER;
     
    25553258            pszFirstModifier = SZ_MODIFIER_ADDAFTER;
    25563259        }
    2557     if (bAddBefore)
     3260    if (_bAddBefore)
    25583261        {
    25593262        ulTextLength += strlen(SZ_MODIFIER_ADDBEFORE);
    25603263        ulSpaces += 3;
    2561         ulTextLength = strlen(szSearchString);
     3264        ulTextLength = strlen(_szSearchString);
    25623265        if (pszFirstModifier)
    25633266            pszSecondModifier = SZ_MODIFIER_ADDBEFORE;
     
    25653268            pszFirstModifier = SZ_MODIFIER_ADDBEFORE;
    25663269        }
    2567     if (bRemoveLine)
     3270    if (_bRemoveLine)
    25683271        {
    25693272        ulTextLength += strlen(SZ_MODIFIER_REMOVELINE);
     
    25713274        pszFirstModifier = SZ_MODIFIER_REMOVELINE;
    25723275        }
    2573     if (bRemovePart)
     3276    if (_bRemovePart)
    25743277        {
    25753278        ulTextLength += strlen(SZ_MODIFIER_REMOVEPART);
     
    25783281        }
    25793282
    2580     if (bAttribute)
     3283    if (p_bAttribute)
    25813284        ulTextLength += strlen(SZ_ATTRIBUTE_CONFIGSYS) + 3;
    25823285
    2583     //pszScriptText = new CHAR[ulTextLength + ulSpaces + 1];
    2584     //*pszScriptText = '\0';
    25853286    szTemp[0] = '\0';
    25863287
    2587     if (bAttribute)
    2588         sprintf(szTemp, "%s=\"%s", SZ_ATTRIBUTE_CONFIGSYS, szStatement);
     3288    if (p_bAttribute)
     3289        sprintf(szTemp, "%s=\"%s", SZ_ATTRIBUTE_CONFIGSYS, _szStatement);
    25893290    else
    2590         sprintf(szTemp, "%s", szStatement);
    2591     xstrcat(&strScriptText, szTemp, 0);
     3291        sprintf(szTemp, "%s", _szStatement);
     3292    xstrcat(&xstrScriptText, szTemp, 0);
    25923293
    25933294    if (pszFirstModifier)
    25943295        {
    2595         xstrcat(&strScriptText, " | ", 0);
    2596         xstrcat(&strScriptText, pszFirstModifier, 0);
     3296        xstrcat(&xstrScriptText, " | ", 0);
     3297        xstrcat(&xstrScriptText, pszFirstModifier, 0);
    25973298        }
    25983299    if (pszSecondModifier)
    25993300        {
    2600         xstrcat(&strScriptText, " ", 0);
    2601         xstrcat(&strScriptText, pszSecondModifier, 0);
    2602         }
    2603     if (strlen(szSearchString) != 0)
    2604         {
    2605         xstrcat(&strScriptText, "(", 0);
    2606         xstrcat(&strScriptText, szSearchString, 0);
    2607         xstrcat(&strScriptText, ")", 0);
    2608         }
    2609     if(bAttribute)
    2610         xstrcat(&strScriptText, "\"", 0);
    2611 
    2612     return strScriptText.psz;
    2613     }
    2614 
    2615 
    2616 
    2617 /***************************************************************************
     3301        xstrcat(&xstrScriptText, " ", 0);
     3302        xstrcat(&xstrScriptText, pszSecondModifier, 0);
     3303        }
     3304    if (strlen(_szSearchString) != 0)
     3305        {
     3306        xstrcat(&xstrScriptText, "(", 0);
     3307        xstrcat(&xstrScriptText, _szSearchString, 0);
     3308        xstrcat(&xstrScriptText, ")", 0);
     3309        }
     3310    if(p_bAttribute)
     3311        xstrcat(&xstrScriptText, "\"", 0);
     3312
     3313    return xstrScriptText.psz;
     3314    }
     3315
     3316
     3317
     3318/*
    26183319 *@@ScriptConfigSys:: BuildFromText
    2619  *  Builds ScriptConfigSys object accordingly to script text. If any errors
    2620  *  are found in script text, error informations are returned in table where
    2621  *  to pScriptError points. Pointer to after end of tag is returned so
    2622  *  multiple searches can be done.
    2623  */
    2624 PSZ ScriptConfigSys::BuildFromText(PSZ pszScriptText,
    2625                                   SCRIPTERROR **ppScriptError,
    2626                                   USHORT *pusErrorTableSize,
    2627                                   ULONG ulLineNumber)
    2628     {
    2629     SCRIPTERROR Error;
     3320 *  Builds ScriptConfigSys object accordingly to script text.
     3321 */
     3322PSZ ScriptConfigSys::BuildFromText(PSZ p_pszScriptText,
     3323                                  ULONG p_ulLineNumber)
     3324    {
     3325    Message msg;
     3326    BSString string;
    26303327    PSZ pszTemp = NULL, pszTemp2 = NULL, pszModifiers = NULL;
    26313328    PSZ pszAttr = NULL;
     
    26373334
    26383335    // Initialize class attributes.
    2639     *szStatement = '\0';
    2640     *szSearchString = '\0';
    2641     bUnique = FALSE;
    2642     bAddRight = FALSE;
    2643     bAddLeft = FALSE;
    2644     bAddRight = FALSE;
    2645     bAddTop = FALSE;
    2646     bAddAfter = FALSE;
    2647     bAddBefore = FALSE;
    2648     bRemoveLine = FALSE;
    2649     bRemovePart = FALSE;
    2650 
    2651 
    2652     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_CONFIGSYS, &ulOffset);
     3336    *_szStatement = '\0';
     3337    *_szSearchString = '\0';
     3338    _bUnique = FALSE;
     3339    _bAddRight = FALSE;
     3340    _bAddLeft = FALSE;
     3341    _bAddRight = FALSE;
     3342    _bAddTop = FALSE;
     3343    _bAddAfter = FALSE;
     3344    _bAddBefore = FALSE;
     3345    _bRemoveLine = FALSE;
     3346    _bRemovePart = FALSE;
     3347
     3348
     3349    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_CONFIGSYS, &ulOffset);
    26533350
    26543351    if (!pszAttr)
    26553352        {
    2656         Error.usErrorCode = ERR_PARSE_CONFIGSYS_NOTFOUND;
    2657         Error.ulLineNumber = ulLineNumber;
    2658         Error.pszStart = strhdup(pszScriptText);
    2659         Error.ulLength = 0;
    2660         if (ppScriptError)
    2661             *pusErrorTableSize =
    2662                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     3353        msg.SetType(MSG_TYPE_INFO);
     3354        msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_NOTFOUND);
     3355        msg.SetLineNumber(p_ulLineNumber);
     3356        _messageLogger.LogMessage(msg);
    26633357        return NULL;
    26643358        }
     
    27023396            else
    27033397                {
    2704                 // Error.
     3398                string = SZ_MODIFIER_ADDRIGHT;
     3399                msg.SetType(MSG_TYPE_ERROR);
     3400                msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     3401                msg.SetMessageText(string);
     3402                msg.SetLineNumber(p_ulLineNumber);
     3403                _messageLogger.LogMessage(msg);
    27053404                }
    27063405            }
     
    27163415            else
    27173416                {
    2718                 // Error.
     3417                string = SZ_MODIFIER_ADDLEFT;
     3418                msg.SetType(MSG_TYPE_ERROR);
     3419                msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     3420                msg.SetMessageText(string);
     3421                msg.SetLineNumber(p_ulLineNumber);
     3422                _messageLogger.LogMessage(msg);
    27193423                }
    27203424            }
     
    27303434            else
    27313435                {
    2732                 // Error.
     3436                string = SZ_MODIFIER_REMOVELINE;
     3437                msg.SetType(MSG_TYPE_ERROR);
     3438                msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     3439                msg.SetMessageText(string);
     3440                msg.SetLineNumber(p_ulLineNumber);
     3441                _messageLogger.LogMessage(msg);
    27333442                }
    27343443            }
     
    27443453            else
    27453454                {
    2746                 // Error.
     3455                string = SZ_MODIFIER_REMOVEPART;
     3456                msg.SetType(MSG_TYPE_ERROR);
     3457                msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     3458                msg.SetMessageText(string);
     3459                msg.SetLineNumber(p_ulLineNumber);
     3460                _messageLogger.LogMessage(msg);
    27473461                }
    27483462            }
     
    27573471            else
    27583472                {
    2759                 // Error.
     3473                string = SZ_MODIFIER_ADDTOP;
     3474                msg.SetType(MSG_TYPE_ERROR);
     3475                msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     3476                msg.SetMessageText(string);
     3477                msg.SetLineNumber(p_ulLineNumber);
     3478                _messageLogger.LogMessage(msg);
    27603479                }
    27613480           }
     
    27743493            else
    27753494                {
    2776                 // Error.
     3495                string = SZ_MODIFIER_ADDAFTER;
     3496                msg.SetType(MSG_TYPE_ERROR);
     3497                msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     3498                msg.SetMessageText(string);
     3499                msg.SetLineNumber(p_ulLineNumber);
     3500                _messageLogger.LogMessage(msg);
    27773501                }
    27783502            }
     
    27913515            else
    27923516                {
    2793                 // Error.
     3517                string = SZ_MODIFIER_ADDBEFORE;
     3518                msg.SetType(MSG_TYPE_ERROR);
     3519                msg.SetMessageValue(MSG_ATTRIBUTE_CFGSYS_MODIFIER_WRONGCOMB);
     3520                msg.SetMessageText(string);
     3521                msg.SetLineNumber(p_ulLineNumber);
     3522                _messageLogger.LogMessage(msg);
    27943523                }
    27953524            }
     
    27983527    ulAttrLen = strlen(pszAttr);
    27993528    delete [] pszAttr;
    2800     return pszScriptText + ulOffset + ulAttrLen + 1;
     3529    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    28013530    }
    28023531
     
    28073536/****************************************************************************
    28083537 ****************************************************************************
    2809         ScriptRegisterClass class:
    2810 
    2811  ****************************************************************************
    2812  *  ScriptRegisterClass class member functions:
    2813  *  ScriptRegisterClass Constructor.
    2814  *  ~ScriptRegisterClass Destructor.
    2815  *  SetClassName    Sets class name text.
    2816  *  SetDLLPath      Sets DLL path name text.
    2817  *  SetIndex        Sets index number.
    2818  *  ReturnClassName Returns const pointer to class name string.
    2819  *  ReturnDLLPath   Returns const pointer to DLL name string.
    2820  *  ReturnIndex     Returns index number.
    2821  *  MakeScriptText  Returns pointer to script text.
    2822  *  BuildFromText
     3538        @@ScriptRegisterClass class:
     3539
     3540    <B>Description:</B>
     3541        This class is for REGISTERCLASS attributes in PCK tag. Detailed
     3542        information about the attribute can be found
     3543        from <I>WarpIN Programmer's Guide and Reference</I>.
     3544
     3545    Member functions:
     3546        ScriptRegisterClass             Constructor.
     3547        ~ScriptRegisterClass            Destructor.
     3548        SetClassName                    Sets class name text.
     3549        SetDLLPath                      Sets DLL path name text.
     3550        ReturnClassName                 Returns const pointer to class name string.
     3551        ReturnDLLPath                   Returns const pointer to DLL name string.
     3552        MakeScriptText                  Returns pointer to script text.
     3553        BuildFromText
    28233554 ***************************************************************************/
    28243555
    28253556
    2826 /***************************************************************************
    2827  *@@ ScriptRegisterClass::ScriptRegisterClass
     3557/*
     3558 *@@ScriptRegisterClass:
    28283559 *  Constructor for ScriptRegisterClass class. Initializes object by setting
    28293560 *  strings to zero and sets index number too.
    28303561 */
    2831 ScriptRegisterClass::ScriptRegisterClass(USHORT usIndex)
    2832     {
    2833     this->usIndex = usIndex;
    2834 
    2835     *szClassName = '\0';
    2836     *szDLLPath = '\0';
    2837     }
    2838 
    2839 
    2840 
    2841 
    2842 /***************************************************************************
    2843  *@@ ScriptRegisterClass::~ScriptRegisterClass
    2844  *  Destructor for ScriptRegisterClass class. Quess what it does?
    2845  *  (Answer is: NOTHING)
    2846  */
    2847 ScriptRegisterClass::~ScriptRegisterClass() {}
    2848 
    2849 
    2850 
    2851 
    2852 /***************************************************************************
    2853  *@@ ScriptRegisterClass::SetClassName
     3562ScriptRegisterClass::ScriptRegisterClass(USHORT p_usIndex)
     3563    {
     3564    SetIndex(p_usIndex);
     3565
     3566    *_szClassName = '\0';
     3567    *_szDLLPath = '\0';
     3568    }
     3569
     3570
     3571/*
     3572 *@@~ScriptRegisterClass:
     3573 *  Destructor for ScriptRegisterClass class.
     3574 */
     3575ScriptRegisterClass::~ScriptRegisterClass()
     3576    {
     3577    *_szClassName = '\0';
     3578    *_szDLLPath = '\0';
     3579    }
     3580
     3581
     3582/*
     3583 *@@SetClassName:
    28543584 *  Sets class name string text.
    28553585 */
    2856 void ScriptRegisterClass::SetClassName(const PSZ pszClassName)
    2857     {
    2858     if (strlen(szClassName) < MAXCLASSNAMELENGTH)
    2859         strcpy(this->szClassName, pszClassName);
    2860     }
    2861 
    2862 
    2863 
    2864 
    2865 /***************************************************************************
    2866  *@@ ScriptRegisterClass::SetDLLPath
     3586USHORT ScriptRegisterClass::SetClassName(const PSZ p_pszClassName)
     3587    {
     3588    Message msg;
     3589    USHORT rc = NO_ERROR;
     3590    if (strlen(p_pszClassName) < MAXCLASSNAMELENGTH)
     3591        strcpy(this->_szClassName, p_pszClassName);
     3592    else
     3593        {
     3594        msg.SetType(MSG_TYPE_ERROR);
     3595        msg.SetMessageValue(MSG_ATTRIBUTE_REGISTER_CLASSNAME_STRTOOLONG);
     3596        msg.SetMessageText(p_pszClassName);
     3597        _messageLogger.LogMessage(msg);
     3598        rc = STRING_TOO_LONG;
     3599        }
     3600    return rc;
     3601    }
     3602
     3603
     3604/*
     3605 *@@SetDLLPath:
    28673606 *  Sets DLL path string text.
    28683607 */
    2869 void ScriptRegisterClass::SetDLLPath(const PSZ pszDLLPath)
    2870     {
    2871     if (strlen(szDLLPath) < CCHMAXPATH)
    2872         strcpy(this->szDLLPath, pszDLLPath);
    2873     }
    2874 
    2875 
    2876 
    2877 
    2878 /***************************************************************************
     3608USHORT ScriptRegisterClass::SetDLLPath(const PSZ p_pszDLLPath)
     3609    {
     3610    Message msg;
     3611    USHORT rc = NO_ERROR;
     3612    if (strlen(p_pszDLLPath) < CCHMAXPATH)
     3613        strcpy(this->_szDLLPath, p_pszDLLPath);
     3614    else
     3615        {
     3616        msg.SetType(MSG_TYPE_ERROR);
     3617        msg.SetMessageValue(MSG_ATTRIBUTE_REGISTER_DLLPATH_STRTOOLONG);
     3618        msg.SetMessageText(p_pszDLLPath);
     3619        _messageLogger.LogMessage(msg);
     3620        rc = STRING_TOO_LONG;
     3621        }
     3622    return rc;
     3623    }
     3624
     3625
     3626/*
    28793627 *@@ ScriptRegisterClass::SetRegisterClass
    28803628 */
    2881 void ScriptRegisterClass::SetRegisterClass(REGISTERCLASSDATA registerClass)
    2882     {
    2883     if (strlen(szClassName) < MAXCLASSNAMELENGTH)
    2884         strcpy(this->szClassName, szClassName);
    2885     if (strlen(registerClass.szDLLPath) < CCHMAXPATH)
    2886         strcpy(this->szDLLPath, registerClass.szDLLPath);
    2887     }
    2888 
    2889 
    2890 
    2891 
    2892 /***************************************************************************
    2893  *@@ ScriptRegisterClass::SetIndex
    2894  *  Sets object's index.
    2895  */
    2896 void ScriptRegisterClass::SetIndex(USHORT usIndex)
    2897     {
    2898     this->usIndex = usIndex;
    2899     }
    2900 
    2901 
    2902 
    2903 /***************************************************************************
    2904  *@@ ScriptRegisterClass::ReturnClassName
     3629USHORT ScriptRegisterClass::SetRegisterClass(REGISTERCLASSDATA p_registerClass)
     3630    {
     3631    Message msg;
     3632    USHORT rc = NO_ERROR;
     3633    if (SetClassName(p_registerClass.szClassname) != NO_ERROR)
     3634        rc = STRING_TOO_LONG;
     3635    if (SetDLLPath(p_registerClass.szDLLPath) != NO_ERROR)
     3636        rc = STRING_TOO_LONG;
     3637
     3638    return STRING_TOO_LONG;
     3639    }
     3640
     3641
     3642/*
     3643 *@@ReturnClassName:
    29053644 *  Returns const pointer to class name string.
    29063645 */
    29073646const PSZ ScriptRegisterClass::ReturnClassName()
    29083647    {
    2909     return szClassName;
    2910     }
    2911 
    2912 
    2913 
    2914 
    2915 /***************************************************************************
    2916  *@@ ScriptRegisterClass::ReturnDLLPath
     3648    return _szClassName;
     3649    }
     3650
     3651
     3652/*
     3653 *@@ReturnDLLPath:
    29173654 *  Returns const pointer to DLL path string.
    29183655 */
    29193656const PSZ ScriptRegisterClass::ReturnDLLPath()
    29203657    {
    2921     return szDLLPath;
    2922     }
    2923 
    2924 
    2925 
    2926 /***************************************************************************
    2927  *@@ ScriptRegisterClass::ReturnRegisterClass
     3658    return _szDLLPath;
     3659    }
     3660
     3661
     3662/*
     3663 *@@ReturnRegisterClass:
    29283664 */
    29293665REGISTERCLASSDATA ScriptRegisterClass::ReturnRegisterClass()
    29303666    {
    29313667    REGISTERCLASSDATA registerClass;
    2932     strcpy(registerClass.szClassname, this->szClassName);
    2933     strcpy(registerClass.szDLLPath, this->szDLLPath);
     3668    strcpy(registerClass.szClassname, this->_szClassName);
     3669    strcpy(registerClass.szDLLPath, this->_szDLLPath);
    29343670    return registerClass;
    29353671    }
    29363672
    29373673
    2938 
    2939 
    2940 /***************************************************************************
    2941  *@@ ScriptRegisterClass::ReturnIndex
    2942  *  Returns index number.
    2943  */
    2944 USHORT ScriptRegisterClass::ReturnIndex()
    2945     {
    2946     return usIndex;
    2947     }
    2948 
    2949 
    2950 
    2951 /***************************************************************************
    2952  *@@ ScriptRegisterClass::MakeScriptText
     3674/*
     3675 *@@MakeScriptText:
    29533676 *  Returns pointer to script text.
    29543677 */
    2955 PSZ ScriptRegisterClass::MakeScriptText(BOOL bAttribute)
     3678PSZ ScriptRegisterClass::MakeScriptText(BOOL p_bAttribute)
    29563679    {
    29573680    ULONG ulTextLength = 0;
    29583681    PSZ pszScriptText = NULL;
    29593682
    2960     ulTextLength = strlen(szClassName) + strlen(szDLLPath);
     3683    ulTextLength = strlen(_szClassName) + strlen(_szDLLPath);
    29613684    ulTextLength += 3;
    29623685
    2963     if (bAttribute)
     3686    if (p_bAttribute)
    29643687        ulTextLength += strlen(SZ_ATTRIBUTE_REGISTERCLASS) + 3;
    29653688
     
    29673690    *pszScriptText = '\0';
    29683691
    2969     if (bAttribute)
     3692    if (p_bAttribute)
    29703693        sprintf(pszScriptText, "%s=\"%s|%s\"", SZ_ATTRIBUTE_REGISTERCLASS,
    2971             szClassName, szDLLPath);
     3694            _szClassName, _szDLLPath);
    29723695    else
    2973         sprintf(pszScriptText, "%s|%s", szClassName, szDLLPath);
     3696        sprintf(pszScriptText, "%s|%s", _szClassName, _szDLLPath);
    29743697
    29753698    return pszScriptText;
     
    29773700
    29783701
    2979 /***************************************************************************
    2980  *@@ScriptRegisterClass::BuildFromText
     3702/*
     3703 *@@BuildFromText:
    29813704 *  Builds ScriptRegisterClass object accordingly to script text.
    2982  *  If any errors is found in script text, error informations are returned
    2983  *  in table where to *pScriptError points. Pointer to after end of tag is
    2984  *  returned so multiple searches can be done.
    2985  */
    2986 PSZ ScriptRegisterClass::BuildFromText(PSZ pszScriptText,
    2987                                       SCRIPTERROR **ppScriptError,
    2988                                       USHORT *pusErrorTableSize,
    2989                                       ULONG ulLineNumber)
    2990     {
    2991     SCRIPTERROR Error;
     3705 *  Pointer to after end of tag is returned so multiple searches can be done.
     3706 */
     3707PSZ ScriptRegisterClass::BuildFromText(PSZ p_pszScriptText,
     3708                                       ULONG p_ulLineNumber)
     3709    {
     3710    Message msg;
    29923711    PSZ pszAttr = NULL;
    29933712    PSZ pszTemp = NULL;
     
    29973716    ULONG ulAttrLen = 0;
    29983717
    2999     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_REGISTERCLASS,
     3718    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_REGISTERCLASS,
    30003719                             &ulOffset);
    30013720
    30023721    if (!pszAttr)
    30033722        {
    3004         Error.usErrorCode = ERR_PARSE_REGISTERCLASS_NOTFOUND;
    3005         Error.ulLineNumber = ulLineNumber;
    3006         Error.pszStart = strhdup(pszScriptText);
    3007         Error.ulLength = 0;
    3008         if (ppScriptError)
    3009             *pusErrorTableSize =
    3010                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     3723        msg.SetType(MSG_TYPE_INFO);
     3724        msg.SetMessageValue(MSG_ATTRIBUTE_REGISTER_NOTFOUND);
     3725        msg.SetLineNumber(p_ulLineNumber);
     3726        _messageLogger.LogMessage(msg);
     3727        return NULL;
     3728        }
     3729
     3730    pszTemp = strchr(pszAttr, '|');
     3731    if (pszTemp)
     3732        {
     3733        pszTemp2 = pszTemp - 1;
     3734        // Remove leading spaces.
     3735        while ((*pszTemp2 == ' ') && (pszTemp2 > pszAttr))
     3736            pszTemp2 --;
     3737        if (pszTemp3 = strhSubstr(pszAttr, pszTemp2 + 1))
     3738            {
     3739            SetClassName(pszTemp3);
     3740            delete [] pszTemp3;
     3741            }
     3742        else
     3743            {
     3744            msg.SetType(MSG_TYPE_INFO);
     3745            msg.SetMessageValue(MSG_ATTRIBUTE_REGISTER_CLASSNAME_NOTFOUND);
     3746            msg.SetLineNumber(p_ulLineNumber);
     3747            _messageLogger.LogMessage(msg);
     3748            }
     3749
     3750        pszTemp2 = pszTemp + 1;
     3751        // Remove trailing spaces.
     3752        while ((*pszTemp2 == ' ') && (*pszTemp2))
     3753            pszTemp2 ++;
     3754        if (strlen(pszTemp2) > 1)
     3755            SetDLLPath(pszTemp2);
     3756        else
     3757            {
     3758            msg.SetType(MSG_TYPE_INFO);
     3759            msg.SetMessageValue(MSG_ATTRIBUTE_REGISTER_DLLPATH_NOTFOUND);
     3760            msg.SetLineNumber(p_ulLineNumber);
     3761            _messageLogger.LogMessage(msg);
     3762            }
     3763        }
     3764    else // Seems that DLL path is missing but get class name.
     3765        {
     3766        while (*pszTemp =! '\0')
     3767            pszTemp ++;
     3768        // Remove leading spaces.
     3769        while ((*pszTemp == ' ') && (pszTemp > pszAttr))
     3770            pszTemp --;
     3771        if (pszTemp3 = strhSubstr(pszAttr, pszTemp))
     3772            {
     3773            SetClassName(pszTemp3);
     3774            delete [] pszTemp3;
     3775            }
     3776        else
     3777            {
     3778            msg.SetType(MSG_TYPE_INFO);
     3779            msg.SetMessageValue(MSG_ATTRIBUTE_REGISTER_CLASSNAME_NOTFOUND);
     3780            msg.SetLineNumber(p_ulLineNumber);
     3781            _messageLogger.LogMessage(msg);
     3782            }
     3783        }
     3784
     3785    ulAttrLen = strlen(pszAttr);
     3786    delete [] pszAttr;
     3787    return p_pszScriptText + ulOffset + ulAttrLen + 1;
     3788    }
     3789
     3790
     3791
     3792
     3793
     3794/****************************************************************************
     3795 ****************************************************************************
     3796        @@ScriptReplaceClass class:
     3797
     3798    <B>Description:</B>
     3799        This class is for REPLACECLASS attribute in CONFIGSYS tag. Detailed
     3800        information about the meaning of the attribute can be found
     3801        from <I>WarpIN Programmer's Guide and Reference</I>.
     3802
     3803    Member functions:
     3804        ScriptReplaceClass Constructor.
     3805        ~ScriptReplaceClass Destructor.
     3806        SetClassName    Sets class name text.
     3807        SetNewClassName Sets new class name text.
     3808        ReturnClassName Returns const pointer to class name string.
     3809        ReturnNewClassName Returns const pointer to new class name string.
     3810        MakeScriptText  Returns pointer to script text.
     3811        BuildFromText
     3812 ***************************************************************************/
     3813
     3814
     3815/*
     3816 *@@ScriptReplaceClass:
     3817 *  Constructor for ScriptReplaceClass class.
     3818 */
     3819ScriptReplaceClass::ScriptReplaceClass(USHORT p_usIndex)
     3820    {
     3821    SetIndex(p_usIndex);
     3822    *_szClassName = '\0';
     3823    *_szNewClassName = '\0';
     3824    }
     3825
     3826
     3827/*
     3828 *@@~ScriptReplaceClass:
     3829 *  Destructor for ScriptRegisterClass class.
     3830 */
     3831ScriptReplaceClass::~ScriptReplaceClass()
     3832    {
     3833    *_szClassName = '\0';
     3834    *_szNewClassName = '\0';
     3835    }
     3836
     3837
     3838/*
     3839 *@@SetClassName:
     3840 *  Sets class name string text.
     3841 */
     3842USHORT ScriptReplaceClass::SetClassName(const PSZ p_pszClassName)
     3843    {
     3844    Message msg;
     3845    USHORT rc = NO_ERROR;
     3846    if (strlen(p_pszClassName) < MAXCLASSNAMELENGTH)
     3847        strcpy(this->_szClassName, p_pszClassName);
     3848    else
     3849        {
     3850        msg.SetType(MSG_TYPE_ERROR);
     3851        msg.SetMessageValue(MSG_ATTRIBUTE_REPLACE_CLASSNAME_STRTOOLONG);
     3852        msg.SetMessageText(p_pszClassName);
     3853        _messageLogger.LogMessage(msg);
     3854        rc = STRING_TOO_LONG;
     3855        }
     3856
     3857    return rc;
     3858    }
     3859
     3860
     3861/*
     3862 *@@SetNewClassName:
     3863 *  Sets new class name string text.
     3864 */
     3865USHORT ScriptReplaceClass::SetNewClassName(const PSZ p_pszNewClassName)
     3866    {
     3867    Message msg;
     3868    USHORT rc = NO_ERROR;
     3869    if (strlen(p_pszNewClassName) < MAXCLASSNAMELENGTH)
     3870        strcpy(this->_szNewClassName, p_pszNewClassName);
     3871    else
     3872        {
     3873        msg.SetType(MSG_TYPE_ERROR);
     3874        msg.SetMessageValue(MSG_ATTRIBUTE_REPLACE_NEWNAME_STRTOOLONG);
     3875        msg.SetMessageText(p_pszNewClassName);
     3876        _messageLogger.LogMessage(msg);
     3877        rc = STRING_TOO_LONG;
     3878        }
     3879
     3880    return rc;
     3881    }
     3882
     3883
     3884/*
     3885 *@@SetReplaceClass:
     3886 */
     3887USHORT ScriptReplaceClass::SetReplaceClass(REPLACECLASSDATA p_replaceClass)
     3888    {
     3889    USHORT rc = NO_ERROR;
     3890    if (SetClassName(p_replaceClass.szOldClassName) != NO_ERROR)
     3891        rc = STRING_TOO_LONG;
     3892    if (SetNewClassName(p_replaceClass.szNewClassName) != NO_ERROR)
     3893        rc = STRING_TOO_LONG;
     3894    return rc;
     3895    }
     3896
     3897
     3898/*
     3899 *@@ReturnClassName:
     3900 *  Returns const pointer to class name string.
     3901 */
     3902const PSZ ScriptReplaceClass::ReturnClassName()
     3903    {
     3904    return _szClassName;
     3905    }
     3906
     3907
     3908/*
     3909 *@@ ScriptReplaceClass::ReturnNewClassName
     3910 *  Returns const pointer to new class name string.
     3911 */
     3912const PSZ ScriptReplaceClass::ReturnNewClassName()
     3913    {
     3914    return _szNewClassName;
     3915    }
     3916
     3917
     3918
     3919/*
     3920 *@@ReturnReplaceClass:
     3921 */
     3922REPLACECLASSDATA ScriptReplaceClass::ReturnReplaceClass()
     3923    {
     3924    REPLACECLASSDATA replaceClass;
     3925    strcpy(replaceClass.szOldClassName, this->_szClassName);
     3926    strcpy(replaceClass.szNewClassName, this->_szNewClassName);
     3927    return replaceClass;
     3928    }
     3929
     3930
     3931/*
     3932 *@@MakeScriptText:
     3933 *  Returns pointer to script text.
     3934 */
     3935PSZ ScriptReplaceClass::MakeScriptText(BOOL p_bAttribute)
     3936    {
     3937    ULONG ulTextLength = 0;
     3938    PSZ pszScriptText = NULL;
     3939
     3940    ulTextLength = strlen(_szClassName) + strlen(_szNewClassName);
     3941    ulTextLength += 3;
     3942
     3943    if (p_bAttribute)
     3944        ulTextLength += strlen(SZ_ATTRIBUTE_REPLACECLASS) + 3;
     3945
     3946    pszScriptText = new CHAR[ulTextLength + 1];
     3947    *pszScriptText = '\0';
     3948
     3949    if (p_bAttribute)
     3950        sprintf(pszScriptText, "%s=\"%s|%s\"", SZ_ATTRIBUTE_REPLACECLASS,
     3951            _szClassName, _szNewClassName);
     3952    else
     3953        sprintf(pszScriptText, "%s|%s", _szClassName, _szNewClassName);
     3954
     3955    return pszScriptText;
     3956    }
     3957
     3958
     3959/*
     3960 *@@BuildFromText:
     3961 *  Builds ScriptReplaceClass object accordingly to script text.
     3962 *  If any errors is found in script text, error informations are returned
     3963 *  in table where to *pScriptError points. Pointer to after end of tag is
     3964 *  returned so multiple searches can be done.
     3965 */
     3966PSZ ScriptReplaceClass::BuildFromText(PSZ p_pszScriptText,
     3967                                      ULONG p_ulLineNumber)
     3968    {
     3969    Message msg;
     3970    PSZ pszAttr = NULL;
     3971    PSZ pszTemp = NULL;
     3972    PSZ pszTemp2 = NULL;
     3973    PSZ pszTemp3 = NULL;
     3974    ULONG ulOffset = 0;
     3975    ULONG ulAttrLen = 0;
     3976
     3977    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_REPLACECLASS,
     3978                             &ulOffset);
     3979
     3980    if (!pszAttr)
     3981        {
     3982        msg.SetType(MSG_TYPE_INFO);
     3983        msg.SetMessageValue(MSG_ATTRIBUTE_REPLACE_NOTFOUND);
     3984        msg.SetLineNumber(p_ulLineNumber);
     3985        _messageLogger.LogMessage(msg);
    30113986        return NULL;
    30123987        }
     
    30274002        while ((*pszTemp2 == ' ') && (*pszTemp2))
    30284003            pszTemp2 ++;
    3029         SetDLLPath(pszTemp2);
     4004        if (pszTemp2)
     4005            SetNewClassName(pszTemp2);
     4006        else
     4007            {
     4008            msg.SetType(MSG_TYPE_ERROR);
     4009            msg.SetMessageValue(MSG_ATTRIBUTE_REGISTER_CLASSNAME_MISSING);
     4010            msg.SetLineNumber(p_ulLineNumber);
     4011            _messageLogger.LogMessage(msg);
     4012            }
    30304013        }
    30314014    else
    30324015        {
    3033         // Error.
     4016        msg.SetType(MSG_TYPE_ERROR);
     4017        msg.SetMessageValue(MSG_ATTRIBUTE_REGISTER_CLASSNAME_MISSING);
     4018        msg.SetLineNumber(p_ulLineNumber);
     4019        _messageLogger.LogMessage(msg);
    30344020        }
    30354021
    30364022    ulAttrLen = strlen(pszAttr);
    30374023    delete [] pszAttr;
    3038     return pszScriptText + ulOffset + ulAttrLen + 1;
     4024    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    30394025    }
    30404026
     
    30454031/****************************************************************************
    30464032 ****************************************************************************
    3047         ScriptReplaceClass class:
    3048 
    3049  ****************************************************************************
    3050  *  ScriptReplaceClass class member functions:
    3051  *  ScriptReplaceClass Constructor.
    3052  *  ~ScriptReplaceClass Destructor.
    3053  *  SetClassName    Sets class name text.
    3054  *  SetNewClassName Sets new class name text.
    3055  *  SetIndex        Sets index number.
    3056  *  ReturnClassName Returns const pointer to class name string.
    3057  *  ReturnNewClassName Returns const pointer to new class name string.
    3058  *  ReturnIndex     Returns index number.
    3059  *  MakeScriptText  Returns pointer to script text.
    3060  *  BuildFromText
     4033        @@ScriptCreateObject class:
     4034
     4035    <B>Description:</B>
     4036        This class is for CREATEOBJECT attribute in CONFIGSYS tag. Detailed
     4037        information about the meaning of the attribute can be found
     4038        from <I>WarpIN Programmer's Guide and Reference</I>.
     4039
     4040    Member functions:
     4041        ScriptCreateObject  Constructor.
     4042        ~ScriptCreateObject Destructor.
     4043        SetClassName        Sets class name text.
     4044        SetTitle            Sets title text.
     4045        SetLocation         Sets location text.
     4046        SetConfig           Sets config text.
     4047        SetReplace          Sets replace parameter state.
     4048        ReturnClassName     Returns const pointer to class name string.
     4049        ReturnTitle         Returns const pointer to title string.
     4050        ReturnLocation      Returns const pointer to location string.
     4051        ReturnConfig        Returns const pointer to config string.
     4052        ReturnReplace       Returns the state of the replace parameter.
     4053        MakeScriptText      Returns pointer to script text.
     4054        BuildFromText
    30614055 ***************************************************************************/
    30624056
    30634057
    3064 /***************************************************************************
    3065  *@@ ScriptReplaceClass::ScriptReplaceClass
    3066  *  Constructor for ScriptReplaceClass class. Initializes object by setting
    3067  *  strings to zero and sets index number too.
    3068  */
    3069 ScriptReplaceClass::ScriptReplaceClass(USHORT usIndex)
    3070     {
    3071     this->usIndex = usIndex;
    3072 
    3073     *szClassName = '\0';
    3074     *szNewClassName = '\0';
    3075     }
    3076 
    3077 
    3078 
    3079 
    3080 /***************************************************************************
    3081  *@@ ScriptReplaceClass::~ScriptReplaceClass
    3082  *  Destructor for ScriptRegisterClass class.
    3083  */
    3084 ScriptReplaceClass::~ScriptReplaceClass() {}
    3085 
    3086 
    3087 
    3088 
    3089 /***************************************************************************
    3090  *@@ ScriptReplaceClass::SetClassName
    3091  *  Sets class name string text.
    3092  */
    3093 void ScriptReplaceClass::SetClassName(const PSZ pszClassName)
    3094     {
    3095     if (strlen(pszClassName) < MAXCLASSNAMELENGTH)
    3096         strcpy(this->szClassName, pszClassName);
    3097     }
    3098 
    3099 
    3100 
    3101 
    3102 /***************************************************************************
    3103  *@@ ScriptReplaceClass::SetNewClassName
    3104  *  Sets new class name string text.
    3105  */
    3106 void ScriptReplaceClass::SetNewClassName(const PSZ pszNewClassName)
    3107     {
    3108     if (strlen(pszNewClassName) < MAXCLASSNAMELENGTH)
    3109         strcpy(this->szNewClassName, pszNewClassName);
    3110     }
    3111 
    3112 
    3113 
    3114 
    3115 /***************************************************************************
    3116  *@@ ScriptReplaceClass::SetReplaceClass
    3117  */
    3118 void ScriptReplaceClass::SetReplaceClass(REPLACECLASSDATA replaceClass)
    3119     {
    3120     if (strlen(replaceClass.szOldClassName) < MAXCLASSNAMELENGTH)
    3121         strcpy(this->szClassName, replaceClass.szOldClassName);
    3122     if (strlen(replaceClass.szNewClassName) < MAXCLASSNAMELENGTH)
    3123         strcpy(this->szNewClassName, replaceClass.szNewClassName);
    3124     }
    3125 
    3126 
    3127 
    3128 
    3129 /***************************************************************************
    3130  *@@ ScriptReplaceClass::SetIndex
    3131  *  Sets object's index.
    3132  */
    3133 void ScriptReplaceClass::SetIndex(USHORT usIndex)
    3134     {
    3135     this->usIndex = usIndex;
    3136     }
    3137 
    3138 
    3139 
    3140 /***************************************************************************
    3141  *@@ ScriptReplaceClass::ReturnClassName
    3142  *  Returns const pointer to class name string.
    3143  */
    3144 const PSZ ScriptReplaceClass::ReturnClassName()
    3145     {
    3146     return szClassName;
    3147     }
    3148 
    3149 
    3150 
    3151 
    3152 /***************************************************************************
    3153  *@@ ScriptReplaceClass::ReturnNewClassName
    3154  *  Returns const pointer to new class name string.
    3155  */
    3156 const PSZ ScriptReplaceClass::ReturnNewClassName()
    3157     {
    3158     return szNewClassName;
    3159     }
    3160 
    3161 
    3162 
    3163 /***************************************************************************
    3164  *@@ ScriptReplaceClass::ReturnReplaceClass
    3165  */
    3166 REPLACECLASSDATA ScriptReplaceClass::ReturnReplaceClass()
    3167     {
    3168     REPLACECLASSDATA replaceClass;
    3169     strcpy(replaceClass.szOldClassName, this->szClassName);
    3170     strcpy(replaceClass.szNewClassName, this->szNewClassName);
    3171     return replaceClass;
    3172     }
    3173 
    3174 
    3175 
    3176 
    3177 /***************************************************************************
    3178  *@@ ScriptReplaceClass::ReturnIndex
    3179  *  Returns index number.
    3180  */
    3181 USHORT ScriptReplaceClass::ReturnIndex()
    3182     {
    3183     return usIndex;
    3184     }
    3185 
    3186 
    3187 
    3188 /***************************************************************************
    3189  *@@ ScriptReplaceClass::MakeScriptText
    3190  *  Returns pointer to script text.
    3191  */
    3192 PSZ ScriptReplaceClass::MakeScriptText(BOOL bAttribute)
    3193     {
    3194     ULONG ulTextLength = 0;
    3195     PSZ pszScriptText = NULL;
    3196 
    3197     ulTextLength = strlen(szClassName) + strlen(szNewClassName);
    3198     ulTextLength += 3;
    3199 
    3200     if (bAttribute)
    3201         ulTextLength += strlen(SZ_ATTRIBUTE_REPLACECLASS) + 3;
    3202 
    3203     pszScriptText = new CHAR[ulTextLength + 1];
    3204     *pszScriptText = '\0';
    3205 
    3206     if (bAttribute)
    3207         sprintf(pszScriptText, "%s=\"%s|%s\"", SZ_ATTRIBUTE_REPLACECLASS,
    3208             szClassName, szNewClassName);
    3209     else
    3210         sprintf(pszScriptText, "%s|%s", szClassName, szNewClassName);
    3211 
    3212     return pszScriptText;
    3213     }
    3214 
    3215 
    3216 /***************************************************************************
    3217  *@@ScriptReplaceClass::BuildFromText
    3218  *  Builds ScriptReplaceClass object accordingly to script text.
    3219  *  If any errors is found in script text, error informations are returned
    3220  *  in table where to *pScriptError points. Pointer to after end of tag is
    3221  *  returned so multiple searches can be done.
    3222  */
    3223 PSZ ScriptReplaceClass::BuildFromText(PSZ pszScriptText,
    3224                                       SCRIPTERROR **ppScriptError,
    3225                                       USHORT *pusErrorTableSize,
    3226                                       ULONG ulLineNumber)
    3227     {
    3228     SCRIPTERROR Error;
    3229     PSZ pszAttr = NULL;
    3230     PSZ pszTemp = NULL;
    3231     PSZ pszTemp2 = NULL;
    3232     PSZ pszTemp3 = NULL;
    3233     ULONG ulOffset = 0;
    3234     ULONG ulAttrLen = 0;
    3235 
    3236     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_REPLACECLASS,
    3237                              &ulOffset);
    3238 
    3239     if (!pszAttr)
    3240         {
    3241         Error.usErrorCode = ERR_PARSE_REPLACECLASS_NOTFOUND;
    3242         Error.ulLineNumber = ulLineNumber;
    3243         Error.pszStart = strhdup(pszScriptText);
    3244         Error.ulLength = 0;
    3245         if (ppScriptError)
    3246             *pusErrorTableSize =
    3247                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
    3248         return NULL;
    3249         }
    3250 
    3251     pszTemp = strchr(pszAttr, '|');
    3252     if (pszTemp)
    3253         {
    3254         pszTemp2 = pszTemp - 1;
    3255         // Remove leading spaces.
    3256         while ((*pszTemp2 == ' ') && (pszTemp2 > pszAttr))
    3257             pszTemp2 --;
    3258         pszTemp3 = strhSubstr(pszAttr, pszTemp2 + 1);
    3259         SetClassName(pszTemp3);
    3260         delete [] pszTemp3;
    3261 
    3262         pszTemp2 = pszTemp + 1;
    3263         // Remove trailing spaces.
    3264         while ((*pszTemp2 == ' ') && (*pszTemp2))
    3265             pszTemp2 ++;
    3266         SetNewClassName(pszTemp2);
    3267         }
    3268     else
    3269         {
    3270         // Error.
    3271         }
    3272 
    3273     ulAttrLen = strlen(pszAttr);
    3274     delete [] pszAttr;
    3275     return pszScriptText + ulOffset + ulAttrLen + 1;
    3276     }
    3277 
    3278 
    3279 
    3280 
    3281 
    3282 /****************************************************************************
    3283  ****************************************************************************
    3284         ScriptCreateObject class:
    3285 
    3286  ****************************************************************************
    3287  *  ScriptCreateObject class member functions:
    3288  *  ScriptCreateObject  Constructor.
    3289  *  ~ScriptCreateObject Destructor.
    3290  *  SetClassName        Sets class name text.
    3291  *  SetTitle            Sets title text.
    3292  *  SetLocation         Sets location text.
    3293  *  SetConfig           Sets config text.
    3294  *  SetReplace          Sets replace parameter state.
    3295  *  SetIndex            Sets index number.
    3296  *  ReturnClassName     Returns const pointer to class name string.
    3297  *  ReturnTitle         Returns const pointer to title string.
    3298  *  ReturnLocation      Returns const pointer to location string.
    3299  *  ReturnConfig        Returns const pointer to config string.
    3300  *  ReturnReplace       Returns the state of the replace parameter.
    3301  *  ReturnIndex         Returns index number.
    3302  *  MakeScriptText      Returns pointer to script text.
    3303  *  BuildFromText
    3304  ***************************************************************************/
    3305 
    3306 
    3307 /***************************************************************************
    3308  *@@ ScriptCreateObject::ScriptCreateObject
     4058/*
     4059 *@@ScriptCreateObject:
    33094060 *  Constructor for ScriptCreateObject class. Initializes object by setting
    33104061 *  strings to zero and sets index number.
    33114062 */
    3312 ScriptCreateObject::ScriptCreateObject(USHORT usIndex)
    3313     {
    3314     this->usIndex = usIndex;
    3315 
    3316     *szClassName = '\0';
    3317     *szTitle = '\0';
    3318     *szLocation = '\0';
    3319     *szConfig = '\0';
    3320     bReplace = FALSE;
    3321     }
    3322 
    3323 
    3324 
    3325 
    3326 /***************************************************************************
    3327  *@@ ScriptCreateObject::~ScriptCreateObject
     4063ScriptCreateObject::ScriptCreateObject(USHORT p_usIndex)
     4064    {
     4065    SetIndex(p_usIndex);
     4066
     4067    *_szClassName = '\0';
     4068    *_szTitle = '\0';
     4069    *_szLocation = '\0';
     4070    *_szConfig = '\0';
     4071    _bReplace = FALSE;
     4072    }
     4073
     4074
     4075/*
     4076 *@@~ScriptCreateObject:
    33284077 *  Destructor for ScriptCreateObject class.
    33294078 */
    3330 ScriptCreateObject::~ScriptCreateObject() {}
    3331 
    3332 
    3333 
    3334 
    3335 /***************************************************************************
    3336  *@@ ScriptCreateObject::SetClassName
     4079ScriptCreateObject::~ScriptCreateObject()
     4080    {
     4081    *_szClassName = '\0';
     4082    *_szTitle = '\0';
     4083    *_szLocation = '\0';
     4084    *_szConfig = '\0';
     4085    _bReplace = FALSE;
     4086    }
     4087
     4088
     4089/*
     4090 *@@SetClassName:
    33374091 *  Sets class name string text.
    33384092 */
    3339 void ScriptCreateObject::SetClassName(const PSZ pszClassName)
    3340     {
    3341     if (strlen(pszClassName) < MAXCLASSNAMELENGTH)
    3342         strcpy(this->szClassName, pszClassName);
    3343     }
    3344 
    3345 
    3346 
    3347 
    3348 /***************************************************************************
    3349  *@@ ScriptCreateObject::SetTitle
     4093USHORT ScriptCreateObject::SetClassName(const PSZ p_pszClassName)
     4094    {
     4095    Message msg;
     4096    USHORT rc = NO_ERROR;
     4097    if (strlen(p_pszClassName) < MAXCLASSNAMELENGTH)
     4098        strcpy(this->_szClassName, p_pszClassName);
     4099    else
     4100        {
     4101        msg.SetType(MSG_TYPE_ERROR);
     4102        msg.SetMessageValue(MSG_ATTRIBUTE_CREATE_CLASSNAME_STRTOOLONG);
     4103        msg.SetMessageText(p_pszClassName);
     4104        _messageLogger.LogMessage(msg);
     4105        rc = STRING_TOO_LONG;
     4106        }
     4107
     4108    return rc;
     4109    }
     4110
     4111
     4112
     4113
     4114/*
     4115 *@@SetTitle:
    33504116 *  Sets new title string text.
    33514117 */
    3352 void ScriptCreateObject::SetTitle(const PSZ pszTitle)
    3353     {
    3354     if (strlen(pszTitle) < MAXCLASSTITLELENGTH)
    3355         strcpy(this->szTitle, pszTitle);
    3356     }
    3357 
    3358 
    3359 
    3360 /***************************************************************************
    3361  *@@ ScriptCreateObject::SetLocation
     4118USHORT ScriptCreateObject::SetTitle(const PSZ p_pszTitle)
     4119    {
     4120    Message msg;
     4121    USHORT rc = NO_ERROR;
     4122    if (strlen(p_pszTitle) < MAXCLASSTITLELENGTH)
     4123        strcpy(this->_szTitle, p_pszTitle);
     4124    else
     4125        {
     4126        msg.SetType(MSG_TYPE_ERROR);
     4127        msg.SetMessageValue(MSG_ATTRIBUTE_CREATE_TITLE_STRTOOLONG);
     4128        msg.SetMessageText(p_pszTitle);
     4129        _messageLogger.LogMessage(msg);
     4130        rc = STRING_TOO_LONG;
     4131        }
     4132
     4133    return rc;
     4134    }
     4135
     4136
     4137/*
     4138 *@@SetLocation:
    33624139 *  Sets new title string text.
    33634140 */
    3364 void ScriptCreateObject::SetLocation(const PSZ pszLocation)
    3365     {
    3366     if (strlen(pszLocation) < CCHMAXPATH)
    3367         strcpy(this->szLocation, pszLocation);
    3368     }
    3369 
    3370 
    3371 
    3372 /***************************************************************************
    3373  *@@ ScriptCreateObject::SetConfig
     4141USHORT ScriptCreateObject::SetLocation(const PSZ p_pszLocation)
     4142    {
     4143    Message msg;
     4144    USHORT rc = NO_ERROR;
     4145    if (strlen(p_pszLocation) < CCHMAXPATH)
     4146        strcpy(this->_szLocation, p_pszLocation);
     4147    else
     4148        {
     4149        msg.SetType(MSG_TYPE_ERROR);
     4150        msg.SetMessageValue(MSG_ATTRIBUTE_CREATE_LOCATION_STRTOOLONG);
     4151        msg.SetMessageText(p_pszLocation);
     4152        _messageLogger.LogMessage(msg);
     4153        rc = STRING_TOO_LONG;
     4154        }
     4155
     4156    return rc;
     4157    }
     4158
     4159
     4160/*
     4161 *@@SetConfig:
    33744162 *  Sets new config string text.
    33754163 */
    3376 void ScriptCreateObject::SetConfig(const PSZ pszConfig)
    3377     {
    3378     if (strlen(pszConfig) < MAXCLASSCONFIGLENGTH)
    3379         strcpy(this->szConfig, pszConfig);
    3380     }
    3381 
    3382 
    3383 /***************************************************************************
    3384  *@@ ScriptCreateObject::SetReplace
     4164USHORT ScriptCreateObject::SetConfig(const PSZ p_pszConfig)
     4165    {
     4166    Message msg;
     4167    USHORT rc = NO_ERROR;
     4168    if (strlen(p_pszConfig) < MAXCLASSCONFIGLENGTH)
     4169        strcpy(this->_szConfig, p_pszConfig);
     4170    else
     4171        {
     4172        msg.SetType(MSG_TYPE_ERROR);
     4173        msg.SetMessageValue(MSG_ATTRIBUTE_CREATE_CONFIG_STRTOOLONG);
     4174        msg.SetMessageText(p_pszConfig);
     4175        _messageLogger.LogMessage(msg);
     4176        rc = STRING_TOO_LONG;
     4177        }
     4178
     4179    return rc;
     4180    }
     4181
     4182
     4183/*
     4184 *@@SetReplace:
    33854185 *  Sets new config string text.
    33864186 */
    3387 void ScriptCreateObject::SetReplace(BOOL bReplace)
    3388     {
    3389     this->bReplace = bReplace;
    3390     }
    3391 
    3392 
    3393 
    3394 /***************************************************************************
    3395  *@@ ScriptCreateObject::SetCreateObject
    3396  */
    3397 void ScriptCreateObject::SetCreateObject(CREATEOBJECTDATA createObject)
    3398     {
    3399     if (strlen(createObject.szClassName) < MAXCLASSNAMELENGTH)
    3400         strcpy(this->szClassName, createObject.szClassName);
    3401     if (strlen(createObject.szTitle) < MAXCLASSTITLELENGTH)
    3402         strcpy(this->szTitle, createObject.szTitle);
    3403     if (strlen(createObject.szLocation) < CCHMAXPATH)
    3404         strcpy(this->szLocation, createObject.szLocation);
    3405     if (strlen(createObject.szConfig) < MAXCLASSCONFIGLENGTH)
    3406         strcpy(this->szConfig, createObject.szConfig);
    3407     }
    3408 
    3409 
    3410 
    3411 
    3412 /***************************************************************************
    3413  *@@ ScriptCreateObject::SetIndex
    3414  *  Sets object's index.
    3415  */
    3416 void ScriptCreateObject::SetIndex(USHORT usIndex)
    3417     {
    3418     this->usIndex = usIndex;
    3419     }
    3420 
    3421 
    3422 
    3423 /***************************************************************************
    3424  *@@ ScriptCreateObject::ReturnClassName
     4187USHORT ScriptCreateObject::SetReplace(BOOL p_bReplace)
     4188    {
     4189    this->_bReplace = p_bReplace;
     4190    }
     4191
     4192
     4193/*
     4194 *@@SetCreateObject:
     4195 */
     4196USHORT ScriptCreateObject::SetCreateObject(CREATEOBJECTDATA p_createObject)
     4197    {
     4198    USHORT rc = NO_ERROR;
     4199    if (SetClassName(p_createObject.szClassName) != NO_ERROR)
     4200        rc = STRING_TOO_LONG;
     4201    if (SetTitle(p_createObject.szTitle) != NO_ERROR)
     4202        rc = STRING_TOO_LONG;
     4203    if (SetLocation(p_createObject.szLocation) != NO_ERROR)
     4204        rc = STRING_TOO_LONG;
     4205    if (SetConfig(p_createObject.szConfig) != NO_ERROR)
     4206        rc = STRING_TOO_LONG;
     4207
     4208    return rc;
     4209    }
     4210
     4211
     4212/*
     4213 *@@ReturnClassName:
    34254214 *  Returns const pointer to class name string.
    34264215 */
    34274216const PSZ ScriptCreateObject::ReturnClassName()
    34284217    {
    3429     return szClassName;
    3430     }
    3431 
    3432 
    3433 
    3434 
    3435 /***************************************************************************
    3436  *@@ ScriptCreateObject::ReturnTitle
     4218    return _szClassName;
     4219    }
     4220
     4221
     4222/*
     4223 *@@ReturnTitle:
    34374224 *  Returns const pointer to title string.
    34384225 */
    34394226const PSZ ScriptCreateObject::ReturnTitle()
    34404227    {
    3441     return szTitle;
    3442     }
    3443 
    3444 
    3445 
    3446 
    3447 /***************************************************************************
    3448  *@@ ScriptCreateObject::ReturnLocation
     4228    return _szTitle;
     4229    }
     4230
     4231
     4232/*
     4233 *@@ReturnLocation:
    34494234 *  Returns const pointer to location string.
    34504235 */
    34514236const PSZ ScriptCreateObject::ReturnLocation()
    34524237    {
    3453     return szLocation;
    3454     }
    3455 
    3456 
    3457 
    3458 
    3459 /***************************************************************************
    3460  *@@ ScriptCreateObject::ReturnConfig
     4238    return _szLocation;
     4239    }
     4240
     4241
     4242/*
     4243 *@@ReturnConfig:
    34614244 *  Returns const pointer to config string.
    34624245 */
    34634246const PSZ ScriptCreateObject::ReturnConfig()
    34644247    {
    3465     return szConfig;
    3466     }
    3467 
    3468 
    3469 
    3470 /***************************************************************************
    3471  *@@ ScriptCreateObject::ReturnReplace
     4248    return _szConfig;
     4249    }
     4250
     4251
     4252/*
     4253 *@@ReturnReplace:
    34724254 *  Returns the state of the replace parameter.
    34734255 */
    34744256BOOL ScriptCreateObject::ReturnReplace()
    34754257    {
    3476     return bReplace;
    3477     }
    3478 
    3479 
    3480 
    3481 
    3482 /***************************************************************************
    3483  *@@ ScriptCreateObject::ReturnCreateObject
     4258    return _bReplace;
     4259    }
     4260
     4261
     4262/*
     4263 *@@ReturnCreateObject:
    34844264 */
    34854265CREATEOBJECTDATA ScriptCreateObject::ReturnCreateObject()
    34864266    {
    34874267    CREATEOBJECTDATA createObject;
    3488     strcpy(createObject.szClassName, this->szClassName);
    3489     strcpy(createObject.szTitle, this->szTitle);
    3490     strcpy(createObject.szLocation, this->szLocation);
    3491     strcpy(createObject.szConfig, this->szConfig);
    3492     createObject.bReplace = this->bReplace;
     4268    strcpy(createObject.szClassName, this->_szClassName);
     4269    strcpy(createObject.szTitle, this->_szTitle);
     4270    strcpy(createObject.szLocation, this->_szLocation);
     4271    strcpy(createObject.szConfig, this->_szConfig);
     4272    createObject.bReplace = this->_bReplace;
    34934273    return createObject;
    34944274    }
    34954275
    34964276
    3497 
    3498 
    3499 /***************************************************************************
    3500  *@@ ScriptCreateObject::ReturnIndex
    3501  *  Returns index number.
    3502  */
    3503 USHORT ScriptCreateObject::ReturnIndex()
    3504     {
    3505     return usIndex;
    3506     }
    3507 
    3508 
    3509 
    3510 /***************************************************************************
     4277/*
    35114278 *@@ ScriptCreateObject::MakeScriptText
    35124279 *  Returns pointer to script text.
    35134280 *
    3514  *  @@ changed v0.9.4 (2000-08-02) [tahola]
    3515  */
    3516 PSZ ScriptCreateObject::MakeScriptText(BOOL bAttribute)
     4281 *@@changed v0.9.5 (2000-08-02) [tahola]
     4282 */
     4283PSZ ScriptCreateObject::MakeScriptText(BOOL p_bAttribute)
    35174284    {
    35184285    ULONG ulTextLength = 0;
    35194286    PSZ pszScriptText = NULL;
    3520     XSTRING strReplace;
    3521     xstrInit(&strReplace, 0);
    3522 
    3523     ulTextLength = strlen(szClassName) + strlen(szTitle) + strlen(szLocation);
    3524     if ((ulTextLength += strlen(szConfig)) > 0)
     4287    PSZ pszReplace = "";
     4288
     4289    ulTextLength = strlen(_szClassName) + strlen(_szTitle) + strlen(_szLocation);
     4290    if ((ulTextLength += strlen(_szConfig)) > 0)
    35254291        ulTextLength += 1; // No spaces allowed.
    3526     ulTextLength += 2;     // v0.9.4 (2000-08-02) [tahola]
    3527     if (bReplace)
     4292    ulTextLength += 2;     // v0.9.5 (2000-08-02) [tahola]
     4293    if (_bReplace)
    35284294        {
    35294295        ulTextLength += strlen(SZ_PARAMETER_REPLACE) + 2;
    3530         xstrcpy(&strReplace, SZ_PARAMETER_REPLACE, 0);
    3531         xstrcat(&strReplace, " ", 0);
     4296        pszReplace = new CHAR[strlen(SZ_PARAMETER_REPLACE) + 3];
     4297        strcpy(pszReplace, SZ_PARAMETER_REPLACE);
     4298        strcat(pszReplace, " ");
    35324299        }
    35334300    ulTextLength += 3;
    35344301
    3535     if (bAttribute)
     4302    if (p_bAttribute)
    35364303        ulTextLength += strlen(SZ_ATTRIBUTE_CREATEOBJECT) + 3;
    35374304
     
    35394306    *pszScriptText = '\0';
    35404307
    3541     if (bAttribute)
     4308    if (p_bAttribute)
    35424309        sprintf(pszScriptText, "%s=\"%s%s|%s|%s",  // No spaces allowed.
    3543             SZ_ATTRIBUTE_CREATEOBJECT, strReplace.psz, // v0.9.4 (2000-08-2) [tahola]
    3544             szClassName, szTitle, szLocation);
     4310            SZ_ATTRIBUTE_CREATEOBJECT, pszReplace, // v0.9.5 (2000-08-2) [tahola]
     4311            _szClassName, _szTitle, _szLocation);
    35454312    else
    3546         sprintf(pszScriptText, "%s%s|%s|%s", strReplace.psz, szClassName,
    3547             szTitle, szLocation); // No spaces allowed.
    3548                                   // v0.9.4 (2000-08-2) [tahola]
    3549     if (strlen(szConfig) != 0)
     4313        sprintf(pszScriptText, "%s%s|%s|%s", pszReplace, _szClassName,
     4314            _szTitle, _szLocation); // No spaces allowed.
     4315                                  // v0.9.5 (2000-08-2) [tahola]
     4316    if (strlen(_szConfig) != 0)
    35504317        {
    35514318        strcat(pszScriptText, "|");      // No spaces allowed.
    3552         strcat(pszScriptText, szConfig); // v0.9.4 (2000-08-2) [tahola]
    3553         }
    3554 
    3555     if (bAttribute)
     4319        strcat(pszScriptText, _szConfig); // v0.9.5 (2000-08-2) [tahola]
     4320        }
     4321
     4322    if (p_bAttribute)
    35564323        strcat(pszScriptText, "\"");
    35574324
    3558     xstrClear(&strReplace);
     4325    if (_bReplace)
     4326        delete [] pszReplace;
    35594327
    35604328    return pszScriptText;
     
    35624330
    35634331
    3564 /***************************************************************************
    3565  *@@ScriptCreateObject:: BuildFromText
    3566  *  Builds ScriptCreateObject accordingly to script text. If any errors is
    3567  *  found in script text, error informations are returned in table where
    3568  *  to *pScriptError points. Pointer to after end of tag is returned so
    3569  *  multiple searches can be done.
    3570  */
    3571 PSZ ScriptCreateObject::BuildFromText(PSZ pszScriptText,
    3572                                      SCRIPTERROR **ppScriptError,
    3573                                      USHORT *pusErrorTableSize,
    3574                                      ULONG ulLineNumber)
    3575     {
    3576     SCRIPTERROR Error;
     4332/*
     4333 *@@BuildFromText:
     4334 *  Builds ScriptCreateObject accordingly to script text.
     4335 */
     4336PSZ ScriptCreateObject::BuildFromText(PSZ p_pszScriptText,
     4337                                      ULONG p_ulLineNumber)
     4338    {
     4339    Message msg;
    35774340    PSZ pszTemp = NULL, pszTemp2 = NULL, pszTemp3 = NULL;
    35784341    PSZ pszAttr = NULL;
    35794342    ULONG ulOffset = 0;
    35804343    ULONG ulVersion = 0;
    3581     BOOL bError = FALSE;
    35824344    ULONG ulAttrLen = 0;
    35834345
    3584     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_CREATEOBJECT,
     4346    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_CREATEOBJECT,
    35854347                             &ulOffset);
    35864348
    35874349    if (!pszAttr)
    35884350        {
    3589         Error.usErrorCode = ERR_PARSE_CREATEOBJECT_NOTFOUND;
    3590         Error.ulLineNumber = ulLineNumber;
    3591         Error.pszStart = strhdup(pszScriptText);
    3592         Error.ulLength = 0;
    3593         if (ppScriptError)
    3594             *pusErrorTableSize =
    3595                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     4351        msg.SetType(MSG_TYPE_INFO);
     4352        msg.SetMessageValue(MSG_ATTRIBUTE_CREATE_NOTFOUND);
     4353        msg.SetLineNumber(p_ulLineNumber);
     4354        _messageLogger.LogMessage(msg);
    35964355        return NULL;
    35974356        }
     
    36334392                }
    36344393            else
    3635                 SetLocation(pszTemp2);
     4394                {
     4395                if (pszTemp2)
     4396                    SetLocation(pszTemp2);
     4397                else
     4398                    {
     4399                    msg.SetType(MSG_TYPE_ERROR);
     4400                    msg.SetMessageValue(MSG_ATTRIBUTE_CREATE_LOCATION_MISSING);
     4401                    msg.SetLineNumber(p_ulLineNumber);
     4402                    _messageLogger.LogMessage(msg);
     4403                    }
     4404                }
    36364405            }
    36374406        else // Title error.
    36384407            {
    3639             Error.usErrorCode = ERR_PARSE_CREATEOBJECT_TITLE_NOTFOUND;
    3640             Error.ulLineNumber = ulLineNumber;
    3641             Error.pszStart = strhdup(pszAttr);
    3642             Error.ulLength = 0;
    3643             if (ppScriptError)
    3644                 *pusErrorTableSize =
    3645                     AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
    3646             bError = TRUE;
     4408            msg.SetType(MSG_TYPE_ERROR);
     4409            msg.SetMessageValue(MSG_ATTRIBUTE_CREATE_TITLE_MISSING);
     4410            msg.SetLineNumber(p_ulLineNumber);
     4411            _messageLogger.LogMessage(msg);
    36474412            }
    36484413        }
    36494414    else // Class name error.
    36504415        {
    3651         Error.usErrorCode = ERR_PARSE_CREATEOBJECT_CLASSNAME_NOTFOUND;
    3652         Error.ulLineNumber = ulLineNumber;
    3653         Error.pszStart = strhdup(pszAttr);
    3654         Error.ulLength = 0;
    3655         if (ppScriptError)
    3656             *pusErrorTableSize =
    3657                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
    3658         bError = TRUE;
    3659         }
    3660     if (bError == TRUE)
    3661         return NULL;
     4416        msg.SetType(MSG_TYPE_ERROR);
     4417        msg.SetMessageValue(MSG_ATTRIBUTE_CREATE_CLASSNAME_MISSING);
     4418        msg.SetLineNumber(p_ulLineNumber);
     4419        _messageLogger.LogMessage(msg);
     4420        }
    36624421
    36634422    ulAttrLen = strlen(pszAttr);
    36644423    delete [] pszAttr;
    3665     return pszScriptText + ulOffset + ulAttrLen + 1;
     4424    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    36664425    }
    36674426
     
    36724431/****************************************************************************
    36734432 ****************************************************************************
    3674         ScriptExecute class:
    3675 
    3676  ****************************************************************************
    3677  *  ScriptExecute class member functions:
    3678  *  ScriptExecute           Constructor.
    3679  *  ~ScriptExecute          Destructor.
    3680  *  SetExecFileParams       Sets class name text.
    3681  *  SetIndex                Sets index number.
    3682  *  ReturnExecFileParams    Returns const pointer to ecec file params string.
    3683  *  ReturnIndex             Returns index number.
    3684  *  MakeScriptText          Returns pointer to script text.
    3685  *  BuildFromText
     4433        @@ScriptExecute class:
     4434
     4435    <B>Description:</B>
     4436        This class is for EXECUTE attribute in CONFIGSYS tag. Detailed
     4437        information about the meaning of the attribute can be found
     4438        from <I>WarpIN Programmer's Guide and Reference</I>.
     4439
     4440
     4441    Member functions:
     4442        ScriptExecute           Constructor.
     4443        ~ScriptExecute          Destructor.
     4444        SetExecFileParams       Sets class name text.
     4445        ReturnExecFileParams    Returns const pointer to exec file params string.
     4446        MakeScriptText          Returns pointer to script text.
     4447        BuildFromText
    36864448 ***************************************************************************/
    36874449
    36884450
    3689 /***************************************************************************
    3690  *@@ ScriptExecute::ScriptExecute
     4451/*
     4452 *@@ScriptExecute:
    36914453 *  Constructor for ScriptExecute class. Initializes object by setting
    36924454 *  strings to zero and sets index number too.
    36934455 */
    3694 ScriptExecute::ScriptExecute(USHORT usIndex)
    3695     {
    3696     this->usIndex = usIndex;
    3697     *szExecFileParams = '\0';
    3698     fusContext = 0;
    3699     }
    3700 
    3701 
    3702 
    3703 
    3704 /***************************************************************************
    3705  *@@ ScriptExecute::~ScriptExecute
     4456ScriptExecute::ScriptExecute(USHORT p_usIndex)
     4457    {
     4458    SetIndex(p_usIndex);
     4459    *_szExecFileParams = '\0';
     4460    _usContext = 0;
     4461    }
     4462
     4463
     4464/*
     4465 *@@~ScriptExecute:
    37064466 *  Destructor for ScriptExecute class.
    37074467 */
    3708 ScriptExecute::~ScriptExecute() {}
    3709 
    3710 
    3711 
    3712 
    3713 /***************************************************************************
    3714  *@@ ScriptExecute::SetClassName
     4468ScriptExecute::~ScriptExecute()
     4469    {
     4470    }
     4471
     4472
     4473/*
     4474 *@@SetClassName:
    37154475 *  Sets exec file params string text.
    37164476 */
    3717 void ScriptExecute::SetExecFileParams(const PSZ pszExecFileParams)
    3718     {
    3719     if (strlen(pszExecFileParams) < CCHMAXPATH)
    3720         strcpy(this->szExecFileParams, pszExecFileParams);
    3721     }
    3722 
    3723 
    3724 /***************************************************************************
     4477USHORT ScriptExecute::SetExecFileParams(const PSZ p_pszExecFileParams)
     4478    {
     4479    Message msg;
     4480    USHORT rc = NO_ERROR;
     4481    if (strlen(p_pszExecFileParams) < CCHMAXPATH)
     4482        strcpy(this->_szExecFileParams, p_pszExecFileParams);
     4483    else
     4484        {
     4485        msg.SetType(MSG_TYPE_ERROR);
     4486        msg.SetMessageValue(MSG_ATTRIBUTE_EXECUTE_EXEFILEPARAM_STRTOOLONG);
     4487        msg.SetMessageText(p_pszExecFileParams);
     4488        _messageLogger.LogMessage(msg);
     4489        rc = STRING_TOO_LONG;
     4490        }
     4491
     4492    return rc;
     4493    }
     4494
     4495
     4496/*
    37254497 *@@ ScriptExecute::SetContext
    37264498 *  Sets object's index.
    37274499 */
    3728 void ScriptExecute::SetContext(USHORT fusContext)
    3729     {
    3730     if ((fusContext == FLAG_CONFIGSYS) || (fusContext == FLAG_REGISTERCLASS) ||
    3731         (fusContext == FLAG_CREATEOBJECT) || (fusContext == FLAG_NOCONTEXT))
    3732         this->fusContext = fusContext;
    3733     }
    3734 
    3735 
    3736 
    3737 /***************************************************************************
    3738  *@@ ScriptExecute::SetIndex
    3739  *  Sets object's index.
    3740  */
    3741 void ScriptExecute::SetIndex(USHORT usIndex)
    3742     {
    3743     this->usIndex = usIndex;
    3744     }
    3745 
    3746 
    3747 /***************************************************************************
    3748  *@@ ScriptExecute::SetExecute
    3749  */
    3750 void ScriptExecute::SetExecute(EXECUTEDATA execData)
    3751     {
    3752     SetExecFileParams(execData.szExecFileParams);
    3753     SetContext(execData.fusContext);
    3754     }
    3755 
    3756 
    3757 
    3758 /***************************************************************************
    3759  *@@ ScriptExecute::ReturnszExecFileParams
     4500USHORT ScriptExecute::SetContext(USHORT p_usContext)
     4501    {
     4502    if ((p_usContext == FLAG_CONFIGSYS) || (p_usContext == FLAG_REGISTERCLASS) ||
     4503        (p_usContext == FLAG_CREATEOBJECT) || (p_usContext == FLAG_NOCONTEXT))
     4504        this->_usContext = p_usContext;
     4505    return NO_ERROR;
     4506    }
     4507
     4508
     4509/*
     4510 *@@SetExecute:
     4511 */
     4512USHORT ScriptExecute::SetExecute(EXECUTEDATA p_execData)
     4513    {
     4514    USHORT rc = NO_ERROR;
     4515    if (SetExecFileParams(p_execData.szExecFileParams) != NO_ERROR)
     4516        rc = STRING_TOO_LONG;
     4517    if (SetContext(p_execData.fusContext) != NO_ERROR)
     4518        rc = STRING_TOO_LONG;
     4519    return rc;
     4520    }
     4521
     4522
     4523/*
     4524 *@@ReturnszExecFileParams:
    37604525 *  Returns const pointer to szExecFileParams string.
    37614526 */
    37624527const PSZ ScriptExecute::ReturnExecFileParams()
    37634528    {
    3764     return szExecFileParams;
    3765     }
    3766 
    3767 
    3768 /***************************************************************************
    3769  *@@ ScriptExecute::ReturnContext
     4529    return _szExecFileParams;
     4530    }
     4531
     4532
     4533/*
     4534 *@@ReturnContext:
    37704535 *  Returns index number.
    37714536 */
    37724537USHORT ScriptExecute::ReturnContext()
    37734538    {
    3774     return fusContext;
    3775     }
    3776 
    3777 
    3778 
    3779 
    3780 /***************************************************************************
    3781  *@@ ScriptExecute::ReturnIndex
    3782  *  Returns index number.
    3783  */
    3784 USHORT ScriptExecute::ReturnIndex()
    3785     {
    3786     return usIndex;
    3787     }
    3788 
    3789 
    3790 /***************************************************************************
    3791  *@@ ScriptExecute::ReturnExecute
     4539    return _usContext;
     4540    }
     4541
     4542
     4543/*
     4544 *@@ReturnExecute:
    37924545 */
    37934546EXECUTEDATA ScriptExecute::ReturnExecute()
    37944547    {
    37954548    EXECUTEDATA execData;
    3796     strcpy(execData.szExecFileParams, this->szExecFileParams);
    3797     execData.fusContext = this->fusContext;
     4549    strcpy(execData.szExecFileParams, this->_szExecFileParams);
     4550    execData.fusContext = this->_usContext;
    37984551    return execData;
    37994552    }
    38004553
    38014554
    3802 
    3803 
    3804 /***************************************************************************
    3805  *@@ ScriptExecute::MakeScriptText
     4555/*
     4556 *@@MakeScriptText:
    38064557 *  Returns pointer to script text.
    38074558 */
    3808 PSZ ScriptExecute::MakeScriptText(BOOL bAttribute)
     4559PSZ ScriptExecute::MakeScriptText(BOOL p_bAttribute)
    38094560    {
    38104561    ULONG ulTextLength = 0;
    38114562    PSZ pszScriptText = NULL;
    3812     XSTRING strTemp;
     4563    PSZ pszTemp = NULL;
     4564        XSTRING strTemp;
    38134565    xstrInit(&strTemp, 0);
    38144566
    3815     ulTextLength = strlen(szExecFileParams);
    3816 
    3817     if (fusContext == FLAG_CONFIGSYS)
     4567    ulTextLength = strlen(_szExecFileParams);
     4568
     4569    if (_usContext == FLAG_CONFIGSYS)
    38184570        {
    38194571        ulTextLength += strlen(SZ_FLAG_CONFIGSYS) + 1;
     
    38214573        xstrcat(&strTemp, "|", 0);
    38224574        }
    3823     else if (fusContext == FLAG_REGISTERCLASS)
     4575    else if (_usContext == FLAG_REGISTERCLASS)
    38244576        {
    38254577        ulTextLength += strlen(SZ_FLAG_REGISTERCLASS) + 1;
     
    38274579        xstrcat(&strTemp, "|", 0);
    38284580        }
    3829     else if (fusContext == FLAG_CREATEOBJECT)
     4581    else if (_usContext == FLAG_CREATEOBJECT)
    38304582        {
    38314583        ulTextLength += strlen(SZ_FLAG_CREATEOBJECT) + 1;
     
    38344586        }
    38354587
    3836     if (bAttribute)
     4588    if (p_bAttribute)
    38374589        ulTextLength += strlen(SZ_ATTRIBUTE_EXECUTE) + 3;
    38384590
     
    38404592    *pszScriptText = '\0';
    38414593
    3842     xstrcat(&strTemp, szExecFileParams, 0);
    3843 
    3844     if (bAttribute)
    3845         sprintf(pszScriptText, "%s=\"%s\"", SZ_ATTRIBUTE_EXECUTE, strTemp.psz);
     4594    xstrcat(&strTemp, _szExecFileParams, 0);
     4595
     4596    if (p_bAttribute)
     4597        sprintf(pszScriptText, "%s=\"%s\"", SZ_ATTRIBUTE_EXECUTE, pszTemp);
    38464598    else
    38474599        sprintf(pszScriptText, "%s", strTemp.psz);
     
    38524604
    38534605
    3854 
    3855 /***************************************************************************
    3856  *@@ScriptExecute::BuildFromText
    3857  *  Builds execute object  accordingly to script text. If any errors is found
    3858  *  in script text, error informations are returned in table where to
    3859  *  *pScriptError points. Pointer to after end of tag is returned so multiple
    3860  *  searches can be done.
    3861  */
    3862 PSZ ScriptExecute::BuildFromText(PSZ pszScriptText,
    3863                                 SCRIPTERROR **ppScriptError,
    3864                                 USHORT *pusErrorTableSize,
    3865                                 ULONG ulLineNumber)
    3866     {
    3867     SCRIPTERROR Error;
     4606/*
     4607 *@@BuildFromText:
     4608 *  Builds execute object  accordingly to script text.
     4609 */
     4610PSZ ScriptExecute::BuildFromText(PSZ p_pszScriptText,
     4611                                ULONG p_ulLineNumber)
     4612    {
     4613    Message msg;
    38684614    PSZ pszTemp = NULL;
    38694615    PSZ pszAttr = NULL;
     
    38734619
    38744620
    3875     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_EXECUTE, &ulOffset);
     4621    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_EXECUTE, &ulOffset);
    38764622    if (pszAttr)
    38774623        {
     
    38904636                                  "\x0d\x0a ()/\\-,.:;|"))
    38914637                this->SetContext(FLAG_CREATEOBJECT);
     4638            else // There is something in the context but it cannot be recognised.
     4639                {
     4640                msg.SetType(MSG_TYPE_INFO);
     4641                msg.SetMessageValue(MSG_ATTRIBUTE_EXECUTE_CONTEXT_MISSING);
     4642                msg.SetLineNumber(p_ulLineNumber);
     4643                _messageLogger.LogMessage(msg);
     4644                }
    38924645            delete [] pszFlag;
    38934646            // Take the rest of the attribute.
     
    39034656            {
    39044657            this->SetContext(FLAG_NOCONTEXT);
    3905             if (strlen(pszAttr) < CCHMAXPATH)
     4658            if (pszAttr)
    39064659                this->SetExecFileParams(pszAttr);
     4660            else
     4661                {
     4662                msg.SetType(MSG_TYPE_ERROR);
     4663                msg.SetMessageValue(MSG_ATTRIBUTE_EXECUTE_EXEFILEPARAM_MISSING);
     4664                msg.SetLineNumber(p_ulLineNumber);
     4665                _messageLogger.LogMessage(msg);
     4666                }
    39074667            }
    39084668        }
    39094669    else
    39104670        {
    3911         Error.usErrorCode = ERR_PARSE_TITLE_NOTFOUND;
    3912         Error.ulLineNumber = ulLineNumber;
    3913         Error.pszStart = strhdup(pszScriptText);
    3914         Error.ulLength = 0;
    3915         if (ppScriptError)
    3916             *pusErrorTableSize =
    3917                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     4671        msg.SetType(MSG_TYPE_INFO);
     4672        msg.SetMessageValue(MSG_ATTRIBUTE_EXECUTE_MISSING);
     4673        msg.SetLineNumber(p_ulLineNumber);
     4674        _messageLogger.LogMessage(msg);
    39184675        return NULL;
    39194676        }
    39204677    ulAttrLen = strlen(pszAttr);
    39214678    delete [] pszAttr;
    3922     return pszScriptText + ulOffset + ulAttrLen + 1;
     4679    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    39234680    }
    39244681
     
    39304687/****************************************************************************
    39314688 ****************************************************************************
    3932         ScriptClearProfile class:
    3933 
    3934  ****************************************************************************
    3935  *  ScriptClearProfile class member functions:
    3936  *  ScriptClearProfile      Constructor.
    3937  *  ~ScriptClearProfile     Destructor.
    3938  *  SetProfileString        Sets profile strting.
    3939  *  SetApplication          Sets application string.
    3940  *  SetKey                  Sets key string.
    3941  *  SetProfile              Sets all fileds.
    3942  *  SetIndex                Sets index number.
    3943  *  ReturnProfileString     Returns const pointer to profile string.
    3944  *  ReturnApplication       Returns const pointer to application string.
    3945  *  ReturnKey               Returns const pointer to key string.
    3946  *  ReturnProfile           Returns profile data.
    3947  *  ReturnIndex             Returns index number.
    3948  *  MakeScriptText          Returns pointer to script text.
    3949  *  BuildFromText
     4689        @@ScriptClearProfile class:
     4690
     4691    <B>Description:</B>
     4692        This class is for CLEARPROFILE attribute in CONFIGSYS tag. Detailed
     4693        information about the meaning of the attribute can be found
     4694        from <I>WarpIN Programmer's Guide and Reference</I>.
     4695
     4696    Member functions:
     4697        ScriptClearProfile      Constructor.
     4698        ~ScriptClearProfile     Destructor.
     4699        SetProfileString        Sets profile strting.
     4700        SetApplication          Sets application string.
     4701        SetKey                  Sets key string.
     4702        SetProfile              Sets all fileds.
     4703        ReturnProfileString     Returns const pointer to profile string.
     4704        ReturnApplication       Returns const pointer to application string.
     4705        ReturnKey               Returns const pointer to key string.
     4706        ReturnProfile           Returns profile data.
     4707        MakeScriptText          Returns pointer to script text.
     4708        BuildFromText
    39504709 ***************************************************************************/
    39514710
    39524711
    3953 /***************************************************************************
    3954  *@@ ScriptClearProfile::ScriptClearProfile
     4712/*
     4713 *@@ScriptClearProfile:
    39554714 *  Constructor for ScriptClearProfile class. Initializes object by setting
    39564715 *  strings to zero and sets index number too.
    39574716 */
    3958 ScriptClearProfile::ScriptClearProfile(USHORT usIndex)
    3959     {
    3960     this->usIndex = usIndex;
    3961     *szProfileString = '\0';
    3962     *szApplication = '\0';
    3963     *szKey = '\0';
    3964     }
    3965 
    3966 
    3967 
    3968 
    3969 /***************************************************************************
    3970  *@@ ScriptClearProfile::~ScriptClearProfile
     4717ScriptClearProfile::ScriptClearProfile(USHORT p_usIndex)
     4718    {
     4719    SetIndex(p_usIndex);
     4720    *_szProfileString = '\0';
     4721    *_szApplication = '\0';
     4722    *_szKey = '\0';
     4723    }
     4724
     4725
     4726/*
     4727 *@@~ScriptClearProfile:
    39714728 *  Destructor for ScriptClearProfile class.
    39724729 */
    3973 ScriptClearProfile::~ScriptClearProfile() {}
    3974 
    3975 
    3976 
    3977 
    3978 /***************************************************************************
    3979  *@@ ScriptClearProfile::SetProfileString
    3980  *  Sets szProfileString string text.
    3981  */
    3982 void ScriptClearProfile::SetProfileString(const PSZ pszProfile)
    3983     {
    3984     if (strlen(pszProfile) < CCHMAXPATH)
    3985         strcpy(this->szProfileString, pszProfile);
    3986     }
    3987 
    3988 
    3989 
    3990 /***************************************************************************
     4730ScriptClearProfile::~ScriptClearProfile()
     4731    {
     4732    }
     4733
     4734
     4735/*
     4736 *@@SetProfileString:
     4737 *  Sets _szProfileString string text.
     4738 */
     4739USHORT ScriptClearProfile::SetProfileString(const PSZ p_pszProfile)
     4740    {
     4741    Message msg;
     4742    USHORT rc = NO_ERROR;
     4743    if (strlen(p_pszProfile) < CCHMAXPATH)
     4744        strcpy(this->_szProfileString, p_pszProfile);
     4745    else
     4746        {
     4747        msg.SetType(MSG_TYPE_ERROR);
     4748        msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_PROFILE_STRTOOLONG);
     4749        msg.SetMessageText(p_pszProfile);
     4750        _messageLogger.LogMessage(msg);
     4751        rc = STRING_TOO_LONG;
     4752        }
     4753
     4754    return rc;
     4755    }
     4756
     4757
     4758/*
    39914759 *@@ ScriptClearProfile::SetApplication
    3992  *  Sets szApplication string text.
    3993  */
    3994 void ScriptClearProfile::SetApplication(const PSZ pszApplication)
    3995     {
    3996     if (strlen(pszApplication) < MAXPROFILEAPPLICATIONLENGTH)
    3997         strcpy(this->szApplication, pszApplication);
    3998     }
    3999 
    4000 
    4001 
    4002 /***************************************************************************
    4003  *@@ ScriptClearProfile::SetKey
     4760 *  Sets _szApplication string text.
     4761 */
     4762USHORT ScriptClearProfile::SetApplication(const PSZ p_pszApplication)
     4763    {
     4764    Message msg;
     4765    USHORT rc = NO_ERROR;
     4766    if (strlen(p_pszApplication) < MAXPROFILEAPPLICATIONLENGTH)
     4767        strcpy(this->_szApplication, p_pszApplication);
     4768    else
     4769        {
     4770        msg.SetType(MSG_TYPE_ERROR);
     4771        msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_APPL_STRTOOLONG);
     4772        msg.SetMessageText(p_pszApplication);
     4773        _messageLogger.LogMessage(msg);
     4774        rc = STRING_TOO_LONG;
     4775        }
     4776
     4777    return rc;
     4778    }
     4779
     4780
     4781/*
     4782 *@@SetKey:
    40044783 *  Sets szKey string text.
    40054784 */
    4006 void ScriptClearProfile::SetKey(const PSZ pszKey)
    4007     {
    4008     if (strlen(pszKey) < MAXPROFILEKEYLENGTH)
    4009         strcpy(this->szKey, pszKey);
    4010     }
    4011 
    4012 
    4013 
    4014 /***************************************************************************
    4015  *@@ ScriptClearProfile::SetProfile
     4785USHORT ScriptClearProfile::SetKey(const PSZ p_pszKey)
     4786    {
     4787    Message msg;
     4788    USHORT rc = NO_ERROR;
     4789    if (strlen(p_pszKey) < MAXPROFILEKEYLENGTH)
     4790        strcpy(this->_szKey, p_pszKey);
     4791    else
     4792        {
     4793        msg.SetType(MSG_TYPE_ERROR);
     4794        msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_KEY_STRTOOLONG);
     4795        msg.SetMessageText(p_pszKey);
     4796        _messageLogger.LogMessage(msg);
     4797        rc = STRING_TOO_LONG;
     4798        }
     4799
     4800    return rc;
     4801    }
     4802
     4803
     4804/*
     4805 *@@SetProfile:
    40164806 *  Sets all string texts.
    40174807 */
    4018 void ScriptClearProfile::SetProfile(PROFILEDATA profile)
    4019     {
    4020     if (strlen(profile.szProfile) < CCHMAXPATH)
    4021         strcpy(this->szProfileString, profile.szProfile);
    4022     if (strlen(profile.szApplication) < MAXPROFILEAPPLICATIONLENGTH)
    4023         strcpy(this->szApplication, profile.szApplication);
    4024     if (strlen(profile.szKey) < MAXPROFILEKEYLENGTH)
    4025         strcpy(this->szKey, profile.szKey);
    4026     }
    4027 
    4028 
    4029 
    4030 
    4031 /***************************************************************************
    4032  *@@ ScriptClearProfile::SetIndex
    4033  *  Sets object's index.
    4034  */
    4035 void ScriptClearProfile::SetIndex(USHORT usIndex)
    4036     {
    4037     this->usIndex = usIndex;
    4038     }
    4039 
    4040 
    4041 
    4042 /***************************************************************************
    4043  *@@ ScriptClearProfile::ReturnProfileString
     4808USHORT ScriptClearProfile::SetProfile(PROFILEDATA p_profile)
     4809    {
     4810    USHORT rc = NO_ERROR;
     4811    if (SetProfileString(p_profile.szProfile) != NO_ERROR)
     4812        rc = STRING_TOO_LONG;
     4813    if (SetApplication(p_profile.szApplication) != NO_ERROR)
     4814        rc = STRING_TOO_LONG;
     4815    if (SetKey(p_profile.szKey) != NO_ERROR)
     4816        rc = STRING_TOO_LONG;
     4817    return rc;
     4818    }
     4819
     4820
     4821/*
     4822 *ReturnProfileString:
    40444823 *  Returns const pointer to szProfileString string.
    40454824 */
    40464825const PSZ ScriptClearProfile::ReturnProfileString()
    40474826    {
    4048     return szProfileString;
    4049     }
    4050 
    4051 
    4052 
    4053 /***************************************************************************
    4054  *@@ ScriptClearProfile::ReturnApplication
     4827    return _szProfileString;
     4828    }
     4829
     4830
     4831/*
     4832 *@@ReturnApplication:
    40554833 *  Returns const pointer to szApplication string.
    40564834 */
    40574835const PSZ ScriptClearProfile::ReturnApplication()
    40584836    {
    4059     return szApplication;
    4060     }
    4061 
    4062 
    4063 
    4064 /***************************************************************************
    4065  *@@ ScriptClearProfile::ReturnKey
     4837    return _szApplication;
     4838    }
     4839
     4840
     4841/*
     4842 *@@ReturnKey:
    40664843 *  Returns const pointer to szKey string.
    40674844 */
    40684845const PSZ ScriptClearProfile::ReturnKey()
    40694846    {
    4070     return szKey;
    4071     }
    4072 
    4073 
    4074 
    4075 /***************************************************************************
    4076  *@@ ScriptClearProfile::ReturnProfile
     4847    return _szKey;
     4848    }
     4849
     4850
     4851/*
     4852 *@@ReturnProfile
    40774853 *  Sets all string texts.
    40784854 */
     
    40814857    PROFILEDATA profile;
    40824858
    4083     strcpy(profile.szProfile, this->szProfileString);
    4084     strcpy(profile.szApplication, this->szApplication);
    4085     strcpy(profile.szKey, this->szKey);
     4859    strcpy(profile.szProfile, this->_szProfileString);
     4860    strcpy(profile.szApplication, this->_szApplication);
     4861    strcpy(profile.szKey, this->_szKey);
    40864862
    40874863    return profile;
     
    40894865
    40904866
    4091 
    4092 
    4093 /***************************************************************************
    4094  *@@ ScriptClearProfile::ReturnIndex
    4095  *  Returns index number.
    4096  */
    4097 USHORT ScriptClearProfile::ReturnIndex()
    4098     {
    4099     return usIndex;
    4100     }
    4101 
    4102 
    4103 
    4104 /***************************************************************************
    4105  *@@ ScriptClearProfile::MakeScriptText
    4106  *  Returns pointer to script text.
    4107  */
    4108 PSZ ScriptClearProfile::MakeScriptText(BOOL bAttribute)
     4867/*
     4868 *@@MakeScriptText:
     4869 */
     4870PSZ ScriptClearProfile::MakeScriptText(BOOL p_bAttribute)
    41094871    {
    41104872    ULONG ulTextLength = 0;
    41114873    PSZ pszScriptText = NULL;
    4112     PSZ pszApplication = '\0';
    4113     PSZ pszKey = '\0';
    4114     CHAR szTemp[1024];
    4115     szTemp[0]='\0';
    4116 
    4117     ulTextLength = strlen(szProfileString) + strlen(szApplication) +
    4118         strlen(szKey) + 2;
    4119 
    4120     /*if (strlen(szApplication) != 0)
    4121         {
    4122         strcpy(pszApplication, this->szApplication);
    4123         }
    4124     if (strlen(szKey) != 0)
    4125         {
    4126         strcpy(szKey, this->szKey);
    4127         }*/
    4128 
    4129     if (bAttribute)
     4874
     4875    ulTextLength = strlen(_szProfileString) + strlen(_szApplication) +
     4876        strlen(_szKey) + 2;
     4877
     4878
     4879    if (p_bAttribute)
    41304880        ulTextLength += strlen(SZ_ATTRIBUTE_CLEARPROFILE) + 3;
    41314881
     
    41334883    *pszScriptText = '\0';
    41344884
    4135     if (bAttribute)
     4885    if (p_bAttribute)
    41364886        sprintf(pszScriptText, "%s=\"%s\\%s\\%s\"", SZ_ATTRIBUTE_CLEARPROFILE,
    4137                 szProfileString, szApplication, szKey);
     4887                _szProfileString, _szApplication, _szKey);
    41384888    else
    4139         sprintf(pszScriptText, "%s\\%s\\%s", szProfileString, szApplication,
    4140             szKey);
    4141     //xstrcat(&strScriptText, szTemp);
     4889        sprintf(pszScriptText, "%s\\%s\\%s", _szProfileString, _szApplication,
     4890            _szKey);
    41424891
    41434892    return pszScriptText;
     
    41454894
    41464895
    4147 /***************************************************************************
    4148  *@@ScriptClearProfile::BuildFromText
    4149  *  Builds clearprofile object  accordingly to script text. If any errors is found
    4150  *  in script text, error informations are returned in table where to
    4151  *  *pScriptError points. Pointer to after end of tag is returned so multiple
    4152  *  searches can be done.
    4153  */
    4154 PSZ ScriptClearProfile::BuildFromText(PSZ pszScriptText,
    4155                                       SCRIPTERROR **ppScriptError,
    4156                                       USHORT *pusErrorTableSize,
    4157                                       ULONG ulLineNumber)
    4158     {
    4159     SCRIPTERROR Error;
     4896/*
     4897 *@@BuildFromText:
     4898 *  Builds clearprofile object  accordingly to script text.
     4899 */
     4900PSZ ScriptClearProfile::BuildFromText(PSZ p_pszScriptText,
     4901                                      ULONG p_ulLineNumber)
     4902    {
     4903    Message msg;
    41604904    PSZ pszTemp = NULL;
    41614905    PSZ pszTemp1 = NULL;
     
    41654909
    41664910
    4167     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_CLEARPROFILE, &ulOffset);
     4911    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_CLEARPROFILE, &ulOffset);
    41684912    if (pszAttr)
    41694913        {
     
    41734917            // Get profile string.
    41744918            pszString = strhSubstr(pszAttr, pszTemp);
    4175             if (strlen(pszString) < CCHMAXPATH)
     4919            if (pszString)
    41764920                this->SetProfileString(pszString);
    41774921            else
    41784922                {
    4179                 Error.usErrorCode = ERR_PARSE_CLEARPROFILE_STRINGTOOLONG;
    4180                 Error.ulLineNumber = ulLineNumber;
    4181                 Error.pszStart = strhdup(pszString);
    4182                 Error.ulLength = 0;
    4183                 if (ppScriptError)
    4184                     *pusErrorTableSize =
    4185                         AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     4923                msg.SetType(MSG_TYPE_WARNING);
     4924                msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_PROFILE_MISSING);
     4925                msg.SetLineNumber(p_ulLineNumber);
     4926                _messageLogger.LogMessage(msg);
    41864927                }
    41874928            delete [] pszString;
     
    41904931                {
    41914932                pszString = strhSubstr(pszTemp + 1, pszTemp1);
    4192                 if (strlen(pszString) < MAXPROFILEAPPLICATIONLENGTH)
     4933                if (pszString)
    41934934                    this->SetApplication(pszString);
    41944935                else
    41954936                    {
    4196                     Error.usErrorCode = ERR_PARSE_CLEARPROFILE_STRINGTOOLONG;
    4197                     Error.ulLineNumber = ulLineNumber;
    4198                     Error.pszStart = strhdup(pszString);
    4199                     Error.ulLength = 0;
    4200                     if (ppScriptError)
    4201                         *pusErrorTableSize =
    4202                             AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     4937                    msg.SetType(MSG_TYPE_WARNING);
     4938                    msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_APPL_MISSING);
     4939                    msg.SetLineNumber(p_ulLineNumber);
     4940                    _messageLogger.LogMessage(msg);
    42034941                    }
    42044942                delete [] pszString;
    42054943
    4206                 if (strlen(pszTemp1 + 1) < MAXPROFILEKEYLENGTH)
     4944                if (*(pszTemp1 + 1) != '\0')
    42074945                    this->SetKey(pszTemp1 + 1);
    42084946                else
    42094947                    {
    4210                     Error.usErrorCode = ERR_PARSE_CLEARPROFILE_STRINGTOOLONG;
    4211                     Error.ulLineNumber = ulLineNumber;
    4212                     Error.pszStart = strhdup(pszTemp1);
    4213                     Error.ulLength = 0;
    4214                     if (ppScriptError)
    4215                         *pusErrorTableSize =
    4216                             AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     4948                    msg.SetType(MSG_TYPE_WARNING);
     4949                    msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_KEY_MISSING);
     4950                    msg.SetLineNumber(p_ulLineNumber);
     4951                    _messageLogger.LogMessage(msg);
    42174952                    }
    42184953                }
    42194954            else
    42204955                {
    4221                 if (strlen(pszTemp + 1) < MAXPROFILEAPPLICATIONLENGTH)
    4222                     this->SetKey(pszTemp + 1);
     4956                if (*(pszTemp + 1) != '\0')
     4957                    this->SetApplication(pszTemp + 1);
    42234958                else
    42244959                    {
    4225                     Error.usErrorCode = ERR_PARSE_CLEARPROFILE_STRINGTOOLONG;
    4226                     Error.ulLineNumber = ulLineNumber;
    4227                     Error.pszStart = strhdup(pszTemp + 1);
    4228                     Error.ulLength = 0;
    4229                     if (ppScriptError)
    4230                         *pusErrorTableSize =
    4231                             AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     4960                    msg.SetType(MSG_TYPE_WARNING);
     4961                    msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_APPL_MISSING);
     4962                    msg.SetLineNumber(p_ulLineNumber);
     4963                    _messageLogger.LogMessage(msg);
    42324964                    }
    42334965                }
     
    42364968            {
    42374969            // Get profile string.
    4238             this->SetProfileString(pszAttr);
    4239             if (strlen(pszAttr) < CCHMAXPATH)
     4970            if (pszAttr)
    42404971                this->SetProfileString(pszAttr);
    42414972            else
    42424973                {
    4243                 Error.usErrorCode = ERR_PARSE_CLEARPROFILE_STRINGTOOLONG;
    4244                 Error.ulLineNumber = ulLineNumber;
    4245                 Error.pszStart = strhdup(pszString);
    4246                 Error.ulLength = 0;
    4247                 if (ppScriptError)
    4248                     *pusErrorTableSize =
    4249                         AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     4974                msg.SetType(MSG_TYPE_WARNING);
     4975                msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_PROFILE_MISSING);
     4976                msg.SetLineNumber(p_ulLineNumber);
     4977                _messageLogger.LogMessage(msg);
    42504978                }
    42514979            delete [] pszString;
     
    42544982    else
    42554983        {
    4256         Error.usErrorCode = ERR_PARSE_CLEARPROFILE_NOTFOUND;
    4257         Error.ulLineNumber = ulLineNumber;
    4258         Error.pszStart = strhdup(pszScriptText);
    4259         Error.ulLength = 0;
    4260         if (ppScriptError)
    4261             *pusErrorTableSize =
    4262                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     4984        msg.SetType(MSG_TYPE_WARNING);
     4985        msg.SetMessageValue(MSG_ATTRIBUTE_CLRPROFILE_MISSING);
     4986        msg.SetLineNumber(p_ulLineNumber);
     4987        _messageLogger.LogMessage(msg);
    42634988        return NULL;
    42644989        }
     
    42664991    ulAttrLen = strlen(pszAttr);
    42674992    delete [] pszAttr;
    4268     return pszScriptText + ulOffset + ulAttrLen + 1;
     4993    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    42694994    }
    42704995
     
    42765001        ScriptWriteProfile class:
    42775002
    4278  ****************************************************************************
    4279  *  ScriptWriteProfile class member functions:
    4280  *  ScriptWriteProfile      Constructor.
    4281  *  ~ScriptWriteProfile     Destructor.
    4282  *  SetProfileString        Sets profile strting.
    4283  *  SetApplication          Sets application string.
    4284  *  SetString               Sets string to be stored to INI file.
    4285  *  SetKey                  Sets key string.
    4286  *  SetProfile              Sets all fileds.
    4287  *  SetIndex                Sets index number.
    4288  *  ReturnProfileString     Returns const pointer to profile string.
    4289  *  ReturnApplication       Returns const pointer to application string.
    4290  *  ReturnKey               Returns const pointer to key string.
    4291  *  ReturnProfile           Returns profile data.
    4292  *  ReturnIndex             Returns index number.
    4293  *  MakeScriptText          Returns pointer to script text.
    4294  *  BuildFromText
     5003    <B>Description:</B>
     5004        This class is for WRITEPROFILE attribute in CONFIGSYS tag. Detailed
     5005        information about the meaning of the attribute can be found
     5006        from <I>WarpIN Programmer's Guide and Reference</I>.
     5007
     5008    Member functions:
     5009        ScriptWriteProfile      Constructor.
     5010        ~ScriptWriteProfile     Destructor.
     5011        SetProfileString        Sets profile strting.
     5012        SetApplication          Sets application string.
     5013        SetString               Sets string to be stored to INI file.
     5014        SetKey                  Sets key string.
     5015        SetProfile              Sets all fileds.
     5016        ReturnProfileString     Returns const pointer to profile string.
     5017        ReturnApplication       Returns const pointer to application string.
     5018        ReturnKey               Returns const pointer to key string.
     5019        ReturnProfile           Returns profile data.
     5020        MakeScriptText          Returns pointer to script text.
     5021        BuildFromText
    42955022 ***************************************************************************/
    42965023
    42975024
    4298 /***************************************************************************
    4299  *@@ ScriptWriteProfile::ScriptWriteProfile
     5025/*
     5026 *@@ScriptWriteProfile:
    43005027 *  Constructor for ScriptWriteProfile class. Initializes object by setting
    43015028 *  strings to zero and sets index number too.
    43025029 */
    4303 ScriptWriteProfile::ScriptWriteProfile(USHORT usIndex)
    4304     {
    4305     this->usIndex = usIndex;
    4306     *szProfileString = '\0';
    4307     *szApplication = '\0';
    4308     *szKey = '\0';
    4309     pszString = NULL;
    4310     }
    4311 
    4312 
    4313 
    4314 
    4315 /***************************************************************************
    4316  *@@ ScriptWriteProfile::~ScriptWriteProfile
     5030ScriptWriteProfile::ScriptWriteProfile(USHORT p_usIndex)
     5031    {
     5032    SetIndex(p_usIndex);
     5033    *_szProfileString = '\0';
     5034    *_szApplication = '\0';
     5035    *_szKey = '\0';
     5036    _pszString = NULL;
     5037    }
     5038
     5039
     5040/*
     5041 *@@~ScriptWriteProfile:
    43175042 *  Destructor for ScriptWriteProfile class.
    43185043 */
    43195044ScriptWriteProfile::~ScriptWriteProfile()
    43205045    {
    4321     if (pszString)
    4322         delete [] pszString;
    4323     }
    4324 
    4325 
    4326 
    4327 /***************************************************************************
    4328  *@@ ScriptWriteProfile::~ScriptWriteProfile
     5046    *_szProfileString = '\0';
     5047    *_szApplication = '\0';
     5048    *_szKey = '\0';
     5049    if (_pszString)
     5050        delete [] _pszString;
     5051    _pszString = NULL;
     5052    }
     5053
     5054
     5055/*
     5056 *@@operator=:
    43295057 *  Assignment operator for ScriptWriteProfile class.
    43305058 */
    4331 ScriptWriteProfile &ScriptWriteProfile::operator=(const
    4332                                                  ScriptWriteProfile &writeProfile)
    4333     {
    4334     this->usIndex = writeProfile.usIndex;
    4335     strcpy(this->szProfileString, writeProfile.szProfileString);
    4336     strcpy(this->szApplication, writeProfile.szApplication);
    4337     strcpy(this->szKey, writeProfile.szKey);
    4338     this->pszString = strhdup(writeProfile.pszString);
     5059ScriptWriteProfile &ScriptWriteProfile::operator=
     5060        (ScriptWriteProfile &p_writeProfile)
     5061    {
     5062    SetIndex(p_writeProfile.ReturnIndex());
     5063    SetProfileString(p_writeProfile.ReturnProfileString());
     5064    SetApplication(p_writeProfile.ReturnApplication());
     5065    SetKey(p_writeProfile.ReturnKey());
     5066    SetString(p_writeProfile.ReturnString());
    43395067    return (*this);
    43405068    }
    43415069
    43425070
    4343 
    4344 
    4345 /***************************************************************************
    4346  *@@ ScriptWriteProfile::SetProfileString
     5071/*
     5072 *@@SetProfileString:
    43475073 *  Sets szProfileString string text.
    43485074 */
    4349 void ScriptWriteProfile::SetProfileString(const PSZ pszProfile)
    4350     {
    4351     if (strlen(pszProfile) < CCHMAXPATH)
    4352         strcpy(this->szProfileString, pszProfile);
    4353     }
    4354 
    4355 
    4356 
    4357 /***************************************************************************
    4358  *@@ ScriptWriteProfile::SetApplication
     5075USHORT ScriptWriteProfile::SetProfileString(const PSZ p_pszProfile)
     5076    {
     5077
     5078    Message msg;
     5079    USHORT rc = NO_ERROR;
     5080    if (strlen(p_pszProfile) < CCHMAXPATH)
     5081        strcpy(this->_szProfileString, p_pszProfile);
     5082    else
     5083        {
     5084        msg.SetType(MSG_TYPE_ERROR);
     5085        msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_PROFILE_STRTOOLONG);
     5086        msg.SetMessageText(p_pszProfile);
     5087        _messageLogger.LogMessage(msg);
     5088        rc = STRING_TOO_LONG;
     5089        }
     5090
     5091    return rc;
     5092    }
     5093
     5094
     5095/*
     5096 *@@SetApplication:
    43595097 *  Sets szApplication string text.
    43605098 */
    4361 void ScriptWriteProfile::SetApplication(const PSZ pszApplication)
    4362     {
    4363     if (strlen(pszApplication) < MAXPROFILEAPPLICATIONLENGTH)
    4364         strcpy(this->szApplication, pszApplication);
    4365     }
    4366 
    4367 
    4368 
    4369 /***************************************************************************
    4370  *@@ ScriptWriteProfile::SetKey
     5099USHORT ScriptWriteProfile::SetApplication(const PSZ p_pszApplication)
     5100    {
     5101    Message msg;
     5102    USHORT rc = NO_ERROR;
     5103    if (strlen(p_pszApplication) < MAXPROFILEAPPLICATIONLENGTH)
     5104        strcpy(this->_szApplication, p_pszApplication);
     5105    else
     5106        {
     5107        msg.SetType(MSG_TYPE_ERROR);
     5108        msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_APPL_STRTOOLONG);
     5109        msg.SetMessageText(p_pszApplication);
     5110        _messageLogger.LogMessage(msg);
     5111        rc = STRING_TOO_LONG;
     5112        }
     5113
     5114    return rc;
     5115    }
     5116
     5117
     5118
     5119/*
     5120 *@@SetKey:
    43715121 *  Sets szKey string text.
    43725122 */
    4373 void ScriptWriteProfile::SetKey(const PSZ pszKey)
    4374     {
    4375     if (strlen(pszKey) < MAXPROFILEKEYLENGTH)
    4376         strcpy(this->szKey, pszKey);
    4377     }
    4378 
    4379 
    4380 /***************************************************************************
    4381  *@@ ScriptWriteProfile::SetString
     5123USHORT ScriptWriteProfile::SetKey(const PSZ p_pszKey)
     5124    {
     5125    Message msg;
     5126    USHORT rc = NO_ERROR;
     5127    if (strlen(p_pszKey) < MAXPROFILEKEYLENGTH)
     5128        strcpy(this->_szKey, p_pszKey);
     5129    else
     5130        {
     5131        msg.SetType(MSG_TYPE_ERROR);
     5132        msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_KEY_STRTOOLONG);
     5133        msg.SetMessageText(p_pszKey);
     5134        _messageLogger.LogMessage(msg);
     5135        rc = STRING_TOO_LONG;
     5136        }
     5137
     5138    return rc;
     5139    }
     5140
     5141
     5142/*
     5143 *@@SetString:
    43825144 *  Sets pszString text.
    43835145 */
    4384 void ScriptWriteProfile::SetString(const PSZ pszString)
    4385     {
    4386     if (pszString)
    4387         this->pszString = strhdup(pszString);
    4388     }
    4389 
    4390 
    4391 
    4392 /***************************************************************************
    4393  *@@ ScriptWriteProfile::SetProfile
     5146USHORT ScriptWriteProfile::SetString(const PSZ p_pszString)
     5147    {
     5148    Message msg;
     5149    USHORT rc = NO_ERROR;
     5150    if (p_pszString)
     5151        this->_pszString = strhdup(p_pszString);
     5152    }
     5153
     5154
     5155/*
     5156 *@@SetProfile:
    43945157 *  Sets all string texts.
    43955158 */
    4396 void ScriptWriteProfile::SetProfile(PROFILEDATA profile)
    4397     {
    4398     if (strlen(profile.szProfile) < CCHMAXPATH)
    4399         strcpy(this->szProfileString, profile.szProfile);
    4400     if (strlen(profile.szApplication) < MAXPROFILEAPPLICATIONLENGTH)
    4401         strcpy(this->szApplication, profile.szApplication);
    4402     if (strlen(profile.szKey) < MAXPROFILEKEYLENGTH)
    4403         strcpy(this->szKey, profile.szKey);
    4404     }
    4405 
    4406 
    4407 
    4408 
    4409 /***************************************************************************
    4410  *@@ ScriptWriteProfile::SetIndex
    4411  *  Sets object's index.
    4412  */
    4413 void ScriptWriteProfile::SetIndex(USHORT usIndex)
    4414     {
    4415     this->usIndex = usIndex;
    4416     }
    4417 
    4418 
    4419 
    4420 /***************************************************************************
    4421  *@@ ScriptWriteProfile::ReturnProfileString
     5159USHORT ScriptWriteProfile::SetProfile(PROFILEDATA p_profile)
     5160    {
     5161    USHORT rc = NO_ERROR;
     5162    if (SetProfileString(p_profile.szProfile) != NO_ERROR)
     5163        rc = STRING_TOO_LONG;
     5164    if (SetApplication(p_profile.szApplication) != NO_ERROR)
     5165        rc = STRING_TOO_LONG;
     5166    if (SetKey(p_profile.szKey) != NO_ERROR)
     5167        rc = STRING_TOO_LONG;
     5168    return rc;
     5169    }
     5170
     5171
     5172/*
     5173 *@@ReturnProfileString:
    44225174 *  Returns const pointer to szProfileString string.
    44235175 */
    4424 const PSZ ScriptWriteProfile::ReturnProfileString()
    4425     {
    4426     return szProfileString;
    4427     }
    4428 
    4429 
    4430 
    4431 /***************************************************************************
    4432  *@@ ScriptWriteProfile::ReturnApplication
     5176const PSZ ScriptWriteProfile::ReturnProfileString() const
     5177    {
     5178    return (PSZ)_szProfileString;
     5179    }
     5180
     5181
     5182/*
     5183 *@@ReturnApplication:
    44335184 *  Returns const pointer to szApplication string.
    44345185 */
    4435 const PSZ ScriptWriteProfile::ReturnApplication()
    4436     {
    4437     return szApplication;
    4438     }
    4439 
    4440 
    4441 
    4442 /***************************************************************************
    4443  *@@ ScriptWriteProfile::ReturnKey
     5186const PSZ ScriptWriteProfile::ReturnApplication() const
     5187    {
     5188    return (PSZ)_szApplication;
     5189    }
     5190
     5191
     5192
     5193/*
     5194 *@@ReturnKey:
    44445195 *  Returns const pointer to szKey string.
    44455196 */
    4446 const PSZ ScriptWriteProfile::ReturnKey()
    4447     {
    4448     return szKey;
    4449     }
    4450 
    4451 
    4452 /***************************************************************************
    4453  *@@ ScriptWriteProfile::ReturnString
     5197const PSZ ScriptWriteProfile::ReturnKey() const
     5198    {
     5199    return (PSZ)_szKey;
     5200    }
     5201
     5202
     5203/*
     5204 *@@ReturnString:
    44545205 *  Returns const pointer to szProfileString string.
    44555206 */
    4456 const PSZ ScriptWriteProfile::ReturnString()
    4457     {
    4458     return pszString;
    4459     }
    4460 
    4461 
    4462 /***************************************************************************
     5207const PSZ ScriptWriteProfile::ReturnString() const
     5208    {
     5209    return _pszString;
     5210    }
     5211
     5212
     5213/*
    44635214 *@@ ScriptWriteProfile::ReturnProfile
    44645215 *  Sets all string texts.
     
    44685219    PROFILEDATA profile;
    44695220
    4470     strcpy(profile.szProfile, this->szProfileString);
    4471     strcpy(profile.szApplication, this->szApplication);
    4472     strcpy(profile.szKey, this->szKey);
     5221    strcpy(profile.szProfile, this->_szProfileString);
     5222    strcpy(profile.szApplication, this->_szApplication);
     5223    strcpy(profile.szKey, this->_szKey);
    44735224
    44745225    return profile;
     
    44765227
    44775228
    4478 
    4479 
    4480 /***************************************************************************
    4481  *@@ ScriptWriteProfile::ReturnIndex
    4482  *  Returns index number.
    4483  */
    4484 USHORT ScriptWriteProfile::ReturnIndex()
    4485     {
    4486     return usIndex;
    4487     }
    4488 
    4489 
    4490 
    4491 /***************************************************************************
    4492  *@@ ScriptWriteProfile::MakeScriptText
    4493  *  Returns pointer to script text.
    4494  */
    4495 PSZ ScriptWriteProfile::MakeScriptText(BOOL bAttribute)
     5229/*
     5230 *@@MakeScriptText:
     5231 *  Returns pointer to script text. The text is based on the object's datas.
     5232 */
     5233PSZ ScriptWriteProfile::MakeScriptText(BOOL p_bAttribute)
    44965234    {
    44975235    ULONG ulTextLength = 0;
    44985236    PSZ pszScriptText = NULL;
    44995237
    4500     if (!pszString)
     5238    if (!_pszString)
    45015239        return FALSE;
    45025240
    4503     ulTextLength = strlen(szProfileString) + strlen(szApplication) +
    4504         strlen(szKey) + strlen(pszString) + 3;
    4505 
    4506 
    4507     if (bAttribute)
     5241    ulTextLength = strlen(_szProfileString) + strlen(_szApplication) +
     5242        strlen(_szKey) + strlen(_pszString) + 3;
     5243
     5244
     5245    if (p_bAttribute)
    45085246        ulTextLength += strlen(SZ_ATTRIBUTE_WRITEPROFILE) + 3;
    45095247
     
    45115249    *pszScriptText = '\0';
    45125250
    4513     if (bAttribute)
     5251    if (p_bAttribute)
    45145252        sprintf(pszScriptText, "%s=\"%s\\%s\\%s|%s\"", SZ_ATTRIBUTE_WRITEPROFILE,
    4515                 szProfileString, szApplication, szKey, pszString);
     5253                _szProfileString, _szApplication, _szKey, _pszString);
    45165254    else
    4517         sprintf(pszScriptText, "%s\\%s\\%s|%s", szProfileString, szApplication,
    4518                szKey, pszString);
     5255        sprintf(pszScriptText, "%s\\%s\\%s|%s", _szProfileString, _szApplication,
     5256               _szKey, _pszString);
    45195257
    45205258
     
    45235261
    45245262
    4525 /***************************************************************************
    4526  *@@ScriptWriteProfile::BuildFromText
    4527  *  Builds clearprofile object  accordingly to script text. If any errors is found
    4528  *  in script text, error informations are returned in table where to
    4529  *  *pScriptError points. Pointer to after end of tag is returned so multiple
    4530  *  searches can be done.
    4531  */
    4532 PSZ ScriptWriteProfile::BuildFromText(PSZ pszScriptText,
    4533                                       SCRIPTERROR **ppScriptError,
    4534                                       USHORT *pusErrorTableSize,
    4535                                       ULONG ulLineNumber)
    4536     {
    4537     SCRIPTERROR Error;
     5263/*
     5264 *@@BuildFromText:
     5265 *  Builds clearprofile object  accordingly to script text.
     5266 */
     5267PSZ ScriptWriteProfile::BuildFromText(PSZ p_pszScriptText,
     5268                                      ULONG p_ulLineNumber)
     5269    {
     5270    Message msg;
    45385271    PSZ pszTemp = NULL;
    45395272    PSZ pszTemp1 = NULL;
     
    45435276
    45445277
    4545     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_WRITEPROFILE, &ulOffset);
     5278    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_WRITEPROFILE, &ulOffset);
    45465279    if (pszAttr)
    45475280        {
     
    45515284            // Get profile string.
    45525285            pszString = strhSubstr(pszAttr, pszTemp);
    4553             if (strlen(pszString) < CCHMAXPATH)
     5286            if (pszString)
    45545287                this->SetProfileString(pszString);
    45555288            else
    45565289                {
    4557                 Error.usErrorCode = ERR_PARSE_WRITEPROFILE_STRINGTOOLONG;
    4558                 Error.ulLineNumber = ulLineNumber;
    4559                 Error.pszStart = strhdup(pszString);
    4560                 Error.ulLength = 0;
    4561                 if (ppScriptError)
    4562                     *pusErrorTableSize =
    4563                         AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     5290                msg.SetType(MSG_TYPE_WARNING);
     5291                msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_PROFILE_MISSING);
     5292                msg.SetLineNumber(p_ulLineNumber);
     5293                _messageLogger.LogMessage(msg);
    45645294                }
    45655295            delete [] pszString;
     
    45685298                {
    45695299                pszString = strhSubstr(pszTemp + 1, pszTemp1);
    4570                 if (strlen(pszString) < MAXPROFILEAPPLICATIONLENGTH)
     5300                if (pszString)
    45715301                    this->SetApplication(pszString);
    45725302                else
    45735303                    {
    4574                     Error.usErrorCode = ERR_PARSE_CLEARPROFILE_STRINGTOOLONG;
    4575                     Error.ulLineNumber = ulLineNumber;
    4576                     Error.pszStart = strhdup(pszString);
    4577                     Error.ulLength = 0;
    4578                     if (ppScriptError)
    4579                         *pusErrorTableSize =
    4580                             AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     5304                    msg.SetType(MSG_TYPE_WARNING);
     5305                    msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_APPL_MISSING);
     5306                    msg.SetLineNumber(p_ulLineNumber);
     5307                    _messageLogger.LogMessage(msg);
    45815308                    }
    45825309                delete [] pszString;
     
    45865313                    {
    45875314                    pszString = strhSubstr(pszTemp + 1, pszTemp1);
    4588                     if (strlen(pszString) < MAXPROFILEKEYLENGTH)
     5315                    if (pszString)
    45895316                        this->SetKey(pszString);
    45905317                    else
    45915318                        {
    4592                         Error.usErrorCode = ERR_PARSE_CLEARPROFILE_STRINGTOOLONG;
    4593                         Error.ulLineNumber = ulLineNumber;
    4594                         Error.pszStart = strhdup(pszTemp1);
    4595                         Error.ulLength = 0;
    4596                         if (ppScriptError)
    4597                             *pusErrorTableSize =
    4598                                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     5319                        msg.SetType(MSG_TYPE_WARNING);
     5320                        msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_KEY_MISSING);
     5321                        msg.SetLineNumber(p_ulLineNumber);
     5322                        _messageLogger.LogMessage(msg);
    45995323                        }
    46005324                    delete [] pszString;
     
    46075331                else
    46085332                    {
    4609                     Error.usErrorCode = ERR_PARSE_WRITEPROFILE_STRING_NOTFOUND;
    4610                     Error.ulLineNumber = ulLineNumber;
    4611                     Error.pszStart = strhdup(pszTemp + 1);
    4612                     Error.ulLength = 0;
    4613                     if (ppScriptError)
    4614                         *pusErrorTableSize =
    4615                             AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     5333                    msg.SetType(MSG_TYPE_WARNING);
     5334                    msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_STRING_MISSING);
     5335                    msg.SetLineNumber(p_ulLineNumber);
     5336                    _messageLogger.LogMessage(msg);
    46165337                    }
    46175338                }
    46185339            else
    46195340                {
    4620                 Error.usErrorCode = ERR_PARSE_WRITEPROFILE_KEY_NOTFOUND;
    4621                 Error.ulLineNumber = ulLineNumber;
    4622                 Error.pszStart = strhdup(pszTemp + 1);
    4623                 Error.ulLength = 0;
    4624                 if (ppScriptError)
    4625                     *pusErrorTableSize =
    4626                         AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     5341                msg.SetType(MSG_TYPE_WARNING);
     5342                msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_KEY_MISSING);
     5343                msg.SetLineNumber(p_ulLineNumber);
     5344                _messageLogger.LogMessage(msg);
    46275345                }
    46285346            }
    46295347        else
    46305348            {
    4631             Error.usErrorCode = ERR_PARSE_WRITEPROFILE_APP_NOTFOUND;
    4632             Error.ulLineNumber = ulLineNumber;
    4633             Error.pszStart = strhdup(pszString);
    4634             Error.ulLength = 0;
    4635             if (ppScriptError)
    4636                 *pusErrorTableSize =
    4637                     AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     5349            msg.SetType(MSG_TYPE_WARNING);
     5350            msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_APPL_MISSING);
     5351            msg.SetLineNumber(p_ulLineNumber);
     5352            _messageLogger.LogMessage(msg);
    46385353            }
    46395354        }
    46405355    else
    46415356        {
    4642         Error.usErrorCode = ERR_PARSE_WRITEPROFILE_NOTFOUND;
    4643         Error.ulLineNumber = ulLineNumber;
    4644         Error.pszStart = strhdup(pszScriptText);
    4645         Error.ulLength = 0;
    4646         if (ppScriptError)
    4647             *pusErrorTableSize =
    4648                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     5357        msg.SetType(MSG_TYPE_WARNING);
     5358        msg.SetMessageValue(MSG_ATTRIBUTE_WRITEPROFILE_MISSING);
     5359        msg.SetLineNumber(p_ulLineNumber);
     5360        _messageLogger.LogMessage(msg);
    46495361        return NULL;
    46505362        }
     
    46525364    ulAttrLen = strlen(pszAttr);
    46535365    delete [] pszAttr;
    4654     return pszScriptText + ulOffset + ulAttrLen + 1;
     5366    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    46555367    }
    46565368
     
    46615373/****************************************************************************
    46625374 ****************************************************************************
    4663         ScriptKillProcess class:
    4664 
    4665  ****************************************************************************
    4666  *  ScriptKillProcess class member functions:
    4667  *  ScripitKillProcess   Constructor.
    4668  *  ~ScriptKillProcess   Destructor.
    4669  *  SetFileName     Sets file name text.
    4670  *  SetIndex        Sets KillProcess object ID. Should be used for identification.
    4671  *  ReturnFileName    Returns const pointer to title text.
    4672  *  ReturnIndex     Returns object ID number.
    4673  *  MakeScriptText  Returns pointer to script text.
    4674  *  BuildFromText   Construct object from script text.
     5375        @@ScriptKillProcess class:
     5376
     5377    <B>Description:</B>
     5378        This class is for KILLPROCESS attribute in CONFIGSYS tag. Detailed
     5379        information about the meaning of the attribute can be found
     5380        from <I>WarpIN Programmer's Guide and Reference</I>.
     5381
     5382    Member functions:
     5383        ScripitKillProcess   Constructor.
     5384        ~ScriptKillProcess   Destructor.
     5385        SetFileName     Sets file name text.
     5386        ReturnFileName    Returns const pointer to title text.
     5387        MakeScriptText  Returns pointer to script text.
     5388        BuildFromText   Construct object from script text.
    46755389 ***************************************************************************/
    46765390
    46775391
    4678 /***************************************************************************
    4679  *@@ ScriptKillProcess::ScriptKillProcess
     5392/*
     5393 *@@ScriptKillProcess:
    46805394 *  Constructor for ScriptKillProcess class. Initializes szFileName string by
    46815395 *  setting first char to '\0'.
    46825396 */
    4683 ScriptKillProcess::ScriptKillProcess(USHORT usIndex)
    4684     {
    4685     *szFileName = '\0';
    4686     this->usIndex = usIndex;
    4687     }
    4688 
    4689 
    4690 
    4691 /***************************************************************************
    4692  *@@ ScriptKillProcess::~ScriptKillProcess
     5397ScriptKillProcess::ScriptKillProcess(USHORT p_usIndex)
     5398    {
     5399    *_szFileName = '\0';
     5400    SetIndex(p_usIndex);
     5401    }
     5402
     5403
     5404/*
     5405 *@@~ScriptKillProcess:
    46935406 *  destructor for ScriptKillProcess class. Does nothing special.
    46945407 */
    46955408ScriptKillProcess::~ScriptKillProcess()
    46965409    {
    4697     }
    4698 
    4699 
    4700 /***************************************************************************
    4701  *@@ ScriptFileName::SetFileName
     5410    *_szFileName = '\0';
     5411    }
     5412
     5413
     5414/*
     5415 *@@SetFileName:
    47025416 *  Sets target text.
    47035417 */
    4704 void ScriptKillProcess::SetFileName(const PSZ pszFileName)
    4705     {
    4706     if (strlen(pszFileName) < CCHMAXPATH)
    4707         strcpy(this->szFileName, pszFileName);
    4708     }
    4709 
    4710 
    4711 
    4712 /***************************************************************************
    4713  *@@ ScriptKillProcess::SetIndex
    4714  *  Sets object's index.
    4715  */
    4716 void ScriptKillProcess::SetIndex(USHORT usIndex)
    4717     {
    4718     this->usIndex = usIndex;
    4719     }
    4720 
    4721 
    4722 
    4723 /***************************************************************************
    4724  *@@ ScriptKillProcess::ReturnFileName
     5418USHORT ScriptKillProcess::SetFileName(const PSZ p_pszFileName)
     5419    {
     5420    Message msg;
     5421    USHORT rc = NO_ERROR;
     5422    if (strlen(p_pszFileName) < CCHMAXPATH)
     5423        strcpy(this->_szFileName, p_pszFileName);
     5424    else
     5425        {
     5426        msg.SetType(MSG_TYPE_ERROR);
     5427        msg.SetMessageValue(MSG_ATTRIBUTE_KILLPROCESS_FILENAME_STRTOOLONG);
     5428        msg.SetMessageText(p_pszFileName);
     5429        _messageLogger.LogMessage(msg);
     5430        rc = STRING_TOO_LONG;
     5431        }
     5432    return rc;
     5433    }
     5434
     5435
     5436/*
     5437 *@@ReturnFileName:
    47255438 *  Returns const pointer to file name text.
    47265439 */
    47275440const PSZ ScriptKillProcess::ReturnFileName()
    47285441    {
    4729     return szFileName;
    4730     }
    4731 
    4732 
    4733 
    4734 /***************************************************************************
    4735  *@@ ScriptKillProcess::ReturnIndex
    4736  *  Returns object's index number.
    4737  */
    4738 USHORT ScriptKillProcess::ReturnIndex()
    4739     {
    4740     return usIndex;
    4741     }
    4742 
    4743 
    4744 
    4745 
    4746 /***************************************************************************
    4747  *@@ ScriptKillProcess::MakeScriptText
     5442    return _szFileName;
     5443    }
     5444
     5445
     5446/*
     5447 *@@MakeScriptText:
    47485448 *  Returns pointer to script text.
    47495449 */
    4750 PSZ ScriptKillProcess::MakeScriptText(BOOL bAttribute)
     5450PSZ ScriptKillProcess::MakeScriptText(BOOL p_bAttribute)
    47515451    {
    47525452    ULONG ulTextLength = 0;
    47535453    XSTRING strScriptText;
    47545454    xstrInit(&strScriptText, 0);
    4755     ulTextLength = strlen(szFileName);
     5455    ulTextLength = strlen(_szFileName);
    47565456    CHAR szTemp[1024];
    47575457    *szTemp = '\0';
    47585458
    4759     if (bAttribute)
     5459    if (p_bAttribute)
    47605460        // Length of the attribute, =, " and "
    47615461        ulTextLength += strlen(SZ_ATTRIBUTE_KILLPROCESS) + 3;
    47625462
    4763     if (bAttribute)
    4764         sprintf(szTemp, "%s=\"%s\"", SZ_ATTRIBUTE_KILLPROCESS, szFileName);
     5463    if (p_bAttribute)
     5464        sprintf(szTemp, "%s=\"%s\"", SZ_ATTRIBUTE_KILLPROCESS, _szFileName);
    47655465    else
    4766         sprintf(szTemp, "%s\"", szFileName);
     5466        sprintf(szTemp, "%s\"", _szFileName);
    47675467
    47685468    xstrcat(&strScriptText, szTemp, 0);
     
    47725472
    47735473
    4774 /***************************************************************************
    4775  *@@ScriptKillProcess::BuildFromText
    4776  *  Builds target object accordingly to script text. If any errors is found
    4777  *  in script text, error informations are returned in table where to
    4778  *  *pScriptError points. Pointer to after end of tag is returned so multiple
    4779  *  searches can be done.
    4780  */
    4781 PSZ ScriptKillProcess::BuildFromText(PSZ pszScriptText,
    4782                                     SCRIPTERROR **ppScriptError,
    4783                                     USHORT *pusErrorTableSize,
    4784                                     ULONG ulLineNumber)
    4785     {
    4786     SCRIPTERROR Error;
     5474/*
     5475 *@@BuildFromText:
     5476 *  Builds target object accordingly to script text.
     5477 */
     5478PSZ ScriptKillProcess::BuildFromText(PSZ p_pszScriptText,
     5479                                    ULONG p_ulLineNumber)
     5480    {
     5481    Message msg;
    47875482    PSZ pszTemp = NULL;
    47885483    PSZ pszAttr = NULL;
     
    47915486
    47925487
    4793     pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_KILLPROCESS, &ulOffset);
     5488    pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_KILLPROCESS, &ulOffset);
    47945489    if (pszAttr)
    47955490        this->SetFileName(pszAttr);
    47965491    else
    47975492        {
    4798         Error.usErrorCode = ERR_PARSE_KILLPROCESS_NOTFOUND;
    4799         Error.ulLineNumber = ulLineNumber;
    4800         Error.pszStart = strhdup(pszScriptText);
    4801         Error.ulLength = 0;
    4802         if (ppScriptError)
    4803             *pusErrorTableSize =
    4804                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     5493        msg.SetType(MSG_TYPE_WARNING);
     5494        msg.SetMessageValue(MSG_ATTRIBUTE_KILLPROCESS_MISSING);
     5495        msg.SetLineNumber(p_ulLineNumber);
     5496        _messageLogger.LogMessage(msg);
    48055497        return NULL;
    48065498        }
     
    48085500    ulAttrLen = strlen(pszAttr);
    48095501    delete [] pszAttr;
    4810     return pszScriptText + ulOffset + ulAttrLen + 1;
     5502    return p_pszScriptText + ulOffset + ulAttrLen + 1;
    48115503    }
    48125504
     
    48175509/****************************************************************************
    48185510 ****************************************************************************
    4819         ScriptPackage class:
    4820 
    4821  ****************************************************************************
    4822  *  ScriptPackage class member functions:
    4823  *  ScriptPackage           Constructor.
    4824  *  ~ScriptPackage          Destructor.
    4825  *  SetIndex                Sets index number.
    4826  *  ReturnIndex             Returns index number.
    4827  *  MakeScriptText          Returns pointer to script text.
    4828  *  BuildFromText
     5511        @@ScriptPackage class:
     5512
     5513    <B>Description:</B>
     5514        This class is for CONFIGSYS tag. Detailed information about the
     5515        meaning of the attribute can be found from
     5516        <I>WarpIN Programmer's Guide and Reference</I>.
     5517
     5518    Member functions:
     5519        ScriptPackage           Constructor.
     5520        ~ScriptPackage          Destructor.
     5521        MakeScriptText          Returns pointer to script text.
     5522        BuildFromText
    48295523 ***************************************************************************/
    48305524
    48315525
    4832 /***************************************************************************
    4833  *@@ ScriptPackage::ScriptPackage
     5526/*
     5527 *@@ScriptPackage:
    48345528 *  Constructor for ScriptPackage class.
    48355529 */
    4836 ScriptPackage::ScriptPackage(USHORT usIndex, BOOL bAllowIndexArrangement)
    4837     {
    4838     this->usIndex = usIndex;
    4839 
    4840     this->bAllowIndexArrangement = bAllowIndexArrangement;
    4841 
    4842     Index.SetIndexAttribute(0);
    4843 
    4844     pszDescription = NULL;
    4845 
    4846     pRequires = NULL;
    4847     usRequiresCount = 0;
    4848     pConfigSys = NULL;
    4849     usConfigSysCount = 0;
    4850     pRegisterClass = NULL;
    4851     usRegisterClassCount = 0;
    4852     pReplaceClass = NULL;
    4853     usReplaceClassCount = 0;
    4854     pCreateObject = NULL;
    4855     usCreateObjectCount = 0;
    4856     pExecute = NULL;
    4857     usExecuteCount = 0;
    4858     pProfile = NULL;
    4859     usProfileCount = 0;
    4860     pWriteProfile = NULL;
    4861     usWriteProfileCount = 0;
    4862     pKillProcess = NULL;
    4863     usKillProcessCount = 0;
    4864     }
    4865 
    4866 
    4867 
    4868 
    4869 /***************************************************************************
    4870  *@@ ScriptPackage::ScriptPackage
     5530ScriptPackage::ScriptPackage(USHORT p_usIndex, BOOL p_bAllowIndexArrangement)
     5531    {
     5532    SetIndex(p_usIndex);
     5533
     5534    this->_bAllowIndexArrangement = p_bAllowIndexArrangement;
     5535
     5536    _Index.SetIndexAttribute(0);
     5537
     5538    _pszDescription = NULL;
     5539
     5540    _pRequires = NULL;
     5541    _usRequiresCount = 0;
     5542    _pConfigSys = NULL;
     5543    _usConfigSysCount = 0;
     5544    _pRegisterClass = NULL;
     5545    _usRegisterClassCount = 0;
     5546    _pReplaceClass = NULL;
     5547    _usReplaceClassCount = 0;
     5548    _pCreateObject = NULL;
     5549    _usCreateObjectCount = 0;
     5550    _pExecute = NULL;
     5551    _usExecuteCount = 0;
     5552    _pProfile = NULL;
     5553    _usProfileCount = 0;
     5554    _pWriteProfile = NULL;
     5555    _usWriteProfileCount = 0;
     5556    _pKillProcess = NULL;
     5557    _usKillProcessCount = 0;
     5558    }
     5559
     5560
     5561
     5562
     5563/*
     5564 *@@ScriptPackage:
    48715565 *  Copy constructor for ScriptPackage class.
    48725566 */
    4873 ScriptPackage::ScriptPackage(ScriptPackage &package)
     5567ScriptPackage::ScriptPackage(ScriptPackage &p_package)
    48745568    {
    48755569    USHORT usIndex;
    48765570
    4877     this->usIndex = package.usIndex;
    4878 
    4879     pszDescription = NULL;
    4880 
    4881     Index.SetIndexAttribute(0);
    4882 
    4883     pRequires = NULL;
    4884     usRequiresCount = 0;
    4885     pConfigSys = NULL;
    4886     usConfigSysCount = 0;
    4887     pRegisterClass = NULL;
    4888     usRegisterClassCount = 0;
    4889     pReplaceClass = NULL;
    4890     usReplaceClassCount = 0;
    4891     pCreateObject = NULL;
    4892     usCreateObjectCount = 0;
    4893     pExecute = NULL;
    4894     usExecuteCount = 0;
    4895     pProfile = NULL;
    4896     usProfileCount = 0;
    4897     pWriteProfile = NULL;
    4898     usWriteProfileCount = 0;
    4899     pKillProcess = NULL;
    4900     usKillProcessCount = 0;
     5571    SetIndex(p_package.ReturnIndex());
     5572
     5573    _pszDescription = NULL;
     5574
     5575    _Index.SetIndexAttribute(0);
     5576
     5577    _pRequires = NULL;
     5578    _usRequiresCount = 0;
     5579    _pConfigSys = NULL;
     5580    _usConfigSysCount = 0;
     5581    _pRegisterClass = NULL;
     5582    _usRegisterClassCount = 0;
     5583    _pReplaceClass = NULL;
     5584    _usReplaceClassCount = 0;
     5585    _pCreateObject = NULL;
     5586    _usCreateObjectCount = 0;
     5587    _pExecute = NULL;
     5588    _usExecuteCount = 0;
     5589    _pProfile = NULL;
     5590    _usProfileCount = 0;
     5591    _pWriteProfile = NULL;
     5592    _usWriteProfileCount = 0;
     5593    _pKillProcess = NULL;
     5594    _usKillProcessCount = 0;
    49015595
    49025596    // Copy pszDescription.
    4903     if (package.pszDescription)
    4904         pszDescription = strdup(package.pszDescription);
     5597    if (p_package._pszDescription)
     5598        _pszDescription = strdup(p_package._pszDescription);
    49055599
    49065600    // Copy requires objects.
    4907     pRequires = new ScriptRequires[package.usRequiresCount];
    4908     usRequiresCount = package.usRequiresCount;
    4909     for (usIndex = 0; usIndex < usRequiresCount; usIndex++)
    4910         pRequires[usIndex] = package.pRequires[usIndex];
     5601    _pRequires = new ScriptRequires[p_package._usRequiresCount];
     5602    _usRequiresCount = p_package._usRequiresCount;
     5603    for (usIndex = 0; usIndex < _usRequiresCount; usIndex++)
     5604        _pRequires[usIndex] = p_package._pRequires[usIndex];
    49115605
    49125606    // Copy configsys objects.
    4913     pConfigSys = new ScriptConfigSys[package.usConfigSysCount];
    4914     usConfigSysCount = package.usConfigSysCount;
    4915     for (usIndex = 0; usIndex < usConfigSysCount; usIndex++)
    4916         pConfigSys[usIndex] = package.pConfigSys[usIndex];
     5607    _pConfigSys = new ScriptConfigSys[p_package._usConfigSysCount];
     5608    _usConfigSysCount = p_package._usConfigSysCount;
     5609    for (usIndex = 0; usIndex < _usConfigSysCount; usIndex++)
     5610        _pConfigSys[usIndex] = p_package._pConfigSys[usIndex];
    49175611
    49185612    // Copy registerclass objects.
    4919     pRegisterClass = new ScriptRegisterClass[package.usRegisterClassCount];
    4920     usRegisterClassCount = package.usRegisterClassCount;
    4921     for (usIndex = 0; usIndex < usRegisterClassCount; usIndex++)
    4922         pRegisterClass[usIndex] = package.pRegisterClass[usIndex];
     5613    _pRegisterClass = new ScriptRegisterClass[p_package._usRegisterClassCount];
     5614    _usRegisterClassCount = p_package._usRegisterClassCount;
     5615    for (usIndex = 0; usIndex < _usRegisterClassCount; usIndex++)
     5616        _pRegisterClass[usIndex] = p_package._pRegisterClass[usIndex];
    49235617
    49245618    // Copy replaceclass objects.
    4925     pReplaceClass = new ScriptReplaceClass[package.usReplaceClassCount];
    4926     usReplaceClassCount = package.usReplaceClassCount;
    4927     for (usIndex = 0; usIndex < usReplaceClassCount; usIndex++)
    4928         pReplaceClass[usIndex] = package.pReplaceClass[usIndex];
     5619    _pReplaceClass = new ScriptReplaceClass[p_package._usReplaceClassCount];
     5620    _usReplaceClassCount = p_package._usReplaceClassCount;
     5621    for (usIndex = 0; usIndex < _usReplaceClassCount; usIndex++)
     5622        _pReplaceClass[usIndex] = p_package._pReplaceClass[usIndex];
    49295623
    49305624    // Copy createobject objects.
    4931     pCreateObject = new ScriptCreateObject[package.usCreateObjectCount];
    4932     usCreateObjectCount = package.usCreateObjectCount;
    4933     for (usIndex = 0; usIndex < usCreateObjectCount; usIndex++)
    4934         pCreateObject[usIndex] = package.pCreateObject[usIndex];
     5625    _pCreateObject = new ScriptCreateObject[p_package._usCreateObjectCount];
     5626    _usCreateObjectCount = p_package._usCreateObjectCount;
     5627    for (usIndex = 0; usIndex < _usCreateObjectCount; usIndex++)
     5628        _pCreateObject[usIndex] = p_package._pCreateObject[usIndex];
    49355629
    49365630    // Copy execute objects.
    4937     pExecute = new ScriptExecute[package.usExecuteCount];
    4938     usExecuteCount = package.usExecuteCount;
    4939     for (usIndex = 0; usIndex < usExecuteCount; usIndex++)
    4940         pExecute[usIndex] = package.pExecute[usIndex];
     5631    _pExecute = new ScriptExecute[p_package._usExecuteCount];
     5632    _usExecuteCount = p_package._usExecuteCount;
     5633    for (usIndex = 0; usIndex < _usExecuteCount; usIndex++)
     5634        _pExecute[usIndex] = p_package._pExecute[usIndex];
    49415635
    49425636    // Copy profile objects.
    4943     pProfile = new ScriptClearProfile[package.usProfileCount];
    4944     usProfileCount = package.usProfileCount;
    4945     for (usIndex = 0; usIndex < usProfileCount; usIndex++)
    4946         pProfile[usIndex] = package.pProfile[usIndex];
     5637    _pProfile = new ScriptClearProfile[p_package._usProfileCount];
     5638    _usProfileCount = p_package._usProfileCount;
     5639    for (usIndex = 0; usIndex < _usProfileCount; usIndex++)
     5640        _pProfile[usIndex] = p_package._pProfile[usIndex];
    49475641
    49485642    // Copy writeprofile objects.
    4949     pWriteProfile = new ScriptWriteProfile[package.usWriteProfileCount];
    4950     usWriteProfileCount = package.usWriteProfileCount;
    4951     for (usIndex = 0; usIndex < usWriteProfileCount; usIndex++)
    4952         pWriteProfile[usIndex] = package.pWriteProfile[usIndex];
     5643    _pWriteProfile = new ScriptWriteProfile[p_package._usWriteProfileCount];
     5644    _usWriteProfileCount = p_package._usWriteProfileCount;
     5645    for (usIndex = 0; usIndex < _usWriteProfileCount; usIndex++)
     5646        _pWriteProfile[usIndex] = p_package._pWriteProfile[usIndex];
    49535647
    49545648    // Copy killprocess objects.
    4955     pKillProcess = new ScriptKillProcess[package.usKillProcessCount];
    4956     usKillProcessCount = package.usKillProcessCount;
    4957     for (usIndex = 0; usIndex < usKillProcessCount; usIndex++)
    4958         pKillProcess[usIndex] = package.pKillProcess[usIndex];
    4959     }
    4960 
    4961 
    4962 
    4963 
    4964 /***************************************************************************
    4965  *@@ ScriptPackage::ScriptPackage &operator=
     5649    _pKillProcess = new ScriptKillProcess[p_package._usKillProcessCount];
     5650    _usKillProcessCount = p_package._usKillProcessCount;
     5651    for (usIndex = 0; usIndex < _usKillProcessCount; usIndex++)
     5652        _pKillProcess[usIndex] = p_package._pKillProcess[usIndex];
     5653    }
     5654
     5655
     5656
     5657
     5658/*
     5659 *@@&operator=:
    49665660 *  Assignment operator for ScriptPackage class.
    4967  */
    4968 ScriptPackage &ScriptPackage::operator=(const ScriptPackage &package)
     5661 *
     5662 *@@changed V0.9.5 (2000-08-22) [tahola]: removed const
     5663 */
     5664ScriptPackage &ScriptPackage::operator=(ScriptPackage &p_package)
    49695665    {
    49705666    USHORT usIndex;
    4971     ScriptIndex PckIndex = package.Index;
    4972 
    4973     this->usIndex = package.usIndex;
    4974 
    4975     this->PckID = package.PckID;
    4976 
    4977     this->Title = package.Title;
    4978 
    4979     this->Target = package.Target;
    4980 
    4981     this->KeyWords = package.KeyWords;
    4982 
    4983     this->Index.SetIndexAttribute(PckIndex.ReturnIndexAttribute());
     5667    ScriptIndex PckIndex = p_package._Index;
     5668
     5669    SetIndex(p_package.ReturnIndex());
     5670
     5671    this->_PckID = p_package._PckID;
     5672
     5673    this->_Title = p_package._Title;
     5674
     5675    this->_Target = p_package._Target;
     5676
     5677    this->_KeyWords = p_package._KeyWords;
     5678
     5679    this->_Index.SetIndexAttribute(PckIndex.ReturnIndexAttribute());
    49845680
    49855681    // Copy pszDescription.
    4986     if (package.pszDescription)
    4987         pszDescription = strdup(package.pszDescription);
     5682    if (p_package._pszDescription)
     5683        _pszDescription = strdup(p_package._pszDescription);
    49885684
    49895685    // Copy requires objects.
    4990     if (package.pRequires)
    4991         {
    4992         pRequires = new ScriptRequires[package.usRequiresCount];
    4993         usRequiresCount = package.usRequiresCount;
    4994         for (usIndex = 0; usIndex < usRequiresCount; usIndex++)
    4995             pRequires[usIndex] = package.pRequires[usIndex];
     5686    if (p_package._pRequires)
     5687        {
     5688        _pRequires = new ScriptRequires[p_package._usRequiresCount];
     5689        _usRequiresCount = p_package._usRequiresCount;
     5690        for (usIndex = 0; usIndex < _usRequiresCount; usIndex++)
     5691            _pRequires[usIndex] = p_package._pRequires[usIndex];
    49965692        }
    49975693    // Copy configsys objects.
    4998     if (package.pConfigSys)
    4999         {
    5000         pConfigSys = new ScriptConfigSys[package.usConfigSysCount];
    5001         usConfigSysCount = package.usConfigSysCount;
    5002         for (usIndex = 0; usIndex < usConfigSysCount; usIndex++)
    5003             pConfigSys[usIndex] = package.pConfigSys[usIndex];
     5694    if (p_package._pConfigSys)
     5695        {
     5696        _pConfigSys = new ScriptConfigSys[p_package._usConfigSysCount];
     5697        _usConfigSysCount = p_package._usConfigSysCount;
     5698        for (usIndex = 0; usIndex < _usConfigSysCount; usIndex++)
     5699            _pConfigSys[usIndex] = p_package._pConfigSys[usIndex];
    50045700        }
    50055701    // Copy registerclass objects.
    5006     if (package.pRegisterClass)
    5007         {
    5008         pRegisterClass = new ScriptRegisterClass[package.usRegisterClassCount];
    5009         usRegisterClassCount = package.usRegisterClassCount;
    5010         for (usIndex = 0; usIndex < usRegisterClassCount; usIndex++)
    5011             pRegisterClass[usIndex] = package.pRegisterClass[usIndex];
     5702    if (p_package._pRegisterClass)
     5703        {
     5704        _pRegisterClass = new ScriptRegisterClass[p_package._usRegisterClassCount];
     5705        _usRegisterClassCount = p_package._usRegisterClassCount;
     5706        for (usIndex = 0; usIndex < _usRegisterClassCount; usIndex++)
     5707            _pRegisterClass[usIndex] = p_package._pRegisterClass[usIndex];
    50125708        }
    50135709    // Copy replaceclass objects.
    5014     if (package.pReplaceClass)
    5015         {
    5016         pReplaceClass = new ScriptReplaceClass[package.usReplaceClassCount];
    5017         usReplaceClassCount = package.usReplaceClassCount;
    5018         for (usIndex = 0; usIndex < usReplaceClassCount; usIndex++)
    5019             pReplaceClass[usIndex] = package.pReplaceClass[usIndex];
     5710    if (p_package._pReplaceClass)
     5711        {
     5712        _pReplaceClass = new ScriptReplaceClass[p_package._usReplaceClassCount];
     5713        _usReplaceClassCount = p_package._usReplaceClassCount;
     5714        for (usIndex = 0; usIndex < _usReplaceClassCount; usIndex++)
     5715            _pReplaceClass[usIndex] = p_package._pReplaceClass[usIndex];
    50205716        }
    50215717    // Copy createobject objects.
    5022     if (package.pCreateObject)
    5023         {
    5024         pCreateObject = new ScriptCreateObject[package.usCreateObjectCount];
    5025         usCreateObjectCount = package.usCreateObjectCount;
    5026         for (usIndex = 0; usIndex < usCreateObjectCount; usIndex++)
    5027             pCreateObject[usIndex] = package.pCreateObject[usIndex];
     5718    if (p_package._pCreateObject)
     5719        {
     5720        _pCreateObject = new ScriptCreateObject[p_package._usCreateObjectCount];
     5721        _usCreateObjectCount = p_package._usCreateObjectCount;
     5722        for (usIndex = 0; usIndex < _usCreateObjectCount; usIndex++)
     5723            _pCreateObject[usIndex] = p_package._pCreateObject[usIndex];
    50285724        }
    50295725    // Copy execute objects.
    5030     if (package.pExecute)
    5031         {
    5032         pExecute = new ScriptExecute[package.usExecuteCount];
    5033         usExecuteCount = package.usExecuteCount;
    5034         for (usIndex = 0; usIndex < usExecuteCount; usIndex++)
    5035             pExecute[usIndex] = package.pExecute[usIndex];
     5726    if (p_package._pExecute)
     5727        {
     5728        _pExecute = new ScriptExecute[p_package._usExecuteCount];
     5729        _usExecuteCount = p_package._usExecuteCount;
     5730        for (usIndex = 0; usIndex < _usExecuteCount; usIndex++)
     5731            _pExecute[usIndex] = p_package._pExecute[usIndex];
    50365732        }
    50375733    // Copy profile objects.
    5038     if (package.pProfile)
    5039         {
    5040         pProfile = new ScriptClearProfile[package.usProfileCount];
    5041         usProfileCount = package.usProfileCount;
    5042         for (usIndex = 0; usIndex < usProfileCount; usIndex++)
    5043             pProfile[usIndex] = package.pProfile[usIndex];
     5734    if (p_package._pProfile)
     5735        {
     5736        _pProfile = new ScriptClearProfile[p_package._usProfileCount];
     5737        _usProfileCount = p_package._usProfileCount;
     5738        for (usIndex = 0; usIndex < _usProfileCount; usIndex++)
     5739            _pProfile[usIndex] = p_package._pProfile[usIndex];
    50445740        }
    50455741    // Copy writeprofile objects.
    5046     if (package.pWriteProfile)
    5047         {
    5048         pWriteProfile = new ScriptWriteProfile[package.usWriteProfileCount];
    5049         usWriteProfileCount = package.usWriteProfileCount;
    5050         for (usIndex = 0; usIndex < usWriteProfileCount; usIndex++)
    5051             pWriteProfile[usIndex] = package.pWriteProfile[usIndex];
     5742    if (p_package._pWriteProfile)
     5743        {
     5744        _pWriteProfile = new ScriptWriteProfile[p_package._usWriteProfileCount];
     5745        _usWriteProfileCount = p_package._usWriteProfileCount;
     5746        for (usIndex = 0; usIndex < _usWriteProfileCount; usIndex++)
     5747            _pWriteProfile[usIndex] = p_package._pWriteProfile[usIndex];
    50525748        }
    50535749    // Copy killprocess objects.
    5054     if (package.pKillProcess)
    5055         {
    5056         pKillProcess = new ScriptKillProcess[package.usKillProcessCount];
    5057         usKillProcessCount = package.usKillProcessCount;
    5058         for (usIndex = 0; usIndex < usKillProcessCount; usIndex++)
    5059             pKillProcess[usIndex] = package.pKillProcess[usIndex];
     5750    if (p_package._pKillProcess)
     5751        {
     5752        _pKillProcess = new ScriptKillProcess[p_package._usKillProcessCount];
     5753        _usKillProcessCount = p_package._usKillProcessCount;
     5754        for (usIndex = 0; usIndex < _usKillProcessCount; usIndex++)
     5755            _pKillProcess[usIndex] = p_package._pKillProcess[usIndex];
    50605756        }
    50615757
     
    50665762
    50675763
    5068 /***************************************************************************
    5069  *@@ ScriptPackage::~ScriptPackage
     5764/*
     5765 *@@~ScriptPackage:
    50705766 *  Destructor for ScriptPackage class.
    50715767 */
    50725768ScriptPackage::~ScriptPackage()
    50735769    {
    5074     if (pszDescription)
    5075         delete [] pszDescription;
    5076     pszDescription = NULL;
    5077     if (pRequires)
    5078         delete [] pRequires;
    5079     pRequires = NULL;
    5080     usRequiresCount = 0;
    5081     if (pConfigSys)
    5082         delete [] pConfigSys;
    5083     pConfigSys = NULL;
    5084     usConfigSysCount = 0;
    5085     if (pRegisterClass)
    5086         delete [] pRegisterClass;
    5087     pRegisterClass = NULL;
    5088     usRegisterClassCount = 0;
    5089     if (pCreateObject)
    5090         delete [] pCreateObject;
    5091     pCreateObject = NULL;
    5092     usCreateObjectCount = 0;
    5093     if (pExecute)
    5094         delete [] pExecute;
    5095     pExecute = NULL;
    5096     usExecuteCount = 0;
    5097     if (pProfile)
    5098         delete [] pProfile;
    5099     pProfile = NULL;
    5100     usProfileCount = 0;
    5101     if (pWriteProfile)
    5102         delete [] pWriteProfile;
    5103     pProfile = NULL;
    5104     usProfileCount = 0;
    5105     if (pKillProcess)
    5106         delete [] pKillProcess;
    5107     pKillProcess = NULL;
    5108     usKillProcessCount = 0;
    5109     }
    5110 
    5111 
    5112 
    5113 
    5114 /***************************************************************************
     5770    ClearAll;
     5771    }
     5772
     5773
     5774/*
     5775 *@@ClearAll:
     5776 *  Clears all fields.
     5777 *
     5778 *@@ added V0.9.5 (2000-08-22) [tahola]
     5779 */
     5780USHORT ScriptPackage::ClearAll()
     5781    {
     5782    if (_pszDescription)
     5783        delete [] _pszDescription;
     5784    _pszDescription = NULL;
     5785    if (_pRequires)
     5786        delete [] _pRequires;
     5787    _pRequires = NULL;
     5788    _usRequiresCount = 0;
     5789    if (_pConfigSys)
     5790        delete [] _pConfigSys;
     5791    _pConfigSys = NULL;
     5792    _usConfigSysCount = 0;
     5793    if (_pRegisterClass)
     5794        delete [] _pRegisterClass;
     5795    _pRegisterClass = NULL;
     5796    _usRegisterClassCount = 0;
     5797    if (_pCreateObject)
     5798        delete [] _pCreateObject;
     5799    _pCreateObject = NULL;
     5800    _usCreateObjectCount = 0;
     5801    if (_pExecute)
     5802        delete [] _pExecute;
     5803    _pExecute = NULL;
     5804    _usExecuteCount = 0;
     5805    if (_pProfile)
     5806        delete [] _pProfile;
     5807    _pProfile = NULL;
     5808    _usProfileCount = 0;
     5809    if (_pWriteProfile)
     5810        delete [] _pWriteProfile;
     5811    _pProfile = NULL;
     5812    _usProfileCount = 0;
     5813    if (_pKillProcess)
     5814        delete [] _pKillProcess;
     5815    _pKillProcess = NULL;
     5816    _usKillProcessCount = 0;
     5817
     5818    return NO_ERROR;
     5819    }
     5820
     5821
     5822/*
     5823 *@@SetDescription:
     5824 *  Sets description string. If parameter is NULL, old pszDescription
     5825 *  will be deleted.
     5826 *
     5827 *  <B>Return values:</B>
     5828 *      NO_ERROR: No errors occurred.
     5829 *      MEM_ALLOC_ERROR: Error occurred during memory allocation.
     5830 */
     5831USHORT ScriptPackage::SetDescription(
     5832                        const PSZ p_pszDescription // in: a pointer to a string.
     5833                                    )
     5834    {
     5835    ULONG ulStringLength;
     5836    if (this->_pszDescription)
     5837        delete [] this->_pszDescription;
     5838    this->_pszDescription = NULL;
     5839
     5840    if (p_pszDescription)
     5841        {
     5842        ulStringLength = strlen(p_pszDescription);
     5843        if (!(this->_pszDescription = (PSZ)new CHAR[ulStringLength + 1]))
     5844            return MEM_ALLOC_ERROR;
     5845        strcpy(this->_pszDescription, p_pszDescription);
     5846        }
     5847    return NO_ERROR;
     5848    }
     5849
     5850
     5851/*
     5852 *@@ReturnDescription:
     5853 *  Returns constant pointer to description string.
     5854 */
     5855const PSZ ScriptPackage::ReturnDescription()
     5856    {
     5857    return _pszDescription;
     5858    }
     5859
     5860
     5861/*
    51155862 *@@ ScriptPackage::SetPackageIndex
    51165863 *  Sets object's index.
    51175864 */
    5118 void ScriptPackage::SetPackageIndex(USHORT usPackageIndex)
    5119     {
    5120     this->Index.SetIndexAttribute(usPackageIndex);
    5121     }
    5122 
    5123 
    5124 
    5125 /***************************************************************************
    5126  *@@ ScriptPackage::SetDescription
    5127  *  Sets description string. If parameter is NULL old pszDescription
    5128  *  will be deleted.
    5129  */
    5130 USHORT ScriptPackage::SetDescription(const PSZ pszDescription)
    5131     {
    5132     ULONG ulStringLength;
    5133     if (this->pszDescription)
    5134         delete [] this->pszDescription;
    5135     this->pszDescription = NULL;
    5136 
    5137     if (pszDescription)
    5138         {
    5139         ulStringLength = strlen(pszDescription);
    5140         this->pszDescription = new CHAR[ulStringLength + 1];
    5141         strcpy(this->pszDescription, pszDescription);
    5142         }
    5143     return 0;
    5144     }
    5145 
    5146 
    5147 
    5148 
    5149 /***************************************************************************
    5150  *@@ ScriptPackage::SetIndex
    5151  *  Sets object's index.
    5152  */
    5153 void ScriptPackage::SetIndex(USHORT usIndex)
    5154     {
    5155     this->usIndex = usIndex;
    5156     }
    5157 
    5158 
    5159 
    5160 
    5161 /***************************************************************************
    5162  *@@ ScriptPackage::ReturnDescription
    5163  *  Returns constant pointer to description string.
    5164  */
    5165 const PSZ ScriptPackage::ReturnDescription()
    5166     {
    5167     return pszDescription;
    5168     }
    5169 
    5170 
    5171 
    5172 
    5173 /***************************************************************************
    5174  *@@ ScriptPackage::SetPackageID
    5175  */
    5176 void ScriptPackage::SetPackageID(PACKAGEIDDATA packageIDData)
    5177     {
    5178     PckID.SetPackageID(packageIDData);
    5179     }
    5180 
    5181 
    5182 
    5183 
    5184 /***************************************************************************
    5185  *@@ ScriptPackage::SetTitle
    5186  */
    5187 void ScriptPackage::SetTitle(const PSZ pszTitle)
    5188     {
    5189     Title.SetTitle(pszTitle);
    5190     }
    5191 
    5192 
    5193 /***************************************************************************
    5194  *@@ ScriptPackage::ReturnTitle
     5865USHORT ScriptPackage::SetPackageIndex(USHORT p_usPackageIndex)
     5866    {
     5867    return _Index.SetIndexAttribute(p_usPackageIndex);
     5868    }
     5869
     5870
     5871/*
     5872 *@@SetPackageID
     5873 */
     5874USHORT ScriptPackage::SetPackageID(PACKAGEIDDATA p_packageIDData)
     5875    {
     5876    return _PckID.SetPackageID(p_packageIDData);
     5877    }
     5878
     5879
     5880/*
     5881 *@@SetTitle:
     5882 */
     5883USHORT ScriptPackage::SetTitle(const PSZ p_pszTitle)
     5884    {
     5885    return _Title.SetTitle(p_pszTitle);
     5886    }
     5887
     5888
     5889/*
     5890 *@@ReturnTitle:
    51955891 */
    51965892const PSZ ScriptPackage::ReturnTitleText()
    51975893    {
    5198     return Title.ReturnTitle();
    5199     }
    5200 
    5201 
    5202 
    5203 /***************************************************************************
    5204  *@@ ScriptPackage::SetTarget
    5205  */
    5206 void ScriptPackage::SetTarget(const PSZ pszTarget)
    5207     {
    5208     Target.SetTarget(pszTarget);
    5209     }
    5210 
    5211 
    5212 
    5213 
    5214 /***************************************************************************
    5215  *@@ ScriptPackage::SetKeyWords
    5216  */
    5217 void ScriptPackage::SetKeyWords(USHORT usKeyWords)
    5218     {
    5219     KeyWords.SetKeyWord(usKeyWords);
    5220     }
    5221 
    5222 
    5223 
    5224 
    5225 /***************************************************************************
    5226  *@@ ScriptPackage::ReturnPackageIDObject
     5894    return _Title.ReturnTitle();
     5895    }
     5896
     5897
     5898/*
     5899 *@@SetTarget:
     5900 */
     5901USHORT ScriptPackage::SetTarget(const PSZ p_pszTarget)
     5902    {
     5903    return _Target.SetTarget(p_pszTarget);
     5904    }
     5905
     5906
     5907/*
     5908 *@@SetKeyWords:
     5909 */
     5910USHORT ScriptPackage::SetKeyWords(USHORT p_usKeyWords)
     5911    {
     5912    return _KeyWords.SetKeyWord(p_usKeyWords);
     5913    }
     5914
     5915
     5916/*
     5917 *@@ReturnPackageIDObject:
    52275918 *  Returns pointer to PackageID object.
    52285919 */
    52295920ScriptPackageID *ScriptPackage::ReturnPackageIDObject()
    52305921    {
    5231     return &PckID;
    5232     }
    5233 
    5234 
    5235 
    5236 /***************************************************************************
    5237  *@@ ScriptPackage::ReturnTitleObject
     5922    return &_PckID;
     5923    }
     5924
     5925
     5926/*
     5927 *@@ReturnTitleObject:
    52385928 *  Returns pointer to PackageID object.
    52395929 */
    52405930ScriptTitle *ScriptPackage::ReturnTitleObject()
    52415931    {
    5242     return &Title;
    5243     }
    5244 
    5245 
    5246 
    5247 /***************************************************************************
    5248  *@@ ScriptPackage::ReturnTargetObject
     5932    return &_Title;
     5933    }
     5934
     5935
     5936/*
     5937 *@@ReturnTargetObject:
    52495938 *  Returns pointer to Target object.
    52505939 */
    52515940ScriptTarget *ScriptPackage::ReturnTargetObject()
    52525941    {
    5253     return &Target;
    5254     }
    5255 
    5256 
    5257 /***************************************************************************
    5258  *@@ ScriptPackage::ReturnTargetText
     5942    return &_Target;
     5943    }
     5944
     5945
     5946/*
     5947 *@@ReturnTargetText:
    52595948 *  Returns pointer to title text.
    52605949 */
    52615950const PSZ ScriptPackage::ReturnTargetText()
    52625951    {
    5263     return Target.ReturnTarget();
    5264     }
    5265 
    5266 
    5267 
    5268 /***************************************************************************
    5269  *@@ ScriptPackage::ReturnKeyWordObject
     5952    return _Target.ReturnTarget();
     5953    }
     5954
     5955
     5956/*
     5957 *@@ReturnKeyWordObject:
    52705958 *  Returns pointer to PackageID object.
    52715959 */
    52725960ScriptKeyWord *ScriptPackage::ReturnKeyWordObject()
    52735961    {
    5274     return &KeyWords;
    5275     }
    5276 
    5277 
    5278 
    5279 /***************************************************************************
    5280  *@@ ScriptPackage::ReturnIndex
    5281  *  Returns index number.
    5282  */
    5283 USHORT ScriptPackage::ReturnIndex()
    5284     {
    5285     return usIndex;
    5286     }
    5287 
    5288 
    5289 /***************************************************************************
    5290  *@@ ScriptPackage::ReturnPackageIndex
     5962    return &_KeyWords;
     5963    }
     5964
     5965
     5966/*
     5967 *@@ReturnPackageIndex:
    52915968 *  Returns package index number.
    52925969 */
    52935970ScriptIndex *ScriptPackage::ReturnPackageIndex()
    52945971    {
    5295     return &Index;
    5296     }
    5297 
    5298 
    5299 /***************************************************************************
    5300  *@@ ScriptPackage::ReturnPackageIndex
     5972    return &_Index;
     5973    }
     5974
     5975
     5976/*
     5977 *@@ReturnPackageIndex:
    53015978 *  Returns package index number.
    53025979 */
    53035980USHORT ScriptPackage::ReturnPackageIndexNumber()
    53045981    {
    5305     return Index.ReturnIndexAttribute();
    5306     }
    5307 
    5308 
    5309 
    5310 /***************************************************************************
    5311  *@@ ScriptPackage::MakeScriptText
     5982    return _Index.ReturnIndexAttribute();
     5983    }
     5984
     5985
     5986/*
     5987 *@@MakeScriptText:
    53125988 *  Returns pointer to script text.
    53135989 */
    5314 PSZ ScriptPackage::MakeScriptText(BOOL bAttribute)
     5990PSZ ScriptPackage::MakeScriptText(BOOL p_bAttribute)
    53155991    {
    53165992    XSTRING strScript;
     
    53215997    USHORT usIndex;
    53225998
    5323     if (bAttribute)
     5999    if (p_bAttribute)
    53246000        {
    53256001        sprintf(szTag, "<%s ", SZ_TAG_PACKAGE);
     
    53286004    //sprintf(szAttribute, "%s=%i\n", SZ_ATTRIBUTE_INDEX, Index.ReturnIndexAttribute());
    53296005    xstrcat(&strScript, "\t", 0);
    5330     pszTemp = Index.MakeScriptText(bAttribute);
     6006    pszTemp = _Index.MakeScriptText(p_bAttribute);
    53316007    xstrcat(&strScript, pszTemp, 0);
    53326008    delete [] pszTemp;
     
    53346010
    53356011    xstrcat(&strScript, "\t", 0);
    5336     pszTemp = PckID.MakeScriptText(bAttribute);
     6012    pszTemp = _PckID.MakeScriptText(p_bAttribute);
    53376013    xstrcat(&strScript, pszTemp, 0);
    53386014    delete [] pszTemp;
     
    53406016
    53416017    xstrcat(&strScript, "\t", 0);
    5342     pszTemp = Title.MakeScriptText(bAttribute);
     6018    pszTemp = _Title.MakeScriptText(p_bAttribute);
    53436019    xstrcat(&strScript, pszTemp, 0);
    53446020    delete [] pszTemp;
     
    53466022
    53476023    xstrcat(&strScript, "\t", 0);
    5348     pszTemp = Target.MakeScriptText(bAttribute);
     6024    pszTemp = _Target.MakeScriptText(p_bAttribute);
    53496025    xstrcat(&strScript, pszTemp, 0);
    53506026    delete [] pszTemp;
     
    53526028
    53536029    xstrcat(&strScript, "\t", 0);
    5354     pszTemp = KeyWords.MakeScriptText(bAttribute);
     6030    pszTemp = _KeyWords.MakeScriptText(p_bAttribute);
    53556031    xstrcat(&strScript, pszTemp, 0);
    53566032    delete [] pszTemp;
    53576033    xstrcat(&strScript, "\n", 0);
    53586034
    5359     for (usIndex = 0; usIndex < usRequiresCount; usIndex ++)
    5360         {
    5361         pszTemp = pRequires[usIndex].MakeScriptText(bAttribute);
     6035    for (usIndex = 0; usIndex < _usRequiresCount; usIndex ++)
     6036        {
     6037        pszTemp = _pRequires[usIndex].MakeScriptText(p_bAttribute);
    53626038        xstrcat(&strScript, "\t", 0);
    53636039        xstrcat(&strScript, pszTemp, 0);
     
    53666042        }
    53676043
    5368     for (usIndex = 0; usIndex < usConfigSysCount; usIndex ++)
    5369         {
    5370         pszTemp = pConfigSys[usIndex].MakeScriptText(bAttribute);
     6044    for (usIndex = 0; usIndex < _usConfigSysCount; usIndex ++)
     6045        {
     6046        pszTemp = _pConfigSys[usIndex].MakeScriptText(p_bAttribute);
    53716047        xstrcat(&strScript, "\t", 0);
    53726048        xstrcat(&strScript, pszTemp, 0);
     
    53756051        }
    53766052
    5377     for (usIndex = 0; usIndex < usRegisterClassCount; usIndex ++)
    5378         {
    5379         pszTemp = pRegisterClass[usIndex].MakeScriptText(bAttribute);
     6053    for (usIndex = 0; usIndex < _usRegisterClassCount; usIndex ++)
     6054        {
     6055        pszTemp = _pRegisterClass[usIndex].MakeScriptText(p_bAttribute);
    53806056        xstrcat(&strScript, "\t", 0);
    53816057        xstrcat(&strScript, pszTemp, 0);
     
    53856061
    53866062
    5387     for (usIndex = 0; usIndex < usReplaceClassCount; usIndex ++)
    5388         {
    5389         pszTemp = pReplaceClass[usIndex].MakeScriptText(bAttribute);
     6063    for (usIndex = 0; usIndex < _usReplaceClassCount; usIndex ++)
     6064        {
     6065        pszTemp = _pReplaceClass[usIndex].MakeScriptText(p_bAttribute);
    53906066        xstrcat(&strScript, "\t", 0);
    53916067        xstrcat(&strScript, pszTemp, 0);
     
    53956071
    53966072
    5397     for (usIndex = 0; usIndex < usCreateObjectCount; usIndex ++)
    5398         {
    5399         pszTemp = pCreateObject[usIndex].MakeScriptText(bAttribute);
     6073    for (usIndex = 0; usIndex < _usCreateObjectCount; usIndex ++)
     6074        {
     6075        pszTemp = _pCreateObject[usIndex].MakeScriptText(p_bAttribute);
    54006076        xstrcat(&strScript, "\t", 0);
    54016077        xstrcat(&strScript, pszTemp, 0);
     
    54046080        }
    54056081
    5406     for (usIndex = 0; usIndex < usExecuteCount; usIndex ++)
    5407         {
    5408         pszTemp = pExecute[usIndex].MakeScriptText(bAttribute);
     6082    for (usIndex = 0; usIndex < _usExecuteCount; usIndex ++)
     6083        {
     6084        pszTemp = _pExecute[usIndex].MakeScriptText(p_bAttribute);
    54096085        xstrcat(&strScript, "\t", 0);
    54106086        xstrcat(&strScript, pszTemp, 0);
     
    54146090
    54156091
    5416     for (usIndex = 0; usIndex < usProfileCount; usIndex ++)
    5417         {
    5418         pszTemp = pProfile[usIndex].MakeScriptText(bAttribute);
     6092    for (usIndex = 0; usIndex < _usProfileCount; usIndex ++)
     6093        {
     6094        pszTemp = _pProfile[usIndex].MakeScriptText(p_bAttribute);
    54196095        xstrcat(&strScript, "\t", 0);
    54206096        xstrcat(&strScript, pszTemp, 0);
     
    54236099        }
    54246100
    5425     for (usIndex = 0; usIndex < usWriteProfileCount; usIndex ++)
    5426         {
    5427         pszTemp = pWriteProfile[usIndex].MakeScriptText(bAttribute);
     6101    for (usIndex = 0; usIndex < _usWriteProfileCount; usIndex ++)
     6102        {
     6103        pszTemp = _pWriteProfile[usIndex].MakeScriptText(p_bAttribute);
    54286104        xstrcat(&strScript, "\t", 0);
    54296105        xstrcat(&strScript, pszTemp, 0);
     
    54326108        }
    54336109
    5434     for (usIndex = 0; usIndex < usKillProcessCount; usIndex ++)
    5435         {
    5436         pszTemp = pKillProcess[usIndex].MakeScriptText(bAttribute);
     6110    for (usIndex = 0; usIndex < _usKillProcessCount; usIndex ++)
     6111        {
     6112        pszTemp = _pKillProcess[usIndex].MakeScriptText(p_bAttribute);
    54376113        xstrcat(&strScript, "\t", 0);
    54386114        xstrcat(&strScript, pszTemp, 0);
     
    54426118
    54436119
    5444     if (bAttribute)
     6120    if (p_bAttribute)
    54456121        xstrcat(&strScript, ">", 0);
    5446     if (pszDescription)
    5447         xstrcat(&strScript, pszDescription, 0);
    5448 
    5449     if (bAttribute)
     6122    if (_pszDescription)
     6123        xstrcat(&strScript, _pszDescription, 0);
     6124
     6125    if (p_bAttribute)
    54506126        {
    54516127        sprintf(szTag, "<%s>", SZ_TAG_ENDPACKAGE);
     
    54576133
    54586134
    5459 
    5460 
    5461 /***********************************
    5462  *  ScriptRequires object handling.
    5463  ***********************************
    5464  * Here are functions when handling ScriptRequires objects. These functions
    5465  * are only way to add, remove or find desired ScriptRequire object.
    5466  */
    5467 
    5468 /***************************************************************************
    5469  *@@ ScriptPackage::CopyTable
    5470  *  Copies source table to destination table.
    5471  */
    5472 ScriptRequires *ScriptPackage::CopyTable(ScriptRequires *DestTable,//in: Pointer to destination table.
    5473                                         ScriptRequires *SrcTable,//in: Pointer to source table.
    5474                                         USHORT usSize,//in: Size of source table.
    5475                                         USHORT usSkipIndex)//in: Index to be skipped. If 0 no skipping.
    5476     {
    5477     USHORT SrcIndex, DestIndex;
    5478     if (!DestTable)
     6135/*
     6136 *@@CreateRequiresObject:
     6137 *  Creates new requires object and returns pointer to it.
     6138 */
     6139ScriptRequires *ScriptPackage::CreateRequiresObject()
     6140    {
     6141    ScriptRequires *requires, *pNewRequires, *pTemp;
     6142
     6143    // Create new table for ScriptRequires objects.
     6144    if (!(requires = new ScriptRequires[++_usRequiresCount]))
     6145        {
     6146        _usRequiresCount --;
    54796147        return NULL;
    5480     if (!SrcTable)
    5481         return DestTable;
    5482     for (SrcIndex = 0, DestIndex = 0; SrcIndex < usSize; SrcIndex ++, DestIndex ++)
    5483         {
    5484         if (SrcTable[SrcIndex].ReturnIndex() == usSkipIndex)
    5485             if (SrcIndex < usSize - 1)
    5486                 SrcIndex ++;
    5487             else
    5488                 break;
    5489         DestTable[DestIndex] = SrcTable[SrcIndex];
    5490         }
    5491 
    5492     return DestTable;
    5493     }
    5494 
    5495 
    5496 
    5497 
    5498 /***************************************************************************
    5499  *@@ ScriptPackage::ReBuildIndexes
    5500  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    5501  *  Example:
    5502  *      Old indexing: 1, 4, 3, 5
    5503  *      New indexing: 1, 3, 2, 4
    5504  */
    5505 void ScriptPackage::ReBuildIndexes(ScriptRequires *Table, USHORT usTableSize)
    5506     {
    5507     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    5508     BOOL bFinded = FALSE, bReady = FALSE;
    5509 
    5510     // First find largest index number.
    5511     for (Index = 0; Index < usTableSize; Index ++)
    5512         if (Table[Index].ReturnIndex() > usMax)
    5513             usMax = Table[Index].ReturnIndex();
    5514 
    5515     // Do this until it is sure that there is no skipped indexes left.
    5516     while (!bReady)
    5517         {
    5518         bReady = TRUE;
    5519         // Go through all index values from 1 to usMax.
    5520         for (Index = 1; Index <= usMax; Index ++)
    5521             {
    5522             // Check that Index number will be found.
    5523             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    5524                 if (Index == Table[Index2].ReturnIndex())
    5525                     bFinded = TRUE;
    5526             // If did not found, dec 1 from every index number above the index number
    5527             // which did not found.
    5528             if (bFinded == FALSE)
    5529                 {
    5530                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    5531                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    5532                         if (Index3 == Table[Index2].ReturnIndex())
    5533                             Table[Index2].SetIndex(Index3 - 1);
    5534                 usMax --;
    5535                 }
    5536             if (bFinded == FALSE)
    5537                 bReady = FALSE;
    5538             bFinded = FALSE;
    5539             }
    5540         }
    5541     }
    5542 
    5543 
    5544 /***************************************************************************
    5545  *@@ ScriptPackage::FindUnusedIndex
    5546  *  Returns first unused index number.
    5547  */
    5548 USHORT ScriptPackage::FindUnusedIndex(ScriptRequires *Table, USHORT usTableSize)
    5549     {
    5550     USHORT Index, Index2, usMax = 0;
    5551     BOOL bFinded = FALSE;
    5552 
    5553     // First find largest index number.
    5554     for (Index = 0; Index < usTableSize; Index ++)
    5555         if (Table[Index].ReturnIndex() > usMax)
    5556             usMax = Table[Index].ReturnIndex();
    5557 
    5558     for (Index = 1; Index <= usMax; Index ++)
    5559         {
    5560         // Go through all the indexes of the table.
    5561         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    5562             if (Index == Table[Index2].ReturnIndex())
    5563                 {
    5564                 bFinded = TRUE;
    5565                 break;
    5566                 }
    5567         // If Index found from the table continue.
    5568         if (bFinded == TRUE)
    5569             bFinded = FALSE;
    5570         // If not break.
    5571         else
    5572             break;
    5573         }
    5574 
    5575     return Index;
    5576     }
    5577 
    5578 
    5579 
    5580 
    5581 /***************************************************************************
    5582  *@@ ScriptPackage::CreateRequiresObject
    5583  *  Creates new requires object and returns pointer to it.
    5584  */
    5585 ScriptRequires *ScriptPackage::CreateRequiresObject()
    5586     {
    5587     ScriptRequires *requires, *pNewRequires;
    5588 
    5589     // Create new table for ScriptRequires objects.
    5590     if (!(requires = new ScriptRequires[++usRequiresCount]))
    5591         {
    5592         usRequiresCount --;
    5593         return NULL;
    55946148        }
    55956149
    55966150    // Set new object's index to first unused index.
    5597     requires[usRequiresCount - 1].SetIndex(FindUnusedIndex(this->pRequires,
    5598         usRequiresCount - 1));
    5599 
    5600     CopyTable(requires, this->pRequires, usRequiresCount - 1);
    5601     delete [] this->pRequires;
    5602     this->pRequires = requires;
    5603     pNewRequires = &this->pRequires[usRequiresCount - 1];
     6151    requires[_usRequiresCount - 1].SetIndex(FindUnusedIndex(this->_pRequires,
     6152        (USHORT)(_usRequiresCount - 1)));
     6153
     6154    CopyTable(requires, this->_pRequires, (USHORT)(_usRequiresCount - 1), (USHORT)0);
     6155    delete [] this->_pRequires;
     6156    this->_pRequires = requires;
     6157    pNewRequires = &this->_pRequires[_usRequiresCount - 1];
    56046158    return pNewRequires;
    56056159    }
    56066160
    56076161
    5608 
    5609 /***************************************************************************
    5610  *@@ ScriptPackage::CreateRequiresObject
     6162/*
     6163 *@@CreateRequiresObject
    56116164 *  Creates requires object and sets datas and returns pointer to it.
    56126165 *  Also sets datas according to requiresData.
    56136166 */
    5614 ScriptRequires *ScriptPackage::CreateRequiresObject(REQUIRESDATA requiresData)
     6167ScriptRequires *ScriptPackage::CreateRequiresObject(REQUIRESDATA p_requiresData)
    56156168    {
    56166169    ScriptRequires *RequiresObject = CreateRequiresObject();
    56176170
    5618     RequiresObject->SetRequires(requiresData);
     6171    RequiresObject->SetRequires(p_requiresData);
    56196172    return RequiresObject;
    56206173    }
    56216174
    56226175
    5623 
    5624 /***************************************************************************
    5625  *@@ ScriptPackage::ReturnRequiresObject
     6176/*
     6177 *@@ReturnRequiresObject
    56266178 *  Returns object which index is given usIndex.
    56276179 */
    5628 ScriptRequires *ScriptPackage::ReturnRequiresObject(USHORT usIndex)
     6180ScriptRequires *ScriptPackage::ReturnRequiresObject(USHORT p_usIndex)
    56296181    {
    56306182    USHORT Index;
    56316183
    5632     for (Index = 0; Index < this->usRequiresCount; Index ++)
    5633         if (pRequires[Index].ReturnIndex() == usIndex)
    5634             return &pRequires[Index];
     6184    for (Index = 0; Index < this->_usRequiresCount; Index ++)
     6185        if (_pRequires[Index].ReturnIndex() == p_usIndex)
     6186            return &_pRequires[Index];
    56356187    return NULL;
    56366188    }
    56376189
    56386190
    5639 
    5640 
    5641 /***************************************************************************
    5642  *@@ ScriptPackage::DeleteRequiresObject
     6191/*
     6192 *@@DeleteRequiresObject:
    56436193 *  Deletes object which index is given in usIndex.
    56446194 */
    5645 USHORT ScriptPackage::DeleteRequiresObject(USHORT usIndex)
     6195USHORT ScriptPackage::DeleteRequiresObject(USHORT p_usIndex)
    56466196    {
    56476197    ScriptRequires *TempRequires = NULL;
    56486198
    5649     if (usRequiresCount > 1)
    5650         {
    5651         TempRequires = new ScriptRequires[usRequiresCount - 1];
    5652         CopyTable(TempRequires, pRequires, usRequiresCount, usIndex);
    5653         if (bAllowIndexArrangement)
    5654             ReBuildIndexes(TempRequires, usRequiresCount - 1);
    5655         }
    5656     delete [] pRequires;
    5657     pRequires = TempRequires;
    5658     usRequiresCount --;
     6199    if (_usRequiresCount > 1)
     6200        {
     6201        TempRequires = new ScriptRequires[_usRequiresCount - 1];
     6202        CopyTable(TempRequires, _pRequires, _usRequiresCount, p_usIndex);
     6203        if (_bAllowIndexArrangement)
     6204            RebuildIndexes(TempRequires, (USHORT)(_usRequiresCount - 1));
     6205        }
     6206    delete [] _pRequires;
     6207    _pRequires = TempRequires;
     6208    _usRequiresCount --;
    56596209    return 0;
    56606210    }
    56616211
    56626212
    5663 
    5664 /***************************************************************************
    5665  *@@ ScriptPackage::DeleteRequiresObject
     6213/*
     6214 *@@DeleteRequiresObject:
    56666215 *  Deletes object which address is *ScriptRequiresObject.
    56676216 */
    5668 USHORT ScriptPackage::DeleteRequiresObject(ScriptRequires *ScriptRequiresObject)
     6217USHORT ScriptPackage::DeleteRequiresObject(ScriptRequires *p_pScriptRequiresObject)
    56696218    {
    56706219    USHORT Index = 0, usDelete;
    56716220    USHORT rc;
    56726221
    5673     if (!ScriptRequiresObject)
     6222    if (!p_pScriptRequiresObject)
    56746223        return 1;
    56756224
     
    56776226    while (TRUE)
    56786227        {
    5679         if (&pRequires[Index] == ScriptRequiresObject)
     6228        if (&_pRequires[Index] == p_pScriptRequiresObject)
    56806229            break;
    56816230        Index ++;
    5682         if (Index >= usRequiresCount)
     6231        if (Index >= _usRequiresCount)
    56836232            return 2;
    56846233        }
    56856234
    5686     usDelete = pRequires[Index].ReturnIndex();
     6235    usDelete = _pRequires[Index].ReturnIndex();
    56876236    rc = DeleteRequiresObject(usDelete);
    56886237
    5689 
    56906238    return rc;
    56916239    }
    56926240
    56936241
    5694 
    5695 
    5696 /***************************************************************************
    5697  *@@ ScriptPackage:: ReturnRequiresObjectCount
     6242/*
     6243 *@@ReturnRequiresObjectCount:
    56986244 *  Returns count number of ScriptRequiresObjects.
    56996245 */
    57006246USHORT ScriptPackage::ReturnRequiresObjectCount()
    57016247    {
    5702     return usRequiresCount;
    5703     }
    5704 
    5705 
    5706 
    5707 
    5708 
    5709 /***********************************
    5710  *  ScriptConfigSys object handling.
    5711  ***********************************
    5712  * Here are functions when handling ScriptConfigSys objects. These functions
    5713  * are only way to add, remove or find desired ScriptConfigSys object.
    5714  */
    5715 
    5716 /***************************************************************************
    5717  *@@ ScriptConfigSys::CopyTable
    5718  *  Copies source table to destination table.
    5719  */
    5720 ScriptConfigSys *ScriptPackage::CopyTable(ScriptConfigSys *DestTable,
    5721                                         ScriptConfigSys *SrcTable,
    5722                                         USHORT usSize, USHORT usSkipIndex)
    5723     {
    5724     USHORT SrcIndex, DestIndex;
    5725     if (!DestTable)
     6248    return _usRequiresCount;
     6249    }
     6250
     6251
     6252/*
     6253 *@@CreateConfigSysObject:
     6254 *  Creates new ConfigSys object and returns pointer to it.
     6255 */
     6256ScriptConfigSys *ScriptPackage::CreateConfigSysObject()
     6257    {
     6258    ScriptConfigSys *Object, *NewObject;
     6259
     6260    if (!(Object = new ScriptConfigSys[++_usConfigSysCount]))
     6261        {
     6262        _usConfigSysCount --;
    57266263        return NULL;
    5727     if (!SrcTable)
    5728         return DestTable;
    5729     for (SrcIndex = 0, DestIndex = 0; SrcIndex < usSize; SrcIndex ++, DestIndex ++)
    5730         {
    5731         if (SrcTable[SrcIndex].ReturnIndex() == usSkipIndex)
    5732             if (SrcIndex < usSize - 1)
    5733                 SrcIndex ++;
    5734             else
    5735                 break;
    5736         DestTable[DestIndex] = SrcTable[SrcIndex];
    5737         }
    5738 
    5739     return DestTable;
    5740     }
    5741 
    5742 
    5743 
    5744 
    5745 /***************************************************************************
    5746  *@@ ScriptConfigSys::ReBuildIndexes
    5747  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    5748  *  Example:
    5749  *      Old indexing: 1, 4, 3, 5
    5750  *      New indexing: 1, 3, 2, 4
    5751  */
    5752 void ScriptPackage::ReBuildIndexes(ScriptConfigSys *Table, USHORT usTableSize)
    5753     {
    5754     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    5755     BOOL bFinded = FALSE, bReady = FALSE;
    5756 
    5757     // First find largest index number.
    5758     for (Index = 0; Index < usTableSize; Index ++)
    5759         if (Table[Index].ReturnIndex() > usMax)
    5760             usMax = Table[Index].ReturnIndex();
    5761 
    5762     // Do this until it is sure that there is no skipped indexes left.
    5763     while (!bReady)
    5764         {
    5765         bReady = TRUE;
    5766         // Go through all index values from 1 to usMax.
    5767         for (Index = 1; Index <= usMax; Index ++)
    5768             {
    5769             // Check that Index number will be found.
    5770             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    5771                 if (Index == Table[Index2].ReturnIndex())
    5772                     bFinded = TRUE;
    5773             // If did not found sub 1 from every index number above the index number
    5774             // which did not found.
    5775             if (bFinded == FALSE)
    5776                 {
    5777                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    5778                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    5779                         if (Index3 == Table[Index2].ReturnIndex())
    5780                             Table[Index2].SetIndex(Index3 - 1);
    5781                 usMax --;
    5782                 }
    5783             if (bFinded == FALSE)
    5784                 bReady = FALSE;
    5785             bFinded = FALSE;
    5786             }
    5787         }
    5788     }
    5789 
    5790 
    5791 /***************************************************************************
    5792  *@@ ScriptPackage::FindUnusedIndex
    5793  *  Returns first unused index number.
    5794  */
    5795 USHORT ScriptPackage::FindUnusedIndex(ScriptConfigSys *Table, USHORT usTableSize)
    5796     {
    5797     USHORT Index, Index2, usMax = 0;
    5798     BOOL bFinded = FALSE;
    5799 
    5800     // First find largest index number.
    5801     for (Index = 0; Index < usTableSize; Index ++)
    5802         if (Table[Index].ReturnIndex() > usMax)
    5803             usMax = Table[Index].ReturnIndex();
    5804 
    5805     for (Index = 1; Index <= usMax; Index ++)
    5806         {
    5807         // Go through all the indexes of the table.
    5808         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    5809             if (Index == Table[Index2].ReturnIndex())
    5810                 {
    5811                 bFinded = TRUE;
    5812                 break;
    5813                 }
    5814         // If Index found from the table continue.
    5815         if (bFinded == TRUE)
    5816             bFinded = FALSE;
    5817         // If not break.
    5818         else
    5819             break;
    5820         }
    5821 
    5822     return Index;
    5823     }
    5824 
    5825 
    5826 
    5827 
    5828 /***************************************************************************
    5829  *@@ ScriptPackage::CreateConfigSysObject
    5830  *  Creates new ConfigSys object and returns pointer to it.
    5831  */
    5832 ScriptConfigSys *ScriptPackage::CreateConfigSysObject()
    5833     {
    5834     ScriptConfigSys *Object, *NewObject;
    5835 
    5836     if (!(Object = new ScriptConfigSys[++usConfigSysCount]))
    5837         {
    5838         usConfigSysCount --;
    5839         return NULL;
    5840         }
    5841 
    5842     Object[usConfigSysCount - 1].SetIndex(FindUnusedIndex(this->pConfigSys,
    5843         usConfigSysCount - 1));
    5844 
    5845     CopyTable(Object, this->pConfigSys, usConfigSysCount - 1);
    5846     delete [] this->pConfigSys;
    5847     this->pConfigSys = Object;
    5848     NewObject = &this->pConfigSys[usConfigSysCount - 1];
     6264        }
     6265
     6266    Object[_usConfigSysCount - 1].SetIndex(FindUnusedIndex(this->_pConfigSys,
     6267        (USHORT)(_usConfigSysCount - 1)));
     6268
     6269    CopyTable(Object, this->_pConfigSys, (USHORT)(_usConfigSysCount - 1), (USHORT)0);
     6270    delete [] this->_pConfigSys;
     6271    this->_pConfigSys = Object;
     6272    NewObject = &this->_pConfigSys[_usConfigSysCount - 1];
    58496273    return NewObject;
    58506274    }
    58516275
    58526276
    5853 
    5854 /***************************************************************************
    5855  *@@ ScriptPackage::CreateConfigSysObject
     6277/*
     6278 *@@CreateConfigSysObject:
    58566279 *  Creates ConfigSys object and sets datas and returns pointer to it.
    58576280 *  Also sets datas according to data.
    58586281 */
    5859 ScriptConfigSys *ScriptPackage::CreateConfigSysObject(CONFIGSYSDATA data)
     6282ScriptConfigSys *ScriptPackage::CreateConfigSysObject(CONFIGSYSDATA p_data)
    58606283    {
    58616284    ScriptConfigSys *ConfigSysObject = CreateConfigSysObject();
    58626285
    5863     ConfigSysObject->SetConfigSys(data);
     6286    ConfigSysObject->SetConfigSys(p_data);
    58646287    return ConfigSysObject;
    58656288    }
    58666289
    58676290
    5868 
    5869 /***************************************************************************
    5870  *@@ ScriptPackage::ReturnConfigSysObject
     6291/*
     6292 *@@ReturnConfigSysObject:
    58716293 *  Returns object which index is given usIndex.
    58726294 */
    5873 ScriptConfigSys *ScriptPackage::ReturnConfigSysObject(USHORT usIndex)
     6295ScriptConfigSys *ScriptPackage::ReturnConfigSysObject(USHORT p_usIndex)
    58746296    {
    58756297    USHORT Index;
    58766298
    5877     for (Index = 0; Index < this->usConfigSysCount; Index ++)
    5878         if (pConfigSys[Index].ReturnIndex() == usIndex)
    5879             return &pConfigSys[Index];
     6299    for (Index = 0; Index < this->_usConfigSysCount; Index ++)
     6300        if (_pConfigSys[Index].ReturnIndex() == p_usIndex)
     6301            return &_pConfigSys[Index];
    58806302    return NULL;
    58816303    }
    58826304
    58836305
    5884 
    5885 
    5886 /***************************************************************************
    5887  *@@ ScriptPackage::DeleteConfigSysObject
     6306/*
     6307 *@@DeleteConfigSysObject:
    58886308 *  Deletes object which index is given in usIndex.
    58896309 */
    5890 USHORT ScriptPackage::DeleteConfigSysObject(USHORT usIndex)
     6310USHORT ScriptPackage::DeleteConfigSysObject(USHORT p_usIndex)
    58916311    {
    58926312    ScriptConfigSys *TempConfigSys = NULL;
    58936313
    5894     if (usConfigSysCount > 1)
    5895         {
    5896         TempConfigSys = new ScriptConfigSys[usConfigSysCount - 1];
    5897         CopyTable(TempConfigSys, pConfigSys, usConfigSysCount, usIndex);
    5898         if (bAllowIndexArrangement)
    5899             ReBuildIndexes(TempConfigSys, usConfigSysCount - 1);
    5900         }
    5901     delete [] pConfigSys;
    5902     pConfigSys = TempConfigSys;
    5903     usConfigSysCount --;
     6314    if (_usConfigSysCount > 1)
     6315        {
     6316        TempConfigSys = new ScriptConfigSys[_usConfigSysCount - 1];
     6317        CopyTable(TempConfigSys, _pConfigSys, _usConfigSysCount, p_usIndex);
     6318        if (_bAllowIndexArrangement)
     6319            RebuildIndexes(TempConfigSys, (USHORT)(_usConfigSysCount - 1));
     6320        }
     6321    delete [] _pConfigSys;
     6322    _pConfigSys = TempConfigSys;
     6323    _usConfigSysCount --;
    59046324    return 0;
    59056325    }
    59066326
    59076327
    5908 
    5909 /***************************************************************************
    5910  *@@ ScriptPackage::DeleteConfigSysObject
     6328/*
     6329 *@@DeleteConfigSysObject:
    59116330 *  Deletes object which address is *ScriptConfigSysObject.
    59126331 */
    5913 USHORT ScriptPackage::DeleteConfigSysObject(ScriptConfigSys *ScriptConfigSysObject)
     6332USHORT ScriptPackage::DeleteConfigSysObject(ScriptConfigSys *p_pScriptConfigSysObject)
    59146333    {
    59156334    USHORT Index = 0, usDelete;
    59166335    USHORT rc;
    59176336
    5918     if (!ScriptConfigSysObject)
     6337    if (!p_pScriptConfigSysObject)
    59196338        return 1;
    59206339
     
    59226341    while (TRUE)
    59236342        {
    5924         if (&pConfigSys[Index] == ScriptConfigSysObject)
     6343        if (&_pConfigSys[Index] == p_pScriptConfigSysObject)
    59256344            break;
    59266345        Index ++;
    5927         if (Index >= usConfigSysCount)
     6346        if (Index >= _usConfigSysCount)
    59286347            return 2;
    59296348        }
    59306349
    5931     usDelete = pConfigSys[Index].ReturnIndex();
     6350    usDelete = _pConfigSys[Index].ReturnIndex();
    59326351    rc = DeleteConfigSysObject(usDelete);
    59336352
     
    59376356
    59386357
    5939 
    5940 
    5941 /***************************************************************************
    5942  *@@ ScriptPackage:: ReturnConfigSysObjectCount
     6358/*
     6359 *@@ReturnConfigSysObjectCount:
    59436360 *  Returns count number of ScriptConfigSysObjects.
    59446361 */
    59456362USHORT ScriptPackage::ReturnConfigSysObjectCount()
    59466363    {
    5947     return usConfigSysCount;
    5948     }
    5949 
    5950 
    5951 
    5952 
    5953 
    5954 /****************************************
    5955  *  ScriptRegisterClass object handling.
    5956  ****************************************
    5957  * Here are functions when handling ScriptRegisterClass objects. These functions
    5958  * are only way to add, remove or find desired ScriptRegisterClass object.
    5959  */
    5960 
    5961 /***************************************************************************
    5962  *@@ ScriptRegisterClass::CopyTable
    5963  *  Copies source table to destination table.
    5964  */
    5965 ScriptRegisterClass *ScriptPackage::CopyTable(ScriptRegisterClass *DestTable, // in: Pointer to destination table.
    5966                                              ScriptRegisterClass *SrcTable, // in: Pointer to source table.
    5967                                              USHORT usSize, // in: Size of source table.
    5968                                              USHORT usSkipIndex) // in: Index to be skipped. If 0 no skipping.
    5969     {
    5970     USHORT SrcIndex, DestIndex;
    5971     if (!DestTable)
     6364    return _usConfigSysCount;
     6365    }
     6366
     6367
     6368/*
     6369 *@@CreateRegisterClassObject:
     6370 *  Creates new RegisterClass object and returns pointer to it.
     6371 */
     6372ScriptRegisterClass *ScriptPackage::CreateRegisterClassObject()
     6373    {
     6374    ScriptRegisterClass *Object, *NewObject;
     6375
     6376    if (!(Object = new ScriptRegisterClass[++_usRegisterClassCount]))
     6377        {
     6378        _usRegisterClassCount --;
    59726379        return NULL;
    5973     if (!SrcTable)
    5974         return DestTable;
    5975     for (SrcIndex = 0, DestIndex = 0; SrcIndex < usSize; SrcIndex ++, DestIndex ++)
    5976         {
    5977         if (SrcTable[SrcIndex].ReturnIndex() == usSkipIndex)
    5978             if (SrcIndex < usSize - 1)
    5979                 SrcIndex ++;
    5980             else
    5981                 break;
    5982         DestTable[DestIndex] = SrcTable[SrcIndex];
    5983         }
    5984 
    5985     return DestTable;
    5986     }
    5987 
    5988 
    5989 
    5990 
    5991 /***************************************************************************
    5992  *@@ ScriptRegisterClass::ReBuildIndexes
    5993  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    5994  *  Example:
    5995  *      Old indexing: 1, 4, 3, 5
    5996  *      New indexing: 1, 3, 2, 4
    5997  */
    5998 void ScriptPackage::ReBuildIndexes(ScriptRegisterClass *Table, USHORT usTableSize)
    5999     {
    6000     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    6001     BOOL bFinded = FALSE, bReady = FALSE;
    6002 
    6003     // First find largest index number.
    6004     for (Index = 0; Index < usTableSize; Index ++)
    6005         if (Table[Index].ReturnIndex() > usMax)
    6006             usMax = Table[Index].ReturnIndex();
    6007 
    6008     // Do this until it is sure that there is no skipped indexes left.
    6009     while (!bReady)
    6010         {
    6011         bReady = TRUE;
    6012         // Go through all index values from 1 to usMax.
    6013         for (Index = 1; Index <= usMax; Index ++)
    6014             {
    6015             // Check that Index number will be found.
    6016             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6017                 if (Index == Table[Index2].ReturnIndex())
    6018                     bFinded = TRUE;
    6019             // If did not found sub 1 from every index number above the index number
    6020             // which did not found.
    6021             if (bFinded == FALSE)
    6022                 {
    6023                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    6024                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6025                         if (Index3 == Table[Index2].ReturnIndex())
    6026                             Table[Index2].SetIndex(Index3 - 1);
    6027                 usMax --;
    6028                 }
    6029             if (bFinded == FALSE)
    6030                 bReady = FALSE;
    6031             bFinded = FALSE;
    6032             }
    6033         }
    6034     }
    6035 
    6036 
    6037 /***************************************************************************
    6038  *@@ ScriptPackage::FindUnusedIndex
    6039  *  Returns first unused index number.
    6040  */
    6041 USHORT ScriptPackage::FindUnusedIndex(ScriptRegisterClass *Table, USHORT usTableSize)
    6042     {
    6043     USHORT Index, Index2, usMax = 0;
    6044     BOOL bFinded = FALSE;
    6045 
    6046     // First find largest index number.
    6047     for (Index = 0; Index < usTableSize; Index ++)
    6048         if (Table[Index].ReturnIndex() > usMax)
    6049             usMax = Table[Index].ReturnIndex();
    6050 
    6051     for (Index = 1; Index <= usMax; Index ++)
    6052         {
    6053         // Go through all the indexes of the table.
    6054         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6055             if (Index == Table[Index2].ReturnIndex())
    6056                 {
    6057                 bFinded = TRUE;
    6058                 break;
    6059                 }
    6060         // If Index found from the table continue.
    6061         if (bFinded == TRUE)
    6062             bFinded = FALSE;
    6063         // If not break.
    6064         else
    6065             break;
    6066         }
    6067 
    6068     return Index;
    6069     }
    6070 
    6071 
    6072 
    6073 
    6074 /***************************************************************************
    6075  *@@ ScriptPackage::CreateRegisterClassObject
    6076  *  Creates new RegisterClass object and returns pointer to it.
    6077  */
    6078 ScriptRegisterClass *ScriptPackage::CreateRegisterClassObject()
    6079     {
    6080     ScriptRegisterClass *Object, *NewObject;
    6081 
    6082     if (!(Object = new ScriptRegisterClass[++usRegisterClassCount]))
    6083         {
    6084         usRegisterClassCount --;
    6085         return NULL;
    6086         }
    6087 
    6088     Object[usRegisterClassCount - 1].SetIndex(FindUnusedIndex(this->pRegisterClass,
    6089         usRegisterClassCount - 1));
    6090 
    6091     CopyTable(Object, this->pRegisterClass, usRegisterClassCount - 1);
    6092     delete [] this->pRegisterClass;
    6093     this->pRegisterClass = Object;
    6094     NewObject = &this->pRegisterClass[usRegisterClassCount - 1];
     6380        }
     6381
     6382    Object[_usRegisterClassCount - 1].SetIndex(FindUnusedIndex(this->_pRegisterClass,
     6383        (USHORT)(_usRegisterClassCount - 1)));
     6384
     6385    CopyTable(Object, this->_pRegisterClass, (USHORT)(_usRegisterClassCount - 1),
     6386              (USHORT)0);
     6387    delete [] this->_pRegisterClass;
     6388    this->_pRegisterClass = Object;
     6389    NewObject = &this->_pRegisterClass[_usRegisterClassCount - 1];
    60956390    return NewObject;
    60966391    }
    60976392
    60986393
    6099 
    6100 /***************************************************************************
    6101  *@@ ScriptPackage::CreateRegisterClassObject
     6394/*
     6395 *@@CreateRegisterClassObject:
    61026396 *  Creates RegisterClass object and sets datas and returns pointer to it.
    61036397 *  Also sets datas according to data.
    61046398 */
    6105 ScriptRegisterClass *ScriptPackage::CreateRegisterClassObject(REGISTERCLASSDATA data)
     6399ScriptRegisterClass *ScriptPackage::CreateRegisterClassObject(REGISTERCLASSDATA p_data)
    61066400    {
    61076401    ScriptRegisterClass *RegisterClassObject = CreateRegisterClassObject();
    61086402
    6109     RegisterClassObject->SetRegisterClass(data);
     6403    RegisterClassObject->SetRegisterClass(p_data);
    61106404    return RegisterClassObject;
    61116405    }
    61126406
    61136407
    6114 
    6115 /***************************************************************************
    6116  *@@ ScriptPackage::ReturnRegisterClassObject
    6117  *  Returns object which index is given usIndex.
    6118  */
    6119 ScriptRegisterClass *ScriptPackage::ReturnRegisterClassObject(USHORT usIndex)
     6408/*
     6409 *@@ReturnRegisterClassObject:
     6410 *  Returns object which index is given p_usIndex.
     6411 */
     6412ScriptRegisterClass *ScriptPackage::ReturnRegisterClassObject(USHORT p_usIndex)
    61206413    {
    61216414    USHORT Index;
    61226415
    6123     for (Index = 0; Index < this->usRegisterClassCount; Index ++)
    6124         if (pRegisterClass[Index].ReturnIndex() == usIndex)
    6125             return &pRegisterClass[Index];
     6416    for (Index = 0; Index < this->_usRegisterClassCount; Index ++)
     6417        if (_pRegisterClass[Index].ReturnIndex() == p_usIndex)
     6418            return &_pRegisterClass[Index];
    61266419    return NULL;
    61276420    }
    61286421
    61296422
    6130 
    6131 
    6132 /***************************************************************************
    6133  *@@ ScriptPackage::DeleteRegisterClassObject
    6134  *  Deletes object which index is given in usIndex.
    6135  */
    6136 USHORT ScriptPackage::DeleteRegisterClassObject(USHORT usIndex)
     6423/*
     6424 *@@DeleteRegisterClassObject:
     6425 *  Deletes object which index is given in p_usIndex.
     6426 */
     6427USHORT ScriptPackage::DeleteRegisterClassObject(USHORT p_usIndex)
    61376428    {
    61386429    ScriptRegisterClass *TempRegisterClass = NULL;
    61396430
    6140     if (usRegisterClassCount > 1)
    6141         {
    6142         TempRegisterClass = new ScriptRegisterClass[usRegisterClassCount - 1];
    6143         CopyTable(TempRegisterClass, pRegisterClass, usRegisterClassCount, usIndex);
    6144         if (bAllowIndexArrangement)
    6145             ReBuildIndexes(TempRegisterClass, usRegisterClassCount - 1);
    6146         }
    6147     delete [] pRegisterClass;
    6148     pRegisterClass = TempRegisterClass;
    6149     usRegisterClassCount --;
     6431    if (_usRegisterClassCount > 1)
     6432        {
     6433        TempRegisterClass = new ScriptRegisterClass[_usRegisterClassCount - 1];
     6434        CopyTable(TempRegisterClass, _pRegisterClass, _usRegisterClassCount, p_usIndex);
     6435        if (_bAllowIndexArrangement)
     6436            RebuildIndexes(TempRegisterClass, (USHORT)(_usRegisterClassCount - 1));
     6437        }
     6438    delete [] _pRegisterClass;
     6439    _pRegisterClass = TempRegisterClass;
     6440    _usRegisterClassCount --;
    61506441    return 0;
    61516442    }
    61526443
    61536444
    6154 
    6155 /***************************************************************************
    6156  *@@ ScriptPackage::DeleteRegisterClassObject
     6445/*
     6446 *@@DeleteRegisterClassObject:
    61576447 *  Deletes object which address is *ScriptRegisterClassObject.
    61586448 */
    6159 USHORT ScriptPackage::DeleteRegisterClassObject(ScriptRegisterClass *ScriptRegisterClassObject)
     6449USHORT ScriptPackage::DeleteRegisterClassObject(
     6450                      ScriptRegisterClass *p_pScriptRegisterClassObject
     6451                                               )
    61606452    {
    61616453    USHORT Index = 0, usDelete;
    61626454    USHORT rc;
    61636455
    6164     if (!ScriptRegisterClassObject)
     6456    if (!p_pScriptRegisterClassObject)
    61656457        return 1;
    61666458
     
    61686460    while (TRUE)
    61696461        {
    6170         if (&pRegisterClass[Index] == ScriptRegisterClassObject)
     6462        if (&_pRegisterClass[Index] == p_pScriptRegisterClassObject)
    61716463            break;
    61726464        Index ++;
    6173         if (Index >= usRegisterClassCount)
     6465        if (Index >= _usRegisterClassCount)
    61746466            return 2;
    61756467        }
    61766468
    6177     usDelete = pRegisterClass[Index].ReturnIndex();
     6469    usDelete = _pRegisterClass[Index].ReturnIndex();
    61786470    rc = DeleteRegisterClassObject(usDelete);
    61796471
     
    61836475
    61846476
    6185 
    6186 
    6187 /***************************************************************************
    6188  *@@ ScriptPackage:: ReturnRegisterClassObjectCount
     6477/*
     6478 *@@ReturnRegisterClassObjectCount:
    61896479 *  Returns count number of ScriptRegisterClassObjects.
    61906480 */
    61916481USHORT ScriptPackage::ReturnRegisterClassObjectCount()
    61926482    {
    6193     return usRegisterClassCount;
    6194     }
    6195 
    6196 
    6197 
    6198 
    6199 
    6200 /****************************************
    6201  *  ScriptReplaceClass object handling.
    6202  ****************************************
    6203  * Here are functions when handling ScriptReplaceClass objects. These functions
    6204  * are only way to add, remove or find desired ScriptReplaceClass object.
    6205  */
    6206 
    6207 /***************************************************************************
    6208  *@@ ScriptReplaceClass::CopyTable
    6209  *  Copies source table to destination table.
    6210  */
    6211 ScriptReplaceClass *ScriptPackage::CopyTable(ScriptReplaceClass *DestTable, // in: Pointer to destination table.
    6212                                              ScriptReplaceClass *SrcTable, // in: Pointer to source table.
    6213                                              USHORT usSize, // in: Size of source table.
    6214                                              USHORT usSkipIndex) // in: Index to be skipped. If 0 no skipping.
    6215     {
    6216     USHORT SrcIndex, DestIndex;
    6217     if (!DestTable)
     6483    return _usRegisterClassCount;
     6484    }
     6485
     6486
     6487/*
     6488 *@@CreateReplaceClassObject:
     6489 *  Creates new ReplaceClass object and returns pointer to it.
     6490 */
     6491ScriptReplaceClass *ScriptPackage::CreateReplaceClassObject()
     6492    {
     6493    ScriptReplaceClass *Object, *NewObject;
     6494
     6495    if (!(Object = new ScriptReplaceClass[++_usReplaceClassCount]))
     6496        {
     6497        _usReplaceClassCount --;
    62186498        return NULL;
    6219     if (!SrcTable)
    6220         return DestTable;
    6221     for (SrcIndex = 0, DestIndex = 0; SrcIndex < usSize; SrcIndex ++, DestIndex ++)
    6222         {
    6223         if (SrcTable[SrcIndex].ReturnIndex() == usSkipIndex)
    6224             if (SrcIndex < usSize - 1)
    6225                 SrcIndex ++;
    6226             else
    6227                 break;
    6228         DestTable[DestIndex] = SrcTable[SrcIndex];
    6229         }
    6230 
    6231     return DestTable;
    6232     }
    6233 
    6234 
    6235 
    6236 
    6237 /***************************************************************************
    6238  *@@ ScriptReplaceClass::ReBuildIndexes
    6239  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    6240  *  Example:
    6241  *      Old indexing: 1, 4, 3, 5
    6242  *      New indexing: 1, 3, 2, 4
    6243  */
    6244 void ScriptPackage::ReBuildIndexes(ScriptReplaceClass *Table, USHORT usTableSize)
    6245     {
    6246     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    6247     BOOL bFinded = FALSE, bReady = FALSE;
    6248 
    6249     // First find largest index number.
    6250     for (Index = 0; Index < usTableSize; Index ++)
    6251         if (Table[Index].ReturnIndex() > usMax)
    6252             usMax = Table[Index].ReturnIndex();
    6253 
    6254     // Do this until it is sure that there is no skipped indexes left.
    6255     while (!bReady)
    6256         {
    6257         bReady = TRUE;
    6258         // Go through all index values from 1 to usMax.
    6259         for (Index = 1; Index <= usMax; Index ++)
    6260             {
    6261             // Check that Index number will be found.
    6262             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6263                 if (Index == Table[Index2].ReturnIndex())
    6264                     bFinded = TRUE;
    6265             // If did not found sub 1 from every index number above the index number
    6266             // which did not found.
    6267             if (bFinded == FALSE)
    6268                 {
    6269                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    6270                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6271                         if (Index3 == Table[Index2].ReturnIndex())
    6272                             Table[Index2].SetIndex(Index3 - 1);
    6273                 usMax --;
    6274                 }
    6275             if (bFinded == FALSE)
    6276                 bReady = FALSE;
    6277             bFinded = FALSE;
    6278             }
    6279         }
    6280     }
    6281 
    6282 
    6283 /***************************************************************************
    6284  *@@ ScriptPackage::FindUnusedIndex
    6285  *  Returns first unused index number.
    6286  */
    6287 USHORT ScriptPackage::FindUnusedIndex(ScriptReplaceClass *Table, USHORT usTableSize)
    6288     {
    6289     USHORT Index, Index2, usMax = 0;
    6290     BOOL bFinded = FALSE;
    6291 
    6292     // First find largest index number.
    6293     for (Index = 0; Index < usTableSize; Index ++)
    6294         if (Table[Index].ReturnIndex() > usMax)
    6295             usMax = Table[Index].ReturnIndex();
    6296 
    6297     for (Index = 1; Index <= usMax; Index ++)
    6298         {
    6299         // Go through all the indexes of the table.
    6300         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6301             if (Index == Table[Index2].ReturnIndex())
    6302                 {
    6303                 bFinded = TRUE;
    6304                 break;
    6305                 }
    6306         // If Index found from the table continue.
    6307         if (bFinded == TRUE)
    6308             bFinded = FALSE;
    6309         // If not break.
    6310         else
    6311             break;
    6312         }
    6313 
    6314     return Index;
    6315     }
    6316 
    6317 
    6318 
    6319 
    6320 /***************************************************************************
    6321  *@@ ScriptPackage::CreateReplaceClassObject
    6322  *  Creates new ReplaceClass object and returns pointer to it.
    6323  */
    6324 ScriptReplaceClass *ScriptPackage::CreateReplaceClassObject()
    6325     {
    6326     ScriptReplaceClass *Object, *NewObject;
    6327 
    6328     if (!(Object = new ScriptReplaceClass[++usReplaceClassCount]))
    6329         {
    6330         usReplaceClassCount --;
    6331         return NULL;
    6332         }
    6333 
    6334     Object[usReplaceClassCount - 1].SetIndex(FindUnusedIndex(this->pReplaceClass,
    6335         usReplaceClassCount - 1));
    6336 
    6337     CopyTable(Object, this->pReplaceClass, usReplaceClassCount - 1);
    6338     delete [] this->pReplaceClass;
    6339     this->pReplaceClass = Object;
    6340     NewObject = &this->pReplaceClass[usReplaceClassCount - 1];
     6499        }
     6500
     6501    Object[_usReplaceClassCount - 1].SetIndex(FindUnusedIndex(this->_pReplaceClass,
     6502        (USHORT)(_usReplaceClassCount - 1)));
     6503
     6504    CopyTable(Object, this->_pReplaceClass, (USHORT)(_usReplaceClassCount - 1),
     6505              (USHORT)0);
     6506    delete [] this->_pReplaceClass;
     6507    this->_pReplaceClass = Object;
     6508    NewObject = &this->_pReplaceClass[_usReplaceClassCount - 1];
    63416509    return NewObject;
    63426510    }
    63436511
    63446512
    6345 
    6346 /***************************************************************************
    6347  *@@ ScriptPackage::CreateReplaceClassObject
     6513/*
     6514 *@@CreateReplaceClassObject:
    63486515 *  Creates ReplaceClass object and sets datas and returns pointer to it.
    63496516 *  Also sets datas according to data.
    63506517 */
    6351 ScriptReplaceClass *ScriptPackage::CreateReplaceClassObject(REPLACECLASSDATA data)
     6518ScriptReplaceClass *ScriptPackage::CreateReplaceClassObject(REPLACECLASSDATA p_data)
    63526519    {
    63536520    ScriptReplaceClass *ReplaceClassObject = CreateReplaceClassObject();
    63546521
    6355     ReplaceClassObject->SetReplaceClass(data);
     6522    ReplaceClassObject->SetReplaceClass(p_data);
    63566523    return ReplaceClassObject;
    63576524    }
    63586525
    63596526
    6360 
    6361 /***************************************************************************
    6362  *@@ ScriptPackage::ReturnReplaceClassObject
     6527/*
     6528 *@@ReturnReplaceClassObject:
    63636529 *  Returns object which index is given usIndex.
    63646530 */
    6365 ScriptReplaceClass *ScriptPackage::ReturnReplaceClassObject(USHORT usIndex)
     6531ScriptReplaceClass *ScriptPackage::ReturnReplaceClassObject(USHORT p_usIndex)
    63666532    {
    63676533    USHORT Index;
    63686534
    6369     for (Index = 0; Index < this->usReplaceClassCount; Index ++)
    6370         if (pReplaceClass[Index].ReturnIndex() == usIndex)
    6371             return &pReplaceClass[Index];
     6535    for (Index = 0; Index < this->_usReplaceClassCount; Index ++)
     6536        if (_pReplaceClass[Index].ReturnIndex() == p_usIndex)
     6537            return &_pReplaceClass[Index];
    63726538    return NULL;
    63736539    }
    63746540
    63756541
    6376 
    6377 
    6378 /***************************************************************************
    6379  *@@ ScriptPackage::DeleteReplaceClassObject
     6542/*
     6543 *@@DeleteReplaceClassObject:
    63806544 *  Deletes object which index is given in usIndex.
    63816545 */
    6382 USHORT ScriptPackage::DeleteReplaceClassObject(USHORT usIndex)
     6546USHORT ScriptPackage::DeleteReplaceClassObject(USHORT p_usIndex)
    63836547    {
    63846548    ScriptReplaceClass *TempReplaceClass = NULL;
    63856549
    6386     if (usReplaceClassCount > 1)
    6387         {
    6388         TempReplaceClass = new ScriptReplaceClass[usReplaceClassCount - 1];
    6389         CopyTable(TempReplaceClass, pReplaceClass, usReplaceClassCount, usIndex);
    6390         if (bAllowIndexArrangement)
    6391             ReBuildIndexes(TempReplaceClass, usReplaceClassCount - 1);
    6392         }
    6393     delete [] pReplaceClass;
    6394     pReplaceClass = TempReplaceClass;
    6395     usReplaceClassCount --;
     6550    if (_usReplaceClassCount > 1)
     6551        {
     6552        TempReplaceClass = new ScriptReplaceClass[_usReplaceClassCount - 1];
     6553        CopyTable(TempReplaceClass, _pReplaceClass, _usReplaceClassCount, p_usIndex);
     6554        if (_bAllowIndexArrangement)
     6555            RebuildIndexes(TempReplaceClass, (USHORT)(_usReplaceClassCount - 1));
     6556        }
     6557    delete [] _pReplaceClass;
     6558    _pReplaceClass = TempReplaceClass;
     6559    _usReplaceClassCount --;
    63966560    return 0;
    63976561    }
    63986562
    63996563
    6400 
    6401 /***************************************************************************
    6402  *@@ ScriptPackage::DeleteReplaceClassObject
     6564/*
     6565 *@@DeleteReplaceClassObject:
    64036566 *  Deletes object which address is *ScriptReplaceClassObject.
    64046567 */
    6405 USHORT ScriptPackage::DeleteReplaceClassObject(ScriptReplaceClass *ScriptReplaceClassObject)
     6568USHORT ScriptPackage::DeleteReplaceClassObject(
     6569                      ScriptReplaceClass *p_pScriptReplaceClassObject
     6570                                              )
    64066571    {
    64076572    USHORT Index = 0, usDelete;
    64086573    USHORT rc;
    64096574
    6410     if (!ScriptReplaceClassObject)
     6575    if (!p_pScriptReplaceClassObject)
    64116576        return 1;
    64126577
     
    64146579    while (TRUE)
    64156580        {
    6416         if (&pReplaceClass[Index] == ScriptReplaceClassObject)
     6581        if (&_pReplaceClass[Index] == p_pScriptReplaceClassObject)
    64176582            break;
    64186583        Index ++;
    6419         if (Index >= usReplaceClassCount)
     6584        if (Index >= _usReplaceClassCount)
    64206585            return 2;
    64216586        }
    64226587
    6423     usDelete = pReplaceClass[Index].ReturnIndex();
     6588    usDelete = _pReplaceClass[Index].ReturnIndex();
    64246589    rc = DeleteReplaceClassObject(usDelete);
    64256590
     
    64296594
    64306595
    6431 
    6432 
    6433 /***************************************************************************
    6434  *@@ ScriptPackage:: ReturnReplaceClassObjectCount
     6596/*
     6597 *@@ReturnReplaceClassObjectCount:
    64356598 *  Returns count number of ScriptReplaceClassObjects.
    64366599 */
    64376600USHORT ScriptPackage::ReturnReplaceClassObjectCount()
    64386601    {
    6439     return usReplaceClassCount;
    6440     }
    6441 
    6442 
    6443 
    6444 
    6445 
    6446 /****************************************
    6447  *  ScriptCreateObject object handling.
    6448  ****************************************
    6449  * Here are functions when handling ScriptCreateObject objects. These functions
    6450  * are only way to add, remove or find desired ScriptCreateObject object.
    6451  */
    6452 
    6453 /***************************************************************************
    6454  *@@ ScriptCreateObject::CopyTable
    6455  *  Copies source table to destination table.
    6456  */
    6457 ScriptCreateObject *ScriptPackage::CopyTable(ScriptCreateObject *DestTable, // in: Pointer to destination table.
    6458                                              ScriptCreateObject *SrcTable, // in: Pointer to source table.
    6459                                              USHORT usSize, // in: Size of source table.
    6460                                              USHORT usSkipIndex) // in: Index to be skipped. If 0 no skipping.
    6461     {
    6462     USHORT SrcIndex, DestIndex;
    6463     if (!DestTable)
     6602    return _usReplaceClassCount;
     6603    }
     6604
     6605
     6606/*
     6607 *@@CreateCreateObjectObject:
     6608 *  Creates new CreateObject object and returns pointer to it.
     6609 */
     6610ScriptCreateObject *ScriptPackage::CreateCreateObjectObject()
     6611    {
     6612    ScriptCreateObject *Object, *NewObject;
     6613
     6614    if (!(Object = new ScriptCreateObject[++_usCreateObjectCount]))
     6615        {
     6616        _usCreateObjectCount --;
    64646617        return NULL;
    6465     if (!SrcTable)
    6466         return DestTable;
    6467     for (SrcIndex = 0, DestIndex = 0; SrcIndex < usSize; SrcIndex ++, DestIndex ++)
    6468         {
    6469         if (SrcTable[SrcIndex].ReturnIndex() == usSkipIndex)
    6470             if (SrcIndex < usSize - 1)
    6471                 SrcIndex ++;
    6472             else
    6473                 break;
    6474         DestTable[DestIndex] = SrcTable[SrcIndex];
    6475         }
    6476 
    6477     return DestTable;
    6478     }
    6479 
    6480 
    6481 
    6482 
    6483 /***************************************************************************
    6484  *@@ ScriptCreateObject::ReBuildIndexes
    6485  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    6486  *  Example:
    6487  *      Old indexing: 1, 4, 3, 5
    6488  *      New indexing: 1, 3, 2, 4
    6489  */
    6490 void ScriptPackage::ReBuildIndexes(ScriptCreateObject *Table, USHORT usTableSize)
    6491     {
    6492     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    6493     BOOL bFinded = FALSE, bReady = FALSE;
    6494 
    6495     // First find largest index number.
    6496     for (Index = 0; Index < usTableSize; Index ++)
    6497         if (Table[Index].ReturnIndex() > usMax)
    6498             usMax = Table[Index].ReturnIndex();
    6499 
    6500     // Do this until it is sure that there is no skipped indexes left.
    6501     while (!bReady)
    6502         {
    6503         bReady = TRUE;
    6504         // Go through all index values from 1 to usMax.
    6505         for (Index = 1; Index <= usMax; Index ++)
    6506             {
    6507             // Check that Index number will be found.
    6508             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6509                 if (Index == Table[Index2].ReturnIndex())
    6510                     bFinded = TRUE;
    6511             // If did not found sub 1 from every index number above the index number
    6512             // which did not found.
    6513             if (bFinded == FALSE)
    6514                 {
    6515                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    6516                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6517                         if (Index3 == Table[Index2].ReturnIndex())
    6518                             Table[Index2].SetIndex(Index3 - 1);
    6519                 usMax --;
    6520                 }
    6521             if (bFinded == FALSE)
    6522                 bReady = FALSE;
    6523             bFinded = FALSE;
    6524             }
    6525         }
    6526     }
    6527 
    6528 
    6529 /***************************************************************************
    6530  *@@ ScriptPackage::FindUnusedIndex
    6531  *  Returns first unused index number.
    6532  */
    6533 USHORT ScriptPackage::FindUnusedIndex(ScriptCreateObject *Table, USHORT usTableSize)
    6534     {
    6535     USHORT Index, Index2, usMax = 0;
    6536     BOOL bFinded = FALSE;
    6537 
    6538     // First find largest index number.
    6539     for (Index = 0; Index < usTableSize; Index ++)
    6540         if (Table[Index].ReturnIndex() > usMax)
    6541             usMax = Table[Index].ReturnIndex();
    6542 
    6543     for (Index = 1; Index <= usMax; Index ++)
    6544         {
    6545         // Go through all the indexes of the table.
    6546         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6547             if (Index == Table[Index2].ReturnIndex())
    6548                 {
    6549                 bFinded = TRUE;
    6550                 break;
    6551                 }
    6552         // If Index found from the table continue.
    6553         if (bFinded == TRUE)
    6554             bFinded = FALSE;
    6555         // If not break.
    6556         else
    6557             break;
    6558         }
    6559 
    6560     return Index;
    6561     }
    6562 
    6563 
    6564 
    6565 
    6566 /***************************************************************************
    6567  *@@ ScriptPackage::CreateCreateObjectObject
    6568  *  Creates new CreateObject object and returns pointer to it.
    6569  */
    6570 ScriptCreateObject *ScriptPackage::CreateCreateObjectObject()
    6571     {
    6572     ScriptCreateObject *Object, *NewObject;
    6573 
    6574     if (!(Object = new ScriptCreateObject[++usCreateObjectCount]))
    6575         {
    6576         usCreateObjectCount --;
    6577         return NULL;
    6578         }
    6579 
    6580     Object[usCreateObjectCount - 1].SetIndex(FindUnusedIndex(this->pCreateObject,
    6581         usCreateObjectCount - 1));
    6582 
    6583     CopyTable(Object, this->pCreateObject, usCreateObjectCount - 1);
    6584     delete [] this->pCreateObject;
    6585     this->pCreateObject = Object;
    6586     NewObject = &this->pCreateObject[usCreateObjectCount - 1];
     6618        }
     6619
     6620    Object[_usCreateObjectCount - 1].SetIndex(FindUnusedIndex(this->_pCreateObject,
     6621        (USHORT)(_usCreateObjectCount - 1)));
     6622
     6623    CopyTable(Object, this->_pCreateObject, (USHORT)(_usCreateObjectCount - 1), (USHORT)0);
     6624    delete [] this->_pCreateObject;
     6625    this->_pCreateObject = Object;
     6626    NewObject = &this->_pCreateObject[_usCreateObjectCount - 1];
    65876627    return NewObject;
    65886628    }
    65896629
    65906630
    6591 
    6592 /***************************************************************************
    6593  *@@ ScriptPackage::CreateCreateObjectObject
     6631/*
     6632 *@@CreateCreateObjectObject:
    65946633 *  Creates CreateObject object and sets datas and returns pointer to it.
    65956634 *  Also sets datas according to data.
    65966635 */
    6597 ScriptCreateObject *ScriptPackage::CreateCreateObjectObject(CREATEOBJECTDATA data)
     6636ScriptCreateObject *ScriptPackage::CreateCreateObjectObject(CREATEOBJECTDATA p_data)
    65986637    {
    65996638    ScriptCreateObject *CreateObjectObject = CreateCreateObjectObject();
    66006639
    6601     CreateObjectObject->SetCreateObject(data);
     6640    CreateObjectObject->SetCreateObject(p_data);
    66026641    return CreateObjectObject;
    66036642    }
    66046643
    66056644
    6606 
    6607 /***************************************************************************
    6608  *@@ ScriptPackage::ReturnCreateObjectObject
     6645/*
     6646 *@@ReturnCreateObjectObject:
    66096647 *  Returns object which index is given usIndex.
    66106648 */
    6611 ScriptCreateObject *ScriptPackage::ReturnCreateObjectObject(USHORT usIndex)
     6649ScriptCreateObject *ScriptPackage::ReturnCreateObjectObject(USHORT p_usIndex)
    66126650    {
    66136651    USHORT Index;
    66146652
    6615     for (Index = 0; Index < this->usCreateObjectCount; Index ++)
    6616         if (pCreateObject[Index].ReturnIndex() == usIndex)
    6617             return &pCreateObject[Index];
     6653    for (Index = 0; Index < this->_usCreateObjectCount; Index ++)
     6654        if (_pCreateObject[Index].ReturnIndex() == p_usIndex)
     6655            return &_pCreateObject[Index];
    66186656    return NULL;
    66196657    }
    66206658
    66216659
    6622 
    6623 
    6624 /***************************************************************************
     6660/*
    66256661 *@@ ScriptPackage::DeleteCreateObjectObject
    66266662 *  Deletes object which index is given in usIndex.
    66276663 */
    6628 USHORT ScriptPackage::DeleteCreateObjectObject(USHORT usIndex)
     6664USHORT ScriptPackage::DeleteCreateObjectObject(USHORT p_usIndex)
    66296665    {
    66306666    ScriptCreateObject *TempCreateObject = NULL;
    66316667
    6632     if (usCreateObjectCount > 1)
    6633         {
    6634         TempCreateObject = new ScriptCreateObject[usCreateObjectCount - 1];
    6635         CopyTable(TempCreateObject, pCreateObject, usCreateObjectCount, usIndex);
    6636         if (bAllowIndexArrangement)
    6637             ReBuildIndexes(TempCreateObject, usCreateObjectCount - 1);
    6638         }
    6639     delete [] pCreateObject;
    6640     pCreateObject = TempCreateObject;
    6641     usCreateObjectCount --;
     6668    if (_usCreateObjectCount > 1)
     6669        {
     6670        TempCreateObject = new ScriptCreateObject[_usCreateObjectCount - 1];
     6671        CopyTable(TempCreateObject, _pCreateObject, _usCreateObjectCount, p_usIndex);
     6672        if (_bAllowIndexArrangement)
     6673            RebuildIndexes(TempCreateObject, (USHORT)(_usCreateObjectCount - 1));
     6674        }
     6675    delete [] _pCreateObject;
     6676    _pCreateObject = TempCreateObject;
     6677    _usCreateObjectCount --;
    66426678    return 0;
    66436679    }
     
    66456681
    66466682
    6647 /***************************************************************************
    6648  *@@ ScriptPackage::DeleteCreateObjectObject
    6649  *  Deletes object which address is *ScriptCreateObjectObject.
    6650  */
    6651 USHORT ScriptPackage::DeleteCreateObjectObject(ScriptCreateObject *ScriptCreateObjectObject)
     6683/*
     6684 *@@DeleteCreateObjectObject:
     6685 *  Deletes object which address is given as an attribute.
     6686 */
     6687USHORT ScriptPackage::DeleteCreateObjectObject(
     6688                      ScriptCreateObject *p_pScriptCreateObjectObject
     6689                                              )
    66526690    {
    66536691    USHORT Index = 0, usDelete;
    66546692    USHORT rc;
    66556693
    6656     if (!ScriptCreateObjectObject)
     6694    if (!p_pScriptCreateObjectObject)
    66576695        return 1;
    66586696
     
    66606698    while (TRUE)
    66616699        {
    6662         if (&pCreateObject[Index] == ScriptCreateObjectObject)
     6700        if (&_pCreateObject[Index] == p_pScriptCreateObjectObject)
    66636701            break;
    66646702        Index ++;
    6665         if (Index >= usCreateObjectCount)
     6703        if (Index >= _usCreateObjectCount)
    66666704            return 2;
    66676705        }
    66686706
    6669     usDelete = pCreateObject[Index].ReturnIndex();
     6707    usDelete = _pCreateObject[Index].ReturnIndex();
    66706708    rc = DeleteCreateObjectObject(usDelete);
    66716709
    6672 
    66736710    return rc;
    66746711    }
    66756712
    66766713
    6677 
    6678 
    6679 /***************************************************************************
    6680  *@@ ScriptPackage:: ReturnCreateObjectObjectCount
     6714/*
     6715 *@@ReturnCreateObjectObjectCount:
    66816716 *  Returns count number of ScriptCreateObjectObjects.
    66826717 */
    66836718USHORT ScriptPackage::ReturnCreateObjectObjectCount()
    66846719    {
    6685     return usCreateObjectCount;
    6686     }
    6687 
    6688 
    6689 
    6690 
    6691 
    6692 
    6693 /****************************************
    6694  *  ScriptClearProfile object handling.
    6695  ****************************************
    6696  * Here are functions when handling ScriptClearProfile objects. These functions
    6697  * are only way to add, remove or find desired ScriptClearProfile object.
    6698  */
    6699 
    6700 /***************************************************************************
    6701  *@@ ScriptClearProfile::CopyTable
    6702  *  Copies source table to destination table.
    6703  */
    6704 ScriptClearProfile *ScriptPackage::CopyTable(ScriptClearProfile *DestTable, // in: Pointer to destination table.
    6705                                              ScriptClearProfile *SrcTable, // in: Pointer to source table.
    6706                                              USHORT usSize, // in: Size of source table.
    6707                                              USHORT usSkipIndex) // in: Index to be skipped. If 0 no skipping.
    6708     {
    6709     USHORT SrcIndex, DestIndex;
    6710     if (!DestTable)
     6720    return _usCreateObjectCount;
     6721    }
     6722
     6723
     6724/*
     6725 *@@CreateClearProfileObject:
     6726 *  Creates new ClearProfile object and returns pointer to it.
     6727 */
     6728ScriptClearProfile *ScriptPackage::CreateClearProfileObject()
     6729    {
     6730    ScriptClearProfile *Object, *NewObject;
     6731
     6732    if (!(Object = new ScriptClearProfile[++_usProfileCount]))
     6733        {
     6734        _usProfileCount --;
    67116735        return NULL;
    6712     if (!SrcTable)
    6713         return DestTable;
    6714     for (SrcIndex = 0, DestIndex = 0; SrcIndex < usSize; SrcIndex ++, DestIndex ++)
    6715         {
    6716         if (SrcTable[SrcIndex].ReturnIndex() == usSkipIndex)
    6717             if (SrcIndex < usSize - 1)
    6718                 SrcIndex ++;
    6719             else
    6720                 break;
    6721         DestTable[DestIndex] = SrcTable[SrcIndex];
    6722         }
    6723 
    6724     return DestTable;
    6725     }
    6726 
    6727 
    6728 
    6729 
    6730 /***************************************************************************
    6731  *@@ ScriptClearProfile::ReBuildIndexes
    6732  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    6733  *  Example:
    6734  *      Old indexing: 1, 4, 3, 5
    6735  *      New indexing: 1, 3, 2, 4
    6736  */
    6737 void ScriptPackage::ReBuildIndexes(ScriptClearProfile *Table, USHORT usTableSize)
    6738     {
    6739     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    6740     BOOL bFinded = FALSE, bReady = FALSE;
    6741 
    6742     // First find largest index number.
    6743     for (Index = 0; Index < usTableSize; Index ++)
    6744         if (Table[Index].ReturnIndex() > usMax)
    6745             usMax = Table[Index].ReturnIndex();
    6746 
    6747     // Do this until it is sure that there is no skipped indexes left.
    6748     while (!bReady)
    6749         {
    6750         bReady = TRUE;
    6751         // Go through all index values from 1 to usMax.
    6752         for (Index = 1; Index <= usMax; Index ++)
    6753             {
    6754             // Check that Index number will be found.
    6755             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6756                 if (Index == Table[Index2].ReturnIndex())
    6757                     bFinded = TRUE;
    6758             // If did not found sub 1 from every index number above the index number
    6759             // which did not found.
    6760             if (bFinded == FALSE)
    6761                 {
    6762                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    6763                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6764                         if (Index3 == Table[Index2].ReturnIndex())
    6765                             Table[Index2].SetIndex(Index3 - 1);
    6766                 usMax --;
    6767                 }
    6768             if (bFinded == FALSE)
    6769                 bReady = FALSE;
    6770             bFinded = FALSE;
    6771             }
    6772         }
    6773     }
    6774 
    6775 
    6776 /***************************************************************************
    6777  *@@ ScriptPackage::FindUnusedIndex
    6778  *  Returns first unused index number.
    6779  */
    6780 USHORT ScriptPackage::FindUnusedIndex(ScriptClearProfile *Table, USHORT usTableSize)
    6781     {
    6782     USHORT Index, Index2, usMax = 0;
    6783     BOOL bFinded = FALSE;
    6784 
    6785     // First find largest index number.
    6786     for (Index = 0; Index < usTableSize; Index ++)
    6787         if (Table[Index].ReturnIndex() > usMax)
    6788             usMax = Table[Index].ReturnIndex();
    6789 
    6790     for (Index = 1; Index <= usMax; Index ++)
    6791         {
    6792         // Go through all the indexes of the table.
    6793         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    6794             if (Index == Table[Index2].ReturnIndex())
    6795                 {
    6796                 bFinded = TRUE;
    6797                 break;
    6798                 }
    6799         // If Index found from the table continue.
    6800         if (bFinded == TRUE)
    6801             bFinded = FALSE;
    6802         // If not break.
    6803         else
    6804             break;
    6805         }
    6806 
    6807     return Index;
    6808     }
    6809 
    6810 
    6811 
    6812 
    6813 /***************************************************************************
    6814  *@@ ScriptPackage::CreateClearProfileObject
    6815  *  Creates new ClearProfile object and returns pointer to it.
    6816  */
    6817 ScriptClearProfile *ScriptPackage::CreateClearProfileObject()
    6818     {
    6819     ScriptClearProfile *Object, *NewObject;
    6820 
    6821     if (!(Object = new ScriptClearProfile[++usProfileCount]))
    6822         {
    6823         usProfileCount --;
    6824         return NULL;
    6825         }
    6826 
    6827     Object[usProfileCount - 1].SetIndex(FindUnusedIndex(this->pProfile,
    6828         usProfileCount - 1));
    6829 
    6830     CopyTable(Object, this->pProfile, usProfileCount - 1);
    6831     delete [] this->pProfile;
    6832     this->pProfile = Object;
    6833     NewObject = &this->pProfile[usProfileCount - 1];
     6736        }
     6737
     6738    Object[_usProfileCount - 1].SetIndex(FindUnusedIndex(this->_pProfile,
     6739        (USHORT)(_usProfileCount - 1)));
     6740
     6741    CopyTable(Object, this->_pProfile, (USHORT)(_usProfileCount - 1), (USHORT)0);
     6742    delete [] this->_pProfile;
     6743    this->_pProfile = Object;
     6744    NewObject = &this->_pProfile[_usProfileCount - 1];
    68346745    return NewObject;
    68356746    }
    68366747
    68376748
    6838 
    6839 /***************************************************************************
    6840  *@@ ScriptPackage::CreateClearProfileObject
     6749/*
     6750 *@@CreateClearProfileObject:
    68416751 *  Creates Profile object and sets datas and returns pointer to it.
    68426752 *  Also sets datas according to data.
    68436753 */
    6844 ScriptClearProfile *ScriptPackage::CreateClearProfileObject(PROFILEDATA data)
     6754ScriptClearProfile *ScriptPackage::CreateClearProfileObject(PROFILEDATA p_data)
    68456755    {
    68466756    ScriptClearProfile *ProfileObject = CreateClearProfileObject();
    68476757
    6848     ProfileObject->SetProfile(data);
     6758    ProfileObject->SetProfile(p_data);
    68496759    return ProfileObject;
    68506760    }
    68516761
    68526762
    6853 
    6854 /***************************************************************************
    6855  *@@ ScriptPackage::ReturnClearProfileObject
    6856  *  Returns object which index is given usIndex.
    6857  */
    6858 ScriptClearProfile *ScriptPackage::ReturnClearProfileObject(USHORT usIndex)
     6763/*
     6764 *@@ReturnClearProfileObject:
     6765 *  Returns object which index is given as a parameter.
     6766 */
     6767ScriptClearProfile *ScriptPackage::ReturnClearProfileObject(USHORT p_usIndex)
    68596768    {
    68606769    USHORT Index;
    68616770
    6862     for (Index = 0; Index < this->usProfileCount; Index ++)
    6863         if (pProfile[Index].ReturnIndex() == usIndex)
    6864             return &pProfile[Index];
     6771    for (Index = 0; Index < this->_usProfileCount; Index ++)
     6772        if (_pProfile[Index].ReturnIndex() == p_usIndex)
     6773            return &_pProfile[Index];
    68656774    return NULL;
    68666775    }
    68676776
    68686777
    6869 
    6870 
    6871 /***************************************************************************
    6872  *@@ ScriptPackage::DeleteClearProfileObject
    6873  *  Deletes object which index is given in usIndex.
    6874  */
    6875 USHORT ScriptPackage::DeleteClearProfileObject(USHORT usIndex)
     6778/*
     6779 *@@DeleteClearProfileObject:
     6780 *  Deletes object which index is given.
     6781 */
     6782USHORT ScriptPackage::DeleteClearProfileObject(USHORT p_usIndex)
    68766783    {
    68776784    ScriptClearProfile *TempProfile = NULL;
    68786785
    6879     if (usProfileCount > 1)
    6880         {
    6881         TempProfile = new ScriptClearProfile[usProfileCount - 1];
    6882         CopyTable(TempProfile, pProfile, usProfileCount, usIndex);
    6883         if (bAllowIndexArrangement)
    6884             ReBuildIndexes(TempProfile, usProfileCount - 1);
    6885         }
    6886     delete [] pProfile;
    6887     pProfile = TempProfile;
    6888     usProfileCount --;
     6786    if (_usProfileCount > 1)
     6787        {
     6788        TempProfile = new ScriptClearProfile[_usProfileCount - 1];
     6789        CopyTable(TempProfile, _pProfile, _usProfileCount, p_usIndex);
     6790        if (_bAllowIndexArrangement)
     6791            RebuildIndexes(TempProfile, (USHORT)(_usProfileCount - 1));
     6792        }
     6793    delete [] _pProfile;
     6794    _pProfile = TempProfile;
     6795    _usProfileCount --;
    68896796    return 0;
    68906797    }
    68916798
    68926799
    6893 
    6894 /***************************************************************************
    6895  *@@ ScriptPackage::DeleteClearProfileObject
    6896  *  Deletes object which address is *ScriptClearProfileObject.
     6800/*
     6801 *@@DeleteClearProfileObject:
     6802 *  Deletes object which address is given.
    68976803 */
    68986804USHORT ScriptPackage::DeleteClearProfileObject(ScriptClearProfile
    6899                                                *ScriptClearProfileObject)
     6805                                               *p_pScriptClearProfileObject)
    69006806    {
    69016807    USHORT Index = 0, usDelete;
    69026808    USHORT rc;
    69036809
    6904     if (!ScriptClearProfileObject)
     6810    if (!p_pScriptClearProfileObject)
    69056811        return 1;
    69066812
     
    69086814    while (TRUE)
    69096815        {
    6910         if (&pProfile[Index] == ScriptClearProfileObject)
     6816        if (&_pProfile[Index] == p_pScriptClearProfileObject)
    69116817            break;
    69126818        Index ++;
    6913         if (Index >= usProfileCount)
     6819        if (Index >= _usProfileCount)
    69146820            return 2;
    69156821        }
    69166822
    6917     usDelete = pProfile[Index].ReturnIndex();
     6823    usDelete = _pProfile[Index].ReturnIndex();
    69186824    rc = DeleteClearProfileObject(usDelete);
    69196825
    6920 
    69216826    return rc;
    69226827    }
    69236828
    69246829
    6925 
    6926 
    6927 /***************************************************************************
    6928  *@@ ScriptPackage:: ReturnClearProfileObjectCount
     6830/*
     6831 *@@ReturnClearProfileObjectCount:
    69296832 *  Returns count number of ScriptClearProfileObjects.
    69306833 */
    69316834USHORT ScriptPackage::ReturnClearProfileObjectCount()
    69326835    {
    6933     return usProfileCount;
    6934     }
    6935 
    6936 
    6937 
    6938 
    6939 /***********************************
    6940  *  ScriptWriteProfile object handling.
    6941  ***********************************
    6942  * Here are functions when handling ScriptWriteProfile objects. These functions
    6943  * are only way to add, remove or find desired ScriptWriteProfile object.
    6944  */
    6945 
    6946 /***************************************************************************
    6947  *@@ ScriptWriteProfile::CopyTable
    6948  *  Copies source table to destination table.
    6949  */
    6950 ScriptWriteProfile *ScriptPackage::CopyTable(ScriptWriteProfile *DestTable,
    6951                                         ScriptWriteProfile *SrcTable,
    6952                                         USHORT usSize, USHORT usSkipIndex)
    6953     {
    6954     USHORT SrcIndex, DestIndex;
    6955     if (!DestTable)
     6836    return _usProfileCount;
     6837    }
     6838
     6839
     6840/*
     6841 *@@CreateWriteProfileObject:
     6842 *  Creates new WriteProfile object and returns pointer to it.
     6843 */
     6844ScriptWriteProfile *ScriptPackage::CreateWriteProfileObject()
     6845    {
     6846    ScriptWriteProfile *Object, *NewObject;
     6847
     6848    if (!(Object = new ScriptWriteProfile[++_usWriteProfileCount]))
     6849        {
     6850        _usWriteProfileCount --;
    69566851        return NULL;
    6957     if (!SrcTable)
    6958         return DestTable;
    6959         for (SrcIndex = 0, DestIndex = 0; SrcIndex < usSize; SrcIndex ++, DestIndex ++)
    6960         {
    6961         if (SrcTable[SrcIndex].ReturnIndex() == usSkipIndex)
    6962             if (SrcIndex < usSize - 1)
    6963                 SrcIndex ++;
    6964             else
    6965                 break;
    6966         DestTable[DestIndex] = SrcTable[SrcIndex];
    6967         }
    6968 
    6969     return DestTable;
    6970     }
    6971 
    6972 
    6973 
    6974 
    6975 /***************************************************************************
    6976  *@@ ScriptWriteProfile::ReBuildIndexes
    6977  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    6978  *  Example:
    6979  *      Old indexing: 1, 4, 3, 5
    6980  *      New indexing: 1, 3, 2, 4
    6981  */
    6982 void ScriptPackage::ReBuildIndexes(ScriptWriteProfile *Table, USHORT usTableSize)
    6983     {
    6984     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    6985     BOOL bFinded = FALSE, bReady = FALSE;
    6986 
    6987     // First find largest index number.
    6988     for (Index = 0; Index < usTableSize; Index ++)
    6989         if (Table[Index].ReturnIndex() > usMax)
    6990             usMax = Table[Index].ReturnIndex();
    6991 
    6992     // Do this until it is sure that there is no skipped indexes left.
    6993     while (!bReady)
    6994         {
    6995         bReady = TRUE;
    6996         // Go through all index values from 1 to usMax.
    6997         for (Index = 1; Index <= usMax; Index ++)
    6998             {
    6999             // Check that Index number will be found.
    7000             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7001                 if (Index == Table[Index2].ReturnIndex())
    7002                     bFinded = TRUE;
    7003             // If did not found sub 1 from every index number above the index number
    7004             // which did not found.
    7005             if (bFinded == FALSE)
    7006                 {
    7007                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    7008                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7009                         if (Index3 == Table[Index2].ReturnIndex())
    7010                             Table[Index2].SetIndex(Index3 - 1);
    7011                 usMax --;
    7012                 }
    7013             if (bFinded == FALSE)
    7014                 bReady = FALSE;
    7015             bFinded = FALSE;
    7016             }
    7017         }
    7018     }
    7019 
    7020 
    7021 /***************************************************************************
    7022  *@@ ScriptPackage::FindUnusedIndex
    7023  *  Returns first unused index number.
    7024  */
    7025 USHORT ScriptPackage::FindUnusedIndex(ScriptWriteProfile *Table, USHORT usTableSize)
    7026     {
    7027     USHORT Index, Index2, usMax = 0;
    7028     BOOL bFinded = FALSE;
    7029 
    7030     // First find largest index number.
    7031     for (Index = 0; Index < usTableSize; Index ++)
    7032         if (Table[Index].ReturnIndex() > usMax)
    7033             usMax = Table[Index].ReturnIndex();
    7034 
    7035     for (Index = 1; Index <= usMax; Index ++)
    7036         {
    7037         // Go through all the indexes of the table.
    7038         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7039             if (Index == Table[Index2].ReturnIndex())
    7040                 {
    7041                 bFinded = TRUE;
    7042                 break;
    7043                 }
    7044         // If Index found from the table continue.
    7045         if (bFinded == TRUE)
    7046             bFinded = FALSE;
    7047         // If not break.
    7048         else
    7049             break;
    7050         }
    7051 
    7052     return Index;
    7053     }
    7054 
    7055 
    7056 
    7057 
    7058 /***************************************************************************
    7059  *@@ ScriptPackage::CreateWriteProfileObject
    7060  *  Creates new WriteProfile object and returns pointer to it.
    7061  */
    7062 ScriptWriteProfile *ScriptPackage::CreateWriteProfileObject()
    7063     {
    7064     ScriptWriteProfile *Object, *NewObject;
    7065 
    7066     if (!(Object = new ScriptWriteProfile[++usWriteProfileCount]))
    7067         {
    7068         usWriteProfileCount --;
    7069         return NULL;
    7070         }
    7071 
    7072     Object[usWriteProfileCount - 1].SetIndex(FindUnusedIndex(this->pWriteProfile,
    7073         usWriteProfileCount - 1));
    7074 
    7075     CopyTable(Object, this->pWriteProfile, usWriteProfileCount - 1);
    7076     delete [] this->pWriteProfile;
    7077     this->pWriteProfile = Object;
    7078     NewObject = &this->pWriteProfile[usWriteProfileCount - 1];
     6852        }
     6853
     6854    Object[_usWriteProfileCount - 1].SetIndex(FindUnusedIndex(this->_pWriteProfile,
     6855        (USHORT)(_usWriteProfileCount - 1)));
     6856
     6857    CopyTable(Object, this->_pWriteProfile, (USHORT)(_usWriteProfileCount - 1),
     6858             (USHORT)0);
     6859    delete [] this->_pWriteProfile;
     6860    this->_pWriteProfile = Object;
     6861    NewObject = &this->_pWriteProfile[_usWriteProfileCount - 1];
    70796862    return NewObject;
    70806863    }
    70816864
    70826865
    7083 
    7084 /***************************************************************************
    7085  *@@ ScriptPackage::CreateWriteProfileObject
     6866/*
     6867 *@@CreateWriteProfileObject:
    70866868 *  Creates WriteProfile object and sets datas and returns pointer to it.
    70876869 *  Also sets datas according to data.
    70886870 */
    7089 ScriptWriteProfile *ScriptPackage::CreateWriteProfileObject(PROFILEDATA data)
     6871ScriptWriteProfile *ScriptPackage::CreateWriteProfileObject(PROFILEDATA p_data)
    70906872    {
    70916873    ScriptWriteProfile *WriteProfileObject = CreateWriteProfileObject();
    70926874
    7093     WriteProfileObject->SetProfile(data);
     6875    WriteProfileObject->SetProfile(p_data);
    70946876    return WriteProfileObject;
    70956877    }
    70966878
    70976879
    7098 
    7099 /***************************************************************************
    7100  *@@ ScriptPackage::ReturnWriteProfileObject
     6880/*
     6881 *@@ReturnWriteProfileObject:
    71016882 *  Returns object which index is given usIndex.
    71026883 */
    7103 ScriptWriteProfile *ScriptPackage::ReturnWriteProfileObject(USHORT usIndex)
     6884ScriptWriteProfile *ScriptPackage::ReturnWriteProfileObject(USHORT p_usIndex)
    71046885    {
    71056886    USHORT Index;
    71066887
    7107     for (Index = 0; Index < this->usWriteProfileCount; Index ++)
    7108         if (pWriteProfile[Index].ReturnIndex() == usIndex)
    7109             return &pWriteProfile[Index];
     6888    for (Index = 0; Index < this->_usWriteProfileCount; Index ++)
     6889        if (_pWriteProfile[Index].ReturnIndex() == p_usIndex)
     6890            return &_pWriteProfile[Index];
    71106891    return NULL;
    71116892    }
    71126893
    71136894
    7114 
    7115 
    7116 /***************************************************************************
    7117  *@@ ScriptPackage::DeleteWriteProfileObject
    7118  *  Deletes object which index is given in usIndex.
    7119  */
    7120 USHORT ScriptPackage::DeleteWriteProfileObject(USHORT usIndex)
     6895/*
     6896 *@@DeleteWriteProfileObject:
     6897 *  Deletes object which index is given in as a parameter.
     6898 */
     6899USHORT ScriptPackage::DeleteWriteProfileObject(USHORT p_usIndex)
    71216900    {
    71226901    ScriptWriteProfile *TempWriteProfile = NULL;
    71236902
    7124     if (usWriteProfileCount > 1)
    7125         {
    7126         TempWriteProfile = new ScriptWriteProfile[usWriteProfileCount - 1];
    7127         CopyTable(TempWriteProfile, pWriteProfile, usWriteProfileCount, usIndex);
    7128         if (bAllowIndexArrangement)
    7129             ReBuildIndexes(TempWriteProfile, usWriteProfileCount - 1);
    7130         }
    7131     delete [] pWriteProfile;
    7132     pWriteProfile = TempWriteProfile;
    7133     usWriteProfileCount --;
     6903    if (_usWriteProfileCount > 1)
     6904        {
     6905        TempWriteProfile = new ScriptWriteProfile[_usWriteProfileCount - 1];
     6906        CopyTable(TempWriteProfile, _pWriteProfile, _usWriteProfileCount, p_usIndex);
     6907        if (_bAllowIndexArrangement)
     6908            RebuildIndexes(TempWriteProfile, (USHORT)(_usWriteProfileCount - 1));
     6909        }
     6910    delete [] _pWriteProfile;
     6911    _pWriteProfile = TempWriteProfile;
     6912    _usWriteProfileCount --;
    71346913    return 0;
    71356914    }
    71366915
    71376916
    7138 
    7139 /***************************************************************************
    7140  *@@ ScriptPackage::DeleteWriteProfileObject
    7141  *  Deletes object which address is *ScriptWriteProfileObject.
    7142  */
    7143 USHORT ScriptPackage::DeleteWriteProfileObject(ScriptWriteProfile *ScriptWriteProfileObject)
     6917/*
     6918 *@@DeleteWriteProfileObject:
     6919 *  Deletes object which address is given as a parameter.
     6920 */
     6921USHORT ScriptPackage::DeleteWriteProfileObject(
     6922                      ScriptWriteProfile *p_pScriptWriteProfileObject
     6923                                              )
    71446924    {
    71456925    USHORT Index = 0, usDelete;
    71466926    USHORT rc;
    71476927
    7148     if (!ScriptWriteProfileObject)
     6928    if (!p_pScriptWriteProfileObject)
    71496929        return 1;
    71506930
     
    71526932    while (TRUE)
    71536933        {
    7154         if (&pWriteProfile[Index] == ScriptWriteProfileObject)
     6934        if (&_pWriteProfile[Index] == p_pScriptWriteProfileObject)
    71556935            break;
    71566936        Index ++;
    7157         if (Index >= usWriteProfileCount)
     6937        if (Index >= _usWriteProfileCount)
    71586938            return 2;
    71596939        }
    71606940
    7161     usDelete = pWriteProfile[Index].ReturnIndex();
     6941    usDelete = _pWriteProfile[Index].ReturnIndex();
    71626942    rc = DeleteWriteProfileObject(usDelete);
    7163 
    7164 
    71656943    return rc;
    71666944    }
    71676945
    71686946
    7169 
    7170 
    7171 /***************************************************************************
    7172  *@@ ScriptPackage:: ReturnWriteProfileObjectCount
     6947/*
     6948 *@@ReturnWriteProfileObjectCount:
    71736949 *  Returns count number of ScriptWriteProfileObjects.
    71746950 */
    71756951USHORT ScriptPackage::ReturnWriteProfileObjectCount()
    71766952    {
    7177     return usWriteProfileCount;
    7178     }
    7179 
    7180 
    7181 
    7182 
    7183 
    7184 
    7185 /****************************************
    7186  *  ScriptExecute object handling.
    7187  ****************************************
    7188  * Here are functions when handling ScriptExecute objects. These functions
    7189  * are only way to add, remove or find desired ScriptExecute object.
    7190  */
    7191 
    7192 /***************************************************************************
    7193  *@@ ScriptExecute::CopyTable
    7194  *  Copies source table to destination table.
    7195  */
    7196 ScriptExecute *ScriptPackage::CopyTable(ScriptExecute *DestTable, // in: Pointer to destination table.
    7197                                              ScriptExecute *SrcTable, // in: Pointer to source table.
    7198                                              USHORT usSize, // in: Size of source table.
    7199                                              USHORT usSkipIndex) // in: Index to be skipped. If 0 no skipping.
    7200     {
    7201     USHORT SrcIndex, DestIndex;
    7202     if (!DestTable)
     6953    return _usWriteProfileCount;
     6954    }
     6955
     6956
     6957/*
     6958 *@@CreateExecuteObject:
     6959 *  Creates new Execute object and returns pointer to it.
     6960 */
     6961ScriptExecute *ScriptPackage::CreateExecuteObject()
     6962    {
     6963    ScriptExecute *Object, *NewObject;
     6964
     6965    if (!(Object = new ScriptExecute[++_usExecuteCount]))
     6966        {
     6967        _usExecuteCount --;
    72036968        return NULL;
    7204     if (!SrcTable)
    7205         return DestTable;
    7206         for (SrcIndex = 0, DestIndex = 0; SrcIndex < usSize; SrcIndex ++, DestIndex ++)
    7207         {
    7208         if (SrcTable[SrcIndex].ReturnIndex() == usSkipIndex)
    7209             if (SrcIndex < usSize - 1)
    7210                 SrcIndex ++;
    7211             else
    7212                 break;
    7213         DestTable[DestIndex] = SrcTable[SrcIndex];
    7214         }
    7215 
    7216     return DestTable;
    7217     }
    7218 
    7219 
    7220 
    7221 
    7222 /***************************************************************************
    7223  *@@ ScriptExecute::ReBuildIndexes
    7224  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    7225  *  Example:
    7226  *      Old indexing: 1, 4, 3, 5
    7227  *      New indexing: 1, 3, 2, 4
    7228  */
    7229 void ScriptPackage::ReBuildIndexes(ScriptExecute *Table, USHORT usTableSize)
    7230     {
    7231     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    7232     BOOL bFinded = FALSE, bReady = FALSE;
    7233 
    7234     // First find largest index number.
    7235     for (Index = 0; Index < usTableSize; Index ++)
    7236         if (Table[Index].ReturnIndex() > usMax)
    7237             usMax = Table[Index].ReturnIndex();
    7238 
    7239     // Do this until it is sure that there is no skipped indexes left.
    7240     while (!bReady)
    7241         {
    7242         bReady = TRUE;
    7243         // Go through all index values from 1 to usMax.
    7244         for (Index = 1; Index <= usMax; Index ++)
    7245             {
    7246             // Check that Index number will be found.
    7247             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7248                 if (Index == Table[Index2].ReturnIndex())
    7249                     bFinded = TRUE;
    7250             // If did not found sub 1 from every index number above the index number
    7251             // which did not found.
    7252             if (bFinded == FALSE)
    7253                 {
    7254                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    7255                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7256                         if (Index3 == Table[Index2].ReturnIndex())
    7257                             Table[Index2].SetIndex(Index3 - 1);
    7258                 usMax --;
    7259                 }
    7260             if (bFinded == FALSE)
    7261                 bReady = FALSE;
    7262             bFinded = FALSE;
    7263             }
    7264         }
    7265     }
    7266 
    7267 
    7268 /***************************************************************************
    7269  *@@ ScriptPackage::FindUnusedIndex
    7270  *  Returns first unused index number.
    7271  */
    7272 USHORT ScriptPackage::FindUnusedIndex(ScriptExecute *Table, USHORT usTableSize)
    7273     {
    7274     USHORT Index, Index2, usMax = 0;
    7275     BOOL bFinded = FALSE;
    7276 
    7277     // First find largest index number.
    7278     for (Index = 0; Index < usTableSize; Index ++)
    7279         if (Table[Index].ReturnIndex() > usMax)
    7280             usMax = Table[Index].ReturnIndex();
    7281 
    7282     for (Index = 1; Index <= usMax; Index ++)
    7283         {
    7284         // Go through all the indexes of the table.
    7285         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7286             if (Index == Table[Index2].ReturnIndex())
    7287                 {
    7288                 bFinded = TRUE;
    7289                 break;
    7290                 }
    7291         // If Index found from the table continue.
    7292         if (bFinded == TRUE)
    7293             bFinded = FALSE;
    7294         // If not break.
    7295         else
    7296             break;
    7297         }
    7298 
    7299     return Index;
    7300     }
    7301 
    7302 
    7303 
    7304 
    7305 /***************************************************************************
    7306  *@@ ScriptPackage::CreateExecuteObject
    7307  *  Creates new Execute object and returns pointer to it.
    7308  */
    7309 ScriptExecute *ScriptPackage::CreateExecuteObject()
    7310     {
    7311     ScriptExecute *Object, *NewObject;
    7312 
    7313     if (!(Object = new ScriptExecute[++usExecuteCount]))
    7314         {
    7315         usExecuteCount --;
    7316         return NULL;
    7317         }
    7318 
    7319     Object[usExecuteCount - 1].SetIndex(FindUnusedIndex(this->pExecute,
    7320         usExecuteCount - 1));
    7321 
    7322     CopyTable(Object, this->pExecute, usExecuteCount - 1);
    7323     delete [] this->pExecute;
    7324     this->pExecute = Object;
    7325     NewObject = &this->pExecute[usExecuteCount - 1];
     6969        }
     6970
     6971    Object[_usExecuteCount - 1].SetIndex(FindUnusedIndex(this->_pExecute,
     6972        (USHORT)(_usExecuteCount - 1)));
     6973
     6974    CopyTable(Object, this->_pExecute, (USHORT)(_usExecuteCount - 1), (USHORT)0);
     6975    delete [] this->_pExecute;
     6976    this->_pExecute = Object;
     6977    NewObject = &this->_pExecute[_usExecuteCount - 1];
    73266978    return NewObject;
    73276979    }
    73286980
    73296981
    7330 
    7331 /***************************************************************************
    7332  *@@ ScriptPackage::CreateExecuteObject
     6982/*
     6983 *@@CreateExecuteObject:
    73336984 *  Creates Execute object and sets datas and returns pointer to it.
    73346985 */
    7335 ScriptExecute *ScriptPackage::CreateExecuteObject(PSZ pszExecute)
     6986ScriptExecute *ScriptPackage::CreateExecuteObject(PSZ p_pszExecute)
    73366987    {
    73376988    ScriptExecute *ExecuteObject = CreateExecuteObject();
    73386989
    7339     ExecuteObject->SetExecFileParams(pszExecute);
     6990    ExecuteObject->SetExecFileParams(p_pszExecute);
    73406991    return ExecuteObject;
    73416992    }
    73426993
    73436994
    7344 
    7345 /***************************************************************************
    7346  *@@ ScriptPackage::ReturnExecuteObject
     6995/*
     6996 *@@ReturnExecuteObject:
    73476997 *  Returns object which index is given usIndex.
    73486998 */
    7349 ScriptExecute *ScriptPackage::ReturnExecuteObject(USHORT usIndex)
     6999ScriptExecute *ScriptPackage::ReturnExecuteObject(USHORT p_usIndex)
    73507000    {
    73517001    USHORT Index;
    73527002
    7353     for (Index = 0; Index < this->usExecuteCount; Index ++)
    7354         if (pExecute[Index].ReturnIndex() == usIndex)
    7355             return &pExecute[Index];
     7003    for (Index = 0; Index < this->_usExecuteCount; Index ++)
     7004        if (_pExecute[Index].ReturnIndex() == p_usIndex)
     7005            return &_pExecute[Index];
    73567006    return NULL;
    73577007    }
    73587008
    73597009
    7360 
    7361 
    7362 /***************************************************************************
    7363  *@@ ScriptPackage::DeleteExecuteObject
    7364  *  Deletes object which index is given in usIndex.
    7365  */
    7366 USHORT ScriptPackage::DeleteExecuteObject(USHORT usIndex)
     7010/*
     7011 *@@DeleteExecuteObject:
     7012 *  Deletes object which index is given as a parameter.
     7013 */
     7014USHORT ScriptPackage::DeleteExecuteObject(USHORT p_usIndex)
    73677015    {
    73687016    ScriptExecute *TempExecute = NULL;
    73697017
    7370     if (usExecuteCount > 1)
    7371         {
    7372         TempExecute = new ScriptExecute[usExecuteCount - 1];
    7373         CopyTable(TempExecute, pExecute, usExecuteCount, usIndex);
    7374         if (bAllowIndexArrangement)
    7375             ReBuildIndexes(TempExecute, usExecuteCount - 1);
    7376         }
    7377     delete [] pExecute;
    7378     pExecute = TempExecute;
    7379     usExecuteCount --;
     7018    if (_usExecuteCount > 1)
     7019        {
     7020        TempExecute = new ScriptExecute[_usExecuteCount - 1];
     7021        CopyTable(TempExecute, _pExecute, _usExecuteCount, p_usIndex);
     7022        if (_bAllowIndexArrangement)
     7023            RebuildIndexes(TempExecute, (USHORT)(_usExecuteCount - 1));
     7024        }
     7025    delete [] _pExecute;
     7026    _pExecute = TempExecute;
     7027    _usExecuteCount --;
    73807028    return 0;
    73817029    }
    73827030
    73837031
    7384 
    7385 /***************************************************************************
    7386  *@@ ScriptPackage::DeleteExecuteObject
    7387  *  Deletes object which address is *ScriptExecuteObject.
    7388  */
    7389 USHORT ScriptPackage::DeleteExecuteObject(ScriptExecute *ScriptExecuteObject)
     7032/*
     7033 *@@DeleteExecuteObject:
     7034 *  Deletes object which address is given as a parameter.
     7035 */
     7036USHORT ScriptPackage::DeleteExecuteObject(ScriptExecute *p_pScriptExecuteObject)
    73907037    {
    73917038    USHORT Index = 0, usDelete;
    73927039    USHORT rc;
    73937040
    7394     if (!ScriptExecuteObject)
     7041    if (!p_pScriptExecuteObject)
    73957042        return 1;
    73967043
     
    73987045    while (TRUE)
    73997046        {
    7400         if (&pExecute[Index] == ScriptExecuteObject)
     7047        if (&_pExecute[Index] == p_pScriptExecuteObject)
    74017048            break;
    74027049        Index ++;
    7403         if (Index >= usExecuteCount)
     7050        if (Index >= _usExecuteCount)
    74047051            return 2;
    74057052        }
    74067053
    7407     usDelete = pExecute[Index].ReturnIndex();
     7054    usDelete = _pExecute[Index].ReturnIndex();
    74087055    rc = DeleteExecuteObject(usDelete);
    74097056
    7410 
    74117057    return rc;
    74127058    }
    74137059
    74147060
    7415 
    7416 
    7417 /***************************************************************************
    7418  *@@ ScriptPackage:: ReturnExecuteObjectCount
     7061/*
     7062 *@@ReturnExecuteObjectCount:
    74197063 *  Returns count number of ScriptExecuteObjects.
    74207064 */
    74217065USHORT ScriptPackage::ReturnExecuteObjectCount()
    74227066    {
    7423     return usExecuteCount;
    7424     }
    7425 
    7426 
    7427 
    7428 
    7429 /***********************************
    7430  *  ScriptKillProcess object handling.
    7431  ***********************************
    7432  * Here are functions when handling ScriptKillProcess objects. These functions
    7433  * are only way to add, remove or find desired ScriptKillProcess object.
    7434  */
    7435 
    7436 /***************************************************************************
    7437  *@@ ScriptKillProcess::CopyTable
    7438  *  Copies source table to destination table.
    7439  */
    7440 ScriptKillProcess *ScriptPackage::CopyTable(ScriptKillProcess *DestTable,
    7441                                         ScriptKillProcess *SrcTable,
    7442                                         USHORT usSize, USHORT usSkipIndex)
    7443     {
    7444     USHORT SrcIndex, DestIndex;
    7445     if (!DestTable)
     7067    return _usExecuteCount;
     7068    }
     7069
     7070
     7071/*
     7072 *@@CreateKillProcessObject:
     7073 *  Creates new KillProcess object and returns pointer to it.
     7074 */
     7075ScriptKillProcess *ScriptPackage::CreateKillProcessObject()
     7076    {
     7077    ScriptKillProcess *Object, *NewObject;
     7078
     7079    if (!(Object = new ScriptKillProcess[++_usKillProcessCount]))
     7080        {
     7081        _usKillProcessCount --;
    74467082        return NULL;
    7447     if (!SrcTable)
    7448         return DestTable;
    7449     for (SrcIndex = 0, DestIndex = 0; DestIndex < usSize - 1; SrcIndex ++, DestIndex ++)
    7450         {
    7451         if ((SrcTable[SrcIndex].ReturnIndex() == usSkipIndex) && (SrcIndex < usSize - 1))
    7452             SrcIndex ++;
    7453         DestTable[DestIndex] = SrcTable[SrcIndex];
    7454         }
    7455 
    7456     return DestTable;
    7457     }
    7458 
    7459 
    7460 
    7461 
    7462 /***************************************************************************
    7463  *@@ ScriptKillProcess::ReBuildIndexes
    7464  *  Rebuilds indexes after deletion. The order of the indexes does not matter.
    7465  *  Example:
    7466  *      Old indexing: 1, 4, 3, 5
    7467  *      New indexing: 1, 3, 2, 4
    7468  */
    7469 void ScriptPackage::ReBuildIndexes(ScriptKillProcess *Table, USHORT usTableSize)
    7470     {
    7471     USHORT Index, Index2, Index3, usMissing, usMax = 0, i;
    7472     BOOL bFinded = FALSE, bReady = FALSE;
    7473 
    7474     // First find largest index number.
    7475     for (Index = 0; Index < usTableSize; Index ++)
    7476         if (Table[Index].ReturnIndex() > usMax)
    7477             usMax = Table[Index].ReturnIndex();
    7478 
    7479     // Do this until it is sure that there is no skipped indexes left.
    7480     while (!bReady)
    7481         {
    7482         bReady = TRUE;
    7483         // Go through all index values from 1 to usMax.
    7484         for (Index = 1; Index <= usMax; Index ++)
    7485             {
    7486             // Check that Index number will be found.
    7487             for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7488                 if (Index == Table[Index2].ReturnIndex())
    7489                     bFinded = TRUE;
    7490             // If did not found sub 1 from every index number above the index number
    7491             // which did not found.
    7492             if (bFinded == FALSE)
    7493                 {
    7494                 for (Index3 = Index + 1; Index3 <= usMax; Index3 ++)
    7495                     for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7496                         if (Index3 == Table[Index2].ReturnIndex())
    7497                             Table[Index2].SetIndex(Index3 - 1);
    7498                 usMax --;
    7499                 }
    7500             if (bFinded == FALSE)
    7501                 bReady = FALSE;
    7502             bFinded = FALSE;
    7503             }
    7504         }
    7505     }
    7506 
    7507 
    7508 /***************************************************************************
    7509  *@@ ScriptPackage::FindUnusedIndex
    7510  *  Returns first unused index number.
    7511  */
    7512 USHORT ScriptPackage::FindUnusedIndex(ScriptKillProcess *Table, USHORT usTableSize)
    7513     {
    7514     USHORT Index, Index2, usMax = 0;
    7515     BOOL bFinded = FALSE;
    7516 
    7517     // First find largest index number.
    7518     for (Index = 0; Index < usTableSize; Index ++)
    7519         if (Table[Index].ReturnIndex() > usMax)
    7520             usMax = Table[Index].ReturnIndex();
    7521 
    7522     for (Index = 1; Index <= usMax; Index ++)
    7523         {
    7524         // Go through all the indexes of the table.
    7525         for (Index2 = 0; Index2 < usTableSize; Index2 ++)
    7526             if (Index == Table[Index2].ReturnIndex())
    7527                 {
    7528                 bFinded = TRUE;
    7529                 break;
    7530                 }
    7531         // If Index found from the table continue.
    7532         if (bFinded == TRUE)
    7533             bFinded = FALSE;
    7534         // If not break.
    7535         else
    7536             break;
    7537         }
    7538 
    7539     return Index;
    7540     }
    7541 
    7542 
    7543 
    7544 
    7545 /***************************************************************************
    7546  *@@ ScriptPackage::CreateKillProcessObject
    7547  *  Creates new KillProcess object and returns pointer to it.
    7548  */
    7549 ScriptKillProcess *ScriptPackage::CreateKillProcessObject()
    7550     {
    7551     ScriptKillProcess *Object, *NewObject;
    7552 
    7553     if (!(Object = new ScriptKillProcess[++usKillProcessCount]))
    7554         {
    7555         usKillProcessCount --;
    7556         return NULL;
    7557         }
    7558 
    7559     Object[usKillProcessCount - 1].SetIndex(FindUnusedIndex(this->pKillProcess,
    7560         usKillProcessCount - 1));
    7561 
    7562     CopyTable(Object, this->pKillProcess, usKillProcessCount - 1);
    7563     delete [] this->pKillProcess;
    7564     this->pKillProcess = Object;
    7565     NewObject = &this->pKillProcess[usKillProcessCount - 1];
     7083        }
     7084
     7085    Object[_usKillProcessCount - 1].SetIndex(FindUnusedIndex(this->_pKillProcess,
     7086        (USHORT)(_usKillProcessCount - 1)));
     7087
     7088    CopyTable(Object, this->_pKillProcess, (USHORT)(_usKillProcessCount - 1), (USHORT)0);
     7089    delete [] this->_pKillProcess;
     7090    this->_pKillProcess = Object;
     7091    NewObject = &this->_pKillProcess[_usKillProcessCount - 1];
    75667092    return NewObject;
    75677093    }
    75687094
    75697095
    7570 
    7571 /***************************************************************************
    7572  *@@ ScriptPackage::CreateKillProcessObject
     7096/*
     7097 *@@CreateKillProcessObject:
    75737098 *  Creates KillProcess object and sets datas and returns pointer to it.
    75747099 *  Also sets datas according to data.
    75757100 */
    7576 ScriptKillProcess *ScriptPackage::CreateKillProcessObject(const PSZ pszFileName)
     7101ScriptKillProcess *ScriptPackage::CreateKillProcessObject(const PSZ p_pszFileName)
    75777102    {
    75787103    ScriptKillProcess *KillProcessObject = CreateKillProcessObject();
    75797104
    7580     KillProcessObject->SetFileName(pszFileName);
     7105    KillProcessObject->SetFileName(p_pszFileName);
    75817106    return KillProcessObject;
    75827107    }
    75837108
    75847109
    7585 
    7586 /***************************************************************************
    7587  *@@ ScriptPackage::ReturnKillProcessObject
     7110/*
     7111 *@@ReturnKillProcessObject:
    75887112 *  Returns object which index is given usIndex.
    75897113 */
    7590 ScriptKillProcess *ScriptPackage::ReturnKillProcessObject(USHORT usIndex)
     7114ScriptKillProcess *ScriptPackage::ReturnKillProcessObject(USHORT p_usIndex)
    75917115    {
    75927116    USHORT Index;
    75937117
    7594     for (Index = 0; Index < this->usKillProcessCount; Index ++)
    7595         if (pKillProcess[Index].ReturnIndex() == usIndex)
    7596             return &pKillProcess[Index];
     7118    for (Index = 0; Index < this->_usKillProcessCount; Index ++)
     7119        if (_pKillProcess[Index].ReturnIndex() == p_usIndex)
     7120            return &_pKillProcess[Index];
    75977121    return NULL;
    75987122    }
    75997123
    76007124
    7601 
    7602 
    7603 /***************************************************************************
    7604  *@@ ScriptPackage::DeleteKillProcessObject
     7125/*
     7126 *@@DeleteKillProcessObject:
    76057127 *  Deletes object which index is given in usIndex.
    76067128 */
    7607 USHORT ScriptPackage::DeleteKillProcessObject(USHORT usIndex)
     7129USHORT ScriptPackage::DeleteKillProcessObject(USHORT p_usIndex)
    76087130    {
    76097131    ScriptKillProcess *TempKillProcess = NULL;
    76107132
    7611     if (usKillProcessCount > 1)
    7612         {
    7613         TempKillProcess = new ScriptKillProcess[usKillProcessCount - 1];
    7614         CopyTable(TempKillProcess, pKillProcess, usKillProcessCount, usIndex);
    7615         if (bAllowIndexArrangement)
    7616             ReBuildIndexes(TempKillProcess, usKillProcessCount - 1);
    7617         }
    7618     delete [] pKillProcess;
    7619     pKillProcess = TempKillProcess;
    7620     usKillProcessCount --;
     7133    if (_usKillProcessCount > 1)
     7134        {
     7135        TempKillProcess = new ScriptKillProcess[_usKillProcessCount - 1];
     7136        CopyTable(TempKillProcess, _pKillProcess, _usKillProcessCount, p_usIndex);
     7137        if (_bAllowIndexArrangement)
     7138            RebuildIndexes(TempKillProcess, (USHORT)(_usKillProcessCount - 1));
     7139        }
     7140    delete [] _pKillProcess;
     7141    _pKillProcess = TempKillProcess;
     7142    _usKillProcessCount --;
    76217143    return 0;
    76227144    }
    76237145
    76247146
    7625 
    7626 /***************************************************************************
    7627  *@@ ScriptPackage::DeleteKillProcessObject
     7147/*
     7148 *@@DeleteKillProcessObject:
    76287149 *  Deletes object which address is *ScriptKillProcessObject.
    76297150 */
    7630 USHORT ScriptPackage::DeleteKillProcessObject(ScriptKillProcess *ScriptKillProcessObject)
     7151USHORT ScriptPackage::DeleteKillProcessObject(
     7152                      ScriptKillProcess *p_pScriptKillProcessObject
     7153                                             )
    76317154    {
    76327155    USHORT Index = 0, usDelete;
    76337156    USHORT rc;
    76347157
    7635     if (!ScriptKillProcessObject)
     7158    if (!p_pScriptKillProcessObject)
    76367159        return 1;
    76377160
     
    76397162    while (TRUE)
    76407163        {
    7641         if (&pKillProcess[Index] == ScriptKillProcessObject)
     7164        if (&_pKillProcess[Index] == p_pScriptKillProcessObject)
    76427165            break;
    76437166        Index ++;
    7644         if (Index >= usKillProcessCount)
     7167        if (Index >= _usKillProcessCount)
    76457168            return 2;
    76467169        }
    76477170
    7648     usDelete = pKillProcess[Index].ReturnIndex();
     7171    usDelete = _pKillProcess[Index].ReturnIndex();
    76497172    rc = DeleteKillProcessObject(usDelete);
    7650 
    7651 
    76527173    return rc;
    76537174    }
    76547175
    76557176
    7656 
    7657 
    7658 /***************************************************************************
    7659  *@@ ScriptPackage:: ReturnKillProcessObjectCount
     7177/*
     7178 *@@ReturnKillProcessObjectCount:
    76607179 *  Returns count number of ScriptKillProcessObjects.
    76617180 */
    76627181USHORT ScriptPackage::ReturnKillProcessObjectCount()
    76637182    {
    7664     return usKillProcessCount;
    7665     }
    7666 
    7667 
    7668 
    7669 
    7670 
    7671 /***************************************************************************
     7183    return _usKillProcessCount;
     7184    }
     7185
     7186
     7187/*
    76727188 *@@ ScriptPackage:: BuildFromText
    7673  *  Builds package accordingly to script text. If any errors is found in script
    7674  *  text, error informations are returned in table where to *pScriptError
    7675  *  points. Pointer to after end of tag is returned so multiple searches can be
    7676  *  done.
    7677  */
    7678 PSZ ScriptPackage::BuildFromText(PSZ pszScriptText,
    7679                                  SCRIPTERROR **ppScriptError,
    7680                                  USHORT *pusErrorTableSize,
    7681                                  ULONG ulLineNumber)
    7682     {
    7683     SCRIPTERROR Error;
     7189 *  Builds package accordingly to script text.
     7190 */
     7191PSZ ScriptPackage::BuildFromText(PSZ p_pszScriptText,
     7192                                 ULONG p_ulLineNumber)
     7193    {
     7194    Message msg;
    76847195    PSZ pszEnd = NULL;
    76857196    ULONG ulRc = 0;
     
    76877198    ULONG ulOffsetBeginBlock = 0;
    76887199    ULONG ulSearchOffset = 0;
    7689     PSZ pszText = pszScriptText;
     7200    PSZ pszText = p_pszScriptText;
    76907201    PSZ pszBlock = NULL;
    76917202    PSZ pszAttrs = NULL;
     
    77067217
    77077218
    7708     // Check that pointers are not NULL.
    7709     if (!pszScriptText)
    7710         {
    7711         /*if (pScriptError)
    7712             {
    7713             *pScriptError = new SCRIPTERROR;
    7714             *pScriptError->usErrorCode = ERR_PARSE_NULLPOINTER;
    7715             *pScriptError->ulLineNumber = ulLineNumber;
    7716             *pScriptError->pszStart = NULL;
    7717             *pScriptError->ulLength = 0;
    7718             }*/
    7719         return NULL;
    7720         }
    7721 
    7722 
    77237219    ulRc = strhGetBlock(pszText, &ulSearchOffset, SZ_TAG_PACKAGE, &pszBlock,
    77247220                        &pszAttrs, &ulOffsetBeginTag, &ulOffsetBeginBlock);
     
    77297225    if (ulRc != 0)
    77307226        {
    7731         Error.usErrorCode = ERR_PARSE_PCK_NOTFOUND;
    7732         Error.ulLineNumber = ulLineNumber;
    7733         Error.pszStart = strhdup(pszScriptText);
    7734         Error.ulLength = 0;
    7735         if (ppScriptError)
    7736             *pusErrorTableSize =
    7737                 AddErrorToTable(Error, ppScriptError, *pusErrorTableSize);
     7227        msg.SetType(MSG_TYPE_INFO);
     7228        msg.SetMessageValue(MSG_TAG_PCK_NOTFOUND);
     7229        msg.SetLineNumber(p_ulLineNumber);
     7230        _messageLogger.LogMessage(msg);
    77387231        return NULL;
    77397232        }
     
    77437236
    77447237    pszTemp = pszAttrs;
    7745     pszTemp = Index.BuildFromText(pszTemp, ppScriptError, pusErrorTableSize, 0);
    7746     pszTemp = pszAttrs;
    7747     pszTemp = PckID.BuildFromText(pszTemp, ppScriptError, pusErrorTableSize, 0);
    7748     pszTemp = pszAttrs;
    7749     pszTemp = Title.BuildFromText(pszTemp, ppScriptError, pusErrorTableSize, 0);
    7750     pszTemp = pszAttrs;
    7751     pszTemp = Target.BuildFromText(pszTemp, ppScriptError, pusErrorTableSize, 0);
    7752     pszTemp = pszAttrs;
    7753     pszTemp = KeyWords.BuildFromText(pszTemp, ppScriptError, pusErrorTableSize, 0);
     7238    _Index.BuildFromText(pszTemp, 0);
     7239    _PckID.BuildFromText(pszTemp, 0);
     7240    _Title.BuildFromText(pszTemp, 0);
     7241    _Target.BuildFromText(pszTemp, 0);
     7242    _KeyWords.BuildFromText(pszTemp, 0);
    77547243
    77557244
     
    77597248        {
    77607249        // Try to build object from text.
    7761         pszTemp = TmpRequires.BuildFromText(pszTemp, ppScriptError,
    7762                                             pusErrorTableSize, 0);
     7250        pszTemp = TmpRequires.BuildFromText(pszTemp, 0);
    77637251        // If it succeded, create new object and copy temp object to
    77647252        // created object.
     
    77687256            TmpRequires.SetIndex(pRequires->ReturnIndex());
    77697257            *pRequires = TmpRequires;
     7258            pRequires->_messageLogger.SetParentLogger(_messageLogger);
     7259            TmpRequires._messageLogger.DeleteLogs();
    77707260            }
    77717261
     
    77777267    do
    77787268        {
    7779         pszTemp = TmpExecute.BuildFromText(pszTemp, ppScriptError,
    7780                                            pusErrorTableSize, 0);
     7269        pszTemp = TmpExecute.BuildFromText(pszTemp, 0);
    77817270        if (pszTemp)
    77827271            {
     
    77847273            TmpExecute.SetIndex(pExecute->ReturnIndex());
    77857274            *pExecute = TmpExecute;
     7275            pExecute->_messageLogger.SetParentLogger(_messageLogger);
     7276            TmpExecute._messageLogger.DeleteLogs();
    77867277            }
    77877278
     
    77937284    do
    77947285        {
    7795         pszTemp = TmpClearProfile.BuildFromText(pszTemp, ppScriptError,
    7796                                                pusErrorTableSize, 0);
     7286        pszTemp = TmpClearProfile.BuildFromText(pszTemp, 0);
    77977287        if (pszTemp)
    77987288            {
     
    78007290            TmpClearProfile.SetIndex(pClearProfile->ReturnIndex());
    78017291            *pClearProfile = TmpClearProfile;
     7292            pClearProfile->_messageLogger.SetParentLogger(_messageLogger);
     7293            TmpClearProfile._messageLogger.DeleteLogs();
    78027294            }
    78037295
     
    78097301    do
    78107302        {
    7811         pszTemp = TmpWriteProfile.BuildFromText(pszTemp, ppScriptError,
    7812                                                pusErrorTableSize, 0);
     7303        pszTemp = TmpWriteProfile.BuildFromText(pszTemp, 0);
    78137304        if (pszTemp)
    78147305            {
     
    78167307            TmpWriteProfile.SetIndex(pWriteProfile->ReturnIndex());
    78177308            *pWriteProfile = TmpWriteProfile;
     7309            pWriteProfile->_messageLogger.SetParentLogger(_messageLogger);
     7310            TmpWriteProfile._messageLogger.DeleteLogs();
    78187311            }
    78197312
     
    78257318    do
    78267319        {
    7827         pszTemp = TmpConfigSys.BuildFromText(pszTemp, ppScriptError,
    7828                                              pusErrorTableSize, 0);
     7320        pszTemp = TmpConfigSys.BuildFromText(pszTemp, 0);
    78297321        if (pszTemp)
    78307322            {
     
    78327324            TmpConfigSys.SetIndex(pConfigSys->ReturnIndex());
    78337325            *pConfigSys = TmpConfigSys;
     7326            pConfigSys->_messageLogger.SetParentLogger(_messageLogger);
     7327            TmpConfigSys._messageLogger.DeleteLogs();
    78347328            }
    78357329
     
    78417335    do
    78427336        {
    7843         pszTemp = TmpKillProcess.BuildFromText(pszTemp, ppScriptError,
    7844                                              pusErrorTableSize, 0);
     7337        pszTemp = TmpKillProcess.BuildFromText(pszTemp, 0);
    78457338        if (pszTemp)
    78467339            {
     
    78487341            TmpKillProcess.SetIndex(pKillProcess->ReturnIndex());
    78497342            *pKillProcess = TmpKillProcess;
     7343            pKillProcess->_messageLogger.SetParentLogger(_messageLogger);
     7344            TmpKillProcess._messageLogger.DeleteLogs();
    78507345            }
    78517346
     
    78567351    do
    78577352        {
    7858         pszTemp = TmpCreateObject.BuildFromText(pszTemp, ppScriptError,
    7859                                                 pusErrorTableSize, 0);
     7353        pszTemp = TmpCreateObject.BuildFromText(pszTemp, 0);
    78607354        if (pszTemp)
    78617355            {
     
    78637357            TmpCreateObject.SetIndex(pCreateObject->ReturnIndex());
    78647358            *pCreateObject = TmpCreateObject;
     7359            pCreateObject->_messageLogger.SetParentLogger(_messageLogger);
     7360            TmpCreateObject._messageLogger.DeleteLogs();
    78657361            }
    78667362
     
    78717367    do
    78727368        {
    7873         pszTemp = TmpRegClass.BuildFromText(pszTemp, ppScriptError,
    7874                                             pusErrorTableSize, 0);
     7369        pszTemp = TmpRegClass.BuildFromText(pszTemp, 0);
    78757370        if (pszTemp)
    78767371            {
     
    78787373            TmpRegClass.SetIndex(pRegClass->ReturnIndex());
    78797374            *pRegClass = TmpRegClass;
     7375            pRegClass->_messageLogger.SetParentLogger(_messageLogger);
     7376            TmpRegClass._messageLogger.DeleteLogs();
    78807377            }
    78817378
     
    78867383    do
    78877384        {
    7888         pszTemp = TmpRepClass.BuildFromText(pszTemp, ppScriptError,
    7889                                             pusErrorTableSize, 0);
     7385        pszTemp = TmpRepClass.BuildFromText(pszTemp, 0);
    78907386        if (pszTemp)
    78917387            {
     
    78937389            TmpRepClass.SetIndex(pRepClass->ReturnIndex());
    78947390            *pRepClass = TmpRepClass;
     7391            pRepClass->_messageLogger.SetParentLogger(_messageLogger);
     7392            TmpRepClass._messageLogger.DeleteLogs();
    78957393            }
    78967394
    78977395        } while (pszTemp != NULL);
     7396
     7397
     7398    BSString message = _messageLogger.ReturnComposedMessageString();
    78987399
    78997400
     
    80997600 *  Constructor for ScriptGroup class.
    81007601 */
    8101 ScriptGroup::ScriptGroup(const ScriptGroup &Group)
     7602ScriptGroup::ScriptGroup(ScriptGroup &Group)
    81027603    {
    81037604    (*this) = Group;
     
    81087609 *@@ ScriptGroup::~ScriptGroup
    81097610 *  Destructor for ScriptGroup class.
     7611 *
     7612 *@@ changed v0.9.5 (2000-08-22) [tahola]: clearning of the fields are moved
     7613 *                                         to ClearAll() function.
    81107614 */
    81117615ScriptGroup::~ScriptGroup()
     7616    {
     7617    ClearAll();
     7618    }
     7619
     7620
     7621/*
     7622 *@@ ClearAll
     7623 *  Clears all fields.
     7624 *
     7625 *@@added v.0.9.5 (2000-08-22) [tahola]
     7626 */
     7627USHORT ScriptGroup::ClearAll()
    81127628    {
    81137629    this->usIndex = 1;
     
    81307646
    81317647
    8132 
    81337648/***************************************************************************
    81347649 *@@ ScriptGroup::ScriptGroup &operator=
    81357650 *  Assignment operator for ScriptGroup class.
    81367651 */
    8137 ScriptGroup &ScriptGroup::operator=(const ScriptGroup &Group)
     7652ScriptGroup &ScriptGroup::operator=(ScriptGroup &Group)
    81387653    {
    81397654    USHORT usIndex = 0;
     
    86868201 *  changed.
    86878202 */
    8688 ScriptPackage *ScriptGroup::CreatePackageObject(const ScriptPackage *pPck)
     8203ScriptPackage *ScriptGroup::CreatePackageObject(ScriptPackage *pPck)
    86898204    {
    86908205    ScriptPackage *pTempPck = CreatePackageObject();
     
    88678382        ulRc = strhGetBlock(pszText, &ulSearchOffset, SZ_TAG_GROUP, &pszBlock,
    88688383                            &pszAttrs, &ulOffsetBeginTag, &ulOffsetBeginBlock);
    8869         pszTemp = Title.BuildFromText(pszAttrs, NULL, NULL, 0);
     8384        pszTemp = Title.BuildFromText(pszAttrs, 0);
    88708385        pszTemp = Expanded.BuildFromText(pszAttrs, NULL, NULL, 0);
    88718386        }
     
    88818396            {
    88828397            // Clear TmpGroup before build it from the text.
    8883             TmpGroup.ScriptGroup::~ScriptGroup();
     8398            TmpGroup.ClearAll();
    88848399            pszBlock = TmpGroup.BuildFromText(pszBlock, NULL, NULL, 0);
    88858400            if (pszBlock)
     
    88958410            // Clear TmpPackage before build it from the text by calling
    88968411            // destructor.
    8897             TmpPackage.ScriptPackage::~ScriptPackage();
    8898             pszBlock = TmpPackage.BuildFromText(pszBlock, NULL, NULL, 0);
     8412            TmpPackage.ClearAll();
     8413            pszBlock = TmpPackage.BuildFromText(pszBlock, 0);
    88998414            if (pszBlock)
    89008415                {
     
    89028417                TmpPackage.SetIndex(pPackage->ReturnIndex());
    89038418                *pPackage = TmpPackage;
     8419                TmpPackage._messageLogger.DeleteLogs();
    89048420                }
    89058421            }
     
    1055810074    {
    1055910075    XSTRING strScript;
    10560     xstrInit(&strScript, 0);
     10076    xstrInit(&strScript, 0);;
    1056110077    PSZ pszTemp = NULL;
    1056210078    CHAR szTag[MAXTAGLENGTH];
  • TabularUnified trunk/src/wicpm/trad_arc_thread.cpp

    r164 r172  
     1/*
     2 *              WicPM - WarpIN Archive Creator for PM
     3 *                  (c) Copyright Teemu Ahola 2000
     4 *
     5 *@@sourcefile:trad_arc_thread.cpp
     6 *  This file contains thread related stuff used during archive creating in
     7 *  traditional mode.
     8 */
     9
     10
     11
    112#define INCL_PM
    213#define INCL_WIN
     
    1324#include "helpers\dosh.h"
    1425#include "helpers\linklist.h"
     26#include <list>
    1527#include "helpers\cnrh.h"
     28#include "helpers\stringh.h"
     29#include "helpers\xstring.h"
     30#include "base\bs_string.h"
    1631
    1732#include "wicpm\script.hpp"
     
    3146
    3247// Globals.
    33 HWND hwndStatusDlg = NULLHANDLE;
    34 
    35 
    36 /****************************************************************************
    37  *@@ WICallback:
    38  *      this is the callback function which is
     48HWND g_hwndStatusDlg = NULLHANDLE;
     49HEV g_hevStatusDlgReady = 0;
     50
     51/*
     52 *@@WICallback:
     53 *      This is the callback function which is
    3954 *      given to the WIArchive class.
    4055 *          in:
     
    4358 *              file header of current file
    4459 */
    45 int WICallback(short mode,         /* in: CBM_* flags defined in wiarchive.h */
    46                short s,            /* percentage of current file */
    47                WIFileHeader* pwifh, /* file header of current file */
    48                void *pvUser)        // added V0.9.9 (2001-04-04) [umoeller]
     60int WICallback(short mode,         // In: CBM_* flags defined in wiarchive.h.
     61               short s,            // Percentage of current file.
     62               WIFileHeader* pwifh,// File header of current file.
     63               PVOID pvData)       // User defined data?
    4964    {
    5065    int rc = CBRC_ABORT;
     
    5368        case CBM_PERCENTAGE:
    5469            {
    55             WinPostMsg(hwndStatusDlg, USER_ARCTM_FILE_PRECENTAGE,
     70            WinPostMsg(g_hwndStatusDlg, USER_ARCTM_FILE_PRECENTAGE,
    5671                       MPFROMSHORT(s), MPFROMP(pwifh->name));
     72            // Wait main thread to set the semaphore.
     73            DosWaitEventSem(g_hevStatusDlgReady, SEM_INDEFINITE_WAIT);
    5774            break;
    5875            }
    5976        case CBM_UPDATING:
    6077            {
    61             WinPostMsg(hwndStatusDlg, USER_ARCTM_FILE_UPDATING,
     78            WinPostMsg(g_hwndStatusDlg, USER_ARCTM_FILE_UPDATING,
    6279                       MPFROMSHORT(s), MPFROMP(pwifh->name));
     80            // Wait main thread to set the semaphore.
     81            DosWaitEventSem(g_hevStatusDlgReady, SEM_INDEFINITE_WAIT);
    6382            break;
    6483            }
     
    6988
    7089
    71 
     90/*
     91 *@@thTradArcThread:
     92 *  This function is used as a parameter in _beginthread function in gui_wicpm.cpp
     93 *  file. This function does the actuall archive creating with assist of WIArchive
     94 *  object being based of ScriptWarpIN object and list of packages. ScriptWarpIN
     95 *  contains the script of the packages and pages. List of packages contains mainly
     96 *  information about the files to be added. Also file name for the archive is
     97 *  included in pThreadArg parameter. This function posts results while archive
     98 *  creating to status dialog window and syncronization between this thread and
     99 *  the status window is organized by using event semaphore. Now message queue
     100 *  will not overflow.
     101 */
    72102VOID _Optlink thTradArcThread (PVOID pThreadArg)
    73103    {
     
    76106    TradArcThreadInfo* pThreadInfo = (TradArcThreadInfo*)pThreadArg;
    77107
    78     hwndStatusDlg = pThreadInfo->hwndStatusDlg;
     108    g_hwndStatusDlg = pThreadInfo->hwndStatusDlg;
     109    g_hevStatusDlgReady = pThreadInfo->hevStatusDlgReady;
    79110
    80111    pThreadInfo->bThreadBusy = TRUE;
     
    121152        // Post message to the status dialog so it can show some information about
    122153        // package to being set.
    123         //WinPostMsg(pThreadInfo->hwndStatusDlg, USER_ARCTM_SET_PCK,
    124         //    MPFROMP(pDBPackageThis), NULL);
     154        WinPostMsg(pThreadInfo->hwndStatusDlg, USER_ARCTM_SET_PCK,
     155            MPFROMP(pDBPackageThis), NULL);
    125156        // Wait until the status dialog is ready.
    126         //DosWaitEventSem(pThreadInfo->hevStatusDlgReady, SEM_INDEFINITE_WAIT);
     157        DosWaitEventSem(pThreadInfo->hevStatusDlgReady, SEM_INDEFINITE_WAIT);
    127158
    128159        Arc.setPackage((LONG)pDBPackageThis->usPckIndexAttr, szPackageName);
    129160
    130         // For future compatibility.
     161        // For future compatibility. We transfer old style C based list system to
     162        // STL list template which is more handy. At some point I will change all
     163        // lists to STL list template. That's why there is this converting system
     164        // now.
    131165        list<DBFile*> listFiles;
    132166        DBFile *pDBFile = NULL;
     
    161195    PSZ pszScript = pThreadInfo->pWarpIN->MakeScriptText();
    162196
    163     // Show information about the script.
     197    // Show information about the script. I don't think that there is a need for
     198    // waiting of event semaphore because at this point there is not many messages
     199    // sended by this thread in the main thread message queue because all message
     200    // posting in this thread before this posting was organized with semaphore.
    164201    WinPostMsg(pThreadInfo->hwndStatusDlg, USER_ARCTM_SET_SCRIPT,
    165202               MPFROMLONG(strlen(pszScript)), 0);
     
    174211    //DosWaitEventSem(pThreadInfo->hevStatusDlgReady, SEM_INDEFINITE_WAIT);
    175212
     213    // Now the real file processing starts. We will get a lot of callbacks to
     214    // WICallback function from WIArchive object.
    176215    Arc.close();
    177216
  • TabularUnified trunk/src/wicpm/wicpm.def

    r170 r172  
    66NAME   WICPM WINDOWAPI
    77
    8 Description '@#OS/2 Netlabs:0.9.12#@ WarpIN PM archive builder'
     8Description '@#OS/2 Netlabs:0.9.11#@ WarpIN PM archive builder'
    99PROTMODE
    10 STACKSIZE   65536
     10STACKSIZE  40480
    1111
  • TabularUnified trunk/src/wicpm/wicpm.dlg

    r118 r172  
    22   #include <os2.h>
    33#endif
    4 DLGINCLUDE 1 "E:\PROJECTS\Netlabs\WarpIN\include\wicpm\wicpmres.h"
     4DLGINCLUDE 1 "E:\PROJECTS\Netlabs\warpin\include\wicpm\wicpmres.h"
    55
    66DLGTEMPLATE IDD_NB_BROWSER_DIALOG LOADONCALL MOVEABLE DISCARDABLE
     
    7979END
    8080
    81 DLGTEMPLATE IDD_NB_REQUIRES_DIALOG LOADONCALL MOVEABLE DISCARDABLE
    82 BEGIN
    83     DIALOG  "Requires", IDD_NB_REQUIRES_DIALOG, 12, 6, 249, 99, NOT
    84             FS_DLGBORDER | FS_BORDER | WS_VISIBLE | NOT WS_SAVEBITS
    85     BEGIN
    86         RTEXT           "Vendor:", -1, 2, 87, 58, 8
    87                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    88         RTEXT           "Application:", -1, 2, 73, 58, 8
    89                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    90         RTEXT           "Package ID:", -1, 2, 59, 58, 8
    91                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    92         RTEXT           "Version:", -1, 3, 45, 57, 8
    93                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    94         ENTRYFIELD      "", IDD_NB_REQUIRES_VENDOR, 64, 87, 113, 8,
    95                         ES_MARGIN
    96         ENTRYFIELD      "", IDD_NB_REQUIRES_APPLICATION, 64, 73, 113, 8,
    97                         ES_MARGIN
    98         ENTRYFIELD      "", IDD_NB_REQUIRES_PACKAGE, 64, 59, 113, 8,
    99                         ES_MARGIN
    100         ENTRYFIELD      "", IDD_NB_REQUIRES_VERSIONMAJOR, 92, 45, 32, 8,
    101                         ES_MARGIN
    102         LISTBOX         IDD_NB_REQUIRES_LIST, 184, 3, 61, 94, LS_NOADJUSTPOS |
    103                         LS_HORZSCROLL
    104         PUSHBUTTON      "~Add", IDD_NB_REQUIRES_ADD, 6, 4, 40, 14
    105         PUSHBUTTON      "~Remove", IDD_NB_REQUIRES_REMOVE, 49, 4, 40, 14,
    106                         WS_DISABLED
    107         RTEXT           "Major:", -1, 63, 45, 26, 8
    108                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    109         RTEXT           "Minor:", -1, 52, 31, 37, 8
    110                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    111         ENTRYFIELD      "", IDD_NB_REQUIRES_VERSIONMINOR, 92, 31, 32, 8,
    112                         ES_MARGIN
    113     END
    114 END
    115 
    11681DLGTEMPLATE IDD_ASNB_PAGE_DIALOG LOADONCALL MOVEABLE DISCARDABLE
    11782BEGIN
     
    12186        CONTAINER       IDD_ASNB_PAGE_CONTAINER, 2, 22, 245, 75,
    12287                        CCS_SINGLESEL | CCS_READONLY | WS_GROUP
    123         PUSHBUTTON      "~Add", IDD_ASNB_PAGE_ADD, 6, 4, 40, 14
     88        PUSHBUTTON      "~Add
     89", IDD_ASNB_PAGE_ADD, 6, 4, 40, 14
    12490        PUSHBUTTON      "~Remove", IDD_ASNB_PAGE_REMOVE, 49, 4, 41, 14
    12591    END
     
    250216        NOTEBOOK        IDD_ADDPCK_NOTEBOOK, 0, 19, 318, 145,
    251217                        BKS_BACKPAGESBR | BKS_TABTEXTCENTER | WS_GROUP | 0x800
    252     END
    253 END
    254 
    255 DLGTEMPLATE IDD_NB_GENERAL_DIALOG LOADONCALL MOVEABLE DISCARDABLE
    256 BEGIN
    257     DIALOG  "General", IDD_NB_GENERAL_DIALOG, 69, 30, 249, 99, NOT
    258             FS_DLGBORDER | FS_BORDER | WS_VISIBLE | NOT WS_SAVEBITS
    259     BEGIN
    260         RTEXT           "Package ID:", -1, 2, 73, 77, 8
    261                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    262         RTEXT           "Author:", -1, 2, 60, 77, 8
    263                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    264         RTEXT           "Application name:", -1, 2, 47, 77, 8
    265                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    266         RTEXT           "Version number:", -1, 2, 34, 77, 8
    267                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    268         RTEXT           "Target path:", -1, 2, 21, 77, 8
    269                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    270         RTEXT           "Title:", -1, 2, 8, 77, 8
    271                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    272         ENTRYFIELD      "", IDD_NB_GENERAL_PCKNAME, 82, 73, 161, 8,
    273                         ES_MARGIN
    274         ENTRYFIELD      "", IDD_NB_GENERAL_AUTHORNAME, 82, 60, 161, 8,
    275                         ES_MARGIN
    276         ENTRYFIELD      "", IDD_NB_GENERAL_APPNAME, 82, 47, 161, 8,
    277                         ES_MARGIN
    278         ENTRYFIELD      "", IDD_NB_GENERAL_VERSIONMAJOR, 108, 34, 15, 8,
    279                         ES_MARGIN
    280         ENTRYFIELD      "", IDD_NB_GENERAL_VERSIONMINOR, 156, 34, 15, 8,
    281                         ES_MARGIN
    282         ENTRYFIELD      "", IDD_NB_GENERAL_TARGETPATH, 82, 21, 161, 8,
    283                         ES_MARGIN
    284         ENTRYFIELD      "", IDD_NB_GENERAL_TITLE, 82, 8, 161, 8, ES_MARGIN
    285         RTEXT           "Major:", -1, 80, 34, 25, 8
    286                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    287         RTEXT           "Minor:", -1, 126, 34, 27, 8
    288                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    289         RTEXT           "Index:", -1, 6, 86, 73, 8
    290                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    291         ENTRYFIELD      "", IDD_NB_GENERAL_INDEX, 82, 86, 32, 8, ES_MARGIN |
    292                         ES_READONLY
    293         RTEXT           "Revision:", -1, 175, 34, 40, 8
    294                         PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
    295         ENTRYFIELD      "", IDD_NB_GENERAL_VERSIONREVISION, 218, 34, 15, 8,
    296                         ES_MARGIN
    297218    END
    298219END
     
    583504                        "6-2000 Julian R Seward.", -1, 2, 39, 241, 8
    584505                        PRESPARAMS PP_FONTNAMESIZE, "8.Helv"
    585         LTEXT           "WicPM front end (C) 1999-00 Teemu Ahola.", -1, 2,
    586                         30, 242, 8
     506        LTEXT           "WicPM front and back ends (C) 1999-00 Teemu Ahola.",
     507                        -1, 2, 30, 242, 8
    587508                        PRESPARAMS PP_FONTNAMESIZE, "8.Helv"
    588509        ICON            IDM_MAIN, -1, 13, 66, 21, 16, WS_GROUP
     
    786707    END
    787708END
     709
     710DLGTEMPLATE IDD_NB_GENERAL_DIALOG LOADONCALL MOVEABLE DISCARDABLE
     711BEGIN
     712    DIALOG  "General", IDD_NB_GENERAL_DIALOG, 69, 30, 249, 99, NOT
     713            FS_DLGBORDER | FS_BORDER | WS_VISIBLE | NOT WS_SAVEBITS
     714    BEGIN
     715        RTEXT           "Package ID:", -1, 2, 73, 77, 8
     716                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     717        RTEXT           "Author:", -1, 2, 60, 77, 8
     718                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     719        RTEXT           "Application name:", -1, 2, 47, 77, 8
     720                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     721        RTEXT           "Version number:", -1, 2, 34, 77, 8
     722                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     723        RTEXT           "Target path:", -1, 2, 21, 77, 8
     724                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     725        RTEXT           "Title:", -1, 2, 8, 77, 8
     726                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     727        ENTRYFIELD      "", IDD_NB_GENERAL_PCKNAME, 82, 73, 161, 8,
     728                        ES_MARGIN
     729        ENTRYFIELD      "", IDD_NB_GENERAL_AUTHORNAME, 82, 60, 161, 8,
     730                        ES_MARGIN
     731        ENTRYFIELD      "", IDD_NB_GENERAL_APPNAME, 82, 47, 161, 8,
     732                        ES_MARGIN
     733        ENTRYFIELD      "", IDD_NB_GENERAL_VERSIONMAJOR, 108, 34, 15, 8,
     734                        ES_MARGIN
     735        ENTRYFIELD      "", IDD_NB_GENERAL_VERSIONMINOR, 156, 34, 15, 8,
     736                        ES_MARGIN
     737        ENTRYFIELD      "", IDD_NB_GENERAL_TITLE, 82, 8, 161, 8, ES_MARGIN
     738        RTEXT           "Major:", -1, 80, 34, 25, 8
     739                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     740        RTEXT           "Minor:", -1, 126, 34, 27, 8
     741                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     742        RTEXT           "Index:", -1, 6, 86, 73, 8
     743                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     744        ENTRYFIELD      "", IDD_NB_GENERAL_INDEX, 82, 86, 32, 8, ES_MARGIN |
     745                        ES_READONLY
     746        RTEXT           "Revision:", -1, 175, 34, 40, 8
     747                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     748        ENTRYFIELD      "", IDD_NB_GENERAL_VERSIONREVISION, 218, 34, 15, 8,
     749                        ES_MARGIN
     750        CONTROL         "", IDD_NB_GENERAL_TARGETPATH, 80, 2, 165, 29,
     751                        WC_COMBOBOX, CBS_DROPDOWN | WS_GROUP | WS_TABSTOP |
     752                        WS_VISIBLE
     753    END
     754END
     755
     756DLGTEMPLATE IDD_NB_REQUIRES_DIALOG LOADONCALL MOVEABLE DISCARDABLE
     757BEGIN
     758    DIALOG  "Requires", IDD_NB_REQUIRES_DIALOG, 12, 6, 249, 99, NOT
     759            FS_DLGBORDER | FS_BORDER | WS_VISIBLE | NOT WS_SAVEBITS
     760    BEGIN
     761        RTEXT           "Vendor:", -1, 2, 87, 58, 8
     762                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     763        RTEXT           "Application:", -1, 2, 73, 58, 8
     764                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     765        RTEXT           "Package ID:", -1, 2, 59, 58, 8
     766                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     767        RTEXT           "Version:", -1, 3, 45, 57, 8
     768                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     769        ENTRYFIELD      "", IDD_NB_REQUIRES_VENDOR, 64, 87, 113, 8,
     770                        ES_MARGIN
     771        ENTRYFIELD      "", IDD_NB_REQUIRES_APPLICATION, 64, 73, 113, 8,
     772                        ES_MARGIN
     773        ENTRYFIELD      "", IDD_NB_REQUIRES_PACKAGE, 64, 59, 113, 8,
     774                        ES_MARGIN
     775        ENTRYFIELD      "", IDD_NB_REQUIRES_VERSIONMAJOR, 92, 45, 12, 8,
     776                        ES_MARGIN
     777        LISTBOX         IDD_NB_REQUIRES_LIST, 184, 3, 61, 94, LS_NOADJUSTPOS |
     778                        LS_HORZSCROLL
     779        PUSHBUTTON      "~Add", IDD_NB_REQUIRES_ADD, 6, 4, 40, 14
     780        PUSHBUTTON      "~Remove", IDD_NB_REQUIRES_REMOVE, 49, 4, 40, 14,
     781                        WS_DISABLED
     782        RTEXT           "Major:", -1, 63, 45, 26, 8
     783                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     784        RTEXT           "Minor:", -1, 108, 45, 26, 8
     785                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     786        ENTRYFIELD      "", IDD_NB_REQUIRES_VERSIONMINOR, 138, 45, 12, 8,
     787                        ES_MARGIN
     788        RTEXT           "Revision *:", -1, 26, 32, 63, 8
     789                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     790        ENTRYFIELD      "", IDD_NB_REQUIRES_VERSIONREVISION, 92, 32, 12, 8,
     791                        ES_MARGIN
     792        AUTOCHECKBOX    "~Use shortcut", IDD_NB_REQUIRES_SHORTCUT, 21, 19,
     793                        69, 10, BS_AUTOSIZE
     794                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     795        LTEXT           "* Optional", -1, 104, 7, 58, 8
     796                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     797        RTEXT           "Index:", -1, 103, 19, 32, 8, WS_DISABLED
     798                        PRESPARAMS PP_FONTNAMESIZE, "10.Helv"
     799        ENTRYFIELD      "", IDD_NB_REQUIRES_SHORTCUT_INDEX, 138, 19, 18, 8,
     800                        ES_MARGIN | WS_DISABLED
     801    END
     802END
  • TabularUnified trunk/src/wicpm/wicpm.rc

    r118 r172  
    2424        MENUITEM    "Open s~cript...",          IDM_MAIN_FILE_OPENSCRIPT
    2525        MENUITEM    "S~ave script as...",       IDM_MAIN_FILE_SAVESCRIPT
    26       /*MENUITEM    SEPARATOR
     26        MENUITEM    SEPARATOR
     27        MENUITEM    "Make EXE...",              IDM_MAIN_FILE_MAKEEXE, ,MIA_DISABLED
     28        /*MENUITEM    SEPARATOR
    2729        MENUITEM    "~Print...",                IDM_MAIN_FILE_PRINT
    2830        MENUITEM    "P~rinter setup...",        IDM_MAIN_FILE_PRINTERSETUP*/
     
    8991END
    9092
     93STRINGTABLE
     94BEGIN
     95    WPMSI_MAINWND_TITLE             "WarpIN Archive Creator"
     96END
     97
    9198
    9299rcinclude "wicpm.dlg"
Note: See TracChangeset for help on using the changeset viewer.