branches/gmyth-0.1b/src/gmyth_stringlist.h
author renatofilho
Thu Feb 01 18:42:01 2007 +0000 (2007-02-01)
branchtrunk
changeset 320 22a17127789e
permissions -rw-r--r--
[svn r322] created branch gmyth-0.1b
renatofilho@320
     1
/**
renatofilho@320
     2
 * GMyth Library
renatofilho@320
     3
 *
renatofilho@320
     4
 * @file gmyth/gmyth_stringlist.h
renatofilho@320
     5
 * 
renatofilho@320
     6
 * @brief <p> This component contains functions for dealing with the stringlist
renatofilho@320
     7
 * format of the mythprotocol.
renatofilho@320
     8
 * 
renatofilho@320
     9
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
renatofilho@320
    10
 * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
renatofilho@320
    11
 *
renatofilho@320
    12
 *//*
renatofilho@320
    13
 * 
renatofilho@320
    14
 * This program is free software; you can redistribute it and/or modify
renatofilho@320
    15
 * it under the terms of the GNU Lesser General Public License as published by
renatofilho@320
    16
 * the Free Software Foundation; either version 2 of the License, or
renatofilho@320
    17
 * (at your option) any later version.
renatofilho@320
    18
 *
renatofilho@320
    19
 * This program is distributed in the hope that it will be useful,
renatofilho@320
    20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
renatofilho@320
    21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
renatofilho@320
    22
 * GNU General Public License for more details.
renatofilho@320
    23
 *
renatofilho@320
    24
 * You should have received a copy of the GNU Lesser General Public License
renatofilho@320
    25
 * along with this program; if not, write to the Free Software
renatofilho@320
    26
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
renatofilho@320
    27
 */
renatofilho@320
    28
renatofilho@320
    29
#ifndef GMYTH_STRING_LIST_H_
renatofilho@320
    30
#define GMYTH_STRING_LIST_H_
renatofilho@320
    31
renatofilho@320
    32
#include <glib-object.h>
renatofilho@320
    33
renatofilho@320
    34
#include <stdio.h>
renatofilho@320
    35
#include <stdlib.h>
renatofilho@320
    36
#include <string.h>
renatofilho@320
    37
#include <netdb.h>
renatofilho@320
    38
#include <sys/socket.h>
renatofilho@320
    39
#include <unistd.h>
renatofilho@320
    40
renatofilho@320
    41
G_BEGIN_DECLS
renatofilho@320
    42
renatofilho@320
    43
#define GMYTH_STRING_LIST_TYPE               (gmyth_string_list_get_type ())
renatofilho@320
    44
#define GMYTH_STRING_LIST(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_STRING_LIST_TYPE, GMythStringList))
renatofilho@320
    45
#define GMYTH_STRING_LIST_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_STRING_LIST_TYPE, GMythStringListClass))
renatofilho@320
    46
#define IS_GMYTH_STRING_LIST(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_STRING_LIST_TYPE))
renatofilho@320
    47
#define IS_GMYTH_STRING_LIST_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_STRING_LIST_TYPE))
renatofilho@320
    48
#define GMYTH_STRING_LIST_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_STRING_LIST_TYPE, GMythStringListClass))
renatofilho@320
    49
renatofilho@320
    50
renatofilho@320
    51
typedef struct _GMythStringList         GMythStringList;
renatofilho@320
    52
typedef struct _GMythStringListClass    GMythStringListClass;
renatofilho@320
    53
renatofilho@320
    54
struct _GMythStringListClass
renatofilho@320
    55
{
renatofilho@320
    56
  GObjectClass parent_class;
renatofilho@320
    57
renatofilho@320
    58
  /* callbacks */
renatofilho@320
    59
  /* no one for now */
renatofilho@320
    60
};
renatofilho@320
    61
renatofilho@320
    62
struct _GMythStringList
renatofilho@320
    63
{
renatofilho@320
    64
    GObject parent;
renatofilho@320
    65
renatofilho@320
    66
    /* string list */
renatofilho@320
    67
    GList *glist;  
renatofilho@320
    68
};
renatofilho@320
    69
renatofilho@320
    70
renatofilho@320
    71
GType               gmyth_string_list_get_type (void);
renatofilho@320
    72
renatofilho@320
    73
GMythStringList *   gmyth_string_list_new (void);
renatofilho@320
    74
renatofilho@320
    75
void                gmyth_string_list_clear_all (GMythStringList *strlist);
renatofilho@320
    76
int                 gmyth_string_list_length (GMythStringList *strlist);
renatofilho@320
    77
renatofilho@320
    78
GString *           gmyth_string_list_append_int (GMythStringList *strlist, 
renatofilho@320
    79
                                                  const gint value);
renatofilho@320
    80
GString *           gmyth_string_list_append_uint64 (GMythStringList *strlist, 
renatofilho@320
    81
                                                     const guint64 value);
renatofilho@320
    82
renatofilho@320
    83
GString *           gmyth_string_list_append_int64 (GMythStringList *strlist, 
renatofilho@320
    84
                                                     const gint64 value);
renatofilho@320
    85
renatofilho@320
    86
GString *           gmyth_string_list_append_char_array (GMythStringList *strlist, 
renatofilho@320
    87
                                                         const char* value);
renatofilho@320
    88
GString *           gmyth_string_list_append_string (GMythStringList *strlist, 
renatofilho@320
    89
                                                     GString *value);
renatofilho@320
    90
renatofilho@320
    91
int                 gmyth_string_list_get_int (GMythStringList *strlist, const gint index);
renatofilho@320
    92
guint64             gmyth_string_list_get_uint64 (GMythStringList *strlist, const gint index);
renatofilho@320
    93
gint64             gmyth_string_list_get_int64 (GMythStringList *strlist, const gint index);
renatofilho@320
    94
GString *           gmyth_string_list_get_string (GMythStringList *strlist, const gint index);
renatofilho@320
    95
renatofilho@320
    96
#define gmyth_string_list_get_char_array(strlist, index) \
renatofilho@320
    97
            (gmyth_string_list_get_string(strlist, index))->str
renatofilho@320
    98
renatofilho@320
    99
G_END_DECLS
renatofilho@320
   100
renatofilho@320
   101
#endif /*GMYTH_STRING_LIST_H_*/