Parent Directory
|
Revision Log
|
Patch
| Revision 1.5 by sysadm, Tue Nov 11 00:28:05 2025 UTC | Revision 1.6 by sysadm, Fri Nov 21 10:34:10 2025 UTC | |
|---|---|---|
| # | Line 35 int bwf_load(const char *filename) | Line 35 int bwf_load(const char *filename) |
| 35 | size_t len_line; | size_t len_line; |
| 36 | char *p = bwf_pattern_str; | char *p = bwf_pattern_str; |
| 37 | int line_id = 0; | int line_id = 0; |
| int errorcode; | ||
| PCRE2_SIZE erroroffset; | ||
| 38 | ||
| 39 | if (filename == NULL) | if (filename == NULL) |
| 40 | { | { |
| # | Line 97 int bwf_load(const char *filename) | Line 95 int bwf_load(const char *filename) |
| 95 | log_error("Debug: bwf_pattern_str: %s\n", bwf_pattern_str); | log_error("Debug: bwf_pattern_str: %s\n", bwf_pattern_str); |
| 96 | #endif | #endif |
| 97 | ||
| 98 | bwf_unload(); | return 0; |
| 99 | } | |
| 100 | ||
| 101 | int bwf_compile(void) | |
| 102 | { | |
| 103 | int errorcode; | |
| 104 | PCRE2_SIZE erroroffset; | |
| 105 | ||
| 106 | bwf_cleanup(); | |
| 107 | ||
| 108 | bwf_code = pcre2_compile((PCRE2_SPTR)bwf_pattern_str, PCRE2_ZERO_TERMINATED, PCRE2_CASELESS, &errorcode, &erroroffset, NULL); | bwf_code = pcre2_compile((PCRE2_SPTR)bwf_pattern_str, PCRE2_ZERO_TERMINATED, PCRE2_CASELESS, &errorcode, &erroroffset, NULL); |
| 109 | if (bwf_code == NULL) | if (bwf_code == NULL) |
| 110 | { | { |
| 111 | log_error("pcre2_compile() error: %d", errorcode); | log_error("pcre2_compile() error: %d", errorcode); |
| 112 | return -4; | return -1; |
| 113 | } | } |
| 114 | ||
| 115 | return 0; | return 0; |
| 116 | } | } |
| 117 | ||
| 118 | void bwf_unload(void) | void bwf_cleanup(void) |
| 119 | { | { |
| 120 | if (bwf_code != NULL) | if (bwf_code != NULL) |
| 121 | { | { |
|
||||||||
| webmaster@leafok.com | ViewVC Help |
| Powered by ViewVC 1.3.0-beta1 |