xref: /Universal-ctags/main/xtag.h (revision 46a698ce2bd18c48eccd6ee7cbfa3af47a60dc32)
1 /*
2  *
3  *  Copyright (c) 2015, Red Hat, Inc.
4  *  Copyright (c) 2015, Masatake YAMATO
5  *
6  *  Author: Masatake YAMATO <yamato@redhat.com>
7  *
8  *   This source code is released for free distribution under the terms of the
9  *   GNU General Public License version 2 or (at your option) any later version.
10  *
11  */
12 #ifndef CTAGS_MAIN_XTAG_H
13 #define CTAGS_MAIN_XTAG_H
14 
15 /*
16 *   INCLUDE FILES
17 */
18 
19 #include "general.h"
20 
21 /*
22 *   DATA DECLARATIONS
23 */
24 
25 typedef enum eXtagType { /* extra tag content control */
26 	XTAG_UNKNOWN = -1,
27 
28 	XTAG_FILE_SCOPE,
29 	XTAG_FILE_NAMES,
30 	XTAG_PSEUDO_TAGS,
31 	XTAG_QUALIFIED_TAGS,
32 	XTAG_REFERENCE_TAGS,
33 	XTAG_GUEST,
34 	XTAG_TAGS_GENERATED_BY_GUEST_PARSERS = XTAG_GUEST, /* Geany uses the old name */
35 	XTAG_SUBPARSER,
36 	XTAG_ANONYMOUS,
37 
38 	XTAG_COUNT
39 } xtagType;
40 
41 struct sXtagDefinition {
42 	bool enabled;
43 	/* letter, and ftype are initialized in the main part,
44 	   not in a parser. */
45 #define NUL_XTAG_LETTER '\0'
46 	unsigned char letter;
47 	const char* name;	 /* used in extra: field */
48 	const char* description;  /* displayed in --list-extra output */
49 
50 	/* If the value for "enabled" is given dynamically,
51 	   use this field.
52 
53 	   "enabled" field of Pseudo extra tag depends on where
54 	   the output stream is connected to. If it is connected
55 	   to standard output, the tag is disabled by default.
56 	   If it is connected to a regular file, the tag is enabled
57 	   by default. */
58 	bool (* isEnabled) (struct sXtagDefinition *def);
59 	bool (* isFixed)   (struct sXtagDefinition *def);
60 	void (* enable)    (struct sXtagDefinition *def, bool state);
61 
62 	unsigned int xtype;	/* Given from the main part */
63 };
64 
65 extern bool isXtagEnabled (xtagType type);
66 
67 #endif	/* CTAGS_MAIN_FIELD_H */
68