394 CxProperties *prop, |
394 CxProperties *prop, |
395 const char *buf, |
395 const char *buf, |
396 size_t len |
396 size_t len |
397 ); |
397 ); |
398 |
398 |
|
399 #ifdef __cplusplus |
|
400 } // extern "C" |
|
401 /** |
|
402 * Fills the input buffer with a string. |
|
403 * |
|
404 * Currently unprocessed data is copied to a temporary buffer. |
|
405 * This temporary buffer is allocated on the heap, unless you specified |
|
406 * a buffer on the stack with #cxPropertiesUseStack(). |
|
407 * In that case, the stack buffer is used, until the capacity is not sufficient |
|
408 * anymore. |
|
409 * |
|
410 * @param prop the properties interface |
|
411 * @param str the string |
|
412 * @return non-zero when a memory allocation was necessary but failed |
|
413 */ |
|
414 cx_attr_nonnull |
|
415 static inline int cxPropertiesFill( |
|
416 CxProperties *prop, |
|
417 cxstring str |
|
418 ) { |
|
419 return cxPropertiesFilln(prop, str.ptr, str.length); |
|
420 } |
|
421 |
|
422 /** |
|
423 * Fills the input buffer with a string. |
|
424 * |
|
425 * Currently unprocessed data is copied to a temporary buffer. |
|
426 * This temporary buffer is allocated on the heap, unless you specified |
|
427 * a buffer on the stack with #cxPropertiesUseStack(). |
|
428 * In that case, the stack buffer is used, until the capacity is not sufficient |
|
429 * anymore. |
|
430 * |
|
431 * @param prop the properties interface |
|
432 * @param str the string |
|
433 * @return non-zero when a memory allocation was necessary but failed |
|
434 */ |
|
435 cx_attr_nonnull |
|
436 static inline int cxPropertiesFill( |
|
437 CxProperties *prop, |
|
438 cxmutstr str |
|
439 ) { |
|
440 return cxPropertiesFilln(prop, str.ptr, str.length); |
|
441 } |
|
442 |
|
443 /** |
|
444 * Fills the input buffer with a string. |
|
445 * |
|
446 * Currently unprocessed data is copied to a temporary buffer. |
|
447 * This temporary buffer is allocated on the heap, unless you specified |
|
448 * a buffer on the stack with #cxPropertiesUseStack(). |
|
449 * In that case, the stack buffer is used, until the capacity is not sufficient |
|
450 * anymore. |
|
451 * |
|
452 * @param prop the properties interface |
|
453 * @param str the string |
|
454 * @return non-zero when a memory allocation was necessary but failed |
|
455 */ |
|
456 cx_attr_nonnull |
|
457 cx_attr_cstr_arg(2) |
|
458 static inline int cxPropertiesFill( |
|
459 CxProperties *prop, |
|
460 const char *str |
|
461 ) { |
|
462 return cxPropertiesFilln(prop, str, strlen(str)); |
|
463 } |
|
464 |
|
465 extern "C" { |
|
466 #else // __cplusplus |
399 /** |
467 /** |
400 * Fills the input buffer with a string. |
468 * Fills the input buffer with a string. |
401 * |
469 * |
402 * Currently unprocessed data is copied to a temporary buffer. |
470 * Currently unprocessed data is copied to a temporary buffer. |
403 * This temporary buffer is allocated on the heap, unless you specified |
471 * This temporary buffer is allocated on the heap, unless you specified |