header.h

00001 /*
00002  * Copyright (c) 2005-2012 by KoanLogic s.r.l. <http://www.koanlogic.com>
00003  * All rights reserved.
00004  *
00005  * This file is part of KLone, and as such it is subject to the license stated
00006  * in the LICENSE file which you have received as part of this distribution.
00007  *
00008  * $Id: header.h,v 1.8 2007/07/13 14:00:13 tat Exp $
00009  */
00010 
00011 #ifndef _KLONE_HEADER_H_
00012 #define _KLONE_HEADER_H_
00013 
00014 #include <klone/field.h>
00015 #include <klone/io.h>
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif 
00020 
00021 /* load modes */
00022 enum { 
00023     HLM_OVERRIDE,
00024     HLM_KEEP,    
00025     HLM_ADD      
00027 };
00028 
00029 typedef struct
00030 {
00031      fields_t fields;         
00032      size_t nfields;
00033 } header_t;
00034 
00035 int header_create(header_t**);
00036 int header_load(header_t*, io_t *);
00037 int header_load_from_cgienv(header_t *h);
00038 int header_load_ex(header_t *h , io_t *io, int mode);
00039 int header_free(header_t*);
00040 int header_add_field(header_t *h, field_t *f);
00041 int header_del_field(header_t *h, field_t *f);
00042 field_t* header_get_field(header_t *h, const char *name);
00043 int header_clear(header_t *h);
00044 
00045 const char* header_get_field_value(header_t *h, const char *name);
00046 
00047 int header_set_field(header_t *h, const char *name, const char *value);
00048 
00049 field_t* header_get_fieldn(header_t *h, size_t idx);
00050 size_t header_field_count(header_t *h);
00051 
00052 #ifdef __cplusplus
00053 }
00054 #endif 
00055 
00056 #endif

←Products
Copyright © 2005-2012 - KoanLogic S.r.l. - All rights reserved