extattr 0.2 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,105 +1,212 @@
1
- #vim: set fileencoding:utf-8
2
-
3
- AUTHOR = "dearblue"
4
- EMAIL = "dearblue@users.sourceforge.jp"
5
- WEBSITE = "http://sourceforge.jp/projects/rutsubo/"
6
- LICENSE = "2-clause BSD License"
7
- PACKAGE = "extattr"
8
- VERSION = "0.2"
9
- PLATFORM_NATIVE = Gem::Platform.local.to_s
10
- GEMFILE = "#{PACKAGE}-#{VERSION}.gem"
11
- GEMFILE_NATIVE = "#{PACKAGE}-#{VERSION}-#{PLATFORM_NATIVE}.gem"
12
- GEMSPEC = "#{PACKAGE}.gemspec"
13
- GEMSPEC_NATIVE = "#{PACKAGE}-#{PLATFORM_NATIVE}.gemspec"
14
- SUMMARY = "extended attribute operation library for ruby"
15
- DESCRIPTION = <<EOS
16
- extattr is extended file attribute operation library for ruby.
17
- Supported for FreeBSD (extattr), GNU/Linux (xattr) and Microsoft Windows (NTFS ADS + Extended Attributes).
18
- EOS
19
-
20
- RUBY19 = ENV["RUBY19"]
21
- RUBY20 = ENV["RUBY20"]
22
- RUBY21 = ENV["RUBY21"]
23
- RUBYSET = [RUBY19, RUBY20, RUBY21].compact
24
-
25
- #RUBY_VERSIONS = [RUBY20].map { |ruby| [`#{ruby} -e "puts RUBY_VERSION"`.slice(/\d+\.\d+/), ruby] }
26
- RUBY_VERSIONS = RUBYSET.map { |ruby| [`#{ruby} -e "puts RbConfig::CONFIG['ruby_version']"`.chomp, ruby] }
27
-
28
- BINFILES = FileList["bin/*"]
29
- EXTFILES = FileList["ext/{*.h,*.c,*.cc}"]
30
- LIBFILES = FileList["lib/**/*.rb"]
31
- SOFILES_SET = RUBY_VERSIONS.map { |(ver, ruby)| ["lib/#{ver}/#{PACKAGE}.so", ruby] }
32
- SOFILES = SOFILES_SET.map { |(lib, ruby)| lib }
33
- EXTCONF = FileList["ext/extconf.rb"]
34
-
35
- SPECSTUB = Gem::Specification.new do |s|
36
- s.name = PACKAGE
37
- s.version = VERSION
38
- s.summary = SUMMARY
39
- s.description = DESCRIPTION
40
- s.homepage = WEBSITE
41
- s.license = LICENSE
42
- s.author = AUTHOR
43
- s.email = EMAIL
44
- s.executables = BINFILES.map { |n| File.basename n }
45
- s.files = %w(LICENSE.md README.md Rakefile) + FileList["spec/*.rb"] + BINFILES + EXTCONF + EXTFILES + LIBFILES
46
- s.rdoc_options = %w(--charset UTF-8 --main README.md)
47
- #s.rdoc_options = %w(--charset UTF-8 --locale ja --main README.md)
48
- s.has_rdoc = false
49
- s.required_ruby_version = ">= 1.9.3"
50
- s.add_development_dependency "rspec", "~> 2.14"
51
- s.add_development_dependency "rake", "~> 10.0"
1
+
2
+ require "pathname"
3
+ require "rake/clean"
4
+
5
+ docnames = "{README,LICENSE,CHANGELOG,Changelog,HISTORY}"
6
+ doctypes = "{,.txt,.rd,.rdoc,.md,.markdown}"
7
+ cexttypes = "{c,C,cc,cxx,cpp,h,H,hh}"
8
+
9
+ DOC = FileList["#{docnames}{,.ja}#{doctypes}"] +
10
+ FileList["{contrib,ext}/**/#{docnames}{,.ja}#{doctypes}"] +
11
+ FileList["ext/**/*.#{cexttypes}"]
12
+ EXT = FileList["ext/**/*"]
13
+ BIN = FileList["bin/*"]
14
+ LIB = FileList["lib/**/*.rb"]
15
+ SPEC = FileList["spec/**/*"]
16
+ TEST = FileList["test/**/*"]
17
+ EXAMPLE = FileList["examples/**/*"]
18
+ GEMSTUB_SRC = "gemstub.rb"
19
+ RAKEFILE = [File.basename(__FILE__), GEMSTUB_SRC]
20
+ EXTRA = []
21
+ EXTCONF = FileList["ext/**/extconf.rb"]
22
+ EXTCONF.reject! { |n| !File.file?(n) }
23
+ EXTMAP = {}
24
+
25
+ load GEMSTUB_SRC
26
+
27
+ EXTMAP.dup.each_pair do |dir, name|
28
+ EXTMAP[Pathname.new(dir).cleanpath.to_s] = Pathname.new(name).cleanpath.to_s
52
29
  end
