|
|
1.1 ! root 1: #ifndef __RDPARM_H ! 2: #define __RDPARM_H ! 3: ! 4: /* ! 5: * _RDPARM.H 5.20A June 8, 1995 ! 6: * ! 7: * The Greenleaf Comm Library ! 8: * ! 9: * Copyright (C) 1991-1995 Greenleaf Software Inc. All Rights Reserved. ! 10: * ! 11: * NOTES ! 12: * ! 13: * This header file contains constants, structures, and definitions ! 14: * used by the Greenleaf Parameter Block library. This is a set of ! 15: * code that supports the use of INI files. These are private functions ! 16: * used for our demo programs only. ! 17: * ! 18: * MODIFICATIONS ! 19: * ! 20: * December 1, 1994 5.10A : Initial release. ! 21: */ ! 22: ! 23: /* ! 24: * The PARAMETER_KEY structure contains the key and the value of ! 25: * the key. Each section has a linked list of these guys. ! 26: */ ! 27: ! 28: typedef struct parameter_key { ! 29: char *name; ! 30: char *value; ! 31: struct parameter_key *next_key; ! 32: } PARAMETER_KEY; ! 33: ! 34: /* ! 35: * The PARAMETER_SECTION structure contains the name of a section. Each ! 36: * parameter block has a linked list of these guys. In turn, these guys ! 37: * have a pointer to a linked list of keys and values. ! 38: */ ! 39: ! 40: typedef struct parameter_section { ! 41: char *name; ! 42: PARAMETER_KEY *first_key; ! 43: struct parameter_section *next_section; ! 44: } PARAMETER_SECTION; ! 45: ! 46: /* ! 47: * This is the stucture for the whole parameter block. All it does is ! 48: * hold the file name, and the pointer to the linked list of sections. ! 49: */ ! 50: ! 51: typedef struct ini_file { ! 52: PARAMETER_SECTION *first_section; ! 53: char *file_name; ! 54: } GF_PARAMETER_BLOCK; ! 55: ! 56: #ifdef __cplusplus ! 57: extern "C" { ! 58: #endif ! 59: ! 60: GF_PARAMETER_BLOCK * GF_CONV PBConstruct( char *file_name ); ! 61: int GF_CONV PBAddKey( GF_PARAMETER_BLOCK *ppb, ! 62: char *section_name, ! 63: char *key_name, ! 64: char *value ); ! 65: int GF_CONV PBReadIniFile( GF_PARAMETER_BLOCK *ppb ); ! 66: void GF_CONV PBWriteIniFile( GF_PARAMETER_BLOCK *ppb ); ! 67: void GF_CONV PBDestroy( GF_PARAMETER_BLOCK *ppb ); ! 68: char * GF_CONV PBFindValue( GF_PARAMETER_BLOCK *ppb, ! 69: char *section_name, ! 70: char *key_name ); ! 71: #ifdef __cplusplus ! 72: } ! 73: #endif ! 74: ! 75: #endif /* #ifndef __RDPARM_H */ ! 76:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.