Changeset 40ef702 for protocols/jabber
- Timestamp:
- 2007-07-01T13:08:47Z (17 years ago)
- Branches:
- master
- Children:
- 2758cfe
- Parents:
- 7bf4326
- Location:
- protocols/jabber
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
r7bf4326 r40ef702 99 99 else if( strcmp( s, XMLNS_DISCOVER ) == 0 ) 100 100 { 101 const char *features[] = { XMLNS_VERSION, 102 XMLNS_TIME, 103 XMLNS_CHATSTATES, 104 XMLNS_MUC, 105 NULL }; 106 const char **f; 107 101 108 c = xt_new_node( "identity", NULL, NULL ); 102 109 xt_add_attr( c, "category", "client" ); … … 105 112 xt_add_child( reply, c ); 106 113 107 c = xt_new_node( "feature", NULL, NULL ); 108 xt_add_attr( c, "var", XMLNS_VERSION ); 109 xt_add_child( reply, c ); 110 111 c = xt_new_node( "feature", NULL, NULL ); 112 xt_add_attr( c, "var", XMLNS_TIME ); 113 xt_add_child( reply, c ); 114 115 c = xt_new_node( "feature", NULL, NULL ); 116 xt_add_attr( c, "var", XMLNS_CHATSTATES ); 117 xt_add_child( reply, c ); 118 119 /* Later this can be useful to announce things like 120 MUC support. */ 114 for( f = features; *f; f ++ ) 115 { 116 c = xt_new_node( "feature", NULL, NULL ); 117 xt_add_attr( c, "var", *f ); 118 xt_add_child( reply, c ); 119 } 121 120 } 122 121 else -
protocols/jabber/xmltree.c
r7bf4326 r40ef702 442 442 list, not the node itself! The reason you have to do this by hand: So 443 443 that you can also use this function as a find-next. */ 444 struct xt_node *xt_find_node( struct xt_node *node, c har *name )444 struct xt_node *xt_find_node( struct xt_node *node, const char *name ) 445 445 { 446 446 while( node ) … … 455 455 } 456 456 457 char *xt_find_attr( struct xt_node *node, c har *key )457 char *xt_find_attr( struct xt_node *node, const char *key ) 458 458 { 459 459 int i; … … 524 524 } 525 525 526 void xt_add_attr( struct xt_node *node, c har *key,char *value )526 void xt_add_attr( struct xt_node *node, const char *key, const char *value ) 527 527 { 528 528 int i; … … 551 551 } 552 552 553 int xt_remove_attr( struct xt_node *node, c har *key )553 int xt_remove_attr( struct xt_node *node, const char *key ) 554 554 { 555 555 int i, last; -
protocols/jabber/xmltree.h
r7bf4326 r40ef702 87 87 void xt_free_node( struct xt_node *node ); 88 88 void xt_free( struct xt_parser *xt ); 89 struct xt_node *xt_find_node( struct xt_node *node, c har *name );90 char *xt_find_attr( struct xt_node *node, c har *key );89 struct xt_node *xt_find_node( struct xt_node *node, const char *name ); 90 char *xt_find_attr( struct xt_node *node, const char *key ); 91 91 92 92 struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children ); 93 93 void xt_add_child( struct xt_node *parent, struct xt_node *child ); 94 void xt_add_attr( struct xt_node *node, c har *key,char *value );95 int xt_remove_attr( struct xt_node *node, c har *key );94 void xt_add_attr( struct xt_node *node, const char *key, const char *value ); 95 int xt_remove_attr( struct xt_node *node, const char *key ); 96 96 97 97 #endif
Note: See TracChangeset
for help on using the changeset viewer.