xref: /dflybsd-src/contrib/grep/lib/memchr2.h (revision 91b9ed38d3db6a8a8ac5b66da1d43e6e331e259a)
1680a9cb8SJohn Marino /* Scan memory for the first of two bytes.
2*09d4459fSDaniel Fojt    Copyright (C) 2008-2020 Free Software Foundation, Inc.
3680a9cb8SJohn Marino 
4680a9cb8SJohn Marino    This program is free software: you can redistribute it and/or modify
5680a9cb8SJohn Marino    it under the terms of the GNU General Public License as published by
6680a9cb8SJohn Marino    the Free Software Foundation; either version 3 of the License, or
7680a9cb8SJohn Marino    (at your option) any later version.
8680a9cb8SJohn Marino 
9680a9cb8SJohn Marino    This program is distributed in the hope that it will be useful,
10680a9cb8SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
11680a9cb8SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12680a9cb8SJohn Marino    GNU General Public License for more details.
13680a9cb8SJohn Marino 
14680a9cb8SJohn Marino    You should have received a copy of the GNU General Public License
15*09d4459fSDaniel Fojt    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
16680a9cb8SJohn Marino 
17680a9cb8SJohn Marino #include <stddef.h>
18680a9cb8SJohn Marino 
19680a9cb8SJohn Marino #ifdef __cplusplus
20680a9cb8SJohn Marino extern "C" {
21680a9cb8SJohn Marino #endif
22680a9cb8SJohn Marino 
23680a9cb8SJohn Marino /* Return the first address of either C1 or C2 (treated as unsigned
24680a9cb8SJohn Marino    char) that occurs within N bytes of the memory region S.  If
25680a9cb8SJohn Marino    neither byte appears, return NULL.  */
26680a9cb8SJohn Marino 
27680a9cb8SJohn Marino extern void *memchr2 (void const *s, int c1, int c2, size_t n)
28680a9cb8SJohn Marino   _GL_ATTRIBUTE_PURE;
29680a9cb8SJohn Marino 
30680a9cb8SJohn Marino #ifdef __cplusplus
31680a9cb8SJohn Marino }
32680a9cb8SJohn Marino #endif
33