00001 /* 00002 * Copyright (c) 2011 Jiri Svoboda 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * - Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * - Redistributions in binary form must reproduce the above copyright 00012 * notice, this list of conditions and the following disclaimer in the 00013 * documentation and/or other materials provided with the distribution. 00014 * - The name of the author may not be used to endorse or promote products 00015 * derived from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00018 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00019 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00020 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00022 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00024 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00026 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 */ 00028 00029 #ifndef RDATA_H_ 00030 #define RDATA_H_ 00031 00032 #include "mytypes.h" 00033 00034 rdata_item_t *rdata_item_new(item_class_t ic); 00035 rdata_addr_var_t *rdata_addr_var_new(void); 00036 rdata_aprop_named_t *rdata_aprop_named_new(void); 00037 rdata_aprop_indexed_t *rdata_aprop_indexed_new(void); 00038 rdata_addr_prop_t *rdata_addr_prop_new(aprop_class_t apc); 00039 rdata_address_t *rdata_address_new(address_class_t ac); 00040 rdata_value_t *rdata_value_new(void); 00041 00042 rdata_var_t *rdata_var_new(var_class_t vc); 00043 void rdata_var_delete(rdata_var_t *var); 00044 rdata_ref_t *rdata_ref_new(void); 00045 rdata_deleg_t *rdata_deleg_new(void); 00046 rdata_enum_t *rdata_enum_new(void); 00047 rdata_array_t *rdata_array_new(int rank); 00048 rdata_object_t *rdata_object_new(void); 00049 rdata_bool_t *rdata_bool_new(void); 00050 rdata_char_t *rdata_char_new(void); 00051 rdata_int_t *rdata_int_new(void); 00052 rdata_string_t *rdata_string_new(void); 00053 rdata_resource_t *rdata_resource_new(void); 00054 rdata_symbol_t *rdata_symbol_new(void); 00055 00056 void rdata_address_delete(rdata_address_t *address); 00057 void rdata_value_delete(rdata_value_t *value); 00058 void rdata_var_delete(rdata_var_t *var); 00059 void rdata_item_delete(rdata_item_t *item); 00060 void rdata_addr_var_delete(rdata_addr_var_t *addr_var); 00061 void rdata_addr_prop_delete(rdata_addr_prop_t *addr_prop); 00062 void rdata_aprop_named_delete(rdata_aprop_named_t *aprop_named); 00063 void rdata_aprop_indexed_delete(rdata_aprop_indexed_t *aprop_indexed); 00064 00065 void rdata_bool_delete(rdata_bool_t *bool_v); 00066 void rdata_char_delete(rdata_char_t *char_v); 00067 void rdata_int_delete(rdata_int_t *int_v); 00068 void rdata_string_delete(rdata_string_t *string_v); 00069 void rdata_ref_delete(rdata_ref_t *ref_v); 00070 void rdata_deleg_delete(rdata_deleg_t *deleg_v); 00071 void rdata_enum_delete(rdata_enum_t *enum_v); 00072 void rdata_array_delete(rdata_array_t *array_v); 00073 void rdata_object_delete(rdata_object_t *object_v); 00074 void rdata_resource_delete(rdata_resource_t *resource_v); 00075 void rdata_symbol_delete(rdata_symbol_t *symbol_v); 00076 00077 void rdata_array_alloc_element(rdata_array_t *array); 00078 void rdata_value_copy(rdata_value_t *val, rdata_value_t **rval); 00079 void rdata_var_copy(rdata_var_t *src, rdata_var_t **dest); 00080 00081 void rdata_address_destroy(rdata_address_t *address); 00082 void rdata_addr_var_destroy(rdata_addr_var_t *addr_var); 00083 void rdata_addr_prop_destroy(rdata_addr_prop_t *addr_prop); 00084 void rdata_aprop_named_destroy(rdata_aprop_named_t *aprop_named); 00085 void rdata_aprop_indexed_destroy(rdata_aprop_indexed_t *aprop_indexed); 00086 void rdata_value_destroy(rdata_value_t *value); 00087 void rdata_var_destroy(rdata_var_t *var); 00088 void rdata_item_destroy(rdata_item_t *item); 00089 00090 void rdata_var_read(rdata_var_t *var, rdata_item_t **ritem); 00091 void rdata_var_write(rdata_var_t *var, rdata_value_t *value); 00092 00093 void rdata_item_print(rdata_item_t *item); 00094 void rdata_value_print(rdata_value_t *value); 00095 00096 #endif