00001
00002
00003
00004
00005
00006
00007
00008 #ifndef LIBAEGIS_GSTATE_H
00009 #define LIBAEGIS_GSTATE_H
00010
00011 #include <common/str.h>
00012 #include <libaegis/output.h>
00013 #include <libaegis/meta_lex.h>
00014 #include <libaegis/meta_parse.h>
00015 #include <libaegis/meta_type.h>
00016
00017 class nstring;
00018
00019 #ifndef gstate_where_DEF
00020 #define gstate_where_DEF
00021
00022 #define gstate_where_project_name_mask ((unsigned long)0)
00023 #define gstate_where_directory_mask ((unsigned long)0)
00024 #define gstate_where_alias_for_mask ((unsigned long)0)
00025
00026 struct gstate_where_ty
00027 {
00028 long reference_count;
00029 unsigned long mask;
00030 string_ty *errpos;
00031 string_ty *project_name;
00032 string_ty *directory;
00033 string_ty *alias_for;
00034 };
00035 #endif // gstate_where_DEF
00036
00037 extern meta_type gstate_where_type;
00038
00039 void gstate_where_write(const output::pointer &fp, const char *name, gstate_where_ty *value);
00040 void gstate_where_write_xml(const output::pointer &fp, const char *name, gstate_where_ty *value);
00041 gstate_where_ty *gstate_where_copy(gstate_where_ty *);
00042 gstate_where_ty *gstate_where_clone(gstate_where_ty *);
00043 #ifdef DEBUG
00044 void gstate_where_trace_real(const char *name, const gstate_where_ty *value);
00045 #define gstate_where_trace(x) ((void)(trace_pretest_ && (trace_where_, gstate_where_trace_real(trace_stringize(x), x), 0)))
00046 #else
00047 #define gstate_where_trace(x)
00048 #endif
00049
00050 #ifndef gstate_where_list_DEF
00051 #define gstate_where_list_DEF
00052 struct gstate_where_list_ty
00053 {
00054 size_t length;
00055 size_t maximum;
00056 gstate_where_ty **list;
00057 };
00058 #endif // gstate_where_list_DEF
00059
00060 extern meta_type gstate_where_list_type;
00061
00062 gstate_where_list_ty *gstate_where_list_copy(gstate_where_list_ty *);
00063 gstate_where_list_ty *gstate_where_list_clone(gstate_where_list_ty *);
00064 void gstate_where_list_write(const output::pointer &fp, const char *name, gstate_where_list_ty *value);
00065 void gstate_where_list_write_xml(const output::pointer &fp, const char *name, gstate_where_list_ty *value);
00066 #ifdef DEBUG
00067 void gstate_where_list_trace_real(const char *name, const gstate_where_list_ty *value);
00068 #define gstate_where_list_trace(x) ((void)(trace_pretest_ && (trace_where_, gstate_where_list_trace_real(trace_stringize(x), x), 0)))
00069 #else
00070 #define gstate_where_list_trace(x)
00071 #endif
00072
00073 #ifndef gstate_DEF
00074 #define gstate_DEF
00075
00076 #define gstate_where_mask ((unsigned long)0)
00077
00078 struct gstate_ty
00079 {
00080 long reference_count;
00081 unsigned long mask;
00082 string_ty *errpos;
00083 gstate_where_list_ty *where;
00084 };
00085 #endif // gstate_DEF
00086
00087 extern meta_type gstate_type;
00088
00089 void gstate_write(const output::pointer &fp, gstate_ty *value);
00090 void gstate_write_xml(const output::pointer &fp, gstate_ty *value);
00091 gstate_ty *gstate_copy(gstate_ty *);
00092 gstate_ty *gstate_clone(gstate_ty *);
00093 #ifdef DEBUG
00094 void gstate_trace_real(const char *name, const gstate_ty *value);
00095 #define gstate_trace(x) ((void)(trace_pretest_ && (trace_where_, gstate_trace_real(trace_stringize(x), x), 0)))
00096 #else
00097 #define gstate_trace(x)
00098 #endif
00099
00116 void gstate_write_file(string_ty *filename, gstate_ty *value, int comp);
00117
00134 void gstate_write_file(const nstring &filnam, gstate_ty *value, bool comp);
00135
00152 gstate_ty *gstate_read_file(string_ty *filename);
00153
00170 gstate_ty *gstate_read_file(const nstring &filename);
00171 void gstate__rpt_init(void);
00172
00173 #endif // LIBAEGIS_GSTATE_H