diff options
| author | Alexander M Pickering <alex@cogarr.net> | 2023-03-07 22:35:00 -0600 |
|---|---|---|
| committer | Alexander M Pickering <alex@cogarr.net> | 2023-03-07 22:35:00 -0600 |
| commit | 65d7db3487cc318dd764481193feb90bb6a897cd (patch) | |
| tree | d1107b2067204e871f24fba26246824d3534a254 /src/client/lua_api/io | |
| parent | 0bc9f8922269233ca651d3765a7b073d5c2c7945 (diff) | |
| download | brokengine-65d7db3487cc318dd764481193feb90bb6a897cd.tar.gz brokengine-65d7db3487cc318dd764481193feb90bb6a897cd.tar.bz2 brokengine-65d7db3487cc318dd764481193feb90bb6a897cd.zip | |
Use an older name for luaL_reg
Diffstat (limited to 'src/client/lua_api/io')
| -rw-r--r-- | src/client/lua_api/io/ifilesystem.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/client/lua_api/io/ifilesystem.cpp b/src/client/lua_api/io/ifilesystem.cpp index 12aab78..588bddd 100644 --- a/src/client/lua_api/io/ifilesystem.cpp +++ b/src/client/lua_api/io/ifilesystem.cpp @@ -13,20 +13,28 @@ A list of files in the current direcotry. */ // io.list() int listfilesin(lua_State *L){ + printf("Device is: %p\n",(void*)device); IFileSystem *fs = device->getFileSystem(); + printf("Got file system %p\n",(void*)fs); IFileList *fl = fs->createFileList(); + printf("Created file list\n"); - unsigned long fc = fl->getFileCount(); + u32 fc = fl->getFileCount(); + printf("Got file count\n"); unsigned long i; const char *path; lua_newtable(L); for(i = 0; i < fc; i++){ + printf("Adding list item %lu \n",i); path = fl->getFileName(i).c_str(); + printf("Got item name: %s\n",path); lua_pushnumber(L,i + 1); lua_pushstring(L,path); lua_settable(L,-3); } + + fl->drop(); return 1; } @@ -93,7 +101,7 @@ int setloglevel(lua_State *L){ return 0; } -static const luaL_reg ifilesystem_f[] = { +static const luaL_Reg ifilesystem_f[] = { {"log", logmessage}, {"set_log_level", setloglevel}, {"list", listfilesin}, @@ -101,7 +109,7 @@ static const luaL_reg ifilesystem_f[] = { {0,0}, }; -static const luaL_reg ifilesystem_m[] = { +static const luaL_Reg ifilesystem_m[] = { {0,0}, }; |
