Include/NSISArray.nsh
changeset 0 d5ce4c64ef88
equal deleted inserted replaced
-1:000000000000 0:d5ce4c64ef88
       
     1 #####################################################
       
     2 # NSISArray.nsh by Afrow UK
       
     3 # Array script header for NSISArray plugin by Afrow UK
       
     4 # For usage, see Docs\NSISArray\Readme.html
       
     5 #
       
     6 # Script header v1.3 (RC3)
       
     7 # Only for use with the same plugin version.
       
     8 #
       
     9 # Last modified: 28th April 2005
       
    10 #
       
    11 #
       
    12 
       
    13 !ifndef NSISArray
       
    14 !define NSISArray
       
    15 
       
    16 !macro Array Name Size StrLen
       
    17 
       
    18  !ifndef Array_ScriptHeaderInited
       
    19 
       
    20   !ifdef ArrayCallInstDLL
       
    21    !define ArrayPluginDLL `${ArrayCallInstDLL}`
       
    22   !else ifndef ArrayPluginDLL
       
    23    !define ArrayPluginDLL `NSISArray`
       
    24   !endif
       
    25 
       
    26   !ifndef ArrayValVar
       
    27    Var ArrayVal
       
    28    !define ArrayValVar $ArrayVal
       
    29   !endif
       
    30 
       
    31   !ifndef ArrayErrVar
       
    32    Var ArrayErr
       
    33    !define ArrayErrVar $ArrayErr
       
    34   !endif
       
    35 
       
    36  !define Array_ScriptHeaderInited
       
    37  !endif
       
    38 
       
    39  !ifndef `Array_${Name}_Declared`
       
    40 
       
    41  !ifdef Array_Obj
       
    42   !undef Array_Obj
       
    43  !endif
       
    44  !define Array_Obj `->`
       
    45 
       
    46  !ifdef ArrayObj
       
    47   !undef ArrayObj
       
    48  !endif
       
    49  !define ArrayObj `!insertmacro ArrayObj`
       
    50 
       
    51  !ifdef Array_Name
       
    52   !undef Array_Name
       
    53  !endif
       
    54  !define Array_Name "${Name}"
       
    55 
       
    56  !ifdef Array_Size
       
    57   !undef Array_Size
       
    58  !endif
       
    59  !define Array_Size "${Size}"
       
    60 
       
    61  !ifdef Array_StrLen
       
    62   !undef Array_StrLen
       
    63  !endif
       
    64  !define Array_StrLen "${StrLen}"
       
    65 
       
    66  !define `Array_${Name}_Declared`
       
    67  !else
       
    68   !error "NSISArray: You cannot declare more than one array with the same name."
       
    69  !endif
       
    70 !macroend
       
    71 !define Array `!insertmacro Array`
       
    72 
       
    73 !macro ArrayObj Obj
       
    74  !ifdef Array_Obj
       
    75   !undef Array_Obj
       
    76  !endif
       
    77  !define Array_Obj `${Obj}`
       
    78 !macroend
       
    79 
       
    80 !macro Array_ObjErr Null
       
    81  !error "NSISArray: You can only set the array object style once."
       
    82 !macroend
       
    83 
       
    84 !macro ArrayFunc Func
       
    85 
       
    86  !define `Func_${Func}`
       
    87  !ifdef Func_Inited \
       
    88       | Func_Print \
       
    89       | Func_Write \
       
    90       | Func_WriteList \
       
    91       | Func_WriteListC \
       
    92       | Func_Put \
       
    93       | Func_Read \
       
    94       | Func_ReadToStack \
       
    95       | Func_Cut \
       
    96       | Func_Push \
       
    97       | Func_Pop \
       
    98       | Func_Shift \
       
    99       | Func_Unshift \
       
   100       | Func_Reverse \
       
   101       | Func_Sort \
       
   102       | Func_Clear \
       
   103       | Func_Splice \
       
   104       | Func_Swap \
       
   105       | Func_Copy \
       
   106       | Func_Join \
       
   107       | Func_Concat \
       
   108       | Func_Exists \
       
   109       | Func_ExistsI \
       
   110       | Func_Search \
       
   111       | Func_SearchI \
       
   112       | Func_SizeOf \
       
   113       | Func_ReadFirst \
       
   114       | Func_ReadNext \
       
   115       | Func_ReadClose \
       
   116       | Func_Debug \
       
   117       | Func_SetSize \
       
   118       | Func_ReDim \
       
   119       | Func_FreeUnusedMem
       
   120 
       
   121   !ifndef Array_Name
       
   122    !error "NSISArray: Please declare an array before declaring functions."
       
   123   !else
       
   124 
       
   125    !ifndef `Array_FuncDefined_${Array_Name}${Func}`
       
   126     !define `Array_FuncDefined_${Array_Name}${Func}`
       
   127    !else
       
   128     !error "NSISArray: You cannot declare a function more than once."
       
   129    !endif
       
   130 
       
   131    !ifdef ArrayObj
       
   132     !undef ArrayObj
       
   133    !endif
       
   134    !define ArrayObj `!insertmacro Array_ObjErr`
       
   135 
       
   136    !ifndef "${Array_Name}${Array_Obj}Init"
       
   137     !define "${Array_Name}${Array_Obj}Init" `!insertmacro Array_Init "${Array_Name}" "${Array_Size}" "${Array_StrLen}"`
       
   138    !endif
       
   139    !ifndef "${Array_Name}${Array_Obj}Delete"
       
   140     !define "${Array_Name}${Array_Obj}Delete" `!insertmacro Array_Delete "${Array_Name}"`
       
   141    !endif
       
   142 
       
   143    !ifdef ArrayCallInstDLL
       
   144     !ifdef Func_WriteList
       
   145      !define "${Array_Name}${Array_Obj}WriteListBegin" `!insertmacro Array_WriteListBegin `
       
   146      !define "${Array_Name}${Array_Obj}WriteListItem"  `!insertmacro Array_WriteListItem`
       
   147      !define "${Array_Name}${Array_Obj}WriteListEnd"   `!insertmacro Array_WriteListEnd "${Array_Name}"`
       
   148     !else \
       
   149      ifdef Func_Splice
       
   150      !define "${Array_Name}${Array_Obj}SpliceBegin" `!insertmacro Array_SpliceBegin `
       
   151      !define "${Array_Name}${Array_Obj}SpliceItem"  `!insertmacro Array_SpliceItem`
       
   152      !define "${Array_Name}${Array_Obj}SpliceEnd"   `!insertmacro Array_SpliceEnd "${Array_Name}"`
       
   153     !else
       
   154      !define "${Array_Name}${Array_Obj}${Func}" `!insertmacro Array_${Func} "${Array_Name}"`
       
   155     !endif
       
   156    !else
       
   157     !define "${Array_Name}${Array_Obj}${Func}" `!insertmacro Array_${Func} "${Array_Name}"`
       
   158    !endif
       
   159 
       
   160   !endif
       
   161 
       
   162  !else \
       
   163   ifdef Func_Init \
       
   164       | Func_Delete
       
   165   !error "NSISArray: You do not need to declare the Init and Delete functions."
       
   166  !else
       
   167   !error "NSISArray: An invalid function Name has been declared."
       
   168  !endif
       
   169  !undef `Func_${Func}`
       
   170 
       
   171 !macroend
       
   172 !define ArrayFunc `!insertmacro ArrayFunc`
       
   173 
       
   174 !macro Array_ErrorStyle ErrorStyle
       
   175  !define `ErrorStyle_${ErrorStyle}`
       
   176  !ifdef ErrorStyle_logwin
       
   177   !define ErrorStyleNum 5
       
   178  !else ifdef ErrorStyle_msgbox
       
   179   !define ErrorStyleNum 3
       
   180  !else
       
   181   !define ErrorStyleNum 1
       
   182  !endif
       
   183  !ifndef ArrayCallInstDLL
       
   184   ${ArrayPluginDLL}::ErrorStyle /NOUNLOAD "${ErrorStyleNum}"
       
   185  !else
       
   186   Push "${ErrorStyleNum}"
       
   187   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD ErrorStyle
       
   188  !endif
       
   189  !undef ErrorStyleNum
       
   190  !undef `ErrorStyle_${ErrorStyle}`
       
   191 !macroend
       
   192 !define ArrayErrorStyle `!insertmacro Array_ErrorStyle`
       
   193 
       
   194 !macro Array_PopErrVar
       
   195  Pop "${ArrayErrVar}"
       
   196  !ifdef ArraySetErrors
       
   197   StrCmp "${ArrayErrVar}" 0 +2
       
   198   SetErrors
       
   199  !endif
       
   200 !macroend
       
   201 !define Array_PopErrVar `!insertmacro Array_PopErrVar`
       
   202 
       
   203 !macro Array_Init Name Size StrLen
       
   204  !ifndef `Array_${Name}_Inited`
       
   205  !ifndef ArrayCallInstDLL
       
   206   ${ArrayPluginDLL}::ErrorStyle /NOUNLOAD ""
       
   207   Pop "${ArrayErrVar}"
       
   208   StrCmp "${ArrayErrVar}" 3 +3
       
   209   StrCmp "${ArrayErrVar}" 5 +2
       
   210   ${ArrayPluginDLL}::ErrorStyle /NOUNLOAD "1"
       
   211  !else
       
   212   Push ""
       
   213   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD ErrorStyle
       
   214   Pop "${ArrayErrVar}"
       
   215   StrCmp "${ArrayErrVar}" 3 +4
       
   216   StrCmp "${ArrayErrVar}" 5 +3
       
   217   Push "1"
       
   218   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD ErrorStyle
       
   219  !endif
       
   220  !ifndef ArrayCallInstDLL
       
   221   ${ArrayPluginDLL}::New /NOUNLOAD "${Name}" "${Size}" "${StrLen}"
       
   222  !else
       
   223   Push "${StrLen}"
       
   224   Push "${Size}"
       
   225   Push "${Name}"
       
   226   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD New
       
   227  !endif
       
   228  ${Array_PopErrVar}
       
   229  !define `Array_${Name}_Inited`
       
   230  !else
       
   231   !error "NSISArray: An array can only be initialised once."
       
   232  !endif
       
   233 !macroend
       
   234 
       
   235 !macro Array_Delete Name
       
   236  !ifndef ArrayCallInstDLL
       
   237   ${ArrayPluginDLL}::Delete /NOUNLOAD "${Name}"
       
   238  ${Array_PopErrVar}
       
   239   ${ArrayPluginDLL}::ArrayCount /NOUNLOAD
       
   240    Pop "${ArrayValVar}"
       
   241   StrCmp "${ArrayValVar}" 0 0 +2
       
   242   ${ArrayPluginDLL}::Unload
       
   243  !else
       
   244   Push "${Name}"
       
   245   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Delete
       
   246  ${Array_PopErrVar}
       
   247   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD ArrayCount
       
   248    Pop "${ArrayValVar}"
       
   249   StrCmp "${ArrayValVar}" 0 0 +2
       
   250   CallInstDLL `${ArrayPluginDLL}` Unload
       
   251  !endif
       
   252 !macroend
       
   253 
       
   254 !macro Array_ReDim Name Size StrLen
       
   255  !ifndef ArrayCallInstDLL
       
   256   ${ArrayPluginDLL}::ReDim /NOUNLOAD "${Name}" "${Size}" "${StrLen}"
       
   257  !else
       
   258   Push "${StrLen}"
       
   259   Push "${Size}"
       
   260   Push "${Name}"
       
   261   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD ReDim
       
   262  !endif
       
   263  ${Array_PopErrVar}
       
   264 !macroend
       
   265 
       
   266 !macro Array_FreeUnusedMem Name
       
   267  !ifndef ArrayCallInstDLL
       
   268   ${ArrayPluginDLL}::FreeUnusedMem /NOUNLOAD "${Name}"
       
   269  !else
       
   270   Push "${Name}"
       
   271   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD FreeUnusedMem
       
   272  !endif
       
   273  ${Array_PopErrVar}
       
   274 !macroend
       
   275 
       
   276 !macro Array_Inited Name JumpInited JumpNotInited
       
   277  !ifndef ArrayCallInstDLL
       
   278   ${ArrayPluginDLL}::ArrayExists /NOUNLOAD "${Name}"
       
   279  !else
       
   280   Push "${Name}"
       
   281   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD ArrayExists
       
   282  !endif
       
   283  ${Array_PopErrVar}
       
   284   Pop "${ArrayValVar}"
       
   285  StrCmp "${ArrayValVar}" 1 "${JumpInited}" "${JumpNotInited}"
       
   286 !macroend
       
   287 
       
   288 !macro Array_Write Name Index Value
       
   289  !ifndef ArrayCallInstDLL
       
   290   ${ArrayPluginDLL}::Write /NOUNLOAD "${Name}" "${Index}" "${Value}"
       
   291  !else
       
   292   Push "${Value}"
       
   293   Push "${Index}"
       
   294   Push "${Name}"
       
   295   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Write
       
   296  !endif
       
   297  ${Array_PopErrVar}
       
   298 !macroend
       
   299 
       
   300 !ifndef ArrayCallInstDLL
       
   301 !macro Array_WriteList Name List
       
   302   ${ArrayPluginDLL}::WriteList /NOUNLOAD "${Name}" ${List} "/END"
       
   303  ${Array_PopErrVar}
       
   304 !macroend
       
   305 !else
       
   306 !macro Array_WriteListBegin
       
   307   Push "/END"
       
   308 !macroend
       
   309 !macro Array_WriteListItem Item
       
   310   Push `${Item}`
       
   311 !macroend
       
   312 !macro Array_WriteListEnd Name
       
   313   Push "${Name}"
       
   314   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD WriteList
       
   315  ${Array_PopErrVar}
       
   316 !macroend
       
   317 !endif
       
   318 
       
   319 !macro Array_WriteListC Name List Char
       
   320  !ifndef ArrayCallInstDLL
       
   321   ${ArrayPluginDLL}::WriteListC /NOUNLOAD "${Name}" "${List}" "${Char}"
       
   322  !else
       
   323   Push "${Char}"
       
   324   Push "${List}"
       
   325   Push "${Name}"
       
   326   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD WriteListC
       
   327  !endif
       
   328  ${Array_PopErrVar}
       
   329 !macroend
       
   330 
       
   331 !macro Array_Put Name Index Value
       
   332  !ifndef ArrayCallInstDLL
       
   333   ${ArrayPluginDLL}::Put /NOUNLOAD "${Name}" "${Index}" "${Value}"
       
   334  !else
       
   335   Push "${Value}"
       
   336   Push "${Index}"
       
   337   Push "${Name}"
       
   338   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Put
       
   339  !endif
       
   340  ${Array_PopErrVar}
       
   341 !macroend
       
   342 
       
   343 !macro Array_Read Name Var Index
       
   344  !ifndef ArrayCallInstDLL
       
   345   ${ArrayPluginDLL}::Read /NOUNLOAD "${Name}" "${Index}"
       
   346  !else
       
   347   Push "${Index}"
       
   348   Push "${Name}"
       
   349   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Read
       
   350  !endif
       
   351  ${Array_PopErrVar}
       
   352   Pop "${Var}"
       
   353 !macroend
       
   354 
       
   355 !macro Array_ReadToStack Name IndexA IndexB
       
   356  !ifndef ArrayCallInstDLL
       
   357   ${ArrayPluginDLL}::ReadToStack /NOUNLOAD "${Name}" "${IndexA}" "${IndexB}"
       
   358  !else
       
   359   Push "${IndexB}"
       
   360   Push "${IndexA}"
       
   361   Push "${Name}"
       
   362   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD ReadToStack
       
   363  !endif
       
   364  ${Array_PopErrVar}
       
   365 !macroend
       
   366 
       
   367 !macro Array_Cut Name Var Index
       
   368  !ifndef ArrayCallInstDLL
       
   369   ${ArrayPluginDLL}::Cut /NOUNLOAD "${Name}" "${Index}"
       
   370  !else
       
   371   Push "${Index}"
       
   372   Push "${Name}"
       
   373   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Cut
       
   374  !endif
       
   375  ${Array_PopErrVar}
       
   376   Pop "${Var}"
       
   377 !macroend
       
   378 
       
   379 !macro Array_Push Name Value
       
   380  !ifndef ArrayCallInstDLL
       
   381   ${ArrayPluginDLL}::Push /NOUNLOAD "${Name}" "${Value}"
       
   382  !else
       
   383   Push "${Value}"
       
   384   Push "${Name}"
       
   385   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Push
       
   386  !endif
       
   387  ${Array_PopErrVar}
       
   388 !macroend
       
   389 
       
   390 !macro Array_Pop Name Var
       
   391  !ifndef ArrayCallInstDLL
       
   392   ${ArrayPluginDLL}::Pop /NOUNLOAD "${Name}"
       
   393  !else
       
   394   Push "${Name}"
       
   395   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Pop
       
   396  !endif
       
   397  ${Array_PopErrVar}
       
   398   Pop "${Var}"
       
   399 !macroend
       
   400 
       
   401 !macro Array_Shift Name Value
       
   402  !ifndef ArrayCallInstDLL
       
   403   ${ArrayPluginDLL}::Shift /NOUNLOAD "${Name}" "${Value}"
       
   404  !else
       
   405   Push "${Value}"
       
   406   Push "${Name}"
       
   407   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Shift
       
   408  !endif
       
   409  ${Array_PopErrVar}
       
   410 !macroend
       
   411 
       
   412 !macro Array_Unshift Name Var
       
   413  !ifndef ArrayCallInstDLL
       
   414   ${ArrayPluginDLL}::Unshift /NOUNLOAD "${Name}"
       
   415  !else
       
   416   Push "${Name}"
       
   417   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Unshift
       
   418  !endif
       
   419  ${Array_PopErrVar}
       
   420   Pop "${Var}"
       
   421 !macroend
       
   422 
       
   423 !macro Array_Reverse Name
       
   424  !ifndef ArrayCallInstDLL
       
   425   ${ArrayPluginDLL}::Reverse /NOUNLOAD "${Name}"
       
   426  !else
       
   427   Push "${Name}"
       
   428   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Reverse
       
   429  !endif
       
   430  ${Array_PopErrVar}
       
   431 !macroend
       
   432 
       
   433 !macro Array_Sort NameA NameB
       
   434  !ifndef ArrayCallInstDLL
       
   435   ${ArrayPluginDLL}::Sort /NOUNLOAD "${NameA}" "${NameB}"
       
   436  !else
       
   437   Push "${NameB}"
       
   438   Push "${NameA}"
       
   439   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Sort
       
   440  !endif
       
   441  ${Array_PopErrVar}
       
   442 !macroend
       
   443 
       
   444 !macro Array_Clear Name
       
   445  !ifndef ArrayCallInstDLL
       
   446   ${ArrayPluginDLL}::Clear /NOUNLOAD "${Name}"
       
   447  !else
       
   448   Push "${Name}"
       
   449   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Clear
       
   450  !endif
       
   451  ${Array_PopErrVar}
       
   452 !macroend
       
   453 
       
   454 !ifndef ArrayCallInstDLL
       
   455 !macro Array_Splice Name IndexA IndexB List
       
   456  ${ArrayPluginDLL}::Splice /NOUNLOAD "${Name}" "${IndexA}" "${IndexB}" ${List} "/END"
       
   457  ${Array_PopErrVar}
       
   458 !macroend
       
   459 !else
       
   460 !macro Array_SpliceBegin IndexA IndexB
       
   461  !define Array_Splice_IndexA `${IndexA}`
       
   462  !define Array_Splice_IndexB `${IndexB}`
       
   463   Push "/END"
       
   464 !macroend
       
   465 !macro Array_SpliceItem Item
       
   466   Push `${Item}`
       
   467 !macroend
       
   468 !macro Array_SpliceEnd Name
       
   469   Push "${Array_Splice_IndexB}"
       
   470   Push "${Array_Splice_IndexA}"
       
   471   Push "${Name}"
       
   472   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Splice
       
   473  ${Array_PopErrVar}
       
   474   !undef Array_Splice_IndexB
       
   475   !undef Array_Splice_IndexA
       
   476 !macroend
       
   477 !endif
       
   478 
       
   479 !macro Array_Swap Name IndexA IndexB
       
   480  !ifndef ArrayCallInstDLL
       
   481   ${ArrayPluginDLL}::Swap /NOUNLOAD "${Name}" "${IndexA}" "${IndexB}"
       
   482  !else
       
   483   Push "${IndexB}"
       
   484   Push "${IndexA}"
       
   485   Push "${Name}"
       
   486   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Swap
       
   487  !endif
       
   488  ${Array_PopErrVar}
       
   489 !macroend
       
   490 
       
   491 !macro Array_Copy Name ToArray
       
   492  !ifndef ArrayCallInstDLL
       
   493   ${ArrayPluginDLL}::Copy /NOUNLOAD "${Name}" "${ToArray}"
       
   494  !else
       
   495   Push "${ToArray}"
       
   496   Push "${Name}"
       
   497   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Copy
       
   498  !endif
       
   499  ${Array_PopErrVar}
       
   500 !macroend
       
   501 
       
   502 !macro Array_Join Name ToArray
       
   503  !ifndef ArrayCallInstDLL
       
   504   ${ArrayPluginDLL}::Join /NOUNLOAD "${Name}" "${ToArray}"
       
   505  !else
       
   506   Push "${ToArray}"
       
   507   Push "${Name}"
       
   508   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Join
       
   509  !endif
       
   510  ${Array_PopErrVar}
       
   511 !macroend
       
   512 
       
   513 !macro Array_Concat Name Var Chars
       
   514  !ifndef ArrayCallInstDLL
       
   515   ${ArrayPluginDLL}::Concat /NOUNLOAD "${Name}" "${Chars}"
       
   516  !else
       
   517   Push "${Chars}"
       
   518   Push "${Name}"
       
   519   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Concat
       
   520  !endif
       
   521  ${Array_PopErrVar}
       
   522   Pop "${Var}"
       
   523 !macroend
       
   524 
       
   525 !macro Array_Exists Name Var Value Index
       
   526  !ifndef ArrayCallInstDLL
       
   527   ${ArrayPluginDLL}::Exists /NOUNLOAD "${Name}" "${Value}" "${Index}"
       
   528  !else
       
   529   Push "${Index}"
       
   530   Push "${Value}"
       
   531   Push "${Name}"
       
   532   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Exists
       
   533  !endif
       
   534  ${Array_PopErrVar}
       
   535   Pop "${Var}"
       
   536 !macroend
       
   537 
       
   538 !macro Array_ExistsI Name Var Value Index
       
   539  !ifndef ArrayCallInstDLL
       
   540   ${ArrayPluginDLL}::ExistsI /NOUNLOAD "${Name}" "${Value}" "${Index}"
       
   541  !else
       
   542   Push "${Index}"
       
   543   Push "${Value}"
       
   544   Push "${Name}"
       
   545   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD ExistsI
       
   546  !endif
       
   547  ${Array_PopErrVar}
       
   548   Pop "${Var}"
       
   549 !macroend
       
   550 
       
   551 !macro Array_Search Name Var Value Index
       
   552  !ifndef ArrayCallInstDLL
       
   553   ${ArrayPluginDLL}::Search /NOUNLOAD "${Name}" "${Value}" "${Index}"
       
   554  !else
       
   555   Push "${Index}"
       
   556   Push "${Value}"
       
   557   Push "${Name}"
       
   558   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Search
       
   559  !endif
       
   560  ${Array_PopErrVar}
       
   561   Pop "${Var}"
       
   562 !macroend
       
   563 
       
   564 !macro Array_SearchI Name Var Value Index
       
   565  !ifndef ArrayCallInstDLL
       
   566   ${ArrayPluginDLL}::SearchI /NOUNLOAD "${Name}" "${Value}" "${Index}"
       
   567  !else
       
   568   Push "${Index}"
       
   569   Push "${Value}"
       
   570   Push "${Name}"
       
   571   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD SearchI
       
   572  !endif
       
   573  ${Array_PopErrVar}
       
   574   Pop "${Var}"
       
   575 !macroend
       
   576 
       
   577 !macro Array_SizeOf Name VarItems VarSize VarStrLen
       
   578  !ifndef ArrayCallInstDLL
       
   579   ${ArrayPluginDLL}::SizeOf /NOUNLOAD "${Name}"
       
   580  !else
       
   581   Push "${Name}"
       
   582   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD SizeOf
       
   583  !endif
       
   584  ${Array_PopErrVar}
       
   585   Pop "${VarStrLen}"
       
   586   Pop "${VarSize}"
       
   587   Pop "${VarItems}"
       
   588 !macroend
       
   589 
       
   590 !macro Array_Debug Name
       
   591  !ifndef ArrayCallInstDLL
       
   592   ${ArrayPluginDLL}::Debug /NOUNLOAD "${Name}"
       
   593  !else
       
   594   Push "${Name}"
       
   595   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Debug
       
   596  !endif
       
   597  ${Array_PopErrVar}
       
   598 !macroend
       
   599 
       
   600 !macro Array_SetSize Name Size
       
   601  !ifndef ArrayCallInstDLL
       
   602   ${ArrayPluginDLL}::SetSize /NOUNLOAD "${Name}" "${Size}"
       
   603  !else
       
   604   Push "${Size}"
       
   605   Push "${Name}"
       
   606   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD SetSize
       
   607  !endif
       
   608  ${Array_PopErrVar}
       
   609 !macroend
       
   610 
       
   611 !macro Array_ReadFirst Name Handle Var
       
   612  !tempfile F
       
   613  !delfile ${F}
       
   614  !define Local ${__LINE__}-${F}
       
   615  !undef F
       
   616  !ifndef ArrayCallInstDLL
       
   617   ${ArrayPluginDLL}::SizeOf /NOUNLOAD "${Name}"
       
   618  !else
       
   619   Push "${Name}"
       
   620   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD SizeOf
       
   621  !endif
       
   622  ${Array_PopErrVar}
       
   623   Pop "${Var}"
       
   624   Pop "${Var}"
       
   625   Pop "${Var}"
       
   626   StrCmp "${Var}" 0 0 +4
       
   627    StrCpy "${Var}" ""
       
   628    SetErrors
       
   629    Goto Done_${Local}
       
   630  !ifndef ArrayCallInstDLL
       
   631   ${ArrayPluginDLL}::Read /NOUNLOAD "${Name}" "0"
       
   632  !else
       
   633   Push "0"
       
   634   Push "${Name}"
       
   635   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Read
       
   636  !endif
       
   637  ${Array_PopErrVar}
       
   638   Pop "${Var}"
       
   639   StrCpy "${Handle}" 1
       
   640  Done_${Local}:
       
   641  !undef Local
       
   642 !macroend
       
   643 
       
   644 !macro Array_ReadNext Name Handle Var
       
   645  !tempfile F
       
   646  !delfile ${F}
       
   647  !define Local ${__LINE__}-${F}
       
   648  !undef F
       
   649  !ifndef ArrayCallInstDLL
       
   650   ${ArrayPluginDLL}::SizeOf /NOUNLOAD "${Name}"
       
   651  !else
       
   652   Push "${Name}"
       
   653   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD SizeOf
       
   654  !endif
       
   655  ${Array_PopErrVar}
       
   656   Pop "${Var}"
       
   657   Pop "${Var}"
       
   658   Pop "${Var}"
       
   659   StrCmp "${Var}" "${Handle}" 0 +4
       
   660    StrCpy "${Var}" ""
       
   661    SetErrors
       
   662    Goto Done_${Local}
       
   663  !ifndef ArrayCallInstDLL
       
   664   ${ArrayPluginDLL}::Read /NOUNLOAD "${Name}" "${Handle}"
       
   665  !else
       
   666   Push "${Handle}"
       
   667   Push "${Name}"
       
   668   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Read
       
   669  !endif
       
   670  ${Array_PopErrVar}
       
   671   Pop "${Var}"
       
   672   IntOp "${Handle}" "${Handle}" + 1
       
   673  Done_${Local}:
       
   674  !undef Local
       
   675 !macroend
       
   676 
       
   677 !macro Array_ReadClose Name Handle
       
   678  StrCpy "${Handle}" ""
       
   679 !macroend
       
   680 
       
   681 !macro Array_Print Name Index
       
   682  !ifndef ArrayCallInstDLL
       
   683   ${ArrayPluginDLL}::Read /NOUNLOAD "${Name}" "${Index}"
       
   684  !else
       
   685   Push "${Index}"
       
   686   Push "${Name}"
       
   687   CallInstDLL `${ArrayPluginDLL}` /NOUNLOAD Read
       
   688  !endif
       
   689  ${Array_PopErrVar}
       
   690   Pop "${ArrayValVar}"
       
   691   DetailPrint "${ArrayValVar}"
       
   692 !macroend
       
   693 
       
   694 !endif