Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_function_miscellaneous.c
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * afw_function_execute_* functions for miscellaneous
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
14 #include "afw_internal.h"
15 
16 
17 
18 /*
19  * Adaptive function: annotate
20  *
21  * afw_function_execute_annotate
22  *
23  * See afw_function_bindings.h for more information.
24  *
25  * Create an annotated value.
26  *
27  * This function is pure, so it will always return the same result
28  * given exactly the same parameters and has no side effects.
29  *
30  * Declaration:
31  *
32  * ```
33  * function annotate(
34  * annotation: (object _AdaptiveAnnotation_),
35  * value: any
36  * ): any;
37  * ```
38  *
39  * Parameters:
40  *
41  * annotation - (object _AdaptiveAnnotation_) Annotation for value.
42  *
43  * value - (any dataType) Any value. This value will not be evaluated.
44  *
45  * Returns:
46  *
47  * (any dataType) Unevaluated annotated value ready for use by function
48  * evaluate().
49  */
50 const afw_value_t *
53 {
54  const afw_value_object_t *annotation;
55  const afw_value_t *result;
56 
58 
59  result = afw_value_annotated_create(NULL, x->argv[2], annotation->internal,
60  x->p, x->xctx);
61 
62  return result;
63 }
64 
65 
66 
67 /*
68  * Adaptive function: compare_uri
69  *
70  * afw_function_execute_compare_uri
71  *
72  * See afw_function_bindings.h for more information.
73  *
74  * Compare two URIs.
75  *
76  * This function is pure, so it will always return the same result
77  * given exactly the same parameters and has no side effects.
78  *
79  * Declaration:
80  *
81  * ```
82  * function compare_uri(
83  * uri1: string,
84  * uri2: string,
85  * isValuePath?: boolean,
86  * currentPath?: string
87  * ): boolean;
88  * ```
89  *
90  * Parameters:
91  *
92  * uri1 - (string) First URI for compare. This URI can not contain an
93  * asterisk ("*").
94  *
95  * uri2 - (string) Second URI for compare. This URI can contain asterisk
96  * ("*") for substitution if isValuePath is true and currentPath2 is
97  * specified.
98  *
99  * isValuePath - (optional boolean) The URIs are adaptive value paths. If one
100  * of the URIs begins with a single slash "/", both must, and each URI
101  * will be parsed as an adaptive value path (example:
102  * /adaptorId/objectType/objectId.propertyNames).
103  *
104  * currentPath - (optional string) If isValuePath is true, this is the
105  * current path that is used to resolve a relative path in the URIs. If
106  * isValuePath is not true, this parameter is ignored.
107  *
108  * Returns:
109  *
110  * (boolean) Result of comparison.
111  */
112 const afw_value_t *
115 {
116  const afw_value_string_t *uri1;
117  const afw_value_string_t *uri2;
118  const afw_value_boolean_t *isValuePath;
119  const afw_value_string_t *currentPath;
120 
123 
124  isValuePath = NULL;
127  }
128 
129  currentPath = NULL;
132  }
133 
134  return
136  &uri1->internal,
137  &uri2->internal,
138  (isValuePath) ? isValuePath->internal: false,
139  (currentPath) ? &currentPath->internal: NULL,
140  x->p, x->xctx)
142  : afw_value_false;
143 }
144 
145 
146 
147 /*
148  * Adaptive function: debug
149  *
150  * afw_function_execute_debug
151  *
152  * See afw_function_bindings.h for more information.
153  *
154  * Conditionally, based on the detail parameter, write a value as a string to
155  * the debug file descriptor (usually stderr).
156  *
157  * This function is not pure, so it may return a different result
158  * given exactly the same parameters and has side effects.
159  *
160  * Declaration:
161  *
162  * ```
163  * function debug(
164  * value: any,
165  * detail?: boolean
166  * ): null;
167  * ```
168  *
169  * Parameters:
170  *
171  * value - (any dataType) This is the value that will be converted to its
172  * string representation and written. An undefined value is represented
173  * by `<undefined>`.
174  *
175  * detail - (optional boolean) If true, the string will only written if the
176  * debug:function_active:detail flag is on. If false or not specified,
177  * the string will only written if the debug:function_active flag is on.
178  *
179  * Returns:
180  *
181  * (null)
182  */
183 const afw_value_t *
186 {
187  const afw_value_t *value;
188  const afw_value_boolean_t *detail;
189  const afw_utf8_t *s;
190  afw_size_t flag_index;
191 
192  value = afw_value_evaluate(x->argv[1], x->p, x->xctx);
193  value = afw_value_convert_to_string(value, true, x->p, x->xctx);
194  s = AFW_VALUE_INTERNAL(value);
195 
196  detail = NULL;
199  }
200 
201  flag_index = (detail && detail->internal)
204 
205  afw_debug(flag_index, NULL, s, x->xctx);
206 
207  return afw_value_null;
208 }
209 
210 
211 
212 /*
213  * Adaptive function: generate_uuid
214  *
215  * afw_function_execute_generate_uuid
216  *
217  * See afw_function_bindings.h for more information.
218  *
219  * Generate a UUID.
220  *
221  * This function is not pure, so it may return a different result
222  * given exactly the same parameters.
223  *
224  * Declaration:
225  *
226  * ```
227  * function generate_uuid(
228  *
229  * ): string;
230  * ```
231  *
232  * Parameters:
233  *
234  * Returns:
235  *
236  * (string)
237  */
238 const afw_value_t *
241 {
242  const afw_utf8_t *uuid;
243 
244  uuid = afw_uuid_create_utf8(x->p, x->xctx);
245 
246  return afw_value_create_string(uuid, x->p, x->xctx);
247 }
248 
249 
250 
251 /*
252  * Adaptive function: log
253  *
254  * afw_function_execute_log
255  *
256  * See afw_function_bindings.h for more information.
257  *
258  * Evaluate and convert value to String and log it.
259  *
260  * This function is not pure, so it may return a different result
261  * given exactly the same parameters and has side effects.
262  *
263  * Declaration:
264  *
265  * ```
266  * function log(
267  * value: any
268  * ): null;
269  * ```
270  *
271  * Parameters:
272  *
273  * value - (any dataType) Value to log.
274  *
275  * Returns:
276  *
277  * (null)
278  */
279 const afw_value_t *
282 {
284  AFW_THROW_ERROR_Z(general, "Not implemented", x->xctx);
285 }
286 
287 
288 
289 /*
290  * Adaptive function: now_local
291  *
292  * afw_function_execute_now_local
293  *
294  * See afw_function_bindings.h for more information.
295  *
296  * Return current local dateTime.
297  *
298  * This function is not pure, so it may return a different result
299  * given exactly the same parameters.
300  *
301  * Declaration:
302  *
303  * ```
304  * function now_local(
305  *
306  * ): dateTime;
307  * ```
308  *
309  * Parameters:
310  *
311  * Returns:
312  *
313  * (dateTime)
314  */
315 const afw_value_t *
318 {
320 }
321 
322 
323 
324 /*
325  * Adaptive function: now_utc
326  *
327  * afw_function_execute_now_utc
328  *
329  * See afw_function_bindings.h for more information.
330  *
331  * Return current UTC dateTime.
332  *
333  * This function is not pure, so it may return a different result
334  * given exactly the same parameters.
335  *
336  * Declaration:
337  *
338  * ```
339  * function now_utc(
340  *
341  * ): dateTime;
342  * ```
343  *
344  * Parameters:
345  *
346  * Returns:
347  *
348  * (dateTime)
349  */
350 const afw_value_t *
353 {
355 }
356 
357 
358 
359 /*
360  * Adaptive function: parse_uri
361  *
362  * afw_function_execute_parse_uri
363  *
364  * See afw_function_bindings.h for more information.
365  *
366  * Parse a URI.
367  *
368  * This function is pure, so it will always return the same result
369  * given exactly the same parameters and has no side effects.
370  *
371  * Declaration:
372  *
373  * ```
374  * function parse_uri(
375  * uri: string,
376  * isValuePath?: boolean,
377  * currentPath?: string
378  * ): (object _AdaptiveParsedURI_);
379  * ```
380  *
381  * Parameters:
382  *
383  * uri - (string) URI to parse.
384  *
385  * isValuePath - (optional boolean) The URI is an adaptive value path. If the
386  * path begins with a single slash "/", the URI will be parsed as an
387  * adaptive value path (example:
388  * /adaptorId/objectType/objectId.propertyNames).
389  *
390  * currentPath - (optional string) If isValuePath is true, this is the
391  * current path that is used to resolve relative paths. If isValuePath is
392  * not true, this parameter is ignored.
393  *
394  * Returns:
395  *
396  * (object _AdaptiveParsedURI_) Object with results of parse.
397  */
398 const afw_value_t *
401 {
402  const afw_value_string_t *uri;
403  const afw_object_t *parsed;
404  const afw_value_boolean_t *isValuePath;
405  const afw_value_string_t *currentPath;
406 
408 
409  isValuePath = NULL;
412  2, boolean);
413  }
414 
415  currentPath = NULL;
418  3, string);
419  }
420 
421  parsed = afw_uri_to_object(
422  &uri->internal,
423  (isValuePath) ? isValuePath->internal : false,
424  (currentPath) ? &currentPath->internal : NULL,
425  x->p, x->xctx);
426 
427  return afw_value_create_object(parsed, x->p, x->xctx);
428 }
429 
430 
431 
432 /*
433  * Adaptive function: perform
434  *
435  * afw_function_execute_perform
436  *
437  * See afw_function_bindings.h for more information.
438  *
439  * Perform actions right away.
440  *
441  * This function is not pure, so it may return a different result
442  * given exactly the same parameters.
443  *
444  * Declaration:
445  *
446  * ```
447  * function perform(
448  * request: (object _AdaptiveActions_)
449  * ): (object _AdaptiveResponse_);
450  * ```
451  *
452  * Parameters:
453  *
454  * request - (object _AdaptiveActions_) See
455  * /afw/_AdaptiveObjectType_/_AdaptiveActions_ for more information.
456  *
457  * Returns:
458  *
459  * (object _AdaptiveResponse_) Response object.
460  */
461 const afw_value_t *
464 {
465  const afw_object_t *response;
466  const afw_value_object_t *request;
467 
469 
470  response = afw_action_perform(request->internal, NULL, NULL,
471  x->p, x->xctx);
472  return afw_value_create_object(response, x->p, x->xctx);
473 }
474 
475 
476 
477 /*
478  * Adaptive function: execution_start_time_local
479  *
480  * afw_function_execute_execution_start_time_local
481  *
482  * See afw_function_bindings.h for more information.
483  *
484  * Return local dateTime when the execution context was created. This will
485  * usually be the start of request time.
486  *
487  * This function is not pure, so it may return a different result
488  * given exactly the same parameters.
489  *
490  * Declaration:
491  *
492  * ```
493  * function execution_start_time_local(
494  *
495  * ): dateTime;
496  * ```
497  *
498  * Parameters:
499  *
500  * Returns:
501  *
502  * (dateTime)
503  */
504 const afw_value_t *
507 {
509  &x->xctx->local_dateTime_when_created, x->p, x->xctx);
510 }
511 
512 
513 
514 /*
515  * Adaptive function: execution_start_time_utc
516  *
517  * afw_function_execute_execution_start_time_utc
518  *
519  * See afw_function_bindings.h for more information.
520  *
521  * Return UTC dateTime when the execution context was created. This will
522  * usually be the start of request time.
523  *
524  * This function is not pure, so it may return a different result
525  * given exactly the same parameters.
526  *
527  * Declaration:
528  *
529  * ```
530  * function execution_start_time_utc(
531  *
532  * ): dateTime;
533  * ```
534  *
535  * Parameters:
536  *
537  * Returns:
538  *
539  * (dateTime)
540  */
541 const afw_value_t *
544 {
546  &x->xctx->utc_dateTime_when_created, x->p, x->xctx);
547 }
548 
549 
550 
551 /*
552  * Adaptive function: trace
553  *
554  * afw_function_execute_trace
555  *
556  * See afw_function_bindings.h for more information.
557  *
558  * Write a value to a trace log.
559  *
560  * This function is not pure, so it may return a different result
561  * given exactly the same parameters and has side effects.
562  *
563  * Declaration:
564  *
565  * ```
566  * function trace(
567  * value: any,
568  * filter?: boolean,
569  * number?: integer
570  * ): null;
571  * ```
572  *
573  * Parameters:
574  *
575  * value - (any dataType) This is the value that will be converted to its
576  * string representation and written the trace log. An undefined value is
577  * represented by `<undefined>`.
578  *
579  * filter - (optional boolean) If this optional filter is false, nothing will
580  * be written to the trace log. The default is true.
581  *
582  * number - (optional integer) This is an optional number between 1 and 8
583  * that is appended to "trace" to identify the trace log. The default is
584  * 1.
585  *
586  * Returns:
587  *
588  * (null)
589  */
590 const afw_value_t *
593 {
594  const afw_value_t *value;
595  const afw_value_boolean_t *filter;
596  const afw_value_integer_t *number;
597  const afw_utf8_t *s;
598  afw_log_priority_t priority;
599 
600  /* If parameter 2 is present and false, skip writing value. */
603  if (!filter->internal) {
604  return afw_value_null;
605  }
606  }
607 
608  /* Determine log priority. */
609  priority = afw_log_priority_trace1;
612  if (number->internal < 1 || number->internal > 8) {
613  AFW_THROW_ERROR_Z(general,
614  "Parameter 3 must be an integer between 1 and 8.", x->xctx);
615  }
616  priority = (afw_log_priority_t)
617  (number->internal - 1 + afw_log_priority_trace1);
618  }
619 
620  /* Get value as a string. */
621  value = afw_value_evaluate(x->argv[1], x->p, x->xctx);
622  if (!afw_value_is_string(value)) {
623  value = afw_value_convert_to_string(value, true, x->p, x->xctx);
624  }
625  s = AFW_VALUE_INTERNAL(value);
626 
627  /* Write string to trace log. */
628  afw_trace_write(priority, NULL, AFW__FILE_LINE__, s, x->xctx);
629 
630  /* Return null. */
631  return afw_value_null;
632 }
633 
634 
635 
636 /*
637  * Adaptive function: variable_exists
638  *
639  * afw_function_execute_variable_exists
640  *
641  * See afw_function_bindings.h for more information.
642  *
643  * Return the true if the named variable exists.
644  *
645  * This function is not pure, so it may return a different result
646  * given exactly the same parameters.
647  *
648  * Declaration:
649  *
650  * ```
651  * function variable_exists(
652  * name: string
653  * ): boolean;
654  * ```
655  *
656  * Parameters:
657  *
658  * name - (string) Name of variable to check. The name can optionally be
659  * preceded with a qualifier followed by "::".
660  *
661  * Returns:
662  *
663  * (boolean) True if variable exists.
664  */
665 const afw_value_t *
668 {
669  const afw_value_string_t *qualified_name;
670  afw_utf8_t qualifier;
671  afw_utf8_t name;
672  const afw_value_t *value;
673 
674  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(qualified_name, 1, string);
675 
676  afw_compile_split_qualified_name(&qualified_name->internal,
677  &qualifier, &name, x->xctx);
678 
679  value = afw_xctx_get_qualified_variable(&qualifier, &name, x->xctx);
680 
681  return (value) ? afw_value_true : afw_value_false;
682 }
683 
684 
685 
686 /*
687  * Adaptive function: variable_get
688  *
689  * afw_function_execute_variable_get
690  *
691  * See afw_function_bindings.h for more information.
692  *
693  * Return the value of a variable. If variable is not available, return a
694  * default or null value.
695  *
696  * This function is not pure, so it may return a different result
697  * given exactly the same parameters.
698  *
699  * Declaration:
700  *
701  * ```
702  * function variable_get(
703  * name: string,
704  * defaultValue?: any
705  * ): any;
706  * ```
707  *
708  * Parameters:
709  *
710  * name - (string) Name of variable to get. The name can optionally be
711  * preceded with a qualifier followed by "::".
712  *
713  * defaultValue - (optional any dataType) The default value of variable if it
714  * does not exist in object. If not specified, null value is the default.
715  *
716  * Returns:
717  *
718  * (any dataType) Evaluated variable value or default.
719  */
720 const afw_value_t *
723 {
724  const afw_value_string_t *qualified_name;
725  afw_utf8_t qualifier;
726  afw_utf8_t name;
727  const afw_value_t *value;
728 
729  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(qualified_name, 1, string);
730 
731  afw_compile_split_qualified_name(&qualified_name->internal,
732  &qualifier, &name, x->xctx);
733 
734  value = afw_xctx_get_qualified_variable(&qualifier, &name, x->xctx);
735 
736  if (!value) {
737  value = afw_value_null;
739  value = afw_value_evaluate(x->argv[2], x->p, x->xctx);
740  }
741  }
742 
743  return value;
744 }
745 
746 
747 
748 /*
749  * Adaptive function: variable_is_not_null
750  *
751  * afw_function_execute_variable_is_not_null
752  *
753  * See afw_function_bindings.h for more information.
754  *
755  * Return the true if the named variable exists and is not null.
756  *
757  * This function is not pure, so it may return a different result
758  * given exactly the same parameters.
759  *
760  * Declaration:
761  *
762  * ```
763  * function variable_is_not_null(
764  * name: string
765  * ): boolean;
766  * ```
767  *
768  * Parameters:
769  *
770  * name - (string) Name of variable to check. The name can optionally be
771  * preceded with a qualifier followed by "::".
772  *
773  * Returns:
774  *
775  * (boolean) True if variable exists and is not null.
776  */
777 const afw_value_t *
780 {
781  const afw_value_string_t *qualified_name;
782  afw_utf8_t qualifier;
783  afw_utf8_t name;
784  const afw_value_t *value;
785 
786  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(qualified_name, 1, string);
787 
788  afw_compile_split_qualified_name(&qualified_name->internal,
789  &qualifier, &name, x->xctx);
790 
791  value = afw_xctx_get_qualified_variable(&qualifier, &name, x->xctx);
792 
793  return (value && !afw_value_is_null(value))
795  : afw_value_false;
796 }
797 
798 
799 
800 /*
801  * Adaptive function: is_nullish
802  *
803  * afw_function_execute_is_nullish
804  *
805  * See afw_function_bindings.h for more information.
806  *
807  * Test value returning boolean True if it is null or undefined.
808  *
809  * This function is pure, so it will always return the same result
810  * given exactly the same parameters and has no side effects.
811  *
812  * Declaration:
813  *
814  * ```
815  * function is_nullish(
816  * value: any
817  * ): boolean;
818  * ```
819  *
820  * Parameters:
821  *
822  * value - (any dataType) Value to check.
823  *
824  * Returns:
825  *
826  * (boolean) True if value is null or undefined.
827  */
828 const afw_value_t *
831 {
832  const afw_value_t *value;
833 
835 
837 }
838 
839 
840 
841 /*
842  * Adaptive function: is_defined
843  *
844  * afw_function_execute_is_defined
845  *
846  * See afw_function_bindings.h for more information.
847  *
848  * Test value returning boolean True if it is not undefined.
849  *
850  * This function is pure, so it will always return the same result
851  * given exactly the same parameters and has no side effects.
852  *
853  * Declaration:
854  *
855  * ```
856  * function is_defined(
857  * value: any
858  * ): boolean;
859  * ```
860  *
861  * Parameters:
862  *
863  * value - (any dataType) Value to check.
864  *
865  * Returns:
866  *
867  * (boolean) True if value is not undefined.
868  */
869 const afw_value_t *
872 {
873  const afw_value_t *value;
874 
876 
877  return value ? afw_value_true : afw_value_false;
878 }
879 
880 
881 
882 /*
883  * Adaptive function: nullish_coalescing
884  *
885  * afw_function_execute_nullish_coalescing
886  *
887  * See afw_function_bindings.h for more information.
888  *
889  * Returns the first value of values that is not null or undefined leaving the
890  * remaining values unevaluated.
891  *
892  * This function is pure, so it will always return the same result
893  * given exactly the same parameters and has no side effects.
894  *
895  * Declaration:
896  *
897  * ```
898  * function nullish_coalescing(
899  * values_1: any,
900  * values_2: any,
901  * ...values_rest: (list of any)
902  * ): any;
903  * ```
904  *
905  * Parameters:
906  *
907  * values - (2 or more any dataType)
908  *
909  * Returns:
910  *
911  * (any dataType) The first value of values that is not null or undefined.
912  */
913 const afw_value_t *
916 {
917  const afw_value_t *arg;
918  afw_size_t i;
919 
920  arg = NULL;
921  for (i = 1; i <= x->argc; i++) {
923  if (!afw_value_is_nullish(arg)) {
924  return arg;
925  }
926  }
927 
928  return arg;
929 }
930 
931 
932 /*
933  * Adaptive function: optional_chaining
934  *
935  * afw_function_execute_optional_chaining
936  *
937  * See afw_function_bindings.h for more information.
938  *
939  * Returns undefined if arg1 is null or undefined without evaluating arg2, but
940  * otherwise returns evaluated value of arg2.
941  *
942  * This function is pure, so it will always return the same result
943  * given exactly the same parameters and has no side effects.
944  *
945  * Declaration:
946  *
947  * ```
948  * function optional_chaining(
949  * arg1: any,
950  * arg2: any
951  * ): any;
952  * ```
953  *
954  * Parameters:
955  *
956  * arg1 - (any dataType)
957  *
958  * arg2 - (any dataType)
959  *
960  * Returns:
961  *
962  * (any dataType) Undefined value if arg1 is null or undefined but otherwise
963  * evaluated arg2.
964  */
965 const afw_value_t *
968 {
969  const afw_value_t *arg1;
970  const afw_value_t *arg2;
971 
973  if (afw_value_is_nullish(arg1)) {
974  return NULL;
975  }
976 
978  return arg2;
979 }
Adaptive Framework Core Internal.
afw_action_perform(const afw_object_t *request, const afw_content_type_t *response_content_type, const afw_object_t *response, const afw_pool_t *p, afw_xctx_t *xctx)
Perform actions(s) specified in AdaptiveActions object.
Definition: afw_action.c:228
afw_value_create_dateTime(const afw_dateTime_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type dateTime value.
#define afw_value_is_null(A_VALUE)
Macro to determine if value is evaluated null.
afw_value_create_object(const afw_object_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type object value.
afw_value_create_string(const afw_utf8_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type string value.
#define afw_value_is_string(A_VALUE)
Macro to determine if value is evaluated string.
apr_size_t afw_size_t
size_t.
Definition: afw_common.h:151
enum afw_log_priority_e afw_log_priority_t
Log levels. See afw_log.h for more information.
#define AFW__FILE_LINE__
file:line
Definition: afw_common.h:148
@ afw_log_priority_trace1
Definition: afw_common.h:994
afw_compile_split_qualified_name(const afw_utf8_t *qualified_name, afw_utf8_t *qualifier, afw_utf8_t *name, afw_xctx_t *xctx)
Split name with optional qualifier.
Definition: afw_compile.c:548
#define afw_debug(flag_index, instance, message, xctx)
If applicable, write debug.
Definition: afw_debug.h:59
#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
#define AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(A_RESULT, A_N, A_TYPE)
Evaluate an arg for a particular data type.
Definition: afw_function.h:328
#define AFW_FUNCTION_PARAMETER_IS_PRESENT(A_N)
Determine if a specific parameter value is present.
Definition: afw_function.h:242
#define AFW_FUNCTION_EVALUATE_PARAMETER(A_RESULT, A_N)
Evaluate a parameter.
Definition: afw_function.h:279
const afw_value_t * afw_function_execute_generate_uuid(afw_function_execute_t *x)
Adaptive Function generate_uuid
const afw_value_t * afw_function_execute_now_local(afw_function_execute_t *x)
Adaptive Function now_local
const afw_value_t * afw_function_execute_now_utc(afw_function_execute_t *x)
Adaptive Function now_utc
const afw_value_t * afw_function_execute_variable_get(afw_function_execute_t *x)
Adaptive Function variable_get
const afw_value_t * afw_function_execute_is_nullish(afw_function_execute_t *x)
Adaptive Function is_nullish
const afw_value_t * afw_function_execute_variable_exists(afw_function_execute_t *x)
Adaptive Function variable_exists
const afw_value_t * afw_function_execute_nullish_coalescing(afw_function_execute_t *x)
Adaptive Function nullish_coalescing
const afw_value_t * afw_function_execute_trace(afw_function_execute_t *x)
Adaptive Function trace
const afw_value_t * afw_function_execute_perform(afw_function_execute_t *x)
Adaptive Function perform
const afw_value_t * afw_function_execute_compare_uri(afw_function_execute_t *x)
Adaptive Function compare_uri
const afw_value_t * afw_function_execute_log(afw_function_execute_t *x)
Adaptive Function log
const afw_value_t * afw_function_execute_debug(afw_function_execute_t *x)
Adaptive Function debug
const afw_value_t * afw_function_execute_is_defined(afw_function_execute_t *x)
Adaptive Function is_defined
const afw_value_t * afw_function_execute_optional_chaining(afw_function_execute_t *x)
Adaptive Function optional_chaining
const afw_value_t * afw_function_execute_execution_start_time_local(afw_function_execute_t *x)
Adaptive Function execution_start_time_local
const afw_value_t * afw_function_execute_annotate(afw_function_execute_t *x)
Adaptive Function annotate
const afw_value_t * afw_function_execute_execution_start_time_utc(afw_function_execute_t *x)
Adaptive Function execution_start_time_utc
const afw_value_t * afw_function_execute_variable_is_not_null(afw_function_execute_t *x)
Adaptive Function variable_is_not_null
const afw_value_t * afw_function_execute_parse_uri(afw_function_execute_t *x)
Adaptive Function parse_uri
afw_trace_write(afw_log_priority_t priority, const afw_interface_implementation_rti_t *rti, const afw_utf8_z_t *source_z, const afw_utf8_t *message, afw_xctx_t *xctx)
Write trace.
Definition: afw_trace.c:21
afw_uri_to_object(const afw_utf8_t *uri, afw_boolean_t is_value_path, const afw_utf8_t *current_path, const afw_pool_t *p, afw_xctx_t *xctx)
Turn a URI into an object representation.
Definition: afw_uri.c:2039
afw_uri_are_equivalent(const afw_utf8_t *uri1, const afw_utf8_t *uri2, afw_boolean_t is_value_path, const afw_utf8_t *current_path2, const afw_pool_t *p, afw_xctx_t *xctx)
Determine if two URIs are equivalent.
Definition: afw_uri.c:2143
afw_uuid_create_utf8(const afw_pool_t *p, afw_xctx_t *xctx)
Create a UUID as a standard format UUID utf-8 string.
Definition: afw_uuid.c:62
afw_value_convert_to_string(const afw_value_t *value, afw_boolean_t allow_undefined, const afw_pool_t *p, afw_xctx_t *xctx)
Convert a value to a string value.
Definition: afw_value.c:688
#define afw_value_evaluate(value, p, xctx)
Evaluate value if needed using specific pool.
Definition: afw_value.h:841
const afw_value_t * afw_value_annotated_create(const afw_compile_value_contextual_t *contextual, const afw_value_t *value, const afw_object_t *annotation, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for annotated value.
afw_value_false
Adaptive value false.
Definition: afw_value.h:354
#define afw_value_is_nullish(A_VALUE)
Determine if value is undefined or null.
Definition: afw_value.h:422
afw_value_create_dateTime_now_local(const afw_pool_t *p, afw_xctx_t *xctx)
Create a dateTime value with current local time.
Definition: afw_value.c:749
afw_value_create_dateTime_now_utc(const afw_pool_t *p, afw_xctx_t *xctx)
Create a dateTime value with current time.
Definition: afw_value.c:736
#define AFW_VALUE_INTERNAL(_VALUE_)
Macro to get const void * of the internal of a value.
Definition: afw_value.h:856
afw_value_null
Adaptive value null.
Definition: afw_value.h:320
afw_value_true
Adaptive value true.
Definition: afw_value.h:348
afw_xctx_get_qualified_variable(const afw_utf8_t *qualifier, const afw_utf8_t *name, afw_xctx_t *xctx)
Get a variable from xctx stack.
Definition: afw_xctx.c:176
afw_size_t flag_index_debug_function_active_detail
Flag index of debug:function_active:detail.
Definition: afw_common.h:1534
afw_size_t flag_index_debug_function_active
Flag index of debug:function_active.
Definition: afw_common.h:1531
Function execute parameter.
Definition: afw_function.h:53
const afw_value_t *const * argv
This is the function parameters.
Definition: afw_function.h:86
afw_xctx_t * xctx
The execution context (xctx) of caller.
Definition: afw_function.h:62
const afw_pool_t * p
Pool for result.
Definition: afw_function.h:59
afw_size_t argc
This is the argv count not counting argv[0].
Definition: afw_function.h:89
Interface afw_object public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
struct for data type boolean values.
struct for data type integer values.
struct for data type object values.
Interface afw_value public struct.
struct for data type string values.