Re: help with creating a module..



On Wed, 2 Feb 2005 15:41:29 -0800
Sriram Ramkrishna <sri aracnet com> wrote:

> On Wed, Feb 02, 2005 at 04:00:18PM +0100, Magnus Bergman wrote:
> > Actually I have very little knowledge about the things you ask
about.
> > But perhaps libusb (http://libusb.sf.net) would help, it seems to
handle
> > those kind of things (for projects like libgphoto). But I guess you
knew
> > about it already.
> 
> Yep, it uses libusb.  I think for me to debug this I have to know what
> the flow is.  I assumed that it is:
> 
> vfs_module_init
> do_open
> do_open_directory (if do_open returns EOF_ERROR_VFS_IS_DIR)

Do you mean in which order the functions of your module is called (by
libgnomevfs), or do I misunderstand you? I think the only thing you can
be sure of is that vfs_module_init() is called first, and
vfs_module_shutdown() called last. Anything call in between is pretty
much up to the application using gnomevfs.

> but I'm still stuck at vfs_module_init
> 
> Any tips on how to debug?

What happens if you just run a program like:

main (..)
{
    find iriver usb device
    print 1
    init usb device
    print 2
    claim usb device
    print 3
    ifp init sequence
    print 4
}

Does that work, but not with the same code in the vfs_module_init()? The
only thing I can think of is that "claim usb device" is called more than
once. Perhaps you don't see the debug output the second time because the
output buffer isn't flushed? I'm not sure if gnomevfs can guarantee that
vfs_module_init() is called only once, perhaps somebody else can answer
that.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]