forked from GitHub/gf-core
added writePGF
This commit is contained in:
@@ -149,7 +149,11 @@ readNGF fpath =
|
||||
return (PGF fptr1 fptr2 Map.empty)
|
||||
|
||||
writePGF :: FilePath -> PGF -> IO ()
|
||||
writePGF = error "TODO: writePGF"
|
||||
writePGF fpath p =
|
||||
withCString fpath $ \c_fpath ->
|
||||
withForeignPtr (a_db p) $ \c_db ->
|
||||
withForeignPtr (revision p) $ \c_revision ->
|
||||
withPgfExn (pgf_write_pgf c_fpath c_db c_revision)
|
||||
|
||||
showPGF :: PGF -> String
|
||||
showPGF = error "TODO: showPGF"
|
||||
|
||||
@@ -58,6 +58,8 @@ foreign import ccall "pgf_boot_ngf"
|
||||
foreign import ccall "pgf_read_ngf"
|
||||
pgf_read_ngf :: CString -> Ptr (Ptr PgfRevision) -> Ptr PgfExn -> IO (Ptr PgfDB)
|
||||
|
||||
foreign import ccall pgf_write_pgf :: CString -> Ptr PgfDB -> Ptr PgfRevision -> Ptr PgfExn -> IO ()
|
||||
|
||||
foreign import ccall "&pgf_free"
|
||||
pgf_free_fptr :: FinalizerPtr PgfDB
|
||||
|
||||
|
||||
Reference in New Issue
Block a user