aboutsummaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorJun Kuriyama <kuriyama@FreeBSD.org>2009-05-01 07:52:27 +0000
committerJun Kuriyama <kuriyama@FreeBSD.org>2009-05-01 07:52:27 +0000
commitddb9a7228a6280d1ecd9e14395aca8ccd60a8e62 (patch)
treeebc6bc46bc7eaa538f07c8b94f263e46c8ec711e /textproc
parent5e19332884328bcc7d6db8a1b81d292c08e5e70d (diff)
downloadports-ddb9a7228a6280d1ecd9e14395aca8ccd60a8e62.tar.gz
ports-ddb9a7228a6280d1ecd9e14395aca8ccd60a8e62.zip
Notes
Diffstat (limited to 'textproc')
-rw-r--r--textproc/p5-Senna/Makefile1
-rw-r--r--textproc/p5-Senna/files/patch-Senna.xs168
2 files changed, 168 insertions, 1 deletions
diff --git a/textproc/p5-Senna/Makefile b/textproc/p5-Senna/Makefile
index 5ae4a9a5146e..a215551edd7c 100644
--- a/textproc/p5-Senna/Makefile
+++ b/textproc/p5-Senna/Makefile
@@ -18,7 +18,6 @@ COMMENT= Perl module for Embeddable Fulltext Search Engine
BUILD_DEPENDS= senna-cfg:${PORTSDIR}/textproc/senna
RUN_DEPENDS= ${BUILD_DEPENDS}
-BROKEN= This version does not support latest libsenna interface.
PERL_MODBUILD= YES
CONFIGURE_ARGS+=</dev/null
CFLAGS+= -I${LOCALBASE}/include
diff --git a/textproc/p5-Senna/files/patch-Senna.xs b/textproc/p5-Senna/files/patch-Senna.xs
new file mode 100644
index 000000000000..5f488dc57281
--- /dev/null
+++ b/textproc/p5-Senna/files/patch-Senna.xs
@@ -0,0 +1,168 @@
+--- lib/Senna.xs.orig 2007-03-17 01:45:57.000000000 +0900
++++ lib/Senna.xs 2009-04-29 23:58:36.000000000 +0900
+@@ -24,6 +24,108 @@
+ #define SEN_SYM_MAX_KEY_LENGTH 0xffff
+ #endif
+
++typedef uint8_t byte;
++
++#ifndef SEN_SYM_MAX_SEGMENT
++#define SEN_SYM_MAX_SEGMENT 0x400
++#endif
++
++typedef enum {
++ sen_io_auto,
++ sen_io_manual
++} sen_io_mode;
++
++typedef struct {
++ void *map;
++ uint32_t nref;
++ uint32_t count;
++#if defined(WIN32) && defined(WIN32_FMO_EACH)
++ HANDLE fmo;
++#endif /* defined(WIN32) && defined(WIN32_FMO_EACH) */
++} sen_io_mapinfo;
++
++typedef struct _sen_io sen_io;
++
++struct _sen_io {
++ char path[PATH_MAX];
++ struct _sen_io_header *header;
++ byte *user_header;
++ sen_io_mapinfo *maps;
++ uint32_t *nrefs;
++ uint32_t base;
++ uint32_t base_seg;
++ sen_io_mode mode;
++ uint32_t cache_size;
++ struct _sen_io_fileinfo *fis;
++ uint32_t nmaps;
++ uint32_t count;
++ uint8_t flags;
++};
++
++struct _sen_sym {
++ uint8_t v08p;
++ sen_io *io;
++ struct sen_sym_header *header;
++ uint32_t flags;
++ sen_encoding encoding;
++ uint32_t key_size;
++ uint32_t nref;
++ uint32_t *lock;
++ void *keyaddrs[SEN_SYM_MAX_SEGMENT];
++ void *pataddrs[SEN_SYM_MAX_SEGMENT];
++ void *sisaddrs[SEN_SYM_MAX_SEGMENT];
++};
++
++#define SEN_SET_MAX_CHUNK 22
++
++typedef pthread_mutex_t sen_mutex;
++
++typedef struct _sen_array sen_array;
++// #define SEN_ARRAY_W 2
++#define SEN_ARRAY_W 0
++#define SEN_ARRAY_R(i) (1<<((i)<<SEN_ARRAY_W))
++#define SEN_ARRAY_S (SEN_ARRAY_R(1)-1)
++#define SEN_ARRAY_N (32>>SEN_ARRAY_W)
++
++struct _sen_array {
++ sen_ctx *ctx;
++ sen_id max;
++ uint16_t element_size;
++ uint16_t flags;
++ sen_mutex lock;
++ void *elements[SEN_ARRAY_N];
++};
++
++struct _sen_set {
++ uint32_t key_size;
++ uint32_t value_size;
++ uint32_t entry_size;
++ uint32_t max_offset;
++ int32_t n_entries;
++ uint32_t n_garbages;
++ // uint32_t curr_entry;
++ // uint32_t curr_chunk;
++ unsigned int max_n_subrecs;
++ unsigned int record_size;
++ unsigned int subrec_size;
++ sen_rec_unit record_unit;
++ sen_rec_unit subrec_unit;
++ uint8_t arrayp;
++ sen_set_eh garbages;
++ sen_set_eh *index;
++ sen_ctx *ctx;
++ sen_sym *keys;
++ sen_recordh *curr_rec;
++ sen_set_cursor *cursor;
++ int limit;
++ sen_recordh *sorted;
++ void *userdata;
++ sen_id subrec_id;
++ // byte *chunks[SEN_SET_MAX_CHUNK + 1];
++
++ sen_array a;
++};
++
+ /* This is defined in senna's snip.h. */
+ #ifndef MAX_SNIP_RESULT_COUNT
+ #define MAX_SNIP_RESULT_COUNT 8U
+@@ -212,6 +314,9 @@
+ }
+ }
+
++struct _sen_set;
++/* typedef struct _sen_set sen_set; */
++
+ static int
+ sen_sort_optarg_cb(sen_records *r1, const sen_recordh *a,
+ sen_records *r2, const sen_recordh *b, void *args)
+@@ -231,6 +336,11 @@
+
+ cb_args = (AV *) compar_args[1];
+
++/* sen_rc sen_sym_info(sen_sym *sym, int *key_size, unsigned *flags,
++ sen_encoding *encoding, unsigned *nrecords, unsigned *file_size); */
++/* typedef struct _sen_sym sen_sym; */
++/* typedef sen_set sen_records; */
++/* sen_set.sen_sym* keys */
+ sen_sym_info(r1->keys, &key_size, NULL, NULL, NULL, NULL);
+ if (key_size == SEN_VARCHAR_KEY) {
+ char key[SEN_MAX_KEY_SIZE];
+@@ -519,10 +629,18 @@
+ sen_rc rc;
+ PPCODE:
+ index = XS_STATE(sen_index *, self);
++/*
++sen_rc sen_index_info(sen_index *i, int *key_size, int *flags,
++ int *initial_n_segments, sen_encoding *encoding,
++ unsigned *nrecords_keys, unsigned *file_size_keys,
++ unsigned *nrecords_lexicon, unsigned *file_size_lexicon,
++ unsigned long long *inv_seg_size,
++ unsigned long long *inv_chunk_size);
++ */
+ rc = sen_index_info(index,
+ &key_size, &flags, &initial_n_segments, &encoding,
+ &nrecords_keys, &file_size_keys, &nrecords_lexicon,
+- &file_size_lexicon, &inv_seg_size, &inv_chunk_size
++ &file_size_lexicon, (unsigned long long*)&inv_seg_size, (unsigned long long*)&inv_chunk_size
+ );
+
+ if (rc != sen_success)
+@@ -910,10 +1028,12 @@
+ sen_records_rewind(r);
+ sen_record_info(r, sen_records_curr_rec(r), NULL, 0, &key_size,
+ NULL, NULL, NULL, NULL);
++/* int sen_records_find(sen_records *r, const void *key);
++ */
+ if (key_size == SEN_INT_KEY) {
+- RETVAL = sen_records_find(r, (void *) SvIV(key));
++ RETVAL = sen_records_find(r, (const void *) SvIV(key));
+ } else {
+- RETVAL = sen_records_find(r, (void *) SvPV(key, len));
++ RETVAL = sen_records_find(r, (const void *) SvPV(key, len));
+ }
+ sen_records_rewind(r);
+ OUTPUT: