mincore 0.0.7 → 0.0.8
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.
- data/lib/mincore.rb +17 -23
- metadata +6 -6
data/lib/mincore.rb
CHANGED
@@ -2,6 +2,21 @@ require 'inline'
|
|
2
2
|
|
3
3
|
# The File mincore extension
|
4
4
|
class File
|
5
|
+
def self._common_code(builder)
|
6
|
+
builder.include("<stdio.h>")
|
7
|
+
builder.include("<stdlib.h>")
|
8
|
+
builder.include("<sys/stat.h>")
|
9
|
+
|
10
|
+
builder.include("<sys/types.h>")
|
11
|
+
builder.include("<fcntl.h>")
|
12
|
+
builder.include("<unistd.h>")
|
13
|
+
builder.include("<sys/mman.h>")
|
14
|
+
# builder.include("<fcntl.h>")
|
15
|
+
# builder.include("<fcntl.h>")
|
16
|
+
|
17
|
+
builder.prefix("#define exiterr(s) { perror(s); exit(-1); }")
|
18
|
+
end
|
19
|
+
|
5
20
|
|
6
21
|
inline do |builder|
|
7
22
|
builder.include("<unistd.h>")
|
@@ -15,19 +30,7 @@ static VALUE _PAGESIZE(int argc, VALUE *argv, VALUE self) {
|
|
15
30
|
|
16
31
|
|
17
32
|
inline do |builder|
|
18
|
-
builder
|
19
|
-
builder.include("<stdlib.h>")
|
20
|
-
builder.include("<sys/stat.h>")
|
21
|
-
|
22
|
-
builder.include("<sys/types.h>")
|
23
|
-
builder.include("<fcntl.h>")
|
24
|
-
builder.include("<unistd.h>")
|
25
|
-
builder.include("<sys/mman.h>")
|
26
|
-
# builder.include("<fcntl.h>")
|
27
|
-
# builder.include("<fcntl.h>")
|
28
|
-
|
29
|
-
builder.prefix("#define exiterr(s) { perror(s); exit(-1); }")
|
30
|
-
|
33
|
+
self._common_code builder
|
31
34
|
builder.c_singleton <<-C_CODE
|
32
35
|
static VALUE _mincore(char *filename) {
|
33
36
|
int fd;
|
@@ -105,16 +108,7 @@ C_CODE
|
|
105
108
|
end
|
106
109
|
|
107
110
|
inline do |builder|
|
108
|
-
builder
|
109
|
-
builder.include("<sys/stat.h>")
|
110
|
-
builder.include("<fcntl.h>")
|
111
|
-
builder.include("<error.h>")
|
112
|
-
builder.include("<stdio.h>")
|
113
|
-
builder.include("<stdlib.h>")
|
114
|
-
builder.include("<string.h>")
|
115
|
-
|
116
|
-
builder.prefix("#define exiterr(s) { perror(s); exit(-1); }")
|
117
|
-
|
111
|
+
self._common_code builder
|
118
112
|
builder.c_singleton <<-C_CODE
|
119
113
|
static VALUE _cachedel(char *filename, int count) {
|
120
114
|
int ret=0;
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mincore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Reda NOUSHI
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-11-
|
18
|
+
date: 2013-11-09 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: RubyInline
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
hash: 45
|
29
29
|
segments:
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
hash: 45
|
45
45
|
segments:
|