Back to index

lightning-sunbird  0.9+nobinonly
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  $Id: icalarray.h,v 1.3 2002/10/09 19:50:46 acampi Exp $
00008  $Locker:  $
00009 
00010  (C) COPYRIGHT 2001, Ximian, Inc.
00011 
00012  This program is free software; you can redistribute it and/or modify
00013  it under the terms of either: 
00014 
00015     The LGPL as published by the Free Software Foundation, version
00016     2.1, available at: http://www.fsf.org/copyleft/lesser.html
00017 
00018   Or:
00019 
00020     The Mozilla Public License Version 1.0. You may obtain a copy of
00021     the License at http://www.mozilla.org/MPL/
00022 
00023 
00024 ======================================================================*/
00025 
00026 
00027 #ifndef ICALARRAY_H
00028 #define ICALARRAY_H
00029 
00036 typedef struct _icalarray icalarray;
00037 struct _icalarray {
00038     unsigned int      element_size;
00039     unsigned int      increment_size;
00040     unsigned int      num_elements;
00041     unsigned int      space_allocated;
00042     void             *data;
00043 };
00044 
00045 
00046 
00047 icalarray *icalarray_new           (int           element_size,
00048                                     int           increment_size);
00049 void      icalarray_free           (icalarray    *array);
00050 
00051 void      icalarray_append         (icalarray    *array,
00052                                     void         *element);
00053 void      icalarray_remove_element_at     (icalarray    *array,
00054                                     int           position);
00055 
00056 void     *icalarray_element_at            (icalarray    *array,
00057                                     int           position);
00058 
00059 void      icalarray_sort           (icalarray    *array,
00060                                     int          (*compare) (const void *, const void *));
00061 
00062 
00063 #endif /* ICALARRAY_H */