PageRenderTime 54ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/src/gpg/error-codes.scm.in

http://github.com/xatom/GPGME-Guile
Autoconf | 67 lines | 59 code | 8 blank | 0 comment | 1 complexity | d35eed46949b2050278d87d3c5c99238 MD5 | raw file
  1. ;;; GPGME/Guile : GPGME with Guile
  2. ;;;
  3. ;;; A Guile binding to the GPGME library
  4. ;;; Error code definitions
  5. ;;;
  6. ;;; Copyright © 2011, 2012, 2013 Atom X Zane
  7. ;;;
  8. ;;; This library is free software: you can redistribute it and/or
  9. ;;; modify it under the terms of the GNU General Public License as
  10. ;;; published by the Free Software Foundation, either version 3 of the
  11. ;;; License, or (at your option) any later version.
  12. ;;;
  13. ;;; This library is distributed in the hope that it will be useful,
  14. ;;; but WITHOUT ANY WARRANTY; without even the implide warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. ;;; General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with this library. If not, see
  20. ;;; <http://www.gnu.org/licenses/>.
  21. ;;; Commentary:
  22. ;; This file defines all of the error codes provided by libgpg-error.
  23. ;; There are a great many of them! All errors and their associated
  24. ;; numeric value have been extracted from <gpg-error.h> with a basic
  25. ;; transformation in the following vein:
  26. ;;
  27. ;; GPG_ERR_[A-Z_]+[A-Z] -> error-code/[a-z-]+[a-z]
  28. ;;
  29. ;; Example: GPG_ERR_NO_VALUE -> error-code/no-value
  30. ;;
  31. ;; Every effort has been made to document each error code, but there
  32. ;; are invariably some omissions due to incomplete documentation
  33. ;; upstream. Luckily, most of the errors listed below are _very_ rare
  34. ;; in the course of using GPGME/G, so hopefully things won't get too
  35. ;; cryptic.
  36. ;;
  37. ;; The code in this file should only ever be run when it's loaded by
  38. ;; @code{errors.scm}; therefore, we are keeping the module loading to
  39. ;; a minimum---if the module is used by @code{errors.scm}, then it
  40. ;; isn't loaded here.
  41. ;;; Code:
  42. (define-immutable-record-type gpg-error-code
  43. (make-error-code code description)
  44. error-code?
  45. (code get-code-value)
  46. (description get-code-description))
  47. ;;; BEGIN ERROR CODES
  48. @@ERROR_CODE_DECLS@@
  49. ;;; END ERROR CODES
  50. (define *error-code-dim* @@ERROR_CODE_DIM@@)
  51. ;; Error codes are just integers, but they are implemented in a
  52. ;; architecture-dependent way. This variable is equal to (expt 2 16),
  53. ;; which is 1+ the highest allowable error code. We will modulo all
  54. ;; error codes by this number, giving us the _real_ error.
  55. (define *error-codes->errors*
  56. (alist->vhash
  57. @@ERROR_CODE_LOOKUP@@
  58. hashq))
  59. ;;; error-codes.scm ends here