コード例 #1
0
ファイル: rules.c プロジェクト: Albermg7/boost
/*
 * enter_rule() - return pointer to RULE, creating it if necessary in
 * target_module.
 */
static RULE *
enter_rule( char *rulename, module_t *target_module )
{
    RULE rule, *r = &rule;

    r->name = rulename;

    if ( hashenter( demand_rules( target_module ), (HASHDATA **)&r ) )
    {
        r->name = newstr( rulename );	/* never freed */
        r->procedure = (PARSE *)0;
        r->module = 0;
        r->actions = 0;
        r->arguments = 0;
        r->exported = 0;
        r->module = target_module;
#ifdef HAVE_PYTHON
        r->python_function = 0;
#endif
    }
    return r;
}
コード例 #2
0
static RULE * enter_rule( OBJECT * rulename, module_t * target_module )
{
    RULE rule;
    RULE * r = &rule;

    r->name = rulename;

    if ( hashenter( demand_rules( target_module ), (HASHDATA * *)&r ) )
    {
        r->name = object_copy( rulename );
        r->procedure = 0;
        r->module = 0;
        r->actions = 0;
        r->arguments = 0;
        r->exported = 0;
        r->module = target_module;
#ifdef HAVE_PYTHON
        r->python_function = 0;
#endif
    }
    return r;
}