Refactor some environment code into env_dispatch.cpp

This new file is supposed to encapsulate all of the logic around
reacting to variable changes, as opposed to the environment core.
This is to help break up the env.cpp monolith.
This commit is contained in:
ridiculousfish
2019-03-25 20:18:00 -07:00
parent e5362a4ae5
commit b7fceddfc8
5 changed files with 364 additions and 265 deletions

24
src/env_dispatch.h Normal file
View File

@@ -0,0 +1,24 @@
// Prototypes for functions that react to environment variable changes
#ifndef FISH_ENV_DISPATCH_H
#define FISH_ENV_DISPATCH_H
#include "config.h" // IWYU pragma: keep
#include "common.h"
#include "env_universal_common.h"
#include <memory>
/// Mark initialization as finished.
void env_dispatch_mark_initialization_finished();
class env_stack_t;
void env_dispatch_var_change(const wchar_t *op, const wcstring &key, env_stack_t &vars);
void guess_emoji_width();
void env_universal_callbacks(env_stack_t *stack, const callback_data_list_t &callbacks);
extern const wcstring_list_t locale_variables;
extern const wcstring_list_t curses_variables;
#endif