-
Notifications
You must be signed in to change notification settings - Fork 30
/
sunday.h
40 lines (36 loc) · 1004 Bytes
/
sunday.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @file sunday.h
*
* @author hutusi ([email protected])
*
* @brief Sunday algorithm.
*
* @date 2019-08-19
*
* @copyright Copyright (c) 2019, hutusi.com
*
*/
#ifndef RETHINK_C_SUNDAY_H
#define RETHINK_C_SUNDAY_H
/**
* @brief Sunday algorithm to find the match substring.
*
* @param text The text string.
* @param text_len The length of text.
* @param pattern The pattern string.
* @param pat_len The length of pattern string.
* @return int The first match index, -1 if no match.
*/
int sunday_text_match(const char *text,
unsigned int text_len,
const char *pattern,
unsigned int pat_len);
/**
* @brief Sunday algorithm to find the match substring.
*
* @param text The text string.
* @param pattern The pattern string.
* @return int The first match index, -1 if no match.
*/
int sunday_string_match(const char *text, const char *pattern);
#endif /* #ifndef RETHINK_C_SUNDAY_H */