home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Mail / appnmail-1.8-Solaris / mailapp-utilities / mailtoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-19  |  2.8 KB  |  76 lines

  1. /* -*-C-*-
  2. *******************************************************************************
  3. *
  4. * File:         mailtoc.h
  5. * RCS:          /usr/local/sources/CVS/mailapp-utilities/mailtoc.h,v 1.2 1997/04/19 17:37:23 tom Exp
  6. * Description:  Structure and access routine declarations for Mail.app mailboxes
  7. * Author:       Carl Edman
  8. * Created:      Sun Apr 25 10:25:29 1993
  9. * Modified:     Sat Apr 19 14:38:11 1997 Tom Hageman <tom@basil.icce.rug.nl>
  10. * Language:     C
  11. * Package:      N/A
  12. * Status:       Experimental (Do Not Distribute)
  13. *
  14. * (C) Copyright 1993, but otherwise this file is perfect freeware.
  15. *
  16. *******************************************************************************
  17. */
  18.  
  19. #if (NS_TARGET_MAJOR < 4) // NEXTSTEP
  20. #  import <appkit/graphics.h>
  21. #else // OPENSTEP
  22. #  import <Foundation/NSGeometry.h>
  23. #  define NXCoord   float
  24. #  define NXRect    NSRect
  25. #endif
  26.  
  27. #import <stdio.h>
  28.  
  29. /* The following two structures have been stolen from Chris Paris excellent
  30.    exposition of the NeXT mailbox format */
  31.  
  32. struct table_of_contents_header
  33. {
  34.    int magic;          /* magic number: 890712 */
  35.    int num_msgs;       /* number of messages in mbox */
  36.    time_t mbox_time;    /* the m_time of mbox */
  37.    NXCoord list;        /* height of upper section of split view containing list */
  38.    NXRect window;       /* Mail window */
  39. };
  40.  
  41. struct message_index
  42. {
  43.    int record_length;  /* the length of this record, including this word */
  44.    int mes_offset;     /* offset in mbox where this message begins */
  45.    int mes_length;     /* length in bytes of this message in mbox */
  46.    int mes_date;       /* the date of this message */
  47.    char status;         /* read ' ' or '>', unread '*', deleted 'd' or 'D', flagged '+' */
  48.    char msgtype;        /* regular ' ', NeXT mail 'r' or Mime Mail 'm' */
  49.    char encrypted;      /* Is this message encrypted ? */
  50.    char sync;           /* always ' ' */
  51.    char data[0];
  52. };
  53.  
  54. struct table_of_contents_header *get_table_of_contents_header(FILE *f,int createflag);
  55. struct message_index *get_message_index(FILE *f);
  56.  
  57. char *message_from(const struct message_index *mi);
  58. char *message_subject(const struct message_index *mi);
  59. char *message_reference(const struct message_index *mi);
  60.  
  61. int message_attachsize(const struct message_index *mi);
  62. time_t message_attachtime(const struct message_index *mi);
  63. int message_priority(const struct message_index *mi);
  64.  
  65. int message_set_attachsize(struct message_index *mi,int size);
  66. time_t message_set_attachtime(struct message_index *mi,time_t time);
  67. int message_set_priority(struct message_index *mi,int priority);
  68.  
  69. long message_current_date(void);
  70. long message_date(int year,const char *month,int day);
  71.  
  72. int message_age(const struct message_index *mi);
  73.  
  74. int put_message_index(FILE *f,struct message_index *mi);
  75. int put_table_of_contents_header(FILE *f,struct table_of_contents_header *toc);
  76.