|
30 | 30 |
|
31 | 31 | #include "dialogs\Splash.h"
|
32 | 32 | #include "direct.h"
|
| 33 | +extern "C" |
| 34 | + { |
| 35 | + #include "scripting\number.h" |
| 36 | + void bc_free_numbers (); |
| 37 | + } |
33 | 38 |
|
34 | 39 | COLORREF xterm_256_colours [256];
|
35 | 40 |
|
@@ -243,6 +248,8 @@ BOOL CMUSHclientApp::InitInstance()
|
243 | 248 | // where we do file browsing from
|
244 | 249 | strcpy (file_browsing_dir, working_dir);
|
245 | 250 |
|
| 251 | +// bc_init_numbers(); |
| 252 | + |
246 | 253 |
|
247 | 254 | // First free the string that was allocated by MFC in the startup
|
248 | 255 | // of CWinApp. The string is allocated before InitInstance is
|
@@ -1216,6 +1223,8 @@ int CMUSHclientApp::ExitInstance()
|
1216 | 1223 |
|
1217 | 1224 | THEMEGLUE_FREE ();
|
1218 | 1225 |
|
| 1226 | +// bc_free_numbers (); // free zero, one, two |
| 1227 | + |
1219 | 1228 | // free the resources DLL
|
1220 | 1229 | FreeLibrary (m_hInstDLL);
|
1221 | 1230 | return CWinApp::ExitInstance();
|
@@ -1361,18 +1370,19 @@ void CMUSHclientApp::OpenLuaDelayed ()
|
1361 | 1370 | return; // can't open Lua
|
1362 | 1371 |
|
1363 | 1372 | luaL_openlibs (m_SpellChecker_Lua); // new way of opening all libraries
|
1364 |
| - luaopen_rex (m_SpellChecker_Lua); // regular expression library |
1365 |
| - luaopen_bits (m_SpellChecker_Lua); // bit manipulation library |
1366 |
| - luaopen_compress (m_SpellChecker_Lua); // compression (utils) library |
1367 |
| - luaopen_progress_dialog (m_SpellChecker_Lua); // progress dialog |
1368 |
| - luaopen_bc (m_SpellChecker_Lua); // open bc library |
1369 |
| - luaopen_lsqlite3 (m_SpellChecker_Lua); // open sqlite library |
1370 |
| - lua_pushcfunction(m_SpellChecker_Lua, luaopen_lpeg); // open lpeg library |
1371 |
| - lua_call(m_SpellChecker_Lua, 0, 0); |
| 1373 | + |
| 1374 | + CallLuaCFunction (m_SpellChecker_Lua, luaopen_rex); // regular expression library |
| 1375 | + CallLuaCFunction (m_SpellChecker_Lua, luaopen_bits); // bit manipulation library |
| 1376 | + CallLuaCFunction (m_SpellChecker_Lua, luaopen_compress); // compression (utils) library |
| 1377 | + CallLuaCFunction (m_SpellChecker_Lua, luaopen_progress_dialog);// progress dialog |
| 1378 | + CallLuaCFunction (m_SpellChecker_Lua, luaopen_bc); // open bc library |
| 1379 | + CallLuaCFunction (m_SpellChecker_Lua, luaopen_lsqlite3); // open sqlite library |
| 1380 | + CallLuaCFunction (m_SpellChecker_Lua, luaopen_lpeg); // open lpeg library |
1372 | 1381 |
|
1373 | 1382 | // add xml reader to utils lib
|
1374 | 1383 | luaL_register (m_SpellChecker_Lua, "utils", ptr_xmllib);
|
1375 | 1384 |
|
| 1385 | + |
1376 | 1386 | lua_settop(m_SpellChecker_Lua, 0); // clear stack
|
1377 | 1387 |
|
1378 | 1388 | // unless they explicitly enable it, remove ability to load DLLs
|
@@ -1711,13 +1721,12 @@ bool bSmallScreen = (iScreenX < 1024) || (iScreenY < 768);
|
1711 | 1721 |
|
1712 | 1722 | luaL_openlibs (m_Translator_Lua); // new way of opening all libraries
|
1713 | 1723 |
|
1714 |
| - luaopen_rex (m_Translator_Lua); // regular expression library |
1715 |
| - luaopen_bits (m_Translator_Lua); // bit manipulation library |
1716 |
| - luaopen_compress (m_Translator_Lua); // compression (utils) library |
1717 |
| - luaopen_bc (m_Translator_Lua); // open bc library |
1718 |
| - luaopen_lsqlite3 (m_Translator_Lua); // open sqlite library |
1719 |
| - lua_pushcfunction(m_Translator_Lua, luaopen_lpeg); // open lpeg library |
1720 |
| - lua_call(m_Translator_Lua, 0, 0); |
| 1724 | + CallLuaCFunction (m_Translator_Lua, luaopen_rex); // regular expression library |
| 1725 | + CallLuaCFunction (m_Translator_Lua, luaopen_bits); // bit manipulation library |
| 1726 | + CallLuaCFunction (m_Translator_Lua, luaopen_compress); // compression (utils) library |
| 1727 | + CallLuaCFunction (m_Translator_Lua, luaopen_bc); // open bc library |
| 1728 | + CallLuaCFunction (m_Translator_Lua, luaopen_lsqlite3); // open sqlite library |
| 1729 | + CallLuaCFunction (m_Translator_Lua, luaopen_lpeg); // open lpeg library |
1721 | 1730 |
|
1722 | 1731 | // add xml reader (and other stuff) to utils lib
|
1723 | 1732 | luaL_register (m_Translator_Lua, "utils", ptr_xmllib);
|
|
0 commit comments