00001 /* 00002 * libfid - Full-text Index Data structure library 00003 * Copyright (C) 2006, 2007, 2008, 2009 Robert Homann 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00018 * MA 02110-1301 USA 00019 */ 00020 00021 #ifndef PROJECTFILE_H 00022 #define PROJECTFILE_H 00023 /*!\addtogroup suffixarrays */ 00024 /*@{*/ 00025 00026 /*! 00027 * \brief Representation of a project file. 00028 * 00029 * Project files are text files containing information about enhanced suffix 00030 * arrays that cannot be derived from the binary data themselves. 00031 * Examples for such information include the integer size (32 or 64 bits), the 00032 * byte order (little or big endian), or names of original input files. 00033 * 00034 * Some of the members in this structures are just there for pure compatibility 00035 * with the \e mkvtree program. 00036 */ 00037 typedef struct 00038 { 00039 fid_Uintsize uisize; /*!<\brief Integer size. */ 00040 char *filename; /*!<\brief Name of the project file. */ 00041 char *prjbasename; /*!<\brief Base name, i.e., the name without file 00042 * name extension (<code>.prj</code>). */ 00043 unsigned char integer_size_in_bits; /*!<\brief Integer size in bits. */ 00044 unsigned char integer_size_in_bytes; /*!<\brief Integer size in bytes. */ 00045 int endianess_known:1; /*!<\brief Set to \e true if endianess is known. */ 00046 int littleendian:1; /*!<\brief Set to \e true if data is stored in 00047 * little endian format. Only valid if 00048 * #fid_Projectfile::endianess_known is \e true. */ 00049 fid_DBfiles dbfiles; /*!<\brief Dynamic array of #fid_DBfileinfo 00050 * structures. */ 00051 fid_Uint64 totallength; /*!<\brief Total length of the sequence. */ 00052 fid_Uint64 num_of_sequences; /*!<\brief Number of sequences. */ 00053 fid_Uint64 num_of_query_sequences; /*!<\brief Number of queries. */ 00054 fid_Uint64 prefixlength; /*!<\brief Prefix length of buckets. */ 00055 fid_Uint64 large_lcp_values; /*!<\brief Number of large LCP values. */ 00056 fid_Uint64 max_branchdepth; /*!<\brief Maximum branch depth. */ 00057 fid_Uint64 num_of_specials; /*!<\brief Number of special characters in the 00058 * sequence data. */ 00059 fid_Uint64 num_of_special_ranges; /*!<\brief Number of stretches of special 00060 * characters in the sequence data. */ 00061 fid_Uint64 longest; /*!<\brief Length of longest sequence. */ 00062 fid_Uint64 len_of_special_prefix; /*!<\brief Number of special characters 00063 * in the beginning of the sequence 00064 * data. */ 00065 fid_Uint64 len_of_special_suffix; /*!<\brief Number of special characters 00066 * in the end of the sequence data. */ 00067 } fid_Projectfile; 00068 #ifdef __cplusplus 00069 extern "C" { 00070 #endif 00071 int fid_projectfile_init(fid_Projectfile *project, const char *prjbasename, 00072 fid_Error *error); 00073 int fid_projectfile_parse_from_file(fid_Projectfile *project, 00074 const char *prjbasename, fid_Error *error); 00075 int fid_projectfile_write(const fid_Projectfile *project, fid_Error *error); 00076 void fid_projectfile_free(fid_Projectfile *project); 00077 void fid_projectfile_dump(const fid_Projectfile *project, FILE *stream); 00078 #ifdef __cplusplus 00079 } 00080 #endif 00081 /*@}*/ 00082 00083 #endif /* !PROJECTFILE_H */