A one-liner macro is simpler, and works just fine.
We don't need the function at all, since we don't use it as a callback.
The macro changes the return type, but we don't really care about that
detail; we could cast it to bool, but we don't really need that, so keep
it simple.
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-// SPDX-FileCopyrightText: 2024-2025, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar <alx@kernel.org>
// SPDX-License-Identifier: BSD-3-Clause
#include "config.h"
-#include <stdbool.h>
-
#include "string/strcmp/strcaseeq.h"
-
-
-extern inline bool strcaseeq(const char *s1, const char *s2);
-// SPDX-FileCopyrightText: 2024-2025, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar <alx@kernel.org>
// SPDX-License-Identifier: BSD-3-Clause
#include "config.h"
-#include <stdbool.h>
#include <strings.h>
-#include "attr.h"
-
-ATTR_STRING(1) ATTR_STRING(2)
-inline bool strcaseeq(const char *s1, const char *s2);
-
-
-// strings case-insensitive equal
-// streq(), but case-insensitive.
-inline bool
-strcaseeq(const char *s1, const char *s2)
-{
- return strcasecmp(s1, s2) == 0;
-}
+// strcaseeq - strings case-insensitive equal
+#define strcaseeq(s1, s2) (!strcasecmp(s1, s2))
#endif // include guard
-// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar <alx@kernel.org>
// SPDX-License-Identifier: BSD-3-Clause
#include "config.h"
-#include <stdbool.h>
-
#include "string/strcmp/streq.h"
-
-
-extern inline bool streq(const char *s1, const char *s2);
-// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar <alx@kernel.org>
// SPDX-License-Identifier: BSD-3-Clause
#include "config.h"
-#include <stdbool.h>
#include <string.h>
-#include "attr.h"
-
-ATTR_STRING(1)
-ATTR_STRING(2)
-inline bool streq(const char *s1, const char *s2);
-
-
-// strings equal
-/* Return true if s1 and s2 compare equal. */
-inline bool
-streq(const char *s1, const char *s2)
-{
- return strcmp(s1, s2) == 0;
-}
+// streq - strings equal
+#define streq(s1, s2) (!strcmp(s1, s2))
#endif // include guard