110db1377Sgtb /* 210db1377Sgtb * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 310db1377Sgtb * Use is subject to license terms. 410db1377Sgtb */ 510db1377Sgtb 67c478bd9Sstevel@tonic-gate /* 77c478bd9Sstevel@tonic-gate * Header file for common error description library. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * Copyright 1988, Student Information Processing Board of the 107c478bd9Sstevel@tonic-gate * Massachusetts Institute of Technology. 117c478bd9Sstevel@tonic-gate * 127c478bd9Sstevel@tonic-gate * Copyright 1995 by Cygnus Support. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * For copyright and distribution info, see the documentation supplied 157c478bd9Sstevel@tonic-gate * with this package. 167c478bd9Sstevel@tonic-gate */ 177c478bd9Sstevel@tonic-gate 187c478bd9Sstevel@tonic-gate #ifndef __COM_ERR_H 197c478bd9Sstevel@tonic-gate 20505d05c7Sgtb #if defined(_WIN32) 217c478bd9Sstevel@tonic-gate #include <win-mac.h> 227c478bd9Sstevel@tonic-gate #endif 237c478bd9Sstevel@tonic-gate 247c478bd9Sstevel@tonic-gate #ifndef KRB5_CALLCONV 257c478bd9Sstevel@tonic-gate #define KRB5_CALLCONV 267c478bd9Sstevel@tonic-gate #define KRB5_CALLCONV_C 277c478bd9Sstevel@tonic-gate #endif 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #include <stdarg.h> 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate typedef long errcode_t; 32505d05c7Sgtb typedef void (*et_old_error_hook_func) (const char *, errcode_t, 33505d05c7Sgtb const char *, va_list ap); 34*1da57d55SToomas Soome 357c478bd9Sstevel@tonic-gate struct error_table { 36505d05c7Sgtb /*@shared@*/ char const * const * msgs; 37505d05c7Sgtb long base; 387c478bd9Sstevel@tonic-gate unsigned int n_msgs; 397c478bd9Sstevel@tonic-gate }; 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate #ifdef __cplusplus 427c478bd9Sstevel@tonic-gate extern "C" { 437c478bd9Sstevel@tonic-gate #endif 447c478bd9Sstevel@tonic-gate 45505d05c7Sgtb /* Public interfaces */ 46505d05c7Sgtb extern void KRB5_CALLCONV_C com_err 47505d05c7Sgtb (const char *, errcode_t, const char *, ...); 48505d05c7Sgtb extern void KRB5_CALLCONV com_err_va 49505d05c7Sgtb (const char *whoami, errcode_t code, const char *fmt, 50505d05c7Sgtb va_list ap); 51505d05c7Sgtb extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message 52505d05c7Sgtb (errcode_t) 53505d05c7Sgtb /*@modifies internalState@*/; 5410db1377Sgtb 5510db1377Sgtb /* 5610db1377Sgtb * Solaris Kerberos 5710db1377Sgtb * {add_,remove_}error_table have been removed here as they don't exist 5810db1377Sgtb * in the Solaris mech. 5910db1377Sgtb * 6010db1377Sgtb * initialize_krb5_error_table is not be needed anymore but Samba still 6110db1377Sgtb * calls it so we make it a no-op. 6210db1377Sgtb */ 6310db1377Sgtb #define initialize_krb5_error_table() 64505d05c7Sgtb 65505d05c7Sgtb #if !defined(_WIN32) 667c478bd9Sstevel@tonic-gate /* 677c478bd9Sstevel@tonic-gate * The display routine should be application specific. A global hook, 687c478bd9Sstevel@tonic-gate * may cause inappropriate display procedures to be called between 697c478bd9Sstevel@tonic-gate * applications under non-Unix environments. 707c478bd9Sstevel@tonic-gate */ 717c478bd9Sstevel@tonic-gate 72505d05c7Sgtb extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func); 73505d05c7Sgtb extern et_old_error_hook_func reset_com_err_hook (void); 747c478bd9Sstevel@tonic-gate #endif 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate #ifdef __cplusplus 777c478bd9Sstevel@tonic-gate } 787c478bd9Sstevel@tonic-gate #endif 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate #define __COM_ERR_H 817c478bd9Sstevel@tonic-gate #endif /* ! defined(__COM_ERR_H) */ 82