Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_context.c
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework Context
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
14 #include "afw_internal.h"
15 
16 
17 
18 static const afw_value_t *
19 impl_current_variable_get_cb(
21  const afw_utf8_t *name,
22  afw_xctx_t *xctx)
23 {
24  const afw_value_t *result;
25  const afw_context_cb_variable_t * const *current_variables =
26  (const afw_context_cb_variable_t * const *)entry->wa;
27  const afw_context_cb_variable_t *const *current_variable;
28 
29  result = NULL;
30 
31  if (current_variables) for (
32  current_variable = current_variables;
33  *current_variable;
34  current_variable++)
35  {
36  if (afw_utf8_equal((*current_variable)->meta->name, name)) {
37  result = (*current_variable)->get_cb(entry, name, xctx);
38  break;
39  }
40  }
41 
42  return result;
43 }
44 
45 
46 AFW_DEFINE(void)
48  const afw_utf8_t *qualifier_id,
49  const afw_context_cb_variable_t *const *variables,
50  void *data,
51  const afw_pool_t *p,
52  afw_xctx_t *xctx)
53 {
55 
56  entry = afw_xctx_push_qualifier(qualifier_id, NULL, true,
57  impl_current_variable_get_cb, data, p, xctx);
58  entry->wa = (void *)variables;
59 }
60 
61 
62 /* Create an unmanaged context type object. */
63 AFW_DEFINE(const afw_object_t *)
65  const afw_utf8_t *context_type_id,
66  const afw_pool_t *p,
67  afw_xctx_t *xctx)
68 {
69  const afw_object_t *result;
70 
71  result = afw_object_create(p, xctx);
72  afw_object_meta_set_ids(result, &afw_s_afw,
73  &afw_s__AdaptiveContextType_, context_type_id, xctx);
74 
76  &afw_s_contextTypeId, context_type_id, xctx);
77 
78  return result;
79 }
80 
81 
82 
83 /* Insure qualifier definitions object exists. */
84 AFW_DEFINE(const afw_object_t *)
86  const afw_object_t *context_type_object,
87  afw_xctx_t *xctx)
88 {
89  const afw_object_t *result;
90 
92  context_type_object, &afw_s_qualifierDefinitions, xctx);
93 
94  if (!result) {
96  context_type_object, &afw_s_qualifierDefinitions,
97  xctx);
99  &afw_s__AdaptiveQualifierDefinitions_, xctx);
100  }
101 
102  return result;
103 }
104 
105 
106 
107 /* Insure qualifier_object exists for qualifier id. */
108 AFW_DEFINE(const afw_object_t *)
110  const afw_object_t *context_type_object,
111  const afw_utf8_t *qualifier_id,
112  afw_xctx_t *xctx)
113 {
114  const afw_object_t *qualifier_definitions;
115  const afw_object_t *result;
116 
117  qualifier_definitions =
119  context_type_object, xctx);
120  result = afw_object_old_get_property_as_object(qualifier_definitions,
121  qualifier_id, xctx);
122  if (!result) {
124  qualifier_definitions, qualifier_id, xctx);
126  &afw_s__AdaptivePropertyTypes_, xctx);
127  }
128 
129  return result;
130 }
131 
132 
133 
134 AFW_DEFINE(void)
136  const afw_utf8_t *context_type_id,
137  const afw_utf8_t *qualifier_id,
138  const afw_utf8_octet_t *description_z,
139  const afw_context_cb_variable_t *const *variables,
140  int include_mask,
141  afw_xctx_t *xctx)
142 {
143  const afw_object_t *context_type_object;
144  const afw_object_t *qualifier_definitions;
145  const afw_object_t *variable_definitions;
146  const afw_context_cb_variable_t *const *variable;
147 
148  context_type_object = afw_context_type_create(
149  context_type_id, xctx->env->p, xctx);
150  qualifier_definitions =
152  context_type_object, xctx);
153  afw_object_meta_add_parent_path(qualifier_definitions,
154  &afw_s_a_context_type_application_qualifier_definitions_path,
155  xctx);
157  &afw_s_description, description_z, xctx);
158 
159  variable_definitions =
161  context_type_object, qualifier_id, xctx);
162 
163  for (variable = variables;
164  *variable;
165  variable++)
166  {
167  if (include_mask & ((*variable)->include_mask))
168  {
170  variable_definitions,
171  (*variable)->meta->name,
172  &afw_s_internal,
173  (*variable)->meta->value_inf,
174  (*variable)->meta->label_z,
175  (*variable)->description_z,
176  (*variable)->meta->data_type_parameter_z,
177  (*variable)->meta->data_type_parameter_formatted_z,
178  xctx);
179  }
180  }
181 
183  context_type_object, xctx);
184 }
185 
186 
187 
188 /* Add variable definition using 0 terminated label and description. */
189 AFW_DEFINE(void)
191  const afw_object_t *variable_definitions,
192  const afw_utf8_t *variable_name,
193  const afw_utf8_t *source,
194  const afw_value_inf_t *value_inf,
195  const afw_utf8_z_t *label_z,
196  const afw_utf8_z_t *description_z,
197  const afw_utf8_z_t *data_type_parameter_z,
198  const afw_utf8_z_t *data_type_parameter_formatted_z,
199  afw_xctx_t *xctx)
200 {
201  const afw_object_t *definition;
202  afw_value_string_t *string_value;
203  const afw_data_type_t *data_type;
204  afw_value_t value;
205 
206  definition = afw_object_create_embedded(variable_definitions,
207  variable_name, xctx);
209  &afw_s__AdaptiveValueMeta_, xctx);
210 
211  value.inf = value_inf;
212  data_type = (value_inf) ? afw_value_get_data_type(&value, xctx) : NULL;
213  if (data_type) {
214  afw_object_set_property_as_string(definition, &afw_s_dataType,
215  &data_type->data_type_id, xctx);
216  }
217  if (label_z) {
218  string_value = afw_value_allocate_string(definition->p, xctx);
219  string_value->internal.s = label_z;
220  string_value->internal.len = strlen(label_z);
221  afw_object_set_property(definition, &afw_s_label,
222  (const afw_value_t *)string_value, xctx);
223  }
224  if (description_z) {
225  string_value = afw_value_allocate_string(definition->p, xctx);
226  string_value->internal.s = description_z;
227  string_value->internal.len = strlen(description_z);
228  afw_object_set_property(definition, &afw_s_description,
229  (const afw_value_t *)string_value, xctx);
230  }
231  if (data_type_parameter_z) {
232  string_value = afw_value_allocate_string(definition->p, xctx);
233  string_value->internal.s = data_type_parameter_z;
234  string_value->internal.len = strlen(data_type_parameter_z);
235  afw_object_set_property(definition, &afw_s_dataTypeParameter,
236  (const afw_value_t *)string_value, xctx);
237  }
238  if (data_type_parameter_formatted_z) {
239  string_value = afw_value_allocate_string(definition->p, xctx);
240  string_value->internal.s = data_type_parameter_formatted_z;
241  string_value->internal.len = strlen(data_type_parameter_formatted_z);
242  afw_object_set_property(definition, &afw_s_dataTypeParameterFormatted,
243  (const afw_value_t *)string_value, xctx);
244  }
245 }
246 
247 
248 
249 /* Add variable definitions. */
250 AFW_DEFINE(void)
252  const afw_object_t *variable_definitions,
253  const afw_object_t *definitions_to_add,
254  afw_boolean_t replace_duplicates,
255  afw_xctx_t *xctx)
256 {
257  const afw_iterator_t *iterator;
258  const afw_utf8_t *property_name;
259  const afw_value_t *value;
260 
261  iterator = NULL;
262  while ((value = afw_object_get_next_property(
263  definitions_to_add, &iterator, &property_name, xctx)))
264  {
265  if (replace_duplicates ||
266  !afw_object_has_property(variable_definitions, property_name, xctx))
267  {
268  afw_object_set_property(variable_definitions, property_name, value,
269  xctx);
270  }
271  }
272 }
273 
274 
275 /* Merge qualifier definitions. */
276 AFW_DEFINE(void)
278  const afw_object_t *qualifier_definitions,
279  const afw_object_t *definitions_to_add,
280  afw_boolean_t replace_duplicates,
281  afw_xctx_t *xctx)
282 {
283  const afw_iterator_t *iterator;
284  const afw_utf8_t *property_name;
285  const afw_value_t *value;
286  const afw_object_t *variable_definitions;
287  const afw_object_t *variable_definitions_to_add;
288 
289  iterator = NULL;
290  while ((value = afw_object_get_next_property(
291  definitions_to_add, &iterator, &property_name, xctx)))
292  {
293  variable_definitions =
295  qualifier_definitions, property_name, xctx);
296  if (variable_definitions)
297  {
298  variable_definitions_to_add =
299  afw_value_as_object(value, xctx);
301  variable_definitions, variable_definitions_to_add,
302  replace_duplicates, xctx);
303  }
304  else {
305  afw_object_set_property(qualifier_definitions,
306  property_name, value, xctx);
307  }
308  }
309 }
310 
311 
312 
313 /* Add variable definitions based on object. */
314 AFW_DEFINE(void)
316  const afw_object_t *variable_definitions,
317  const afw_object_t *object,
318  afw_xctx_t *xctx)
319 {
320  const afw_object_t *object_type_object;
321  const afw_object_t *property_types;
322  const afw_object_t *pt;
323  const afw_object_t *other_properties;
324  const afw_value_t *value;
325  const afw_iterator_t *iterator;
326  const afw_utf8_t *property_name;
327  const afw_value_t *value2;
328  const afw_iterator_t *iterator2;
329  const afw_utf8_t *property_name2;
330  const afw_pool_t *p = variable_definitions->p;
331  const afw_utf8_t *s;
332  const afw_data_type_t *data_type;
333  const afw_data_type_t *value_data_type;
334 
335  object_type_object = NULL;
336  if (afw_object_meta_get_object_type_id(object, xctx))
337  {
338  object_type_object = afw_runtime_get_object(&afw_s__AdaptiveObjectType_,
339  afw_object_meta_get_object_type_id(object, xctx), xctx);
340  }
341  if (!object_type_object) {
342  AFW_THROW_ERROR_Z(general, "Object requires valid object type", xctx);
343  }
344 
346  object_type_object = afw_object_view_create(object_type_object, NULL,
347  &afw_object_options_composite, p, xctx);
348 
349  property_types = afw_object_old_get_property_as_object(
350  object_type_object, &afw_s_propertyTypes, xctx);
351  other_properties = afw_object_old_get_property_as_object(
352  object_type_object, &afw_s_otherProperties, xctx);
353  iterator = NULL;
354  while ((value = afw_object_get_next_property(object,
355  &iterator, &property_name, xctx)))
356  {
357  /* Determine property type for this property name. */
358  pt = NULL;
359  if (property_types) {
360  pt = afw_object_old_get_property_as_object(property_types,
361  property_name, xctx);
362  }
363  if (!pt) {
364  pt = other_properties;
365  }
366  if (!pt) {
367  continue;
368  AFW_THROW_ERROR_FZ(general, xctx,
369  "Missing property type for %" AFW_UTF8_FMT,
370  AFW_UTF8_FMT_ARG(property_name));
371  }
372 
373  value_data_type = afw_value_get_data_type(value, xctx);
374 
375 
377  /*
378  * If this is a compiled data type, ignore if not already compiled or
379  * use relatedPropertyType for pt if it is.
380  */
382  &afw_s_dataType, xctx);
383  if (s) {
384  data_type = afw_environment_get_data_type(s, xctx);
385  if (data_type && data_type->evaluated) {
386  if (value_data_type && value_data_type->evaluated) {
387  continue;
388  }
392  }
393  }
394 
395  /* If this is an annotated value, merge annotation into pt. */
396  if (afw_value_is_annotated(value)) {
397  if (pt) {
398  pt = afw_object_create_clone(pt, p, xctx);
399  iterator2 = NULL;
400  while ((value2 = afw_object_get_next_property(
401  ((const afw_value_annotated_t *)value)->annotation,
402  &iterator2, &property_name2, xctx)))
403  {
404  afw_object_set_property(pt, property_name2, value2,
405  xctx);
407  }
408  }
409  else {
410  pt = ((const afw_value_annotated_t *)value)->annotation;
411  }
412  }
413 
414  /* If not a pt at this point, make one using value meta. */
415  if (!pt) {
416  pt = afw_object_create(p, xctx);
417  if (value_data_type) {
419  &afw_s_dataType, &value_data_type->data_type_id, xctx);
420  }
421  }
422 
423  /* Add variable definition using this property name and pt. */
424  afw_object_set_property_as_object(variable_definitions,
425  property_name, pt, xctx);
426  }
427 }
428 
429 
430 
431 /* Add variable definitions based on object type id. */
432 AFW_DEFINE(void)
434  const afw_object_t *variable_definitions,
435  const afw_utf8_t *object_type_id,
436  afw_boolean_t include_evaluated,
437  afw_xctx_t *xctx)
438 {
439  const afw_pool_t *p = variable_definitions->p;
440  const afw_object_t *object_type_object;
441  const afw_object_t *property_types;
442  const afw_object_t *pt;
443  const afw_object_t *related_pt;
444  const afw_iterator_t *iterator;
445  const afw_utf8_t *property_name;
446  const afw_utf8_t *data_type_id;
447  const afw_data_type_t *data_type = NULL;
448  afw_value_string_t *source_value;
449 
450 
451  object_type_object = afw_runtime_get_object(&afw_s__AdaptiveObjectType_,
452  object_type_id, xctx);
453  if (!object_type_object) {
454  AFW_THROW_ERROR_Z(general, "Object type does not exist", xctx);
455  }
456 
458  object_type_object = afw_object_view_create(object_type_object, NULL,
459  &afw_object_options_composite, p, xctx);
460 
461  property_types = afw_object_old_get_property_as_object(
462  object_type_object, &afw_s_propertyTypes, xctx);
463  iterator = NULL;
465  property_types, &iterator, &property_name, xctx)))
466  {
467  /* Skip custom. */
468  if (afw_utf8_equal(property_name, &afw_s_custom)) {
469  continue;
470  }
471 
472  /* Get data type. */
473  data_type_id = afw_object_old_get_property_as_string(pt,
474  &afw_s_dataType, xctx);
475  if (data_type_id) {
476  data_type = afw_environment_get_data_type(data_type_id, xctx);
477  }
478 
479  /* If evaluated value and they should not included, skip. */
480  if (data_type && data_type->evaluated) {
481  if (!include_evaluated) {
482  continue;
483  }
485  /* Use relatedPropertyType for property type if available or skip. */
489  related_pt = NULL;
490  if (!related_pt) {
491  continue;
492  }
493  pt = related_pt;
494  }
495 
496  /* Clone pt and set source. */
497  pt = afw_object_create_clone(pt, p, xctx);
498  source_value = afw_value_allocate_string(p, xctx);
499  source_value->internal.len = object_type_id->len;
500  source_value->internal.s = afw_memory_dup(
501  object_type_id->s, object_type_id->len, p, xctx);
502 
503  /* Add variable definition using this property name and pt. */
504  afw_object_set_property_as_object(variable_definitions,
505  property_name, pt, xctx);
506  }
507 }
508 
509 
510 
511 /* Compile and add variable definitions (_AdaptiveHybridProperties_) */
512 AFW_DEFINE(void)
514  const afw_object_t *context_type_object,
515  const afw_object_t *object,
516  const afw_utf8_t *qualifier_id,
517  const afw_utf8_t *source_location,
518  afw_xctx_t *xctx)
519 {
520  const afw_utf8_t *detail_source_location;
521  const afw_object_t *variable_definitions_object;
522 
523  variable_definitions_object =
525  context_type_object, qualifier_id, xctx);
526  detail_source_location = afw_utf8_printf(object->p, xctx,
527  "%" AFW_UTF8_FMT "/%" AFW_UTF8_FMT,
528  AFW_UTF8_FMT_ARG(source_location),
529  AFW_UTF8_FMT_ARG(qualifier_id));
531  detail_source_location, false, NULL, xctx);
532  variable_definitions_object =
534  context_type_object, qualifier_id, xctx);
536  variable_definitions_object, object, xctx);
537 }
538 
539 
540 /* Compile and add variable definitions (_AdaptiveHybridProperties_) */
541 AFW_DEFINE(void)
543  const afw_object_t *context_type_object,
544  const afw_object_t *objects,
545  const afw_utf8_t *source_location,
546  afw_xctx_t *xctx)
547 {
548  const afw_iterator_t *iterator;
549  const afw_utf8_t *qualifier_id;
550  const afw_utf8_t *detail_source_location;
551  const afw_object_t *object;
552 
553  iterator = NULL;
555  objects, &iterator, &qualifier_id, xctx)))
556  {
557  detail_source_location = afw_utf8_printf(
558  object->p, xctx,
559  "%" AFW_UTF8_FMT "/%" AFW_UTF8_FMT,
560  AFW_UTF8_FMT_ARG(source_location),
561  AFW_UTF8_FMT_ARG(qualifier_id));
563  context_type_object, object,
564  qualifier_id, detail_source_location, xctx);
565  }
566 }
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
afw_object_set_property_as_object(const afw_object_t *object, const afw_utf8_t *property_name, const afw_object_t *internal, afw_xctx_t *xctx)
Set property function for data type object values.
#define afw_object_old_get_property_as_object(object, property_name, xctx)
Get property function for data type object value.
#define afw_object_old_get_next_property_as_object(object, iterator, property_name, xctx)
Get next property function for data type object value.
afw_value_as_object(const afw_value_t *value, afw_xctx_t *xctx)
Typesafe cast of data type object.
#define afw_object_old_get_property_as_string(object, property_name, xctx)
Get property function for data type string value.
afw_value_allocate_string(const afw_pool_t *p, afw_xctx_t *xctx)
Allocate function for unmanaged data type string value.
afw_object_set_property_as_string(const afw_object_t *object, const afw_utf8_t *property_name, const afw_utf8_t *internal, afw_xctx_t *xctx)
Set property function for data type string values.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
Definition: afw_common.h:605
struct afw_iterator_s afw_iterator_t
_Bool afw_boolean_t
Definition: afw_common.h:373
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
Definition: afw_common.h:588
afw_utf8_octet_t afw_utf8_z_t
NFC normalized UTF-8 null terminated string.
Definition: afw_common.h:523
char afw_utf8_octet_t
8 bits of utf-8 codepoint.
Definition: afw_common.h:236
afw_compile_expressions_templates_and_hybrids(const afw_object_t *object, const afw_utf8_t *source_location, afw_boolean_t recursive, const afw_compile_shared_t *shared, afw_xctx_t *xctx)
Compile object's expressions, templates, and hybrids.
Definition: afw_compile.c:411
afw_context_variable_definitions_add(const afw_object_t *variable_definitions, const afw_object_t *definitions_to_add, afw_boolean_t replace_duplicates, afw_xctx_t *xctx)
Add variable definitions.
Definition: afw_context.c:251
afw_context_qualifier_definitions_merge(const afw_object_t *qualifier_definitions, const afw_object_t *definitions_to_add, afw_boolean_t replace_duplicates, afw_xctx_t *xctx)
Merge qualifier definitions.
Definition: afw_context.c:277
afw_context_variable_definitions_add_based_on_object(const afw_object_t *variable_definitions, const afw_object_t *object, afw_xctx_t *xctx)
Add variable definitions based on object.
Definition: afw_context.c:315
afw_context_variable_definition_add_z(const afw_object_t *variable_definitions, const afw_utf8_t *variable_name, const afw_utf8_t *source, const afw_value_inf_t *value_inf, const afw_utf8_z_t *label_z, const afw_utf8_z_t *description_z, const afw_utf8_z_t *data_type_parameter_z, const afw_utf8_z_t *data_type_parameter_formatted_z, afw_xctx_t *xctx)
Add variable definition using 0 terminated label and description.
Definition: afw_context.c:190
afw_context_type_register_cb_variables(const afw_utf8_t *context_type_id, const afw_utf8_t *qualifier_id, const afw_utf8_octet_t *description_z, const afw_context_cb_variable_t *const *variables, int include_mask, afw_xctx_t *xctx)
Register context type id for array of current variable callbacks.
Definition: afw_context.c:135
afw_context_variable_definitions_compile_and_add_based_on_qualifiers_object(const afw_object_t *context_type_object, const afw_object_t *objects, const afw_utf8_t *source_location, afw_xctx_t *xctx)
Compile and add variable definitions based on AdaptiveHybridProperties object.
Definition: afw_context.c:542
afw_context_type_insure_qualifier_definitions_object_exists(const afw_object_t *context_type_object, afw_xctx_t *xctx)
Insure qualifier definitions object exists.
Definition: afw_context.c:85
afw_context_variable_definitions_compile_and_add_based_on_object(const afw_object_t *context_type_object, const afw_object_t *object, const afw_utf8_t *qualifier_id, const afw_utf8_t *source_location, afw_xctx_t *xctx)
Compile and add variable definitions based on AdaptiveHybridProperties object.
Definition: afw_context.c:513
afw_context_type_insure_variable_definitions_object_exists(const afw_object_t *context_type_object, const afw_utf8_t *qualifier_id, afw_xctx_t *xctx)
Insure variable definitions object exists for qualifier id.
Definition: afw_context.c:109
afw_context_variable_definitions_add_based_on_object_type_id(const afw_object_t *variable_definitions, const afw_utf8_t *object_type_id, afw_boolean_t include_evaluated, afw_xctx_t *xctx)
Add variable definitions based on object type id.
Definition: afw_context.c:433
afw_context_type_create(const afw_utf8_t *context_type_id, const afw_pool_t *p, afw_xctx_t *xctx)
Create a context type object.
Definition: afw_context.c:64
afw_context_push_cb_variables(const afw_utf8_t *qualifier_id, const afw_context_cb_variable_t *const *variables, void *data, const afw_pool_t *p, afw_xctx_t *xctx)
Push NULL terminated list of variable callback structs.
Definition: afw_context.c:47
void afw_environment_register_context_type(const afw_utf8_t *context_type_id, const afw_object_t *context_type_object, afw_xctx_t *xctx)
Register an context type.
const afw_data_type_t * afw_environment_get_data_type(const afw_utf8_t *type, afw_xctx_t *xctx)
Get the data_type associated with configuration entry type.
#define AFW_THROW_ERROR_FZ(code, xctx, format_z,...)
Macro used to set error and 0 rv in xctx and throw it.
Definition: afw_error.h:319
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
Definition: afw_error.h:283
void * afw_memory_dup(const void *from, apr_size_t size, const afw_pool_t *p, afw_xctx_t *xctx)
Duplicate a block of memory into specified pool.
Definition: afw_memory.h:88
#define afw_object_get_next_property(instance, iterator, property_name, xctx)
Call method get_next_property of interface afw_object.
#define afw_object_has_property(instance, property_name, xctx)
Call method has_property of interface afw_object.
#define afw_object_meta_get_object_type_id(instance, xctx)
Get object's object_type_id.
afw_object_meta_add_parent_path(const afw_object_t *instance, const afw_utf8_t *parent_path, afw_xctx_t *xctx)
Add a parent path to instance's meta.
afw_object_meta_set_object_type_id(const afw_object_t *instance, const afw_utf8_t *object_type_id, afw_xctx_t *xctx)
Set object's object type id.
afw_object_meta_set_ids(const afw_object_t *instance, const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_xctx_t *xctx)
Set object's ids.
afw_object_options_composite
Object processing options - composite only.
afw_object_view_create(const afw_object_t *instance, const afw_utf8_t *entity_path, const afw_object_options_t *options, const afw_pool_t *p, afw_xctx_t *xctx)
Create an object view of an object in specified pool.
afw_object_create_clone(const afw_object_t *object, const afw_pool_t *p, afw_xctx_t *xctx)
Clone an object to a specified pool.
Definition: afw_memory.c:138
#define afw_object_create(p, xctx)
Create an empty unmanaged object in memory.
Definition: afw_object.h:948
afw_object_set_property_as_string_from_utf8_z(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_utf8_z_t *string_z, afw_xctx_t *xctx)
Set an string property from utf8_z.
Definition: afw_object.c:194
afw_object_set_property(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_value_t *value, afw_xctx_t *xctx)
Set the value of an object's property.
Definition: afw_object.c:46
const afw_object_t * afw_object_create_embedded(const afw_object_t *embedding_object, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Create an empty embedded object in a memory object.
afw_runtime_get_object(const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_xctx_t *xctx)
Get a runtime object.
Definition: afw_runtime.c:853
afw_boolean_t afw_utf8_equal(const afw_utf8_t *s1, const afw_utf8_t *s2)
Check to see if a string equals another string.
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.
Definition: afw_utf8.c:459
#define afw_value_get_data_type(instance, xctx)
Call method get_data_type of interface afw_value.
#define afw_value_is_annotated(A_VALUE)
Macro to determine if value is an annotated.
Definition: afw_value.h:468
afw_xctx_push_qualifier(const afw_utf8_t *qualifier, const afw_object_t *qualifier_object, afw_boolean_t secure, afw_xctx_get_variable_t get, void *data, const afw_pool_t *p, afw_xctx_t *xctx)
Push qualifier on to stack.
Definition: afw_xctx.c:359
Struct passed to afw_context_type_register_cb_variables()
Definition: afw_context.h:43
Interface afw_data_type public struct.
Interface afw_object public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Struct for annotated value.
Interface afw_value_inf_s struct.
Interface afw_value public struct.
struct for data type string values.
Definition: afw_xctx.h:352
void * wa
Work area used by get/set.
Definition: afw_xctx.h:370
Interface afw_xctx public struct.