added writePGF

This commit is contained in:
krangelov
2021-09-15 19:58:42 +02:00
parent c6d6914688
commit e00be98ac6
7 changed files with 495 additions and 1 deletions

View File

@@ -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"