summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ft_global.h35
-rw-r--r--include/my_base.h1
-rw-r--r--include/my_global.h3
3 files changed, 21 insertions, 18 deletions
diff --git a/include/ft_global.h b/include/ft_global.h
index 415c0884989..8588684907d 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -29,17 +29,21 @@ extern "C" {
#define FT_QUERY_MAXLEN 1024
#define HA_FT_MAXLEN 254
-typedef struct ft_doc_rec {
- my_off_t dpos;
- double weight;
-} FT_DOC;
-
-typedef struct st_ft_doclist {
- int ndocs;
- int curdoc;
- void *info; /* actually (MI_INFO *) but don't want to include myisam.h */
- FT_DOC doc[1];
-} FT_DOCLIST;
+typedef struct st_ft_info FT_INFO;
+struct _ft_vft {
+ int (*read_next)(FT_INFO *, char *);
+ float (*find_relevance)(FT_INFO *, my_off_t);
+ void (*close_search)(FT_INFO *);
+ float (*get_relevance)(FT_INFO *);
+ my_off_t (*get_docid)(FT_INFO *);
+ void (*reinit_search)(FT_INFO *);
+};
+
+#ifndef FT_CORE
+struct st_ft_info {
+ struct _ft_vft *please; /* INTERCAL style :-) */
+};
+#endif
extern const char *ft_precompiled_stopwords[];
@@ -50,12 +54,9 @@ extern uint ft_max_word_len_for_sort;
int ft_init_stopwords(const char **);
void ft_free_stopwords(void);
-FT_DOCLIST * ft_init_search(void *, uint, byte *, uint, my_bool);
-int ft_read_next(FT_DOCLIST *, char *);
-#define ft_close_search(handler) my_free(((gptr)(handler)),MYF(0))
-#define ft_get_relevance(handler) ((handler)->doc[(handler)->curdoc].weight)
-#define ft_get_docid(handler) ((handler)->doc[(handler)->curdoc].dpos)
-#define ft_reinit_search(handler) (((FT_DOCLIST *)(handler))->curdoc=-1)
+#define FT_NL 0
+#define FT_BOOL 1
+FT_INFO *ft_init_search(uint,void *, uint, byte *, uint, my_bool);
#ifdef __cplusplus
}
diff --git a/include/my_base.h b/include/my_base.h
index 800e623bc2c..4fdc2c33a39 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -159,6 +159,7 @@ enum ha_base_keytype {
#define HA_BLOB_PART 32
#define HA_SWAP_KEY 64
#define HA_REVERSE_SORT 128 /* Sort key in reverse order */
+#define HA_NO_SORT 256 /* do not bother sorting on this keyseg */
/* optionbits for database */
#define HA_OPTION_PACK_RECORD 1
diff --git a/include/my_global.h b/include/my_global.h
index 09956254ac4..6f33e570ba3 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -262,7 +262,7 @@ int __void__;
#define LINT_INIT(var)
#endif
-/* Define som useful general macros */
+/* Define some useful general macros */
#if defined(__cplusplus) && defined(__GNUC__)
#define max(a, b) ((a) >? (b))
#define min(a, b) ((a) <? (b))
@@ -276,6 +276,7 @@ typedef unsigned int uint;
typedef unsigned short ushort;
#endif
+#define CMP(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; }
#define test(a) ((a) ? 1 : 0)