50 lines
1.0 KiB
C
50 lines
1.0 KiB
C
|
|
#ifndef __safestr_lib
|
|
#define __safestr_lib
|
|
#include "config.h"
|
|
|
|
#define SAFESTRING_COMMON_BUFFER_SIZE 1024
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
char * strsafecpy( char * dest, const char * src, int size );
|
|
|
|
char * strnsafecpy( char * dest, const char * src, int n, int size );
|
|
|
|
char * strsafecat( char * dest, const char * src, int size );
|
|
|
|
char * strcatf( char * dest, int size, const char * fmt, ... );
|
|
|
|
char * strnsafecat( char * dest, const char * src, int n, int size );
|
|
// Append first n characters of src to dest
|
|
|
|
char * last_line( char * buf ); // find the last line and return the pointer to its beginning
|
|
|
|
char * safestrdup( const char *s );
|
|
|
|
char * strreverse( char *s );
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
char * toupper( char * s, char * dest=0, int sz=0 );
|
|
char * tolower( char * s, char * dest=0, int sz=0 );
|
|
|
|
char * toupper( const char * s, char * dest, int sz );
|
|
char * tolower( const char * s, char * dest, int sz );
|
|
|
|
#endif
|
|
|
|
|
|
//int GetParam(char * params, char _name[], char value[], int valuelen, char ** end = 0 );
|
|
|
|
|
|
#endif
|