summaryrefslogtreecommitdiffstats
path: root/include/c/mem/chr/memrchr.h
blob: 01b7f0d12ea9ce80ad866434f7a273baf0204bbc (plain) (blame)
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
// Copyright 2022 Alejandro Colomar <alx@kernel.org>
// SPDX-License-Identifier:  LGPL-3.0-or-later WITH LGPL-3.0-linking-exception


#ifndef INCLUDE_C_MEM_CHR_MEMRCHR_H_
#define INCLUDE_C_MEM_CHR_MEMRCHR_H_


#include <string.h>
#include <sys/types.h>

#include <c/qual/const/const.h>


#define c_memrchr(mem, c, sz)    c_const_generic_func(c_memrchr, mem, c, sz)


#pragma clang assume_nonnull begin
inline const void *(c_memrchr)(const void *mem, u_char c, size_t sz);


inline const void *
(c_memrchr)(const void *mem, u_char c, size_t sz)
{
	return memrchr(mem, c, sz);
}
#pragma clang assume_nonnull end


#endif  // Header guard