[Haskell-cafe] HDirect, [unique], troubles again!

Vincenzo aka Nick Name vincenzo_mlRE.MOVE at yahoo.it
Wed May 5 23:51:29 EDT 2004

In my quest for a fuse binding for Haskell, which I really need at the 
moment, I have the following definition working:

module HSFuse {
  interface stat{};
  typedef int getattrT([string] char *,stat);

  typedef struct fuseOps {
    [ref] getattrT * getattr;
  } fuseOps;

  void fuse_main(int argc,[in,string,size_is(argc)]char** argv,[ref] 
fuseOps * op);

but when I substitute "ref" with "unique", because some operations can 
be null, I get the errors below. The problem is that in the generated 
hs file there is

data FuseOps = FuseOps {getattr :: GetattrT}

which completely ignores my type declaration! Did I do something wrong?

Commands invoked and errors follow, thanks for attention:

ihc -fhs-to-c -fuse-ints-everywhere -c HSFuse.idl
ghc  -package hdirect -fglasgow-exts HSFuse.hs -c

    Couldn't match
        `GHC.Base.String -> Stat -> GHC.IOBase.IO GHC.Base.Int'
             (GHC.Base.String -> Stat -> GHC.IOBase.IO GHC.Base.Int)'
        Expected type: GHC.Ptr.Ptr
                                (GHC.Base.String -> Stat -> 
GHC.IOBase.IO GHC.Base.Int))
                       -> GHC.Ptr.Ptr
                              (GHC.Base.String -> Stat -> GHC.IOBase.IO 
                          -> GHC.IOBase.IO ()
        Inferred type: GHC.Ptr.Ptr
                                (GHC.Base.String -> Stat -> 
GHC.IOBase.IO GHC.Base.Int))
                       -> (GHC.Base.String -> Stat -> GHC.IOBase.IO 
                          -> GHC.IOBase.IO ()
    In the second argument of `HDirect.writeunique', namely
    In the definition of `writeFuseOps':
        writeFuseOps ptr (FuseOps getattr)
                       = let
                           pf0 = ptr
                           pf1 = HDirect.addNCastPtr pf0 0
                           HDirect.writeunique (HDirect.allocBytes 
(GHC.Real.fromIntegral sizeofGetattrT))

More information about the Haskell-Cafe mailing list