Skip to content

Commit

Permalink
* configure.in (FILE_READPTR): new. for IO#gets improvement.
Browse files Browse the repository at this point in the history
* io.c (READ_DATA_PENDING_PTR): ditto.

* io.c (remain_size): separated from read_all().

* io.c (read_all): argument chagend.

* io.c (appendline): new.  get a line and append to string.

* io.c (swallow): new.  swallow continuous line delimiters.

* io.c (rb_io_getline_fast): add delimiter argument.

* io.c (rb_io_getline): performance improvement.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Mar 25, 2002
1 parent 45ca4d6 commit dfaf41d
Show file tree
Hide file tree
Showing 3 changed files with 239 additions and 161 deletions.
18 changes: 18 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
Mon Mar 25 23:39:25 2002 Nobuyoshi Nakada <[email protected]>

* configure.in (FILE_READPTR): new. for IO#gets improvement.

* io.c (READ_DATA_PENDING_PTR): ditto.

* io.c (remain_size): separated from read_all().

* io.c (read_all): argument chagend.

* io.c (appendline): new. get a line and append to string.

* io.c (swallow): new. swallow continuous line delimiters.

* io.c (rb_io_getline_fast): add delimiter argument.

* io.c (rb_io_getline): performance improvement.

Mon Mar 25 19:30:25 2002 WATANABE Hirofumi <[email protected]>

* ext/extmk.rb.in (arg_config): get rid of single quotes
Expand Down
78 changes: 56 additions & 22 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -453,36 +453,70 @@ else
AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y))
fi

AC_MSG_CHECKING(count field in FILE structures)
AC_MSG_CHECKING(read count field in FILE structures)
AC_CACHE_VAL(rb_cv_fcnt,
[AC_TRY_COMPILE([#include <stdio.h>],
[FILE *f = stdin; f->_cnt = 0;], rb_cv_fcnt="_cnt", )
if test "$rb_cv_fcnt" = ""; then
AC_TRY_COMPILE([#include <stdio.h>],
[FILE *f = stdin; f->__cnt = 0;], rb_cv_fcnt="__cnt", )
fi
if test "$rb_cv_fcnt" = ""; then
AC_TRY_COMPILE([#include <stdio.h>],
[FILE *f = stdin; f->_r = 0;], rb_cv_fcnt="_r", )
fi
if test "$rb_cv_fcnt" = ""; then
AC_TRY_COMPILE([#include <stdio.h>],
[FILE *f = stdin; f->readCount = 0;],
rb_cv_fcnt="readCount", )
fi
dnl for emx0.9c
if test "$rb_cv_fcnt" = ""; then
AC_TRY_COMPILE([#include <stdio.h>],
[FILE *f = stdin; f->_rcount = 0;],
rb_cv_fcnt="_rcount", rb_cv_fcnt="not found")
fi])
[for fcnt in dnl
_cnt dnl
__cnt dnl
_r dnl
readCount dnl
_rcount dnl for emx0.9c
; do
AC_TRY_COMPILE([#include <stdio.h>
],
[FILE *f = stdin; f->$fcnt = 0;],
rb_cv_fcnt="$fcnt"; break,
rb_cv_fcnt="not found")
done])
if test "$rb_cv_fcnt" = "not found"; then
AC_MSG_RESULT([not found(OK if using GNU libc)])
else
AC_MSG_RESULT($rb_cv_fcnt)
AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)
fi

AC_MSG_CHECKING(read buffer ptr field in FILE structures)
AC_CACHE_VAL(rb_cv_frptr,
[for frptr in dnl
_IO_read_ptr dnl
_ptr dnl
__ptr dnl
bufpos dnl
; do
AC_TRY_COMPILE([#include <stdio.h>
],
[FILE *f = stdin; char buf[256]; f->$frptr = buf;],
rb_cv_frptr="$frptr"; break,
rb_cv_frptr="not found")
done])
if test "$rb_cv_frptr" = "not found"; then
AC_MSG_RESULT([not found])
else
AC_MSG_RESULT($rb_cv_frptr)
AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)

if test "$rb_cv_fcnt" = "not found"; then
AC_MSG_CHECKING(read buffer end field in FILE structures)
AC_CACHE_VAL(rb_cv_frend,
[for frend in dnl
_IO_read_end dnl
bufend dnl
; do
AC_TRY_COMPILE([#include <stdio.h>
],
[FILE *f = stdin; char buf[256]; f->$frend = buf;],
rb_cv_frend="$frend"; break,
rb_cv_frend="not found")
done])
if test "$rb_cv_frend" = "not found"; then
AC_MSG_RESULT([not found])
else
AC_MSG_RESULT($rb_cv_frend)
AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
fi
fi
fi

dnl default value for $KANJI
DEFAULT_KCODE="KCODE_NONE"

Expand Down
Loading

0 comments on commit dfaf41d

Please sign in to comment.