1 |
/* |
2 |
* DocProperties.c, DocProperties.h |
3 |
* |
4 |
* Functions to manage the index's Document Properties |
5 |
* |
6 |
* File Created. |
7 |
* M. Gaulin 8/10/98 |
8 |
* Jose Ruiz 2000/10 many modifications |
9 |
* Jose Ruiz 2001/01 many modifications |
10 |
* |
11 |
* 2001-01-26 rasc getPropertyByname changed |
12 |
* 2001-02-09 rasc printSearchResultProperties changed |
13 |
*/ |
14 |
|
15 |
#ifdef __cplusplus |
16 |
extern "C" { |
17 |
#endif |
18 |
|
19 |
void freeProperty( propEntry *prop ); |
20 |
void freeDocProperties (docProperties *); |
21 |
void freefileinfo(FileRec *); |
22 |
|
23 |
unsigned char *storeDocProperties (docProperties *, int *); |
24 |
|
25 |
propEntry *CreateProperty(struct metaEntry *meta_entry, unsigned char *propValue, int propLen, int preEncoded, int *error_flag ); |
26 |
void addDocProperties( INDEXDATAHEADER *header, docProperties **docProperties, unsigned char *propValue, int propLen, char *filename ); |
27 |
int addDocProperty (docProperties **, struct metaEntry * , unsigned char* ,int, int ); |
28 |
int Compare_Properties( struct metaEntry *meta_entry, propEntry *p1, propEntry *p2 ); |
29 |
|
30 |
unsigned char *fetchDocProperties ( FileRec *, char * ); |
31 |
|
32 |
int initSearchResultProperties (SWISH *); |
33 |
void addSearchResultDisplayProperty (SWISH *, char* ); |
34 |
void addSearchResultSortProperty (SWISH *, char*, int ); |
35 |
void printStandardResultProperties(SWISH *, FILE *, RESULT *); |
36 |
|
37 |
void swapDocPropertyMetaNames (docProperties **, struct metaMergeEntry *); |
38 |
|
39 |
// char *SwishResultPropertyStr(SWISH *sw, RESULT *result, char *pname); |
40 |
char *getResultPropAsString(SWISH *, RESULT *, int); |
41 |
char *DecodeDocProperty( struct metaEntry *meta_entry, propEntry *prop ); |
42 |
void getSwishInternalProperties(FileRec *, IndexFILE *); |
43 |
|
44 |
|
45 |
PropValue *getResultPropValue (SWISH *sw, RESULT *r, char *name, int ID); |
46 |
void freeResultPropValue(PropValue *pv); |
47 |
|
48 |
|
49 |
void dump_single_property( propEntry *prop, struct metaEntry *meta_entry ); |
50 |
void dump_file_properties(IndexFILE * indexf, FileRec *fi ); |
51 |
|
52 |
void WritePropertiesToDisk( SWISH *sw , FileRec *fi); |
53 |
propEntry *ReadSingleDocPropertiesFromDisk( SWISH *sw, IndexFILE *indexf, FileRec *fi, int metaID, int max_size ); |
54 |
docProperties *ReadAllDocPropertiesFromDisk( SWISH *sw, IndexFILE *indexf, int filenum ); |
55 |
|
56 |
|
57 |
|
58 |
/* |
59 |
-- Mapping AutoProperties <-> METANAMES |
60 |
-- should be the same |
61 |
*/ |
62 |
|
63 |
/* all AutoPropteries start with this string ! */ |
64 |
|
65 |
|
66 |
#define AUTOPROPERTY_DEFAULT "swishdefault" |
67 |
#define AUTOPROPERTY_REC_COUNT "swishreccount" |
68 |
#define AUTOPROPERTY_RESULT_RANK "swishrank" |
69 |
#define AUTOPROPERTY_FILENUM "swishfilenum" |
70 |
#define AUTOPROPERTY_INDEXFILE "swishdbfile" |
71 |
|
72 |
#define AUTOPROPERTY_DOCPATH "swishdocpath" |
73 |
#define AUTOPROPERTY_TITLE "swishtitle" |
74 |
#define AUTOPROPERTY_DOCSIZE "swishdocsize" |
75 |
#define AUTOPROPERTY_LASTMODIFIED "swishlastmodified" |
76 |
#define AUTOPROPERTY_SUMMARY "swishdescription" |
77 |
#define AUTOPROPERTY_STARTPOS "swishstartpos" |
78 |
|
79 |
#ifdef __cplusplus |
80 |
} |
81 |
#endif /* __cplusplus */ |
82 |
|