// SPDX-License-Identifier: MPL-2.0
#ifndef BP_LIB_CONF_H
#define BP_LIB_CONF_H
#include <Uefi.h>
#include "disk.h"
typedef struct {
  CHAR16 *line_content;
  UINTN length;
} bp_conf_LINE;
typedef struct {
  bp_conf_LINE *lines;
  UINTN count;
  UINTN capacity;
} bp_conf_LINED_FILE;
typedef struct {
  CHAR16 *key;
  CHAR16 *value;
} bp_conf_PAIR;
typedef struct {
  bp_conf_PAIR *pairs;
  UINTN count;
  UINTN capacity;
} bp_conf_CONF;
typedef struct {
  BOOLEAN serial_port_enabled;
  BOOLEAN serial_port_debuging;
  BOOLEAN serial_port_erroring;
  CHAR16 *font;
  BOOLEAN disable_boot_animation;
  UINT64 default_horizontal_resolution;
  UINT64 default_vertical_resolution;
  UINT8 initfs_partition_type_guid[16];
  UINT8 initfs_partition_guid[16];
  UINT8 signsyst_partition_type_guid[16];
  UINT8 signsyst_partition_guid[16];
  UINT8 kernel_log_level;
  BOOLEAN kernel_test_benchmark;
  UINT64 kernel_bench_iterations;
  BOOLEAN kernel_log_disable_serial_port;
  BOOLEAN kernel_disable_serial_port;
  UINT16 kernel_log_ring_size;
  UINT16 kernel_kbd_events_queue_capacity;
} bp_conf_BOOT_CONF;
STATIC CONST CHAR16 *CONST bp_conf_boot_conf_params[]={
  L"serial_port_enabled",
  L"serial_port_debuging",
  L"serial_port_erroring",
  L"font",
  L"disable_boot_animation",
  L"default_horizontal_resolution",
  L"default_vertical_resolution",
  L"initfs_partition_type_guid",
  L"initfs_partition_guid",
  L"signsyst_partition_type_guid",
  L"signsyst_partition_guid",
  L"kernel_log_level",
  L"kernel_test_benchmark",
  L"kernel_bench_iterations",
  L"kernel_log_disable_serial_port",
  L"kernel_disable_serial_port",
  L"kernel_log_ring_size",
  L"kernel_kbd_events_queue_capacity"
};
#define BP_CONF_BOOT_CONF_PARAMS_SIZE (sizeof(bp_conf_boot_conf_params)/sizeof(bp_conf_boot_conf_params[0]))
EFI_STATUS bp_conf_get_lines_number(bp_disk_FILE *file,UINTN *line_number);
EFI_STATUS bp_conf_parse_file_lines(bp_disk_FILE *file,bp_conf_LINED_FILE **lined_file);
EFI_STATUS bp_conf_parse_conf(bp_conf_LINED_FILE *lined_file,bp_conf_CONF **conf);
EFI_STATUS bp_conf_fill_default_boot_conf(bp_conf_BOOT_CONF **boot_conf);
EFI_STATUS bp_conf_fill_boot_conf(bp_conf_CONF *conf,bp_conf_BOOT_CONF **boot_conf);
#endif
