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   
Text File  |  1993-12-20  |  5KB  |  140 lines

  1.         IFND    INCLUDE_INI_I
  2. INCLUDE_INI_I    EQU    1
  3.  
  4. ; possible return codes from ini.library functions
  5.  
  6. ; successfull call to library function
  7. INIERROR_NONE            equ    0
  8.  
  9. ; not enough memory to complete action; results are invalid
  10. INIERROR_NOT_ENOUGH_MEMORY    equ    1
  11.  
  12. ; couldn't Open() file, call dos/IoErr() for more details
  13. INIERROR_CANNOT_OPEN_FILE    equ    2
  14.  
  15. ; couldn't Examine() file, call dos/IoErr() for more details
  16. INIERROR_CANNOT_EXAMINE_FILE    equ    3
  17.  
  18. ; couldn't Read() file, call dos/IoErr() for more details
  19. INIERROR_CANNOT_READ_FILE    equ    4
  20.  
  21. ; couldn't Write() file, call dos/IoErr() for more details
  22. INIERROR_CANNOT_WRITE_FILE    equ    5
  23.  
  24. ; parser structure not valid (invalid arguments)
  25. INIERROR_INVALID_PARSER        equ    6
  26.  
  27. ; section header not found
  28. INIERROR_HEADER_NOT_FOUND    equ    7
  29.  
  30. ; section variable not found
  31. INIERROR_VARIABLE_NOT_FOUND    equ    8
  32.  
  33. ; invalid function arguments, check your code!
  34. INIERROR_INVALID_ARGS        equ    9
  35.  
  36. ; template failed (NOT OFFICIAL YET)
  37. INIERROR_TEMPLATE_FAILED    equ    10
  38.  
  39. ; inifile is invalid ( ";INI" missing at start of file )
  40. INIERROR_INVALID_INI_FILE    equ    11
  41.  
  42. ; general error (internal); this should be a fatal one...
  43. INIERROR_INITFAILED        equ    12
  44.  
  45. ; couldn't handle template input (NOT OFFICIAL YET)
  46. INIERROR_NO_TEMPLATE_INPUT    equ    13
  47.  
  48. ; section has an invalid password code
  49. INIERROR_INVALID_PASSWORD    equ    14
  50.  
  51. ; possible values for ili_flags
  52. INIFLAG_UNKNOWN            equ    0    ; unknown
  53. INIFLAG_VARIABLE        equ    1    ; a section variable
  54. INIFLAG_HEADER            equ    2    ; a section header 
  55. INIFLAG_COMMENT            equ    4    ; a comment - ignore
  56.  
  57.         STRUCTURE INILINEINFO,0
  58.         STRUCT    ili_node,LN_SIZE    ; for internal linkage
  59.         UBYTE    ili_flags        ; one of the above flags
  60.         UBYTE    ili_status        ; see bitdefs below
  61.         APTR    ili_variable        ; ptr to variable or NULL (if not variable)
  62.         APTR    ili_contents        ; ptr to contents or NULL (if no contents)
  63.         APTR    ili_allocated        ; ptr to allocated memory 
  64.         LONG    ili_size        ; size of allocated memory
  65.         LABEL    ili_SIZEOF
  66.  
  67.         STRUCTURE INIPARSER,0
  68.         STRUCT    ip_Table,LH_SIZE    ; IniLineInfo anchor
  69.         LONG    ip_Flags        ; flags : see bitdefs below
  70.         STRUCT    ip_Private,12        ; INTERNAL USE
  71.         LABEL    ip_SIZEOF
  72.  
  73. ;--------------    flags for INIPARSER.ip_Flags
  74.  
  75. ;--------------    the lowest 4 bits tell you about the "real" location of your
  76. ;--------------    inifile (which may be anywhere, since the ini.library does
  77. ;--------------    the path dispatching for you)
  78. INIPARSER_UNKNOWN    equ    %0000    ; uses fixed path (or current directory)
  79. INIPARSER_S        equ    %0001    ; uses S:
  80. INIPARSER_INI        equ    %0010    ; uses INI:
  81. INIPARSER_ENV        equ    %0100    ; uses ENV:
  82. INIPARSER_USER        equ    %1000    ; uses USER:
  83.  
  84. ;--------------    if this bit is set, the extensions to the ini-standard are DISABLED
  85. ;--------------    (which you shouldn't normally insist on)
  86.         BITDEF    INIPARSER,NOEXTENSIONS,31
  87.  
  88.         STRUCTURE INIBASESTRUCT,LIB_SIZE
  89.         ULONG    iniBase_SegList    
  90.         APTR    iniBase_SysBase        ; exec.library
  91.         APTR    iniBase_DosBase        ; dos.library
  92.         APTR    iniBase_GlobalConfig    ; pointer to global configuration
  93.         STRUCT    iniBase_LocalConfig,LH_SIZE    ; linked list of local configurations
  94.         ULONG    iniBase_Flags        ; INTERNAL USE
  95.         LABEL    iniBase_SIZEOF
  96.  
  97. ;--------------    Note well : LN_NAME does NOT point to a valid name but to 
  98. ;--------------    a "struct Task" (or rather "struct Process") if the config is
  99. ;--------------    local (this is how the ini.library knows which local node to use)
  100. ;--------------    if the config is global, LN_NAME will probably always be NULL
  101.         STRUCTURE INILIBCONFIG,LN_SIZE    
  102.         ULONG    icfg_Flags        ; see bit definitions below
  103.         APTR    icfg_UserAssign        ; ptr to user-assign or NULL
  104.  
  105. ;--------------    this structure may well grow in the future; use ini_NewConfig()/
  106. ;--------------    ini_DeleteConfig() if you want to create one yourself
  107.         LABEL    icfg_SIZEOF
  108.  
  109. ;--------------    flags for struct "INILIBCONFIG":
  110.  
  111. ;--------------    if the following bits are set, the ini.library will try to load
  112. ;--------------    the inifile from one of these assigns; 
  113.         BITDEF    INICONFIG,S,0        ; enable S:
  114.         BITDEF    INICONFIG,INI,1        ; enable INI:
  115.         BITDEF    INICONFIG,ENV,2        ; enable ENV:
  116.         BITDEF    INICONFIG,USER,3    ; enable <userdefined>:
  117.  
  118. INICONFIGF_ALLDIRS    equ    %1111
  119.  
  120. ;--------------    if this bit is set, ini-files do NOT have to contain the ";INI"
  121. ;--------------    string as the first four bytes;
  122.         BITDEF    INICONFIG,NOINIMARK,8
  123.  
  124. ;--------------    some of the other flags are undocumented here because they are
  125. ;--------------    only of limited interest to the public; others are 
  126.  
  127. ;--------------    tagitems for ini_NewConfig() 
  128.         ENUM    TAG_USER+100
  129.         EITEM    ICFG_ENABLE_S        ; ti_Data is boolean, default = TRUE
  130.         EITEM    ICFG_ENABLE_INI        ; ti_Data is boolean, default = TRUE
  131.         EITEM    ICFG_ENABLE_ENV        ; ti_Data is boolean, default = TRUE
  132.         EITEM    ICFG_ENABLE_USER    ; ti_Data is boolean, default = TRUE
  133.         EITEM    ICFG_INIMASK        ; ti_Data is boolean, default = FALSE
  134.         EITEM    ICFG_ASSIGN        ; user-assign directory
  135.                         ; must be STATIC MEMORY !!!!!!!!
  136.  
  137.         ENDC    ;INCLUDE_INI_I
  138.  
  139. ;--------------    
  140.