• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 12.0.1.79
GD_C_FileSystem.h
Go to the documentation of this file.
1 /*
2  * (c) 2016 Good Technology Corporation. All rights reserved.
3  */
4 
5 #ifndef GD_C_FILESYSTEM_H
6 #define GD_C_FILESYSTEM_H
7 
8 #include <stddef.h>
9 #include <stdarg.h>
10 #include <stdio.h>
11 #include <sys/stat.h>
12 
20 typedef size_t GD_FILE;
21 
25 typedef size_t GD_DIR;
26 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #ifndef GD_C_API
35 # if !defined(_WIN32)
36 # define GD_C_API __attribute__((visibility("default")))
37 # else
38 # define GD_C_API
39 # endif
40 #endif
41 
42 #ifndef GD_C_API_EXT
43 # define GD_C_API_EXT
44 #endif
45 
46 #if defined(_WIN32)
47 # define GD_ATTRIBUTE(ignore)
48 #else
49 # define GD_ATTRIBUTE __attribute__
50 #endif
51 
81 GD_C_API GD_FILE* GD_fopen(const char* filename, const char* mode);
82 
94 GD_C_API int GD_fclose(GD_FILE* filePointer);
95 
124 GD_C_API size_t GD_fread(void* ptr, size_t size, size_t count, GD_FILE* filePointer);
125 
152 GD_C_API size_t GD_fwrite(const void* ptr, size_t size, size_t count, GD_FILE* filePointer);
153 
161 GD_C_API int GD_remove(const char* filename);
162 
171 GD_C_API long int GD_ftell(GD_FILE* filePointer);
172 
181 GD_C_API off_t GD_ftello(GD_FILE* filePointer);
182 
195 GD_C_API int GD_fseek(GD_FILE* filePointer, long int offset, int origin);
196 
209 GD_C_API int GD_fseeko(GD_FILE* filePointer, off_t offset, int origin);
210 
223 GD_C_API int GD_fscanf(GD_FILE* filePointer, const char* format, ...) GD_ATTRIBUTE((format(scanf,2,3)));
224 
225 
245 GD_C_API int GD_vfscanf(GD_FILE* filePointer, const char * format, va_list args) GD_ATTRIBUTE((format(scanf,2,0)));
246 
254 GD_C_API int GD_feof(GD_FILE* filePointer);
255 
266 GD_C_API char* GD_tmpnam(char* str);
267 
281 GD_C_API int GD_truncate(const char* filename, off_t length);
282 
295 GD_C_API int GD_ftruncate(GD_FILE* filePointer, off_t length);
296 
329 GD_C_API GD_FILE* GD_freopen(const char* filename, const char* mode, GD_FILE* filePointer);
330 
344 GD_C_API int GD_fgetpos(GD_FILE* filePointer, fpos_t* pos);
345 
361 GD_C_API int GD_fsetpos(GD_FILE* filePointer, const fpos_t* pos);
362 
370 GD_C_API void GD_rewind(GD_FILE* filePointer);
371 
385 GD_C_API int GD_fgetc(GD_FILE* filePointer);
386 
406 GD_C_API char* GD_fgets(char* buf, int count, GD_FILE* filePointer);
407 
421 GD_C_API int GD_fputc(int character, GD_FILE* filePointer);
422 
435 GD_C_API int GD_fputs(const char* buf, GD_FILE* filePointer);
436 
450 GD_C_API int GD_fprintf(GD_FILE* filePointer, const char* format, ...) GD_ATTRIBUTE((format(printf,2,3)));
451 
471 GD_C_API int GD_vfprintf(GD_FILE* filePointer, const char * format, va_list args) GD_ATTRIBUTE((format(printf,2,0)));
472 
488 GD_C_API int GD_rename(const char* oldname, const char* newname);
489 
518 GD_C_API int GD_setvbuf(GD_FILE* filePointer, char* buf, int mode, size_t size);
519 
545 GD_C_API void GD_setbuffer(GD_FILE* filePointer, char* buf, int size);
546 
570 GD_C_API void GD_setbuf(GD_FILE* filePointer, char* buf);
571 
587 GD_C_API int GD_fflush(GD_FILE* filePointer);
588 
604 GD_C_API int GD_fsync(GD_FILE* filePointer);
605 
615 GD_C_API void GD_clearerr(GD_FILE* filePointer);
616 
627 GD_C_API int GD_ferror(GD_FILE* filePointer);
628 
638 GD_C_API int GD_mkdir(const char* dirname, mode_t mode);
639 
649 GD_C_API GD_DIR* GD_opendir(const char *dirname);
650 
659 GD_C_API int GD_closedir(GD_DIR *dirp);
660 
671 GD_C_API struct dirent* GD_readdir(GD_DIR *dirp);
672 
691 GD_C_API int GD_readdir_r(GD_DIR* dirp, struct dirent* entry, struct dirent** result);
692 
699 GD_C_API void GD_rewinddir(GD_DIR *dirp);
700 
710 GD_C_API void GD_seekdir(GD_DIR *dirp, long loc);
711 
723 GD_C_API long GD_telldir(GD_DIR *dirp);
724 
736 GD_C_API int GD_stat(const char* path, struct stat* buf);
737 
748 GD_C_API int GD_statdir(GD_DIR *dirp, const char* name, struct stat* buf);
749 
763 GD_C_API int GD_getc(GD_FILE* filePointer);
764 
776 GD_C_API int GD_ungetc(int character, GD_FILE* filePointer);
777 
778 #ifdef __cplusplus
779 }
780 #endif
781 
785 #endif // GD_C_FILESYSTEM_H
GD_setvbuf
int GD_setvbuf(GD_FILE *filePointer, char *buf, int mode, size_t size)
Change stream buffering.
GD_readdir
struct dirent * GD_readdir(GD_DIR *dirp)
Read next directory entry.
GD_rewinddir
void GD_rewinddir(GD_DIR *dirp)
Reset directory stream.
GD_vfprintf
int GD_vfprintf(GD_FILE *filePointer, const char *format, va_list args)
Write formatted data from variable argument list to stream.
GD_fputc
int GD_fputc(int character, GD_FILE *filePointer)
Write character to stream.
GD_rename
int GD_rename(const char *oldname, const char *newname)
Rename file.
GD_tmpnam
char * GD_tmpnam(char *str)
Generate a unique file name.
GD_fgetc
int GD_fgetc(GD_FILE *filePointer)
Get character from stream.
GD_fsetpos
int GD_fsetpos(GD_FILE *filePointer, const fpos_t *pos)
Set position indicator of stream.
GD_ftello
off_t GD_ftello(GD_FILE *filePointer)
Get the current position of the file pointer.
GD_mkdir
int GD_mkdir(const char *dirname, mode_t mode)
Create a directory at the specified path.
GD_ATTRIBUTE
#define GD_ATTRIBUTE
Definition: GD_C_FileSystem.h:49
GD_stat
int GD_stat(const char *path, struct stat *buf)
File statistics.
GD_fscanf
int GD_fscanf(GD_FILE *filePointer, const char *format,...)
Read formatted data from stream.
GD_truncate
int GD_truncate(const char *filename, off_t length)
Truncate a file that is in the secure store.
GD_fread
size_t GD_fread(void *ptr, size_t size, size_t count, GD_FILE *filePointer)
Read from a file that is in the secure store, previously opened in read mode with GD_fopen.
GD_setbuf
void GD_setbuf(GD_FILE *filePointer, char *buf)
Change stream buffering.
GD_ftell
long int GD_ftell(GD_FILE *filePointer)
Get the current position of the file pointer.
GD_fseek
int GD_fseek(GD_FILE *filePointer, long int offset, int origin)
Set the position of the file pointer.
GD_getc
int GD_getc(GD_FILE *filePointer)
Get character from stream.
GD_fprintf
int GD_fprintf(GD_FILE *filePointer, const char *format,...)
Write formatted data to stream.
GD_ftruncate
int GD_ftruncate(GD_FILE *filePointer, off_t length)
Truncate a file that is in the secure store.
GD_fflush
int GD_fflush(GD_FILE *filePointer)
Flush stream.
GD_clearerr
void GD_clearerr(GD_FILE *filePointer)
Clear error indicators.
GD_fsync
int GD_fsync(GD_FILE *filePointer)
Flush stream and synchronize.
GD_FILE
size_t GD_FILE
C API file structure, for accessing secure storage.
Definition: GD_C_FileSystem.h:20
GD_telldir
long GD_telldir(GD_DIR *dirp)
Current location of a directory stream.
GD_fgets
char * GD_fgets(char *buf, int count, GD_FILE *filePointer)
Get string from stream.
GD_fwrite
size_t GD_fwrite(const void *ptr, size_t size, size_t count, GD_FILE *filePointer)
Write to a file that is in the secure store, previously opened in write mode with GD_fopen.
GD_fputs
int GD_fputs(const char *buf, GD_FILE *filePointer)
Write string to stream.
GD_freopen
GD_FILE * GD_freopen(const char *filename, const char *mode, GD_FILE *filePointer)
Reopen stream with different file or mode.
GD_fclose
int GD_fclose(GD_FILE *filePointer)
Close a file that was previously opened.
GD_fgetpos
int GD_fgetpos(GD_FILE *filePointer, fpos_t *pos)
Get current position in stream.
GD_opendir
GD_DIR * GD_opendir(const char *dirname)
Open a directory at specified path.
GD_feof
int GD_feof(GD_FILE *filePointer)
Test if the file pointer is at the end of the file.
GD_fseeko
int GD_fseeko(GD_FILE *filePointer, off_t offset, int origin)
Set the position of the file pointer.
GD_vfscanf
int GD_vfscanf(GD_FILE *filePointer, const char *format, va_list args)
Read formatted data from stream into variable argument list.
GD_rewind
void GD_rewind(GD_FILE *filePointer)
Set position of stream to the beginning.
GD_ferror
int GD_ferror(GD_FILE *filePointer)
Check error indicator.
GD_closedir
int GD_closedir(GD_DIR *dirp)
Close an already opened directory stream.
GD_ungetc
int GD_ungetc(int character, GD_FILE *filePointer)
Push character back onto stream.
GD_setbuffer
void GD_setbuffer(GD_FILE *filePointer, char *buf, int size)
Change stream buffering.
GD_seekdir
void GD_seekdir(GD_DIR *dirp, long loc)
Set the position of a directory stream.
GD_DIR
size_t GD_DIR
C API directory structure, for accessing secure storage.
Definition: GD_C_FileSystem.h:25
GD_fopen
GD_FILE * GD_fopen(const char *filename, const char *mode)
Open a file that is in the secure store, for reading or writing.
GD_remove
int GD_remove(const char *filename)
Delete a file.
GD_readdir_r
int GD_readdir_r(GD_DIR *dirp, struct dirent *entry, struct dirent **result)
Read next directory entry into a buffer.
GD_statdir
int GD_statdir(GD_DIR *dirp, const char *name, struct stat *buf)
Obtain information about the directory or file associated with the named directory stream.