I'm looking for a nice way to use libmtp in Java. I tried to generate the needed JNI files with XBiG, which worked very well. I just adapted the build.xml file I found in tests/ogre4j, because I couldn't find any other real documentation. Is it possible to make customizations such as the default java package, or the generated name for structures (don't append _struct)?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've another problem, variable names can be ommitted in function prototypes in C/C++, but there can be the 'const' keyword after a '*' character, so when the corresponding Java function is generated, the parameter takes the name 'const' and thus generates an error.
Here's an example:
int LIBMTP_Get_Supported_Devices_List(LIBMTP_device_entry_t ** const, int * const);
is converted to:
public static int LIBMTP_Get_Supported_Devices_List(NativeObjectPointer<org.xbig.ILIBMTP_device_entry_struct> const, IntegerPointer const)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> Is it possible to make customizations such as the default java package
Yes, it is. See xbig/src/xsl/config.xml and xbig/src/xsl/config.xml.ogre4j.
For package names search the file for packageprefix.
Where does _struct occur?
Please post a native code sample.
> I've another problem, variable names can be ommitted in function prototypes in C/C++, but
> there can be the 'const' keyword after a '*' character
In that case 'const' is part of the type name and obviously there is a bug in XBiG or maybe doxygen (which XBiG uses for C++ parsing). Not sure when I find time to fix it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>Yes, it is. See xbig/src/xsl/config.xml and xbig/src/xsl/config.xml.ogre4j.
>For package names search the file for packageprefix.
Thanks, I'll take a look when I have time.
>Where does _struct occur?
>Please post a native code sample.
Oops, in fact it's not added. The header file I use contains a struct name ending whith _struct, but when I use it I use a typedef ending with _t, that's why I thought XBiG altered the name. It's just using the struct name instead of the typedef'ed name.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm looking for a nice way to use libmtp in Java. I tried to generate the needed JNI files with XBiG, which worked very well. I just adapted the build.xml file I found in tests/ogre4j, because I couldn't find any other real documentation. Is it possible to make customizations such as the default java package, or the generated name for structures (don't append _struct)?
Thanks
I've another problem, variable names can be ommitted in function prototypes in C/C++, but there can be the 'const' keyword after a '*' character, so when the corresponding Java function is generated, the parameter takes the name 'const' and thus generates an error.
Here's an example:
int LIBMTP_Get_Supported_Devices_List(LIBMTP_device_entry_t ** const, int * const);
is converted to:
public static int LIBMTP_Get_Supported_Devices_List(NativeObjectPointer<org.xbig.ILIBMTP_device_entry_struct> const, IntegerPointer const)
> Is it possible to make customizations such as the default java package
Yes, it is. See xbig/src/xsl/config.xml and xbig/src/xsl/config.xml.ogre4j.
For package names search the file for packageprefix.
Where does _struct occur?
Please post a native code sample.
> I've another problem, variable names can be ommitted in function prototypes in C/C++, but
> there can be the 'const' keyword after a '*' character
In that case 'const' is part of the type name and obviously there is a bug in XBiG or maybe doxygen (which XBiG uses for C++ parsing). Not sure when I find time to fix it.
>Yes, it is. See xbig/src/xsl/config.xml and xbig/src/xsl/config.xml.ogre4j.
>For package names search the file for packageprefix.
Thanks, I'll take a look when I have time.
>Where does _struct occur?
>Please post a native code sample.
Oops, in fact it's not added. The header file I use contains a struct name ending whith _struct, but when I use it I use a typedef ending with _t, that's why I thought XBiG altered the name. It's just using the struct name instead of the typedef'ed name.
> It's just using the struct name instead of the typedef'ed name.
That behavior is intended.
I have added the "const as parameter name" issue to the bug tracker.