Changeset b67ab6b for perlconfig.c


Ignore:
Timestamp:
Apr 29, 2008, 1:21:15 AM (13 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:
52f8dd6
Parents:
864ed35
Message:
Implement back-compat with old-style owl::format_msg() styles
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    r9c7a701 rb67ab6b  
    411411}
    412412
    413 char *owl_perlconfig_getmsg(owl_message *m, int mode, char *subname)
    414 {
    415   /* if mode==1 we are doing message formatting.  The returned
    416    * formatted message needs to be freed by the caller.
    417    *
    418    * if mode==0 we are just doing the message-has-been-received
    419    * thing.
    420    */
    421   if (!owl_global_have_config(&g)) return(NULL);
    422  
    423   /* run the procedure corresponding to the mode */
    424   if (mode==1) {
    425     char *ret = NULL;
    426     ret = owl_perlconfig_call_with_message(subname?subname
    427                                            :"BarnOwl::_format_msg_legacy_wrap", m);
    428     if (!ret) {
    429       ret = owl_sprintf("@b([Perl Message Formatting Failed!])\n");
    430     }
    431     return ret;
    432   } else {
    433     char *ptr = NULL;
    434     if (owl_perlconfig_is_function("BarnOwl::Hooks::_receive_msg")) {
    435       ptr = owl_perlconfig_call_with_message(subname?subname
    436                                        :"BarnOwl::_receive_msg_legacy_wrap", m);
    437     }
    438     if (ptr) owl_free(ptr);
    439     return(NULL);
    440   }
     413void owl_perlconfig_getmsg(owl_message *m, char *subname)
     414{
     415  char *ptr = NULL;
     416  if (owl_perlconfig_is_function("BarnOwl::Hooks::_receive_msg")) {
     417    ptr = owl_perlconfig_call_with_message(subname?subname
     418                                           :"BarnOwl::_receive_msg_legacy_wrap", m);
     419  }
     420  if (ptr) owl_free(ptr);
    441421}
    442422
Note: See TracChangeset for help on using the changeset viewer.