Stardew Engine
Loading...
Searching...
No Matches
StardewString.h
Go to the documentation of this file.
1#ifndef STARDEWSTRING_H
2#define STARDEWSTRING_H
3
4#include "DynArray.h"
5
10int Str_Tokenize(char* string, char sep);
11
14void Str_AdvanceToNextToken(char** pNextToken);
15
20#define DECLARE_STATIC_STRING_COPY(copyName, copySrc) \
21 static VECTOR(char) copyName = NULL; \
22 if(!copyName) \
23 { \
24 copyName = NEW_VECTOR(char); \
25 copyName = VectorResize(copyName, 32000); \
26 } \
27 size_t len = strlen(copySrc); \
28 while(len > VectorCapacity(copyName)) \
29 { \
30 copyName = VectorResize(copyName, VectorCapacity(copyName) * 2); \
31 } \
32 strcpy(copyName, copySrc);
33
34#endif
int Str_Tokenize(char *string, char sep)
replaces occurences of the char "sep" in the string with null characters and returns the resulting nu...
Definition String.c:3
void Str_AdvanceToNextToken(char **pNextToken)
advance a char pointer to the null terminator and then past its
Definition String.c:22