Declare the new user-error reporting macro.

This is a macro to allow use of the __FILE__ and __FUNCTION__
macros.
This commit is contained in:
Mark Murray 2001-08-10 14:15:00 +00:00
parent a56dfc9b23
commit 0b2e8123ef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81452
2 changed files with 18 additions and 6 deletions

View File

@ -46,6 +46,7 @@ struct opttab {
struct options {
struct {
const char *name;
int bool;
char *arg;
} opt[PAM_MAX_OPTIONS];
@ -60,15 +61,20 @@ void pam_set_option(struct options *, enum opt);
void pam_clear_option(struct options *, enum opt);
void _pam_log(struct options *, const char *, const char *, const char *, ...);
void _pam_log_retval(struct options *, const char *, const char *, int);
void _pam_verbose_error(pam_handle_t *, struct options *, const char *,
const char *, const char *, ...);
__END_DECLS
#define PAM_LOG(args...) \
#define PAM_LOG(args...) \
_pam_log(&options, __FILE__, __FUNCTION__, ##args)
#define PAM_RETURN(arg) \
do { \
_pam_log_retval(&options, __FILE__, __FUNCTION__, arg); \
return arg; \
_pam_log_retval(&options, __FILE__, __FUNCTION__, arg); \
return arg; \
} while (0)
#define PAM_VERBOSE_ERROR(args...) \
_pam_verbose_error(pamh, &options, __FILE__, __FUNCTION__, ##args)
#endif

View File

@ -46,6 +46,7 @@ struct opttab {
struct options {
struct {
const char *name;
int bool;
char *arg;
} opt[PAM_MAX_OPTIONS];
@ -60,15 +61,20 @@ void pam_set_option(struct options *, enum opt);
void pam_clear_option(struct options *, enum opt);
void _pam_log(struct options *, const char *, const char *, const char *, ...);
void _pam_log_retval(struct options *, const char *, const char *, int);
void _pam_verbose_error(pam_handle_t *, struct options *, const char *,
const char *, const char *, ...);
__END_DECLS
#define PAM_LOG(args...) \
#define PAM_LOG(args...) \
_pam_log(&options, __FILE__, __FUNCTION__, ##args)
#define PAM_RETURN(arg) \
do { \
_pam_log_retval(&options, __FILE__, __FUNCTION__, arg); \
return arg; \
_pam_log_retval(&options, __FILE__, __FUNCTION__, arg); \
return arg; \
} while (0)
#define PAM_VERBOSE_ERROR(args...) \
_pam_verbose_error(pamh, &options, __FILE__, __FUNCTION__, ##args)
#endif