Y-lib
Loadrunner libraries
Macros | Functions
Standard C string functions

Standard C functions using null terminated C strings (defined in stdio.h, cstring.h) More...

Macros

#define strcat(to, from)   0_DO_NOT_USE_strcat_THERE_IS_ALWAYS_A_BETTER_SOLUTION
 Force a compile time error when strcat() is used.
Because the use of strcat() is a very strong indicator for poorly written code being compiled – there is always a better solution! More...
 
#define strcpy(dest, source)   0_DO_NOT_USE_strcpy_DUPLICATION_IS_NOT_REQUIRED
 Force a compile time error when strcpy() is used.
The use of strcpy is banned because in practice strcpy is only used by novice coders doing unnecessary duplicating. (Typically when trying to avoid using pointers when actually using pointers.)
Evaluate your coding solution and avoid duplication. If you must, use the safer strncpy or snprintf. More...
 

Functions

int snprintf (char *buffer, size_t n, const char *format_string,...)
 Documented at http://www.cplusplus.com/reference/cstdio/snprintf/.
This function was introduced by the latest revision of the C++ standard (2011). Older compilers may not support it. More...
 
int sprintf (char *buffer, const char *format_string,...)
 Documented at http://www.cplusplus.com/reference/cstdio/sprintf/.
You should prefer snprintf over sprintf. More...
 
int sscanf (const char *buffer, const char *format_string,...)
 Documented at http://www.cplusplus.com/reference/cstdio/sscanf/. More...
 
char * strchr (const char *string, int c)
 Documented at http://www.cplusplus.com/reference/cstring/strchr/. More...
 
int strcmp (const char *string1, const char *string2)
 Documented at http://www.cplusplus.com/reference/cstring/strcmp/. More...
 
char * strdup (const char *string)
 Documented at http://pubs.opengroup.org/onlinepubs/007904975/functions/strdup.html . More...
 
int stricmp (const char *string1, const char *string2)
 Documented at http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rtref/stricmp.htm . More...
 
size_t strlen (const char *string)
 Documented at http://www.cplusplus.com/reference/cstring/strlen/. More...
 
char * strlwr (char *string)
 Documented at http://www.qnx.com/developers/docs/6.5.0/topic/com.qnx.doc.neutrino_lib_ref/s/strlwr.html . More...
 
char * strncat (char *to_string, const char *from_string, size_t n)
 Documented at http://www.cplusplus.com/reference/cstring/strncat/. More...
 
int strncmp (const char *string1, const char *string2, size_t n)
 Documented at http://www.cplusplus.com/reference/cstring/strncmp/. More...
 
int strnicmp (const char *string1, const char *string2, size_t num)
 Documented at http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rtref/strnicmp.htm. More...
 
char * strncpy (char *destination, const char *source, size_t num)
 Documented at http://www.cplusplus.com/reference/cstring/strncpy/. More...
 
char * strrchr (const char *string, int c)
 Documented at http://www.cplusplus.com/reference/cstring/strrchr/. More...
 
char * strset (char *string1, int character)
 Documented at http://www.qnx.com/developers/docs/6.5.0/topic/com.qnx.doc.neutrino_lib_ref/s/strset.html . More...
 
size_t * strspn (const char *string, const char *skipset)
 Documented at http://www.cplusplus.com/reference/cstring/strspn/. More...
 
char * strstr (const char *string1, const char *string2)
 Documented at http://www.cplusplus.com/reference/cstring/strstr/. More...
 
char * strtok (char *string, const char *delimiters)
 Documented at http://www.cplusplus.com/reference/cstring/strtok/. More...
 
char * strupr (char *string)
 Documented at http://www.qnx.com/developers/docs/6.5.0/topic/com.qnx.doc.neutrino_lib_ref/s/strupr.html . More...
 
double atof (const char *string)
 Documented at http://www.cplusplus.com/reference/cstdlib/atof/. More...
 
int atoi (const char *string)
 Documented at http://www.cplusplus.com/reference/cstdlib/atoi/. More...
 
long atol (const char *string)
 Documented at http://www.cplusplus.com/reference/cstdlib/atol/. More...
 
int itoa (int value, char *str, int radix)
 Documented at http://www.cplusplus.com/reference/cstdlib/itoa/. More...
 
long strtol (const char *string, char **endptr, int radix)
 Documented at http://www.cplusplus.com/reference/cstdlib/strtol/. More...
 
unsigned long int strtoul (const char *str, char **endptr, int base)
 Documented at http://www.cplusplus.com/reference/cstdlib/strtoul/. More...
 
double strtod (const char *str, char **endptr)
 Documented at http://www.cplusplus.com/reference/cstdlib/strtod/. More...
 

Detailed Description

Standard C functions using null terminated C strings (defined in stdio.h, cstring.h)

Macro Definition Documentation

#define strcat (   to,
  from 
)    0_DO_NOT_USE_strcat_THERE_IS_ALWAYS_A_BETTER_SOLUTION

Force a compile time error when strcat() is used.
Because the use of strcat() is a very strong indicator for poorly written code being compiled – there is always a better solution!

Unfortunately the use of #error is not possible here.

Note
Original declaration: char *strcat(char *to, const char *from); !

Definition at line 94 of file vugen.h.

#define strcpy (   dest,
  source 
)    0_DO_NOT_USE_strcpy_DUPLICATION_IS_NOT_REQUIRED

Force a compile time error when strcpy() is used.
The use of strcpy is banned because in practice strcpy is only used by novice coders doing unnecessary duplicating. (Typically when trying to avoid using pointers when actually using pointers.)
Evaluate your coding solution and avoid duplication. If you must, use the safer strncpy or snprintf.

Note
Original declaration: char *strcpy(char *dest, const char *source); !

Definition at line 105 of file vugen.h.

Function Documentation

double atof ( const char *  string)
int atoi ( const char *  string)
long atol ( const char *  string)
int itoa ( int  value,
char *  str,
int  radix 
)
int snprintf ( char *  buffer,
size_t  n,
const char *  format_string,
  ... 
)

Documented at http://www.cplusplus.com/reference/cstdio/snprintf/.
This function was introduced by the latest revision of the C++ standard (2011). Older compilers may not support it.

int sprintf ( char *  buffer,
const char *  format_string,
  ... 
)

Documented at http://www.cplusplus.com/reference/cstdio/sprintf/.
You should prefer snprintf over sprintf.

int sscanf ( const char *  buffer,
const char *  format_string,
  ... 
)
char* strchr ( const char *  string,
int  c 
)
int strcmp ( const char *  string1,
const char *  string2 
)
char* strdup ( const char *  string)
int stricmp ( const char *  string1,
const char *  string2 
)
size_t strlen ( const char *  string)
char* strlwr ( char *  string)
char* strncat ( char *  to_string,
const char *  from_string,
size_t  n 
)
int strncmp ( const char *  string1,
const char *  string2,
size_t  n 
)
char* strncpy ( char *  destination,
const char *  source,
size_t  num 
)
int strnicmp ( const char *  string1,
const char *  string2,
size_t  num 
)
char* strrchr ( const char *  string,
int  c 
)
char* strset ( char *  string1,
int  character 
)
size_t* strspn ( const char *  string,
const char *  skipset 
)
char* strstr ( const char *  string1,
const char *  string2 
)
double strtod ( const char *  str,
char **  endptr 
)
char* strtok ( char *  string,
const char *  delimiters 
)
long strtol ( const char *  string,
char **  endptr,
int  radix 
)
unsigned long int strtoul ( const char *  str,
char **  endptr,
int  base 
)
char* strupr ( char *  string)