設定ファイル (INI 形式) 解析モジュール。
c-modernization-kit sample team
1.0.0
2026/03/04
Copyright (C) CompanyName, Ltd. 2026. All rights reserved.
static FILE *open_config_file_read ( const char *path )static void copy_cstr_trunc ( char *dst, size_t dst_size, const char *src )static void trim ( const char *src, char *buf, size_t buf_size )static int parse_kv ( const char *line, char *key_out, size_t key_size, char *val_out, size_t val_size )int config_load_global ( const char *config_path, PotrGlobalConfig *global )設定ファイルから [global] セクションを読み込みます。
[global] セクションが存在しない場合はデフォルト値を設定します。
成功時は POTR_SUCCESS、失敗時は POTR_ERROR を返します。
static void apply_service_kv ( const char *key, const char *val, PotrServiceDef *current )int config_load_service ( const char *config_path, int64_t service_id, PotrServiceDef *def )設定ファイルから指定サービスの定義を読み込みます。
[service.
サービスの識別子はセクション名の
成功時は POTR_SUCCESS、サービスが見つからない場合は POTR_ERROR を返します。
int config_list_service_ids ( const char *config_path, int64_t **ids_out, int *count_out )設定ファイルに登録されているすべてのサービス ID を列挙します。
初期容量 POTR_MAX_SERVICES で配列を確保し、超過時は realloc で 2 倍に拡張します。
成功時は POTR_SUCCESS、失敗時は POTR_ERROR を返します。
#define CONFIG_LINE_MAX 256設定ファイル 1 行の最大長。
#define CONFIG_SECTION_MAX 64セクション名の最大長。
#define CONFIG_KEY_MAX 64キー名の最大長。
#define CONFIG_VAL_MAX 128値文字列の最大長。