args.c (295427) | args.c (295428) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Keith Muller of the University of California, San Diego and Lance 7 * Visser of Convex Computer Corporation. 8 * --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94"; 37#endif 38#endif /* not lint */ 39#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Keith Muller of the University of California, San Diego and Lance 7 * Visser of Convex Computer Corporation. 8 * --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94"; 37#endif 38#endif /* not lint */ 39#include <sys/cdefs.h> |
40__FBSDID("$FreeBSD: head/bin/dd/args.c 295427 2016-02-09 09:37:04Z trasz $"); | 40__FBSDID("$FreeBSD: head/bin/dd/args.c 295428 2016-02-09 09:38:05Z trasz $"); |
41 42#include <sys/types.h> 43 44#include <err.h> 45#include <errno.h> 46#include <inttypes.h> 47#include <limits.h> 48#include <signal.h> --- 353 unchanged lines hidden (view full) --- 402 403/* 404 * Convert an expression of the following forms to a uintmax_t. 405 * 1) A positive decimal number. 406 * 2) A positive decimal number followed by a 'b' or 'B' (mult by 512). 407 * 3) A positive decimal number followed by a 'k' or 'K' (mult by 1 << 10). 408 * 4) A positive decimal number followed by a 'm' or 'M' (mult by 1 << 20). 409 * 5) A positive decimal number followed by a 'g' or 'G' (mult by 1 << 30). | 41 42#include <sys/types.h> 43 44#include <err.h> 45#include <errno.h> 46#include <inttypes.h> 47#include <limits.h> 48#include <signal.h> --- 353 unchanged lines hidden (view full) --- 402 403/* 404 * Convert an expression of the following forms to a uintmax_t. 405 * 1) A positive decimal number. 406 * 2) A positive decimal number followed by a 'b' or 'B' (mult by 512). 407 * 3) A positive decimal number followed by a 'k' or 'K' (mult by 1 << 10). 408 * 4) A positive decimal number followed by a 'm' or 'M' (mult by 1 << 20). 409 * 5) A positive decimal number followed by a 'g' or 'G' (mult by 1 << 30). |
410 * 5) A positive decimal number followed by a 'w' or 'W' (mult by sizeof int). 411 * 6) Two or more positive decimal numbers (with/without [BbKkMmGgWw]) | 410 * 6) A positive decimal number followed by a 't' or 'T' (mult by 1 << 40). 411 * 7) A positive decimal number followed by a 'p' or 'P' (mult by 1 << 50). 412 * 8) A positive decimal number followed by a 'w' or 'W' (mult by sizeof int). 413 * 9) Two or more positive decimal numbers (with/without [BbKkMmGgWw]) |
412 * separated by 'x' or 'X' (also '*' for backwards compatibility), 413 * specifying the product of the indicated values. 414 */ 415static uintmax_t 416get_num(const char *val) 417{ 418 uintmax_t num, mult, prevnum; 419 char *expr; --- 88 unchanged lines hidden --- | 414 * separated by 'x' or 'X' (also '*' for backwards compatibility), 415 * specifying the product of the indicated values. 416 */ 417static uintmax_t 418get_num(const char *val) 419{ 420 uintmax_t num, mult, prevnum; 421 char *expr; --- 88 unchanged lines hidden --- |