diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-01-31 13:46:01 (GMT) |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-01-31 13:46:01 (GMT) |
commit | e8bd88d1fcded01ccd066572eeaae1b507989cb3 (patch) | |
tree | c8e7be6c07c6f635f6e803e6a6ba9e7a95fee7c0 /gl/str-two-way.h | |
parent | 2ad962c13473607ca0d974bfaa516a0ed53ec73d (diff) | |
download | monitoring-plugins-e8bd88d1fcded01ccd066572eeaae1b507989cb3.tar.gz |
Sync with the latest Gnulib code 668c0b8ffa
Diffstat (limited to 'gl/str-two-way.h')
-rw-r--r-- | gl/str-two-way.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/gl/str-two-way.h b/gl/str-two-way.h index 707145d..dfe7022 100644 --- a/gl/str-two-way.h +++ b/gl/str-two-way.h | |||
@@ -1,24 +1,24 @@ | |||
1 | /* Byte-wise substring search, using the Two-Way algorithm. | 1 | /* Byte-wise substring search, using the Two-Way algorithm. |
2 | Copyright (C) 2008-2013 Free Software Foundation, Inc. | 2 | Copyright (C) 2008-2023 Free Software Foundation, Inc. |
3 | This file is part of the GNU C Library. | 3 | This file is part of the GNU C Library. |
4 | Written by Eric Blake <ebb9@byu.net>, 2008. | 4 | Written by Eric Blake <ebb9@byu.net>, 2008. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This file is free software: you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU Lesser General Public License as |
8 | the Free Software Foundation; either version 3, or (at your option) | 8 | published by the Free Software Foundation; either version 2.1 of the |
9 | any later version. | 9 | License, or (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This file is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU Lesser General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License along | 16 | You should have received a copy of the GNU Lesser General Public License |
17 | with this program; if not, see <http://www.gnu.org/licenses/>. */ | 17 | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
18 | 18 | ||
19 | /* Before including this file, you need to include <config.h> and | 19 | /* Before including this file, you need to include <config.h> and |
20 | <string.h>, and define: | 20 | <string.h>, and define: |
21 | RESULT_TYPE A macro that expands to the return type. | 21 | RETURN_TYPE A macro that expands to the return type. |
22 | AVAILABLE(h, h_l, j, n_l) | 22 | AVAILABLE(h, h_l, j, n_l) |
23 | A macro that returns nonzero if there are | 23 | A macro that returns nonzero if there are |
24 | at least N_L bytes left starting at H[J]. | 24 | at least N_L bytes left starting at H[J]. |
@@ -49,9 +49,9 @@ | |||
49 | character shift table similar to the Boyer-Moore algorithm to | 49 | character shift table similar to the Boyer-Moore algorithm to |
50 | achieve improved (potentially sub-linear) performance. | 50 | achieve improved (potentially sub-linear) performance. |
51 | 51 | ||
52 | See http://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260, | 52 | See https://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260, |
53 | http://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm, | 53 | https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm, |
54 | http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.6641&rep=rep1&type=pdf | 54 | https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.6641&rep=rep1&type=pdf |
55 | */ | 55 | */ |
56 | 56 | ||
57 | /* Point at which computing a bad-byte shift table is likely to be | 57 | /* Point at which computing a bad-byte shift table is likely to be |
@@ -231,7 +231,7 @@ critical_factorization (const unsigned char *needle, size_t needle_len, | |||
231 | most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. | 231 | most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. |
232 | If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * | 232 | If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * |
233 | HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */ | 233 | HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */ |
234 | static RETURN_TYPE | 234 | static RETURN_TYPE _GL_ATTRIBUTE_PURE |
235 | two_way_short_needle (const unsigned char *haystack, size_t haystack_len, | 235 | two_way_short_needle (const unsigned char *haystack, size_t haystack_len, |
236 | const unsigned char *needle, size_t needle_len) | 236 | const unsigned char *needle, size_t needle_len) |
237 | { | 237 | { |
@@ -325,7 +325,7 @@ two_way_short_needle (const unsigned char *haystack, size_t haystack_len, | |||
325 | If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * | 325 | If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * |
326 | HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and | 326 | HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and |
327 | sublinear performance is not possible. */ | 327 | sublinear performance is not possible. */ |
328 | static RETURN_TYPE | 328 | static RETURN_TYPE _GL_ATTRIBUTE_PURE |
329 | two_way_long_needle (const unsigned char *haystack, size_t haystack_len, | 329 | two_way_long_needle (const unsigned char *haystack, size_t haystack_len, |
330 | const unsigned char *needle, size_t needle_len) | 330 | const unsigned char *needle, size_t needle_len) |
331 | { | 331 | { |