diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-14 17:16:22 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-14 17:16:22 +0100 |
| commit | 28b00896a8cb94663a3d35313ee7d771d4af11e0 (patch) | |
| tree | 47ac8ff198b5ad9264263914b647ef5da620eefc /src/search.h | |
| parent | b7d17bdf8c0f1a4118709fbc5162463afb48b5c8 (diff) | |
use cstdint types
Diffstat (limited to 'src/search.h')
| -rw-r--r-- | src/search.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/search.h b/src/search.h index bdfdafa..ac4a3eb 100644 --- a/src/search.h +++ b/src/search.h @@ -8,8 +8,8 @@ typedef struct t_ts_found_file { utf8_int8_t *path; - int match_count; - int error; + uint32_t match_count; + uint16_t error; bool collapsed; } ts_found_file; @@ -19,17 +19,17 @@ typedef struct t_ts_search_result ts_array files; ts_array matches; ts_array filters; - int match_count; - int file_count; + uint32_t match_count; + uint32_t file_count; ts_memory_bucket memory; struct t_ts_search_result* prev_result; uint64_t timestamp; // thread syncing ts_mutex mutex; - int completed_match_threads; - int done_finding_files; - int file_list_read_cursor; + uint16_t completed_match_threads; + bool done_finding_files; + uint32_t file_list_read_cursor; bool cancel_search; bool search_completed; bool is_saving; @@ -38,15 +38,15 @@ typedef struct t_ts_search_result utf8_int8_t *directory_to_search; utf8_int8_t *file_filter; utf8_int8_t *search_text; - int max_ts_thread_count; - uint64_t max_file_size; + uint16_t max_ts_thread_count; + uint32_t max_file_size; bool respect_capitalization; } ts_search_result; typedef struct t_ts_file_match { ts_found_file* file; - int line_nr; + uint32_t line_nr; size_t word_match_offset; // nr of bytes, not codepoints. size_t word_match_length; // nr of bytes, not codepoints. utf8_int8_t *line_info; @@ -54,7 +54,7 @@ typedef struct t_ts_file_match typedef struct t_ts_text_match { - int line_nr; + uint32_t line_nr; size_t word_offset; size_t word_match_len; utf8_int8_t *line_start; @@ -65,10 +65,10 @@ extern ts_search_result* current_search_result; ts_array ts_get_filters(utf8_int8_t *pattern); size_t ts_filter_matches(ts_array *filters, utf8_int8_t *string, utf8_int8_t **matched_filter); -int ts_string_match(utf8_int8_t *first, utf8_int8_t *second); +uint32_t ts_string_match(utf8_int8_t *first, utf8_int8_t *second); ts_search_result* ts_create_empty_search_result(); bool ts_string_contains(utf8_int8_t *text_to_search, utf8_int8_t *text_to_find, ts_array *text_matches, bool respect_capitalization); -void ts_start_search(utf8_int8_t *path, utf8_int8_t *filter, utf8_int8_t *query, int thread_count, int max_file_size, bool respect_capitalization); +void ts_start_search(utf8_int8_t *path, utf8_int8_t *filter, utf8_int8_t *query, uint16_t thread_count, uint32_t max_file_size, bool respect_capitalization); void ts_destroy_result(ts_search_result* result); #endif
\ No newline at end of file |
