hexsyntax.c (f84276e918f3f70bce10d1bae923ce48bc600985) hexsyntax.c (38d54d33e44292c9a0955be1284fb875f3eebe35)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 42 unchanged lines hidden (view full) ---

51{
52 extern enum _vflag vflag;
53 extern FS *fshead;
54 extern int length;
55 int ch;
56 char *p, **argv;
57
58 argv = *argvp;
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 42 unchanged lines hidden (view full) ---

51{
52 extern enum _vflag vflag;
53 extern FS *fshead;
54 extern int length;
55 int ch;
56 char *p, **argv;
57
58 argv = *argvp;
59 if ((p = rindex(argv[0], 'h')) != NULL &&
60 strcmp(p, "hd") == 0) {
61 /* "Canonical" format, implies -C. */
62 add("\"%08.8_Ax\n\"");
63 add("\"%08.8_ax \" 8/1 \"%02x \" \" \"");
64 add(" 8/1 \"%02x \" ");
65 add("\" |\" 16/1 \"%_p\" \"|\\n\"");
66 }
59 while ((ch = getopt(argc, argv, "bcCde:f:n:os:vx")) != EOF)
60 switch (ch) {
61 case 'b':
62 add("\"%07.7_Ax\n\"");
63 add("\"%07.7_ax \" 16/1 \"%03o \" \"\\n\"");
64 break;
65 case 'c':
66 add("\"%07.7_Ax\n\"");
67 add("\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"");
68 break;
69 case 'C':
70 add("\"%08.8_Ax\n\"");
67 while ((ch = getopt(argc, argv, "bcCde:f:n:os:vx")) != EOF)
68 switch (ch) {
69 case 'b':
70 add("\"%07.7_Ax\n\"");
71 add("\"%07.7_ax \" 16/1 \"%03o \" \"\\n\"");
72 break;
73 case 'c':
74 add("\"%07.7_Ax\n\"");
75 add("\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"");
76 break;
77 case 'C':
78 add("\"%08.8_Ax\n\"");
71 add("\"%08.8_ax \" 16/1 \"%02x \" ");
72 add("\" |\" 16/1 \"%_p\" \"|\\n\"");
79 add("\"%08.8_ax \" 8/1 \"%02x \" \" \"");
80 add(" 8/1 \"%02x \" ");
81 add("\" |\" 16/1 \"%_p\" \"|\\n\"");
73 break;
74 case 'd':
75 add("\"%07.7_Ax\n\"");
76 add("\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"");
77 break;
78 case 'e':
79 add(optarg);
80 break;

--- 41 unchanged lines hidden (view full) ---

122
123 *argvp += optind;
124}
125
126void
127usage()
128{
129 (void)fprintf(stderr,
82 break;
83 case 'd':
84 add("\"%07.7_Ax\n\"");
85 add("\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"");
86 break;
87 case 'e':
88 add(optarg);
89 break;

--- 41 unchanged lines hidden (view full) ---

131
132 *argvp += optind;
133}
134
135void
136usage()
137{
138 (void)fprintf(stderr,
130"hexdump: [-bcdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\n");
139"hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\n");
131 exit(1);
132}
140 exit(1);
141}