Barracuda Application Server C/C++ Reference
NO
|
43 #include "ThreadLib.h"
63 #define IOINTF_INVALIDNAME -11
67 #define IOINTF_NOTFOUND -12
71 #define IOINTF_EXIST -13
75 #define IOINTF_ENOENT -14
79 #define IOINTF_NOACCESS -15
83 #define IOINTF_NOTEMPTY -16
87 #define IOINTF_NOSPACE -17
91 #define IOINTF_IOERROR -18
95 #define IOINTF_MEM -19
97 #define IOINTF_LOCKED -20
102 #define IOINTF_NOIMPLEMENTATION -50
106 #define IOINTF_BUFTOOSMALL -51
111 #define IOINTF_NOZIPLIB -100
116 #define IOINTF_NOTCOMPRESSED -101
120 #define IOINTF_ZIPERROR -102
127 #define IOINTF_NOAESLIB -200
131 #define IOINTF_AES_NO_SUPPORT -201
134 #define IOINTF_NO_PASSWORD -202
138 #define IOINTF_WRONG_PASSWORD -203
144 #define IOINTF_AES_WRONG_AUTH -204
151 #define IOINTF_AES_COMPROMISED -205
158 typedef struct IoIntf* IoIntfPtr;
160 typedef struct DirIntf* DirIntfPtr;
162 typedef struct ResIntf* ResIntfPtr;
178 #define OpenRes_READ 1
181 #define OpenRes_WRITE 2
184 #define OpenRes_APPEND 4
202 IoIntfPtr o,
const char* password,
size_t passwordLen);
216 IoIntfPtr o, BaBool passwordRequired, BaBool passwordBin);
245 IoIntfPtr o,
const char* name,BaBool* isEncrypted);
261 IoIntfPtr io,
const char* name,
int* status,
const char** ecode);
270 ResIntfPtr resPtr,
const char* name,
ThreadMutex* m,
271 BaFileSize* size, BaBool* isCompressed);
308 int* status,
const char** ecode);
333 U32 mode,
int* status,
344 int* status,
const char** ecode);
348 typedef int (*
IoIntf_MkDir)(IoIntfPtr o,
const char* name,
const char** ecode);
356 typedef int (*
IoIntf_Remove)(IoIntfPtr o,
const char* name,
const char** ecode);
360 typedef int (*
IoIntf_RmDir)(IoIntfPtr o,
const char* name,
const char** ecode);
362 typedef int (*IoIntf_SeekAndRead)(
363 ResIntfPtr super, BaFileSize offset,
void* buf,
size_t maxSize,
size_t* size);
366 typedef void (*IoIntf_OnTerminate)(IoIntfPtr o, IoIntfPtr io);
419 struct IoIntf* attachedIo;
420 IoIntf_OnTerminate onTerminate;
426 #define IoIntf_constructorRW(o, property, closeDir, mkDir, rename,\
427 openDir, openRes, openResGzip, rm,\
429 (o)->propertyFp=property;\
430 (o)->closeDirFp=closeDir;\
432 (o)->renameFp=rename;\
433 (o)->openDirFp=openDir;\
434 (o)->openResFp=openRes;\
435 (o)->openResGzipFp=openResGzip;\
447 #define IoIntf_constructorR(o, property, closeDir, openDir,\
448 openRes, openResGzip, st) do {\
449 (o)->propertyFp=property;\
450 (o)->closeDirFp=closeDir;\
453 (o)->openDirFp=openDir;\
454 (o)->openResFp=openRes;\
455 (o)->openResGzipFp=openResGzip;\
471 typedef const char* (*DirIntf_GetName)(DirIntfPtr o);
506 #define DirIntf_constructor(o, read, getName, st) do {\
508 (o)->getNameFp=getName;\
515 ResIntfPtr o,
void* buf,
size_t maxSize,
size_t* size);
516 typedef int (*ResIntf_Write)(ResIntfPtr o,
const void* buf,
size_t size);
517 typedef int (*ResIntf_Seek)(ResIntfPtr o, BaFileSize offset);
518 typedef int (*ResIntf_Flush)(ResIntfPtr o);
519 typedef int (*ResIntf_Close)(ResIntfPtr o);
538 #define ResIntf_constructor(o, read, write, seek, flush, close) do {\
BA_API int IoIntf_isEncrypted(IoIntfPtr o, const char *name, BaBool *isEncrypted)
wrapper for IoIntf_Property: 'aes'.
int(* IoIntf_Stat)(IoIntfPtr o, const char *name, IoStat *st)
Fetch resource information.
Definition: IoIntf.h:312
int(* IoIntf_MkDir)(IoIntfPtr o, const char *name, const char **ecode)
Create a new directory.
Definition: IoIntf.h:348
int(* IoIntf_RmDir)(IoIntfPtr o, const char *name, const char **ecode)
delete an empty directory.
Definition: IoIntf.h:360
IoIntf_OpenRes openResFp
Open resource.
Definition: IoIntf.h:400
IoIntf_MkDir mkDirFp
Make directory.
Definition: IoIntf.h:388
BA_API int IoIntf_setPassword(IoIntfPtr o, const char *password, size_t passwordLen)
wrapper for IoIntf_Property: 'pl'.
struct IoIntf IoIntf
The IoIntf class specifies an abstract file API, implementations include ZipIo, DiskIo,...
ResIntf_Read readFp
Read from resource.
Definition: IoIntf.h:527
IoIntf_Rename renameFp
Rename resource.
Definition: IoIntf.h:392
Directory handle for a directory opened with IoIntf_OpenDir.
Definition: IoIntf.h:495
int(* DirIntf_Stat)(DirIntfPtr o, IoStat *st)
Returns resource information.
Definition: IoIntf.h:475
BA_API int IoIntf_setPasswordProp(IoIntfPtr o, BaBool passwordRequired, BaBool passwordBin)
wrapper for IoIntf_Property: 'pp'.
IoIntf_OpenResGzip openResGzipFp
Open file as a compressed gzip file.
Definition: IoIntf.h:404
BA_API int IoIntf_getType(IoIntfPtr o, const char **type, const char **platform)
wrapper for IoIntf_Property: 'type'.
int(* IoIntf_CloseDir)(IoIntfPtr o, DirIntfPtr *dirIntf)
Close an open directory iterator.
Definition: IoIntf.h:338
BaFileSize size
Get size.
Definition: IoIntf.h:172
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:10 GMT – i....
Definition: GenPrimT.h:93
BA_API char * IoIntf_getAbspath(IoIntfPtr o, const char *path)
wrapper for IoIntf_Property: 'abs'.
ResIntfPtr(* IoIntf_OpenResGzip)(IoIntfPtr o, const char *name, ThreadMutex *m, BaFileSize *size, int *status, const char **ecode)
Returns data as a compressed gzip file.
Definition: IoIntf.h:342
BA_API void IoIntf_destructor(IoIntfPtr o)
Virtual destructor.
DirIntf_Read readFp
Iterate the resources in the file system.
Definition: IoIntf.h:498
int(* IoIntf_Remove)(IoIntfPtr o, const char *name, const char **ecode)
Delete a file.
Definition: IoIntf.h:356
int(* IoIntf_Rename)(IoIntfPtr o, const char *from, const char *to, const char **ecode)
Close an open directory iterator.
Definition: IoIntf.h:352
ResIntf_Close closeFp
Close the resource and release any data.
Definition: IoIntf.h:535
ResIntf_Write writeFp
Write to resource.
Definition: IoIntf.h:529
BaBool isDir
Resource type.
Definition: IoIntf.h:174
ResIntfPtr(* IoIntf_OpenRes)(IoIntfPtr o, const char *name, U32 mode, int *status, const char **ecode)
Open a file for reading or writing.
Definition: IoIntf.h:332
ResIntf_Flush flushFp
Flush resource.
Definition: IoIntf.h:533
struct ResIntf ResIntf
Resource handle for a directory opened with IoIntf_OpenRes.
The IoIntf class specifies an abstract file API, implementations include ZipIo, DiskIo,...
Definition: IoIntf.h:377
IoIntf_Property propertyFp
Set or get property.
Definition: IoIntf.h:380
IoIntf_OpenDir openDirFp
Open directory.
Definition: IoIntf.h:396
int(* IoIntf_Property)(IoIntfPtr o, const char *name, void *a, void *b)
Set or get properties.
Definition: IoIntf.h:302
ResIntfPtr(* IoIntf_DeflateGzip)(ResIntfPtr resPtr, const char *name, ThreadMutex *m, BaFileSize *size, BaBool *isCompressed)
Deflate a file or portion of a file to temporary storage.
Definition: IoIntf.h:269
ResIntfPtr(* IoIntf_InflateGzip)(IoIntfPtr io, const char *name, int *status, const char **ecode)
Open a file for writing.
Definition: IoIntf.h:260
DirIntfPtr(* IoIntf_OpenDir)(IoIntfPtr o, const char *dirname, int *status, const char **ecode)
Open a directory for reading.
Definition: IoIntf.h:307
int(* ResIntf_Read)(ResIntfPtr o, void *buf, size_t maxSize, size_t *size)
Abstract Resource Interface.
Definition: IoIntf.h:514
IoIntf_Stat statFp
Get resource information.
Definition: IoIntf.h:416
int(* DirIntf_Read)(DirIntfPtr o)
Iterate to next resource in directory.
Definition: IoIntf.h:467
DirIntf_Stat statFp
Get resource information.
Definition: IoIntf.h:502
Resource handle for a directory opened with IoIntf_OpenRes.
Definition: IoIntf.h:525
BaTime lastModified
Get lastModified time.
Definition: IoIntf.h:170
IoIntf_Remove removeFp
Remove file.
Definition: IoIntf.h:408
const char *(* DirIntf_GetName)(DirIntfPtr o)
Returns the resource name.
Definition: IoIntf.h:471
A mutual exclusion class.
Definition: ThreadLib.h:186
ResIntf_Seek seekFp
Seek to position in resource.
Definition: IoIntf.h:531
Resource information.
Definition: IoIntf.h:168
struct DirIntf DirIntf
Directory handle for a directory opened with IoIntf_OpenDir.
IoIntf_CloseDir closeDirFp
Close directory.
Definition: IoIntf.h:384
IoIntf_RmDir rmDirFp
Remove directory.
Definition: IoIntf.h:412
DirIntf_GetName getNameFp
Get resource name.
Definition: IoIntf.h:500