![]() ![]() lua_genpcallW is the protected version of lua_gencallW.Either using wctomb and mbtowc (system functions based on current locale) or converting to UTF-8 with custom code. Two conversion methods are supported by the function, selected at compile time. The script string may contain arbitrary characters most typically file names and user messages in localized languages. The format string always contains ASCII characters, so the transformation is straightforward. It will convert these into their char* counterpart and call lua_gencallA. Its both string arguments (script chunk and format) must be of type wchar_t*. lua_gencallW is the Unicode, or wide character, version of lua_gencallA.In case of errors, the exception is trapped and the error message is output as the function result. It calls lua_gencallA, enclosed with lua_cpcall. ![]() lua_genpcallA is the protected version of the same function.It is the responsibility of the caller to catch this error, by using lua_cpcall, or by setting lua_atpanic. It calls luaL_error that throws an exception (or makes a longjmp, which is similar). In case of an error (compile time, run time or coming from parameters), Variantsįour versions of the general call function are in fact defined, but normally you only use one of them: However, for this job, it may be preferable to follow EasyManualLibraryLoad guideline. This can for example simplify dynamic loading of Lua shared library, because for each exported function, you need to define a new type for the prototype of the function, instantiate a variable of this type and make a call to GetProcAddress or dlsym. The second goal is to minimize, ideally to only one, the number of functions needed in the API. Const char* errmsg = lua_genpcall(L, "local a,b =. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |