nserror.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #ifndef __nserror_h
  13. #define __nserror_h
  14. #ifndef NOINTNSACL
  15. #define INTNSACL
  16. #endif /* !NOINTNSACL */
  17. /*
  18. * Description (nserror.h)
  19. *
  20. * This file describes the interface to an error handling mechanism
  21. * that is intended for general use. This mechanism uses a data
  22. * structure known as an "error frame" to capture information about
  23. * an error. Multiple error frames are used in nested function calls
  24. * to capture the interpretation of an error at the different levels
  25. * of a nested call.
  26. */
  27. #include <stdarg.h>
  28. #include <prtypes.h>
  29. #include "public/nsacl/nserrdef.h"
  30. #ifdef INTNSACL
  31. NSPR_BEGIN_EXTERN_C
  32. /* Functions in nseframe.c */
  33. extern void nserrDispose(NSErr_t * errp);
  34. extern NSEFrame_t * nserrFAlloc(NSErr_t * errp);
  35. extern void nserrFFree(NSErr_t * errp, NSEFrame_t * efp);
  36. extern NSEFrame_t * nserrGenerate(NSErr_t * errp, long retcode, long errorid,
  37. const char * program, int errc, ...);
  38. /* Functions in nserrmsg.c */
  39. extern char * nserrMessage(NSEFrame_t * efp, int flags);
  40. extern char * nserrRetrieve(NSEFrame_t * efp, int flags);
  41. NSPR_END_EXTERN_C
  42. #endif /* INTNSACL */
  43. #endif /* __nserror_h */