Lines Matching +full:3 +full:base +full:- +full:x

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
15 * 3. Neither the name of the University nor the names of its contributors
63 /* Add initial (default) address format. -A may change it later. */ in oldsyntax()
70 while ((ch = getopt(argc, argv, "A:aBbcDdeFfHhIij:LlN:Oost:vXx")) != -1) in oldsyntax()
74 case 'd': case 'o': case 'x': in oldsyntax()
75 fshead->nextfu->fmt[TYPE_OFFSET] = *optarg; in oldsyntax()
76 fshead->nextfs->nextfu->fmt[TYPE_OFFSET] = in oldsyntax()
80 fshead->nextfu->fmt = empty; in oldsyntax()
81 fshead->nextfs->nextfu->fmt = padding; in oldsyntax()
84 errx(1, "%s: invalid address base", optarg); in oldsyntax()
114 case 'X': in oldsyntax()
118 case 'x': in oldsyntax()
162 if (fshead->nextfs->nextfs == NULL) in oldsyntax()
165 argc -= optind; in oldsyntax()
177 "usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type]\n"); in odusage()
187 int base; in odoffset() local
192 * there were at least two arguments, a number or lower-case 'x' in odoffset()
194 * octal; if it started with 'x' or '0x' it was hex. If it ended in odoffset()
204 (!isdigit(p[0]) && (p[0] != 'x' || !isxdigit(p[1]))))) in odoffset()
207 base = 0; in odoffset()
209 * skip over leading '+', 'x[0-9a-fA-f]' or '0x', and in odoffset()
210 * set base. in odoffset()
214 if (p[0] == 'x' && isxdigit(p[1])) { in odoffset()
216 base = 16; in odoffset()
217 } else if (p[0] == '0' && p[1] == 'x') { in odoffset()
219 base = 16; in odoffset()
223 if (base == 16) in odoffset()
232 /* if terminates with a '.', base is decimal */ in odoffset()
234 if (base) in odoffset()
236 base = 10; in odoffset()
239 skip = strtoll(num, &end, base ? base : 8); in odoffset()
241 /* if end isn't the same as p, we got a non-octal digit */ in odoffset()
263 * If the offset uses a non-octal base, the base of the offset in odoffset()
266 if (base == 16) { in odoffset()
267 fshead->nextfu->fmt[TYPE_OFFSET] = 'x'; in odoffset()
268 fshead->nextfs->nextfu->fmt[TYPE_OFFSET] = 'x'; in odoffset()
269 } else if (base == 10) { in odoffset()
270 fshead->nextfu->fmt[TYPE_OFFSET] = 'd'; in odoffset()
271 fshead->nextfs->nextfu->fmt[TYPE_OFFSET] = 'd'; in odoffset()
286 odadd("16/1 \"%3_u \" \"\\n\""); in odformat()
289 odadd("16/1 \"%3_c \" \"\\n\""); in odformat()
291 case 'o': case 'u': case 'd': case 'x': in odformat()
401 * base 8. We need one extra space for signed numbers in odformatint()
404 n = (1ULL << (8 * isize)) - 1; in odformatint()
408 n >>= (fchar == 'x') ? 4 : 3; in odformatint()
413 16UL / (u_long)isize, (u_long)isize, (int)(4 * isize - digits), in odformatint()