00001 /* libIntegra multimedia module definition interface 00002 * 00003 * Copyright (C) 2007 Jamie Bullock, Henrik Frisk 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00018 * USA. 00019 */ 00020 00021 #ifndef INTEGRA_VALUE_H 00022 #define INTEGRA_VALUE_H 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 #include "Integra/integra_core_schema.h" 00029 00031 typedef struct ntg_value_ { 00032 int type; 00033 union ctype_ { 00034 char *s; 00035 float f; 00036 int i; 00037 unsigned char *b; 00038 } ctype; 00039 } ntg_value; 00040 00042 ntg_value *ntg_value_new(int type, void *v); 00043 00047 ntg_value *ntg_xml_value_new(int type, const char *v); 00048 00055 void ntg_value_copy(ntg_value *target, const ntg_value *source, 00056 const int source_type, const int target_type); 00057 00065 void ntg_value_set(ntg_value *value, int type, void *v); 00066 00067 00069 void ntg_value_append(ntg_value *values, const ntg_value *value); 00070 00072 int ntg_value_free(ntg_value *value) ; 00073 00075 int ntg_value_sprintf(char *s, const ntg_value *value); 00076 00078 //int ntg_value_get_type(ntg_value *value); 00079 00081 float ntg_value_get_float(const ntg_value *value); 00082 00084 int ntg_value_get_int(const ntg_value *value); 00085 00087 char *ntg_value_get_string(const ntg_value *value); 00088 00090 unsigned char *ntg_value_get_blob(const ntg_value *value); 00091 00092 #ifdef __cplusplus 00093 } 00094 #endif 00095 00096 #endif