Mon, 06 Jan 2025 22:22:55 +0100
update ucx, toolkit
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | * Copyright 2021 Mike Becker, Olaf Wintermann All rights reserved. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
29 | * @file printf.h |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
30 | * @brief Wrapper for write functions with a printf-like interface. |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
31 | * @author Mike Becker |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
32 | * @author Olaf Wintermann |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
33 | * @copyright 2-Clause BSD License |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | */ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | #ifndef UCX_PRINTF_H |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | #define UCX_PRINTF_H |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | #include "common.h" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | #include "string.h" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | #include <stdarg.h> |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
43 | /** |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
44 | * Attribute for printf-like functions. |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
45 | * @param fmt_idx index of the format string parameter |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
46 | * @param arg_idx index of the first formatting argument |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
47 | */ |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
48 | #define cx_attr_printf(fmt_idx, arg_idx) \ |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
49 | __attribute__((__format__(printf, fmt_idx, arg_idx))) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
50 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | #ifdef __cplusplus |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | extern "C" { |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | #endif |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
55 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
56 | /** |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
57 | * The maximum string length that fits into stack memory. |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
58 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
59 | extern const unsigned cx_printf_sbo_size; |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
60 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
61 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
62 | * A @c fprintf like function which writes the output to a stream by |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
63 | * using a write_func. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65 | * @param stream the stream the data is written to |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66 | * @param wfc the write function |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67 | * @param fmt format string |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68 | * @param ... additional arguments |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
69 | * @return the total number of bytes written or an error code from stdlib printf implementation |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
71 | cx_attr_nonnull_arg(1, 2, 3) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
72 | cx_attr_printf(3, 4) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
73 | cx_attr_cstr_arg(3) |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
74 | int cx_fprintf( |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | void *stream, |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | cx_write_func wfc, |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
77 | const char *fmt, |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | ... |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | ); |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
82 | * A @c vfprintf like function which writes the output to a stream by |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
83 | * using a write_func. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
84 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | * @param stream the stream the data is written to |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | * @param wfc the write function |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | * @param fmt format string |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | * @param ap argument list |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
89 | * @return the total number of bytes written or an error code from stdlib printf implementation |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | * @see cx_fprintf() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
91 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
92 | cx_attr_nonnull |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
93 | cx_attr_cstr_arg(3) |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
94 | int cx_vfprintf( |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
95 | void *stream, |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
96 | cx_write_func wfc, |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
97 | const char *fmt, |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
98 | va_list ap |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
99 | ); |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
102 | * A @c asprintf like function which allocates space for a string |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | * the result is written to. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
105 | * @note The resulting string is guaranteed to be zero-terminated, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
106 | * unless there was an error, in which case the string's pointer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
107 | * will be @c NULL. |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | * @param allocator the CxAllocator used for allocating the string |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | * @param fmt format string |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | * @param ... additional arguments |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | * @return the formatted string |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | * @see cx_strfree_a() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
115 | cx_attr_nonnull_arg(1, 2) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
116 | cx_attr_printf(2, 3) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
117 | cx_attr_cstr_arg(2) |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | cxmutstr cx_asprintf_a( |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
119 | const CxAllocator *allocator, |
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
120 | const char *fmt, |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | ... |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | ); |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
125 | * A @c asprintf like function which allocates space for a string |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | * the result is written to. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
128 | * @note The resulting string is guaranteed to be zero-terminated, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
129 | * unless there was an error, in which case the string's pointer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
130 | * will be @c NULL. |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
132 | * @param fmt (@c char*) format string |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | * @param ... additional arguments |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
134 | * @return (@c cxmutstr) the formatted string |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | * @see cx_strfree() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | */ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | #define cx_asprintf(fmt, ...) \ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | cx_asprintf_a(cxDefaultAllocator, fmt, __VA_ARGS__) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
141 | * A @c vasprintf like function which allocates space for a string |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | * the result is written to. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
144 | * @note The resulting string is guaranteed to be zero-terminated, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
145 | * unless there was an error, in which case the string's pointer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
146 | * will be @c NULL. |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | * |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | * @param allocator the CxAllocator used for allocating the string |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | * @param fmt format string |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | * @param ap argument list |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | * @return the formatted string |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | * @see cx_asprintf_a() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
154 | cx_attr_nonnull |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
155 | cx_attr_cstr_arg(2) |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | cxmutstr cx_vasprintf_a( |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
157 | const CxAllocator *allocator, |
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
158 | const char *fmt, |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | va_list ap |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | ); |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
163 | * A @c vasprintf like function which allocates space for a string |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | * the result is written to. |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
166 | * @note The resulting string is guaranteed to be zero-terminated, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
167 | * unless there was in error, in which case the string's pointer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
168 | * will be @c NULL. |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
169 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
170 | * @param fmt (@c char*) format string |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
171 | * @param ap (@c va_list) argument list |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
172 | * @return (@c cxmutstr) the formatted string |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
173 | * @see cx_asprintf() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
174 | */ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175 | #define cx_vasprintf(fmt, ap) cx_vasprintf_a(cxDefaultAllocator, fmt, ap) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
176 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
177 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
178 | * A @c printf like function which writes the output to a CxBuffer. |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
179 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
180 | * @param buffer (@c CxBuffer*) a pointer to the buffer the data is written to |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
181 | * @param fmt (@c char*) the format string |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
182 | * @param ... additional arguments |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
183 | * @return (@c int) the total number of bytes written or an error code from stdlib printf implementation |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
184 | * @see cx_fprintf() |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
185 | * @see cxBufferWrite() |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
186 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
187 | #define cx_bprintf(buffer, fmt, ...) cx_fprintf((void*)buffer, \ |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
188 | (cx_write_func) cxBufferWrite, fmt, __VA_ARGS__) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
189 | |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
190 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
191 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
192 | * An @c sprintf like function which reallocates the string when the buffer is not large enough. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
193 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
194 | * The size of the buffer will be updated in @p len when necessary. |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
195 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
196 | * @note The resulting string, if successful, is guaranteed to be zero-terminated. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
197 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
198 | * @param str (@c char**) a pointer to the string buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
199 | * @param len (@c size_t*) a pointer to the length of the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
200 | * @param fmt (@c char*) the format string |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
201 | * @param ... additional arguments |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
202 | * @return (@c int) the length of produced string or an error code from stdlib printf implementation |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
203 | */ |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
204 | #define cx_sprintf(str, len, fmt, ...) cx_sprintf_a(cxDefaultAllocator, str, len, fmt, __VA_ARGS__) |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
205 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
206 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
207 | * An @c sprintf like function which reallocates the string when the buffer is not large enough. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
208 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
209 | * The size of the buffer will be updated in @p len when necessary. |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
210 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
211 | * @note The resulting string, if successful, is guaranteed to be zero-terminated. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
212 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
213 | * @attention The original buffer MUST have been allocated with the same allocator! |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
214 | * |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
215 | * @param alloc the allocator to use |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
216 | * @param str a pointer to the string buffer |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
217 | * @param len a pointer to the length of the buffer |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
218 | * @param fmt the format string |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
219 | * @param ... additional arguments |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
220 | * @return the length of produced string or an error code from stdlib printf implementation |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
221 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
222 | cx_attr_nonnull_arg(1, 2, 3, 4) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
223 | cx_attr_printf(4, 5) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
224 | cx_attr_cstr_arg(4) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
225 | int cx_sprintf_a( |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
226 | CxAllocator *alloc, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
227 | char **str, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
228 | size_t *len, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
229 | const char *fmt, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
230 | ... |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
231 | ); |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
232 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
233 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
234 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
235 | * An @c sprintf like function which reallocates the string when the buffer is not large enough. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
236 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
237 | * The size of the buffer will be updated in @p len when necessary. |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
238 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
239 | * @note The resulting string, if successful, is guaranteed to be zero-terminated. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
240 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
241 | * @param str (@c char**) a pointer to the string buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
242 | * @param len (@c size_t*) a pointer to the length of the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
243 | * @param fmt (@c char*) the format string |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
244 | * @param ap (@c va_list) argument list |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
245 | * @return (@c int) the length of produced string or an error code from stdlib printf implementation |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
246 | */ |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
247 | #define cx_vsprintf(str, len, fmt, ap) cx_vsprintf_a(cxDefaultAllocator, str, len, fmt, ap) |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
248 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
249 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
250 | * An @c sprintf like function which reallocates the string when the buffer is not large enough. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
251 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
252 | * The size of the buffer will be updated in @p len when necessary. |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
253 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
254 | * @note The resulting string is guaranteed to be zero-terminated. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
255 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
256 | * @attention The original buffer MUST have been allocated with the same allocator! |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
257 | * |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
258 | * @param alloc the allocator to use |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
259 | * @param str a pointer to the string buffer |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
260 | * @param len a pointer to the length of the buffer |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
261 | * @param fmt the format string |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
262 | * @param ap argument list |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
263 | * @return the length of produced string or an error code from stdlib printf implementation |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
264 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
265 | cx_attr_nonnull |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
266 | cx_attr_cstr_arg(4) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
267 | cx_attr_access_rw(2) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
268 | cx_attr_access_rw(3) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
269 | int cx_vsprintf_a( |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
270 | CxAllocator *alloc, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
271 | char **str, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
272 | size_t *len, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
273 | const char *fmt, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
274 | va_list ap |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
275 | ); |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
276 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
277 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
278 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
279 | * An @c sprintf like function which allocates a new string when the buffer is not large enough. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
280 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
281 | * The size of the buffer will be updated in @p len when necessary. |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
282 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
283 | * The location of the resulting string will @em always be stored to @p str. When the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
284 | * was sufficiently large, @p buf itself will be stored to the location of @p str. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
285 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
286 | * @note The resulting string, if successful, is guaranteed to be zero-terminated. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
287 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
288 | * @remark When a new string needed to be allocated, the contents of @p buf will be |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
289 | * poisoned after the call, because this function tries to produce the string in @p buf, first. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
290 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
291 | * @param buf (@c char*) a pointer to the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
292 | * @param len (@c size_t*) a pointer to the length of the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
293 | * @param str (@c char**) a pointer where the location of the result shall be stored |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
294 | * @param fmt (@c char*) the format string |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
295 | * @param ... additional arguments |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
296 | * @return (@c int) the length of produced string or an error code from stdlib printf implementation |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
297 | */ |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
298 | #define cx_sprintf_s(buf, len, str, fmt, ...) cx_sprintf_sa(cxDefaultAllocator, buf, len, str, fmt, __VA_ARGS__) |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
299 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
300 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
301 | * An @c sprintf like function which allocates a new string when the buffer is not large enough. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
302 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
303 | * The size of the buffer will be updated in @p len when necessary. |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
304 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
305 | * The location of the resulting string will @em always be stored to @p str. When the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
306 | * was sufficiently large, @p buf itself will be stored to the location of @p str. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
307 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
308 | * @note The resulting string, if successful, is guaranteed to be zero-terminated. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
309 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
310 | * @remark When a new string needed to be allocated, the contents of @p buf will be |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
311 | * poisoned after the call, because this function tries to produce the string in @p buf, first. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
312 | * |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
313 | * @param alloc the allocator to use |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
314 | * @param buf a pointer to the buffer |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
315 | * @param len a pointer to the length of the buffer |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
316 | * @param str a pointer where the location of the result shall be stored |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
317 | * @param fmt the format string |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
318 | * @param ... additional arguments |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
319 | * @return the length of produced string or an error code from stdlib printf implementation |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
320 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
321 | cx_attr_nonnull_arg(1, 2, 4, 5) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
322 | cx_attr_printf(5, 6) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
323 | cx_attr_cstr_arg(5) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
324 | cx_attr_access_rw(2) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
325 | cx_attr_access_rw(3) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
326 | cx_attr_access_rw(4) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
327 | int cx_sprintf_sa( |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
328 | CxAllocator *alloc, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
329 | char *buf, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
330 | size_t *len, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
331 | char **str, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
332 | const char *fmt, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
333 | ... |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
334 | ); |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
335 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
336 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
337 | * An @c sprintf like function which allocates a new string when the buffer is not large enough. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
338 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
339 | * The size of the buffer will be updated in @p len when necessary. |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
340 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
341 | * The location of the resulting string will @em always be stored to @p str. When the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
342 | * was sufficiently large, @p buf itself will be stored to the location of @p str. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
343 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
344 | * @note The resulting string is guaranteed to be zero-terminated. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
345 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
346 | * @remark When a new string needed to be allocated, the contents of @p buf will be |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
347 | * poisoned after the call, because this function tries to produce the string in @p buf, first. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
348 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
349 | * @param buf (@c char*) a pointer to the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
350 | * @param len (@c size_t*) a pointer to the length of the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
351 | * @param str (@c char**) a pointer where the location of the result shall be stored |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
352 | * @param fmt (@c char*) the format string |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
353 | * @param ap (@c va_list) argument list |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
354 | * @return (@c int) the length of produced string or an error code from stdlib printf implementation |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
355 | */ |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
356 | #define cx_vsprintf_s(buf, len, str, fmt, ap) cx_vsprintf_sa(cxDefaultAllocator, buf, len, str, fmt, ap) |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
357 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
358 | /** |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
359 | * An @c sprintf like function which allocates a new string when the buffer is not large enough. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
360 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
361 | * The size of the buffer will be updated in @p len when necessary. |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
362 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
363 | * The location of the resulting string will @em always be stored to @p str. When the buffer |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
364 | * was sufficiently large, @p buf itself will be stored to the location of @p str. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
365 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
366 | * @note The resulting string is guaranteed to be zero-terminated. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
367 | * |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
368 | * @remark When a new string needed to be allocated, the contents of @p buf will be |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
369 | * poisoned after the call, because this function tries to produce the string in @p buf, first. |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
370 | * |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
371 | * @param alloc the allocator to use |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
372 | * @param buf a pointer to the buffer |
49
2f71f4ee247a
update toolkit, ucx, libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
373 | * @param len a pointer to the length of the buffer |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
374 | * @param str a pointer where the location of the result shall be stored |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
375 | * @param fmt the format string |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
376 | * @param ap argument list |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
377 | * @return the length of produced string or an error code from stdlib printf implementation |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
378 | */ |
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
379 | cx_attr_nonnull |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
380 | cx_attr_cstr_arg(5) |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
381 | int cx_vsprintf_sa( |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
382 | CxAllocator *alloc, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
383 | char *buf, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
384 | size_t *len, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
385 | char **str, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
386 | const char *fmt, |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
387 | va_list ap |
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
49
diff
changeset
|
388 | ); |
2
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
389 | |
fbdfaacc4182
update ucx, libidav and add first gui code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
390 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
391 | #ifdef __cplusplus |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
392 | } // extern "C" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
393 | #endif |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
394 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
395 | #endif //UCX_PRINTF_H |