00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CUCON_RPMAP_H
00019 #define CUCON_RPMAP_H
00020
00021 #include <cucon/rumap.h>
00022
00023 CU_BEGIN_DECLARATIONS
00024
00025
00026
00027 struct cucon_rpmap
00028 {
00029 struct cucon_rumap impl;
00030 };
00031
00032
00033 CU_SINLINE void cucon_rpmap_init(cucon_rpmap_t rmap)
00034 { cucon_rumap_init(&rmap->impl); }
00035
00036
00037 CU_SINLINE cucon_rpmap_t cucon_rpmap_new(void)
00038 { return (cucon_rpmap_t)cucon_rumap_new(); }
00039
00040
00041 CU_SINLINE void *cucon_rpmap_value(cucon_rpmap_t rmap)
00042 { return cucon_rumap_value(&rmap->impl); }
00043
00044
00045 CU_SINLINE void cucon_rpmap_set_value(cucon_rpmap_t rmap, void *value)
00046 { cucon_rumap_set_value(&rmap->impl, value); }
00047
00048
00049 CU_SINLINE cu_bool_t cucon_rpmap_is_leaf(cucon_rpmap_t rmap)
00050 { return cucon_rumap_is_leaf(&rmap->impl); }
00051
00052
00053 CU_SINLINE cucon_rpmap_t cucon_rpmap_mref(cucon_rpmap_t rmap, void *key)
00054 { return (cucon_rpmap_t)cucon_rumap_mref(&rmap->impl, (uintptr_t)key); }
00055
00056
00057 CU_SINLINE cucon_rpmap_t
00058 cucon_rpmap_cref(cucon_rpmap_t rpmap, void *key)
00059 { return (cucon_rpmap_t)cucon_rumap_cref(&rpmap->impl, (uintptr_t)key); }
00060
00061 CU_SINLINE cu_bool_t
00062 cucon_rpmap_conj(cucon_rpmap_t rpmap,
00063 cu_clop(fn, cu_bool_t, void const *, cucon_rpmap_t))
00064 {
00065 return cucon_umap_conj_mem(&rpmap->impl.branches,
00066 (cu_clop(, cu_bool_t, uintptr_t, void *))fn);
00067 }
00068
00069
00070 CU_END_DECLARATIONS
00071
00072 #endif