/* This file was autogenerated from perlwrap.pm.  DO NOT EDIT !!!! */

char *owl_perlwrap_codebuff = 
   "# $Id: perlwrap.pm,v 1.4 2009/03/28 21:00:42 kretch Exp $\n"
   "#\n"
   "# This is all linked into the binary and evaluated when perl starts up...\n"
   "#\n"
   "#####################################################################\n"
   "#####################################################################\n"
   "\n"
   "package owl;\n"
   "\n"
   "# bootstrap in C bindings and glue\n"
   "bootstrap owl 1.2;\n"
   "\n"
   "# populate global variable space for legacy owlconf files \n"
   "sub _format_msg_legacy_wrap {\n"
   "    my ($m) = @_;\n"
   "    $m->legacy_populate_global();\n"
   "    return &owl::format_msg($m);\n"
   "}\n"
   "\n"
   "# populate global variable space for legacy owlconf files \n"
   "sub _receive_msg_legacy_wrap {\n"
   "    my ($m) = @_;\n"
   "    $m->legacy_populate_global();\n"
   "    return &owl::receive_msg($m);\n"
   "}\n"
   "\n"
   "# make owl::<command>(\"foo\") be aliases to owl::command(\"<command> foo\");\n"
   "sub AUTOLOAD {\n"
   "    my $called = $AUTOLOAD;\n"
   "    $called =~ s/.*:://;\n"
   "    return &owl::command(\"$called \".join(\" \",@_));\n"
   "}\n"
   "\n"
   "#####################################################################\n"
   "#####################################################################\n"
   "\n"
   "package owl::Message;\n"
   "\n"
   "sub type        { return shift->{\"type\"}; }\n"
   "sub direction   { return shift->{\"direction\"}; }\n"
   "sub time        { return shift->{\"time\"}; }\n"
   "sub id          { return shift->{\"id\"}; }\n"
   "sub body        { return shift->{\"body\"}; }\n"
   "sub sender      { return shift->{\"sender\"}; }\n"
   "sub recipient   { return shift->{\"recipient\"}; }\n"
   "sub login       { return shift->{\"login\"}; }\n"
   "sub is_private  { return shift->{\"private\"}; }\n"
   "\n"
   "sub is_login    { return shift->login eq \"login\"; }\n"
   "sub is_logout   { return shift->login eq \"logout\"; }\n"
   "sub is_loginout { my $m=shift; return ($m->is_login or $m->is_logout); }\n"
   "sub is_incoming { return (shift->{\"direction\"} eq \"in\"); }\n"
   "sub is_outgoing { return (shift->{\"direction\"} eq \"out\"); }\n"
   "\n"
   "sub is_deleted  { return shift->{\"deleted\"}; }\n"
   "\n"
   "sub is_zephyr   { return (shift->{\"type\"} eq \"zephyr\"); }\n"
   "sub is_aim      { return (shift->{\"type\"} eq \"aim\"); }\n"
   "sub is_admin    { return (shift->{\"type\"} eq \"admin\"); }\n"
   "sub is_generic  { return (shift->{\"type\"} eq \"generic\"); }\n"
   "\n"
   "# These are overridden by appropriate message types\n"
   "sub is_ping     { return 0; }\n"
   "sub is_mail     { return 0; }\n"
   "sub is_personal { return undef; }\n"
   "sub class       { return undef; }\n"
   "sub instance    { return undef; }\n"
   "sub realm       { return undef; }\n"
   "sub opcode      { return undef; }\n"
   "sub header      { return undef; }\n"
   "sub host        { return undef; }\n"
   "sub hostname    { return undef; }\n"
   "sub auth        { return undef; }\n"
   "sub fields      { return undef; }\n"
   "sub zsig        { return undef; }\n"
   "sub zwriteline  { return undef; }\n"
   "sub login_host  { return undef; }\n"
   "sub login_tty   { return undef; }\n"
   "\n"
   "sub pretty_sender { return shift->sender; }\n"
   "\n"
   "sub delete {\n"
   "    my ($m) = @_;\n"
   "    &owl::command(\"delete --id \".$m->id);\n"
   "}\n"
   "\n"
   "sub undelete {\n"
   "    my ($m) = @_;\n"
   "    &owl::command(\"undelete --id \".$m->id);\n"
   "}\n"
   "\n"
   "# Serializes the message into something similar to the zwgc->vt format\n"
   "sub serialize {\n"
   "    my ($this) = @_;\n"
   "    my $s;\n"
   "    for my $f (keys %$this) {\n"
   "	my $val = $this->{$f};\n"
   "	if (ref($val) eq \"ARRAY\") {\n"
   "	    for my $i (0..@$val-1) {\n"
   "		my $aval;\n"
   "		$aval = $val->[$i];\n"
   "		$aval =~ s/\\n/\\n$f.$i: /g;\n"
   "		$s .= \"$f.$i: $aval\\n\";	   \n"
   "	    }\n"
   "	} else {\n"
   "	    $val =~ s/\\n/\\n$f: /g;\n"
   "	    $s .= \"$f: $val\\n\";\n"
   "	}\n"
   "    }\n"
   "    return $s;\n"
   "}\n"
   "\n"
   "# Populate the annoying legacy global variables\n"
   "sub legacy_populate_global {\n"
   "    my ($m) = @_;\n"
   "    $owl::direction  = $m->direction ;\n"
   "    $owl::type       = $m->type      ;\n"
   "    $owl::id         = $m->id        ;\n"
   "    $owl::class      = $m->class     ;\n"
   "    $owl::instance   = $m->instance  ;\n"
   "    $owl::recipient  = $m->recipient ;\n"
   "    $owl::sender     = $m->sender    ;\n"
   "    $owl::realm      = $m->realm     ;\n"
   "    $owl::opcode     = $m->opcode    ;\n"
   "    $owl::zsig       = $m->zsig      ;\n"
   "    $owl::msg        = $m->body      ;\n"
   "    $owl::time       = $m->time      ;\n"
   "    $owl::host       = $m->host      ;\n"
   "    $owl::login      = $m->login     ;\n"
   "    $owl::auth       = $m->auth      ;\n"
   "    if ($m->fields) {\n"
   "	@owl::fields = @{$m->fields};\n"
   "	@main::fields = @{$m->fields};\n"
   "    } else {\n"
   "	@owl::fields = undef;\n"
   "	@main::fields = undef;\n"
   "    }\n"
   "}\n"
   "\n"
   "#####################################################################\n"
   "#####################################################################\n"
   "\n"
   "package owl::Message::Admin;\n"
   "\n"
   "@ISA = qw( owl::Message );\n"
   "\n"
   "sub header       { return shift->{\"header\"}; }\n"
   "\n"
   "#####################################################################\n"
   "#####################################################################\n"
   "\n"
   "package owl::Message::Generic;\n"
   "\n"
   "@ISA = qw( owl::Message );\n"
   "\n"
   "#####################################################################\n"
   "#####################################################################\n"
   "\n"
   "package owl::Message::AIM;\n"
   "\n"
   "@ISA = qw( owl::Message );\n"
   "\n"
   "# all non-loginout AIM messages are personal for now...\n"
   "sub is_personal { \n"
   "    return !(shift->is_loginout);\n"
   "}\n"
   "\n"
   "#####################################################################\n"
   "#####################################################################\n"
   "\n"
   "package owl::Message::Zephyr;\n"
   "\n"
   "@ISA = qw( owl::Message );\n"
   "\n"
   "sub login_tty { \n"
   "    my ($m) = @_;\n"
   "    return undef if (!$m->is_loginout);\n"
   "    return $m->fields->[2];\n"
   "}\n"
   "\n"
   "sub login_host { \n"
   "    my ($m) = @_;\n"
   "    return undef if (!$m->is_loginout);\n"
   "    return $m->fields->[0];\n"
   "}\n"
   "\n"
   "sub zwriteline  { return shift->{\"zwriteline\"}; }\n"
   "\n"
   "sub zsig        { return shift->{\"zsig\"}; }\n"
   "\n"
   "sub is_ping     { return (lc(shift->opcode) eq \"ping\"); }\n"
   "\n"
   "sub is_personal { \n"
   "    my ($m) = @_;\n"
   "    return ((lc($m->class) eq \"message\")\n"
   "	    && (lc($m->instance) eq \"personal\")\n"
   "	    && $m->is_private);\n"
   "}\n"
   "\n"
   "sub is_mail { \n"
   "    my ($m) = @_;\n"
   "    return ((lc($m->class) eq \"mail\") && $m->is_private);\n"
   "}\n"
   "\n"
   "sub pretty_sender {\n"
   "    my ($m) = @_;\n"
   "    my $sender = $m->sender;\n"
   "    my $realm = owl::zephyr_getrealm();\n"
   "    $sender =~ s/\\@$realm$//;\n"
   "    return $sender;\n"
   "}\n"
   "\n"
   "# These are arguably zephyr-specific\n"
   "sub class       { return shift->{\"class\"}; }\n"
   "sub instance    { return shift->{\"instance\"}; }\n"
   "sub realm       { return shift->{\"realm\"}; }\n"
   "sub opcode      { return shift->{\"opcode\"}; }\n"
   "sub host        { return shift->{\"hostname\"}; }\n"
   "sub hostname    { return shift->{\"hostname\"}; }\n"
   "sub header      { return shift->{\"header\"}; }\n"
   "sub auth        { return shift->{\"auth\"}; }\n"
   "sub fields      { return shift->{\"fields\"}; }\n"
   "sub zsig        { return shift->{\"zsig\"}; }\n"
   "\n"
   "#####################################################################\n"
   "#####################################################################\n"
   "\n"
   "# switch to package main when we're done\n"
   "package main;\n"
   "\n"
   "1;\n"
   ;
