search.h 341 B

12345678910111213141516
  1. #ifndef SEARCH_H
  2. #define SEARCH_H
  3. #include <regex.h>
  4. struct search
  5. {
  6. struct cache *cache;
  7. regex_t pattern[1];
  8. int x, y, len; // the position of the match
  9. };
  10. struct search *search_start(struct cache *ca, u8 *pattern);
  11. void search_end(struct search *s);
  12. int search_next(struct search *s, int *pgno, int *subno, int dir);
  13. #endif