Permalink
Browse files

start cleaning up the public header files

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5134 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent f30a3a4 commit 7a4fd1b4ca9a362b4af10cbe2f83a2c22b8f5bbf @lrz lrz committed Jan 8, 2011
Showing with 211 additions and 1,010 deletions.
  1. +2 −2 dir.c
  2. +3 −0 dln.c
  3. +0 −2 env.c
  4. +0 −8 ext/socket/socket.c
  5. +2 −2 file.c
  6. +15 −162 include/ruby/defines.h
  7. +9 −65 include/ruby/encoding.h
  8. +42 −68 include/ruby/intern.h
  9. +8 −28 include/ruby/io.h
  10. +15 −37 include/ruby/macruby.h
  11. +1 −168 include/ruby/missing.h
  12. +1 −18 include/ruby/mvm.h
  13. +9 −18 include/ruby/node.h
  14. +10 −0 include/ruby/objc.h
  15. +9 −2 include/ruby/re.h
  16. +51 −181 include/ruby/ruby.h
  17. +10 −60 include/ruby/signal.h
  18. +1 −10 include/ruby/st.h
  19. +10 −56 include/ruby/util.h
  20. +4 −34 marshal.c
  21. +2 −2 object.c
  22. +3 −31 parse.y
  23. +1 −3 process.c
  24. +1 −19 signal.c
  25. +0 −4 time.c
  26. +2 −30 variable.c
