summaryrefslogtreecommitdiffstats
path: root/libutil
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2008-07-01 22:30:57 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2008-07-01 22:30:57 +0000
commit589ea9a9ddfb5616b2443f7ec846e03e8077d616 (patch)
treeb3d28e5cee0c8f3e2d73947e84d4039efb1eb478 /libutil
parent09b467206915e719fe1be4e13130bbd7dab65ebe (diff)
downloadpw-darwin-589ea9a9ddfb5616b2443f7ec846e03e8077d616.tar.gz
pw-darwin-589ea9a9ddfb5616b2443f7ec846e03e8077d616.tar.zst
pw-darwin-589ea9a9ddfb5616b2443f7ec846e03e8077d616.zip
Merge hexdump(9) to userland as hexdump(3) in libutil. I'm tired of doing
this by hand in userland utilities. MFC after: 1 month
Diffstat (limited to 'libutil')
-rw-r--r--libutil/libutil.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libutil/libutil.h b/libutil/libutil.h
index 8fafe9b..186ee2e 100644
--- a/libutil/libutil.h
+++ b/libutil/libutil.h
@@ -71,6 +71,7 @@ void clean_environment(const char * const *_white,
int extattr_namespace_to_string(int _attrnamespace, char **_string);
int extattr_string_to_namespace(const char *_string, int *_attrnamespace);
int flopen(const char *_path, int _flags, ...);
+void hexdump(const void *ptr, int length, const char *hdr, int flags);
void login(struct utmp *_ut);
int login_tty(int _fd);
int logout(const char *_line);
@@ -171,4 +172,11 @@ __END_DECLS
#define HN_GETSCALE 0x10
#define HN_AUTOSCALE 0x20
+/* hexdump(3) */
+#define HD_COLUMN_MASK 0xff
+#define HD_DELIM_MASK 0xff00
+#define HD_OMIT_COUNT (1 << 16)
+#define HD_OMIT_HEX (1 << 17)
+#define HD_OMIT_CHARS (1 << 18)
+
#endif /* !_LIBUTIL_H_ */