Back to index

php5  5.3.10
inifile.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2010 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Marcus Boerger <helly@php.net>                               |
00016    +----------------------------------------------------------------------+
00017  */
00018 
00019 /* $Id: inifile.h 293036 2010-01-03 09:23:27Z sebastian $ */
00020 
00021 #ifndef PHP_LIB_INIFILE_H
00022 #define PHP_LIB_INIFILE_H
00023 
00024 typedef struct {
00025        char *group;
00026        char *name;
00027 } key_type;
00028 
00029 typedef struct {
00030        char *value;
00031 } val_type;
00032 
00033 typedef struct {
00034        key_type key;
00035        val_type val;
00036        size_t pos;
00037 } line_type;
00038 
00039 typedef struct {
00040        char *lockfn;
00041        int lockfd;
00042        php_stream *fp;
00043        int readonly;
00044        line_type curr;
00045        line_type next;
00046 } inifile;
00047 
00048 val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC);
00049 int inifile_firstkey(inifile *dba TSRMLS_DC);
00050 int inifile_nextkey(inifile *dba TSRMLS_DC);
00051 int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC);
00052 int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
00053 int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
00054 char *inifile_version();
00055 
00056 key_type inifile_key_split(const char *group_name);
00057 char * inifile_key_string(const key_type *key);
00058 
00059 void inifile_key_free(key_type *key);
00060 void inifile_val_free(val_type *val);
00061 void inifile_line_free(line_type *ln);
00062 
00063 inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC);
00064 void inifile_free(inifile *dba, int persistent);
00065 
00066 #endif