40 #if defined __cplusplus
52 if( ( gStr->gStr = (
char*) xData_malloc2( smr, size + 1, 0,
"gStr->gStr" ) ) == NULL )
return( 1 );
60 gStr->allocated = size;
62 if( increment < (
int) gString_minIncrement ) increment = gString_minIncrement;
63 gStr->increment = increment;
71 if( gStr->gStr != NULL )
free( gStr->gStr );
81 if( gStr->gStr != NULL ) {
90 int gString_addTo( statusMessageReporting *smr, gString *gStr,
char const *str ) {
92 int n, size = strlen( str );
94 if( gStr->gStr == NULL ) {
96 else if( ( gStr->length + size ) > gStr->allocated ) {
98 if( n < size ) n = size;
100 if( ( gStr->gStr = (
char*) xData_realloc2( smr, gStr->gStr, gStr->allocated + n,
"gStr->gStr" ) ) == NULL )
return( 1 );
101 gStr->allocated +=
n;
103 strcpy( &(gStr->gStr[gStr->length - 1]), str );
104 gStr->length = gStr->length + size;
113 return( gStr->gStr );
121 return( gStr->length );
129 return( gStr->allocated );
137 return( gStr->increment );
140 #if defined __cplusplus
int gString_clear(statusMessageReporting *, gString *gStr)
int gString_addTo(statusMessageReporting *smr, gString *gStr, char const *str)
int gString_release(statusMessageReporting *smr, gString *gStr)
int gString_allocated(statusMessageReporting *, gString *gStr)
char const * gString_string(statusMessageReporting *, gString *gStr)
int gString_initialize(statusMessageReporting *smr, gString *gStr, int size, int increment)
int gString_length(statusMessageReporting *, gString *gStr)
int gString_increment(statusMessageReporting *, gString *gStr)