00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00019 #ifndef __DXCUT_VALUE_H
00020 #define __DXCUT_VALUE_H
00021 #include <dxcut/dex.h>
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00029 typedef enum DexValueType {
00031 VALUE_BYTE = 0x00,
00033 VALUE_SHORT = 0x02,
00035 VALUE_CHAR = 0x03,
00037 VALUE_INT = 0x04,
00039 VALUE_LONG = 0x06,
00041 VALUE_FLOAT = 0x10,
00043 VALUE_DOUBLE = 0x11,
00045 VALUE_STRING = 0x17,
00047 VALUE_TYPE = 0x18,
00049 VALUE_FIELD = 0x19,
00051 VALUE_METHOD = 0x1a,
00053 VALUE_ENUM = 0x1b,
00055 VALUE_ARRAY = 0x1c,
00058 VALUE_ANNOTATION = 0x1d,
00060 VALUE_NULL = 0x1e,
00062 VALUE_BOOLEAN = 0x1f,
00063
00064 VALUE_SENTINEL = 0xff
00065 } DexValueType;
00066
00067 struct dex_annotation_t;
00068
00069 struct dex_value_t {
00070 DexValueType type;
00071 union {
00072 dx_byte val_byte;
00073 dx_short val_short;
00074 dx_ushort val_char;
00075 dx_int val_int;
00076 dx_long val_long;
00077 float val_float;
00078 double val_double;
00079 ref_str* val_str;
00080 ref_str* val_type;
00081 struct {
00082 ref_str* defining_class;
00083 ref_str* type;
00084 ref_str* name;
00085 } val_field;
00086 struct {
00087 ref_str* defining_class;
00088 ref_strstr* prototype;
00089 ref_str* name;
00090 } val_method;
00091 struct {
00092 ref_str* defining_class;
00093 ref_str* type;
00094 ref_str* name;
00095 } val_enum;
00096
00097 struct dex_value_t* val_array;
00098 struct dex_annotation_t* val_annotation;
00099 int val_boolean;
00100 } value;
00101 };
00102
00103 typedef struct dex_value_t DexValue;
00104
00109 extern
00110 const char* dxc_value_nice(DexValue* value);
00111
00116 extern
00117 void dxc_free_value(DexValue* value);
00118
00122 extern
00123 int dxc_is_sentinel_value(DexValue* value);
00124
00128 extern
00129 void dxc_make_sentinel_value(DexValue* value);
00130
00131 #ifdef __cplusplus
00132 }
00133 #endif
00134 #endif // __DXCUT_VALUE_H