[brlcad-commits] SF.net SVN: brlcad:[33653] brlcad/trunk/src/adrt/adrt.h
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <eri...@us...> - 2009-02-04 15:08:45
|
Revision: 33653 http://brlcad.svn.sourceforge.net/brlcad/?rev=33653&view=rev Author: erikgreenwald Date: 2009-02-04 15:08:41 +0000 (Wed, 04 Feb 2009) Log Message: ----------- macro to turn network opcodes into human readable names Modified Paths: -------------- brlcad/trunk/src/adrt/adrt.h Modified: brlcad/trunk/src/adrt/adrt.h =================================================================== --- brlcad/trunk/src/adrt/adrt.h 2009-02-04 13:45:17 UTC (rev 33652) +++ brlcad/trunk/src/adrt/adrt.h 2009-02-04 15:08:41 UTC (rev 33653) @@ -44,16 +44,17 @@ ADRT_WORK_SHOTLINE, ADRT_WORK_SPALL, ADRT_WORK_SELECT, - ADRT_WORK_MINMAX + ADRT_WORK_MINMAX, + ADRT_WORK_END }; static char *adrt_work_table[40] = { "ADRT_WORK_INIT", - "ADRT_WORK_STATUS,", - "ADRT_WORK_FRAME_ATTR,", - "ADRT_WORK_FRAME,", - "ADRT_WORK_SHOTLINE,", - "ADRT_WORK_SPALL,", - "ADRT_WORK_SELECT,", + "ADRT_WORK_STATUS", + "ADRT_WORK_FRAME_ATTR", + "ADRT_WORK_FRAME", + "ADRT_WORK_SHOTLINE", + "ADRT_WORK_SPALL", + "ADRT_WORK_SELECT", "ADRT_WORK_MINMAX", NULL}; @@ -70,7 +71,8 @@ ADRT_NETOP_WORK, ADRT_NETOP_MESG, ADRT_NETOP_QUIT, - ADRT_NETOP_SHUTDOWN + ADRT_NETOP_SHUTDOWN, + ADRT_NETOP_END }; static char *adrt_netop_table[40] = { "ADRT_NETOP_NOP", @@ -83,6 +85,13 @@ "ADRT_NETOP_SHUTDOWN", NULL}; +/* fill in a human readable version of the adrt op (for debugging) */ +#define ADRT_MESSAGE_NAME(op) \ + (op >= ADRT_WORK_BASE && op <= ADRT_WORK_END) ? adrt_work_table[op-ADRT_WORK_BASE] : \ + (op >= ADRT_NETOP_BASE && op <= ADRT_NETOP_END) ? adrt_netop_table[op-ADRT_NETOP_BASE] : \ + "Unknown" + + #define ADRT_VER_KEY 0 #define ADRT_VER_DETAIL "ADRT - Advanced Distributed Ray Tracer" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |