ferret 0.9.6 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. data/MIT-LICENSE +1 -1
  2. data/README +12 -24
  3. data/Rakefile +38 -54
  4. data/TODO +14 -17
  5. data/ext/analysis.c +982 -823
  6. data/ext/analysis.h +133 -76
  7. data/ext/array.c +96 -58
  8. data/ext/array.h +40 -13
  9. data/ext/bitvector.c +476 -118
  10. data/ext/bitvector.h +264 -22
  11. data/ext/compound_io.c +217 -229
  12. data/ext/defines.h +49 -0
  13. data/ext/document.c +107 -317
  14. data/ext/document.h +31 -65
  15. data/ext/except.c +81 -36
  16. data/ext/except.h +117 -55
  17. data/ext/extconf.rb +2 -9
  18. data/ext/ferret.c +211 -104
  19. data/ext/ferret.h +22 -11
  20. data/ext/filter.c +97 -82
  21. data/ext/fs_store.c +348 -367
  22. data/ext/global.c +226 -188
  23. data/ext/global.h +44 -26
  24. data/ext/hash.c +474 -391
  25. data/ext/hash.h +441 -68
  26. data/ext/hashset.c +124 -96
  27. data/ext/hashset.h +169 -20
  28. data/ext/helper.c +56 -5
  29. data/ext/helper.h +7 -0
  30. data/ext/inc/lang.h +29 -49
  31. data/ext/inc/threading.h +31 -0
  32. data/ext/ind.c +288 -278
  33. data/ext/ind.h +68 -0
  34. data/ext/index.c +5688 -0
  35. data/ext/index.h +663 -616
  36. data/ext/lang.h +29 -49
  37. data/ext/libstemmer.c +3 -3
  38. data/ext/mem_pool.c +84 -0
  39. data/ext/mem_pool.h +35 -0
  40. data/ext/posh.c +1006 -0
  41. data/ext/posh.h +1007 -0
  42. data/ext/priorityqueue.c +117 -194
  43. data/ext/priorityqueue.h +135 -39
  44. data/ext/q_boolean.c +1305 -1108
  45. data/ext/q_const_score.c +106 -93
  46. data/ext/q_filtered_query.c +138 -135
  47. data/ext/q_fuzzy.c +206 -242
  48. data/ext/q_match_all.c +94 -80
  49. data/ext/q_multi_term.c +663 -0
  50. data/ext/q_parser.c +667 -593
  51. data/ext/q_phrase.c +992 -555
  52. data/ext/q_prefix.c +72 -61
  53. data/ext/q_range.c +235 -210
  54. data/ext/q_span.c +1480 -1166
  55. data/ext/q_term.c +273 -246
  56. data/ext/q_wildcard.c +127 -114
  57. data/ext/r_analysis.c +1720 -711
  58. data/ext/r_index.c +3049 -0
  59. data/ext/r_qparser.c +433 -146
  60. data/ext/r_search.c +2934 -1993
  61. data/ext/r_store.c +372 -143
  62. data/ext/r_utils.c +941 -0
  63. data/ext/ram_store.c +330 -326
  64. data/ext/search.c +1291 -668
  65. data/ext/search.h +403 -702
  66. data/ext/similarity.c +91 -113
  67. data/ext/similarity.h +45 -30
  68. data/ext/sort.c +721 -484
  69. data/ext/stopwords.c +361 -273
  70. data/ext/store.c +556 -58
  71. data/ext/store.h +706 -126
  72. data/ext/tags +3578 -2780
  73. data/ext/term_vectors.c +352 -0
  74. data/ext/threading.h +31 -0
  75. data/ext/win32.h +54 -0
  76. data/lib/ferret.rb +5 -17
  77. data/lib/ferret/document.rb +130 -2
  78. data/lib/ferret/index.rb +577 -26
  79. data/lib/ferret/number_tools.rb +157 -0
  80. data/lib/ferret_version.rb +3 -0
  81. data/test/test_helper.rb +5 -13
  82. data/test/unit/analysis/tc_analyzer.rb +513 -1
  83. data/test/unit/analysis/{ctc_tokenstream.rb → tc_token_stream.rb} +23 -0
  84. data/test/unit/index/tc_index.rb +183 -240
  85. data/test/unit/index/tc_index_reader.rb +312 -479
  86. data/test/unit/index/tc_index_writer.rb +397 -13
  87. data/test/unit/index/th_doc.rb +269 -206
  88. data/test/unit/query_parser/tc_query_parser.rb +40 -33
  89. data/test/unit/search/tc_filter.rb +59 -71
  90. data/test/unit/search/tc_fuzzy_query.rb +24 -16
  91. data/test/unit/search/tc_index_searcher.rb +23 -201
  92. data/test/unit/search/tc_multi_searcher.rb +78 -226
  93. data/test/unit/search/tc_search_and_sort.rb +93 -81
  94. data/test/unit/search/tc_sort.rb +23 -23
  95. data/test/unit/search/tc_sort_field.rb +7 -7
  96. data/test/unit/search/tc_spans.rb +51 -47
  97. data/test/unit/search/tm_searcher.rb +339 -0
  98. data/test/unit/store/tc_fs_store.rb +1 -1
  99. data/test/unit/store/tm_store_lock.rb +3 -3
  100. data/test/unit/tc_document.rb +81 -0
  101. data/test/unit/ts_analysis.rb +1 -1
  102. data/test/unit/ts_utils.rb +1 -1
  103. data/test/unit/utils/tc_bit_vector.rb +288 -0
  104. data/test/unit/utils/tc_number_tools.rb +117 -0
  105. data/test/unit/utils/tc_priority_queue.rb +106 -0
  106. metadata +140 -301
  107. data/CHANGELOG +0 -9
  108. data/ext/dummy.exe +0 -0
  109. data/ext/field.c +0 -408
  110. data/ext/frtio.h +0 -13
  111. data/ext/inc/except.h +0 -90
  112. data/ext/index_io.c +0 -382
  113. data/ext/index_rw.c +0 -2658
  114. data/ext/lang.c +0 -41
  115. data/ext/nix_io.c +0 -134
  116. data/ext/q_multi_phrase.c +0 -380
  117. data/ext/r_doc.c +0 -582
  118. data/ext/r_index_io.c +0 -1021
  119. data/ext/r_term.c +0 -219
  120. data/ext/term.c +0 -820
  121. data/ext/termdocs.c +0 -611
  122. data/ext/vector.c +0 -637
  123. data/ext/w32_io.c +0 -150
  124. data/lib/ferret/analysis.rb +0 -11
  125. data/lib/ferret/analysis/analyzers.rb +0 -112
  126. data/lib/ferret/analysis/standard_tokenizer.rb +0 -71
  127. data/lib/ferret/analysis/token.rb +0 -100
  128. data/lib/ferret/analysis/token_filters.rb +0 -86
  129. data/lib/ferret/analysis/token_stream.rb +0 -26
  130. data/lib/ferret/analysis/tokenizers.rb +0 -112
  131. data/lib/ferret/analysis/word_list_loader.rb +0 -27
  132. data/lib/ferret/document/document.rb +0 -152
  133. data/lib/ferret/document/field.rb +0 -312
  134. data/lib/ferret/index/compound_file_io.rb +0 -338
  135. data/lib/ferret/index/document_writer.rb +0 -289
  136. data/lib/ferret/index/field_infos.rb +0 -279
  137. data/lib/ferret/index/fields_io.rb +0 -181
  138. data/lib/ferret/index/index.rb +0 -675
  139. data/lib/ferret/index/index_file_names.rb +0 -33
  140. data/lib/ferret/index/index_reader.rb +0 -503
  141. data/lib/ferret/index/index_writer.rb +0 -534
  142. data/lib/ferret/index/multi_reader.rb +0 -377
  143. data/lib/ferret/index/multiple_term_doc_pos_enum.rb +0 -98
  144. data/lib/ferret/index/segment_infos.rb +0 -130
  145. data/lib/ferret/index/segment_merge_info.rb +0 -49
  146. data/lib/ferret/index/segment_merge_queue.rb +0 -16
  147. data/lib/ferret/index/segment_merger.rb +0 -358
  148. data/lib/ferret/index/segment_reader.rb +0 -412
  149. data/lib/ferret/index/segment_term_enum.rb +0 -169
  150. data/lib/ferret/index/segment_term_vector.rb +0 -58
  151. data/lib/ferret/index/term.rb +0 -53
  152. data/lib/ferret/index/term_buffer.rb +0 -83
  153. data/lib/ferret/index/term_doc_enum.rb +0 -291
  154. data/lib/ferret/index/term_enum.rb +0 -52
  155. data/lib/ferret/index/term_info.rb +0 -37
  156. data/lib/ferret/index/term_infos_io.rb +0 -321
  157. data/lib/ferret/index/term_vector_offset_info.rb +0 -20
  158. data/lib/ferret/index/term_vectors_io.rb +0 -553
  159. data/lib/ferret/query_parser.rb +0 -312
  160. data/lib/ferret/query_parser/query_parser.tab.rb +0 -928
  161. data/lib/ferret/search.rb +0 -50
  162. data/lib/ferret/search/boolean_clause.rb +0 -100
  163. data/lib/ferret/search/boolean_query.rb +0 -299
  164. data/lib/ferret/search/boolean_scorer.rb +0 -294
  165. data/lib/ferret/search/caching_wrapper_filter.rb +0 -40
  166. data/lib/ferret/search/conjunction_scorer.rb +0 -99
  167. data/lib/ferret/search/disjunction_sum_scorer.rb +0 -205
  168. data/lib/ferret/search/exact_phrase_scorer.rb +0 -32
  169. data/lib/ferret/search/explanation.rb +0 -41
  170. data/lib/ferret/search/field_cache.rb +0 -215
  171. data/lib/ferret/search/field_doc.rb +0 -31
  172. data/lib/ferret/search/field_sorted_hit_queue.rb +0 -184
  173. data/lib/ferret/search/filter.rb +0 -11
  174. data/lib/ferret/search/filtered_query.rb +0 -130
  175. data/lib/ferret/search/filtered_term_enum.rb +0 -79
  176. data/lib/ferret/search/fuzzy_query.rb +0 -154
  177. data/lib/ferret/search/fuzzy_term_enum.rb +0 -247
  178. data/lib/ferret/search/hit_collector.rb +0 -34
  179. data/lib/ferret/search/hit_queue.rb +0 -11
  180. data/lib/ferret/search/index_searcher.rb +0 -200
  181. data/lib/ferret/search/match_all_query.rb +0 -104
  182. data/lib/ferret/search/multi_phrase_query.rb +0 -216
  183. data/lib/ferret/search/multi_searcher.rb +0 -261
  184. data/lib/ferret/search/multi_term_query.rb +0 -65
  185. data/lib/ferret/search/non_matching_scorer.rb +0 -22
  186. data/lib/ferret/search/phrase_positions.rb +0 -55
  187. data/lib/ferret/search/phrase_query.rb +0 -214
  188. data/lib/ferret/search/phrase_scorer.rb +0 -152
  189. data/lib/ferret/search/prefix_query.rb +0 -54
  190. data/lib/ferret/search/query.rb +0 -140
  191. data/lib/ferret/search/query_filter.rb +0 -51
  192. data/lib/ferret/search/range_filter.rb +0 -103
  193. data/lib/ferret/search/range_query.rb +0 -139
  194. data/lib/ferret/search/req_excl_scorer.rb +0 -125
  195. data/lib/ferret/search/req_opt_sum_scorer.rb +0 -70
  196. data/lib/ferret/search/score_doc.rb +0 -38
  197. data/lib/ferret/search/score_doc_comparator.rb +0 -114
  198. data/lib/ferret/search/scorer.rb +0 -91
  199. data/lib/ferret/search/similarity.rb +0 -278
  200. data/lib/ferret/search/sloppy_phrase_scorer.rb +0 -47
  201. data/lib/ferret/search/sort.rb +0 -112
  202. data/lib/ferret/search/sort_comparator.rb +0 -60
  203. data/lib/ferret/search/sort_field.rb +0 -91
  204. data/lib/ferret/search/spans.rb +0 -12
  205. data/lib/ferret/search/spans/near_spans_enum.rb +0 -304
  206. data/lib/ferret/search/spans/span_first_query.rb +0 -79
  207. data/lib/ferret/search/spans/span_near_query.rb +0 -108
  208. data/lib/ferret/search/spans/span_not_query.rb +0 -130
  209. data/lib/ferret/search/spans/span_or_query.rb +0 -176
  210. data/lib/ferret/search/spans/span_query.rb +0 -25
  211. data/lib/ferret/search/spans/span_scorer.rb +0 -74
  212. data/lib/ferret/search/spans/span_term_query.rb +0 -105
  213. data/lib/ferret/search/spans/span_weight.rb +0 -84
  214. data/lib/ferret/search/spans/spans_enum.rb +0 -44
  215. data/lib/ferret/search/term_query.rb +0 -128
  216. data/lib/ferret/search/term_scorer.rb +0 -183
  217. data/lib/ferret/search/top_docs.rb +0 -36
  218. data/lib/ferret/search/top_field_docs.rb +0 -17
  219. data/lib/ferret/search/weight.rb +0 -54
  220. data/lib/ferret/search/wildcard_query.rb +0 -26
  221. data/lib/ferret/search/wildcard_term_enum.rb +0 -61
  222. data/lib/ferret/stemmers.rb +0 -1
  223. data/lib/ferret/stemmers/porter_stemmer.rb +0 -218
  224. data/lib/ferret/store.rb +0 -5
  225. data/lib/ferret/store/buffered_index_io.rb +0 -190
  226. data/lib/ferret/store/directory.rb +0 -141
  227. data/lib/ferret/store/fs_store.rb +0 -381
  228. data/lib/ferret/store/index_io.rb +0 -245
  229. data/lib/ferret/store/ram_store.rb +0 -286
  230. data/lib/ferret/utils.rb +0 -8
  231. data/lib/ferret/utils/bit_vector.rb +0 -123
  232. data/lib/ferret/utils/date_tools.rb +0 -138
  233. data/lib/ferret/utils/number_tools.rb +0 -91
  234. data/lib/ferret/utils/parameter.rb +0 -41
  235. data/lib/ferret/utils/priority_queue.rb +0 -120
  236. data/lib/ferret/utils/string_helper.rb +0 -47
  237. data/lib/ferret/utils/thread_local.rb +0 -28
  238. data/lib/ferret/utils/weak_key_hash.rb +0 -60
  239. data/lib/rferret.rb +0 -37
  240. data/rake_utils/code_statistics.rb +0 -106
  241. data/test/benchmark/tb_ram_store.rb +0 -76
  242. data/test/benchmark/tb_rw_vint.rb +0 -26
  243. data/test/functional/thread_safety_index_test.rb +0 -81
  244. data/test/functional/thread_safety_test.rb +0 -137
  245. data/test/longrunning/tc_numbertools.rb +0 -60
  246. data/test/longrunning/tm_store.rb +0 -19
  247. data/test/unit/analysis/ctc_analyzer.rb +0 -532
  248. data/test/unit/analysis/data/wordfile +0 -6
  249. data/test/unit/analysis/rtc_letter_tokenizer.rb +0 -20
  250. data/test/unit/analysis/rtc_lower_case_filter.rb +0 -20
  251. data/test/unit/analysis/rtc_lower_case_tokenizer.rb +0 -27
  252. data/test/unit/analysis/rtc_per_field_analyzer_wrapper.rb +0 -39
  253. data/test/unit/analysis/rtc_porter_stem_filter.rb +0 -16
  254. data/test/unit/analysis/rtc_standard_analyzer.rb +0 -20
  255. data/test/unit/analysis/rtc_standard_tokenizer.rb +0 -20
  256. data/test/unit/analysis/rtc_stop_analyzer.rb +0 -20
  257. data/test/unit/analysis/rtc_stop_filter.rb +0 -14
  258. data/test/unit/analysis/rtc_white_space_analyzer.rb +0 -21
  259. data/test/unit/analysis/rtc_white_space_tokenizer.rb +0 -20
  260. data/test/unit/analysis/rtc_word_list_loader.rb +0 -32
  261. data/test/unit/analysis/tc_token.rb +0 -25
  262. data/test/unit/document/rtc_field.rb +0 -28
  263. data/test/unit/document/tc_document.rb +0 -47
  264. data/test/unit/document/tc_field.rb +0 -98
  265. data/test/unit/index/rtc_compound_file_io.rb +0 -107
  266. data/test/unit/index/rtc_field_infos.rb +0 -127
  267. data/test/unit/index/rtc_fields_io.rb +0 -167
  268. data/test/unit/index/rtc_multiple_term_doc_pos_enum.rb +0 -83
  269. data/test/unit/index/rtc_segment_infos.rb +0 -74
  270. data/test/unit/index/rtc_segment_term_docs.rb +0 -17
  271. data/test/unit/index/rtc_segment_term_enum.rb +0 -60
  272. data/test/unit/index/rtc_segment_term_vector.rb +0 -71
  273. data/test/unit/index/rtc_term_buffer.rb +0 -57
  274. data/test/unit/index/rtc_term_info.rb +0 -19
  275. data/test/unit/index/rtc_term_infos_io.rb +0 -192
  276. data/test/unit/index/rtc_term_vectors_io.rb +0 -108
  277. data/test/unit/index/tc_term.rb +0 -27
  278. data/test/unit/index/tc_term_voi.rb +0 -18
  279. data/test/unit/search/rtc_similarity.rb +0 -37
  280. data/test/unit/search/rtc_sort_field.rb +0 -14
  281. data/test/unit/search/tc_multi_searcher2.rb +0 -126
  282. data/test/unit/store/rtc_fs_store.rb +0 -62
  283. data/test/unit/store/rtc_ram_store.rb +0 -15
  284. data/test/unit/store/rtm_store.rb +0 -150
  285. data/test/unit/store/rtm_store_lock.rb +0 -2
  286. data/test/unit/ts_document.rb +0 -2
  287. data/test/unit/utils/rtc_bit_vector.rb +0 -73
  288. data/test/unit/utils/rtc_date_tools.rb +0 -50
  289. data/test/unit/utils/rtc_number_tools.rb +0 -59
  290. data/test/unit/utils/rtc_parameter.rb +0 -40
  291. data/test/unit/utils/rtc_priority_queue.rb +0 -62
  292. data/test/unit/utils/rtc_string_helper.rb +0 -21
  293. data/test/unit/utils/rtc_thread.rb +0 -61
  294. data/test/unit/utils/rtc_weak_key_hash.rb +0 -25
  295. data/test/utils/number_to_spoken.rb +0 -132
