Changeset View
Changeset View
Standalone View
Standalone View
head/bin/dd/args.c
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
static void f_speed(char *); | static void f_speed(char *); | ||||
static void f_status(char *); | static void f_status(char *); | ||||
static uintmax_t get_num(const char *); | static uintmax_t get_num(const char *); | ||||
static off_t get_off_t(const char *); | static off_t get_off_t(const char *); | ||||
static const struct arg { | static const struct arg { | ||||
const char *name; | const char *name; | ||||
void (*f)(char *); | void (*f)(char *); | ||||
u_int set, noset; | uint64_t set, noset; | ||||
} args[] = { | } args[] = { | ||||
{ "bs", f_bs, C_BS, C_BS|C_IBS|C_OBS|C_OSYNC }, | { "bs", f_bs, C_BS, C_BS|C_IBS|C_OBS|C_OSYNC }, | ||||
{ "cbs", f_cbs, C_CBS, C_CBS }, | { "cbs", f_cbs, C_CBS, C_CBS }, | ||||
{ "conv", f_conv, 0, 0 }, | { "conv", f_conv, 0, 0 }, | ||||
{ "count", f_count, C_COUNT, C_COUNT }, | { "count", f_count, C_COUNT, C_COUNT }, | ||||
{ "files", f_files, C_FILES, C_FILES }, | { "files", f_files, C_FILES, C_FILES }, | ||||
{ "fillchar", f_fillchar, C_FILL, C_FILL }, | { "fillchar", f_fillchar, C_FILL, C_FILL }, | ||||
{ "ibs", f_ibs, C_IBS, C_BS|C_IBS }, | { "ibs", f_ibs, C_IBS, C_BS|C_IBS }, | ||||
▲ Show 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | f_status(char *arg) | ||||
else if (strcmp(arg, "progress") == 0) | else if (strcmp(arg, "progress") == 0) | ||||
ddflags |= C_PROGRESS; | ddflags |= C_PROGRESS; | ||||
else | else | ||||
errx(1, "unknown status %s", arg); | errx(1, "unknown status %s", arg); | ||||
} | } | ||||
static const struct conv { | static const struct conv { | ||||
const char *name; | const char *name; | ||||
u_int set, noset; | uint64_t set, noset; | ||||
const u_char *ctab; | const u_char *ctab; | ||||
} clist[] = { | } clist[] = { | ||||
{ "ascii", C_ASCII, C_EBCDIC, e2a_POSIX }, | { "ascii", C_ASCII, C_EBCDIC, e2a_POSIX }, | ||||
{ "block", C_BLOCK, C_UNBLOCK, NULL }, | { "block", C_BLOCK, C_UNBLOCK, NULL }, | ||||
{ "ebcdic", C_EBCDIC, C_ASCII, a2e_POSIX }, | { "ebcdic", C_EBCDIC, C_ASCII, a2e_POSIX }, | ||||
{ "fdatasync", C_FDATASYNC, 0, NULL }, | |||||
{ "fsync", C_FSYNC, 0, NULL }, | { "fsync", C_FSYNC, 0, NULL }, | ||||
{ "ibm", C_EBCDIC, C_ASCII, a2ibm_POSIX }, | { "ibm", C_EBCDIC, C_ASCII, a2ibm_POSIX }, | ||||
{ "lcase", C_LCASE, C_UCASE, NULL }, | { "lcase", C_LCASE, C_UCASE, NULL }, | ||||
{ "noerror", C_NOERROR, 0, NULL }, | { "noerror", C_NOERROR, 0, NULL }, | ||||
{ "notrunc", C_NOTRUNC, 0, NULL }, | { "notrunc", C_NOTRUNC, 0, NULL }, | ||||
{ "oldascii", C_ASCII, C_EBCDIC, e2a_32V }, | { "oldascii", C_ASCII, C_EBCDIC, e2a_32V }, | ||||
{ "oldebcdic", C_EBCDIC, C_ASCII, a2e_32V }, | { "oldebcdic", C_EBCDIC, C_ASCII, a2e_32V }, | ||||
{ "oldibm", C_EBCDIC, C_ASCII, a2ibm_32V }, | { "oldibm", C_EBCDIC, C_ASCII, a2ibm_32V }, | ||||
▲ Show 20 Lines • Show All 184 Lines • Show Last 20 Lines |