New upstream version 4.19.0
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCMP_STRCASEEQ_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <strings.h>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "string/strcmp/strcaseprefix.h"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCMP_STRCASEPREFIX_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -19,9 +19,9 @@
|
||||
#define strcaseprefix(s, prefix) \
|
||||
({ \
|
||||
const char *p_; \
|
||||
\
|
||||
\
|
||||
p_ = strcaseprefix_(s, prefix); \
|
||||
\
|
||||
\
|
||||
_Generic(s, \
|
||||
const char *: p_, \
|
||||
const void *: p_, \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCMP_STREQ_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// SPDX-FileCopyrightText: 2025, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "string/strcmp/strneq.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
extern inline bool strneq(const char *strn, const char *s, size_t size);
|
||||
@@ -0,0 +1,37 @@
|
||||
// SPDX-FileCopyrightText: 2025, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_STRING_STRCMP_STRNEQ_H_
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCMP_STRNEQ_H_
|
||||
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "sizeof.h"
|
||||
|
||||
|
||||
#define strneq_a(strn, s) strneq(strn, s, countof(strn))
|
||||
|
||||
|
||||
ATTR_STRING(2)
|
||||
inline bool strneq(ATTR_NONSTRING const char *strn, const char *s, size_t size);
|
||||
|
||||
|
||||
// nonstring equal
|
||||
/* Return true if the nonstring strn and the string s compare equal. */
|
||||
inline bool
|
||||
strneq(const char *strn, const char *s, size_t size)
|
||||
{
|
||||
if (strlen(s) > size)
|
||||
return false;
|
||||
|
||||
return strncmp(strn, s, size) == 0;
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "string/strcmp/strprefix.h"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCMP_STRPREFIX_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -19,9 +19,9 @@
|
||||
#define strprefix(s, prefix) \
|
||||
({ \
|
||||
const char *p_; \
|
||||
\
|
||||
\
|
||||
p_ = strprefix_(s, prefix); \
|
||||
\
|
||||
\
|
||||
_Generic(s, \
|
||||
const char *: p_, \
|
||||
const void *: p_, \
|
||||
|
||||
Reference in New Issue
Block a user