3 * Copyright (c) 2016, Red Hat, Inc.
4 * Copyright (c) 2016, Masatake YAMATO
6 * Author: Masatake YAMATO <yamato@redhat.com>
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.
12 #ifndef CTAGS_MAIN_PTAG_PRIVATE_H
13 #define CTAGS_MAIN_PTAG_PRIVATE_H
18 #define PSEUDO_TAG_PREFIX "!_"
19 #define PSEUDO_TAG_SEPARATOR "!"
21 typedef enum ePtagType
{ /* pseudo tag content control */
23 /* Only --output-format=json use this ptag.
24 Applications of the output may expect this comes first in the output. */
25 PTAG_JSON_OUTPUT_VERSION
,
37 PTAG_KIND_DESCRIPTION
,
38 PTAG_FIELD_DESCRIPTION
,
39 PTAG_EXTRA_DESCRIPTION
,
40 PTAG_ROLE_DESCRIPTION
,
43 PTAG_PATTERN_TRUNCATION
,
49 typedef enum ePtagFlag
{
50 /* use isPtagCommonInParsers() for testing. */
51 PTAGF_COMMON
= 1 << 0,
52 /* use isPtagParserSpecific for testing.
53 * PSEUDO_TAG_SEPARATOR is used for printing. */
54 PTAGF_PARSER
= 1 << 1,
60 const char* description
; /* displayed in --list-pseudo-tags output */
62 /* For making ptags for common in parsers, LANG_IGNOR is for the second
63 * argument and a pointer for optionValues type value for the third argument
66 * For parser specific ptags, the pointer for parserObject
67 * of the parser is passed as the thrid argument.
69 bool (* makeTag
) (ptagDesc
*, langType
, const void *);
74 extern bool makePtagIfEnabled (ptagType type
, langType language
, const void *data
);
75 extern ptagDesc
* getPtagDesc (ptagType type
);
76 extern ptagType
getPtagTypeForName (const char *name
);
77 extern void printPtags (bool withListHeader
, bool machinable
, FILE *fp
);
78 extern bool isPtagEnabled (ptagType type
);
79 extern bool isPtagCommonInParsers (ptagType type
);
80 extern bool isPtagParserSpecific (ptagType type
);
81 extern bool enablePtag (ptagType type
, bool state
);
83 #endif /* CTAGS_MAIN_PTAG_PRIVATE_H */