diff options
author | Ralf Kirchner <ralf.kirchner@embedded-brains.de> | 2013-05-22 12:16:18 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-03 17:28:40 +0200 |
commit | d2e0bb36e34f1fe45641f26b8b8d6ef615963854 (patch) | |
tree | 3975c03a1f0b0caff9d837ba1d989794f8537639 /cpukit/libfs/src/dosfs/msdos_init.c | |
parent | bsp/lm3s69xx: Typos (diff) | |
download | rtems-d2e0bb36e34f1fe45641f26b8b8d6ef615963854.tar.bz2 |
dosfs: UTF-8 Support: UI, backwards compatibility
User interface and backwards compatibility for UTF-8 support in the FAT
file system. Purpose of UTF-8 support is to permit file names and
directory names with characters from all kinds of languages (Czech,
Chinese, Arabian, Hebrew, Korean, ...). This commit does not yet
support multibyte characters. It only contains the user interface and
the backwards compatibility.
Diffstat (limited to 'cpukit/libfs/src/dosfs/msdos_init.c')
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_init.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_init.c b/cpukit/libfs/src/dosfs/msdos_init.c index e82e3f52d2..bcc5f9f278 100644 --- a/cpukit/libfs/src/dosfs/msdos_init.c +++ b/cpukit/libfs/src/dosfs/msdos_init.c @@ -12,6 +12,9 @@ * Modifications to support reference counting in the file system are * Copyright (c) 2012 embedded brains GmbH. * + * Modifications to support UTF-8 in the file system are + * Copyright (c) 2013 embedded brains GmbH. + * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. @@ -89,14 +92,32 @@ void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry) * RC_OK on success, or -1 if error occured (errno set apropriately). * */ -int rtems_dosfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry, - const void *data) +int rtems_dosfs_initialize( + rtems_filesystem_mount_table_entry_t *mt_entry, + const void *data +) { - int rc; + int rc = 0; + const rtems_dosfs_mount_options *mount_options = data; + rtems_dosfs_convert_control *converter; + + + if (mount_options == NULL || mount_options->converter == NULL) { + converter = rtems_dosfs_create_default_converter(); + } else { + converter = mount_options->converter; + } + + if (converter != NULL) { + rc = msdos_initialize_support(mt_entry, + &msdos_ops, + &msdos_file_handlers, + &msdos_dir_handlers, + converter); + } else { + errno = ENOMEM; + rc = -1; + } - rc = msdos_initialize_support(mt_entry, - &msdos_ops, - &msdos_file_handlers, - &msdos_dir_handlers); return rc; } |