Update HACKING for changed doc generation instructions
[geany-mirror.git] / tagmanager / src / tm_symbol.h
blobe6207d3fde97393307345308ab10f87caedcc14f
1 /*
3 * Copyright (c) 2001-2002, Biswapesh Chattopadhyay
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 */
10 #ifndef TM_SYMBOL_H
11 #define TM_SYMBOL_H
14 /*! \file
15 The TMSymbol structure and related routines are used by TMProject to maintain a symbol
16 hierarchy. The top level TMSymbol maintains a pretty simple hierarchy, consisting of
17 compounds (classes and structs) and their children (member variables and functions).
20 #include <glib.h>
22 #include "tm_tag.h"
24 #ifdef __cplusplus
25 extern "C"
27 #endif
29 /*! This structure defines a symbol */
30 typedef struct _TMSymbol
32 TMTag *tag; /*!< The tag corresponding to this symbol */
33 struct _TMSymbol *parent; /*!< Parent class/struct for functions/variables */
34 union
36 GPtrArray *children; /*!< Array of child symbols */
37 TMTag *equiv; /*!< Prototype tag for functions */
38 } info;
39 } TMSymbol;
41 #define TM_SYMBOL(S) ((TMSymbol *) (S))
43 /*! Creates a symbol tree from an array of tags.
44 \param tags The array of tags from which to create the symbol tree.
45 \return The root symbol (starting point of the symbol tree)
47 TMSymbol *tm_symbol_tree_new(GPtrArray *tags);
49 /*! Given a symbol, frees it and all its children.
50 \param root The symbol to free.
52 void tm_symbol_tree_free(gpointer root);
54 /*! Given a symbol tree and an array of tags, updates the symbol tree. Note
55 that the returned pointer may be different from the passed root pointer,
56 so don't throw it away. This is basically a convinience function that calls
57 tm_symbol_tree_free() and tm_symbol_tree_new().
58 \param root The original root symbol.
59 \param tags The array of tags from which to rebuild the tree.
60 \return The new root symbol.
62 TMSymbol *tm_symbol_tree_update(TMSymbol *root, GPtrArray *tags);
64 /*! Arglist comparison function */
65 int tm_arglist_compare(const TMTag *t1, const TMTag *t2);
67 /*! Symbol comparison function - can be used for sorting purposes. */
68 int tm_symbol_compare(const void *p1, const void *p2);
70 /*! Tag comparison function tailor made for creating symbol view */
71 int tm_symbol_tag_compare(const TMTag **t1, const TMTag **t2);
73 /*! Prints the symbol hierarchy to standard error */
74 void tm_symbol_print(TMSymbol *sym, guint level);
76 #ifdef __cplusplus
78 #endif
80 #endif /* TM_SYMBOL_H */