// Header File // Created 08/11/2004; 22:32:23 #ifndef __GTC__ asm("conflib__version01: .xdef conflib__version01"); #else char conflib__version01[0]; #endif #define conflib__get_num_key conflib__0000 long conflib::get_num_key(const char *file, const char *section, const char *key, long default, const short *error) /* file = name of the file which contains the searched key this name can't contain a folder name, the searched file must be in the system folder (defined by PreOS) if *file doesn't exist, conflib will try to create it. In case of failure, conflib will return default value and error code will be conflib_FILE_NOT_FOUND section = name of section in which the key will be searched. You can pass a NULL pointer if the searched key isn't in a section key = name of the searched key if *key doesn't exist, conflib will return default value and error code will be conflib_KEY_NOT_FOUND default = default value, which is returned in case of error (so, caller program doesn't need to catch errors) error = pointer to short value, where the error will be stored. Can be NULL if you don't want to take care of errors if all is correct, *error = conflib_OK*/ #define conflib__add_num_key conflib__0001 short conflib__add_num_key(const char *file, const char *section, const char *key, long value) /* file = name of the file which contains the key to store this name can't contain a folder name, the searched file must be in the system folder (defined by PreOS) if *file doesn't exist, conflib will try to create it. In case of failure, conflib will return CONFLIB_FILE_NOT_FOUND section = name of section in which the key will be searched. You can pass a NULL pointer if the searched key isn't in a section key = name of the key to store if *key doesn't exist, conflib will create a new key value = value of the key if all is correct, conflib returns conflib_OK */ #define conflib__remove_key conflib__0002 short conflib::remove_key(const char *file, const char *section, const char *key) /* file = name of the file which contains the key to remove this name can't contain a folder name, the searched file must be in the system folder (defined by PreOS) if *file doesn't exist, conflib will try to create it. In case of failure, conflib will return CONFLIB_FILE_NOT_FOUND section = name of section in which the key will be searched. You can pass a NULL pointer if the searched key isn't in a section key = name of the key to remove if *key doesn't exist, the text remain unchanged. after this function, *file is unarchived (even the searched key doesn't exist). if there is not enough memory to remove the key, error will be conflib_UNSAVED_FILE if all is correct, conflib returns conflib_OK */ #define conflib__get_string_key conflib__0003 short conflib__get_string_key(const char *file, const char *section, const char *key, const char *value, long max_length, const char *default) /* file = name of the file which contains the searched key this name can't contain a folder name, the searched file must be in the system folder (defined by PreOS) if *file doesn't exist, conflib will try to create it. In case of failure, conflib will return CONFLIB_FILE_NOT_FOUND section = name of section in which the key will be searched. You can pass a NULL pointer if the searched key isn't in a section key = name of the searched key if *key doesn't exist, conflib will return default value and error code will be conflib_KEY_NOT_FOUND value = pointer where the result will be stored max_length = maximum length of the result. The *value buffer must be at least (max_length-bytes+1) long (+1 for the terminating zero) default = default value, which is written in case of error error = pointer to short value, where the error will be stored if all is correct, conflib returns conflib_OK */ #define conflib__add_string_key conflib__0004 short conflib__add_string_key(const char *file, const char *section, const char *key, const char *value) /* file = name of the file which contains the key to store this name can't contain a folder name, the searched file must be in the system folder (defined by PreOS) if *file doesn't exist, conflib will try to create it. In case of failure, conflib will return CONFLIB_FILE_NOT_FOUND section = name of section in which the key will be searched. You can pass a NULL pointer if the searched key isn't in a section key = name of the key to store if *key doesn't exist, conflib will create a new key value = pointer to the value (standard C string) if all is correct, conflib returns conflib_OK */ #define CONFLIB_OK 0 #define CONFLIB_FILE_NOT_FOUND 1 #define CONFLIB_KEY_NOT_FOUND 2 #define CONFLIB_INVALID_KEY 3 #define CONFLIB_UNSAVED_FILE 4 #define CONFLIB_UNARCHIVED_FILE 5 #define CONFLIB_CANT_CREATE_FILE 6 #define CONFLIB_SECTION_NOT_FOUND 7