Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

include/gimp-print/list.h

Go to the documentation of this file.
00001 /*
00002  * "$Id: list.h,v 1.3 2004/05/07 19:20:23 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 
00025 /*
00026  * This file must include only standard C header files.  The core code must
00027  * compile on generic platforms that don't support glib, gimp, gtk, etc.
00028  */
00029 
00030 #ifndef GIMP_PRINT_LIST_H
00031 #define GIMP_PRINT_LIST_H
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 
00038 struct stp_list_item;
00039 typedef struct stp_list_item stp_list_item_t;
00040 struct stp_list;
00041 typedef struct stp_list stp_list_t;
00042 typedef void (*stp_node_freefunc)(void *);
00043 typedef void *(*stp_node_copyfunc)(const void *);
00044 typedef const char *(*stp_node_namefunc)(const void *);
00045 typedef int (*stp_node_sortfunc)(const void *, const void *);
00046 
00047 extern void stp_list_node_free_data(void *item);
00048 extern stp_list_t *stp_list_create(void);
00049 extern stp_list_t *stp_list_copy(const stp_list_t *list);
00050 extern int stp_list_destroy(stp_list_t *list);
00051 extern stp_list_item_t *stp_list_get_start(const stp_list_t *list);
00052 extern stp_list_item_t *stp_list_get_end(const stp_list_t *list);
00053 extern stp_list_item_t *stp_list_get_item_by_index(const stp_list_t *list,
00054                                                    int idx);
00055 extern stp_list_item_t *stp_list_get_item_by_name(const stp_list_t *list,
00056                                                   const char *name);
00057 extern stp_list_item_t *stp_list_get_item_by_long_name(const stp_list_t *list,
00058                                                        const char *long_name);
00059 extern int stp_list_get_length(const stp_list_t *list);
00060 
00061 extern void stp_list_set_freefunc(stp_list_t *list, stp_node_freefunc);
00062 extern stp_node_freefunc stp_list_get_freefunc(const stp_list_t *list);
00063 
00064 extern void stp_list_set_copyfunc(stp_list_t *list, stp_node_copyfunc);
00065 extern stp_node_copyfunc stp_list_get_copyfunc(const stp_list_t *list);
00066 
00067 extern void stp_list_set_namefunc(stp_list_t *list, stp_node_namefunc);
00068 extern stp_node_namefunc stp_list_get_namefunc(const stp_list_t *list);
00069 
00070 extern void stp_list_set_long_namefunc(stp_list_t *list, stp_node_namefunc);
00071 extern stp_node_namefunc stp_list_get_long_namefunc(const stp_list_t *list);
00072 
00073 extern void stp_list_set_sortfunc(stp_list_t *list, stp_node_sortfunc);
00074 extern stp_node_sortfunc stp_list_get_sortfunc(const stp_list_t *list);
00075 
00076 extern int stp_list_item_create(stp_list_t *list,
00077                                 stp_list_item_t *next,
00078                                 const void *data);
00079 extern int stp_list_item_destroy(stp_list_t *list,
00080                                  stp_list_item_t *item);
00081 extern stp_list_item_t *stp_list_item_prev(const stp_list_item_t *item);
00082 extern stp_list_item_t *stp_list_item_next(const stp_list_item_t *item);
00083 extern void *stp_list_item_get_data(const stp_list_item_t *item);
00084 extern int stp_list_item_set_data(stp_list_item_t *item,
00085                                   void *data);
00086 
00087 #ifdef __cplusplus
00088   }
00089 #endif
00090 
00091 #endif /* GIMP_PRINT_LIST_H */

Generated on Wed May 12 20:21:27 2004 for libgimpprint API Reference by doxygen1.2.17