00001 /* Find the length of STRING, but scan at most MAXLEN characters. 00002 Copyright (C) 2005 Free Software Foundation, Inc. 00003 Written by Simon Josefsson. 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU Lesser General Public License as published by 00007 the Free Software Foundation; either version 2.1, or (at your option) 00008 any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public License 00016 along with this program; if not, write to the Free Software Foundation, 00017 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 00018 00019 #ifndef STRNLEN_H 00020 #define STRNLEN_H 00021 00022 /* Get strnlen declaration, if available. */ 00023 #include <string.h> 00024 00025 #if defined HAVE_DECL_STRNLEN && !HAVE_DECL_STRNLEN 00026 /* Find the length (number of bytes) of STRING, but scan at most 00027 MAXLEN bytes. If no '\0' terminator is found in that many bytes, 00028 return MAXLEN. */ 00029 extern size_t strnlen(const char *string, size_t maxlen); 00030 #endif 00031 00032 #endif /* STRNLEN_H */