gobj_start_up()
#
gobj_start_up()
initializes the gobj system, setting up global settings, memory management, and persistent attributes.
Prototype
int gobj_start_up(
int argc,
char *argv[],
const json_t *jn_global_settings,
const persistent_attrs_t *persistent_attrs,
json_function_fn global_command_parser,
json_function_fn global_statistics_parser,
authorization_checker_fn global_authorization_checker,
authentication_parser_fn global_authentication_parser,
size_t mem_max_block,
size_t mem_max_system_memory,
BOOL use_own_system_memory,
size_t mem_min_block,
size_t mem_superblock
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
Number of command-line arguments. |
|
|
Array of command-line arguments. |
|
|
Global settings in JSON format (not owned). |
|
Persistent attributes management functions. |
|
|
|
Global command parser function. |
|
|
Global statistics parser function. |
|
|
Global authorization checker function. |
|
|
Global authentication parser function. |
|
|
Maximum memory block size. |
|
|
Maximum system memory allocation. |
|
|
Flag to use internal memory manager. |
|
|
Minimum memory block size (used only in internal memory manager). |
|
|
Superblock size (used only in internal memory manager). |
Return Value
Returns 0
on success, -1
if already initialized.
Notes
This function must be called before using any other gobj-related functions.
If persistent_attrs
is provided, it initializes persistent attributes.
If global_command_parser
is NULL
, an internal command parser is used.
If global_statistics_parser
is NULL
, an internal statistics parser is used.
If global_authorization_checker
is NULL
, authorization checks are disabled.
If global_authentication_parser
is NULL
, authentication is bypassed.
Prototype
function gobj_start_up(
jn_global_settings,
load_persistent_attrs_fn,
save_persistent_attrs_fn,
remove_persistent_attrs_fn,
list_persistent_attrs_fn,
global_command_parser_fn,
global_stats_parser_fn
)
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples