Alexander Hansen | 1e04f44 | 2024-06-12 16:35:58 +0200 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2016 IBM |
| 3 | * Copyright © 2024 9elements |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | #pragma once |
| 19 | |
Andrew Jeffery | 7a76595 | 2025-02-03 16:47:40 +1030 | [diff] [blame] | 20 | #include <stddef.h> |
Alexander Hansen | 1e04f44 | 2024-06-12 16:35:58 +0200 | [diff] [blame] | 21 | #include <stdint.h> |
| 22 | #include <termios.h> |
| 23 | |
| 24 | struct config; |
| 25 | |
Alexander Hansen | e3a083e | 2024-07-08 15:30:35 +0200 | [diff] [blame] | 26 | const char *config_get_section_value(struct config *config, const char *secname, |
| 27 | const char *name); |
Alexander Hansen | 1e04f44 | 2024-06-12 16:35:58 +0200 | [diff] [blame] | 28 | const char *config_get_value(struct config *config, const char *name); |
| 29 | struct config *config_init(const char *filename); |
| 30 | const char *config_resolve_console_id(struct config *config, |
| 31 | const char *id_arg); |
| 32 | void config_fini(struct config *config); |
| 33 | |
| 34 | int config_parse_baud(speed_t *speed, const char *baud_string); |
| 35 | uint32_t parse_baud_to_int(speed_t speed); |
| 36 | speed_t parse_int_to_baud(uint32_t baud); |
| 37 | int config_parse_bytesize(const char *size_str, size_t *size); |
Alexander Hansen | e3a083e | 2024-07-08 15:30:35 +0200 | [diff] [blame] | 38 | |
| 39 | int config_count_sections(struct config *config); |
| 40 | const char *config_get_section_name(struct config *config, int i); |