xattribute.h

Go to the documentation of this file.
00001 
00032 #ifndef XATTRIBUTE_H_ALEIX0211250054
00033 #define XATTRIBUTE_H_ALEIX0211250054
00034 
00035 #include "attribute.h"
00036 
00037 #include <expat.h>
00038 
00039 
00040 struct _scew_attribute
00041 {
00042     XML_Char* name;
00043     XML_Char* value;
00044 };
00045 
00046 /* Doubly linked list node */
00047 typedef struct _attr_node
00048 {
00049     scew_attribute* info;
00050     struct _attr_node* prev;
00051     struct _attr_node* next;
00052 } attribute_node;
00053 
00054 /* Doubly linked list */
00055 typedef struct
00056 {
00057     unsigned int size;
00058     attribute_node* first;
00059     attribute_node* last;
00060 } attribute_list;
00061 
00062 
00063 /* Creates a duplicated attribute from the given one. */
00064 scew_attribute*
00065 attribute_create(XML_Char const* name, XML_Char const* value);
00066 
00067 /* Frees an attribute structure. */
00068 void
00069 attribute_free(scew_attribute* attribute);
00070 
00071 /* Frees an attribute node structure. */
00072 void
00073 attribute_node_free(attribute_node* node);
00074 
00075 /* Creates a new attribute list. */
00076 attribute_list*
00077 attribute_list_create();
00078 
00079 /* Frees an attribute list. */
00080 void
00081 attribute_list_free(attribute_list* list);
00082 
00083 /* Adds a new element to the attribute list. */
00084 scew_attribute*
00085 attribute_list_add(attribute_list* list, scew_attribute* attribute);
00086 
00087 /* Deletes an attribute from an attribute list. */
00088 void
00089 attribute_list_del(attribute_list* list, XML_Char const* name);
00090 
00091 /* Return the list node in position idx. */
00092 attribute_node*
00093 attribute_node_by_index(attribute_list* list, unsigned int idx);
00094 
00095 /* Return the list node that matches name. */
00096 attribute_node*
00097 attribute_node_by_name(attribute_list* list, XML_Char const* name);
00098 
00099 /* Return the attribute in position idx. */
00100 scew_attribute*
00101 attribute_by_index(attribute_list* list, unsigned int idx);
00102 
00103 /* Return the attribute that matches name. */
00104 scew_attribute*
00105 attribute_by_name(attribute_list* list, XML_Char const* name);
00106 
00107 #endif /* XATTRIBUTE_H_ALEIX0211250054 */

Generated on Mon Jun 5 10:20:43 2006 for Intelligence.kdevelop by  doxygen 1.4.6