Changeset 5ebff60 for lib/xmltree.h


Ignore:
Timestamp:
2015-02-20T22:50:54Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
0b9daac, 3d45471, 7733b8c
Parents:
af359b4
git-author:
Indent <please@…> (19-02-15 05:47:20)
git-committer:
dequis <dx@…> (20-02-15 22:50:54)
Message:

Reindent everything to K&R style with tabs

Used uncrustify, with the configuration file in ./doc/uncrustify.cfg

Commit author set to "Indent <please@…>" so that it's easier to
skip while doing git blame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/xmltree.h

    raf359b4 r5ebff60  
    2525#define _XMLTREE_H
    2626
    27 typedef enum
    28 {
    29         XT_COMPLETE     = 1,    /* </tag> reached */
    30         XT_SEEN         = 2,    /* Handler called (or not defined) */
     27typedef enum {
     28        XT_COMPLETE     = 1,    /* </tag> reached */
     29        XT_SEEN         = 2,    /* Handler called (or not defined) */
    3130} xt_flags;
    3231
    33 typedef enum
    34 {
    35         XT_ABORT,               /* Abort, don't handle the rest anymore */
    36         XT_HANDLED,             /* Handled this tag properly, go to the next one */
    37         XT_NEXT                 /* Try if there's another matching handler */
     32typedef enum {
     33        XT_ABORT,               /* Abort, don't handle the rest anymore */
     34        XT_HANDLED,             /* Handled this tag properly, go to the next one */
     35        XT_NEXT                 /* Try if there's another matching handler */
    3836} xt_status;
    3937
    40 struct xt_attr
    41 {
     38struct xt_attr {
    4239        char *key, *value;
    4340};
    4441
    45 struct xt_node
    46 {
     42struct xt_node {
    4743        struct xt_node *parent;
    4844        struct xt_node *children;
    49        
     45
    5046        char *name;
    5147        struct xt_attr *attr;
    5248        char *text;
    5349        int text_len;
    54        
     50
    5551        struct xt_node *next;
    5652        xt_flags flags;
    5753};
    5854
    59 typedef xt_status (*xt_handler_func) ( struct xt_node *node, gpointer data );
     55typedef xt_status (*xt_handler_func) (struct xt_node *node, gpointer data);
    6056
    61 struct xt_handler_entry
    62 {
     57struct xt_handler_entry {
    6358        char *name, *parent;
    6459        xt_handler_func func;
    6560};
    6661
    67 struct xt_parser
    68 {
     62struct xt_parser {
    6963        GMarkupParseContext *parser;
    7064        struct xt_node *root;
    7165        struct xt_node *cur;
    72        
     66
    7367        const struct xt_handler_entry *handlers;
    7468        gpointer data;
    75        
     69
    7670        GError *gerr;
    7771};
    7872
    79 struct xt_parser *xt_new( const struct xt_handler_entry *handlers, gpointer data );
    80 void xt_reset( struct xt_parser *xt );
    81 int xt_feed( struct xt_parser *xt, const char *text, int text_len );
    82 int xt_handle( struct xt_parser *xt, struct xt_node *node, int depth );
    83 void xt_cleanup( struct xt_parser *xt, struct xt_node *node, int depth );
    84 struct xt_node *xt_from_string( const char *in, int text_len );
    85 char *xt_to_string( struct xt_node *node );
    86 char *xt_to_string_i( struct xt_node *node );
    87 void xt_print( struct xt_node *node );
    88 struct xt_node *xt_dup( struct xt_node *node );
    89 void xt_free_node( struct xt_node *node );
    90 void xt_free( struct xt_parser *xt );
    91 struct xt_node *xt_find_node( struct xt_node *node, const char *name );
    92 struct xt_node *xt_find_path( struct xt_node *node, const char *name );
    93 char *xt_find_attr( struct xt_node *node, const char *key );
    94 struct xt_node *xt_find_node_by_attr( struct xt_node *xt, const char *tag, const char *key, const char *value );
     73struct xt_parser *xt_new(const struct xt_handler_entry *handlers, gpointer data);
     74void xt_reset(struct xt_parser *xt);
     75int xt_feed(struct xt_parser *xt, const char *text, int text_len);
     76int xt_handle(struct xt_parser *xt, struct xt_node *node, int depth);
     77void xt_cleanup(struct xt_parser *xt, struct xt_node *node, int depth);
     78struct xt_node *xt_from_string(const char *in, int text_len);
     79char *xt_to_string(struct xt_node *node);
     80char *xt_to_string_i(struct xt_node *node);
     81void xt_print(struct xt_node *node);
     82struct xt_node *xt_dup(struct xt_node *node);
     83void xt_free_node(struct xt_node *node);
     84void xt_free(struct xt_parser *xt);
     85struct xt_node *xt_find_node(struct xt_node *node, const char *name);
     86struct xt_node *xt_find_path(struct xt_node *node, const char *name);
     87char *xt_find_attr(struct xt_node *node, const char *key);
     88struct xt_node *xt_find_node_by_attr(struct xt_node *xt, const char *tag, const char *key, const char *value);
    9589
    96 struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children );
    97 void xt_add_child( struct xt_node *parent, struct xt_node *child );
    98 void xt_insert_child( struct xt_node *parent, struct xt_node *child );
    99 void xt_add_attr( struct xt_node *node, const char *key, const char *value );
    100 int xt_remove_attr( struct xt_node *node, const char *key );
     90struct xt_node *xt_new_node(char *name, const char *text, struct xt_node *children);
     91void xt_add_child(struct xt_node *parent, struct xt_node *child);
     92void xt_insert_child(struct xt_node *parent, struct xt_node *child);
     93void xt_add_attr(struct xt_node *node, const char *key, const char *value);
     94int xt_remove_attr(struct xt_node *node, const char *key);
    10195
    10296#endif
Note: See TracChangeset for help on using the changeset viewer.