xref: /Universal-ctags/optlib/passwd.c (revision be545a5f980218f14fb60b602e4378a2988e5019)
1 /*
2  * Generated by ./misc/optlib2c from optlib/passwd.ctags, Don't edit this manually.
3  */
4 #include "general.h"
5 #include "parse.h"
6 #include "routines.h"
7 #include "field.h"
8 #include "xtag.h"
9 
10 
initializePasswdParser(const langType language CTAGS_ATTR_UNUSED)11 static void initializePasswdParser (const langType language CTAGS_ATTR_UNUSED)
12 {
13 }
14 
PasswdParser(void)15 extern parserDefinition* PasswdParser (void)
16 {
17 	static const char *const extensions [] = {
18 		NULL
19 	};
20 
21 	static const char *const aliases [] = {
22 		NULL
23 	};
24 
25 	static const char *const patterns [] = {
26 		"passwd",
27 		NULL
28 	};
29 
30 	static kindDefinition PasswdKindTable [] = {
31 		{
32 		  true, 'u', "username", "user names",
33 		},
34 	};
35 	static fieldDefinition PasswdFieldTable [] = {
36 		{
37 		  .enabled     = true,
38 		  .name        = "home",
39 		  .description = "home directory",
40 		},
41 		{
42 		  .enabled     = true,
43 		  .name        = "shell",
44 		  .description = "login shell",
45 		},
46 	};
47 	static tagRegexTable PasswdTagRegexTable [] = {
48 		{"^([^:]+):([^:]+):([^:]+):([^:]+):([^:]*):([^:]+):([^:]+)", "\\1",
49 		"u", "{_field=home:\\6}{_field=shell:\\7}", NULL, false},
50 	};
51 
52 
53 	parserDefinition* const def = parserNew ("Passwd");
54 
55 	def->enabled       = true;
56 	def->extensions    = extensions;
57 	def->patterns      = patterns;
58 	def->aliases       = aliases;
59 	def->method        = METHOD_NOT_CRAFTED|METHOD_REGEX;
60 	def->kindTable     = PasswdKindTable;
61 	def->kindCount     = ARRAY_SIZE(PasswdKindTable);
62 	def->fieldTable    = PasswdFieldTable;
63 	def->fieldCount    = ARRAY_SIZE(PasswdFieldTable);
64 	def->tagRegexTable = PasswdTagRegexTable;
65 	def->tagRegexCount = ARRAY_SIZE(PasswdTagRegexTable);
66 	def->initialize    = initializePasswdParser;
67 
68 	return def;
69 }
70