Statistiques
| Révision :

root / tmp / org.txm.setups / nsis-2.5 / Include / TextFunc.nsh @ 3100

Historique | Voir | Annoter | Télécharger (23,84 ko)

1 2961 mdecorde
/*
2 2961 mdecorde
_____________________________________________________________________________
3 2961 mdecorde
4 2961 mdecorde
                       Text Functions Header v2.4
5 2961 mdecorde
_____________________________________________________________________________
6 2961 mdecorde
7 2961 mdecorde
 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
8 2961 mdecorde
9 2961 mdecorde
 See documentation for more information about the following functions.
10 2961 mdecorde
11 2961 mdecorde
 Usage in script:
12 2961 mdecorde
 1. !include "TextFunc.nsh"
13 2961 mdecorde
 2. [Section|Function]
14 2961 mdecorde
      ${TextFunction} "File" "..."  $var
15 2961 mdecorde
    [SectionEnd|FunctionEnd]
16 2961 mdecorde
17 2961 mdecorde
18 2961 mdecorde
 TextFunction=[LineFind|LineRead|FileReadFromEnd|LineSum|FileJoin|
19 2961 mdecorde
               TextCompare|TextCompareS|ConfigRead|ConfigReadS|
20 2961 mdecorde
               ConfigWrite|ConfigWriteS|FileRecode|TrimNewLines]
21 2961 mdecorde
22 2961 mdecorde
_____________________________________________________________________________
23 2961 mdecorde
24 2961 mdecorde
                       Thanks to:
25 2961 mdecorde
_____________________________________________________________________________
26 2961 mdecorde
27 2961 mdecorde
LineRead
28 2961 mdecorde
	Afrow UK (Based on his idea of Function "ReadFileLine")
29 2961 mdecorde
LineSum
30 2961 mdecorde
	Afrow UK (Based on his idea of Function "LineCount")
31 2961 mdecorde
FileJoin
32 2961 mdecorde
	Afrow UK (Based on his idea of Function "JoinFiles")
33 2961 mdecorde
ConfigRead
34 2961 mdecorde
	vbgunz (His idea)
35 2961 mdecorde
ConfigWrite
36 2961 mdecorde
	vbgunz (His idea)
37 2961 mdecorde
TrimNewLines
38 2961 mdecorde
	sunjammer (Based on his Function "TrimNewLines")
39 2961 mdecorde
*/
40 2961 mdecorde
41 2961 mdecorde
42 2961 mdecorde
;_____________________________________________________________________________
43 2961 mdecorde
;
44 2961 mdecorde
;                                   Macros
45 2961 mdecorde
;_____________________________________________________________________________
46 2961 mdecorde
;
47 2961 mdecorde
; Change log window verbosity (default: 3=no script)
48 2961 mdecorde
;
49 2961 mdecorde
; Example:
50 2961 mdecorde
; !include "TextFunc.nsh"
51 2961 mdecorde
; !insertmacro LineFind
52 2961 mdecorde
; ${TEXTFUNC_VERBOSE} 4   # all verbosity
53 2961 mdecorde
; !insertmacro LineSum
54 2961 mdecorde
; ${TEXTFUNC_VERBOSE} 3   # no script
55 2961 mdecorde
56 2961 mdecorde
!ifndef TEXTFUNC_INCLUDED
57 2961 mdecorde
!define TEXTFUNC_INCLUDED
58 2961 mdecorde
59 2961 mdecorde
!include FileFunc.nsh
60 2961 mdecorde
!include Util.nsh
61 2961 mdecorde
62 2961 mdecorde
!verbose push
63 2961 mdecorde
!verbose 3
64 2961 mdecorde
!ifndef _TEXTFUNC_VERBOSE
65 2961 mdecorde
	!define _TEXTFUNC_VERBOSE 3
66 2961 mdecorde
!endif
67 2961 mdecorde
!verbose ${_TEXTFUNC_VERBOSE}
68 2961 mdecorde
!define TEXTFUNC_VERBOSE `!insertmacro TEXTFUNC_VERBOSE`
69 2961 mdecorde
!verbose pop
70 2961 mdecorde
71 2961 mdecorde
!macro TEXTFUNC_VERBOSE _VERBOSE
72 2961 mdecorde
	!verbose push
73 2961 mdecorde
	!verbose 3
74 2961 mdecorde
	!undef _TEXTFUNC_VERBOSE
75 2961 mdecorde
	!define _TEXTFUNC_VERBOSE ${_VERBOSE}
76 2961 mdecorde
	!verbose pop
77 2961 mdecorde
!macroend
78 2961 mdecorde
79 2961 mdecorde
!macro LineFindCall _INPUT _OUTPUT _RANGE _FUNC
80 2961 mdecorde
	!verbose push
81 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
82 2961 mdecorde
	Push $0
83 2961 mdecorde
	Push `${_INPUT}`
84 2961 mdecorde
	Push `${_OUTPUT}`
85 2961 mdecorde
	Push `${_RANGE}`
86 2961 mdecorde
	GetFunctionAddress $0 `${_FUNC}`
87 2961 mdecorde
	Push `$0`
88 2961 mdecorde
	${CallArtificialFunction} LineFind_
89 2961 mdecorde
	Pop $0
90 2961 mdecorde
	!verbose pop
91 2961 mdecorde
!macroend
92 2961 mdecorde
93 2961 mdecorde
!macro LineReadCall _FILE _NUMBER _RESULT
94 2961 mdecorde
	!verbose push
95 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
96 2961 mdecorde
	Push `${_FILE}`
97 2961 mdecorde
	Push `${_NUMBER}`
98 2961 mdecorde
	${CallArtificialFunction} LineRead_
99 2961 mdecorde
	Pop ${_RESULT}
100 2961 mdecorde
	!verbose pop
101 2961 mdecorde
!macroend
102 2961 mdecorde
103 2961 mdecorde
!macro FileReadFromEndCall _FILE _FUNC
104 2961 mdecorde
	!verbose push
105 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
106 2961 mdecorde
	Push $0
107 2961 mdecorde
	Push `${_FILE}`
108 2961 mdecorde
	GetFunctionAddress $0 `${_FUNC}`
109 2961 mdecorde
	Push `$0`
110 2961 mdecorde
	${CallArtificialFunction} FileReadFromEnd_
111 2961 mdecorde
	Pop $0
112 2961 mdecorde
	!verbose pop
113 2961 mdecorde
!macroend
114 2961 mdecorde
115 2961 mdecorde
!macro LineSumCall _FILE _RESULT
116 2961 mdecorde
	!verbose push
117 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
118 2961 mdecorde
	Push `${_FILE}`
119 2961 mdecorde
	${CallArtificialFunction} LineSum_
120 2961 mdecorde
	Pop ${_RESULT}
121 2961 mdecorde
	!verbose pop
122 2961 mdecorde
!macroend
123 2961 mdecorde
124 2961 mdecorde
!macro FileJoinCall _FILE1 _FILE2 _FILE3
125 2961 mdecorde
	!verbose push
126 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
127 2961 mdecorde
	Push `${_FILE1}`
128 2961 mdecorde
	Push `${_FILE2}`
129 2961 mdecorde
	Push `${_FILE3}`
130 2961 mdecorde
	${CallArtificialFunction} FileJoin_
131 2961 mdecorde
	!verbose pop
132 2961 mdecorde
!macroend
133 2961 mdecorde
134 2961 mdecorde
!macro TextCompareCall _FILE1 _FILE2 _OPTION _FUNC
135 2961 mdecorde
	!verbose push
136 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
137 2961 mdecorde
	Push $0
138 2961 mdecorde
	Push `${_FILE1}`
139 2961 mdecorde
	Push `${_FILE2}`
140 2961 mdecorde
	Push `${_OPTION}`
141 2961 mdecorde
	GetFunctionAddress $0 `${_FUNC}`
142 2961 mdecorde
	Push `$0`
143 2961 mdecorde
	${CallArtificialFunction} TextCompare_
144 2961 mdecorde
	Pop $0
145 2961 mdecorde
	!verbose pop
146 2961 mdecorde
!macroend
147 2961 mdecorde
148 2961 mdecorde
!macro TextCompareSCall _FILE1 _FILE2 _OPTION _FUNC
149 2961 mdecorde
	!verbose push
150 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
151 2961 mdecorde
	Push $0
