Main.h 472 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2022, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/Error.h>
  9. #include <AK/Span.h>
  10. #include <AK/StringView.h>
  11. namespace Main {
  12. struct Arguments {
  13. int argc {};
  14. char** argv {};
  15. Span<StringView> strings;
  16. };
  17. int return_code_for_errors();
  18. void set_return_code_for_errors(int);
  19. }
  20. ErrorOr<int> serenity_main(Main::Arguments);