Main Page   File List   File Members  

class.h

Go to the documentation of this file.
00001 
00010 #ifndef _CLASS_H_
00011 #define _CLASS_H_
00012 
00013 #include <gtk/gtk.h>
00014 #include "value.h"
00015 #include "mem.h"
00016 
00017 /*>>> class types definition                       */
00018 typedef enum {
00019   CLASS_PROC,             
00020   CLASS_VAR,              
00021   CLASS_INSTR,            
00022   CLASS_CONST,            
00023   CLASS_LIST              
00024 } classtype_t;
00025 
00026 /*>>> class definition                                                       */
00027 struct s_class {
00028   classtype_t classtype;  
00029   struct s_value value;   
00031   gshort refcnt;          
00032 };
00033 
00034 /*>>> macros                                                                 */
00035 #define CLASS(noclass)        ((struct s_class *)noclass)
00036 #define CLASS_TYPE(class)     ((CLASS(class))->classtype)
00037 #define CLASS_VALUE(noclass)  ((CLASS(noclass))->value)
00038 
00039 #define class_subdebug(noclass)                                               \
00040   ({                                                                          \
00041     gchar *str = NULL;                                                        \
00042                                                                               \
00043     if(noclass != NULL)                                                       \
00044       {                                                                       \
00045         switch(CLASS_TYPE(noclass))                                           \
00046           {                                                                   \
00047           case CLASS_PROC : str = proc_subdebug(noclass); break;              \
00048           case CLASS_VAR  : str = var_subdebug(noclass); break;               \
00049           case CLASS_INSTR: str = instr_subdebug(noclass); break;             \
00050           case CLASS_CONST: str = const_subdebug(noclass); break;             \
00051           case CLASS_LIST : str = list_subdebug(noclass);                     \
00052           }                                                                   \
00053                                                                               \
00054       }                                                                       \
00055                                                                               \
00056     str;                                                                      \
00057   })
00058 
00059 #define class_ref(class)    (CLASS(class)->refcnt++)
00060 #define class_unref(class)  (CLASS(class)->refcnt--)
00061 
00062 /*>>> functions prototypes                         */
00063 void class_free_from_list(gpointer, gpointer);
00064 
00065 #endif /* _CLASS_H_ */

Generated on Tue Aug 6 13:21:19 2002 for lafontaine by doxygen1.2.15