Peter Huewe | 9f7cc08 | 2019-05-02 18:16:28 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
Philip Tricca | e394cff | 2018-04-18 08:36:06 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2018, Intel Corporation |
| 4 | * All rights reserved. |
Philip Tricca | e394cff | 2018-04-18 08:36:06 -0700 | [diff] [blame] | 5 | */ |
Jonas Witschel | 4af3ca6 | 2019-07-24 15:40:49 +0200 | [diff] [blame] | 6 | |
| 7 | #ifndef KEY_VALUE_PARSE_H |
| 8 | #define KEY_VALUE_PARSE_H |
| 9 | |
Philip Tricca | e394cff | 2018-04-18 08:36:06 -0700 | [diff] [blame] | 10 | #include <stdlib.h> |
| 11 | |
| 12 | #include "tss2_tpm2_types.h" |
| 13 | |
| 14 | #define KEY_VALUE_INIT { \ |
| 15 | .key = NULL, \ |
| 16 | .value = NULL, \ |
| 17 | } |
| 18 | |
| 19 | typedef struct { |
| 20 | char *key; |
| 21 | char *value; |
| 22 | } key_value_t; |
| 23 | |
| 24 | typedef TSS2_RC (*KeyValueFunc) (const key_value_t* key_value, |
| 25 | void *user_data); |
| 26 | bool |
| 27 | parse_key_value (char *key_value_str, |
| 28 | key_value_t *key_value); |
| 29 | TSS2_RC |
| 30 | parse_key_value_string (char *kv_str, |
| 31 | KeyValueFunc callback, |
| 32 | void *user_data); |
Jonas Witschel | 4af3ca6 | 2019-07-24 15:40:49 +0200 | [diff] [blame] | 33 | |
| 34 | #endif /* KEY_VALUE_PARSE_H */ |