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