152 2961 mdecorde
	Push `${_FILE1}`
153 2961 mdecorde
	Push `${_FILE2}`
154 2961 mdecorde
	Push `${_OPTION}`
155 2961 mdecorde
	GetFunctionAddress $0 `${_FUNC}`
156 2961 mdecorde
	Push `$0`
157 2961 mdecorde
	${CallArtificialFunction} TextCompareS_
158 2961 mdecorde
	Pop $0
159 2961 mdecorde
	!verbose pop
160 2961 mdecorde
!macroend
161 2961 mdecorde
162 2961 mdecorde
!macro ConfigReadCall _FILE _ENTRY _RESULT
163 2961 mdecorde
	!verbose push
164 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
165 2961 mdecorde
	Push `${_FILE}`
166 2961 mdecorde
	Push `${_ENTRY}`
167 2961 mdecorde
	${CallArtificialFunction} ConfigRead_
168 2961 mdecorde
	Pop ${_RESULT}
169 2961 mdecorde
	!verbose pop
170 2961 mdecorde
!macroend
171 2961 mdecorde
172 2961 mdecorde
!macro ConfigReadSCall _FILE _ENTRY _RESULT
173 2961 mdecorde
	!verbose push
174 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
175 2961 mdecorde
	Push `${_FILE}`
176 2961 mdecorde
	Push `${_ENTRY}`
177 2961 mdecorde
	${CallArtificialFunction} ConfigReadS_
178 2961 mdecorde
	Pop ${_RESULT}
179 2961 mdecorde
	!verbose pop
180 2961 mdecorde
!macroend
181 2961 mdecorde
182 2961 mdecorde
!macro ConfigWriteCall _FILE _ENTRY _VALUE _RESULT
183 2961 mdecorde
	!verbose push
184 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
185 2961 mdecorde
	Push `${_FILE}`
186 2961 mdecorde
	Push `${_ENTRY}`
187 2961 mdecorde
	Push `${_VALUE}`
188 2961 mdecorde
	${CallArtificialFunction} ConfigWrite_
189 2961 mdecorde
	Pop ${_RESULT}
190 2961 mdecorde
	!verbose pop
191 2961 mdecorde
!macroend
192 2961 mdecorde
193 2961 mdecorde
!macro ConfigWriteSCall _FILE _ENTRY _VALUE _RESULT
194 2961 mdecorde
	!verbose push
195 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
196 2961 mdecorde
	Push `${_FILE}`
197 2961 mdecorde
	Push `${_ENTRY}`
198 2961 mdecorde
	Push `${_VALUE}`
199 2961 mdecorde
	${CallArtificialFunction} ConfigWriteS_
200 2961 mdecorde
	Pop ${_RESULT}
201 2961 mdecorde
	!verbose pop
202 2961 mdecorde
!macroend
203 2961 mdecorde
204 2961 mdecorde
!macro FileRecodeCall _FILE _FORMAT
205 2961 mdecorde
	!verbose push
206 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
207 2961 mdecorde
	Push `${_FILE}`
208 2961 mdecorde
	Push `${_FORMAT}`
209 2961 mdecorde
	${CallArtificialFunction} FileRecode_
210 2961 mdecorde
	!verbose pop
211 2961 mdecorde
!macroend
212 2961 mdecorde
213 2961 mdecorde
!macro TrimNewLinesCall _FILE _RESULT
214 2961 mdecorde
	!verbose push
215 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
216 2961 mdecorde
	Push `${_FILE}`
217 2961 mdecorde
	${CallArtificialFunction} TrimNewLines_
218 2961 mdecorde
	Pop ${_RESULT}
219 2961 mdecorde
	!verbose pop
220 2961 mdecorde
!macroend
221 2961 mdecorde
222 2961 mdecorde
!macro _TextFunc_TempFileForFile _FILE _RESULT
223 2961 mdecorde
	# XXX replace with GetParent
224 2961 mdecorde
	Push `${_FILE}`
225 2961 mdecorde
	Exch $0
226 2961 mdecorde
	Push $1
227 2961 mdecorde
	Push $2
228 2961 mdecorde
229 2961 mdecorde
	StrCpy $2 $0 1 -1
230 2961 mdecorde
	StrCmp $2 '\' 0 +3
231 2961 mdecorde
	StrCpy $0 $0 -1
232 2961 mdecorde
	goto -3
233 2961 mdecorde
234 2961 mdecorde
	StrCpy $1 0
235 2961 mdecorde
	IntOp $1 $1 - 1
236 2961 mdecorde
	StrCpy $2 $0 1 $1
237 2961 mdecorde
	StrCmp $2 '\' +2
238 2961 mdecorde
	StrCmp $2 '' 0 -3
239 2961 mdecorde
	StrCpy $0 $0 $1
240 2961 mdecorde
241 2961 mdecorde
	Pop $2
242 2961 mdecorde
	Pop $1
243 2961 mdecorde
	Exch $0
244 2961 mdecorde
	Pop ${_RESULT}
245 2961 mdecorde
	# XXX
246 2961 mdecorde
	StrCmp ${_RESULT} "" 0 +2
247 2961 mdecorde
		StrCpy ${_RESULT} $EXEDIR
248 2961 mdecorde
	GetTempFileName ${_RESULT} ${_RESULT}
249 2961 mdecorde
	StrCmp ${_RESULT} "" 0 +2
250 2961 mdecorde
		GetTempFileName ${_RESULT}
251 2961 mdecorde
	ClearErrors
252 2961 mdecorde
!macroend
253 2961 mdecorde
254 2961 mdecorde
!define LineFind `!insertmacro LineFindCall`
255 2961 mdecorde
!define un.LineFind `!insertmacro LineFindCall`
256 2961 mdecorde
257 2961 mdecorde
!macro LineFind
258 2961 mdecorde
!macroend
259 2961 mdecorde
260 2961 mdecorde
!macro un.LineFind
261 2961 mdecorde
!macroend
262 2961 mdecorde
263 2961 mdecorde
!macro LineFind_
264 2961 mdecorde
	!verbose push
265 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
266 2961 mdecorde
267 2961 mdecorde
	Exch $3
268 2961 mdecorde
	Exch
269 2961 mdecorde
	Exch $2
270 2961 mdecorde
	Exch
271 2961 mdecorde
	Exch 2
272 2961 mdecorde
	Exch $1
273 2961 mdecorde
	Exch 2
274 2961 mdecorde
	Exch 3
275 2961 mdecorde
	Exch $0
276 2961 mdecorde
	Exch 3
277 2961 mdecorde
	Push $4
278 2961 mdecorde
	Push $5
279 2961 mdecorde
	Push $6
280 2961 mdecorde
	Push $7
281 2961 mdecorde
	Push $8
282 2961 mdecorde
	Push $9
283 2961 mdecorde
	Push $R4
284 2961 mdecorde
	Push $R5
285 2961 mdecorde
	Push $R6
286 2961 mdecorde
	Push $R7
287 2961 mdecorde
	Push $R8
288 2961 mdecorde
	Push $R9
289 2961 mdecorde
	ClearErrors
290 2961 mdecorde
291 2961 mdecorde
	IfFileExists '$0' 0 TextFunc_LineFind_error
292 2961 mdecorde
	StrCmp $1 '/NUL' TextFunc_LineFind_begin
293 2961 mdecorde
	StrCpy $8 0
294 2961 mdecorde
	IntOp $8 $8 - 1
295 2961 mdecorde
	StrCpy $9 $1 1 $8
296 2961 mdecorde
	StrCmp $9 \ +2
297 2961 mdecorde
	StrCmp $9 '' +3 -3
298 2961 mdecorde
	StrCpy $9 $1 $8
299 2961 mdecorde
	IfFileExists '$9\*.*' 0 TextFunc_LineFind_error
300 2961 mdecorde
301 2961 mdecorde
	TextFunc_LineFind_begin:
302 2961 mdecorde
	StrCpy $4 1
303 2961 mdecorde
	StrCpy $5 -1
304 2961 mdecorde
	StrCpy $6 0
305 2961 mdecorde
	StrCpy $7 0
306 2961 mdecorde
	StrCpy $R4 ''
307 2961 mdecorde
	StrCpy $R6 ''
308 2961 mdecorde
	StrCpy $R7 ''
309 2961 mdecorde
	StrCpy $R8 0
