engine/source/preprocessorlib/pp_parser.c
/**
 * Frees the memory associated with a preprocessor context.  This function can
 * safely be called multiple times on the same context with no negative
 * consequences.  However, it does assume that the context has been initialized
 * at least once.
 */
Frees the memory associated with a preprocessor context.  This function can
safely be called multiple times on the same context with no negative
consequences.  However, it does assume that the context has been initialized
at least once.
Frees the memory associated with a preprocessor context . This function can safely be called multiple times on the same context with no negative consequences . However it does assume that the context has been initialized at least once .
void pp_context_destroy(pp_context *self)
{
    List_Reset(&self->macros);
    while(self->macros.size > 0)
    {
        free(List_Retrieve(&self->macros));
        List_Remove(&self->macros);
    }
    List_Clear(&self->macros);
    List_Reset(&self->func_macros);
    while(self->func_macros.size > 0)
    {
        List *params = List_Retrieve(&self->func_macros);
        while(params->size > 0)
        {
            free(List_Retrieve(params));
            List_Remove(params);
        }
        List_Clear(params);
        free(params);
        List_Remove(&self->func_macros);
    }
    List_Clear(&self->func_macros);
    List_Reset(&self->imports);
    while(self->imports.size > 0)
    {
        List_Remove(&self->imports);
    }
    List_Clear(&self->imports);
}
void pp_context_destroy ( pp_context * self ) { List_Reset ( & self -> macros ) ; while ( self -> macros . size > 0 ) { free ( List_Retrieve ( & self -> macros ) ) ; List_Remove ( & self -> macros ) ; } List_Clear ( & self -> macros ) ; List_Reset ( & self -> func_macros ) ; while ( self -> func_macros . size > 0 ) { List * params = List_Retrieve ( & self -> func_macros ) ; while ( params -> size > 0 ) { free ( List_Retrieve ( params ) ) ; List_Remove ( params ) ; } List_Clear ( params ) ; free ( params ) ; List_Remove ( & self -> func_macros ) ; } List_Clear ( & self -> func_macros ) ; List_Reset ( & self -> imports ) ; while ( self -> imports . size > 0 ) { List_Remove ( & self -> imports ) ; } List_Clear ( & self -> imports ) ; }
Frees the memory associated with a preprocessor context.
Frees the memory associated with a preprocessor context .
// undefine and free all non-function macros // undefine and free all function-style macros // free the import list