21 #define AFW_IMPLEMENTATION_ID "afw_yaml"
22 #define AFW_IMPLEMENTATION_VERSION AFW_YAML_VERSION_STRING
45 static const afw_memory_t impl_raw_last_object_separator = {
59 &impl_afw_content_type_inf,
67 extern void afw_yaml_internal_write_value(
86 return &impl_afw_content_type;
106 impl_afw_extension_initialize(
124 return &impl_extension;
132 impl_afw_extension_release(
142 apr_array_header_t *a;
145 if (!s)
return "null";
150 for (c = s; *c; c++) {
156 APR_ARRAY_PUSH(a,
char) = *u;
165 APR_ARRAY_PUSH(a,
char) = *c;
171 APR_ARRAY_PUSH(a,
char) = 0;
181 "\"status\": \"error\",\n"
182 "\"errorCode\": %d,\n"
183 "\"errorCodeId\": %s,\n"
184 "\"sourceFile\": %s,\n"
185 "\"function\": %s,\n"
186 "\"lineNumber\": %d,\n"
187 "\"rvSourceId\": %s,\n"
189 "\"rvDecoded\": %s,\n"
208 impl_afw_content_type_raw_to_value(
224 impl_afw_content_type_raw_to_object (
236 adaptor_id, object_type_id, object_id, cede_p, p, xctx);
245 impl_afw_content_type_write_value(
253 afw_yaml_internal_write_value(value, options, context, callback,
263 impl_afw_content_type_create_object_list_writer(
270 return afw_content_type_impl_create_object_list_writer(
271 instance, options, context, callback,
272 &impl_raw_begin_object_list,
273 &impl_raw_object_separator,
274 &impl_raw_last_object_separator,
275 &impl_raw_end_object_list,
Adaptive Framework Core API.
Helpers for afw_content_type* implementation development.
Interface afw_interface implementation declares.
Interface afw_interface implementation declares.
const afw_content_type_t * afw_yaml_content_type_get()
Get the content type instance for FIXME.
Header file for Adaptive Framework YAML.
Adaptive Framework Version (afw_yaml_) header.
#define AFW_UTF8_LITERAL(A_STRING)
String literal initializer.
unsigned char afw_byte_t
A byte of memory (unsigned).
afw_utf8_octet_t afw_utf8_z_t
NFC normalized UTF-8 null terminated string.
afw_size_t(* afw_write_cb_t)(void *context, const void *buffer, afw_size_t size, const afw_pool_t *p, afw_xctx_t *xctx)
Typedef for write callback function.
afw_content_type_register(const afw_content_type_t *content_type, afw_xctx_t *xctx)
Register content type with its id and all of its media types.
#define AFW_ENVIRONMENT_DEFINE_EXTENSION_IMPL()
Macro to put in each afw_extension implementation.
afw_error_code_id_z(const afw_error_t *error)
Returns error->code id.
#define afw_error_source_file(error)
Returns value of error->source_z after last '/ 'or '\'.
#define afw_pool_get_apr_pool(instance)
Call method get_apr_pool of interface afw_pool.
afw_utf8_printf(const afw_pool_t *p, afw_xctx_t *xctx, const afw_utf8_z_t *format,...)
Create a utf-8 string using a c format string in specified pool.
void afw_yaml_register(afw_xctx_t *xctx)
Register YAML support.
const afw_value_t * afw_yaml_to_value(const afw_memory_t *yaml, const afw_utf8_t *path, const afw_pool_t *p, afw_xctx_t *xctx)
Convert YAML to an adaptive value.
const afw_utf8_t * afw_yaml_from_error(afw_xctx_t *xctx)
Convert error from xctx to a YAML object.
const afw_object_t * afw_yaml_to_object(const afw_memory_t *yaml, const afw_utf8_t *source_location, const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_boolean_t cede_p, const afw_pool_t *p, afw_xctx_t *xctx)
Convert from YAML to adaptive object.
Interface afw_content_type_object_list_writer public struct.
Interface afw_content_type public struct.
Adaptive Framework Error.
afw_error_code_t code
Error code.
const afw_utf8_z_t * rv_source_id_z
This is the source of the non-zero rv.
const afw_utf8_z_t * message_z
Message.
int rv
If non-zero, this is rc, rv, or any int value related to error.
const afw_utf8_z_t * source_z
File:line in source error was thrown.
const afw_utf8_z_t * rv_decoded_z
Human readable decode of rv.
Interface afw_extension public struct.
Struct for memory pointer and size.
Struct for object processing options.
Interface afw_object public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_value public struct.
Interface afw_xctx public struct.