cudd  3.0.0
The University of Colorado Decision Diagram Package
Typedefs | Functions
cstringstream.h File Reference

Package for simple stringstreams in C. More...

Go to the source code of this file.

Typedefs

typedef struct _cstringstreamcstringstream
 Type of a string stream.
 
typedef struct _cstringstream const * const_cstringstream
 Const-qualified version of cstringstream.
 

Functions

cstringstream newStringStream (void)
 Returns a new cstringstream with an empty string. More...
 
void deleteStringStream (cstringstream ss)
 Frees cstringstream ss.
 
int clearStringStream (cstringstream ss)
 Clears the contents of cstringstream ss. More...
 
cstringstream copyStringStream (const_cstringstream src)
 Copies cstringstream src to a new cstringstream. More...
 
int resizeStringStream (cstringstream ss, size_t newSize)
 Changes the size of cstringstream ss. More...
 
int sizeStringStream (const_cstringstream ss, size_t *num)
 Writes the size of cstringstream ss to the location pointed by num. More...
 
int getStringStream (const_cstringstream ss, size_t i, char *c)
 Writes the i-th element of cstringstream ss to the location pointed by c. More...
 
int appendCharStringStream (cstringstream ss, char c)
 Adds char c at the end of cstringstream ss. More...
 
int appendStringStringStream (cstringstream ss, char const *s)
 Adds string s at the end of cstringstream ss. More...
 
int appendIntStringStream (cstringstream ss, int d)
 Adds int d at the end of cstringstream ss. More...
 
int appendUnsignedStringStream (cstringstream ss, unsigned u)
 Adds unsigned u at the end of cstringstream ss. More...
 
int appendLongStringStream (cstringstream ss, long ld)
 Adds long ld at the end of cstringstream ss. More...
 
int appendUnsignedLongStringStream (cstringstream ss, unsigned long lu)
 Adds unsigned long lu at the end of cstringstream ss. More...
 
int appendDoubleStringStream (cstringstream ss, double g)
 Adds double g at the end of cstringstream ss. More...
 
int putStringStream (cstringstream ss, size_t index, char c)
 Sets the i-th element of cstringstream ss to c. More...
 
char * stringFromStringStream (const_cstringstream ss)
 Returns a NULL-terminated string from the contents of cstringstream ss. More...
 

Detailed Description

Package for simple stringstreams in C.

Author
Fabio Somenzi
Id
cstringstream.h,v 1.1 2015/07/01 20:36:47 fabio Exp fabio

Function Documentation

◆ appendCharStringStream()

int appendCharStringStream ( cstringstream  ss,
char  c 
)

Adds char c at the end of cstringstream ss.

Returns
0 if successful or -1 otherwise.

◆ appendDoubleStringStream()

int appendDoubleStringStream ( cstringstream  ss,
double  g 
)

Adds double g at the end of cstringstream ss.

Returns
0 if successful or -1 otherwise.

◆ appendIntStringStream()

int appendIntStringStream ( cstringstream  ss,
int  d 
)

Adds int d at the end of cstringstream ss.

Returns
0 if successful or -1 otherwise.

◆ appendLongStringStream()

int appendLongStringStream ( cstringstream  ss,
long  ld 
)

Adds long ld at the end of cstringstream ss.

Returns
0 if successful or -1 otherwise.

◆ appendStringStringStream()

int appendStringStringStream ( cstringstream  ss,
char const *  s 
)

Adds string s at the end of cstringstream ss.

Returns
0 if successful or -1 otherwise.

◆ appendUnsignedLongStringStream()

int appendUnsignedLongStringStream ( cstringstream  ss,
unsigned long  lu 
)

Adds unsigned long lu at the end of cstringstream ss.

Returns
0 if successful or -1 otherwise.

◆ appendUnsignedStringStream()

int appendUnsignedStringStream ( cstringstream  ss,
unsigned  u 
)

Adds unsigned u at the end of cstringstream ss.

Returns
0 if successful or -1 otherwise.

◆ clearStringStream()

int clearStringStream ( cstringstream  ss)

Clears the contents of cstringstream ss.

Returns
0 if succesful and -1 if ss is an invalid pointer.

◆ copyStringStream()

cstringstream copyStringStream ( const_cstringstream  src)

Copies cstringstream src to a new cstringstream.

Returns
0 if succesful or -1 if src is an invalid pointer or memory allocation fails.

◆ getStringStream()

int getStringStream ( const_cstringstream  ss,
size_t  i,
char *  c 
)

Writes the i-th element of cstringstream ss to the location pointed by c.

Returns
0 if successful or -1 otherwise.

◆ newStringStream()

cstringstream newStringStream ( void  )

Returns a new cstringstream with an empty string.

Returns
NULL if creation fails.

◆ putStringStream()

int putStringStream ( cstringstream  ss,
size_t  index,
char  c 
)

Sets the i-th element of cstringstream ss to c.

Returns
0 if successful or -1 otherwise.

The i-th element of ss must already exist.

◆ resizeStringStream()

int resizeStringStream ( cstringstream  ss,
size_t  newSize 
)

Changes the size of cstringstream ss.

Returns
0 if successful or -1 if resizing fails.

◆ sizeStringStream()

int sizeStringStream ( const_cstringstream  ss,
size_t *  num 
)

Writes the size of cstringstream ss to the location pointed by num.

Returns
0 if succesful or -1 if ss is an invalid pointer.

◆ stringFromStringStream()

char* stringFromStringStream ( const_cstringstream  ss)

Returns a NULL-terminated string from the contents of cstringstream ss.

In case of failure, it returns NULL. The returned string must be freed by the caller.