10 int whelk_perror(lua_State *L,const char *s)
14 lua_pushfstring(L,"%s: %s",s,strerror(errno));
16 lua_pushstring(L,strerror(errno));
17 lua_pushinteger(L,errno);
21 static int whelk_unsupported(lua_State *L)
24 return whelk_perror(L,NULL);
28 #define WIN32_ONLY(func) func
30 #define WIN32_ONLY(func) whelk_unsupported
33 static const luaL_reg whelk_functions[]={
34 { "GetFolderPath",WIN32_ONLY(whelk_get_folder_path) },
35 { "CreateShortCut",WIN32_ONLY(whelk_create_short_cut) },
36 { "Spawn",WIN32_ONLY(whelk_spawn) },
37 { "CryptCATAdmin",WIN32_ONLY(whelk_crypt_cat_admin_new) },
38 { "SetupCopyOEMInf",WIN32_ONLY(whelk_setup_copy_oem_inf) },
39 { "SetupUninstallOEMInf",WIN32_ONLY(whelk_setup_uninstall_oem_inf) },
43 LUALIB_API int luaopen_whelk(lua_State *L)
45 luaL_register(L,"whelk",whelk_functions);
46 lua_pushliteral(L,"version");
47 lua_pushliteral(L,PACKAGE_STRING);
50 whelk_open_get_folder_path(L);
51 whelk_open_reg_keys(L);