source: trunk/essentials/dev-lang/perl/x2p/str.h

Last change on this file was 3181, checked in by bird, 18 years ago

perl 5.8.8

File size: 1.3 KB
Line 
1/* str.h
2 *
3 * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2005
4 * by Larry Wall and others
5 *
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.
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
22#define Nullstr Null(STR*)
23
24/* the following macro updates any magic values this str is associated with */
25
26#define STABSET(x) (x->str_link.str_magic && stabset(x->str_link.str_magic,x))
27
28EXT STR **tmps_list;
29EXT long tmps_max INIT(-1);
30
31char * str_2ptr ( STR *str );
32void str_cat ( STR *str, char *ptr );
33void str_free ( STR *str );
34char * str_gets ( STR *str, FILE *fp );
35int str_len ( STR *str );
36STR * str_make ( char *s );
37void str_ncat ( STR *str, char *ptr, int len );
38STR * str_new ( int len );
39void str_nset ( STR *str, char *ptr, int len );
40void str_numset ( STR *str, double num );
41void str_scat ( STR *dstr, STR *sstr );
42void str_set ( STR *str, char *ptr );
43void str_sset ( STR *dstr, STR *sstr );
Note: See TracBrowser for help on using the repository browser.