00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef RUBY_UTIL_H
00013 #define RUBY_UTIL_H 1
00014
00015 #if defined(__cplusplus)
00016 extern "C" {
00017 #if 0
00018 }
00019 #endif
00020 #endif
00021
00022 #include "ruby/defines.h"
00023 #ifdef RUBY_EXTCONF_H
00024 #include RUBY_EXTCONF_H
00025 #endif
00026
00027 #ifndef _
00028 #ifdef __cplusplus
00029 # ifndef HAVE_PROTOTYPES
00030 # define HAVE_PROTOTYPES 1
00031 # endif
00032 # ifndef HAVE_STDARG_PROTOTYPES
00033 # define HAVE_STDARG_PROTOTYPES 1
00034 # endif
00035 #endif
00036 #ifdef HAVE_PROTOTYPES
00037 # define _(args) args
00038 #else
00039 # define _(args) ()
00040 #endif
00041 #ifdef HAVE_STDARG_PROTOTYPES
00042 # define __(args) args
00043 #else
00044 # define __(args) ()
00045 #endif
00046 #endif
00047
00048 #if defined __GNUC__ && __GNUC__ >= 4
00049 #pragma GCC visibility push(default)
00050 #endif
00051
00052 #define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
00053 unsigned long ruby_scan_oct(const char *, size_t, size_t *);
00054 #define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))
00055 unsigned long ruby_scan_hex(const char *, size_t, size_t *);
00056
00057 #if defined(__CYGWIN32__) || defined(_WIN32)
00058 void ruby_add_suffix(VALUE str, const char *suffix);
00059 #endif
00060
00061 void ruby_qsort(void *, const size_t, const size_t,
00062 int (*)(const void *, const void *, void *), void *);
00063
00064 void ruby_setenv(const char *, const char *);
00065 void ruby_unsetenv(const char *);
00066 #undef setenv
00067 #undef unsetenv
00068 #define setenv(name,val) ruby_setenv((name),(val))
00069 #define unsetenv(name,val) ruby_unsetenv(name);
00070
00071 char *ruby_strdup(const char *);
00072 #undef strdup
00073 #define strdup(s) ruby_strdup(s)
00074
00075 char *ruby_getcwd(void);
00076 #define my_getcwd() ruby_getcwd()
00077
00078 double ruby_strtod(const char *, char **);
00079 #undef strtod
00080 #define strtod(s,e) ruby_strtod((s),(e))
00081
00082 #if defined _MSC_VER && _MSC_VER >= 1300
00083 #pragma warning(push)
00084 #pragma warning(disable:4723)
00085 #endif
00086 #if defined _MSC_VER && _MSC_VER >= 1300
00087 #pragma warning(pop)
00088 #endif
00089
00090 void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
00091
00092 #if defined __GNUC__ && __GNUC__ >= 4
00093 #pragma GCC visibility pop
00094 #endif
00095
00096 #if defined(__cplusplus)
00097 #if 0
00098 {
00099 #endif
00100 }
00101 #endif
00102
00103 #endif
00104