=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/doas/doas.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/usr.bin/doas/doas.h 2016/06/07 16:49:23 1.6 +++ src/usr.bin/doas/doas.h 2016/06/16 17:40:30 1.7 @@ -1,5 +1,20 @@ -/* $OpenBSD: doas.h,v 1.6 2016/06/07 16:49:23 tedu Exp $ */ +/* $OpenBSD: doas.h,v 1.7 2016/06/16 17:40:30 tedu Exp $ */ +#include + +struct envnode { + RB_ENTRY(envnode) node; + const char *key; + const char *value; +}; + +struct env { + RB_HEAD(envtree, envnode) root; + u_int count; +}; + +RB_PROTOTYPE(envtree, envnode, node, envcmp) + struct rule { int action; int options; @@ -15,6 +30,10 @@ extern int parse_errors; size_t arraylen(const char **); + +struct env *createenv(char **); +struct env *filterenv(struct env *, struct rule *); +char **flattenenv(struct env *); #define PERMIT 1 #define DENY 2