xref: /PHP-7.4/ext/xmlrpc/libxmlrpc/simplestring.h (revision 3b78cabc)
1 /*
2   This file is part of libXMLRPC - a C library for xml-encoded function calls.
3 
4   Author: Dan Libby (dan@libby.com)
5   Epinions.com may be contacted at feedback@epinions-inc.com
6 */
7 
8 /*
9   Copyright 2000 Epinions, Inc.
10 
11   Subject to the following 3 conditions, Epinions, Inc.  permits you, free
12   of charge, to (a) use, copy, distribute, modify, perform and display this
13   software and associated documentation files (the "Software"), and (b)
14   permit others to whom the Software is furnished to do so as well.
15 
16   1) The above copyright notice and this permission notice shall be included
17   without modification in all copies or substantial portions of the
18   Software.
19 
20   2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF
21   ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY
22   IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR
23   PURPOSE OR NONINFRINGEMENT.
24 
25   3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
26   SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
27   OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING
28   NEGLIGENCE), EVEN IF EPINIONS, INC.  IS AWARE OF THE POSSIBILITY OF SUCH
29   DAMAGES.
30 
31 */
32 
33 #ifndef __SIMPLESTRING_H__
34  #define __SIMPLESTRING_H__
35 
36 /*-********************************
37 * begin simplestring header stuff *
38 **********************************/
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44    /****s* struct/simplestring
45  * NAME
46  *  simplestring
47  * NOTES
48  *   represents a string efficiently for fast appending, etc.
49  * SOURCE
50  */
51 typedef struct _simplestring {
52    char* str;         /* string buf               */
53    size_t len;           /* length of string/buf     */
54    size_t size;          /* size of allocated buffer */
55 } simplestring;
56 /******/
57 
58 #ifndef NULL
59  #define NULL 0
60 #endif
61 
62 void simplestring_init(simplestring* string);
63 void simplestring_clear(simplestring* string);
64 void simplestring_free(simplestring* string);
65 void simplestring_add(simplestring* string, const char* add);
66 void simplestring_addn(simplestring* string, const char* add, size_t add_len);
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 /*-******************************
73 * end simplestring header stuff *
74 ********************************/
75 
76 #endif /* __SIMPLESTRING_H__ */
77