|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Declares lightweight JSON and conf value lookup helpers. More...
Go to the source code of this file.
Functions | |
JSON and conf lookup helpers | |
| char * | json_find_string_after (const char *text, const char *key, const char *start_at) |
| Finds a JSON string value for a key after a given scan position. | |
| char * | json_find_string (const char *text, const char *key) |
| Finds the first JSON string value associated with a key. | |
| char * | json_find_string_in_section (const char *text, const char *section, const char *key) |
| Finds a JSON string value for a key inside a named section object. | |
| char * | json_extract_array_in_section (const char *text, const char *section, const char *key) |
| Extracts the raw JSON array text for a key inside a named section. | |
| char * | conf_lookup_value_in_text (const char *text, const char *key) |
| Looks up one key from Pharos conf-format text. | |
| char * | conf_lookup_value (const char *path, const char *key) |
| Reads a Pharos conf file and looks up one key. | |
Declares lightweight JSON and conf value lookup helpers.
Definition in file native_json_config.h.
| char * conf_lookup_value | ( | const char * | path, |
| const char * | key ) |
Reads a Pharos conf file and looks up one key.
| path | Path to the config file. |
| key | Config key to locate. |
Definition at line 179 of file native_json_config.c.
References conf_lookup_value_in_text(), and read_file_text().
Referenced by apply_serve_config_defaults_from_conf_native(), dynamic_conf_lookup_runtime(), load_runtime_stack(), native_app_conf_value_path(), native_backup_base_dir(), native_conf_positive_size_value(), native_db_check_json(), native_default_backend(), native_default_backend_local(), native_default_environment(), native_default_sqlite_path(), native_default_sqlite_path(), native_default_sqlite_path_local(), native_dynamic_config_lookup_raw_dup(), resolve_runtime_socket_path_native(), and runtime_apps_dir_native().
| char * conf_lookup_value_in_text | ( | const char * | text, |
| const char * | key ) |
Looks up one key from Pharos conf-format text.
| text | Config text to search. |
| key | Config key to locate. |
Definition at line 139 of file native_json_config.c.
References dup_range(), pharos_json_strdup, and trim_in_place().
Referenced by conf_lookup_value(), and load_app_local_config_native().
| char * json_extract_array_in_section | ( | const char * | text, |
| const char * | section, | ||
| const char * | key ) |
Extracts the raw JSON array text for a key inside a named section.
| text | JSON text to search. |
| section | Section name that should contain the array. |
| key | Array-valued key to locate. |
Definition at line 81 of file native_json_config.c.
References len.
Referenced by build_app_from_root_native().
| char * json_find_string | ( | const char * | text, |
| const char * | key ) |
Finds the first JSON string value associated with a key.
| text | JSON text to search. |
| key | Key name to locate. |
Definition at line 58 of file native_json_config.c.
References json_find_string_after().
Referenced by add_runtime_app_native(), build_app_from_root_native(), capture_migrate_verify_report_json(), load_app_runtime_for_single_app(), load_app_runtime_from_artifact_native(), load_runtime_stack(), match_app_root_in_directory(), and resolve_website_root().
| char * json_find_string_after | ( | const char * | text, |
| const char * | key, | ||
| const char * | start_at ) |
Finds a JSON string value for a key after a given scan position.
| text | JSON text to search. |
| key | Key name to locate. |
| start_at | Pointer within text where scanning should begin. |
Definition at line 20 of file native_json_config.c.
References dup_range().
Referenced by json_find_string(), json_find_string_in_section(), and native_dispatch_response_file_for_request().
| char * json_find_string_in_section | ( | const char * | text, |
| const char * | section, | ||
| const char * | key ) |
Finds a JSON string value for a key inside a named section object.
| text | JSON text to search. |
| section | Section name that should contain the key. |
| key | Key name to locate inside the section. |
Definition at line 62 of file native_json_config.c.
References json_find_string_after().
Referenced by app_runtime_host_profile_native(), build_app_from_root_native(), load_app_local_config_native(), load_app_runtime_for_single_app(), load_app_runtime_from_artifact_native(), native_metadata_artifact_value(), native_migration_fixture_path(), and resolve_seed_entrypoint_native().