File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1204,6 +1204,7 @@ RLAPI int GetGlyphIndex(Font font, int codepoint);
12041204
12051205// Text strings management functions (no utf8 strings, only byte chars)
12061206// NOTE: Some strings allocate memory internally for returned strings, just be careful!
1207+ RLAPI int TextCopy (char * dst , const char * src ); // Copy one string to another, returns bytes copied
12071208RLAPI bool TextIsEqual (const char * text1 , const char * text2 ); // Check if two text string are equal
12081209RLAPI unsigned int TextLength (const char * text ); // Get text length, checks for '\0' ending
12091210RLAPI const char * TextFormat (const char * text , ...); // Text formatting with variables (sprintf style)
Original file line number Diff line number Diff line change @@ -1105,8 +1105,32 @@ int GetGlyphIndex(Font font, int codepoint)
11051105#endif
11061106}
11071107
1108+ //----------------------------------------------------------------------------------
11081109// Text strings management functions
11091110//----------------------------------------------------------------------------------
1111+
1112+ // Copy one string to another, returns bytes copied
1113+ int TextCopy (char * dst , const char * src )
1114+ {
1115+ int bytes = 0 ;
1116+
1117+ if (dst != NULL )
1118+ {
1119+ while (* src != '\0' )
1120+ {
1121+ * dst = * src ;
1122+ dst ++ ;
1123+ src ++ ;
1124+
1125+ bytes ++ ;
1126+ }
1127+
1128+ * dst = '\0' ;
1129+ }
1130+
1131+ return bytes ;
1132+ }
1133+
11101134// Check if two text string are equal
11111135// REQUIRES: strcmp()
11121136bool TextIsEqual (const char * text1 , const char * text2 )
You can’t perform that action at this time.
0 commit comments