|
Packit |
fd8b60 |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
Packit |
fd8b60 |
/* include/k5-err.h */
|
|
Packit |
fd8b60 |
/*
|
|
Packit |
fd8b60 |
* Copyright 2006, 2007 Massachusetts Institute of Technology.
|
|
Packit |
fd8b60 |
* All Rights Reserved.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* Export of this software from the United States of America may
|
|
Packit |
fd8b60 |
* require a specific license from the United States Government.
|
|
Packit |
fd8b60 |
* It is the responsibility of any person or organization contemplating
|
|
Packit |
fd8b60 |
* export to obtain such a license before exporting.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
|
Packit |
fd8b60 |
* distribute this software and its documentation for any purpose and
|
|
Packit |
fd8b60 |
* without fee is hereby granted, provided that the above copyright
|
|
Packit |
fd8b60 |
* notice appear in all copies and that both that copyright notice and
|
|
Packit |
fd8b60 |
* this permission notice appear in supporting documentation, and that
|
|
Packit |
fd8b60 |
* the name of M.I.T. not be used in advertising or publicity pertaining
|
|
Packit |
fd8b60 |
* to distribution of the software without specific, written prior
|
|
Packit |
fd8b60 |
* permission. Furthermore if you modify this software you must label
|
|
Packit |
fd8b60 |
* your software as modified software and not distribute it in such a
|
|
Packit |
fd8b60 |
* fashion that it might be confused with the original M.I.T. software.
|
|
Packit |
fd8b60 |
* M.I.T. makes no representations about the suitability of
|
|
Packit |
fd8b60 |
* this software for any purpose. It is provided "as is" without express
|
|
Packit |
fd8b60 |
* or implied warranty.
|
|
Packit |
fd8b60 |
*/
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/*
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* Error-message handling
|
|
Packit |
fd8b60 |
*/
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#ifndef K5_ERR_H
|
|
Packit |
fd8b60 |
#define K5_ERR_H
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#if defined(_MSDOS) || defined(_WIN32)
|
|
Packit |
fd8b60 |
#include <win-mac.h>
|
|
Packit |
fd8b60 |
#endif
|
|
Packit |
fd8b60 |
#ifndef KRB5_CALLCONV
|
|
Packit |
fd8b60 |
#define KRB5_CALLCONV
|
|
Packit |
fd8b60 |
#define KRB5_CALLCONV_C
|
|
Packit |
fd8b60 |
#endif
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#include <stdarg.h>
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
struct errinfo {
|
|
Packit |
fd8b60 |
long code;
|
|
Packit |
fd8b60 |
char *msg;
|
|
Packit |
fd8b60 |
};
|
|
Packit |
fd8b60 |
#define EMPTY_ERRINFO { 0, NULL }
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
void k5_set_error(struct errinfo *ep, long code, const char *fmt, ...)
|
|
Packit |
fd8b60 |
#if !defined(__cplusplus) && (__GNUC__ > 2)
|
|
Packit |
fd8b60 |
__attribute__((__format__(__printf__, 3, 4)))
|
|
Packit |
fd8b60 |
#endif
|
|
Packit |
fd8b60 |
;
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
void k5_vset_error(struct errinfo *ep, long code, const char *fmt,
|
|
Packit |
fd8b60 |
va_list args)
|
|
Packit |
fd8b60 |
#if !defined(__cplusplus) && (__GNUC__ > 2)
|
|
Packit |
fd8b60 |
__attribute__((__format__(__printf__, 3, 0)))
|
|
Packit |
fd8b60 |
#endif
|
|
Packit |
fd8b60 |
;
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
const char *k5_get_error(struct errinfo *ep, long code);
|
|
Packit |
fd8b60 |
void k5_free_error(struct errinfo *ep, const char *msg);
|
|
Packit |
fd8b60 |
void k5_clear_error(struct errinfo *ep);
|
|
Packit |
fd8b60 |
void k5_set_error_info_callout_fn(const char *(KRB5_CALLCONV *f)(long));
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#endif /* K5_ERR_H */
|