Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

util.h
Go to the documentation of this file.
1 /**********************************************************************
2
3 util.h -
4
5 $Author: tadf $
6 created at: Thu Mar 9 11:55:53 JST 1995
7
8 Copyright (C) 1993-2007 Yukihiro Matsumoto
9
10 **********************************************************************/
11
12 #ifndef RUBY_UTIL_H
13 #define RUBY_UTIL_H 1
14
15 #if defined(__cplusplus)
16 extern "C" {
17 #if 0
18 } /* satisfy cc-mode */
19 #endif
20 #endif
21
22 #include "ruby/defines.h"
23 #ifdef RUBY_EXTCONF_H
24 #include RUBY_EXTCONF_H
25 #endif
26
27 #ifndef _
28 #ifdef __cplusplus
29 # ifndef HAVE_PROTOTYPES
30 # define HAVE_PROTOTYPES 1
31 # endif
32 # ifndef HAVE_STDARG_PROTOTYPES
33 # define HAVE_STDARG_PROTOTYPES 1
34 # endif
35 #endif
36 #ifdef HAVE_PROTOTYPES
37 # define _(args) args
38 #else
39 # define _(args) ()
40 #endif
41 #ifdef HAVE_STDARG_PROTOTYPES
42 # define __(args) args
43 #else
44 # define __(args) ()
45 #endif
46 #endif
47
48 #if defined __GNUC__ && __GNUC__ >= 4
49 #pragma GCC visibility push(default)
50 #endif
51
52 #define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
53 unsigned long ruby_scan_oct(const char *, size_t, size_t *);
54 #define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))
55 unsigned long ruby_scan_hex(const char *, size_t, size_t *);
56
57 void ruby_qsort(void *, const size_t, const size_t,
58 int (*)(const void *, const void *, void *), void *);
59
60 void ruby_setenv(const char *, const char *);
61 void ruby_unsetenv(const char *);
62 #undef setenv
63 #undef unsetenv
64 #define setenv(name,val) ruby_setenv((name),(val))
65 #define unsetenv(name,val) ruby_unsetenv(name)
66
67 char *ruby_strdup(const char *);
68 #undef strdup
69 #define strdup(s) ruby_strdup(s)
70
71 char *ruby_getcwd(void);
72 #define my_getcwd() ruby_getcwd()
73
74 double ruby_strtod(const char *, char **);
75 #undef strtod
76 #define strtod(s,e) ruby_strtod((s),(e))
77
78 #if defined _MSC_VER && _MSC_VER >= 1300
79 #pragma warning(push)
80 #pragma warning(disable:4723)
81 #endif
82 #if defined _MSC_VER && _MSC_VER >= 1300
83 #pragma warning(pop)
84 #endif
85
86 void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
87
88 #if defined __GNUC__ && __GNUC__ >= 4
89 #pragma GCC visibility pop
90 #endif
91
92 #if defined(__cplusplus)
93 #if 0
94 { /* satisfy cc-mode */
95 #endif
96 } /* extern "C" { */
97 #endif
98
99 #endif /* RUBY_UTIL_H */
100