/[mailutils]/mailutils/mailbox/mbx_mh.c
ViewVC logotype

Diff of /mailutils/mailbox/mbx_mh.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32 by gray, Sat Jan 11 22:19:46 2003 UTC revision 1.33 by gray, Sat Jan 18 21:57:04 2003 UTC
# Line 1037  mh_scan0 (mailbox_t mailbox, size_t msgn Line 1037  mh_scan0 (mailbox_t mailbox, size_t msgn
1037    if (do_notify)    if (do_notify)
1038      for (msg = mhd->msg_head; msg; msg = msg->next)      for (msg = mhd->msg_head; msg; msg = msg->next)
1039        {        {
           
1040          DISPATCH_ADD_MSG(mailbox, mhd);          DISPATCH_ADD_MSG(mailbox, mhd);
1041        }        }
1042                        
# Line 1186  mh_message_stream_open (struct _mh_messa Line 1185  mh_message_stream_open (struct _mh_messa
1185    status = stream_open (mhm->stream);    status = stream_open (mhm->stream);
1186    
1187    if (status != 0)    if (status != 0)
   {  
1188      stream_destroy (&mhm->stream, NULL);      stream_destroy (&mhm->stream, NULL);
   }  
1189    
1190    if (status == 0)    if (status == 0)
1191      status = mh_scan_message (mhm);      status = mh_scan_message (mhm);
# Line 1207  mh_message_stream_close (struct _mh_mess Line 1204  mh_message_stream_close (struct _mh_mess
1204      }      }
1205  }  }
1206    
1207    void
1208    mh_check_message (struct _mh_message *mhm)
1209    {
1210      if (mhm->body_end == 0)
1211        mh_pool_open (mhm);
1212    }
1213    
1214  /* Reading functions */  /* Reading functions */
1215    
1216  static int  static int
# Line 1295  mh_body_size (body_t body, size_t *psize Line 1299  mh_body_size (body_t body, size_t *psize
1299    struct _mh_message *mhm = message_get_owner (msg);    struct _mh_message *mhm = message_get_owner (msg);
1300    if (mhm == NULL)    if (mhm == NULL)
1301      return EINVAL;      return EINVAL;
1302      mh_check_message (mhm);
1303    if (psize)    if (psize)
1304      *psize = mhm->body_end - mhm->body_start;      *psize = mhm->body_end - mhm->body_start;
1305    return 0;    return 0;
1306  }  }
1307    
   
1308  static int  static int
1309  mh_body_lines (body_t body, size_t *plines)  mh_body_lines (body_t body, size_t *plines)
1310  {  {
# Line 1308  mh_body_lines (body_t body, size_t *plin Line 1312  mh_body_lines (body_t body, size_t *plin
1312    struct _mh_message *mhm = message_get_owner (msg);    struct _mh_message *mhm = message_get_owner (msg);
1313    if (mhm == NULL)    if (mhm == NULL)
1314      return EINVAL;      return EINVAL;
1315      mh_check_message (mhm);
1316    if (plines)    if (plines)
1317      *plines = mhm->body_lines;      *plines = mhm->body_lines;
1318    return 0;    return 0;
# Line 1342  mh_header_size (header_t header, size_t Line 1347  mh_header_size (header_t header, size_t
1347    struct _mh_message *mhm = message_get_owner (msg);    struct _mh_message *mhm = message_get_owner (msg);
1348    if (mhm == NULL)    if (mhm == NULL)
1349      return EINVAL;      return EINVAL;
1350      mh_check_message (mhm);
1351    if (psize)    if (psize)
1352      *psize = mhm->body_start;      *psize = mhm->body_start;
1353    return 0;    return 0;
# Line 1354  mh_header_lines (header_t header, size_t Line 1360  mh_header_lines (header_t header, size_t
1360    struct _mh_message *mhm = message_get_owner (msg);    struct _mh_message *mhm = message_get_owner (msg);
1361    if (mhm == NULL)    if (mhm == NULL)
1362      return EINVAL;      return EINVAL;
1363      mh_check_message (mhm);
1364    if (plines)    if (plines)
1365      *plines = mhm->header_lines;      *plines = mhm->header_lines;
1366    return 0;    return 0;

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26