Move parts of wpa_cli to a new common file
[mech_eap.git] / src / common / cli.h
1 /*
2  * Common hostapd/wpa_supplicant command line interface functionality
3  * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8
9 #ifndef CLI_H
10 #define CLI_H
11
12 #include "utils/list.h"
13
14 struct cli_txt_entry {
15         struct dl_list list;
16         char *txt;
17 };
18
19 void cli_txt_list_free(struct cli_txt_entry *e);
20 void cli_txt_list_flush(struct dl_list *list);
21
22 struct cli_txt_entry *
23 cli_txt_list_get(struct dl_list *txt_list, const char *txt);
24
25 void cli_txt_list_del(struct dl_list *txt_list, const char *txt);
26 void cli_txt_list_del_addr(struct dl_list *txt_list, const char *txt);
27 void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt,
28                            int separator);
29
30 int cli_txt_list_add(struct dl_list *txt_list, const char *txt);
31 int cli_txt_list_add_addr(struct dl_list *txt_list, const char *txt);
32 int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt,
33                           int separator);
34
35 char ** cli_txt_list_array(struct dl_list *txt_list);
36
37 #endif /* CLI_H */