kyotocabinet-java 0.1.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +15 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +62 -0
- data/VERSION +1 -0
- data/ext/kyotocabinet-java/.gitignore +2 -0
- data/ext/kyotocabinet-java/COPYING +674 -0
- data/ext/kyotocabinet-java/Cursor.java +268 -0
- data/ext/kyotocabinet-java/DB.java +650 -0
- data/ext/kyotocabinet-java/Error.java +257 -0
- data/ext/kyotocabinet-java/FileProcessor.java +42 -0
- data/ext/kyotocabinet-java/Loader.java +60 -0
- data/ext/kyotocabinet-java/Makefile.in +246 -0
- data/ext/kyotocabinet-java/MapReduce.java +127 -0
- data/ext/kyotocabinet-java/README +26 -0
- data/ext/kyotocabinet-java/Test.java +1494 -0
- data/ext/kyotocabinet-java/Utility.java +131 -0
- data/ext/kyotocabinet-java/VCmakefile +150 -0
- data/ext/kyotocabinet-java/ValueIterator.java +49 -0
- data/ext/kyotocabinet-java/Visitor.java +56 -0
- data/ext/kyotocabinet-java/configure.in +310 -0
- data/ext/kyotocabinet-java/doc/allclasses-frame.html +26 -0
- data/ext/kyotocabinet-java/doc/allclasses-noframe.html +26 -0
- data/ext/kyotocabinet-java/doc/constant-values.html +344 -0
- data/ext/kyotocabinet-java/doc/index-all.html +848 -0
- data/ext/kyotocabinet-java/doc/index.html +30 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/Cursor.html +711 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/DB.html +1674 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/Error.html +604 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/FileProcessor.html +210 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/MapReduce.html +461 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/Test.html +220 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/Utility.html +413 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/ValueIterator.html +221 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/Visitor.html +283 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/package-frame.html +33 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/package-summary.html +199 -0
- data/ext/kyotocabinet-java/doc/kyotocabinet/package-tree.html +141 -0
- data/ext/kyotocabinet-java/doc/overview-summary.html +285 -0
- data/ext/kyotocabinet-java/doc/overview-tree.html +145 -0
- data/ext/kyotocabinet-java/doc/package-list +1 -0
- data/ext/kyotocabinet-java/doc/resources/background.gif +0 -0
- data/ext/kyotocabinet-java/doc/resources/tab.gif +0 -0
- data/ext/kyotocabinet-java/doc/resources/titlebar.gif +0 -0
- data/ext/kyotocabinet-java/doc/resources/titlebar_end.gif +0 -0
- data/ext/kyotocabinet-java/doc/serialized-form.html +141 -0
- data/ext/kyotocabinet-java/doc/stylesheet.css +474 -0
- data/ext/kyotocabinet-java/example/KCDBEX1.java +44 -0
- data/ext/kyotocabinet-java/example/KCDBEX2.java +44 -0
- data/ext/kyotocabinet-java/example/Makefile +59 -0
- data/ext/kyotocabinet-java/kyotocabinet.cc +2187 -0
- data/ext/kyotocabinet-java/kyotocabinet_Cursor.h +157 -0
- data/ext/kyotocabinet-java/kyotocabinet_DB.h +353 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error.h +49 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XBROKEN.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XDUPREC.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XINVALID.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XLOGIC.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XMISC.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XNOIMPL.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XNOPERM.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XNOREC.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XNOREPOS.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XSUCCESS.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_Error_XSYSTEM.h +41 -0
- data/ext/kyotocabinet-java/kyotocabinet_MapReduce.h +33 -0
- data/ext/kyotocabinet-java/kyotocabinet_Utility.h +101 -0
- data/ext/kyotocabinet-java/kyotocabinet_ValueIterator.h +21 -0
- data/ext/kyotocabinet-java/overview.html +177 -0
- data/kyotocabinet-java.gemspec +129 -0
- data/lib/kyotocabinet-java.rb +141 -0
- data/lib/kyotocabinet-java/version.rb +5 -0
- metadata +222 -0
@@ -0,0 +1,257 @@
|
|
1
|
+
/*************************************************************************************************
|
2
|
+
* Java binding of Kyoto Cabinet.
|
3
|
+
* Copyright (C) 2009-2011 FAL Labs
|
4
|
+
* This file is part of Kyoto Cabinet.
|
5
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of
|
6
|
+
* the GNU General Public License as published by the Free Software Foundation, either version
|
7
|
+
* 3 of the License, or any later version.
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
9
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
10
|
+
* See the GNU General Public License for more details.
|
11
|
+
* You should have received a copy of the GNU General Public License along with this program.
|
12
|
+
* If not, see <http://www.gnu.org/licenses/>.
|
13
|
+
*************************************************************************************************/
|
14
|
+
|
15
|
+
|
16
|
+
package kyotocabinet;
|
17
|
+
|
18
|
+
import java.util.*;
|
19
|
+
import java.io.*;
|
20
|
+
import java.net.*;
|
21
|
+
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Error data.
|
25
|
+
*/
|
26
|
+
public class Error extends RuntimeException {
|
27
|
+
//----------------------------------------------------------------
|
28
|
+
// static initializer
|
29
|
+
//----------------------------------------------------------------
|
30
|
+
static {
|
31
|
+
Loader.load();
|
32
|
+
}
|
33
|
+
//----------------------------------------------------------------
|
34
|
+
// public inner classes
|
35
|
+
//----------------------------------------------------------------
|
36
|
+
/**
|
37
|
+
* Exception for the success code.
|
38
|
+
*/
|
39
|
+
public static class XSUCCESS extends Error {
|
40
|
+
XSUCCESS(String expr) {
|
41
|
+
super(expr);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* Exception for the not implemented code.
|
46
|
+
*/
|
47
|
+
public static class XNOIMPL extends Error {
|
48
|
+
XNOIMPL(String expr) {
|
49
|
+
super(expr);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Exception for the invalid operation code.
|
54
|
+
*/
|
55
|
+
public static class XINVALID extends Error {
|
56
|
+
XINVALID(String expr) {
|
57
|
+
super(expr);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Exception for the no repository code.
|
62
|
+
*/
|
63
|
+
public static class XNOREPOS extends Error {
|
64
|
+
XNOREPOS(String expr) {
|
65
|
+
super(expr);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
/**
|
69
|
+
* Exception for the no permission code.
|
70
|
+
*/
|
71
|
+
public static class XNOPERM extends Error {
|
72
|
+
public XNOPERM(String expr) {
|
73
|
+
super(expr);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
/**
|
77
|
+
* Exception for the broken file code.
|
78
|
+
*/
|
79
|
+
public static class XBROKEN extends Error {
|
80
|
+
XBROKEN(String expr) {
|
81
|
+
super(expr);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
/**
|
85
|
+
* Exception for the record duplication code.
|
86
|
+
*/
|
87
|
+
public static class XDUPREC extends Error {
|
88
|
+
XDUPREC(String expr) {
|
89
|
+
super(expr);
|
90
|
+
}
|
91
|
+
}
|
92
|
+
/**
|
93
|
+
* Exception for the no record code.
|
94
|
+
*/
|
95
|
+
public static class XNOREC extends Error {
|
96
|
+
XNOREC(String expr) {
|
97
|
+
super(expr);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
/**
|
101
|
+
* Exception for the logical inconsistency code.
|
102
|
+
*/
|
103
|
+
public static class XLOGIC extends Error {
|
104
|
+
XLOGIC(String expr) {
|
105
|
+
super(expr);
|
106
|
+
}
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* Exception for the system error code.
|
110
|
+
*/
|
111
|
+
public static class XSYSTEM extends Error {
|
112
|
+
XSYSTEM(String expr) {
|
113
|
+
super(expr);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
/**
|
117
|
+
* Exception for the miscellaneous error code.
|
118
|
+
*/
|
119
|
+
public static class XMISC extends Error {
|
120
|
+
XMISC(String expr) {
|
121
|
+
super(expr);
|
122
|
+
}
|
123
|
+
}
|
124
|
+
//----------------------------------------------------------------
|
125
|
+
// public constants
|
126
|
+
//----------------------------------------------------------------
|
127
|
+
/** error code: success */
|
128
|
+
public static final int SUCCESS = 0;
|
129
|
+
/** error code: not implemented */
|
130
|
+
public static final int NOIMPL = 1;
|
131
|
+
/** error code: invalid operation */
|
132
|
+
public static final int INVALID = 2;
|
133
|
+
/** error code: no repository. */
|
134
|
+
public static final int NOREPOS = 3;
|
135
|
+
/** error code: no permission */
|
136
|
+
public static final int NOPERM = 4;
|
137
|
+
/** error code: broken file */
|
138
|
+
public static final int BROKEN = 5;
|
139
|
+
/** error code: record duplication */
|
140
|
+
public static final int DUPREC = 6;
|
141
|
+
/** error code: no record */
|
142
|
+
public static final int NOREC = 7;
|
143
|
+
/** error code: logical inconsistency */
|
144
|
+
public static final int LOGIC = 8;
|
145
|
+
/** error code: system error */
|
146
|
+
public static final int SYSTEM = 9;
|
147
|
+
/** error code: miscellaneous error */
|
148
|
+
public static final int MISC = 15;
|
149
|
+
//----------------------------------------------------------------
|
150
|
+
// constructors and finalizer
|
151
|
+
//----------------------------------------------------------------
|
152
|
+
/**
|
153
|
+
* Create an instance.
|
154
|
+
*/
|
155
|
+
public Error() {
|
156
|
+
code_ = SUCCESS;
|
157
|
+
message_ = "no error";
|
158
|
+
}
|
159
|
+
/**
|
160
|
+
* Create an instance.
|
161
|
+
* @param code the error code.
|
162
|
+
* @param message the supplement message.
|
163
|
+
*/
|
164
|
+
public Error(int code, String message) {
|
165
|
+
code_ = code;
|
166
|
+
message_ = message;
|
167
|
+
}
|
168
|
+
//----------------------------------------------------------------
|
169
|
+
// public methods
|
170
|
+
//---------------------------------------------------------------
|
171
|
+
/**
|
172
|
+
* Set the error information.
|
173
|
+
* @param code the error code.
|
174
|
+
* @param message the supplement message.
|
175
|
+
*/
|
176
|
+
public void set(int code, String message) {
|
177
|
+
code_ = code;
|
178
|
+
message_ = message;
|
179
|
+
}
|
180
|
+
/**
|
181
|
+
* Get the error code.
|
182
|
+
* @return the error code.
|
183
|
+
*/
|
184
|
+
public int code() {
|
185
|
+
return code_;
|
186
|
+
}
|
187
|
+
/**
|
188
|
+
* Get the readable string of the code.
|
189
|
+
* @return the readable string of the code.
|
190
|
+
*/
|
191
|
+
public String name() {
|
192
|
+
return codename(code_);
|
193
|
+
}
|
194
|
+
/**
|
195
|
+
* Get the supplement message.
|
196
|
+
* @return the supplement message.
|
197
|
+
*/
|
198
|
+
public String message() {
|
199
|
+
return message_;
|
200
|
+
}
|
201
|
+
/**
|
202
|
+
* Get the string expression.
|
203
|
+
* @return the string expression.
|
204
|
+
*/
|
205
|
+
public String toString() {
|
206
|
+
return name() + ": " + message();
|
207
|
+
}
|
208
|
+
/**
|
209
|
+
* Check equality.
|
210
|
+
* @param right an error object.
|
211
|
+
* @return true for the both operands are equal, or false if not.
|
212
|
+
*/
|
213
|
+
public boolean equals(Error right) {
|
214
|
+
return right.code_ == code_;
|
215
|
+
}
|
216
|
+
//----------------------------------------------------------------
|
217
|
+
// package methods
|
218
|
+
//----------------------------------------------------------------
|
219
|
+
/**
|
220
|
+
* Create an instance.
|
221
|
+
* @param expr an expression of the error.
|
222
|
+
*/
|
223
|
+
Error(String expr) {
|
224
|
+
super(expr);
|
225
|
+
code_ = (int)Utility.atoi(expr);
|
226
|
+
int idx = expr.indexOf(':');
|
227
|
+
if (idx >= 0) {
|
228
|
+
idx++;
|
229
|
+
int len = expr.length();
|
230
|
+
while (idx < len && expr.charAt(idx) == ' ') {
|
231
|
+
idx++;
|
232
|
+
}
|
233
|
+
expr = expr.substring(idx);
|
234
|
+
}
|
235
|
+
message_ = expr;
|
236
|
+
}
|
237
|
+
//----------------------------------------------------------------
|
238
|
+
// private static methods
|
239
|
+
//----------------------------------------------------------------
|
240
|
+
/**
|
241
|
+
* Get the readable string of an error code.
|
242
|
+
* @param code the error code.
|
243
|
+
* @return the readable string of the error code.
|
244
|
+
*/
|
245
|
+
private static native String codename(int code);
|
246
|
+
//----------------------------------------------------------------
|
247
|
+
// private fields
|
248
|
+
//----------------------------------------------------------------
|
249
|
+
/** The error code. */
|
250
|
+
private int code_;
|
251
|
+
/** The supplement message. */
|
252
|
+
private String message_;
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
// END OF FILE
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/*************************************************************************************************
|
2
|
+
* Java binding of Kyoto Cabinet.
|
3
|
+
* Copyright (C) 2009-2011 FAL Labs
|
4
|
+
* This file is part of Kyoto Cabinet.
|
5
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of
|
6
|
+
* the GNU General Public License as published by the Free Software Foundation, either version
|
7
|
+
* 3 of the License, or any later version.
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
9
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
10
|
+
* See the GNU General Public License for more details.
|
11
|
+
* You should have received a copy of the GNU General Public License along with this program.
|
12
|
+
* If not, see <http://www.gnu.org/licenses/>.
|
13
|
+
*************************************************************************************************/
|
14
|
+
|
15
|
+
|
16
|
+
package kyotocabinet;
|
17
|
+
|
18
|
+
import java.util.*;
|
19
|
+
import java.io.*;
|
20
|
+
import java.net.*;
|
21
|
+
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Interface to process the database file.
|
25
|
+
*/
|
26
|
+
public interface FileProcessor {
|
27
|
+
//----------------------------------------------------------------
|
28
|
+
// public methods
|
29
|
+
//----------------------------------------------------------------
|
30
|
+
/**
|
31
|
+
* Process the database file.
|
32
|
+
* @param path the path of the database file.
|
33
|
+
* @param count the number of records.
|
34
|
+
* @param size the size of the available region.
|
35
|
+
* @return true on success, or false on failure.
|
36
|
+
*/
|
37
|
+
public boolean process(String path, long count, long size);
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
// END OF FILE
|
@@ -0,0 +1,60 @@
|
|
1
|
+
/*************************************************************************************************
|
2
|
+
* Java binding of Kyoto Cabinet.
|
3
|
+
* Copyright (C) 2009-2011 FAL Labs
|
4
|
+
* This file is part of Kyoto Cabinet.
|
5
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of
|
6
|
+
* the GNU General Public License as published by the Free Software Foundation, either version
|
7
|
+
* 3 of the License, or any later version.
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
9
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
10
|
+
* See the GNU General Public License for more details.
|
11
|
+
* You should have received a copy of the GNU General Public License along with this program.
|
12
|
+
* If not, see <http://www.gnu.org/licenses/>.
|
13
|
+
*************************************************************************************************/
|
14
|
+
|
15
|
+
|
16
|
+
package kyotocabinet;
|
17
|
+
|
18
|
+
import java.util.*;
|
19
|
+
import java.io.*;
|
20
|
+
import java.net.*;
|
21
|
+
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Library loader.
|
25
|
+
*/
|
26
|
+
class Loader {
|
27
|
+
//----------------------------------------------------------------
|
28
|
+
// package static methods
|
29
|
+
//----------------------------------------------------------------
|
30
|
+
/**
|
31
|
+
* Load the native library.
|
32
|
+
*/
|
33
|
+
static synchronized void load() {
|
34
|
+
// JNI library will be loaded from the Ruby side
|
35
|
+
if(loaded) return;
|
36
|
+
String sopath = System.getProperty("kyotocabinet.lib");
|
37
|
+
if (sopath != null) {
|
38
|
+
System.load(sopath);
|
39
|
+
} else {
|
40
|
+
System.loadLibrary("jkyotocabinet");
|
41
|
+
}
|
42
|
+
loaded = true;
|
43
|
+
}
|
44
|
+
//----------------------------------------------------------------
|
45
|
+
// static private fields
|
46
|
+
//----------------------------------------------------------------
|
47
|
+
/** The flag whether loaded. */
|
48
|
+
static private boolean loaded = false;
|
49
|
+
//----------------------------------------------------------------
|
50
|
+
// private methods
|
51
|
+
//----------------------------------------------------------------
|
52
|
+
/**
|
53
|
+
* Dummy constructor.
|
54
|
+
*/
|
55
|
+
private Loader() {}
|
56
|
+
}
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
/* END OF FILE */
|
@@ -0,0 +1,246 @@
|
|
1
|
+
# Makefile for Kyoto Cabinet for Java
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
#================================================================
|
6
|
+
# Setting Variables
|
7
|
+
#================================================================
|
8
|
+
|
9
|
+
|
10
|
+
# Generic settings
|
11
|
+
SHELL = @SHELL@
|
12
|
+
|
13
|
+
# Package information
|
14
|
+
PACKAGE = @PACKAGE_NAME@
|
15
|
+
VERSION = @PACKAGE_VERSION@
|
16
|
+
PACKAGEDIR = $(PACKAGE)-$(VERSION)
|
17
|
+
PACKAGETGZ = $(PACKAGE)-$(VERSION).tar.gz
|
18
|
+
LIBVER = @MYLIBVER@
|
19
|
+
LIBREV = @MYLIBREV@
|
20
|
+
|
21
|
+
# Targets
|
22
|
+
JARFILES = @MYJARFILES@
|
23
|
+
JAVAFILES = @MYJAVAFILES@
|
24
|
+
LIBRARYFILES = @MYLIBRARYFILES@
|
25
|
+
LIBOBJFILES = @MYLIBOBJFILES@
|
26
|
+
|
27
|
+
# Install destinations
|
28
|
+
prefix = @prefix@
|
29
|
+
exec_prefix = @exec_prefix@
|
30
|
+
datarootdir = @datarootdir@
|
31
|
+
LIBDIR = @libdir@
|
32
|
+
DESTDIR =
|
33
|
+
|
34
|
+
# Building configuration
|
35
|
+
JAVAC = @JAVAC@
|
36
|
+
JAVACFLAGS = @MYJAVACFLAGS@
|
37
|
+
JAR = @JAR@
|
38
|
+
JAVAH = @JAVAH@
|
39
|
+
JAVADOC = @JAVADOC@
|
40
|
+
JAVADOCFLAGS = @MYJAVADOCFLAGS@
|
41
|
+
JAVARUN = @JAVARUN@
|
42
|
+
JAVARUNFLAGS = @MYJAVARUNFLAGS@
|
43
|
+
CXX = @CXX@
|
44
|
+
CPPFLAGS = @MYCPPFLAGS@
|
45
|
+
CXXFLAGS = @MYCXXFLAGS@
|
46
|
+
LDFLAGS = @MYLDFLAGS@
|
47
|
+
LIBS = @LIBS@
|
48
|
+
LDENV = LD_RUN_PATH=/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@:.
|
49
|
+
RUNENV = @MYLDLIBPATHENV@=.:/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
#================================================================
|
54
|
+
# Suffix rules
|
55
|
+
#================================================================
|
56
|
+
|
57
|
+
|
58
|
+
.SUFFIXES :
|
59
|
+
.SUFFIXES : .cc .o
|
60
|
+
|
61
|
+
.cc.o :
|
62
|
+
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
#================================================================
|
67
|
+
# Actions
|
68
|
+
#================================================================
|
69
|
+
|
70
|
+
|
71
|
+
all : $(JARFILES) $(LIBRARYFILES)
|
72
|
+
@printf '\n'
|
73
|
+
@printf '#================================================================\n'
|
74
|
+
@printf '# Ready to install.\n'
|
75
|
+
@printf '#================================================================\n'
|
76
|
+
|
77
|
+
|
78
|
+
clean :
|
79
|
+
rm -rf $(JARFILES) $(LIBRARYFILES) $(LIBOBJFILES) \
|
80
|
+
*.o a.out *.class check.in check.out gmon.out *.vlog \
|
81
|
+
casket* *.kch *.kct *.kcd *.kcf *.wal *.tmpkc* *.kcss *.log *~ hoge moge tako ika
|
82
|
+
|
83
|
+
|
84
|
+
untabify :
|
85
|
+
ls *.cc *.h *.java | while read name ; \
|
86
|
+
do \
|
87
|
+
sed -e 's/\t/ /g' -e 's/ *$$//' $$name > $$name~; \
|
88
|
+
[ -f $$name~ ] && mv -f $$name~ $$name ; \
|
89
|
+
done
|
90
|
+
|
91
|
+
|
92
|
+
install :
|
93
|
+
mkdir -p $(DESTDIR)$(LIBDIR)
|
94
|
+
cp -Rf $(JARFILES) $(DESTDIR)$(LIBDIR)
|
95
|
+
cp -Rf $(LIBRARYFILES) $(DESTDIR)$(LIBDIR)
|
96
|
+
@printf '\n'
|
97
|
+
@printf '#================================================================\n'
|
98
|
+
@printf '# Thanks for using Kyoto Cabinet for Java.\n'
|
99
|
+
@printf '#================================================================\n'
|
100
|
+
|
101
|
+
|
102
|
+
uninstall :
|
103
|
+
cd $(DESTDIR)$(LIBDIR) && rm -f $(JARFILES)
|
104
|
+
cd $(DESTDIR)$(LIBDIR) && rm -f $(LIBRARYFILES)
|
105
|
+
|
106
|
+
|
107
|
+
dist :
|
108
|
+
$(MAKE) untabify
|
109
|
+
$(MAKE) distclean
|
110
|
+
cd .. && tar cvf - $(PACKAGEDIR) | gzip -c > $(PACKAGETGZ)
|
111
|
+
sync ; sync
|
112
|
+
|
113
|
+
|
114
|
+
distclean : clean
|
115
|
+
cd example && $(MAKE) clean
|
116
|
+
rm -rf Makefile config.cache config.log config.status config.tmp autom4te.cache
|
117
|
+
|
118
|
+
|
119
|
+
head : kyotocabinet.jar
|
120
|
+
rm -rf kyotocabinet_*.h
|
121
|
+
CLASSPATH=kyotocabinet.jar $(JAVAH) -jni kyotocabinet.Utility kyotocabinet.Error \
|
122
|
+
kyotocabinet.Cursor kyotocabinet.DB kyotocabinet.MapReduce kyotocabinet.ValueIterator
|
123
|
+
|
124
|
+
|
125
|
+
check :
|
126
|
+
$(MAKE) DBNAME=":" RNUM="10000" check-each
|
127
|
+
$(MAKE) DBNAME="*" RNUM="10000" check-each
|
128
|
+
$(MAKE) DBNAME="%" RNUM="10000" check-each
|
129
|
+
$(MAKE) DBNAME="casket.kch" RNUM="10000" check-each
|
130
|
+
$(MAKE) DBNAME="casket.kct" RNUM="10000" check-each
|
131
|
+
$(MAKE) DBNAME="casket.kcd" RNUM="1000" check-each
|
132
|
+
$(MAKE) DBNAME="casket.kcf" RNUM="10000" check-each
|
133
|
+
@printf '\n'
|
134
|
+
@printf '#================================================================\n'
|
135
|
+
@printf '# Checking completed.\n'
|
136
|
+
@printf '#================================================================\n'
|
137
|
+
|
138
|
+
|
139
|
+
check-each :
|
140
|
+
rm -rf casket*
|
141
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test order \
|
142
|
+
"$(DBNAME)" "$(RNUM)"
|
143
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test order \
|
144
|
+
-rnd "$(DBNAME)" "$(RNUM)"
|
145
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test order \
|
146
|
+
-etc "$(DBNAME)" "$(RNUM)"
|
147
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test order \
|
148
|
+
-rnd -etc "$(DBNAME)" "$(RNUM)"
|
149
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test order \
|
150
|
+
-th 4 "$(DBNAME)" "$(RNUM)"
|
151
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test order \
|
152
|
+
-th 4 -rnd "$(DBNAME)" "$(RNUM)"
|
153
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test order \
|
154
|
+
-th 4 -etc "$(DBNAME)" "$(RNUM)"
|
155
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test order \
|
156
|
+
-th 4 -rnd -etc "$(DBNAME)" "$(RNUM)"
|
157
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test wicked \
|
158
|
+
"$(DBNAME)" "$(RNUM)"
|
159
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test wicked \
|
160
|
+
-it 4 "$(DBNAME)" "$(RNUM)"
|
161
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test wicked \
|
162
|
+
-th 4 "$(DBNAME)" "$(RNUM)"
|
163
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test wicked \
|
164
|
+
-th 4 -it 4 "$(DBNAME)" "$(RNUM)"
|
165
|
+
$(RUNENV) $(JAVARUN) $(JAVARUNFLAGS) kyotocabinet.Test misc \
|
166
|
+
"$(DBNAME)"
|
167
|
+
rm -rf casket*
|
168
|
+
|
169
|
+
|
170
|
+
check-forever :
|
171
|
+
while true ; \
|
172
|
+
do \
|
173
|
+
$(MAKE) check || break ; \
|
174
|
+
done
|
175
|
+
|
176
|
+
|
177
|
+
doc :
|
178
|
+
$(MAKE) docclean
|
179
|
+
mkdir -p doc
|
180
|
+
mkdir -p doctmp
|
181
|
+
\ls *.java | while read file ; \
|
182
|
+
do \
|
183
|
+
sed -e 's/public static class X/private static class X/' $$file > doctmp/$$file ; \
|
184
|
+
done
|
185
|
+
$(JAVADOC) $(JAVADOCFLAGS) -windowtitle kyotocabinet -overview overview.html \
|
186
|
+
-d doc doctmp/*.java
|
187
|
+
rm -rf doctmp
|
188
|
+
|
189
|
+
|
190
|
+
docclean :
|
191
|
+
rm -rf doc doctmp
|
192
|
+
|
193
|
+
|
194
|
+
.PHONY : all clean install casket check doc
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
#================================================================
|
199
|
+
# Building binaries
|
200
|
+
#================================================================
|
201
|
+
|
202
|
+
|
203
|
+
kyotocabinet.jar : $(JAVAFILES)
|
204
|
+
$(JAVAC) $(JAVACFLAGS) $(JAVAFILES)
|
205
|
+
$(JAR) cvf $@ kyotocabinet/*.class
|
206
|
+
rm -rf kyotocabinet
|
207
|
+
|
208
|
+
|
209
|
+
libjkyotocabinet.so.$(LIBVER).$(LIBREV).0 : $(LIBOBJFILES)
|
210
|
+
$(CXX) $(CXXFLAGS) -shared -Wl,-soname,libjkyotocabinet.so.$(LIBVER) -o $@ \
|
211
|
+
$(LIBOBJFILES) $(LDFLAGS) $(LIBS)
|
212
|
+
|
213
|
+
|
214
|
+
libjkyotocabinet.so.$(LIBVER) : libjkyotocabinet.so.$(LIBVER).$(LIBREV).0
|
215
|
+
ln -f -s libjkyotocabinet.so.$(LIBVER).$(LIBREV).0 $@
|
216
|
+
|
217
|
+
|
218
|
+
libjkyotocabinet.so : libjkyotocabinet.so.$(LIBVER).$(LIBREV).0
|
219
|
+
ln -f -s libjkyotocabinet.so.$(LIBVER).$(LIBREV).0 $@
|
220
|
+
|
221
|
+
|
222
|
+
libjkyotocabinet.$(LIBVER).$(LIBREV).0.dylib : $(LIBOBJFILES)
|
223
|
+
$(CXX) $(CXXFLAGS) -dynamiclib -o $@ \
|
224
|
+
-install_name $(LIBDIR)/libjkyotocabinet.$(LIBVER).dylib \
|
225
|
+
-current_version $(LIBVER).$(LIBREV).0 -compatibility_version $(LIBVER) \
|
226
|
+
$(LIBOBJFILES) $(LDFLAGS) $(LIBS)
|
227
|
+
|
228
|
+
|
229
|
+
libjkyotocabinet.$(LIBVER).dylib : libjkyotocabinet.$(LIBVER).$(LIBREV).0.dylib
|
230
|
+
ln -f -s libjkyotocabinet.$(LIBVER).$(LIBREV).0.dylib $@
|
231
|
+
|
232
|
+
|
233
|
+
libjkyotocabinet.dylib : libjkyotocabinet.$(LIBVER).$(LIBREV).0.dylib
|
234
|
+
ln -f -s libjkyotocabinet.$(LIBVER).$(LIBREV).0.dylib $@
|
235
|
+
|
236
|
+
|
237
|
+
libjkyotocabinet.jnilib : libjkyotocabinet.dylib
|
238
|
+
ln -f -s libjkyotocabinet.dylib $@
|
239
|
+
|
240
|
+
|
241
|
+
kyotocabinet.o : kyotocabinet_Utility.h kyotocabinet_Error.h \
|
242
|
+
kyotocabinet_Cursor.h kyotocabinet_DB.h kyotocabinet_MapReduce.h kyotocabinet_ValueIterator.h
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
# END OF FILE
|