Skip to content

Commit

Permalink
BBS-Lua porting part 4: Enable BBS-Lua in more().
Browse files Browse the repository at this point in the history
  • Loading branch information
IepIweidieng committed Jan 25, 2019
1 parent f62fd02 commit effe3c8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@

#define GRAYOUT /* 淡入淡出特效系統 */

#ifdef M3_USE_BBSLUA /* Enable BBS-Lua */
#define USE_BBSLUA
#endif

/* ----------------------------------------------------- */
/* 隨 BBS 站規模成長而擴增 */
/* ----------------------------------------------------- */
Expand Down
19 changes: 19 additions & 0 deletions maple/more.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,25 @@ more(
shift = 0;
break;
}
/* BBS-Lua */
#ifdef M3_USE_BBSLUA
else if (key == 'L' || key == 'l')
{
#ifdef M3_USE_PFTERM
screen_backup_t old_screen = {0};
scr_dump(&old_screen);
#else
screenline slt[T_LINES];
vs_save(slt);
#endif
bbslua(fpath);
#ifdef M3_USE_PFTERM
scr_restore_free(&old_screen);
#else
vs_restore(slt);
#endif
}
#endif /* #ifdef M3_USE_BBSLUA */
/* 081229.cache: BBSRuby */
// else if (key == '!')
// {
Expand Down
8 changes: 8 additions & 0 deletions maple/pmore.c
Original file line number Diff line number Diff line change
Expand Up @@ -2831,6 +2831,14 @@ _pmore2(
break;
#endif // PMORE_USE_INTERNAL_HELP

/* BBS-Lua */
#ifdef USE_BBSLUA
case 'l': case 'L':
bbslua(* (char **)ahctx);
MFDISP_DIRTY();
break;
#endif // USE_BBSLUA

/* debug system */
#ifdef DEBUG
case 'd':
Expand Down

0 comments on commit effe3c8

Please sign in to comment.