Changeset 147d880


Ignore:
Timestamp:
Aug 25, 2008, 8:11:12 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
740d5f7
Parents:
da466e0
Message:
Move 'zwriteline' to a message attribute, not a field in struct owl_message.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • message.c

    r719c699 r147d880  
    4242  owl_message_set_direction_none(m);
    4343  m->delete=0;
    44   m->zwriteline=NULL;
    4544
    4645  owl_message_set_hostname(m, "");
     
    485484char *owl_message_get_zwriteline(owl_message *m)
    486485{
    487   if(!m->zwriteline)
    488     return "";
    489   return(m->zwriteline);
     486  char *z = owl_message_get_attribute_value(m, "zwriteline");
     487  if (!z) return "";
     488  return z;
    490489}
    491490
    492491void owl_message_set_zwriteline(owl_message *m, char *line)
    493492{
    494   if(m->zwriteline) owl_free(m->zwriteline);
    495   m->zwriteline=owl_strdup(line);
     493  owl_message_set_attribute(m, "zwriteline", line);
    496494}
    497495
     
    860858  }
    861859
    862   m->zwriteline=owl_strdup("");
    863 
    864860  /* save the hostname */
    865861  owl_function_debugmsg("About to do gethostbyaddr");
     
    942938  }
    943939
    944   m->zwriteline=owl_strdup("");
    945 
    946940  owl_message_set_body(m, "<uninitialized>");
    947941
     
    975969  owl_message_set_opcode(m, owl_zwrite_get_opcode(&z));
    976970  owl_message_set_realm(m, owl_zwrite_get_realm(&z)); /* also a hack, but not here */
    977   m->zwriteline=owl_strdup(line);
     971  owl_message_set_zwriteline(m, line);
    978972  owl_message_set_body(m, body);
    979973  owl_message_set_zsig(m, zsig);
     
    10161010#endif
    10171011  if (m->timestr) owl_free(m->timestr);
    1018   if (m->zwriteline) owl_free(m->zwriteline);
    10191012
    10201013  /* free all the attributes */
  • owl.h

    r0504f63 r147d880  
    342342  char *timestr;
    343343  time_t time;
    344   char *zwriteline;
    345344} owl_message;
    346345
Note: See TracChangeset for help on using the changeset viewer.