| 1 | /* |
| 2 | Authors: |
| 3 | Pavel Březina <[email protected]> |
| 4 | |
| 5 | Copyright (C) 2024 Red Hat |
| 6 | |
| 7 | This program is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 3 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
| 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #ifndef _CONFIG_H_ |
| 22 | #define _CONFIG_H_ |
| 23 | |
| 24 | #include "common/common.h" |
| 25 | |
| 26 | /** |
| 27 | * Read configuration file containing profile ID and features. |
| 28 | * |
| 29 | * The file format is: |
| 30 | * Line 1: profile ID |
| 31 | * Lines 2+: features (one per line, empty lines ignored) |
| 32 | * |
| 33 | * @param path Path to configuration file. |
| 34 | * @param _profile_id Output: profile identifier (must be freed). |
| 35 | * @param _features Output: NULL-terminated array of features (must be freed |
| 36 | * with string_array_free), or NULL if not requested. |
| 37 | * @return EOK on success, error code on failure. |
| 38 | */ |
| 39 | errno_t |
| 40 | config_read(const char *path, |
| 41 | char **_profile_id, |
| 42 | char ***_features); |
| 43 | |
| 44 | #endif /* _CONFIG_H_ */ |