date and time created 89/08/29 18:36:24 by bostic
[unix-history] / usr / src / usr.bin / hexdump / hexdump.h
CommitLineData
a2eb9e55
KB
1/*
2 * Copyright (c) 1989 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 *
17 * @(#)hexdump.h 5.1 (Berkeley) %G%
18 */
19
20typedef struct _pr {
21 struct _pr *nextpr; /* next print unit */
22#define F_ADDRESS 0x001 /* print offset */
23#define F_C 0x002 /* %_c */
24#define F_CHAR 0x004 /* %c */
25#define F_DBL 0x008 /* %[EefGf] */
26#define F_INT 0x010 /* %[di] */
27#define F_P 0x020 /* %_p */
28#define F_STR 0x040 /* %s */
29#define F_U 0x080 /* %_u */
30#define F_UINT 0x100 /* %[ouXx] */
31#define F_TEXT 0x200 /* no conversions */
32 u_int flags; /* flag values */
33 int bcnt; /* byte count */
34 char *cchar; /* conversion character */
35 char *fmt; /* printf format */
36 char *nospace; /* no whitespace version */
37} PR;
38
39typedef struct _fu {
40 struct _fu *nextfu; /* next format unit */
41 struct _pr *nextpr; /* next print unit */
42#define F_IGNORE 0x01 /* %_A */
43#define F_SETREP 0x02 /* rep count set, not default */
44 u_int flags; /* flag values */
45 int reps; /* repetition count */
46 int bcnt; /* byte count */
47 char *fmt; /* format string */
48} FU;
49
50typedef struct _fs { /* format strings */
51 struct _fs *nextfs; /* linked list of format strings */
52 struct _fu *nextfu; /* linked list of format units */
53 int bcnt;
54} FS;
55
56extern FS *fshead; /* head of format strings list */
57extern int blocksize; /* data block size */
58enum _vflag { ALL, DUP, WAIT }; /* -v values */
59char *emalloc();