Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zachhannum/search-c
https://github.com/zachhannum/search-c
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/zachhannum/search-c
- Owner: zachhannum
- License: mit
- Created: 2022-07-28T12:55:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-29T04:23:42.000Z (over 2 years ago)
- Last Synced: 2024-05-12T00:26:43.930Z (8 months ago)
- Language: C
- Size: 1.37 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Search C
Just a small program written in C to test out a trie-based search algorithm.
## Build with CMake
```sh
mkdir build
cd build
cmake ..
cmake --build .
```## Usage
```C
#includeSearch* search = Search_Init();
search->AddSearchResult(search, "delegate");
search->AddSearchResult(search, "delineate");
search->AddSearchResult(search, "demonstrate");SearchRequest req = {"del", match_type_all};
if (search->SearchQuery(search, req)) {
while(result) {
puts(result->result_string);
result = result->next_result;
}
/* Prints:
* delegate
* delineate
*/
}
```