lsr fs macros

This commit is contained in:
toddouska
2012-08-17 13:45:31 -07:00
parent 03356be00b
commit 690938ffd4
2 changed files with 30 additions and 11 deletions

View File

@@ -158,8 +158,15 @@
#define NO_DEV_RANDOM
#define NO_CYASSL_DIR
#define NO_RABBIT
#ifndef NO_FILESYSTEM
#define LSR_FS
#include "fs.h"
#endif
#define CYASSL_LWIP
#define CYASSL_SAFERTOS
#endif
#ifdef CYASSL_SAFERTOS
#ifndef SINGLE_THREADED
#include "SafeRTOS/semphr.h"
#endif

View File

@@ -1214,17 +1214,18 @@ static int ProcessChainBuffer(CYASSL_CTX* ctx, const unsigned char* buff,
#define XFCLOSE vf_close
#define XSEEK_END VSEEK_END
#define XBADFILE -1
#elif !defined(MICRIUM)
#define XFILE FILE*
#define XFOPEN fopen
#define XFSEEK fseek
#define XFTELL ftell
#define XREWIND rewind
#define XFREAD fread
#define XFCLOSE fclose
#define XSEEK_END SEEK_END
#elif defined(LSR_FS)
#include <fs.h>
#define XFILE struct fs_file*
#define XFOPEN(NAME, MODE) fs_open(NAME);
#define XFSEEK
#define XFTELL(F) (F)->len
#define XREWIND
#define XFREAD(BUF, SZ, AMT, F) fs_read(F, BUF, SZ*AMT)
#define XFCLOSE fs_close
#define XSEEK_END 0
#define XBADFILE NULL
#else
#elif defined(MICRIUM)
#include <fs.h>
#define XFILE FS_FILE*
#define XFOPEN fs_fopen
@@ -1235,6 +1236,17 @@ static int ProcessChainBuffer(CYASSL_CTX* ctx, const unsigned char* buff,
#define XFCLOSE fs_fclose
#define XSEEK_END FS_SEEK_END
#define XBADFILE NULL
#else
/* stdio, default case */
#define XFILE FILE*
#define XFOPEN fopen
#define XFSEEK fseek
#define XFTELL ftell
#define XREWIND rewind
#define XFREAD fread
#define XFCLOSE fclose
#define XSEEK_END SEEK_END
#define XBADFILE NULL
#endif