53
30
 
31
+ GEMSTUB.extensions += EXTCONF
32
+ GEMSTUB.executables += FileList["bin/*"].map { |n| File.basename n }
33
+ GEMSTUB.executables.sort!
54
34
 
55
- task :default => :gem
56
- task :gem => [GEMFILE_NATIVE, GEMFILE]
57
- task :gemspec => GEMSPEC
58
- task :gemspec_native => GEMSPEC_NATIVE
59
- task :gemfile => GEMFILE
60
- task :gemfile_native => GEMFILE_NATIVE
35
+ PACKAGENAME = "#{GEMSTUB.name}-#{GEMSTUB.version}"
36
+ GEMFILE = "#{PACKAGENAME}.gem"
37
+ GEMSPEC = "#{PACKAGENAME}.gemspec"
61
38
 
62
- task :rdoc do
63
- sh "yardoc --charset UTF-8 --locale ja --main README.md README.md LICENSE.md #{(EXTFILES + LIBFILES).join(" ")}"
39
+ GEMSTUB.files += DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + RAKEFILE + EXTRA
40
+ GEMSTUB.files.sort!
41
+ if GEMSTUB.rdoc_options.nil? || GEMSTUB.rdoc_options.empty?
42
+ readme = %W(.md .markdown .rd .rdoc .txt #{""}).map { |ext| "README#{ext}" }.find { |m| DOC.find { |n| n == m } }
43
+ GEMSTUB.rdoc_options = %w(--charset UTF-8) + (readme ? %W(-m #{readme}) : [])
44
+ end
45
+ GEMSTUB.extra_rdoc_files += DOC + LIB + EXT.reject { |n| n.include?("/externals/") || !%w(.h .hh .c .cc .cpp .cxx).include?(File.extname(n)) }
46
+ GEMSTUB.extra_rdoc_files.sort!
47
+
48
+ GEMSTUB_TRYOUT = GEMSTUB.dup
49
+ GEMSTUB_TRYOUT.version = "#{GEMSTUB.version}#{Time.now.strftime(".TRYOUT.%Y%m%d.%H%M%S")}"
50
+ PACKAGENAME_TRYOUT = "#{GEMSTUB.name}-#{GEMSTUB_TRYOUT.version}"
51
+ GEMFILE_TRYOUT = "#{PACKAGENAME_TRYOUT}.gem"
52
+ GEMSPEC_TRYOUT = "#{PACKAGENAME_TRYOUT}.gemspec"
53
+
54
+ CLEAN << GEMSPEC << GEMSPEC_TRYOUT
55
+ CLOBBER << GEMFILE
56
+
57
+ task :default => :tryout do
58
+ $stderr.puts <<-EOS
59
+ #{__FILE__}:#{__LINE__}:
60
+ \ttype ``rake release'' to build release package.
61
+ EOS
64
62
  end
65
63
 
64
+ desc "build tryout package"
65
+ task :tryout
66
+
67
+ desc "build release package"
68
+ task :release => :all
69
+
70
+ unless EXTCONF.empty?
71
+ RUBYSET ||= (ENV["RUBYSET"] || "").split(",")
72
+
73
+ if RUBYSET.nil? || RUBYSET.empty?
74
+ $stderr.puts <<-EOS
75
+ #{__FILE__}:
76
+ |
77
+ | If you want binary gem package, launch rake with ``RUBYSET`` enviroment
78
+ | variable for set ruby interpreters by comma separated.
79
+ |
80
+ | e.g.) $ rake RUBYSET=ruby
81
+ | or) $ rake RUBYSET=ruby21,ruby22,ruby23
82
+ |
83
+ EOS
84
+ else
85
+ platforms = RUBYSET.map { |ruby| `#{ruby} --disable-gems -e "puts RUBY_PLATFORM"`.chomp }
86
+ platforms1 = platforms.uniq
87
+ unless platforms1.size == 1 && !platforms1[0].empty?
88
+ abort <<-EOS
89
+ #{__FILE__}:#{__LINE__}: different platforms:
90
+ #{RUBYSET.zip(platforms).map { |ruby, platform| "%24s => %s" % [ruby, platform] }.join("\n")}
91
+ ABORTED.
92
+ EOS
93
+ end
94
+ PLATFORM = platforms1[0]
66
95
 
67
- file GEMFILE => [GEMSPEC] + BINFILES + EXTFILES + LIBFILES do
68
- sh "gem build #{GEMSPEC}"
96
+ RUBY_VERSIONS = RUBYSET.map do |ruby|
97
+ ver = `#{ruby} --disable-gems -e "puts RUBY_VERSION"`.slice(/\d+\.\d+/)
98
+ raise "failed ruby checking - ``#{ruby}''" unless $?.success?
99
+ [ver, ruby]
100
+ end
101
+
102
+ SOFILES_SET = RUBY_VERSIONS.map { |(ver, ruby)|
103
+ EXTCONF.map { |extconf|
104
+ extdir = Pathname.new(extconf).cleanpath.dirname.to_s
105
+ case
106
+ when soname = EXTMAP[extdir.sub(/^ext\//i, "")]
107
+ soname = soname.sub(/\.so$/i, "")
108
+ when extdir == "ext" || extdir == "."
109
+ soname = GEMSTUB.name
110
+ else
111
+ soname = File.basename(extdir)
112
+ end
113
+
114
+ [ruby, File.join("lib", "#{soname.sub(/(?<=\/)|^(?!.*\/)/, "#{ver}/")}.so"), extconf]
115
+ }
116
+ }.flatten(1)
117
+ SOFILES = SOFILES_SET.map { |(ruby, sopath, extconf)| sopath }
118
+
119
+ GEMSTUB_NATIVE = GEMSTUB.dup
120
+ GEMSTUB_NATIVE.files += SOFILES
121
+ GEMSTUB_NATIVE.platform = Gem::Platform.new(PLATFORM).to_s
122
+ GEMSTUB_NATIVE.extensions.clear
123
+ GEMFILE_NATIVE = "#{GEMSTUB_NATIVE.name}-#{GEMSTUB_NATIVE.version}-#{GEMSTUB_NATIVE.platform}.gem"
124
+ GEMSPEC_NATIVE = "#{GEMSTUB_NATIVE.name}-#{GEMSTUB_NATIVE.platform}.gemspec"
125
+
126
+ task :all => ["native-gem", GEMFILE]
127
+
128
+ desc "build binary gem package"
129
+ task "native-gem" => GEMFILE_NATIVE
130
+
131
+ desc "generate binary gemspec"
132
+ task "native-gemspec" => GEMSPEC_NATIVE
133
+
134
+ file GEMFILE_NATIVE => DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + SOFILES + RAKEFILE + [GEMSPEC_NATIVE] do
135
+ sh "gem build #{GEMSPEC_NATIVE}"
136
+ end
137
+
138
+ file GEMSPEC_NATIVE => RAKEFILE do
139
+ File.write(GEMSPEC_NATIVE, GEMSTUB_NATIVE.to_ruby, mode: "wb")
140
+ end
141
+
142
+ desc "build c-extension libraries"
143
+ task "sofiles" => SOFILES
144
+
145
+ SOFILES_SET.each do |(ruby, soname, extconf)|
146
+ sodir = File.dirname(soname)
147
+ makefile = File.join(sodir, "Makefile")
148
+
149
+ CLEAN << GEMSPEC_NATIVE << sodir
150
+ CLOBBER << GEMFILE_NATIVE
151
+
152
+ directory sodir
153
+
154
+ desc "generate Makefile for binary extension library"
155
+ file makefile => [sodir, extconf] do
156
+ rel_extconf = Pathname.new(extconf).relative_path_from(Pathname.new(sodir)).to_s
157
+ cd sodir do
158
+ sh *%W"#{ruby} #{rel_extconf} --ruby=#{ruby} #{ENV["EXTCONF"]}"
159
+ end
160
+ end
161
+
162
+ desc "build binary extension library"
163
+ file soname => [makefile] + EXT do
164
+ cd sodir do
165
+ sh "make"
166
+ end
167
+ end
168
+ end
169
+ end
69
170
  end
70
171
 
71
- file GEMFILE_NATIVE => [GEMSPEC_NATIVE] + BINFILES + EXTFILES + LIBFILES + SOFILES do
72
- sh "gem build #{GEMSPEC_NATIVE}"
172
+
173
+ task :all => GEMFILE
174
+ task :tryout => GEMFILE_TRYOUT
175
+
176
+ desc "generate local rdoc"
177
+ task :rdoc => DOC + LIB do
178
+ sh *(%w(rdoc) + GEMSTUB.rdoc_options + DOC + LIB)
73
179
  end
74
180
 
75
- file GEMSPEC => __FILE__ do
76
- s = SPECSTUB.dup
77
- s.extensions += EXTCONF
78
- File.write(GEMSPEC, s.to_ruby, mode: "wb")
181
+ desc "launch rspec"
182
+ task rspec: :all do
183
+ sh "rspec"
79
184
  end
80
185
 
81
- file GEMSPEC_NATIVE => __FILE__ do
82
- s = SPECSTUB.dup
83
- s.files += SOFILES
84
- s.platform = PLATFORM_NATIVE
85
- File.write(GEMSPEC_NATIVE, s.to_ruby, mode: "wb")
186
+ desc "build gem package"
187
+ task gem: GEMFILE
188
+
189
+ desc "generate gemspec"
190
+ task gemspec: GEMSPEC
191
+
192
+ desc "print package name"
193
+ task "package-name" do
194
+ puts PACKAGENAME
86
195
  end
87
196
 
88
- SOFILES_SET.each do |(soname, ruby)|
89
- sodir = File.dirname(soname)
90
- makefile = File.join(sodir, "Makefile")
197
+ file GEMFILE => DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + RAKEFILE + [GEMSPEC] do
198
+ sh "gem build #{GEMSPEC}"
199
+ end
91
200
 
92
- directory sodir
201
+ file GEMFILE_TRYOUT => DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + RAKEFILE + [GEMSPEC_TRYOUT] do
202
+ #file GEMFILE_TRYOUT do
203
+ sh "gem build #{GEMSPEC_TRYOUT}"
204
+ end
93
205
 
94
- file soname => [makefile] + EXTFILES do
95
- cd sodir do
96
- sh "make"
97
- end
98
- end
206
+ file GEMSPEC => RAKEFILE do
207
+ File.write(GEMSPEC, GEMSTUB.to_ruby, mode: "wb")
208
+ end
99
209
 
100
- file makefile => [sodir] + EXTCONF do
101
- cd sodir do
102
- sh "#{ruby} ../../ext/extconf.rb"
103
- end
104
- end
210
+ file GEMSPEC_TRYOUT => RAKEFILE do
211
+ File.write(GEMSPEC_TRYOUT, GEMSTUB_TRYOUT.to_ruby, mode: "wb")
105
212
  end
@@ -22,31 +22,31 @@ extattr_list_name(const char list[], size_t size, VALUE infection_source, void (
22
22
  }
23
23
 
24
24
  static int
25
- get_extattr_list_size(int (*extattr_list)(), intptr_t d, int namespace1)
25
+ get_extattr_list_size(ssize_t (*extattr_list)(), intptr_t d, VALUE filesrc, int namespace1)
26
26
  {
27
27
  int size = extattr_list(d, namespace1, NULL, 0);
28
- if (size < 0) { rb_sys_fail("extattr_list call error"); }
28
+ if (size < 0) { aux_sys_fail(filesrc, "extattr_list"); }
29
29
  return size;
30
30
  }
31
31
 
32
32
  static VALUE
33
- extattr_list_common(int (*extattr_list)(), intptr_t d, VALUE infection_source, int namespace1)
33
+ extattr_list_common(ssize_t (*extattr_list)(), intptr_t d, VALUE filesrc, int namespace1)
34
34
  {
35
- size_t size = get_extattr_list_size(extattr_list, d, namespace1);
35
+ size_t size = get_extattr_list_size(extattr_list, d, filesrc, namespace1);
36
36
  VALUE buf;
37
37
  char *ptr = ALLOCV(buf, size);
38
38
 
39
39
  ssize_t size1 = extattr_list(d, namespace1, ptr, size);
40
- if (size1 < 0) { rb_sys_fail("extattr_list call error"); }
40
+ if (size1 < 0) { aux_sys_fail(filesrc, "extattr_list"); }
41
41
 
42
42
  VALUE list = Qnil;
43
43
  if (rb_block_given_p()) {
44
- extattr_list_name(ptr, size1, infection_source,
44
+ extattr_list_name(ptr, size1, filesrc,
45
45
  (void (*)(void *, VALUE))rb_yield_values, (void *)(1));
46
46
  } else {
47
47
  list = rb_ary_new();
48
- OBJ_INFECT(list, infection_source);
49
- extattr_list_name(ptr, size1, infection_source,
48
+ OBJ_INFECT(list, filesrc);
49
+ extattr_list_name(ptr, size1, filesrc,
50
50
  (void (*)(void *, VALUE))rb_ary_push, (void *)list);
51
51
  }
52
52
  ALLOCV_END(buf);
@@ -74,9 +74,9 @@ file_s_extattr_list_link_main(VALUE path, int namespace1)
74
74
 
75
75
 
76
76
  static VALUE
77
- extattr_size_common(int (*extattr_get)(), intptr_t d, int namespace1, VALUE name)
77
+ extattr_size_common(ssize_t (*extattr_get)(), intptr_t d, int namespace1, VALUE name)
78
78
  {
79
- ssize_t size = extattr_get(d, namespace1, RSTRING_PTR(name), NULL, 0);
79
+ ssize_t size = extattr_get(d, namespace1, StringValueCStr(name), NULL, 0);
80
80
  if (size < 0) { rb_sys_fail("extattr_get call error"); }
81
81
  return SIZET2NUM(size);
82
82
  }
@@ -101,12 +101,12 @@ file_s_extattr_size_link_main(VALUE path, int namespace1, VALUE name)
101
101
 
102
102
 
103
103
  static VALUE
104
- extattr_get_common(int (*extattr_get)(), intptr_t d, VALUE path, int namespace1, VALUE name)
104
+ extattr_get_common(ssize_t (*extattr_get)(), intptr_t d, VALUE path, int namespace1, VALUE name)
105
105
  {
106
- ssize_t size = extattr_get(d, namespace1, RSTRING_PTR(name), NULL, 0);
106
+ ssize_t size = extattr_get(d, namespace1, StringValueCStr(name), NULL, 0);
107
107
  if (size < 0) { rb_sys_fail(StringValueCStr(path)); }
108
108
  VALUE buf = rb_str_buf_new(size);
109
- size = extattr_get(d, namespace1, RSTRING_PTR(name), RSTRING_PTR(buf), size);
109
+ size = extattr_get(d, namespace1, StringValueCStr(name), StringValueCStr(buf), size);
110
110
  if (size < 0) { rb_sys_fail(StringValueCStr(path)); }
111
111
  rb_str_set_len(buf, size);
112
112
  return buf;
@@ -132,9 +132,9 @@ file_s_extattr_get_link_main(VALUE path, int namespace1, VALUE name)
132
132
 
133
133
 
134
134
  static VALUE
135
- extattr_set_common(int (*extattr_set)(), intptr_t d, int namespace1, VALUE name, VALUE data)
135
+ extattr_set_common(ssize_t (*extattr_set)(), intptr_t d, int namespace1, VALUE name, VALUE data)
136
136
  {
137
- int status = extattr_set(d, namespace1, RSTRING_PTR(name), RSTRING_PTR(data), RSTRING_LEN(data));
137
+ int status = extattr_set(d, namespace1, StringValueCStr(name), StringValueCStr(data), RSTRING_LEN(data));
138
138
  if (status < 0) { rb_sys_fail("extattr_set call error"); }
139
139
  return Qnil;
140
140
  }
@@ -161,7 +161,7 @@ file_s_extattr_set_link_main(VALUE path, int namespace1, VALUE name, VALUE data)
161
161
  static VALUE
162
162
  extattr_delete_common(int (*extattr_delete)(), intptr_t d, int namespace1, VALUE name)
163
163
  {
164
- int status = extattr_delete(d, namespace1, RSTRING_PTR(name), NULL, 0);
164
+ int status = extattr_delete(d, namespace1, StringValueCStr(name), NULL, 0);
165
165
  if (status < 0) { rb_sys_fail("extattr_delete call error"); }
166
166
  return Qnil;
167
167
  }
@@ -186,7 +186,7 @@ file_s_extattr_delete_link_main(VALUE path, int namespace1, VALUE name)
186
186
 
187
187
 
188
188
  static void
189
- ext_init_implement(void)
189
+ extattr_init_implement(void)
190
190
  {
191
- rb_define_const(rb_cFile, "EXTATTR_IMPLEMANT", rb_str_freeze(rb_str_new_cstr("extattr")));
191
+ rb_define_const(mExtAttr, "IMPLEMENT", rb_str_freeze(rb_str_new_cstr("extattr")));
192
192
  }
@@ -19,8 +19,8 @@
19
19
  */
20
20
 
21
21
  enum {
22
- EXTATTR_NAMESPACE_USER = 0,
23
- EXTATTR_NAMESPACE_SYSTEM = 1,
22
+ EXTATTR_NAMESPACE_USER = 1,
23
+ EXTATTR_NAMESPACE_SYSTEM = 2,
24
24
 
25
25
  /*
26
26
  * ADS は普通のファイルのように扱えるから、extattr とみなして扱う場合は容量の制限を設けることにする。
@@ -91,7 +91,7 @@ wpath2str(const wchar_t path[], size_t size)
91
91
  }
92
92
 
93
93
  /*
94
- * ADS 名の先端のコロン『:』と、終端の『:$DATA』を除去して ruby の文字列を返す。
94
+ * ADS 名の先端のコロン『:』と、終端の『:$DATA』を除去して Ruby の文字列を返す。
95
95
  */
96
96
  static VALUE
97
97
  adsname2str(const wchar_t name[], size_t size)
@@ -710,7 +710,7 @@ file_s_extattr_delete_link_main(VALUE path, int namespace1, VALUE name)
710
710
 
711
711
 
712
712
  static void
713
- ext_init_implement(void)
713
+ extattr_init_implement(void)
714
714
  {
715
715
  ENCutf8p = rb_enc_find("UTF-8");
716
716
  ENCutf8 = rb_enc_from_encoding(ENCutf8p);
@@ -720,5 +720,5 @@ ext_init_implement(void)
720
720
  ENCutf16le = rb_enc_from_encoding(ENCutf16lep);
721
721
  rb_gc_register_address(&ENCutf16le);
722
722
 
723
- rb_define_const(rb_cFile, "EXTATTR_IMPLEMANT", rb_str_freeze(rb_str_new_cstr("windows")));
723
+ rb_define_const(mExtAttr, "IMPLEMENT", rb_str_freeze(rb_str_new_cstr("windows")));
724
724
  }
data/ext/extattr-xattr.h CHANGED
@@ -6,10 +6,10 @@
6
6
  #endif
7
7
 
8
8
  enum {
9
- EXTATTR_NAMESPACE_USER,
10
- EXTATTR_NAMESPACE_SYSTEM,
11
- EXTATTR_NAMESPACE_TRUSTED,
12
- EXTATTR_NAMESPACE_SECURITY,
9
+ EXTATTR_NAMESPACE_USER = 1,
10
+ EXTATTR_NAMESPACE_SYSTEM = 2,
11
+ EXTATTR_NAMESPACE_TRUSTED = 3,
12
+ EXTATTR_NAMESPACE_SECURITY = 4,
13
13
  };
14
14
 
15
15
 
@@ -217,7 +217,7 @@ file_s_extattr_delete_link_main(VALUE path, int namespace1, VALUE name)
217
217
 
218
218
 
219
219
  static void
220
- ext_init_implement(void)
220
+ extattr_init_implement(void)
221
221
  {
222
222
  NAMESPACE_USER_PREFIX = rb_str_new_cstr("user.");
223
223
  NAMESPACE_SYSTEM_PREFIX = rb_str_new_cstr("system.");
@@ -225,5 +225,5 @@ ext_init_implement(void)
225
225
  rb_gc_register_mark_object(NAMESPACE_USER_PREFIX);
226
226
  rb_gc_register_mark_object(NAMESPACE_SYSTEM_PREFIX);
227
227
 
228
- rb_define_const(rb_cFile, "EXTATTR_IMPLEMANT", rb_str_freeze(rb_str_new_cstr("xattr")));
228
+ rb_define_const(mExtAttr, "IMPLEMENT", rb_str_freeze(rb_str_new_cstr("xattr")));
229
229
  }