|
|
| version 1.14, 2005/03/09 16:13:24 | version 1.20, 2012/01/23 04:05:05 |
|---|---|
| Line 1 | Line 1 |
| /* $Id$ */ | |
| #include "compiler.h" | #include "compiler.h" |
| #include <sys/stat.h> | #include <sys/stat.h> |
| Line 29 dosio_term(void) | Line 27 dosio_term(void) |
| /* nothing to do */ | /* nothing to do */ |
| } | } |
| /* ファイル操作 */ | /* ファイル操作 */ |
| FILEH | FILEH |
| file_open(const OEMCHAR *path) | file_open(const OEMCHAR *path) |
| { | { |
| Line 162 file_dircreate(const OEMCHAR *path) | Line 160 file_dircreate(const OEMCHAR *path) |
| } | } |
| /* カレントファイル操作 */ | /* カレントファイル操作 */ |
| void | void |
| file_setcd(const OEMCHAR *exepath) | file_setcd(const OEMCHAR *exepath) |
| { | { |
| Line 223 file_attr_c(const OEMCHAR *filename) | Line 221 file_attr_c(const OEMCHAR *filename) |
| *curfilep = '\0'; | *curfilep = '\0'; |
| file_catname(curpath, filename, sizeof(curpath)); | file_catname(curpath, filename, sizeof(curpath)); |
| return file_attr_c(curpath); | return file_attr(curpath); |
| } | } |
| FLISTH | FLISTH |
| Line 352 file_catname(OEMCHAR *path, const OEMCHA | Line 350 file_catname(OEMCHAR *path, const OEMCHA |
| } else if (((*path - 0x41) & 0xff) < 26) { | } else if (((*path - 0x41) & 0xff) < 26) { |
| *path |= 0x20; | *path |= 0x20; |
| } else if (*path == '\\') { | } else if (*path == '\\') { |
| *path = '/'; | *path = G_DIR_SEPARATOR; |
| } | } |
| } | } |
| } | } |
| Line 362 BOOL | Line 360 BOOL |
| file_cmpname(const OEMCHAR *path, const OEMCHAR *path2) | file_cmpname(const OEMCHAR *path, const OEMCHAR *path2) |
| { | { |
| return strcmp(path, path2); | return strcasecmp(path, path2); |
| } | } |
| OEMCHAR * | OEMCHAR * |
| Line 376 file_getname(const OEMCHAR *path) | Line 374 file_getname(const OEMCHAR *path) |
| if (*path == '\0') { | if (*path == '\0') { |
| break; | break; |
| } | } |
| } else if (*path == '/') { | } else if (*path == G_DIR_SEPARATOR) { |
| ret = path + 1; | ret = path + 1; |
| } | } |
| } | } |
| Line 405 file_getext(const OEMCHAR *path) | Line 403 file_getext(const OEMCHAR *path) |
| if (q == NULL) { | if (q == NULL) { |
| q = p; | q = p; |
| } | } |
| return (char *)q; | return (OEMCHAR *)q; |
| } | } |
| void | void |
| Line 429 file_cutseparator(OEMCHAR *path) | Line 427 file_cutseparator(OEMCHAR *path) |
| int pos; | int pos; |
| pos = strlen(path) - 1; | pos = strlen(path) - 1; |
| if ((pos > 0) && (path[pos] == '/')) { | if ((pos > 0) && (path[pos] == G_DIR_SEPARATOR)) { |
| path[pos] = '\0'; | path[pos] = '\0'; |
| } | } |
| } | } |
| Line 440 file_setseparator(OEMCHAR *path, int max | Line 438 file_setseparator(OEMCHAR *path, int max |
| int pos; | int pos; |
| pos = strlen(path); | pos = strlen(path); |
| if ((pos) && (path[pos-1] != '/') && ((pos + 2) < maxlen)) { | if ((pos) && (path[pos-1] != G_DIR_SEPARATOR) && ((pos + 2) < maxlen)) { |
| path[pos++] = '/'; | path[pos++] = G_DIR_SEPARATOR; |
| path[pos] = '\0'; | path[pos] = '\0'; |
| } | } |
| } | } |