Debian Codegraph @

entry.h

raw
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
76 /* type (union/struct/etc.) and name for a variable or typedef. */
77 const char* typeRef [2]; /* e.g., "struct" and struct name */
78
79 } extensionFields; /* list of extension fields*/
80 } tagEntryInfo;
81
82 /*
83 * GLOBAL VARIABLES
84 */
85 extern tagFile TagFile;
86
87 /*
88 * FUNCTION PROTOTYPES
89 */
90 extern void freeTagFileResources (void);
91 extern const char *tagFileName (void);
92 extern void copyBytes (FILE* const fromFp, FILE* const toFp, const long size);
93 extern void copyFile (const char *const from, const char *const to, const long size);
94 extern void openTagFile (void);
95 extern void closeTagFile (const boolean resize);
96 extern void beginEtagsFile (void);
97 extern void endEtagsFile (const char *const name);
98 extern void makeTagEntry (const tagEntryInfo *const tag);
99 extern void initTagEntry (tagEntryInfo *const e, const char *const name);
100
101 #endif /* _ENTRY_H */
102
103 /* vi:set tabstop=4 shiftwidth=4: */