SDTS_AL
cpl_vsi.h
Go to the documentation of this file.
1/******************************************************************************
2 * $Id$
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"
36
55/* -------------------------------------------------------------------- */
56/* We need access to ``struct stat''. */
57/* -------------------------------------------------------------------- */
58
59/* Unix */
60#if !defined(_WIN32)
61# include <unistd.h>
62#endif
63
64/* Windows */
65#include <sys/stat.h>
66
67CPL_C_START
68
70#ifdef ENABLE_EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
71#define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_WARN_UNUSED_RESULT
72#else
73#define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
74#endif
77/* ==================================================================== */
78/* stdio file access functions. These do not support large */
79/* files, and do not go through the virtualization API. */
80/* ==================================================================== */
81
84FILE CPL_DLL * VSIFOpen( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
85int CPL_DLL VSIFClose( FILE * );
86int CPL_DLL VSIFSeek( FILE *, long, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
87long CPL_DLL VSIFTell( FILE * ) CPL_WARN_UNUSED_RESULT;
88void CPL_DLL VSIRewind( FILE * );
89void CPL_DLL VSIFFlush( FILE * );
90
91size_t CPL_DLL VSIFRead( void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
92size_t CPL_DLL VSIFWrite( const void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
93char CPL_DLL *VSIFGets( char *, int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
94int CPL_DLL VSIFPuts( const char *, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
95int CPL_DLL VSIFPrintf( FILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
96
97int CPL_DLL VSIFGetc( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
98int CPL_DLL VSIFPutc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
99int CPL_DLL VSIUngetc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
100int CPL_DLL VSIFEof( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
101
104/* ==================================================================== */
105/* VSIStat() related. */
106/* ==================================================================== */
107
109typedef struct stat VSIStatBuf;
110int CPL_DLL VSIStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
113#ifdef _WIN32
114# define VSI_ISLNK(x) ( 0 ) /* N/A on Windows */
115# define VSI_ISREG(x) ((x) & S_IFREG)
116# define VSI_ISDIR(x) ((x) & S_IFDIR)
117# define VSI_ISCHR(x) ((x) & S_IFCHR)
118# define VSI_ISBLK(x) ( 0 ) /* N/A on Windows */
119#else
121# define VSI_ISLNK(x) S_ISLNK(x)
123# define VSI_ISREG(x) S_ISREG(x)
125# define VSI_ISDIR(x) S_ISDIR(x)
127# define VSI_ISCHR(x) S_ISCHR(x)
128# define VSI_ISBLK(x) S_ISBLK(x)
130#endif
131
132/* ==================================================================== */
133/* 64bit stdio file access functions. If we have a big size */
134/* defined, then provide prototypes for the large file API, */
135/* otherwise redefine to use the regular api. */
136/* ==================================================================== */
137
141#define VSI_L_OFFSET_MAX GUINTBIG_MAX
142
144/* Make VSIL_STRICT_ENFORCE active in DEBUG builds */
145#ifdef DEBUG
146#define VSIL_STRICT_ENFORCE
147#endif
150#ifdef VSIL_STRICT_ENFORCE
152typedef struct _VSILFILE VSILFILE;
153#else
155typedef FILE VSILFILE;
156#endif
157
158VSILFILE CPL_DLL * VSIFOpenL( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
159VSILFILE CPL_DLL * VSIFOpenExL( const char *, const char *, int ) CPL_WARN_UNUSED_RESULT;
160int CPL_DLL VSIFCloseL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
161int CPL_DLL VSIFSeekL( VSILFILE *, vsi_l_offset, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
163void CPL_DLL VSIRewindL( VSILFILE * );
164size_t CPL_DLL VSIFReadL( void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
165int CPL_DLL VSIFReadMultiRangeL( int nRanges, void ** ppData, const vsi_l_offset* panOffsets, const size_t* panSizes, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
166size_t CPL_DLL VSIFWriteL( const void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
167int CPL_DLL VSIFEofL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
168int CPL_DLL VSIFTruncateL( VSILFILE *, vsi_l_offset ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
169int CPL_DLL VSIFFlushL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
170int CPL_DLL VSIFPrintfL( VSILFILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
171int CPL_DLL VSIFPutcL( int, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
172
174typedef enum
175{
180
182
183int CPL_DLL VSIIngestFile( VSILFILE* fp,
184 const char* pszFilename,
185 GByte** ppabyRet,
186 vsi_l_offset* pnSize,
188
189#if defined(VSI_STAT64_T)
191typedef struct VSI_STAT64_T VSIStatBufL;
192#else
194#define VSIStatBufL VSIStatBuf
195#endif
196
197int CPL_DLL VSIStatL( const char *, VSIStatBufL * ) CPL_WARN_UNUSED_RESULT;
198
200#define VSI_STAT_EXISTS_FLAG 0x1
202#define VSI_STAT_NATURE_FLAG 0x2
204#define VSI_STAT_SIZE_FLAG 0x4
206#define VSI_STAT_SET_ERROR_FLAG 0x8
207
208int CPL_DLL VSIStatExL( const char * pszFilename, VSIStatBufL * psStatBuf, int nFlags ) CPL_WARN_UNUSED_RESULT;
209
210int CPL_DLL VSIIsCaseSensitiveFS( const char * pszFilename );
211
212int CPL_DLL VSISupportsSparseFiles( const char* pszPath );
213
214int CPL_DLL VSIHasOptimizedReadMultiRange( const char* pszPath );
215
216const char CPL_DLL *VSIGetActualURL( const char* pszFilename );
217
218char CPL_DLL *VSIGetSignedURL( const char* pszFilename, CSLConstList papszOptions );
219
220const char CPL_DLL *VSIGetFileSystemOptions( const char* pszFilename );
221
222char CPL_DLL **VSIGetFileSystemsPrefixes( void );
223
224void CPL_DLL *VSIFGetNativeFileDescriptorL( VSILFILE* );
225
226/* ==================================================================== */
227/* Memory allocation */
228/* ==================================================================== */
229
230void CPL_DLL *VSICalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT;
231void CPL_DLL *VSIMalloc( size_t ) CPL_WARN_UNUSED_RESULT;
232void CPL_DLL VSIFree( void * );
233void CPL_DLL *VSIRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT;
234char CPL_DLL *VSIStrdup( const char * ) CPL_WARN_UNUSED_RESULT;
235
236void CPL_DLL *VSIMallocAligned( size_t nAlignment, size_t nSize ) CPL_WARN_UNUSED_RESULT;
237void CPL_DLL *VSIMallocAlignedAuto( size_t nSize ) CPL_WARN_UNUSED_RESULT;
238void CPL_DLL VSIFreeAligned( void* ptr );
239
240void CPL_DLL *VSIMallocAlignedAutoVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
242#define VSI_MALLOC_ALIGNED_AUTO_VERBOSE( size ) VSIMallocAlignedAutoVerbose(size,__FILE__,__LINE__)
243
251void CPL_DLL *VSIMalloc2( size_t nSize1, size_t nSize2 ) CPL_WARN_UNUSED_RESULT;
252
260void CPL_DLL *VSIMalloc3( size_t nSize1, size_t nSize2, size_t nSize3 ) CPL_WARN_UNUSED_RESULT;
261
263void CPL_DLL *VSIMallocVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
265#define VSI_MALLOC_VERBOSE( size ) VSIMallocVerbose(size,__FILE__,__LINE__)
266
268void CPL_DLL *VSIMalloc2Verbose( size_t nSize1, size_t nSize2, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
270#define VSI_MALLOC2_VERBOSE( nSize1, nSize2 ) VSIMalloc2Verbose(nSize1,nSize2,__FILE__,__LINE__)
271
273void CPL_DLL *VSIMalloc3Verbose( size_t nSize1, size_t nSize2, size_t nSize3, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
275#define VSI_MALLOC3_VERBOSE( nSize1, nSize2, nSize3 ) VSIMalloc3Verbose(nSize1,nSize2,nSize3,__FILE__,__LINE__)
276
278void CPL_DLL *VSICallocVerbose( size_t nCount, size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
280#define VSI_CALLOC_VERBOSE( nCount, nSize ) VSICallocVerbose(nCount,nSize,__FILE__,__LINE__)
281
283void CPL_DLL *VSIReallocVerbose( void* pOldPtr, size_t nNewSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
285#define VSI_REALLOC_VERBOSE( pOldPtr, nNewSize ) VSIReallocVerbose(pOldPtr,nNewSize,__FILE__,__LINE__)
286
288char CPL_DLL *VSIStrdupVerbose( const char* pszStr, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
290#define VSI_STRDUP_VERBOSE( pszStr ) VSIStrdupVerbose(pszStr,__FILE__,__LINE__)
291
292GIntBig CPL_DLL CPLGetPhysicalRAM(void);
293GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void);
294
295/* ==================================================================== */
296/* Other... */
297/* ==================================================================== */
298
300#define CPLReadDir VSIReadDir
301char CPL_DLL **VSIReadDir( const char * );
302char CPL_DLL **VSIReadDirRecursive( const char *pszPath );
303char CPL_DLL **VSIReadDirEx( const char *pszPath, int nMaxFiles );
304int CPL_DLL VSIMkdir( const char * pszPathname, long mode );
305int CPL_DLL VSIMkdirRecursive( const char * pszPathname, long mode );
306int CPL_DLL VSIRmdir( const char * pszDirname );
307int CPL_DLL VSIRmdirRecursive( const char * pszDirname );
308int CPL_DLL VSIUnlink( const char * pszFilename );
309int CPL_DLL VSIRename( const char * oldpath, const char * newpath );
310char CPL_DLL *VSIStrerror( int );
311GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname);
312
313/* ==================================================================== */
314/* Install special file access handlers. */
315/* ==================================================================== */
316void CPL_DLL VSIInstallMemFileHandler(void);
318void CPL_DLL VSIInstallLargeFileHandler(void);
320void CPL_DLL VSIInstallSubFileHandler(void);
321void VSIInstallCurlFileHandler(void);
322void CPL_DLL VSICurlClearCache(void);
323void VSIInstallCurlStreamingFileHandler(void);
324void VSIInstallS3FileHandler(void);
325void VSIInstallS3StreamingFileHandler(void);
326void VSIInstallGSFileHandler(void);
327void VSIInstallGSStreamingFileHandler(void);
328void VSIInstallAzureFileHandler(void);
329void VSIInstallAzureStreamingFileHandler(void);
330void VSIInstallOSSFileHandler(void);
331void VSIInstallOSSStreamingFileHandler(void);
332void VSIInstallSwiftFileHandler(void);
333void VSIInstallSwiftStreamingFileHandler(void);
334void VSIInstallGZipFileHandler(void); /* No reason to export that */
335void VSIInstallZipFileHandler(void); /* No reason to export that */
336void VSIInstallStdinHandler(void); /* No reason to export that */
337void VSIInstallStdoutHandler(void); /* No reason to export that */
338void CPL_DLL VSIInstallSparseFileHandler(void);
339void VSIInstallTarFileHandler(void); /* No reason to export that */
340void CPL_DLL VSIInstallCryptFileHandler(void);
341void CPL_DLL VSISetCryptKey(const GByte* pabyKey, int nKeySize);
343void CPL_DLL VSICleanupFileManager(void);
346VSILFILE CPL_DLL *VSIFileFromMemBuffer( const char *pszFilename,
347 GByte *pabyData,
348 vsi_l_offset nDataLength,
349 int bTakeOwnership ) CPL_WARN_UNUSED_RESULT;
350GByte CPL_DLL *VSIGetMemFileBuffer( const char *pszFilename,
351 vsi_l_offset *pnDataLength,
352 int bUnlinkAndSeize );
353
355typedef size_t (*VSIWriteFunction)(const void* ptr, size_t size, size_t nmemb, FILE* stream);
356void CPL_DLL VSIStdoutSetRedirection( VSIWriteFunction pFct, FILE* stream );
357
358/* ==================================================================== */
359/* Time querying. */
360/* ==================================================================== */
361
363unsigned long CPL_DLL VSITime( unsigned long * );
364const char CPL_DLL *VSICTime( unsigned long );
365struct tm CPL_DLL *VSIGMTime( const time_t *pnTime,
366 struct tm *poBrokenTime );
367struct tm CPL_DLL *VSILocalTime( const time_t *pnTime,
368 struct tm *poBrokenTime );
372/* -------------------------------------------------------------------- */
373/* the following can be turned on for detailed logging of */
374/* almost all IO calls. */
375/* -------------------------------------------------------------------- */
376#ifdef VSI_DEBUG
377
378#ifndef DEBUG
379# define DEBUG
380#endif
381
382#include "cpl_error.h"
383
384#define VSIDebug4(f,a1,a2,a3,a4) CPLDebug( "VSI", f, a1, a2, a3, a4 );
385#define VSIDebug3( f, a1, a2, a3 ) CPLDebug( "VSI", f, a1, a2, a3 );
386#define VSIDebug2( f, a1, a2 ) CPLDebug( "VSI", f, a1, a2 );
387#define VSIDebug1( f, a1 ) CPLDebug( "VSI", f, a1 );
388#else
389#define VSIDebug4( f, a1, a2, a3, a4 ) {}
390#define VSIDebug3( f, a1, a2, a3 ) {}
391#define VSIDebug2( f, a1, a2 ) {}
392#define VSIDebug1( f, a1 ) {}
393#endif
396CPL_C_END
397
398#endif /* ndef CPL_VSI_H_INCLUDED */
unsigned long long GUIntBig
Definition: cpl_port.h:249
#define CPL_FORMAT_STRING(arg)
Definition: cpl_port.h:919
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Definition: cpl_port.h:904
#define CPL_WARN_UNUSED_RESULT
Definition: cpl_port.h:929
char ** CSLConstList
Definition: cpl_port.h:1184
unsigned char GByte
Definition: cpl_port.h:213
long long GIntBig
Definition: cpl_port.h:246
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:1500
vsi_l_offset CPL_DLL VSIFTellL(VSILFILE *) CPL_WARN_UNUSED_RESULT
Tell current file offset.
Definition: cpl_vsil.cpp:1031
void CPL_DLL * VSICallocVerbose(size_t nCount, size_t nSize, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1201
const char CPL_DLL * VSIGetFileSystemOptions(const char *pszFilename)
Return the list of options associated with a virtual file system handler as a serialized XML string.
Definition: cpl_vsil.cpp:1759
size_t(* VSIWriteFunction)(const void *ptr, size_t size, size_t nmemb, FILE *stream)
Definition: cpl_vsi.h:355
VSILFILE CPL_DLL * VSIFileFromMemBuffer(const char *pszFilename, GByte *pabyData, vsi_l_offset nDataLength, int bTakeOwnership) CPL_WARN_UNUSED_RESULT
Create memory "file" from a buffer.
Definition: cpl_vsi_mem.cpp:925
int CPL_DLL VSIHasOptimizedReadMultiRange(const char *pszPath)
Returns if the filesystem supports efficient multi-range reading.
Definition: cpl_vsil.cpp:703
char CPL_DLL ** VSIReadDirRecursive(const char *pszPath)
Read names in a directory recursively.
Definition: cpl_vsil.cpp:160
int CPL_DLL VSIStatExL(const char *pszFilename, VSIStatBufL *psStatBuf, int nFlags) CPL_WARN_UNUSED_RESULT
Get filesystem object info.
Definition: cpl_vsil.cpp:597
void CPL_DLL * VSIMallocAlignedAutoVerbose(size_t nSize, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:947
VSIRangeStatus
Definition: cpl_vsi.h:175
@ VSI_RANGE_STATUS_DATA
Definition: cpl_vsi.h:177
@ VSI_RANGE_STATUS_HOLE
Definition: cpl_vsi.h:178
@ VSI_RANGE_STATUS_UNKNOWN
Definition: cpl_vsi.h:176
void CPL_DLL VSIFreeAligned(void *ptr)
Definition: cpl_vsisimple.cpp:971
void VSIInstallStdinHandler(void)
Install /vsistdin/ file system handler.
Definition: cpl_vsil_stdin.cpp:434
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:1260
int CPL_DLL VSIFEofL(VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Test for end of file.
Definition: cpl_vsil.cpp:1306
void CPL_DLL * VSIMallocAlignedAuto(size_t nSize) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:934
void CPL_DLL * VSIMallocAligned(size_t nAlignment, size_t nSize) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:888
char CPL_DLL ** VSIGetFileSystemsPrefixes(void)
Return the list of prefixes for virtual file system handlers currently registered.
Definition: cpl_vsil.cpp:1739
void CPL_DLL VSIInstallSparseFileHandler(void)
Definition: cpl_vsil_sparsefile.cpp:559
void VSIInstallGZipFileHandler(void)
Install GZip file system handler.
Definition: cpl_vsil_gzip.cpp:1828
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:1206
int CPL_DLL VSIFFlushL(VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Flush pending writes to disk.
Definition: cpl_vsil.cpp:1094
char CPL_DLL * VSIStrdupVerbose(const char *pszStr, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1238
void CPL_DLL * VSIFGetNativeFileDescriptorL(VSILFILE *)
Returns the "native" file descriptor for the virtual handle.
Definition: cpl_vsil.cpp:1696
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:1463
void CPL_DLL VSIInstallSubFileHandler(void)
Definition: cpl_vsil_subfile.cpp:501
void VSIInstallStdoutHandler(void)
Install /vsistdout/ file system handler.
Definition: cpl_vsil_stdout.cpp:435
int CPL_DLL VSIRmdir(const char *pszDirname)
Delete a directory.
Definition: cpl_vsil.cpp:468
VSILFILE CPL_DLL * VSIFOpenL(const char *, const char *) CPL_WARN_UNUSED_RESULT
Open file.
Definition: cpl_vsil.cpp:818
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:1411
void CPL_DLL * VSIRealloc(void *, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:677
void CPL_DLL * VSIMalloc(size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:554
void CPL_DLL VSIInstallMemFileHandler(void)
Install "memory" file system handler.
Definition: cpl_vsi_mem.cpp:895
void CPL_DLL * VSIMalloc3(size_t nSize1, size_t nSize2, size_t nSize3) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1125
int CPL_DLL VSIIsCaseSensitiveFS(const char *pszFilename)
Returns if the filenames of the filesystem are case sensitive.
Definition: cpl_vsil.cpp:647
int CPL_DLL VSIRename(const char *oldpath, const char *newpath)
Rename a file.
Definition: cpl_vsil.cpp:439
void CPL_DLL * VSIMalloc2Verbose(size_t nSize1, size_t nSize2, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1151
GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void)
Definition: cpl_vsisimple.cpp:1431
GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname)
Return free disk space available on the filesystem.
Definition: cpl_vsil.cpp:1717
void VSIInstallZipFileHandler(void)
Install ZIP file system handler.
Definition: cpl_vsil_gzip.cpp:2665
size_t CPL_DLL VSIFReadL(void *, size_t, size_t, VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Read bytes from file.
Definition: cpl_vsil.cpp:1146
int CPL_DLL VSIRmdirRecursive(const char *pszDirname)
Delete a directory recursively.
Definition: cpl_vsil.cpp:490
void CPL_DLL * VSIMallocVerbose(size_t nSize, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1134
void CPL_DLL VSIStdoutSetRedirection(VSIWriteFunction pFct, FILE *stream)
Definition: cpl_vsil_stdout.cpp:64
char CPL_DLL ** VSIReadDirEx(const char *pszPath, int nMaxFiles)
Read names in a directory.
Definition: cpl_vsil.cpp:117
int CPL_DLL VSIFCloseL(VSILFILE *) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Close file.
Definition: cpl_vsil.cpp:928
void CPL_DLL * VSICalloc(size_t, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:440
void CPL_DLL * VSIReallocVerbose(void *pOldPtr, size_t nNewSize, const char *pszFile, int nLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1220
char CPL_DLL * VSIGetSignedURL(const char *pszFilename, CSLConstList papszOptions)
Returns a signed URL of a supplied filename.
Definition: cpl_vsil.cpp:780
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:1348
int CPL_DLL VSIUnlink(const char *pszFilename)
Delete a file.
Definition: cpl_vsil.cpp:408
char CPL_DLL * VSIStrerror(int)
Definition: cpl_vsisimple.cpp:1343
void CPL_DLL VSIFree(void *)
Definition: cpl_vsisimple.cpp:823
int CPL_DLL VSIFSeekL(VSILFILE *, vsi_l_offset, int) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
Seek to requested offset.
Definition: cpl_vsil.cpp:988
int CPL_DLL VSIStatL(const char *, VSIStatBufL *) CPL_WARN_UNUSED_RESULT
Get filesystem object info.
Definition: cpl_vsil.cpp:558
char CPL_DLL ** VSIReadDir(const char *)
Read names in a directory.
Definition: cpl_vsil.cpp:83
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:1176
int CPL_DLL VSISupportsSparseFiles(const char *pszPath)
Returns if the filesystem supports sparse files.
Definition: cpl_vsil.cpp:677
struct VSI_STAT64_T VSIStatBufL
Definition: cpl_vsi.h:191
void VSIInstallTarFileHandler(void)
Install /vsitar/ file system handler.
Definition: cpl_vsil_tar.cpp:586
const char CPL_DLL * VSIGetActualURL(const char *pszFilename)
Returns the actual URL of a supplied filename.
Definition: cpl_vsil.cpp:733
int CPL_DLL VSIMkdirRecursive(const char *pszPathname, long mode)
Create a directory and all its ancestors.
Definition: cpl_vsil.cpp:356
GIntBig CPL_DLL CPLGetPhysicalRAM(void)
Definition: cpl_vsisimple.cpp:1360
GByte CPL_DLL * VSIGetMemFileBuffer(const char *pszFilename, vsi_l_offset *pnDataLength, int bUnlinkAndSeize)
Fetch buffer underlying memory file.
Definition: cpl_vsi_mem.cpp:986
void CPL_DLL VSIRewindL(VSILFILE *)
Rewind the file pointer to the beginning of the file.
Definition: cpl_vsil.cpp:1053
VSILFILE CPL_DLL * VSIFOpenExL(const char *, const char *, int) CPL_WARN_UNUSED_RESULT
Open file.
Definition: cpl_vsil.cpp:872
FILE VSILFILE
Definition: cpl_vsi.h:155
char CPL_DLL * VSIStrdup(const char *) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:991
GUIntBig vsi_l_offset
Definition: cpl_vsi.h:139
int CPL_DLL VSIMkdir(const char *pszPathname, long mode)
Create a directory.
Definition: cpl_vsil.cpp:333
void CPL_DLL * VSIMalloc2(size_t nSize1, size_t nSize2) CPL_WARN_UNUSED_RESULT
Definition: cpl_vsisimple.cpp:1112