X-Git-Url: https://git.sesse.net/?p=itkacl;a=blobdiff_plain;f=itkacl-2.2%2Fitkacl.h;fp=itkacl-2.2%2Fitkacl.h;h=77be702fc75cdb87f3d38694cb96b193c0134cbe;hp=0000000000000000000000000000000000000000;hb=55f933b88c9d9992b1ec0ed7c13a621032f7637d;hpb=e51368f580164e7324c706501758aaf56a4fa312 diff --git a/itkacl-2.2/itkacl.h b/itkacl-2.2/itkacl.h new file mode 100644 index 0000000..77be702 --- /dev/null +++ b/itkacl-2.2/itkacl.h @@ -0,0 +1,32 @@ +#ifndef _ITKACL_H +#define _ITKACL_H + +/* + * itkacl control library, version 2.2 + * + * (C) 2004-2022 Steinar H. Gunderson + * GPL, v2. + */ + +int itkacl_check(const char * const realm, const char * const user, + char *errmsg, size_t errmsg_size); + +/* + * Opaque context. A context is created with itkacl_create_ctx() + * and freed with itkacl_free_ctx(), and is thread-safe. + * If you are making multiple calls to itkacl_check(), it is faster + * to reuse the same context over and over (since libunbound can + * have rather high setup times depending on configuration). + * + * Configuration is only reread when the context is created. + */ +struct itkacl_ctx; + +struct itkacl_ctx *itkacl_create_ctx(char *errmsg, size_t errmsg_size); // Returns NULL on failure. +void itkacl_free_ctx(struct itkacl_ctx *ctx); + +int itkacl_check_with_ctx(struct itkacl_ctx *ctx, + const char * const realm, const char * const user, + char *errmsg, size_t errmsg_size); + +#endif /* !defined(_ITKACL_H) */