diff options
Diffstat (limited to 'src/authz.h')
| -rw-r--r-- | src/authz.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/authz.h b/src/authz.h index 671b45f..8e6c2bb 100644 --- a/src/authz.h +++ b/src/authz.h @@ -7,9 +7,10 @@ #ifndef AUTHZ_H #define AUTHZ_H +#include <getopt.h> #include <stddef.h> -#define MAX_FIELDS 64 // one rule line, split on whitespace +#define MAX_FIELDS 64 // one rule line, split on whitespace // one rule line, split on whitespace typedef enum { LV_NONE = 0, @@ -172,4 +173,15 @@ char *xsubstr(const char *s, size_t len); // 'pre-receive' when invoked through the hook symlink, 'git-authz' otherwise. extern const char *progname; +// getopt_long hands back an option's val, not the name that was typed, and for +// a long-only option the val is a number nobody wrote down. The table is the +// only place that still knows the pair. + +const char *authz_optname(int val, const struct option *lo); + +// A run parses options twice - the global ones, then the command's own - each on +// its own argv slice, so getopt_long has to be told to start again. + +void authz_opt_reset(void); + #endif /* AUTHZ_H */ |
