diff options
| author | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2014-01-05 16:28:21 -0500 |
|---|---|---|
| committer | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2014-01-05 16:28:21 -0500 |
| commit | 59a9b205dfb6d68545e75f28083cf68eb064547d (patch) | |
| tree | 1be3a06d55d87d9c93cb3d9660e6eb4e1a16bf5c /rfile.c | |
| parent | 50ff0e53d94c60860e768100f549e4dfe9110096 (diff) | |
| download | prism-59a9b205dfb6d68545e75f28083cf68eb064547d.tar.gz prism-59a9b205dfb6d68545e75f28083cf68eb064547d.zip | |
Prism can now revert current changes
Diffstat (limited to 'rfile.c')
| -rw-r--r-- | rfile.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1,6 +1,7 @@ #include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <io.h>
#include "prism.h"
#include "md5.h"
@@ -54,3 +55,21 @@ char *newfile; return PRET_GZFAILED;
}
+
+int decompress_file(const char *destination, int id, int revision)
+{
+char *stored_name;
+
+ /* Arbitrary size... */
+ stored_name = (char *)malloc(128*sizeof(char));
+ if(stored_name == NULL)
+ return PRET_ERROR;
+ snprintf(stored_name, 128, "%s%s%x.%x", PDB_DIR, DIR_SEP, id, revision);
+
+ unlink(destination);
+
+ if(file_uncompress(stored_name, destination) >= 0)
+ return PRET_OK;
+
+ return PRET_GZFAILED;
+}
|
