Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

list.h

Go to the documentation of this file.
00001 /*
00002  * "$Id: list.h,v 1.2 2004/11/28 15:59:29 rleigh Exp $"
00003  *
00004  *   libgimpprint generic list type
00005  *
00006  *   Copyright 1997-2000 Michael Sweet (mike@easysw.com),
00007  *      Robert Krawitz (rlk@alum.mit.edu) and Michael Natterer (mitch@gimp.org)
00008  *   Copyright 2002 Roger Leigh (rleigh@debian.org)
00009  *
00010  *   This program is free software; you can redistribute it and/or modify it
00011  *   under the terms of the GNU General Public License as published by the Free
00012  *   Software Foundation; either version 2 of the License, or (at your option)
00013  *   any later version.
00014  *
00015  *   This program is distributed in the hope that it will be useful, but
00016  *   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00017  *   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00018  *   for more details.
00019  *
00020  *   You should have received a copy of the GNU General Public License
00021  *   along with this program; if not, write to the Free Software
00022  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00023  */
00024 
00030 /*
00031  * This file must include only standard C header files.  The core code must
00032  * compile on generic platforms that don't support glib, gimp, gtk, etc.
00033  */
00034 
00035 #ifndef GUTENPRINT_LIST_H
00036 #define GUTENPRINT_LIST_H
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00054   struct stp_list_item;
00059   typedef struct stp_list_item stp_list_item_t;
00060 
00061   struct stp_list;
00066   typedef struct stp_list stp_list_t;
00067 
00072   typedef void (*stp_node_freefunc)(void *);
00073 
00079   typedef void *(*stp_node_copyfunc)(const void *);
00080 
00087   typedef const char *(*stp_node_namefunc)(const void *);
00088 
00096   typedef int (*stp_node_sortfunc)(const void *, const void *);
00097 
00104   extern void stp_list_node_free_data(void *item);
00105 
00110   extern stp_list_t *stp_list_create(void);
00111 
00119   extern stp_list_t *stp_list_copy(const stp_list_t *list);
00120 
00127   extern int stp_list_destroy(stp_list_t *list);
00128 
00135   extern stp_list_item_t *stp_list_get_start(const stp_list_t *list);
00136 
00143   extern stp_list_item_t *stp_list_get_end(const stp_list_t *list);
00144 
00152   extern stp_list_item_t *stp_list_get_item_by_index(const stp_list_t *list,
00153                                                      int idx);
00154 
00162   extern stp_list_item_t *stp_list_get_item_by_name(const stp_list_t *list,
00163                                                     const char *name);
00164 
00172   extern stp_list_item_t *stp_list_get_item_by_long_name(const stp_list_t *list,
00173                                                          const char *long_name);
00174 
00180   extern int stp_list_get_length(const stp_list_t *list);
00181 
00190   extern void stp_list_set_freefunc(stp_list_t *list,
00191                                     stp_node_freefunc freefunc);
00192 
00199   extern stp_node_freefunc stp_list_get_freefunc(const stp_list_t *list);
00200 
00209   extern void stp_list_set_copyfunc(stp_list_t *list,
00210                                     stp_node_copyfunc copyfunc);
00211 
00218   extern stp_node_copyfunc stp_list_get_copyfunc(const stp_list_t *list);
00219 
00228   extern void stp_list_set_namefunc(stp_list_t *list,
00229                                     stp_node_namefunc namefunc);
00230 
00237   extern stp_node_namefunc stp_list_get_namefunc(const stp_list_t *list);
00238 
00247   extern void stp_list_set_long_namefunc(stp_list_t *list,
00248                                          stp_node_namefunc long_namefunc);
00249 
00256   extern stp_node_namefunc stp_list_get_long_namefunc(const stp_list_t *list);
00257 
00265   extern void stp_list_set_sortfunc(stp_list_t *list,
00266                                     stp_node_sortfunc sortfunc);
00267 
00274   extern stp_node_sortfunc stp_list_get_sortfunc(const stp_list_t *list);
00275 
00284   extern int stp_list_item_create(stp_list_t *list,
00285                                   stp_list_item_t *next,
00286                                   const void *data);
00287 
00294   extern int stp_list_item_destroy(stp_list_t *list,
00295                                    stp_list_item_t *item);
00296 
00303   extern stp_list_item_t *stp_list_item_prev(const stp_list_item_t *item);
00304 
00311   extern stp_list_item_t *stp_list_item_next(const stp_list_item_t *item);
00312 
00318   extern void *stp_list_item_get_data(const stp_list_item_t *item);
00319 
00328   extern int stp_list_item_set_data(stp_list_item_t *item,
00329                                     void *data);
00330 
00333 #ifdef __cplusplus
00334   }
00335 #endif
00336 
00337 #endif /* GUTENPRINT_LIST_H */

Generated on Thu Feb 10 19:29:29 2005 for libgutenprint API Reference by  doxygen 1.4.1