Project

General

Profile

Bug #5530 » file-const.patch

kosaki (Motohiro KOSAKI), 11/19/2012 04:59 PM

View differences:

io.c (作業コピー)
VALUE rb_output_rs;
VALUE rb_default_rs;
extern VALUE rb_mFConst;
static VALUE argf;
static ID id_write, id_read, id_getc, id_flush, id_readpartial, id_set_encoding;
......
rb_define_method(rb_cFile, "initialize", rb_file_initialize, -1);
/* open for reading only */
rb_define_const(rb_mFConst, "RDONLY", INT2FIX(O_RDONLY));
#if 0
rb_file_const("RDONLY", INT2FIX(O_RDONLY));
#endif
/* open for writing only */
rb_file_const("WRONLY", INT2FIX(O_WRONLY));
/* open for reading and writing */
file.c (作業コピー)
rb_define_method(rb_cFile, "flock", rb_file_flock, 1);
/*
* Document-module: File::Constants
*
* foo bar.
*/
rb_mFConst = rb_define_module_under(rb_cFile, "Constants");
rb_include_module(rb_cIO, rb_mFConst);
/* shared lock */
rb_define_const(rb_mFConst, "LOCK_SH", INT2FIX(LOCK_SH));
#if 0
rb_file_const("LOCK_SH", INT2FIX(LOCK_SH));
#endif
/* exclusive lock */
rb_file_const("LOCK_EX", INT2FIX(LOCK_EX));
rb_file_const("LOCK_UN", INT2FIX(LOCK_UN));
rb_file_const("LOCK_NB", INT2FIX(LOCK_NB));
(1-1/2)