OSDN Git Service

Ruby-2.0.0 is now included in the repository.
[molby/Molby.git] / MolLib / Missing.h
1 /*
2  *  Missing.h
3  *  Molby
4  *
5  *  Created by Toshi Nagata on 08/11/06.
6  *  Copyright 2008 Toshi Nagata. All rights reserved.
7  *
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation version 2 of the License.
11  
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  GNU General Public License for more details.
16  */
17
18 #ifndef __MISSING_H__
19 #define __MISSING_H__
20
21 #if defined(__WXMSW__) || defined(__CMDMSW__)
22 #define MISSING_STRSEP 1
23 #define MISSING_ASPRINTF 1
24 #define MISSING_STRTOK_R 1
25 #define MISSING_MERGESORT 1
26 #define MISSING_STRDUP 1    /*  For debug with 'external' malloc library  */
27 #define PATH_SEPARATOR '\\'
28 #else
29 #define PATH_SEPARATOR '/'
30 #endif
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 void translate_char(char *p, int from, int to);
37 void fix_dosish_path(char *p);
38         
39 #if MISSING_STRSEP
40 char *strpbrk(const char *cs, const char *ct);
41 char *strsep(char **stringp, const char *delim);
42 #endif
43
44 #if MISSING_ASPRINTF
45 #include <stdarg.h>
46 int asprintf(char **ret, const char *format, ...);
47 int vasprintf(char **ret, const char *format, va_list ap);
48 #endif /* MISSING_ASPRINTF */
49
50 #if MISSING_STRDUP
51 #include <wchar.h>
52 char *_strdup(const char *src);
53 wchar_t *_wcsdup(const wchar_t *src);
54 char *strdup(const char *src);
55 wchar_t *wcsdup(const wchar_t *src);
56 #endif /* MISSING_STRDUP */
57
58 #if MISSING_STRTOK_R
59 char *strtok_r(char *str, const char *sep, char **lasts);
60 #endif /* MISSING_STRTOK_R */
61
62 #if MISSING_MERGESORT
63 #include <stdlib.h>
64 int mergesort(void *base, size_t nel, size_t width, int (*compar)(const void *, const void *));
65 #endif /* MISSING_MERGESORT */
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif /* __MISSING_H__ */