Changeset 13a3c1db for perlglue.xs


Ignore:
Timestamp:
May 30, 2007, 12:05:27 AM (17 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
4508e21
Parents:
1fd5e4c1
git-author:
Nelson Elhage <nelhage@mit.edu> (05/30/07 00:05:16)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/30/07 00:05:27)
Message:
Refactoring message processing: All new messages, incoming or
outgoing, get added to the owl_global_messagequeue by protocol code,
and then passed to owl_proces_message, which serves as a single
central code path for adding messages to the message list.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlglue.xs

    ra695a68 r13a3c1db  
    129129        }
    130130
    131 void add_message(msg)
    132         SV *msg
    133         PREINIT:
    134                 owl_message *m;
    135         CODE:
    136         {
    137                 if(!SvROK(msg) || SvTYPE(SvRV(msg)) != SVt_PVHV) {
    138                         croak("Usage: BarnOwl::add_message($message)");
    139                 }
    140 
    141                 if (owl_global_is_displayoutgoing(&g)) {
    142                         m = owl_perlconfig_hashref2message(msg);
    143                         owl_function_add_message(m);
    144                 }
    145         }
    146 
    147 void log_message(msg)
    148         SV *msg
    149         PREINIT:
    150                 owl_message *m;
    151         CODE:
    152         {
    153                 if(!SvROK(msg) || SvTYPE(SvRV(msg)) != SVt_PVHV) {
    154                         croak("Usage: BarnOwl::log_message($message)");
    155                 }
    156 
    157                 m = owl_perlconfig_hashref2message(msg);
    158                 owl_log_message(m);
    159                 owl_message_free(m);
    160         }
    161 
    162 void add_and_log_message(msg)
    163         SV *msg
    164         PREINIT:
    165                 owl_message *m;
    166         CODE:
    167         {
    168                 if(!SvROK(msg) || SvTYPE(SvRV(msg)) != SVt_PVHV) {
    169                         croak("Usage: BarnOwl::add_and_log_message($message)");
    170                 }
    171 
    172                 m = owl_perlconfig_hashref2message(msg);
    173                 owl_log_message(m);
    174                 if (owl_global_is_displayoutgoing(&g)) {
    175                         owl_function_add_message(m);
    176                 } else {
    177                         owl_message_free(m);
    178                 }
    179         }
    180 
    181131void admin_message(header, body)
    182132        char *header
Note: See TracChangeset for help on using the changeset viewer.