Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

var.h

00001 /*
00002  * Copyright (c) 2005, 2006 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: var.h,v 1.8 2006/01/09 12:38:38 tat Exp $
00009  */
00010 
00011 #ifndef _KLONE_VAR_H_
00012 #define _KLONE_VAR_H_
00013 
00014 #include <sys/types.h>
00015 #include <u/libu.h>
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 struct var_s;
00022 typedef struct var_s var_t;
00023 
00024 int var_create(const char* name, const char *value, var_t**);
00025 int var_bin_create(const char* name, const char *data, size_t size, var_t**);
00026 int var_free(var_t*);
00027 
00028 const char* var_get_name(var_t *v);
00029 const char* var_get_value(var_t *v);
00030 size_t var_get_value_size(var_t *v);
00031 
00032 u_string_t* var_get_name_s(var_t *v);
00033 u_string_t* var_get_value_s(var_t *v);
00034 
00035 int var_set(var_t*, const char *name, const char *value);
00036 int var_set_name(var_t *v, const char *name);
00037 int var_set_value(var_t *v, const char *value);
00038 int var_set_bin_value(var_t *v, const char *data, size_t size);
00039 
00040 void var_set_opaque(var_t *v, void *blob);
00041 void* var_get_opaque(var_t *v);
00042 
00043 #ifdef __cplusplus
00044 }
00045 #endif 
00046 
00047 #endif