1 /*
2 *   $Id: entry.h 443 2006-05-30 04:37:13Z darren $
3 *
4 *   Copyright (c) 1998-2002, Darren Hiebert
5 *
6 *   This source code is released for free distribution under the terms of the
7 *   GNU General Public License.
8 *
9 *   External interface to entry.c
10 */
11 #ifndef _ENTRY_H
12 #define _ENTRY_H
13 
14 /*
15 *   INCLUDE FILES
16 */
17 #include "general.h"  /* must always come first */
18 
19 #include <stdio.h>
20 
21 #include "vstring.h"
22 
23 /*
24 *   MACROS
25 */
26 #define WHOLE_FILE  -1L
27 
28 /*
29 *   DATA DECLARATIONS
30 */
31 
32 /*  Maintains the state of the tag file.
33  */
34 typedef struct eTagFile {
35 	char *name;
36 	char *directory;
37 	FILE *fp;
38 	struct sNumTags { unsigned long added, prev; } numTags;
39 	struct sMax { size_t line, tag, file; } max;
40 	struct sEtags {
41 		char *name;
42 		FILE *fp;
43 		size_t byteCount;
44 	} etags;
45 	vString *vLine;
46 } tagFile;
47 
48 typedef struct sTagFields {
49 	unsigned int count;        /* number of additional extension flags */
50 	const char *const *label;  /* list of labels for extension flags */
51 	const char *const *value;  /* list of values for extension flags */
52 } tagFields;
53 
54 /*  Information about the current tag candidate.
55  */
56 typedef struct sTagEntryInfo {
57 	boolean     lineNumberEntry;  /* pattern or line number entry */
58 	unsigned long lineNumber;     /* line number of tag */
59 	fpos_t      filePosition;     /* file position of line containing tag */
60 	const char* language;         /* language of source file */
61 	boolean     isFileScope;      /* is tag visibile only within source file? */
62 	boolean     isFileEntry;      /* is this just an entry for a file name? */
63 	boolean     truncateLine;     /* truncate tag line at end of tag name? */
64 	const char *sourceFileName;   /* name of source file */
65 	const char *name;             /* name of the tag */
66 	const char *kindName;         /* kind of tag */
67 	char        kind;             /* single character representation of kind */
68 	struct {
69 		const char* access;
70 		const char* fileScope;
71 		const char* implementation;
72 		const char* inheritance;
73 		const char* scope [2];    /* value and key */
74 		const char* signature;
75 		const char* returnType;
76 
77 		/* type (union/struct/etc.) and name for a variable or typedef. */
78 		const char* typeRef [2];  /* e.g., "struct" and struct name */
79 
80 	} extensionFields;  /* list of extension fields*/
81 } tagEntryInfo;
82 
83 /*
84 *   GLOBAL VARIABLES
85 */
86 extern tagFile TagFile;
87 
88 /*
89 *   FUNCTION PROTOTYPES
90 */
91 extern void freeTagFileResources (void);
92 extern const char *tagFileName (void);
93 extern void copyBytes (FILE* const fromFp, FILE* const toFp, const long size);
94 extern void copyFile (const char *const from, const char *const to, const long size);
95 extern void openTagFile (void);
96 extern void closeTagFile (const boolean resize);
97 extern void beginEtagsFile (void);
98 extern void endEtagsFile (const char *const name);
99 extern void makeTagEntry (const tagEntryInfo *const tag);
100 extern void initTagEntry (tagEntryInfo *const e, const char *const name);
101 
102 #endif  /* _ENTRY_H */
103 
104 /* vi:set tabstop=4 shiftwidth=4: */
105