1 #include <portability.h>
57 #include "soar_TraceNames.h"
66 using namespace soar_TraceNames;
96 const char * output_link_name)
101 print (thisAgent,
"Error: tried to add_output_function with duplicate name %s\n",
105 assert(0 &&
"error in io.cpp (control_c_handler() used to be called here)");
203 if (! (
id && attr && value)) {
204 print (thisAgent,
"Error: an input routine gave a NULL argument to add_input_wme.\n");
256 print (thisAgent,
"Error: an input routine called remove_input_wme on a NULL wme.\n");
262 print (thisAgent,
"Error: an input routine called remove_input_wme on a wme that\n");
263 print (thisAgent,
"isn't one of the input wmes currently in working memory.\n");
379 #define NEW_OL_STATUS 0
380 #define UNCHANGED_OL_STATUS 1
381 #define MODIFIED_BUT_SAME_TC_OL_STATUS 2
384 #define MODIFIED_OL_STATUS 3
386 #define REMOVED_OL_STATUS 4
414 #define LINK_NAME_SIZE 1024
489 list *wmes_being_added,
490 list *wmes_being_removed) {
495 for (c=wmes_being_added; c!=
NIL; c=c->
rest) {
513 if ( !strcmp(
id,
"I3" ) ) {
514 print(thisAgent,
"--> Added to I3, but doesn't register as an OL change!" );
520 for (c=wmes_being_removed; c!=
NIL; c=c->
rest) {
552 if (c->
first == ol)
break;
555 strncpy(msg,
"io.c: Internal error: can't find output link in id's list\n",
BUFFER_MSG_SIZE);
560 else id->id.associated_output_links = c->
rest;
620 allocate_with_pool (thisAgent, &thisAgent->
io_wme_pool, &New);
686 output_call_data.
outputs = iw_list;
687 #ifndef NO_TIMING_STUFF
695 #ifndef NO_TIMING_STUFF
709 output_call_data.
outputs = iw_list;
710 #ifndef NO_TIMING_STUFF
718 #ifndef NO_TIMING_STUFF
734 output_call_data.
outputs = iw_list;
735 #ifndef NO_TIMING_STUFF
743 #ifndef NO_TIMING_STUFF
758 output_call_data.
outputs = iw_list;
759 #ifndef NO_TIMING_STUFF
767 #ifndef NO_TIMING_STUFF
799 for (iw=outputs; iw!=
NIL; iw=iw->
next)
800 if ( ((
id==
NIL)||(
id==iw->
id)) &&
832 Bool possible_id, possible_var, possible_sc, possible_ic, possible_fc;
836 strlen(input_string),
847 int_val = strtol (input_string,NULL,10);
849 print (thisAgent,
"Text Input Error: bad integer (probably too large)\n");
858 float_val = strtod (input_string,NULL);
860 print (thisAgent,
"Text Input Error: bad floating point number\n");
870 #define MAX_TEXT_INPUT_LINE_LENGTH 1000
873 char **text_read_position) {
876 int input_lexeme_length;
878 ch = *text_read_position;
884 if ((*ch==
'\n')||(*ch==0)) { *text_read_position = ch;
return NIL; }
888 input_string[0] = *ch++;
890 *text_read_position = ch;
895 input_lexeme_length = 0;
897 input_string[input_lexeme_length++] = *ch++;
900 input_string[input_lexeme_length] = 0;
901 *text_read_position = ch;