310 2961 mdecorde
311 2961 mdecorde
	StrCpy $8 $2 1
312 2961 mdecorde
	StrCmp $8 '{' 0 TextFunc_LineFind_delspaces
313 2961 mdecorde
	StrCpy $2 $2 '' 1
314 2961 mdecorde
	StrCpy $8 $2 1 -1
315 2961 mdecorde
	StrCmp $8 '}' 0 TextFunc_LineFind_delspaces
316 2961 mdecorde
	StrCpy $2 $2 -1
317 2961 mdecorde
	StrCpy $R6 TextFunc_LineFind_cut
318 2961 mdecorde
319 2961 mdecorde
	TextFunc_LineFind_delspaces:
320 2961 mdecorde
	StrCpy $8 $2 1
321 2961 mdecorde
	StrCmp $8 ' ' 0 +3
322 2961 mdecorde
	StrCpy $2 $2 '' 1
323 2961 mdecorde
	goto -3
324 2961 mdecorde
	StrCmp $2$7 '0' TextFunc_LineFind_file
325 2961 mdecorde
	StrCpy $4 ''
326 2961 mdecorde
	StrCpy $5 ''
327 2961 mdecorde
	StrCmp $2 '' TextFunc_LineFind_writechk
328 2961 mdecorde
329 2961 mdecorde
	TextFunc_LineFind_range:
330 2961 mdecorde
	StrCpy $8 0
331 2961 mdecorde
	StrCpy $9 $2 1 $8
332 2961 mdecorde
	StrCmp $9 '' +5
333 2961 mdecorde
	StrCmp $9 ' ' +4
334 2961 mdecorde
	StrCmp $9 ':' +3
335 2961 mdecorde
	IntOp $8 $8 + 1
336 2961 mdecorde
	goto -5
337 2961 mdecorde
	StrCpy $5 $2 $8
338 2961 mdecorde
	IntOp $5 $5 + 0
339 2961 mdecorde
	IntOp $8 $8 + 1
340 2961 mdecorde
	StrCpy $2 $2 '' $8
341 2961 mdecorde
	StrCmp $4 '' 0 +2
342 2961 mdecorde
	StrCpy $4 $5
343 2961 mdecorde
	StrCmp $9 ':' TextFunc_LineFind_range
344 2961 mdecorde
345 2961 mdecorde
	IntCmp $4 0 0 +2
346 2961 mdecorde
	IntCmp $5 -1 TextFunc_LineFind_goto 0 TextFunc_LineFind_growthcmp
347 2961 mdecorde
	StrCmp $R7 '' 0 TextFunc_LineFind_minus2plus
348 2961 mdecorde
	StrCpy $R7 0
349 2961 mdecorde
	FileOpen $8 $0 r
350 2961 mdecorde
	FileRead $8 $9
351 2961 mdecorde
	IfErrors +3
352 2961 mdecorde
	IntOp $R7 $R7 + 1
353 2961 mdecorde
	Goto -3
354 2961 mdecorde
	FileClose $8
355 2961 mdecorde
356 2961 mdecorde
	TextFunc_LineFind_minus2plus:
357 2961 mdecorde
	IntCmp $4 0 +5 0 +5
358 2961 mdecorde
	IntOp $4 $R7 + $4
359 2961 mdecorde
	IntOp $4 $4 + 1
360 2961 mdecorde
	IntCmp $4 0 +2 0 +2
361 2961 mdecorde
	StrCpy $4 0
362 2961 mdecorde
	IntCmp $5 -1 TextFunc_LineFind_goto 0 TextFunc_LineFind_growthcmp
363 2961 mdecorde
	IntOp $5 $R7 + $5
364 2961 mdecorde
	IntOp $5 $5 + 1
365 2961 mdecorde
	TextFunc_LineFind_growthcmp:
366 2961 mdecorde
	IntCmp $4 $5 TextFunc_LineFind_goto TextFunc_LineFind_goto
367 2961 mdecorde
	StrCpy $5 $4
368 2961 mdecorde
	TextFunc_LineFind_goto:
369 2961 mdecorde
	goto $7
370 2961 mdecorde
371 2961 mdecorde
	TextFunc_LineFind_file:
372 2961 mdecorde
	StrCmp $1 '/NUL' TextFunc_LineFind_notemp
373 2961 mdecorde
	!insertmacro _TextFunc_TempFileForFile $1 $R4
374 2961 mdecorde
	Push $R4
375 2961 mdecorde
	FileOpen $R4 $R4 w
376 2961 mdecorde
	TextFunc_LineFind_notemp:
377 2961 mdecorde
	FileOpen $R5 $0 r
378 2961 mdecorde
	IfErrors TextFunc_LineFind_preerror
379 2961 mdecorde
380 2961 mdecorde
	TextFunc_LineFind_loop:
381 2961 mdecorde
	IntOp $R8 $R8 + 1
382 2961 mdecorde
	FileRead $R5 $R9
383 2961 mdecorde
	IfErrors TextFunc_LineFind_handleclose
384 2961 mdecorde
385 2961 mdecorde
	TextFunc_LineFind_cmp:
386 2961 mdecorde
	StrCmp $2$4$5 '' TextFunc_LineFind_writechk
387 2961 mdecorde
	IntCmp $4 $R8 TextFunc_LineFind_call 0 TextFunc_LineFind_writechk
388 2961 mdecorde
	StrCmp $5 -1 TextFunc_LineFind_call
389 2961 mdecorde
	IntCmp $5 $R8 TextFunc_LineFind_call 0 TextFunc_LineFind_call
390 2961 mdecorde
391 2961 mdecorde
	GetLabelAddress $7 TextFunc_LineFind_cmp
392 2961 mdecorde
	goto TextFunc_LineFind_delspaces
393 2961 mdecorde
394 2961 mdecorde
	TextFunc_LineFind_call:
395 2961 mdecorde
	StrCpy $7 $R9
396 2961 mdecorde
	Push $0
397 2961 mdecorde
	Push $1
398 2961 mdecorde
	Push $2
399 2961 mdecorde
	Push $3
400 2961 mdecorde
	Push $4
401 2961 mdecorde
	Push $5
402 2961 mdecorde
	Push $6
403 2961 mdecorde
	Push $7
404 2961 mdecorde
	Push $R4
405 2961 mdecorde
	Push $R5
406 2961 mdecorde
	Push $R6
407 2961 mdecorde
	Push $R7
408 2961 mdecorde
	Push $R8
409 2961 mdecorde
	StrCpy $R6 '$4:$5'
410 2961 mdecorde
	StrCmp $R7 '' +3
411 2961 mdecorde
	IntOp $R7 $R8 - $R7
412 2961 mdecorde
	IntOp $R7 $R7 - 1
413 2961 mdecorde
	Call $3
414 2961 mdecorde
	Pop $9
415 2961 mdecorde
	Pop $R8
416 2961 mdecorde
	Pop $R7
417 2961 mdecorde
	Pop $R6
418 2961 mdecorde
	Pop $R5
419 2961 mdecorde
	Pop $R4
420 2961 mdecorde
	Pop $7
421 2961 mdecorde
	Pop $6
422 2961 mdecorde
	Pop $5
423 2961 mdecorde
	Pop $4
424 2961 mdecorde
	Pop $3
425 2961 mdecorde
	Pop $2
426 2961 mdecorde
	Pop $1
427 2961 mdecorde
	Pop $0
428 2961 mdecorde
	IfErrors TextFunc_LineFind_preerror
429 2961 mdecorde
	StrCmp $9 'StopLineFind' 0 +3
430 2961 mdecorde
	IntOp $6 $6 + 1
431 2961 mdecorde
	goto TextFunc_LineFind_handleclose
432 2961 mdecorde
	StrCmp $1 '/NUL' TextFunc_LineFind_loop
433 2961 mdecorde
	StrCmp $9 'SkipWrite' 0 +3
434 2961 mdecorde
	IntOp $6 $6 + 1
435 2961 mdecorde
	goto TextFunc_LineFind_loop
436 2961 mdecorde
	StrCmp $7 $R9 TextFunc_LineFind_write
437 2961 mdecorde
	IntOp $6 $6 + 1
438 2961 mdecorde
	goto TextFunc_LineFind_write
439 2961 mdecorde
440 2961 mdecorde
	TextFunc_LineFind_writechk:
