|
|
1.1 root 1: /*
2: Hatari - str.h
3:
1.1.1.5 root 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.
1.1 root 6: */
7:
8: #ifndef HATARI_STR_H
9: #define HATARI_STR_H
10:
1.1.1.7 root 11: #include "config.h"
1.1 root 12: #include <string.h>
13: #if HAVE_STRINGS_H
14: # include <strings.h>
15: #endif
16:
1.1.1.7 root 17: #if !HAVE_LIBC_STRLCPY
18: #define strlcpy(dst, src, len) SDL_strlcpy(dst, src, len)
19: #endif
20:
21: /* Define this only for an old Linux system which does not store
22: * pathnames in UTF-8. If this is defined, pathnames are converted
23: * to the host character set as defined by the locale.
24: * Do not define this for OSX, as the unicode pathnames then won't
25: * be converted from the decomposed to the precomposed form.
26: *
27: * TODO: this should have option / be set in CMake config.
28: */
29: /* #define USE_LOCALE_CHARSET 1 */
30:
31:
1.1.1.6 root 32: /* Invalid characters in paths & filenames are replaced by this,
33: * a valid, but uncommon GEMDOS file name character,
34: * which hopefully shouldn't cause problems in:
35: * - TOS *.INF files used for autostarting
36: * - GEM file selectors (TOS or replacement ones)
37: * - path/file handling code of common programming languages
1.1.1.4 root 38: */
1.1.1.6 root 39: #define INVALID_CHAR '+'
1.1.1.4 root 40:
1.1.1.8 ! root 41: #define Str_Free(s) { free(s); s = NULL; }
! 42:
1.1.1.2 root 43: extern char *Str_Trim(char *buffer);
44: extern char *Str_ToUpper(char *pString);
45: extern char *Str_ToLower(char *pString);
1.1.1.8 ! root 46: extern char *Str_Alloc(int len);
! 47: extern char *Str_Dup(const char *str);
1.1.1.2 root 48: extern char *Str_Trunc(char *str);
49: extern bool Str_IsHex(const char *str);
1.1.1.4 root 50: extern void Str_Filename2TOSname(const char *src, char *dst);
1.1.1.6 root 51: extern void Str_Dump_Hex_Ascii ( char *p , int Len , int Width , const char *Suffix , FILE *pFile );
1.1 root 52:
1.1.1.7 root 53: /* Interface of character set conversions */
54: extern void Str_AtariToHost(const char *source, char *dest, int destLen, char replacementChar);
55: extern void Str_DecomposedToPrecomposedUtf8(const char *source, char *dest);
56:
57:
1.1 root 58: #endif /* HATARI_STR_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.