Skip to content

Commit

Permalink
BBS-Ruby porting part 4: Enable BBS-Ruby in more().
Browse files Browse the repository at this point in the history
  • Loading branch information
IepIweidieng committed Feb 12, 2019
1 parent d306ce2 commit 400f19c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
4 changes: 4 additions & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
#define USE_BBSLUA
#endif

#ifdef M3_USE_BBSRUBY /* Enable BBS-Ruby */
#define USE_BBSRUBY
#endif

/* ----------------------------------------------------- */
/* 隨 BBS 站規模成長而擴增 */
/* ----------------------------------------------------- */
Expand Down
25 changes: 18 additions & 7 deletions maple/more.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,14 +718,25 @@ more(
#endif
}
#endif /* #ifdef M3_USE_BBSLUA */
#ifdef M3_USE_BBSRUBY
/* 081229.cache: BBSRuby */
// else if (key == '!')
// {
// screenline slt[T_LINES];
// vs_save(slt);
// run_ruby(fpath);
// vs_restore(slt);
// }
else if (key == '!')
{
#ifdef M3_USE_PFTERM
screen_backup_t old_screen = {0};
scr_dump(&old_screen);
#else
screenline slt[T_LINES];
vs_save(slt);
#endif
run_ruby(fpath);
#ifdef M3_USE_PFTERM
scr_restore_free(&old_screen);
#else
vs_restore(slt);
#endif
}
#endif /* #ifdef M3_USE_BBSRUBY */

else /* 其他鍵都是使用者中斷 */
{
Expand Down
8 changes: 8 additions & 0 deletions maple/pmore.c
Original file line number Diff line number Diff line change
Expand Up @@ -2835,6 +2835,14 @@ _pmore2(
break;
#endif // USE_BBSLUA

/* BBS-Ruby */
#ifdef USE_BBSRUBY
case '!':
run_ruby(* (char **)ahctx);
MFDISP_DIRTY();
break;
#endif // USE_BBSRUBY

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

0 comments on commit 400f19c

Please sign in to comment.