StrFunc 1.09 by deguix:

- Fixed stack problems involving: StrCase, StrRep, StrSort, StrTok.
 - Fixed StrClb: When "Action" = "<>", handle was wrongly outputed as text.
 - Fixed StrSort, StrStrAdv documentation examples.
 - Fixed StrIOToNSIS, StrLoc, StrNSISToIO, StrRep, StrStr: sometimes didn't find "StrToSearch" at all.


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3746 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2004-10-22 23:52:01 +00:00
parent 42af15470f
commit eb00ff12cc
3 changed files with 288 additions and 153 deletions

View file

@ -31,12 +31,60 @@ ${UnStrTok}
${UnStrTrimNewLines} ${UnStrTrimNewLines}
${UnStrSort} ${UnStrSort}
!macro StackVerificationStart
StrCpy $0 S0
StrCpy $1 S1
StrCpy $2 S2
StrCpy $3 S3
StrCpy $4 S4
StrCpy $5 S5
StrCpy $6 S6
StrCpy $7 S7
StrCpy $8 S8
StrCpy $9 S9
StrCpy $R0 SR0
StrCpy $R1 SR1
StrCpy $R2 SR2
StrCpy $R3 SR3
StrCpy $R4 SR4
StrCpy $R5 SR5
StrCpy $R6 SR6
StrCpy $R7 SR7
StrCpy $R8 SR8
StrCpy $R9 SR9
!macroend
!macro StackVerificationEnd
ClearErrors
${If} $1 != "S1"
${OrIf} $2 != "S2"
${OrIf} $3 != "S3"
${OrIf} $4 != "S4"
${OrIf} $5 != "S5"
${OrIf} $6 != "S6"
${OrIf} $7 != "S7"
${OrIf} $8 != "S8"
${OrIf} $9 != "S9"
${OrIf} $R0 != "SR0"
${OrIf} $R1 != "SR1"
${OrIf} $R2 != "SR2"
${OrIf} $R3 != "SR3"
${OrIf} $R4 != "SR4"
${OrIf} $R5 != "SR5"
${OrIf} $R6 != "SR6"
${OrIf} $R7 != "SR7"
${OrIf} $R8 != "SR8"
${OrIf} $R9 != "SR9"
SetErrors
${EndIf}
!macroend
Section Section
# Test case conversion # Test case conversion
!insertmacro StackVerificationStart
${StrCase} $0 "This is just an example. A very simple one." "" ${StrCase} $0 "This is just an example. A very simple one." ""
StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror
${StrCase} $0 "THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE." "S" ${StrCase} $0 "THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE." "S"
StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror
${StrCase} $0 "This is just an example. A very simple one." "L" ${StrCase} $0 "This is just an example. A very simple one." "L"
@ -47,15 +95,14 @@ Section
StrCmp $0 "This Is Just An Example. A Very Simple One." 0 strcaseerror StrCmp $0 "This Is Just An Example. A Very Simple One." 0 strcaseerror
${StrCase} $0 "This is just an example. A very simple one." "<>" ${StrCase} $0 "This is just an example. A very simple one." "<>"
StrCmp $0 "tHIS IS JUST AN EXAMPLE. a VERY SIMPLE ONE." 0 strcaseerror StrCmp $0 "tHIS IS JUST AN EXAMPLE. a VERY SIMPLE ONE." 0 strcaseerror
${StrCase} $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" "S" ${StrCase} $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" "S"
StrCmp $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" 0 strcaseerror StrCmp $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" 0 strcaseerror
${StrCase} $0 "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#%^&*()abcdefghijklmnopqrstuvwxyz-_=+[]{};:,./<>?" "<>" ${StrCase} $0 "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#%^&*()abcdefghijklmnopqrstuvwxyz-_=+[]{};:,./<>?" "<>"
StrCmp $0 "123456789abcdefghijklmnopqrstuvwxyz!@#%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+[]{};:,./<>?" 0 strcaseerror StrCmp $0 "123456789abcdefghijklmnopqrstuvwxyz!@#%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+[]{};:,./<>?" 0 strcaseerror
${StrCase} $0 "what about taking a shower tomorrow? it's late to do so now! try to sleep now. Good Night!" "S" ${StrCase} $0 "what about taking a shower tomorrow? it's late to do so now! try to sleep now. Good Night!" "S"
StrCmp $0 "What about taking a shower tomorrow? It's late to do so now! Try to sleep now. Good night!" 0 strcaseerror StrCmp $0 "What about taking a shower tomorrow? It's late to do so now! Try to sleep now. Good night!" 0 strcaseerror
!insertmacro StackVerificationEnd
IfErrors strcaseerror
DetailPrint "PASSED StrCase test" DetailPrint "PASSED StrCase test"
Goto +2 Goto +2
@ -63,9 +110,17 @@ strcaseerror:
DetailPrint "FAILED StrCase test" DetailPrint "FAILED StrCase test"
# Test clipboard function # Test clipboard function
!insertmacro StackVerificationStart
${StrClb} $0 "StrFunc clipboard test" ">" ${StrClb} $0 "StrFunc clipboard test" ">"
${StrClb} $0 "" "<" StrCmp $0 "" 0 strclberror
${StrClb} $0 "StrFunc clipboard test #2" "<>"
StrCmp $0 "StrFunc clipboard test" 0 strclberror StrCmp $0 "StrFunc clipboard test" 0 strclberror
${StrClb} $0 "" "<"
StrCmp $0 "StrFunc clipboard test #2" 0 strclberror
${StrClb} $0 "" ""
StrCmp $0 "" 0 strclberror
!insertmacro StackVerificationEnd
IfErrors strclberror
DetailPrint "PASSED StrClb test" DetailPrint "PASSED StrClb test"
Goto +2 Goto +2
@ -73,6 +128,7 @@ strclberror:
DetailPrint "FAILED StrClb test" DetailPrint "FAILED StrClb test"
# Test IO functions # Test IO functions
!insertmacro StackVerificationStart
!macro testio str !macro testio str
${StrNSISToIO} $0 "${str}" ${StrNSISToIO} $0 "${str}"
${StrIOToNSIS} $0 $0 ${StrIOToNSIS} $0 $0
@ -86,12 +142,16 @@ strclberror:
!insertmacro testio "$\r \ $\t $\n $$" !insertmacro testio "$\r \ $\t $\n $$"
!insertmacro testio "" !insertmacro testio ""
!insertmacro testio " " !insertmacro testio " "
!insertmacro StackVerificationEnd
IfErrors ioerror
DetailPrint "PASSED StrNSISToIO/StrIOToNSIS test" DetailPrint "PASSED StrNSISToIO/StrIOToNSIS test"
Goto +2 Goto +2
ioerror: ioerror:
DetailPrint "FAILED StrNSISToIO/StrIOToNSIS test" DetailPrint "FAILED StrNSISToIO/StrIOToNSIS test"
# Test string search functions # Test string search functions
!insertmacro StackVerificationStart
${StrLoc} $0 "This is just an example" "just" "<" ${StrLoc} $0 "This is just an example" "just" "<"
StrCmp $0 "11" 0 strlocerror StrCmp $0 "11" 0 strlocerror
${StrLoc} $0 a abc < ${StrLoc} $0 a abc <
@ -112,12 +172,16 @@ ioerror:
StrCmp $0 "0" 0 strlocerror StrCmp $0 "0" 0 strlocerror
${StrLoc} $0 abc d < ${StrLoc} $0 abc d <
StrCmp $0 "" 0 strlocerror StrCmp $0 "" 0 strlocerror
!insertmacro StackVerificationEnd
IfErrors strlocerror
DetailPrint "PASSED StrLoc test" DetailPrint "PASSED StrLoc test"
Goto +2 Goto +2
strlocerror: strlocerror:
DetailPrint "FAILED StrLoc test" DetailPrint "FAILED StrLoc test"
# Test string replacement # Test string replacement
!insertmacro StackVerificationStart
${StrRep} $0 "This is just an example" "an" "one" ${StrRep} $0 "This is just an example" "an" "one"
StrCmp $0 "This is just one example" 0 strreperror StrCmp $0 "This is just one example" 0 strreperror
${StrRep} $0 "test... test... 1 2 3..." "test" "testing" ${StrRep} $0 "test... test... 1 2 3..." "test" "testing"
@ -132,12 +196,16 @@ strlocerror:
StrCmp $0 "test" 0 strreperror StrCmp $0 "test" 0 strreperror
${StrRep} $0 "test" "" "" ${StrRep} $0 "test" "" ""
StrCmp $0 "test" 0 strreperror StrCmp $0 "test" 0 strreperror
!insertmacro StackVerificationEnd
IfErrors strreperror
DetailPrint "PASSED StrRep test" DetailPrint "PASSED StrRep test"
Goto +2 Goto +2
strreperror: strreperror:
DetailPrint "FAILED StrRep test" DetailPrint "FAILED StrRep test"
# Test sorting # Test sorting
!insertmacro StackVerificationStart
${StrSort} $0 "This is just an example" "" " just" "ple" "0" "0" "0" ${StrSort} $0 "This is just an example" "" " just" "ple" "0" "0" "0"
StrCmp $0 "This is an exam" 0 strsorterror StrCmp $0 "This is an exam" 0 strsorterror
${StrSort} $0 "This is just an example" " " "j" " " "0" "" "0" ${StrSort} $0 "This is just an example" " " "j" " " "0" "" "0"
@ -176,11 +244,15 @@ strreperror:
StrCmp $0 " rror " 0 strsorterror StrCmp $0 " rror " 0 strsorterror
${StrSort} $0 "" " " "something" " " "1" "0" "1" ${StrSort} $0 "" " " "something" " " "1" "0" "1"
StrCmp $0 "" 0 strsorterror StrCmp $0 "" 0 strsorterror
!insertmacro StackVerificationEnd
IfErrors strsorterror
DetailPrint "PASSED StrSort test" DetailPrint "PASSED StrSort test"
Goto +2 Goto +2
strsorterror: strsorterror:
DetailPrint "FAILED StrSort test" DetailPrint "FAILED StrSort test"
!insertmacro StackVerificationStart
${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "g" ${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "g"
StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror
${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga" ${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga"
@ -189,11 +261,15 @@ strsorterror:
StrCmp $0 "abcefghijklmnopqrstuvwxyz" 0 strstrerror StrCmp $0 "abcefghijklmnopqrstuvwxyz" 0 strstrerror
${StrStr} $0 "a" "abcefghijklmnopqrstuvwxyz" ${StrStr} $0 "a" "abcefghijklmnopqrstuvwxyz"
StrCmp $0 "" 0 strstrerror StrCmp $0 "" 0 strstrerror
!insertmacro StackVerificationEnd
IfErrors strstrerror
DetailPrint "PASSED StrStr test" DetailPrint "PASSED StrStr test"
Goto +2 Goto +2
strstrerror: strstrerror:
DetailPrint "FAILED StrStr test" DetailPrint "FAILED StrStr test"
!insertmacro StackVerificationStart
${StrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "0" "0" ${StrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "0" "0"
StrCmp $0 "abcabcabc" 0 strstradverror StrCmp $0 "abcabcabc" 0 strstradverror
${StrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "1" "0" ${StrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "1" "0"
@ -214,7 +290,6 @@ strstrerror:
StrCmp $0 "" 0 strstradverror StrCmp $0 "" 0 strstradverror
${StrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0" ${StrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0"
StrCmp $0 "abc" 0 strstradverror StrCmp $0 "abc" 0 strstradverror
${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1" ${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1"
StrCmp $0 "abcabc" 0 strstradverror StrCmp $0 "abcabc" 0 strstradverror
${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1" ${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1"
@ -235,12 +310,16 @@ strstrerror:
StrCmp $0 "" 0 strstradverror StrCmp $0 "" 0 strstradverror
${StrStrAdv} $0 "ABCabcabc" "abc" "<" ">" "0" "1" "1" ${StrStrAdv} $0 "ABCabcabc" "abc" "<" ">" "0" "1" "1"
StrCmp $0 "abc" 0 strstradverror StrCmp $0 "abc" 0 strstradverror
!insertmacro StackVerificationEnd
IfErrors strstradverror
DetailPrint "PASSED StrStrAdv test" DetailPrint "PASSED StrStrAdv test"
Goto +2 Goto +2
strstradverror: strstradverror:
DetailPrint "FAILED StrStrAdv test" DetailPrint "FAILED StrStrAdv test"
# Test tokenizer # Test tokenizer
!insertmacro StackVerificationStart
${StrTok} $0 "This is, or is not, just an example" " ," "4" "1" ${StrTok} $0 "This is, or is not, just an example" " ," "4" "1"
StrCmp $0 "not" 0 strtokerror StrCmp $0 "not" 0 strtokerror
${StrTok} $0 "This is, or is not, just an example" " ," "4" "0" ${StrTok} $0 "This is, or is not, just an example" " ," "4" "0"
@ -253,17 +332,25 @@ strstradverror:
StrCmp $0 "example" 0 strtokerror StrCmp $0 "example" 0 strtokerror
${StrTok} $0 "This is, or is not, just an example" " ," "0" "0" ${StrTok} $0 "This is, or is not, just an example" " ," "0" "0"
StrCmp $0 "This" 0 strtokerror StrCmp $0 "This" 0 strtokerror
!insertmacro StackVerificationEnd
IfErrors strtokerror
DetailPrint "PASSED StrTok test" DetailPrint "PASSED StrTok test"
Goto +2 Goto +2
strtokerror: strtokerror:
DetailPrint "FAILED StrTok test" DetailPrint "FAILED StrTok test"
# Test trim new lines # Test trim new lines
!insertmacro StackVerificationStart
${StrTrimNewLines} $0 "$\r$\ntest$\r$\ntest$\r$\n" ${StrTrimNewLines} $0 "$\r$\ntest$\r$\ntest$\r$\n"
StrCmp $0 "$\r$\ntest$\r$\ntest" +3 StrCmp $0 "$\r$\ntest$\r$\ntest" 0 strtrimnewlineserror
DetailPrint "FAILED StrTrimNewLines test" !insertmacro StackVerificationEnd
Goto +2 IfErrors strtrimnewlineserror
DetailPrint "PASSED StrTrimNewLines test"
DetailPrint "PASSED StrTrimNewLines test"
Goto +2
strtrimnewlineserror:
DetailPrint "FAILED StrTrimNewLines test"
WriteUninstaller $EXEDIR\UnStrFunc.exe WriteUninstaller $EXEDIR\UnStrFunc.exe
@ -274,9 +361,9 @@ SectionEnd
Section Uninstall Section Uninstall
# Test case conversion # Test case conversion
!insertmacro StackVerificationStart
${UnStrCase} $0 "This is just an example. A very simple one." "" ${UnStrCase} $0 "This is just an example. A very simple one." ""
StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror
${UnStrCase} $0 "THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE." "S" ${UnStrCase} $0 "THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE." "S"
StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror
${UnStrCase} $0 "This is just an example. A very simple one." "L" ${UnStrCase} $0 "This is just an example. A very simple one." "L"
@ -287,15 +374,14 @@ Section Uninstall
StrCmp $0 "This Is Just An Example. A Very Simple One." 0 strcaseerror StrCmp $0 "This Is Just An Example. A Very Simple One." 0 strcaseerror
${UnStrCase} $0 "This is just an example. A very simple one." "<>" ${UnStrCase} $0 "This is just an example. A very simple one." "<>"
StrCmp $0 "tHIS IS JUST AN EXAMPLE. a VERY SIMPLE ONE." 0 strcaseerror StrCmp $0 "tHIS IS JUST AN EXAMPLE. a VERY SIMPLE ONE." 0 strcaseerror
${UnStrCase} $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" "S" ${UnStrCase} $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" "S"
StrCmp $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" 0 strcaseerror StrCmp $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" 0 strcaseerror
${UnStrCase} $0 "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#%^&*()abcdefghijklmnopqrstuvwxyz-_=+[]{};:,./<>?" "<>" ${UnStrCase} $0 "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#%^&*()abcdefghijklmnopqrstuvwxyz-_=+[]{};:,./<>?" "<>"
StrCmp $0 "123456789abcdefghijklmnopqrstuvwxyz!@#%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+[]{};:,./<>?" 0 strcaseerror StrCmp $0 "123456789abcdefghijklmnopqrstuvwxyz!@#%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+[]{};:,./<>?" 0 strcaseerror
${UnStrCase} $0 "what about taking a shower tomorrow? it's late to do so now! try to sleep now. Good Night!" "S" ${UnStrCase} $0 "what about taking a shower tomorrow? it's late to do so now! try to sleep now. Good Night!" "S"
StrCmp $0 "What about taking a shower tomorrow? It's late to do so now! Try to sleep now. Good night!" 0 strcaseerror StrCmp $0 "What about taking a shower tomorrow? It's late to do so now! Try to sleep now. Good night!" 0 strcaseerror
!insertmacro StackVerificationEnd
IfErrors strcaseerror
DetailPrint "PASSED StrCase test" DetailPrint "PASSED StrCase test"
Goto +2 Goto +2
@ -303,9 +389,17 @@ strcaseerror:
DetailPrint "FAILED StrCase test" DetailPrint "FAILED StrCase test"
# Test clipboard function # Test clipboard function
!insertmacro StackVerificationStart
${UnStrClb} $0 "StrFunc clipboard test" ">" ${UnStrClb} $0 "StrFunc clipboard test" ">"
${UnStrClb} $0 "" "<" StrCmp $0 "" 0 strclberror
${UnStrClb} $0 "StrFunc clipboard test #2" "<>"
StrCmp $0 "StrFunc clipboard test" 0 strclberror StrCmp $0 "StrFunc clipboard test" 0 strclberror
${UnStrClb} $0 "" "<"
StrCmp $0 "StrFunc clipboard test #2" 0 strclberror
${UnStrClb} $0 "" ""
StrCmp $0 "" 0 strclberror
!insertmacro StackVerificationEnd
IfErrors strclberror
DetailPrint "PASSED StrClb test" DetailPrint "PASSED StrClb test"
Goto +2 Goto +2
@ -313,6 +407,7 @@ strclberror:
DetailPrint "FAILED StrClb test" DetailPrint "FAILED StrClb test"
# Test IO functions # Test IO functions
!insertmacro StackVerificationStart
!macro untestio str !macro untestio str
${UnStrNSISToIO} $0 "${str}" ${UnStrNSISToIO} $0 "${str}"
${UnStrIOToNSIS} $0 $0 ${UnStrIOToNSIS} $0 $0
@ -326,12 +421,16 @@ strclberror:
!insertmacro untestio "$\r \ $\t $\n $$" !insertmacro untestio "$\r \ $\t $\n $$"
!insertmacro untestio "" !insertmacro untestio ""
!insertmacro untestio " " !insertmacro untestio " "
!insertmacro StackVerificationEnd
IfErrors ioerror
DetailPrint "PASSED StrNSISToIO/StrIOToNSIS test" DetailPrint "PASSED StrNSISToIO/StrIOToNSIS test"
Goto +2 Goto +2
ioerror: ioerror:
DetailPrint "FAILED StrNSISToIO/StrIOToNSIS test" DetailPrint "FAILED StrNSISToIO/StrIOToNSIS test"
# Test string search functions # Test string search functions
!insertmacro StackVerificationStart
${UnStrLoc} $0 "This is just an example" "just" "<" ${UnStrLoc} $0 "This is just an example" "just" "<"
StrCmp $0 "11" 0 strlocerror StrCmp $0 "11" 0 strlocerror
${UnStrLoc} $0 a abc < ${UnStrLoc} $0 a abc <
@ -352,12 +451,16 @@ ioerror:
StrCmp $0 "0" 0 strlocerror StrCmp $0 "0" 0 strlocerror
${UnStrLoc} $0 abc d < ${UnStrLoc} $0 abc d <
StrCmp $0 "" 0 strlocerror StrCmp $0 "" 0 strlocerror
!insertmacro StackVerificationEnd
IfErrors strlocerror
DetailPrint "PASSED StrLoc test" DetailPrint "PASSED StrLoc test"
Goto +2 Goto +2
strlocerror: strlocerror:
DetailPrint "FAILED StrLoc test" DetailPrint "FAILED StrLoc test"
# Test string replacement # Test string replacement
!insertmacro StackVerificationStart
${UnStrRep} $0 "This is just an example" "an" "one" ${UnStrRep} $0 "This is just an example" "an" "one"
StrCmp $0 "This is just one example" 0 strreperror StrCmp $0 "This is just one example" 0 strreperror
${UnStrRep} $0 "test... test... 1 2 3..." "test" "testing" ${UnStrRep} $0 "test... test... 1 2 3..." "test" "testing"
@ -372,12 +475,16 @@ strlocerror:
StrCmp $0 "test" 0 strreperror StrCmp $0 "test" 0 strreperror
${UnStrRep} $0 "test" "" "" ${UnStrRep} $0 "test" "" ""
StrCmp $0 "test" 0 strreperror StrCmp $0 "test" 0 strreperror
!insertmacro StackVerificationEnd
IfErrors strreperror
DetailPrint "PASSED StrRep test" DetailPrint "PASSED StrRep test"
Goto +2 Goto +2
strreperror: strreperror:
DetailPrint "FAILED StrRep test" DetailPrint "FAILED StrRep test"
# Test sorting # Test sorting
!insertmacro StackVerificationStart
${UnStrSort} $0 "This is just an example" "" " just" "ple" "0" "0" "0" ${UnStrSort} $0 "This is just an example" "" " just" "ple" "0" "0" "0"
StrCmp $0 "This is an exam" 0 strsorterror StrCmp $0 "This is an exam" 0 strsorterror
${UnStrSort} $0 "This is just an example" " " "j" " " "0" "" "0" ${UnStrSort} $0 "This is just an example" " " "j" " " "0" "" "0"
@ -416,11 +523,15 @@ strreperror:
StrCmp $0 " rror " 0 strsorterror StrCmp $0 " rror " 0 strsorterror
${UnStrSort} $0 "" " " "something" " " "1" "0" "1" ${UnStrSort} $0 "" " " "something" " " "1" "0" "1"
StrCmp $0 "" 0 strsorterror StrCmp $0 "" 0 strsorterror
!insertmacro StackVerificationEnd
IfErrors strsorterror
DetailPrint "PASSED StrSort test" DetailPrint "PASSED StrSort test"
Goto +2 Goto +2
strsorterror: strsorterror:
DetailPrint "FAILED StrSort test" DetailPrint "FAILED StrSort test"
!insertmacro StackVerificationStart
${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "g" ${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "g"
StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror
${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga" ${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga"
@ -429,11 +540,15 @@ strsorterror:
StrCmp $0 "abcefghijklmnopqrstuvwxyz" 0 strstrerror StrCmp $0 "abcefghijklmnopqrstuvwxyz" 0 strstrerror
${UnStrStr} $0 "a" "abcefghijklmnopqrstuvwxyz" ${UnStrStr} $0 "a" "abcefghijklmnopqrstuvwxyz"
StrCmp $0 "" 0 strstrerror StrCmp $0 "" 0 strstrerror
!insertmacro StackVerificationEnd
IfErrors strstrerror
DetailPrint "PASSED StrStr test" DetailPrint "PASSED StrStr test"
Goto +2 Goto +2
strstrerror: strstrerror:
DetailPrint "FAILED StrStr test" DetailPrint "FAILED StrStr test"
!insertmacro StackVerificationStart
${UnStrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "0" "0" ${UnStrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "0" "0"
StrCmp $0 "abcabcabc" 0 strstradverror StrCmp $0 "abcabcabc" 0 strstradverror
${UnStrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "1" "0" ${UnStrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "1" "0"
@ -454,7 +569,6 @@ strstrerror:
StrCmp $0 "" 0 strstradverror StrCmp $0 "" 0 strstradverror
${UnStrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0" ${UnStrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0"
StrCmp $0 "abc" 0 strstradverror StrCmp $0 "abc" 0 strstradverror
${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1" ${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1"
StrCmp $0 "abcabc" 0 strstradverror StrCmp $0 "abcabc" 0 strstradverror
${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1" ${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1"
@ -475,12 +589,16 @@ strstrerror:
StrCmp $0 "" 0 strstradverror StrCmp $0 "" 0 strstradverror
${UnStrStrAdv} $0 "ABCabcabc" "abc" "<" ">" "0" "1" "1" ${UnStrStrAdv} $0 "ABCabcabc" "abc" "<" ">" "0" "1" "1"
StrCmp $0 "abc" 0 strstradverror StrCmp $0 "abc" 0 strstradverror
!insertmacro StackVerificationEnd
IfErrors strstradverror
DetailPrint "PASSED StrStrAdv test" DetailPrint "PASSED StrStrAdv test"
Goto +2 Goto +2
strstradverror: strstradverror:
DetailPrint "FAILED StrStrAdv test" DetailPrint "FAILED StrStrAdv test"
# Test tokenizer # Test tokenizer
!insertmacro StackVerificationStart
${UnStrTok} $0 "This is, or is not, just an example" " ," "4" "1" ${UnStrTok} $0 "This is, or is not, just an example" " ," "4" "1"
StrCmp $0 "not" 0 strtokerror StrCmp $0 "not" 0 strtokerror
${UnStrTok} $0 "This is, or is not, just an example" " ," "4" "0" ${UnStrTok} $0 "This is, or is not, just an example" " ," "4" "0"
@ -493,16 +611,24 @@ strstradverror:
StrCmp $0 "example" 0 strtokerror StrCmp $0 "example" 0 strtokerror
${UnStrTok} $0 "This is, or is not, just an example" " ," "0" "0" ${UnStrTok} $0 "This is, or is not, just an example" " ," "0" "0"
StrCmp $0 "This" 0 strtokerror StrCmp $0 "This" 0 strtokerror
!insertmacro StackVerificationEnd
IfErrors strtokerror
DetailPrint "PASSED StrTok test" DetailPrint "PASSED StrTok test"
Goto +2 Goto +2
strtokerror: strtokerror:
DetailPrint "FAILED StrTok test" DetailPrint "FAILED StrTok test"
# Test trim new lines # Test trim new lines
!insertmacro StackVerificationStart
${UnStrTrimNewLines} $0 "$\r$\ntest$\r$\ntest$\r$\n" ${UnStrTrimNewLines} $0 "$\r$\ntest$\r$\ntest$\r$\n"
StrCmp $0 "$\r$\ntest$\r$\ntest" +3 StrCmp $0 "$\r$\ntest$\r$\ntest" 0 strtrimnewlineserror
DetailPrint "FAILED StrTrimNewLines test" !insertmacro StackVerificationEnd
Goto +2 IfErrors strtrimnewlineserror
DetailPrint "PASSED StrTrimNewLines test"
DetailPrint "PASSED StrTrimNewLines test"
Goto +2
strtrimnewlineserror:
DetailPrint "FAILED StrTrimNewLines test"
SectionEnd SectionEnd

View file

@ -1,6 +1,6 @@
/* /*
o-----------------------------------------------------------------------------o o-----------------------------------------------------------------------------o
|String Functions Header File 1.08 | |String Functions Header File 1.09 |
(-----------------------------------------------------------------------------) (-----------------------------------------------------------------------------)
| By deguix / A Header file for NSIS 2.01 | | By deguix / A Header file for NSIS 2.01 |
| <cevo_deguix@yahoo.com.br> -------------------------------| | <cevo_deguix@yahoo.com.br> -------------------------------|
@ -34,7 +34,7 @@ o-----------------------------------------------------------------------------o
;Header File Version ;Header File Version
!define STRFUNC_VERMAJ 1 !define STRFUNC_VERMAJ 1
!define STRFUNC_VERMED 08 !define STRFUNC_VERMED 09
;!define STRFUNC_VERMIN 0 ;!define STRFUNC_VERMIN 0
;!define STRFUNC_VERBLD 0 ;!define STRFUNC_VERBLD 0
@ -191,7 +191,7 @@ o-----------------------------------------------------------------------------o
################ ################
!macro FUNCTION_STRING_StrCase !macro FUNCTION_STRING_StrCase
!insertmacro STRFUNC_FUNC `StrCase` `2004 Diego Pedroso` !insertmacro STRFUNC_FUNC `StrCase` `2004 Diego Pedroso - Based on functions by Dave Laundon`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
@ -209,6 +209,7 @@ o-----------------------------------------------------------------------------o
Exch $1 Exch $1
Exch Exch
Exch $0 Exch $0
Exch
Push $2 Push $2
Push $3 Push $3
Push $4 Push $4
@ -367,12 +368,12 @@ o-----------------------------------------------------------------------------o
!macroend !macroend
!macro FUNCTION_STRING_StrClb !macro FUNCTION_STRING_StrClb
!insertmacro STRFUNC_FUNC `StrClb` `2004 Diego Pedroso - Based on CopyToClipboard and CopyFromClipboard by Nik Medved` !insertmacro STRFUNC_FUNC `StrClb` `2004 Diego Pedroso - Based on functions by Nik Medved`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
$0 = Action (input) $0 = String (input)
$1 = String (input) $1 = Action (input)
$2 = Lock/Unlock (temp) $2 = Lock/Unlock (temp)
$3 = Temp (temp) $3 = Temp (temp)
$4 = Temp2 (temp)*/ $4 = Temp2 (temp)*/
@ -387,6 +388,10 @@ o-----------------------------------------------------------------------------o
Push $3 Push $3
Push $4 Push $4
StrCpy $2 ""
StrCpy $3 ""
StrCpy $4 ""
;Open the clipboard to do the operations the user chose (kichik's fix) ;Open the clipboard to do the operations the user chose (kichik's fix)
System::Call 'user32::OpenClipboard(i $HWNDPARENT)' System::Call 'user32::OpenClipboard(i $HWNDPARENT)'
@ -428,7 +433,7 @@ o-----------------------------------------------------------------------------o
${ElseIf} $1 == "<>" ;Swap ${ElseIf} $1 == "<>" ;Swap
;Step 1: Get clipboard data ;Step 1: Get clipboard data
System::Call 'user32::GetClipboardData(i 1) t .r2' System::Call 'user32::GetClipboardData(i 1) i .r2'
;Step 2: Lock and copy data (kichik's fix) ;Step 2: Lock and copy data (kichik's fix)
System::Call 'kernel32::GlobalLock(i r2) t .r4' System::Call 'kernel32::GlobalLock(i r2) t .r4'
@ -486,78 +491,68 @@ o-----------------------------------------------------------------------------o
#################### ####################
!macro FUNCTION_STRING_StrIOToNSIS !macro FUNCTION_STRING_StrIOToNSIS
!insertmacro STRFUNC_FUNC `StrIOToNSIS` `2003-2004 Amir Szekely, Joost Verburg and Dave Laundon` !insertmacro STRFUNC_FUNC `StrIOToNSIS` `2004 "bluenet" - Based on functions by Amir Szekely, Joost Verburg, Dave Laundon and Diego Pedroso`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
$0 = String (input) $R0 = String (input/output)
$1 = OutVar (output) $R1 = StartCharPos (temp)
$2 = Temp (temp)*/ $R2 = StrLen (temp)
$R3 = TempStr (temp)
$R4 = TempRepStr (temp)*/
;Get input from user ;Get input from user
Exch $0 Exch $R0
Push $1 Push $R1
Push $2 Push $R2
Push $R3
Push $R4
;Initialize output ;Get "String" length
StrCpy $1 `` StrLen $R2 $R0
;Loop until an escape character is found or "String" reaches its end ;Loop until "String" end is reached
${Do} ${For} $R1 0 $R2
;Get the next "String" character ;Get the next "String" characters
StrCpy $2 $0 1 StrCpy $R3 $R0 2 $R1
;Abort when none left ;Detect if current character is:
${If} $2 == `` ${If} $R3 == "\\" ;Back-slash
${ExitDo} StrCpy $R4 "\"
${Else} ${ElseIf} $R3 == "\r" ;Carriage return
;Remove current character from "String" StrCpy $R4 "$\r"
StrCpy $0 $0 `` 1 ${ElseIf} $R3 == "\n" ;Line feed
StrCpy $R4 "$\n"
;Detect if current character is an escape character ${ElseIf} $R3 == "\t" ;Tab
${If} $2 != `\` StrCpy $R4 "$\t"
;If not just output ${Else} ;Anything else
StrCpy $1 `$1$2` StrCpy $R4 ""
${Else}
;Get the next "String" character
StrCpy $2 $0 1
;Remove current character from "String"
StrCpy $0 $0 `` 1
;Detect if current character is:
${If} $2 == `\` ;Back-slash
StrCpy $1 `$1\`
${ElseIf} $2 == `r` ;Carriage return
StrCpy $1 `$1$\r`
${ElseIf} $2 == `n` ;Line feed
StrCpy $1 `$1$\n`
${ElseIf} $2 == `t` ;Tab
StrCpy $1 `$1$\t`
${Else} ;Anything else
StrCpy $1 "$1$2"
${EndIf}
${EndIf}
${EndIf} ${EndIf}
${Loop}
/*After this point: ;Detect if "TempRepStr" is not empty
------------------------------------------ ${If} $R4 != ""
$0 = OutVar (output)*/ ;Replace the old characters with the new one
StrCpy $R3 $R0 $R1
;Return output to user IntOp $R1 $R1 + 2
StrCpy $0 $1 StrCpy $R0 $R0 "" $R1
Pop $2 StrCpy $R0 "$R3$R4$R0"
Pop $1 IntOp $R2 $R2 - 1 ;Decrease "StrLen"
Exch $0 IntOp $R1 $R1 - 2 ;Go back to the next character
${EndIf}
${Next}
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd FunctionEnd
!macroend !macroend
# Function StrLoc # Function StrLoc
############### ###############
!macro FUNCTION_STRING_StrLoc !macro FUNCTION_STRING_StrLoc
!insertmacro STRFUNC_FUNC `StrLoc` `2004 Diego Pedroso` !insertmacro STRFUNC_FUNC `StrLoc` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
@ -627,67 +622,69 @@ o-----------------------------------------------------------------------------o
#################### ####################
!macro FUNCTION_STRING_StrNSISToIO !macro FUNCTION_STRING_StrNSISToIO
!insertmacro STRFUNC_FUNC `StrNSISToIO` `2003-2004 Amir Szekely, Joost Verburg and Dave Laundon` !insertmacro STRFUNC_FUNC `StrNSISToIO` `2004 "bluenet" - Based on functions by Amir Szekely, Joost Verburg, Dave Laundon and Diego Pedroso`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
$0 = String (input) $R0 = String (input/output)
$1 = OutVar (output) $R1 = StartCharPos (temp)
$2 = Temp (temp)*/ $R2 = StrLen (temp)
$R3 = TempStr (temp)
$R4 = TempRepStr (temp)*/
;Get input from user ;Get input from user
Exch $0 ;String (input) Exch $R0
Push $1 ;OutVar (output) Push $R1
Push $2 ;Temp (temp) Push $R2
Push $R3
Push $R4
;Initialize output ;Get "String" length
StrCpy $1 `` StrLen $R2 $R0
;Loop until an escape character is found or "String" reaches its end ;Loop until "String" end is reached
${Do} ${For} $R1 0 $R2
;Get the next "String" character ;Get the next "String" character
StrCpy $2 $0 1 StrCpy $R3 $R0 1 $R1
;Abort when none left ;Detect if current character is:
${If} $2 == `` ${If} $R3 == "$\r" ;Back-slash
${ExitDo} StrCpy $R4 "\r"
${Else} ${ElseIf} $R3 == "$\n" ;Carriage return
;Remove current character from "String" StrCpy $R4 "\n"
StrCpy $0 $0 `` 1 ${ElseIf} $R3 == "$\t" ;Line feed
StrCpy $R4 "\t"
;Detect if current character is: ${ElseIf} $R3 == "\" ;Tab
${If} $2 == `\` ;Back-slash StrCpy $R4 "\\"
StrCpy $1 `$1\\` ${Else} ;Anything else
${ElseIf} $2 == `$\r` ;Carriage return StrCpy $R4 ""
StrCpy $1 `$1\r`
${ElseIf} $2 == `$\n` ;Line feed
StrCpy $1 `$1\n`
${ElseIf} $2 == `$\t` ;Tab
StrCpy $1 `$1\t`
${Else} ;Anything else
StrCpy $1 "$1$2"
${EndIf}
${EndIf} ${EndIf}
${Loop}
/*After this point: ;Detect if "TempRepStr" is not empty
------------------------------------------ ${If} $R4 != ""
$0 = OutVar (output)*/ ;Replace the old character with the new ones
StrCpy $R3 $R0 $R1
IntOp $R1 $R1 + 1
StrCpy $R0 $R0 "" $R1
StrCpy $R0 "$R3$R4$R0"
IntOp $R2 $R2 + 1 ;Increase "StrLen"
${EndIf}
${Next}
;Return output to user ;Return output to user
StrCpy $0 $1 Pop $R4
Pop $2 Pop $R3
Pop $1 Pop $R2
Exch $0 Pop $R1
Exch $R0
FunctionEnd FunctionEnd
!macroend !macroend
# Function StrRep # Function StrRep
############### ###############
!macro FUNCTION_STRING_StrRep !macro FUNCTION_STRING_StrRep
!insertmacro STRFUNC_FUNC `StrRep` `2002-2004 Hendri Adriaens` !insertmacro STRFUNC_FUNC `StrRep` `2004 Diego Pedroso - Based on functions by Hendri Adriaens`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
@ -767,6 +764,7 @@ o-----------------------------------------------------------------------------o
Pop $R6 Pop $R6
Pop $R5 Pop $R5
Pop $R4 Pop $R4
Pop $R3
Pop $R2 Pop $R2
Pop $R1 Pop $R1
Exch $R0 Exch $R0
@ -778,7 +776,7 @@ o-----------------------------------------------------------------------------o
################ ################
!macro FUNCTION_STRING_StrSort !macro FUNCTION_STRING_StrSort
!insertmacro STRFUNC_FUNC `StrSort` `2004 Diego Pedroso - based on SortString by "Afrow UK"` !insertmacro STRFUNC_FUNC `StrSort` `2004 Diego Pedroso - Based on functions by Stuart Welch`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
@ -985,7 +983,7 @@ o-----------------------------------------------------------------------------o
############### ###############
!macro FUNCTION_STRING_StrStr !macro FUNCTION_STRING_StrStr
!insertmacro STRFUNC_FUNC `StrStr` `2002-2004 Ximon Eighteen` !insertmacro STRFUNC_FUNC `StrStr` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
@ -1309,7 +1307,7 @@ o-----------------------------------------------------------------------------o
############### ###############
!macro FUNCTION_STRING_StrTok !macro FUNCTION_STRING_StrTok
!insertmacro STRFUNC_FUNC `StrTok` `2004 Diego Pedroso - based on StrTok by "bigmac666"` !insertmacro STRFUNC_FUNC `StrTok` `2004 Diego Pedroso - Based on functions by "bigmac666"`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------
$0 = SkipEmptyParts (input) $0 = SkipEmptyParts (input)
@ -1341,6 +1339,8 @@ o-----------------------------------------------------------------------------o
Push $6 Push $6
Push $7 Push $7
Push $8 Push $8
Push $9
Push $R0
;Parameter defaults ;Parameter defaults
${IfThen} $2 == `` ${|} StrCpy $2 `|` ${|} ${IfThen} $2 == `` ${|} StrCpy $2 `|` ${|}
@ -1434,6 +1434,8 @@ o-----------------------------------------------------------------------------o
;Return output to user ;Return output to user
Pop $R0
Pop $9
Pop $8 Pop $8
Pop $7 Pop $7
Pop $6 Pop $6
@ -1451,7 +1453,7 @@ o-----------------------------------------------------------------------------o
######################## ########################
!macro FUNCTION_STRING_StrTrimNewLines !macro FUNCTION_STRING_StrTrimNewLines
!insertmacro STRFUNC_FUNC `StrTrimNewLines` `2003-2004 Ximon Eighteen` !insertmacro STRFUNC_FUNC `StrTrimNewLines` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`
/*After this point: /*After this point:
------------------------------------------ ------------------------------------------

View file

@ -378,7 +378,7 @@ How to use
Example: Example:
${StrSort} $0 "This is just an example" " just" "" "ple" "0" "0" ${StrSort} $0 "This is just an example" " just" "" "ple" "0" "0" "0"
[_______(___)_______]( ) [_______(___)_______]( )
C R C R
@ -474,7 +474,7 @@ How to use
Example: Example:
${StrStrAdv} $0 "This IS really just an example" "IS " ">" ">" "1" "0" "1" ${StrStrAdv} $0 "This IS really just an example" "IS " ">" ">" "0" "0" "1"
>>>>>( )[____________________] >>>>>( )[____________________]
@ -584,11 +584,22 @@ Functions included and not included
Version History Version History
--------------- ---------------
1.09 - 10/22/2004
- Fixed stack problems involving: StrCase, StrRep, StrSort, StrTok.
- Fixed StrClb: When "Action" = "<>", handle was wrongly outputed as
text.
- Fixed StrSort, StrStrAdv documentation examples.
- Fixed StrIOToNSIS, StrLoc, StrNSISToIO, StrRep, StrStr: sometimes
didn't find "StrToSearch" at all.
1.08 - 10/12/2004 1.08 - 10/12/2004
- Converted all the functions to LogicLib. - Converted all the functions to LogicLib.
- StrSort: Totally remade and it can break old scripts. See - StrSort: Totally remade and it can break old scripts. See
documentation for details. documentation for details.
- StrTok: "ResultPart" has to start from 0 and it can break old scripts.
See documentation for details.
- Added defines: StrFunc_List, *_List and *_TypeList. - Added defines: StrFunc_List, *_List and *_TypeList.
- Fixed StrStrAdv: Variables $R0-$R3 couldn't be used on scripts before - Fixed StrStrAdv: Variables $R0-$R3 couldn't be used on scripts before
calling. calling.
@ -598,8 +609,8 @@ Version History
1.07 - 09/21/2004 1.07 - 09/21/2004
- Removed ${UnStrFunc} command. Now you can just include uninstall - Removed ${UnStrFunc} command. Now you can just include uninstall
functions commands like ${UnStrStr} to be supported by uninstall functions functions commands like ${UnStrStr} to be supported by uninstall functions
and sections. and sections.
- Added case-sensitive comparation option for StrStrAdv. - Added case-sensitive comparation option for StrStrAdv.
- StrCase now uses System.dll which makes case convertions effective with - StrCase now uses System.dll which makes case convertions effective with
all latin letters (i.e. ê). all latin letters (i.e. ê).
@ -607,8 +618,6 @@ all latin letters (i.e.
- StrClbSet and StrClbGet removed, added StrClb. - StrClbSet and StrClbGet removed, added StrClb.
- Made compact the most usual operations inside the header file. File size - Made compact the most usual operations inside the header file. File size
reduced. reduced.
- Added "!verbose" to header file -> faster compilation and header file
output organized (code borrowed from LogicLib.nsh).
1.06 - 03/26/2004 1.06 - 03/26/2004
@ -658,27 +667,25 @@ output organized (code borrowed from LogicLib.nsh).
0.02 - 01/24/2004 0.02 - 01/24/2004
- Completed StrFunc.nsh file. Need some tests and the readme. - Completed StrFunc.nsh file. Need some tests and the readme.
0.01 - 01/22/2004 0.01 - 01/22/2004
- First version to test ideas... - First version to test ideas...
Credits Credits
------- -------
Made by Diego Pedroso (aka deguix). Made by Diego Pedroso (aka deguix).
Functions Credits Functions Credits
----------------- -----------------
- StrCase, StrClb, StrLoc, StrSort, StrStrAdv and StrTok made - All functions are made by Diego Pedroso on LogicLib format. They
by Diego Pedroso, some based on functions made by Dave Laundon, are based on functions by Amir Szekely, Dave Laundon, Hendri
"Afrow UK" and "bigmac666". Adriaens, Nik Medved, Joost Verburg, Stuart Welch, Ximon Eighteen,
- StrRep made by Hendri Adriaens. "bigmac666" and "bluenet". "bluenet"'s version of StrIOToNSIS and
- StrStr, StrTrimNewLines made by Ximon Eighteen. StrNSISToIO on LogicLib format were included.
- StrNSISToIO and StrIOToNSIS made by Amir Szekely, Joost Verburg and
Dave Laundon.
License License
------- -------