| 1 |
|
| 2 |
#include <stdlib.h> |
| 3 |
|
| 4 |
typedef struct { |
| 5 |
int k; |
| 6 |
int v; |
| 7 |
} CDictEntry; |
| 8 |
|
| 9 |
typedef struct { |
| 10 |
int n; |
| 11 |
CDictEntry *dict; |
| 12 |
} CDict; |
| 13 |
|
| 14 |
typedef struct { |
| 15 |
int k; |
| 16 |
CDict *v; |
| 17 |
} CGraphEntry; |
| 18 |
|
| 19 |
typedef struct { |
| 20 |
int n; |
| 21 |
CGraphEntry *dict; |
| 22 |
} CGraph; |
| 23 |
|
| 24 |
extern CDict *cdict_alloc(int n); |
| 25 |
extern int cdict_free(CDict *d); |
| 26 |
extern int cdict_qsort_cmp(const void *void_a,const void *void_b); |
| 27 |
extern CDictEntry *cdict_getitem(CDict *d,int k); |
| 28 |
extern CGraph *cgraph_alloc(int n); |
| 29 |
extern int cgraph_free(CGraph *d); |
| 30 |
extern CGraphEntry *cgraph_getitem(CGraph *d,int k); |
| 31 |
extern int *calloc_int(int n); |
| 32 |
|
| 33 |
|