1 /* $Id$
2  *  Provides funstions to operate dinamically allocated strings.
3 
4  * Copyright (C) 1997-2000
5  *
6  * Kolya Nesterov
7  *
8  * Fido:     2:463/567
9  * Kiev, Ukraine
10  *
11  *  Latest version may be foind on http://husky.sourceforge.net
12  *
13  *
14  * HUSKYLIB: common defines, types and functions for HUSKY
15  *
16  * This is part of The HUSKY Fidonet Software project:
17  * see http://husky.sourceforge.net for details
18  *
19  *
20  * HUSKYLIB is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2 of the License, or (at your option) any later version.
24  *
25  * HUSKYLIB is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
28  * General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; see file COPYING. If not, write to the
32  * Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33  *
34  * See also http://www.gnu.org, license may be found here.
35  */
36 
37 #ifndef HUSKY_XSTR_H
38 #define HUSKY_XSTR_H
39 
40 /* huskylib: compiler.h */
41 #include "compiler.h"
42 
43 /* huskylib headers */
44 #include "huskyext.h"
45 
46 /***  Declarations & defines  ***********************************************/
47 
48 HUSKYEXT char *xstralloc(char **s, size_t add);
49 /*
50  * Adds to variable "s" "add" bytes (allocates or reallocates it)
51  */
52 
53 HUSKYEXT char *xstrcat(char **s, const char *add);
54 /*
55  * Appends "add" to variable "s", reallocating it when it needs
56  */
57 
58 #define NULLP ((void*)0)
59 HUSKYEXT char *xstrscat(char **s, ...);
60 /*
61  * Appends a list of strings to "s", reallocating it when it needs
62  * list is terminated with NULLP value
63  */
64 
65 HUSKYEXT char *xstrcpy(char **s, const char *add);
66 /*
67  * Copys "add" to variable "s", reallocating it when it needs
68  */
69 
70 HUSKYEXT int xscatprintf(char **s, const char *format, ...);
71 /*
72  * sprintf's "format" to the end of "s". Reallocates it when it needs
73  * return value: number of bytes added.
74  */
75 
76 #endif
77