SDTS_AL
cpl_vsi.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: cpl_vsi.h 39224 2017-06-21 08:50:19Z rouault $
3  *
4  * Project: CPL - Common Portability Library
5  * Author: Frank Warmerdam, warmerdam@pobox.com
6  * Purpose: Include file defining Virtual File System (VSI) functions, a
7  * layer over POSIX file and other system services.
8  *
9  ******************************************************************************
10  * Copyright (c) 1998, Frank Warmerdam
11  * Copyright (c) 2008-2014, Even Rouault <even dot rouault at mines-paris dot org>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  ****************************************************************************/
31 
32 #ifndef CPL_VSI_H_INCLUDED
33 #define CPL_VSI_H_INCLUDED
34 
35 #include "cpl_port.h"
54 /* -------------------------------------------------------------------- */
55 /* We need access to ``struct stat''. */
56 /* -------------------------------------------------------------------- */
57 
58 /* Unix */
59 #if !defined(_WIN32)
60 # include <unistd.h>
61 #endif
62 
63 /* Windows */
64 #include <sys/stat.h>
65 
66 CPL_C_START
67 
69 #ifdef ENABLE_EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
70 #define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_WARN_UNUSED_RESULT
71 #else
72 #define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
73 #endif
74 
76 /* ==================================================================== */
77 /* stdio file access functions. These do not support large */
78 /* files, and do not go through the virtualization API. */
79 /* ==================================================================== */
80 
83 FILE CPL_DLL * VSIFOpen( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
84 int CPL_DLL VSIFClose( FILE * );
85 int CPL_DLL VSIFSeek( FILE *, long, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
86 long CPL_DLL VSIFTell( FILE * ) CPL_WARN_UNUSED_RESULT;
87 void CPL_DLL VSIRewind( FILE * );
88 void CPL_DLL VSIFFlush( FILE * );
89 
90 size_t CPL_DLL VSIFRead( void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
91 size_t CPL_DLL VSIFWrite( const void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
92 char CPL_DLL *VSIFGets( char *, int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
93 int CPL_DLL VSIFPuts( const char *, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
94 int CPL_DLL VSIFPrintf( FILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
95 
96 int CPL_DLL VSIFGetc( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
97 int CPL_DLL VSIFPutc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
98 int CPL_DLL VSIUngetc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
99 int CPL_DLL VSIFEof( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
100 
103 /* ==================================================================== */
104 /* VSIStat() related. */
105 /* ==================================================================== */
106 
108 typedef struct stat VSIStatBuf;
109 int CPL_DLL VSIStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
112 #ifdef _WIN32
113 # define VSI_ISLNK(x) ( 0 ) /* N/A on Windows */
114 # define VSI_ISREG(x) ((x) & S_IFREG)
115 # define VSI_ISDIR(x) ((x) & S_IFDIR)
116 # define VSI_ISCHR(x) ((x) & S_IFCHR)
117 # define VSI_ISBLK(x) ( 0 ) /* N/A on Windows */
118 #else
119 
120 # define VSI_ISLNK(x) S_ISLNK(x)
121 
122 # define VSI_ISREG(x) S_ISREG(x)
123 
124 # define VSI_ISDIR(x) S_ISDIR(x)
125 
126 # define VSI_ISCHR(x) S_ISCHR(x)
127 # define VSI_ISBLK(x) S_ISBLK(x)
128 
129 #endif
130 
131 /* ==================================================================== */
132 /* 64bit stdio file access functions. If we have a big size */
133 /* defined, then provide prototypes for the large file API, */
134 /* otherwise redefine to use the regular api. */
135 /* ==================================================================== */
136 
140 #define VSI_L_OFFSET_MAX GUINTBIG_MAX
141 
143 /* Make VSIL_STRICT_ENFORCE active in DEBUG builds */
144 #ifdef DEBUG
145 #define VSIL_STRICT_ENFORCE
146 #endif
147 
149 #ifdef VSIL_STRICT_ENFORCE
150 
151 typedef struct _VSILFILE VSILFILE;
152 #else
153 
154 typedef FILE VSILFILE;
155 #endif
156 
157 VSILFILE CPL_DLL * VSIFOpenL( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
158 VSILFILE CPL_DLL * VSIFOpenExL( const char *, const char *, int ) CPL_WARN_UNUSED_RESULT;
159 int CPL_DLL VSIFCloseL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
160 int CPL_DLL VSIFSeekL( VSILFILE *, vsi_l_offset, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
161 vsi_l_offset CPL_DLL VSIFTellL( VSILFILE * ) CPL_WARN_UNUSED_RESULT;
162 void CPL_DLL VSIRewindL( VSILFILE * );
163 size_t CPL_DLL VSIFReadL( void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
164 int CPL_DLL VSIFReadMultiRangeL( int nRanges, void ** ppData, const vsi_l_offset* panOffsets, const size_t* panSizes, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
165 size_t CPL_DLL VSIFWriteL( const void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
166 int CPL_DLL VSIFEofL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
167 int CPL_DLL VSIFTruncateL( VSILFILE *, vsi_l_offset ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
168 int CPL_DLL VSIFFlushL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
169 int CPL_DLL VSIFPrintfL( VSILFILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
170 int CPL_DLL VSIFPutcL( int, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
171 
173 typedef enum
174 {
179 
180 VSIRangeStatus CPL_DLL VSIFGetRangeStatusL( VSILFILE * fp, vsi_l_offset nStart, vsi_l_offset nLength );
181 
182 int CPL_DLL VSIIngestFile( VSILFILE* fp,
183  const char* pszFilename,
184  GByte** ppabyRet,
185  vsi_l_offset* pnSize,
186  GIntBig nMaxSize ) CPL_WARN_UNUSED_RESULT;
187 
188 #if defined(VSI_STAT64_T)
189 
190 typedef struct VSI_STAT64_T VSIStatBufL;
191 #else
192 
193 #define VSIStatBufL VSIStatBuf
194 #endif
195 
196 int CPL_DLL VSIStatL( const char *, VSIStatBufL * ) CPL_WARN_UNUSED_RESULT;
197 
199 #define VSI_STAT_EXISTS_FLAG 0x1
200 
201 #define VSI_STAT_NATURE_FLAG 0x2
202 
203 #define VSI_STAT_SIZE_FLAG 0x4
204 
205 #define VSI_STAT_SET_ERROR_FLAG 0x8
206 
207 int CPL_DLL VSIStatExL( const char * pszFilename, VSIStatBufL * psStatBuf, int nFlags ) CPL_WARN_UNUSED_RESULT;
208 
209 int CPL_DLL VSIIsCaseSensitiveFS( const char * pszFilename );
210 
211 int CPL_DLL VSISupportsSparseFiles( const char* pszPath );
212 
213 void CPL_DLL *VSIFGetNativeFileDescriptorL( VSILFILE* );
214 
215 /* ==================================================================== */
216 /* Memory allocation */
217 /* ==================================================================== */
218 
219 void CPL_DLL *VSICalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT;
220 void CPL_DLL *VSIMalloc( size_t ) CPL_WARN_UNUSED_RESULT;
221 void CPL_DLL VSIFree( void * );
222 void CPL_DLL *VSIRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT;
223 char CPL_DLL *VSIStrdup( const char * ) CPL_WARN_UNUSED_RESULT;
224 
225 void CPL_DLL *VSIMallocAligned( size_t nAlignment, size_t nSize ) CPL_WARN_UNUSED_RESULT;
226 void CPL_DLL *VSIMallocAlignedAuto( size_t nSize ) CPL_WARN_UNUSED_RESULT;
227 void CPL_DLL VSIFreeAligned( void* ptr );
228 
229 void CPL_DLL *VSIMallocAlignedAutoVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
231 #define VSI_MALLOC_ALIGNED_AUTO_VERBOSE( size ) VSIMallocAlignedAutoVerbose(size,__FILE__,__LINE__)
232 
240 void CPL_DLL *VSIMalloc2( size_t nSize1, size_t nSize2 ) CPL_WARN_UNUSED_RESULT;
241 
249 void CPL_DLL *VSIMalloc3( size_t nSize1, size_t nSize2, size_t nSize3 ) CPL_WARN_UNUSED_RESULT;
250 
252 void CPL_DLL *VSIMallocVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
254 #define VSI_MALLOC_VERBOSE( size ) VSIMallocVerbose(size,__FILE__,__LINE__)
255 
257 void CPL_DLL *VSIMalloc2Verbose( size_t nSize1, size_t nSize2, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
259 #define VSI_MALLOC2_VERBOSE( nSize1, nSize2 ) VSIMalloc2Verbose(nSize1,nSize2,__FILE__,__LINE__)
260 
262 void CPL_DLL *VSIMalloc3Verbose( size_t nSize1, size_t nSize2, size_t nSize3, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
264 #define VSI_MALLOC3_VERBOSE( nSize1, nSize2, nSize3 ) VSIMalloc3Verbose(nSize1,nSize2,nSize3,__FILE__,__LINE__)
265 
267 void CPL_DLL *VSICallocVerbose( size_t nCount, size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
269 #define VSI_CALLOC_VERBOSE( nCount, nSize ) VSICallocVerbose(nCount,nSize,__FILE__,__LINE__)
270 
272 void CPL_DLL *VSIReallocVerbose( void* pOldPtr, size_t nNewSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
274 #define VSI_REALLOC_VERBOSE( pOldPtr, nNewSize ) VSIReallocVerbose(pOldPtr,nNewSize,__FILE__,__LINE__)
275 
277 char CPL_DLL *VSIStrdupVerbose( const char* pszStr, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
279 #define VSI_STRDUP_VERBOSE( pszStr ) VSIStrdupVerbose(pszStr,__FILE__,__LINE__)
280 
281 GIntBig CPL_DLL CPLGetPhysicalRAM(void);
282 GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void);
283 
284 /* ==================================================================== */
285 /* Other... */
286 /* ==================================================================== */
287 
289 #define CPLReadDir VSIReadDir
290 char CPL_DLL **VSIReadDir( const char * );
291 char CPL_DLL **VSIReadDirRecursive( const char *pszPath );
292 char CPL_DLL **VSIReadDirEx( const char *pszPath, int nMaxFiles );
293 int CPL_DLL VSIMkdir( const char * pathname, long mode );
294 int CPL_DLL VSIRmdir( const char * pathname );
295 int CPL_DLL VSIUnlink( const char * pathname );
296 int CPL_DLL VSIRename( const char * oldpath, const char * newpath );
297 char CPL_DLL *VSIStrerror( int );
298 GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname);
299 
300 /* ==================================================================== */
301 /* Install special file access handlers. */
302 /* ==================================================================== */
303 void CPL_DLL VSIInstallMemFileHandler(void);
305 void CPL_DLL VSIInstallLargeFileHandler(void);
307 void CPL_DLL VSIInstallSubFileHandler(void);
308 void VSIInstallCurlFileHandler(void);
309 void CPL_DLL VSICurlClearCache(void);
310 void VSIInstallCurlStreamingFileHandler(void);
311 void VSIInstallS3FileHandler(void);
312 void VSIInstallS3StreamingFileHandler(void);
313 void VSIInstallGSFileHandler(void);
314 void VSIInstallGSStreamingFileHandler(void);
315 void VSIInstallGZipFileHandler(void); /* No reason to export that */
316 void VSIInstallZipFileHandler(void); /* No reason to export that */
317 void VSIInstallStdinHandler(void); /* No reason to export that */
318 void VSIInstallStdoutHandler(void); /* No reason to export that */
319 void CPL_DLL VSIInstallSparseFileHandler(void);
320 void VSIInstallTarFileHandler(void); /* No reason to export that */
321 void CPL_DLL VSIInstallCryptFileHandler(void);
322 void CPL_DLL VSISetCryptKey(const GByte* pabyKey, int nKeySize);
324 void CPL_DLL VSICleanupFileManager(void);
327 VSILFILE CPL_DLL *VSIFileFromMemBuffer( const char *pszFilename,
328  GByte *pabyData,
329  vsi_l_offset nDataLength,
330  int bTakeOwnership ) CPL_WARN_UNUSED_RESULT;
331 GByte CPL_DLL *VSIGetMemFileBuffer( const char *pszFilename,
332  vsi_l_offset *pnDataLength,
333  int bUnlinkAndSeize );
334 
336 typedef size_t (*VSIWriteFunction)(const void* ptr, size_t size, size_t nmemb, FILE* stream);
337 void CPL_DLL VSIStdoutSetRedirection( VSIWriteFunction pFct, FILE* stream );
338 
339 /* ==================================================================== */
340 /* Time querying. */
341 /* ==================================================================== */
342 
344 unsigned long CPL_DLL VSITime( unsigned long * );
345 const char CPL_DLL *VSICTime( unsigned long );
346 struct tm CPL_DLL *VSIGMTime( const time_t *pnTime,
347  struct tm *poBrokenTime );
348 struct tm CPL_DLL *VSILocalTime( const time_t *pnTime,
349  struct tm *poBrokenTime );
353 /* -------------------------------------------------------------------- */
354 /* the following can be turned on for detailed logging of */
355 /* almost all IO calls. */
356 /* -------------------------------------------------------------------- */
357 #ifdef VSI_DEBUG
358 
359 #ifndef DEBUG
360 # define DEBUG
361 #endif
362 
363 #include "cpl_error.h"
364 
365 #define VSIDebug4(f,a1,a2,a3,a4) CPLDebug( "VSI", f, a1, a2, a3, a4 );
366 #define VSIDebug3( f, a1, a2, a3 ) CPLDebug( "VSI", f, a1, a2, a3 );
367 #define VSIDebug2( f, a1, a2 ) CPLDebug( "VSI", f, a1, a2 );
368 #define VSIDebug1( f, a1 ) CPLDebug( "VSI", f, a1 );
369 #else
370 #define VSIDebug4( f, a1, a2, a3, a4 ) {}
371 #define VSIDebug3( f, a1, a2, a3 ) {}
372 #define VSIDebug2( f, a1, a2 ) {}
373 #define VSIDebug1( f, a1 ) {}
374 #endif
375 
377 CPL_C_END
378 
379 #endif /* ndef CPL_VSI_H_INCLUDED */
VSIRangeStatus
Definition: cpl_vsi.h:173
char CPL_DLL * VSIStrerror(int)
Definition: cpl_vsisimple.cpp:1335
void CPL_DLL * VSIMalloc(size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:548
char CPL_DLL ** VSIReadDirEx(const char *pszPath, int nMaxFiles)
Read names in a directory.
Definition: cpl_vsil.cpp:116
void CPL_DLL * VSICallocVerbose(size_t nCount, size_t nSize, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1193
int CPL_DLL VSIFSeekL(VSILFILE *, vsi_l_offset, int) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Seek to requested offset.
Definition: cpl_vsil.cpp:764
Definition: cpl_vsi.h:177
void CPL_DLL VSIInstallSubFileHandler(void)
Definition: cpl_vsil_subfile.cpp:496
int CPL_DLL VSIMkdir(const char *pathname, long mode)
Create a directory.
Definition: cpl_vsil.cpp:329
void CPL_DLL * VSIFGetNativeFileDescriptorL(VSILFILE *)
Returns the &quot;native&quot; file descriptor for the virtual handle.
Definition: cpl_vsil.cpp:1474
int CPL_DLL VSIFCloseL(VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Close file.
Definition: cpl_vsil.cpp:712
FILE VSILFILE
Definition: cpl_vsi.h:154
vsi_l_offset CPL_DLL VSIFTellL(VSILFILE *) CPL_WARN_UNUSED_RESULT
Tell current file offset.
Definition: cpl_vsil.cpp:807
size_t CPL_DLL VSIFReadL(void *, size_t, size_t, VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Read bytes from file.
Definition: cpl_vsil.cpp:922
int CPL_DLL int CPL_DLL VSIFPutcL(int, VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Write a single byte to the file.
Definition: cpl_vsil.cpp:1187
int CPL_DLL VSIIngestFile(VSILFILE *fp, const char *pszFilename, GByte **ppabyRet, vsi_l_offset *pnSize, GIntBig nMaxSize) CPL_WARN_UNUSED_RESULT
Ingest a file into memory.
Definition: cpl_vsil.cpp:1278
Definition: cpl_vsi.h:176
unsigned char GByte
Definition: cpl_port.h:207
void CPL_DLL * VSIMalloc3(size_t nSize1, size_t nSize2, size_t nSize3) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1117
int CPL_DLL VSIStatExL(const char *pszFilename, VSIStatBufL *psStatBuf, int nFlags) CPL_WARN_UNUSED_RESULT
Get filesystem object info.
Definition: cpl_vsil.cpp:490
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Definition: cpl_port.h:967
int CPL_DLL VSIFTruncateL(VSILFILE *, vsi_l_offset) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Truncate/expand the file to the specified size.
Definition: cpl_vsil.cpp:1124
void CPL_DLL * VSIMalloc2(size_t nSize1, size_t nSize2) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1104
void CPL_DLL * VSIMallocAlignedAutoVerbose(size_t nSize, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:941
int CPL_DLL VSIRename(const char *oldpath, const char *newpath)
Rename a file.
Definition: cpl_vsil.cpp:388
void VSIInstallStdoutHandler(void)
Install /vsistdout/ file system handler.
Definition: cpl_vsil_stdout.cpp:434
void CPL_DLL * VSIMallocAlignedAuto(size_t nSize) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:928
void VSIInstallStdinHandler(void)
Install /vsistdin/ file system handler.
Definition: cpl_vsil_stdin.cpp:421
VSILFILE CPL_DLL * VSIFileFromMemBuffer(const char *pszFilename, GByte *pabyData, vsi_l_offset nDataLength, int bTakeOwnership) CPL_WARN_UNUSED_RESULT
Create memory &quot;file&quot; from a buffer.
Definition: cpl_vsi_mem.cpp:933
void CPL_DLL * VSICalloc(size_t, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:438
VSIRangeStatus CPL_DLL VSIFGetRangeStatusL(VSILFILE *fp, vsi_l_offset nStart, vsi_l_offset nLength)
Return if a given file range contains data or holes filled with zeroes.
Definition: cpl_vsil.cpp:1241
void CPL_DLL * VSIReallocVerbose(void *pOldPtr, size_t nNewSize, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1212
void CPL_DLL * VSIMallocAligned(size_t nAlignment, size_t nSize) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:882
void VSIInstallTarFileHandler(void)
Install /vsitar/ file system handler.
Definition: cpl_vsil_tar.cpp:538
void VSIInstallZipFileHandler(void)
Install ZIP file system handler.
Definition: cpl_vsil_gzip.cpp:2634
char CPL_DLL ** VSIReadDirRecursive(const char *pszPath)
Read names in a directory recursively.
Definition: cpl_vsil.cpp:159
struct VSI_STAT64_T VSIStatBufL
Definition: cpl_vsi.h:190
void CPL_DLL VSIInstallSparseFileHandler(void)
Definition: cpl_vsil_sparsefile.cpp:588
int CPL_DLL VSISupportsSparseFiles(const char *pszPath)
Returns if the filesystem supports sparse files.
Definition: cpl_vsil.cpp:570
Definition: cpl_vsi.h:175
int CPL_DLL VSIFEofL(VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Test for end of file.
Definition: cpl_vsil.cpp:1082
int CPL_DLL VSIFReadMultiRangeL(int nRanges, void **ppData, const vsi_l_offset *panOffsets, const size_t *panSizes, VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Read several ranges of bytes from file.
Definition: cpl_vsil.cpp:982
void CPL_DLL * VSIMalloc2Verbose(size_t nSize1, size_t nSize2, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1143
VSILFILE CPL_DLL * VSIFOpenExL(const char *, const char *, int) CPL_WARN_UNUSED_RESULT
Open file.
Definition: cpl_vsil.cpp:662
void VSIInstallGZipFileHandler(void)
Install GZip file system handler.
Definition: cpl_vsil_gzip.cpp:1805
void CPL_DLL * VSIMallocVerbose(size_t nSize, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1126
char CPL_DLL * VSIStrdup(const char *) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:985
int CPL_DLL VSIUnlink(const char *pathname)
Delete a file.
Definition: cpl_vsil.cpp:357
char CPL_DLL ** VSIReadDir(const char *)
Read names in a directory.
Definition: cpl_vsil.cpp:82
int CPL_DLL VSIFFlushL(VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Flush pending writes to disk.
Definition: cpl_vsil.cpp:870
GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname)
Return free disk space available on the filesystem.
Definition: cpl_vsil.cpp:1495
unsigned long long GUIntBig
Definition: cpl_port.h:253
size_t(* VSIWriteFunction)(const void *ptr, size_t size, size_t nmemb, FILE *stream)
Definition: cpl_vsi.h:336
char CPL_DLL * VSIStrdupVerbose(const char *pszStr, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1230
void CPL_DLL VSIFree(void *)
Definition: cpl_vsisimple.cpp:817
VSILFILE CPL_DLL * VSIFOpenL(const char *, const char *) CPL_WARN_UNUSED_RESULT
Open file.
Definition: cpl_vsil.cpp:608
int CPL_DLL VSIStatL(const char *, VSIStatBufL *) CPL_WARN_UNUSED_RESULT
Get filesystem object info.
Definition: cpl_vsil.cpp:451
GByte CPL_DLL * VSIGetMemFileBuffer(const char *pszFilename, vsi_l_offset *pnDataLength, int bUnlinkAndSeize)
Fetch buffer underlying memory file.
Definition: cpl_vsi_mem.cpp:992
size_t CPL_DLL VSIFWriteL(const void *, size_t, size_t, VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Write bytes to file.
Definition: cpl_vsil.cpp:1036
#define CPL_FORMAT_STRING(arg)
Definition: cpl_port.h:989
GIntBig CPL_DLL CPLGetPhysicalRAM(void)
Definition: cpl_vsisimple.cpp:1352
GUIntBig vsi_l_offset
Definition: cpl_vsi.h:138
#define CPL_WARN_UNUSED_RESULT
Definition: cpl_port.h:999
GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void)
Definition: cpl_vsisimple.cpp:1423
void CPL_DLL VSIInstallMemFileHandler(void)
Install &quot;memory&quot; file system handler.
Definition: cpl_vsi_mem.cpp:903
long long GIntBig
Definition: cpl_port.h:250
void CPL_DLL VSIRewindL(VSILFILE *)
Rewind the file pointer to the beginning of the file.
Definition: cpl_vsil.cpp:829
int CPL_DLL VSIIsCaseSensitiveFS(const char *pszFilename)
Returns if the filenames of the filesystem are case sensitive.
Definition: cpl_vsil.cpp:540
void CPL_DLL VSIStdoutSetRedirection(VSIWriteFunction pFct, FILE *stream)
Definition: cpl_vsil_stdout.cpp:64
void CPL_DLL * VSIRealloc(void *, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:671
void CPL_DLL VSIFreeAligned(void *ptr)
Definition: cpl_vsisimple.cpp:965
int CPL_DLL VSIRmdir(const char *pathname)
Delete a directory.
Definition: cpl_vsil.cpp:417
void CPL_DLL * VSIMalloc3Verbose(size_t nSize1, size_t nSize2, size_t nSize3, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1168