~ubuntu-branches/debian/sid/gdal/sid

« back to all changes in this revision

Viewing changes to port/cpl_minizip_ioapi.cpp

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2012-05-07 15:04:42 UTC
  • mfrom: (5.5.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120507150442-2eks97loeh6rq005
Tags: 1.9.0-1
* Ready for sid, starting transition.
* All symfiles updated to latest builds.
* Added dh_numpy call in debian/rules to depend on numpy ABI.
* Policy bumped to 3.9.3, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
   Copyright (C) 1998-2005 Gilles Vollant
19
19
*/
20
20
 
 
21
#include "cpl_vsi.h"
 
22
 
21
23
#include <stdio.h>
22
24
#include <stdlib.h>
23
25
#include <string.h>
24
26
 
25
 
#include "cpl_vsi.h"
26
 
 
27
27
#include "zlib.h"
28
28
#include "cpl_minizip_ioapi.h"
29
29
 
73
73
static
74
74
voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
75
75
{
76
 
    FILE* file = NULL;
 
76
    VSILFILE* file = NULL;
77
77
    const char* mode_fopen = NULL;
78
78
    if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
79
79
        mode_fopen = "rb";
93
93
uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
94
94
{
95
95
    uLong ret;
96
 
    ret = (uLong)VSIFReadL(buf, 1, (size_t)size, (FILE *)stream);
 
96
    ret = (uLong)VSIFReadL(buf, 1, (size_t)size, (VSILFILE *)stream);
97
97
    return ret;
98
98
}
99
99
 
101
101
uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
102
102
{
103
103
    uLong ret;
104
 
    ret = (uLong)VSIFWriteL(buf, 1, (size_t)size, (FILE *)stream);
 
104
    ret = (uLong)VSIFWriteL(buf, 1, (size_t)size, (VSILFILE *)stream);
105
105
    return ret;
106
106
}
107
107
 
109
109
uLong64 ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
110
110
{
111
111
    uLong64 ret;
112
 
    ret = VSIFTellL((FILE *)stream);
 
112
    ret = VSIFTellL((VSILFILE *)stream);
113
113
    return ret;
114
114
}
115
115
 
132
132
    default: return -1;
133
133
    }
134
134
    ret = 0;
135
 
    VSIFSeekL((FILE *)stream, offset, fseek_origin);
 
135
    VSIFSeekL((VSILFILE *)stream, offset, fseek_origin);
136
136
    return ret;
137
137
}
138
138
 
140
140
int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
141
141
{
142
142
    int ret;
143
 
    ret = VSIFCloseL((FILE *)stream);
 
143
    ret = VSIFCloseL((VSILFILE *)stream);
144
144
    return ret;
145
145
}
146
146