View
4 dir.c
@@ -746,7 +746,7 @@ dir_s_chdir(VALUE obj, SEL sel, int argc, VALUE *argv)
if (rb_block_given_p()) {
struct chdir_data args;
- VALUE cwd = my_getcwd();
+ VALUE cwd = ruby_getcwd();
args.old_path = cwd;
GC_RETAIN(args.old_path);
@@ -774,7 +774,7 @@ static VALUE
dir_s_getwd(VALUE dir, SEL sel)
{
rb_secure(4);
- return my_getcwd();
+ return ruby_getcwd();
}
static void
View
3 dln.c
@@ -25,6 +25,9 @@
#define FUNCNAME_PATTERN "Init_%s"
+// In file.c
+int eaccess(const char *path, int mode);
+
static int
init_funcname_len(char **buf, const char *file)
{
View
2 env.c
@@ -150,8 +150,6 @@ rb_env_path_tainted(void)
void
ruby_setenv(const char *name, const char *value)
{
-#undef setenv
-#undef unsetenv
if (value != NULL) {
setenv(name, value, 1);
}
View
@@ -522,15 +522,11 @@ bsock_send(VALUE sock, SEL sel, int argc, VALUE *argv)
rb_thread_fd_writable(fd);
retry:
if (!NIL_P(to)) {
- TRAP_BEG;
n = sendto(fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg), NUM2INT(flags),
(struct sockaddr*)RSTRING_PTR(to), RSTRING_LEN(to));
- TRAP_END;
}
else {
- TRAP_BEG;
n = send(fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg), NUM2INT(flags));
- TRAP_END;
}
if (n < 0) {
if (rb_io_wait_writable(fd)) {
@@ -611,10 +607,8 @@ s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
if (rb_bstr_length(str) != buflen) {
rb_raise(rb_eRuntimeError, "buffer string modified");
}
- TRAP_BEG;
slen = recvfrom(fd, rb_bstr_bytes(str), buflen, flags,
(struct sockaddr *)buf, &alen);
- TRAP_END;
if (slen < 0) {
if (rb_io_wait_readable(fd)) {
@@ -1477,9 +1471,7 @@ s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
#if defined(_nec_ews)
fd2 = accept(fd, sockaddr, len);
#else
- TRAP_BEG;
fd2 = accept(fd, sockaddr, len);
- TRAP_END;
#endif
if (fd2 < 0) {
switch (errno) {
View
4 file.c
@@ -2537,7 +2537,7 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
}
}
- curdir = my_getcwd();
+ curdir = ruby_getcwd();
ptr = (char *)RSTRING_PTR(curdir);
curdir_names = skiproot(ptr);
resolved = rb_str_new(ptr, curdir_names - ptr);
@@ -3953,7 +3953,7 @@ path_check_0(VALUE path, int execpath)
char *p = 0, *s;
if (!is_absolute_path(p0)) {
- VALUE newpath = my_getcwd();
+ VALUE newpath = ruby_getcwd();
rb_str_cat2(newpath, "/");
rb_str_cat2(newpath, p0);
path = newpath;
View
@@ -1,20 +1,15 @@
-/************************************************
-
- defines.h -
-
- $Author: nobu $
- created at: Wed May 18 00:21:44 JST 1994
-
-************************************************/
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ */
#ifndef RUBY_DEFINES_H
#define RUBY_DEFINES_H 1
#if defined(__cplusplus)
extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
#endif
#define RUBY
@@ -108,17 +103,6 @@ void xfree(void*);
# define BDIGIT_DBL_SIGNED long
#endif
-#ifdef __CYGWIN__
-#undef _WIN32
-#endif
-
-#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__)
-#define DOSISH 1
-#ifndef _WIN32_WCE
-# define DOSISH_DRIVE_LETTER
-#endif
-#endif
-
#if defined(__NeXT__) || defined(__APPLE__)
/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
result in a different endian. Instead trust __BIG_ENDIAN__ and
@@ -129,175 +113,44 @@ void xfree(void*);
#endif
#endif
-#ifdef __NeXT__
-/* NextStep, OpenStep, Rhapsody */
-#ifndef S_IRUSR
-#define S_IRUSR 0000400 /* read permission, owner */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 0000040 /* read permission, group */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0000004 /* read permission, other */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 0000200 /* write permission, owner */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0000020 /* write permission, group */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0000002 /* write permission, other */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 0000100 /* execute/search permission, owner */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0000010 /* execute/search permission, group */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0000001 /* execute/search permission, other */
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 0000700 /* read, write, execute permissions, owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 0000070 /* read, write, execute permissions, group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 0000007 /* read, write, execute permissions, other */
-#endif
-#ifndef S_ISBLK
-#define S_ISBLK(mode) (((mode) & (0170000)) == (0060000))
-#endif
-#ifndef S_ISCHR
-#define S_ISCHR(mode) (((mode) & (0170000)) == (0020000))
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode) & (0170000)) == (0040000))
-#endif
-#ifndef S_ISFIFO
-#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000))
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode) (((mode) & (0170000)) == (0100000))
-#endif
-#ifndef __APPLE__
-/* NextStep, OpenStep (but not Rhapsody) */
-#ifndef GETPGRP_VOID
-#define GETPGRP_VOID 1
-#endif
-#ifndef WNOHANG
-#define WNOHANG 01
-#endif
-#ifndef WUNTRACED
-#define WUNTRACED 02
-#endif
-#ifndef X_OK
-#define X_OK 1
-#endif
-#endif /* __APPLE__ */
-#endif /* NeXT */
-
-#ifdef _WIN32
-#include "ruby/win32.h"
-#endif
-
-#if defined(__VMS)
-#include "vms/vms.h"
-#endif
-
-#if defined(__BEOS__)
-#include <net/socket.h> /* intern.h needs fd_set definition */
-#endif
-
#ifdef RUBY_EXPORT
-#undef RUBY_EXTERN
+# undef RUBY_EXTERN
#endif
#ifndef RUBY_EXTERN
-#define RUBY_EXTERN extern
+# define RUBY_EXTERN extern
#endif
#ifndef EXTERN
-#define EXTERN RUBY_EXTERN /* deprecated */
+# define EXTERN RUBY_EXTERN /* deprecated */
#endif
#ifndef RUBY_MBCHAR_MAXSIZE
#define RUBY_MBCHAR_MAXSIZE INT_MAX
/* MB_CUR_MAX will not work well in C locale */
#endif
-#if defined(sparc) || defined(__sparc__)
-static inline void
-flush_register_windows(void)
-{
- asm
-#ifdef __GNUC__
- volatile
-#endif
-# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
- ("flushw")
-# else
- ("ta 0x03")
-# endif /* trap always to flush register windows if we are on a Sparc system */
- ;
-}
-# define FLUSH_REGISTER_WINDOWS flush_register_windows()
-#elif defined(__ia64)
-void *rb_ia64_bsp(void);
-void rb_ia64_flushrs(void);
-# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
-#else
-# define FLUSH_REGISTER_WINDOWS ((void)0)
-#endif
-
-#if defined(DOSISH)
-#define PATH_SEP ";"
-#elif defined(riscos)
-#define PATH_SEP ","
-#else
#define PATH_SEP ":"
-#endif
#define PATH_SEP_CHAR PATH_SEP[0]
-
-#if defined(__human68k__)
-#define PATH_ENV "path"
-#else
#define PATH_ENV "PATH"
-#endif
-#if defined(DOSISH) && !defined(__human68k__) && !defined(__EMX__)
-#define ENV_IGNORECASE
-#endif
-
-#ifndef CASEFOLD_FILESYSTEM
-# if defined DOSISH || defined __VMS
-# define CASEFOLD_FILESYSTEM 1
-# else
-# define CASEFOLD_FILESYSTEM 0
-# endif
-#endif
+#define CASEFOLD_FILESYSTEM 0
#ifndef DLEXT_MAXLEN
-#define DLEXT_MAXLEN 4
+# define DLEXT_MAXLEN 4
#endif
#ifndef RUBY_PLATFORM
-#define RUBY_PLATFORM "unknown-unknown"
+# define RUBY_PLATFORM "unknown-unknown"
#endif
-#define WITH_OBJC 1 /* TODO: this should be set by configure */
+#define WITH_OBJC 1
+#define __MACRUBY__ 1
#define force_inline __attribute__((always_inline))
-#define __MACRUBY__ 1
-
#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
+} // extern "C" {
#endif
#endif /* RUBY_DEFINES_H */
Oops, something went wrong.

0 comments on commit 7a4fd1b

Please sign in to comment.