summaryrefslogtreecommitdiffstats
ModeNameSize
-rw-r--r--.appveyor.yml945logstatsplain
-rw-r--r--.cirrus.yml540logstatsplain
-rw-r--r--.codecov.yml205logstatsplain
-rw-r--r--.gitattributes27logstatsplain
d---------.github270logstatsplain
-rw-r--r--.gitignore1915logstatsplain
-rw-r--r--.hgignore1752logstatsplain
-rw-r--r--CONTRIBUTING.md5370logstatsplain
-rw-r--r--Filelist28047logstatsplain
-rw-r--r--LICENSE5021logstatsplain
-rw-r--r--Makefile20820logstatsplain
-rw-r--r--README.md6918logstatsplain
-rw-r--r--README.rux.txt11502logstatsplain
-rw-r--r--README.txt5085logstatsplain
-rw-r--r--README_VIM9.md10833logstatsplain
d---------READMEdir1192logstatsplain
-rw-r--r--SECURITY.md364logstatsplain
d---------ci469logstatsplain
-rwxr-xr-xconfigure182logstatsplain
d---------nsis186logstatsplain
d---------pixmaps2350logstatsplain
d---------runtime2362logstatsplain
d---------src10846logstatsplain
d---------tools38logstatsplain
-rw-r--r--uninstall.txt3812logstatsplain
-rw-r--r--vimtutor.bat1709logstatsplain
-rwxr-xr-xvimtutor.com2901logstatsplain
o2->name)); } void options_init(struct options *oo, struct options *parent) { SPLAY_INIT(&oo->tree); oo->parent = parent; } void options_free(struct options *oo) { struct options_entry *o; while (!SPLAY_EMPTY(&oo->tree)) { o = SPLAY_ROOT(&oo->tree); SPLAY_REMOVE(options_tree, &oo->tree, o); xfree(o->name); if (o->type == OPTIONS_STRING) xfree(o->str); xfree(o); } } struct options_entry * options_find1(struct options *oo, const char *name) { struct options_entry p; p.name = (char *) name; return (SPLAY_FIND(options_tree, &oo->tree, &p)); } struct options_entry * options_find(struct options *oo, const char *name) { struct options_entry *o, p; p.name = (char *) name; o = SPLAY_FIND(options_tree, &oo->tree, &p); while (o == NULL) { oo = oo->parent; if (oo == NULL) break; o = SPLAY_FIND(options_tree, &oo->tree, &p); } return (o); } void options_remove(struct options *oo, const char *name) { struct options_entry *o; if ((o = options_find1(oo, name)) == NULL) return; SPLAY_REMOVE(options_tree, &oo->tree, o); xfree(o->name); if (o->type == OPTIONS_STRING) xfree(o->str); xfree(o); } struct options_entry *printflike3 options_set_string(struct options *oo, const char *name, const char *fmt, ...) { struct options_entry *o; va_list ap; if ((o = options_find1(oo, name)) == NULL) { o = xmalloc(sizeof *o); o->name = xstrdup(name); SPLAY_INSERT(options_tree, &oo->tree, o); } else if (o->type == OPTIONS_STRING) xfree(o->str); va_start(ap, fmt); o->type = OPTIONS_STRING; xvasprintf(&o->str, fmt, ap); va_end(ap); return (o); } char * options_get_string(struct options *oo, const char *name) { struct options_entry *o; if ((o = options_find(oo, name)) == NULL) fatalx("missing option"); if (o->type != OPTIONS_STRING) fatalx("option not a string"); return (o->str); } struct options_entry * options_set_number(struct options *oo, const char *name, long long value) { struct options_entry *o; if ((o = options_find1(oo, name)) == NULL) { o = xmalloc(sizeof *o); o->name = xstrdup(name); SPLAY_INSERT(options_tree, &oo->tree, o); } else if (o->type == OPTIONS_STRING) xfree(o->str); o->type = OPTIONS_NUMBER; o->num = value; return (o); } long long options_get_number(struct options *oo, const char *name) { struct options_entry *o; if ((o = options_find(oo, name)) == NULL) fatalx("missing option"); if (o->type != OPTIONS_NUMBER) fatalx("option not a number"); return (o->num); }