C:/Users/Dennis/src/lang/russell.orig/src/datatypes/consnodes.h

Go to the documentation of this file.
00001 
00002 /*  Structure definition and macros for manipulation of LISP style lists.
00003  */
00004 
00005 
00006 # define ANYTHING  char
00007 # define NIL 0
00008 
00009 /*
00010  *  The consnode structure and its basic operations.
00011  */
00012 typedef struct cn {
00013     struct cn * cn_tl_field;
00014     ANYTHING * cn_hd_field; } ConsNode;
00015 
00016 # define cn_tail(l) ( (struct cn *) ((l) -> cn_tl_field) )
00017 
00018 # define cn_head(l) ( (l) -> cn_hd_field )
00019 
00020 # define is_null_cn(l) ( (l) == NIL )
00021 
00022 /* The following macros should be used for assignment to the head and
00023  * tail fields of a consnode.
00024  */
00025 
00026 # define cn_sethead(nodeptr,fvalue)  \
00027         ( (nodeptr) -> cn_hd_field = (ANYTHING *)(fvalue) )
00028 
00029 # define cn_settail(nodeptr,list)  \
00030         ( (nodeptr) -> cn_tl_field = (list)  )
00031 
00032 ConsNode * cn_cons();
00033 
00034 ConsNode * cn_del_hd();

Generated on Fri Jan 25 10:39:45 2008 for russell by  doxygen 1.5.4