summaryrefslogtreecommitdiffstats
path: root/src/misc/vec/vecStr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/vec/vecStr.h')
-rw-r--r--src/misc/vec/vecStr.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/misc/vec/vecStr.h b/src/misc/vec/vecStr.h
index 33be5f1d..2a9dc7a0 100644
--- a/src/misc/vec/vecStr.h
+++ b/src/misc/vec/vecStr.h
@@ -301,8 +301,8 @@ static inline void Vec_StrGrow( Vec_Str_t * p, int nCapMin )
{
if ( p->nCap >= nCapMin )
return;
- p->pArray = REALLOC( char, p->pArray, nCapMin );
- p->nCap = nCapMin;
+ p->pArray = REALLOC( char, p->pArray, 2 * nCapMin );
+ p->nCap = 2 * nCapMin;
}
/**Function*************************************************************
@@ -383,6 +383,26 @@ static inline void Vec_StrPush( Vec_Str_t * p, char Entry )
/**Function*************************************************************
+ Synopsis [Appends the string to the char vector.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void Vec_StrAppend( Vec_Str_t * p, char * pString )
+{
+ int i, nLength = strlen(pString);
+ Vec_StrGrow( p, p->nSize + nLength );
+ for ( i = 0; i < nLength; i++ )
+ p->pArray[p->nSize + i] = pString[i];
+ p->nSize += nLength;
+}
+
+/**Function*************************************************************
+
Synopsis [Returns the last entry and removes it from the list.]
Description []