X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=giscanner%2Fsourcescanner.h;h=9e3713120de5a6aa37b53c1300009308b22f11f3;hb=90c6035f8c6bcba7f58f9e571910e6a8c3e1585c;hp=3a391d85c3d377ff54774d5225faf0c83d5d2efd;hpb=76fa07f59e18aeca3254aa00089e9e7c931ad5aa;p=platform%2Fupstream%2Fgobject-introspection.git diff --git a/giscanner/sourcescanner.h b/giscanner/sourcescanner.h index 3a391d8..9e37131 100644 --- a/giscanner/sourcescanner.h +++ b/giscanner/sourcescanner.h @@ -25,13 +25,14 @@ #include #include +#include G_BEGIN_DECLS +typedef struct _GISourceComment GISourceComment; typedef struct _GISourceScanner GISourceScanner; typedef struct _GISourceSymbol GISourceSymbol; typedef struct _GISourceType GISourceType; -typedef struct _GISourceDirective GISourceDirective; typedef enum { @@ -96,28 +97,44 @@ typedef enum UNARY_LOGICAL_NEGATION } UnaryOperator; +struct _GISourceComment +{ + char *comment; + char *filename; + int line; +}; + struct _GISourceScanner { - char *current_filename; + GFile *current_file; gboolean macro_scan; + gboolean private; /* set by gtk-doc comment / */ + gboolean flags; /* set by gtk-doc comment */ GSList *symbols; - GList *filenames; - GHashTable *directives_map; + GHashTable *files; + GSList *comments; /* _GIComment */ GHashTable *typedef_table; - GHashTable *struct_or_union_or_enum_table; + gboolean skipping; + GQueue conditionals; }; struct _GISourceSymbol { int ref_count; GISourceSymbolType type; - int id; char *ident; GISourceType *base_type; gboolean const_int_set; - int const_int; + gboolean private; + gint64 const_int; /* 64-bit we can handle signed and unsigned 32-bit values */ + gboolean const_int_is_unsigned; char *const_string; - GSList *directives; /* list of GISourceDirective */ + gboolean const_double_set; + double const_double; + gboolean const_boolean_set; + int const_boolean; + char *source_filename; + int line; }; struct _GISourceType @@ -129,13 +146,7 @@ struct _GISourceType char *name; GISourceType *base_type; GList *child_list; /* list of GISourceSymbol */ -}; - -struct _GISourceDirective -{ - char *name; - char *value; - GSList *options; /* list of options (key=value) */ + gboolean is_bitfield; }; GISourceScanner * gi_source_scanner_new (void); @@ -148,23 +159,20 @@ void gi_source_scanner_parse_macros (GISourceScanner *scanne void gi_source_scanner_set_macro_scan (GISourceScanner *scanner, gboolean macro_scan); GSList * gi_source_scanner_get_symbols (GISourceScanner *scanner); -GSList * gi_source_scanner_get_directives (GISourceScanner *scanner, - const gchar *name); +GSList * gi_source_scanner_get_comments (GISourceScanner *scanner); void gi_source_scanner_free (GISourceScanner *scanner); -GISourceSymbol * gi_source_symbol_new (GISourceSymbolType type); +GISourceSymbol * gi_source_symbol_new (GISourceSymbolType type, GFile *file, int line); gboolean gi_source_symbol_get_const_boolean (GISourceSymbol *symbol); GISourceSymbol * gi_source_symbol_ref (GISourceSymbol *symbol); void gi_source_symbol_unref (GISourceSymbol *symbol); - -GISourceDirective * gi_source_directive_new (const gchar *name, - const gchar *value, - GSList *options); -void gi_source_directive_free (GISourceDirective *directive); +GISourceSymbol * gi_source_symbol_copy (GISourceSymbol *symbol); /* Private */ void gi_source_scanner_add_symbol (GISourceScanner *scanner, GISourceSymbol *symbol); +void gi_source_scanner_take_comment (GISourceScanner *scanner, + GISourceComment *comment); gboolean gi_source_scanner_is_typedef (GISourceScanner *scanner, const char *name); void gi_source_symbol_merge_type (GISourceSymbol *symbol, @@ -180,6 +188,8 @@ GISourceType * gi_source_pointer_new (GISourceType *base_type); GISourceType * gi_source_array_new (GISourceSymbol *size); GISourceType * gi_source_function_new (void); +void ctype_free (GISourceType * type); + G_END_DECLS #endif /* __SOURCE_SCANNER_H__ */