| 546 | } |
| 547 | |
| 548 | void soar_pop_callback(agent* thisAgent, |
| 549 | SOAR_CALLBACK_TYPE callback_type) |
| 550 | { |
| 551 | list* head; |
| 552 | soar_callback* cb; |
| 553 | |
| 554 | head = thisAgent->soar_callbacks[callback_type]; |
| 555 | |
| 556 | if (head == NULL) |
| 557 | { |
| 558 | print_string(thisAgent, "Attempt to remove non-existant callback.\n"); |
| 559 | return; |
| 560 | } |
| 561 | |
| 562 | if ((callback_type == PRINT_CALLBACK) |
| 563 | && (head->rest == NULL)) |
| 564 | { |
| 565 | print_string(thisAgent, "Attempt to remove last print callback. Ignored.\n"); |
| 566 | return; |
| 567 | } |
| 568 | |
| 569 | cb = static_cast< soar_callback* >(head->first); |
| 570 | |
| 571 | thisAgent->soar_callbacks[callback_type] = head->rest; |
| 572 | soar_destroy_callback(cb); |
| 573 | free_cons(thisAgent, head); |
| 574 | } |
| 575 | |
| 576 | void soar_push_callback(agent* thisAgent, |
| 577 | SOAR_CALLBACK_TYPE callback_type, |
nothing calls this directly
no test coverage detected