Debian Codegraph @

src/common/xstr.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2005 Dizzy
3 *
4 * xstr is a module trying to offer some high-level string functionality
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21 #ifndef INCLUDED_XSTR_TYPES
22 #define INCLUDED_XSTR_TYPEScxx . . $ `src/common/xstr.h:22:9`!
23
24 namespace pvpgncxx . . $ pvpgn/
25 {
26
27 typedef structcxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0# {
28 unsigned alencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#alen., ulencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#ulen.;
29 char *strcxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#str.;
30 } t_xstrcxx . . $ pvpgn/t_xstr#;
31
32 }
33
34 #define DECLARE_XSTRcxx . . $ `src/common/xstr.h:34:9`!(var) \
35 t_xstr var = { 0, 0, NULL };
36
37 #endif /* INCLUDED_XSTR_TYPES */
38
39 #ifndef INCLUDED_XSTR_PROTOS
40 #define INCLUDED_XSTR_PROTOScxx . . $ `src/common/xstr.h:40:9`!
41
42 /* for NULL */
43 #include <cstddef>
44
45 namespace pvpgncxx . . $ pvpgn/
46 {
47
48 extern t_xstrcxx . . $ pvpgn/t_xstr#* xstr_alloccxx . . $ pvpgn/xstr_alloc(3125114ad3ba0a87).(void);
49 extern void xstr_freecxx . . $ pvpgn/xstr_free(dbb2bf3681fb2b00).(t_xstrcxx . . $ pvpgn/t_xstr#*);
50 extern t_xstrcxx . . $ pvpgn/t_xstr#* xstr_cpy_strcxx . . $ pvpgn/xstr_cpy_str(5f93d84c9cbedb2c).(t_xstrcxx . . $ pvpgn/t_xstr#* dst, const char* src);
51 extern t_xstrcxx . . $ pvpgn/t_xstr#* xstr_cat_xstrcxx . . $ pvpgn/xstr_cat_xstr(489e26548c9f888e).(t_xstrcxx . . $ pvpgn/t_xstr#* dst, const t_xstrcxx . . $ pvpgn/t_xstr#* src);
52 extern t_xstrcxx . . $ pvpgn/t_xstr#* xstr_cat_strcxx . . $ pvpgn/xstr_cat_str(5f93d84c9cbedb2c).(t_xstrcxx . . $ pvpgn/t_xstr#* dst, const char* src);
53 extern t_xstrcxx . . $ pvpgn/t_xstr#* xstr_ncat_strcxx . . $ pvpgn/xstr_ncat_str(8f3e6e1e70863ca).(t_xstrcxx . . $ pvpgn/t_xstr#* dst, const char* src, int len);
54 extern t_xstrcxx . . $ pvpgn/t_xstr#* xstr_cat_charcxx . . $ pvpgn/xstr_cat_char(b449f1e097feab7).(t_xstrcxx . . $ pvpgn/t_xstr#* dst, const char ch);
55
56 static inline void xstr_initcxx . . $ pvpgn/xstr_init(dbb2bf3681fb2b00).(t_xstrcxx . . $ pvpgn/t_xstr#* xstr)
57 {
58 xstr->alencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#alen. = xstr->ulencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#ulen. = 0;
59 xstr->strcxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#str. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
60 }
61
62 static inline const char* xstr_get_strcxx . . $ pvpgn/xstr_get_str(9a9300e90646af37).(t_xstrcxx . . $ pvpgn/t_xstr#* xstr)
63 {
64 if (xstr->alencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#alen. && xstr->ulencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#ulen.) return xstr->strcxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#str.;
65 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
66 }
67
68 static inline unsigned xstr_get_lencxx . . $ pvpgn/xstr_get_len(f93386cd036cbaa3).(t_xstrcxx . . $ pvpgn/t_xstr#* xstr)
69 {
70 return xstr->alencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#alen. ? xstr->ulencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#ulen. : 0;
71 }
72
73 static inline t_xstrcxx . . $ pvpgn/t_xstr#* xstr_clearcxx . . $ pvpgn/xstr_clear(40fb192192514c35).(t_xstrcxx . . $ pvpgn/t_xstr#* xstr)
74 {
75 /* reset the string content, don't touch the allocation space */
76 xstr->ulencxx . . $ pvpgn/$anonymous_type_cb3022ae3e20e626_0#ulen. = 0;
77
78 return xstr;
79 }
80
81 }
82
83 #endif /* INCLUDED_STR_PROTOS */
84