1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2018, Intel Corporation 4 * All rights reserved. 5 */ 6 7 #ifndef KEY_VALUE_PARSE_H 8 #define KEY_VALUE_PARSE_H 9 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); 33 34 #endif /* KEY_VALUE_PARSE_H */ 35