1 |
greg |
2.2 |
/* RCSid $Id$ */ |
2 |
greg |
2.1 |
#ifndef __G3FLIST_H |
3 |
|
|
#define __G3FLIST_H |
4 |
|
|
|
5 |
|
|
#ifdef __cplusplus |
6 |
|
|
extern "C" { |
7 |
|
|
#endif |
8 |
|
|
|
9 |
|
|
#include <stdio.h> |
10 |
|
|
|
11 |
|
|
#include "g3vector.h" |
12 |
|
|
|
13 |
|
|
|
14 |
|
|
#define G3FL_STARTCAP 50 |
15 |
|
|
#define G3FL_ID(fl,id) (fl->comp_size*id) |
16 |
|
|
#define G3FL_GETID(fl,e) ((e-fl->list)/fl->comp_size) |
17 |
|
|
|
18 |
|
|
typedef struct g3FList { |
19 |
|
|
int size; |
20 |
|
|
int cap; |
21 |
|
|
int comp_size; |
22 |
|
|
int ipos; |
23 |
|
|
g3Float* list; |
24 |
|
|
} g3FList; |
25 |
|
|
|
26 |
|
|
#define g3fl_get_size(fl) (fl->size) |
27 |
|
|
#define g3fl_get_comp_size(fl) (fl->comp_size) |
28 |
|
|
|
29 |
|
|
int g3fl_init(g3FList* fl,int cs); |
30 |
|
|
g3FList* g3fl_create(int cs); |
31 |
|
|
void g3fl_free(g3FList* fl); |
32 |
|
|
|
33 |
|
|
int g3fl_copy(g3FList* dst,g3FList* src); |
34 |
|
|
|
35 |
|
|
void g3fl_clear(g3FList* fl); |
36 |
|
|
|
37 |
|
|
int g3fl_read(g3FList* fl,FILE* fp); |
38 |
|
|
g3Float* g3fl_append_new(g3FList* fl); |
39 |
|
|
int g3fl_append(g3FList* fl,g3Float* el); |
40 |
|
|
g3Float* g3fl_get(g3FList* fl,int id); |
41 |
|
|
g3Float* g3fl_get_copy(g3FList* fl,int id); |
42 |
|
|
int g3fl_remove(g3FList* fl,int id); |
43 |
|
|
int g3fl_remove_last(g3FList* fl); |
44 |
|
|
|
45 |
|
|
g3Float* g3fl_begin(g3FList* fl); |
46 |
|
|
g3Float* g3fl_next(g3FList* fl); |
47 |
|
|
void g3fl_rewind(g3FList* fl); |
48 |
|
|
|
49 |
|
|
int g3fl_sort(g3FList* fl,int cnum); |
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
#ifdef __cplusplus |
55 |
|
|
} |
56 |
|
|
#endif |
57 |
|
|
|
58 |
|
|
#endif |