[ooc-compiler] Proposal for an Email-Module; RFC
Brought to you by:
mva
|
From: Marco O. <Mar...@we...> - 2001-05-14 21:12:24
|
Hello!
I would like to have your comments on my idea
implementing the module described below.
I want to use libadt. Does anyone think that
the String-Module is not sufficient for holding
single lines of the mailheader and the body?
I would like to know if something is missing
or not useful.
Traversal and modifications of a collection of
mailing is done by Iterator-Methods. I would
like to allow traversal independant of the
actual sequence of storage. One Iterator could
use Subject: while another uses Date: as
sort criteria.
I took a short look on the sources in the Oberon
System. Mail is there tightly coupled with the
user interface and distribution protocols. I
want to keep these aspects apart. The below
module just describes the interface to some
data containers. Sending and receiving mail
just as storage should to be placed outside
this module. Please tell me if you think this
way is wrong and why.
Greetings,
Marco
MODULE ElectronicMail;
TYPE
Mail * = POINTER TO MailDesc;
MailDesc * = RECORD
END;
MailContainer = POINTER TO MailContainerDesc;
MailContainerDesc = RECORD
END;
Iterator = POINTER TO IteratorDesc;
IteratorDesc = RECORD
END;
CONST
(* Sortcriteria *)
headerElement = 0;
body = 1;
date = 2;
none = 3;
PROCEDURE (m : Mail) SetHeaderEntry * (desc, content : ARRAY OF CHAR);
PROCEDURE (m : Mail) AddHeaderEntry * (desc, content : ARRAY OF CHAR);
PROCEDURE (m : Mail) GetHeaderEntry * (desc : ARRAY OF CHAR):String.String;
PROCEDURE (m : Mail) GetHeaderEntry * (index : LONGINT;
VAR desc, content : String.String);
PROCEDURE (m : Mail) SetBody * (body : ARRAY OF CHAR);
PROCEDURE (m : Mail) GetBody * ():String.String;
PROCEDURE (m : MailContainer) GetIterator * (sortCriteria : INTEGER;
header : ARRAY OF CHAR);
PROCEDURE (m : Iterator) Init *;
PROCEDURE (m : Iterator) Next * ();
PROCEDURE (m : Iterator) Forward * (n : INTEGER);
PROCEDURE (m : Iterator) First *;
PROCEDURE (m : Iterator) Last *;
PROCEDURE (m : Iterator) Get * ():Mail;
PROCEDURE (m : Iterator) Insert * (m : Mail);
PROCEDURE (m : Iterator) Lock *;
PROCEDURE (m : Iterator) IsValid * ():BOOLEAN;
END ElectronicMail.
|