Hobocamp

 view release on metacpan or  search on metacpan

Dialog.xs  view on Meta::CPAN

    int checklist_or_radio_flag
    PROTOTYPE: $$$$$$$
    PREINIT:
        I32 i;
        I32 items_amount = 0;
        int current_item = 0;
        DIALOG_LISTITEM *listitems;
        int dialog_return_code;
    INIT:
        items_amount = av_len((AV *)SvRV(items_list)) + 1;
    PPCODE:
        listitems = dlg_calloc(DIALOG_LISTITEM, (size_t) items_amount);

        for (i = 0; i < items_amount; i++) {
            listitems[i].name = SvPV_nolen(_get_hash_key_sv_from_array(items_list, i, "name"));
            listitems[i].text = SvPV_nolen(_get_hash_key_sv_from_array(items_list, i, "text"));

            if (dialog_vars.item_help) {
                listitems[i].help = SvPV_nolen(_get_hash_key_sv_from_array(items_list, i, "help"));
            }
            else {

Dialog.xs  view on Meta::CPAN

    SV *items_menu
    PROTOTYPE: $$$$$$
    PREINIT:
        I32 i;
        I32 items_amount = 0;
        int current_item = 0;
        DIALOG_LISTITEM *listitems;
        int dialog_return_code;
    INIT:
        items_amount = av_len((AV *)SvRV(items_menu)) + 1;
    PPCODE:
        listitems = dlg_calloc(DIALOG_LISTITEM, (size_t) items_amount);

        for (i = 0; i < items_amount; i++) {
            listitems[i].name = SvPV_nolen(_get_hash_key_sv_from_array(items_menu, i, "name"));
            listitems[i].text = SvPV_nolen(_get_hash_key_sv_from_array(items_menu, i, "text"));

            if (dialog_vars.item_help) {
                listitems[i].help = SvPV_nolen(_get_hash_key_sv_from_array(items_menu, i, "help"));
            }
            else {

Dialog.xs  view on Meta::CPAN

dialog_timebox(const char *title, const char *subtitle, int height, int width, int hour = 12, int minute = 0 , int second = 0)

int
dialog_yesno(const char *title, const char *prompt, int height, int width)

# -------- extra --------

void
_dialog_result()
    PROTOTYPE:
    PPCODE:
        mXPUSHs(newSVpv(dialog_vars.input_result, 0));
        dlg_clr_result();

void
_dialog_set_backtitle(title)
    char *title
    PROTOTYPE: $
    CODE:
        if (dialog_vars.backtitle != NULL) {
            free(dialog_vars.backtitle);

const-xs.inc  view on Meta::CPAN

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	IV		iv;
	/* NV		nv;	Uncomment this if you need to return NVs */
	/* const char	*pv;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
        /* Change this to constant(aTHX_ s, len, &iv, &nv);
           if you need to return both NVs and IVs */
	type = constant(aTHX_ s, len, &iv);
      /* Return 1 or 2 items. First is error message, or undef if no error.
           Second, if present, is found value */
        switch (type) {
        case PERL_constant_NOTFOUND:
          sv =
	    sv_2mortal(newSVpvf("%s is not a valid Hobocamp macro", s));
          PUSHs(sv);

fallback/const-c.inc  view on Meta::CPAN

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	IV		iv;
	/* NV		nv;	Uncomment this if you need to return NVs */
	/* const char	*pv;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
        /* Change this to constant(aTHX_ s, len, &iv, &nv);
           if you need to return both NVs and IVs */
	type = constant(aTHX_ s, len, &iv);
      /* Return 1 or 2 items. First is error message, or undef if no error.
           Second, if present, is found value */
        switch (type) {
        case PERL_constant_NOTFOUND:
          sv =
	    sv_2mortal(newSVpvf("%s is not a valid Hobocamp macro", s));
          PUSHs(sv);

fallback/const-xs.inc  view on Meta::CPAN

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	IV		iv;
	/* NV		nv;	Uncomment this if you need to return NVs */
	/* const char	*pv;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
        /* Change this to constant(aTHX_ s, len, &iv, &nv);
           if you need to return both NVs and IVs */
	type = constant(aTHX_ s, len, &iv);
      /* Return 1 or 2 items. First is error message, or undef if no error.
           Second, if present, is found value */
        switch (type) {
        case PERL_constant_NOTFOUND:
          sv =
	    sv_2mortal(newSVpvf("%s is not a valid Hobocamp macro", s));
          PUSHs(sv);



( run in 2.431 seconds using v1.01-cache-2.11-cpan-71847e10f99 )