mastring.h File Reference


Detailed Description

String handling.

#include "ma.h"
#include "mactype.h"

Functions

char * strncpy (char *dest, const char *source, size_t count)
int strncmp (const char *s1, const char *s2, size_t count)
char * strncat (char *s1, const char *s2, size_t count)
int memcmp (const void *dst, const void *src, size_t n)
int stricmp (const char *s1, const char *s2)
int strnicmp (const char *s1, const char *s2, size_t count)
char * strchr (const char *s, int ch)
char * strrchr (const char *s, int ch)
char * strstr (const char *str1, const char *str2)
size_t strspn (const char *string, const char *control)
size_t strcspn (const char *string, const char *control)
char * strpbrk (const char *string, const char *control)
void * memmove (void *dst, const void *src, size_t count)
void * memchr (const void *buf, int ch, size_t count)
void * memrchr (const void *buf, int ch, size_t count)
char * strdup (const char *s)
char * strlwr (char *s)
char * strupr (char *s)
char * strnset (char *s, int c, size_t count)
char * strrev (char *s)
void * memccpy (void *dst, const void *src, int c, size_t count)
int memicmp (const void *buf1, const void *buf2, size_t count)
size_t strlen (const char *s)
char * strcat (char *dst, const char *src)
char * strset (char *s, int c)
double strtod (const char *string, char **endptr)
size_t strnlen (const char *s, size_t count)
int StringMatch (const char *a, const char *b)
int StringMatch1 (const char *a, const char *b)
int memeq (const void *a, const void *b, int size)
int ConvertLatin1ToUtf8 (char *dst, int src)
int i2a (int a, char *dst)
int d2a (double d, char *dst)


Function Documentation

char* strncpy char *  dest,
const char *  source,
size_t  count
 

int strncmp const char *  s1,
const char *  s2,
size_t  count
 

char* strncat char *  s1,
const char *  s2,
size_t  count
 

int memcmp const void *  dst,
const void *  src,
size_t  n
 

int stricmp const char *  s1,
const char *  s2
 

Compares strings s1 with s2 without case sensitivity.

Returns:
< 0 if s1 is less than s2
= 0 if s1 is equal to s2
> 0 if s1 is greater than s2

int strnicmp const char *  s1,
const char *  s2,
size_t  count
 

Compares strings s1 with s2 for a max length count without case sensitivity.

Returns:
< 0 if s1 is less than s2
= 0 if s1 is equal to s2
> 0 if s1 is greater than s2

char* strchr const char *  s,
int  ch
 

Scans a string for the first occurance of a character.

Returns:
A pointer to the character, NULL if not found.

char* strrchr const char *  s,
int  ch
 

Scans a string for the last occurance of a character.

Returns:
A pointer to the character, NULL if not found.

char* strstr const char *  str1,
const char *  str2
 

Scans the substring str2 in string str1.

Returns:
A pointer to the substring, NULL if not found.

size_t strspn const char *  string,
const char *  control
 

Find length of initial segment matching mask.

Returns:
Returns the length of the initial portion of string which consists only of characters that are part of control.

size_t strcspn const char *  string,
const char *  control
 

Gets the length of a complementary substring.

Returns:
The length of the initial part of string not containing any of the characters that are part of control. This is the length of string if none of the characters in control are found in string.

char* strpbrk const char *  string,
const char *  control
 

A pointer to the first occurrence in string of any of the characters that are part of control, or a null pointer if none of the characters of control is found in string before the terminating null-character.

void* memmove void *  dst,
const void *  src,
size_t  count
 

Moves count bytes from src to dst.

Returns:
Pointer to the last destination memory address.

void* memchr const void *  buf,
int  ch,
size_t  count
 

Searches buf for count bytes for the first occurance of ch.

Returns:
Pointer to the ch found, NULL if not found.

void* memrchr const void *  buf,
int  ch,
size_t  count
 

Searches buf for count bytes for the last occurance of ch.

Returns:
Pointer to the ch found, NULL if not found.

char* strdup const char *  s  ) 
 

Makes a duplicate of a string, by allocation memory from the heap.

Returns:
Pointer to the new string.

char* strlwr char *  s  ) 
 

Makes a string lower case.

Returns:
Pointer to the end of the string.

char* strupr char *  s  ) 
 

Makes a string upper case.

Returns:
Pointer to the end of the string.

char* strnset char *  s,
int  c,
size_t  count
 

Sets a number of characters in the string s to c.

Returns:
Pointer to the last character changed.

char* strrev char *  s  ) 
 

Reverses the order of the characters in a string.

Returns:
Pointer to the altered string.

void* memccpy void *  dst,
const void *  src,
int  c,
size_t  count
 

Copies bytes from memory area src into dst, stops if byte c is encounted

Returns:
A Pointer to the byte after the copy of c in dst, if c not found a null pointer.

int memicmp const void *  buf1,
const void *  buf2,
size_t  count
 

Compares first n (count) bytes of buf1 & buf2, is case insensitive.

Returns:
< 0 if buf1 is less than buf2
= 0 if buf1 is equal to buf2
> 0 if buf1 is greater than buf2

size_t strlen const char *  s  ) 
 

Get the length of a string.

Returns:
The length of the string.

char* strcat char *  dst,
const char *  src
 

Appends the string dst with the string src, the dst string is appended at its end.

Returns:
Destination string.

char* strset char *  s,
int  c
 

Sets all the characters in string s to the character c,

Returns:
Destination string s.

double strtod const char *  string,
char **  endptr
 

Converts a string to a double.

Stores the pointer to the character immediately following the converted string in the pointer pointed to by endptr, if endptr is not NULL.

size_t strnlen const char *  s,
size_t  count
 

int StringMatch const char *  a,
const char *  b
 

Compares two null-terminated strings. Returns TRUE if the characters of the shorter string equals the first characters of the longer string.

int StringMatch1 const char *  a,
const char *  b
 

Compares two null-terminated strings. Returns TRUE if the characters of a equals the first characters of b.

int memeq const void *  a,
const void *  b,
int  size
 

Compares memory areas. Returns TRUE if identical, FALSE otherwise.

int ConvertLatin1ToUtf8 char *  dst,
int  src
 

Converts a single Latin-1 character to UTF-8. Returns the number of bytes written to dst (1 or 2).

int i2a int  a,
char *  dst
 

Stores a string representation of a into the buffer pointed to by dst. Returns strlen(dst).

int d2a double  d,
char *  dst
 

Stores a string representation of d into the buffer pointed to by dst. Returns strlen(dst).


Generated on Sat Feb 13 00:15:38 2010 for MoSync 2 beta 1 by  doxygen 1.4.6-NO