Commit | Line | Data |
79072805 |
1 | /* $RCSfile: str.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:27 $ |
a687059c |
2 | * |
d48672a2 |
3 | * Copyright (c) 1991, Larry Wall |
a687059c |
4 | * |
d48672a2 |
5 | * You may distribute under the terms of either the GNU General Public |
6 | * License or the Artistic License, as specified in the README file. |
8d063cd8 |
7 | * |
8 | * $Log: str.h,v $ |
8d063cd8 |
9 | */ |
10 | |
11 | struct string { |
12 | char * str_ptr; /* pointer to malloced string */ |
13 | double str_nval; /* numeric value, if any */ |
14 | int str_len; /* allocated size */ |
15 | int str_cur; /* length of str_ptr as a C string */ |
16 | union { |
17 | STR *str_next; /* while free, link to next free str */ |
18 | } str_link; |
19 | char str_pok; /* state of str_ptr */ |
20 | char str_nok; /* state of str_nval */ |
21 | }; |
22 | |
23 | #define Nullstr Null(STR*) |
24 | |
25 | /* the following macro updates any magic values this str is associated with */ |
26 | |
27 | #define STABSET(x) (x->str_link.str_magic && stabset(x->str_link.str_magic,x)) |
28 | |
29 | EXT STR **tmps_list; |
30 | EXT long tmps_max INIT(-1); |
31 | |
9c8d0b29 |
32 | double str_2num _(( STR *str )); |
33 | char * str_2ptr _(( STR *str )); |
34 | char * str_append_till _(( STR *str, char *from, int delim, char *keeplist )); |
35 | void str_cat _(( STR *str, char *ptr )); |
36 | void str_chop _(( STR *str, char *ptr )); |
37 | void str_dec _(( STR *str )); |
38 | void str_free _(( STR *str )); |
39 | char * str_gets _(( STR *str, FILE *fp )); |
40 | void str_grow _(( STR *str, int len )); |
41 | void str_inc _(( STR *str )); |
42 | int str_len _(( STR *str )); |
43 | STR * str_make _(( char *s )); |
44 | STR * str_mortal _(( STR *oldstr )); |
45 | void str_ncat _(( STR *str, char *ptr, int len )); |
46 | STR * str_new _(( int len )); |
47 | STR * str_nmake _(( double n )); |
48 | void str_nset _(( STR *str, char *ptr, int len )); |
49 | void str_numset _(( STR *str, double num )); |
50 | void str_replace _(( STR *str, STR *nstr )); |
51 | void str_scat _(( STR *dstr, STR *sstr )); |
52 | void str_set _(( STR *str, char *ptr )); |
53 | void str_sset _(( STR *dstr, STR *sstr )); |