#include #include #include #include #include #include #define OWL_PERL #include "owl.h" static const char fileIdent[] = "$Id$"; extern char *owl_perlwrap_codebuff; extern XS(boot_owl); extern XS(boot_DynaLoader); // extern XS(boot_DBI); static void owl_perl_xs_init(pTHX) { char *file = __FILE__; dXSUB_SYS; { newXS("owl::bootstrap", boot_owl, file); newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); } } SV *owl_perlconfig_message2hashref(owl_message *m) /*noproto*/ { HV *h; SV *hr; char *ptr, *blessas; int i, j; if (!m) return &PL_sv_undef; h = newHV(); #define MSG2H(h,field) hv_store(h, #field, strlen(#field), \ newSVpv(owl_message_get_##field(m),0), 0) if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) { /* Handle zephyr-specific fields... */ AV *av_zfields; av_zfields = newAV(); j=owl_zephyr_get_num_fields(owl_message_get_notice(m)); for (i=0; icmd_perl, G_SCALAR|G_EVAL); SPAGAIN; if(SvTRUE(ERRSV)) { owl_function_error("Error: %s", SvPV(ERRSV, n_a)); POPs; } else { if(count != 1) croak("Perl command %s returned more than one value!", cmd->name); SV * rv = POPs; if(SvTRUE(rv)) { ret = owl_strdup(SvPV(rv, n_a)); } } FREETMPS; LEAVE; return ret; } void owl_perlconfig_cmd_free(owl_cmd *cmd) { SvREFCNT_dec(cmd); }