Changeset 94d484a in mainline for uspace/app/sbi/src/stree.c
- Timestamp:
- 2010-03-07T17:45:33Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d0febca
- Parents:
- fa36f29
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/stree.c
rfa36f29 r94d484a 149 149 } 150 150 151 stree_arg_attr_t *stree_arg_attr_new(arg_attr_class_t aac) 152 { 153 stree_arg_attr_t *arg_attr; 154 155 arg_attr = calloc(1, sizeof(stree_arg_attr_t)); 156 if (arg_attr == NULL) { 157 printf("Memory allocation failed.\n"); 158 exit(1); 159 } 160 161 arg_attr->aac = aac; 162 return arg_attr; 163 } 164 151 165 stree_stat_t *stree_stat_new(stat_class_t sc) 152 166 { … … 267 281 } 268 282 283 stree_except_t *stree_except_new(void) 284 { 285 stree_except_t *except_c; 286 287 except_c = calloc(1, sizeof(stree_except_t)); 288 if (except_c == NULL) { 289 printf("Memory allocation failed.\n"); 290 exit(1); 291 } 292 293 return except_c; 294 } 295 269 296 stree_block_t *stree_block_new(void) 270 297 { … … 361 388 } 362 389 390 stree_index_t *stree_index_new(void) 391 { 392 stree_index_t *index; 393 394 index = calloc(1, sizeof(stree_index_t)); 395 if (index == NULL) { 396 printf("Memory allocation failed.\n"); 397 exit(1); 398 } 399 400 return index; 401 } 402 363 403 stree_nameref_t *stree_nameref_new(void) 364 404 { … … 428 468 } 429 469 470 stree_taccess_t *stree_taccess_new(void) 471 { 472 stree_taccess_t *taccess; 473 474 taccess = calloc(1, sizeof(stree_taccess_t)); 475 if (taccess == NULL) { 476 printf("Memory allocation failed.\n"); 477 exit(1); 478 } 479 480 return taccess; 481 } 482 430 483 stree_tapply_t *stree_tapply_new(void) 431 484 { … … 441 494 } 442 495 443 stree_t access_t *stree_taccess_new(void)444 { 445 stree_t access_t *taccess;446 447 t access = calloc(1, sizeof(stree_taccess_t));448 if (t access== NULL) {449 printf("Memory allocation failed.\n"); 450 exit(1); 451 } 452 453 return t access;496 stree_tindex_t *stree_tindex_new(void) 497 { 498 stree_tindex_t *tindex; 499 500 tindex = calloc(1, sizeof(stree_tindex_t)); 501 if (tindex == NULL) { 502 printf("Memory allocation failed.\n"); 503 exit(1); 504 } 505 506 return tindex; 454 507 } 455 508 … … 506 559 return program; 507 560 } 561 562 /** Determine if argument @a arg has attribute of class @a aac. */ 563 bool_t stree_arg_has_attr(stree_fun_arg_t *arg, arg_attr_class_t aac) 564 { 565 list_node_t *node; 566 stree_arg_attr_t *attr; 567 568 node = list_first(&arg->attr); 569 while (node != NULL) { 570 attr = list_node_data(node, stree_arg_attr_t *); 571 if (attr->aac == aac) 572 return b_true; 573 574 node = list_next(&arg->attr, node); 575 } 576 577 return b_false; 578 } 579 580 /** Determine wheter @a a is derived (transitively) from @a b. 581 * 582 * @param a Derived CSI. 583 * @param b Base CSI. 584 * @return @c b_true if @a a is equal to or directly or indirectly 585 * derived from @a b. 586 */ 587 bool_t stree_is_csi_derived_from_csi(stree_csi_t *a, stree_csi_t *b) 588 { 589 stree_csi_t *csi; 590 591 csi = a; 592 while (csi != NULL) { 593 if (csi == b) 594 return b_true; 595 596 csi = csi->base_csi; 597 } 598 599 /* We went all the way to the root and did not find b. */ 600 return b_false; 601 }
Note:
See TracChangeset
for help on using the changeset viewer.