Closed mwette closed 3 years ago
Sure. No problem. Fixed on master.
Thanks! From this:
(define-ffi-module (ffi xlsxwriter)
#:include '("xlsxwriter.h")
#:library '("libxlsxwriter")
#:inc-filter (lambda (f p) (string-contains p "xlsxwriter" 0))
#:inc-dirs '("/usr/local/include"))
my tool (nyacc's ffi-helper) generates several 1000's lines of scheme code using Guile's API for libffi. Then a user can do this:
(use-modules (ffi xlsxwriter))
(use-modules (system ffi-help-rt))
(define workbook (workbook_new "xlsxdemo.xlsx"))
(define worksheet (workbook_add_worksheet workbook NULL))
(define format (workbook_add_format workbook))
(format_set_bold format)
(worksheet_set_column worksheet 0 0 20 NULL)
(worksheet_write_string worksheet 0 0 "Hello" NULL)
(worksheet_write_string worksheet 1 0 "World" NULL)
(worksheet_write_number worksheet 2 0 123 NULL)
(worksheet_write_number worksheet 3 0 123.456 NULL)
(worksheet_insert_image worksheet 1 2 "xlsxlogo.png")
(workbook_close workbook)
That's really cool.
In
styles.h
exists the declarationI'm (sheepishly) asking that the variable name
lxw_styles
not be a typedef name, which my API generator can't parse. For example, changelsw_styles *lxw_styles
tolxw_styles *styles
.My API generator works like the tool
swig
: it reads header files and generates API wrapper code for Guile (GNU's Scheme implementation). I know the bug is my parser, but it's a realy hard fix.