1 /* 2 Hatari - str.h 3 4 This file is distributed under the GNU General Public License, version 2 5 or at your option any later version. Read the file gpl.txt for details. 6 */ 7 8 #ifndef HATARI_STR_H 9 #define HATARI_STR_H 10 11 #include <string.h> 12 #include <config.h> 13 #if HAVE_STRINGS_H 14 # include <strings.h> 15 #endif 16 17 18 /* Define this only for an old Linux system which does not store 19 * pathnames in UTF-8. If this is defined, pathnames are converted 20 * to the host character set as defined by the locale. 21 * Do not define this for OSX, as the unicode pathnames then won't 22 * be converted from the decomposed to the precomposed form. 23 * 24 * TODO: this should have option / be set in CMake config. 25 */ 26 /* #define USE_LOCALE_CHARSET 1 */ 27 28 29 /* Invalid characters in paths & filenames are replaced by this, 30 * a valid, but uncommon GEMDOS file name character, 31 * which hopefully shouldn't cause problems in: 32 * - TOS *.INF files used for autostarting 33 * - GEM file selectors (TOS or replacement ones) 34 * - path/file handling code of common programming languages 35 */ 36 #define INVALID_CHAR '+' 37 38 extern char *Str_Trim(char *buffer); 39 extern char *Str_ToUpper(char *pString); 40 extern char *Str_ToLower(char *pString); 41 extern char *Str_Trunc(char *str); 42 extern bool Str_IsHex(const char *str); 43 extern void Str_Filename2TOSname(const char *src, char *dst); 44 extern void Str_Dump_Hex_Ascii ( char *p , int Len , int Width , const char *Suffix , FILE *pFile ); 45 46 /* Interface of character set conversions */ 47 extern void Str_AtariToHost(const char *source, char *dest, int destLen, char replacementChar); 48 extern void Str_HostToAtari(const char *source, char *dest, char replacementChar); 49 extern void Str_DecomposedToPrecomposedUtf8(const char *source, char *dest); 50 51 52 #endif /* HATARI_STR_H */ 53