441 2961 mdecorde
	StrCmp $1 '/NUL' TextFunc_LineFind_loop
442 2961 mdecorde
	StrCmp $R6 TextFunc_LineFind_cut 0 TextFunc_LineFind_write
443 2961 mdecorde
	IntOp $6 $6 + 1
444 2961 mdecorde
	goto TextFunc_LineFind_loop
445 2961 mdecorde
446 2961 mdecorde
	TextFunc_LineFind_write:
447 2961 mdecorde
	FileWrite $R4 $R9
448 2961 mdecorde
	goto TextFunc_LineFind_loop
449 2961 mdecorde
450 2961 mdecorde
	TextFunc_LineFind_preerror:
451 2961 mdecorde
	SetErrors
452 2961 mdecorde
453 2961 mdecorde
	TextFunc_LineFind_handleclose:
454 2961 mdecorde
	StrCmp $1 '/NUL' +3
455 2961 mdecorde
	FileClose $R4
456 2961 mdecorde
	Pop $R4
457 2961 mdecorde
	FileClose $R5
458 2961 mdecorde
	IfErrors TextFunc_LineFind_error
459 2961 mdecorde
460 2961 mdecorde
	StrCmp $1 '/NUL' TextFunc_LineFind_end
461 2961 mdecorde
	StrCmp $1 '' 0 +2
462 2961 mdecorde
	StrCpy $1 $0
463 2961 mdecorde
	StrCmp $6 0 0 TextFunc_LineFind_rename
464 2961 mdecorde
	FileOpen $7 $0 r
465 2961 mdecorde
	FileSeek $7 0 END $8
466 2961 mdecorde
	FileClose $7
467 2961 mdecorde
	FileOpen $7 $R4 r
468 2961 mdecorde
	FileSeek $7 0 END $9
469 2961 mdecorde
	FileClose $7
470 2961 mdecorde
	IntCmp $8 $9 0 TextFunc_LineFind_rename
471 2961 mdecorde
	Delete $R4
472 2961 mdecorde
	StrCmp $1 $0 TextFunc_LineFind_end
473 2961 mdecorde
	CopyFiles /SILENT $0 $1
474 2961 mdecorde
	goto TextFunc_LineFind_end
475 2961 mdecorde
476 2961 mdecorde
	TextFunc_LineFind_rename:
477 2961 mdecorde
	Delete '$EXEDIR\$1'
478 2961 mdecorde
	Rename $R4 '$EXEDIR\$1'
479 2961 mdecorde
	IfErrors 0 TextFunc_LineFind_end
480 2961 mdecorde
	Delete $1
481 2961 mdecorde
	Rename $R4 $1
482 2961 mdecorde
	IfErrors 0 TextFunc_LineFind_end
483 2961 mdecorde
484 2961 mdecorde
	TextFunc_LineFind_error:
485 2961 mdecorde
	SetErrors
486 2961 mdecorde
487 2961 mdecorde
	TextFunc_LineFind_end:
488 2961 mdecorde
	Pop $R9
489 2961 mdecorde
	Pop $R8
490 2961 mdecorde
	Pop $R7
491 2961 mdecorde
	Pop $R6
492 2961 mdecorde
	Pop $R5
493 2961 mdecorde
	Pop $R4
494 2961 mdecorde
	Pop $9
495 2961 mdecorde
	Pop $8
496 2961 mdecorde
	Pop $7
497 2961 mdecorde
	Pop $6
498 2961 mdecorde
	Pop $5
499 2961 mdecorde
	Pop $4
500 2961 mdecorde
	Pop $3
501 2961 mdecorde
	Pop $2
502 2961 mdecorde
	Pop $1
503 2961 mdecorde
	Pop $0
504 2961 mdecorde
505 2961 mdecorde
	!verbose pop
506 2961 mdecorde
!macroend
507 2961 mdecorde
508 2961 mdecorde
!define LineRead `!insertmacro LineReadCall`
509 2961 mdecorde
!define un.LineRead `!insertmacro LineReadCall`
510 2961 mdecorde
511 2961 mdecorde
!macro LineRead
512 2961 mdecorde
!macroend
513 2961 mdecorde
514 2961 mdecorde
!macro un.LineRead
515 2961 mdecorde
!macroend
516 2961 mdecorde
517 2961 mdecorde
!macro LineRead_
518 2961 mdecorde
	!verbose push
519 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
520 2961 mdecorde
521 2961 mdecorde
	Exch $1
522 2961 mdecorde
	Exch
523 2961 mdecorde
	Exch $0
524 2961 mdecorde
	Exch
525 2961 mdecorde
	Push $2
526 2961 mdecorde
	Push $3
527 2961 mdecorde
	Push $4
528 2961 mdecorde
	ClearErrors
529 2961 mdecorde
530 2961 mdecorde
	IfFileExists $0 0 TextFunc_LineRead_error
531 2961 mdecorde
	IntOp $1 $1 + 0
532 2961 mdecorde
	IntCmp $1 0 TextFunc_LineRead_error 0 TextFunc_LineRead_plus
533 2961 mdecorde
	StrCpy $4 0
534 2961 mdecorde
	FileOpen $2 $0 r
535 2961 mdecorde
	IfErrors TextFunc_LineRead_error
536 2961 mdecorde
	FileRead $2 $3
537 2961 mdecorde
	IfErrors +3
538 2961 mdecorde
	IntOp $4 $4 + 1
539 2961 mdecorde
	Goto -3
540 2961 mdecorde
	FileClose $2
541 2961 mdecorde
	IntOp $1 $4 + $1
542 2961 mdecorde
	IntOp $1 $1 + 1
543 2961 mdecorde
	IntCmp $1 0 TextFunc_LineRead_error TextFunc_LineRead_error
544 2961 mdecorde
545 2961 mdecorde
	TextFunc_LineRead_plus:
546 2961 mdecorde
	FileOpen $2 $0 r
547 2961 mdecorde
	IfErrors TextFunc_LineRead_error
548 2961 mdecorde
	StrCpy $3 0
549 2961 mdecorde
	IntOp $3 $3 + 1
550 2961 mdecorde
	FileRead $2 $0
551 2961 mdecorde
	IfErrors +4
552 2961 mdecorde
	StrCmp $3 $1 0 -3
553 2961 mdecorde
	FileClose $2
554 2961 mdecorde
	goto TextFunc_LineRead_end
555 2961 mdecorde
	FileClose $2
556 2961 mdecorde
557 2961 mdecorde
	TextFunc_LineRead_error:
558 2961 mdecorde
	SetErrors
559 2961 mdecorde
	StrCpy $0 ''
560 2961 mdecorde
561 2961 mdecorde
	TextFunc_LineRead_end:
562 2961 mdecorde
	Pop $4
563 2961 mdecorde
	Pop $3
564 2961 mdecorde
	Pop $2
565 2961 mdecorde
	Pop $1
566 2961 mdecorde
	Exch $0
567 2961 mdecorde
568 2961 mdecorde
	!verbose pop
569 2961 mdecorde
!macroend
570 2961 mdecorde
571 2961 mdecorde
!define FileReadFromEnd `!insertmacro FileReadFromEndCall`
572 2961 mdecorde
!define un.FileReadFromEnd `!insertmacro FileReadFromEndCall`
573 2961 mdecorde
574 2961 mdecorde
!macro FileReadFromEnd
575 2961 mdecorde
!macroend
576 2961 mdecorde
577 2961 mdecorde
!macro un.FileReadFromEnd
578 2961 mdecorde
!macroend
579 2961 mdecorde
580 2961 mdecorde
!macro FileReadFromEnd_
581 2961 mdecorde
	!verbose push
582 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
583 2961 mdecorde
584 2961 mdecorde
	Exch $1
585 2961 mdecorde
	Exch
586 2961 mdecorde
	Exch $0
587 2961 mdecorde
	Exch
588 2961 mdecorde
	Push $7
589 2961 mdecorde
	Push $8
590 2961 mdecorde
	Push $9
591 2961 mdecorde
	ClearErrors
592 2961 mdecorde
593 2961 mdecorde
	StrCpy $7 -1
594 2961 mdecorde
	StrCpy $8 0
595 2961 mdecorde
	IfFileExists $0 0 TextFunc_FileReadFromEnd_error
596 2961 mdecorde
	FileOpen $0 $0 r
