#
# Encoding C's type system in Mythryl.
# This module provides the "public"
# view of the implementation.
#
# DEBUG VERSION with CHECKED POINTER DEREFERENCING.
#
# (C) 2002, Lucent Technologies, Bell Laboratories
#
# author: Matthias Blume (blume@research.bell-labs.com)
# Compiled by:
#
src/lib/c-glue-lib/internals/c-internals.libpackage c_debug: (weak) Ckit_Debug { # Ckit_Debug is from
src/lib/c-glue-lib/c-debug.api # First of all, we look mostly like package c...
#
include package c;
# ... but then, we also check for NULL pointers...
#
exception NULL_POINTER;
# ... which means that we have to re-implement some things:
#
package ptr {
include package ptr;
my deref' = \\ p = if (is_null' p ) raise exception NULL_POINTER; else deref' p; fi;
my deref = \\ p = if (is_null p ) raise exception NULL_POINTER; else deref p; fi;
};
};