file-const.patch

Motohiro KOSAKI, 11/19/2012 04:59 PM

Download (1.43 KB)

View differences:

io.c (作業コピー)
136 136
VALUE rb_output_rs;
137 137
VALUE rb_default_rs;
138 138

  
139
extern VALUE rb_mFConst;
140

  
139 141
static VALUE argf;
140 142

  
141 143
static ID id_write, id_read, id_getc, id_flush, id_readpartial, id_set_encoding;
......
11632 11634
    rb_define_method(rb_cFile, "initialize",  rb_file_initialize, -1);
11633 11635

  
11634 11636
    /* open for reading only */
11637
    rb_define_const(rb_mFConst, "RDONLY", INT2FIX(O_RDONLY));
11638
#if 0
11635 11639
    rb_file_const("RDONLY", INT2FIX(O_RDONLY));
11640
#endif
11636 11641
    /* open for writing only */
11637 11642
    rb_file_const("WRONLY", INT2FIX(O_WRONLY));
11638 11643
    /* open for reading and writing */
file.c (作業コピー)
5513 5513

  
5514 5514
    rb_define_method(rb_cFile, "flock", rb_file_flock, 1);
5515 5515

  
5516
    /*
5517
     * Document-module: File::Constants
5518
     *
5519
     * foo bar.
5520
     */
5516 5521
    rb_mFConst = rb_define_module_under(rb_cFile, "Constants");
5517 5522
    rb_include_module(rb_cIO, rb_mFConst);
5523

  
5524
    /* shared lock */
5525
    rb_define_const(rb_mFConst, "LOCK_SH", INT2FIX(LOCK_SH));
5526
#if 0
5518 5527
    rb_file_const("LOCK_SH", INT2FIX(LOCK_SH));
5528
#endif
5529
    /* exclusive lock */
5519 5530
    rb_file_const("LOCK_EX", INT2FIX(LOCK_EX));
5520 5531
    rb_file_const("LOCK_UN", INT2FIX(LOCK_UN));
5521 5532
    rb_file_const("LOCK_NB", INT2FIX(LOCK_NB));