181 |
181 |
182 cx_attr_nonnull |
182 cx_attr_nonnull |
183 cx_attr_access_r(2, 3) |
183 cx_attr_access_r(2, 3) |
184 int cxJsonFilln(CxJson *json, const char *buf, size_t len); |
184 int cxJsonFilln(CxJson *json, const char *buf, size_t len); |
185 |
185 |
|
186 #ifdef __cplusplus |
|
187 } // extern "C" |
|
188 |
|
189 cx_attr_nonnull |
|
190 static inline int cxJsonFill( |
|
191 CxJson *json, |
|
192 cxstring str |
|
193 ) { |
|
194 return cxJsonFilln(json, str.ptr, str.length); |
|
195 } |
|
196 |
|
197 cx_attr_nonnull |
|
198 static inline int cxJsonFill( |
|
199 CxJson *json, |
|
200 cxmutstr str |
|
201 ) { |
|
202 return cxJsonFilln(json, str.ptr, str.length); |
|
203 } |
|
204 |
|
205 cx_attr_nonnull |
|
206 cx_attr_cstr_arg(2) |
|
207 static inline int cxJsonFill( |
|
208 CxJson *json, |
|
209 const char *str |
|
210 ) { |
|
211 return cxJsonFilln(json, str, strlen(str)); |
|
212 } |
|
213 |
|
214 extern "C" { |
|
215 #else // __cplusplus |
186 #define cxJsonFill(json, str) _Generic((str), \ |
216 #define cxJsonFill(json, str) _Generic((str), \ |
187 cxstring: cx_json_fill_cxstr, \ |
217 cxstring: cx_json_fill_cxstr, \ |
188 cxmutstr: cx_json_fill_mutstr, \ |
218 cxmutstr: cx_json_fill_mutstr, \ |
189 char*: cx_json_fill_str, \ |
219 char*: cx_json_fill_str, \ |
190 const char*: cx_json_fill_str) \ |
220 const char*: cx_json_fill_str) \ |