Changeset c08c70a for message.c


Ignore:
Timestamp:
Aug 15, 2009, 7:08:19 PM (15 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1fdab04
Parents:
25fb825
git-author:
Anders Kaseorg <andersk@mit.edu> (08/04/09 00:44:38)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:19)
Message:
Add const qualifiers for owl_message *.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    r1077891a rc08c70a  
    8282 * the attribute does not exist
    8383 */
    84 const char *owl_message_get_attribute_value(owl_message *m, const char *attrname)
     84const char *owl_message_get_attribute_value(const owl_message *m, const char *attrname)
    8585{
    8686  int i, j;
     
    107107 * function to indent fmtext.
    108108 */
    109 void owl_message_attributes_tofmtext(owl_message *m, owl_fmtext *fm) {
     109void owl_message_attributes_tofmtext(const owl_message *m, owl_fmtext *fm) {
    110110  int i, j;
    111111  owl_pair *p;
     
    164164}
    165165
    166 const char *owl_message_get_class(owl_message *m)
     166const char *owl_message_get_class(const owl_message *m)
    167167{
    168168  const char *class;
     
    178178}
    179179
    180 const char *owl_message_get_instance(owl_message *m)
     180const char *owl_message_get_instance(const owl_message *m)
    181181{
    182182  const char *instance;
     
    192192}
    193193
    194 const char *owl_message_get_sender(owl_message *m)
     194const char *owl_message_get_sender(const owl_message *m)
    195195{
    196196  const char *sender;
     
    206206}
    207207
    208 const char *owl_message_get_zsig(owl_message *m)
     208const char *owl_message_get_zsig(const owl_message *m)
    209209{
    210210  const char *zsig;
     
    220220}
    221221
    222 const char *owl_message_get_recipient(owl_message *m)
     222const char *owl_message_get_recipient(const owl_message *m)
    223223{
    224224  /* this is stupid for outgoing messages, we need to fix it. */
     
    236236}
    237237
    238 const char *owl_message_get_realm(owl_message *m)
     238const char *owl_message_get_realm(const owl_message *m)
    239239{
    240240  const char *realm;
     
    250250}
    251251
    252 const char *owl_message_get_body(owl_message *m)
     252const char *owl_message_get_body(const owl_message *m)
    253253{
    254254  const char *body;
     
    265265}
    266266
    267 const char *owl_message_get_opcode(owl_message *m)
     267const char *owl_message_get_opcode(const owl_message *m)
    268268{
    269269  const char *opcode;
     
    286286}
    287287
    288 int owl_message_is_loginout(owl_message *m)
     288int owl_message_is_loginout(const owl_message *m)
    289289{
    290290  const char *res;
     
    295295}
    296296
    297 int owl_message_is_login(owl_message *m)
     297int owl_message_is_login(const owl_message *m)
    298298{
    299299  const char *res;
     
    306306
    307307
    308 int owl_message_is_logout(owl_message *m)
     308int owl_message_is_logout(const owl_message *m)
    309309{
    310310  const char *res;
     
    321321}
    322322
    323 int owl_message_is_private(owl_message *m)
     323int owl_message_is_private(const owl_message *m)
    324324{
    325325  const char *res;
     
    330330}
    331331
    332 const char *owl_message_get_timestr(owl_message *m)
     332const char *owl_message_get_timestr(const owl_message *m)
    333333{
    334334  if (m->timestr) return(m->timestr);
     
    361361}
    362362
    363 int owl_message_is_type(owl_message *m, const char *type) {
     363int owl_message_is_type(const owl_message *m, const char *type) {
    364364  const char * t = owl_message_get_attribute_value(m, "type");
    365365  if(!t) return 0;
     
    367367}
    368368                                               
    369 int owl_message_is_type_admin(owl_message *m)
     369int owl_message_is_type_admin(const owl_message *m)
    370370{
    371371  return owl_message_is_type(m, "admin");
    372372}
    373373
    374 int owl_message_is_type_zephyr(owl_message *m)
     374int owl_message_is_type_zephyr(const owl_message *m)
    375375{
    376376  return owl_message_is_type(m, "zephyr");
    377377}
    378378
    379 int owl_message_is_type_aim(owl_message *m)
     379int owl_message_is_type_aim(const owl_message *m)
    380380{
    381381  return owl_message_is_type(m, "aim");
     
    383383
    384384/* XXX TODO: deprecate this */
    385 int owl_message_is_type_jabber(owl_message *m)
     385int owl_message_is_type_jabber(const owl_message *m)
    386386{
    387387  return owl_message_is_type(m, "jabber");
    388388}
    389389
    390 int owl_message_is_type_loopback(owl_message *m)
     390int owl_message_is_type_loopback(const owl_message *m)
    391391{
    392392  return owl_message_is_type(m, "loopback");
    393393}
    394394
    395 int owl_message_is_pseudo(owl_message *m)
     395int owl_message_is_pseudo(const owl_message *m)
    396396{
    397397  if (owl_message_get_attribute_value(m, "pseudo")) return(1);
     
    425425}
    426426
    427 int owl_message_is_direction_in(owl_message *m)
     427int owl_message_is_direction_in(const owl_message *m)
    428428{
    429429  if (m->direction==OWL_MESSAGE_DIRECTION_IN) return(1);
     
    431431}
    432432
    433 int owl_message_is_direction_out(owl_message *m)
     433int owl_message_is_direction_out(const owl_message *m)
    434434{
    435435  if (m->direction==OWL_MESSAGE_DIRECTION_OUT) return(1);
     
    437437}
    438438
    439 int owl_message_is_direction_none(owl_message *m)
     439int owl_message_is_direction_none(const owl_message *m)
    440440{
    441441  if (m->direction==OWL_MESSAGE_DIRECTION_NONE) return(1);
     
    462462}
    463463
    464 const char *owl_message_get_zwriteline(owl_message *m)
     464const char *owl_message_get_zwriteline(const owl_message *m)
    465465{
    466466  const char *z = owl_message_get_attribute_value(m, "zwriteline");
     
    474474}
    475475
    476 int owl_message_is_delete(owl_message *m)
     476int owl_message_is_delete(const owl_message *m)
    477477{
    478478  if (m == NULL) return(0);
     
    482482
    483483#ifdef HAVE_LIBZEPHYR
    484 const ZNotice_t *owl_message_get_notice(owl_message *m)
     484const ZNotice_t *owl_message_get_notice(const owl_message *m)
    485485{
    486486  return(&(m->notice));
    487487}
    488488#else
    489 void *owl_message_get_notice(owl_message *m)
     489void *owl_message_get_notice(const owl_message *m)
    490490{
    491491  return(NULL);
     
    498498}
    499499
    500 const char *owl_message_get_hostname(owl_message *m)
     500const char *owl_message_get_hostname(const owl_message *m)
    501501{
    502502  return(m->hostname);
     
    524524}
    525525
    526 int owl_message_is_personal(owl_message *m)
     526int owl_message_is_personal(const owl_message *m)
    527527{
    528528  owl_filter * f = owl_global_get_filter(&g, "personal");
     
    534534}
    535535
    536 int owl_message_is_question(owl_message *m)
     536int owl_message_is_question(const owl_message *m)
    537537{
    538538  if(!owl_message_is_type_admin(m)) return 0;
     
    541541}
    542542
    543 int owl_message_is_answered(owl_message *m) {
     543int owl_message_is_answered(const owl_message *m) {
    544544  const char *q;
    545545  if(!owl_message_is_question(m)) return 0;
     
    553553}
    554554
    555 int owl_message_is_mail(owl_message *m)
     555int owl_message_is_mail(const owl_message *m)
    556556{
    557557  if (owl_message_is_type_zephyr(m)) {
     
    566566
    567567/* caller must free return value. */
    568 char *owl_message_get_cc(owl_message *m)
     568char *owl_message_get_cc(const owl_message *m)
    569569{
    570570  const char *cur;
     
    583583
    584584/* caller must free return value */
    585 char *owl_message_get_cc_without_recipient(owl_message *m)
     585char *owl_message_get_cc_without_recipient(const owl_message *m)
    586586{
    587587  char *cc, *out, *end, *shortuser, *recip;
     
    620620}
    621621
    622 int owl_message_get_id(owl_message *m)
     622int owl_message_get_id(const owl_message *m)
    623623{
    624624  return(m->id);
    625625}
    626626
    627 const char *owl_message_get_type(owl_message *m) {
     627const char *owl_message_get_type(const owl_message *m) {
    628628  const char * type = owl_message_get_attribute_value(m, "type");
    629629  if(!type) {
     
    633633}
    634634
    635 const char *owl_message_get_direction(owl_message *m) {
     635const char *owl_message_get_direction(const owl_message *m) {
    636636  switch (m->direction) {
    637637  case OWL_MESSAGE_DIRECTION_IN:
     
    657657
    658658
    659 const char *owl_message_get_login(owl_message *m) {
     659const char *owl_message_get_login(const owl_message *m) {
    660660  if (owl_message_is_login(m)) {
    661661    return "login";
     
    668668
    669669
    670 const char *owl_message_get_header(owl_message *m) {
     670const char *owl_message_get_header(const owl_message *m) {
    671671  return owl_message_get_attribute_value(m, "adminheader");
    672672}
Note: See TracChangeset for help on using the changeset viewer.