Back to index

plt-scheme  4.2.1
schexn.h
Go to the documentation of this file.
00001 /* This file was generated by makeexn */
00002 #ifndef _MZEXN_DEFINES
00003 #define _MZEXN_DEFINES
00004 
00005 enum {
00006   MZEXN,
00007   MZEXN_FAIL,
00008   MZEXN_FAIL_CONTRACT,
00009   MZEXN_FAIL_CONTRACT_ARITY,
00010   MZEXN_FAIL_CONTRACT_DIVIDE_BY_ZERO,
00011   MZEXN_FAIL_CONTRACT_CONTINUATION,
00012   MZEXN_FAIL_CONTRACT_VARIABLE,
00013   MZEXN_FAIL_SYNTAX,
00014   MZEXN_FAIL_READ,
00015   MZEXN_FAIL_READ_EOF,
00016   MZEXN_FAIL_READ_NON_CHAR,
00017   MZEXN_FAIL_FILESYSTEM,
00018   MZEXN_FAIL_FILESYSTEM_EXISTS,
00019   MZEXN_FAIL_FILESYSTEM_VERSION,
00020   MZEXN_FAIL_NETWORK,
00021   MZEXN_FAIL_OUT_OF_MEMORY,
00022   MZEXN_FAIL_UNSUPPORTED,
00023   MZEXN_FAIL_USER,
00024   MZEXN_BREAK,
00025   MZEXN_OTHER
00026 };
00027 
00028 #endif
00029 
00030 #ifdef _MZEXN_TABLE
00031 
00032 #define MZEXN_MAXARGS 3
00033 
00034 #ifdef GLOBAL_EXN_ARRAY
00035 static exn_rec exn_table[] = {
00036   { 2, NULL, NULL, 0, NULL, -1 },
00037   { 2, NULL, NULL, 0, NULL, 0 },
00038   { 2, NULL, NULL, 0, NULL, 1 },
00039   { 2, NULL, NULL, 0, NULL, 2 },
00040   { 2, NULL, NULL, 0, NULL, 2 },
00041   { 2, NULL, NULL, 0, NULL, 2 },
00042   { 3, NULL, NULL, 0, NULL, 2 },
00043   { 3, NULL, NULL, 0, NULL, 1 },
00044   { 3, NULL, NULL, 0, NULL, 1 },
00045   { 3, NULL, NULL, 0, NULL, 8 },
00046   { 3, NULL, NULL, 0, NULL, 8 },
00047   { 2, NULL, NULL, 0, NULL, 1 },
00048   { 2, NULL, NULL, 0, NULL, 11 },
00049   { 2, NULL, NULL, 0, NULL, 11 },
00050   { 2, NULL, NULL, 0, NULL, 1 },
00051   { 2, NULL, NULL, 0, NULL, 1 },
00052   { 2, NULL, NULL, 0, NULL, 1 },
00053   { 2, NULL, NULL, 0, NULL, 1 },
00054   { 3, NULL, NULL, 0, NULL, 0 }
00055 };
00056 #else
00057 static exn_rec *exn_table;
00058 #endif
00059 
00060 #endif
00061 
00062 #ifdef _MZEXN_PRESETUP
00063 
00064 #ifndef GLOBAL_EXN_ARRAY
00065   exn_table = (exn_rec *)scheme_malloc(sizeof(exn_rec) * MZEXN_OTHER);
00066   exn_table[MZEXN].args = 2;
00067   exn_table[MZEXN_FAIL].args = 2;
00068   exn_table[MZEXN_FAIL_CONTRACT].args = 2;
00069   exn_table[MZEXN_FAIL_CONTRACT_ARITY].args = 2;
00070   exn_table[MZEXN_FAIL_CONTRACT_DIVIDE_BY_ZERO].args = 2;
00071   exn_table[MZEXN_FAIL_CONTRACT_CONTINUATION].args = 2;
00072   exn_table[MZEXN_FAIL_CONTRACT_VARIABLE].args = 3;
00073   exn_table[MZEXN_FAIL_SYNTAX].args = 3;
00074   exn_table[MZEXN_FAIL_READ].args = 3;
00075   exn_table[MZEXN_FAIL_READ_EOF].args = 3;
00076   exn_table[MZEXN_FAIL_READ_NON_CHAR].args = 3;
00077   exn_table[MZEXN_FAIL_FILESYSTEM].args = 2;
00078   exn_table[MZEXN_FAIL_FILESYSTEM_EXISTS].args = 2;
00079   exn_table[MZEXN_FAIL_FILESYSTEM_VERSION].args = 2;
00080   exn_table[MZEXN_FAIL_NETWORK].args = 2;
00081   exn_table[MZEXN_FAIL_OUT_OF_MEMORY].args = 2;
00082   exn_table[MZEXN_FAIL_UNSUPPORTED].args = 2;
00083   exn_table[MZEXN_FAIL_USER].args = 2;
00084   exn_table[MZEXN_BREAK].args = 3;
00085 #endif
00086 
00087 #endif
00088 
00089 #ifdef _MZEXN_DECL_FIELDS
00090 
00091 static const char *MZEXN_FIELDS[2] = { "message", "continuation-marks" };
00092 static const char *MZEXN_FAIL_CONTRACT_VARIABLE_FIELDS[1] = { "id" };
00093 static const char *MZEXN_FAIL_SYNTAX_FIELDS[1] = { "exprs" };
00094 static const char *MZEXN_FAIL_READ_FIELDS[1] = { "srclocs" };
00095 static const char *MZEXN_BREAK_FIELDS[1] = { "continuation" };
00096 
00097 #endif
00098 
00099 #ifdef _MZEXN_DECL_PROPS
00100 
00101 #define MZEXN_FAIL_SYNTAX_PROPS scheme_make_pair(scheme_make_pair(scheme_source_property, scheme_make_prim(extract_syntax_locations)), scheme_null)
00102 #define MZEXN_FAIL_READ_PROPS scheme_make_pair(scheme_make_pair(scheme_source_property, scheme_make_prim(extract_read_locations)), scheme_null)
00103 
00104 #endif
00105 
00106 #ifdef _MZEXN_SETUP
00107 
00108   SETUP_STRUCT(MZEXN, NULL, "exn", 2, MZEXN_FIELDS, scheme_null, scheme_make_prim(exn_field_check))
00109   SETUP_STRUCT(MZEXN_FAIL, EXN_PARENT(MZEXN), "exn:fail", 0, NULL, scheme_null, NULL)
00110   SETUP_STRUCT(MZEXN_FAIL_CONTRACT, EXN_PARENT(MZEXN_FAIL), "exn:fail:contract", 0, NULL, scheme_null, NULL)
00111   SETUP_STRUCT(MZEXN_FAIL_CONTRACT_ARITY, EXN_PARENT(MZEXN_FAIL_CONTRACT), "exn:fail:contract:arity", 0, NULL, scheme_null, NULL)
00112   SETUP_STRUCT(MZEXN_FAIL_CONTRACT_DIVIDE_BY_ZERO, EXN_PARENT(MZEXN_FAIL_CONTRACT), "exn:fail:contract:divide-by-zero", 0, NULL, scheme_null, NULL)
00113   SETUP_STRUCT(MZEXN_FAIL_CONTRACT_CONTINUATION, EXN_PARENT(MZEXN_FAIL_CONTRACT), "exn:fail:contract:continuation", 0, NULL, scheme_null, NULL)
00114   SETUP_STRUCT(MZEXN_FAIL_CONTRACT_VARIABLE, EXN_PARENT(MZEXN_FAIL_CONTRACT), "exn:fail:contract:variable", 1, MZEXN_FAIL_CONTRACT_VARIABLE_FIELDS, scheme_null, scheme_make_prim(variable_field_check))
00115   SETUP_STRUCT(MZEXN_FAIL_SYNTAX, EXN_PARENT(MZEXN_FAIL), "exn:fail:syntax", 1, MZEXN_FAIL_SYNTAX_FIELDS, MZEXN_FAIL_SYNTAX_PROPS, scheme_make_prim(syntax_field_check))
00116   SETUP_STRUCT(MZEXN_FAIL_READ, EXN_PARENT(MZEXN_FAIL), "exn:fail:read", 1, MZEXN_FAIL_READ_FIELDS, MZEXN_FAIL_READ_PROPS, scheme_make_prim(read_field_check))
00117   SETUP_STRUCT(MZEXN_FAIL_READ_EOF, EXN_PARENT(MZEXN_FAIL_READ), "exn:fail:read:eof", 0, NULL, scheme_null, NULL)
00118   SETUP_STRUCT(MZEXN_FAIL_READ_NON_CHAR, EXN_PARENT(MZEXN_FAIL_READ), "exn:fail:read:non-char", 0, NULL, scheme_null, NULL)
00119   SETUP_STRUCT(MZEXN_FAIL_FILESYSTEM, EXN_PARENT(MZEXN_FAIL), "exn:fail:filesystem", 0, NULL, scheme_null, NULL)
00120   SETUP_STRUCT(MZEXN_FAIL_FILESYSTEM_EXISTS, EXN_PARENT(MZEXN_FAIL_FILESYSTEM), "exn:fail:filesystem:exists", 0, NULL, scheme_null, NULL)
00121   SETUP_STRUCT(MZEXN_FAIL_FILESYSTEM_VERSION, EXN_PARENT(MZEXN_FAIL_FILESYSTEM), "exn:fail:filesystem:version", 0, NULL, scheme_null, NULL)
00122   SETUP_STRUCT(MZEXN_FAIL_NETWORK, EXN_PARENT(MZEXN_FAIL), "exn:fail:network", 0, NULL, scheme_null, NULL)
00123   SETUP_STRUCT(MZEXN_FAIL_OUT_OF_MEMORY, EXN_PARENT(MZEXN_FAIL), "exn:fail:out-of-memory", 0, NULL, scheme_null, NULL)
00124   SETUP_STRUCT(MZEXN_FAIL_UNSUPPORTED, EXN_PARENT(MZEXN_FAIL), "exn:fail:unsupported", 0, NULL, scheme_null, NULL)
00125   SETUP_STRUCT(MZEXN_FAIL_USER, EXN_PARENT(MZEXN_FAIL), "exn:fail:user", 0, NULL, scheme_null, NULL)
00126   SETUP_STRUCT(MZEXN_BREAK, EXN_PARENT(MZEXN), "exn:break", 1, MZEXN_BREAK_FIELDS, scheme_null, scheme_make_prim(break_field_check))
00127 
00128 #endif