plugins_vfs_zip_vfs_zip_c.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. diff --git a/plugins/vfs_zip/vfs_zip.c b/plugins/vfs_zip/vfs_zip.c
  2. index 752e7f5..f146867 100644
  3. --- a/plugins/vfs_zip/vfs_zip.c
  4. +++ b/plugins/vfs_zip/vfs_zip.c
  5. @@ -54,7 +54,7 @@ typedef struct {
  6. int buffer_remaining;
  7. int buffer_pos;
  8. #endif
  9. -} zip_file_t;
  10. +} ddb_zip_file_t;
  11. static const char *scheme_names[] = { "zip://", NULL };
  12. @@ -108,8 +108,8 @@ vfs_zip_open (const char *fname) {
  13. return NULL;
  14. }
  15. - zip_file_t *f = malloc (sizeof (zip_file_t));
  16. - memset (f, 0, sizeof (zip_file_t));
  17. + ddb_zip_file_t *f = malloc (sizeof (ddb_zip_file_t));
  18. + memset (f, 0, sizeof (ddb_zip_file_t));
  19. f->file.vfs = &plugin;
  20. f->z = z;
  21. f->zf = zf;
  22. @@ -122,7 +122,7 @@ vfs_zip_open (const char *fname) {
  23. void
  24. vfs_zip_close (DB_FILE *f) {
  25. trace ("vfs_zip: close\n");
  26. - zip_file_t *zf = (zip_file_t *)f;
  27. + ddb_zip_file_t *zf = (ddb_zip_file_t *)f;
  28. if (zf->zf) {
  29. zip_fclose (zf->zf);
  30. }
  31. @@ -134,7 +134,7 @@ vfs_zip_close (DB_FILE *f) {
  32. size_t
  33. vfs_zip_read (void *ptr, size_t size, size_t nmemb, DB_FILE *f) {
  34. - zip_file_t *zf = (zip_file_t *)f;
  35. + ddb_zip_file_t *zf = (ddb_zip_file_t *)f;
  36. // printf ("read: %d\n", size*nmemb);
  37. size_t sz = size * nmemb;
  38. @@ -167,7 +167,7 @@ vfs_zip_read (void *ptr, size_t size, size_t nmemb, DB_FILE *f) {
  39. int
  40. vfs_zip_seek (DB_FILE *f, int64_t offset, int whence) {
  41. - zip_file_t *zf = (zip_file_t *)f;
  42. + ddb_zip_file_t *zf = (ddb_zip_file_t *)f;
  43. // printf ("seek: %lld (%d)\n", offset, whence);
  44. if (whence == SEEK_CUR) {
  45. @@ -242,13 +242,13 @@ vfs_zip_seek (DB_FILE *f, int64_t offset, int whence) {
  46. int64_t
  47. vfs_zip_tell (DB_FILE *f) {
  48. - zip_file_t *zf = (zip_file_t *)f;
  49. + ddb_zip_file_t *zf = (ddb_zip_file_t *)f;
  50. return zf->offset;
  51. }
  52. void
  53. vfs_zip_rewind (DB_FILE *f) {
  54. - zip_file_t *zf = (zip_file_t *)f;
  55. + ddb_zip_file_t *zf = (ddb_zip_file_t *)f;
  56. zip_fclose (zf->zf);
  57. zf->zf = zip_fopen_index (zf->z, zf->index, 0);
  58. assert (zf->zf); // FIXME: better error handling?
  59. @@ -260,7 +260,7 @@ vfs_zip_rewind (DB_FILE *f) {
  60. int64_t
  61. vfs_zip_getlength (DB_FILE *f) {
  62. - zip_file_t *zf = (zip_file_t *)f;
  63. + ddb_zip_file_t *zf = (ddb_zip_file_t *)f;
  64. return zf->size;
  65. }