libkcal

icalarray.h

Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /*======================================================================
00003  FILE: icalarray.h
00004  CREATOR: Damon Chaplin 07 March 2001
00005 
00006 
00007 
00008  (C) COPYRIGHT 2001, Ximian, Inc.
00009 
00010  This program is free software; you can redistribute it and/or modify
00011  it under the terms of either: 
00012 
00013     The LGPL as published by the Free Software Foundation, version
00014     2.1, available at: http://www.fsf.org/copyleft/lesser.html
00015 
00016   Or:
00017 
00018     The Mozilla Public License Version 1.0. You may obtain a copy of
00019     the License at http://www.mozilla.org/MPL/
00020 
00021 
00022 ======================================================================*/
00023 
00024 
00025 #ifndef ICALARRAY_H
00026 #define ICALARRAY_H
00027 
00034 typedef struct _icalarray icalarray;
00035 struct _icalarray {
00036     unsigned int     element_size;
00037     unsigned int     increment_size;
00038     unsigned int     num_elements;
00039     unsigned int     space_allocated;
00040     void        *data;
00041 };
00042 
00043 
00044 
00045 icalarray *icalarray_new        (int         element_size,
00046                      int         increment_size);
00047 void       icalarray_free       (icalarray  *array);
00048 
00049 void       icalarray_append     (icalarray  *array,
00050                      const void     *element);
00051 void       icalarray_remove_element_at  (icalarray  *array,
00052                      int         position);
00053 
00054 void      *icalarray_element_at     (icalarray  *array,
00055                      int         position);
00056 
00057 void       icalarray_sort       (icalarray  *array,
00058                      int           (*compare) (const void *, const void *));
00059 
00060 
00061 #endif /* ICALARRAY_H */