https://github.com/nimterop/nimterop/issues/171#issuecomment-602387909
Thanks for that. I was looking about how that was called (enum offsets).
=> I filed it here:
[https://github.com/nimterop/nimterop/issues/171](https://github.com/nimterop/nimterop/issues/171)
Nimterop has other issues (I should file it). For instance:
toast -pnrk VapourSynth.h
creates the following enums:
pfRGB24* = (cmRGB + 10).VSPresetFormat
pfRGB27* = 29.VSPresetFormat
pfRGB30* = 30.VSPresetFormat
pfRGB48* = 31.VSPresetFormat
@akavel no problem and I understand (I can imagine).
@shashlick thanks for that. Very useful.
I have left my spaguetty code [here](https://github.com/mantielero/h2nim.py) (I
called it **h2nim.py** ). It uses
[pyclibrary](https://pyclibrary.readthedocs.io/en/latest/) under the hood. It
is far
Read this section
[https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst#def-directive](https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst#def-directive)
but the introduction also tries to explain it.
To get you started, [here's](http://ix.io/2dTc/nim) the wrapper output from:
toast -pnrk gr.h
Run
Toast is the c2nim equivalent from nimterop.
Please try to not take offence with Araq's occasional snappy replies; I can
only assume he sometimes gets tired with the maintainer role &
responsibilities, which indeed can be exhausting at times; I know I myself am
sometimes less polite than I'd like to be when I'm overly tired, even to
I will take a look to ggplotnim. Looks interesting.
I have played with both nimterop and c2nim before.
Thanks a lot.
Also related to your C library wrapping project, have a look at
[https://github.com/nimterop/nimterop](https://github.com/nimterop/nimterop).
Using that, I have successfully wrapped quite a few C libraries, and this is
coming from someone who has never coded in C (of course, some learning curve
Related to your plotting application, also have a look at ggplotnim:
[https://github.com/Vindaar/ggplotnim](https://github.com/Vindaar/ggplotnim) .
It helps me make things like:
Thanks for the clarification.
$ c2nim --header gr.h
gr.h(27, 25) Error: token expected: ;
Run
AFAIK, c2nim cannot read something with c custom macro. You can edit the header
temporarily to remove that custom macro. In this case it's the `DLLEXPORT`.
Or alternative, you can point me in the right direction if you actually know
what is the problem.
I read the documentation, despite neither
[here](https://github.com/nim-lang/c2nim) nor [here
Well alternatively you can read c2nim's documentation.
When I try to use c2nim, it tends to fail while parsing stuff (vapoursynth and
gr). Por example, with
[gr.h](https://github.com/sciapp/gr/blob/master/lib/gr/gr.h):
$ c2nim --header gr.h
gr.h(27, 25) Error: token expected: ;
$ c2nim --dynlib /usr/gr/lib/libGR.so
> where I have to add a, b, c just to make it work.
Yeah, well you do have to do that. c2nim automates it for you.
By the way, I am just playing with [gr framework](https://gr-framework.org/).
#import gr_wrapper
const
libName = "/usr/gr/lib/libGR.so"
proc gr_initgr*(){.importc,dynlib: libName.}
proc gr_polyline*(a:cint, b:ptr cdouble, c:ptr cdouble)
Is it possible to avoid giving names to arguments in the functions?
I have the following in the C header:
DLLEXPORT void gr_polyline(int, double *, double *);
Run
and in order to make it work, I have to do:
proc gr_polyline*(a:cint, b:ptr cdouble, c:ptr
19 matches
Mail list logo