Watt-32 tcp/ip  2.2 dev-rel.10
strings.c File Reference

Go to the source code of this file.


void _outchar (char c)
static int W32_CALL outch (char chr)
 int (W32_CALL *_outch)(char c)
 int (MS_CDECL *_printf)(const char *
static int MS_CDECL empty_printf (const char *fmt,...)
void W32_CALL outs (const char *s)
void W32_CALL outsnl (const char *s)
void W32_CALL outsn (const char *s, int n)
void W32_CALL outhex (char c)
void W32_CALL outhexes (const char *s, int n)
char *W32_CALL rip (char *s)
 Removes end-of-line termination from a string. More...
BYTE atox (const char *hex)
 Convert hexstring "0x??" to hex. More...
char * strreplace (int ch1, int ch2, char *str)
 Replace 'ch1' to 'ch2' in string 'str'.
char * _strlcpy (char *dst, const char *src, size_t len)
 Similar to strncpy(), but always returns 'dst' with 0-termination.
char * strltrim (const char *s)
 Return pointer to first non-blank (space/tab) in a string.
char * strrtrim (char *s)
 Trim trailing blanks (space/tab) from a string.
size_t strntrimcpy (char *dst, const char *src, size_t n)
 Copy a string, stripping leading and trailing blanks (space/tab). More...
char * strtok_r (char *ptr, const char *sep, char **end)
int isstring (const char *str, size_t len)

Detailed Description

Printing to console and general string handling.

Definition in file strings.c.

Function Documentation

BYTE atox ( const char *  hex)

Convert hexstring "0x??" to hex.

Just assumes "??" are in the [0-9,a-fA-F] range. Don't call atox() unless they are or before checking for a "0x" prefix.

Definition at line 194 of file strings.c.

char* W32_CALL rip ( char *  s)

Removes end-of-line termination from a string.

Removes "\n" (Unix), "\r" (MacOS) or "\r\n" (DOS/net-ascii) terminations, but not single "\n\r" (who uses that?).

Definition at line 180 of file strings.c.

size_t strntrimcpy ( char *  dst,
const char *  src,
size_t  n 

Copy a string, stripping leading and trailing blanks (space/tab).

This function does not work exactly like strncpy(), in that it expects the destination buffer to be at last (n+1) chars long.

Definition at line 277 of file strings.c.