mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 22:07:35 +02:00
remove two unused utility functions
This commit is contained in:
parent
f393c5eeda
commit
aa2d19a611
1 changed files with 0 additions and 64 deletions
|
@ -203,70 +203,6 @@ Var AR_RegFlags
|
||||||
# Utility Functions #
|
# Utility Functions #
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
; StrStr
|
|
||||||
; input, top of stack = string to search for
|
|
||||||
; top of stack-1 = string to search in
|
|
||||||
; output, top of stack (replaces with the portion of the string remaining)
|
|
||||||
; modifies no other variables.
|
|
||||||
;
|
|
||||||
; Usage:
|
|
||||||
; Push "this is a long ass string"
|
|
||||||
; Push "ass"
|
|
||||||
; Call StrStr
|
|
||||||
; Pop $R0
|
|
||||||
; ($R0 at this point is "ass string")
|
|
||||||
|
|
||||||
!macro StrStr un
|
|
||||||
Function ${un}StrStr
|
|
||||||
Exch $R1 ; st=haystack,old$R1, $R1=needle
|
|
||||||
Exch ; st=old$R1,haystack
|
|
||||||
Exch $R2 ; st=old$R1,old$R2, $R2=haystack
|
|
||||||
Push $R3
|
|
||||||
Push $R4
|
|
||||||
Push $R5
|
|
||||||
StrLen $R3 $R1
|
|
||||||
StrCpy $R4 0
|
|
||||||
; $R1=needle
|
|
||||||
; $R2=haystack
|
|
||||||
; $R3=len(needle)
|
|
||||||
; $R4=cnt
|
|
||||||
; $R5=tmp
|
|
||||||
loop:
|
|
||||||
StrCpy $R5 $R2 $R3 $R4
|
|
||||||
StrCmp $R5 $R1 done
|
|
||||||
StrCmp $R5 "" done
|
|
||||||
IntOp $R4 $R4 + 1
|
|
||||||
Goto loop
|
|
||||||
done:
|
|
||||||
StrCpy $R1 $R2 "" $R4
|
|
||||||
Pop $R5
|
|
||||||
Pop $R4
|
|
||||||
Pop $R3
|
|
||||||
Pop $R2
|
|
||||||
Exch $R1
|
|
||||||
FunctionEnd
|
|
||||||
!macroend
|
|
||||||
!insertmacro StrStr ""
|
|
||||||
!insertmacro StrStr "un."
|
|
||||||
|
|
||||||
Function Trim ; Added by Pelaca
|
|
||||||
Exch $R1
|
|
||||||
Push $R2
|
|
||||||
Loop:
|
|
||||||
StrCpy $R2 "$R1" 1 -1
|
|
||||||
StrCmp "$R2" " " RTrim
|
|
||||||
StrCmp "$R2" "$\n" RTrim
|
|
||||||
StrCmp "$R2" "$\r" RTrim
|
|
||||||
StrCmp "$R2" ";" RTrim
|
|
||||||
GoTo Done
|
|
||||||
RTrim:
|
|
||||||
StrCpy $R1 "$R1" -1
|
|
||||||
Goto Loop
|
|
||||||
Done:
|
|
||||||
Pop $R2
|
|
||||||
Exch $R1
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
Function ConditionalAddToRegisty
|
Function ConditionalAddToRegisty
|
||||||
Pop $0
|
Pop $0
|
||||||
Pop $1
|
Pop $1
|
||||||
|
|
Loading…
Reference in a new issue