597 2961 mdecorde
	IfErrors TextFunc_FileReadFromEnd_error
598 2961 mdecorde
	FileRead $0 $9
599 2961 mdecorde
	IfErrors +4
600 2961 mdecorde
	Push $9
601 2961 mdecorde
	IntOp $8 $8 + 1
602 2961 mdecorde
	goto -4
603 2961 mdecorde
	FileClose $0
604 2961 mdecorde
605 2961 mdecorde
	TextFunc_FileReadFromEnd_nextline:
606 2961 mdecorde
	StrCmp $8 0 TextFunc_FileReadFromEnd_end
607 2961 mdecorde
	Pop $9
608 2961 mdecorde
	Push $1
609 2961 mdecorde
	Push $7
610 2961 mdecorde
	Push $8
611 2961 mdecorde
	Call $1
612 2961 mdecorde
	Pop $0
613 2961 mdecorde
	Pop $8
614 2961 mdecorde
	Pop $7
615 2961 mdecorde
	Pop $1
616 2961 mdecorde
	IntOp $7 $7 - 1
617 2961 mdecorde
	IntOp $8 $8 - 1
618 2961 mdecorde
	IfErrors TextFunc_FileReadFromEnd_error
619 2961 mdecorde
	StrCmp $0 'StopFileReadFromEnd' TextFunc_FileReadFromEnd_clearstack TextFunc_FileReadFromEnd_nextline
620 2961 mdecorde
621 2961 mdecorde
	TextFunc_FileReadFromEnd_error:
622 2961 mdecorde
	SetErrors
623 2961 mdecorde
624 2961 mdecorde
	TextFunc_FileReadFromEnd_clearstack:
625 2961 mdecorde
	StrCmp $8 0 TextFunc_FileReadFromEnd_end
626 2961 mdecorde
	Pop $9
627 2961 mdecorde
	IntOp $8 $8 - 1
628 2961 mdecorde
	goto TextFunc_FileReadFromEnd_clearstack
629 2961 mdecorde
630 2961 mdecorde
	TextFunc_FileReadFromEnd_end:
631 2961 mdecorde
	Pop $9
632 2961 mdecorde
	Pop $8
633 2961 mdecorde
	Pop $7
634 2961 mdecorde
	Pop $1
635 2961 mdecorde
	Pop $0
636 2961 mdecorde
637 2961 mdecorde
	!verbose pop
638 2961 mdecorde
!macroend
639 2961 mdecorde
640 2961 mdecorde
!define LineSum `!insertmacro LineSumCall`
641 2961 mdecorde
!define un.LineSum `!insertmacro LineSumCall`
642 2961 mdecorde
643 2961 mdecorde
!macro LineSum
644 2961 mdecorde
!macroend
645 2961 mdecorde
646 2961 mdecorde
!macro un.LineSum
647 2961 mdecorde
!macroend
648 2961 mdecorde
649 2961 mdecorde
!macro LineSum_
650 2961 mdecorde
	!verbose push
651 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
652 2961 mdecorde
653 2961 mdecorde
	Exch $0
654 2961 mdecorde
	Push $1
655 2961 mdecorde
	Push $2
656 2961 mdecorde
	ClearErrors
657 2961 mdecorde
658 2961 mdecorde
	IfFileExists $0 0 TextFunc_LineSum_error
659 2961 mdecorde
	StrCpy $2 0
660 2961 mdecorde
	FileOpen $0 $0 r
661 2961 mdecorde
	IfErrors TextFunc_LineSum_error
662 2961 mdecorde
	FileRead $0 $1
663 2961 mdecorde
	IfErrors +3
664 2961 mdecorde
	IntOp $2 $2 + 1
665 2961 mdecorde
	Goto -3
666 2961 mdecorde
	FileClose $0
667 2961 mdecorde
	StrCpy $0 $2
668 2961 mdecorde
	goto TextFunc_LineSum_end
669 2961 mdecorde
670 2961 mdecorde
	TextFunc_LineSum_error:
671 2961 mdecorde
	SetErrors
672 2961 mdecorde
	StrCpy $0 ''
673 2961 mdecorde
674 2961 mdecorde
	TextFunc_LineSum_end:
675 2961 mdecorde
	Pop $2
676 2961 mdecorde
	Pop $1
677 2961 mdecorde
	Exch $0
678 2961 mdecorde
679 2961 mdecorde
	!verbose pop
680 2961 mdecorde
!macroend
681 2961 mdecorde
682 2961 mdecorde
!define FileJoin `!insertmacro FileJoinCall`
683 2961 mdecorde
!define un.FileJoin `!insertmacro FileJoinCall`
684 2961 mdecorde
685 2961 mdecorde
!macro FileJoin
686 2961 mdecorde
!macroend
687 2961 mdecorde
688 2961 mdecorde
!macro un.FileJoin
689 2961 mdecorde
!macroend
690 2961 mdecorde
691 2961 mdecorde
!macro FileJoin_
692 2961 mdecorde
	!verbose push
693 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
694 2961 mdecorde
695 2961 mdecorde
	Exch $2
696 2961 mdecorde
	Exch
697 2961 mdecorde
	Exch $1
698 2961 mdecorde
	Exch
699 2961 mdecorde
	Exch 2
700 2961 mdecorde
	Exch $0
701 2961 mdecorde
	Exch 2
702 2961 mdecorde
	Push $3
703 2961 mdecorde
	Push $4
704 2961 mdecorde
	Push $5
705 2961 mdecorde
	ClearErrors
706 2961 mdecorde
707 2961 mdecorde
	IfFileExists $0 0 TextFunc_FileJoin_error
708 2961 mdecorde
	IfFileExists $1 0 TextFunc_FileJoin_error
709 2961 mdecorde
	StrCpy $3 0
710 2961 mdecorde
	IntOp $3 $3 - 1
711 2961 mdecorde
	StrCpy $4 $2 1 $3
712 2961 mdecorde
	StrCmp $4 \ +2
713 2961 mdecorde
	StrCmp $4 '' +3 -3
714 2961 mdecorde
	StrCpy $4 $2 $3
715 2961 mdecorde
	IfFileExists '$4\*.*' 0 TextFunc_FileJoin_error
716 2961 mdecorde
717 2961 mdecorde
	StrCmp $2 $0 0 +2
718 2961 mdecorde
	StrCpy $2 ''
719 2961 mdecorde
	StrCmp $2 '' 0 +3
720 2961 mdecorde
	StrCpy $4 $0
721 2961 mdecorde
	Goto TextFunc_FileJoin_notemp
722 2961 mdecorde
	!insertmacro _TextFunc_TempFileForFile $2 $4
723 2961 mdecorde
	CopyFiles /SILENT $0 $4
724 2961 mdecorde
	TextFunc_FileJoin_notemp:
725 2961 mdecorde
	FileOpen $3 $4 a
726 2961 mdecorde
	IfErrors TextFunc_FileJoin_error
727 2961 mdecorde
	FileSeek $3 -1 END
728 2961 mdecorde
	FileRead $3 $5
729 2961 mdecorde
	StrCmp $5 '$\r' +3
730 2961 mdecorde
	StrCmp $5 '$\n' +2
731 2961 mdecorde
	FileWrite $3 '$\r$\n'
732 2961 mdecorde
733 2961 mdecorde
	;FileWrite $3 '$\r$\n--Divider--$\r$\n'
734 2961 mdecorde
735 2961 mdecorde
	FileOpen $0 $1 r
736 2961 mdecorde
	IfErrors TextFunc_FileJoin_error
737 2961 mdecorde
	FileRead $0 $5
738 2961 mdecorde
	IfErrors +3
739 2961 mdecorde
	FileWrite $3 $5
740 2961 mdecorde
	goto -3
741 2961 mdecorde
	FileClose $0
742 2961 mdecorde
	FileClose $3
743 2961 mdecorde
	StrCmp $2 '' TextFunc_FileJoin_end
744 2961 mdecorde
	Delete '$EXEDIR\$2'
745 2961 mdecorde
	Rename $4 '$EXEDIR\$2'
746 2961 mdecorde
	IfErrors 0 TextFunc_FileJoin_end
747 2961 mdecorde
	Delete $2
748 2961 mdecorde
	Rename $4 $2
749 2961 mdecorde
	IfErrors 0 TextFunc_FileJoin_end
750 2961 mdecorde
751 2961 mdecorde
	TextFunc_FileJoin_error:
