Commit e94e79a6 authored by John van Groningen's avatar John van Groningen

call GetPrivateProfileString with Clean strings instead of c strings,

removes winMakeCString and winGetCStringAndFree calls and import of ostoolbox
parent 1d6f801d
......@@ -4,7 +4,7 @@ import code from library "platform_kernel_library"
import StdArray, StdEnum, StdList, StdClass, StdBool, StdMisc
import ArgEnv
import clCCall_12, ostoolbox
import clCCall_12
import logfile, set_return_code
from ossystem import osApplicationpath
......@@ -32,15 +32,19 @@ get_env n
EnvironmentVariable v -> (True,v)
get_ini file section key default`
#! (buffer,tb) = winMakeCString (createArray 256 '@') OSNewToolbox
(size,tb) = GetPrivateProfileString section key default` buffer 256 file tb
(buffer,tb) = winGetCStringAndFree buffer tb
= buffer%(0,size-1)
where
GetPrivateProfileString :: !String !String !String !CSTR !Int !String !*OSToolbox -> (!Int,!*OSToolbox)
GetPrivateProfileString _ _ _ _ _ _ _ = code {
ccall GetPrivateProfileStringA@24 "PsssIIs:I:I"
}
# (size,buffer,tb) = GetPrivateProfileString section key default` (createArray 256 '\0') 256 file []
= buffer % (0,size-1)
GetPrivateProfileString :: !String !String !String !*{#Char} !Int !String !*state -> (!Int,!{#Char},!*state)
GetPrivateProfileString appName keyName default returnedString returnedStringSize fileName state = code {
push_a 0
update_a 2 1
update_a 3 2
update_a 4 3
update_a 5 4
update_a 3 5
ccall GetPrivateProfileStringA@24 "PssssIs:I:AA"
}
batchOptions :: !*World -> (!Bool,Bool,String,*File,!*World)
batchOptions world
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment