|
|
| version 1.2, 2003/11/21 06:51:15 | version 1.7, 2005/03/24 04:40:33 |
|---|---|
| Line 1 | Line 1 |
| enum { // ver0.28 | |
| FTYPE_NONE = 0, // 自動判別 or PC | |
| FTYPE_SMIL, // システム予約 | |
| FTYPE_TEXT, // テキストファイル | |
| FTYPE_BMP, // Bitmap | |
| FTYPE_PICT, // Picture (予約) | |
| FTYPE_PNG, // Png (予約) | |
| FTYPE_WAV, // Wave | |
| FTYPE_D88, // D88 | |
| FTYPE_BETA, // ベタイメージ | |
| FTYPE_THD, // .thd ハードディスクイメージ | |
| FTYPE_HDI, // .hdi ハードディスクイメージ | |
| FTYPE_HDD, // .hdd ハードディスクイメージ (予約) | |
| FTYPE_S98, // .s98 ハードディスクイメージ | |
| FTYPE_MIMPI // mimpi defaultファイル | |
| }; | |
| #define FILEH HANDLE | #define FILEH HANDLE |
| #define FILEH_INVALID ((FILEH)-1) | #define FILEH_INVALID (INVALID_HANDLE_VALUE) |
| #define FILEFINDH HANDLE | #define FLISTH HANDLE |
| #define FILEFINDH_INVALID ((FILEFINDH)-1) | #define FLISTH_INVALID (INVALID_HANDLE_VALUE) |
| enum { | enum { |
| FSEEK_SET = 0, | FSEEK_SET = 0, |
| Line 28 enum { | Line 11 enum { |
| FSEEK_END = 2 | FSEEK_END = 2 |
| }; | }; |
| enum { | |
| FILEATTR_READONLY = 0x01, | |
| FILEATTR_HIDDEN = 0x02, | |
| FILEATTR_SYSTEM = 0x04, | |
| FILEATTR_VOLUME = 0x08, | |
| FILEATTR_DIRECTORY = 0x10, | |
| FILEATTR_ARCHIVE = 0x20 | |
| }; | |
| enum { | |
| FLICAPS_SIZE = 0x0001, | |
| FLICAPS_ATTR = 0x0002, | |
| FLICAPS_DATE = 0x0004, | |
| FLICAPS_TIME = 0x0008 | |
| }; | |
| typedef struct { | typedef struct { |
| UINT16 year; // cx | UINT16 year; // cx |
| BYTE month; // dh | UINT8 month; // dh |
| BYTE day; // dl | UINT8 day; // dl |
| } DOSDATE; | } DOSDATE; |
| typedef struct { | typedef struct { |
| BYTE hour; // ch | UINT8 hour; // ch |
| BYTE minute; // cl | UINT8 minute; // cl |
| BYTE second; // dh | UINT8 second; // dh |
| } DOSTIME; | } DOSTIME; |
| typedef struct { | typedef struct { |
| char path[MAX_PATH]; | UINT caps; |
| UINT32 size; | UINT32 size; |
| UINT32 attr; | UINT32 attr; |
| } FILEFINDT; | DOSDATE date; |
| DOSTIME time; | |
| OEMCHAR path[MAX_PATH]; | |
| } FLINFO; | |
| #ifdef __cplusplus | #ifdef __cplusplus |
| Line 55 extern "C" { | Line 57 extern "C" { |
| void dosio_init(void); | void dosio_init(void); |
| void dosio_term(void); | void dosio_term(void); |
| // ファイル操作 | // ファイル操作 |
| FILEH file_open(const char *path); | FILEH file_open(const OEMCHAR *path); |
| FILEH file_open_rb(const char *path); | FILEH file_open_rb(const OEMCHAR *path); |
| FILEH file_create(const char *path); | FILEH file_create(const OEMCHAR *path); |
| long file_seek(FILEH handle, long pointer, int method); | long file_seek(FILEH handle, long pointer, int method); |
| UINT file_read(FILEH handle, void *data, UINT length); | UINT file_read(FILEH handle, void *data, UINT length); |
| UINT file_write(FILEH handle, const void *data, UINT length); | UINT file_write(FILEH handle, const void *data, UINT length); |
| short file_close(FILEH handle); | short file_close(FILEH handle); |
| UINT file_getsize(FILEH handle); | UINT file_getsize(FILEH handle); |
| short file_getdatetime(FILEH handle, DOSDATE *dosdate, DOSTIME *dostime); | short file_getdatetime(FILEH handle, DOSDATE *dosdate, DOSTIME *dostime); |
| short file_delete(const char *path); | short file_delete(const OEMCHAR *path); |
| short file_attr(const char *path); | short file_attr(const OEMCHAR *path); |
| short file_dircreate(const char *path); | short file_dircreate(const OEMCHAR *path); |
| // カレントファイル操作 | // カレントファイル操作 |
| void file_setcd(const char *exepath); | void file_setcd(const OEMCHAR *exepath); |
| char *file_getcd(const char *path); | OEMCHAR *file_getcd(const OEMCHAR *path); |
| FILEH file_open_c(const char *path); | FILEH file_open_c(const OEMCHAR *path); |
| FILEH file_open_rb_c(const char *path); | FILEH file_open_rb_c(const OEMCHAR *path); |
| FILEH file_create_c(const char *path); | FILEH file_create_c(const OEMCHAR *path); |
| short file_delete_c(const char *path); | short file_delete_c(const OEMCHAR *path); |
| short file_attr_c(const char *path); | short file_attr_c(const OEMCHAR *path); |
| FILEFINDH file_find1st(const char *dir, FILEFINDT *fft); | FLISTH file_list1st(const OEMCHAR *dir, FLINFO *fli); |
| BOOL file_findnext(FILEFINDH hdl, FILEFINDT *fft); | BOOL file_listnext(FLISTH hdl, FLINFO *fli); |
| void file_findclose(FILEFINDH hdl); | void file_listclose(FLISTH hdl); |
| #if defined(OSLANG_SJIS) | |
| #define file_cpyname(a, b, c) milsjis_ncpy(a, b, c) | #define file_cpyname(a, b, c) milsjis_ncpy(a, b, c) |
| #define file_catname(a, b, c) milsjis_ncat(a, b, c) | #define file_catname(a, b, c) milsjis_ncat(a, b, c) |
| #define file_cmpname(a, b) milsjis_cmp(a, b) | #define file_cmpname(a, b) milsjis_cmp(a, b) |
| char *file_getname(char *path); | #elif defined(OSLANG_UTF8) |
| void file_cutname(char *path); | #define file_cpyname(a, b, c) milutf8_ncpy(a, b, c) |
| char *file_getext(char *path); | #define file_catname(a, b, c) milutf8_ncat(a, b, c) |
| void file_cutext(char *path); | #define file_cmpname(a, b) milutf8_cmp(a, b) |
| void file_cutseparator(char *path); | #else |
| void file_setseparator(char *path, int maxlen); | #define file_cpyname(a, b, c) milank_ncpy(a, b, c) |
| #define file_catname(a, b, c) milank_ncat(a, b, c) | |
| #define file_cmpname(a, b) milank_cmp(a, b) | |
| #endif | |
| OEMCHAR *file_getname(const OEMCHAR *path); | |
| void file_cutname(OEMCHAR *path); | |
| OEMCHAR *file_getext(const OEMCHAR *path); | |
| void file_cutext(OEMCHAR *path); | |
| void file_cutseparator(OEMCHAR *path); | |
| void file_setseparator(OEMCHAR *path, int maxlen); | |
| #ifdef __cplusplus | #ifdef __cplusplus |
| } | } |