summaryrefslogtreecommitdiffstats
path: root/bin/dd/conv_tab.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-09-12 16:51:53 +0000
committergreen <green@FreeBSD.org>1999-09-12 16:51:53 +0000
commit4c16a85a3ff03636818f24c79ff2bc5947df9263 (patch)
tree27ec4fb5de7c3368adcff8f419831e3fad5929a9 /bin/dd/conv_tab.c
parent24f1ee63f7883c5a3b659be2be4b666369e6142d (diff)
downloadFreeBSD-src-4c16a85a3ff03636818f24c79ff2bc5947df9263.zip
FreeBSD-src-4c16a85a3ff03636818f24c79ff2bc5947df9263.tar.gz
Even more cleanups to dd(1). This is probably the culmination of the
BDEification process of dd(1). Most of the changes are from BDE's archive. Support for negative offsets is gone again, but the case where you lseek() onto byte -1 of something from a negative offset using seek/skip is fixed; if you end up on -1, you won't get a false positive lseek failure. The biggest changes are to data types (more size_t, for instance) and argument parsing. skip/seek on /dev/{,k}mem now occurs (instead of "read until you reach the offset") due to mem devices now being D_DISK. Some const things are now correctly declared as such, and the "case table" building is better. The only thing that seems to be left to make dd(1) everything TOG wants it to be is l10n.
Diffstat (limited to 'bin/dd/conv_tab.c')
-rw-r--r--bin/dd/conv_tab.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/bin/dd/conv_tab.c b/bin/dd/conv_tab.c
index 8637bdd..bd951a7 100644
--- a/bin/dd/conv_tab.c
+++ b/bin/dd/conv_tab.c
@@ -46,10 +46,7 @@ static const char rcsid[] =
#include <sys/types.h>
/*
- * There are currently eight tables:
- *
- * lower-case -> upper-case conv=upper
- * upper-case -> lower-case conv=lower
+ * There are currently six tables:
*
* ebcdic -> ascii 32V conv=oldascii
* ascii -> ebcdic 32V conv=oldebcdic
@@ -72,14 +69,10 @@ static const char rcsid[] =
* ACM, Volume 11, Number 11, November 1968, pp. 783-789.
*/
-/* Lower-case to upper-case */
-u_char l2u[256];
-
-/* Upper-case to lower-case */
-u_char u2l[256];
+u_char casetab[256];
/* EBCDIC to ASCII -- 32V compatible. */
-u_char e2a_32V[] = {
+const u_char e2a_32V[] = {
0000, 0001, 0002, 0003, 0234, 0011, 0206, 0177, /* 0000 */
0227, 0215, 0216, 0013, 0014, 0015, 0016, 0017, /* 0010 */
0020, 0021, 0022, 0023, 0235, 0205, 0010, 0207, /* 0020 */
@@ -115,7 +108,7 @@ u_char e2a_32V[] = {
};
/* ASCII to EBCDIC -- 32V compatible. */
-u_char a2e_32V[] = {
+const u_char a2e_32V[] = {
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
@@ -151,7 +144,7 @@ u_char a2e_32V[] = {
};
/* ASCII to IBM EBCDIC -- 32V compatible. */
-u_char a2ibm_32V[] = {
+const u_char a2ibm_32V[] = {
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
@@ -187,7 +180,7 @@ u_char a2ibm_32V[] = {
};
/* EBCDIC to ASCII -- POSIX and System V compatible. */
-u_char e2a_POSIX[] = {
+const u_char e2a_POSIX[] = {
0000, 0001, 0002, 0003, 0234, 0011, 0206, 0177, /* 0000 */
0227, 0215, 0216, 0013, 0014, 0015, 0016, 0017, /* 0010 */
0020, 0021, 0022, 0023, 0235, 0205, 0010, 0207, /* 0020 */
@@ -223,7 +216,7 @@ u_char e2a_POSIX[] = {
};
/* ASCII to EBCDIC -- POSIX and System V compatible. */
-u_char a2e_POSIX[] = {
+const u_char a2e_POSIX[] = {
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
@@ -259,7 +252,7 @@ u_char a2e_POSIX[] = {
};
/* ASCII to IBM EBCDIC -- POSIX and System V compatible. */
-u_char a2ibm_POSIX[] = {
+const u_char a2ibm_POSIX[] = {
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
OpenPOWER on IntegriCloud