data/ext/store.h CHANGED
@@ -1,153 +1,733 @@
1
- #include "global.h"
2
- #include "hash.h"
3
-
4
1
  #ifndef FRT_STORE_H
5
2
  #define FRT_STORE_H
6
3
 
4
+ #include <sys/types.h>
5
+ #include "global.h"
6
+ #include "hash.h"
7
+ #include "threading.h"
8
+
7
9
  #define BUFFER_SIZE 1024
8
10
  #define LOCK_PREFIX "ferret-"
11
+ #define LOCK_EXT ".lck"
9
12
 
10
13
  #define VINT_MAX_LEN 10
11
14
  #define VINT_END BUFFER_SIZE - VINT_MAX_LEN
12
15
 
13
- typedef struct Buffer {
14
- uchar buf[BUFFER_SIZE];
15
- int start;
16
- int pos;
17
- int len;
16
+ typedef struct Buffer
17
+ {
18
+ uchar buf[BUFFER_SIZE];
19
+ off_t start;
20
+ off_t pos;
21
+ off_t len;
18
22
  } Buffer;
19
23
 
20
- typedef struct OutStream {
21
- Buffer buf;
22
- void *file;
23
- int pointer; /* only used by RAMOut */
24
- void (*flush_internal)(struct OutStream *os, uchar *buf, int len);
25
- void (*seek_internal)(struct OutStream *os, int pos);
26
- void (*close_internal)(struct OutStream *os);
27
- } OutStream;
24
+ typedef struct OutStream OutStream;
25
+ struct OutStreamMethods {
26
+ /* internal functions for the InStream */
27
+ /**
28
+ * Flush +len+ characters from +src+ to the output stream +os+
29
+ *
30
+ * @param os self
31
+ * @param src the characters to write to the output stream
32
+ * @param len the number of characters to write
33
+ * @raise IO_ERROR if there is an error writing the characters
34
+ */
35
+ void (*flush_i)(struct OutStream *os, uchar *buf, int len);
36
+
37
+ /**
38
+ * Seek +pos+ in the output stream
39
+ *
40
+ * @param os self
41
+ * @param pos the position to seek in the stream
42
+ * @raise IO_ERROR if there is an error seeking in the output stream
43
+ */
44
+ void (*seek_i)(struct OutStream *os, off_t pos);
45
+
46
+ /**
47
+ * Close any resources used by the output stream +os+
48
+ *
49
+ * @param os self
50
+ * @raise IO_ERROR if there is an closing the file
51
+ */
52
+ void (*close_i)(struct OutStream *os);
53
+ };
54
+
55
+ typedef struct RAMFile
56
+ {
57
+ char *name;
58
+ uchar **buffers;
59
+ int bufcnt;
60
+ off_t len;
61
+ int ref_cnt;
62
+ } RAMFile;
63
+
64
+ struct OutStream
65
+ {
66
+ Buffer buf;
67
+ union
68
+ {
69
+ int fd;
70
+ RAMFile *rf;
71
+ } file;
72
+ off_t pointer; /* only used by RAMOut */
73
+ const struct OutStreamMethods *m;
74
+ };
28
75
 
29
76
  typedef struct CompoundInStream CompoundInStream;
30
77
 
31
- typedef struct InStream {
32
- int is_clone;
33
- Buffer buf;
34
- void *file;
35
- union {
36
- int pointer; /* only used by RAMIn */
37
- char *path; /* only used by FSIn */
38
- CompoundInStream *cis;
39
- } d;
40
- void (*read_internal)(struct InStream *is, uchar *buf, int offset, int len);
41
- void (*seek_internal)(struct InStream *is, int pos);
42
- void (*close_internal)(struct InStream *is);
43
- void (*clone_internal)(struct InStream *is, struct InStream *new_index_i);
44
- int (*length_internal)(struct InStream *is);
45
- } InStream;
46
-
47
- struct CompoundInStream {
48
- InStream *sub;
49
- int offset;
50
- int length;
78
+ typedef struct InStream InStream;
79
+
80
+ struct InStreamMethods
81
+ {
82
+ /**
83
+ * Read +len+ characters from the input stream into the +offset+ position in
84
+ * +buf+, an array of unsigned characters.
85
+ *
86
+ * @param is self
87
+ * @param buf an array of characters which must be allocated with at least
88
+ * +offset+ + +len+ bytes
89
+ * @param len the number of bytes to read
90
+ * @raise IO_ERROR if there is an error reading from the input stream
91
+ */
92
+ void (*read_i)(struct InStream *is, uchar *buf, int len);
93
+
94
+ /**
95
+ * Seek position +pos+ in input stream +is+
96
+ *
97
+ * @param is self
98
+ * @param pos the position to seek
99
+ * @raise IO_ERROR if the seek fails
100
+ */
101
+ void (*seek_i)(struct InStream *is, off_t pos);
102
+
103
+ /**
104
+ * Returns the length of the input stream +is+
105
+ *
106
+ * @param is self
107
+ * @raise IO_ERROR if there is an error getting the file length
108
+ */
109
+ off_t (*length_i)(struct InStream *is);
110
+
111
+ /**
112
+ * Close the resources allocated to the inputstream +is+
113
+ *
114
+ * @param is self
115
+ * @raise IO_ERROR if the close fails
116
+ */
117
+ void (*close_i)(struct InStream *is);
118
+ };
119
+
120
+ struct InStream
121
+ {
122
+ Buffer buf;
123
+ union
124
+ {
125
+ int fd;
126
+ RAMFile *rf;
127
+ } file;
128
+ union
129
+ {
130
+ off_t pointer; /* only used by RAMIn */
131
+ char *path; /* only used by FSIn */
132
+ CompoundInStream *cis;
133
+ } d;
134
+ int *ref_cnt_ptr;
135
+ const struct InStreamMethods *m;
136
+ };
137
+
138
+ struct CompoundInStream
139
+ {
140
+ InStream *sub;
141
+ off_t offset;
142
+ off_t length;
51
143
  };
52
144
 
53
- #define is_length(mis) mis->length_internal(mis)
145
+ #define is_length(mis) mis->m->length_i(mis)
54
146
 
55
147
  typedef struct Store Store;
56
148
  typedef struct Lock Lock;
57
- struct Lock {
58
- char *name;
59
- Store *store;
60
- int (*obtain)(Lock *lock);
61
- int (*is_locked)(Lock *lock);
62
- void (*release)(Lock *lock);
149
+ struct Lock
150
+ {
151
+ char *name;
152
+ Store *store;
153
+ int (*obtain)(Lock *lock);
154
+ int (*is_locked)(Lock *lock);
155
+ void (*release)(Lock *lock);
63
156
  };
64
157
 
65
- typedef struct CompoundStore {
66
- Store *store;
67
- const char *name;
68
- HshTable *entries;
69
- InStream *stream;
158
+ typedef struct CompoundStore
159
+ {
160
+ Store *store;
161
+ const char *name;
162
+ HashTable *entries;
163
+ InStream *stream;
70
164
  } CompoundStore;
71
165
 
72
- struct Store {
73
- int ref_cnt; /* for fs_store only */
74
- mutex_t mutex;
75
- mutex_t ext_mutex;
76
- union {
77
- char *path; /* for fs_store only */
78
- HshTable *ht; /* for ram_store only */
79
- CompoundStore *cmpd; /* for compound_store only */
80
- } dir;
81
- void (*touch)(Store *store, char *filename);
82
- int (*exists)(Store *store, char *filename);
83
- int (*remove)(Store *store, char *filename);
84
- int (*rename)(Store *store, char *from, char *to);
85
- int (*count)(Store *store);
86
- void (*clear)(Store *store);
87
- void (*clear_all)(Store *store);
88
- void (*clear_locks)(Store *store);
89
- int (*length)(Store *store, char *filename);
90
- void (*each)(Store *store, void (*func)(char *fname, void *arg), void *arg);
91
- OutStream *(*create_output)(Store *store, const char *filename);
92
- InStream *(*open_input)(Store *store, const char *filename);
93
- Lock *(*open_lock)(Store *store, char *lockname);
94
- void (*close_lock)(Lock *lock);
95
- void (*close_i)(Store *store);
166
+ struct Store
167
+ {
168
+ int ref_cnt; /* for fs_store only */
169
+ mutex_t mutex_i; /* for internal use only */
170
+ mutex_t mutex; /* external mutex for use outside */
171
+ union
172
+ {
173
+ char *path; /* for fs_store only */
174
+ HashTable *ht; /* for ram_store only */
175
+ CompoundStore *cmpd; /* for compound_store only */
176
+ } dir;
177
+
178
+ /**
179
+ * Create the file +filename+ in the +store+.
180
+ *
181
+ * @param store self
182
+ * @param filename the name of the file to create
183
+ * @raise IO_ERROR if the file cannot be created
184
+ */
185
+ void (*touch)(Store *store, char *filename);
186
+
187
+ /**
188
+ * Return true if a file of name +filename+ exists in +store+.
189
+ *
190
+ * @param store self
191
+ * @param filename the name of the file to check for
192
+ * @returns true if the file exists
193
+ * @raise IO_ERROR if there is an error checking for the files existance
194
+ */
195
+ int (*exists)(Store *store, char *filename);
196
+
197
+ /**
198
+ * Remove the file +filename+ from the +store+
199
+ *
200
+ * @param store self
201
+ * @param filename the name of the file to remove
202
+ * @returns On success, zero is returned. On error, -1 is returned, and errno
203
+ * is set appropriately.
204
+ */
205
+ int (*remove)(Store *store, char *filename);
206
+
207
+ /**
208
+ * Rename the file in the +store+ from the name +from+ to the name +to+.
209
+ *
210
+ * @param store self
211
+ * @param from the name of the file to rename
212
+ * @param to the new name of the file
213
+ * @raise IO_ERROR if there is an error renaming the file
214
+ */
215
+ void (*rename)(Store *store, char *from, char *to);
216
+
217
+ /**
218
+ * Returns the number of files in the store.
219
+ *
220
+ * @param store self
221
+ * @return the number of files in the store
222
+ * @raise IO_ERROR if there is an error opening the directory
223
+ */
224
+ int (*count)(Store *store);
225
+
226
+ /**
227
+ * Call the function +func+ with each filename in the store and the arg
228
+ * that you passed. If you need to open the file you should pass the store
229
+ * as the argument. If you need to pass more than one argument, you should
230
+ * pass a struct.
231
+ *
232
+ * @param store self
233
+ * @param func the function to call with each files name and the +arg+
234
+ * passed
235
+ * @param arg the argument to pass to the function
236
+ * @raise IO_ERROR if there is an error opening the directory
237
+ */
238
+ void (*each)(Store *store, void (*func)(char *fname, void *arg),
239
+ void *arg);
240
+
241
+ /**
242
+ * Clear all the locks in the store.
243
+ *
244
+ * @param store self
245
+ * @raise IO_ERROR if there is an error opening the directory
246
+ */
247
+ void (*clear_locks)(Store *store);
248
+
249
+ /**
250
+ * Clear all files from the store except the lock files.
251
+ *
252
+ * @param store self
253
+ * @raise IO_ERROR if there is an error deleting the files
254
+ */
255
+ void (*clear)(Store *store);
256
+
257
+ /**
258
+ * Clear all files from the store including the lock files.
259
+ *
260
+ * @param store self
261
+ * @raise IO_ERROR if there is an error deleting the files
262
+ */
263
+ void (*clear_all)(Store *store);
264
+
265
+ /**
266
+ * Return the length of the file +filename+ in +store+
267
+ *
268
+ * @param store self
269
+ * @param the name of the file to check the length of
270
+ * @return the length of the file in bytes
271
+ * @raise IO_ERROR if there is an error checking the file length
272
+ */
273
+ off_t (*length)(Store *store, char *filename);
274
+
275
+ /**
276
+ * Allocate the resources needed for the output stream in the +store+ with
277
+ * the name +filename+
278
+ *
279
+ * @param store self
280
+ * @param filename the name of the output stream
281
+ * @return a newly allocated filestream
282
+ * @raise IO_ERROR if there is an error opening the output stream
283
+ * resources
284
+ */
285
+ OutStream *(*new_output)(Store *store, const char *filename);
286
+
287
+ /**
288
+ * Open an input stream in the +store+ with the name +filename+
289
+ *
290
+ * @param store self
291
+ * @param filename the name of the input stream
292
+ * @raise IO_ERROR if the input stream cannot be opened
293
+ */
294
+ InStream *(*open_input)(Store *store, const char *filename);
295
+
296
+ /**
297
+ * Obtain a lock on the lock +lock+
298
+ *
299
+ * @param store self
300
+ * @param lock the lock to obtain
301
+ */
302
+ Lock *(*open_lock)(Store *store, char *lockname);
303
+
304
+ /**
305
+ * Returns true if +lock+ is locked. To test if the file is locked:wq
306
+ *
307
+ * @param lock the lock to test
308
+ * @raise IO_ERROR if there is an error detecting the lock status
309
+ */
310
+ void (*close_lock)(Lock *lock);
311
+
312
+ /**
313
+ * Internal function to close the store freeing implementation specific
314
+ * resources.
315
+ *
316
+ * @param store self
317
+ */
318
+ void (*close_i)(Store *store);
96
319
  };
97
320
 
98
- void store_deref(Store *store);
99
- Store *store_create();
100
- char *store_to_s(Store *store);
101
- Store *open_fs_store(const char *pathname);
102
- Store *open_ram_store();
103
- Store *open_ram_store_and_copy(Store *store, bool close_dir);
104
- Store *open_cmpd_store(Store *sub, const char *filename);
105
- void ram_close(Store *store);
106
- Buffer *buf_create();
107
- void os_flush(OutStream *os);
108
- void os_close(OutStream *os);
109
- int os_pos(OutStream *os);
110
- void os_seek(OutStream *os, int new_pos);
111
- void os_write_byte(OutStream *os, uchar b);
112
- void os_write_bytes(OutStream *os, uchar *b, int len);
113
- uchar is_read_byte(InStream *is);
114
- int is_pos(InStream *is);
115
- uchar *is_read_bytes(InStream *is, uchar *b, int offset, int len);
116
- void is_seek(InStream *is, int pos);
117
- InStream *is_clone(InStream *is);
118
- void is_close(InStream *is);
119
- int is_read_int(InStream *is);
120
- llong is_read_long(InStream *is);
121
- unsigned int is_read_uint(InStream *is);
122
- ullong is_read_ulong(InStream *is);
123
- ullong is_read_vint(InStream *is);
124
- void is_skip_vints(InStream *is, register int cnt);
125
- void is_read_chars(InStream *is, char* buffer, int off, int len) ;
126
- char *is_read_string(InStream *is);
127
- void os_write_int(OutStream *os, int l);
128
- void os_write_long(OutStream *os, llong l);
129
- void os_write_uint(OutStream *os, unsigned int l);
130
- void os_write_ulong(OutStream *os, ullong l);
131
- void os_write_vint(OutStream *os, register ullong i);
132
- void os_write_chars(OutStream *os, char *buf, int start, int length);
133
- void os_write_string(OutStream *os, char *str);
134
- void os_copy_bytes(OutStream *os, InStream *is, int len);
135
- OutStream *os_create();
136
- InStream *is_create();
137
- void buf_destroy(Buffer *buf);
138
-
139
- /* RamStore functions */
140
- int ramo_length(OutStream *os);
141
- void ramo_reset(OutStream *os);
142
- int rami_length(InStream *is);
143
- void ramo_write_to(OutStream *os, OutStream *other_o);
144
- OutStream *ram_create_buffer();
145
- void ram_destroy_buffer(OutStream *os);
146
-
147
- int file_is_lock(char *filename);
148
-
149
- void with_lock(Lock *lock, void (*func)(void *arg), void *arg);
150
- void with_lock_name(Store *store, char *lock_name,
151
- void (*func)(void *arg), void *arg);
321
+ /**
322
+ * Create a newly allocated file-system Store at the pathname designated. The
323
+ * pathname must be the name of an existing directory.
324
+ *
325
+ * @param pathname the pathname of the directory to be used by the index
326
+ * @return a newly allocated file-system Store.
327
+ */
328
+ extern Store *open_fs_store(const char *pathname);
329
+
330
+ /**
331
+ * Create a newly allocated in-memory or RAM Store.
332
+ *
333
+ * @return a newly allocated RAM Store.
334
+ */
335
+ extern Store *open_ram_store();
336
+
337
+ /**
338
+ * Create a newly allocated in-memory or RAM Store. Copy the contents of
339
+ * another store into this store. Then close the other store if required. This
340
+ * method would be used for example to read an index into memory for faster
341
+ * searching.
342
+ *
343
+ * @param store the whose contents will be copied into the newly allocated RAM
344
+ * store
345
+ * @param close_store close the store whose contents where copied
346
+ * @return a newly allocated RAM Store.
347
+ */
348
+ extern Store *open_ram_store_and_copy(Store *store, bool close_store);
349
+
350
+ /**
351
+ * Open a compound store. This is basically store which is stored within a
352
+ * single file and can in turn be stored within either a FileSystem or RAM
353
+ * store.
354
+ *
355
+ * @param store the store within which this compound store will be stored
356
+ * @param filename the name of the file in which to store the compound store
357
+ * @return a newly allocated Compound Store.
358
+ */
359
+ extern Store *open_cmpd_store(Store *store, const char *filename);
360
+
361
+ /*
362
+ * == RamStore functions ==
363
+ *
364
+ * These functions or optimizations to be used when you know you are using a
365
+ * Ram OutStream.
366
+ */
367
+
368
+ /**
369
+ * Return the length of the OutStream in bytes.
370
+ *
371
+ * @param os the OutStream who's length you want
372
+ * @return the length of +os+ in bytes
373
+ */
374
+ extern off_t ramo_length(OutStream *os);
375
+
376
+ /**
377
+ * Reset the OutStream removing any data written to it. Since it is a RAM
378
+ * file, all that needs to be done is set the length to 0.
379
+ *
380
+ * @param os the OutStream to reset
381
+ */
382
+ extern void ramo_reset(OutStream *os);
383
+
384
+ /**
385
+ * Write the contents of a RAM OutStream to another OutStream.
386
+ *
387
+ * @param from_os the OutStream to write from
388
+ * @param to_os the OutStream to write to
389
+ */
390
+ extern void ramo_write_to(OutStream *from_os, OutStream *to_os);
391
+
392
+ /**
393
+ * Create a buffer RAM OutStream which is unassociated with any RAM Store.
394
+ * This OutStream can be used to write temporary data too. When the time
395
+ * comes, this data can be written to another OutStream (which might possibly
396
+ * be a file-system OutStream) using ramo_write_to.
397
+ *
398
+ * @return A newly allocated RAM OutStream
399
+ */
400
+ extern OutStream *ram_new_buffer();
401
+
402
+ /**
403
+ * Destroy a RAM OutStream which is unassociated with any RAM Store, freeing
404
+ * all resources allocated to it.
405
+ *
406
+ * @param os the OutStream to destroy
407
+ */
408
+ extern void ram_destroy_buffer(OutStream *os);
409
+
410
+ /**
411
+ * Call the function +func+ with the +lock+ locked. The argument +arg+ will be
412
+ * passed to +func+. If you need to pass more than one argument you should use
413
+ * a struct. When the function is finished, release the lock.
414
+ *
415
+ * @param lock lock to be locked while func is called
416
+ * @param func function to call with the lock locked
417
+ * @param arg argument to pass to the function
418
+ * @raise IO_ERROR if the lock is already locked
419
+ * @see with_lock_name
420
+ */
421
+ extern void with_lock(Lock *lock, void (*func)(void *arg), void *arg);
422
+
423
+ /**
424
+ * Create a lock in the +store+ with the name +lock_name+. Call the function
425
+ * +func+ with the lock locked. The argument +arg+ will be passed to +func+.
426
+ * If you need to pass more than one argument you should use a struct. When
427
+ * the function is finished, release and destroy the lock.
428
+ *
429
+ * @param store store to open the lock in
430
+ * @param lock_name name of the lock to open
431
+ * @param func function to call with the lock locked
432
+ * @param arg argument to pass to the function
433
+ * @raise IO_ERROR if the lock is already locked
434
+ * @see with_lock
435
+ */
436
+ extern void with_lock_name(Store *store, char *lock_name,
437
+ void (*func)(void *arg), void *arg);
438
+
439
+ /**
440
+ * Remove a reference to the store. If the reference count gets to zero free
441
+ * all resources used by the store.
442
+ *
443
+ * @param store the store to be dereferenced
444
+ */
445
+ extern void store_deref(Store *store);
446
+
447
+ /**
448
+ * Flush the buffered contents of the OutStream to the store.
449
+ *
450
+ * @param os the OutStream to flush
451
+ */
452
+ extern void os_flush(OutStream *os);
453
+
454
+ /**
455
+ * Close the OutStream after flushing the buffers, also freeing all allocated
456
+ * resources.
457
+ *
458
+ * @param os the OutStream to close
459
+ */
460
+ extern void os_close(OutStream *os);
461
+
462
+ /**
463
+ * Return the current position of OutStream +os+.
464
+ *
465
+ * @param os the OutStream to get the position from
466
+ * @return the current position in OutStream +os+
467
+ */
468
+ extern off_t os_pos(OutStream *os);
469
+
470
+ /**
471
+ * Set the current position in OutStream +os+.
472
+ *
473
+ * @param os the OutStream to set the position in
474
+ * @param pos the new position in the OutStream
475
+ * @raise IO_ERROR if there is a file-system IO error seeking the file
476
+ */
477
+ extern void os_seek(OutStream *os, off_t new_pos);
478
+
479
+ /**
480
+ * Write a single byte +b+ to the OutStream +os+
481
+ *
482
+ * @param os the OutStream to write to @param b the byte to write @raise
483
+ * IO_ERROR if there is an IO error writing to the file-system
484
+ */
485
+ extern void os_write_byte(OutStream *os, uchar b);
486
+ /**
487
+ * Write +len+ bytes from buffer +buf+ to the OutStream +os+.
488
+ *
489
+ * @param os the OutStream to write to
490
+ * @param len the number of bytes to write
491
+ * @param buf the buffer from which to get the bytes to write.
492
+ * @raise IO_ERROR if there is an IO error writing to the file-system
493
+ */
494
+ extern void os_write_bytes(OutStream *os, uchar *buf, int len);
495
+
496
+ /**
497
+ * Write a 32-bit signed integer to the OutStream
498
+ *
499
+ * @param os OutStream to write to
500
+ * @param num the 32-bit signed integer to write
501
+ * @raise IO_ERROR if there is an error writing to the file-system
502
+ */
503
+ extern void os_write_i32(OutStream *os, f_i32 num);
504
+
505
+ /**
506
+ * Write a 64-bit signed integer to the OutStream
507
+ *
508
+ *
509
+ * @param os OutStream to write to
510
+ * @param num the 64-bit signed integer to write
511
+ * @raise IO_ERROR if there is an error writing to the file-system
512
+ */
513
+ extern void os_write_i64(OutStream *os, f_i64 num);
514
+
515
+ /**
516
+ * Write a 32-bit unsigned integer to the OutStream
517
+ *
518
+ * @param os OutStream to write to
519
+ * @param num the 32-bit unsigned integer to write
520
+ * @raise IO_ERROR if there is an error writing to the file-system
521
+ */
522
+ extern void os_write_u32(OutStream *os, f_u32 num);
523
+
524
+ /**
525
+ * Write a 64-bit unsigned integer to the OutStream
526
+ *
527
+ * @param os OutStream to write to
528
+ * @param num the 64-bit unsigned integer to write
529
+ * @raise IO_ERROR if there is an error writing to the file-system
530
+ */
531
+ extern void os_write_u64(OutStream *os, f_u64 num);
532
+
533
+ /**
534
+ * Write an unsigned integer to OutStream in compressed VINT format.
535
+ * TODO: describe VINT format
536
+ *
537
+ * @param os OutStream to write to
538
+ * @param num the integer to write
539
+ * @raise IO_ERROR if there is an error writing to the file-system
540
+ */
541
+ extern void os_write_vint(OutStream *os, register unsigned int num);
542
+
543
+ /**
544
+ * Write an unsigned off_t to OutStream in compressed VINT format.
545
+ * TODO: describe VINT format
546
+ *
547
+ * @param os OutStream to write to
548
+ * @param num the off_t to write
549
+ * @raise IO_ERROR if there is an error writing to the file-system
550
+ */
551
+ extern void os_write_voff_t(OutStream *os, register off_t num);
552
+
553
+ /**
554
+ * Write a string to the OutStream. A string is an integer +length+ in VINT
555
+ * format (see os_write_vint) followed by +length+ bytes. The string can then
556
+ * be read using is_read_string.
557
+ *
558
+ * @param os OutStream to write to
559
+ * @param str the string to write
560
+ * @raise IO_ERROR if there is an error writing to the file-system
561
+ */
562
+ extern void os_write_string(OutStream *os, char *str);
563
+ /**
564
+ * Get the current position within an InStream.
565
+ *
566
+ * @param is the InStream to get the current position from
567
+ * @return the current position within the InStream +is+
568
+ */
569
+ extern off_t is_pos(InStream *is);
570
+
571
+ /**
572
+ * Set the current position in InStream +is+ to +pos+.
573
+ *
574
+ * @param is the InStream to set the current position in
575
+ * @param pos the position in InStream to seek
576
+ * @raise IO_ERROR if there is a error seeking from the file-system
577
+ * @raise EOF_ERROR if there is an attempt to seek past the end of the file
578
+ */
579
+ extern void is_seek(InStream *is, off_t pos);
580
+
581
+ /**
582
+ * Close the InStream freeing all allocated resources.
583
+ *
584
+ * @param is the InStream to close
585
+ * @raise IO_ERROR if there is an error closing the associated file
586
+ */
587
+ extern void is_close(InStream *is);
588
+
589
+ /**
590
+ * Clone the InStream allocating a new InStream structure
591
+ *
592
+ * @param is the InStream to clone
593
+ * @return a newly allocated InStream which is a clone of +is+
594
+ */
595
+ extern InStream *is_clone(InStream *is);
596
+
597
+ /**
598
+ * Read a singly byte (unsigned char) from the InStream +is+.
599
+ *
600
+ * @param is the Instream to read from
601
+ * @return a single unsigned char read from the InStream +is+
602
+ * @raise IO_ERROR if there is a error reading from the file-system
603
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
604
+ */
605
+ extern inline uchar is_read_byte(InStream *is);
606
+
607
+ /**
608
+ * Read +len+ bytes from InStream +is+ and write them to buffer +buf+
609
+ *
610
+ * @param is the InStream to read from
611
+ * @param buf the buffer to read into, that is copy the bytes read to
612
+ * @param len the number of bytes to read
613
+ * @return the resultant buffer +buf+
614
+ * @raise IO_ERROR if there is a error reading from the file-system
615
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
616
+ */
617
+ extern uchar *is_read_bytes(InStream *is, uchar *buf, int len);
618
+
619
+ /**
620
+ * Read a 32-bit unsigned integer from the InStream.
621
+ *
622
+ * @param is the InStream to read from
623
+ * @return a 32-bit unsigned integer
624
+ * @raise IO_ERROR if there is a error reading from the file-system
625
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
626
+ */
627
+ extern f_i32 is_read_i32(InStream *is);
628
+
629
+ /**
630
+ * Read a 64-bit unsigned integer from the InStream.
631
+ *
632
+ * @param is the InStream to read from
633
+ * @return a 64-bit unsigned integer
634
+ * @raise IO_ERROR if there is a error reading from the file-system
635
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
636
+ */
637
+ extern f_i64 is_read_i64(InStream *is);
638
+
639
+ /**
640
+ * Read a 32-bit signed integer from the InStream.
641
+ *
642
+ * @param is the InStream to read from
643
+ * @return a 32-bit signed integer
644
+ * @raise IO_ERROR if there is a error reading from the file-system
645
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
646
+ */
647
+ extern f_u32 is_read_u32(InStream *is);
648
+
649
+ /**
650
+ * Read a 64-bit signed integer from the InStream.
651
+ *
652
+ * @param is the InStream to read from
653
+ * @return a 64-bit signed integer
654
+ * @raise IO_ERROR if there is a error reading from the file-system
655
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
656
+ */
657
+ extern f_u64 is_read_u64(InStream *is);
658
+
659
+ /**
660
+ * Read a compressed (VINT) unsigned integer from the InStream.
661
+ * TODO: describe VINT format
662
+ *
663
+ * @param is the InStream to read from
664
+ * @return an int
665
+ * @raise IO_ERROR if there is a error reading from the file-system
666
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
667
+ */
668
+ extern inline unsigned int is_read_vint(InStream *is);
669
+
670
+ /**
671
+ * Skip _cnt_ vints. This is a convenience method used for performance reasons
672
+ * to skip large numbers of vints. It is mostly used by TermDocEnums. When
673
+ * skipping positions os the proximity index file.
674
+ *
675
+ * @param is the InStream to read from
676
+ * @param cnt the number of vints to skip
677
+ * @raise IO_ERROR if there is a error reading from the file-system
678
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
679
+ */
680
+ extern inline void is_skip_vints(InStream *is, register int cnt);
681
+
682
+ /**
683
+ * Read a compressed (VINT) unsigned off_t from the InStream.
684
+ * TODO: describe VINT format
685
+ *
686
+ * @param is the InStream to read from
687
+ * @return a off_t
688
+ * @raise IO_ERROR if there is a error reading from the file-system
689
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
690
+ */
691
+ extern inline off_t is_read_voff_t(InStream *is);
692
+
693
+ /**
694
+ * Read a string from the InStream. A string is an integer +length+ in vint
695
+ * format (see is_read_vint) followed by +length+ bytes. This is the format
696
+ * used by os_write_string.
697
+ *
698
+ * @param is the InStream to read from
699
+ * @return a null byte delimited string
700
+ * @raise IO_ERROR if there is a error reading from the file-system
701
+ * @raise EOF_ERROR if there is an attempt to read past the end of the file
702
+ */
703
+ extern char *is_read_string(InStream *is);
704
+
705
+ /**
706
+ * Copy cnt bytes from Instream _is_ to OutStream _os_.
707
+ *
708
+ * @param is the InStream to read from
709
+ * @param os the OutStream to write to
710
+ * @raise IO_ERROR
711
+ * @raise EOF_ERROR
712
+ */
713
+ extern void is2os_copy_bytes(InStream *is, OutStream *os, int cnt);
714
+
715
+ /**
716
+ * Copy cnt vints from Instream _is_ to OutStream _os_.
717
+ *
718
+ * @param is the InStream to read from
719
+ * @param os the OutStream to write to
720
+ * @raise IO_ERROR
721
+ * @raise EOF_ERROR
722
+ */
723
+ extern void is2os_copy_vints(InStream *is, OutStream *os, int cnt);
152
724
 
725
+ /**
726
+ * Print the filenames in a store to a buffer.
727
+ *
728
+ * @param store the store to get the filenames from
729
+ * @param buf the buffer to print the filenames to
730
+ * @paran len the length of the buffer
731
+ */
732
+ extern char *store_to_s(Store *store, char *buf, int buf_size);
153
733
  #endif