##base _INIBase
##bias 30
##public
*
* ini_lib.fd, v31.00, 14 Nov 98
* Written by Sebastian Vater, known as Basty/Seasons.
*
* This library is freeware. This library may also be commercial used without
* need of any payment for me.
*
* The ini.library is the base of all programs using the Windows .INI file
* style for configuration. It allows to handle those files easily. A Windows
* .INI file looks like (example):
*
* /* The ini.library also supports multiline comments,
*    as you know them from the C/C++ language.
*    This example configures screen modes and user name. */
*
* [Display]
* ScreenWidth = 640            ; comments are allowed!
* ScreenHeight = 256           * aren't they?
* Depth = 4
* ColorTable = 0x000, 0xFFF,
*                     0x777, 0x333
*
* [User]
* FirstName = Sebastian
* LastName = Vater
*
* Miscellanous functions (mainly for coder support)
iniAllocPMem(byteSize)(D0)
iniFreePMem(memoryBlock,byteSize)(A1,D0)
iniAllocNameStr(CStr)(A0)
iniFreeNameStr(NameStr)(A0)
iniSetString(StructPos,CStr)(A0/A1)
iniSetNameStr(StructPos,NameStr)(A0/A1)
*
* INI file management
*
iniOpenDefault(address,name,len)(A0/A1,D0)
iniOpenFile(name,accessMode)(D1/D2)
iniOpenFromFH(fh,len)(A0,D0)
iniOpenMem(address,len)(A0,D0)
iniClose(iniFile)(A0)
iniSaveFile(iniFile,name,accessMode)(A0,D1/D2)
iniSaveToFH(fh,iniFile)(A0/A1)
*
* INI file context construction functions
*
iniCreateContext(ContextName)(A0)
iniFreeContext(ContextStr)(A0)
iniAddContext(iniFile,ContextStr)(A0/A1)
iniRemContext(iniFile)(A0)
iniInsertContext(iniFile,ContextStr,PredContext)(A0/A1/A2)
iniDeleteContext(ContextStr)(A0)
*
* INI file context item construction functions
*
iniCreateContextItem(CStr)(A0)
iniFreeContextItem(ContextItemLine)(A0)
iniAddContextItem(ContextStr,ContextItemLine)(A0/A1)
iniRemContextItem(ContextStr)(A0)
iniInsertContextItem(ContextStr,ContextItemLine,PredLine)(A0/A1/A2)
iniDeleteContextItem(ContextItemLine)(A0)
*
* Evaluating INI context and item fields
*
iniReadLong(iniFile,ContextName,ItemName,Default,Flags)(A0/A1/A2,D0/D1)
iniReadFloat(iniFile,ContextName,ItemName,Default,Flags)(A0/A1/A2,D0/D1)
iniReadStr(iniFile,ContextName,ItemName,Default,Flags)(A0/A1/A2/A3,D0)
iniReadByteA(iniFile,ContextName,ItemName,Array,Entries,Flags)(A0/A1/A2/A3,D0/D1)
iniReadWordA(iniFile,ContextName,ItemName,Array,Entries,Flags)(A0/A1/A2/A3,D0/D1)
iniReadLongA(iniFile,ContextName,ItemName,Array,Entries,Flags)(A0/A1/A2/A3,D0/D1)
iniReadFloatA(iniFile,ContextName,ItemName,Array,Entries,Flags)(A0/A1/A2/A3,D0/D1)
iniReadStrA(iniFile,ContextName,ItemName,Array,Entries,Flags)(A0/A1/A2/A3,D0/D1)
iniWriteLong(iniFile,ContextName,ItemName,Value,Flags,Format,Len,ZeroSep)(A0/A1/A2,D0/D1/D2/D3/D4)
iniWriteFloat(iniFile,ContextName,ItemName,Value,Flags,FltFormat,IntLen,FracLen,ZeroSep)(A0/A1/A2,D0/D1/D2/D3/D4/D5)
iniWriteStr(iniFile,ContextName,ItemName,String,Flags)(A0/A1/A2/A3,D0)
iniWriteByteA(iniFile,ContextName,ItemName,Array,Entries,Flags,Format,Len,ZeroSep)(A0/A1/A2/A3,D0/D1/D2/D3/D4)
iniWriteWordA(iniFile,ContextName,ItemName,Array,Entries,Flags,Format,Len,ZeroSep)(A0/A1/A2/A3,D0/D1/D2/D3/D4)
iniWriteLongA(iniFile,ContextName,ItemName,Array,Entries,Flags,Format,Len,ZeroSep)(A0/A1/A2/A3,D0/D1/D2/D3/D4)
iniWriteFloatA(iniFile,ContextName,ItemName,Array,Entries,Flags,FltFormat,IntLen,FracLen,ZeroSep)(A0/A1/A2/A3,D0/D1/D2/D3/D4/D5)
iniWriteStrA(iniFile,ContextName,ItemName,Array,Entries,Flags)(A0/A1/A2/A3,D0/D1)
*
* Low level functions (these evaluate single lines)
*
iniGetContextName(ContextLine,Buffer)(A0/A1)
iniGetContextItem(ContextStr,ContextItemLine,Buffer)(A0/A1/A2)
iniGetContextItemData(ContextStr,ContextItemLine,Buffer)(A0/A1/A2)
iniGetContextItemDataA(ContextStr,ContextItemLine,Buffer,Number)(A0/A1/A2,D0)
iniCheckComment(ContextStr,ContextItemLine)(A0/A1)
iniGetNumArrays(ContextStr,ContextItemLine)(A0/A1)
iniGetArrayLine(ContextStr,ContextItemLine,Number)(A0/A1,D0)
iniGetArrayPos(ContextStr,ContextItemLine,Number)(A0/A1,D0)
iniGetLong(ContextStr,ContextItemLine,Default)(A0/A1,D0)
iniGetFloat(ContextStr,ContextItemLine,Default)(A0/A1,D0)
iniGetStr(ContextStr,ContextItemLine,Default)(A0/A1/A2)
iniGetByteA(ContextStr,ContextItemLine,Array,Entries)(A0/A1/A2,D0)
iniGetWordA(ContextStr,ContextItemLine,Array,Entries)(A0/A1/A2,D0)
iniGetLongA(ContextStr,ContextItemLine,Array,Entries)(A0/A1/A2,D0)
iniGetFloatA(ContextStr,ContextItemLine,Array,Entries)(A0/A1/A2,D0)
iniGetStrA(ContextStr,ContextItemLine,Array,Entries)(A0/A1/A2,D0)
iniPutLong(ContextStr,ContextItemLine,Value,Format,Len,ZeroSep)(A0/A1,D0/D1/D2/D3)
iniPutFloat(ContextStr,ContextItemLine,Value,FltFormat,IntLen,FracLen,ZeroSep)(A0/A1,D0/D1/D2/D3/D4)
iniPutStr(ContextStr,ContextItemLine,String)(A0/A1/A2)
iniPutByteA(ContextStr,ContextItemLine,Array,Entries,Format,Len,ZeroSep)(A0/A1/A2,D0/D1/D2/D3)
iniPutWordA(ContextStr,ContextItemLine,Array,Entries,Format,Len,ZeroSep)(A0/A1/A2,D0/D1/D2/D3)
iniPutLongA(ContextStr,ContextItemLine,Array,Entries,Format,Len,ZeroSep)(A0/A1/A2,D0/D1/D2/D3)
iniPutFloatA(ContextStr,ContextItemLine,Array,Entries,FltFormat,IntLen,FracLen,ZeroSep)(A0/A1/A2,D0/D1/D2/D3/D4)
iniPutStrA(ContextStr,ContextItemLine,Array,Entries)(A0/A1/A2,D0)
iniStrToInt(String,Default)(A0,D0)
iniIntToStr(Buffer,Integer,Format,Len,ZeroSep)(A0,D0/D1/D2/D3)
iniStrToFloat(String,Default)(A0,D0)
iniFloatToStr(Buffer,Float,FltFormat,IntLen,FracLen,ZeroSep)(A0,D0/D1/D2/D3/D4)
*
* INI scan functions (search for contexts, context items)
*
iniFindContext(iniFile,ContextName,Flags)(A0/A1,D0)
iniFindItem(ContextStr,ContextItemName,Flags)(A0/A1,D0)
##end
