zeek/src/zeek-setup.h
Benjamin Bannier f5a76c1aed Reformat Zeek in Spicy style
This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
2023-10-30 09:40:55 +01:00

31 lines
899 B
C++

// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "zeek/Options.h"
namespace zeek::detail {
struct SetupResult {
int code = 0;
Options options;
};
/**
* Initializes Zeek's global state.
* @param argc the argument count (same semantics as main function)
* @param argv the argument strings (same semantics as main function)
* @param options if provided, those options are used instead of
* deriving them by parsing the "argv" list. The "argv" list still
* needs to be provided regardless since some functionality requires
* it, particularly, several things use the value of argv[0].
*/
SetupResult setup(int argc, char** argv, Options* options = nullptr);
/**
* Cleans up Zeek's global state.
* @param did_run_loop whether the run_loop() function was called.
*/
int cleanup(bool did_run_loop);
} // namespace zeek::detail