752 2961 mdecorde
	SetErrors
753 2961 mdecorde
754 2961 mdecorde
	TextFunc_FileJoin_end:
755 2961 mdecorde
	Pop $5
756 2961 mdecorde
	Pop $4
757 2961 mdecorde
	Pop $3
758 2961 mdecorde
	Pop $2
759 2961 mdecorde
	Pop $1
760 2961 mdecorde
	Pop $0
761 2961 mdecorde
762 2961 mdecorde
	!verbose pop
763 2961 mdecorde
!macroend
764 2961 mdecorde
765 2961 mdecorde
!macro TextCompareBody _TEXTFUNC_S
766 2961 mdecorde
	Exch $3
767 2961 mdecorde
	Exch
768 2961 mdecorde
	Exch $2
769 2961 mdecorde
	Exch
770 2961 mdecorde
	Exch 2
771 2961 mdecorde
	Exch $1
772 2961 mdecorde
	Exch 2
773 2961 mdecorde
	Exch 3
774 2961 mdecorde
	Exch $0
775 2961 mdecorde
	Exch 3
776 2961 mdecorde
	Push $4
777 2961 mdecorde
	Push $5
778 2961 mdecorde
	Push $6
779 2961 mdecorde
	Push $7
780 2961 mdecorde
	Push $8
781 2961 mdecorde
	Push $9
782 2961 mdecorde
	ClearErrors
783 2961 mdecorde
784 2961 mdecorde
	IfFileExists $0 0 TextFunc_TextCompare${_TEXTFUNC_S}_error
785 2961 mdecorde
	IfFileExists $1 0 TextFunc_TextCompare${_TEXTFUNC_S}_error
786 2961 mdecorde
	StrCmp $2 'FastDiff' +5
787 2961 mdecorde
	StrCmp $2 'FastEqual' +4
788 2961 mdecorde
	StrCmp $2 'SlowDiff' +3
789 2961 mdecorde
	StrCmp $2 'SlowEqual' +2
790 2961 mdecorde
	goto TextFunc_TextCompare${_TEXTFUNC_S}_error
791 2961 mdecorde
792 2961 mdecorde
	FileOpen $4 $0 r
793 2961 mdecorde
	IfErrors TextFunc_TextCompare${_TEXTFUNC_S}_error
794 2961 mdecorde
	FileOpen $5 $1 r
795 2961 mdecorde
	IfErrors TextFunc_TextCompare${_TEXTFUNC_S}_error
796 2961 mdecorde
	SetDetailsPrint textonly
797 2961 mdecorde
798 2961 mdecorde
	StrCpy $6 0
799 2961 mdecorde
	StrCpy $8 0
800 2961 mdecorde
801 2961 mdecorde
	TextFunc_TextCompare${_TEXTFUNC_S}_nextline:
802 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_fast
803 2961 mdecorde
	IntOp $8 $8 + 1
804 2961 mdecorde
	FileRead $4 $9
805 2961 mdecorde
	IfErrors 0 +4
806 2961 mdecorde
	FileClose $4
807 2961 mdecorde
	StrCpy $4 ''
808 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $5 '' TextFunc_TextCompare${_TEXTFUNC_S}_end
809 2961 mdecorde
	StrCmp $2 'FastDiff' TextFunc_TextCompare${_TEXTFUNC_S}_fast
810 2961 mdecorde
	StrCmp $2 'FastEqual' TextFunc_TextCompare${_TEXTFUNC_S}_fast TextFunc_TextCompare${_TEXTFUNC_S}_slow
811 2961 mdecorde
812 2961 mdecorde
	TextFunc_TextCompare${_TEXTFUNC_S}_fast:
813 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $5 '' TextFunc_TextCompare${_TEXTFUNC_S}_call
814 2961 mdecorde
	IntOp $6 $6 + 1
815 2961 mdecorde
	FileRead $5 $7
816 2961 mdecorde
	IfErrors 0 +5
817 2961 mdecorde
	FileClose $5
818 2961 mdecorde
	StrCpy $5 ''
819 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_end
820 2961 mdecorde
	StrCmp $2 'FastDiff' TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_close
821 2961 mdecorde
	StrCmp $2 'FastDiff' 0 +2
822 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_nextline TextFunc_TextCompare${_TEXTFUNC_S}_call
823 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_nextline
824 2961 mdecorde
825 2961 mdecorde
	TextFunc_TextCompare${_TEXTFUNC_S}_slow:
826 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_close
827 2961 mdecorde
	StrCpy $6 ''
828 2961 mdecorde
	DetailPrint '$8. $9'
829 2961 mdecorde
	FileSeek $5 0
830 2961 mdecorde
831 2961 mdecorde
	TextFunc_TextCompare${_TEXTFUNC_S}_slownext:
832 2961 mdecorde
	FileRead $5 $7
833 2961 mdecorde
	IfErrors 0 +2
834 2961 mdecorde
	StrCmp $2 'SlowDiff' TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_nextline
835 2961 mdecorde
	StrCmp $2 'SlowDiff' 0 +2
836 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_nextline TextFunc_TextCompare${_TEXTFUNC_S}_slownext
837 2961 mdecorde
	IntOp $6 $6 + 1
838 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $7 $9 0 TextFunc_TextCompare${_TEXTFUNC_S}_slownext
839 2961 mdecorde
840 2961 mdecorde
	TextFunc_TextCompare${_TEXTFUNC_S}_call:
841 2961 mdecorde
	Push $2
842 2961 mdecorde
	Push $3
843 2961 mdecorde
	Push $4
844 2961 mdecorde
	Push $5
845 2961 mdecorde
	Push $6
846 2961 mdecorde
	Push $7
847 2961 mdecorde
	Push $8
848 2961 mdecorde
	Push $9
849 2961 mdecorde
	Call $3
850 2961 mdecorde
	Pop $0
851 2961 mdecorde
	Pop $9
852 2961 mdecorde
	Pop $8
853 2961 mdecorde
	Pop $7
854 2961 mdecorde
	Pop $6
855 2961 mdecorde
	Pop $5
856 2961 mdecorde
	Pop $4
857 2961 mdecorde
	Pop $3
858 2961 mdecorde
	Pop $2
859 2961 mdecorde
	StrCmp $0 'StopTextCompare' 0 TextFunc_TextCompare${_TEXTFUNC_S}_nextline
860 2961 mdecorde
861 2961 mdecorde
	TextFunc_TextCompare${_TEXTFUNC_S}_close:
862 2961 mdecorde
	FileClose $4
863 2961 mdecorde
	FileClose $5
864 2961 mdecorde
	goto TextFunc_TextCompare${_TEXTFUNC_S}_end
865 2961 mdecorde
866 2961 mdecorde
	TextFunc_TextCompare${_TEXTFUNC_S}_error:
867 2961 mdecorde
	SetErrors
868 2961 mdecorde
869 2961 mdecorde
	TextFunc_TextCompare${_TEXTFUNC_S}_end:
870 2961 mdecorde
	SetDetailsPrint both
871 2961 mdecorde
	Pop $9
872 2961 mdecorde
	Pop $8
873 2961 mdecorde
	Pop $7
874 2961 mdecorde
	Pop $6
875 2961 mdecorde
	Pop $5
876 2961 mdecorde
	Pop $4
877 2961 mdecorde
	Pop $3
878 2961 mdecorde
	Pop $2
879 2961 mdecorde
	Pop $1
880 2961 mdecorde
	Pop $0
881 2961 mdecorde
!macroend
882 2961 mdecorde
883 2961 mdecorde
!define TextCompare `!insertmacro TextCompareCall`
884 2961 mdecorde
!define un.TextCompare `!insertmacro TextCompareCall`
885 2961 mdecorde
886 2961 mdecorde
!macro TextCompare
887 2961 mdecorde
!macroend
888 2961 mdecorde
889 2961 mdecorde
!macro un.TextCompare
890 2961 mdecorde
!macroend
891 2961 mdecorde
892 2961 mdecorde
!macro TextCompare_
893 2961 mdecorde
	!verbose push
894 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
895 2961 mdecorde
896 2961 mdecorde
	!insertmacro TextCompareBody ''
897 2961 mdecorde
898 2961 mdecorde
	!verbose pop
