diff --git a/src/wolfssh_file.c b/src/wolfssh_file.c new file mode 100644 index 000000000..ca3408f03 --- /dev/null +++ b/src/wolfssh_file.c @@ -0,0 +1,14 @@ +#ifdef WOLFSSH_FILE_STREAM + +WOLFSSH_FILE* wolfSSH_FILE_open(WOLFSSH_FILE* f) +{ + file = fopen(); +} +#elif WOLFSSH_FILE_FD + +WOLFSSH_FILE* wolfSSH_FILE_open(WOLFSSH_FILE* f) +{ + file = open(); +} + +#endif diff --git a/wolfssh/wolfssh_file.h b/wolfssh/wolfssh_file.h new file mode 100644 index 000000000..28ad888c5 --- /dev/null +++ b/wolfssh/wolfssh_file.h @@ -0,0 +1,57 @@ +#ifndef WOLFSSH_WOLFSSH_FILE_H +#define WOLFSSH_WOLFSSH_FILE_H + +typedef struct WOLFSSH_FILE WOLFSSH_FILE; +typedef struct WOLFSSH_DIR WOLFSSH_DIR; + + +/* +1. NO_FILESYSTEM +2. WOLFSSH_NUCLEUS +3. FREESCALE_MQX +4. WOLFSSH_FATFS +5. WOLFSSH_ZEPHYR +*/ + + +WOLFSSH_API WOLFSSH_FILE* wolfSSH_FILE_open(WOLFSSH_FILE* f); +WOLFSSH_API int wolfSSH_FILE_close(WOLFSSH_FILE* f); +WOLFSSH_API int wolfSSH_FILE_read(WOLFSSH_FILE* f); +WOLFSSH_API int wolfSSH_FILE_write(WOLFSSH_FILE* f); +WOLFSSH_API int wolfSSH_FILE_seek(WOLFSSH_FILE* f); +WOLFSSH_API int wolfSSH_FILE_tell(WOLFSSH_FILE* f); +WOLFSSH_API int wolfSSH_FILE_rewind(WOLFSSH_FILE* f); +WOLFSSH_API int wolfSSH_FILE_flush(WOLFSSH_FILE* f); +WOLFSSH_API int wolfSSH_FILE_stat(WOLFSSH_FILE* f); + +wolfSSH_FILE_chmod(const char* fn); + #define WSETTIME(fs,f,a,m) (0) + #define WFSETTIME(fs,fd,a,m) (0) + +/* From Zephyr */ + #define WFGETS(b,s,f) NULL /* Not ported yet */ + #define WFPUTS(b,s) EOF /* Not ported yet */ + #define WUTIMES(a,b) (0) /* Not ported yet */ + #define WCHDIR(fs,b) z_fs_chdir((b)) + + #define WS_DELIM '\\' + #define WOLFSSH_O_RDWR + #define WOLFSSH_O_RDONLY + #define WOLFSSH_O_WRONLY + #define WOLFSSH_O_APPEND + #define WOLFSSH_O_CREAT + #define WOLFSSH_O_TRUNC + #define WOLFSSH_O_EXCL + #define WOLFSSH_MAX_FILENAME + #define WBADFILE + #define WSEEK_SET 0 + #define WSEEK_CUR 1 + #define WSEEK_END 2 + +#if defined(USE_WINDOWS_API) +#elif defined(POSIX) +#else + /* USER DEFINED */ +#endif + +#endif /* WOLFSSH_WOLFSSH_FILE_H */