diff options
Diffstat (limited to 'index.h')
| -rw-r--r-- | index.h | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -1,7 +1,7 @@ /* arfnet2-search: Fast file indexer and search - Copyright (C) 2023 arf20 (Ángel Ruiz Fernandez) + Copyright (C) 2025 arf20 (Ángel Ruiz Fernandez) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,8 @@ typedef enum { LOOKUP_SUBSTR, - LOOKUP_SUBSTR_NOCASE, + LOOKUP_SUBSTR_CASEINSENSITIVE, + LOOKUP_EXACT, LOOKUP_REGEX } lookup_type_t; @@ -40,6 +41,19 @@ typedef struct { typedef struct map_s *index_t; +typedef enum { + SORT_NAME, + SORT_MIME, + SORT_PATH, + SORT_SIZE, + SORT_TIME +} sort_type_t; + +typedef struct { + time_t time_low, time_high; + size_t size_low, size_high; +} filter_t; + typedef struct { const node_data_t **results; size_t size, capacity; @@ -50,6 +64,9 @@ void index_deinit(); index_t index_new(size_t icapacity, const char *root, int examine); results_t *index_lookup(index_t index, lookup_type_t type, const char *query); void index_destroy(index_t index); + +void results_sort(results_t *results, sort_type_t sort_type, int desc); +results_t *results_filter(results_t *results, const filter_t *filter); void results_destroy(results_t *results); #endif /* _INDEX_H */ |
