X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=includes%2Fstring.h;h=00309f520910d0a0601fe79181d109164d1eae3f;hb=10f020f1a39804bbef8cd1cf35ef7c9a8e75c7d6;hp=a3a154d7f4c667ac2359d53a14084e4c99fab4bc;hpb=23e170071520809fd7b2ea3514e48399358362f2;p=pdclib.old diff --git a/includes/string.h b/includes/string.h index a3a154d..00309f5 100644 --- a/includes/string.h +++ b/includes/string.h @@ -1,8 +1,6 @@ /* $Id$ */ -/* Release $Name$ */ - -/* String handling +/* 7.21 String handling This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. @@ -10,23 +8,18 @@ #ifndef _PDCLIB_STRING_H #define _PDCLIB_STRING_H _PDCLIB_STRING_H - -#ifndef _PDCLIB_AUX_H -#define _PDCLIB_AUX_H _PDCLIB_AUX_H -#include <_PDCLIB_aux.h> -#endif - -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif +_PDCLIB_BEGIN_EXTERN_C #ifndef _PDCLIB_SIZE_T_DEFINED #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED typedef _PDCLIB_size_t size_t; #endif +#ifndef _PDCLIB_NULL_DEFINED +#define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED #define NULL _PDCLIB_NULL +#endif /* String function conventions */ @@ -184,12 +177,17 @@ void * memset( void * s, int c, size_t n ); /* Map an error number to a (locale-specific) error message string. Error numbers are typically errno values, but any number is mapped to a message. TODO: PDCLib does not yet support locales. - TODO: strerror() not yet implemented. -char * strerror( int errnum ); */ +char * strerror( int errnum ); /* Returns the length of the string s (excluding terminating '\0'). */ size_t strlen( const char * s ); +#if _PDCLIB_POSIX_MIN(2008098L) || _PDCLIB_XOPEN_MIN(0) +char * strdup( const char* src ); +char * strndup( const char* src, size_t n ); +#endif + +_PDCLIB_END_EXTERN_C #endif