Main Page | Data Structures | Directories | File List | Data Fields | Globals

lcn_terminfos.h

Go to the documentation of this file.
00001 /* Copyright 2005 The Apache Software Foundation or its licensors, as
00002  * applicable.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /**
00018  * @file lcn_terminfos.h
00019  * @brief Routines for manipulating the terminfos file from a lucene segment
00020  */
00021 
00022 #ifndef _LCN_TERMINFOS_H
00023 #define _LCN_TERMINFOS_H
00024 
00025 #include "lcn_types.h"
00026 #include "lcn_directory.h"
00027 #include "lcn_term.h"
00028 
00029 #include <apr_hash.h>
00030 #include <apr_file_io.h>
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif /* __cplusplus */
00035 
00036 /** Opaque structure representing the information about a particular term. */
00037 typedef struct lcn_terminfo_t lcn_terminfo_t;
00038 
00039 /** Opaque structure representing the contents of the terminfos index. */
00040 typedef struct lcn_terminfos_idx_t lcn_terminfos_idx_t;
00041 
00042 /** Opaque structure representing a segments terminfos file. */
00043 typedef struct lcn_terminfos_t lcn_terminfos_t;
00044 
00045 /** Return the term @a ti corresponds to. */
00046 const lcn_term_t *lcn_terminfo_term (const lcn_terminfo_t *ti);
00047 
00048 /** Return the field number @a ti corresponds to. */
00049 apr_uint32_t lcn_terminfo_field_num (const lcn_terminfo_t *ti);
00050 
00051 /** Return the document frequency for terminfo @a ti. */
00052 apr_uint32_t lcn_terminfo_doc_freq (const lcn_terminfo_t *ti);
00053 
00054 /** Return the proximity position for terminfo @a ti. */
00055 apr_uint64_t lcn_terminfo_prox_position (const lcn_terminfo_t *ti);
00056 
00057 /** Return the frequency position for terminfo @a ti. */
00058 apr_uint64_t lcn_terminfo_freq_position (const lcn_terminfo_t *ti);
00059 
00060 /** Return the skip offset for terminfo @a ti. */
00061 apr_uint32_t lcn_terminfo_skip_offset (const lcn_terminfo_t *ti);
00062 
00063 /** Return a copy of terminfo @a ti, allocated in @a pool. */
00064 lcn_terminfo_t *
00065 lcn_terminfo_copy (const lcn_terminfo_t *ti, apr_pool_t *pool);
00066 
00067 /** Read the terminfos index for @a segment in directory @a directory and
00068  * return it in @a tisidx, allocated in @a pool.
00069  */
00070 lcn_error_t *
00071 lcn_terminfos_idx_read (lcn_terminfos_idx_t **tisidx,
00072                         const lcn_directory_t *directory,
00073                         const lcn_char_t *segment,
00074                         apr_pool_t *pool);
00075 
00076 /** Return the count of the terminfos in @a tisidx. */
00077 apr_uint64_t
00078 lcn_terminfos_idx_get_count (const lcn_terminfos_idx_t *tisidx);
00079 
00080 /** Return the terminfo @a ti at @a position in @a tisidx. */
00081 lcn_error_t *
00082 lcn_terminfos_idx_get_terminfo (lcn_terminfo_t **ti,
00083                                 const lcn_terminfos_idx_t *tisidx,
00084                                 apr_uint64_t position);
00085 
00086 /** Open the terminfos file for @a segment in @a directory, return it in
00087  * @a tis, allocated in @a pool.
00088  */
00089 lcn_error_t *
00090 lcn_terminfos_open (lcn_terminfos_t **tis,
00091                     const lcn_directory_t *directory,
00092                     const lcn_char_t *segment,
00093                     apr_pool_t *pool);
00094 
00095 /** Return the terminfo @a ti from @a tis that corresponds to @a term, 
00096  * allocated in @a pool.
00097  */
00098 lcn_error_t *
00099 lcn_terminfos_get_terminfo (lcn_terminfo_t **ti,
00100                             const lcn_terminfos_t *tis,
00101                             const lcn_term_t *term,
00102                             apr_pool_t *pool);
00103 
00104 #ifdef __cplusplus
00105 }
00106 #endif /* __cplusplus */
00107 
00108 #endif

Generated on Sat Mar 26 08:12:11 2005 for Lucene4c by  doxygen 1.4.0