--- np2/sdl/dosio.c 2004/06/20 09:36:37 1.6 +++ np2/sdl/dosio.c 2011/07/21 06:40:18 1.9 @@ -1,6 +1,9 @@ #include "compiler.h" #include #include +#if defined(WIN32) && defined(OSLANG_EUC) +#include "codecnv.h" +#endif #include "dosio.h" #if defined(WIN32) #include @@ -27,7 +30,7 @@ FILEH file_open(const char *path) { #if defined(WIN32) && defined(OSLANG_EUC) char sjis[MAX_PATH]; - codecnv_euc2sjis(sjis, sizeof(sjis), path, (UINT)-1); + codecnv_euctosjis(sjis, sizeof(sjis), path, (UINT)-1); return(fopen(sjis, "rb+")); #else return(fopen(path, "rb+")); @@ -38,7 +41,7 @@ FILEH file_open_rb(const char *path) { #if defined(WIN32) && defined(OSLANG_EUC) char sjis[MAX_PATH]; - codecnv_euc2sjis(sjis, sizeof(sjis), path, (UINT)-1); + codecnv_euctosjis(sjis, sizeof(sjis), path, (UINT)-1); return(fopen(sjis, "rb+")); #else return(fopen(path, "rb+")); @@ -49,7 +52,7 @@ FILEH file_create(const char *path) { #if defined(WIN32) && defined(OSLANG_EUC) char sjis[MAX_PATH]; - codecnv_euc2sjis(sjis, sizeof(sjis), path, (UINT)-1); + codecnv_euctosjis(sjis, sizeof(sjis), path, (UINT)-1); return(fopen(sjis, "wb+")); #else return(fopen(path, "wb+")); @@ -248,7 +251,7 @@ static BOOL setflist(WIN32_FIND_DATA *w3 fli->caps |= FLICAPS_DATE | FLICAPS_TIME; } #if defined(OSLANG_EUC) - codecnv_sjis2euc(fli->path, sizeof(fli->path), + codecnv_sjistoeuc(fli->path, sizeof(fli->path), w32fd->cFileName, (UINT)-1); #else file_cpyname(fli->path, w32fd->cFileName, sizeof(fli->path)); @@ -342,7 +345,7 @@ struct stat sb; fli->size = 0; fli->attr = 0; } - mileuc_ncpy(fli->path, de->d_name, sizeof(fli->path)); + milstr_ncpy(fli->path, de->d_name, sizeof(fli->path)); } return(SUCCESS); } @@ -373,9 +376,9 @@ void file_catname(char *path, const char } } -char *file_getname(char *path) { +char *file_getname(const char *path) { - char *ret; +const char *ret; int csize; ret = path; @@ -385,7 +388,7 @@ char *file_getname(char *path) { } path += csize; } - return(ret); + return((char *)ret); } void file_cutname(char *path) { @@ -396,10 +399,10 @@ void file_cutname(char *path) { *p = '\0'; } -char *file_getext(char *path) { +char *file_getext(const char *path) { - char *p; - char *q; +const char *p; +const char *q; p = file_getname(path); q = NULL; @@ -412,7 +415,7 @@ char *file_getext(char *path) { if (q == NULL) { q = p; } - return(q); + return((char *)q); } void file_cutext(char *path) {