mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (encdb_{replicate,alias,dummy,declare}): define only if
NO_ENCDB_H is not defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
19d9380b3d
commit
f3ed7fa233
2 changed files with 18 additions and 3 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Jan 29 18:05:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* encoding.c (encdb_{replicate,alias,dummy,declare}): define only if
|
||||||
|
NO_ENCDB_H is not defined.
|
||||||
|
|
||||||
Tue Jan 29 17:54:11 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
Tue Jan 29 17:54:11 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* enc/gbk.c (EncLen_gbk): too short. [ruby-dev:33497]
|
* enc/gbk.c (EncLen_gbk): too short. [ruby-dev:33497]
|
||||||
|
|
|
||||||
16
encoding.c
16
encoding.c
|
|
@ -34,17 +34,19 @@ static struct {
|
||||||
|
|
||||||
void rb_enc_init(void);
|
void rb_enc_init(void);
|
||||||
|
|
||||||
|
#ifndef NO_ENCDB_H
|
||||||
#undef ENC_REPLICATE
|
#undef ENC_REPLICATE
|
||||||
#undef ENC_ALIAS
|
#undef ENC_ALIAS
|
||||||
#undef ENC_DUMMY
|
#undef ENC_DUMMY
|
||||||
static int encdb_replicate(const char *alias, const char *orig);
|
static int encdb_replicate(const char *alias, const char *orig);
|
||||||
static int encdb_alias(const char *alias, const char *orig);
|
static int encdb_alias(const char *alias, const char *orig);
|
||||||
static int encdb_dummy(const char *name);
|
static int encdb_dummy(const char *name);
|
||||||
static void enc_declare(const char *name);
|
static void encdb_declare(const char *name);
|
||||||
#define ENC_REPLICATE(name, orig) encdb_replicate(name, orig)
|
#define ENC_REPLICATE(name, orig) encdb_replicate(name, orig)
|
||||||
#define ENC_ALIAS(name, orig) encdb_alias(name, orig)
|
#define ENC_ALIAS(name, orig) encdb_alias(name, orig)
|
||||||
#define ENC_DUMMY(name) encdb_dummy(name)
|
#define ENC_DUMMY(name) encdb_dummy(name)
|
||||||
#define ENC_DEFINE(name) enc_declare(name)
|
#define ENC_DEFINE(name) encdb_declare(name)
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
enc_init_db(void)
|
enc_init_db(void)
|
||||||
|
|
@ -249,8 +251,9 @@ rb_enc_register(const char *name, rb_encoding *encoding)
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_ENCDB_H
|
||||||
static void
|
static void
|
||||||
enc_declare(const char *name)
|
encdb_declare(const char *name)
|
||||||
{
|
{
|
||||||
int idx = rb_enc_registered(name);
|
int idx = rb_enc_registered(name);
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
|
|
@ -258,6 +261,7 @@ enc_declare(const char *name)
|
||||||
}
|
}
|
||||||
set_encoding_const(name, rb_enc_from_index(idx));
|
set_encoding_const(name, rb_enc_from_index(idx));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
enc_check_duplication(const char *name)
|
enc_check_duplication(const char *name)
|
||||||
|
|
@ -289,6 +293,7 @@ rb_enc_replicate(const char *name, rb_encoding *encoding)
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_ENCDB_H
|
||||||
static int
|
static int
|
||||||
enc_replicate(int idx, const char *name, rb_encoding *origenc)
|
enc_replicate(int idx, const char *name, rb_encoding *origenc)
|
||||||
{
|
{
|
||||||
|
|
@ -316,6 +321,7 @@ encdb_replicate(const char *name, const char *orig)
|
||||||
}
|
}
|
||||||
return enc_replicate(idx, name, rb_enc_from_index(origidx));
|
return enc_replicate(idx, name, rb_enc_from_index(origidx));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
rb_define_dummy_encoding(const char *name)
|
rb_define_dummy_encoding(const char *name)
|
||||||
|
|
@ -327,6 +333,7 @@ rb_define_dummy_encoding(const char *name)
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_ENCDB_H
|
||||||
static int
|
static int
|
||||||
encdb_dummy(const char *name)
|
encdb_dummy(const char *name)
|
||||||
{
|
{
|
||||||
|
|
@ -337,6 +344,7 @@ encdb_dummy(const char *name)
|
||||||
ENC_SET_DUMMY(enc);
|
ENC_SET_DUMMY(enc);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
rb_enc_dummy_p(rb_encoding *enc)
|
rb_enc_dummy_p(rb_encoding *enc)
|
||||||
|
|
@ -388,6 +396,7 @@ rb_enc_alias(const char *alias, const char *orig)
|
||||||
return enc_alias(alias, idx);
|
return enc_alias(alias, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_ENCDB_H
|
||||||
static int
|
static int
|
||||||
encdb_alias(const char *alias, const char *orig)
|
encdb_alias(const char *alias, const char *orig)
|
||||||
{
|
{
|
||||||
|
|
@ -398,6 +407,7 @@ encdb_alias(const char *alias, const char *orig)
|
||||||
}
|
}
|
||||||
return enc_alias(alias, idx);
|
return enc_alias(alias, idx);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ENCINDEX_ASCII,
|
ENCINDEX_ASCII,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue