Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Entry Point

Functions for initializing and launching a yuno application.

Source: kernel/c/root-linux/src/entry_point.h, kernel/c/root-linux/src/manage_services.h, kernel/c/root-linux/src/yunetas_register.h


yuneta_setup()

Configures the yuneta runtime: persistent-attribute handlers, command / stats parsers, authentication / authorization callbacks, and memory allocator settings. Call once, before yuneta_entry_point().

int yuneta_setup(
    const persistent_attrs_t    *persistent_attrs,
    json_function_fn            command_parser,
    json_function_fn            stats_parser,
    authorization_checker_fn    authz_checker,
    authentication_parser_fn    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

KeyTypeDescription
persistent_attrsconst persistent_attrs_t *Custom persistent-attribute callbacks (NULL uses the built-in dbsimple backend).
command_parserjson_function_fnCustom command parser (NULL uses the built-in command_parser).
stats_parserjson_function_fnCustom stats parser (NULL uses the built-in stats_parser).
authz_checkerauthorization_checker_fnAuthorization checker (NULL uses the default C_AUTHZ monoclass).
authentication_parserauthentication_parser_fnAuthentication parser (NULL uses the default C_AUTHZ monoclass).
mem_max_blocksize_tLargest memory block size for the allocator.
mem_max_system_memorysize_tMaximum system memory the allocator may use.
use_own_system_memoryBOOLTRUE to use the custom memory allocator.
mem_min_blocksize_tSmallest memory block size.
mem_superblocksize_tSuper-block size.

Returns

0 on success.


yuneta_entry_point()

Main entry point for a yuno application. Parses command-line arguments, loads configuration, sets up the environment, creates the yuno GObj tree, and runs the event loop.

int yuneta_entry_point(
    int argc, char *argv[],
    const char *APP_NAME,
    const char *APP_VERSION,
    const char *APP_SUPPORT,
    const char *APP_DOC,
    const char *APP_DATETIME,
    const char *fixed_config,
    const char *variable_config,
    int (*register_yuno_and_more)(void),
    void (*cleaning_fn)(void)
);

Parameters

KeyTypeDescription
argcintArgument count from main().
argvchar *[]Argument vector from main().
APP_NAMEconst char *Application / yuno role name.
APP_VERSIONconst char *Application version string.
APP_SUPPORTconst char *Support e-mail address.
APP_DOCconst char *Short documentation string.
APP_DATETIMEconst char *Build date/time.
fixed_configconst char *Fixed configuration (JSON string).
variable_configconst char *Variable configuration (JSON string).
register_yuno_and_moreint (*)(void)Callback to register custom GClasses — executed after the environment is set up but before yuno creation.
cleaning_fnvoid (*)(void)Cleanup callback — executed after all resources are freed.

Returns

Process exit code.


set_auto_kill_time()

For testing: kills the yuno after a specified number of seconds. Only effective when the yuno is not running as a daemon.

void set_auto_kill_time(int seconds);

Parameters

KeyTypeDescription
secondsintTimeout in seconds after which the yuno is killed.

Returns

This function does not return a value.


yuneta_json_config()

Returns the currently loaded JSON configuration object.

json_t *yuneta_json_config(void);

Parameters

KeyTypeDescription
--This function does not take any parameters.

Returns

Pointer to the configuration json_t object. The pointer is not owned by the caller — do not modify or free it.


run_services()

Starts and plays services and the yuno in priority order. Calls gobj_start() on the yuno, starts autostart services, calls gobj_play() on the yuno if autoplay is enabled, and plays autoplay services.

void run_services(void);

Parameters

KeyTypeDescription
--This function does not take any parameters.

Returns

This function does not return a value.


stop_services()

Pauses and stops services and the yuno in reverse priority order (priority 9 down to 0).

void stop_services(void);

Parameters

KeyTypeDescription
--This function does not take any parameters.

Returns

This function does not return a value.


yuno_shutdown()

Shuts down the yuno by marking it as shutting down and stopping the event loop.

void yuno_shutdown(void);

Parameters

KeyTypeDescription
--This function does not take any parameters.

Returns

This function does not return a value.

Notes


yunetas_register_c_core()

Registers all built-in runtime GClasses in one call. This is the centralized registration point invoked during yuno startup.

int yunetas_register_c_core(void);

Parameters

KeyTypeDescription
--This function does not take any parameters.

Returns

0 on success.

Notes