Changeset 172
- Timestamp:
- May 29, 2001, 5:41:22 PM (24 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/include/wicpm/gui_helpers.h ¶
r128 r172 1 2 1 /* 3 2 * gui_helpers.h … … 56 55 USHORT guiSetEntryFieldTextLimit(HWND hwndParent, ULONG ulEFId, SHORT sTextLimit); 57 56 USHORT guiShowFileDialog (HWND, USHORT, PSZ, PAPSZ, PSZ, PSZ *, PAPSZ *, ULONG *); 57 USHORT guiLoadString(HAB, ULONG, PSZ *); 58 58 59 59 -
TabularUnified trunk/include/wicpm/gui_notebook.h ¶
r128 r172 1 2 1 /* 3 2 * gui_notebook.h -
TabularUnified trunk/include/wicpm/gui_objwnd.h ¶
r128 r172 1 1 2 /*3 * gui_objwnd.h4 *5 * Copyright (C) 1999-2000 Teemu Ahola.6 *7 */8 2 9 3 #ifndef _GUI_OBJWND_H_ -
TabularUnified trunk/include/wicpm/gui_trad_cntr.h ¶
r128 r172 1 2 1 /* 3 2 * gui_trad_cntr.h -
TabularUnified trunk/include/wicpm/gui_trad_nb_dlgproc.h ¶
r128 r172 1 2 1 /* 3 2 * gui_trad_nb_dlgproc.h … … 43 42 #define TEXT_SETUPSTRING_EXENAME "EXENAME=" 44 43 #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 45 52 46 53 … … 59 66 HWND hwndObjWnd; 60 67 } SCRIPTDLGINFO, *PSCRIPTDLGINFO; 68 69 typedef struct 70 { 71 PFNWP OldProc; 72 } OLDPROC; 61 73 62 74 … … 95 107 MRESULT EXPENTRY fnTradCntrDlgProc(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2); 96 108 MRESULT EXPENTRY fnTradCnfgDlgProc(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2); 109 MRESULT EXPENTRY fnCnfgLbox(HWND hwndWnd, ULONG msg, MPARAM mp1, MPARAM mp2); 97 110 98 111 -
TabularUnified trunk/include/wicpm/gui_wicpm.h ¶
r128 r172 1 2 1 /* 3 2 * gui_wicpm.h … … 68 67 * General window info structure for storing windows information 69 68 */ 70 typedefstruct _WICPMINFO69 struct _WICPMINFO 71 70 { 72 71 HAB hab; // Handle to an anchor block. … … 95 94 strcpy(szWicPMPath, "e:\\testi"); 96 95 } 97 } WICPMINFO, *PWICPMINFO; 96 }; 97 typedef _WICPMINFO WICPMINFO, *PWICPMINFO; 98 98 99 99 struct StatusDlgInfo -
TabularUnified trunk/include/wicpm/script.hpp ¶
r125 r172 3 3 * (c) Copyright Teemu Ahola 2000 4 4 * 5 * WarpIN Script Class 0.9. 35 * WarpIN Script Class 0.9.5 6 6 * 7 * 7 *@@script.hpp 8 8 * Header file for script.cpp. 9 9 * This file contains class headers for script classes. … … 17 17 #define _SCRIPT_HPP 18 18 19 #define MAXCHILDREN 2020 21 #define MAXAPPNAMELENGTH 6422 #define MAXVENDORNAMELENGTH 6423 #define MAXPCKNAMELENGTH 3224 #define MAXINETADDRESSLENGTH 12825 #define MAXVERSIONLENGTH 1026 #define MAXTITLELENGTH 12827 #define MAXSTATEMENTLENGTH 12828 #define MAXSEARCHSTRINGLENGTH 12829 #define MAXCLASSNAMELENGTH 25630 #define MAXCLASSTITLELENGTH 25631 #define MAXCLASSCONFIGLENGTH 25632 #define MAXSCRIPTLENGTH 409633 #define MAXSCRIPTLINELENGTH 25634 #define MAXSCRIPTSTRINGLENGTH 25635 #define MAXPROFILEAPPLICATIONLENGTH 25636 #define MAXPROFILEKEYLENGTH 25637 #define MAXPAGETEXTLENGTH 102438 #define MAXPAGETITLELENGTH 25639 #define MAXNEXTBTNTEXTLENGTH 25640 #define MAXMESSAGELENGTH 25641 #define MAXOPERATIGSYSTEMLENGTH 6442 #define MAXTARGETLENGTH 25643 #define MAXTAGLENGTH 25644 #define MAXATTRIBUTELENGTH 25619 #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 45 45 46 46 // Keyword attributes. 47 #define KEYWORD_BASE 148 #define KEYWORD_FIXED 249 #define KEYWORD_SELECT 450 #define KEYWORD_NODESELECT 847 #define KEYWORD_BASE 1 48 #define KEYWORD_FIXED 2 49 #define KEYWORD_SELECT 4 50 #define KEYWORD_NODESELECT 8 51 51 52 52 // ConfigSys modifiers. 53 #define MODIFIER_NONE 054 #define MODIFIER_UNIQUE 155 #define MODIFIER_ADDRIGHT 256 #define MODIFIER_ADDLEFT 457 #define MODIFIER_ADDTOP 858 #define MODIFIER_ADDAFTER 1659 #define MODIFIER_ADDBEFORE 3260 #define MODIFIER_REMOVELINE 6461 #define MODIFIER_REMOVEPART 12853 #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 62 62 63 63 // Execute context flags 64 #define FLAG_NOCONTEXT 065 #define FLAG_CONFIGSYS 166 #define FLAG_REGISTERCLASS 267 #define FLAG_CREATEOBJECT 364 #define FLAG_NOCONTEXT 0 65 #define FLAG_CONFIGSYS 1 66 #define FLAG_REGISTERCLASS 2 67 #define FLAG_CREATEOBJECT 3 68 68 69 69 // ReadMe formats. 70 #define README_FORMAT_NONE 071 #define README_FORMAT_PLAIN 172 #define README_FORMAT_FLOW 273 #define README_FORMAT_HTML 370 #define README_FORMAT_NONE 0 71 #define README_FORMAT_PLAIN 1 72 #define README_FORMAT_FLOW 2 73 #define README_FORMAT_HTML 3 74 74 75 75 // Page types. 76 #define PAGE_TYPES_TEXT 077 #define PAGE_TYPES_README 178 #define PAGE_TYPES_CONTAINER 279 #define PAGE_TYPES_CONFIGURE 376 #define PAGE_TYPES_TEXT 0 77 #define PAGE_TYPES_README 1 78 #define PAGE_TYPES_CONTAINER 2 79 #define PAGE_TYPES_CONFIGURE 3 80 80 81 81 // Operating system 82 #define OS_OS2_2X 083 #define OS_OS2_3X 184 #define OS_OS2_4X 282 #define OS_OS2_2X 0 83 #define OS_OS2_3X 1 84 #define OS_OS2_4X 2 85 85 86 86 87 87 // Error codes 88 #define NO_ERROR 0 88 #define NO_ERROR 0 89 #define STRING_TOO_LONG 1 90 #define MEM_ALLOC_ERROR 2 89 91 90 92 // Configsys error codes 91 #define ERR_CONFIGSYS_ADDRIGHT_SETTED 192 #define ERR_CONFIGSYS_ADDLEFT_SETTED 293 #define ERR_CONFIGSYS_UNIQUE_SETTED 494 #define ERR_CONFIGSYS_ADDTOP_SETTED 895 #define ERR_CONFIGSYS_ADDAFTER_SETTED 1696 #define ERR_CONFIGSYS_ADDBEFORE_SETTED 3297 #define ERR_CONFIGSYS_REMOVELINE_SETTED 6498 #define ERR_CONFIGSYS_REMOVEPART_SETTED 12893 #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 99 101 100 102 // 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 130 211 131 212 … … 216 297 /* 217 298 *@@INDEX structure 218 * This structure is for indexes in script classes. Because script class219 * needs a way to locate different objects this structure is designed for220 * it.221 299 */ 222 300 struct INDEX … … 233 311 234 312 /* 235 *@@ ScriptIndex class 313 *@@Message 314 * This class is the message class used in MessageLogger. 315 */ 316 class 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 */ 347 class 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 */ 375 class 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 236 392 * This class is used in ScriptPackage and ScriptPage classes and it contains datas used 237 393 * while creating INDEX attribute. 238 394 */ 239 class ScriptIndex 240 { 241 USHORT usIndex; 242 243 USHORT usIndexAttribute; 244 245 public: 246 ScriptIndex(USHORT usIndex = 1); 395 class ScriptIndex : public WarpINScriptBase 396 { 397 USHORT usIndexAttribute; 398 399 public: 400 ScriptIndex(USHORT = 1); 247 401 ~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); 252 407 253 408 USHORT ReturnIndexAttribute(); 254 409 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 268 422 * This class is used in ScriptPackage class and it contains datas used 269 423 * while creating package ID attribute. 270 424 */ 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; 425 class 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; 283 433 284 434 public: 285 435 // Constructor for the class 286 ScriptPackageID(USHORT usIndex= 1);436 ScriptPackageID(USHORT = 1); 287 437 // Destructor for the class 288 438 ~ScriptPackageID(); 289 439 290 void SetIndex(USHORT usIndex);291 292 440 // 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); 300 448 301 449 const PSZ ReturnVendor(); … … 307 455 PACKAGEIDDATA ReturnPackageID(); 308 456 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); 314 459 }; 315 460 … … 321 466 * while creating title attribute. 322 467 */ 323 class ScriptTitle 324 { 325 USHORT usIndex; 326 327 CHAR szTitle[MAXTITLELENGTH]; 328 329 public: 330 ScriptTitle(USHORT usIndex = 1); 468 class ScriptTitle : public WarpINScriptBase 469 { 470 CHAR _szTitle[MAXTITLELENGTH]; 471 472 public: 473 ScriptTitle(USHORT = 1); 331 474 ~ScriptTitle(); 332 475 333 void SetTitle(const PSZ pszTitle); 334 335 void SetIndex(USHORT usIndex); 476 USHORT SetTitle(const PSZ); 336 477 337 478 const PSZ ReturnTitle(); 338 479 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); 345 483 }; 346 484 … … 352 490 * while creating target attribute. 353 491 */ 354 class ScriptTarget 355 { 356 USHORT usIndex; 357 358 CHAR szTarget[CCHMAXPATH]; 359 360 public: 361 ScriptTarget(USHORT usIndex = 1); 492 class ScriptTarget : public WarpINScriptBase 493 { 494 CHAR _szTarget[CCHMAXPATH]; 495 496 public: 497 ScriptTarget(USHORT = 1); 362 498 ~ScriptTarget(); 363 499 364 void SetTarget(const PSZ pszTarget); 365 366 void SetIndex(USHORT usIndex); 500 USHORT SetTarget(const PSZ); 367 501 368 502 const PSZ ReturnTarget(); 369 503 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: 382 513 * This class is used in ScriptPackage class and it contains datas used 383 514 * while creating keyword attribute. 384 515 */ 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); 516 class ScriptKeyWord : public WarpINScriptBase 517 { 518 BOOL _bBase; 519 BOOL _bFixed; 520 BOOL _bSelect; 521 BOOL _bNoDeselect; 522 523 public: 524 ScriptKeyWord(USHORT = 1); 396 525 ~ScriptKeyWord(); 397 526 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); 406 532 407 533 BOOL ReturnBase(); … … 411 537 USHORT ReturnKeyWord(); 412 538 413 USHORT ReturnIndex();414 415 539 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: 425 548 * This class is used in ScriptPackage class and it contains datas used 426 549 * while creating requires attribute. 427 550 */ 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; 551 class 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; 439 560 440 561 public: 441 562 // Constructor for the class 442 ScriptRequires(USHORT usIndex= 1);563 ScriptRequires(USHORT = 1); 443 564 // Destructor for the class 444 565 ~ScriptRequires(); 445 566 446 567 // 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); 457 576 458 577 const PSZ ReturnVendor(); … … 465 584 REQUIRESDATA ReturnRequires(); 466 585 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: 478 594 * This class is used in ScriptPackage class and it contains datas used 479 595 * while creating configsys attribute. 480 596 */ 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); 597 class 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); 498 612 ~ScriptConfigSys(); 499 613 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); 513 625 514 626 const PSZ ReturnStatement(); … … 524 636 CONFIGSYSDATA ReturnConfigSys(); 525 637 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: 540 648 * This class is used in ScriptPackage class and it contains datas used 541 649 * while creating register class attribute. 542 650 */ 543 class ScriptRegisterClass 544 { 545 USHORT usIndex; 546 547 CHAR szClassName[MAXCLASSNAMELENGTH]; 548 CHAR szDLLPath[CCHMAXPATH]; 549 550 public: 551 ScriptRegisterClass(USHORT usIndex = 1); 651 class ScriptRegisterClass : public WarpINScriptBase 652 { 653 CHAR _szClassName[MAXCLASSNAMELENGTH]; 654 CHAR _szDLLPath[CCHMAXPATH]; 655 656 public: 657 ScriptRegisterClass(USHORT = 1); 552 658 ~ScriptRegisterClass(); 553 659 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); 559 663 560 664 const PSZ ReturnClassName(); … … 562 666 REGISTERCLASSDATA ReturnRegisterClass(); 563 667 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: 578 679 * This class is used in ScriptPackage class and it contains datas used 579 680 * while creating replace class attribute. 580 681 */ 581 class ScriptReplaceClass 582 { 583 USHORT usIndex; 584 585 CHAR szClassName[MAXCLASSNAMELENGTH]; 586 CHAR szNewClassName[MAXCLASSNAMELENGTH]; 587 588 public: 589 ScriptReplaceClass(USHORT usIndex = 1); 682 class ScriptReplaceClass : public WarpINScriptBase 683 { 684 CHAR _szClassName[MAXCLASSNAMELENGTH]; 685 CHAR _szNewClassName[MAXCLASSNAMELENGTH]; 686 687 public: 688 ScriptReplaceClass(USHORT = 1); 590 689 ~ScriptReplaceClass(); 591 690 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); 597 694 598 695 const PSZ ReturnClassName(); … … 600 697 REPLACECLASSDATA ReturnReplaceClass(); 601 698 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: 615 709 * This class is used in ScriptPackage class and it contains datas used 616 710 * while creating create object attribute. 617 711 */ 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); 712 class 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); 630 722 ~ScriptCreateObject(); 631 723 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); 640 730 641 731 const PSZ ReturnClassName(); … … 646 736 CREATEOBJECTDATA ReturnCreateObject(); 647 737 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: 662 749 * This class is used in ScriptPackage class and it contains datas used 663 750 * while creating execute attribute. 664 751 */ 665 class ScriptExecute 666 { 667 USHORT usIndex; 668 669 CHAR szExecFileParams[CCHMAXPATH]; 670 USHORT fusContext; 671 672 public: 673 ScriptExecute(USHORT usIndex = 1); 752 class ScriptExecute : public WarpINScriptBase 753 { 754 CHAR _szExecFileParams[CCHMAXPATH]; 755 USHORT _usContext; 756 757 public: 758 ScriptExecute(USHORT = 1); 674 759 ~ScriptExecute(); 675 760 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); 682 765 683 766 const PSZ ReturnExecFileParams(); 684 767 USHORT ReturnContext(); 685 768 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: 701 781 * This class is used in ScriptPackage class and it contains datas used 702 782 * while creating clearprofile attribute. 703 783 */ 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); 784 class ScriptClearProfile : public WarpINScriptBase 785 { 786 CHAR _szProfileString[CCHMAXPATH]; 787 CHAR _szApplication[MAXPROFILEAPPLICATIONLENGTH]; 788 CHAR _szKey[MAXPROFILEKEYLENGTH]; 789 790 public: 791 ScriptClearProfile(USHORT = 1); 714 792 ~ScriptClearProfile(); 715 793 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); 722 798 723 799 const PSZ ReturnProfileString(); … … 726 802 PROFILEDATA ReturnProfile(); 727 803 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); 734 807 735 808 }; … … 743 816 * while creating writeprofile attribute. 744 817 */ 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); 818 class 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); 756 827 ~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; 771 840 PROFILEDATA ReturnProfile(); 772 841 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); 779 845 780 846 }; … … 788 854 * while creating KILLPROCESS attribute. 789 855 */ 790 class ScriptKillProcess 791 { 792 USHORT usIndex; 793 794 CHAR szFileName[CCHMAXPATH]; 795 796 public: 797 ScriptKillProcess(USHORT usIndex = 1); 856 class ScriptKillProcess : public WarpINScriptBase 857 { 858 CHAR _szFileName[CCHMAXPATH]; 859 860 public: 861 ScriptKillProcess(USHORT = 1); 798 862 ~ScriptKillProcess(); 799 863 800 void SetFileName(const PSZ pszFileName); 801 802 void SetIndex(USHORT usIndex); 864 USHORT SetFileName(const PSZ); 803 865 804 866 const PSZ ReturnFileName(); 805 867 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); 812 871 }; 813 872 … … 822 881 * related to package. There are two different index ordering modes... 823 882 */ 824 class ScriptPackage 825 { 826 USHORT usIndex; 827 883 class ScriptPackage : public WarpINScriptBase 884 { 828 885 // Used when removing object from table. If TRUE object indexes are 829 // automatically ordered.886 // automatically reordered. 830 887 // Ex. 0, 1, 2, 3, 4 831 888 // Number 3 is removed -> indexing: 0, 1, 2, 3 832 889 // New object -> indexing: 0, 1, 2, 3, 4 833 890 // => New object is now number 4. 834 // If FALSE object indexes are not ordered.891 // If FALSE object indexes are not reordered. 835 892 // Ex. 0, 1, 2, 3, 4 836 893 // Number 3 is removed -> indexing: 0, 1, 2, 4 837 894 // New object -> indexing: 0, 1, 2, 4, 3 838 895 // => 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); 924 934 ~ScriptPackage(); 925 935 // Copy constructor. Needed when adding, removing or moving objects … … 927 937 ScriptPackage(ScriptPackage &); 928 938 // 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); 932 944 //SetPackageData(PACKAGEDATA package); 933 934 void SetIndex(USHORT usIndex);935 945 936 946 const PSZ ReturnDescription(); 937 947 //PACKAGEDATA ReturnPackageData(); 938 948 939 void SetPackageIndex(USHORT usPckIndex);940 voidSetPackageID(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); 944 954 ScriptIndex *ReturnPackageIndex(); 945 955 USHORT ReturnPackageIndexNumber(); … … 951 961 ScriptKeyWord *ReturnKeyWordObject(); 952 962 953 USHORT ReturnIndex(); 954 955 PSZ MakeScriptText(BOOL bAttribute = TRUE); 963 PSZ MakeScriptText(BOOL = TRUE); 956 964 957 965 // Build package accordingly to pszScriptText. If there is any errors 958 966 // 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); 961 968 962 969 // Functions for handling of requires class … … 964 971 // pointer to the new object. 965 972 ScriptRequires *CreateRequiresObject(); 966 ScriptRequires *CreateRequiresObject(REQUIRESDATA requiresData);973 ScriptRequires *CreateRequiresObject(REQUIRESDATA); 967 974 // Returns address of ScriptRequires object which index is usIndex. 968 ScriptRequires *ReturnRequiresObject(USHORT usIndex);975 ScriptRequires *ReturnRequiresObject(USHORT); 969 976 // Deletes ScriptRequires object which index is usIndex. 970 USHORT DeleteRequiresObject(USHORT usIndex);977 USHORT DeleteRequiresObject(USHORT); 971 978 // Deletes ScriptRequires object which address is 972 979 // *ScriptRequiresClass. 973 USHORT DeleteRequiresObject(ScriptRequires * ScriptRequiresObject);980 USHORT DeleteRequiresObject(ScriptRequires *); 974 981 // Returns how many ScriptRequires objectes belongs to ScriptPackage 975 982 // (this) object. … … 982 989 // pointer to the new object. 983 990 ScriptConfigSys *CreateConfigSysObject(); 984 ScriptConfigSys *CreateConfigSysObject(CONFIGSYSDATA data);991 ScriptConfigSys *CreateConfigSysObject(CONFIGSYSDATA); 985 992 // Returns address of ScriptConfigSys object which index is usIndex. 986 ScriptConfigSys *ReturnConfigSysObject(USHORT usIndex);993 ScriptConfigSys *ReturnConfigSysObject(USHORT); 987 994 // Deletes ScriptConfigSys object which index is usIndex. 988 USHORT DeleteConfigSysObject(USHORT usIndex);995 USHORT DeleteConfigSysObject(USHORT); 989 996 // Deletes ScriptConfigSys object which address is 990 997 // *ScriptConfigSysObject. 991 USHORT DeleteConfigSysObject(ScriptConfigSys * ScriptConfigSysObject);998 USHORT DeleteConfigSysObject(ScriptConfigSys *); 992 999 // Returns index of object which address is *ScriptConfigSysObject. 993 USHORT ReturnIndexOfConfigSysObject(ScriptConfigSys * ScriptConfigSysObject);1000 USHORT ReturnIndexOfConfigSysObject(ScriptConfigSys *); 994 1001 // Returns how many ScriptConfigSys objectes belongs to ScriptPackage 995 1002 // (this) object. … … 1002 1009 // pointer to the new object. 1003 1010 ScriptRegisterClass *CreateRegisterClassObject(); 1004 ScriptRegisterClass *CreateRegisterClassObject(REGISTERCLASSDATA data);1011 ScriptRegisterClass *CreateRegisterClassObject(REGISTERCLASSDATA); 1005 1012 // Returns address of ScriptRegisterClass object which index is 1006 1013 // usIndex. 1007 ScriptRegisterClass *ReturnRegisterClassObject(USHORT usIndex);1014 ScriptRegisterClass *ReturnRegisterClassObject(USHORT); 1008 1015 // Deletes ScriptRegisterClass object which index is usIndex. 1009 USHORT DeleteRegisterClassObject(USHORT usIndex);1016 USHORT DeleteRegisterClassObject(USHORT); 1010 1017 // Deletes ScriptRegisterClass object which address is 1011 1018 // *ScriptRegisterClassObject. 1012 USHORT DeleteRegisterClassObject(ScriptRegisterClass 1013 *ScriptRegisterClassObject); 1019 USHORT DeleteRegisterClassObject(ScriptRegisterClass *); 1014 1020 // Returns how many ScriptRegisterClass objectes belongs to ScriptPackage 1015 1021 // (this) object. … … 1022 1028 // pointer to the new object. 1023 1029 ScriptReplaceClass *CreateReplaceClassObject(); 1024 ScriptReplaceClass *CreateReplaceClassObject(REPLACECLASSDATA data);1030 ScriptReplaceClass *CreateReplaceClassObject(REPLACECLASSDATA); 1025 1031 // Returns address of ScriptReplaceClass object which index is 1026 1032 // usIndex. 1027 ScriptReplaceClass *ReturnReplaceClassObject(USHORT usIndex);1033 ScriptReplaceClass *ReturnReplaceClassObject(USHORT); 1028 1034 // Deletes ScriptReplaceClass object which index is usIndex. 1029 USHORT DeleteReplaceClassObject(USHORT usIndex);1035 USHORT DeleteReplaceClassObject(USHORT); 1030 1036 // Deletes ScriptReplaceClass object which address is 1031 1037 // *ScriptReplaceClassObject. 1032 USHORT DeleteReplaceClassObject(ScriptReplaceClass 1033 *ScriptReplaceClassObject); 1038 USHORT DeleteReplaceClassObject(ScriptReplaceClass *); 1034 1039 // Returns how many ScriptReplaceClass objectes belongs to ScriptPackage 1035 1040 // (this) object. … … 1042 1047 // pointer to the new object. 1043 1048 ScriptCreateObject *CreateCreateObjectObject(); 1044 ScriptCreateObject *CreateCreateObjectObject(CREATEOBJECTDATA data);1049 ScriptCreateObject *CreateCreateObjectObject(CREATEOBJECTDATA); 1045 1050 // Returns address of ScriptCreateObject object which index is 1046 1051 // usIndex. 1047 ScriptCreateObject *ReturnCreateObjectObject(USHORT usIndex);1052 ScriptCreateObject *ReturnCreateObjectObject(USHORT); 1048 1053 // Deletes ScriptCreateObject object which index is usIndex. 1049 USHORT DeleteCreateObjectObject(USHORT usIndex);1054 USHORT DeleteCreateObjectObject(USHORT); 1050 1055 // Deletes ScriptCreateObject object which address is 1051 1056 // *ScriptCreateObjectObject. 1052 USHORT DeleteCreateObjectObject(ScriptCreateObject 1053 *ScriptCreateObjectObject); 1057 USHORT DeleteCreateObjectObject(ScriptCreateObject *); 1054 1058 // Returns how many ScriptCreateObject objectes belongs to ScriptPackage 1055 1059 // (this) object. … … 1062 1066 // pointer to the new object. 1063 1067 ScriptExecute *CreateExecuteObject(); 1064 ScriptExecute *CreateExecuteObject(PSZ pszExecute);1068 ScriptExecute *CreateExecuteObject(PSZ); 1065 1069 // Returns address of ScriptExecute object which index is 1066 1070 // usIndex. 1067 ScriptExecute *ReturnExecuteObject(USHORT usIndex);1071 ScriptExecute *ReturnExecuteObject(USHORT); 1068 1072 // Deletes ScriptExecute object which index is usIndex. 1069 USHORT DeleteExecuteObject(USHORT usIndex);1073 USHORT DeleteExecuteObject(USHORT); 1070 1074 // Deletes ScriptExecute object which address is 1071 1075 // *ScriptExecuteObject. 1072 USHORT DeleteExecuteObject(ScriptExecute 1073 *ScriptExecuteObject); 1076 USHORT DeleteExecuteObject(ScriptExecute *); 1074 1077 // Returns how many ScriptCreateObject objectes belongs to ScriptPackage 1075 1078 // (this) object. … … 1082 1085 // pointer to the new object. 1083 1086 ScriptClearProfile *CreateClearProfileObject(); 1084 ScriptClearProfile *CreateClearProfileObject(PROFILEDATA data);1087 ScriptClearProfile *CreateClearProfileObject(PROFILEDATA); 1085 1088 // Returns address of ScriptClearProfile object which index is 1086 1089 // usIndex. 1087 ScriptClearProfile *ReturnClearProfileObject(USHORT usIndex);1090 ScriptClearProfile *ReturnClearProfileObject(USHORT); 1088 1091 // Deletes ScriptClearProfile object which index is usIndex. 1089 USHORT DeleteClearProfileObject(USHORT usIndex);1092 USHORT DeleteClearProfileObject(USHORT); 1090 1093 // Deletes ScriptClearProfile object which address is 1091 1094 // *ScriptClearProfileObject. 1092 USHORT DeleteClearProfileObject(ScriptClearProfile 1093 *ScriptClearProfileObject); 1095 USHORT DeleteClearProfileObject(ScriptClearProfile *); 1094 1096 // Returns how many ScriptCreateObject objectes belongs to ScriptPackage 1095 1097 // (this) object. 1096 1098 USHORT ReturnClearProfileObjectCount(); 1099 1097 1100 1098 1101 … … 1101 1104 // pointer to the new object. 1102 1105 ScriptWriteProfile *CreateWriteProfileObject(); 1103 ScriptWriteProfile *CreateWriteProfileObject(PROFILEDATA data);1106 ScriptWriteProfile *CreateWriteProfileObject(PROFILEDATA); 1104 1107 // Returns address of ScriptWriteProfile object which index is 1105 1108 // usIndex. 1106 ScriptWriteProfile *ReturnWriteProfileObject(USHORT usIndex);1109 ScriptWriteProfile *ReturnWriteProfileObject(USHORT); 1107 1110 // Deletes ScriptWriteProfile object which index is usIndex. 1108 USHORT DeleteWriteProfileObject(USHORT usIndex);1111 USHORT DeleteWriteProfileObject(USHORT); 1109 1112 // Deletes ScriptWriteProfile object which address is 1110 1113 // *ScriptWriteProfileObject. 1111 USHORT DeleteWriteProfileObject(ScriptWriteProfile 1112 *ScriptWriteProfileObject); 1114 USHORT DeleteWriteProfileObject(ScriptWriteProfile *); 1113 1115 // Returns how many ScriptCreateObject objectes belongs to ScriptPackage 1114 1116 // (this) object. 1115 1117 USHORT ReturnWriteProfileObjectCount(); 1118 1116 1119 1117 1120 … … 1120 1123 // pointer to the new object. 1121 1124 ScriptKillProcess *CreateKillProcessObject(); 1122 ScriptKillProcess *CreateKillProcessObject(const PSZ pszFileName);1125 ScriptKillProcess *CreateKillProcessObject(const PSZ); 1123 1126 // Returns address of ScriptKillProcess object which index is 1124 1127 // usIndex. 1125 ScriptKillProcess *ReturnKillProcessObject(USHORT usIndex);1128 ScriptKillProcess *ReturnKillProcessObject(USHORT); 1126 1129 // Deletes ScriptKillProcess object which index is usIndex. 1127 USHORT DeleteKillProcessObject(USHORT usIndex);1130 USHORT DeleteKillProcessObject(USHORT); 1128 1131 // Deletes ScriptKillProcess object which address is 1129 1132 // *ScriptKillProcessObject. 1130 USHORT DeleteKillProcessObject(ScriptKillProcess 1131 *ScriptKillProcessObject); 1133 USHORT DeleteKillProcessObject(ScriptKillProcess *); 1132 1134 // Returns how many ScriptCreateObject objectes belongs to ScriptPackage 1133 1135 // (this) object. … … 1213 1215 BOOL bAllowIndexArrangement = TRUE); 1214 1216 ~ScriptGroup(); 1215 ScriptGroup(const ScriptGroup &); 1216 ScriptGroup &operator=(const ScriptGroup &); 1217 ScriptGroup(ScriptGroup &); 1218 USHORT ClearAll(); 1219 ScriptGroup &operator=(ScriptGroup &); 1217 1220 1218 1221 void SetVirtual(BOOL bVirtual); … … 1238 1241 // pointer to the new object. 1239 1242 ScriptPackage *CreatePackageObject(); 1240 ScriptPackage *CreatePackageObject( constScriptPackage *pPck);1243 ScriptPackage *CreatePackageObject(ScriptPackage *pPck); 1241 1244 // Returns address of ScriptPackage object which index is 1242 1245 // usIndex. … … 1347 1350 /* 1348 1351 *@@ ScriptHead class 1349 * This class is used in WarpINScript class and it contains datas used1352 * This class is used in WarpINScriptBase class and it contains datas used 1350 1353 * while creating head tag. This class contains all other classes 1351 1354 * related to head attribute including group, title and message. Although … … 1563 1566 /* 1564 1567 *@@ ScriptBody class 1565 * This class is used in WarpINScript class and it contains datas used1568 * This class is used in WarpINScriptBase class and it contains datas used 1566 1569 * while creating body tag. This class contains page class. 1567 1570 */ … … 1620 1623 /* 1621 1624 *@@ ScriptVersion class 1622 * This class is used in WarpINScript class and it contains datas used1625 * This class is used in WarpINScriptBase class and it contains datas used 1623 1626 * while creating version attribute. This class contains no other classes. 1624 1627 */ … … 1658 1661 /* 1659 1662 *@@ ScriptOS class 1660 * This class is used in WarpINScript class and it contains datas used1663 * This class is used in WarpINScriptBase class and it contains datas used 1661 1664 * while creating operating system attribute. This class contains no other 1662 1665 * classes. … … 1697 1700 /* 1698 1701 *@@ ScriptCodePage class 1699 * This class is used in WarpINScript class and it contains datas used1702 * This class is used in WarpINScriptBase class and it contains datas used 1700 1703 * while creating codepage attribute. This class contains no other 1701 1704 * classes. -
TabularUnified trunk/include/wicpm/trad_arc_thread.h ¶
r128 r172 1 2 /*3 * trad_arc_thread.h4 *5 * Copyright (C) 1999-2000 Teemu Ahola.6 *7 */8 1 9 2 -
TabularUnified trunk/src/wicpm/gui_helpers.cpp ¶
r116 r172 324 324 } 325 325 326 327 USHORT 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 13 13 #include <stdlib.h> 14 14 #include "setup.h" 15 #include "helpers\dosh.h" 15 16 16 17 #include "wicpm\gui_notebook.h" … … 172 173 /*ulNBStyle = WinQueryWindowULong (hwndNotebook, QWL_STYLE); 173 174 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 177 183 WinSetWindowULong (hwndNotebook, QWL_STYLE, ulNBStyle); 178 184 WinInvalidateRect (hwndNotebook, NULL, TRUE);*/ 179 180 185 181 186 if (!SizeTabs (hwndNotebook)) -
TabularUnified trunk/src/wicpm/gui_objwnd.cpp ¶
r116 r172 26 26 #include "helpers\dosh.h" 27 27 #include "helpers\stringh.h" 28 #include <list> 29 #include "helpers\stringh.h" 30 #include "helpers\xstring.h" 31 #include "base\bs_string.h" 28 32 29 33 #include "wicpm\script.hpp" -
TabularUnified trunk/src/wicpm/gui_trad_cntr.cpp ¶
r116 r172 29 29 #include "helpers\cnrh.h" 30 30 #include "helpers\linklist.h" 31 #include <list> 32 #include "helpers\stringh.h" 33 #include "helpers\xstring.h" 34 #include "base\bs_string.h" 31 35 32 36 #include "wicpm\script.hpp" -
TabularUnified trunk/src/wicpm/gui_trad_nb_dlgproc.cpp ¶
r155 r172 23 23 #include "helpers\linklist.h" 24 24 #include "helpers\cnrh.h" 25 #include "helpers\stringh.h" 26 #include "helpers\xstring.h" 27 #include "base\bs_string.h" 28 25 29 26 30 #include "wiarchive\wiarchive.h" // WIArchive created by Jens Bckman. … … 77 81 { 78 82 MRESULT mrc = 0; 83 static BOOL bSelectedFromList = FALSE; 79 84 80 85 switch (msg) … … 110 115 sprintf(szNumber, "%d", pPckID->ReturnRevision()); 111 116 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 112 127 break; 113 128 } … … 142 157 case IDD_NB_GENERAL_PCKNAME: 143 158 { 144 WinQueryDlgItemText 145 159 WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_PCKNAME, 160 MAXPCKNAMELENGTH, szString); 146 161 pPckID->SetPackage(szString); 147 162 … … 150 165 case IDD_NB_GENERAL_AUTHORNAME: 151 166 { 152 WinQueryDlgItemText 153 167 WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_AUTHORNAME, 168 MAXVENDORNAMELENGTH, szString); 154 169 pPckID->SetVendor(szString); 155 170 break; … … 157 172 case IDD_NB_GENERAL_APPNAME: 158 173 { 159 WinQueryDlgItemText 160 174 WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_APPNAME, 175 MAXAPPNAMELENGTH, szString); 161 176 pPckID->SetApplication(szString); 162 177 break; … … 164 179 case IDD_NB_GENERAL_VERSIONMAJOR: 165 180 { 166 WinQueryDlgItemText 167 181 WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_VERSIONMAJOR, 182 MAXVERSIONLENGTH, szString); 168 183 pPckID->SetMajor(atoi(szString)); 169 184 break; … … 171 186 case IDD_NB_GENERAL_VERSIONMINOR: 172 187 { 173 WinQueryDlgItemText 174 188 WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_VERSIONMINOR, 189 MAXVERSIONLENGTH, szString); 175 190 pPckID->SetMinor(atoi(szString)); 176 191 break; … … 178 193 case IDD_NB_GENERAL_VERSIONREVISION: 179 194 { 180 WinQueryDlgItemText 181 195 WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_VERSIONREVISION, 196 MAXVERSIONLENGTH, szString); 182 197 pPckID->SetRevision(atoi(szString)); 183 198 break; … … 185 200 case IDD_NB_GENERAL_TITLE: 186 201 { 187 WinQueryDlgItemText 188 202 WinQueryDlgItemText(hwndDlg, IDD_NB_GENERAL_TITLE, 203 MAXTITLELENGTH, szString); 189 204 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 { 192 221 case IDD_NB_GENERAL_TARGETPATH: 193 222 { 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 }*/ 202 281 } 203 282 break; … … 847 926 * Dialog procedure for object page dialog in the package notebook. 848 927 */ 849 MRESULT EXPENTRY fnTradObjectPageProc 928 MRESULT EXPENTRY fnTradObjectPageProc(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2) 850 929 { 851 930 MRESULT mrc = 0; … … 865 944 HWND hwndClassLbox = WinWindowFromID (hwndDlg, IDD_NB_OBJECT_CLASSNAME); 866 945 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 */ 867 957 868 958 pMsgData = new MSGDATA; … … 978 1068 case IDD_NB_OBJECT_REMOVE: 979 1069 { 980 PPCKDLGINFO pPckDlgInfo = (PPCKDLGINFO)WinQueryWindowPtr 981 HWND hwndLbox = WinWindowFromID 1070 PPCKDLGINFO pPckDlgInfo = (PPCKDLGINFO)WinQueryWindowPtr(hwndDlg, 0); 1071 HWND hwndLbox = WinWindowFromID(hwndDlg, 982 1072 IDD_NB_OBJECT_LIST); 983 1073 ScriptPackage *pPck = pPckDlgInfo->pPackage; … … 988 1078 pPck->DeleteCreateObjectObject((USHORT)sSelected); 989 1079 // Clear entry fields. 990 WinSetDlgItemText 991 WinSetDlgItemText 992 WinSetDlgItemText 993 WinSetDlgItemText 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, ""); 994 1084 // Uncheck replace check button. 995 WinCheckButton 1085 WinCheckButton(hwndDlg, IDD_NB_OBJECT_REPLACE, FALSE); 996 1086 } 997 1087 sSelected = 0; 998 1088 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 } 1002 1186 break; 1003 1187 } … … 1021 1205 SHORT sCount = SHORT1FROMMR(WinSendDlgItemMsg(hwndDlg, 1022 1206 IDD_NB_OBJECT_LIST, LM_QUERYITEMCOUNT, 0, 0)); 1207 // If something is selected. 1023 1208 if (sRet != LIT_NONE) 1024 1209 { 1025 1210 sSelected = sRet + 1; 1211 // Send message to this dialog, which is actually 1212 // converted to function call, to set controls. 1026 1213 WinSendMsg(hwndDlg, USER_OBJECT_SETDLGITEMS, NULL, 1027 1214 NULL); … … 1039 1226 } 1040 1227 break; 1041 } 1228 } // endof LN_SELECT 1042 1229 } 1043 1230 break; … … 3162 3349 return mrc; 3163 3350 } 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 */ 3362 MRESULT 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 26 26 #include "helpers\linklist.h" 27 27 #include "helpers\cnrh.h" 28 #include <list> 29 #include "helpers\stringh.h" 28 30 #include "helpers\xstring.h" 31 #include "base\bs_string.h" 29 32 30 33 #include "wicpm\script.hpp" … … 343 346 PMAINWINDOWINFO pWinInfo = 344 347 (PMAINWINDOWINFO) WinQueryWindowPtr(hwndWnd, 0); 348 349 345 350 break; 346 351 } … … 408 413 if (WinProcessDlg(hwndAdd)) // Processing of the main window procedure 409 414 { // stops while proessing Add package dialog. 410 *pPckTemp1 = *pPckTemp; 415 416 *pPckTemp1 = *pPckTemp; // Update original package object. 411 417 pDBPck->usPckIndexAttr = pPckTemp1->ReturnPackageIndexNumber(); 412 418 pPckIDTemp = pPckTemp1->ReturnPackageIDObject(); … … 493 499 break; 494 500 } 501 case IDM_MAIN_EDIT_REMOVE_PCK: 495 502 case IDM_PCKCONTAINER_REMOVE: 496 503 { … … 559 566 break; 560 567 } 568 case IDM_MAIN_EDIT_REMOVE_FILE: 561 569 case IDM_FILECONTAINER_REMOVE: 562 570 { … … 630 638 pTradArcThInfo->pszArchiveFileName = pszFileName; 631 639 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); 636 644 PLISTNODE pNode = lstQueryFirstNode(pWinInfo->plPackageList); 637 645 DBPackage *pDBPackage; … … 665 673 666 674 WinProcessDlg(pTradArcThInfo->hwndStatusDlg); 667 //DosCloseEventSem(pTradArcThInfo->hevStatusDlgReady);675 DosCloseEventSem(pTradArcThInfo->hevStatusDlgReady); 668 676 delete pTradArcThInfo; 669 677 delete pSDlgInfo; … … 741 749 pWinInfo->fileContainerInfo.hwndContextMenu, 742 750 IDM_FILECONTAINER_ADD, TRUE); 751 WinEnableMenuItem( 752 pWinInfo->hwndMainMenu, 753 IDM_MAIN_EDIT_ADD_FILE, TRUE); 743 754 } 744 755 break; … … 792 803 // selected pointer to point to it. 793 804 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 } 794 815 } 795 816 } // endswitch … … 1250 1271 MPFROMSHORT(usMaxPercentage)); 1251 1272 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. 1254 1279 case USER_ARCTM_FILE_UPDATING: 1255 1280 { 1256 XSTRING strStatus; 1257 xstrInit(&strStatus, 100); 1281 XSTRING xstrStatus; 1258 1282 CHAR szRation[4]; 1259 1283 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); 1263 1288 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); 1267 1292 WinSendMsg(WinWindowFromID(hwndDlg, IDD_CREATING_REPORT), 1268 1293 MLM_INSERT, 1269 (MPARAM) (strStatus.psz),1294 (MPARAM)xstrStatus.psz, 1270 1295 MPNULL); 1271 xstrClear(&strStatus); 1296 xstrClear(&xstrStatus); 1297 // Post semaphore so WIArchive can continue it's work. 1298 DosPostEventSem(pSDlgInfo->hevStatusDlgReady); 1272 1299 break; 1273 1300 } -
TabularUnified trunk/src/wicpm/makefile ¶
r147 r172 124 124 $(HLPINC)\comctl.h \ 125 125 $(HLPINC)\except.h \ 126 $(FEINC)\gui_wicpm.h \ 126 127 $(INC)\setup.h 127 128 -
TabularUnified trunk/src/wicpm/script.cpp ¶
r155 r172 3 3 * (c) Copyright Teemu Ahola 2000 4 4 * 5 * WarpIN Script Class 0.9.45 * WarpIN Script Handling Class 0.9.6 6 6 * 7 7 * Special thanks to Ulrich Mller about his great helper functions for … … 9 9 * 10 10 * 11 *@@ 11 *@@sourcefile: script.cpp 12 12 * Source code file for Script C++ class. 13 * This file contains source codes for WarpIN Scriptclass.14 * This file is notplatform independent. More detailed information about13 * This file contains source codes for WarpIN Script handling class. 14 * This file <U>is</U> platform independent. More detailed information about 15 15 * WarpIN script can be found from WarpIN programmer guide. 16 16 * … … 21 21 * script can be created and script text can be parsed back to objects. 22 22 * 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. 23 29 */ 24 30 … … 30 36 #include <direct.h> 31 37 32 #include "setup.h" // Teemu, this must be first V0.9.7 (2000-12-08) [umoeller]33 38 #include "setup.h" 39 #include <list> 34 40 #include "helpers\stringh.h" 35 41 #include "helpers\xstring.h" 42 #include "base\bs_string.h" 36 43 #include "wicpm\script.hpp" 44 45 37 46 38 47 // Script tags and attributes … … 133 142 #define SZ_TAG_ENDWARPIN "/WARPIN" 134 143 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 135 150 136 151 … … 144 159 145 160 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 */ 174 template <class T> 175 T *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 */ 209 template <class T> 210 USHORT 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 */ 260 template <class T> 261 USHORT 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: 149 303 * Adds error information structure to table. Returns error code if 150 304 * necessary. … … 176 330 177 331 178 /* **************************************************************************179 *@@ AddCharacterAfterEOL180 * 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. 181 335 */ 182 336 void AddCharacterAfterEOL(PSZ *pszText, // Pointer to PSZ pointer. … … 190 344 return; 191 345 192 pszTemp1 = strhins(pszTemp, ulOffset, &szCharacter); 346 // Add the character to the beginning of the string. 347 pszTemp1 = strhins(pszTemp, 0, &szCharacter); 193 348 delete [] pszTemp; 194 349 pszTemp = pszTemp1; 350 // Repeat. 195 351 while (TRUE) 196 352 { 353 // Find next line. 197 354 pszReturn = strhFindNextLine(pszTemp + ulOffset, &ulOffset); 355 // If no more lines, break. 198 356 if (*pszReturn == '\0') 199 357 break; 358 // Set ulOffset to beginning of next line. 200 359 ulOffset += ulTempOffset; 201 360 ulTempOffset = ulOffset; 361 // Add the character. 202 362 pszTemp1 = strhins(pszTemp, ulOffset, &szCharacter); 203 363 delete [] pszTemp; … … 288 448 289 449 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 */ 484 Message::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 */ 496 Message::~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 */ 510 USHORT 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 */ 522 USHORT 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 */ 535 USHORT 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 */ 549 USHORT 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 */ 561 USHORT 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 */ 573 USHORT Message::ReturnType() 574 { 575 return _usType; 576 } 577 578 579 /* 580 *@@ ReturnLineNumber 581 * Return line number. (See SetLineNumber) 582 */ 583 ULONG Message::ReturnLineNumber() 584 { 585 return _ulLineNumber; 586 } 587 588 589 /* 590 *@@ReturnMessageValue: 591 * Returns message value. 592 */ 593 USHORT Message::ReturnMessageValue() 594 { 595 return _usMessageValue; 596 } 597 598 599 /* 600 *@@ReturnMessageString: 601 * Return message string. (See SetMessageText) 602 */ 603 BSString &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 */ 614 BSString &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 */ 674 MessageLogger::MessageLogger() 675 { 676 _pParentLogger = NULL; 677 _usMessages = 0; 678 } 679 680 681 /* 682 *@@MessageLogger: 683 * Copy constructor for MessageLogger class. 684 */ 685 MessageLogger::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 */ 698 MessageLogger::~MessageLogger() 699 { 700 DeleteLogs(); 701 _pParentLogger = NULL; 702 _usMessages = 0; 703 } 704 705 706 /* 707 *@@operator=: 708 * Assignment operator for MessageLogger. 709 */ 710 MessageLogger &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 */ 740 const list<Message*> MessageLogger::ReturnMessageList() 741 { 742 return _lstMessage; 743 } 744 745 746 USHORT 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 759 USHORT 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 776 USHORT 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 */ 806 BSString &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 */ 845 USHORT WarpINScriptBase::SetIndex(const USHORT p_usIndex) 846 { 847 _usIndex = p_usIndex; 848 } 849 850 851 /* 852 *@@ReturnIndex: 853 * Returns UsIndex number. 854 */ 855 856 USHORT WarpINScriptBase::ReturnIndex() 857 { 858 return _usIndex; 859 } 860 861 862 WarpINScriptBase::~WarpINScriptBase() 863 { 864 865 } 866 867 868 290 869 291 870 /**************************************************************************** 292 871 **************************************************************************** 293 872 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. 312 890 */ 313 891 ScriptIndex::ScriptIndex(USHORT usIndex) 314 892 { 315 usIndex = 0;316 this->usIndex = usIndex;317 } 318 319 320 321 /* **************************************************************************322 *@@ ScriptIndex::~ScriptIndex323 * 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. 324 902 */ 325 903 … … 329 907 330 908 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 */ 913 ScriptIndex &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 926 USHORT ScriptIndex::SetIndexAttribute(USHORT usIndexAttribute) 337 927 { 338 928 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: 357 935 * Returns usIndexAttribute number. 358 936 */ … … 364 942 365 943 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. 383 947 */ 384 948 PSZ ScriptIndex::MakeScriptText(BOOL bAttribute) … … 386 950 ULONG ulTextLength = 0; 387 951 PSZ pszScriptText = NULL; 388 ulTextLength = LtoALength((LONG) 952 ulTextLength = LtoALength((LONG)usIndexAttribute); 389 953 390 954 if (bAttribute) … … 404 968 405 969 406 /* **************************************************************************407 *@@ ScriptIndex::BuildFromText970 /* 971 *@@BuildFromText: 408 972 * Builds INDEX accordingly to script text. If any errors is found in script 409 973 * text, error informations are returned in table where to *pScriptError 410 974 * points. Pointer to after end of tag is returned so multiple searches can be 411 975 * done. 976 *@@changed v.0.9.5 (2000-08-30) [tahola]: modified message logging. 412 977 */ 413 978 PSZ ScriptIndex::BuildFromText(PSZ pszScriptText, 414 SCRIPTERROR **ppScriptError,415 USHORT *pusErrorTableSize,416 979 ULONG ulLineNumber) 417 980 { 418 SCRIPTERROR Error;981 Message msg; 419 982 PSZ pszTemp = NULL; 420 983 PSZ pszAttr = NULL; … … 427 990 else 428 991 { 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); 436 996 return NULL; 437 997 } … … 446 1006 /**************************************************************************** 447 1007 **************************************************************************** 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 473 1034 ****************************************************************************/ 474 1035 475 1036 476 /* ***************************************************************************477 *@@ScriptPackageID: :ScriptPackageID1037 /* 1038 *@@ScriptPackageID: 478 1039 * This is default constructor for ScriptPackageID class. This initializes 479 1040 * all local variables. 480 1041 */ 481 ScriptPackageID::ScriptPackageID(USHORT usIndex)1042 ScriptPackageID::ScriptPackageID(USHORT p_usIndex) 482 1043 { 483 1044 // 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::~ScriptPackageID1045 *_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: 497 1058 * This is default destructor for ScriptPackageID class. This does not do 498 1059 * anything special. … … 504 1065 505 1066 506 /* ***************************************************************************507 *@@S criptPackageID::SetVendor1067 /* 1068 *@@SetVendor: 508 1069 * This function sets vendor string. 509 1070 */ 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 1071 USHORT 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: 520 1092 * This function sets application string. 521 1093 */ 522 void ScriptPackageID::SetApplication(const PSZ pszApplication) 523 { 524 if (strlen(szApplication) < MAXAPPNAMELENGTH) 525 strcpy(this->szApplication, pszApplication); 526 } 527 528 /**************************************************************************** 529 *@@ScriptPackageID::SetPackage 1094 USHORT 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: 530 1113 * This function sets package string. 531 1114 */ 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 1115 USHORT 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: 542 1136 * This function sets major number. 543 1137 */ 544 void ScriptPackageID::SetMajor(USHORTusMajor)545 { 546 this-> usMajor =usMajor;547 }548 549 550 551 /* ***************************************************************************552 *@@S criptPackageID::SetMinor1138 USHORT ScriptPackageID::SetMajor(USHORT p_usMajor) 1139 { 1140 this->_usMajor = p_usMajor; 1141 return NO_ERROR; 1142 } 1143 1144 1145 /* 1146 *@@SetMinor: 553 1147 * This function sets minor number. 554 1148 */ 555 void ScriptPackageID::SetMinor(USHORT usMinor) 556 { 557 this->usMinor = usMinor; 558 } 559 560 561 562 /**************************************************************************** 563 *@@ScriptPackageID::SetRevision 1149 USHORT ScriptPackageID::SetMinor(USHORT p_usMinor) 1150 { 1151 this->_usMinor = p_usMinor; 1152 return NO_ERROR; 1153 } 1154 1155 1156 1157 /* 1158 *@@SetRevision: 564 1159 * This function sets revision number. 565 1160 */ 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 1161 USHORT 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 */ 1173 USHORT ScriptPackageID::SetPackageID(PACKAGEIDDATA packageIDData) 1174 { 1175 return NO_ERROR; 1176 } 1177 1178 1179 /* 1180 *@@ReturnVendor: 597 1181 * This function returns const pointer to vendor string. 598 1182 */ 599 1183 const PSZ ScriptPackageID::ReturnVendor() 600 1184 { 601 return (PSZ) szVendor;602 } 603 604 605 606 /* ***************************************************************************607 *@@ ScriptPackageID::ReturnApplication1185 return (PSZ)_szVendor; 1186 } 1187 1188 1189 1190 /* 1191 *@@ReturnApplication: 608 1192 * This function returns const pointer to application string. 609 1193 */ 610 1194 const PSZ ScriptPackageID::ReturnApplication() 611 1195 { 612 return (PSZ) szApplication;613 } 614 615 616 617 /* ***************************************************************************618 *@@ ScriptPackageID::ReturnPackage1196 return (PSZ)_szApplication; 1197 } 1198 1199 1200 1201 /* 1202 *@@ReturnPackage: 619 1203 * This function returns const pointer to package string. 620 1204 */ 621 1205 const PSZ ScriptPackageID::ReturnPackage() 622 1206 { 623 return (PSZ) szPackage;624 } 625 626 627 /* ***************************************************************************628 *@@ ScriptPackageID::ReturnMajor1207 return (PSZ)_szPackage; 1208 } 1209 1210 1211 /* 1212 *@@ReturnMajor: 629 1213 * This function returns major version number. 630 1214 */ 631 1215 USHORT ScriptPackageID::ReturnMajor() 632 1216 { 633 return usMajor; 634 } 635 636 637 638 /**************************************************************************** 639 *@@ScriptPackageID::ReturnMinor 1217 return _usMajor; 1218 } 1219 1220 1221 /* 1222 *@@ReturnMinor: 640 1223 * This function returns minor version number. 641 1224 */ 642 1225 USHORT ScriptPackageID::ReturnMinor() 643 1226 { 644 return usMinor;645 } 646 647 648 /* ***************************************************************************649 *@@ ScriptPackageID::ReturnRevision1227 return _usMinor; 1228 } 1229 1230 1231 /* 1232 *@@ReturnRevision: 650 1233 * This function returns revision version number. 651 1234 */ 652 1235 USHORT ScriptPackageID::ReturnRevision() 653 1236 { 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: 671 1243 * This function returns pointer to script text. If bShowAttribute is FALSE 672 1244 * PACKAGEID="" text will not be included to the script text. 673 1245 */ 674 PSZ ScriptPackageID::MakeScriptText(BOOL bShowAttribute)1246 PSZ ScriptPackageID::MakeScriptText(BOOL p_bShowAttribute) 675 1247 { 676 1248 ULONG ulTextLength = 0; 677 XSTRING strScriptText;1249 XSTRING xstrScriptText; 678 1250 CHAR szTemp[1024]; 679 xstrInit(&strScriptText, 0); 1251 1252 xstrInit(&xstrScriptText, 0); 680 1253 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); 684 1257 ulTextLength += 5; 685 1258 686 if ( bShowAttribute)1259 if (p_bShowAttribute) 687 1260 // Length of the attribute, =, " and " 688 1261 ulTextLength += strlen(SZ_ATTRIBUTE_PACKAGEID) + 3; 689 1262 690 //pszScriptText = new CHAR[ulTextLength + 1]; 691 //*pszScriptText = '\0'; 692 693 if (bShowAttribute) 1263 if (p_bShowAttribute) 694 1264 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); 696 1266 else 697 1267 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:: BuildFromText1268 _szVendor, _szApplication, _szPackage, _usMajor, _usMinor, _usRevision); 1269 1270 xstrcat(&xstrScriptText, szTemp, 0); 1271 return xstrScriptText.psz; 1272 } 1273 1274 1275 /* 1276 *@@BuildFromText: 707 1277 * Builds package ID accordingly to script text. If any errors is found in script 708 1278 * text, error informations are returned in table where to *pScriptError … … 711 1281 */ 712 1282 PSZ ScriptPackageID::BuildFromText(PSZ pszScriptText, 713 SCRIPTERROR **ppScriptError,714 USHORT *pusErrorTableSize,715 1283 ULONG ulLineNumber) 716 1284 { 717 SCRIPTERROR Error;1285 Message msg; 718 1286 PSZ pszTemp = NULL, pszTemp2 = NULL, pszTemp3 = NULL; 719 1287 PSZ pszAttr = NULL; … … 724 1292 pszAttr = strhGetTextAttr(pszScriptText, SZ_ATTRIBUTE_PACKAGEID, &ulOffset); 725 1293 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); 735 1300 return NULL; 736 1301 } … … 741 1306 { 742 1307 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 } 743 1316 this->SetVendor(pszTemp3); 744 1317 delete [] pszTemp3; … … 748 1321 { 749 1322 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 } 750 1331 this->SetApplication(pszTemp3); 751 1332 delete [] pszTemp3; … … 755 1336 { 756 1337 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 } 757 1346 this->SetPackage(pszTemp3); 758 1347 delete [] pszTemp3; … … 762 1351 { 763 1352 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 } 764 1361 sscanf(pszTemp3, "%d", &ulVersion); 765 1362 this->SetMajor((USHORT)ulVersion); … … 770 1367 { 771 1368 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 } 772 1377 sscanf(pszTemp3, "%d", &ulVersion); 773 1378 this->SetMinor((USHORT)ulVersion); … … 795 1400 } 796 1401 } 797 else // Major 1402 else // Major warning. 798 1403 { 799 // Error 1404 msg.SetType(MSG_TYPE_WARNING); 1405 msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_NOTFOUND); 1406 msg.SetLineNumber(ulLineNumber); 1407 _messageLogger.LogMessage(msg); 800 1408 } 801 1409 } 802 else // Package 1410 else // Package warning. 803 1411 { 804 // Error 1412 msg.SetType(MSG_TYPE_WARNING); 1413 msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_PACKAGE_NOTFOUND); 1414 msg.SetLineNumber(ulLineNumber); 1415 _messageLogger.LogMessage(msg); 805 1416 } 806 1417 } 807 else // Application 1418 else // Application warning. 808 1419 { 809 // Error 1420 msg.SetType(MSG_TYPE_WARNING); 1421 msg.SetMessageValue(MSG_ATTRIBUTE_PACKAGEID_APPL_NOTFOUND); 1422 msg.SetLineNumber(ulLineNumber); 1423 _messageLogger.LogMessage(msg); 810 1424 } 811 1425 } 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 } 818 1433 819 1434 ulAttrLen = strlen(pszAttr); … … 828 1443 /**************************************************************************** 829 1444 **************************************************************************** 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: 847 1464 * Constructor for ScriptTitle class. Initializes szTitle string by setting 848 1465 * first char to '\0'. 849 1466 */ 850 ScriptTitle::ScriptTitle(USHORT usIndex) 851 { 852 *szTitle = '\0'; 853 this->usIndex = usIndex; 854 } 855 856 857 858 /*************************************************************************** 859 *@@ ScriptTitle::~ScriptTitle 1467 ScriptTitle::ScriptTitle(USHORT p_usIndex) 1468 { 1469 *_szTitle = '\0'; 1470 SetIndex(p_usIndex); 1471 } 1472 1473 1474 /* 1475 *@@~ScriptTitle: 860 1476 * destructor for ScriptTitle class. Does nothing special. 861 1477 */ … … 866 1482 867 1483 868 /* **************************************************************************869 *@@ ScriptTitle::SetTitle1484 /* 1485 *@@SetTitle: 870 1486 * Sets title text. 871 1487 */ 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 1488 USHORT 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: 895 1509 * Returns const pointer to title text. 896 1510 */ 897 898 1511 const PSZ ScriptTitle::ReturnTitle() 899 1512 { 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: 920 1518 * Returns pointer to script text. 921 1519 */ 922 PSZ ScriptTitle::MakeScriptText(BOOL bAttribute)1520 PSZ ScriptTitle::MakeScriptText(BOOL p_bAttribute) 923 1521 { 924 1522 ULONG ulTextLength = 0; 925 1523 PSZ pszScriptText = NULL; 926 ulTextLength = strlen( szTitle);1524 ulTextLength = strlen(_szTitle); 927 1525 CHAR szTemp[1024]; 928 1526 szTemp[0]='\0'; 929 1527 930 if ( bAttribute)1528 if (p_bAttribute) 931 1529 // Length of the attribute, =, " and " 932 ulTextLength += strlen( "TITLE") + 3;1530 ulTextLength += strlen(SZ_ATTRIBUTE_TITLE) + 3; 933 1531 934 1532 pszScriptText = new CHAR[ulTextLength + 1]; 935 1533 *pszScriptText = '\0'; 936 1534 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); 939 1537 else 940 sprintf(pszScriptText, "%s", szTitle);1538 sprintf(pszScriptText, "%s", _szTitle); 941 1539 942 1540 return pszScriptText; … … 944 1542 945 1543 946 /* **************************************************************************947 *@@ ScriptTitle::BuildFromText1544 /* 1545 *@@BuildFromText: 948 1546 * Builds package ID accordingly to script text. If any errors is found in script 949 1547 * text, error informations are returned in table where to *pScriptError … … 952 1550 */ 953 1551 PSZ 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; 959 1555 PSZ pszTemp = NULL; 960 1556 PSZ pszAttr = NULL; … … 968 1564 else 969 1565 { 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); 977 1570 return NULL; 978 1571 } … … 988 1581 /**************************************************************************** 989 1582 **************************************************************************** 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. 1002 1598 ***************************************************************************/ 1003 1599 1004 1600 1005 /* **************************************************************************1006 *@@ ScriptTarget::ScriptTarget1601 /* 1602 *@@ScriptTarget: 1007 1603 * Constructor for ScriptTarget class. Initializes szTarget string by 1008 1604 * setting first char to '\0'. 1009 1605 */ 1010 ScriptTarget::ScriptTarget(USHORT usIndex)1011 { 1012 * szTarget = '\0';1013 this->usIndex = usIndex;1014 } 1015 1016 1017 1018 /* **************************************************************************1019 *@@ ScriptTarget::~ScriptTarget1020 * destructor for ScriptTarget class. Does nothing special.1606 ScriptTarget::ScriptTarget(USHORT p_usIndex) 1607 { 1608 *_szTarget = '\0'; 1609 SetIndex(p_usIndex); 1610 } 1611 1612 1613 1614 /* 1615 *@@~ScriptTarget: 1616 * destructor for ScriptTarget class. 1021 1617 */ 1022 1618 ScriptTarget::~ScriptTarget() 1023 1619 { 1024 } 1025 1026 1027 /*************************************************************************** 1028 *@@ ScriptTarget::SetTarget 1620 *_szTarget = '\0'; 1621 } 1622 1623 1624 /* 1625 *@@SetTarget: 1029 1626 * Sets target text. 1030 1627 */ 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 1628 USHORT 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: 1052 1648 * Returns const pointer to target text. 1053 1649 */ 1054 1650 const PSZ ScriptTarget::ReturnTarget() 1055 1651 { 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: 1075 1658 * Returns pointer to script text. 1076 1659 */ 1077 PSZ ScriptTarget::MakeScriptText(BOOL bAttribute) 1078 { 1079 ULONG ulTextLength = 0; 1080 XSTRING strScriptText; 1081 xstrInit(&strScriptText, 0); 1082 ulTextLength = strlen(szTarget); 1660 PSZ ScriptTarget::MakeScriptText(BOOL p_bAttribute) 1661 { 1662 XSTRING xstrScriptText; 1083 1663 CHAR szTemp[1024]; 1084 1664 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); 1095 1669 else 1096 sprintf(szTemp, "%s\"", szTarget);1097 1098 xstrcat(& strScriptText, szTemp, 0);1099 return strScriptText.psz;1100 } 1101 1102 1103 1104 /* **************************************************************************1105 *@@ ScriptTarget::BuildFromText1670 sprintf(szTemp, "%s\"", _szTarget); 1671 1672 xstrcat(&xstrScriptText, szTemp, 0); 1673 return xstrScriptText.psz; 1674 } 1675 1676 1677 1678 /* 1679 *@@BuildFromText: 1106 1680 * 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 */ 1684 PSZ ScriptTarget::BuildFromText(PSZ p_pszScriptText, 1685 ULONG p_ulLineNumber) 1686 { 1687 Message msg; 1117 1688 PSZ pszTemp = NULL; 1118 1689 PSZ pszAttr = NULL; … … 1121 1692 1122 1693 1123 pszAttr = strhGetTextAttr(p szScriptText, SZ_ATTRIBUTE_TARGET, &ulOffset);1694 pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_TARGET, &ulOffset); 1124 1695 if (pszAttr) 1125 1696 this->SetTarget(pszAttr); 1126 1697 else 1127 1698 { 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); 1135 1703 return NULL; 1136 1704 } … … 1138 1706 ulAttrLen = strlen(pszAttr); 1139 1707 delete [] pszAttr; 1140 return p szScriptText + ulOffset + ulAttrLen + 1;1708 return p_pszScriptText + ulOffset + ulAttrLen + 1; 1141 1709 } 1142 1710 … … 1145 1713 /**************************************************************************** 1146 1714 **************************************************************************** 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. 1166 1738 ***************************************************************************/ 1167 1739 1168 1740 1169 /* **************************************************************************1170 *@@ ScriptKeyWord::ScriptKeyWord1741 /* 1742 *@@ScriptKeyWord: 1171 1743 * Constructor for ScriptKeyWord class. Initializes object by setting 1172 1744 * usIndex to given value on uses default value (1). 1173 1745 */ 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 1746 ScriptKeyWord::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: 1188 1758 * Destructor for ScriptKeyWord class. 1189 1759 */ 1190 1760 ScriptKeyWord::~ScriptKeyWord() 1191 1761 { 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: 1198 1771 * Sets BASE keyword state. 1199 1772 */ 1200 void ScriptKeyWord::SetBase(BOOLbBase)1201 { 1202 this->bBase =bBase;1203 }1204 1205 1206 1207 /* **************************************************************************1773 USHORT ScriptKeyWord::SetBase(BOOL p_bBase) 1774 { 1775 _bBase = p_bBase; 1776 return NO_ERROR; 1777 } 1778 1779 1780 /* 1208 1781 *@@ ScriptKeyWord::SetFixed 1209 1782 * Sets FIXED keyword state. 1210 1783 */ 1211 void ScriptKeyWord::SetFixed(BOOLbFixed)1212 { 1213 this->bFixed =bFixed;1214 }1215 1216 1217 1218 /* **************************************************************************1219 *@@ ScriptKeyWord::SetSelect1784 USHORT ScriptKeyWord::SetFixed(BOOL p_bFixed) 1785 { 1786 _bFixed = p_bFixed; 1787 return NO_ERROR; 1788 } 1789 1790 1791 /* 1792 *@@SetSelect: 1220 1793 * Sets SELECT keyword state. 1221 1794 */ 1222 void ScriptKeyWord::SetSelect(BOOLbSelect)1223 { 1224 this->bSelect =bSelect;1225 }1226 1227 1228 1229 /* **************************************************************************1230 *@@ ScriptKeyWord::SetNoDeselect1795 USHORT ScriptKeyWord::SetSelect(BOOL p_bSelect) 1796 { 1797 _bSelect = p_bSelect; 1798 return NO_ERROR; 1799 } 1800 1801 1802 /* 1803 *@@SetNoDeselect: 1231 1804 * Sets NODESELECT keyword state. 1232 1805 */ 1233 void ScriptKeyWord::SetNoDeselect(BOOL bNoDeselect) 1234 { 1235 this->bNoDeselect = bNoDeselect; 1236 } 1237 1238 1239 1240 1241 /*************************************************************************** 1242 *@@ ScriptKeyWord::SetKeyWord 1806 USHORT ScriptKeyWord::SetNoDeselect(BOOL p_bNoDeselect) 1807 { 1808 _bNoDeselect = p_bNoDeselect; 1809 return NO_ERROR; 1810 } 1811 1812 1813 /* 1814 *@@SetKeyWord: 1243 1815 * Sets all keyword states acconding to usKeyWords. Different keywords can 1244 1816 * be combined with OR. Example: KEYWORD_BASE | KEYWORD_FIXED. 1245 1817 */ 1246 void ScriptKeyWord::SetKeyWord(USHORTusKeyWords)1247 { 1248 if ( usKeyWords & KEYWORD_BASE)1249 bBase = TRUE;1818 USHORT ScriptKeyWord::SetKeyWord(USHORT p_usKeyWords) 1819 { 1820 if (p_usKeyWords & KEYWORD_BASE) 1821 _bBase = TRUE; 1250 1822 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; 1255 1827 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; 1260 1832 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; 1265 1837 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: 1284 1846 * Returns bBase state. 1285 1847 */ 1286 1848 BOOL ScriptKeyWord::ReturnBase() 1287 1849 { 1288 return bBase; 1289 } 1290 1291 1292 1293 /*************************************************************************** 1294 *@@ ScriptKeyWord::ReturnFixed 1850 return _bBase; 1851 } 1852 1853 1854 /* 1855 *@@ReturnFixed: 1295 1856 * Returns bFixed state. 1296 1857 */ 1297 1858 BOOL ScriptKeyWord::ReturnFixed() 1298 1859 { 1299 return bFixed; 1300 } 1301 1302 1303 1304 /*************************************************************************** 1305 *@@ ScriptKeyWord::ReturnSelect 1860 return _bFixed; 1861 } 1862 1863 1864 /* 1865 *@@ReturnSelect: 1306 1866 * Returns bSelect state. 1307 1867 */ 1308 1868 BOOL ScriptKeyWord::ReturnSelect() 1309 1869 { 1310 return bSelect; 1311 } 1312 1313 1314 1315 /*************************************************************************** 1316 *@@ ScriptKeyWord::ReturnNoDeselect 1870 return _bSelect; 1871 } 1872 1873 1874 /* 1875 *@@ReturnNoDeselect: 1317 1876 * Returns bBase state. 1318 1877 */ 1319 1878 BOOL ScriptKeyWord::ReturnNoDeselect() 1320 1879 { 1321 return bNoDeselect; 1322 } 1323 1324 1325 1326 /*************************************************************************** 1327 *@@ ScriptKeyWord::ReturnKeyWord 1880 return _bNoDeselect; 1881 } 1882 1883 1884 /* 1885 *@@ReturnKeyWord: 1328 1886 * Returns all keyword states. 1329 1887 */ … … 1332 1890 USHORT usReturnValue = 0; 1333 1891 1334 if ( bBase)1892 if (_bBase) 1335 1893 usReturnValue |= KEYWORD_BASE; 1336 if ( bFixed)1894 if (_bFixed) 1337 1895 usReturnValue |= KEYWORD_FIXED; 1338 if ( bSelect)1896 if (_bSelect) 1339 1897 usReturnValue |= KEYWORD_SELECT; 1340 if ( bNoDeselect)1898 if (_bNoDeselect) 1341 1899 usReturnValue |= KEYWORD_NODESELECT; 1342 1900 … … 1345 1903 1346 1904 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: 1362 1907 * Returns pointer to script text. 1363 1908 */ 1364 PSZ ScriptKeyWord::MakeScriptText(BOOL bAttribute, BOOL bLineFeed) 1365 { 1366 ULONG ulTextLength = 0; 1909 PSZ ScriptKeyWord::MakeScriptText(BOOL p_bAttribute, BOOL p_bLineFeed) 1910 { 1367 1911 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) 1373 1916 ulSpaces ++; 1374 } 1375 if (bFixed) 1376 { 1377 ulTextLength += strlen(SZ_KEYWORD_FIXED); 1917 if (_bFixed) 1378 1918 ulSpaces ++; 1379 } 1380 if (bSelect) 1381 { 1382 ulTextLength += strlen(SZ_KEYWORD_SELECT); 1919 if (_bSelect) 1383 1920 ulSpaces ++; 1384 } 1385 if (bNoDeselect) 1386 { 1387 ulTextLength += strlen(SZ_KEYWORD_NODESELECT); 1921 if (_bNoDeselect) 1388 1922 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); 1399 1929 else if (ulSpaces > 0) 1400 strcat(pszScriptText, " ");1930 xstrcat(&xstrScriptText, " ", 0); 1401 1931 ulSpaces--; 1402 1932 } 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); 1408 1938 else if (ulSpaces > 0) 1409 strcat(pszScriptText, " ");1939 xstrcat(&xstrScriptText, " ", 0); 1410 1940 ulSpaces--; 1411 1941 } 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); 1417 1947 else if (ulSpaces > 0) 1418 strcat(pszScriptText, " ");1948 xstrcat(&xstrScriptText, " ", 0); 1419 1949 ulSpaces--; 1420 1950 } 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); 1426 1956 else if (ulSpaces > 0) 1427 strcat(pszScriptText, " ");1957 xstrcat(&xstrScriptText, " ", 0); 1428 1958 ulSpaces--; 1429 1959 } 1430 1960 1431 return pszScriptText; 1432 } 1433 1434 1435 1436 /*************************************************************************** 1437 *@@ScriptKeyWord::BuildFromText 1961 return xstrScriptText.psz; 1962 } 1963 1964 1965 /* 1966 *@@BuildFromText: 1438 1967 * 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 */ 1971 PSZ ScriptKeyWord::BuildFromText(PSZ p_pszScriptText, 1972 ULONG p_ulLineNumber) 1973 { 1974 Message msg; 1449 1975 PSZ pszKWord = NULL; 1450 1976 BOOL KWFound = FALSE; 1451 1977 1452 1978 1453 pszKWord = strhFindWord(p szScriptText, SZ_KEYWORD_BASE, "\x0d\x0a ()/\\-,.",1979 pszKWord = strhFindWord(p_pszScriptText, SZ_KEYWORD_BASE, "\x0d\x0a ()/\\-,.", 1454 1980 "\x0d\x0a ()/\\-,.:;"); 1455 1981 if (pszKWord) … … 1461 1987 this->SetBase(FALSE); 1462 1988 1463 pszKWord = strhFindWord(p szScriptText, SZ_KEYWORD_FIXED, "\x0d\x0a ()/\\-,.",1989 pszKWord = strhFindWord(p_pszScriptText, SZ_KEYWORD_FIXED, "\x0d\x0a ()/\\-,.", 1464 1990 "\x0d\x0a ()/\\-,.:;"); 1465 1991 if (pszKWord) … … 1471 1997 this->SetFixed(FALSE); 1472 1998 1473 pszKWord = strhFindWord(p szScriptText, SZ_KEYWORD_SELECT, "\x0d\x0a ()/\\-,.",1999 pszKWord = strhFindWord(p_pszScriptText, SZ_KEYWORD_SELECT, "\x0d\x0a ()/\\-,.", 1474 2000 "\x0d\x0a ()/\\-,.:;"); 1475 2001 if (pszKWord) … … 1481 2007 this->SetSelect(FALSE); 1482 2008 1483 pszKWord = strhFindWord(p szScriptText, SZ_KEYWORD_NODESELECT, "\x0d\x0a ()/\\-,.",2009 pszKWord = strhFindWord(p_pszScriptText, SZ_KEYWORD_NODESELECT, "\x0d\x0a ()/\\-,.", 1484 2010 "\x0d\x0a ()/\\-,.:;"); 1485 2011 if (pszKWord) … … 1493 2019 if (KWFound) 1494 2020 { 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); 1502 2025 return NULL; 1503 2026 } 1504 2027 1505 return p szScriptText;2028 return p_pszScriptText; 1506 2029 } 1507 2030 … … 1511 2034 /**************************************************************************** 1512 2035 **************************************************************************** 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. 1536 2061 ***************************************************************************/ 1537 2062 1538 2063 1539 /* **************************************************************************1540 *@@ ScriptRequires::ScriptRequires2064 /* 2065 *@@ScriptRequires: 1541 2066 * Constructor for ScriptRequires class. Initializes object by setting 1542 2067 * fields to zero. 1543 2068 */ 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 2069 ScriptRequires::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: 1560 2084 * Destructor for ScriptRequires class. 1561 2085 */ 1562 2086 ScriptRequires::~ScriptRequires() 1563 2087 { 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: 1570 2100 * Sets vendor text. 1571 2101 */ 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 2102 USHORT 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: 1582 2122 * Sets application text. 1583 2123 */ 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 2124 USHORT 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: 1595 2144 * Sets package text. 1596 2145 */ 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 2146 USHORT 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 1608 2166 * This function sets major number. 1609 2167 */ 1610 void ScriptRequires::SetMajor(USHORTusMajor)1611 { 1612 this-> usMajor =usMajor;1613 }1614 1615 1616 1617 /* ***************************************************************************1618 *@@S criptRequires::SetMinor2168 USHORT ScriptRequires::SetMajor(USHORT p_usMajor) 2169 { 2170 this->_usMajor = p_usMajor; 2171 return NO_ERROR; 2172 } 2173 2174 2175 /* 2176 *@@SetMinor: 1619 2177 * This function sets minor number. 1620 2178 */ 1621 void ScriptRequires::SetMinor(USHORTusMinor)1622 { 1623 this-> usMinor =usMinor;1624 }1625 1626 1627 1628 /* ***************************************************************************1629 *@@S criptRequires::SetRevision2179 USHORT ScriptRequires::SetMinor(USHORT p_usMinor) 2180 { 2181 this->_usMinor = p_usMinor; 2182 return NO_ERROR; 2183 } 2184 2185 2186 /* 2187 *@@SetRevision: 1630 2188 * This function sets revision number. 1631 2189 */ 1632 void ScriptRequires::SetRevision(USHORTusRevision)1633 { 1634 this-> usRevision =usRevision;1635 }1636 1637 1638 1639 /* ***************************************************************************1640 *@@S criptRequires::SetPckIndex2190 USHORT ScriptRequires::SetRevision(USHORT p_usRevision) 2191 { 2192 this->_usRevision = p_usRevision; 2193 return NO_ERROR; 2194 } 2195 2196 2197 /* 2198 *@@SetPckIndex: 1641 2199 * This function sets required package number. 1642 2200 */ 1643 void ScriptRequires::SetPckIndex(USHORT usPckIndex) 1644 { 1645 this->usPckIndex = usPckIndex; 1646 } 1647 1648 1649 1650 1651 /**************************************************************************** 1652 *@@ScriptRequires::SetRequires 2201 USHORT ScriptRequires::SetPckIndex(USHORT p_usPckIndex) 2202 { 2203 this->_usPckIndex = p_usPckIndex; 2204 return NO_ERROR; 2205 } 2206 2207 2208 /* 2209 *@@SetRequires: 1653 2210 * This function sets all datas. 1654 2211 */ 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 2212 USHORT 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: 1683 2232 * Returns const pointer to vendor text. 1684 2233 */ 1685 2234 const PSZ ScriptRequires::ReturnVendor() 1686 2235 { 1687 return szVendor; 1688 } 1689 1690 1691 1692 /*************************************************************************** 1693 *@@ ScriptRequires::ReturnApplication 2236 return _szVendor; 2237 } 2238 2239 2240 /* 2241 *@@ReturnApplication: 1694 2242 * Returns const pointer to application text. 1695 2243 */ 1696 2244 const PSZ ScriptRequires::ReturnApplication() 1697 2245 { 1698 return szApplication; 1699 } 1700 1701 1702 1703 /*************************************************************************** 1704 *@@ ScriptRequires::ReturnPackage 2246 return _szApplication; 2247 } 2248 2249 2250 /* 2251 *@@ReturnPackage: 1705 2252 * Returns const pointer to package text. 1706 2253 */ 1707 2254 const PSZ ScriptRequires::ReturnPackage() 1708 2255 { 1709 return szPackage; 1710 } 1711 1712 1713 1714 /*************************************************************************** 1715 *@@ ScriptRequires::ReturnMajor 2256 return _szPackage; 2257 } 2258 2259 2260 /* 2261 *@@ReturnMajor: 1716 2262 * Returns major number. 1717 2263 */ 1718 2264 USHORT ScriptRequires::ReturnMajor() 1719 2265 { 1720 return usMajor; 1721 } 1722 1723 1724 1725 1726 /*************************************************************************** 1727 *@@ ScriptRequires::ReturnMinor 2266 return _usMajor; 2267 } 2268 2269 2270 /* 2271 *@@ReturnMinor: 1728 2272 * Returns minor number. 1729 2273 */ 1730 2274 USHORT ScriptRequires::ReturnMinor() 1731 2275 { 1732 return usMinor; 1733 } 1734 1735 1736 1737 /*************************************************************************** 1738 *@@ ScriptRequires::ReturnRevision 2276 return _usMinor; 2277 } 2278 2279 2280 /* 2281 *@@ReturnRevision: 1739 2282 * Returns revision number. 1740 2283 */ 1741 2284 USHORT ScriptRequires::ReturnRevision() 1742 2285 { 1743 return usRevision; 1744 } 1745 1746 1747 1748 /*************************************************************************** 2286 return _usRevision; 2287 } 2288 2289 2290 /* 1749 2291 *@@ ScriptRequires::ReturnPckIndex 1750 2292 * Returns revision number. … … 1752 2294 USHORT ScriptRequires::ReturnPckIndex() 1753 2295 { 1754 return usPckIndex; 1755 } 1756 1757 1758 1759 1760 /**************************************************************************** 1761 *@@ScriptRequires::ReturnRequires 2296 return _usPckIndex; 2297 } 2298 2299 2300 /* 2301 *@@ReturnRequires: 1762 2302 * This function returns all datas. 1763 2303 */ … … 1765 2305 { 1766 2306 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; 1773 2313 return requiresData; 1774 2314 } 1775 2315 1776 2316 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: 1791 2319 * Returns pointer to script text. 1792 2320 */ 1793 PSZ ScriptRequires::MakeScriptText(BOOL bAttribute)2321 PSZ ScriptRequires::MakeScriptText(BOOL p_bAttribute) 1794 2322 { 1795 2323 ULONG ulTextLength = 0; 1796 2324 PSZ pszScriptText = NULL; 1797 2325 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); 1802 2330 ulTextLength += 5; 1803 2331 1804 if ( bAttribute)1805 ulTextLength += strlen( "REQUIRES") + 3;2332 if (p_bAttribute) 2333 ulTextLength += strlen(SZ_ATTRIBUTE_REQUIRES) + 3; 1806 2334 1807 2335 pszScriptText = new CHAR[ulTextLength + 1]; 1808 2336 *pszScriptText = '\0'; 1809 2337 1810 if ( bAttribute)2338 if (p_bAttribute) 1811 2339 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); 1814 2342 else 1815 2343 sprintf(pszScriptText, "%s\\%s\\%s\\%i\\%i\\%i", 1816 szVendor, szApplication, szPackage, usMajor,usMinor,1817 usRevision);2344 _szVendor, _szApplication, _szPackage, _usMajor, _usMinor, 2345 _usRevision); 1818 2346 return pszScriptText; 1819 2347 } … … 1821 2349 1822 2350 1823 /* **************************************************************************1824 *@@ ScriptRequires:: BuildFromText2351 /* 2352 *@@BuildFromText: 1825 2353 * 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 */ 2357 PSZ ScriptRequires::BuildFromText(PSZ p_pszScriptText, 2358 ULONG p_ulLineNumber) 2359 { 2360 Message msg; 1836 2361 PSZ pszTemp = NULL, pszTemp2 = NULL, pszTemp3 = NULL; 1837 2362 PSZ pszAttr = NULL; … … 1841 2366 ULONG ulAttrLen = 0; 1842 2367 1843 pszAttr = strhGetTextAttr(p szScriptText, SZ_ATTRIBUTE_REQUIRES, &ulOffset);2368 pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_REQUIRES, &ulOffset); 1844 2369 1845 2370 if (!pszAttr) 1846 2371 { 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); 1854 2376 return NULL; 1855 2377 } … … 1869 2391 this->SetApplication(pszTemp3); 1870 2392 delete [] pszTemp3; 1871 pszTemp2 = ++pszTemp;2393 pszTemp2 = ++pszTemp; 1872 2394 pszTemp = strchr(pszTemp, '\\'); 1873 2395 if (pszTemp) // Set package … … 1888 2410 if (pszTemp) // Set minor and revision 1889 2411 { 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 } 1895 2427 1896 2428 // Set revision 1897 2429 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); 1898 2435 this->SetRevision(0); 2436 } 1899 2437 else 1900 2438 { … … 1907 2445 else // Minor and revision 1908 2446 { 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 } 1914 2463 } 1915 2464 } 1916 2465 else // Major error 1917 2466 { 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); 1925 2471 bError = TRUE; 1926 2472 } … … 1928 2474 else // Package error 1929 2475 { 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); 1937 2480 bError = TRUE; 1938 2481 } … … 1940 2483 else // Application error 1941 2484 { 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); 1949 2489 bError = TRUE; 1950 2490 } … … 1952 2492 else // Vendor error 1953 2493 { 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); 1961 2498 bError = TRUE; 1962 2499 } … … 1966 2503 ulAttrLen = strlen(pszAttr); 1967 2504 delete [] pszAttr; 1968 return p szScriptText + ulOffset + ulAttrLen + 1;2505 return p_pszScriptText + ulOffset + ulAttrLen + 1; 1969 2506 } 1970 2507 … … 1975 2512 /**************************************************************************** 1976 2513 **************************************************************************** 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. 2006 2546 ***************************************************************************/ 2007 2547 2008 2548 2009 /* **************************************************************************2010 *@@ ScriptConfigSys::ScriptConfigSys2549 /* 2550 *@@ScriptConfigSys: 2011 2551 * Constructor for ScriptConfigSys class. Initializes object by setting 2012 2552 * fields to zero. 2013 2553 */ 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 2554 ScriptConfigSys::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: 2034 2573 * Destructor for ScriptConfigSys class. 2035 2574 */ 2036 2575 ScriptConfigSys::~ScriptConfigSys() 2037 2576 { 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: 2045 2593 * This function sets statement string. 2046 2594 */ 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 2595 USHORT 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: 2057 2615 * This function sets unique state. Returns error code if error occurred. 2058 * Error codes:2059 2616 * 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 */ 2628 USHORT ScriptConfigSys::SetUnique(BOOL p_bUnique) 2629 { 2630 Message msg; 2631 BSString string = SZ_MODIFIER_UNIQUE; 2632 string += "|"; 2063 2633 USHORT usRc = NO_ERROR; 2064 if (bUnique) 2065 { 2066 if (bAddRight) 2634 if (p_bUnique) 2635 { 2636 if (_bAddRight) 2637 { 2067 2638 usRc |= ERR_CONFIGSYS_ADDRIGHT_SETTED; 2068 if (bAddLeft) 2639 string += SZ_MODIFIER_ADDRIGHT; 2640 string += "|"; 2641 } 2642 if (_bAddLeft) 2643 { 2069 2644 usRc |= ERR_CONFIGSYS_ADDLEFT_SETTED; 2070 if (bRemoveLine) 2645 string += SZ_MODIFIER_ADDLEFT; 2646 string += "|"; 2647 } 2648 if (_bRemoveLine) 2649 { 2071 2650 usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED; 2072 if (bRemovePart) 2651 string += SZ_MODIFIER_REMOVELINE; 2652 string += "|"; 2653 } 2654 if (_bRemovePart) 2655 { 2073 2656 usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED; 2657 string += SZ_MODIFIER_REMOVEPART; 2658 } 2074 2659 } 2075 2660 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); 2076 2666 return usRc; 2077 2078 this->bUnique = bUnique; 2667 } 2668 2669 this->_bUnique = p_bUnique; 2079 2670 2080 2671 return usRc; … … 2082 2673 2083 2674 2084 2085 2086 /**************************************************************************** 2087 *@@ScriptConfigSys::SetAddRight 2675 /* 2676 *@@SetAddRight: 2088 2677 * This function sets addright state. Returns error code if error occurred. 2089 2678 * 2090 2679 */ 2091 USHORT ScriptConfigSys::SetAddRight(BOOL bAddRight) 2092 { 2680 USHORT ScriptConfigSys::SetAddRight(BOOL p_bAddRight) 2681 { 2682 Message msg; 2683 BSString string = SZ_MODIFIER_ADDRIGHT; 2684 string += "|"; 2093 2685 USHORT usRc = NO_ERROR; 2094 if (bAddRight) 2095 { 2096 if (bUnique) 2686 if (p_bAddRight) 2687 { 2688 if (_bUnique) 2689 { 2097 2690 usRc |= ERR_CONFIGSYS_UNIQUE_SETTED; 2098 if (bAddLeft) 2691 string += SZ_MODIFIER_UNIQUE; 2692 string += "|"; 2693 } 2694 if (_bAddLeft) 2695 { 2099 2696 usRc |= ERR_CONFIGSYS_ADDLEFT_SETTED; 2100 if (bRemoveLine) 2697 string += SZ_MODIFIER_ADDLEFT; 2698 string += "|"; 2699 } 2700 if (_bRemoveLine) 2701 { 2101 2702 usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED; 2102 if (bRemovePart) 2703 string += SZ_MODIFIER_REMOVELINE; 2704 string += "|"; 2705 } 2706 if (_bRemovePart) 2707 { 2103 2708 usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED; 2709 string += SZ_MODIFIER_REMOVEPART; 2710 string += "|"; 2711 } 2104 2712 } 2105 2713 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); 2106 2719 return usRc; 2107 2108 this->bAddRight = bAddRight; 2720 } 2721 2722 this->_bAddRight = p_bAddRight; 2109 2723 2110 2724 return usRc; … … 2112 2726 2113 2727 2114 2115 2116 2117 /**************************************************************************** 2118 *@@ScriptConfigSys::SetAddLeft 2728 /* 2729 *@@SetAddLeft: 2119 2730 * This function sets addleft state. Returns error code if error occurred. 2120 * 2121 */ 2122 USHORT ScriptConfigSys::SetAddLeft(BOOL bAddLeft) 2123 { 2731 */ 2732 USHORT ScriptConfigSys::SetAddLeft(BOOL p_bAddLeft) 2733 { 2734 Message msg; 2735 BSString string = SZ_MODIFIER_ADDLEFT; 2736 string += "|"; 2124 2737 USHORT usRc = NO_ERROR; 2125 if (bAddLeft) 2126 { 2127 if (bUnique) 2738 if (p_bAddLeft) 2739 { 2740 if (_bUnique) 2741 { 2128 2742 usRc |= ERR_CONFIGSYS_UNIQUE_SETTED; 2129 if (bAddRight) 2743 string += SZ_MODIFIER_UNIQUE; 2744 string += "|"; 2745 } 2746 if (_bAddRight) 2747 { 2130 2748 usRc |= ERR_CONFIGSYS_ADDRIGHT_SETTED; 2131 if (bRemoveLine) 2749 string += SZ_MODIFIER_ADDRIGHT; 2750 string += "|"; 2751 } 2752 if (_bRemoveLine) 2753 { 2132 2754 usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED; 2133 if (bRemovePart) 2755 string += SZ_MODIFIER_REMOVELINE; 2756 string += "|"; 2757 } 2758 if (_bRemovePart) 2759 { 2134 2760 usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED; 2761 string += SZ_MODIFIER_REMOVEPART; 2762 string += "|"; 2763 } 2135 2764 } 2136 2765 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); 2137 2771 return usRc; 2138 2139 this->bAddLeft = bAddLeft; 2772 } 2773 2774 this->_bAddLeft = p_bAddLeft; 2140 2775 2141 2776 return usRc; 2142 2777 } 2143 2778 2144 2145 2146 /**************************************************************************** 2147 *@@ScriptConfigSys::SetAddAfter 2779 /* 2780 *@@SetAddAfter: 2148 2781 * This function sets addafter state. Returns error code if error occurred. 2149 * 2150 */ 2151 USHORT ScriptConfigSys::SetAddAfter(BOOL bAddAfter) 2152 { 2782 */ 2783 USHORT ScriptConfigSys::SetAddAfter(BOOL p_bAddAfter) 2784 { 2785 Message msg; 2786 BSString string = SZ_MODIFIER_ADDAFTER; 2787 string += "|"; 2153 2788 USHORT usRc = NO_ERROR; 2154 if (bAddAfter) 2155 { 2156 if (bRemoveLine) 2789 if (p_bAddAfter) 2790 { 2791 if (_bRemoveLine) 2792 { 2157 2793 usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED; 2158 if (bRemovePart) 2794 string += SZ_MODIFIER_REMOVELINE; 2795 string += "|"; 2796 } 2797 if (_bRemovePart) 2798 { 2159 2799 usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED; 2800 string += SZ_MODIFIER_REMOVEPART; 2801 string += "|"; 2802 } 2160 2803 } 2161 2804 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); 2162 2810 return usRc; 2163 2164 this->bAddAfter = bAddAfter; 2811 } 2812 2813 this->_bAddAfter = p_bAddAfter; 2165 2814 2166 2815 return usRc; … … 2168 2817 2169 2818 2170 2171 2172 /**************************************************************************** 2173 *@@ScriptConfigSys::SetAddTop 2819 /* 2820 *@@SetAddTop: 2174 2821 * This function sets addtop state. Returns error code if error occurred. 2175 2822 * 2176 2823 */ 2177 USHORT ScriptConfigSys::SetAddTop(BOOL bAddTop) 2178 { 2824 USHORT ScriptConfigSys::SetAddTop(BOOL p_bAddTop) 2825 { 2826 Message msg; 2827 BSString string = SZ_MODIFIER_ADDTOP; 2828 string += "|"; 2179 2829 USHORT usRc = NO_ERROR; 2180 if (bAddTop) 2181 { 2182 if (bRemoveLine) 2830 if (p_bAddTop) 2831 { 2832 if (_bRemoveLine) 2833 { 2183 2834 usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED; 2184 if (bRemovePart) 2835 string += SZ_MODIFIER_REMOVELINE; 2836 string += "|"; 2837 } 2838 if (_bRemovePart) 2839 { 2185 2840 usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED; 2841 string += SZ_MODIFIER_REMOVEPART; 2842 string += "|"; 2843 } 2186 2844 } 2187 2845 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); 2188 2851 return usRc; 2189 2190 this->bAddTop = bAddTop; 2852 } 2853 2854 this->_bAddTop = p_bAddTop; 2191 2855 2192 2856 return usRc; … … 2194 2858 2195 2859 2196 2197 2198 /**************************************************************************** 2199 *@@ScriptConfigSys::SetAddBefore 2860 /* 2861 *@@SetAddBefore: 2200 2862 * This function sets addbefore state. Returns error code if error occurred. 2201 * 2202 */ 2203 USHORT ScriptConfigSys::SetAddBefore(BOOL bAddBefore) 2204 { 2863 */ 2864 USHORT ScriptConfigSys::SetAddBefore(BOOL p_bAddBefore) 2865 { 2866 Message msg; 2867 BSString string = SZ_MODIFIER_ADDBEFORE; 2868 string += "|"; 2205 2869 USHORT usRc = NO_ERROR; 2206 if (bAddBefore) 2207 { 2208 if (bRemoveLine) 2870 if (p_bAddBefore) 2871 { 2872 if (_bRemoveLine) 2873 { 2209 2874 usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED; 2210 if (bRemovePart) 2875 string += SZ_MODIFIER_REMOVELINE; 2876 string += "|"; 2877 } 2878 if (_bRemovePart) 2879 { 2211 2880 usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED; 2881 string += SZ_MODIFIER_REMOVEPART; 2882 string += "|"; 2883 } 2212 2884 } 2213 2885 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); 2214 2891 return usRc; 2215 2216 this->bAddBefore = bAddBefore; 2892 } 2893 2894 this->_bAddBefore = p_bAddBefore; 2217 2895 2218 2896 return usRc; … … 2220 2898 2221 2899 2222 2223 /**************************************************************************** 2224 *@@ScriptConfigSys::SetRemoveLine 2900 /* 2901 *@@SetRemoveLine: 2225 2902 * This function sets removeline state. Returns error code if error occurred. 2226 * 2227 */ 2228 USHORT ScriptConfigSys::SetRemoveLine(BOOL bRemoveLine) 2229 { 2903 */ 2904 USHORT ScriptConfigSys::SetRemoveLine(BOOL p_bRemoveLine) 2905 { 2906 Message msg; 2907 BSString string = SZ_MODIFIER_REMOVELINE; 2908 string += "|"; 2230 2909 USHORT usRc = NO_ERROR; 2231 if (bRemoveLine) 2232 { 2233 if (bRemovePart) 2910 if (p_bRemoveLine) 2911 { 2912 if (_bRemovePart) 2913 { 2234 2914 usRc |= ERR_CONFIGSYS_REMOVEPART_SETTED; 2235 if (bUnique) 2915 string += SZ_MODIFIER_REMOVEPART; 2916 string += "|"; 2917 } 2918 if (_bUnique) 2919 { 2236 2920 usRc |= ERR_CONFIGSYS_UNIQUE_SETTED; 2237 if (bAddRight) 2921 string += SZ_MODIFIER_UNIQUE; 2922 string += "|"; 2923 } 2924 if (_bAddRight) 2925 { 2238 2926 usRc |= ERR_CONFIGSYS_ADDRIGHT_SETTED; 2239 if (bAddLeft) 2927 string += SZ_MODIFIER_ADDRIGHT; 2928 string += "|"; 2929 } 2930 if (_bAddLeft) 2931 { 2240 2932 usRc |= ERR_CONFIGSYS_ADDLEFT_SETTED; 2933 string += SZ_MODIFIER_ADDLEFT; 2934 string += "|"; 2935 } 2241 2936 } 2242 2937 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); 2243 2943 return usRc; 2244 2245 this->bRemoveLine = bRemoveLine; 2944 } 2945 2946 this->_bRemoveLine = p_bRemoveLine; 2246 2947 2247 2948 return usRc; … … 2249 2950 2250 2951 2251 2252 /**************************************************************************** 2952 /* 2253 2953 *@@ScriptConfigSys::SetRemovePart 2254 2954 * This function sets removepart state. Returns error code if error occurred. 2255 * 2256 */ 2257 USHORT ScriptConfigSys::SetRemovePart(BOOL bRemovePart) 2258 { 2955 */ 2956 USHORT ScriptConfigSys::SetRemovePart(BOOL p_bRemovePart) 2957 { 2958 Message msg; 2959 BSString string = SZ_MODIFIER_REMOVEPART; 2960 string += "|"; 2259 2961 USHORT usRc = NO_ERROR; 2260 if (bRemovePart) 2261 { 2262 if (bRemoveLine) 2962 if (p_bRemovePart) 2963 { 2964 if (_bRemoveLine) 2965 { 2263 2966 usRc |= ERR_CONFIGSYS_REMOVELINE_SETTED; 2264 if (bUnique) 2967 string += SZ_MODIFIER_REMOVELINE; 2968 string += "|"; 2969 } 2970 if (_bUnique) 2971 { 2265 2972 usRc |= ERR_CONFIGSYS_UNIQUE_SETTED; 2266 if (bAddRight) 2973 string += SZ_MODIFIER_UNIQUE; 2974 string += "|"; 2975 } 2976 if (_bAddRight) 2977 { 2267 2978 usRc |= ERR_CONFIGSYS_ADDRIGHT_SETTED; 2268 if (bAddLeft) 2979 string += SZ_MODIFIER_ADDRIGHT; 2980 string += "|"; 2981 } 2982 if (_bAddLeft) 2983 { 2269 2984 usRc |= ERR_CONFIGSYS_ADDLEFT_SETTED; 2985 string += SZ_MODIFIER_ADDLEFT; 2986 string += "|"; 2987 } 2270 2988 } 2271 2989 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); 2272 2995 return usRc; 2273 2274 this->bRemovePart = bRemovePart; 2996 } 2997 2998 this->_bRemovePart = p_bRemovePart; 2275 2999 2276 3000 return usRc; … … 2278 3002 2279 3003 2280 2281 2282 /**************************************************************************** 2283 *@@ScriptConfigSys::SetSearchString 3004 /* 3005 *@@SetSearchString: 2284 3006 * This function sets search string. 2285 3007 */ 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 3008 USHORT 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: 2296 3029 * This function sets statement string. 2297 3030 */ 2298 3031 USHORT ScriptConfigSys::SetConfigSys(CONFIGSYSDATA configSys) 2299 3032 { 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; 2304 3039 SetUnique(FALSE); 2305 3040 SetAddRight(FALSE); … … 2327 3062 if (configSys.usModifiers & MODIFIER_REMOVEPART) 2328 3063 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: 2347 3070 * Returns const pointer to statement string. 2348 3071 */ 2349 3072 const PSZ ScriptConfigSys::ReturnStatement() 2350 3073 { 2351 return szStatement; 2352 } 2353 2354 2355 2356 2357 /*************************************************************************** 2358 *@@ ScriptConfigSys::ReturnUnique 3074 return _szStatement; 3075 } 3076 3077 3078 /* 3079 *@@ReturnUnique: 2359 3080 * Returns the state of the unique modifier. 2360 3081 */ 2361 3082 BOOL ScriptConfigSys::ReturnUnique() 2362 3083 { 2363 return bUnique; 2364 } 2365 2366 2367 2368 2369 /*************************************************************************** 2370 *@@ ScriptConfigSys::ReturnAddRight 3084 return _bUnique; 3085 } 3086 3087 3088 /* 3089 *@@ReturnAddRight: 2371 3090 * Returns the state of the addright modifier. 2372 3091 */ 2373 3092 BOOL ScriptConfigSys::ReturnAddRight() 2374 3093 { 2375 return bAddRight; 2376 } 2377 2378 2379 2380 2381 /*************************************************************************** 2382 *@@ ScriptConfigSys::ReturnAddLeft 3094 return _bAddRight; 3095 } 3096 3097 3098 /* 3099 *@@ReturnAddLeft: 2383 3100 * Returns the state of the addleft modifier. 2384 3101 */ 2385 3102 BOOL ScriptConfigSys::ReturnAddLeft() 2386 3103 { 2387 return bAddLeft;2388 } 2389 2390 2391 2392 /* **************************************************************************2393 *@@ ScriptConfigSys::ReturnAddAfter3104 return _bAddLeft; 3105 } 3106 3107 3108 3109 /* 3110 *@@ReturnAddAfter: 2394 3111 * Returns the state of the addafter modifier. 2395 3112 */ 2396 3113 BOOL ScriptConfigSys::ReturnAddAfter() 2397 3114 { 2398 return bAddAfter; 2399 } 2400 2401 2402 2403 /*************************************************************************** 2404 *@@ ScriptConfigSys::ReturnAddTop 3115 return _bAddAfter; 3116 } 3117 3118 3119 /* 3120 *@@ReturnAddTop: 2405 3121 * Returns the state of the addtop modifier. 2406 3122 */ 2407 3123 BOOL ScriptConfigSys::ReturnAddTop() 2408 3124 { 2409 return bAddTop; 2410 } 2411 2412 2413 2414 2415 /*************************************************************************** 2416 *@@ ScriptConfigSys::ReturnAddBefore 3125 return _bAddTop; 3126 } 3127 3128 3129 /* 3130 *@@ReturnAddBefore: 2417 3131 * Returns the state of the addbefore modifier. 2418 3132 */ 2419 3133 BOOL ScriptConfigSys::ReturnAddBefore() 2420 3134 { 2421 return bAddBefore;2422 } 2423 2424 2425 2426 2427 /* **************************************************************************2428 *@@ ScriptConfigSys::ReturnRemoveLine3135 return _bAddBefore; 3136 } 3137 3138 3139 3140 3141 /* 3142 *@@ReturnRemoveLine: 2429 3143 * Returns the state of the removeline modifier. 2430 3144 */ 2431 3145 BOOL ScriptConfigSys::ReturnRemoveLine() 2432 3146 { 2433 return bRemoveLine;2434 } 2435 2436 2437 2438 2439 /* **************************************************************************2440 *@@ ScriptConfigSys::ReturnRemovePart3147 return _bRemoveLine; 3148 } 3149 3150 3151 3152 3153 /* 3154 *@@ReturnRemovePart: 2441 3155 * Returns the state of the removepart modifier. 2442 3156 */ 2443 3157 BOOL ScriptConfigSys::ReturnRemovePart() 2444 3158 { 2445 return bRemovePart;2446 } 2447 2448 2449 2450 /* **************************************************************************2451 *@@ ScriptConfigSys::ReturnSearchString3159 return _bRemovePart; 3160 } 3161 3162 3163 3164 /* 3165 *@@ReturnSearchString: 2452 3166 * Returns const pointer to search string string. 2453 3167 */ 2454 3168 const PSZ ScriptConfigSys::ReturnSearchString() 2455 3169 { 2456 return szSearchString;2457 } 2458 2459 2460 2461 2462 /* ***************************************************************************2463 *@@ ScriptConfigSys::ReturnConfigSys3170 return _szSearchString; 3171 } 3172 3173 3174 3175 3176 /* 3177 *@@ReturnConfigSys: 2464 3178 * This function returns statement string. 2465 3179 */ … … 2467 3181 { 2468 3182 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) 2473 3187 configSys.usModifiers |= MODIFIER_UNIQUE; 2474 if ( bAddRight)3188 if (_bAddRight) 2475 3189 configSys.usModifiers |= MODIFIER_ADDRIGHT; 2476 if ( bAddLeft)3190 if (_bAddLeft) 2477 3191 configSys.usModifiers |= MODIFIER_ADDLEFT; 2478 if ( bAddAfter)3192 if (_bAddAfter) 2479 3193 configSys.usModifiers |= MODIFIER_ADDAFTER; 2480 if ( bAddBefore)3194 if (_bAddBefore) 2481 3195 configSys.usModifiers |= MODIFIER_ADDBEFORE; 2482 if ( bAddTop)3196 if (_bAddTop) 2483 3197 configSys.usModifiers |= MODIFIER_ADDTOP; 2484 if ( bRemoveLine)3198 if (_bRemoveLine) 2485 3199 configSys.usModifiers |= MODIFIER_REMOVELINE; 2486 if ( bRemovePart)3200 if (_bRemovePart) 2487 3201 configSys.usModifiers |= MODIFIER_REMOVEPART; 3202 2488 3203 return configSys; 2489 3204 } 2490 3205 2491 3206 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: 2506 3209 * Returns pointer to script text. 2507 3210 */ 2508 PSZ ScriptConfigSys::MakeScriptText(BOOL bAttribute)3211 PSZ ScriptConfigSys::MakeScriptText(BOOL p_bAttribute) 2509 3212 { 2510 3213 ULONG ulTextLength = 0; 2511 XSTRING strScriptText; 2512 xstrInit(&strScriptText, 0); 3214 XSTRING xstrScriptText; 2513 3215 PSZ pszFirstModifier = NULL; 2514 3216 PSZ pszSecondModifier = NULL; 2515 3217 USHORT ulSpaces = 0; 2516 3218 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) 2521 3224 { 2522 3225 ulTextLength += strlen(SZ_MODIFIER_UNIQUE); … … 2524 3227 pszFirstModifier = SZ_MODIFIER_UNIQUE; 2525 3228 } 2526 if ( bAddRight)3229 if (_bAddRight) 2527 3230 { 2528 3231 ulTextLength += strlen(SZ_MODIFIER_ADDRIGHT); … … 2530 3233 pszFirstModifier = SZ_MODIFIER_ADDRIGHT; 2531 3234 } 2532 if ( bAddLeft)3235 if (_bAddLeft) 2533 3236 { 2534 3237 ulTextLength += strlen(SZ_MODIFIER_ADDLEFT); … … 2536 3239 pszFirstModifier = SZ_MODIFIER_ADDLEFT; 2537 3240 } 2538 if ( bAddTop)3241 if (_bAddTop) 2539 3242 { 2540 3243 ulTextLength += strlen(SZ_MODIFIER_ADDTOP); … … 2545 3248 pszFirstModifier = SZ_MODIFIER_ADDTOP; 2546 3249 } 2547 if ( bAddAfter)3250 if (_bAddAfter) 2548 3251 { 2549 3252 ulTextLength += strlen(SZ_MODIFIER_ADDAFTER); 2550 3253 ulSpaces += 3; 2551 ulTextLength += strlen( szSearchString);3254 ulTextLength += strlen(_szSearchString); 2552 3255 if (pszFirstModifier) 2553 3256 pszSecondModifier = SZ_MODIFIER_ADDAFTER; … … 2555 3258 pszFirstModifier = SZ_MODIFIER_ADDAFTER; 2556 3259 } 2557 if ( bAddBefore)3260 if (_bAddBefore) 2558 3261 { 2559 3262 ulTextLength += strlen(SZ_MODIFIER_ADDBEFORE); 2560 3263 ulSpaces += 3; 2561 ulTextLength = strlen( szSearchString);3264 ulTextLength = strlen(_szSearchString); 2562 3265 if (pszFirstModifier) 2563 3266 pszSecondModifier = SZ_MODIFIER_ADDBEFORE; … … 2565 3268 pszFirstModifier = SZ_MODIFIER_ADDBEFORE; 2566 3269 } 2567 if ( bRemoveLine)3270 if (_bRemoveLine) 2568 3271 { 2569 3272 ulTextLength += strlen(SZ_MODIFIER_REMOVELINE); … … 2571 3274 pszFirstModifier = SZ_MODIFIER_REMOVELINE; 2572 3275 } 2573 if ( bRemovePart)3276 if (_bRemovePart) 2574 3277 { 2575 3278 ulTextLength += strlen(SZ_MODIFIER_REMOVEPART); … … 2578 3281 } 2579 3282 2580 if ( bAttribute)3283 if (p_bAttribute) 2581 3284 ulTextLength += strlen(SZ_ATTRIBUTE_CONFIGSYS) + 3; 2582 3285 2583 //pszScriptText = new CHAR[ulTextLength + ulSpaces + 1];2584 //*pszScriptText = '\0';2585 3286 szTemp[0] = '\0'; 2586 3287 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); 2589 3290 else 2590 sprintf(szTemp, "%s", szStatement);2591 xstrcat(& strScriptText, szTemp, 0);3291 sprintf(szTemp, "%s", _szStatement); 3292 xstrcat(&xstrScriptText, szTemp, 0); 2592 3293 2593 3294 if (pszFirstModifier) 2594 3295 { 2595 xstrcat(& strScriptText, " | ", 0);2596 xstrcat(& strScriptText, pszFirstModifier, 0);3296 xstrcat(&xstrScriptText, " | ", 0); 3297 xstrcat(&xstrScriptText, pszFirstModifier, 0); 2597 3298 } 2598 3299 if (pszSecondModifier) 2599 3300 { 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 /* 2618 3319 *@@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 */ 3322 PSZ ScriptConfigSys::BuildFromText(PSZ p_pszScriptText, 3323 ULONG p_ulLineNumber) 3324 { 3325 Message msg; 3326 BSString string; 2630 3327 PSZ pszTemp = NULL, pszTemp2 = NULL, pszModifiers = NULL; 2631 3328 PSZ pszAttr = NULL; … … 2637 3334 2638 3335 // 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(p szScriptText, 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); 2653 3350 2654 3351 if (!pszAttr) 2655 3352 { 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); 2663 3357 return NULL; 2664 3358 } … … 2702 3396 else 2703 3397 { 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); 2705 3404 } 2706 3405 } … … 2716 3415 else 2717 3416 { 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); 2719 3423 } 2720 3424 } … … 2730 3434 else 2731 3435 { 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); 2733 3442 } 2734 3443 } … … 2744 3453 else 2745 3454 { 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); 2747 3461 } 2748 3462 } … … 2757 3471 else 2758 3472 { 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); 2760 3479 } 2761 3480 } … … 2774 3493 else 2775 3494 { 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); 2777 3501 } 2778 3502 } … … 2791 3515 else 2792 3516 { 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); 2794 3523 } 2795 3524 } … … 2798 3527 ulAttrLen = strlen(pszAttr); 2799 3528 delete [] pszAttr; 2800 return p szScriptText + ulOffset + ulAttrLen + 1;3529 return p_pszScriptText + ulOffset + ulAttrLen + 1; 2801 3530 } 2802 3531 … … 2807 3536 /**************************************************************************** 2808 3537 **************************************************************************** 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 2823 3554 ***************************************************************************/ 2824 3555 2825 3556 2826 /* **************************************************************************2827 *@@ ScriptRegisterClass::ScriptRegisterClass3557 /* 3558 *@@ScriptRegisterClass: 2828 3559 * Constructor for ScriptRegisterClass class. Initializes object by setting 2829 3560 * strings to zero and sets index number too. 2830 3561 */ 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 3562 ScriptRegisterClass::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 */ 3575 ScriptRegisterClass::~ScriptRegisterClass() 3576 { 3577 *_szClassName = '\0'; 3578 *_szDLLPath = '\0'; 3579 } 3580 3581 3582 /* 3583 *@@SetClassName: 2854 3584 * Sets class name string text. 2855 3585 */ 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 3586 USHORT 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: 2867 3606 * Sets DLL path string text. 2868 3607 */ 2869 void ScriptRegisterClass::SetDLLPath(const PSZ pszDLLPath) 2870 { 2871 if (strlen(szDLLPath) < CCHMAXPATH) 2872 strcpy(this->szDLLPath, pszDLLPath); 2873 } 2874 2875 2876 2877 2878 /*************************************************************************** 3608 USHORT 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 /* 2879 3627 *@@ ScriptRegisterClass::SetRegisterClass 2880 3628 */ 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 3629 USHORT 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: 2905 3644 * Returns const pointer to class name string. 2906 3645 */ 2907 3646 const PSZ ScriptRegisterClass::ReturnClassName() 2908 3647 { 2909 return szClassName; 2910 } 2911 2912 2913 2914 2915 /*************************************************************************** 2916 *@@ ScriptRegisterClass::ReturnDLLPath 3648 return _szClassName; 3649 } 3650 3651 3652 /* 3653 *@@ReturnDLLPath: 2917 3654 * Returns const pointer to DLL path string. 2918 3655 */ 2919 3656 const PSZ ScriptRegisterClass::ReturnDLLPath() 2920 3657 { 2921 return szDLLPath; 2922 } 2923 2924 2925 2926 /*************************************************************************** 2927 *@@ ScriptRegisterClass::ReturnRegisterClass 3658 return _szDLLPath; 3659 } 3660 3661 3662 /* 3663 *@@ReturnRegisterClass: 2928 3664 */ 2929 3665 REGISTERCLASSDATA ScriptRegisterClass::ReturnRegisterClass() 2930 3666 { 2931 3667 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); 2934 3670 return registerClass; 2935 3671 } 2936 3672 2937 3673 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: 2953 3676 * Returns pointer to script text. 2954 3677 */ 2955 PSZ ScriptRegisterClass::MakeScriptText(BOOL bAttribute)3678 PSZ ScriptRegisterClass::MakeScriptText(BOOL p_bAttribute) 2956 3679 { 2957 3680 ULONG ulTextLength = 0; 2958 3681 PSZ pszScriptText = NULL; 2959 3682 2960 ulTextLength = strlen( szClassName) + strlen(szDLLPath);3683 ulTextLength = strlen(_szClassName) + strlen(_szDLLPath); 2961 3684 ulTextLength += 3; 2962 3685 2963 if ( bAttribute)3686 if (p_bAttribute) 2964 3687 ulTextLength += strlen(SZ_ATTRIBUTE_REGISTERCLASS) + 3; 2965 3688 … … 2967 3690 *pszScriptText = '\0'; 2968 3691 2969 if ( bAttribute)3692 if (p_bAttribute) 2970 3693 sprintf(pszScriptText, "%s=\"%s|%s\"", SZ_ATTRIBUTE_REGISTERCLASS, 2971 szClassName,szDLLPath);3694 _szClassName, _szDLLPath); 2972 3695 else 2973 sprintf(pszScriptText, "%s|%s", szClassName,szDLLPath);3696 sprintf(pszScriptText, "%s|%s", _szClassName, _szDLLPath); 2974 3697 2975 3698 return pszScriptText; … … 2977 3700 2978 3701 2979 /* **************************************************************************2980 *@@ ScriptRegisterClass::BuildFromText3702 /* 3703 *@@BuildFromText: 2981 3704 * 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 */ 3707 PSZ ScriptRegisterClass::BuildFromText(PSZ p_pszScriptText, 3708 ULONG p_ulLineNumber) 3709 { 3710 Message msg; 2992 3711 PSZ pszAttr = NULL; 2993 3712 PSZ pszTemp = NULL; … … 2997 3716 ULONG ulAttrLen = 0; 2998 3717 2999 pszAttr = strhGetTextAttr(p szScriptText, SZ_ATTRIBUTE_REGISTERCLASS,3718 pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_REGISTERCLASS, 3000 3719 &ulOffset); 3001 3720 3002 3721 if (!pszAttr) 3003 3722 { 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 */ 3819 ScriptReplaceClass::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 */ 3831 ScriptReplaceClass::~ScriptReplaceClass() 3832 { 3833 *_szClassName = '\0'; 3834 *_szNewClassName = '\0'; 3835 } 3836 3837 3838 /* 3839 *@@SetClassName: 3840 * Sets class name string text. 3841 */ 3842 USHORT 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 */ 3865 USHORT 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 */ 3887 USHORT 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 */ 3902 const PSZ ScriptReplaceClass::ReturnClassName() 3903 { 3904 return _szClassName; 3905 } 3906 3907 3908 /* 3909 *@@ ScriptReplaceClass::ReturnNewClassName 3910 * Returns const pointer to new class name string. 3911 */ 3912 const PSZ ScriptReplaceClass::ReturnNewClassName() 3913 { 3914 return _szNewClassName; 3915 } 3916 3917 3918 3919 /* 3920 *@@ReturnReplaceClass: 3921 */ 3922 REPLACECLASSDATA 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 */ 3935 PSZ 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 */ 3966 PSZ 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); 3011 3986 return NULL; 3012 3987 } … … 3027 4002 while ((*pszTemp2 == ' ') && (*pszTemp2)) 3028 4003 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 } 3030 4013 } 3031 4014 else 3032 4015 { 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); 3034 4020 } 3035 4021 3036 4022 ulAttrLen = strlen(pszAttr); 3037 4023 delete [] pszAttr; 3038 return p szScriptText + ulOffset + ulAttrLen + 1;4024 return p_pszScriptText + ulOffset + ulAttrLen + 1; 3039 4025 } 3040 4026 … … 3045 4031 /**************************************************************************** 3046 4032 **************************************************************************** 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 3061 4055 ***************************************************************************/ 3062 4056 3063 4057 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: 3309 4060 * Constructor for ScriptCreateObject class. Initializes object by setting 3310 4061 * strings to zero and sets index number. 3311 4062 */ 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 4063 ScriptCreateObject::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: 3328 4077 * Destructor for ScriptCreateObject class. 3329 4078 */ 3330 ScriptCreateObject::~ScriptCreateObject() {} 3331 3332 3333 3334 3335 /*************************************************************************** 3336 *@@ ScriptCreateObject::SetClassName 4079 ScriptCreateObject::~ScriptCreateObject() 4080 { 4081 *_szClassName = '\0'; 4082 *_szTitle = '\0'; 4083 *_szLocation = '\0'; 4084 *_szConfig = '\0'; 4085 _bReplace = FALSE; 4086 } 4087 4088 4089 /* 4090 *@@SetClassName: 3337 4091 * Sets class name string text. 3338 4092 */ 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 4093 USHORT 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: 3350 4116 * Sets new title string text. 3351 4117 */ 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 4118 USHORT 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: 3362 4139 * Sets new title string text. 3363 4140 */ 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 4141 USHORT 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: 3374 4162 * Sets new config string text. 3375 4163 */ 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 4164 USHORT 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: 3385 4185 * Sets new config string text. 3386 4186 */ 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 4187 USHORT ScriptCreateObject::SetReplace(BOOL p_bReplace) 4188 { 4189 this->_bReplace = p_bReplace; 4190 } 4191 4192 4193 /* 4194 *@@SetCreateObject: 4195 */ 4196 USHORT 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: 3425 4214 * Returns const pointer to class name string. 3426 4215 */ 3427 4216 const PSZ ScriptCreateObject::ReturnClassName() 3428 4217 { 3429 return szClassName; 3430 } 3431 3432 3433 3434 3435 /*************************************************************************** 3436 *@@ ScriptCreateObject::ReturnTitle 4218 return _szClassName; 4219 } 4220 4221 4222 /* 4223 *@@ReturnTitle: 3437 4224 * Returns const pointer to title string. 3438 4225 */ 3439 4226 const PSZ ScriptCreateObject::ReturnTitle() 3440 4227 { 3441 return szTitle; 3442 } 3443 3444 3445 3446 3447 /*************************************************************************** 3448 *@@ ScriptCreateObject::ReturnLocation 4228 return _szTitle; 4229 } 4230 4231 4232 /* 4233 *@@ReturnLocation: 3449 4234 * Returns const pointer to location string. 3450 4235 */ 3451 4236 const PSZ ScriptCreateObject::ReturnLocation() 3452 4237 { 3453 return szLocation; 3454 } 3455 3456 3457 3458 3459 /*************************************************************************** 3460 *@@ ScriptCreateObject::ReturnConfig 4238 return _szLocation; 4239 } 4240 4241 4242 /* 4243 *@@ReturnConfig: 3461 4244 * Returns const pointer to config string. 3462 4245 */ 3463 4246 const PSZ ScriptCreateObject::ReturnConfig() 3464 4247 { 3465 return szConfig; 3466 } 3467 3468 3469 3470 /*************************************************************************** 3471 *@@ ScriptCreateObject::ReturnReplace 4248 return _szConfig; 4249 } 4250 4251 4252 /* 4253 *@@ReturnReplace: 3472 4254 * Returns the state of the replace parameter. 3473 4255 */ 3474 4256 BOOL ScriptCreateObject::ReturnReplace() 3475 4257 { 3476 return bReplace; 3477 } 3478 3479 3480 3481 3482 /*************************************************************************** 3483 *@@ ScriptCreateObject::ReturnCreateObject 4258 return _bReplace; 4259 } 4260 4261 4262 /* 4263 *@@ReturnCreateObject: 3484 4264 */ 3485 4265 CREATEOBJECTDATA ScriptCreateObject::ReturnCreateObject() 3486 4266 { 3487 4267 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; 3493 4273 return createObject; 3494 4274 } 3495 4275 3496 4276 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 /* 3511 4278 *@@ ScriptCreateObject::MakeScriptText 3512 4279 * Returns pointer to script text. 3513 4280 * 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 */ 4283 PSZ ScriptCreateObject::MakeScriptText(BOOL p_bAttribute) 3517 4284 { 3518 4285 ULONG ulTextLength = 0; 3519 4286 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) 3525 4291 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) 3528 4294 { 3529 4295 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, " "); 3532 4299 } 3533 4300 ulTextLength += 3; 3534 4301 3535 if ( bAttribute)4302 if (p_bAttribute) 3536 4303 ulTextLength += strlen(SZ_ATTRIBUTE_CREATEOBJECT) + 3; 3537 4304 … … 3539 4306 *pszScriptText = '\0'; 3540 4307 3541 if ( bAttribute)4308 if (p_bAttribute) 3542 4309 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); 3545 4312 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) 3550 4317 { 3551 4318 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) 3556 4323 strcat(pszScriptText, "\""); 3557 4324 3558 xstrClear(&strReplace); 4325 if (_bReplace) 4326 delete [] pszReplace; 3559 4327 3560 4328 return pszScriptText; … … 3562 4330 3563 4331 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 */ 4336 PSZ ScriptCreateObject::BuildFromText(PSZ p_pszScriptText, 4337 ULONG p_ulLineNumber) 4338 { 4339 Message msg; 3577 4340 PSZ pszTemp = NULL, pszTemp2 = NULL, pszTemp3 = NULL; 3578 4341 PSZ pszAttr = NULL; 3579 4342 ULONG ulOffset = 0; 3580 4343 ULONG ulVersion = 0; 3581 BOOL bError = FALSE;3582 4344 ULONG ulAttrLen = 0; 3583 4345 3584 pszAttr = strhGetTextAttr(p szScriptText, SZ_ATTRIBUTE_CREATEOBJECT,4346 pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_CREATEOBJECT, 3585 4347 &ulOffset); 3586 4348 3587 4349 if (!pszAttr) 3588 4350 { 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); 3596 4355 return NULL; 3597 4356 } … … 3633 4392 } 3634 4393 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 } 3636 4405 } 3637 4406 else // Title error. 3638 4407 { 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); 3647 4412 } 3648 4413 } 3649 4414 else // Class name error. 3650 4415 { 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 } 3662 4421 3663 4422 ulAttrLen = strlen(pszAttr); 3664 4423 delete [] pszAttr; 3665 return p szScriptText + ulOffset + ulAttrLen + 1;4424 return p_pszScriptText + ulOffset + ulAttrLen + 1; 3666 4425 } 3667 4426 … … 3672 4431 /**************************************************************************** 3673 4432 **************************************************************************** 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 3686 4448 ***************************************************************************/ 3687 4449 3688 4450 3689 /* **************************************************************************3690 *@@ ScriptExecute::ScriptExecute4451 /* 4452 *@@ScriptExecute: 3691 4453 * Constructor for ScriptExecute class. Initializes object by setting 3692 4454 * strings to zero and sets index number too. 3693 4455 */ 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 4456 ScriptExecute::ScriptExecute(USHORT p_usIndex) 4457 { 4458 SetIndex(p_usIndex); 4459 *_szExecFileParams = '\0'; 4460 _usContext = 0; 4461 } 4462 4463 4464 /* 4465 *@@~ScriptExecute: 3706 4466 * Destructor for ScriptExecute class. 3707 4467 */ 3708 ScriptExecute::~ScriptExecute() {}3709 3710 3711 3712 3713 /* **************************************************************************3714 *@@ ScriptExecute::SetClassName4468 ScriptExecute::~ScriptExecute() 4469 { 4470 } 4471 4472 4473 /* 4474 *@@SetClassName: 3715 4475 * Sets exec file params string text. 3716 4476 */ 3717 void ScriptExecute::SetExecFileParams(const PSZ pszExecFileParams) 3718 { 3719 if (strlen(pszExecFileParams) < CCHMAXPATH) 3720 strcpy(this->szExecFileParams, pszExecFileParams); 3721 } 3722 3723 3724 /*************************************************************************** 4477 USHORT 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 /* 3725 4497 *@@ ScriptExecute::SetContext 3726 4498 * Sets object's index. 3727 4499 */ 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 4500 USHORT 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 */ 4512 USHORT 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: 3760 4525 * Returns const pointer to szExecFileParams string. 3761 4526 */ 3762 4527 const PSZ ScriptExecute::ReturnExecFileParams() 3763 4528 { 3764 return szExecFileParams;3765 } 3766 3767 3768 /* **************************************************************************3769 *@@ ScriptExecute::ReturnContext4529 return _szExecFileParams; 4530 } 4531 4532 4533 /* 4534 *@@ReturnContext: 3770 4535 * Returns index number. 3771 4536 */ 3772 4537 USHORT ScriptExecute::ReturnContext() 3773 4538 { 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: 3792 4545 */ 3793 4546 EXECUTEDATA ScriptExecute::ReturnExecute() 3794 4547 { 3795 4548 EXECUTEDATA execData; 3796 strcpy(execData.szExecFileParams, this-> szExecFileParams);3797 execData.fusContext = this-> fusContext;4549 strcpy(execData.szExecFileParams, this->_szExecFileParams); 4550 execData.fusContext = this->_usContext; 3798 4551 return execData; 3799 4552 } 3800 4553 3801 4554 3802 3803 3804 /*************************************************************************** 3805 *@@ ScriptExecute::MakeScriptText 4555 /* 4556 *@@MakeScriptText: 3806 4557 * Returns pointer to script text. 3807 4558 */ 3808 PSZ ScriptExecute::MakeScriptText(BOOL bAttribute)4559 PSZ ScriptExecute::MakeScriptText(BOOL p_bAttribute) 3809 4560 { 3810 4561 ULONG ulTextLength = 0; 3811 4562 PSZ pszScriptText = NULL; 3812 XSTRING strTemp; 4563 PSZ pszTemp = NULL; 4564 XSTRING strTemp; 3813 4565 xstrInit(&strTemp, 0); 3814 4566 3815 ulTextLength = strlen( szExecFileParams);3816 3817 if ( fusContext == FLAG_CONFIGSYS)4567 ulTextLength = strlen(_szExecFileParams); 4568 4569 if (_usContext == FLAG_CONFIGSYS) 3818 4570 { 3819 4571 ulTextLength += strlen(SZ_FLAG_CONFIGSYS) + 1; … … 3821 4573 xstrcat(&strTemp, "|", 0); 3822 4574 } 3823 else if ( fusContext == FLAG_REGISTERCLASS)4575 else if (_usContext == FLAG_REGISTERCLASS) 3824 4576 { 3825 4577 ulTextLength += strlen(SZ_FLAG_REGISTERCLASS) + 1; … … 3827 4579 xstrcat(&strTemp, "|", 0); 3828 4580 } 3829 else if ( fusContext == FLAG_CREATEOBJECT)4581 else if (_usContext == FLAG_CREATEOBJECT) 3830 4582 { 3831 4583 ulTextLength += strlen(SZ_FLAG_CREATEOBJECT) + 1; … … 3834 4586 } 3835 4587 3836 if ( bAttribute)4588 if (p_bAttribute) 3837 4589 ulTextLength += strlen(SZ_ATTRIBUTE_EXECUTE) + 3; 3838 4590 … … 3840 4592 *pszScriptText = '\0'; 3841 4593 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); 3846 4598 else 3847 4599 sprintf(pszScriptText, "%s", strTemp.psz); … … 3852 4604 3853 4605 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 */ 4610 PSZ ScriptExecute::BuildFromText(PSZ p_pszScriptText, 4611 ULONG p_ulLineNumber) 4612 { 4613 Message msg; 3868 4614 PSZ pszTemp = NULL; 3869 4615 PSZ pszAttr = NULL; … … 3873 4619 3874 4620 3875 pszAttr = strhGetTextAttr(p szScriptText, SZ_ATTRIBUTE_EXECUTE, &ulOffset);4621 pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_EXECUTE, &ulOffset); 3876 4622 if (pszAttr) 3877 4623 { … … 3890 4636 "\x0d\x0a ()/\\-,.:;|")) 3891 4637 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 } 3892 4645 delete [] pszFlag; 3893 4646 // Take the rest of the attribute. … … 3903 4656 { 3904 4657 this->SetContext(FLAG_NOCONTEXT); 3905 if ( strlen(pszAttr) < CCHMAXPATH)4658 if (pszAttr) 3906 4659 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 } 3907 4667 } 3908 4668 } 3909 4669 else 3910 4670 { 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); 3918 4675 return NULL; 3919 4676 } 3920 4677 ulAttrLen = strlen(pszAttr); 3921 4678 delete [] pszAttr; 3922 return p szScriptText + ulOffset + ulAttrLen + 1;4679 return p_pszScriptText + ulOffset + ulAttrLen + 1; 3923 4680 } 3924 4681 … … 3930 4687 /**************************************************************************** 3931 4688 **************************************************************************** 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 3950 4709 ***************************************************************************/ 3951 4710 3952 4711 3953 /* **************************************************************************3954 *@@ ScriptClearProfile::ScriptClearProfile4712 /* 4713 *@@ScriptClearProfile: 3955 4714 * Constructor for ScriptClearProfile class. Initializes object by setting 3956 4715 * strings to zero and sets index number too. 3957 4716 */ 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 4717 ScriptClearProfile::ScriptClearProfile(USHORT p_usIndex) 4718 { 4719 SetIndex(p_usIndex); 4720 *_szProfileString = '\0'; 4721 *_szApplication = '\0'; 4722 *_szKey = '\0'; 4723 } 4724 4725 4726 /* 4727 *@@~ScriptClearProfile: 3971 4728 * Destructor for ScriptClearProfile class. 3972 4729 */ 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 /*************************************************************************** 4730 ScriptClearProfile::~ScriptClearProfile() 4731 { 4732 } 4733 4734 4735 /* 4736 *@@SetProfileString: 4737 * Sets _szProfileString string text. 4738 */ 4739 USHORT 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 /* 3991 4759 *@@ 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 */ 4762 USHORT 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: 4004 4783 * Sets szKey string text. 4005 4784 */ 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 4785 USHORT 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: 4016 4806 * Sets all string texts. 4017 4807 */ 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 4808 USHORT 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: 4044 4823 * Returns const pointer to szProfileString string. 4045 4824 */ 4046 4825 const PSZ ScriptClearProfile::ReturnProfileString() 4047 4826 { 4048 return szProfileString; 4049 } 4050 4051 4052 4053 /*************************************************************************** 4054 *@@ ScriptClearProfile::ReturnApplication 4827 return _szProfileString; 4828 } 4829 4830 4831 /* 4832 *@@ReturnApplication: 4055 4833 * Returns const pointer to szApplication string. 4056 4834 */ 4057 4835 const PSZ ScriptClearProfile::ReturnApplication() 4058 4836 { 4059 return szApplication; 4060 } 4061 4062 4063 4064 /*************************************************************************** 4065 *@@ ScriptClearProfile::ReturnKey 4837 return _szApplication; 4838 } 4839 4840 4841 /* 4842 *@@ReturnKey: 4066 4843 * Returns const pointer to szKey string. 4067 4844 */ 4068 4845 const PSZ ScriptClearProfile::ReturnKey() 4069 4846 { 4070 return szKey; 4071 } 4072 4073 4074 4075 /*************************************************************************** 4076 *@@ ScriptClearProfile::ReturnProfile 4847 return _szKey; 4848 } 4849 4850 4851 /* 4852 *@@ReturnProfile 4077 4853 * Sets all string texts. 4078 4854 */ … … 4081 4857 PROFILEDATA profile; 4082 4858 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); 4086 4862 4087 4863 return profile; … … 4089 4865 4090 4866 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 */ 4870 PSZ ScriptClearProfile::MakeScriptText(BOOL p_bAttribute) 4109 4871 { 4110 4872 ULONG ulTextLength = 0; 4111 4873 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) 4130 4880 ulTextLength += strlen(SZ_ATTRIBUTE_CLEARPROFILE) + 3; 4131 4881 … … 4133 4883 *pszScriptText = '\0'; 4134 4884 4135 if ( bAttribute)4885 if (p_bAttribute) 4136 4886 sprintf(pszScriptText, "%s=\"%s\\%s\\%s\"", SZ_ATTRIBUTE_CLEARPROFILE, 4137 szProfileString, szApplication,szKey);4887 _szProfileString, _szApplication, _szKey); 4138 4888 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); 4142 4891 4143 4892 return pszScriptText; … … 4145 4894 4146 4895 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 */ 4900 PSZ ScriptClearProfile::BuildFromText(PSZ p_pszScriptText, 4901 ULONG p_ulLineNumber) 4902 { 4903 Message msg; 4160 4904 PSZ pszTemp = NULL; 4161 4905 PSZ pszTemp1 = NULL; … … 4165 4909 4166 4910 4167 pszAttr = strhGetTextAttr(p szScriptText, SZ_ATTRIBUTE_CLEARPROFILE, &ulOffset);4911 pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_CLEARPROFILE, &ulOffset); 4168 4912 if (pszAttr) 4169 4913 { … … 4173 4917 // Get profile string. 4174 4918 pszString = strhSubstr(pszAttr, pszTemp); 4175 if ( strlen(pszString) < CCHMAXPATH)4919 if (pszString) 4176 4920 this->SetProfileString(pszString); 4177 4921 else 4178 4922 { 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); 4186 4927 } 4187 4928 delete [] pszString; … … 4190 4931 { 4191 4932 pszString = strhSubstr(pszTemp + 1, pszTemp1); 4192 if ( strlen(pszString) < MAXPROFILEAPPLICATIONLENGTH)4933 if (pszString) 4193 4934 this->SetApplication(pszString); 4194 4935 else 4195 4936 { 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); 4203 4941 } 4204 4942 delete [] pszString; 4205 4943 4206 if ( strlen(pszTemp1 + 1) < MAXPROFILEKEYLENGTH)4944 if (*(pszTemp1 + 1) != '\0') 4207 4945 this->SetKey(pszTemp1 + 1); 4208 4946 else 4209 4947 { 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); 4217 4952 } 4218 4953 } 4219 4954 else 4220 4955 { 4221 if ( strlen(pszTemp + 1) < MAXPROFILEAPPLICATIONLENGTH)4222 this->Set Key(pszTemp + 1);4956 if (*(pszTemp + 1) != '\0') 4957 this->SetApplication(pszTemp + 1); 4223 4958 else 4224 4959 { 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); 4232 4964 } 4233 4965 } … … 4236 4968 { 4237 4969 // Get profile string. 4238 this->SetProfileString(pszAttr); 4239 if (strlen(pszAttr) < CCHMAXPATH) 4970 if (pszAttr) 4240 4971 this->SetProfileString(pszAttr); 4241 4972 else 4242 4973 { 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); 4250 4978 } 4251 4979 delete [] pszString; … … 4254 4982 else 4255 4983 { 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); 4263 4988 return NULL; 4264 4989 } … … 4266 4991 ulAttrLen = strlen(pszAttr); 4267 4992 delete [] pszAttr; 4268 return p szScriptText + ulOffset + ulAttrLen + 1;4993 return p_pszScriptText + ulOffset + ulAttrLen + 1; 4269 4994 } 4270 4995 … … 4276 5001 ScriptWriteProfile class: 4277 5002 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 4295 5022 ***************************************************************************/ 4296 5023 4297 5024 4298 /* **************************************************************************4299 *@@ ScriptWriteProfile::ScriptWriteProfile5025 /* 5026 *@@ScriptWriteProfile: 4300 5027 * Constructor for ScriptWriteProfile class. Initializes object by setting 4301 5028 * strings to zero and sets index number too. 4302 5029 */ 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 5030 ScriptWriteProfile::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: 4317 5042 * Destructor for ScriptWriteProfile class. 4318 5043 */ 4319 5044 ScriptWriteProfile::~ScriptWriteProfile() 4320 5045 { 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=: 4329 5057 * Assignment operator for ScriptWriteProfile class. 4330 5058 */ 4331 ScriptWriteProfile &ScriptWriteProfile::operator= (const4332 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);5059 ScriptWriteProfile &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()); 4339 5067 return (*this); 4340 5068 } 4341 5069 4342 5070 4343 4344 4345 /*************************************************************************** 4346 *@@ ScriptWriteProfile::SetProfileString 5071 /* 5072 *@@SetProfileString: 4347 5073 * Sets szProfileString string text. 4348 5074 */ 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 5075 USHORT 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: 4359 5097 * Sets szApplication string text. 4360 5098 */ 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 5099 USHORT 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: 4371 5121 * Sets szKey string text. 4372 5122 */ 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 5123 USHORT 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: 4382 5144 * Sets pszString text. 4383 5145 */ 4384 void ScriptWriteProfile::SetString(const PSZ pszString) 4385 { 4386 if (pszString) 4387 this->pszString = strhdup(pszString); 4388 } 4389 4390 4391 4392 /*************************************************************************** 4393 *@@ ScriptWriteProfile::SetProfile 5146 USHORT 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: 4394 5157 * Sets all string texts. 4395 5158 */ 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 5159 USHORT 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: 4422 5174 * Returns const pointer to szProfileString string. 4423 5175 */ 4424 const PSZ ScriptWriteProfile::ReturnProfileString() 4425 { 4426 return szProfileString; 4427 } 4428 4429 4430 4431 /*************************************************************************** 4432 *@@ ScriptWriteProfile::ReturnApplication 5176 const PSZ ScriptWriteProfile::ReturnProfileString() const 5177 { 5178 return (PSZ)_szProfileString; 5179 } 5180 5181 5182 /* 5183 *@@ReturnApplication: 4433 5184 * Returns const pointer to szApplication string. 4434 5185 */ 4435 const PSZ ScriptWriteProfile::ReturnApplication() 4436 { 4437 return szApplication;4438 } 4439 4440 4441 4442 /* **************************************************************************4443 *@@ ScriptWriteProfile::ReturnKey5186 const PSZ ScriptWriteProfile::ReturnApplication() const 5187 { 5188 return (PSZ)_szApplication; 5189 } 5190 5191 5192 5193 /* 5194 *@@ReturnKey: 4444 5195 * Returns const pointer to szKey string. 4445 5196 */ 4446 const PSZ ScriptWriteProfile::ReturnKey() 4447 { 4448 return szKey;4449 } 4450 4451 4452 /* **************************************************************************4453 *@@ ScriptWriteProfile::ReturnString5197 const PSZ ScriptWriteProfile::ReturnKey() const 5198 { 5199 return (PSZ)_szKey; 5200 } 5201 5202 5203 /* 5204 *@@ReturnString: 4454 5205 * Returns const pointer to szProfileString string. 4455 5206 */ 4456 const PSZ ScriptWriteProfile::ReturnString() 4457 { 4458 return pszString;4459 } 4460 4461 4462 /* **************************************************************************5207 const PSZ ScriptWriteProfile::ReturnString() const 5208 { 5209 return _pszString; 5210 } 5211 5212 5213 /* 4463 5214 *@@ ScriptWriteProfile::ReturnProfile 4464 5215 * Sets all string texts. … … 4468 5219 PROFILEDATA profile; 4469 5220 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); 4473 5224 4474 5225 return profile; … … 4476 5227 4477 5228 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 */ 5233 PSZ ScriptWriteProfile::MakeScriptText(BOOL p_bAttribute) 4496 5234 { 4497 5235 ULONG ulTextLength = 0; 4498 5236 PSZ pszScriptText = NULL; 4499 5237 4500 if (! pszString)5238 if (!_pszString) 4501 5239 return FALSE; 4502 5240 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) 4508 5246 ulTextLength += strlen(SZ_ATTRIBUTE_WRITEPROFILE) + 3; 4509 5247 … … 4511 5249 *pszScriptText = '\0'; 4512 5250 4513 if ( bAttribute)5251 if (p_bAttribute) 4514 5252 sprintf(pszScriptText, "%s=\"%s\\%s\\%s|%s\"", SZ_ATTRIBUTE_WRITEPROFILE, 4515 szProfileString, szApplication, szKey,pszString);5253 _szProfileString, _szApplication, _szKey, _pszString); 4516 5254 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); 4519 5257 4520 5258 … … 4523 5261 4524 5262 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 */ 5267 PSZ ScriptWriteProfile::BuildFromText(PSZ p_pszScriptText, 5268 ULONG p_ulLineNumber) 5269 { 5270 Message msg; 4538 5271 PSZ pszTemp = NULL; 4539 5272 PSZ pszTemp1 = NULL; … … 4543 5276 4544 5277 4545 pszAttr = strhGetTextAttr(p szScriptText, SZ_ATTRIBUTE_WRITEPROFILE, &ulOffset);5278 pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_WRITEPROFILE, &ulOffset); 4546 5279 if (pszAttr) 4547 5280 { … … 4551 5284 // Get profile string. 4552 5285 pszString = strhSubstr(pszAttr, pszTemp); 4553 if ( strlen(pszString) < CCHMAXPATH)5286 if (pszString) 4554 5287 this->SetProfileString(pszString); 4555 5288 else 4556 5289 { 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); 4564 5294 } 4565 5295 delete [] pszString; … … 4568 5298 { 4569 5299 pszString = strhSubstr(pszTemp + 1, pszTemp1); 4570 if ( strlen(pszString) < MAXPROFILEAPPLICATIONLENGTH)5300 if (pszString) 4571 5301 this->SetApplication(pszString); 4572 5302 else 4573 5303 { 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); 4581 5308 } 4582 5309 delete [] pszString; … … 4586 5313 { 4587 5314 pszString = strhSubstr(pszTemp + 1, pszTemp1); 4588 if ( strlen(pszString) < MAXPROFILEKEYLENGTH)5315 if (pszString) 4589 5316 this->SetKey(pszString); 4590 5317 else 4591 5318 { 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); 4599 5323 } 4600 5324 delete [] pszString; … … 4607 5331 else 4608 5332 { 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); 4616 5337 } 4617 5338 } 4618 5339 else 4619 5340 { 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); 4627 5345 } 4628 5346 } 4629 5347 else 4630 5348 { 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); 4638 5353 } 4639 5354 } 4640 5355 else 4641 5356 { 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); 4649 5361 return NULL; 4650 5362 } … … 4652 5364 ulAttrLen = strlen(pszAttr); 4653 5365 delete [] pszAttr; 4654 return p szScriptText + ulOffset + ulAttrLen + 1;5366 return p_pszScriptText + ulOffset + ulAttrLen + 1; 4655 5367 } 4656 5368 … … 4661 5373 /**************************************************************************** 4662 5374 **************************************************************************** 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. 4675 5389 ***************************************************************************/ 4676 5390 4677 5391 4678 /* **************************************************************************4679 *@@ ScriptKillProcess::ScriptKillProcess5392 /* 5393 *@@ScriptKillProcess: 4680 5394 * Constructor for ScriptKillProcess class. Initializes szFileName string by 4681 5395 * setting first char to '\0'. 4682 5396 */ 4683 ScriptKillProcess::ScriptKillProcess(USHORT usIndex) 4684 { 4685 *szFileName = '\0'; 4686 this->usIndex = usIndex; 4687 } 4688 4689 4690 4691 /*************************************************************************** 4692 *@@ ScriptKillProcess::~ScriptKillProcess 5397 ScriptKillProcess::ScriptKillProcess(USHORT p_usIndex) 5398 { 5399 *_szFileName = '\0'; 5400 SetIndex(p_usIndex); 5401 } 5402 5403 5404 /* 5405 *@@~ScriptKillProcess: 4693 5406 * destructor for ScriptKillProcess class. Does nothing special. 4694 5407 */ 4695 5408 ScriptKillProcess::~ScriptKillProcess() 4696 5409 { 4697 } 4698 4699 4700 /*************************************************************************** 4701 *@@ ScriptFileName::SetFileName 5410 *_szFileName = '\0'; 5411 } 5412 5413 5414 /* 5415 *@@SetFileName: 4702 5416 * Sets target text. 4703 5417 */ 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 5418 USHORT 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: 4725 5438 * Returns const pointer to file name text. 4726 5439 */ 4727 5440 const PSZ ScriptKillProcess::ReturnFileName() 4728 5441 { 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: 4748 5448 * Returns pointer to script text. 4749 5449 */ 4750 PSZ ScriptKillProcess::MakeScriptText(BOOL bAttribute)5450 PSZ ScriptKillProcess::MakeScriptText(BOOL p_bAttribute) 4751 5451 { 4752 5452 ULONG ulTextLength = 0; 4753 5453 XSTRING strScriptText; 4754 5454 xstrInit(&strScriptText, 0); 4755 ulTextLength = strlen( szFileName);5455 ulTextLength = strlen(_szFileName); 4756 5456 CHAR szTemp[1024]; 4757 5457 *szTemp = '\0'; 4758 5458 4759 if ( bAttribute)5459 if (p_bAttribute) 4760 5460 // Length of the attribute, =, " and " 4761 5461 ulTextLength += strlen(SZ_ATTRIBUTE_KILLPROCESS) + 3; 4762 5462 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); 4765 5465 else 4766 sprintf(szTemp, "%s\"", szFileName);5466 sprintf(szTemp, "%s\"", _szFileName); 4767 5467 4768 5468 xstrcat(&strScriptText, szTemp, 0); … … 4772 5472 4773 5473 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 */ 5478 PSZ ScriptKillProcess::BuildFromText(PSZ p_pszScriptText, 5479 ULONG p_ulLineNumber) 5480 { 5481 Message msg; 4787 5482 PSZ pszTemp = NULL; 4788 5483 PSZ pszAttr = NULL; … … 4791 5486 4792 5487 4793 pszAttr = strhGetTextAttr(p szScriptText, SZ_ATTRIBUTE_KILLPROCESS, &ulOffset);5488 pszAttr = strhGetTextAttr(p_pszScriptText, SZ_ATTRIBUTE_KILLPROCESS, &ulOffset); 4794 5489 if (pszAttr) 4795 5490 this->SetFileName(pszAttr); 4796 5491 else 4797 5492 { 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); 4805 5497 return NULL; 4806 5498 } … … 4808 5500 ulAttrLen = strlen(pszAttr); 4809 5501 delete [] pszAttr; 4810 return p szScriptText + ulOffset + ulAttrLen + 1;5502 return p_pszScriptText + ulOffset + ulAttrLen + 1; 4811 5503 } 4812 5504 … … 4817 5509 /**************************************************************************** 4818 5510 **************************************************************************** 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 4829 5523 ***************************************************************************/ 4830 5524 4831 5525 4832 /* **************************************************************************4833 *@@ ScriptPackage::ScriptPackage5526 /* 5527 *@@ScriptPackage: 4834 5528 * Constructor for ScriptPackage class. 4835 5529 */ 4836 ScriptPackage::ScriptPackage(USHORT usIndex, BOOLbAllowIndexArrangement)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::ScriptPackage5530 ScriptPackage::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: 4871 5565 * Copy constructor for ScriptPackage class. 4872 5566 */ 4873 ScriptPackage::ScriptPackage(ScriptPackage &p ackage)5567 ScriptPackage::ScriptPackage(ScriptPackage &p_package) 4874 5568 { 4875 5569 USHORT usIndex; 4876 5570 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; 4901 5595 4902 5596 // Copy pszDescription. 4903 if (p ackage.pszDescription)4904 pszDescription = strdup(package.pszDescription);5597 if (p_package._pszDescription) 5598 _pszDescription = strdup(p_package._pszDescription); 4905 5599 4906 5600 // 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]; 4911 5605 4912 5606 // 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]; 4917 5611 4918 5612 // 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]; 4923 5617 4924 5618 // 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]; 4929 5623 4930 5624 // 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]; 4935 5629 4936 5630 // 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]; 4941 5635 4942 5636 // 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]; 4947 5641 4948 5642 // 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]; 4953 5647 4954 5648 // 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=: 4966 5660 * 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 */ 5664 ScriptPackage &ScriptPackage::operator=(ScriptPackage &p_package) 4969 5665 { 4970 5666 USHORT usIndex; 4971 ScriptIndex PckIndex = p ackage.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()); 4984 5680 4985 5681 // Copy pszDescription. 4986 if (p ackage.pszDescription)4987 pszDescription = strdup(package.pszDescription);5682 if (p_package._pszDescription) 5683 _pszDescription = strdup(p_package._pszDescription); 4988 5684 4989 5685 // Copy requires objects. 4990 if (p ackage.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]; 4996 5692 } 4997 5693 // Copy configsys objects. 4998 if (p ackage.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]; 5004 5700 } 5005 5701 // Copy registerclass objects. 5006 if (p ackage.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]; 5012 5708 } 5013 5709 // Copy replaceclass objects. 5014 if (p ackage.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]; 5020 5716 } 5021 5717 // Copy createobject objects. 5022 if (p ackage.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]; 5028 5724 } 5029 5725 // Copy execute objects. 5030 if (p ackage.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]; 5036 5732 } 5037 5733 // Copy profile objects. 5038 if (p ackage.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]; 5044 5740 } 5045 5741 // Copy writeprofile objects. 5046 if (p ackage.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]; 5052 5748 } 5053 5749 // Copy killprocess objects. 5054 if (p ackage.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]; 5060 5756 } 5061 5757 … … 5066 5762 5067 5763 5068 /* **************************************************************************5069 *@@ ScriptPackage::~ScriptPackage5764 /* 5765 *@@~ScriptPackage: 5070 5766 * Destructor for ScriptPackage class. 5071 5767 */ 5072 5768 ScriptPackage::~ScriptPackage() 5073 5769 { 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 */ 5780 USHORT 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 */ 5831 USHORT 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 */ 5855 const PSZ ScriptPackage::ReturnDescription() 5856 { 5857 return _pszDescription; 5858 } 5859 5860 5861 /* 5115 5862 *@@ ScriptPackage::SetPackageIndex 5116 5863 * Sets object's index. 5117 5864 */ 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 5865 USHORT ScriptPackage::SetPackageIndex(USHORT p_usPackageIndex) 5866 { 5867 return _Index.SetIndexAttribute(p_usPackageIndex); 5868 } 5869 5870 5871 /* 5872 *@@SetPackageID 5873 */ 5874 USHORT ScriptPackage::SetPackageID(PACKAGEIDDATA p_packageIDData) 5875 { 5876 return _PckID.SetPackageID(p_packageIDData); 5877 } 5878 5879 5880 /* 5881 *@@SetTitle: 5882 */ 5883 USHORT ScriptPackage::SetTitle(const PSZ p_pszTitle) 5884 { 5885 return _Title.SetTitle(p_pszTitle); 5886 } 5887 5888 5889 /* 5890 *@@ReturnTitle: 5195 5891 */ 5196 5892 const PSZ ScriptPackage::ReturnTitleText() 5197 5893 { 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 */ 5901 USHORT ScriptPackage::SetTarget(const PSZ p_pszTarget) 5902 { 5903 return _Target.SetTarget(p_pszTarget); 5904 } 5905 5906 5907 /* 5908 *@@SetKeyWords: 5909 */ 5910 USHORT ScriptPackage::SetKeyWords(USHORT p_usKeyWords) 5911 { 5912 return _KeyWords.SetKeyWord(p_usKeyWords); 5913 } 5914 5915 5916 /* 5917 *@@ReturnPackageIDObject: 5227 5918 * Returns pointer to PackageID object. 5228 5919 */ 5229 5920 ScriptPackageID *ScriptPackage::ReturnPackageIDObject() 5230 5921 { 5231 return &PckID; 5232 } 5233 5234 5235 5236 /*************************************************************************** 5237 *@@ ScriptPackage::ReturnTitleObject 5922 return &_PckID; 5923 } 5924 5925 5926 /* 5927 *@@ReturnTitleObject: 5238 5928 * Returns pointer to PackageID object. 5239 5929 */ 5240 5930 ScriptTitle *ScriptPackage::ReturnTitleObject() 5241 5931 { 5242 return &Title; 5243 } 5244 5245 5246 5247 /*************************************************************************** 5248 *@@ ScriptPackage::ReturnTargetObject 5932 return &_Title; 5933 } 5934 5935 5936 /* 5937 *@@ReturnTargetObject: 5249 5938 * Returns pointer to Target object. 5250 5939 */ 5251 5940 ScriptTarget *ScriptPackage::ReturnTargetObject() 5252 5941 { 5253 return & Target;5254 } 5255 5256 5257 /* **************************************************************************5258 *@@ ScriptPackage::ReturnTargetText5942 return &_Target; 5943 } 5944 5945 5946 /* 5947 *@@ReturnTargetText: 5259 5948 * Returns pointer to title text. 5260 5949 */ 5261 5950 const PSZ ScriptPackage::ReturnTargetText() 5262 5951 { 5263 return Target.ReturnTarget(); 5264 } 5265 5266 5267 5268 /*************************************************************************** 5269 *@@ ScriptPackage::ReturnKeyWordObject 5952 return _Target.ReturnTarget(); 5953 } 5954 5955 5956 /* 5957 *@@ReturnKeyWordObject: 5270 5958 * Returns pointer to PackageID object. 5271 5959 */ 5272 5960 ScriptKeyWord *ScriptPackage::ReturnKeyWordObject() 5273 5961 { 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: 5291 5968 * Returns package index number. 5292 5969 */ 5293 5970 ScriptIndex *ScriptPackage::ReturnPackageIndex() 5294 5971 { 5295 return & Index;5296 } 5297 5298 5299 /* **************************************************************************5300 *@@ ScriptPackage::ReturnPackageIndex5972 return &_Index; 5973 } 5974 5975 5976 /* 5977 *@@ReturnPackageIndex: 5301 5978 * Returns package index number. 5302 5979 */ 5303 5980 USHORT ScriptPackage::ReturnPackageIndexNumber() 5304 5981 { 5305 return Index.ReturnIndexAttribute(); 5306 } 5307 5308 5309 5310 /*************************************************************************** 5311 *@@ ScriptPackage::MakeScriptText 5982 return _Index.ReturnIndexAttribute(); 5983 } 5984 5985 5986 /* 5987 *@@MakeScriptText: 5312 5988 * Returns pointer to script text. 5313 5989 */ 5314 PSZ ScriptPackage::MakeScriptText(BOOL bAttribute)5990 PSZ ScriptPackage::MakeScriptText(BOOL p_bAttribute) 5315 5991 { 5316 5992 XSTRING strScript; … … 5321 5997 USHORT usIndex; 5322 5998 5323 if ( bAttribute)5999 if (p_bAttribute) 5324 6000 { 5325 6001 sprintf(szTag, "<%s ", SZ_TAG_PACKAGE); … … 5328 6004 //sprintf(szAttribute, "%s=%i\n", SZ_ATTRIBUTE_INDEX, Index.ReturnIndexAttribute()); 5329 6005 xstrcat(&strScript, "\t", 0); 5330 pszTemp = Index.MakeScriptText(bAttribute);6006 pszTemp = _Index.MakeScriptText(p_bAttribute); 5331 6007 xstrcat(&strScript, pszTemp, 0); 5332 6008 delete [] pszTemp; … … 5334 6010 5335 6011 xstrcat(&strScript, "\t", 0); 5336 pszTemp = PckID.MakeScriptText(bAttribute);6012 pszTemp = _PckID.MakeScriptText(p_bAttribute); 5337 6013 xstrcat(&strScript, pszTemp, 0); 5338 6014 delete [] pszTemp; … … 5340 6016 5341 6017 xstrcat(&strScript, "\t", 0); 5342 pszTemp = Title.MakeScriptText(bAttribute);6018 pszTemp = _Title.MakeScriptText(p_bAttribute); 5343 6019 xstrcat(&strScript, pszTemp, 0); 5344 6020 delete [] pszTemp; … … 5346 6022 5347 6023 xstrcat(&strScript, "\t", 0); 5348 pszTemp = Target.MakeScriptText(bAttribute);6024 pszTemp = _Target.MakeScriptText(p_bAttribute); 5349 6025 xstrcat(&strScript, pszTemp, 0); 5350 6026 delete [] pszTemp; … … 5352 6028 5353 6029 xstrcat(&strScript, "\t", 0); 5354 pszTemp = KeyWords.MakeScriptText(bAttribute);6030 pszTemp = _KeyWords.MakeScriptText(p_bAttribute); 5355 6031 xstrcat(&strScript, pszTemp, 0); 5356 6032 delete [] pszTemp; 5357 6033 xstrcat(&strScript, "\n", 0); 5358 6034 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); 5362 6038 xstrcat(&strScript, "\t", 0); 5363 6039 xstrcat(&strScript, pszTemp, 0); … … 5366 6042 } 5367 6043 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); 5371 6047 xstrcat(&strScript, "\t", 0); 5372 6048 xstrcat(&strScript, pszTemp, 0); … … 5375 6051 } 5376 6052 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); 5380 6056 xstrcat(&strScript, "\t", 0); 5381 6057 xstrcat(&strScript, pszTemp, 0); … … 5385 6061 5386 6062 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); 5390 6066 xstrcat(&strScript, "\t", 0); 5391 6067 xstrcat(&strScript, pszTemp, 0); … … 5395 6071 5396 6072 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); 5400 6076 xstrcat(&strScript, "\t", 0); 5401 6077 xstrcat(&strScript, pszTemp, 0); … … 5404 6080 } 5405 6081 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); 5409 6085 xstrcat(&strScript, "\t", 0); 5410 6086 xstrcat(&strScript, pszTemp, 0); … … 5414 6090 5415 6091 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); 5419 6095 xstrcat(&strScript, "\t", 0); 5420 6096 xstrcat(&strScript, pszTemp, 0); … … 5423 6099 } 5424 6100 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); 5428 6104 xstrcat(&strScript, "\t", 0); 5429 6105 xstrcat(&strScript, pszTemp, 0); … … 5432 6108 } 5433 6109 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); 5437 6113 xstrcat(&strScript, "\t", 0); 5438 6114 xstrcat(&strScript, pszTemp, 0); … … 5442 6118 5443 6119 5444 if ( bAttribute)6120 if (p_bAttribute) 5445 6121 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) 5450 6126 { 5451 6127 sprintf(szTag, "<%s>", SZ_TAG_ENDPACKAGE); … … 5457 6133 5458 6134 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 */ 6139 ScriptRequires *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 --; 5479 6147 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 else5488 break;5489 DestTable[DestIndex] = SrcTable[SrcIndex];5490 }5491 5492 return DestTable;5493 }5494 5495 5496 5497 5498 /***************************************************************************5499 *@@ ScriptPackage::ReBuildIndexes5500 * Rebuilds indexes after deletion. The order of the indexes does not matter.5501 * Example:5502 * Old indexing: 1, 4, 3, 55503 * New indexing: 1, 3, 2, 45504 */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 number5527 // 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::FindUnusedIndex5546 * 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 else5572 break;5573 }5574 5575 return Index;5576 }5577 5578 5579 5580 5581 /***************************************************************************5582 *@@ ScriptPackage::CreateRequiresObject5583 * 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;5594 6148 } 5595 6149 5596 6150 // 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]; 5604 6158 return pNewRequires; 5605 6159 } 5606 6160 5607 6161 5608 5609 /*************************************************************************** 5610 *@@ ScriptPackage::CreateRequiresObject 6162 /* 6163 *@@CreateRequiresObject 5611 6164 * Creates requires object and sets datas and returns pointer to it. 5612 6165 * Also sets datas according to requiresData. 5613 6166 */ 5614 ScriptRequires *ScriptPackage::CreateRequiresObject(REQUIRESDATA requiresData)6167 ScriptRequires *ScriptPackage::CreateRequiresObject(REQUIRESDATA p_requiresData) 5615 6168 { 5616 6169 ScriptRequires *RequiresObject = CreateRequiresObject(); 5617 6170 5618 RequiresObject->SetRequires( requiresData);6171 RequiresObject->SetRequires(p_requiresData); 5619 6172 return RequiresObject; 5620 6173 } 5621 6174 5622 6175 5623 5624 /*************************************************************************** 5625 *@@ ScriptPackage::ReturnRequiresObject 6176 /* 6177 *@@ReturnRequiresObject 5626 6178 * Returns object which index is given usIndex. 5627 6179 */ 5628 ScriptRequires *ScriptPackage::ReturnRequiresObject(USHORT usIndex)6180 ScriptRequires *ScriptPackage::ReturnRequiresObject(USHORT p_usIndex) 5629 6181 { 5630 6182 USHORT Index; 5631 6183 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]; 5635 6187 return NULL; 5636 6188 } 5637 6189 5638 6190 5639 5640 5641 /*************************************************************************** 5642 *@@ ScriptPackage::DeleteRequiresObject 6191 /* 6192 *@@DeleteRequiresObject: 5643 6193 * Deletes object which index is given in usIndex. 5644 6194 */ 5645 USHORT ScriptPackage::DeleteRequiresObject(USHORT usIndex)6195 USHORT ScriptPackage::DeleteRequiresObject(USHORT p_usIndex) 5646 6196 { 5647 6197 ScriptRequires *TempRequires = NULL; 5648 6198 5649 if ( usRequiresCount > 1)5650 { 5651 TempRequires = new ScriptRequires[ usRequiresCount - 1];5652 CopyTable(TempRequires, pRequires, usRequiresCount,usIndex);5653 if ( bAllowIndexArrangement)5654 Re BuildIndexes(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 --; 5659 6209 return 0; 5660 6210 } 5661 6211 5662 6212 5663 5664 /*************************************************************************** 5665 *@@ ScriptPackage::DeleteRequiresObject 6213 /* 6214 *@@DeleteRequiresObject: 5666 6215 * Deletes object which address is *ScriptRequiresObject. 5667 6216 */ 5668 USHORT ScriptPackage::DeleteRequiresObject(ScriptRequires * ScriptRequiresObject)6217 USHORT ScriptPackage::DeleteRequiresObject(ScriptRequires *p_pScriptRequiresObject) 5669 6218 { 5670 6219 USHORT Index = 0, usDelete; 5671 6220 USHORT rc; 5672 6221 5673 if (! ScriptRequiresObject)6222 if (!p_pScriptRequiresObject) 5674 6223 return 1; 5675 6224 … … 5677 6226 while (TRUE) 5678 6227 { 5679 if (& pRequires[Index] ==ScriptRequiresObject)6228 if (&_pRequires[Index] == p_pScriptRequiresObject) 5680 6229 break; 5681 6230 Index ++; 5682 if (Index >= usRequiresCount)6231 if (Index >= _usRequiresCount) 5683 6232 return 2; 5684 6233 } 5685 6234 5686 usDelete = pRequires[Index].ReturnIndex();6235 usDelete = _pRequires[Index].ReturnIndex(); 5687 6236 rc = DeleteRequiresObject(usDelete); 5688 6237 5689 5690 6238 return rc; 5691 6239 } 5692 6240 5693 6241 5694 5695 5696 /*************************************************************************** 5697 *@@ ScriptPackage:: ReturnRequiresObjectCount 6242 /* 6243 *@@ReturnRequiresObjectCount: 5698 6244 * Returns count number of ScriptRequiresObjects. 5699 6245 */ 5700 6246 USHORT ScriptPackage::ReturnRequiresObjectCount() 5701 6247 { 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 */ 6256 ScriptConfigSys *ScriptPackage::CreateConfigSysObject() 6257 { 6258 ScriptConfigSys *Object, *NewObject; 6259 6260 if (!(Object = new ScriptConfigSys[++_usConfigSysCount])) 6261 { 6262 _usConfigSysCount --; 5726 6263 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]; 5849 6273 return NewObject; 5850 6274 } 5851 6275 5852 6276 5853 5854 /*************************************************************************** 5855 *@@ ScriptPackage::CreateConfigSysObject 6277 /* 6278 *@@CreateConfigSysObject: 5856 6279 * Creates ConfigSys object and sets datas and returns pointer to it. 5857 6280 * Also sets datas according to data. 5858 6281 */ 5859 ScriptConfigSys *ScriptPackage::CreateConfigSysObject(CONFIGSYSDATA data)6282 ScriptConfigSys *ScriptPackage::CreateConfigSysObject(CONFIGSYSDATA p_data) 5860 6283 { 5861 6284 ScriptConfigSys *ConfigSysObject = CreateConfigSysObject(); 5862 6285 5863 ConfigSysObject->SetConfigSys( data);6286 ConfigSysObject->SetConfigSys(p_data); 5864 6287 return ConfigSysObject; 5865 6288 } 5866 6289 5867 6290 5868 5869 /*************************************************************************** 5870 *@@ ScriptPackage::ReturnConfigSysObject 6291 /* 6292 *@@ReturnConfigSysObject: 5871 6293 * Returns object which index is given usIndex. 5872 6294 */ 5873 ScriptConfigSys *ScriptPackage::ReturnConfigSysObject(USHORT usIndex)6295 ScriptConfigSys *ScriptPackage::ReturnConfigSysObject(USHORT p_usIndex) 5874 6296 { 5875 6297 USHORT Index; 5876 6298 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]; 5880 6302 return NULL; 5881 6303 } 5882 6304 5883 6305 5884 5885 5886 /*************************************************************************** 5887 *@@ ScriptPackage::DeleteConfigSysObject 6306 /* 6307 *@@DeleteConfigSysObject: 5888 6308 * Deletes object which index is given in usIndex. 5889 6309 */ 5890 USHORT ScriptPackage::DeleteConfigSysObject(USHORT usIndex)6310 USHORT ScriptPackage::DeleteConfigSysObject(USHORT p_usIndex) 5891 6311 { 5892 6312 ScriptConfigSys *TempConfigSys = NULL; 5893 6313 5894 if ( usConfigSysCount > 1)5895 { 5896 TempConfigSys = new ScriptConfigSys[ usConfigSysCount - 1];5897 CopyTable(TempConfigSys, pConfigSys, usConfigSysCount,usIndex);5898 if ( bAllowIndexArrangement)5899 Re BuildIndexes(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 --; 5904 6324 return 0; 5905 6325 } 5906 6326 5907 6327 5908 5909 /*************************************************************************** 5910 *@@ ScriptPackage::DeleteConfigSysObject 6328 /* 6329 *@@DeleteConfigSysObject: 5911 6330 * Deletes object which address is *ScriptConfigSysObject. 5912 6331 */ 5913 USHORT ScriptPackage::DeleteConfigSysObject(ScriptConfigSys * ScriptConfigSysObject)6332 USHORT ScriptPackage::DeleteConfigSysObject(ScriptConfigSys *p_pScriptConfigSysObject) 5914 6333 { 5915 6334 USHORT Index = 0, usDelete; 5916 6335 USHORT rc; 5917 6336 5918 if (! ScriptConfigSysObject)6337 if (!p_pScriptConfigSysObject) 5919 6338 return 1; 5920 6339 … … 5922 6341 while (TRUE) 5923 6342 { 5924 if (& pConfigSys[Index] ==ScriptConfigSysObject)6343 if (&_pConfigSys[Index] == p_pScriptConfigSysObject) 5925 6344 break; 5926 6345 Index ++; 5927 if (Index >= usConfigSysCount)6346 if (Index >= _usConfigSysCount) 5928 6347 return 2; 5929 6348 } 5930 6349 5931 usDelete = pConfigSys[Index].ReturnIndex();6350 usDelete = _pConfigSys[Index].ReturnIndex(); 5932 6351 rc = DeleteConfigSysObject(usDelete); 5933 6352 … … 5937 6356 5938 6357 5939 5940 5941 /*************************************************************************** 5942 *@@ ScriptPackage:: ReturnConfigSysObjectCount 6358 /* 6359 *@@ReturnConfigSysObjectCount: 5943 6360 * Returns count number of ScriptConfigSysObjects. 5944 6361 */ 5945 6362 USHORT ScriptPackage::ReturnConfigSysObjectCount() 5946 6363 { 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 */ 6372 ScriptRegisterClass *ScriptPackage::CreateRegisterClassObject() 6373 { 6374 ScriptRegisterClass *Object, *NewObject; 6375 6376 if (!(Object = new ScriptRegisterClass[++_usRegisterClassCount])) 6377 { 6378 _usRegisterClassCount --; 5972 6379 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]; 6095 6390 return NewObject; 6096 6391 } 6097 6392 6098 6393 6099 6100 /*************************************************************************** 6101 *@@ ScriptPackage::CreateRegisterClassObject 6394 /* 6395 *@@CreateRegisterClassObject: 6102 6396 * Creates RegisterClass object and sets datas and returns pointer to it. 6103 6397 * Also sets datas according to data. 6104 6398 */ 6105 ScriptRegisterClass *ScriptPackage::CreateRegisterClassObject(REGISTERCLASSDATA data)6399 ScriptRegisterClass *ScriptPackage::CreateRegisterClassObject(REGISTERCLASSDATA p_data) 6106 6400 { 6107 6401 ScriptRegisterClass *RegisterClassObject = CreateRegisterClassObject(); 6108 6402 6109 RegisterClassObject->SetRegisterClass( data);6403 RegisterClassObject->SetRegisterClass(p_data); 6110 6404 return RegisterClassObject; 6111 6405 } 6112 6406 6113 6407 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 */ 6412 ScriptRegisterClass *ScriptPackage::ReturnRegisterClassObject(USHORT p_usIndex) 6120 6413 { 6121 6414 USHORT Index; 6122 6415 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]; 6126 6419 return NULL; 6127 6420 } 6128 6421 6129 6422 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 */ 6427 USHORT ScriptPackage::DeleteRegisterClassObject(USHORT p_usIndex) 6137 6428 { 6138 6429 ScriptRegisterClass *TempRegisterClass = NULL; 6139 6430 6140 if ( usRegisterClassCount > 1)6141 { 6142 TempRegisterClass = new ScriptRegisterClass[ usRegisterClassCount - 1];6143 CopyTable(TempRegisterClass, pRegisterClass, usRegisterClassCount,usIndex);6144 if ( bAllowIndexArrangement)6145 Re BuildIndexes(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 --; 6150 6441 return 0; 6151 6442 } 6152 6443 6153 6444 6154 6155 /*************************************************************************** 6156 *@@ ScriptPackage::DeleteRegisterClassObject 6445 /* 6446 *@@DeleteRegisterClassObject: 6157 6447 * Deletes object which address is *ScriptRegisterClassObject. 6158 6448 */ 6159 USHORT ScriptPackage::DeleteRegisterClassObject(ScriptRegisterClass *ScriptRegisterClassObject) 6449 USHORT ScriptPackage::DeleteRegisterClassObject( 6450 ScriptRegisterClass *p_pScriptRegisterClassObject 6451 ) 6160 6452 { 6161 6453 USHORT Index = 0, usDelete; 6162 6454 USHORT rc; 6163 6455 6164 if (! ScriptRegisterClassObject)6456 if (!p_pScriptRegisterClassObject) 6165 6457 return 1; 6166 6458 … … 6168 6460 while (TRUE) 6169 6461 { 6170 if (& pRegisterClass[Index] ==ScriptRegisterClassObject)6462 if (&_pRegisterClass[Index] == p_pScriptRegisterClassObject) 6171 6463 break; 6172 6464 Index ++; 6173 if (Index >= usRegisterClassCount)6465 if (Index >= _usRegisterClassCount) 6174 6466 return 2; 6175 6467 } 6176 6468 6177 usDelete = pRegisterClass[Index].ReturnIndex();6469 usDelete = _pRegisterClass[Index].ReturnIndex(); 6178 6470 rc = DeleteRegisterClassObject(usDelete); 6179 6471 … … 6183 6475 6184 6476 6185 6186 6187 /*************************************************************************** 6188 *@@ ScriptPackage:: ReturnRegisterClassObjectCount 6477 /* 6478 *@@ReturnRegisterClassObjectCount: 6189 6479 * Returns count number of ScriptRegisterClassObjects. 6190 6480 */ 6191 6481 USHORT ScriptPackage::ReturnRegisterClassObjectCount() 6192 6482 { 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 */ 6491 ScriptReplaceClass *ScriptPackage::CreateReplaceClassObject() 6492 { 6493 ScriptReplaceClass *Object, *NewObject; 6494 6495 if (!(Object = new ScriptReplaceClass[++_usReplaceClassCount])) 6496 { 6497 _usReplaceClassCount --; 6218 6498 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]; 6341 6509 return NewObject; 6342 6510 } 6343 6511 6344 6512 6345 6346 /*************************************************************************** 6347 *@@ ScriptPackage::CreateReplaceClassObject 6513 /* 6514 *@@CreateReplaceClassObject: 6348 6515 * Creates ReplaceClass object and sets datas and returns pointer to it. 6349 6516 * Also sets datas according to data. 6350 6517 */ 6351 ScriptReplaceClass *ScriptPackage::CreateReplaceClassObject(REPLACECLASSDATA data)6518 ScriptReplaceClass *ScriptPackage::CreateReplaceClassObject(REPLACECLASSDATA p_data) 6352 6519 { 6353 6520 ScriptReplaceClass *ReplaceClassObject = CreateReplaceClassObject(); 6354 6521 6355 ReplaceClassObject->SetReplaceClass( data);6522 ReplaceClassObject->SetReplaceClass(p_data); 6356 6523 return ReplaceClassObject; 6357 6524 } 6358 6525 6359 6526 6360 6361 /*************************************************************************** 6362 *@@ ScriptPackage::ReturnReplaceClassObject 6527 /* 6528 *@@ReturnReplaceClassObject: 6363 6529 * Returns object which index is given usIndex. 6364 6530 */ 6365 ScriptReplaceClass *ScriptPackage::ReturnReplaceClassObject(USHORT usIndex)6531 ScriptReplaceClass *ScriptPackage::ReturnReplaceClassObject(USHORT p_usIndex) 6366 6532 { 6367 6533 USHORT Index; 6368 6534 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]; 6372 6538 return NULL; 6373 6539 } 6374 6540 6375 6541 6376 6377 6378 /*************************************************************************** 6379 *@@ ScriptPackage::DeleteReplaceClassObject 6542 /* 6543 *@@DeleteReplaceClassObject: 6380 6544 * Deletes object which index is given in usIndex. 6381 6545 */ 6382 USHORT ScriptPackage::DeleteReplaceClassObject(USHORT usIndex)6546 USHORT ScriptPackage::DeleteReplaceClassObject(USHORT p_usIndex) 6383 6547 { 6384 6548 ScriptReplaceClass *TempReplaceClass = NULL; 6385 6549 6386 if ( usReplaceClassCount > 1)6387 { 6388 TempReplaceClass = new ScriptReplaceClass[ usReplaceClassCount - 1];6389 CopyTable(TempReplaceClass, pReplaceClass, usReplaceClassCount,usIndex);6390 if ( bAllowIndexArrangement)6391 Re BuildIndexes(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 --; 6396 6560 return 0; 6397 6561 } 6398 6562 6399 6563 6400 6401 /*************************************************************************** 6402 *@@ ScriptPackage::DeleteReplaceClassObject 6564 /* 6565 *@@DeleteReplaceClassObject: 6403 6566 * Deletes object which address is *ScriptReplaceClassObject. 6404 6567 */ 6405 USHORT ScriptPackage::DeleteReplaceClassObject(ScriptReplaceClass *ScriptReplaceClassObject) 6568 USHORT ScriptPackage::DeleteReplaceClassObject( 6569 ScriptReplaceClass *p_pScriptReplaceClassObject 6570 ) 6406 6571 { 6407 6572 USHORT Index = 0, usDelete; 6408 6573 USHORT rc; 6409 6574 6410 if (! ScriptReplaceClassObject)6575 if (!p_pScriptReplaceClassObject) 6411 6576 return 1; 6412 6577 … … 6414 6579 while (TRUE) 6415 6580 { 6416 if (& pReplaceClass[Index] ==ScriptReplaceClassObject)6581 if (&_pReplaceClass[Index] == p_pScriptReplaceClassObject) 6417 6582 break; 6418 6583 Index ++; 6419 if (Index >= usReplaceClassCount)6584 if (Index >= _usReplaceClassCount) 6420 6585 return 2; 6421 6586 } 6422 6587 6423 usDelete = pReplaceClass[Index].ReturnIndex();6588 usDelete = _pReplaceClass[Index].ReturnIndex(); 6424 6589 rc = DeleteReplaceClassObject(usDelete); 6425 6590 … … 6429 6594 6430 6595 6431 6432 6433 /*************************************************************************** 6434 *@@ ScriptPackage:: ReturnReplaceClassObjectCount 6596 /* 6597 *@@ReturnReplaceClassObjectCount: 6435 6598 * Returns count number of ScriptReplaceClassObjects. 6436 6599 */ 6437 6600 USHORT ScriptPackage::ReturnReplaceClassObjectCount() 6438 6601 { 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 */ 6610 ScriptCreateObject *ScriptPackage::CreateCreateObjectObject() 6611 { 6612 ScriptCreateObject *Object, *NewObject; 6613 6614 if (!(Object = new ScriptCreateObject[++_usCreateObjectCount])) 6615 { 6616 _usCreateObjectCount --; 6464 6617 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]; 6587 6627 return NewObject; 6588 6628 } 6589 6629 6590 6630 6591 6592 /*************************************************************************** 6593 *@@ ScriptPackage::CreateCreateObjectObject 6631 /* 6632 *@@CreateCreateObjectObject: 6594 6633 * Creates CreateObject object and sets datas and returns pointer to it. 6595 6634 * Also sets datas according to data. 6596 6635 */ 6597 ScriptCreateObject *ScriptPackage::CreateCreateObjectObject(CREATEOBJECTDATA data)6636 ScriptCreateObject *ScriptPackage::CreateCreateObjectObject(CREATEOBJECTDATA p_data) 6598 6637 { 6599 6638 ScriptCreateObject *CreateObjectObject = CreateCreateObjectObject(); 6600 6639 6601 CreateObjectObject->SetCreateObject( data);6640 CreateObjectObject->SetCreateObject(p_data); 6602 6641 return CreateObjectObject; 6603 6642 } 6604 6643 6605 6644 6606 6607 /*************************************************************************** 6608 *@@ ScriptPackage::ReturnCreateObjectObject 6645 /* 6646 *@@ReturnCreateObjectObject: 6609 6647 * Returns object which index is given usIndex. 6610 6648 */ 6611 ScriptCreateObject *ScriptPackage::ReturnCreateObjectObject(USHORT usIndex)6649 ScriptCreateObject *ScriptPackage::ReturnCreateObjectObject(USHORT p_usIndex) 6612 6650 { 6613 6651 USHORT Index; 6614 6652 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]; 6618 6656 return NULL; 6619 6657 } 6620 6658 6621 6659 6622 6623 6624 /*************************************************************************** 6660 /* 6625 6661 *@@ ScriptPackage::DeleteCreateObjectObject 6626 6662 * Deletes object which index is given in usIndex. 6627 6663 */ 6628 USHORT ScriptPackage::DeleteCreateObjectObject(USHORT usIndex)6664 USHORT ScriptPackage::DeleteCreateObjectObject(USHORT p_usIndex) 6629 6665 { 6630 6666 ScriptCreateObject *TempCreateObject = NULL; 6631 6667 6632 if ( usCreateObjectCount > 1)6633 { 6634 TempCreateObject = new ScriptCreateObject[ usCreateObjectCount - 1];6635 CopyTable(TempCreateObject, pCreateObject, usCreateObjectCount,usIndex);6636 if ( bAllowIndexArrangement)6637 Re BuildIndexes(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 --; 6642 6678 return 0; 6643 6679 } … … 6645 6681 6646 6682 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 */ 6687 USHORT ScriptPackage::DeleteCreateObjectObject( 6688 ScriptCreateObject *p_pScriptCreateObjectObject 6689 ) 6652 6690 { 6653 6691 USHORT Index = 0, usDelete; 6654 6692 USHORT rc; 6655 6693 6656 if (! ScriptCreateObjectObject)6694 if (!p_pScriptCreateObjectObject) 6657 6695 return 1; 6658 6696 … … 6660 6698 while (TRUE) 6661 6699 { 6662 if (& pCreateObject[Index] ==ScriptCreateObjectObject)6700 if (&_pCreateObject[Index] == p_pScriptCreateObjectObject) 6663 6701 break; 6664 6702 Index ++; 6665 if (Index >= usCreateObjectCount)6703 if (Index >= _usCreateObjectCount) 6666 6704 return 2; 6667 6705 } 6668 6706 6669 usDelete = pCreateObject[Index].ReturnIndex();6707 usDelete = _pCreateObject[Index].ReturnIndex(); 6670 6708 rc = DeleteCreateObjectObject(usDelete); 6671 6709 6672 6673 6710 return rc; 6674 6711 } 6675 6712 6676 6713 6677 6678 6679 /*************************************************************************** 6680 *@@ ScriptPackage:: ReturnCreateObjectObjectCount 6714 /* 6715 *@@ReturnCreateObjectObjectCount: 6681 6716 * Returns count number of ScriptCreateObjectObjects. 6682 6717 */ 6683 6718 USHORT ScriptPackage::ReturnCreateObjectObjectCount() 6684 6719 { 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 */ 6728 ScriptClearProfile *ScriptPackage::CreateClearProfileObject() 6729 { 6730 ScriptClearProfile *Object, *NewObject; 6731 6732 if (!(Object = new ScriptClearProfile[++_usProfileCount])) 6733 { 6734 _usProfileCount --; 6711 6735 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]; 6834 6745 return NewObject; 6835 6746 } 6836 6747 6837 6748 6838 6839 /*************************************************************************** 6840 *@@ ScriptPackage::CreateClearProfileObject 6749 /* 6750 *@@CreateClearProfileObject: 6841 6751 * Creates Profile object and sets datas and returns pointer to it. 6842 6752 * Also sets datas according to data. 6843 6753 */ 6844 ScriptClearProfile *ScriptPackage::CreateClearProfileObject(PROFILEDATA data)6754 ScriptClearProfile *ScriptPackage::CreateClearProfileObject(PROFILEDATA p_data) 6845 6755 { 6846 6756 ScriptClearProfile *ProfileObject = CreateClearProfileObject(); 6847 6757 6848 ProfileObject->SetProfile( data);6758 ProfileObject->SetProfile(p_data); 6849 6759 return ProfileObject; 6850 6760 } 6851 6761 6852 6762 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 */ 6767 ScriptClearProfile *ScriptPackage::ReturnClearProfileObject(USHORT p_usIndex) 6859 6768 { 6860 6769 USHORT Index; 6861 6770 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]; 6865 6774 return NULL; 6866 6775 } 6867 6776 6868 6777 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 */ 6782 USHORT ScriptPackage::DeleteClearProfileObject(USHORT p_usIndex) 6876 6783 { 6877 6784 ScriptClearProfile *TempProfile = NULL; 6878 6785 6879 if ( usProfileCount > 1)6880 { 6881 TempProfile = new ScriptClearProfile[ usProfileCount - 1];6882 CopyTable(TempProfile, pProfile, usProfileCount,usIndex);6883 if ( bAllowIndexArrangement)6884 Re BuildIndexes(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 --; 6889 6796 return 0; 6890 6797 } 6891 6798 6892 6799 6893 6894 /*************************************************************************** 6895 *@@ ScriptPackage::DeleteClearProfileObject 6896 * Deletes object which address is *ScriptClearProfileObject. 6800 /* 6801 *@@DeleteClearProfileObject: 6802 * Deletes object which address is given. 6897 6803 */ 6898 6804 USHORT ScriptPackage::DeleteClearProfileObject(ScriptClearProfile 6899 * ScriptClearProfileObject)6805 *p_pScriptClearProfileObject) 6900 6806 { 6901 6807 USHORT Index = 0, usDelete; 6902 6808 USHORT rc; 6903 6809 6904 if (! ScriptClearProfileObject)6810 if (!p_pScriptClearProfileObject) 6905 6811 return 1; 6906 6812 … … 6908 6814 while (TRUE) 6909 6815 { 6910 if (& pProfile[Index] ==ScriptClearProfileObject)6816 if (&_pProfile[Index] == p_pScriptClearProfileObject) 6911 6817 break; 6912 6818 Index ++; 6913 if (Index >= usProfileCount)6819 if (Index >= _usProfileCount) 6914 6820 return 2; 6915 6821 } 6916 6822 6917 usDelete = pProfile[Index].ReturnIndex();6823 usDelete = _pProfile[Index].ReturnIndex(); 6918 6824 rc = DeleteClearProfileObject(usDelete); 6919 6825 6920 6921 6826 return rc; 6922 6827 } 6923 6828 6924 6829 6925 6926 6927 /*************************************************************************** 6928 *@@ ScriptPackage:: ReturnClearProfileObjectCount 6830 /* 6831 *@@ReturnClearProfileObjectCount: 6929 6832 * Returns count number of ScriptClearProfileObjects. 6930 6833 */ 6931 6834 USHORT ScriptPackage::ReturnClearProfileObjectCount() 6932 6835 { 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 */ 6844 ScriptWriteProfile *ScriptPackage::CreateWriteProfileObject() 6845 { 6846 ScriptWriteProfile *Object, *NewObject; 6847 6848 if (!(Object = new ScriptWriteProfile[++_usWriteProfileCount])) 6849 { 6850 _usWriteProfileCount --; 6956 6851 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]; 7079 6862 return NewObject; 7080 6863 } 7081 6864 7082 6865 7083 7084 /*************************************************************************** 7085 *@@ ScriptPackage::CreateWriteProfileObject 6866 /* 6867 *@@CreateWriteProfileObject: 7086 6868 * Creates WriteProfile object and sets datas and returns pointer to it. 7087 6869 * Also sets datas according to data. 7088 6870 */ 7089 ScriptWriteProfile *ScriptPackage::CreateWriteProfileObject(PROFILEDATA data)6871 ScriptWriteProfile *ScriptPackage::CreateWriteProfileObject(PROFILEDATA p_data) 7090 6872 { 7091 6873 ScriptWriteProfile *WriteProfileObject = CreateWriteProfileObject(); 7092 6874 7093 WriteProfileObject->SetProfile( data);6875 WriteProfileObject->SetProfile(p_data); 7094 6876 return WriteProfileObject; 7095 6877 } 7096 6878 7097 6879 7098 7099 /*************************************************************************** 7100 *@@ ScriptPackage::ReturnWriteProfileObject 6880 /* 6881 *@@ReturnWriteProfileObject: 7101 6882 * Returns object which index is given usIndex. 7102 6883 */ 7103 ScriptWriteProfile *ScriptPackage::ReturnWriteProfileObject(USHORT usIndex)6884 ScriptWriteProfile *ScriptPackage::ReturnWriteProfileObject(USHORT p_usIndex) 7104 6885 { 7105 6886 USHORT Index; 7106 6887 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]; 7110 6891 return NULL; 7111 6892 } 7112 6893 7113 6894 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 */ 6899 USHORT ScriptPackage::DeleteWriteProfileObject(USHORT p_usIndex) 7121 6900 { 7122 6901 ScriptWriteProfile *TempWriteProfile = NULL; 7123 6902 7124 if ( usWriteProfileCount > 1)7125 { 7126 TempWriteProfile = new ScriptWriteProfile[ usWriteProfileCount - 1];7127 CopyTable(TempWriteProfile, pWriteProfile, usWriteProfileCount,usIndex);7128 if ( bAllowIndexArrangement)7129 Re BuildIndexes(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 --; 7134 6913 return 0; 7135 6914 } 7136 6915 7137 6916 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 */ 6921 USHORT ScriptPackage::DeleteWriteProfileObject( 6922 ScriptWriteProfile *p_pScriptWriteProfileObject 6923 ) 7144 6924 { 7145 6925 USHORT Index = 0, usDelete; 7146 6926 USHORT rc; 7147 6927 7148 if (! ScriptWriteProfileObject)6928 if (!p_pScriptWriteProfileObject) 7149 6929 return 1; 7150 6930 … … 7152 6932 while (TRUE) 7153 6933 { 7154 if (& pWriteProfile[Index] ==ScriptWriteProfileObject)6934 if (&_pWriteProfile[Index] == p_pScriptWriteProfileObject) 7155 6935 break; 7156 6936 Index ++; 7157 if (Index >= usWriteProfileCount)6937 if (Index >= _usWriteProfileCount) 7158 6938 return 2; 7159 6939 } 7160 6940 7161 usDelete = pWriteProfile[Index].ReturnIndex();6941 usDelete = _pWriteProfile[Index].ReturnIndex(); 7162 6942 rc = DeleteWriteProfileObject(usDelete); 7163 7164 7165 6943 return rc; 7166 6944 } 7167 6945 7168 6946 7169 7170 7171 /*************************************************************************** 7172 *@@ ScriptPackage:: ReturnWriteProfileObjectCount 6947 /* 6948 *@@ReturnWriteProfileObjectCount: 7173 6949 * Returns count number of ScriptWriteProfileObjects. 7174 6950 */ 7175 6951 USHORT ScriptPackage::ReturnWriteProfileObjectCount() 7176 6952 { 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 */ 6961 ScriptExecute *ScriptPackage::CreateExecuteObject() 6962 { 6963 ScriptExecute *Object, *NewObject; 6964 6965 if (!(Object = new ScriptExecute[++_usExecuteCount])) 6966 { 6967 _usExecuteCount --; 7203 6968 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]; 7326 6978 return NewObject; 7327 6979 } 7328 6980 7329 6981 7330 7331 /*************************************************************************** 7332 *@@ ScriptPackage::CreateExecuteObject 6982 /* 6983 *@@CreateExecuteObject: 7333 6984 * Creates Execute object and sets datas and returns pointer to it. 7334 6985 */ 7335 ScriptExecute *ScriptPackage::CreateExecuteObject(PSZ p szExecute)6986 ScriptExecute *ScriptPackage::CreateExecuteObject(PSZ p_pszExecute) 7336 6987 { 7337 6988 ScriptExecute *ExecuteObject = CreateExecuteObject(); 7338 6989 7339 ExecuteObject->SetExecFileParams(p szExecute);6990 ExecuteObject->SetExecFileParams(p_pszExecute); 7340 6991 return ExecuteObject; 7341 6992 } 7342 6993 7343 6994 7344 7345 /*************************************************************************** 7346 *@@ ScriptPackage::ReturnExecuteObject 6995 /* 6996 *@@ReturnExecuteObject: 7347 6997 * Returns object which index is given usIndex. 7348 6998 */ 7349 ScriptExecute *ScriptPackage::ReturnExecuteObject(USHORT usIndex)6999 ScriptExecute *ScriptPackage::ReturnExecuteObject(USHORT p_usIndex) 7350 7000 { 7351 7001 USHORT Index; 7352 7002 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]; 7356 7006 return NULL; 7357 7007 } 7358 7008 7359 7009 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 */ 7014 USHORT ScriptPackage::DeleteExecuteObject(USHORT p_usIndex) 7367 7015 { 7368 7016 ScriptExecute *TempExecute = NULL; 7369 7017 7370 if ( usExecuteCount > 1)7371 { 7372 TempExecute = new ScriptExecute[ usExecuteCount - 1];7373 CopyTable(TempExecute, pExecute, usExecuteCount,usIndex);7374 if ( bAllowIndexArrangement)7375 Re BuildIndexes(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 --; 7380 7028 return 0; 7381 7029 } 7382 7030 7383 7031 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 */ 7036 USHORT ScriptPackage::DeleteExecuteObject(ScriptExecute *p_pScriptExecuteObject) 7390 7037 { 7391 7038 USHORT Index = 0, usDelete; 7392 7039 USHORT rc; 7393 7040 7394 if (! ScriptExecuteObject)7041 if (!p_pScriptExecuteObject) 7395 7042 return 1; 7396 7043 … … 7398 7045 while (TRUE) 7399 7046 { 7400 if (& pExecute[Index] ==ScriptExecuteObject)7047 if (&_pExecute[Index] == p_pScriptExecuteObject) 7401 7048 break; 7402 7049 Index ++; 7403 if (Index >= usExecuteCount)7050 if (Index >= _usExecuteCount) 7404 7051 return 2; 7405 7052 } 7406 7053 7407 usDelete = pExecute[Index].ReturnIndex();7054 usDelete = _pExecute[Index].ReturnIndex(); 7408 7055 rc = DeleteExecuteObject(usDelete); 7409 7056 7410 7411 7057 return rc; 7412 7058 } 7413 7059 7414 7060 7415 7416 7417 /*************************************************************************** 7418 *@@ ScriptPackage:: ReturnExecuteObjectCount 7061 /* 7062 *@@ReturnExecuteObjectCount: 7419 7063 * Returns count number of ScriptExecuteObjects. 7420 7064 */ 7421 7065 USHORT ScriptPackage::ReturnExecuteObjectCount() 7422 7066 { 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 */ 7075 ScriptKillProcess *ScriptPackage::CreateKillProcessObject() 7076 { 7077 ScriptKillProcess *Object, *NewObject; 7078 7079 if (!(Object = new ScriptKillProcess[++_usKillProcessCount])) 7080 { 7081 _usKillProcessCount --; 7446 7082 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]; 7566 7092 return NewObject; 7567 7093 } 7568 7094 7569 7095 7570 7571 /*************************************************************************** 7572 *@@ ScriptPackage::CreateKillProcessObject 7096 /* 7097 *@@CreateKillProcessObject: 7573 7098 * Creates KillProcess object and sets datas and returns pointer to it. 7574 7099 * Also sets datas according to data. 7575 7100 */ 7576 ScriptKillProcess *ScriptPackage::CreateKillProcessObject(const PSZ p szFileName)7101 ScriptKillProcess *ScriptPackage::CreateKillProcessObject(const PSZ p_pszFileName) 7577 7102 { 7578 7103 ScriptKillProcess *KillProcessObject = CreateKillProcessObject(); 7579 7104 7580 KillProcessObject->SetFileName(p szFileName);7105 KillProcessObject->SetFileName(p_pszFileName); 7581 7106 return KillProcessObject; 7582 7107 } 7583 7108 7584 7109 7585 7586 /*************************************************************************** 7587 *@@ ScriptPackage::ReturnKillProcessObject 7110 /* 7111 *@@ReturnKillProcessObject: 7588 7112 * Returns object which index is given usIndex. 7589 7113 */ 7590 ScriptKillProcess *ScriptPackage::ReturnKillProcessObject(USHORT usIndex)7114 ScriptKillProcess *ScriptPackage::ReturnKillProcessObject(USHORT p_usIndex) 7591 7115 { 7592 7116 USHORT Index; 7593 7117 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]; 7597 7121 return NULL; 7598 7122 } 7599 7123 7600 7124 7601 7602 7603 /*************************************************************************** 7604 *@@ ScriptPackage::DeleteKillProcessObject 7125 /* 7126 *@@DeleteKillProcessObject: 7605 7127 * Deletes object which index is given in usIndex. 7606 7128 */ 7607 USHORT ScriptPackage::DeleteKillProcessObject(USHORT usIndex)7129 USHORT ScriptPackage::DeleteKillProcessObject(USHORT p_usIndex) 7608 7130 { 7609 7131 ScriptKillProcess *TempKillProcess = NULL; 7610 7132 7611 if ( usKillProcessCount > 1)7612 { 7613 TempKillProcess = new ScriptKillProcess[ usKillProcessCount - 1];7614 CopyTable(TempKillProcess, pKillProcess, usKillProcessCount,usIndex);7615 if ( bAllowIndexArrangement)7616 Re BuildIndexes(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 --; 7621 7143 return 0; 7622 7144 } 7623 7145 7624 7146 7625 7626 /*************************************************************************** 7627 *@@ ScriptPackage::DeleteKillProcessObject 7147 /* 7148 *@@DeleteKillProcessObject: 7628 7149 * Deletes object which address is *ScriptKillProcessObject. 7629 7150 */ 7630 USHORT ScriptPackage::DeleteKillProcessObject(ScriptKillProcess *ScriptKillProcessObject) 7151 USHORT ScriptPackage::DeleteKillProcessObject( 7152 ScriptKillProcess *p_pScriptKillProcessObject 7153 ) 7631 7154 { 7632 7155 USHORT Index = 0, usDelete; 7633 7156 USHORT rc; 7634 7157 7635 if (! ScriptKillProcessObject)7158 if (!p_pScriptKillProcessObject) 7636 7159 return 1; 7637 7160 … … 7639 7162 while (TRUE) 7640 7163 { 7641 if (& pKillProcess[Index] ==ScriptKillProcessObject)7164 if (&_pKillProcess[Index] == p_pScriptKillProcessObject) 7642 7165 break; 7643 7166 Index ++; 7644 if (Index >= usKillProcessCount)7167 if (Index >= _usKillProcessCount) 7645 7168 return 2; 7646 7169 } 7647 7170 7648 usDelete = pKillProcess[Index].ReturnIndex();7171 usDelete = _pKillProcess[Index].ReturnIndex(); 7649 7172 rc = DeleteKillProcessObject(usDelete); 7650 7651 7652 7173 return rc; 7653 7174 } 7654 7175 7655 7176 7656 7657 7658 /*************************************************************************** 7659 *@@ ScriptPackage:: ReturnKillProcessObjectCount 7177 /* 7178 *@@ReturnKillProcessObjectCount: 7660 7179 * Returns count number of ScriptKillProcessObjects. 7661 7180 */ 7662 7181 USHORT ScriptPackage::ReturnKillProcessObjectCount() 7663 7182 { 7664 return usKillProcessCount; 7665 } 7666 7667 7668 7669 7670 7671 /*************************************************************************** 7183 return _usKillProcessCount; 7184 } 7185 7186 7187 /* 7672 7188 *@@ 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 */ 7191 PSZ ScriptPackage::BuildFromText(PSZ p_pszScriptText, 7192 ULONG p_ulLineNumber) 7193 { 7194 Message msg; 7684 7195 PSZ pszEnd = NULL; 7685 7196 ULONG ulRc = 0; … … 7687 7198 ULONG ulOffsetBeginBlock = 0; 7688 7199 ULONG ulSearchOffset = 0; 7689 PSZ pszText = p szScriptText;7200 PSZ pszText = p_pszScriptText; 7690 7201 PSZ pszBlock = NULL; 7691 7202 PSZ pszAttrs = NULL; … … 7706 7217 7707 7218 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 7723 7219 ulRc = strhGetBlock(pszText, &ulSearchOffset, SZ_TAG_PACKAGE, &pszBlock, 7724 7220 &pszAttrs, &ulOffsetBeginTag, &ulOffsetBeginBlock); … … 7729 7225 if (ulRc != 0) 7730 7226 { 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); 7738 7231 return NULL; 7739 7232 } … … 7743 7236 7744 7237 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); 7754 7243 7755 7244 … … 7759 7248 { 7760 7249 // Try to build object from text. 7761 pszTemp = TmpRequires.BuildFromText(pszTemp, ppScriptError, 7762 pusErrorTableSize, 0); 7250 pszTemp = TmpRequires.BuildFromText(pszTemp, 0); 7763 7251 // If it succeded, create new object and copy temp object to 7764 7252 // created object. … … 7768 7256 TmpRequires.SetIndex(pRequires->ReturnIndex()); 7769 7257 *pRequires = TmpRequires; 7258 pRequires->_messageLogger.SetParentLogger(_messageLogger); 7259 TmpRequires._messageLogger.DeleteLogs(); 7770 7260 } 7771 7261 … … 7777 7267 do 7778 7268 { 7779 pszTemp = TmpExecute.BuildFromText(pszTemp, ppScriptError, 7780 pusErrorTableSize, 0); 7269 pszTemp = TmpExecute.BuildFromText(pszTemp, 0); 7781 7270 if (pszTemp) 7782 7271 { … … 7784 7273 TmpExecute.SetIndex(pExecute->ReturnIndex()); 7785 7274 *pExecute = TmpExecute; 7275 pExecute->_messageLogger.SetParentLogger(_messageLogger); 7276 TmpExecute._messageLogger.DeleteLogs(); 7786 7277 } 7787 7278 … … 7793 7284 do 7794 7285 { 7795 pszTemp = TmpClearProfile.BuildFromText(pszTemp, ppScriptError, 7796 pusErrorTableSize, 0); 7286 pszTemp = TmpClearProfile.BuildFromText(pszTemp, 0); 7797 7287 if (pszTemp) 7798 7288 { … … 7800 7290 TmpClearProfile.SetIndex(pClearProfile->ReturnIndex()); 7801 7291 *pClearProfile = TmpClearProfile; 7292 pClearProfile->_messageLogger.SetParentLogger(_messageLogger); 7293 TmpClearProfile._messageLogger.DeleteLogs(); 7802 7294 } 7803 7295 … … 7809 7301 do 7810 7302 { 7811 pszTemp = TmpWriteProfile.BuildFromText(pszTemp, ppScriptError, 7812 pusErrorTableSize, 0); 7303 pszTemp = TmpWriteProfile.BuildFromText(pszTemp, 0); 7813 7304 if (pszTemp) 7814 7305 { … … 7816 7307 TmpWriteProfile.SetIndex(pWriteProfile->ReturnIndex()); 7817 7308 *pWriteProfile = TmpWriteProfile; 7309 pWriteProfile->_messageLogger.SetParentLogger(_messageLogger); 7310 TmpWriteProfile._messageLogger.DeleteLogs(); 7818 7311 } 7819 7312 … … 7825 7318 do 7826 7319 { 7827 pszTemp = TmpConfigSys.BuildFromText(pszTemp, ppScriptError, 7828 pusErrorTableSize, 0); 7320 pszTemp = TmpConfigSys.BuildFromText(pszTemp, 0); 7829 7321 if (pszTemp) 7830 7322 { … … 7832 7324 TmpConfigSys.SetIndex(pConfigSys->ReturnIndex()); 7833 7325 *pConfigSys = TmpConfigSys; 7326 pConfigSys->_messageLogger.SetParentLogger(_messageLogger); 7327 TmpConfigSys._messageLogger.DeleteLogs(); 7834 7328 } 7835 7329 … … 7841 7335 do 7842 7336 { 7843 pszTemp = TmpKillProcess.BuildFromText(pszTemp, ppScriptError, 7844 pusErrorTableSize, 0); 7337 pszTemp = TmpKillProcess.BuildFromText(pszTemp, 0); 7845 7338 if (pszTemp) 7846 7339 { … … 7848 7341 TmpKillProcess.SetIndex(pKillProcess->ReturnIndex()); 7849 7342 *pKillProcess = TmpKillProcess; 7343 pKillProcess->_messageLogger.SetParentLogger(_messageLogger); 7344 TmpKillProcess._messageLogger.DeleteLogs(); 7850 7345 } 7851 7346 … … 7856 7351 do 7857 7352 { 7858 pszTemp = TmpCreateObject.BuildFromText(pszTemp, ppScriptError, 7859 pusErrorTableSize, 0); 7353 pszTemp = TmpCreateObject.BuildFromText(pszTemp, 0); 7860 7354 if (pszTemp) 7861 7355 { … … 7863 7357 TmpCreateObject.SetIndex(pCreateObject->ReturnIndex()); 7864 7358 *pCreateObject = TmpCreateObject; 7359 pCreateObject->_messageLogger.SetParentLogger(_messageLogger); 7360 TmpCreateObject._messageLogger.DeleteLogs(); 7865 7361 } 7866 7362 … … 7871 7367 do 7872 7368 { 7873 pszTemp = TmpRegClass.BuildFromText(pszTemp, ppScriptError, 7874 pusErrorTableSize, 0); 7369 pszTemp = TmpRegClass.BuildFromText(pszTemp, 0); 7875 7370 if (pszTemp) 7876 7371 { … … 7878 7373 TmpRegClass.SetIndex(pRegClass->ReturnIndex()); 7879 7374 *pRegClass = TmpRegClass; 7375 pRegClass->_messageLogger.SetParentLogger(_messageLogger); 7376 TmpRegClass._messageLogger.DeleteLogs(); 7880 7377 } 7881 7378 … … 7886 7383 do 7887 7384 { 7888 pszTemp = TmpRepClass.BuildFromText(pszTemp, ppScriptError, 7889 pusErrorTableSize, 0); 7385 pszTemp = TmpRepClass.BuildFromText(pszTemp, 0); 7890 7386 if (pszTemp) 7891 7387 { … … 7893 7389 TmpRepClass.SetIndex(pRepClass->ReturnIndex()); 7894 7390 *pRepClass = TmpRepClass; 7391 pRepClass->_messageLogger.SetParentLogger(_messageLogger); 7392 TmpRepClass._messageLogger.DeleteLogs(); 7895 7393 } 7896 7394 7897 7395 } while (pszTemp != NULL); 7396 7397 7398 BSString message = _messageLogger.ReturnComposedMessageString(); 7898 7399 7899 7400 … … 8099 7600 * Constructor for ScriptGroup class. 8100 7601 */ 8101 ScriptGroup::ScriptGroup( constScriptGroup &Group)7602 ScriptGroup::ScriptGroup(ScriptGroup &Group) 8102 7603 { 8103 7604 (*this) = Group; … … 8108 7609 *@@ ScriptGroup::~ScriptGroup 8109 7610 * Destructor for ScriptGroup class. 7611 * 7612 *@@ changed v0.9.5 (2000-08-22) [tahola]: clearning of the fields are moved 7613 * to ClearAll() function. 8110 7614 */ 8111 7615 ScriptGroup::~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 */ 7627 USHORT ScriptGroup::ClearAll() 8112 7628 { 8113 7629 this->usIndex = 1; … … 8130 7646 8131 7647 8132 8133 7648 /*************************************************************************** 8134 7649 *@@ ScriptGroup::ScriptGroup &operator= 8135 7650 * Assignment operator for ScriptGroup class. 8136 7651 */ 8137 ScriptGroup &ScriptGroup::operator=( constScriptGroup &Group)7652 ScriptGroup &ScriptGroup::operator=(ScriptGroup &Group) 8138 7653 { 8139 7654 USHORT usIndex = 0; … … 8686 8201 * changed. 8687 8202 */ 8688 ScriptPackage *ScriptGroup::CreatePackageObject( constScriptPackage *pPck)8203 ScriptPackage *ScriptGroup::CreatePackageObject(ScriptPackage *pPck) 8689 8204 { 8690 8205 ScriptPackage *pTempPck = CreatePackageObject(); … … 8867 8382 ulRc = strhGetBlock(pszText, &ulSearchOffset, SZ_TAG_GROUP, &pszBlock, 8868 8383 &pszAttrs, &ulOffsetBeginTag, &ulOffsetBeginBlock); 8869 pszTemp = Title.BuildFromText(pszAttrs, NULL, NULL,0);8384 pszTemp = Title.BuildFromText(pszAttrs, 0); 8870 8385 pszTemp = Expanded.BuildFromText(pszAttrs, NULL, NULL, 0); 8871 8386 } … … 8881 8396 { 8882 8397 // Clear TmpGroup before build it from the text. 8883 TmpGroup. ScriptGroup::~ScriptGroup();8398 TmpGroup.ClearAll(); 8884 8399 pszBlock = TmpGroup.BuildFromText(pszBlock, NULL, NULL, 0); 8885 8400 if (pszBlock) … … 8895 8410 // Clear TmpPackage before build it from the text by calling 8896 8411 // destructor. 8897 TmpPackage. ScriptPackage::~ScriptPackage();8898 pszBlock = TmpPackage.BuildFromText(pszBlock, NULL, NULL,0);8412 TmpPackage.ClearAll(); 8413 pszBlock = TmpPackage.BuildFromText(pszBlock, 0); 8899 8414 if (pszBlock) 8900 8415 { … … 8902 8417 TmpPackage.SetIndex(pPackage->ReturnIndex()); 8903 8418 *pPackage = TmpPackage; 8419 TmpPackage._messageLogger.DeleteLogs(); 8904 8420 } 8905 8421 } … … 10558 10074 { 10559 10075 XSTRING strScript; 10560 xstrInit(&strScript, 0); 10076 xstrInit(&strScript, 0);; 10561 10077 PSZ pszTemp = NULL; 10562 10078 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 1 12 #define INCL_PM 2 13 #define INCL_WIN … … 13 24 #include "helpers\dosh.h" 14 25 #include "helpers\linklist.h" 26 #include <list> 15 27 #include "helpers\cnrh.h" 28 #include "helpers\stringh.h" 29 #include "helpers\xstring.h" 30 #include "base\bs_string.h" 16 31 17 32 #include "wicpm\script.hpp" … … 31 46 32 47 // Globals. 33 HWND hwndStatusDlg = NULLHANDLE;34 35 36 /* ***************************************************************************37 *@@ 38 * this is the callback function which is48 HWND g_hwndStatusDlg = NULLHANDLE; 49 HEV g_hevStatusDlgReady = 0; 50 51 /* 52 *@@WICallback: 53 * This is the callback function which is 39 54 * given to the WIArchive class. 40 55 * in: … … 43 58 * file header of current file 44 59 */ 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]60 int 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? 49 64 { 50 65 int rc = CBRC_ABORT; … … 53 68 case CBM_PERCENTAGE: 54 69 { 55 WinPostMsg( hwndStatusDlg, USER_ARCTM_FILE_PRECENTAGE,70 WinPostMsg(g_hwndStatusDlg, USER_ARCTM_FILE_PRECENTAGE, 56 71 MPFROMSHORT(s), MPFROMP(pwifh->name)); 72 // Wait main thread to set the semaphore. 73 DosWaitEventSem(g_hevStatusDlgReady, SEM_INDEFINITE_WAIT); 57 74 break; 58 75 } 59 76 case CBM_UPDATING: 60 77 { 61 WinPostMsg( hwndStatusDlg, USER_ARCTM_FILE_UPDATING,78 WinPostMsg(g_hwndStatusDlg, USER_ARCTM_FILE_UPDATING, 62 79 MPFROMSHORT(s), MPFROMP(pwifh->name)); 80 // Wait main thread to set the semaphore. 81 DosWaitEventSem(g_hevStatusDlgReady, SEM_INDEFINITE_WAIT); 63 82 break; 64 83 } … … 69 88 70 89 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 */ 72 102 VOID _Optlink thTradArcThread (PVOID pThreadArg) 73 103 { … … 76 106 TradArcThreadInfo* pThreadInfo = (TradArcThreadInfo*)pThreadArg; 77 107 78 hwndStatusDlg = pThreadInfo->hwndStatusDlg; 108 g_hwndStatusDlg = pThreadInfo->hwndStatusDlg; 109 g_hevStatusDlgReady = pThreadInfo->hevStatusDlgReady; 79 110 80 111 pThreadInfo->bThreadBusy = TRUE; … … 121 152 // Post message to the status dialog so it can show some information about 122 153 // 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); 125 156 // Wait until the status dialog is ready. 126 //DosWaitEventSem(pThreadInfo->hevStatusDlgReady, SEM_INDEFINITE_WAIT);157 DosWaitEventSem(pThreadInfo->hevStatusDlgReady, SEM_INDEFINITE_WAIT); 127 158 128 159 Arc.setPackage((LONG)pDBPackageThis->usPckIndexAttr, szPackageName); 129 160 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. 131 165 list<DBFile*> listFiles; 132 166 DBFile *pDBFile = NULL; … … 161 195 PSZ pszScript = pThreadInfo->pWarpIN->MakeScriptText(); 162 196 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. 164 201 WinPostMsg(pThreadInfo->hwndStatusDlg, USER_ARCTM_SET_SCRIPT, 165 202 MPFROMLONG(strlen(pszScript)), 0); … … 174 211 //DosWaitEventSem(pThreadInfo->hevStatusDlgReady, SEM_INDEFINITE_WAIT); 175 212 213 // Now the real file processing starts. We will get a lot of callbacks to 214 // WICallback function from WIArchive object. 176 215 Arc.close(); 177 216 -
TabularUnified trunk/src/wicpm/wicpm.def ¶
r170 r172 6 6 NAME WICPM WINDOWAPI 7 7 8 Description '@#OS/2 Netlabs:0.9.1 2#@ WarpIN PM archive builder'8 Description '@#OS/2 Netlabs:0.9.11#@ WarpIN PM archive builder' 9 9 PROTMODE 10 STACKSIZE 6553610 STACKSIZE 40480 11 11 -
TabularUnified trunk/src/wicpm/wicpm.dlg ¶
r118 r172 2 2 #include <os2.h> 3 3 #endif 4 DLGINCLUDE 1 "E:\PROJECTS\Netlabs\ WarpIN\include\wicpm\wicpmres.h"4 DLGINCLUDE 1 "E:\PROJECTS\Netlabs\warpin\include\wicpm\wicpmres.h" 5 5 6 6 DLGTEMPLATE IDD_NB_BROWSER_DIALOG LOADONCALL MOVEABLE DISCARDABLE … … 79 79 END 80 80 81 DLGTEMPLATE IDD_NB_REQUIRES_DIALOG LOADONCALL MOVEABLE DISCARDABLE82 BEGIN83 DIALOG "Requires", IDD_NB_REQUIRES_DIALOG, 12, 6, 249, 99, NOT84 FS_DLGBORDER | FS_BORDER | WS_VISIBLE | NOT WS_SAVEBITS85 BEGIN86 RTEXT "Vendor:", -1, 2, 87, 58, 887 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"88 RTEXT "Application:", -1, 2, 73, 58, 889 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"90 RTEXT "Package ID:", -1, 2, 59, 58, 891 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"92 RTEXT "Version:", -1, 3, 45, 57, 893 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"94 ENTRYFIELD "", IDD_NB_REQUIRES_VENDOR, 64, 87, 113, 8,95 ES_MARGIN96 ENTRYFIELD "", IDD_NB_REQUIRES_APPLICATION, 64, 73, 113, 8,97 ES_MARGIN98 ENTRYFIELD "", IDD_NB_REQUIRES_PACKAGE, 64, 59, 113, 8,99 ES_MARGIN100 ENTRYFIELD "", IDD_NB_REQUIRES_VERSIONMAJOR, 92, 45, 32, 8,101 ES_MARGIN102 LISTBOX IDD_NB_REQUIRES_LIST, 184, 3, 61, 94, LS_NOADJUSTPOS |103 LS_HORZSCROLL104 PUSHBUTTON "~Add", IDD_NB_REQUIRES_ADD, 6, 4, 40, 14105 PUSHBUTTON "~Remove", IDD_NB_REQUIRES_REMOVE, 49, 4, 40, 14,106 WS_DISABLED107 RTEXT "Major:", -1, 63, 45, 26, 8108 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"109 RTEXT "Minor:", -1, 52, 31, 37, 8110 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"111 ENTRYFIELD "", IDD_NB_REQUIRES_VERSIONMINOR, 92, 31, 32, 8,112 ES_MARGIN113 END114 END115 116 81 DLGTEMPLATE IDD_ASNB_PAGE_DIALOG LOADONCALL MOVEABLE DISCARDABLE 117 82 BEGIN … … 121 86 CONTAINER IDD_ASNB_PAGE_CONTAINER, 2, 22, 245, 75, 122 87 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 124 90 PUSHBUTTON "~Remove", IDD_ASNB_PAGE_REMOVE, 49, 4, 41, 14 125 91 END … … 250 216 NOTEBOOK IDD_ADDPCK_NOTEBOOK, 0, 19, 318, 145, 251 217 BKS_BACKPAGESBR | BKS_TABTEXTCENTER | WS_GROUP | 0x800 252 END253 END254 255 DLGTEMPLATE IDD_NB_GENERAL_DIALOG LOADONCALL MOVEABLE DISCARDABLE256 BEGIN257 DIALOG "General", IDD_NB_GENERAL_DIALOG, 69, 30, 249, 99, NOT258 FS_DLGBORDER | FS_BORDER | WS_VISIBLE | NOT WS_SAVEBITS259 BEGIN260 RTEXT "Package ID:", -1, 2, 73, 77, 8261 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"262 RTEXT "Author:", -1, 2, 60, 77, 8263 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"264 RTEXT "Application name:", -1, 2, 47, 77, 8265 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"266 RTEXT "Version number:", -1, 2, 34, 77, 8267 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"268 RTEXT "Target path:", -1, 2, 21, 77, 8269 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"270 RTEXT "Title:", -1, 2, 8, 77, 8271 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"272 ENTRYFIELD "", IDD_NB_GENERAL_PCKNAME, 82, 73, 161, 8,273 ES_MARGIN274 ENTRYFIELD "", IDD_NB_GENERAL_AUTHORNAME, 82, 60, 161, 8,275 ES_MARGIN276 ENTRYFIELD "", IDD_NB_GENERAL_APPNAME, 82, 47, 161, 8,277 ES_MARGIN278 ENTRYFIELD "", IDD_NB_GENERAL_VERSIONMAJOR, 108, 34, 15, 8,279 ES_MARGIN280 ENTRYFIELD "", IDD_NB_GENERAL_VERSIONMINOR, 156, 34, 15, 8,281 ES_MARGIN282 ENTRYFIELD "", IDD_NB_GENERAL_TARGETPATH, 82, 21, 161, 8,283 ES_MARGIN284 ENTRYFIELD "", IDD_NB_GENERAL_TITLE, 82, 8, 161, 8, ES_MARGIN285 RTEXT "Major:", -1, 80, 34, 25, 8286 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"287 RTEXT "Minor:", -1, 126, 34, 27, 8288 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"289 RTEXT "Index:", -1, 6, 86, 73, 8290 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"291 ENTRYFIELD "", IDD_NB_GENERAL_INDEX, 82, 86, 32, 8, ES_MARGIN |292 ES_READONLY293 RTEXT "Revision:", -1, 175, 34, 40, 8294 PRESPARAMS PP_FONTNAMESIZE, "10.Helv"295 ENTRYFIELD "", IDD_NB_GENERAL_VERSIONREVISION, 218, 34, 15, 8,296 ES_MARGIN297 218 END 298 219 END … … 583 504 "6-2000 Julian R Seward.", -1, 2, 39, 241, 8 584 505 PRESPARAMS PP_FONTNAMESIZE, "8.Helv" 585 LTEXT "WicPM front end (C) 1999-00 Teemu Ahola.", -1, 2,586 30, 242, 8506 LTEXT "WicPM front and back ends (C) 1999-00 Teemu Ahola.", 507 -1, 2, 30, 242, 8 587 508 PRESPARAMS PP_FONTNAMESIZE, "8.Helv" 588 509 ICON IDM_MAIN, -1, 13, 66, 21, 16, WS_GROUP … … 786 707 END 787 708 END 709 710 DLGTEMPLATE IDD_NB_GENERAL_DIALOG LOADONCALL MOVEABLE DISCARDABLE 711 BEGIN 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 754 END 755 756 DLGTEMPLATE IDD_NB_REQUIRES_DIALOG LOADONCALL MOVEABLE DISCARDABLE 757 BEGIN 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 802 END -
TabularUnified trunk/src/wicpm/wicpm.rc ¶
r118 r172 24 24 MENUITEM "Open s~cript...", IDM_MAIN_FILE_OPENSCRIPT 25 25 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 27 29 MENUITEM "~Print...", IDM_MAIN_FILE_PRINT 28 30 MENUITEM "P~rinter setup...", IDM_MAIN_FILE_PRINTERSETUP*/ … … 89 91 END 90 92 93 STRINGTABLE 94 BEGIN 95 WPMSI_MAINWND_TITLE "WarpIN Archive Creator" 96 END 97 91 98 92 99 rcinclude "wicpm.dlg"
Note:
See TracChangeset
for help on using the changeset viewer.