Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_function_administrative.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 administrative
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
14 #include "afw_internal.h"
15 
16 
17 
18 /*
19  * Adaptive function: flag_get_active
20  *
21  * afw_function_execute_flag_get_active
22  *
23  * See afw_function_bindings.h for more information.
24  *
25  * Get a list of of the flagId of flags that are set in the current execution
26  * context (xctx).
27  *
28  * This function is not pure, so it may return a different result
29  * given exactly the same parameters.
30  *
31  * Declaration:
32  *
33  * ```
34  * function flag_get_active(
35  *
36  * ): (list string);
37  * ```
38  *
39  * Parameters:
40  *
41  * Returns:
42  *
43  * (list string) This is a list of the flagId of flags that are set in the
44  * current execution context (xctx).
45  */
46 const afw_value_t *
49 {
50  afw_size_t i, count;
51  const afw_list_t *list;
52 
54  x->p, x->xctx);
55 
56  for (i = 0, count = x->xctx->flags_count;
57  i < count && x->xctx->env->flag_by_index[i];
58  i++)
59  {
60  if (x->xctx->flags[i]) {
62  x->xctx->env->flag_by_index[i]->flag_id, x->xctx);
63  }
64  }
65 
66  return afw_value_create_list(list, x->p, x->xctx);
67 }
68 
69 
70 
71 /*
72  * Adaptive function: flag_get_active_defaults
73  *
74  * afw_function_execute_flag_get_active_defaults
75  *
76  * See afw_function_bindings.h for more information.
77  *
78  * Get a list of the flagId of flags that are set by default when a new
79  * execution context (xctx) is created.
80  *
81  * This function is not pure, so it may return a different result
82  * given exactly the same parameters.
83  *
84  * Declaration:
85  *
86  * ```
87  * function flag_get_active_defaults(
88  *
89  * ): (list string);
90  * ```
91  *
92  * Parameters:
93  *
94  * Returns:
95  *
96  * (list string) This is a list of the flagId of flags that are set by
97  * default when a new execution context (xctx) is created.
98  */
99 const afw_value_t *
102 {
103  afw_size_t i, count;
104  const afw_list_t *list;
105 
107  x->p, x->xctx);
108 
109  for (i = 0, count = x->xctx->env->flags_count_registered;
110  i < count;
111  i++)
112  {
113  if (x->xctx->env->default_flags[i]) {
115  x->xctx->env->flag_by_index[i]->flag_id, x->xctx);
116  }
117  }
118 
119  return afw_value_create_list(list, x->p, x->xctx);
120 }
121 
122 
123 
124 /*
125  * Adaptive function: flag_get_defaults
126  *
127  * afw_function_execute_flag_get_defaults
128  *
129  * See afw_function_bindings.h for more information.
130  *
131  * Get the list of the flagId of flags that are used to determine the default
132  * active flags when an execution context (xctx) is created. This list can
133  * contain the flagId of flags that have not yet been registered. Each of these
134  * flags and the flags they include are set as the active default flags.
135  *
136  * This function is not pure, so it may return a different result
137  * given exactly the same parameters.
138  *
139  * Declaration:
140  *
141  * ```
142  * function flag_get_defaults(
143  *
144  * ): (list string);
145  * ```
146  *
147  * Parameters:
148  *
149  * Returns:
150  *
151  * (list string) This is a list of the flagId of flags used to determine the
152  * default active flags.
153  */
154 const afw_value_t *
157 {
158  const afw_environment_internal_t *env_internal =
159  (const afw_environment_internal_t *)x->xctx->env;
160  const afw_list_t *list;
161  const afw_utf8_t * const *flag_id;
162  const afw_utf8_t *s;
163  afw_xctx_t *xctx = x->xctx;
164 
166  x->p, x->xctx);
167 
168  AFW_LOCK_BEGIN(xctx->env->flags_lock) {
169  if (env_internal->default_flag_ids) {
170  for (flag_id = env_internal->default_flag_ids; *flag_id; flag_id++)
171  {
172  s = afw_utf8_clone(*flag_id, x->p, x->xctx);
174  }
175  }
176 
177  }
178  AFW_LOCK_END;
179 
180  return afw_value_create_list(list, x->p, x->xctx);
181 }
182 
183 
184 
185 /*
186  * Adaptive function: flag_modify_defaults
187  *
188  * afw_function_execute_flag_modify_defaults
189  *
190  * See afw_function_bindings.h for more information.
191  *
192  * Add or remove flags from the list of the flagId of flags that are used to
193  * determine the default active flags when an execution context (xctx) is
194  * created. This list can contain the flagId of flags that have not yet been
195  * registered. These flags and the flags they include are set as the active
196  * default flags.
197  *
198  * This change only lasts for the life of the current adaptive environment
199  * (e.g. until the adaptive server or afw command ends). If you want the change
200  * to persist, change the defaultFlags property in the application config.
201  *
202  * This function is not pure, so it may return a different result
203  * given exactly the same parameters.
204  *
205  * Declaration:
206  *
207  * ```
208  * function flag_modify_defaults(
209  * flagId: (list string),
210  * add?: boolean
211  * ): null;
212  * ```
213  *
214  * Parameters:
215  *
216  * flagId - (list string) The flagId of flags to be added or removed.
217  *
218  * add - (optional boolean) Specify true to add and false to remove flags. If
219  * not specified, flags are added.
220  *
221  * Returns:
222  *
223  * (null)
224  */
225 const afw_value_t *
228 {
229  const afw_value_list_t *list_value;
230  const afw_value_boolean_t *set_to_value;
231  const afw_data_type_t *data_type;
232  const afw_iterator_t *iterator;
233  const afw_utf8_t *flag_id;
234  const void *internal;
235  afw_boolean_t add;
236 
238 
239  add = true;
242  2, boolean);
243  add = set_to_value->internal;
244  }
245 
246  for (iterator = NULL;;)
247  {
249  list_value->internal,
250  &iterator,
251  &data_type,
252  &internal,
253  x->xctx);
254 
255  if (!internal) break;
256 
257  if (afw_data_type_is_string(data_type)) {
258  flag_id = (const afw_utf8_t *)internal;
259  }
260  else {
261  flag_id = afw_data_type_internal_to_utf8(data_type,
262  internal, x->p, x->xctx);
263  }
264 
265  afw_flag_set_default(flag_id, add, x->xctx);
266  }
267 
268  return afw_value_null;
269 }
270 
271 
272 
273 /*
274  * Adaptive function: flag_replace_defaults
275  *
276  * afw_function_execute_flag_replace_defaults
277  *
278  * See afw_function_bindings.h for more information.
279  *
280  * Completely replace the list of the flagId of flags that are used to
281  * determine the default active flags when an execution context (xctx) is
282  * created. This list can contain the flagId of flags that have not yet been
283  * registered. These flags and the flags they include are set as the active
284  * default flags.
285  *
286  * This change only lasts for the life of the current adaptive environment
287  * (e.g. until the adaptive server or afw command ends). If you want the change
288  * to persist, change the defaultFlags property in the application config.
289  *
290  * This function is not pure, so it may return a different result
291  * given exactly the same parameters.
292  *
293  * Declaration:
294  *
295  * ```
296  * function flag_replace_defaults(
297  * flagId: (list string)
298  * ): null;
299  * ```
300  *
301  * Parameters:
302  *
303  * flagId - (list string) The list of the flagId of flags used to determine
304  * the default active flags.
305  *
306  * Returns:
307  *
308  * (null)
309  */
310 const afw_value_t *
313 {
314  const afw_value_list_t *list_value;
315 
317 
318  afw_flag_set_default_flag_ids(list_value->internal, x->xctx);
319 
320  return afw_value_null;
321 }
322 
323 
324 
325 /*
326  * Adaptive function: flag_set
327  *
328  * afw_function_execute_flag_set
329  *
330  * See afw_function_bindings.h for more information.
331  *
332  * Set or unset one or more active xctx (request) flags.
333  *
334  * This function is not pure, so it may return a different result
335  * given exactly the same parameters.
336  *
337  * Declaration:
338  *
339  * ```
340  * function flag_set(
341  * flagId: (list string),
342  * setTo?: boolean
343  * ): null;
344  * ```
345  *
346  * Parameters:
347  *
348  * flagId - (list string) List of flagId of flags to set or unset.
349  *
350  * setTo - (optional boolean) Specify true to set and false to unset. If not
351  * specified, flags are set.
352  *
353  * Returns:
354  *
355  * (null)
356  */
357 const afw_value_t *
360 {
361  const afw_value_list_t *list_value;
362  const afw_value_boolean_t *set_to_value;
363  const afw_data_type_t *data_type;
364  const afw_iterator_t *iterator;
365  const afw_utf8_t *flag_id;
366  const void *internal;
367  afw_boolean_t set_to;
368 
370 
371  set_to = true;
374  2, boolean);
375  set_to = set_to_value->internal;
376  }
377 
378  for (iterator = NULL;;)
379  {
381  list_value->internal,
382  &iterator,
383  &data_type,
384  &internal,
385  x->xctx);
386 
387  if (!internal) break;
388 
389  if (afw_data_type_is_string(data_type)) {
390  flag_id = (const afw_utf8_t *)internal;
391  }
392  else {
393  flag_id = afw_data_type_internal_to_utf8(data_type,
394  internal, x->p, x->xctx);
395  }
396 
397  afw_flag_set(flag_id, set_to, x->xctx);
398  }
399 
400  return afw_value_null;
401 }
402 
403 
404 
405 /*
406  * Adaptive function: extension_load
407  *
408  * afw_function_execute_extension_load
409  *
410  * See afw_function_bindings.h for more information.
411  *
412  * Load an extension by its extension id if it is not already loaded. Loading
413  * an AFW package's manifest extension will register the manifest of all
414  * extensions in the package.
415  *
416  * This function is not pure, so it may return a different result
417  * given exactly the same parameters and has side effects.
418  *
419  * Declaration:
420  *
421  * ```
422  * function extension_load(
423  * extension_id: string
424  * ): boolean;
425  * ```
426  *
427  * Parameters:
428  *
429  * extension_id - (string) This is the object id of a
430  * /afw/_AdaptiveManifest_/ object.
431  *
432  * Returns:
433  *
434  * (boolean) If false the extension was already loaded. If true, the
435  * extension was successfully loaded which might have caused side effects
436  * such as environment registry changes. An error is thrown if there is a
437  * problem.
438  */
439 const afw_value_t *
442 {
443  const afw_value_string_t *extension_id;
444 
446 
447  /* If extension already loaded, return false. */
449  afw_environemnt_registry_type_extension,
450  &extension_id->internal, x->xctx))
451  {
452  return afw_value_false;
453  }
454 
455  /* Load extension and return true. */
457  &extension_id->internal, NULL, NULL, x->xctx);
458 
459  return afw_value_true;
460 }
461 
462 
463 
464 /*
465  * Adaptive function: extension_load_by_module_path
466  *
467  * afw_function_execute_extension_load_by_module_path
468  *
469  * See afw_function_bindings.h for more information.
470  *
471  * Load an extension by its module path. Loading an AFW package's manifest
472  * extension will register the manifest of all extensions in the package.
473  *
474  * This function is not pure, so it may return a different result
475  * given exactly the same parameters and has side effects.
476  *
477  * Declaration:
478  *
479  * ```
480  * function extension_load_by_module_path(
481  * module_path: string
482  * ): string;
483  * ```
484  *
485  * Parameters:
486  *
487  * module_path - (string) This is the path to the dso containing the
488  * extension. If the extension is installed in the normal place, the
489  * library name without a file extension (.so) will suffice.
490  *
491  * Returns:
492  *
493  * (string) The extension id of the extension loaded.
494  */
495 const afw_value_t *
498 {
499  const afw_value_string_t *module_path;
500  const afw_utf8_t *extension_id;
501  const afw_extension_t *extension;
502 
503  AFW_FUNCTION_EVALUATE_DATA_TYPE_PARAMETER(module_path, 1, string);
504 
505  /* Load extension and return true. */
506  extension = afw_environment_load_extension(
507  NULL, &module_path->internal, NULL, x->xctx);
508  extension_id = (extension)
509  ? &extension->extension_id
510  : &afw_s_undefined;
511 
512  return afw_value_create_string(extension_id, x->p, x->xctx);
513 }
514 
515 
516 
517 /*
518  * Adaptive function: registry_key_check
519  *
520  * afw_function_execute_registry_key_check
521  *
522  * See afw_function_bindings.h for more information.
523  *
524  * This will check to see if a registry key exists for a specified registry
525  * type and optionally load it's associated extension if needed.
526  *
527  * This function is not pure, so it may return a different result
528  * given exactly the same parameters and has side effects.
529  *
530  * Declaration:
531  *
532  * ```
533  * function registry_key_check(
534  * registryType: string,
535  * key: string,
536  * loadExtension?: boolean
537  * ): boolean;
538  * ```
539  *
540  * Parameters:
541  *
542  * registryType - (string) This is the registry type, which is the object id
543  * of a /afw/_AdaptiveEnvironmentRegistryType_/ object.
544  *
545  * key - (string) This is a key to check for existence in the specified
546  * registryType.
547  *
548  * loadExtension - (optional boolean) Specifying true for this optional
549  * parameter will cause the associated extension to be loaded if needed.
550  *
551  * Returns:
552  *
553  * (boolean) If false the extension was already loaded. If true, the
554  * extension was successfully loaded which might have caused side effects
555  * such as environment registry changes. An error is thrown if there is a
556  * problem.
557  */
558 const afw_value_t *
561 {
562  const afw_value_string_t *registry_type_value;
563  const afw_value_string_t *key_value;
564  const afw_value_boolean_t *load_extension_value;
565  const afw_environment_registry_type_t *registry_type;
566  afw_boolean_t load_extension;
567  const afw_value_t *result;
568 
570  1, string);
572 
573  load_extension = false;
576  3, boolean);
577  load_extension = load_extension_value->internal;
578  }
579 
581  &registry_type_value->internal, load_extension, x->xctx);
582 
583  if (!registry_type) {
584  result = afw_value_false;
585  }
586 
587  else if (load_extension) {
588  result =
590  registry_type->number, &key_value->internal, x->xctx))
592  : afw_value_false;
593  }
594  else {
596  registry_type->number, &key_value->internal, x->xctx))
598  : afw_value_false;
599  }
600 
601  return result;
602 }
603 
604 
605 
606 /*
607  * Adaptive function: service_get
608  *
609  * afw_function_execute_service_get
610  *
611  * See afw_function_bindings.h for more information.
612  *
613  * Get a service object.
614  *
615  * This function is not pure, so it may return a different result
616  * given exactly the same parameters.
617  *
618  * Declaration:
619  *
620  * ```
621  * function service_get(
622  * serviceId: string
623  * ): (object _AdaptiveService_);
624  * ```
625  *
626  * Parameters:
627  *
628  * serviceId - (string) The serviceId of the service.
629  *
630  * Returns:
631  *
632  * (object _AdaptiveService_) _AdaptiveService_ object for the service which
633  * will contain the current status of the service. If there is an error,
634  * the status property value will be "error" and "statusMessage" contain
635  * an error message.
636  */
637 const afw_value_t *
640 {
641  const afw_value_string_t *service_id;
642  const afw_object_t *obj;
643 
645 
646  obj = afw_service_get_object(&service_id->internal, x->p, x->xctx);
647 
648  if (!obj) {
649  AFW_THROW_ERROR_Z(not_found, "Not found", x->xctx);
650  }
651 
652  return afw_value_create_object(obj, x->p, x->xctx);
653 }
654 
655 
656 
657 /*
658  * Adaptive function: service_restart
659  *
660  * afw_function_execute_service_restart
661  *
662  * See afw_function_bindings.h for more information.
663  *
664  * Restart a service.
665  *
666  * This function is not pure, so it may return a different result
667  * given exactly the same parameters and has side effects.
668  *
669  * Declaration:
670  *
671  * ```
672  * function service_restart(
673  * serviceId: string
674  * ): (object _AdaptiveService_);
675  * ```
676  *
677  * Parameters:
678  *
679  * serviceId - (string) The serviceId of the service to restart.
680  *
681  * Returns:
682  *
683  * (object _AdaptiveService_) _AdaptiveService_ object for the service which
684  * will contain the current status of the service. If there is an error,
685  * the status property value will be "error" and "statusMessage" contain
686  * an error message.
687  */
688 const afw_value_t *
691 {
692  const afw_value_string_t *service_id;
693  const afw_object_t *obj;
694 
696 
697  afw_service_restart(&service_id->internal, x->xctx);
698 
699  obj = afw_service_get_object(&service_id->internal, x->p, x->xctx);
700 
701  if (!obj) {
702  AFW_THROW_ERROR_Z(not_found, "Not found", x->xctx);
703  }
704 
705  return afw_value_create_object(obj, x->p, x->xctx);
706 }
707 
708 
709 
710 /*
711  * Adaptive function: service_start
712  *
713  * afw_function_execute_service_start
714  *
715  * See afw_function_bindings.h for more information.
716  *
717  * Start a service.
718  *
719  * This function is not pure, so it may return a different result
720  * given exactly the same parameters and has side effects.
721  *
722  * Declaration:
723  *
724  * ```
725  * function service_start(
726  * serviceId: string
727  * ): (object _AdaptiveService_);
728  * ```
729  *
730  * Parameters:
731  *
732  * serviceId - (string) The serviceId of the service to start.
733  *
734  * Returns:
735  *
736  * (object _AdaptiveService_) _AdaptiveService_ object for the service which
737  * will contain the current status of the service. If there is an error,
738  * the status property value will be "error" and "statusMessage" contain
739  * an error message.
740  */
741 const afw_value_t *
744 {
745  const afw_value_string_t *service_id;
746  const afw_object_t *obj;
747 
749 
750  afw_service_start(&service_id->internal, true, x->xctx);
751 
752  obj = afw_service_get_object(&service_id->internal, x->p, x->xctx);
753 
754  if (!obj) {
755  AFW_THROW_ERROR_Z(not_found, "Not found", x->xctx);
756  }
757 
758  return afw_value_create_object(obj, x->p, x->xctx);
759 }
760 
761 
762 
763 /*
764  * Adaptive function: service_stop
765  *
766  * afw_function_execute_service_stop
767  *
768  * See afw_function_bindings.h for more information.
769  *
770  * Stop a service.
771  *
772  * This function is not pure, so it may return a different result
773  * given exactly the same parameters and has side effects.
774  *
775  * Declaration:
776  *
777  * ```
778  * function service_stop(
779  * serviceId: string
780  * ): (object _AdaptiveService_);
781  * ```
782  *
783  * Parameters:
784  *
785  * serviceId - (string) The serviceId of the service to stop.
786  *
787  * Returns:
788  *
789  * (object _AdaptiveService_) _AdaptiveService_ object for the service which
790  * will contain the current status of the service. If there is an error,
791  * the status property value will be "error" and "statusMessage" contain
792  * an error message.
793  */
794 const afw_value_t *
797 {
798  const afw_value_string_t *service_id;
799  const afw_object_t *obj;
800 
802 
803  afw_service_stop(&service_id->internal, x->xctx);
804 
805  obj = afw_service_get_object(&service_id->internal, x->p, x->xctx);
806 
807  if (!obj) {
808  AFW_THROW_ERROR_Z(not_found, "Not found", x->xctx);
809  }
810 
811  return afw_value_create_object(obj, x->p, x->xctx);
812 }
Adaptive Framework Core Internal.
afw_value_create_list(const afw_list_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type list value.
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.
afw_data_type_string
Data type struct for string.
#define afw_data_type_is_string(A_DATA_TYPE)
Macro to determine if data type is string.
struct afw_iterator_s afw_iterator_t
_Bool afw_boolean_t
Definition: afw_common.h:373
apr_size_t afw_size_t
size_t.
Definition: afw_common.h:151
#define afw_data_type_internal_to_utf8(instance, from_internal, p, xctx)
Call method internal_to_utf8 of interface afw_data_type.
const afw_environment_registry_type_t * afw_environment_get_registry_type_by_id(const afw_utf8_t *registry_type_id, afw_boolean_t load_extension, afw_xctx_t *xctx)
Get the registry type associated with a registry type id.
afw_environment_registry_key_exists(int type_number, const afw_utf8_t *key, afw_xctx_t *xctx)
Check to see if a key exists.
afw_environment_load_extension(const afw_utf8_t *extension_id, const afw_utf8_t *module_path, const afw_object_t *properties, afw_xctx_t *xctx)
Load and initialize environment extension.
afw_environment_registry_get(int type_number, const afw_utf8_t *key, afw_xctx_t *xctx)
Get the value associated with a key for a registry type.
#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
afw_flag_set_default(const afw_utf8_t *flag_id, afw_boolean_t set_to, afw_xctx_t *xctx)
Set the default value of a flag.
Definition: afw_flag.c:717
afw_flag_set_default_flag_ids(const afw_list_t *default_flag_ids, afw_xctx_t *xctx)
Set a new default flags list.
Definition: afw_flag.c:823
afw_flag_set(const afw_utf8_t *flag_id, afw_boolean_t set_to, afw_xctx_t *xctx)
Set a flag in xctx.
Definition: afw_flag.c:780
#define AFW_FUNCTION_EVALUATE_DATA_TYPE_PARAMETER(A_RESULT, A_N, A_TYPE)
Evaluate an arg for a particular data type.
Definition: afw_function.h:261
#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
const afw_value_t * afw_function_execute_service_stop(afw_function_execute_t *x)
Adaptive Function service_stop
const afw_value_t * afw_function_execute_flag_replace_defaults(afw_function_execute_t *x)
Adaptive Function flag_replace_defaults
const afw_value_t * afw_function_execute_flag_get_active(afw_function_execute_t *x)
Adaptive Function flag_get_active
const afw_value_t * afw_function_execute_flag_modify_defaults(afw_function_execute_t *x)
Adaptive Function flag_modify_defaults
const afw_value_t * afw_function_execute_service_get(afw_function_execute_t *x)
Adaptive Function service_get
const afw_value_t * afw_function_execute_flag_set(afw_function_execute_t *x)
Adaptive Function flag_set
const afw_value_t * afw_function_execute_extension_load_by_module_path(afw_function_execute_t *x)
Adaptive Function extension_load_by_module_path
const afw_value_t * afw_function_execute_service_start(afw_function_execute_t *x)
Adaptive Function service_start
const afw_value_t * afw_function_execute_flag_get_active_defaults(afw_function_execute_t *x)
Adaptive Function flag_get_active_defaults
const afw_value_t * afw_function_execute_registry_key_check(afw_function_execute_t *x)
Adaptive Function registry_key_check
const afw_value_t * afw_function_execute_service_restart(afw_function_execute_t *x)
Adaptive Function service_restart
const afw_value_t * afw_function_execute_flag_get_defaults(afw_function_execute_t *x)
Adaptive Function flag_get_defaults
const afw_value_t * afw_function_execute_extension_load(afw_function_execute_t *x)
Adaptive Function extension_load
#define afw_list_get_next_internal(instance, iterator, data_type, internal, xctx)
Call method get_next_internal of interface afw_list.
afw_list_add_internal(const afw_list_t *instance, const afw_data_type_t *data_type, const void *internal, afw_xctx_t *xctx)
Call method add of interface afw_list_setter.
Definition: afw_list.c:78
const afw_list_t * afw_list_create_with_options(int options, const afw_data_type_t *data_type, const afw_pool_t *p, afw_xctx_t *xctx)
Create an list in memory with options.
#define AFW_LOCK_BEGIN(instance)
Macro to begin a lock section.
Definition: afw_lock.h:191
#define AFW_LOCK_END
Macro to end a lock section.
Definition: afw_lock.h:202
afw_service_restart(const afw_utf8_t *service_id, afw_xctx_t *xctx)
Restart a service.
Definition: afw_service.c:1465
afw_service_stop(const afw_utf8_t *service_id, afw_xctx_t *xctx)
Stop a service.
Definition: afw_service.c:1266
const afw_object_t * afw_service_get_object(const afw_utf8_t *service_id, const afw_pool_t *p, afw_xctx_t *xctx)
Get a service object by service id.
Definition: afw_service.c:1058
afw_service_start(const afw_utf8_t *service_id, afw_boolean_t manual_start, afw_xctx_t *xctx)
Start a service.
Definition: afw_service.c:1201
const afw_utf8_t * afw_utf8_clone(const afw_utf8_t *string, const afw_pool_t *p, afw_xctx_t *xctx)
Clone a utf-8 string into a specific pool.
Definition: afw_utf8.h:347
afw_value_false
Adaptive value false.
Definition: afw_value.h:354
afw_value_null
Adaptive value null.
Definition: afw_value.h:320
afw_value_true
Adaptive value true.
Definition: afw_value.h:348
Interface afw_data_type public struct.
AFW_ATOMIC const afw_boolean_t * default_flags
Default flags array indexed by flag_index.
Definition: afw_common.h:1519
const afw_flag_t *AFW_ATOMIC const * flag_by_index
Flag struct indexed by flag_index.
Definition: afw_common.h:1528
AFW_ATOMIC afw_size_t flags_count_registered
The number of flags registered.
Definition: afw_common.h:1507
Interface afw_extension public struct.
Definition: afw_interface.h:55
const afw_utf8_t * flag_id
objectId of this flag.
Definition: afw_flag.h:39
Function execute parameter.
Definition: afw_function.h:53
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
Interface afw_list public struct.
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 list values.
Interface afw_value public struct.
struct for data type string values.
Interface afw_xctx public struct.