mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #252] Libxlsxwriter API refactoring in progress - Porters take note. #201
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#201
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jmcnamara on GitHub (Nov 11, 2019).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/252
Libxlsxwriter uses two kinds of structs as API parameters:
The second type are always copied by the library and freed afterwards, i.e., the library never touches the public user data. However, some of these struct types are also used internally and some of the fields/members for metadata are shared with the external structs. This can cause issues where these fields aren't initialised by the user or just cause general confusion when inspected by the user.
This also make the API/ABI quite fragile since additional fields are often added to internal structs.
For the next version (0.8.8) of the library I'm going to rework the APIs so that external facing structs only contain documented fields and so that different structs are used internally if they require any additional metadata.
If you are porting or wrapping libxlsxwriter then this change will probably cause you some rework as well (although if you are just following the external documented APIs you will probably be okay).
Hopefully this will be a one-off overhead.
You can try out the changes from this rework on the api_refactor branch.
@jmcnamara commented on GitHub (Nov 12, 2019):
@Alexhuszagh @RaFaeL-NN @sjmulder @Paxa@ @FTrautwein @gekola @HalfWayMan @Rolltrax @ropensci @yoeljacobsen @viest @fterrag
Please note this refactoring to libxlsxwriter which may affect your ports/wrappers.
@jmcnamara commented on GitHub (Nov 17, 2019):
I've made a series of changes to fix the internal/external struct issues and document any unused (for now) fields. Hopefully this will make the ABI/API more stable in the future and less brittle for people instantiating structs to pass to the API.
I merge this up to master later and will release it in approximately the next day.
If anyone sees any issues let me know.
@RaFaeL-NN commented on GitHub (Nov 17, 2019):
I get "error: wrong number of arguments specified for `deprecated' attribute" under MinGW
@RaFaeL-NN commented on GitHub (Nov 17, 2019):
Also, code for copying of user_props->created to doc_props does not exists in workbook_set_properties. If it's documented now, I think it must be or not?
@jmcnamara commented on GitHub (Nov 17, 2019):
@RaFaeL-NN
I don't see that in my MinGW environment. How are you compiling it?
It is documented in the
lxw_doc_propertiesstruct. I'll add it toworkbook_set_properties()as well. http://libxlsxwriter.github.io/structlxw__doc__properties.html@RaFaeL-NN commented on GitHub (Nov 17, 2019):
I don't know how to answer on this. I type "make" in MSYS under Windows
@jmcnamara commented on GitHub (Nov 17, 2019):
@RaFaeL-NN
I followed the steps shown in the libxlsxwriter user guide for installing on Windows using Mingw-w64 and MSYS2 and when I type
makeI don't see that, or any other issue:I've added an explanation of the
createdparameter to theworkbook_set_properties()docs:http://libxlsxwriter.github.io/workbook_8h.html#aa814fd7f8d2c3ce86a7aa5d5ed127000
@RaFaeL-NN commented on GitHub (Nov 17, 2019):
I still can't see any code for this in workbook_set_properties in workbook.c at master. How it works? Is there an example?
@jmcnamara commented on GitHub (Nov 17, 2019):
Sorry. I understand now. I had omitted copying the user value. I've fixed it on master.
Here is a working example:
@jmcnamara commented on GitHub (Nov 20, 2019):
Merged upstream in version 0.8.8.