7 int conf_dirmark(int idx
, char **pat
, int *ctx
, int *dir
, int *grp
)
9 if (idx
< 0 || idx
>= LEN(dirmarks
))
12 *pat
= dirmarks
[idx
].pat
;
14 *ctx
= dirmarks
[idx
].ctx
;
16 *dir
= dirmarks
[idx
].dir
;
18 *grp
= dirmarks
[idx
].grp
;
22 int conf_dircontext(int idx
, char **pat
, int *ctx
)
24 if (idx
< 0 || idx
>= LEN(dircontexts
))
27 *pat
= dircontexts
[idx
].pat
;
29 *ctx
= dircontexts
[idx
].dir
;
33 int conf_placeholder(int idx
, char **s
, char **d
, int *wid
)
35 if (idx
< 0 || idx
>= LEN(placeholders
))
38 *s
= placeholders
[idx
].s
;
40 *d
= placeholders
[idx
].d
;
42 *wid
= placeholders
[idx
].wid
;
46 int conf_highlight(int idx
, char **ft
, int **att
, char **pat
, int *end
)
48 if (idx
< 0 || idx
>= LEN(highlights
))
51 *ft
= highlights
[idx
].ft
;
53 *att
= highlights
[idx
].att
;
55 *pat
= highlights
[idx
].pat
;
57 *end
= highlights
[idx
].end
;
61 int conf_filetype(int idx
, char **ft
, char **pat
)
63 if (idx
< 0 || idx
>= LEN(filetypes
))
66 *ft
= filetypes
[idx
].ft
;
68 *pat
= filetypes
[idx
].pat
;
87 char **conf_kmap(int id
)
92 int conf_kmapfind(char *name
)
95 for (i
= 0; i
< LEN(kmaps
); i
++)
96 if (name
&& kmaps
[i
][0] && !strcmp(name
, kmaps
[i
][0]))
101 char *conf_digraph(int c1
, int c2
)
104 for (i
= 0; i
< LEN(digraphs
); i
++)
105 if (digraphs
[i
][0][0] == c1
&& digraphs
[i
][0][1] == c2
)
106 return digraphs
[i
][1];
110 char *conf_lnpref(void)
115 char *conf_definition(char *ft
)
118 for (i
= 0; i
< LEN(filetypes
); i
++)
119 if (!strcmp(ft
, filetypes
[i
].ft
) && filetypes
[i
].def
)
120 return filetypes
[i
].def
;
124 char *conf_section(char *ft
)
127 for (i
= 0; i
< LEN(filetypes
); i
++)
128 if (!strcmp(ft
, filetypes
[i
].ft
) && filetypes
[i
].sec
)
129 return filetypes
[i
].sec
;
133 char *conf_ecmd(void)