Example #1
0
File: zprof.c Project: AMDmi3/zsh
                stack->beg += now - prev;
                if (a)
                    a->time += now - prev;
            }
        } else
            stack = sf.prev;
    }
    return 0;
}

static struct builtin bintab[] = {
    BUILTIN("zprof", 0, bin_zprof, 0, 0, 0, "c", NULL),
};

static struct funcwrap wrapper[] = {
    WRAPDEF(zprof_wrapper),
};

static struct features module_features = {
    bintab, sizeof(bintab)/sizeof(*bintab),
    NULL, 0,
    NULL, 0,
    NULL, 0,
    0
};

/**/
int
setup_(Module m)
{
    zprof_module = m;
Example #2
0
}

static struct builtin bintab[] = {
    BUILTIN("compadd", 0, bin_compadd, 0, -1, 0, NULL, NULL),
    BUILTIN("compset", 0, bin_compset, 1, 3, 0, NULL, NULL),
};

static struct conddef cotab[] = {
    CONDDEF("after", 0, cond_range, 1, 1, 0),
    CONDDEF("between", 0, cond_range, 2, 2, 1),
    CONDDEF("prefix", 0, cond_psfix, 1, 2, CVT_PREPAT),
    CONDDEF("suffix", 0, cond_psfix, 1, 2, CVT_SUFPAT),
};

static struct funcwrap wrapper[] = {
    WRAPDEF(comp_wrapper),
};

/* The order of the entries in this table has to match the *HOOK
 * macros in comp.h */

/**/
struct hookdef comphooks[] = {
    HOOKDEF("insert_match", NULL, HOOKF_ALL),
    HOOKDEF("menu_start", NULL, HOOKF_ALL),
    HOOKDEF("compctl_make", NULL, 0),
    HOOKDEF("compctl_cleanup", NULL, 0),
    HOOKDEF("comp_list_matches", ilistmatches, 0),
};

static struct features module_features = {
Example #3
0
    if (pm->level == locallevel) {
        if (!is_private(pm))
            return;
        if (onoff == PM_UNSET)
            if (pm->node.flags & PM_UNSET)
                pm->node.flags |= PM_NORESTORE;
            else
                pm->node.flags |= PM_UNSET;
        else if (!(pm->node.flags & PM_NORESTORE))
            pm->node.flags &= ~PM_UNSET;
        pm->node.flags &= ~PM_NORESTORE;
    }
}

static struct funcwrap wrapper[] = {
    WRAPDEF(wrap_private)
};

/**/
static int
wrap_private(Eprog prog, FuncWrap w, char *name)
{
    static int wraplevel = 0;

    if (wraplevel < locallevel /* && strcmp(name, "(anon)") != 0 */) {
        int owl = wraplevel;
        wraplevel = locallevel;
        scanhashtable(paramtab, 0, 0, 0, scopeprivate, PM_UNSET);
        runshfunc(prog, w, name);
        scanhashtable(paramtab, 0, 0, 0, scopeprivate, 0);
        wraplevel = owl;