This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
a "replacement" for awk and sed
[perl5.git] / stab.h
CommitLineData
8d063cd8
LW
1/* $Header: stab.h,v 1.0 87/12/18 13:06:18 root Exp $
2 *
3 * $Log: stab.h,v $
4 * Revision 1.0 87/12/18 13:06:18 root
5 * Initial revision
6 *
7 */
8
9struct stab {
10 struct stab *stab_next;
11 char *stab_name;
12 STR *stab_val;
13 struct stio *stab_io;
14 FCMD *stab_form;
15 ARRAY *stab_array;
16 HASH *stab_hash;
17 CMD *stab_sub;
18 char stab_flags;
19};
20
21#define SF_VMAGIC 1 /* call routine to dereference STR val */
22
23struct stio {
24 FILE *fp;
25 long lines;
26 long page;
27 long page_len;
28 long lines_left;
29 char *top_name;
30 STAB *top_stab;
31 char *fmt_name;
32 STAB *fmt_stab;
33 char type;
34 char flags;
35};
36
37#define IOF_ARGV 1 /* this fp iterates over ARGV */
38#define IOF_START 2 /* check for null ARGV and substitute '-' */
39#define IOF_FLUSH 4 /* this fp wants a flush after write op */
40
41#define Nullstab Null(STAB*)
42
43#define STAB_STR(s) (tmpstab = (s), tmpstab->stab_flags & SF_VMAGIC ? stab_str(tmpstab) : tmpstab->stab_val)
44#define STAB_GET(s) (tmpstab = (s), str_get(tmpstab->stab_flags & SF_VMAGIC ? stab_str(tmpstab) : tmpstab->stab_val))
45#define STAB_GNUM(s) (tmpstab = (s), str_gnum(tmpstab->stab_flags & SF_VMAGIC ? stab_str(tmpstab) : tmpstab->stab_val))
46
47EXT STAB *tmpstab;
48
49EXT STAB *stab_index[128];
50
51EXT char *envname; /* place for ENV name being assigned--gross cheat */
52EXT char *signame; /* place for SIG name being assigned--gross cheat */
53
54EXT int statusvalue;
55EXT int subsvalue;
56
57STAB *aadd();
58STAB *hadd();