home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d09xx
/
d0948.lha
/
Snoopy
/
Ini
/
Includes
/
libraries
/
ini.i
< prev
Wrap
Text File
|
1993-12-20
|
5KB
|
140 lines
IFND INCLUDE_INI_I
INCLUDE_INI_I EQU 1
; possible return codes from ini.library functions
; successfull call to library function
INIERROR_NONE equ 0
; not enough memory to complete action; results are invalid
INIERROR_NOT_ENOUGH_MEMORY equ 1
; couldn't Open() file, call dos/IoErr() for more details
INIERROR_CANNOT_OPEN_FILE equ 2
; couldn't Examine() file, call dos/IoErr() for more details
INIERROR_CANNOT_EXAMINE_FILE equ 3
; couldn't Read() file, call dos/IoErr() for more details
INIERROR_CANNOT_READ_FILE equ 4
; couldn't Write() file, call dos/IoErr() for more details
INIERROR_CANNOT_WRITE_FILE equ 5
; parser structure not valid (invalid arguments)
INIERROR_INVALID_PARSER equ 6
; section header not found
INIERROR_HEADER_NOT_FOUND equ 7
; section variable not found
INIERROR_VARIABLE_NOT_FOUND equ 8
; invalid function arguments, check your code!
INIERROR_INVALID_ARGS equ 9
; template failed (NOT OFFICIAL YET)
INIERROR_TEMPLATE_FAILED equ 10
; inifile is invalid ( ";INI" missing at start of file )
INIERROR_INVALID_INI_FILE equ 11
; general error (internal); this should be a fatal one...
INIERROR_INITFAILED equ 12
; couldn't handle template input (NOT OFFICIAL YET)
INIERROR_NO_TEMPLATE_INPUT equ 13
; section has an invalid password code
INIERROR_INVALID_PASSWORD equ 14
; possible values for ili_flags
INIFLAG_UNKNOWN equ 0 ; unknown
INIFLAG_VARIABLE equ 1 ; a section variable
INIFLAG_HEADER equ 2 ; a section header
INIFLAG_COMMENT equ 4 ; a comment - ignore
STRUCTURE INILINEINFO,0
STRUCT ili_node,LN_SIZE ; for internal linkage
UBYTE ili_flags ; one of the above flags
UBYTE ili_status ; see bitdefs below
APTR ili_variable ; ptr to variable or NULL (if not variable)
APTR ili_contents ; ptr to contents or NULL (if no contents)
APTR ili_allocated ; ptr to allocated memory
LONG ili_size ; size of allocated memory
LABEL ili_SIZEOF
STRUCTURE INIPARSER,0
STRUCT ip_Table,LH_SIZE ; IniLineInfo anchor
LONG ip_Flags ; flags : see bitdefs below
STRUCT ip_Private,12 ; INTERNAL USE
LABEL ip_SIZEOF
;-------------- flags for INIPARSER.ip_Flags
;-------------- the lowest 4 bits tell you about the "real" location of your
;-------------- inifile (which may be anywhere, since the ini.library does
;-------------- the path dispatching for you)
INIPARSER_UNKNOWN equ %0000 ; uses fixed path (or current directory)
INIPARSER_S equ %0001 ; uses S:
INIPARSER_INI equ %0010 ; uses INI:
INIPARSER_ENV equ %0100 ; uses ENV:
INIPARSER_USER equ %1000 ; uses USER:
;-------------- if this bit is set, the extensions to the ini-standard are DISABLED
;-------------- (which you shouldn't normally insist on)
BITDEF INIPARSER,NOEXTENSIONS,31
STRUCTURE INIBASESTRUCT,LIB_SIZE
ULONG iniBase_SegList
APTR iniBase_SysBase ; exec.library
APTR iniBase_DosBase ; dos.library
APTR iniBase_GlobalConfig ; pointer to global configuration
STRUCT iniBase_LocalConfig,LH_SIZE ; linked list of local configurations
ULONG iniBase_Flags ; INTERNAL USE
LABEL iniBase_SIZEOF
;-------------- Note well : LN_NAME does NOT point to a valid name but to
;-------------- a "struct Task" (or rather "struct Process") if the config is
;-------------- local (this is how the ini.library knows which local node to use)
;-------------- if the config is global, LN_NAME will probably always be NULL
STRUCTURE INILIBCONFIG,LN_SIZE
ULONG icfg_Flags ; see bit definitions below
APTR icfg_UserAssign ; ptr to user-assign or NULL
;-------------- this structure may well grow in the future; use ini_NewConfig()/
;-------------- ini_DeleteConfig() if you want to create one yourself
LABEL icfg_SIZEOF
;-------------- flags for struct "INILIBCONFIG":
;-------------- if the following bits are set, the ini.library will try to load
;-------------- the inifile from one of these assigns;
BITDEF INICONFIG,S,0 ; enable S:
BITDEF INICONFIG,INI,1 ; enable INI:
BITDEF INICONFIG,ENV,2 ; enable ENV:
BITDEF INICONFIG,USER,3 ; enable <userdefined>:
INICONFIGF_ALLDIRS equ %1111
;-------------- if this bit is set, ini-files do NOT have to contain the ";INI"
;-------------- string as the first four bytes;
BITDEF INICONFIG,NOINIMARK,8
;-------------- some of the other flags are undocumented here because they are
;-------------- only of limited interest to the public; others are
;-------------- tagitems for ini_NewConfig()
ENUM TAG_USER+100
EITEM ICFG_ENABLE_S ; ti_Data is boolean, default = TRUE
EITEM ICFG_ENABLE_INI ; ti_Data is boolean, default = TRUE
EITEM ICFG_ENABLE_ENV ; ti_Data is boolean, default = TRUE
EITEM ICFG_ENABLE_USER ; ti_Data is boolean, default = TRUE
EITEM ICFG_INIMASK ; ti_Data is boolean, default = FALSE
EITEM ICFG_ASSIGN ; user-assign directory
; must be STATIC MEMORY !!!!!!!!
ENDC ;INCLUDE_INI_I
;--------------