blob: ff63564bbaed9a9bbc51ab4c4149b7bada817ba0 [file] [log] [blame]
Martin Rothbe08c1d2024-02-16 09:12:33 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Patrick Georgi77612372024-03-13 13:01:21 +01002#ifndef LKC_PROTO_H
3#define LKC_PROTO_H
4
Patrick Georgid5208402014-04-11 20:24:06 +02005#include <stdarg.h>
Patrick Georgi0588d192009-08-12 15:00:51 +00006
7/* confdata.c */
Patrick Georgi53ea1d42019-11-22 16:55:58 +01008void conf_parse(const char *name);
9int conf_read(const char *name);
10int conf_read_simple(const char *name, int);
11int conf_write_defconfig(const char *name);
12int conf_write(const char *name);
13int conf_write_autoconf(int overwrite);
14void conf_set_changed(bool val);
15bool conf_get_changed(void);
16void conf_set_changed_callback(void (*fn)(void));
17void conf_set_message_callback(void (*fn)(const char *s));
Patrick Georgi77612372024-03-13 13:01:21 +010018bool conf_errors(void);
Patrick Georgi0588d192009-08-12 15:00:51 +000019
20/* symbol.c */
Patrick Georgi53ea1d42019-11-22 16:55:58 +010021extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
Patrick Georgi0588d192009-08-12 15:00:51 +000022
Patrick Georgi53ea1d42019-11-22 16:55:58 +010023struct symbol * sym_lookup(const char *name, int flags);
24struct symbol * sym_find(const char *name);
Patrick Georgi4c9b9e92022-10-28 01:00:26 +020025void print_symbol_for_listconfig(struct symbol *sym);
Patrick Georgi53ea1d42019-11-22 16:55:58 +010026struct symbol ** sym_re_search(const char *pattern);
27const char * sym_type_name(enum symbol_type type);
28void sym_calc_value(struct symbol *sym);
Patrick Georgi77612372024-03-13 13:01:21 +010029bool sym_dep_errors(void);
Patrick Georgi53ea1d42019-11-22 16:55:58 +010030enum symbol_type sym_get_type(struct symbol *sym);
31bool sym_tristate_within_range(struct symbol *sym,tristate tri);
32bool sym_set_tristate_value(struct symbol *sym,tristate tri);
33tristate sym_toggle_tristate_value(struct symbol *sym);
34bool sym_string_valid(struct symbol *sym, const char *newval);
35bool sym_string_within_range(struct symbol *sym, const char *str);
36bool sym_set_string_value(struct symbol *sym, const char *newval);
37bool sym_is_changeable(struct symbol *sym);
38struct property * sym_get_choice_prop(struct symbol *sym);
39const char * sym_get_string_value(struct symbol *sym);
Patrick Georgi0588d192009-08-12 15:00:51 +000040
Patrick Georgi53ea1d42019-11-22 16:55:58 +010041const char * prop_get_type_name(enum prop_type type);
42
43/* preprocess.c */
44enum variable_flavor {
45 VAR_SIMPLE,
46 VAR_RECURSIVE,
47 VAR_APPEND,
48};
49void env_write_dep(FILE *f, const char *auto_conf_name);
50void variable_add(const char *name, const char *value,
51 enum variable_flavor flavor);
52void variable_all_del(void);
53char *expand_dollar(const char **str);
54char *expand_one_token(const char **str);
Patrick Georgi0588d192009-08-12 15:00:51 +000055
56/* expr.c */
Patrick Georgi53ea1d42019-11-22 16:55:58 +010057void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken);
Patrick Georgi77612372024-03-13 13:01:21 +010058
59#endif /* LKC_PROTO_H */