cslerror.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /* cslerror.h Copyright (C) 1989-2002 Codemist Ltd */
  2. /*
  3. * Error codes and functions.
  4. *
  5. */
  6. /*
  7. * This code may be used and modified, and redistributed in binary
  8. * or source form, subject to the "CCL Public License", which should
  9. * accompany it. This license is a variant on the BSD license, and thus
  10. * permits use of code derived from this in either open and commercial
  11. * projects: but it does require that updates to this code be made
  12. * available back to the originators of the package.
  13. * Before merging other code in with this or linking this code
  14. * with other packages or libraries please check that the license terms
  15. * of the other material are compatible with those of this.
  16. */
  17. /* Signature: 3cbc3365 08-Apr-2002 */
  18. #ifndef header_cslerror_h
  19. #define header_cslerror_h 1
  20. extern Lisp_Object interrupted(Lisp_Object p);
  21. extern Lisp_Object MS_CDECL error(int nargs, int code, ...);
  22. extern Lisp_Object MS_CDECL cerror(int nargs, int code1, int code2, ...);
  23. extern Lisp_Object too_few_2(Lisp_Object env, Lisp_Object a1);
  24. extern Lisp_Object too_many_1(Lisp_Object env, Lisp_Object a1, Lisp_Object a2);
  25. extern Lisp_Object wrong_no_0a(Lisp_Object env, Lisp_Object a1);
  26. extern Lisp_Object wrong_no_0b(Lisp_Object env, Lisp_Object a1, Lisp_Object a2);
  27. extern Lisp_Object wrong_no_3a(Lisp_Object env, Lisp_Object a1);
  28. extern Lisp_Object wrong_no_3b(Lisp_Object env, Lisp_Object a1, Lisp_Object a2);
  29. extern Lisp_Object wrong_no_na(Lisp_Object env, Lisp_Object a1);
  30. extern Lisp_Object wrong_no_nb(Lisp_Object env, Lisp_Object a1, Lisp_Object a2);
  31. extern Lisp_Object MS_CDECL wrong_no_1(Lisp_Object env, int nargs, ...);
  32. extern Lisp_Object MS_CDECL wrong_no_2(Lisp_Object env, int nargs, ...);
  33. extern Lisp_Object bad_special2(Lisp_Object env, Lisp_Object a1, Lisp_Object a2);
  34. extern Lisp_Object MS_CDECL bad_specialn(Lisp_Object env, int nargs, ...);
  35. extern Lisp_Object aerror(char *s); /* Called from C not Lisp */
  36. extern Lisp_Object aerror0(char *s);
  37. extern Lisp_Object aerror1(char *s, Lisp_Object a);
  38. extern Lisp_Object aerror2(char *s, Lisp_Object a, Lisp_Object b);
  39. extern void MS_CDECL fatal_error(int code, ...);
  40. #define GC_MESSAGES 0x01
  41. #define FASL_MESSAGES 0x02
  42. #define VERBOSE_MSGS 0x04
  43. #define GC_MSG_BITS 0x07
  44. #define HEADLINE_FLAG 0x08
  45. #define MESSAGES_FLAG 0x10
  46. #define ALWAYS_NOISY 0x20
  47. #define verbos_flag (miscflags & GC_MSG_BITS)
  48. /*
  49. * It is essential that the #define values set up here are kept in
  50. * step with the textual error messages in the array that follows...
  51. */
  52. #define err_bad_car 0 /* + the atom */
  53. #define err_bad_cdr 1 /* + the atom */
  54. #define err_no_store 2 /* no extras */
  55. #define err_undefined_function_1 3 /* + fn name */
  56. #define err_undefined_function_2 4 /* + fn name */
  57. #define err_undefined_function_n 5 /* + fn name */
  58. #define err_wrong_no_args 6 /* fn name, actual arg count */
  59. #define err_unbound_lexical 7 /* + name */
  60. #define err_bad_rplac 8 /* + atom */
  61. #define err_bad_arith 9 /* + bad value */
  62. #define err_redef_special 10 /* + name */
  63. #define err_bad_arg 11 /* + offending value */
  64. #define err_bad_declare 12 /* + offending value */
  65. #define err_bad_fn 13 /* + offending value */
  66. #define err_unset_var 14 /* + name */
  67. #define err_too_many_args1 15 /* no extras */
  68. #define err_too_many_args2 16 /* no extras */
  69. #define err_bad_apply 17 /* + bad thing */
  70. #define err_macroex_hook 18 /* what it is */
  71. #define err_block_tag 19 /* bad tag */
  72. #define err_go_tag 20 /* bad tag */
  73. #define err_excess_args 21
  74. #define err_insufficient_args 22
  75. #define err_bad_bvl 23 /* + offending value */
  76. #define err_bad_keyargs 24
  77. #define err_write_err 25
  78. #define err_bad_endp 26 /* + the non-null atom */
  79. #define err_no_fasldir 27
  80. #define err_no_fasl 28 /* plus module name */
  81. #define err_open_failed 29 /* plus file name */
  82. #define err_pipe_failed 30 /* plus command for execution */
  83. #define err_stack_overflow 31
  84. #define err_top_bit 32
  85. #define err_mem_spans_zero 33
  86. #define err_registration 34
  87. #ifdef INCLUDE_ERROR_STRING_TABLE
  88. static char *error_message_table[] =
  89. {
  90. "attempt to take car of an atom",
  91. "attempt to take cdr of an atom",
  92. "insufficient freestore to run this package",
  93. "undefined function (1 arg)",
  94. "undefined function (2 args)",
  95. "undefined function",
  96. "wrong number of arguments",
  97. "unbound lexical variable",
  98. "bad rplaca/rplacd",
  99. "bad argument for an arithmetic function",
  100. "attempt to redefine a special form",
  101. "not a variable",
  102. "bad use of declare",
  103. "attempt to apply non-function",
  104. "unset variable",
  105. "too many arguments",
  106. "too many arguments",
  107. "object not valid as a function (apply,",
  108. "macroexpand-hook failure",
  109. "block tag not found",
  110. "go tag not found",
  111. "too many arguments provided",
  112. "not enough arguments provided",
  113. "bad item in bound variable list",
  114. "bad keyword arguments",
  115. "write-error on file",
  116. "endp used on badly terminated list",
  117. "environment parameter 'fasldir' not set",
  118. "loadable module not found for loading",
  119. "file could not be opened",
  120. "unable to establish pipe",
  121. "stack overflow",
  122. "top bit of address has unexpected value",
  123. "memory block spans the zero address",
  124. "registration code corrupt or invalid",
  125. "dummy final error message"
  126. };
  127. #endif
  128. #endif /* header_cslerror_h */
  129. /* end of cslerror.h */