No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tab_fonctions.c 577B

1234567891011121314151617181920212223242526272829
  1. struct fonction_t tab_fonctions[MAX_TAILLE_FONC];
  2. int index = 0;
  3. struct fonction_t get_fonction(char * name){
  4. int not_found = 1;
  5. int i = 0;
  6. struct fonction_t res = NULL;
  7. while (not_found && (i <= index)){
  8. if (!strcmp(name,tab_fonctions[i].name){
  9. res = tab_fonctions[i];
  10. not_found = 0;
  11. }
  12. i++;
  13. }
  14. return res;
  15. }
  16. void push_fonction(char * name, struct type_t type, int line){
  17. if (index < MAX_TAILLE_FONC){
  18. struct fonction_t fonc;
  19. strcpy(fonc.name,name);
  20. fonc.type = type;
  21. fonc.first_instruction_line = line;
  22. tab_fonctions[i] = fonc;
  23. index++;
  24. }
  25. }