Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Changes for CPlugin ABI v2 breaking changes #59

Open
CromFr opened this issue Sep 20, 2022 · 0 comments
Open

[WIP] Changes for CPlugin ABI v2 breaking changes #59

CromFr opened this issue Sep 20, 2022 · 0 comments

Comments

@CromFr
Copy link
Member

CromFr commented Sep 20, 2022

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.

NWNXCPlugin_New(NWNXCPlugin_InitInfo info);
// =>
NWNXCPlugin_New(const NWNXCPlugin_InitInfo* info);

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 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, "...", ...)

Allow to switch CNWSMessage for ExecuteScript

See issue #80

@CromFr CromFr changed the title [WIP] Changes for next CPlugin ABI breaking changes [WIP] Changes for CPlugin ABI v2 breaking changes Dec 8, 2024
@CromFr CromFr mentioned this issue Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant