Changeset 37f527b in mainline for uspace/app/sbi/src/stree.c
- Timestamp:
- 2010-03-26T21:55:23Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4204ad9
- Parents:
- b535aeb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/stree.c
rb535aeb r37f527b 136 136 } 137 137 138 stree_symbol_attr_t *stree_symbol_attr_new(symbol_attr_class_t sac) 139 { 140 stree_symbol_attr_t *symbol_attr; 141 142 symbol_attr = calloc(1, sizeof(stree_symbol_attr_t)); 143 if (symbol_attr == NULL) { 144 printf("Memory allocation failed.\n"); 145 exit(1); 146 } 147 148 symbol_attr->sac = sac; 149 return symbol_attr; 150 } 151 138 152 stree_proc_t *stree_proc_new(void) 139 153 { … … 414 428 } 415 429 430 stree_as_t *stree_as_new(void) 431 { 432 stree_as_t *as_expr; 433 434 as_expr = calloc(1, sizeof(stree_as_t)); 435 if (as_expr == NULL) { 436 printf("Memory allocation failed.\n"); 437 exit(1); 438 } 439 440 return as_expr; 441 } 442 416 443 stree_nameref_t *stree_nameref_new(void) 417 444 { … … 572 599 573 600 return program; 601 } 602 603 /** Determine if @a symbol has attribute of class @a sac. */ 604 bool_t stree_symbol_has_attr(stree_symbol_t *symbol, symbol_attr_class_t sac) 605 { 606 list_node_t *node; 607 stree_symbol_attr_t *attr; 608 609 node = list_first(&symbol->attr); 610 while (node != NULL) { 611 attr = list_node_data(node, stree_symbol_attr_t *); 612 if (attr->sac == sac) 613 return b_true; 614 615 node = list_next(&symbol->attr, node); 616 } 617 618 return b_false; 574 619 } 575 620
Note:
See TracChangeset
for help on using the changeset viewer.