You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue will list useful changes that will be bundled into the next NWNX4 version that needs to break the CPlugin ABI (and increments nwnxcplugin_abi_version)
The current order has been built by appending new attributes at the end of the struct to improve compatibility.
Avoid strcpy for NWNXCPlugin_GetString return value
Currently NWNX4 provides a dest buffer to NWNXCPlugin_GetString so that the plugin can write its returned value into.
However in some cases the plugin already stores a null terminated string, and should be allowed to directly return this string, as it's always strcpy-ed into a NWScript string (need to double check this, just to be sure).
NWNXCPlugin_GetString should return a const char* in order to return a null terminated string. The plugin will be able to chose between returning the buffer provided as parameter, or return a custom string that's already allocated.
Note: Another solution is to give a char** result parameter, and have the plugin *result = "hello world"; or sprintf(*result, "...", ...)
This issue will list useful changes that will be bundled into the next NWNX4 version that needs to break the CPlugin ABI (and increments
nwnxcplugin_abi_version
)NWNXCPlugin_InitInfo argument
Consider if it is necessary / useful.
Reorder NWNXCPlugin_InitInfo content
The current order has been built by appending new attributes at the end of the struct to improve compatibility.
Avoid strcpy for NWNXCPlugin_GetString return value
Currently NWNX4 provides a dest buffer to
NWNXCPlugin_GetString
so that the plugin can write its returned value into.However in some cases the plugin already stores a null terminated string, and should be allowed to directly return this string, as it's always strcpy-ed into a NWScript string (need to double check this, just to be sure).
NWNXCPlugin_GetString
should return aconst char*
in order to return a null terminated string. The plugin will be able to chose between returning the buffer provided as parameter, or return a custom string that's already allocated.Note: Another solution is to give a
char** result
parameter, and have the plugin*result = "hello world";
orsprintf(*result, "...", ...)
Allow to switch CNWSMessage for ExecuteScript
See issue #80
The text was updated successfully, but these errors were encountered: