Menu

Documentation?

Help
Nebelmann
2008-12-28
2013-04-24
  • Nebelmann

    Nebelmann - 2008-12-28

    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

     
    • Nebelmann

      Nebelmann - 2008-12-28

      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)

       
    • Christoph Nenning

      > 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.

       
      • Nebelmann

        Nebelmann - 2009-01-07

        >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.

         
    • Christoph Nenning

      > It's just using the struct name instead of the typedef'ed name. 

      That behavior is intended.

       
    • Christoph Nenning

      I have added the "const as parameter name" issue to the bug tracker.

       

Log in to post a comment.