/* Copyright (c) 2002,2003,2004,2009 James M. Kretchmar * * This file is part of Owl. * * Owl is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Owl is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Owl. If not, see . * * --------------------------------------------------------------- * * As of Owl version 2.1.12 there are patches contributed by * developers of the branched BarnOwl project, Copyright (c) * 2006-2009 The BarnOwl Developers. All rights reserved. */ #include #include #include #include #include #include #include "owl.h" #include #include "XSUB.h" static const char fileIdent[] = "$Id$"; extern char *owl_perlwrap_codebuff; extern XS(boot_owl); static void owl_perl_xs_init(pTHX) { char *file = __FILE__; dXSUB_SYS; { newXS("owl::bootstrap", boot_owl, 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; i