This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert commit cbdd5331.
[perl5.git] / x2p / str.h
CommitLineData
8665f9e4 1/* str.h
a687059c 2 *
8665f9e4 3 * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2005
4bb101f2 4 * by Larry Wall and others
a687059c 5 *
d48672a2
LW
6 * You may distribute under the terms of either the GNU General Public
7 * License or the Artistic License, as specified in the README file.
8d063cd8
LW
8 */
9
10struct string {
11 char * str_ptr; /* pointer to malloced string */
12 double str_nval; /* numeric value, if any */
13 int str_len; /* allocated size */
14 int str_cur; /* length of str_ptr as a C string */
15 union {
16 STR *str_next; /* while free, link to next free str */
17 } str_link;
18 char str_pok; /* state of str_ptr */
19 char str_nok; /* state of str_nval */
20};
21
8d063cd8
LW
22/* the following macro updates any magic values this str is associated with */
23
24#define STABSET(x) (x->str_link.str_magic && stabset(x->str_link.str_magic,x))
25
26EXT STR **tmps_list;
27EXT long tmps_max INIT(-1);
28
20ce7b12 29char * str_2ptr ( STR *str );
aab39148 30void str_cat ( STR *str, const char *ptr );
20ce7b12
GS
31void str_free ( STR *str );
32char * str_gets ( STR *str, FILE *fp );
20ce7b12 33int str_len ( STR *str );
aab39148
RB
34STR * str_make ( const char *s );
35void str_ncat ( STR *str, const char *ptr, int len );
20ce7b12 36STR * str_new ( int len );
aab39148 37void str_nset ( STR *str, const char *ptr, int len );
20ce7b12 38void str_numset ( STR *str, double num );
20ce7b12 39void str_scat ( STR *dstr, STR *sstr );
aab39148 40void str_set ( STR *str, const char *ptr );
20ce7b12 41void str_sset ( STR *dstr, STR *sstr );