diff options
author | Phil Jones <philj56@gmail.com> | 2021-11-17 01:15:13 +0000 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2021-11-17 01:15:13 +0000 |
commit | 7562d7b539d8013376de2cff494231ba307f4ee1 (patch) | |
tree | 1eb4e8b28ed10da0e7a582cc4a38cfc37cef3ff8 /src/history.h | |
parent | 49c7405b6a88e56bb69e12189adb719927343e07 (diff) |
Add sorting by run frequency.
This implements a rofi-like run cache. Other smaller changes include
simplification of resize logic now that there's only one surface.
Diffstat (limited to 'src/history.h')
-rw-r--r-- | src/history.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/history.h b/src/history.h new file mode 100644 index 0000000..3be757f --- /dev/null +++ b/src/history.h @@ -0,0 +1,31 @@ +#ifndef HISTORY_H +#define HISTORY_H + +#include <stddef.h> + +struct program { + char *restrict name; + size_t run_count; +}; + +struct history { + size_t count; + size_t size; + struct program *buf; +}; + +[[gnu::nonnull]] +void history_destroy(struct history *restrict vec); + +[[gnu::nonnull]] +void history_add(struct history *restrict vec, const char *restrict str); + +//[[gnu::nonnull]] +//void history_remove(struct history *restrict vec, const char *restrict str); + +[[nodiscard]] +struct history history_load(void); + +void history_save(struct history *history); + +#endif /* HISTORY_H */ |