loudmouth/inc/loudmouth/lm-message-node.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
       
     2 /*
       
     3  * Copyright (C) 2003 Imendio AB
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or
       
     6  * modify it under the terms of the GNU Lesser General Public License as
       
     7  * published by the Free Software Foundation; either version 2 of the
       
     8  * License, or (at your option) any later version.
       
     9  *
       
    10  * This program is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13  * Lesser General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU Lesser General Public
       
    16  * License along with this program; if not, write to the
       
    17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
       
    18  * Boston, MA 02111-1307, USA.
       
    19  */
       
    20 
       
    21 #ifndef __LM_MESSAGE_NODE_H__
       
    22 #define __LM_MESSAGE_NODE_H__
       
    23 
       
    24 #if !defined (LM_INSIDE_LOUDMOUTH_H) && !defined (LM_COMPILATION)
       
    25 #error "Only <loudmouth/loudmouth.h> can be included directly, this file may disappear or change contents."
       
    26 #endif
       
    27 
       
    28 #include <glib.h>
       
    29 
       
    30 G_BEGIN_DECLS
       
    31 
       
    32 typedef struct _LmMessageNode LmMessageNode;
       
    33 
       
    34 struct _LmMessageNode {
       
    35 	gchar      *name;
       
    36 	gchar      *value;
       
    37 	gboolean    raw_mode;
       
    38 
       
    39         LmMessageNode     *next;
       
    40         LmMessageNode     *prev;
       
    41 	LmMessageNode     *parent;
       
    42         LmMessageNode     *children;
       
    43 
       
    44 	/* < private > */
       
    45 	GSList     *attributes;
       
    46 	gint        ref_count;
       
    47 };
       
    48 
       
    49 IMPORT_C const gchar *  lm_message_node_get_value      (LmMessageNode *node);
       
    50 IMPORT_C void           lm_message_node_set_value      (LmMessageNode *node,
       
    51 					       const gchar   *value);
       
    52 IMPORT_C LmMessageNode *lm_message_node_add_child      (LmMessageNode *node,
       
    53 					       const gchar   *name,
       
    54 					       const gchar   *value);
       
    55 IMPORT_C void           lm_message_node_set_attributes (LmMessageNode *node,
       
    56 					       const gchar   *name,
       
    57 					       ...);
       
    58 IMPORT_C void           lm_message_node_set_attribute  (LmMessageNode *node,
       
    59 					       const gchar   *name,
       
    60 					       const gchar   *value);
       
    61 IMPORT_C const gchar *  lm_message_node_get_attribute  (LmMessageNode *node,
       
    62 					       const gchar   *name);
       
    63 IMPORT_C LmMessageNode *lm_message_node_get_child      (LmMessageNode *node,
       
    64 					       const gchar   *child_name);
       
    65 IMPORT_C LmMessageNode *lm_message_node_find_child     (LmMessageNode *node,
       
    66 					       const gchar   *child_name);
       
    67 IMPORT_C gboolean       lm_message_node_get_raw_mode   (LmMessageNode *node);
       
    68 IMPORT_C void           lm_message_node_set_raw_mode   (LmMessageNode *node,
       
    69 					       gboolean       raw_mode);
       
    70 IMPORT_C LmMessageNode *lm_message_node_ref            (LmMessageNode *node);
       
    71 IMPORT_C void           lm_message_node_unref          (LmMessageNode *node);
       
    72 IMPORT_C gchar *        lm_message_node_to_string      (LmMessageNode *node);
       
    73 
       
    74 G_END_DECLS
       
    75 
       
    76 #endif /* __LM_MESSAGE_NODE_H__ */