New SWIG python user with a quick question

marksibly via Swig-user <[email protected]> Sat, 02 Mar 2024 21:24:33 +1300
Newsgroups gmane.comp.programming.swig
Message-ID <[email protected]>
--===============2255093359943573636==
Content-Type: multipart/alternative; 
	boundary="----=_Part_26786_47136409.1709367873204"

------=_Part_26786_47136409.1709367873204
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Hi,



I am new to SWIG but have it up and running and producing a python wrapper for my C library after only a few hours work/googling!



A quick question (more are likely to follow) - is it possible to get SWIG to just use my header files directly instead of having to declare everything a second time in the .i?



The headers contain very boring 'C' code, although I do typedef int to a number of handle types. I did notice SWIG dealt with my 'typedef const char* SGD_String' no problem though, so I assume it knows what my typedefs mean.



All functions are consistently prefixed with sgd_ and all types and macros with SGD_ (there are actually only the int handle types right now - would SGD_Bool, SGD_Int be a problem?).



It's not a huge amount of work maintaing the .i, although it's the 3rd set I'll have to deal without as I'm supporting another language not supported by SWIG. I guess I could also write something to convert the .h's to a .i, is this common practice?



Oh, one other quicky: is it possible to generate wrappers for Javascript in a node.js environment?



Anyway, loving SWIG so far, nice job!



Bye,

Mark
------=_Part_26786_47136409.1709367873204
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>=
<meta content=3D"text/html;charset=3DUTF-8" http-equiv=3D"Content-Type"></h=
ead><body ><div style=3D"font-family: Verdana, Arial, Helvetica, sans-serif=
; font-size: 10pt;"><div>Hi,<br></div><div><br></div><div>I am new to SWIG =
but have it up and running and producing a python wrapper for my C library =
after only a few hours work/googling!<br></div><div><br></div><div>A quick =
question (more are likely to follow) - is it possible to get SWIG to just u=
se my header files directly instead of having to declare everything a secon=
d time in the .i?<br></div><div><br></div><div>The headers contain very bor=
ing 'C' code, although I do typedef int to a number of handle types. I did =
notice SWIG dealt with my 'typedef const char* SGD_String' no problem thoug=
h, so I assume it knows what my typedefs mean.<br></div><div><br></div><div=
>All functions are consistently prefixed with sgd_ and all types and macros=
 with SGD_ (there are actually only the int handle types right now - would =
SGD_Bool, SGD_Int be a problem?).<br></div><div><br></div><div>It's not a h=
uge amount of work maintaing the .i, although it's the 3rd set I'll have to=
 deal without as I'm supporting another language not supported by SWIG. I g=
uess I could also write something to convert the .h's to a .i, is this comm=
on practice?<br></div><div><br></div><div>Oh, one other quicky: is it possi=
ble to generate wrappers for Javascript in a node.js environment?<br></div>=
<div><br></div><div>Anyway, loving SWIG so far, nice job!<br></div><div><br=
></div><div>Bye,<br></div><div>Mark<br></div><div><br></div></div><br></bod=
y></html>
------=_Part_26786_47136409.1709367873204--



--===============2255093359943573636==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============2255093359943573636==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user

--===============2255093359943573636==--