const poisoning
--HG--
branch : HEAD
diff --git a/lib/zip.h b/lib/zip.h
index 052d8d4..9e1d1bc 100644
--- a/lib/zip.h
+++ b/lib/zip.h
@@ -2,10 +2,10 @@
#define _HAD_ZIP_H
/*
- $NiH: zip.h,v 1.28 2002/06/06 09:27:05 dillo Exp $
+ $NiH: zip.h,v 1.29 2003/03/16 10:21:37 wiz Exp $
zip.h -- exported declarations.
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -135,14 +135,14 @@
/* opening/closing zip files */
-struct zip *zip_open(char *fn, int checkp);
+struct zip *zip_open(const char *fn, int checkp);
int zip_close(struct zip *zf);
-int zip_name_locate(struct zip *zf, char *fn, int case_sens);
+int zip_name_locate(struct zip *zf, const char *fn, int case_sens);
/* read access to files in zip file */
-struct zip_file *zip_fopen(struct zip *zf, char *fn, int case_sens);
+struct zip_file *zip_fopen(struct zip *zf, const char *fn, int case_sens);
struct zip_file *zip_fopen_index(struct zip *zf, int fileno);
int zip_fread(struct zip_file *zff, char *outbuf, int toread);
int zip_fclose(struct zip_file *zff);
@@ -152,34 +152,37 @@
struct zip_meta *zip_new_meta(void);
void zip_free_meta(struct zip_meta *meta);
struct zip_meta *zip_get_meta(struct zip *zf, int idx);
-char *zip_get_name(struct zip *zf, int idx);
+const char *zip_get_name(struct zip *zf, int idx);
/* high level routines to modify zip file */
-int zip_rename(struct zip *zf, int idx, char *name);
+int zip_rename(struct zip *zf, int idx, const char *name);
int zip_delete(struct zip *zf, int idx);
-int zip_replace(struct zip *zf, int idx, char *name, struct zip_meta *meta,
+int zip_add(struct zip *zf, const char *name, struct zip_meta *meta,
+ zip_read_func fn, void *state, int comp);
+int zip_replace(struct zip *zf, int idx, const char *name,
+ struct zip_meta *meta,
zip_read_func fn, void *state, int comp);
-int zip_add_data(struct zip *zf, char *name, struct zip_meta *meta,
- char *data, int len, int freep);
-int zip_replace_data(struct zip *zf, int idx, char *name,
+int zip_add_data(struct zip *zf, const char *name, struct zip_meta *meta,
+ const char *data, int len, int freep);
+int zip_replace_data(struct zip *zf, int idx, const char *name,
struct zip_meta *meta,
- char *data, int len, int freep);
-int zip_add_file(struct zip *zf, char *name, struct zip_meta *meta,
- char *fname, int start, int len);
-int zip_replace_file(struct zip *zf, int idx, char *name,
+ const char *data, int len, int freep);
+int zip_add_file(struct zip *zf, const char *name, struct zip_meta *meta,
+ const char *fname, int start, int len);
+int zip_replace_file(struct zip *zf, int idx, const char *name,
struct zip_meta *meta,
- char *fname, int start, int len);
-int zip_add_filep(struct zip *zf, char *name, struct zip_meta *meta,
+ const char *fname, int start, int len);
+int zip_add_filep(struct zip *zf, const char *name, struct zip_meta *meta,
FILE *file, int start, int len);
-int zip_replace_filep(struct zip *zf, int idx, char *name,
+int zip_replace_filep(struct zip *zf, int idx, const char *name,
struct zip_meta *meta,
FILE *file, int start, int len);
-int zip_add_zip(struct zip *zf, char *name, struct zip_meta *meta,
+int zip_add_zip(struct zip *zf, const char *name, struct zip_meta *meta,
struct zip *srczf, int srcidx, int start, int len);
-int zip_replace_zip(struct zip *zf, int idx, char *name,
+int zip_replace_zip(struct zip *zf, int idx, const char *name,
struct zip_meta *meta,
struct zip *srczf, int srcidx, int start, int len);
diff --git a/lib/zip_add.c b/lib/zip_add.c
index 6d46f8c..c04d681 100644
--- a/lib/zip_add.c
+++ b/lib/zip_add.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_add.c,v 1.6 2002/06/06 09:27:05 dillo Exp $
+ $NiH: zip_add.c,v 1.7 2003/03/16 10:21:37 wiz Exp $
zip_add.c -- add file via callback function
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -30,7 +30,7 @@
int
-zip_add(struct zip *zf, char *name, struct zip_meta *meta,
+zip_add(struct zip *zf, const char *name, struct zip_meta *meta,
zip_read_func fn, void *state, int comp)
{
return zip_replace(zf, -1, name, meta, fn, state, comp);
diff --git a/lib/zip_add_data.c b/lib/zip_add_data.c
index 4bc9792..afb3935 100644
--- a/lib/zip_add_data.c
+++ b/lib/zip_add_data.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_add_data.c,v 1.3 2002/06/06 09:27:06 dillo Exp $
+ $NiH: zip_add_data.c,v 1.4 2003/03/16 10:21:37 wiz Exp $
zip_add_data.c -- add file from buffer
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -30,8 +30,8 @@
int
-zip_add_data(struct zip *zf, char *name, struct zip_meta *meta,
- char *data, int len, int freep)
+zip_add_data(struct zip *zf, const char *name, struct zip_meta *meta,
+ const char *data, int len, int freep)
{
return zip_replace_data(zf, -1, name, meta, data, len, freep);
}
diff --git a/lib/zip_add_file.c b/lib/zip_add_file.c
index 537dc4f..ceb60e5 100644
--- a/lib/zip_add_file.c
+++ b/lib/zip_add_file.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_add_file.c,v 1.4 2002/06/06 09:27:07 dillo Exp $
+ $NiH: zip_add_file.c,v 1.5 2003/03/16 10:21:37 wiz Exp $
zip_add_file.c -- add file from file system
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -30,8 +30,8 @@
int
-zip_add_file(struct zip *zf, char *name, struct zip_meta *meta,
- char *fname, int start, int len)
+zip_add_file(struct zip *zf, const char *name, struct zip_meta *meta,
+ const char *fname, int start, int len)
{
return zip_replace_file(zf, -1, name, meta, fname, start, len);
}
diff --git a/lib/zip_add_filep.c b/lib/zip_add_filep.c
index a274dfd..2ac0f6f 100644
--- a/lib/zip_add_filep.c
+++ b/lib/zip_add_filep.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_add_filep.c,v 1.3 2002/06/06 09:27:08 dillo Exp $
+ $NiH: zip_add_filep.c,v 1.4 2003/03/16 10:21:38 wiz Exp $
zip_add_filep.c -- add file from FILE*
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -30,7 +30,7 @@
int
-zip_add_filep(struct zip *zf, char *name, struct zip_meta *meta,
+zip_add_filep(struct zip *zf, const char *name, struct zip_meta *meta,
FILE *file, int start, int len)
{
return zip_replace_filep(zf, -1, name, meta, file, start, len);
diff --git a/lib/zip_add_zip.c b/lib/zip_add_zip.c
index 76a2c0b..24a83a3 100644
--- a/lib/zip_add_zip.c
+++ b/lib/zip_add_zip.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_add_zip.c,v 1.4 2002/06/06 09:27:08 dillo Exp $
+ $NiH: zip_add_zip.c,v 1.5 2003/03/16 10:21:38 wiz Exp $
zip_add_zip.c -- add file from zip file
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -30,7 +30,7 @@
int
-zip_add_zip(struct zip *zf, char *name, struct zip_meta *meta,
+zip_add_zip(struct zip *zf, const char *name, struct zip_meta *meta,
struct zip *srczf, int srcidx, int start, int len)
{
return zip_replace_zip(zf, -1, name, meta, srczf, srcidx, start, len);
diff --git a/lib/zip_fopen.c b/lib/zip_fopen.c
index b8138b5..5afd764 100644
--- a/lib/zip_fopen.c
+++ b/lib/zip_fopen.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_fopen.c,v 1.3 2002/06/06 09:27:09 dillo Exp $
+ $NiH: zip_fopen.c,v 1.4 2003/03/16 10:21:38 wiz Exp $
zip_fopen.c -- open file in zip file for reading
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -30,7 +30,7 @@
struct zip_file *
-zip_fopen(struct zip *zf, char *fname, int case_sens)
+zip_fopen(struct zip *zf, const char *fname, int case_sens)
{
int idx;
diff --git a/lib/zip_free_entry.c b/lib/zip_free_entry.c
index afa1399..4f2b486 100644
--- a/lib/zip_free_entry.c
+++ b/lib/zip_free_entry.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_free_entry.c,v 1.6 2002/06/06 09:27:11 dillo Exp $
+ $NiH: zip_free_entry.c,v 1.7 2003/03/16 10:21:39 wiz Exp $
zip_free_entry.c -- free struct zip_entry
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -25,7 +25,11 @@
#include <stdlib.h>
+
#include "zip.h"
+#include "zipint.h"
+
+
int
_zip_free_entry(struct zip_entry *ze)
diff --git a/lib/zip_get_name.c b/lib/zip_get_name.c
index 6fd9322..65e7297 100644
--- a/lib/zip_get_name.c
+++ b/lib/zip_get_name.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_get_name.c,v 1.2 2002/06/06 09:27:12 dillo Exp $
+ $NiH: zip_get_name.c,v 1.3 2003/03/16 10:21:39 wiz Exp $
zip_get_name.c -- get filename for a file in zip file
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -29,7 +29,7 @@
-char *
+const char *
zip_get_name(struct zip *zf, int idx)
{
if (idx < 0 || idx >= zf->nentry) {
diff --git a/lib/zip_name_locate.c b/lib/zip_name_locate.c
index 36bcbc4..69b8a66 100644
--- a/lib/zip_name_locate.c
+++ b/lib/zip_name_locate.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_name_locate.c,v 1.5 2002/06/06 09:27:12 dillo Exp $
+ $NiH: zip_name_locate.c,v 1.6 2003/03/16 10:21:40 wiz Exp $
zip_name_locate.c -- get index by name
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -32,7 +32,7 @@
int
-zip_name_locate(struct zip *zf, char *fname, int case_sens)
+zip_name_locate(struct zip *zf, const char *fname, int case_sens)
{
int i;
diff --git a/lib/zip_new_entry.c b/lib/zip_new_entry.c
index d9733ad..4ba793f 100644
--- a/lib/zip_new_entry.c
+++ b/lib/zip_new_entry.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_new_entry.c,v 1.4 2002/06/06 09:27:13 dillo Exp $
+ $NiH: zip_new_entry.c,v 1.5 2003/03/16 10:21:40 wiz Exp $
zip_new_entry.c -- create and init struct zip_entry
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -25,7 +25,11 @@
#include <stdlib.h>
+
#include "zip.h"
+#include "zipint.h"
+
+
struct zip_entry *
_zip_new_entry(struct zip *zf)
diff --git a/lib/zip_open.c b/lib/zip_open.c
index 066ce78..75c940c 100644
--- a/lib/zip_open.c
+++ b/lib/zip_open.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_open.c,v 1.13 2002/06/06 09:27:13 dillo Exp $
+ $NiH: zip_open.c,v 1.14 2003/03/16 10:21:40 wiz Exp $
zip_open.c -- open zip file
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -58,7 +58,7 @@
zipfile struct, or NULL if unsuccessful, setting zip_err. */
struct zip *
-zip_open(char *fn, int flags)
+zip_open(const char *fn, int flags)
{
FILE *fp;
unsigned char *buf, *match;
diff --git a/lib/zip_rename.c b/lib/zip_rename.c
index ba49752..6f8031b 100644
--- a/lib/zip_rename.c
+++ b/lib/zip_rename.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_rename.c,v 1.5 2002/06/06 09:27:14 dillo Exp $
+ $NiH: zip_rename.c,v 1.6 2003/03/16 10:21:40 wiz Exp $
zip_rename.c -- rename file in zip file
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -30,7 +30,7 @@
int
-zip_rename(struct zip *zf, int idx, char *name)
+zip_rename(struct zip *zf, int idx, const char *name)
{
if (idx >= zf->nentry || idx < 0) {
zip_err = ZERR_INVAL;
diff --git a/lib/zip_replace.c b/lib/zip_replace.c
index 09a6dd2..d4f5151 100644
--- a/lib/zip_replace.c
+++ b/lib/zip_replace.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_replace.c,v 1.8 2002/06/06 09:27:14 dillo Exp $
+ $NiH: zip_replace.c,v 1.9 2003/03/16 10:21:41 wiz Exp $
zip_replace.c -- replace file via callback function
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -30,7 +30,7 @@
int
-zip_replace(struct zip *zf, int idx, char *name, struct zip_meta *meta,
+zip_replace(struct zip *zf, int idx, const char *name, struct zip_meta *meta,
zip_read_func fn, void *state, int comp)
{
if (idx == -1) {
diff --git a/lib/zip_replace_data.c b/lib/zip_replace_data.c
index c4a69ee..f4b5707 100644
--- a/lib/zip_replace_data.c
+++ b/lib/zip_replace_data.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_replace_data.c,v 1.9 2003/01/30 03:46:01 wiz Exp $
+ $NiH: zip_replace_data.c,v 1.10 2003/03/16 10:21:41 wiz Exp $
zip_replace_data.c -- replace file from buffer
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -31,7 +31,7 @@
#include "zipint.h"
struct read_data {
- char *buf, *data;
+ const char *buf, *data;
int len;
int freep;
};
@@ -42,8 +42,9 @@
int
-zip_replace_data(struct zip *zf, int idx, char *name, struct zip_meta *meta,
- char *data, int len, int freep)
+zip_replace_data(struct zip *zf, int idx, const char *name,
+ struct zip_meta *meta,
+ const char *data, int len, int freep)
{
struct read_data *f;
@@ -99,7 +100,7 @@
case ZIP_CMD_CLOSE:
if (z->freep) {
- free(z->data);
+ free((void *)z->data);
z->data = NULL;
}
return 0;
diff --git a/lib/zip_replace_file.c b/lib/zip_replace_file.c
index 296e590..fe17aae 100644
--- a/lib/zip_replace_file.c
+++ b/lib/zip_replace_file.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_replace_file.c,v 1.8 2002/06/06 09:27:15 dillo Exp $
+ $NiH: zip_replace_file.c,v 1.9 2003/03/16 10:21:41 wiz Exp $
zip_replace_file.c -- replace file from file system
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -32,8 +32,9 @@
int
-zip_replace_file(struct zip *zf, int idx, char *name, struct zip_meta *meta,
- char *fname, int start, int len)
+zip_replace_file(struct zip *zf, int idx, const char *name,
+ struct zip_meta *meta,
+ const char *fname, int start, int len)
{
FILE *fp;
diff --git a/lib/zip_replace_filep.c b/lib/zip_replace_filep.c
index 53c2129..f8d9376 100644
--- a/lib/zip_replace_filep.c
+++ b/lib/zip_replace_filep.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_replace_filep.c,v 1.4 2002/06/06 09:27:15 dillo Exp $
+ $NiH: zip_replace_filep.c,v 1.5 2003/03/16 10:21:41 wiz Exp $
zip_replace_filep.c -- replace file from FILE*
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -39,8 +39,9 @@
int
-zip_replace_filep(struct zip *zf, int idx, char *name, struct zip_meta *meta,
- FILE *file, int start, int len)
+zip_replace_filep(struct zip *zf, int idx, const char *name,
+ struct zip_meta *meta,
+ FILE *file, int start, int len)
{
struct read_file *f;
diff --git a/lib/zip_replace_zip.c b/lib/zip_replace_zip.c
index 6d27309..c03c5a1 100644
--- a/lib/zip_replace_zip.c
+++ b/lib/zip_replace_zip.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_replace_zip.c,v 1.14 2002/06/06 09:27:15 dillo Exp $
+ $NiH: zip_replace_zip.c,v 1.15 2003/03/16 10:21:41 wiz Exp $
zip_replace_zip.c -- replace file from zip file
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -50,7 +50,8 @@
int
-zip_replace_zip(struct zip *zf, int idx, char *name, struct zip_meta *meta,
+zip_replace_zip(struct zip *zf, int idx, const char *name,
+ struct zip_meta *meta,
struct zip *srczf, int srcidx, int start, int len)
{
struct read_zip *z;
diff --git a/lib/zip_set_name.c b/lib/zip_set_name.c
index cce1167..84fe68f 100644
--- a/lib/zip_set_name.c
+++ b/lib/zip_set_name.c
@@ -1,8 +1,8 @@
/*
- $NiH: zip_set_name.c,v 1.6 2002/06/06 09:27:15 dillo Exp $
+ $NiH: zip_set_name.c,v 1.7 2003/03/16 10:21:41 wiz Exp $
zip_set_name.c -- rename helper function
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -32,7 +32,7 @@
int
-_zip_set_name(struct zip *zf, int idx, char *name)
+_zip_set_name(struct zip *zf, int idx, const char *name)
{
if (idx < 0 || idx >= zf->nentry) {
zip_err = ZERR_INVAL;
diff --git a/lib/zipint.h b/lib/zipint.h
index 256985b..fd5fd4c 100644
--- a/lib/zipint.h
+++ b/lib/zipint.h
@@ -2,10 +2,10 @@
#define _HAD_ZIPINT_H
/*
- $NiH: zipint.h,v 1.14 2002/06/06 09:27:17 dillo Exp $
+ $NiH: zipint.h,v 1.15 2003/03/16 10:21:42 wiz Exp $
zipint.h -- internal declarations.
- Copyright (C) 1999 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP files.
The authors can be contacted at <nih@giga.or.at>
@@ -44,7 +44,7 @@
int _zip_file_fillbuf(char *buf, int buflen, struct zip_file *zff);
void *_zip_memdup(const void *mem, int len);
void _zip_entry_init(struct zip *zf, int idx);
-int _zip_set_name(struct zip *zf, int idx, char *name);
+int _zip_set_name(struct zip *zf, int idx, const char *name);
struct zip_entry *_zip_new_entry(struct zip *zf);
int _zip_free_entry(struct zip_entry *ze);
int _zip_unchange_data(struct zip_entry *ze);