Revision 14852,
1.2 KB
checked in by ghudson, 24 years ago
(diff) |
Move os-checkfiles here, with some portability cleanups.
|
Line | |
---|
1 | /* $Id: array.h,v 1.1 2000-06-19 03:53:32 ghudson Exp $ */ |
---|
2 | |
---|
3 | /* Copyright 1999 by the Massachusetts Institute of Technology. |
---|
4 | * |
---|
5 | * Permission to use, copy, modify, and distribute this |
---|
6 | * software and its documentation for any purpose and without |
---|
7 | * fee is hereby granted, provided that the above copyright |
---|
8 | * notice appear in all copies and that both that copyright |
---|
9 | * notice and this permission notice appear in supporting |
---|
10 | * documentation, and that the name of M.I.T. not be used in |
---|
11 | * advertising or publicity pertaining to distribution of the |
---|
12 | * software without specific, written prior permission. |
---|
13 | * M.I.T. makes no representations about the suitability of |
---|
14 | * this software for any purpose. It is provided "as is" |
---|
15 | * without express or implied warranty. |
---|
16 | */ |
---|
17 | |
---|
18 | #define BLOCKSIZE 10 |
---|
19 | |
---|
20 | typedef struct _Array { |
---|
21 | int size; |
---|
22 | int allocated; |
---|
23 | void **elements; |
---|
24 | int (*compar)(const void *, const void *); |
---|
25 | } Array; |
---|
26 | |
---|
27 | Array *array_new(void); |
---|
28 | void array_add(Array *, const void *); |
---|
29 | void *array_read(const Array *, int); |
---|
30 | void array_sort(Array *, int (*)(const void *, const void *)); |
---|
31 | void *array_search(const Array *, const void *key); |
---|
32 | int array_size(const Array *); |
---|
33 | void array_free(Array *); |
---|
Note: See
TracBrowser
for help on using the repository browser.