Пример #1
0
void test_klist_append () {
    TASSERT(l1 != NULL);
    klist_append(l1, (void *)item2);
    klist_append(l1, (void *)item3);
    klist_prepend(l1, (void *)item1);
    TASSERT(l1->length == 3);
}
Пример #2
0
int exception_push_handler(int code, ExceptionHandler handler) {
  LinkNode *node = exc_alloc_node();
  node->data = handler;
  
  if (code > (int)(sizeof(exception_stacks) / sizeof(*exception_stacks))) {
    e9printf("exception_add_handler: invalid code: %d\n", code);
    kerror(-1, "invalid code");
    return -1;
  }
  
  klist_prepend(exception_stacks+code, node);
  
  return 0;
}