cfad47cfa3/src/missing.h

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
1
/* This file provides some non-standard functions that are considered
2
 * standard by the portable Tads code and thus aren't in the OS-layer.
3
 * None of these funtions will be implemented if the system happens to
4
 * provide them; in that case, the configure script will generate an
5
 * appropriate HAVE_[NAME OF FUNCTION] macro.
6
 */
7
#ifndef MISSING_H
8
#define MISSING_H
9
10
#include "common.h"
11
12
#include <stddef.h> /* For size_t. */
13
14
#ifdef __cplusplus
15
extern "C" {
16
#endif
17
18
/* Counted-length case-insensitive string comparison.
19
 *
20
 * This function always compares 'len' characters, regardless if a '\0'
21
 * character has been detected.
22
 */
23
#ifndef HAVE_MEMICMP
24
int
25
memicmp( const void* s1, const void* s2, size_t len );
26
#endif
27
28
/* Case-insensitive string comparison.
29
 *
30
 * We only use this implemention if neither stricmp() nor strcasecmp()
31
 * are available.
32
 */
33
#if !defined HAVE_STRICMP && !defined HAVE_STRCASECMP
34
int
35
stricmp( const char* s1, const char* s2 );
36
#endif
37
38
/* Length-limited case-insensitive string comparison.
39
 *
40
 * This function compares at most `n' characters, or until a '\0'
41
 * character has been detected.
42
 *
43
 * We only use this implemention if neither strnicmp() nor strncasecmp()
44
 * are available.
45
 */
46
#if !defined HAVE_STRNICMP && !defined HAVE_STRNCASECMP
47
int
48
strnicmp( const char* s1, const char* s2, size_t n );
49
#endif
50
51
/* Determine the length of a wide character string.
52
 */
53
#if !HAVE_DECL_WCSLEN
54
size_t
55
wcslen( wchar_t* s );
56
#endif
57
58
/* Copy a wide character string.
59
 */
60
#if !HAVE_DECL_WCSCPY
61
wchar_t*
62
wcscpy( wchar_t* dest, const wchar_t* src );
63
#endif
64
65
#ifdef __cplusplus
66
} /* extern "C" */
67
#endif
68
69
#endif /* MISSING_H */