Variable * crb_add_global_variable(CRB_Interpreter *inter, char *identifier) { Variable *new_variable; new_variable = crb_execute_malloc(inter, sizeof(Variable)); new_variable->name = crb_execute_malloc(inter, strlen(identifier) + 1); strcpy(new_variable->name, identifier); new_variable->next = inter->variable; inter->variable = new_variable; return new_variable; }
CRB_Value * CRB_add_global_variable(CRB_Interpreter *inter, char *identifier, CRB_Value *value, CRB_Boolean is_final) { Variable *new_variable; new_variable = crb_execute_malloc(inter, sizeof(Variable)); new_variable->is_final = is_final; new_variable->name = crb_execute_malloc(inter, strlen(identifier) + 1); strcpy(new_variable->name, identifier); new_variable->next = inter->variable; inter->variable = new_variable; new_variable->value = *value; return &new_variable->value; }