diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-04-23 01:45:08 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-04-23 01:45:08 +0000 |
commit | 3b59821cbdc63ad3acb920095cae1b866e28bcb7 (patch) | |
tree | 3f352a7a58e597b36b7a9154b6a32b098d6ccbb6 /util-linux/e2p/ostype.c | |
parent | 0ea3a6f660d890368d22fc7d3543487f825b2f1b (diff) | |
download | busybox-3b59821cbdc63ad3acb920095cae1b866e28bcb7.tar.gz |
remove lsattr/chattr to prepare for a top level e2fsprogs dir with more stuff in it
Diffstat (limited to 'util-linux/e2p/ostype.c')
-rw-r--r-- | util-linux/e2p/ostype.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/util-linux/e2p/ostype.c b/util-linux/e2p/ostype.c deleted file mode 100644 index fe6597dd5..000000000 --- a/util-linux/e2p/ostype.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * getostype.c - Get the Filesystem OS type - * - * Copyright (C) 2004,2005 Theodore Ts'o <tytso@mit.edu> - * - * This file can be redistributed under the terms of the GNU Library General - * Public License - */ - -#include "e2p.h" -#include <string.h> - -const char *os_tab[] = - { "Linux", - "Hurd", - "Masix", - "FreeBSD", - "Lites", - 0 }; - -/* - * Convert an os_type to a string - */ -char *e2p_os2string(int os_type) -{ - const char *os; - char *ret; - - if (os_type <= EXT2_OS_LITES) - os = os_tab[os_type]; - else - os = "(unknown os)"; - - ret = malloc(strlen(os)+1); - strcpy(ret, os); - return ret; -} - -/* - * Convert an os_type to a string - */ -int e2p_string2os(char *str) -{ - const char **cpp; - int i = 0; - - for (cpp = os_tab; *cpp; cpp++, i++) { - if (!strcasecmp(str, *cpp)) - return i; - } - return -1; -} - -#ifdef TEST_PROGRAM -int main(int argc, char **argv) -{ - char *s; - int i, os; - - for (i=0; i <= EXT2_OS_LITES; i++) { - s = e2p_os2string(i); - os = e2p_string2os(s); - printf("%d: %s (%d)\n", i, s, os); - if (i != os) { - fprintf(stderr, "Failure!\n"); - exit(1); - } - } - exit(0); -} -#endif - - |