summaryrefslogtreecommitdiff
path: root/pith/hist.h
diff options
context:
space:
mode:
authorEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
committerEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
commit094ca96844842928810f14844413109fc6cdd890 (patch)
treee60efbb980f38ba9308ccb4fb2b77b87bbc115f3 /pith/hist.h
downloadalpine-094ca96844842928810f14844413109fc6cdd890.tar.xz
Initial Alpine Version
Diffstat (limited to 'pith/hist.h')
-rw-r--r--pith/hist.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/pith/hist.h b/pith/hist.h
new file mode 100644
index 00000000..b3a2b421
--- /dev/null
+++ b/pith/hist.h
@@ -0,0 +1,53 @@
+/*
+ * $Id: hist.h 768 2007-10-24 00:10:03Z hubert@u.washington.edu $
+ *
+ * ========================================================================
+ * Copyright 2006-2007 University of Washington
+ * Copyright 2013 Eduardo Chappa
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+#ifndef PITH_HIST_INCLUDED
+#define PITH_HIST_INCLUDED
+
+
+#define HISTSIZE (20+1)
+
+typedef struct one_hist {
+ char *str;
+ unsigned flags;
+ void *cntxt;
+} ONE_HIST_S;
+
+
+typedef struct history_s {
+ int histsize;
+ int origindex;
+ int curindex;
+ ONE_HIST_S *hist[1]; /* has size histsize */
+} HISTORY_S;
+
+
+#define HISTORY_UP_KEYNAME "Up"
+#define HISTORY_DOWN_KEYNAME "Down"
+#define HISTORY_KEYLABEL N_("History")
+
+
+void init_hist(HISTORY_S **, int);
+void free_hist(HISTORY_S **);
+char *get_prev_hist(HISTORY_S *, char *, unsigned, void *);
+char *get_next_hist(HISTORY_S *, char *, unsigned, void *);
+void save_hist(HISTORY_S *, char *, unsigned, void *);
+int items_in_hist(HISTORY_S *);
+void add_to_histlist(HISTORY_S **);
+void free_histlist(void);
+
+
+#endif /* PITH_HIST_INCLUDED */