spl.c
/* Add a new constant to the list */
Add a new constant to the list
Add a new constant to the list
void insert_constant(char *name, int value)
{
    struct define *temp;
    temp = lookup_constant(name);
    if (temp == NULL)
    {
        temp = malloc(sizeof(struct define));
        strcpy(temp->name, name);
        temp->value = value;
        temp->next = root_define;
        root_define = temp;
    }
    else
    {
        printf("\n%d: Multiple Definitions for constant %s!!\n", linecount, name);
        exit(0);
    }
}
void insert_constant ( char * name , int value ) { struct define * temp ; temp = lookup_constant ( name ) ; if ( temp == NULL ) { temp = malloc ( sizeof ( struct define ) ) ; strcpy ( temp -> name , name ) ; temp -> value = value ; temp -> next = root_define ; root_define = temp ; } else { printf ( " \n \n " , linecount , name ) ; exit ( 0 ) ; } }
Add a new constant to the list
Add a new constant to the list