From c4fefc4887ae696ce512d1d94a7a7013b09aadd5 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Tue, 13 Feb 2001 11:48:31 +0000 Subject: [PATCH] Add a hook for loading of a Unicode -> char conversion routine as a kld at a run-time. This is temporary solution until proper kernel Unicode interfaces are in place and as such was purposely designed to be as tiny as possible (3 lines of the code not counting comments). The port with conversion routines for the most popular single-byte languages will be added later today Reviewed by: bp, "Michael C . Wu" Approved by: bp --- sys/fs/cd9660/cd9660_util.c | 12 ++++++++++++ sys/isofs/cd9660/cd9660_util.c | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/sys/fs/cd9660/cd9660_util.c b/sys/fs/cd9660/cd9660_util.c index 2a11dc2f6361..56279db03665 100644 --- a/sys/fs/cd9660/cd9660_util.c +++ b/sys/fs/cd9660/cd9660_util.c @@ -46,6 +46,14 @@ #include +/* + * XXX: limited support for loading of Unicode + * conversion routine as a kld at a run-time. + * Should be removed when native Unicode kernel + * interfaces have been introduced. + */ +u_char (*cd9660_wchar2char)(u_int32_t wchar) = NULL; + /* * Get one character out of an iso filename * Obey joliet_level @@ -72,6 +80,10 @@ isochar(isofn, isoend, joliet_level, c) *c = *isofn; break; } + /* XXX: if Unicode conversion routine is loaded then use it */ + if (cd9660_wchar2char != NULL) + *c = cd9660_wchar2char((*(isofn - 1) << 8) | *isofn); + return 2; } diff --git a/sys/isofs/cd9660/cd9660_util.c b/sys/isofs/cd9660/cd9660_util.c index 2a11dc2f6361..56279db03665 100644 --- a/sys/isofs/cd9660/cd9660_util.c +++ b/sys/isofs/cd9660/cd9660_util.c @@ -46,6 +46,14 @@ #include +/* + * XXX: limited support for loading of Unicode + * conversion routine as a kld at a run-time. + * Should be removed when native Unicode kernel + * interfaces have been introduced. + */ +u_char (*cd9660_wchar2char)(u_int32_t wchar) = NULL; + /* * Get one character out of an iso filename * Obey joliet_level @@ -72,6 +80,10 @@ isochar(isofn, isoend, joliet_level, c) *c = *isofn; break; } + /* XXX: if Unicode conversion routine is loaded then use it */ + if (cd9660_wchar2char != NULL) + *c = cd9660_wchar2char((*(isofn - 1) << 8) | *isofn); + return 2; }