libgeda

geda_list.h

Go to the documentation of this file.
00001 /* gEDA - GPL Electronic Design Automation
00002  * libgeda - gEDA's library
00003  * Copyright (C) 1998-2010 Ales Hvezda
00004  * Copyright (C) 2007-2010 Peter Clifton
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00019  * MA 02111-1301 USA.
00020  */
00021 
00022 
00023 #ifndef __GEDA_LIST_H__
00024 #define __GEDA_LIST_H__
00025 
00026 G_BEGIN_DECLS
00027 
00028 #define GEDA_TYPE_LIST            (geda_list_get_type())
00029 #define GEDA_LIST(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDA_TYPE_LIST, GedaList))
00030 #define GEDA_LIST_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  GEDA_TYPE_LIST, GedaListClass))
00031 #define GEDA_IS_LIST(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDA_TYPE_LIST))
00032 #define GEDA_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  GEDA_TYPE_LIST))
00033 #define GEDA_LIST_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  GEDA_TYPE_LIST, GedaListClass))
00034 
00035 
00036 typedef struct _GedaList      GedaList;
00037 typedef struct _GedaListClass GedaListClass;
00038 
00039 struct _GedaList {
00040   GObject parent;
00041   GList *glist;
00042 };
00043 
00044 struct _GedaListClass {
00045   GObjectClass parent;
00046 };
00047 
00048 GType geda_list_get_type (void);
00049 
00050 /* It would be nice to add const qualifiers to some of these, but GLib
00051  * is buggy in this respect, and doesn't have const where necessary. */
00052 GedaList *geda_list_new( void );
00053 void geda_list_add( GedaList *list, gpointer item );
00054 void geda_list_add_glist( GedaList *list, GList *items );
00055 void geda_list_remove( GedaList *list, gpointer item );
00056 /*void geda_list_remove_glist( GedaList *list, GList *items ); */ /* Undemanded as yet */
00057 void geda_list_remove_all( GedaList *list );
00058 
00059 /*const GList *geda_list_get_glist( GedaList *list ); */
00060 #define geda_list_get_glist(list) (list->glist)
00061 
00062 G_END_DECLS
00063 
00064 #endif /* __GEDA_LIST_H__ */
00065 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines