Skip to content

Commit

Permalink
Allow the search head to be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Jul 31, 2016
1 parent 97ee376 commit f4257fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions search.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ void searchable_free(struct searchable *s)
free(s);
}

void searchable_set_head(struct searchable *s, const struct iter *head)
{
s->head = *head;
}

int search(struct searchable *s, const char *text, enum search_direction dir, int beginning)
{
struct iter iter;
Expand Down
1 change: 1 addition & 0 deletions search.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct searchable;

struct searchable *searchable_new(void *data, const struct iter *head, const struct searchable_ops *ops);
void searchable_free(struct searchable *s);
void searchable_set_head(struct searchable *s, const struct iter *head);

int search(struct searchable *s, const char *text, enum search_direction dir, int beginning);
int search_next(struct searchable *s, const char *text, enum search_direction dir);
Expand Down

0 comments on commit f4257fa

Please sign in to comment.