aboutsummaryrefslogtreecommitdiff
path: root/dep/libzip/regress/deltest.c
diff options
context:
space:
mode:
authorBrian <none@none>2010-08-25 23:40:39 -0600
committerBrian <none@none>2010-08-25 23:40:39 -0600
commitbed85f565b853b13576258adcd585c9753e3e10f (patch)
treeb5ed510db75eefcbb380f4c5edd52d4fc8d69942 /dep/libzip/regress/deltest.c
parent55b09e7a9c312e900d6995fac790173904d5cf60 (diff)
Core/Dep: Added libzip which IS needed by G3D
Fixes compile on Windows and Linux (if you didn't have libzip installed for some reason). --HG-- branch : trunk
Diffstat (limited to 'dep/libzip/regress/deltest.c')
-rw-r--r--dep/libzip/regress/deltest.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/dep/libzip/regress/deltest.c b/dep/libzip/regress/deltest.c
new file mode 100644
index 00000000000..87991e5ede0
--- /dev/null
+++ b/dep/libzip/regress/deltest.c
@@ -0,0 +1,37 @@
+#include "zip.h"
+#include "error.h"
+
+char *prg;
+#define BUFSIZE 65536
+
+int
+main(int argc, char *argv[])
+{
+ struct zip *za;
+
+ if (argc != 2) {
+ fprintf(stderr, "%s: call with one option: zip-file. First file"
+ " in zip-file will be deleted\n", argv[0]);
+ return 1;
+ }
+
+ if ((za=zip_open(argv[1], ZIP_CHECKCONS))==NULL) {
+ fprintf(stderr, "%s: can't open '%s': %s\n", argv[0], argv[1],
+ zip_err_str[zip_err]);
+ return 1;
+ }
+
+ if (zip_delete(za, 0)< 0) {
+ fprintf(stderr, "%s: can't delete first file in '%s': %s",
+ argv[0], argv[1], zip_err_str[zip_err]);
+ return 1;
+ }
+
+ if (zip_close(za)!=0) {
+ fprintf(stderr, "%s: can't close file '%s': %s", argv[0], argv[1],
+ zip_err_str[zip_err]);
+ return 1;
+ }
+
+ return 0;
+}