 #c
 // generate a delta, based on the implementation of rdiff
 rs_result genDelta(int sigFd, char* filePath, int deltaFd) {
-    FILE*           sigFile, f, deltaFile;
+    FILE*           sigFile;
+    FILE*           f;
+    FILE*           deltaFile;
     rs_result       result;
     rs_signature_t* sumset;
     rs_stats_t      stats;
 
     sigFile   = fdopen(sigFd, "rb");
-    f         = rs_open_file(filePath, "rb");
+    f         = fopen(filePath, "rb");
     deltaFile = fdopen(deltaFd, "wb");
 
     result = rs_loadsig_file(sigFile, &sumset, &stats);


#c
rs_result applyPatch(int deltaFd, char* inputPath, char* outputPath) {
    FILE*      deltaFile, inputFile, outputFile;
    rs_stats_t stats;
    rs_result  result;

    inputFile  = rs_file_open(inputPath, "rb");
    deltaFile  = fdopen(deltaFd, "rb");
    outputFile = rs_file_open(outputPath, "wb");

    result = rs_patch_file(inputFile, deltaFile, outputFile, &stats);


}
#endc

--------------------------------------------------------------------------------
-- | Delta

-- | Given a handle refering to the sginature, in (at least) binary Read mode,
-- positioned at the beginning of the file, a file path to a file, and a handle
-- in binary read write mode. Compute the delta, and write the result to the
-- file indicated by the second handle. The handle is repositioned to the
-- beginning of the file. The result of this function is a Maybe String
-- indicating any error messages. Nothing means the operation succeeded.
cGenDelta :: Handle -> FilePath -> Handle -> IO (Maybe String)
cGenDelta sigHandle p deltaHandle = undefined


