123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- #pragma once
- #ifndef _SGX_TPROTECTED_FS_H_
- #define _SGX_TPROTECTED_FS_H_
- #include <stddef.h>
- #include "sgx_defs.h"
- #include "sgx_key.h"
- #define SGX_FILE void
- #define EOF (-1)
- #define SEEK_SET 0
- #define SEEK_CUR 1
- #define SEEK_END 2
- #define FILENAME_MAX 260
- #define FOPEN_MAX 20
- #ifdef __cplusplus
- extern "C" {
- #endif
- SGX_FILE* SGXAPI sgx_fopen(const char* filename, const char* mode, const sgx_key_128bit_t *key);
- SGX_FILE* SGXAPI sgx_fopen_auto_key(const char* filename, const char* mode);
- size_t SGXAPI sgx_fwrite(const void* ptr, size_t size, size_t count, SGX_FILE* stream);
- size_t SGXAPI sgx_fread(void* ptr, size_t size, size_t count, SGX_FILE* stream);
- int64_t SGXAPI sgx_ftell(SGX_FILE* stream);
- int32_t SGXAPI sgx_fseek(SGX_FILE* stream, int64_t offset, int origin);
- int32_t SGXAPI sgx_fflush(SGX_FILE* stream);
- int32_t SGXAPI sgx_ferror(SGX_FILE* stream);
- int32_t SGXAPI sgx_feof(SGX_FILE* stream);
- void SGXAPI sgx_clearerr(SGX_FILE* stream);
- int32_t SGXAPI sgx_fclose(SGX_FILE* stream);
- int32_t SGXAPI sgx_remove(const char* filename);
- int32_t SGXAPI sgx_fexport_auto_key(const char* filename, sgx_key_128bit_t *key);
- int32_t SGXAPI sgx_fimport_auto_key(const char* filename, const sgx_key_128bit_t *key);
- int32_t SGXAPI sgx_fclear_cache(SGX_FILE* stream);
- #ifdef __cplusplus
- }
- #endif
- #endif
|