summaryrefslogtreecommitdiff
path: root/usr/src/lib/libofmt/common/ofmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libofmt/common/ofmt.h')
-rw-r--r--usr/src/lib/libofmt/common/ofmt.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/usr/src/lib/libofmt/common/ofmt.h b/usr/src/lib/libofmt/common/ofmt.h
index 6048367a84..7248556189 100644
--- a/usr/src/lib/libofmt/common/ofmt.h
+++ b/usr/src/lib/libofmt/common/ofmt.h
@@ -25,6 +25,7 @@
*/
/*
+ * Copyright (c) 2015 by Delphix. All rights reserved.
* Copyright 2017 Joyent, Inc.
*/
@@ -127,12 +128,12 @@
* caller), the function ofmt_update_winsize(handle) may be called.
*/
-#include <sys/types.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include <sys/types.h>
+
/*
* Recommended buffer size for buffers passed, for example, to ofmt_strerror().
*/
@@ -187,6 +188,7 @@ extern ofmt_status_t ofmt_open(const char *, const ofmt_field_t *, uint_t,
#define OFMT_WRAP 0x00000002 /* wrap output if field width is exceeded */
#define OFMT_MULTILINE 0x00000004 /* "long" output: "name: value" lines */
#define OFMT_RIGHTJUST 0x00000008 /* right justified output */
+#define OFMT_NOHEADER 0x00000010 /* do not automatically print header lines */
/*
* ofmt_close() must be called to free resources associated
@@ -195,11 +197,22 @@ extern ofmt_status_t ofmt_open(const char *, const ofmt_field_t *, uint_t,
extern void ofmt_close(ofmt_handle_t);
/*
+ * Set the field separator used in parsable output (default is ':').
+ */
+extern void ofmt_set_fs(ofmt_handle_t, char);
+
+/*
* ofmt_print() emits one row of output
*/
extern void ofmt_print(ofmt_handle_t, void *);
/*
+ * ofmt_print_header() prints the header line. It can be used with
+ * OFMT_NOHEADER to control exactly when the header gets printed.
+ */
+extern void ofmt_print_header(ofmt_handle_t);
+
+/*
* ofmt_update_winsize() updates the window size information for ofmt_handle_t
*/
extern void ofmt_update_winsize(ofmt_handle_t);