From b79a45e9c02e6aa5d768a932280ce55b5c77d212 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Mon, 7 Jun 2010 14:57:31 +0000 Subject: 2010-06-05 Bharath Suri * libcsupport/include/rtems/libio_.h: Removed macros rtems_filesystem_is_separator rtems_filesystem_get_start_loc rtems_filesystem_get_sym_start_loc and added them as files under libcsupport/src/ * libcsupport/src/: Added new files libcsupport/src/sup_fs_get_start_loc.c libcsupport/src/sup_fs_get_sym_start_loc.c libcsupport/src/sup_fs_is_separator.c * libcsupport/Makefile.am: Changes to accommodate new files under libcsupport/src/ --- cpukit/libcsupport/Makefile.am | 2 + cpukit/libcsupport/include/rtems/libio_.h | 64 +++++++++---------------------- 2 files changed, 21 insertions(+), 45 deletions(-) (limited to 'cpukit/libcsupport') diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am index c9729c289b..6b74f0e052 100644 --- a/cpukit/libcsupport/Makefile.am +++ b/cpukit/libcsupport/Makefile.am @@ -110,6 +110,8 @@ BSD_LIBC_C_FILES = src/strlcpy.c src/strlcat.c src/issetugid.c libcsupport_a_SOURCES = src/gxx_wrappers.c src/getchark.c src/printk.c \ src/printk_plugin.c src/putk.c src/vprintk.c \ + src/sup_fs_is_separator.c src/sup_fs_get_start_loc.c \ + src/sup_fs_get_sym_start_loc.c \ $(BSD_LIBC_C_FILES) $(BASE_FS_C_FILES) $(MALLOC_C_FILES) \ $(ERROR_C_FILES) $(ASSOCIATION_C_FILES) diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 22f498b98a..ad00f8785f 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -1,4 +1,4 @@ -/** +/* * @file rtems/libio_.h */ @@ -90,7 +90,7 @@ extern rtems_libio_t *rtems_libio_iop_freelist; #define rtems_libio_check_fd(_fd) \ do { \ - if ((uint32_t) (_fd) >= rtems_libio_number_iops) { \ + if ((uint32_t) (_fd) >= rtems_libio_number_iops) { \ errno = EBADF; \ return -1; \ } \ @@ -129,12 +129,12 @@ extern rtems_libio_t *rtems_libio_iop_freelist; * Macro to check if a file descriptor is open for this operation. */ -#define rtems_libio_check_permissions(_iop, _flag) \ - do { \ - if (((_iop)->flags & (_flag)) == 0) { \ +#define rtems_libio_check_permissions(_iop, _flag) \ + do { \ + if (((_iop)->flags & (_flag)) == 0) { \ rtems_set_errno_and_return_minus_one( EINVAL ); \ - return -1; \ - } \ + return -1; \ + } \ } while (0) /* @@ -150,44 +150,6 @@ extern rtems_libio_t *rtems_libio_iop_freelist; (*(_node)->ops->freenod_h)( (_node) ); \ } while (0) -/* - * rtems_filesystem_is_separator - * - * Macro to determine if a character is a path name separator. - * - * NOTE: This macro handles MS-DOS and UNIX style names. - */ - -#define rtems_filesystem_is_separator( _ch ) \ - ( ((_ch) == '/') || ((_ch) == '\\') || ((_ch) == '\0')) - -/* - * rtems_filesystem_get_start_loc - * - * Macro to determine if path is absolute or relative. - */ - -#define rtems_filesystem_get_start_loc( _path, _index, _loc ) \ - do { \ - if ( rtems_filesystem_is_separator( (_path)[ 0 ] ) ) { \ - *(_loc) = rtems_filesystem_root; \ - *(_index) = 1; \ - } else { \ - *(_loc) = rtems_filesystem_current; \ - *(_index) = 0; \ - } \ - } while (0) - -#define rtems_filesystem_get_sym_start_loc( _path, _index, _loc ) \ - do { \ - if ( rtems_filesystem_is_separator( (_path)[ 0 ] ) ) { \ - *(_loc) = rtems_filesystem_root; \ - *(_index) = 1; \ - } else { \ - *(_index) = 0; \ - } \ - } while (0) - /* * External structures @@ -271,6 +233,18 @@ int rtems_filesystem_prefix_separators( void rtems_filesystem_initialize(void); +int init_fs_mount_table(void); + +int rtems_filesystem_is_separator(char ch); + +void rtems_filesystem_get_start_loc(const char *path, + int *index, + rtems_filesystem_location_info_t *loc); + +void rtems_filesystem_get_sym_start_loc(const char *path, + int *index, + rtems_filesystem_location_info_t *loc); + #ifdef __cplusplus } #endif -- cgit v1.2.3