1 /*
2 array.h
3 copyright 1991-96, Michael D. Brennan
4 
5 This is a source file for mawk, an implementation of
6 the AWK programming language.
7 
8 Mawk is distributed without warranty under the terms of
9 the GNU General Public License, version 2, 1991.
10 */
11 
12 /*
13 This file was generated with the command
14 
15    notangle -R'"array.h"' array.w > array.h
16 
17 Notangle is part of Norman Ramsey's noweb literate programming package
18 available from CTAN(ftp.shsu.edu).
19 
20 It's easiest to read or modify this file by working with array.w.
21 */
22 
23 #ifndef ARRAY_H
24 #define ARRAY_H 1
25 typedef struct array {
26    PTR ptr ;  /* What this points to depends on the type */
27    unsigned size ; /* number of elts in the table */
28    unsigned limit ; /* Meaning depends on type */
29    unsigned hmask ; /* bitwise and with hash value to get table index */
30    short type ;  /* values in AY_NULL .. AY_SPLIT */
31 } *ARRAY ;
32 
33 #define AY_NULL         0
34 #define AY_INT          1
35 #define AY_STR          2
36 #define AY_SPLIT        4
37 
38 #define NO_CREATE  0
39 #define CREATE     1
40 
41 #define new_ARRAY()  ((ARRAY)memset(ZMALLOC(struct array),0,sizeof(struct array)))
42 
43 CELL* PROTO(array_find, (ARRAY,CELL*,int)) ;
44 void  PROTO(array_delete, (ARRAY,CELL*)) ;
45 void  PROTO(array_load, (ARRAY,int)) ;
46 void  PROTO(array_clear, (ARRAY)) ;
47 STRING** PROTO(array_loop_vector, (ARRAY,unsigned*)) ;
48 CELL* PROTO(array_cat, (CELL*,int)) ;
49 
50 #endif /* ARRAY_H */
51 
52