home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Eudora 1.3.1 / source / Include / mailbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-16  |  4.9 KB  |  118 lines  |  [TEXT/MPS ]

  1. /* Copyright (c) 1990-1992 by the University of Illinois Board of Trustees */
  2. /**********************************************************************
  3.  * the basic TOC types
  4.  **********************************************************************/
  5. typedef enum {
  6.     UNREAD=1,
  7.     READ,
  8.     REPLIED,
  9.     REDIST, 
  10.     UNSENDABLE, 
  11.     SENDABLE, 
  12.     QUEUED,
  13.     FORWARDED,
  14.     SENT,
  15.     UNSENT,
  16.     STATE_ENUM_LIMIT
  17. } StateEnum;
  18.  
  19. typedef struct
  20. {
  21.     long offset;        /* byte offset in file */
  22.     long length;        /* length of message, in bytes */
  23.     int bodyOffset; /* byte where the body begins, relative to offset */
  24.     StateEnum state;/* current state of the message */
  25.     char date[32];    /* header items to keep handy */
  26.     unsigned long seconds;     /* the value of seconds when message arrived */
  27.     unsigned long flags;        /* some binary values */
  28.     Rect savedPos;    /* saved window position */
  29.     Byte priority;    /* display as 1-5, keep as 1-200 */
  30.     Byte origPriority;
  31.     short tableId;    /* resid of xlate table to use (0 for none, -1 for default) */
  32.     long spare[3];
  33.     char from[64];    /* header items to keep handy */
  34.     char subj[64];    /* header items to keep handy */
  35.     int dateTrunc;    /* length to draw for date */
  36.     int fromTrunc;    /* length to draw for from */
  37.     Boolean selected;/* is it selected? */
  38.     Handle messH;     /* message structure (and window) if any */
  39. } MSumType, *MSumPtr;
  40.  
  41. typedef struct
  42. {
  43.     short version;        /* TOC version number */
  44.     short refN;         /* path ref number of open file */
  45.     Str31 name;      /* name of box */
  46.     long dirId;                     /* memory ONLY--not valid on disk */
  47.     short usedK;    /* number of Kbytes used by contents */
  48.     short totalK; /* number of Kbytes total */
  49.     long volumeFree;    /* free space on TOC volume */
  50.     short needRedo;    /* min summary we need to look at */
  51.     short maxValid;    /* max summary known to not need redraw */
  52.     long waste[52];
  53.     short vRef;         /* volume ref # of box */
  54.     short count;            /* number of messages described */
  55.     Boolean dirty;    /* whether or not this toc needs to be written out */
  56.     Handle next;        /* the next TOC in the chain */
  57.     MyWindowPtr win;/* the window for this toc */
  58.     short which;            /* which type of mailbox (in, out, or regular) */
  59.     Boolean spareBoolean;
  60.     MSumType sums[1];     /* summaries of the messages contained in block */
  61. } TOCType, *TOCPtr, **TOCHandle;
  62. #define FLAG_NBK                1             /* message has never been saved */
  63. #define FLAG_SIG                2             /* DO add signature to this message */
  64. #define FLAG_BX_TEXT        4             /* binhex any text attachments */
  65. #define FLAG_WRAP_OUT     8             /* send this message right away */
  66. #define FLAG_KEEP_COPY    16            /* keep a copy of this message */
  67. #define FLAG_TABS             32            /* put tabs in the body of this message */
  68. #define FLAG_OUT                (1<<27)    /* message was outgoing */
  69. #define FLAG_ADDRERR        (1<<28) /* addressing error in outgoing message */
  70. #define FLAG_ZOOMED         (1<<29) /* was window zoomed when saved */
  71. #define FLAG_ICON_BAR     (1<<30) /* use icon bar in this message */
  72. #define DEFAULT_TABLE (-1)
  73. #define NO_TABLE 0
  74. /**********************************************************************
  75.  * function prototypes
  76.  **********************************************************************/
  77. Boolean BadMailboxName(long inDirId,UPtr name,Boolean folder,long *newDirId);
  78. int BoxFClose(TOCHandle tocH);
  79. int BoxFOpen(TOCHandle tocH);
  80. void CalcSumLengths(TOCHandle tocH,int sumNum);
  81. TOCHandle CheckTOC(long dirId,UPtr boxName);
  82. void DeleteSum(TOCHandle tocH,int sumNum);
  83. TOCHandle FindTOC(long dirId,UPtr name);
  84. int FlushTOCs(Boolean andClose,Boolean canSkip);
  85. TOCHandle GetInTOC(void);
  86. int GetMailbox(long dirId, UPtr name, Boolean showIt);
  87. Boolean GetNewMailbox(long inDirId, UPtr name, Boolean *folder,long *newDirId,Boolean *xfer);
  88. TOCHandle GetOutTOC(void);
  89. void InvalSum(TOCHandle tocH,int sum);
  90. TOCHandle ReadTOC(long dirId,UPtr boxName);
  91. int RemoveMailbox(long inDirId,UPtr name);
  92. int RenameMailbox(long inDirId,UPtr oldName, UPtr newName, Boolean folder);
  93. Boolean SaveMessageSum(MSumPtr sum,TOCHandle tocH);
  94. void SetState(TOCHandle tocH, int sumNum, int state);
  95. void SortTOC(TOCHandle tocH, int (*compare)());
  96. int SumFromCompare(MSumPtr sum1, MSumPtr sum2);
  97. int SumSubjCompare(MSumPtr sum1, MSumPtr sum2);
  98. int SumTimeCompare(MSumPtr sum1, MSumPtr sum2);
  99. int RevSumFromCompare(MSumPtr sum1, MSumPtr sum2);
  100. int RevSumSubjCompare(MSumPtr sum1, MSumPtr sum2);
  101. int RevSumTimeCompare(MSumPtr sum1, MSumPtr sum2);
  102. int SumStatCompare(MSumPtr sum1, MSumPtr sum2);
  103. int RevSumStatCompare(MSumPtr sum1, MSumPtr sum2);
  104. int SumPriorCompare(MSumPtr sum1, MSumPtr sum2);
  105. int RevSumPriorCompare(MSumPtr sum1, MSumPtr sum2);
  106. TOCHandle TOCByName(long dirId,UPtr name);
  107. int WriteTOC(TOCHandle tocH);
  108. void CalcAllSumLengths(TOCHandle toc);
  109. Boolean MessagePosition(Boolean save,MyWindowPtr win);
  110. void TooLong(UPtr name);
  111. short FindDirLevel(long dirId);
  112. void AddBoxCountMenu(MenuHandle mh, short item, long dirId);
  113. void Rebox(void);
  114. short GetTOCK(TOCHandle tocH,short *usedK, short *totalK);
  115. void CleanseTOC(TOCHandle tocH);
  116. Boolean GetTransferParams(short menu,short item,long *dirId,UPtr name);
  117. void TempWarning(UPtr filename);
  118.