home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / pine / c-client / mail.h_vms < prev    next >
Text File  |  1994-02-13  |  20KB  |  638 lines

  1. /*
  2.  * Program:    Mailbox Access routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    22 November 1989
  13.  * Last Edited:    14 September 1993
  14.  *
  15.  * Copyright 1993 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. #ifndef    __MAIL_H
  37. #define    __MAIL_H
  38. /* Build parameters */
  39.  
  40. #define CACHEINCREMENT 100    /* cache growth increments */
  41. #define MAILTMPLEN 1024        /* size of a temporary buffer */
  42. #define MAXMESSAGESIZE 65000    /* MS-DOS: maximum text buffer size
  43.                  * other:  initial text buffer size */
  44. #define NUSERFLAGS 30        /* # of user flags (current servers 30 max) */
  45. #define BASEYEAR 1969        /* the year time began */
  46.  
  47.  
  48. /* Constants */
  49.  
  50. #define NIL 0            /* convenient name */
  51. #define T 1            /* opposite of NIL */
  52. #define LONGT (long) 1        /* long T */
  53.  
  54. #define WARN (long) 1        /* mm_log warning type */
  55. #define ERROR (long) 2        /* mm_log error type */
  56. #define PARSE (long) 3        /* mm_log parse error type */
  57.  
  58.  
  59. /* Open options */
  60.  
  61. #define OP_DEBUG (long) 1    /* debug protocol negotiations */
  62. #define OP_READONLY (long) 2    /* read-only open */
  63. #define OP_ANONYMOUS (long) 4    /* anonymous open of newsgroup */
  64. #define OP_SHORTCACHE (long) 8    /* short (elt-only) caching */
  65. #define OP_SILENT (long) 16    /* don't pass up events (internal use) */
  66. #define OP_PROTOTYPE (long) 32    /* return driver prototype */
  67. #define OP_HALFOPEN (long) 64    /* half-open (IMAP connect but no select) */
  68.  
  69.  
  70. /* Cache management function codes */
  71.  
  72. #define CH_INIT (long) 10    /* initialize cache */
  73. #define CH_SIZE (long) 11    /* (re-)size the cache */
  74. #define CH_MAKELELT (long) 20    /* return long elt, make if needed */
  75. #define CH_LELT (long) 21    /* return long elt if exists */
  76. #define CH_MAKEELT (long) 30    /* return short elt, make if needed */
  77. #define CH_ELT (long) 31    /* return short elt if exists */
  78. #define CH_FREE (long) 40    /* free space used by elt */
  79. #define CH_EXPUNGE (long) 45    /* delete elt pointer from list */
  80.  
  81.  
  82. /* Garbage collection flags */
  83.  
  84. #define GC_ELT (long) 1        /* message cache elements */
  85. #define GC_ENV (long) 2        /* envelopes and bodies */
  86. #define GC_TEXTS (long) 4    /* cached texts */
  87.  
  88. /* Message structures */
  89.  
  90.  
  91. /* Item in an address list */
  92.  
  93. #define ADDRESS struct mail_address
  94. ADDRESS {
  95.   char *personal;        /* personal name phrase */
  96.   char *adl;            /* at-domain-list source route */
  97.   char *mailbox;        /* mailbox name */
  98.   char *host;            /* domain name of mailbox's host */
  99.   char *error;            /* error in address from SMTP module */
  100.   ADDRESS *next;        /* pointer to next address in list */
  101. };
  102.  
  103.  
  104. /* Message envelope */
  105.  
  106. typedef struct mail_envelope {
  107.   char *remail;            /* remail header if any */
  108.   ADDRESS *return_path;        /* error return address */
  109.   char *date;            /* message composition date string */
  110.   ADDRESS *from;        /* originator address list */
  111.   ADDRESS *sender;        /* sender address list */
  112.   ADDRESS *reply_to;        /* reply address list */
  113.   char *subject;        /* message subject string */
  114.   ADDRESS *to;            /* primary recipient list */
  115.   ADDRESS *cc;            /* secondary recipient list */
  116.   ADDRESS *bcc;            /* blind secondary recipient list */
  117.   char *in_reply_to;        /* replied message ID */
  118.   char *message_id;        /* message ID */
  119.   char *newsgroups;        /* USENET newsgroups */
  120. } ENVELOPE;
  121.  
  122. /* Primary body types */
  123. /* If you change any of these you must also change body_types in rfc822.c */
  124.  
  125. extern const char *body_types[];/* defined body type strings */
  126.  
  127. #define TYPETEXT 0        /* unformatted text */
  128. #define TYPEMULTIPART 1        /* multiple part */
  129. #define TYPEMESSAGE 2        /* encapsulated message */
  130. #define TYPEAPPLICATION 3    /* application data */
  131. #define TYPEAUDIO 4        /* audio */
  132. #define TYPEIMAGE 5        /* static image */
  133. #define TYPEVIDEO 6        /* video */
  134. #define TYPEOTHER 7        /* unknown */
  135.  
  136.  
  137. /* Body encodings */
  138. /* If you change any of these you must also change body_encodings in rfc822.c
  139.  */
  140.  
  141.                 /* defined body encoding strings */
  142. extern const char *body_encodings[];
  143.  
  144. #define ENC7BIT 0        /* 7 bit SMTP semantic data */
  145. #define ENC8BIT 1        /* 8 bit SMTP semantic data */
  146. #define ENCBINARY 2        /* 8 bit binary data */
  147. #define ENCBASE64 3        /* base-64 encoded data */
  148. #define ENCQUOTEDPRINTABLE 4    /* human-readable 8-as-7 bit data */
  149. #define ENCOTHER 5        /* unknown */
  150.  
  151.  
  152. /* Body contents */
  153.  
  154. #define BINARY void
  155. #define BODY struct mail_body
  156. #define MESSAGE struct mail_body_message
  157. #define PARAMETER struct mail_body_parameter
  158. #define PART struct mail_body_part
  159.  
  160. /* Message content (ONLY for parsed messages) */
  161.  
  162. MESSAGE {
  163.   ENVELOPE *env;        /* message envelope */
  164.   BODY *body;            /* message body */
  165.   char *text;            /* message in RFC-822 form */
  166.   unsigned long offset;        /* offset of text from header */
  167. };
  168.  
  169.  
  170. /* Parameter list */
  171.  
  172. PARAMETER {
  173.   char *attribute;        /* parameter attribute name */
  174.   char *value;            /* parameter value */
  175.   PARAMETER *next;        /* next parameter in list */
  176. };
  177.  
  178.  
  179. /* Message body structure */
  180.  
  181. BODY {
  182.   unsigned short type;        /* body primary type */
  183.   unsigned short encoding;    /* body transfer encoding */
  184.   char *subtype;        /* subtype string */
  185.   PARAMETER *parameter;        /* parameter list */
  186.   char *id;            /* body identifier */
  187.   char *description;        /* body description */
  188.   union {            /* different ways of accessing contents */
  189.     unsigned char *text;    /* body text (+ enc. message in composing) */
  190.     BINARY *binary;        /* body binary */
  191.     PART *part;            /* body part list */
  192.     MESSAGE msg;        /* body encapsulated message (PARSE ONLY) */
  193.   } contents;
  194.   struct {
  195.     unsigned long lines;    /* size in lines */
  196.     unsigned long bytes;    /* size in bytes */
  197.     unsigned long ibytes;    /* internal size in bytes (drivers ONLY!!) */
  198.   } size;
  199. };
  200.  
  201.  
  202. /* Multipart content list */
  203.  
  204. PART {
  205.   BODY body;            /* body information for this part */
  206.   unsigned long offset;        /* offset from body origin */
  207.   PART *next;            /* next body part */
  208. };
  209.  
  210. /* Entry in the message cache array */
  211.  
  212. typedef struct message_cache {
  213.   unsigned long msgno;        /* message number */
  214.   /* The next 8 bytes is ordered in this way so that it will be reasonable even
  215.    * on a 36-bit machine.  Maybe someday I'll port this to TOPS-20.  ;-)
  216.    */
  217.             /* internal time/zone, system flags (4 bytes) */
  218.   unsigned int hours: 5;    /* hours (0-23) */
  219.   unsigned int minutes: 6;    /* minutes (0-59) */
  220.   unsigned int seconds: 6;    /* seconds (0-59) */
  221.   /* It may seem easier to have zhours be signed.  Unfortunately, a certain
  222.    * cretinous C compiler from a well-known software vendor in Redmond, WA
  223.    * does not allow signed bit fields.
  224.    */
  225.   unsigned int zoccident : 1;    /* non-zero if west of UTC */
  226.   unsigned int zhours : 4;    /* hours from UTC (0-12) */
  227.   unsigned int zminutes: 6;    /* minutes (0-59) */
  228.   unsigned int seen : 1;    /* system Seen flag */
  229.   unsigned int deleted : 1;    /* system Deleted flag */
  230.   unsigned int flagged : 1;     /* system Flagged flag */
  231.   unsigned int answered : 1;    /* system Answered flag */
  232.             /* flags, lock count (2 bytes) */
  233.   unsigned int xxxx : 1;    /* system flag reserved for future */
  234.   unsigned int yyyy : 1;    /* system flag reserved for future */
  235.   unsigned int recent : 1;    /* message is new as of this mailbox open */
  236.   unsigned int searched : 1;    /* message was searched */
  237.   unsigned int sequence : 1;    /* (driver use) message is in sequence */
  238.   unsigned int spare : 1;    /* reserved for use by main program */
  239.   unsigned int zzzz : 2;    /* reserved for future assignment */
  240.   unsigned int lockcount : 8;    /* non-zero if multiple references */
  241.             /* internal date (2 bytes) */
  242.   unsigned int day : 5;        /* day of month (1-31) */
  243.   unsigned int month : 4;    /* month of year (1-12) */
  244.   unsigned int year : 7;    /* year since 1969 (expires 2097) */
  245.   unsigned long user_flags;    /* user-assignable flags */
  246.   unsigned long rfc822_size;    /* # of bytes of message as raw RFC822 */
  247.   unsigned long data1;        /* (driver use) first data item */
  248.   unsigned long data2;        /* (driver use) second data item */
  249. } MESSAGECACHE;
  250.  
  251.  
  252. typedef struct long_cache {
  253.   MESSAGECACHE elt;
  254.   ENVELOPE *env;        /* pointer to message envelope */
  255.   BODY *body;            /* pointer to message body */
  256. } LONGCACHE;
  257.  
  258. /* String structure */
  259.  
  260. #define STRINGDRIVER struct string_driver
  261.  
  262. typedef struct mailstring {
  263.   void *data;            /* driver-dependent data */
  264.   unsigned long data1;        /* driver-dependent data */
  265.   unsigned long size;        /* total length of string */
  266.   char *chunk;            /* base address of chunk */
  267.   unsigned long chunksize;    /* size of chunk */
  268.   unsigned long offset;        /* offset of this chunk in base */
  269.   char *curpos;            /* current position in chunk */
  270.   unsigned long cursize;    /* number of bytes remaining in chunk */
  271.   STRINGDRIVER *dtb;        /* driver that handles this type of string */
  272. } STRING;
  273.  
  274.  
  275. /* Dispatch table for string driver */
  276.  
  277. STRINGDRIVER {
  278.                 /* initialize string driver */
  279.   void (*init) ();
  280.                 /* get next character in string */
  281.   char (*next) ();
  282.                 /* set position in string */
  283.   void (*setpos) ();
  284. };
  285.  
  286.  
  287. /* Stringstruct access routines */
  288.  
  289. #define INIT(s,d,data,size) ((*((s)->dtb = &d)->init) (s,data,size))
  290. #define SIZE(s) ((s)->size - GETPOS (s))
  291. #define CHR(s) (*(s)->curpos)
  292. #define SNX(s) (--(s)->cursize ? *(s)->curpos++ : (*(s)->dtb->next) (s))
  293. #define GETPOS(s) ((s)->offset + ((s)->curpos - (s)->chunk))
  294. #define SETPOS(s,i) (*(s)->dtb->setpos) (s,i)
  295.  
  296. /* Mail Access I/O stream */
  297.  
  298.  
  299. /* Structure for mail driver dispatch */
  300.  
  301. #define DRIVER struct driver    
  302.  
  303.  
  304. /* Mail I/O stream */
  305.  
  306. typedef struct mail_stream {
  307.   DRIVER *dtb;            /* dispatch table for this driver */
  308.   void *local;            /* pointer to driver local data */
  309.   char *mailbox;        /* mailbox name */
  310. #ifdef VMS
  311.   unsigned long    MailboxContext;    /* Used to refference mailbox actions */
  312.   unsigned long MessageContext; /* While we are inside a message */
  313. #endif    /* VMS */
  314.   unsigned int lock : 1;    /* stream lock flag */
  315.   unsigned int debug : 1;    /* stream debug flag */
  316.   unsigned int silent : 1;    /* silent stream from Tenex */
  317.   unsigned int readonly : 1;    /* stream read-only flag */
  318.   unsigned int anonymous : 1;    /* stream anonymous access flag */
  319.   unsigned int scache : 1;    /* stream short cache flag */
  320.   unsigned int halfopen : 1;    /* stream half-open flag */
  321.   unsigned short use;        /* stream use count */
  322.   unsigned short sequence;    /* stream sequence */
  323.   unsigned long gensym;        /* generated tag */
  324.   unsigned long nmsgs;        /* # of associated msgs */
  325.   unsigned long recent;        /* # of recent msgs */
  326.   char *flagstring;        /* buffer of user keyflags */
  327.   char *user_flags[NUSERFLAGS];    /* pointers to user flags in bit order */
  328.   unsigned long cachesize;    /* size of message cache */
  329.   union {
  330.     void **c;            /* to get at the cache in general */
  331.     MESSAGECACHE **s;        /* message cache array */
  332.     LONGCACHE **l;        /* long cache array */
  333.   } cache;
  334.   unsigned long msgno;        /* message number of `current' message */
  335.   ENVELOPE *env;        /* pointer to `current' message envelope */
  336.   BODY *body;            /* pointer to `current' message body */
  337.   char *text;            /* pointer to `current' text */
  338. } MAILSTREAM;
  339.  
  340.  
  341. /* Mail I/O stream handle */
  342.  
  343. typedef struct mail_stream_handle {
  344.   MAILSTREAM *stream;        /* pointer to mail stream */
  345.   unsigned short sequence;    /* sequence of what we expect stream to be */
  346. } MAILHANDLE;
  347.  
  348. /* Mail driver dispatch */
  349.  
  350. DRIVER {
  351.   char *name;            /* driver name */
  352.   DRIVER *next;            /* next driver */
  353.                 /* mailbox is valid for us */
  354.   DRIVER *(*valid) ();
  355.                 /* manipulate driver parameters */
  356.   void *(*parameters) ();
  357.                 /* find mailboxes */
  358.   void (*find) ();
  359.                 /* find bboards */
  360.   void (*find_bboard) ();
  361.                 /* find all mailboxes */
  362.   void (*find_all) ();
  363.                 /* find all bboards */
  364.   void (*find_all_bboard) ();
  365.                 /* subscribe to mailbox */
  366.   long (*subscribe) ();
  367.                 /* unsubscribe from mailbox */
  368.   long (*unsubscribe) ();
  369.                 /* subscribe to bboard */
  370.   long (*subscribe_bboard) ();
  371.                 /* unsubscribe to bboard */
  372.   long (*unsubscribe_bboard) ();
  373.                 /* create mailbox */
  374.   long (*create) ();
  375.                 /* delete mailbox */
  376.   long (*delete) ();
  377.                 /* rename mailbox */
  378.   long (*rename) ();
  379.  
  380.                 /* open mailbox */
  381.   MAILSTREAM *(*open) ();
  382.                 /* close mailbox */
  383.   void (*close) ();
  384.                 /* fetch message "fast" attributes */
  385.   void (*fetchfast) ();
  386.                 /* fetch message flags */
  387.   void (*fetchflags) ();
  388.                 /* fetch message envelopes */
  389.   ENVELOPE *(*fetchstructure) ();
  390.                 /* fetch message header only */
  391.   char *(*fetchheader) ();
  392.                 /* fetch message body only */
  393.   char *(*fetchtext) ();
  394.                 /* fetch message body section */
  395.   char *(*fetchbody) ();
  396.                 /* set message flag */
  397.   void (*setflag) ();
  398.                 /* clear message flag */
  399.   void (*clearflag) ();
  400.                 /* search for message based on criteria */
  401.   void (*search) ();
  402.                 /* ping mailbox to see if still alive */
  403.   long (*ping) ();
  404.                 /* check for new messages */
  405.   void (*check) ();
  406.                 /* expunge deleted messages */
  407.   void (*expunge) ();
  408.                 /* copy messages to another mailbox */
  409.   long (*copy) ();
  410.                 /* move messages to another mailbox */
  411.   long (*move) ();
  412.                 /* append string message to mailbox */
  413.   long (*append) ();
  414.                 /* garbage collect stream */
  415.   void (*gc) ();
  416. };
  417.  
  418.  
  419. /* Parse results from mail_valid_net_parse */
  420.  
  421. #define MAXSRV 20
  422. typedef struct net_mailbox {
  423.   char host[MAILTMPLEN];    /* host name */
  424.   char mailbox[MAILTMPLEN];    /* mailbox name */
  425.   char service[MAXSRV+1];    /* service name */
  426.   int port;            /* TCP port number */
  427.   unsigned int anoflag : 1;    /* anonymous */
  428.   unsigned int bbdflag : 1;    /* bboard flag */
  429. } NETMBX;
  430.  
  431. /* Other symbols */
  432.  
  433. extern const char *months[];    /* month name strings */
  434.  
  435.  
  436. /* Jacket into external interfaces */
  437.  
  438. typedef long (*readfn_t) ();
  439. typedef char *(*mailgets_t) ();
  440. typedef void *(*mailcache_t) ();
  441.  
  442. extern MAILSTREAM *mailstd_proto;
  443. extern char *lhostn;
  444. extern mailgets_t mailgets;
  445. extern mailcache_t mailcache;
  446.  
  447. /* Coddle certain compilers' 6-character symbol limitation */
  448.  
  449. #ifdef __COMPILER_KCC__
  450. #define mm_gets mmgets
  451. #define mm_cache mmcach
  452. #define mm_searched mmsrhd
  453. #define mm_exists mmexst
  454. #define mm_expunged mmexpn
  455. #define mm_flags mmflag
  456. #define mm_notify mmntfy
  457. #define mm_mailbox mmmlbx
  458. #define mm_bboard mmbbrd
  459. #define mm_log mmlog
  460. #define mm_dlog mmdlog
  461. #define mm_login mmlogn
  462. #define mm_critical mmcrit
  463. #define mm_nocritical mmncrt
  464. #define mm_diskerror mmderr
  465. #define mm_fatal mmfatl
  466. #define mail_string mstr
  467. #define mail_string_init mstrin
  468. #define mail_string_next mstrnx
  469. #define mail_string_setpos mstrsp
  470. #define mail_link mllink
  471. #define mail_parameters mlparm
  472. #define mail_find mlfind
  473. #define mail_find_bboards mlfndb
  474. #define mail_find_all mlfnam
  475. #define mail_find_all_bboard mlfalb
  476. #define mail_valid mlvali
  477. #define mail_valid_net mlvaln
  478. #define mail_valid_net_parse mlvlnp
  479. #define mail_subscribe mlsub
  480. #define mail_unsubscribe mlusub
  481. #define mail_subscribe_bboard mlsubb
  482. #define mail_unsubscribe_bboard mlusbb
  483. #define mail_create mlcret
  484. #define mail_delete mldele
  485. #define mail_rename mlrena
  486. #define mail_open mlopen
  487. #define mail_close mlclse
  488. #define mail_makehandle mlmkha
  489. #define mail_free_handle mlfrha
  490. #define mail_stream mlstrm
  491. #define mail_fetchfast mlffst
  492. #define mail_fetchflags mlfflg
  493. #define mail_fetchstructure mlfstr
  494. #define mail_fetchheader mlfhdr
  495. #define mail_fetchtext mlftxt
  496. #define mail_fetchbody mlfbdy
  497. #define mail_fetchfrom mlffrm
  498. #define mail_fetchsubject mlfsub
  499.  
  500. #define mail_lelt mllelt
  501. #define mail_elt mlelt
  502. #define mail_setflag mlsflg
  503. #define mail_clearflag mlcflg
  504. #define mail_search mlsrch
  505. #define mail_ping mlping
  506. #define mail_check mlchck
  507. #define mail_expunge mlexpn
  508. #define mail_copy mlcopy
  509. #define mail_move mlmove
  510. #define mail_append mlappd
  511. #define mail_gc mailgc
  512. #define mail_date mldate
  513. #define mail_cdate mlcdat
  514. #define mail_parse_date mlpdat
  515. #define mail_searched mlsrch
  516. #define mail_exists mlexist
  517. #define mail_recent mlrcnt
  518. #define mail_expunged mlexst
  519. #define mail_lock mllock
  520. #define mail_unlock mlulck
  521. #define mail_debug mldbug
  522. #define mail_nodebug mlndbg
  523. #define mail_sequence mlsequ
  524. #define mail_newenvelope mlnenv
  525. #define mail_newaddr mlnadr
  526. #define mail_newbody mlnbod
  527. #define mail_initbody mlibod
  528. #define mail_newbody_parameter mlnbpr
  529. #define mail_newbody_part mlnbpt
  530. #define mail_free_body mlfrbd
  531. #define mail_free_body_data mlfrbt
  532. #define mail_free_body_parameter mlfrbr
  533. #define mail_free_body_part mlfrbp
  534. #define mail_free_cache mlfrch
  535. #define mail_free_elt mlfrel
  536. #define mail_free_envelope mlfren
  537. #define mail_free_address mlfrad
  538. #endif
  539.  
  540. /* Function prototypes */
  541.  
  542. void mm_searched  ();
  543. void mm_exists  ();
  544. void mm_expunged  ();
  545. void mm_flags  ();
  546. void mm_notify  ();
  547. void mm_mailbox  ();
  548. void mm_bboard  ();
  549. void mm_log  ();
  550. void mm_dlog  ();
  551. void mm_login  ();
  552. void mm_critical  ();
  553. void mm_nocritical  ();
  554. long mm_diskerror  ();
  555. void mm_fatal  ();
  556. char *mm_gets  ();
  557. void *mm_cache  ();
  558.  
  559. extern STRINGDRIVER mail_string;
  560. void mail_string_init  ();
  561. char mail_string_next  ();
  562. void mail_string_setpos  ();
  563. void mail_link  ();
  564. void *mail_parameters  ();
  565. void mail_find  ();
  566. void mail_find_bboards  ();
  567. void mail_find_all  ();
  568. void mail_find_all_bboard  ();
  569. DRIVER *mail_valid  ();
  570. DRIVER *mail_valid_net  ();
  571. long mail_valid_net_parse  ();
  572. long mail_subscribe  ();
  573. long mail_unsubscribe  ();
  574. long mail_subscribe_bboard  ();
  575. long mail_unsubscribe_bboard  ();
  576. long mail_create  ();
  577. long mail_delete  ();
  578. long mail_rename  ();
  579. MAILSTREAM *mail_open  ();
  580. MAILSTREAM *mail_close  ();
  581. MAILHANDLE *mail_makehandle  ();
  582. void mail_free_handle  ();
  583. MAILSTREAM *mail_stream  ();
  584. void mail_fetchfast  ();
  585. void mail_fetchflags  ();
  586. ENVELOPE *mail_fetchstructure  ();
  587. char *mail_fetchheader  ();
  588. char *mail_fetchtext  ();
  589. char *mail_fetchbody  ();
  590. void mail_fetchfrom  ();
  591. void mail_fetchsubject  ();
  592. LONGCACHE *mail_lelt  ();
  593. MESSAGECACHE *mail_elt  ();
  594.  
  595. void mail_setflag  ();
  596. void mail_clearflag  ();
  597. void mail_search  ();
  598. long mail_ping  ();
  599. void mail_check  ();
  600. void mail_expunge  ();
  601. long mail_copy  ();
  602. long mail_move  ();
  603. long mail_append  ();
  604. void mail_gc  ();
  605. char *mail_date  ();
  606. char *mail_cdate  ();
  607. long mail_parse_date  ();
  608. void mail_searched  ();
  609. void mail_exists  ();
  610. void mail_recent  ();
  611. void mail_expunged  ();
  612. void mail_lock  ();
  613. void mail_unlock  ();
  614. void mail_debug  ();
  615. void mail_nodebug  ();
  616. long mail_sequence  ();
  617. ENVELOPE *mail_newenvelope  ();
  618. ADDRESS *mail_newaddr  ();
  619. BODY *mail_newbody  ();
  620. BODY *mail_initbody  ();
  621. PARAMETER *mail_newbody_parameter  ();
  622. PART *mail_newbody_part  ();
  623. void mail_free_body  ();
  624. void mail_free_body_data  ();
  625. void mail_free_body_parameter  ();
  626. void mail_free_body_part  ();
  627. void mail_free_cache  ();
  628. void mail_free_elt  ();
  629. void mail_free_lelt  ();
  630. void mail_free_envelope  ();
  631. void mail_free_address  ();
  632.  
  633. long sm_subscribe  ();
  634. long sm_unsubscribe  ();
  635. char *sm_read  ();
  636.  
  637. #endif    /* __MAIL_H */
  638.