Lines Matching refs:current
90 fprintf(fp, "\t%s->chars = str;\n",current->label); \
91 fprintf(fp, "\t%s->len = len;\n",current->label); \
107 fprintf(fp, "\t%s->subids = sub;\n",current->label);\
108 fprintf(fp, "\t%s->len = len;\n",current->label);\
157 static struct tree *find_node(struct tree *current, char *label);
161 static void init_tree_first_pass(struct tree *current, int *index, int *object_index, int *column_i…
162 static void init_tree_second_pass(struct tree *current);
165 static void output_tree_c(struct tree *current);
167 static void output_extern_function(FILE *fp, struct tree *current);
172 static void output_subid_table(FILE *fp, struct tree *current, int *subid_index);
173 static void output_enum_table(FILE *fp, struct tree *current, int *enum_index);
174 static void output_object_table(FILE *fp, struct tree *current, int *subid_index, int *enum_index, …
175 static void output_entry_table(FILE *fp, struct tree *current, int *index_index, int *size);
176 static void output_column_table(FILE *fp, struct tree *current, int *subid_index, int *enum_index, …
177 static void output_node_table(FILE *fp, struct tree *current, int *size);
180 static void output_stub_h(struct tree *current);
183 static void output_stub_c(struct tree *current);
184 static void output_appl_c(struct tree *current);
185 static void output_trap_c(struct tree *current);
186 static void output_entry_function(FILE *fp, struct tree *current);
187 static void output_single_obj_function(FILE *fp, struct tree *current);
407 static void init_tree_first_pass(struct tree *current, int *node_index, int *object_index, int *col… in init_tree_first_pass() argument
415 current->node_index = *node_index; in init_tree_first_pass()
420 node_type = get_node_type(current); in init_tree_first_pass()
421 current->node_type = node_type; in init_tree_first_pass()
425 current->object_index = *object_index; in init_tree_first_pass()
426 current->column_index = -1; in init_tree_first_pass()
427 current->entry_index = -1; in init_tree_first_pass()
432 current->object_index = -1; in init_tree_first_pass()
433 current->column_index = *column_index; in init_tree_first_pass()
434 current->entry_index = -1; in init_tree_first_pass()
440 current->object_index = -1; in init_tree_first_pass()
441 current->column_index = -1; in init_tree_first_pass()
442 current->entry_index = -1; in init_tree_first_pass()
446 current->object_index = -1; in init_tree_first_pass()
447 current->column_index = -1; in init_tree_first_pass()
448 current->entry_index = *entry_index; in init_tree_first_pass()
454 node_type, current->label); in init_tree_first_pass()
460 next = current->child_list; in init_tree_first_pass()
469 current->next = next; in init_tree_first_pass()
478 parent = current; in init_tree_first_pass()
508 current->next = NULL; in init_tree_first_pass()
516 current->next = next; in init_tree_first_pass()
521 for(tp = current->child_list; tp; tp = tp->next_peer) in init_tree_first_pass()
530 static void init_tree_second_pass(struct tree *current) in init_tree_second_pass() argument
539 next = current->next; in init_tree_second_pass()
553 current->next = next; in init_tree_second_pass()
557 switch(current->node_type) in init_tree_second_pass()
560 if(current->parent->node_type != ENTRY) in init_tree_second_pass()
563 current->parent->node_type, in init_tree_second_pass()
564 current->parent->label, in init_tree_second_pass()
565 current->label); in init_tree_second_pass()
567 if(current->parent->parent->node_type != TABLE) in init_tree_second_pass()
570 current->parent->parent->node_type, in init_tree_second_pass()
571 current->parent->parent->label, in init_tree_second_pass()
572 current->label); in init_tree_second_pass()
575 if( (current->n_indexs != 0) || ( current->indexs != NULL) ) in init_tree_second_pass()
578 current->label); in init_tree_second_pass()
585 if(current->parent->node_type != TABLE) in init_tree_second_pass()
588 current->parent->node_type, in init_tree_second_pass()
589 current->parent->label, in init_tree_second_pass()
590 current->label); in init_tree_second_pass()
594 if( (current->n_indexs == 0) || ( current->indexs == NULL) ) in init_tree_second_pass()
597 current->label); in init_tree_second_pass()
600 indexs = current->indexs; in init_tree_second_pass()
608 current->label); in init_tree_second_pass()
625 current->label); in init_tree_second_pass()
636 if( (current->n_indexs != 0) || ( current->indexs != NULL) ) in init_tree_second_pass()
639 current->label, in init_tree_second_pass()
640 current->node_type); in init_tree_second_pass()
647 for(tp = current->child_list; tp; tp = tp->next_peer) in init_tree_second_pass()
689 static void output_extern_function(FILE *fp, struct tree *current) in output_extern_function() argument
695 switch(current->node_type) in output_extern_function()
698 if(current->access & READ_FLAG) in output_extern_function()
700 switch(current->type) in output_extern_function()
707 current->label, in output_extern_function()
708 current->label); in output_extern_function()
715 current->label, in output_extern_function()
716 current->label); in output_extern_function()
721 current->label, in output_extern_function()
722 current->label); in output_extern_function()
727 current->type, in output_extern_function()
728 current->label); in output_extern_function()
731 if(current->access & WRITE_FLAG) in output_extern_function()
733 switch(current->type) in output_extern_function()
740 current->label, in output_extern_function()
741 current->label); in output_extern_function()
748 current->label, in output_extern_function()
749 current->label); in output_extern_function()
754 current->label, in output_extern_function()
755 current->label); in output_extern_function()
760 current->type, in output_extern_function()
761 current->label); in output_extern_function()
765 if( (current->access & READ_FLAG) || (current->access & WRITE_FLAG) ) in output_extern_function()
767 switch(current->type) in output_extern_function()
779 current->label, in output_extern_function()
780 current->label); in output_extern_function()
785 current->label, in output_extern_function()
786 current->label); in output_extern_function()
791 current->type, in output_extern_function()
792 current->label); in output_extern_function()
800 if(current->access & READ_FLAG) in output_extern_function()
803 current->label); in output_extern_function()
805 switch(current->type) in output_extern_function()
812 current->label); in output_extern_function()
819 current->label); in output_extern_function()
824 current->label); in output_extern_function()
829 current->type, in output_extern_function()
830 current->label); in output_extern_function()
833 indexs = current->parent->indexs; in output_extern_function()
883 if(current->access & WRITE_FLAG) in output_extern_function()
886 current->label); in output_extern_function()
888 indexs = current->parent->indexs; in output_extern_function()
936 switch(current->type) in output_extern_function()
943 current->label); in output_extern_function()
950 current->label); in output_extern_function()
955 current->label); in output_extern_function()
960 current->type, in output_extern_function()
961 current->label); in output_extern_function()
965 if( (current->access & READ_FLAG) || (current->access & WRITE_FLAG) ) in output_extern_function()
967 switch(current->type) in output_extern_function()
979 current->label, in output_extern_function()
980 current->label); in output_extern_function()
985 current->label, in output_extern_function()
986 current->label); in output_extern_function()
991 current->type, in output_extern_function()
992 current->label); in output_extern_function()
1001 current->label, in output_extern_function()
1002 toupper(current->label[0]), in output_extern_function()
1003 &(current->label[1]), in output_extern_function()
1004 current->label); in output_extern_function()
1007 indexs = current->indexs; in output_extern_function()
1054 current->label, in output_extern_function()
1055 toupper(current->label[0]), in output_extern_function()
1056 &(current->label[1]), in output_extern_function()
1057 current->label); in output_extern_function()
1062 for(tp = current->child_list; tp; tp = tp->next_peer) in output_extern_function()
1071 static void output_enum_table(FILE *fp, struct tree *current, int *enum_index) in output_enum_table() argument
1077 for(enums = current->enums; enums; enums = enums->next) in output_enum_table()
1098 for(tp = current->child_list; tp; tp = tp->next_peer) in output_enum_table()
1107 static void output_subid_table(FILE *fp, struct tree *current, int *subid_index) in output_subid_table() argument
1116 if( (current->node_type == OBJECT) in output_subid_table()
1117 || (current->node_type == COLUMN) ) in output_subid_table()
1122 parent = current; in output_subid_table()
1139 for(tp = current->child_list; tp; tp = tp->next_peer) in output_subid_table()
1148 static void output_object_table(FILE *fp, struct tree *current, int *subid_index, int *enum_index, … in output_object_table() argument
1156 if(current->node_type == OBJECT) in output_object_table()
1159 current->object_index); in output_object_table()
1163 parent = current; in output_object_table()
1173 switch(current->type) in output_object_table()
1210 current->type, in output_object_table()
1211 current->label); in output_object_table()
1215 if(current->enums) in output_object_table()
1225 if( (current->access & READ_FLAG) && (current->access & WRITE_FLAG) ) in output_object_table()
1230 if( (current->access & READ_FLAG) && !(current->access & WRITE_FLAG) ) in output_object_table()
1235 if( !(current->access & READ_FLAG) && (current->access & WRITE_FLAG) ) in output_object_table()
1248 if(current->access & READ_FLAG) in output_object_table()
1250 fprintf(fp, ", get_%s", current->label); in output_object_table()
1258 if(current->access & WRITE_FLAG) in output_object_table()
1260 fprintf(fp, ", set_%s", current->label); in output_object_table()
1268 if( (current->access & READ_FLAG) || (current->access & WRITE_FLAG) ) in output_object_table()
1270 switch(current->type) in output_object_table()
1279 fprintf(fp,",free_%s",current->label); in output_object_table()
1295 if( (current->node_type == OBJECT) in output_object_table()
1296 || (current->node_type == COLUMN) ) in output_object_table()
1298 parent = current; in output_object_table()
1308 for(enums = current->enums; enums; enums = enums->next) in output_object_table()
1314 for(tp = current->child_list; tp; tp = tp->next_peer) in output_object_table()
1323 static void output_index_table(FILE *fp, struct tree *current, int *index_index) in output_index_table() argument
1329 for(indexs = current->indexs; indexs; indexs = indexs->next) in output_index_table()
1382 for(tp = current->child_list; tp; tp = tp->next_peer) in output_index_table()
1391 static void output_entry_table(FILE *fp, struct tree *current, int *index_index, int *size) in output_entry_table() argument
1396 if(current->node_type == ENTRY) in output_entry_table()
1402 current->entry_index); in output_entry_table()
1407 current->n_indexs); in output_entry_table()
1409 for(indexs = current->indexs; indexs; indexs = indexs->next) in output_entry_table()
1415 fprintf(fp, ", get_%s", current->label); in output_entry_table()
1418 fprintf(fp, ", free_%s", current->label); in output_entry_table()
1427 for(tp = current->child_list; tp; tp = tp->next_peer) in output_entry_table()
1436 static void output_column_table(FILE *fp, struct tree *current, int *subid_index, int *enum_index, … in output_column_table() argument
1443 if(current->node_type == COLUMN) in output_column_table()
1451 current->column_index); in output_column_table()
1455 parent = current; in output_column_table()
1465 switch(current->type) in output_column_table()
1502 current->type, in output_column_table()
1503 current->label); in output_column_table()
1507 if(current->enums) in output_column_table()
1517 if( (current->access & READ_FLAG) && (current->access & WRITE_FLAG) ) in output_column_table()
1522 if( (current->access & READ_FLAG) && !(current->access & WRITE_FLAG) ) in output_column_table()
1527 if( !(current->access & READ_FLAG) && (current->access & WRITE_FLAG) ) in output_column_table()
1541 if(current->access & READ_FLAG) in output_column_table()
1543 fprintf(fp, ", get_%s", current->label); in output_column_table()
1551 if(current->access & WRITE_FLAG) in output_column_table()
1553 fprintf(fp, ", set_%s", current->label); in output_column_table()
1561 fprintf(fp, ", &entry_table[%d]", current->parent->entry_index); in output_column_table()
1565 for(child = current->parent->child_list; child != current; child = child->next_peer) in output_column_table()
1606 if( (current->node_type == OBJECT) in output_column_table()
1607 || (current->node_type == COLUMN) ) in output_column_table()
1609 parent = current; in output_column_table()
1619 for(enums = current->enums; enums; enums = enums->next) in output_column_table()
1625 for(tp = current->child_list; tp; tp = tp->next_peer) in output_column_table()
1634 static void output_node_table(FILE *fp, struct tree *current, int *size) in output_node_table() argument
1640 current->node_index); in output_node_table()
1643 if(current->parent == NULL) in output_node_table()
1650 current->parent->node_index); in output_node_table()
1654 if(current->child_list == NULL) in output_node_table()
1661 current->child_list->node_index); in output_node_table()
1665 if(current->next_peer == NULL) in output_node_table()
1672 current->next_peer->node_index); in output_node_table()
1676 if(current->next == NULL) in output_node_table()
1683 current->next->node_index); in output_node_table()
1688 current->label, current->subid); in output_node_table()
1691 switch(current->node_type) in output_node_table()
1695 current->object_index); in output_node_table()
1700 current->column_index); in output_node_table()
1712 current->type, current->label); in output_node_table()
1721 for(tp = current->child_list; tp; tp = tp->next_peer) in output_node_table()
1730 static void output_tree_c(struct tree *current) in output_tree_c() argument
1772 output_subid_table(fp, current, &subid_index); in output_tree_c()
1779 output_enum_table(fp, current, &enum_index); in output_tree_c()
1788 output_object_table(fp, current, &subid_index, &enum_index, &size); in output_tree_c()
1795 output_index_table(fp, current, &index_index); in output_tree_c()
1803 output_entry_table(fp, current, &index_index, &size); in output_tree_c()
1812 output_column_table(fp, current, &subid_index, &enum_index, &size); in output_tree_c()
1819 output_node_table(fp, current, &size); in output_tree_c()
1831 static struct tree *find_node(struct tree *current, char *label) in find_node() argument
1837 if(strcmp(current->label, label) == 0) in find_node()
1839 return current; in find_node()
1842 for(tp = current->child_list; tp; tp = tp->next_peer) in find_node()
1857 static void output_structure(FILE *fp, struct tree *current) in output_structure() argument
1862 if(current->node_type == ENTRY) in output_structure()
1869 toupper(current->label[0]), in output_structure()
1870 &(current->label[1])); in output_structure()
1871 for(child = current->child_list; child; child = child->next_peer) in output_structure()
1904 toupper(current->label[0]), in output_structure()
1905 &(current->label[1])); in output_structure()
1909 for(tp = current->child_list; tp; tp = tp->next_peer) in output_structure()
1918 static void output_stub_h(struct tree *current) in output_stub_h() argument
1958 output_structure(fp, current); in output_stub_h()
1961 output_extern_function(fp, current); in output_stub_h()
2245 static void output_entry_function(FILE *fp, struct tree *current) in output_entry_function() argument
2253 switch(current->node_type) in output_entry_function()
2256 if( !(current->access & WRITE_FLAG) ) in output_entry_function()
2264 fp = output_file(current->label); in output_entry_function()
2267 current->label); in output_entry_function()
2271 switch(current->node_type) in output_entry_function()
2274 if(current->access & READ_FLAG) in output_entry_function()
2278 current->label); in output_entry_function()
2280 switch(current->type) in output_entry_function()
2287 current->label); in output_entry_function()
2294 current->label); in output_entry_function()
2299 current->label); in output_entry_function()
2304 current->type, in output_entry_function()
2305 current->label); in output_entry_function()
2308 indexs = current->parent->indexs; in output_entry_function()
2357 switch(current->type) in output_entry_function()
2365 fprintf(fp,"\t*%s = 1;\n",current->label); in output_entry_function()
2388 current->type, in output_entry_function()
2389 current->label); in output_entry_function()
2395 if(current->access & WRITE_FLAG) in output_entry_function()
2399 current->label); in output_entry_function()
2401 indexs = current->parent->indexs; in output_entry_function()
2439 switch(current->type) in output_entry_function()
2446 current->label); in output_entry_function()
2449 fprintf(fp, "\t\t\tprintf(\"The new value is %%d\\n\",%s);\n",current->label); in output_entry_function()
2457 current->label); in output_entry_function()
2461 fprintf(fp, "\t\t\tmemcpy(buf,%s->chars,%s->len);\n",current->label,current->label); in output_entry_function()
2462 fprintf(fp, "\t\t\tbuf[%s->len+1] = '\\0';\n",current->label); in output_entry_function()
2469 current->label); in output_entry_function()
2472 fprintf(fp, "\t\t\tprintf(\"The new value is %%s\\n\",SSAOidString(%s));\n",current->label); in output_entry_function()
2478 current->type, in output_entry_function()
2479 current->label); in output_entry_function()
2486 if( (current->access & READ_FLAG) || (current->access & WRITE_FLAG) ) in output_entry_function()
2488 switch(current->type) in output_entry_function()
2501 current->label, in output_entry_function()
2502 current->label); in output_entry_function()
2504 fprintf(fp, "\t if(%s->",current->label); in output_entry_function()
2510 current->label, in output_entry_function()
2511 current->label); in output_entry_function()
2513 fprintf(fp, "\t if(%s->",current->label); in output_entry_function()
2518 current->type, in output_entry_function()
2519 current->label); in output_entry_function()
2521 switch(current->type) in output_entry_function()
2532 … fprintf(fp, "chars!=NULL && %s->len !=0)\n",current->label); in output_entry_function()
2534 … fprintf(fp, "\t\tfree(%s->chars);\n",current->label); in output_entry_function()
2535 fprintf(fp,"\t\t%s->len = 0;\n",current->label); in output_entry_function()
2541 … fprintf(fp, "subids!=NULL && %s->len !=0)\n",current->label); in output_entry_function()
2543 … fprintf(fp, "\t\tfree(%s->subids);\n",current->label); in output_entry_function()
2544 fprintf(fp,"\t\t%s->len = 0;\n",current->label); in output_entry_function()
2551 current->type, in output_entry_function()
2552 current->label); in output_entry_function()
2562 current->label, in output_entry_function()
2563 toupper(current->label[0]), in output_entry_function()
2564 &(current->label[1]), in output_entry_function()
2565 current->label); in output_entry_function()
2567 indexs = current->indexs; in output_entry_function()
2614 current->label, in output_entry_function()
2615 toupper(current->label[0]), &(current->label[1]), in output_entry_function()
2616 toupper(current->label[0]), &(current->label[1])); in output_entry_function()
2617 fprintf(fp,"\tif(%s_data == NULL) return SNMP_ERR_GENERR;\n",current->label); in output_entry_function()
2621 for(child = current->child_list; child; child = child->next_peer) in output_entry_function()
2657 fprintf(fp,"\t &((*%s_data)->%s),\n",current->label,child->label); in output_entry_function()
2663 … fprintf(fp,"\t\tfree_%s(*%s_data);\n",current->label,current->label); in output_entry_function()
2664 fprintf(fp, "\t\t*%s_data=NULL;\n",current->label); in output_entry_function()
2688 current->label, toupper(current->label[0]), in output_entry_function()
2689 &(current->label[1]), current->label); in output_entry_function()
2692 fprintf(fp,"\tif (%s) {\n", current->label); in output_entry_function()
2694 for(child = current->child_list; child; child = child->next_peer) in output_entry_function()
2713 current->label,child->label); in output_entry_function()
2722 fprintf(fp,"\t\tfree(%s);\n",current->label); in output_entry_function()
2723 fprintf(fp,"\t\t%s=NULL;\n",current->label); in output_entry_function()
2731 for(tp = current->child_list; tp; tp = tp->next_peer) in output_entry_function()
2737 static void output_single_obj_function(FILE *fp, struct tree *current) in output_single_obj_function() argument
2742 switch(current->node_type) in output_single_obj_function()
2745 if(current->access & READ_FLAG) in output_single_obj_function()
2748 switch(current->type) in output_single_obj_function()
2755 current->label, in output_single_obj_function()
2756 current->label); in output_single_obj_function()
2759 fprintf(fp, "\t*%s = 1;\n",current->label); in output_single_obj_function()
2767 current->label, in output_single_obj_function()
2768 current->label); in output_single_obj_function()
2779 current->label, in output_single_obj_function()
2780 current->label); in output_single_obj_function()
2791 error_exit("output_function(): Unknown type (%d) for %s", current->type, in output_single_obj_function()
2792 current->label); in output_single_obj_function()
2797 if(current->access & WRITE_FLAG) in output_single_obj_function()
2800 switch(current->type) in output_single_obj_function()
2807 current->label, in output_single_obj_function()
2808 current->label); in output_single_obj_function()
2813 fprintf(fp, "\t\t\tprintf(\"The new value is %%d\\n\",%s);\n",current->label); in output_single_obj_function()
2822 current->label, in output_single_obj_function()
2823 current->label); in output_single_obj_function()
2829 fprintf(fp, "\t\t\tmemcpy(buf,%s->chars,%s->len);\n",current->label,current->label); in output_single_obj_function()
2830 fprintf(fp, "\t\t\tbuf[%s->len+1] = '\\0';\n",current->label); in output_single_obj_function()
2838 current->label, in output_single_obj_function()
2839 current->label); in output_single_obj_function()
2844 fprintf(fp, "\t\t\tprintf(\"The new value is %%s\\n\",SSAOidString(%s));\n",current->label); in output_single_obj_function()
2850 error_exit("output_function(): Unknown type (%d) for %s", current->type, in output_single_obj_function()
2851 current->label); in output_single_obj_function()
2858 if( (current->access & READ_FLAG) || (current->access & WRITE_FLAG) ) in output_single_obj_function()
2860 switch(current->type) in output_single_obj_function()
2873 current->label, in output_single_obj_function()
2874 current->label); in output_single_obj_function()
2876 fprintf(fp, "\t if(%s->",current->label); in output_single_obj_function()
2882 current->label, in output_single_obj_function()
2883 current->label); in output_single_obj_function()
2885 fprintf(fp, "\t if(%s->",current->label); in output_single_obj_function()
2890 current->type, in output_single_obj_function()
2891 current->label); in output_single_obj_function()
2893 switch(current->type) in output_single_obj_function()
2904 fprintf(fp, "chars!=NULL && %s->len !=0)\n",current->label); in output_single_obj_function()
2906 fprintf(fp, "\t\tfree(%s->chars);\n",current->label); in output_single_obj_function()
2907 fprintf(fp,"\t\t%s->len = 0;\n",current->label); in output_single_obj_function()
2913 fprintf(fp, "subids!=NULL && %s->len !=0)\n",current->label); in output_single_obj_function()
2915 fprintf(fp, "\t\tfree(%s->subids);\n",current->label); in output_single_obj_function()
2916 fprintf(fp,"\t\t%s->len = 0;\n",current->label); in output_single_obj_function()
2923 current->type, in output_single_obj_function()
2924 current->label); in output_single_obj_function()
2930 for(tp = current->child_list; tp; tp = tp->next_peer) in output_single_obj_function()
2981 static void output_appl_c(struct tree *current) in output_appl_c() argument
3047 static void output_trap_c(struct tree *current) in output_trap_c() argument
3056 static void output_stub_c(struct tree *current) in output_stub_c() argument
3061 output_single_obj_function(fp, current); in output_stub_c()
3062 output_entry_function(fp, current); in output_stub_c()