1 /* ----------------------------------------------------------------------------- 2 * 3 * (c) Tamar Christina 2018-2019 4 * 5 * Windows I/O routines for file opening. 6 * 7 * NOTE: Only modify this file in utils/fs/ and rerun configure. Do not edit 8 * this file in any other directory as it will be overwritten. 9 * 10 * ---------------------------------------------------------------------------*/ 11 12 #pragma once 13 14 #include <stdio.h> 15 16 #if !defined(FS_NAMESPACE) 17 #define FS_NAMESPACE hs 18 #endif 19 20 /* Play some dirty tricks to get CPP to expand correctly. */ 21 #define FS_FULL(ns, name) __##ns##_##name 22 #define prefix FS_NAMESPACE 23 #define FS_L(p, n) FS_FULL(p, n) 24 #define FS(name) FS_L(prefix, name) 25 26 #if defined(_WIN32) 27 #include <wchar.h> 28 wchar_t* FS(create_device_name) (const wchar_t*); 29 int FS(translate_mode) (const wchar_t*); 30 int FS(swopen) (const wchar_t* filename, int oflag, 31 int shflag, int pmode); 32 int FS(sopen) (const char* filename, int oflag, 33 int shflag, int pmode); 34 FILE *FS(fwopen) (const wchar_t* filename, const wchar_t* mode); 35 FILE *FS(fopen) (const char* filename, const char* mode); 36 int FS(_stat) (const char *path, struct _stat *buffer); 37 int FS(_stat64) (const char *path, struct __stat64 *buffer); 38 int FS(_wstat) (const wchar_t *path, struct _stat *buffer); 39 int FS(_wstat64) (const wchar_t *path, struct __stat64 *buffer); 40 int FS(_wrename) (const wchar_t *from, const wchar_t *to); 41 int FS(rename) (const char *from, const char *to); 42 int FS(unlink) (const char *filename); 43 int FS(_unlink) (const char *filename); 44 int FS(_wunlink) (const wchar_t *filename); 45 int FS(remove) (const char *path); 46 int FS(_wremove) (const wchar_t *path); 47 #else 48 49 FILE *FS(fopen) (const char* filename, const char* mode); 50 #endif 51