diff options
author | Indent <please@skip.me> | 2015-02-19 02:47:20 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-02-20 19:50:54 -0300 |
commit | 5ebff60479fc7a9f7f50ac03b124c91d4e6ebe11 (patch) | |
tree | 9fc0d50cb1f4bc9768d9f00de94eafd876bb55b0 /lib/xmltree.h | |
parent | af359b4316f9d392c6b752495a1b2ed631576ed8 (diff) |
Reindent everything to K&R style with tabs
Used uncrustify, with the configuration file in ./doc/uncrustify.cfg
Commit author set to "Indent <please@skip.me>" so that it's easier to
skip while doing git blame.
Diffstat (limited to 'lib/xmltree.h')
-rw-r--r-- | lib/xmltree.h | 80 |
1 files changed, 37 insertions, 43 deletions
diff --git a/lib/xmltree.h b/lib/xmltree.h index af13b859..85b10983 100644 --- a/lib/xmltree.h +++ b/lib/xmltree.h @@ -24,79 +24,73 @@ #ifndef _XMLTREE_H #define _XMLTREE_H -typedef enum -{ - XT_COMPLETE = 1, /* </tag> reached */ - XT_SEEN = 2, /* Handler called (or not defined) */ +typedef enum { + XT_COMPLETE = 1, /* </tag> reached */ + XT_SEEN = 2, /* Handler called (or not defined) */ } xt_flags; -typedef enum -{ - XT_ABORT, /* Abort, don't handle the rest anymore */ - XT_HANDLED, /* Handled this tag properly, go to the next one */ - XT_NEXT /* Try if there's another matching handler */ +typedef enum { + XT_ABORT, /* Abort, don't handle the rest anymore */ + XT_HANDLED, /* Handled this tag properly, go to the next one */ + XT_NEXT /* Try if there's another matching handler */ } xt_status; -struct xt_attr -{ +struct xt_attr { char *key, *value; }; -struct xt_node -{ +struct xt_node { struct xt_node *parent; struct xt_node *children; - + char *name; struct xt_attr *attr; char *text; int text_len; - + struct xt_node *next; xt_flags flags; }; -typedef xt_status (*xt_handler_func) ( struct xt_node *node, gpointer data ); +typedef xt_status (*xt_handler_func) (struct xt_node *node, gpointer data); -struct xt_handler_entry -{ +struct xt_handler_entry { char *name, *parent; xt_handler_func func; }; -struct xt_parser -{ +struct xt_parser { GMarkupParseContext *parser; struct xt_node *root; struct xt_node *cur; - + const struct xt_handler_entry *handlers; gpointer data; - + GError *gerr; }; -struct xt_parser *xt_new( const struct xt_handler_entry *handlers, gpointer data ); -void xt_reset( struct xt_parser *xt ); -int xt_feed( struct xt_parser *xt, const char *text, int text_len ); -int xt_handle( struct xt_parser *xt, struct xt_node *node, int depth ); -void xt_cleanup( struct xt_parser *xt, struct xt_node *node, int depth ); -struct xt_node *xt_from_string( const char *in, int text_len ); -char *xt_to_string( struct xt_node *node ); -char *xt_to_string_i( struct xt_node *node ); -void xt_print( struct xt_node *node ); -struct xt_node *xt_dup( struct xt_node *node ); -void xt_free_node( struct xt_node *node ); -void xt_free( struct xt_parser *xt ); -struct xt_node *xt_find_node( struct xt_node *node, const char *name ); -struct xt_node *xt_find_path( struct xt_node *node, const char *name ); -char *xt_find_attr( struct xt_node *node, const char *key ); -struct xt_node *xt_find_node_by_attr( struct xt_node *xt, const char *tag, const char *key, const char *value ); +struct xt_parser *xt_new(const struct xt_handler_entry *handlers, gpointer data); +void xt_reset(struct xt_parser *xt); +int xt_feed(struct xt_parser *xt, const char *text, int text_len); +int xt_handle(struct xt_parser *xt, struct xt_node *node, int depth); +void xt_cleanup(struct xt_parser *xt, struct xt_node *node, int depth); +struct xt_node *xt_from_string(const char *in, int text_len); +char *xt_to_string(struct xt_node *node); +char *xt_to_string_i(struct xt_node *node); +void xt_print(struct xt_node *node); +struct xt_node *xt_dup(struct xt_node *node); +void xt_free_node(struct xt_node *node); +void xt_free(struct xt_parser *xt); +struct xt_node *xt_find_node(struct xt_node *node, const char *name); +struct xt_node *xt_find_path(struct xt_node *node, const char *name); +char *xt_find_attr(struct xt_node *node, const char *key); +struct xt_node *xt_find_node_by_attr(struct xt_node *xt, const char *tag, const char *key, const char *value); -struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children ); -void xt_add_child( struct xt_node *parent, struct xt_node *child ); -void xt_insert_child( struct xt_node *parent, struct xt_node *child ); -void xt_add_attr( struct xt_node *node, const char *key, const char *value ); -int xt_remove_attr( struct xt_node *node, const char *key ); +struct xt_node *xt_new_node(char *name, const char *text, struct xt_node *children); +void xt_add_child(struct xt_node *parent, struct xt_node *child); +void xt_insert_child(struct xt_node *parent, struct xt_node *child); +void xt_add_attr(struct xt_node *node, const char *key, const char *value); +int xt_remove_attr(struct xt_node *node, const char *key); #endif |