00001
00012 #ifndef _CONSTANT_H_
00013 #define _CONSTANT_H_
00014
00015 #include <gtk/gtk.h>
00016 #include "class.h"
00017
00018
00019 struct s_constant {
00020 struct s_class class;
00021 };
00022
00023
00024 #define CONST(class) ((struct s_constant *)class)
00025 #define CONST_TYPE(const) CLASS_TYPE(const)
00026
00027 #define const_alloc(_type, _value) \
00028 ({ \
00029 register struct s_constant *__myconst = __const_alloc(); \
00030 value_set(&(CLASS(__myconst)->value), _type, _value); \
00031 __myconst; \
00032 })
00033
00034
00035 struct s_constant *__const_alloc(void);
00036 void const_free(struct s_constant *);
00037 #ifdef DEBUG
00038 gchar *const_subdebug(struct s_constant *);
00039 #endif
00040 #endif