/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef _CPR_STRING_H_ #define _CPR_STRING_H_
#include <stdarg.h>
#include"cpr_types.h" #include"cpr_strings.h"
#ifdef __cplusplus extern"C" { #endif
/** * sstrncpy * * @brief The CPR wrapper for strncpy * * This is Cisco's *safe* version of strncpy. The string will always * be NUL terminated (which is not ANSI compliant). * * @param[in] dst - The destination string * @param[in] src - The source * @param[in] max - maximum length in octets to concatenate * * @return Pointer to the @b end of the string * * @note Modified to be explicitly safe for all inputs. * Also return the number of characters copied excluding the * NUL terminator vs. the original string s1. This simplifies * code where sstrncat functions follow.
*/ unsignedlong
sstrncpy(char *dst, constchar *src, unsignedlong max);
/** * sstrncat * * @brief The CPR wrapper for strncat * * This is Cisco's *safe* version of strncat. The string will always * be NUL terminated (which is not ANSI compliant). * * @param[in] s1 - first string * @param[in] s2 - second string * @param[in] max - maximum length in octets to concatenate * * @return Pointer to the @b end of the string * * @note Modified to be explicitly safe for all inputs. * Also return the end vs. the beginning of the string s1 * which is useful for multiple sstrncat calls.
*/ char *
sstrncat(char *s1, constchar *s2, unsignedlong max);
/* * flex_string_check_alloc * * Allocate enough chunks to hold the new minimum size. * * Not thread-safe
*/ void flex_string_check_alloc(flex_string *fs, size_t new_min_length);
/* From cpr_linux_string.h */ /* cpr_strdup * * @brief The CPR wrapper for strdup
* The cpr_strdup shall return a pointer to a new string, which is a duplicate * of the string pointed to by "str" argument. A null pointer is returned if the * new string cannot be created. * * @param[in] str - The string that needs to be duplicated * * @return The duplicated string or NULL in case of no memory *
*/ char *
cpr_strdup(constchar *str);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.