home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / hyprmail.zip / hypermail.h < prev    next >
C/C++ Source or Header  |  1994-07-31  |  3KB  |  140 lines

  1. /*
  2. ** Copyright (C) 1994, Enterprise Integration Technologies Corp.          
  3. ** All Rights Reserved.
  4. ** Kevin Hughes, kevinh@eit.com
  5. ** 7/31/94
  6. */
  7.  
  8. #include "config.h"
  9.  
  10. #define VERSION    "1.02"
  11. #define PROGNAME   "hypermail"
  12. #define HMURL      "http://www.eit.com/software/hypermail/hypermail.html"
  13. #define DIRNAME    "archive"
  14. #define INDEXNAME  "index.html"
  15. #define DATENAME   "date.html"
  16. #define THRDNAME   "thread.html"
  17. #define SUBJNAME   "subject.html"
  18. #define AUTHNAME   "author.html"
  19. #define NONAME     "(no name)"
  20. #define NODATE     "(no date)"
  21. #define NOEMAIL    "(no email)"
  22. #define NOSUBJECT  "(no subject)"
  23. #define MAXLINE       1000
  24. #define MAXFILELEN 100
  25. #define NAMESTRLEN 80
  26. #define NUMSTRLEN  10
  27. #define MAILSTRLEN 80
  28. #define DATESTRLEN 80
  29. #define MSGDSTRLEN 80
  30. #define REPYSTRLEN 240
  31. #define SUBJSTRLEN 100
  32. #define URLSTRLEN  100
  33. #define HASHSIZE   101
  34.  
  35. #define SHORTDATELEN   9
  36. #define TIMEZONELEN    10
  37. #define YEARLEN        5
  38. #define CENTURY        1900
  39. #define BASEYEAR       1970
  40. #define DAYSPERYEAR    365
  41. #define SECSPERMIN     60
  42. #define SECSPERHOUR    3600
  43. #define SECSPERDAY     86400
  44. #define IS_LEAP(y) (y > 1752 && (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)))
  45.  
  46. #include <stdio.h>
  47. #include <sys/types.h>
  48. #include <sys/stat.h>
  49. #include <stdlib.h>
  50. #include <pwd.h>
  51.  
  52. #ifndef MAIN_FILE
  53. #define VAR extern
  54. #else
  55. #define VAR
  56. #endif
  57.  
  58. struct reply {
  59.     int msgnum;
  60.     int frommsgnum;
  61.     char *name;
  62.     char *subject;
  63.     int maybereply;
  64.     struct reply *next;
  65. };
  66.  
  67. struct body {
  68.     char *line;
  69.     struct body *next;
  70. };
  71.  
  72. struct printed {
  73.     int msgnum;
  74.     struct printed *next;
  75. };
  76.  
  77. struct email {
  78.     int msgnum;
  79.     char *name;
  80.     char *emailaddr;
  81.     char *fromdatestr;
  82.     char *datestr;
  83.     char *msgid;
  84.     char *subject;
  85.     char *inreplyto;
  86.     struct body *bodylist;
  87.     struct email *next;
  88. };
  89.  
  90. struct header {
  91.     int msgnum;
  92.     char *name;
  93.     char *subject;
  94.     char *datestr;
  95.     int datenum;
  96.     struct header *left;
  97.     struct header *right;
  98. };
  99.  
  100. VAR struct header *subjectlist;
  101. VAR struct header *authorlist;
  102. VAR struct header *datelist;
  103. VAR struct reply *replylist;
  104. VAR struct reply *threadlist;
  105. VAR struct printed *printedlist;
  106. VAR struct printed *printedthreadlist;
  107. VAR struct email *etable[HASHSIZE];
  108. VAR char timezonestr[TIMEZONELEN];
  109. VAR char thisyear[YEARLEN];
  110. VAR char datename[NAMESTRLEN];
  111. VAR char thrdname[NAMESTRLEN];
  112. VAR char subjname[NAMESTRLEN];
  113. VAR char authname[NAMESTRLEN];
  114. VAR char errmsg[MAXLINE];
  115. VAR int firstdatenum;
  116. VAR int lastdatenum;
  117. VAR int bignum;
  118. VAR int showprogress;
  119. VAR int reverse;
  120. VAR int showheaders;
  121. VAR int showhtml;
  122. VAR int thrdlevels;
  123. VAR int dirmode;
  124. VAR int filemode;
  125.  
  126. #ifdef MAIN_FILE
  127. char *urls[] = { "http://", "gopher://", "file://", "ftp://",
  128.     "wais://", "telnet://", "news:", "mailto:", NULL };
  129. char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
  130.         "Aug", "Sep", "Oct", "Nov", "Dec" };
  131. char *days[] = { "Sun ", "Mon ", "Tue ", "Wed ", "Thu ", "Fri ", "Sat ", NULL };
  132. char monthnums[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  133.         '0', '1', '2' };
  134. int monthdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 30, 30, 31 };
  135. #else
  136. extern char *urls[], *months[], *days[];
  137. extern char monthnums[];
  138. extern int monthdays[];
  139. #endif
  140.