strings.h revision 1.20
11.20Sriastrad/* $NetBSD: strings.h,v 1.20 2024/11/01 18:42:30 riastradh Exp $ */ 21.3Scgd 31.1Scgd/*- 41.4Skleink * Copyright (c) 1998 The NetBSD Foundation, Inc. 51.1Scgd * All rights reserved. 61.1Scgd * 71.4Skleink * This code is derived from software contributed to The NetBSD Foundation 81.4Skleink * by Klaus Klein. 91.4Skleink * 101.1Scgd * Redistribution and use in source and binary forms, with or without 111.1Scgd * modification, are permitted provided that the following conditions 121.1Scgd * are met: 131.1Scgd * 1. Redistributions of source code must retain the above copyright 141.1Scgd * notice, this list of conditions and the following disclaimer. 151.1Scgd * 2. Redistributions in binary form must reproduce the above copyright 161.1Scgd * notice, this list of conditions and the following disclaimer in the 171.1Scgd * documentation and/or other materials provided with the distribution. 181.1Scgd * 191.4Skleink * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 201.4Skleink * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 211.4Skleink * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 221.4Skleink * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 231.4Skleink * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 241.4Skleink * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 251.4Skleink * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 261.4Skleink * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 271.4Skleink * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 281.4Skleink * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 291.4Skleink * POSSIBILITY OF SUCH DAMAGE. 301.1Scgd */ 311.1Scgd 321.4Skleink#ifndef _STRINGS_H_ 331.4Skleink#define _STRINGS_H_ 341.4Skleink 351.4Skleink#include <machine/ansi.h> 361.6Skleink#include <sys/featuretest.h> 371.4Skleink 381.4Skleink#ifdef _BSD_SIZE_T_ 391.4Skleinktypedef _BSD_SIZE_T_ size_t; 401.4Skleink#undef _BSD_SIZE_T_ 411.4Skleink#endif 421.4Skleink 431.9Sbjh21#if defined(_NETBSD_SOURCE) 441.8Skleink#include <sys/null.h> 451.4Skleink#endif 461.4Skleink 471.4Skleink#include <sys/cdefs.h> 481.4Skleink 491.18Sdholland#include <machine/int_types.h> 501.15Sjoerg 511.4Skleink__BEGIN_DECLS 521.19Sriastrad#if defined(_NETBSD_SOURCE) || \ 531.19Sriastrad (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE - 0 < 202405L) 541.10Sperryint bcmp(const void *, const void *, size_t); 551.10Sperryvoid bcopy(const void *, void *, size_t); 561.10Sperryvoid bzero(void *, size_t); 571.19Sriastrad#endif 581.20Sriastrad#if defined(_NETBSD_SOURCE) || _XOPEN_SOURCE - 0 >= 600 591.19Sriastradint ffs(int) __constfunc; 601.19Sriastrad#endif 611.19Sriastrad#if defined(_NETBSD_SOURCE) || _XOPEN_SOURCE - 0 >= 800 621.19Sriastradint ffsl(long) __constfunc; 631.19Sriastradint ffsll(long long) __constfunc; 641.19Sriastrad#endif 651.19Sriastrad#ifdef _NETBSD_SOURCE 661.14Sjoergunsigned int popcount(unsigned int) __constfunc; 671.14Sjoergunsigned int popcountl(unsigned long) __constfunc; 681.14Sjoergunsigned int popcountll(unsigned long long) __constfunc; 691.18Sdhollandunsigned int popcount32(__uint32_t) __constfunc; 701.18Sdhollandunsigned int popcount64(__uint64_t) __constfunc; 711.19Sriastrad#endif 721.19Sriastrad#if defined(_NETBSD_SOURCE) || \ 731.19Sriastrad (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE - 0 < 202405L) 741.19Sriastradchar *index(const char *, int); 751.10Sperrychar *rindex(const char *, int); 761.19Sriastrad#endif 771.10Sperryint strcasecmp(const char *, const char *); 781.10Sperryint strncasecmp(const char *, const char *, size_t); 791.4Skleink__END_DECLS 801.5Skleink 811.9Sbjh21#if defined(_NETBSD_SOURCE) 821.5Skleink#include <string.h> 831.5Skleink#endif 841.4Skleink 851.12Skristerw#if _FORTIFY_SOURCE > 0 861.11Stls#include <ssp/strings.h> 871.12Skristerw#endif 881.4Skleink#endif /* !defined(_STRINGS_H_) */ 89