/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* include/k5-err.h */2/*3* Copyright 2006, 2007 Massachusetts Institute of Technology.4* All Rights Reserved.5*6* Export of this software from the United States of America may7* require a specific license from the United States Government.8* It is the responsibility of any person or organization contemplating9* export to obtain such a license before exporting.10*11* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and12* distribute this software and its documentation for any purpose and13* without fee is hereby granted, provided that the above copyright14* notice appear in all copies and that both that copyright notice and15* this permission notice appear in supporting documentation, and that16* the name of M.I.T. not be used in advertising or publicity pertaining17* to distribution of the software without specific, written prior18* permission. Furthermore if you modify this software you must label19* your software as modified software and not distribute it in such a20* fashion that it might be confused with the original M.I.T. software.21* M.I.T. makes no representations about the suitability of22* this software for any purpose. It is provided "as is" without express23* or implied warranty.24*/2526/*27*28* Error-message handling29*/3031#ifndef K5_ERR_H32#define K5_ERR_H3334#if defined(_MSDOS) || defined(_WIN32)35#include <win-mac.h>36#endif37#ifndef KRB5_CALLCONV38#define KRB5_CALLCONV39#define KRB5_CALLCONV_C40#endif4142#include <stdarg.h>4344struct errinfo {45long code;46char *msg;47};48#define EMPTY_ERRINFO { 0, NULL }4950void k5_set_error(struct errinfo *ep, long code, const char *fmt, ...)51#if !defined(__cplusplus) && (__GNUC__ > 2)52__attribute__((__format__(__printf__, 3, 4)))53#endif54;5556void k5_vset_error(struct errinfo *ep, long code, const char *fmt,57va_list args)58#if !defined(__cplusplus) && (__GNUC__ > 2)59__attribute__((__format__(__printf__, 3, 0)))60#endif61;6263const char *k5_get_error(struct errinfo *ep, long code);64void k5_free_error(struct errinfo *ep, const char *msg);65void k5_clear_error(struct errinfo *ep);66void k5_set_error_info_callout_fn(const char *(KRB5_CALLCONV *f)(long));6768#endif /* K5_ERR_H */697071