diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-10-18 16:53:57 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-10-18 16:53:57 +0000 |
commit | bfac6a7577b20a4f8410446902658294f848da9f (patch) | |
tree | b4eddf147150661137a75a2470ae5ef5e3431db1 /c/src/lib/libc/imfs_gtkn.c | |
parent | 2000-10-18 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-bfac6a7577b20a4f8410446902658294f848da9f.tar.bz2 |
2000-10-18 Chris Johns <ccj@acm.org>
* libfs created.
* libc/deviceio.c, libc/imfs_getchild.c, libc/imfs_readlink.c,
libc/imfs.h, libc/imfs_gtkn.c, libc/imfs_rmnod.c, libc/imfs_chown.c,
libc/imfs_handlers_device.c, libc/imfs_stat.c, libc/imfs_creat.c,
libc/imfs_handlers_directory.c, libc/imfs_symlink.c, libc/imfs_debug.c,
libc/imfs_handlers_link.c, libc/imfs_unixstub.c, libc/imfs_directory.c,
libc/imfs_handlers_memfile.c, libc/imfs_unlink.c, libc/imfs_eval.c,
libc/imfs_init.c, libc/imfs_unmount.c, libc/imfs_fchmod.c,
libc/imfs_initsupp.c, libc/imfs_utime.c, libc/imfs_fcntl.c,
libc/imfs_link.c, libc/memfile.c, libc/imfs_fdatasync.c,
libc/imfs_mknod.c, libc/miniimfs_init.c, libc/imfs_free.c,
libc/imfs_mount.c, libc/imfs_fsunmount.c, libc/imfs_ntype.c:
Moved to libfs/src/imfs.
* Makefile.am: Modified to reflect above.
Diffstat (limited to 'c/src/lib/libc/imfs_gtkn.c')
-rw-r--r-- | c/src/lib/libc/imfs_gtkn.c | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/c/src/lib/libc/imfs_gtkn.c b/c/src/lib/libc/imfs_gtkn.c deleted file mode 100644 index 3fd6f8deae..0000000000 --- a/c/src/lib/libc/imfs_gtkn.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * IMFS_get_token - * - * Routine to get a token (name or separator) from the path - * the length of the token is returned in token_len. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <stdlib.h> -#include "imfs.h" -#include "libio_.h" - -IMFS_token_types IMFS_get_token( - const char *path, - char *token, - int *token_len -) -{ - register int i = 0; - IMFS_token_types type = IMFS_NAME; - register char c; - - /* - * Copy a name into token. (Remember NULL is a token.) - */ - c = path[i]; - while ( (!IMFS_is_separator(c)) && (i <= IMFS_NAME_MAX) ) { - - token[i] = c; - - if ( i == IMFS_NAME_MAX ) - return IMFS_INVALID_TOKEN; - - if ( !IMFS_is_valid_name_char(c) ) - type = IMFS_INVALID_TOKEN; - - c = path [++i]; - } - - /* - * Copy a seperator into token. - */ - - if ( i == 0 ) { - token[i] = c; - - if ( token[i] != '\0' ) { - i++; - type = IMFS_CURRENT_DIR; - } else { - type = IMFS_NO_MORE_PATH; - } - } else if (token[ i-1 ] != '\0') { - token[i] = '\0'; - } - - /* - * Set token_len to the number of characters copied. - */ - - *token_len = i; - - /* - * If we copied something that was not a seperator see if - * it was a special name. - */ - - if ( type == IMFS_NAME ) { - if ( strcmp( token, "..") == 0 ) - type = IMFS_UP_DIR; - else if ( strcmp( token, "." ) == 0 ) - type = IMFS_CURRENT_DIR; - } - - return type; -} |