summaryrefslogtreecommitdiff
path: root/src/choices.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/choices.h')
-rw-r--r--src/choices.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/choices.h b/src/choices.h
index 925478e..70ef13f 100644
--- a/src/choices.h
+++ b/src/choices.h
@@ -8,9 +8,16 @@
struct scored_result {
score_t score;
- const char *str;
+ size_t idx;
};
+typedef struct InputItem {
+ const char *input_line;
+ const char *search_buf;
+
+ char *allocated;
+} InputItem;
+
typedef struct {
char *buffer;
size_t buffer_size;
@@ -18,13 +25,17 @@ typedef struct {
size_t capacity;
size_t size;
- const char **strings;
+ InputItem *input_items;
struct scored_result *results;
size_t available;
size_t selection;
unsigned int worker_count;
+
+ const char *delimiters;
+ const FieldSelector *search_fields;
+ const FieldSelector *output_fields;
} choices_t;
void choices_init(choices_t *c, options_t *options);
@@ -33,7 +44,8 @@ void choices_destroy(choices_t *c);
void choices_add(choices_t *c, const char *choice);
size_t choices_available(choices_t *c);
void choices_search(choices_t *c, const char *search);
-const char *choices_get(choices_t *c, size_t n);
+const char *choices_get_search(choices_t *c, size_t n);
+char *choices_get_output(choices_t *c, size_t n);
score_t choices_getscore(choices_t *c, size_t n);
void choices_prev(choices_t *c);
void choices_next(choices_t *c);