899 2961 mdecorde
!macroend
900 2961 mdecorde
901 2961 mdecorde
!define TextCompareS `!insertmacro TextCompareSCall`
902 2961 mdecorde
!define un.TextCompareS `!insertmacro TextCompareSCall`
903 2961 mdecorde
904 2961 mdecorde
!macro TextCompareS
905 2961 mdecorde
!macroend
906 2961 mdecorde
907 2961 mdecorde
!macro un.TextCompareS
908 2961 mdecorde
!macroend
909 2961 mdecorde
910 2961 mdecorde
!macro TextCompareS_
911 2961 mdecorde
	!verbose push
912 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
913 2961 mdecorde
914 2961 mdecorde
	!insertmacro TextCompareBody 'S'
915 2961 mdecorde
916 2961 mdecorde
	!verbose pop
917 2961 mdecorde
!macroend
918 2961 mdecorde
919 2961 mdecorde
!macro ConfigReadBody _TEXTFUNC_S
920 2961 mdecorde
	Exch $1
921 2961 mdecorde
	Exch
922 2961 mdecorde
	Exch $0
923 2961 mdecorde
	Exch
924 2961 mdecorde
	Push $2
925 2961 mdecorde
	Push $3
926 2961 mdecorde
	Push $4
927 2961 mdecorde
	ClearErrors
928 2961 mdecorde
929 2961 mdecorde
	FileOpen $2 $0 r
930 2961 mdecorde
	IfErrors TextFunc_ConfigRead${_TEXTFUNC_S}_error
931 2961 mdecorde
	StrLen $0 $1
932 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $0 0 TextFunc_ConfigRead${_TEXTFUNC_S}_error
933 2961 mdecorde
934 2961 mdecorde
	TextFunc_ConfigRead${_TEXTFUNC_S}_readnext:
935 2961 mdecorde
	FileRead $2 $3
936 2961 mdecorde
	IfErrors TextFunc_ConfigRead${_TEXTFUNC_S}_error
937 2961 mdecorde
	StrCpy $4 $3 $0
938 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $4 $1 0 TextFunc_ConfigRead${_TEXTFUNC_S}_readnext
939 2961 mdecorde
	StrCpy $0 $3 '' $0
940 2961 mdecorde
	StrCpy $4 $0 1 -1
941 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $4 '$\r' +2
942 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $4 '$\n' 0 TextFunc_ConfigRead${_TEXTFUNC_S}_close
943 2961 mdecorde
	StrCpy $0 $0 -1
944 2961 mdecorde
	goto -4
945 2961 mdecorde
946 2961 mdecorde
	TextFunc_ConfigRead${_TEXTFUNC_S}_error:
947 2961 mdecorde
	SetErrors
948 2961 mdecorde
	StrCpy $0 ''
949 2961 mdecorde
950 2961 mdecorde
	TextFunc_ConfigRead${_TEXTFUNC_S}_close:
951 2961 mdecorde
	FileClose $2
952 2961 mdecorde
953 2961 mdecorde
	Pop $4
954 2961 mdecorde
	Pop $3
955 2961 mdecorde
	Pop $2
956 2961 mdecorde
	Pop $1
957 2961 mdecorde
	Exch $0
958 2961 mdecorde
!macroend
959 2961 mdecorde
960 2961 mdecorde
!define ConfigRead `!insertmacro ConfigReadCall`
961 2961 mdecorde
!define un.ConfigRead `!insertmacro ConfigReadCall`
962 2961 mdecorde
963 2961 mdecorde
!macro ConfigRead
964 2961 mdecorde
!macroend
965 2961 mdecorde
966 2961 mdecorde
!macro un.ConfigRead
967 2961 mdecorde
!macroend
968 2961 mdecorde
969 2961 mdecorde
!macro ConfigRead_
970 2961 mdecorde
	!verbose push
971 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
972 2961 mdecorde
973 2961 mdecorde
	!insertmacro ConfigReadBody ''
974 2961 mdecorde
975 2961 mdecorde
	!verbose pop
976 2961 mdecorde
!macroend
977 2961 mdecorde
978 2961 mdecorde
!define ConfigReadS `!insertmacro ConfigReadSCall`
979 2961 mdecorde
!define un.ConfigReadS `!insertmacro ConfigReadSCall`
980 2961 mdecorde
981 2961 mdecorde
!macro ConfigReadS
982 2961 mdecorde
!macroend
983 2961 mdecorde
984 2961 mdecorde
!macro un.ConfigReadS
985 2961 mdecorde
!macroend
986 2961 mdecorde
987 2961 mdecorde
!macro ConfigReadS_
988 2961 mdecorde
	!verbose push
989 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
990 2961 mdecorde
991 2961 mdecorde
	!insertmacro ConfigReadBody 'S'
992 2961 mdecorde
993 2961 mdecorde
	!verbose pop
994 2961 mdecorde
!macroend
995 2961 mdecorde
996 2961 mdecorde
!macro ConfigWriteBody _TEXTFUNC_S
997 2961 mdecorde
	Exch $2
998 2961 mdecorde
	Exch
999 2961 mdecorde
	Exch $1
1000 2961 mdecorde
	Exch
1001 2961 mdecorde
	Exch 2
1002 2961 mdecorde
	Exch $0
1003 2961 mdecorde
	Exch 2
1004 2961 mdecorde
	Push $3
1005 2961 mdecorde
	Push $4
1006 2961 mdecorde
	Push $5
1007 2961 mdecorde
	Push $6
1008 2961 mdecorde
	ClearErrors
1009 2961 mdecorde
1010 2961 mdecorde
	IfFileExists $0 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_error
1011 2961 mdecorde
	FileOpen $3 $0 a
1012 2961 mdecorde
	IfErrors TextFunc_ConfigWrite${_TEXTFUNC_S}_error
1013 2961 mdecorde
1014 2961 mdecorde
	StrLen $0 $1
1015 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $0 0 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext
1016 2961 mdecorde
	StrCpy $0 ''
1017 2961 mdecorde
	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
1018 2961 mdecorde
1019 2961 mdecorde
	TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext:
1020 2961 mdecorde
	FileRead $3 $4
1021 2961 mdecorde
	IfErrors TextFunc_ConfigWrite${_TEXTFUNC_S}_add
1022 2961 mdecorde
	StrCpy $5 $4 $0
1023 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $5 $1 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext
1024 2961 mdecorde
1025 2961 mdecorde
	StrCpy $5 0
1026 2961 mdecorde
	IntOp $5 $5 - 1
1027 2961 mdecorde
	StrCpy $6 $4 1 $5
1028 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $6 '$\r' -2
1029 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $6 '$\n' -3
1030 2961 mdecorde
	StrCpy $6 $4
1031 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $5 -1 +3
1032 2961 mdecorde
	IntOp $5 $5 + 1
1033 2961 mdecorde
	StrCpy $6 $4 $5
1034 2961 mdecorde
1035 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $2 '' TextFunc_ConfigWrite${_TEXTFUNC_S}_change
1036 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $6 '$1$2' 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_change
1037 2961 mdecorde
	StrCpy $0 SAME
1038 2961 mdecorde
	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
1039 2961 mdecorde
1040 2961 mdecorde
	TextFunc_ConfigWrite${_TEXTFUNC_S}_change:
1041 2961 mdecorde
	FileSeek $3 0 CUR $5
1042 2961 mdecorde
	StrLen $4 $4
1043 2961 mdecorde
	IntOp $4 $5 - $4
1044 2961 mdecorde
	FileSeek $3 0 END $6
1045 2961 mdecorde
	IntOp $6 $6 - $5
1046 2961 mdecorde
1047 2961 mdecorde
	System::Alloc $6
1048 2961 mdecorde
	Pop $0
1049 2961 mdecorde
	FileSeek $3 $5 SET
1050 2961 mdecorde
	System::Call 'kernel32::ReadFile(i r3, i r0, i $6, t.,)'
1051 2961 mdecorde
	FileSeek $3 $4 SET
1052 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $2 '' +2
1053 2961 mdecorde
	FileWrite $3 '$1$2$\r$\n'
1054 2961 mdecorde
	System::Call 'kernel32::WriteFile(i r3, i r0, i $6, t.,)'
1055 2961 mdecorde
	System::Call 'kernel32::SetEndOfFile(i r3)'
1056 2961 mdecorde
	System::Free $0
1057 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $2 '' +3
1058 2961 mdecorde
	StrCpy $0 CHANGED
