1 /**********************************************************************************
4 * Include file for libini.a. Coding? Include this and link against libini.a.
7 **************************************************
8 * This code was created by Peter Harvey @ CodeByDesign.
9 * Released under LGPL 28.JAN.99
11 * Contributions from...
12 * -----------------------------------------------
13 * Peter Harvey - pharvey@codebydesign.com
14 **************************************************/
16 #ifndef INCLUDED_INI_H
17 #define INCLUDED_INI_H
19 /*********[ CONSTANTS AND TYPES ]**************************************************/
37 #define INI_MAX_LINE 1000
38 #define INI_MAX_OBJECT_NAME INI_MAX_LINE
39 #define INI_MAX_PROPERTY_NAME INI_MAX_LINE
40 #define INI_MAX_PROPERTY_VALUE INI_MAX_LINE
47 #define ODBC_FILENAME_MAX PATH_MAX
49 #define ODBC_FILENAME_MAX MAXPATHLEN
51 #define ODBC_FILENAME_MAX FILENAME_MAX
54 /********************************************
57 * Each property line has Name=Value pair.
58 * They are stored in this structure and linked together to provide a list
59 * of all properties for a given Object.
60 ********************************************/
62 typedef struct tINIPROPERTY
64 struct tINIPROPERTY
*pNext
;
65 struct tINIPROPERTY
*pPrev
;
67 char szName
[INI_MAX_PROPERTY_NAME
+1];
68 char szValue
[INI_MAX_PROPERTY_VALUE
+1];
70 } INIPROPERTY
, *HINIPROPERTY
;
72 /********************************************
75 * Each object line has just an object name. This structure
76 * stores the object name and its subordinate information.
77 * The lines that follow are considered to be properties
78 * and are stored in a list of tINIPROPERTY.
79 ********************************************/
81 typedef struct tINIOBJECT
83 struct tINIOBJECT
*pNext
;
84 struct tINIOBJECT
*pPrev
;
86 char szName
[INI_MAX_OBJECT_NAME
+1];
88 HINIPROPERTY hFirstProperty
;
89 HINIPROPERTY hLastProperty
;
92 } INIOBJECT
, *HINIOBJECT
;
94 /********************************************
97 * Each INI file contains a list of objects. This
98 * structure stores each object in a list of tINIOBJECT.
99 ********************************************/
103 char szFileName
[ODBC_FILENAME_MAX
+1]; /* FULL INI FILE NAME */
104 char cComment
; /* COMMENT CHAR MUST BE IN FIRST COLUMN */
105 char cLeftBracket
; /* BRACKETS DELIMIT THE OBJECT NAME, THE LEFT BRACKET MUST BE IN COLUMN ONE */
107 char cEqual
; /* SEPERATES THE PROPERTY NAME FROM ITS VALUE */
108 int bChanged
; /* IF true, THEN THE WHOLE FILE IS OVERWRITTEN UPON iniCommit */
109 int bReadOnly
; /* TRUE IF AT LEAST ONE CALL HAS BEEN MADE TO iniAppend() */
111 HINIOBJECT hFirstObject
;
112 HINIOBJECT hLastObject
;
113 HINIOBJECT hCurObject
;
116 HINIPROPERTY hCurProperty
;
120 /********************************************
123 * Used to store the current Object and Property pointers so
124 * that the caller can quickly return to some point in the
126 ********************************************/
128 typedef struct tINIBOOKMARK
131 HINIOBJECT hCurObject
;
132 HINIPROPERTY hCurProperty
;
134 } INIBOOKMARK
, *HINIBOOKMARK
;
136 #if defined(__cplusplus)
140 /*********[ PRIMARY INTERFACE ]*****************************************************/
142 #include "ini_stubs.h"
144 #if defined(__cplusplus)