talkfilters 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/ext/talkfilters/talkfilters.c +11 -3
  2. metadata +48 -32
@@ -5,6 +5,14 @@
5
5
 
6
6
  #define TF_REALLOC_SIZE 1024
7
7
 
8
+ #ifndef RSTRING_LEN
9
+ #define RSTRING_LEN(x) RSTRING(x)->len
10
+ #endif
11
+
12
+ #ifndef RSTRING_PTR
13
+ #define RSTRING_PTR(x) RSTRING(x)->ptr
14
+ #endif
15
+
8
16
  VALUE tf_list_filters(void);
9
17
  VALUE tf_translate(VALUE dummy, VALUE type, VALUE string);
10
18
 
@@ -32,15 +40,15 @@ VALUE tf_translate(VALUE dummy, VALUE type, VALUE string) {
32
40
  return rb_string_new2("");
33
41
  }
34
42
 
35
- bufsize = RSTRING(string)->len + 2;
43
+ bufsize = RSTRING_LEN(string) + 2;
36
44
 
37
45
  buf = (char *) malloc(bufsize);
38
46
  bzero(buf, bufsize);
39
47
 
40
- filter = (gtf_filter_t *) gtf_filter_lookup(RSTRING(type)->ptr);
48
+ filter = (gtf_filter_t *) gtf_filter_lookup(RSTRING_PTR(type));
41
49
 
42
50
  if (filter != NULL) {
43
- while (filter->filter(RSTRING(string)->ptr, buf, bufsize)) {
51
+ while (filter->filter(RSTRING_PTR(string), buf, bufsize)) {
44
52
  tmpbuf = realloc(buf, bufsize + TF_REALLOC_SIZE);
45
53
  if (tmpbuf == NULL) {
46
54
  rb_raise(rb_eException, "Allocation Error");
metadata CHANGED
@@ -1,47 +1,63 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: talkfilters
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.0.4
7
- date: 2007-07-08 00:00:00 -07:00
8
- summary: Ruby interface to GNU Talkfilters
9
- require_paths:
10
- - lib
11
- email: erik@hollensbe.org
12
- homepage: http://rubyforge.org/projects/ngslib
13
- rubyforge_project: ngslib
14
- description:
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: false
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 5
9
+ version: 0.0.5
25
10
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
11
  authors:
30
12
  - Erik Hollensbe
31
- files:
32
- - ext/talkfilters/talkfilters.c
33
- - ext/talkfilters/extconf.rb
34
- test_files: []
35
-
36
- rdoc_options: []
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
37
16
 
38
- extra_rdoc_files: []
17
+ date: 2010-05-21 00:00:00 -04:00
18
+ default_executable:
19
+ dependencies: []
39
20
 
21
+ description:
22
+ email: erik@hollensbe.org
40
23
  executables: []
41
24
 
42
25
  extensions:
43
26
  - ext/talkfilters/extconf.rb
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - ext/talkfilters/talkfilters.c
31
+ - ext/talkfilters/extconf.rb
32
+ has_rdoc: true
33
+ homepage: http://github.com/erikh/talkfilters/
34
+ licenses: []
35
+
36
+ post_install_message:
37
+ rdoc_options: []
38
+
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ segments:
46
+ - 0
47
+ version: "0"
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ segments:
53
+ - 0
54
+ version: "0"
44
55
  requirements: []
45
56
 
46
- dependencies: []
57
+ rubyforge_project: ngslib
58
+ rubygems_version: 1.3.6
59
+ signing_key:
60
+ specification_version: 3
61
+ summary: Ruby interface to GNU Talkfilters
62
+ test_files: []
47
63