Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

Dynamic string functions
[LibTDS API]

Handle dynamic string. More...

Defines

#define tds_dstr_init(s)   { *(s) = tds_str_empty; }
 init a string with empty

#define tds_dstr_isempty(s)   (**(s) == '\0')
 test if string is empty


Functions

void tds_dstr_zero (char **s)
 clear all string filling with zeroes (mainly for security reason)

void tds_dstr_free (char **s)
 free string

char * tds_dstr_copyn (char **s, const char *src, unsigned int length)
 Set string to a given buffer of characters.

char * tds_dstr_set (char **s, char *src)
 set a string from another buffer.

char * tds_dstr_copy (char **s, const char *src)
 copy a string from another


Detailed Description

Handle dynamic string.

In this string are always valid (you don't have NULL pointer, only empty string)


Function Documentation

char* tds_dstr_copy char **    s,
const char *    src
 

copy a string from another

Parameters:
s  dynamic string
src  source buffer
Returns:
string copied or NULL on memory error

char* tds_dstr_copyn char **    s,
const char *    src,
unsigned int    length
 

Set string to a given buffer of characters.

Parameters:
s  dynamic string
src  source buffer
length  length of source buffer
Returns:
string copied or NULL on memory error

char* tds_dstr_set char **    s,
char *    src
 

set a string from another buffer.

The string will use the supplied buffer (it not copy the string), so it should be a pointer returned by malloc.

Parameters:
s  dynamic string
src  source buffer
Returns:
string copied or NULL on memory error


Generated on Sat Apr 5 23:17:42 2003 for FreeTDS API by doxygen1.2.18