1059 2961 mdecorde
	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
1060 2961 mdecorde
	StrCpy $0 DELETED
1061 2961 mdecorde
	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
1062 2961 mdecorde
1063 2961 mdecorde
	TextFunc_ConfigWrite${_TEXTFUNC_S}_add:
1064 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $2 '' 0 +3
1065 2961 mdecorde
	StrCpy $0 SAME
1066 2961 mdecorde
	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
1067 2961 mdecorde
	FileSeek $3 -1 END
1068 2961 mdecorde
	FileRead $3 $4
1069 2961 mdecorde
	IfErrors +4
1070 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $4 '$\r' +3
1071 2961 mdecorde
	StrCmp${_TEXTFUNC_S} $4 '$\n' +2
1072 2961 mdecorde
	FileWrite $3 '$\r$\n'
1073 2961 mdecorde
	FileWrite $3 '$1$2$\r$\n'
1074 2961 mdecorde
	StrCpy $0 ADDED
1075 2961 mdecorde
1076 2961 mdecorde
	TextFunc_ConfigWrite${_TEXTFUNC_S}_close:
1077 2961 mdecorde
	FileClose $3
1078 2961 mdecorde
	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_end
1079 2961 mdecorde
1080 2961 mdecorde
	TextFunc_ConfigWrite${_TEXTFUNC_S}_error:
1081 2961 mdecorde
	SetErrors
1082 2961 mdecorde
	StrCpy $0 ''
1083 2961 mdecorde
1084 2961 mdecorde
	TextFunc_ConfigWrite${_TEXTFUNC_S}_end:
1085 2961 mdecorde
	Pop $6
1086 2961 mdecorde
	Pop $5
1087 2961 mdecorde
	Pop $4
1088 2961 mdecorde
	Pop $3
1089 2961 mdecorde
	Pop $2
1090 2961 mdecorde
	Pop $1
1091 2961 mdecorde
	Exch $0
1092 2961 mdecorde
!macroend
1093 2961 mdecorde
1094 2961 mdecorde
!define ConfigWrite `!insertmacro ConfigWriteCall`
1095 2961 mdecorde
!define un.ConfigWrite `!insertmacro ConfigWriteCall`
1096 2961 mdecorde
1097 2961 mdecorde
!macro ConfigWrite
1098 2961 mdecorde
!macroend
1099 2961 mdecorde
1100 2961 mdecorde
!macro un.ConfigWrite
1101 2961 mdecorde
!macroend
1102 2961 mdecorde
1103 2961 mdecorde
!macro ConfigWrite_
1104 2961 mdecorde
	!verbose push
1105 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
1106 2961 mdecorde
1107 2961 mdecorde
	!insertmacro ConfigWriteBody ''
1108 2961 mdecorde
1109 2961 mdecorde
	!verbose pop
1110 2961 mdecorde
!macroend
1111 2961 mdecorde
1112 2961 mdecorde
!define ConfigWriteS `!insertmacro ConfigWriteSCall`
1113 2961 mdecorde
!define un.ConfigWriteS `!insertmacro ConfigWriteSCall`
1114 2961 mdecorde
1115 2961 mdecorde
!macro ConfigWriteS
1116 2961 mdecorde
!macroend
1117 2961 mdecorde
1118 2961 mdecorde
!macro un.ConfigWriteS
1119 2961 mdecorde
!macroend
1120 2961 mdecorde
1121 2961 mdecorde
!macro ConfigWriteS_
1122 2961 mdecorde
	!verbose push
1123 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
1124 2961 mdecorde
1125 2961 mdecorde
	!insertmacro ConfigWriteBody 'S'
1126 2961 mdecorde
1127 2961 mdecorde
	!verbose pop
1128 2961 mdecorde
!macroend
1129 2961 mdecorde
1130 2961 mdecorde
!define FileRecode `!insertmacro FileRecodeCall`
1131 2961 mdecorde
!define un.FileRecode `!insertmacro FileRecodeCall`
1132 2961 mdecorde
1133 2961 mdecorde
!macro FileRecode
1134 2961 mdecorde
!macroend
1135 2961 mdecorde
1136 2961 mdecorde
!macro un.FileRecode
1137 2961 mdecorde
!macroend
1138 2961 mdecorde
1139 2961 mdecorde
!macro FileRecode_
1140 2961 mdecorde
	!verbose push
1141 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
1142 2961 mdecorde
1143 2961 mdecorde
	Exch $1
1144 2961 mdecorde
	Exch
1145 2961 mdecorde
	Exch $0
1146 2961 mdecorde
	Exch
1147 2961 mdecorde
	Push $2
1148 2961 mdecorde
	Push $3
1149 2961 mdecorde
	Push $4
1150 2961 mdecorde
1151 2961 mdecorde
	IfFileExists $0 0 TextFunc_FileRecode_error
1152 2961 mdecorde
	StrCmp $1 OemToChar +2
1153 2961 mdecorde
	StrCmp $1 CharToOem 0 TextFunc_FileRecode_error
1154 2961 mdecorde
1155 2961 mdecorde
	FileOpen $2 $0 a
1156 2961 mdecorde
	FileSeek $2 0 END $3
1157 2961 mdecorde
	System::Alloc $3
1158 2961 mdecorde
	Pop $4
1159 2961 mdecorde
	FileSeek $2 0 SET
1160 2961 mdecorde
	System::Call 'kernel32::ReadFile(i r2, i r4, i $3, t.,)'
1161 2961 mdecorde
	System::Call 'user32::$1Buff(i r4, i r4, i $3)'
1162 2961 mdecorde
	FileSeek $2 0 SET
1163 2961 mdecorde
	System::Call 'kernel32::WriteFile(i r2, i r4, i $3, t.,)'
1164 2961 mdecorde
	System::Free $4
1165 2961 mdecorde
	FileClose $2
1166 2961 mdecorde
	goto TextFunc_FileRecode_end
1167 2961 mdecorde
1168 2961 mdecorde
	TextFunc_FileRecode_error:
1169 2961 mdecorde
	SetErrors
1170 2961 mdecorde
1171 2961 mdecorde
	TextFunc_FileRecode_end:
1172 2961 mdecorde
	Pop $4
1173 2961 mdecorde
	Pop $3
1174 2961 mdecorde
	Pop $2
1175 2961 mdecorde
	Pop $1
1176 2961 mdecorde
	Pop $0
1177 2961 mdecorde
1178 2961 mdecorde
	!verbose pop
1179 2961 mdecorde
!macroend
1180 2961 mdecorde
1181 2961 mdecorde
!define TrimNewLines `!insertmacro TrimNewLinesCall`
1182 2961 mdecorde
!define un.TrimNewLines `!insertmacro TrimNewLinesCall`
1183 2961 mdecorde
1184 2961 mdecorde
!macro TrimNewLines
1185 2961 mdecorde
!macroend
1186 2961 mdecorde
1187 2961 mdecorde
!macro un.TrimNewLines
1188 2961 mdecorde
!macroend
1189 2961 mdecorde
1190 2961 mdecorde
!macro TrimNewLines_
1191 2961 mdecorde
	!verbose push
1192 2961 mdecorde
	!verbose ${_TEXTFUNC_VERBOSE}
1193 2961 mdecorde
1194 2961 mdecorde
	Exch $0
1195 2961 mdecorde
	Push $1
1196 2961 mdecorde
	Push $2
1197 2961 mdecorde
1198 2961 mdecorde
	StrCpy $1 0
1199 2961 mdecorde
	IntOp $1 $1 - 1
1200 2961 mdecorde
	StrCpy $2 $0 1 $1
1201 2961 mdecorde
	StrCmp $2 '$\r' -2
1202 2961 mdecorde
	StrCmp $2 '$\n' -3
1203 2961 mdecorde
	StrCmp $1 -1 +3
1204 2961 mdecorde
	IntOp $1 $1 + 1
1205 2961 mdecorde
	StrCpy $0 $0 $1
1206 2961 mdecorde
1207 2961 mdecorde
	Pop $2
1208 2961 mdecorde
	Pop $1
1209 2961 mdecorde
	Exch $0
1210 2961 mdecorde
1211 2961 mdecorde
	!verbose pop
1212 2961 mdecorde
!macroend
1213 2961 mdecorde
1214 2961 mdecorde
!endif