summaryrefslogtreecommitdiffstats
path: root/src/bar.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bar.h')
-rw-r--r--src/bar.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/bar.h b/src/bar.h
new file mode 100644
index 0000000..20d92a9
--- /dev/null
+++ b/src/bar.h
@@ -0,0 +1,44 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+/**
+ * A terminal status bar.
+ */
+
+#ifndef BFS_BAR_H
+#define BFS_BAR_H
+
+/** A terminal status bar. */
+struct bfs_bar;
+
+/**
+ * Create a terminal status bar. Only one status bar is supported at a time.
+ *
+ * @return
+ * A pointer to the new status bar, or NULL on failure.
+ */
+struct bfs_bar *bfs_bar_show(void);
+
+/**
+ * Get the width of the status bar.
+ */
+unsigned int bfs_bar_width(const struct bfs_bar *bar);
+
+/**
+ * Update the status bar message.
+ *
+ * @param bar
+ * The status bar to update.
+ * @param str
+ * The string to display.
+ * @return
+ * 0 on success, -1 on failure.
+ */
+int bfs_bar_update(struct bfs_bar *bar, const char *str);
+
+/**
+ * Hide the status bar.
+ */
+void bfs_bar_hide(struct bfs_bar *status);
+
+#endif // BFS_BAR_H