From 3b59821cbdc63ad3acb920095cae1b866e28bcb7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 23 Apr 2005 01:45:08 +0000 Subject: remove lsattr/chattr to prepare for a top level e2fsprogs dir with more stuff in it --- util-linux/e2p/parse_num.c | 64 ---------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 util-linux/e2p/parse_num.c (limited to 'util-linux/e2p/parse_num.c') diff --git a/util-linux/e2p/parse_num.c b/util-linux/e2p/parse_num.c deleted file mode 100644 index 3910e70de..000000000 --- a/util-linux/e2p/parse_num.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * parse_num.c - Parse the number of blocks - * - * Copyright (C) 2004,2005 Theodore Ts'o - * - * This file can be redistributed under the terms of the GNU Library General - * Public License - */ - -#include "e2p.h" - -#include - -unsigned long parse_num_blocks(const char *arg, int log_block_size) -{ - char *p; - unsigned long long num; - - num = strtoull(arg, &p, 0); - - if (p[0] && p[1]) - return 0; - - switch (*p) { /* Using fall-through logic */ - case 'T': case 't': - num <<= 10; - case 'G': case 'g': - num <<= 10; - case 'M': case 'm': - num <<= 10; - case 'K': case 'k': - num >>= log_block_size; - break; - case 's': - num >>= 1; - break; - case '\0': - break; - default: - return 0; - } - return num; -} - -#ifdef DEBUG -#include -#include - -main(int argc, char **argv) -{ - unsigned long num; - int log_block_size = 0; - - if (argc != 2) { - fprintf(stderr, "Usage: %s arg\n", argv[0]); - exit(1); - } - - num = parse_num_blocks(argv[1], log_block_size); - - printf("Parsed number: %lu\n", num); - exit(0); -} -#endif -- cgit v1.2.3