Changeset 8203afd for perlconfig.c


Ignore:
Timestamp:
Jan 9, 2007, 11:33:44 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
d609dd6
Parents:
ffe70f9
git-author:
Nelson Elhage <nelhage@mit.edu> (01/09/07 18:50:40)
git-committer:
Nelson Elhage <nelhage@mit.edu> (01/09/07 23:33:44)
Message:
* Renaming package owl to BarnOwl::
* Moving hooks into the BarnOwl::Hooks package, and restoring support
  for .owlconf files that use sub startup {} and so on.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    r9364a36 r8203afd  
    1212extern char *owl_perlwrap_codebuff;
    1313
    14 extern XS(boot_owl);
     14extern XS(boot_BarnOwl);
    1515extern XS(boot_DynaLoader);
    1616// extern XS(boot_DBI);
     
    2121  dXSUB_SYS;
    2222  {
    23     newXS("owl::bootstrap", boot_owl, file);
     23    newXS("BarnOwl::bootstrap", boot_BarnOwl, file);
    2424    newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
    2525  }
     
    8686  hv_store(h, "private", strlen("private"), newSViv(owl_message_is_private(m)),0);
    8787
    88   if (owl_message_is_type_zephyr(m))       blessas = "owl::Message::Zephyr";
    89   else if (owl_message_is_type_aim(m))     blessas = "owl::Message::AIM";
    90   else if (owl_message_is_type_jabber(m))  blessas = "owl::Message::Jabber";
    91   else if (owl_message_is_type_admin(m))   blessas = "owl::Message::Admin";
    92   else if (owl_message_is_type_generic(m)) blessas = "owl::Message::Generic";
    93   else                                     blessas = "owl::Message";
     88  if (owl_message_is_type_zephyr(m))       blessas = "BarnOwl::Message::Zephyr";
     89  else if (owl_message_is_type_aim(m))     blessas = "BarnOwl::Message::AIM";
     90  else if (owl_message_is_type_jabber(m))  blessas = "BarnOwl::Message::Jabber";
     91  else if (owl_message_is_type_admin(m))   blessas = "BarnOwl::Message::Admin";
     92  else if (owl_message_is_type_generic(m)) blessas = "BarnOwl::Message::Generic";
     93  else                                     blessas = "BarnOwl::Message";
    9494
    9595  hr = sv_2mortal(newRV_noinc((SV*)h));
     
    255255
    256256  /* create legacy variables */
    257   perl_get_sv("owl::id", TRUE);
    258   perl_get_sv("owl::class", TRUE);
    259   perl_get_sv("owl::instance", TRUE);
    260   perl_get_sv("owl::recipient", TRUE);
    261   perl_get_sv("owl::sender", TRUE);
    262   perl_get_sv("owl::realm", TRUE);
    263   perl_get_sv("owl::opcode", TRUE);
    264   perl_get_sv("owl::zsig", TRUE);
    265   perl_get_sv("owl::msg", TRUE);
    266   perl_get_sv("owl::time", TRUE);
    267   perl_get_sv("owl::host", TRUE);
    268   perl_get_av("owl::fields", TRUE);
     257  perl_get_sv("BarnOwl::id", TRUE);
     258  perl_get_sv("BarnOwl::class", TRUE);
     259  perl_get_sv("BarnOwl::instance", TRUE);
     260  perl_get_sv("BarnOwl::recipient", TRUE);
     261  perl_get_sv("BarnOwl::sender", TRUE);
     262  perl_get_sv("BarnOwl::realm", TRUE);
     263  perl_get_sv("BarnOwl::opcode", TRUE);
     264  perl_get_sv("BarnOwl::zsig", TRUE);
     265  perl_get_sv("BarnOwl::msg", TRUE);
     266  perl_get_sv("BarnOwl::time", TRUE);
     267  perl_get_sv("BarnOwl::host", TRUE);
     268  perl_get_av("BarnOwl::fields", TRUE);
    269269
    270270  if(file) {
    271     SV * cfg = get_sv("owl::configfile", TRUE);
     271    SV * cfg = get_sv("BarnOwl::configfile", TRUE);
    272272    sv_setpv(cfg, file);
    273273  }
     
    283283
    284284  /* check if we have the formatting function */
    285   if (owl_perlconfig_is_function("owl::format_msg")) {
     285  if (owl_perlconfig_is_function("BarnOwl::format_msg")) {
    286286    owl_global_set_config_format(&g, 1);
    287287  }
     
    361361    char *ret = NULL;
    362362    ret = owl_perlconfig_call_with_message(subname?subname
    363                                            :"owl::_format_msg_legacy_wrap", m);
     363                                           :"BarnOwl::_format_msg_legacy_wrap", m);
    364364    if (!ret) {
    365365      ret = owl_sprintf("@b([Perl Message Formatting Failed!])\n");
     
    368368  } else {
    369369    char *ptr = NULL;
    370     if (owl_perlconfig_is_function("owl::receive_msg")) {
     370    if (owl_perlconfig_is_function("BarnOwl::Hooks::receive_msg")) {
    371371      ptr = owl_perlconfig_call_with_message(subname?subname
    372                                        :"owl::_receive_msg_legacy_wrap", m);
     372                                       :"BarnOwl::_receive_msg_legacy_wrap", m);
    373373    }
    374374    if (ptr) owl_free(ptr);
     
    452452void owl_perlconfig_mainloop()
    453453{
     454  if (!owl_perlconfig_is_function("BarnOwl::Hooks::mainloop_hook"))
     455    return;
    454456  dSP ;
    455457  PUSHMARK(SP) ;
    456   call_pv("owl::mainloop_hook", G_DISCARD|G_EVAL);
     458  call_pv("BarnOwl::Hooks::mainloop_hook", G_DISCARD|G_EVAL);
    457459  if(SvTRUE(ERRSV)) {
    458460    STRLEN n_a;
Note: See TracChangeset for help on using the changeset viewer.