Merge remote-tracking branch 'origin/main' into agent/continue-0922/rso

This commit is contained in:
coah
2026-09-22 07:54:19 +00:00
3 changed files with 103 additions and 6 deletions

View File

@@ -1159,7 +1159,7 @@ config.libs = [
Object(Matching, "vf/system/pf_system.c"),
Object(Matching, "vf/develop/d_vf.c"),
Object(NonMatching, "vf/develop/d_vf_sys.c"),
Object(Matching, "vf/develop/d_vf_sys.c"),
Object(Matching, "vf/develop/d_hash.c"),
Object(Matching, "vf/develop/d_time.c"),
Object(Matching, "vf/develop/d_common.c"),
@@ -1952,7 +1952,7 @@ config.libs = [
Object(NonMatching, "MSL_Common/direct_io.c"),
Object(NonMatching, "MSL_Common/file_io.c"),
Object(NonMatching, "MSL_Common/FILE_POS.c"),
Object(NonMatching, "MSL_Common/mbstring.c"),
Object(Matching, "MSL_Common/mbstring.c"),
Object(Matching, "MSL_Common/mem.c"),
Object(Matching, "MSL_Common/mem_funcs.c"),
Object(Matching, "MSL_Common/math_api.c"),

View File

@@ -0,0 +1,97 @@
#include <internal/locale.h>
#include <string.h>
int mbtowc(wchar_t* pwc, const char* s, size_t n) {
return _current_locale.ctype_cmpt_ptr->decode_mb(pwc, s, n);
}
int __mbtowc_noconv(wchar_t* pwc, const char* s, size_t n) {
if (s == NULL) {
return 0;
}
if (n == 0) {
return -1;
}
if (pwc != NULL) {
*pwc = (unsigned char)*s;
}
if (!*s) {
return 0;
}
return 1;
}
int __wctomb_noconv(char* s, wchar_t wchar) {
if (s == NULL) {
return 0;
}
*s = (char)wchar;
return 1;
}
size_t mbstowcs(wchar_t* dest, const char* src, size_t len) {
int count;
char* src_ptr;
size_t slen;
slen = strlen(src);
if (dest != NULL) {
src_ptr = (char*)src;
for (count = 0; count < len; count++) {
if (*src_ptr) {
int res = mbtowc(dest++, src_ptr, slen);
if (res > 0) {
src_ptr += res;
slen -= res;
} else {
return -1;
}
} else {
*dest = 0;
break;
}
}
} else {
count = 0;
}
return count;
}
size_t wcstombs(char* s, const wchar_t* pwcs, size_t n) {
int result;
int chars_written = 0;
char temp[3];
wchar_t* source;
if (s == NULL || pwcs == NULL) {
return 0;
}
source = (wchar_t*)pwcs;
while (chars_written <= n) {
if (!*source) {
*(s + chars_written) = '\0';
break;
}
result = _current_locale.ctype_cmpt_ptr->encode_wc(temp, *source++);
if (chars_written + result > n) {
break;
}
strncpy(s + chars_written, temp, result);
chars_written += result;
}
return chars_written;
}

View File

@@ -385,7 +385,7 @@ VFErr VFSysSetSyncMode(s32 i_handle_idx, u32 i_mode) {
return VF_ERR_SYSTEM;
}
u32 VFSysGetSyncMode(s32 i_handle_idx) {
static u32 VFSysGetSyncMode(s32 i_handle_idx) {
VFSys_handle* handle_p = VFSysGetHandleP(i_handle_idx);
if (handle_p == NULL || handle_p->drive.pf_disk_p == NULL || handle_p->device_p == NULL) {
@@ -541,7 +541,7 @@ s32 VFSysHandleP2Idx(VFSys_handle* i_handle_p) {
return VF_ERR_SYSTEM;
}
VFSys_handle* VFSysVol2HandleP(PF_VOLUME* i_vol_p) {
static VFSys_handle* VFSysVol2HandleP(PF_VOLUME* i_vol_p) {
if (i_vol_p != NULL) {
VFSys_handle* handle_p = VFSysGetHandleP(0);
VFSys_handle* handle_end_p = &handle_p[l_vfsys_vol_max];
@@ -728,7 +728,7 @@ static void VFiSysClearDeviceSDDirect(VFSys_deviceSD* o_sd_p) {
o_sd_p->slotNo = -1;
}
VFSys_device* VFSysGetDeviceP(s32 i_idx) {
static VFSys_device* VFSysGetDeviceP(s32 i_idx) {
VFSys_handle* handle_p = VFSysGetHandleP(i_idx);
if (handle_p != NULL) {
return handle_p->device_p;
@@ -1170,7 +1170,7 @@ static VFErr VFiSysGetLastDeviceError_common(VFSys_handle* i_handle_p) {
return VF_ERR_SYSTEM;
}
void VFSysSetDevErrInfo(s32 i_handle_idx, VFErr i_err) {
static void VFSysSetDevErrInfo(s32 i_handle_idx, VFErr i_err) {
VFSys_handle* handle_p = VFSysGetHandleP(i_handle_idx);
if (handle_p != NULL) {
VFiSysSetDeviceErrInfo(handle_p, i_err);