Skip to content

Commit

Permalink
Menus work for the basics
Browse files Browse the repository at this point in the history
  • Loading branch information
wwiv committed Nov 10, 2020
1 parent 0c60f29 commit 40ce3a3
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 1,467 deletions.
1 change: 0 additions & 1 deletion bbs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ set(COMMON_SOURCES
lpfunc.cpp
oldmenu.cpp
menuinterpretcommand.cpp
menu_parser.cpp
menuspec.cpp
menusupp.cpp
misccmd.cpp
Expand Down
2 changes: 1 addition & 1 deletion bbs/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ int Application::Run(int argc, char* argv[]) {
}
const auto menu_commands = cmdline.arg("menu_commands");
if (!menu_commands.is_default()) {
wwiv::menus::PrintMenuCommands(menu_commands.as_string());
wwiv::bbs::menus::PrintMenuCommands(menu_commands.as_string());
return 0;
}

Expand Down
18 changes: 12 additions & 6 deletions bbs/basic/wwiv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "bbs/basic/util.h"
#include "bbs/interpret.h"
#include "bbs/oldmenu.h"
#include "bbs/menus/menucommands.h"
#include "bbs/acs.h"
#include "core/version.h"
#include "deps/my_basic/core/my_basic.h"
Expand Down Expand Up @@ -47,14 +47,20 @@ bool RegisterNamespaceWWIV(mb_interpreter_t* basi) {

mb_register_func(basi, "COMMAND", [](struct mb_interpreter_t* bas, void** l) -> int {
mb_check(mb_attempt_open_bracket(bas, l));
char* arg = nullptr;
auto cmd = wwiv_mb_pop_string(bas, l);
if (!cmd) {
// command missing
return MB_FUNC_ERR;
}
std::string data;
if (mb_has_arg(bas, l)) {
mb_check(mb_pop_string(bas, l, &arg));
if (const auto o = wwiv_mb_pop_string(bas, l)) {
data = o.value();
}
}
mb_check(mb_attempt_close_bracket(bas, l));
if (arg) {
menus::InterpretCommand(nullptr, arg);
}

menus::InterpretCommand(nullptr, cmd.value(), data);
return MB_FUNC_OK;
});

Expand Down
159 changes: 0 additions & 159 deletions bbs/menu_parser.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions bbs/menu_parser.h

This file was deleted.

Loading

0 comments on commit 40ce3a3

Please sign in to comment.