34 #include <libFreeWRL.h>
36 #include "../vrml_parser/Structs.h"
37 #include "../main/headers.h"
39 #include "../input/EAIHeaders.h"
40 #include "../world_script/fieldGet.h"
43 #if !defined(EXCLUDE_EAI)
58 static void goThroughFields(
struct X3D_Node *boxptr) {
70 np = (
int *) NODE_OFFSETS[boxptr->_nodeType];
74 if (0 != strncmp(stringFieldType(np[0]),
"_", 1) ) {
75 ctmp = (char) mapFieldTypeToEAItype(np[2]) ;
76 dtmp = mapEAItypeToFieldType(ctmp) ;
78 tmpptr = offsetPointer_deref (
char *, boxptr,np[1]);
79 printf(
"%s,%d ",__FILE__,__LINE__) ;
80 printf(
"Field %d %s , ", myc, stringFieldType(np[0])) ;
81 printf(
"offset=%d bytes , ", np[1]) ;
83 printf(
"field_type= %c (%d) , ", ctmp , dtmp) ;
84 printf(
"Routing=%s , ", stringKeywordType(np[3])) ;
85 printf(
"Spec=%d , ", np[4]) ;
87 errcount = UtilEAI_Convert_mem_to_ASCII (dtmp,tmpptr, utilBuf);
89 printf (
"\t\tValue = %s\n",utilBuf);
91 printf (
"\t\tValue = indeterminate....\n");
98 #endif // FOR_DEBUGGING
112 void EAIListener () {
113 int node_id, field_id;
114 int field_type, listener_id;
115 char buf[EAIREADSIZE];
119 eaiverbose = tg->EAI_C_CommonFunctions.eaiverbose;
124 field_id = pp->field_id;
125 node_id = pp->node_id;
126 field_type = pp->field_type;
127 listener_id = pp->listener_id;
133 struct X3D_Node* tableNode = getEAINodeFromTable(node_id,field_id);
134 int actual_offs = getEAIActualOffset(node_id, field_id);
138 printf (
"EAIListener, from table, actual offset is %d\n",actual_offs);
139 printf (
"EAIListener, frim table, field_type is :%d: %s\n",field_type,FIELDTYPES[field_type]);
140 printf (
"EAIListener, from table, table node is %p\n",tableNode);
141 printf (
"EAIListener, from a node of %s\n",stringNodeType(tableNode->_nodeType));
142 printf (
"EAIListener, type %d, node id %d\n",field_id,node_id);
143 printf (
"EAIListener, node type from table as a string is %s\n",stringNodeType(getEAINodeTypeFromTable(node_id)));
144 goThroughFields(tableNode);
145 #endif //FOR_DEBUGGING
148 char *field_pointer = offsetPointer_deref (
char *, tableNode, actual_offs);
149 EAI_Convert_mem_to_ASCII (listener_id,
"EV", field_type, field_pointer, buf);
152 strcat (buf,
"\nEV_EOT");
155 printf (
"Handle Listener, returning %s\n",buf);
159 fwlio_RxTx_sendbuffer(__FILE__,__LINE__,CHANNEL_EAI,buf) ;