You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Netscape Messaging Access SDK: Source Code Documentation
<prasad@netscape.com>
Last Updated: Aug 25, 1998

Contents

Overview

The source code for the Messaging Access SDK consists of the sources for the C SDK and the sources for the Java SDK. This document describes the source tree organization and the contents of each file for both Java and C sides of the SDK. It also addresses other issues related to the source tree as needed.

At the top level, the source code for the Netscape Messaging Access SDK is organized as shown below:

	mozilla/
 	   msgsdk/
	      C/
	      java/
	      CONFIG/
As shown above, at the msgsdk root the SDK source tree contains two sub-directories named C and java that contain the sources for the C and Java sides of the SDK respectively. The Makefile at this level is common to both Java and C sides and builds either Java or C side of the SDK based on the build target specified. Please see the build instructions for further details.

The CONFIG directory that is also at the top level contains the configuration file msgsdk.mk and the companion getarch file. These files are also common to both java and C sides of the SDK and contain platform specific definitions. These files contain the needed definitions for several platforms already. You can add the definitions for other platforms as needed. Please see the build instructions for further details.

Roadmap of C SDK Sources

The C SDK comprises of the libraries libcomm, libmime, libsmtp, libpop3 and libimap4. The libcomm library contains the low-level socket I/O routines and the streaming API routines. Other libraries contain corresponding protocol API routines as indicated by the name of the library.

The source code for the C SDK is organized in the following directories:

	mozilla/
 	   msgsdk/
 	      C/
	        include/ 	// Common include files to the C SDK
	        src/ 		// Sources for the libcomm library
	        protocol/ 	// Root for all protocol API sources
	 	  MIME/ 	// MIME protocol API sub directory
		     include/   // MIME include files
		     src/ 	// MIME src files
		  SMTP/ 	// SMTP protocol API sub directory
		     include/ 	// SMTP include files
		     src/ 	// SMTP src file
		  POP3/ 	// POP3 protocol API sub directory
		     include/ 	// POP3 include files
		     src/ 	// POP3 src file
		  IMAP4/ 	// IMAP4 protocol API sub directory
		     include/ 	// IMAP4 include files
		     src/ 	// IMAP4 src file
Below we give a brief description of contents of each file. Please refer to the comments at the beginning of each source file for complete details.

The mozilla/msgsdk/C/include directory contains the following files:

  • nsmail.h - common definitions for all libraries
  • nsStream.h - definitions for the streaming API
  • nsio.h - definitions for the i/o routines
  • nssocket.h - platform dependent socket i/o definitions

The mozilla/msgsdk/C/src directory contains the following files:

  • nsStream.c - streaming API routines
  • nsio.c - platform independent messaging SDK i/o routines
  • nssocket.c - platform dependent socket i/o wrapper routines
NOTE: If you would like to port the libcomm library to other platforms you will need to modify nssocket.[ch] files.

The mozilla/msgsdk/C/protocol/MIME/include directory contains the following files:

  • mime.h - MIME encoder and exposed API definitions
  • mimeparser.h - MIME parser definitions
  • mime_internal.h - internal MIME definitions
  • mimeparser_internal.h - internal definitions specific to the parser
  • util.h - definitions for the common utility routines
  • vector.h - definitions for vector routines used by the parser

The mozilla/msgsdk/C/protocol/MIME/src directory contains the following files:

  • mime.c - MIME encoder and parser/encoder common routines
  • mimeparser.c - MIME parser routines
  • mime_internal.c - common internal routines
  • mimeDataSink.c - MIME DataSink routines
  • util.c - utility routines
  • vector.c - vector routines used by the parser

The mozilla/msgsdk/C/protocol/SMTP/include directory contains the following files:

  • smtp.h - Exposed SMTP API definitions
  • smtppriv.h - Internal SMTP definitions
The mozilla/msgsdk/C/protocol/SMTP/src directory contains the following file:
  • smtp.c - The SMTP API implementation.
The mozilla/msgsdk/C/protocol/POP3/include directory contains the following files:
  • pop3.h - Exposed POP3 API definitions
  • prop3priv.h - Internal POP3 definitions
The mozilla/msgsdk/C/protocol/POP3/src directory contains the following file:
  • pop3.c - POP3 API implementation
The mozilla/msgsdk/C/protocol/IMAP4/include directory contains the following files:
  • imap4.h - Exposed IMAP4 API definitions
  • imapdata.h - Internal IMAP4 data structure definitions
The mozilla/msgsdk/C/protocol/IMAP4/src directory contains the following file:
  • imap4.c - IMAP4 API implementation
NOTE: Please note that most of the directories above have an example or test sub directory that contains test or example programs for the corresponding API. These are not explicitly listed above to avoid cluttering up the main source tree description.

Roadmap of Java SDK Sources

The Java SDK comprises of the class libraries for MIME, SMTP, POP3, IMAP4 and the Convenience APIs. The SDK includes several support classes for low level i/o and byte buffer handling.

The source code for the Java SDK is organized in the following directories:

	mozilla/
 	   msgsdk/
 	      java/
		highlevel/ 	// Convenience (highlevel) API subdir
 		    src/ 	// Convenience API src files
 		protocol/ 	// Root for all protocol API sources
 		    Messaging/ 	// Sub directory for common i/o routines
			src/ 	// Messaging (common/io) src files
		     MIME/ 	// MIME protocol API sub directory
			src/ 	// MIME src files
		     SMTP/ 	// SMTP protocol API sub directory
			src/ 	// SMTP src files
		     POP3/ 	// POP3 protocol API sub directory
			src/ 	// POP3 src files
		     IMAP4/ 	// IMAP4 protocol API sub directory
			src/ 	// IMAP4 src files

Below we give a brief description of contents of each file. Please refer to the javadocs and comments at the beginning of each source file for complete details.

The mozilla/msgsdk/java/highlevel/src directory contains the following files:

  • IMTransport.java - Implementation of IMTransport class
  • IMAttachment.java - Implementation of IMAttachment class
  • IMSendThr.java - Utility class to do message transfer in a separate thread
  • IMException.java - Exception class for the convenience API
The mozilla/msgsdk/java/protocol/Messaging/src directory contains the following files:
  • Common.java - Helper class that implements utiltity routines for IO class
  • IO.java - Encapsulates low level IO / sockect functionality
The mozilla/msgsdk/java/protocol/MIME/src directory contains the following files:
  • MIMEMessage.java - Implements the MIMEMessage class
  • MIMEBodyPart.java - Abstract base class for all MIME bodypart types
  • MIMEBasicPart.java - Implements basic / leaf parts of a MIME message
  • MIMEMultiPart.java - Implements the MIMEMultiPart class
  • MIMEMessagePart.java - Implements the MIMEMessagePart class
  • Header.java - Implements MIME / RFC822 headers
  • ByteBuffer.java - Implements a ByteBuffer (similar to StringBuffer)
  • MIMEHelper.java - Implements encoder, decoder and other helper routines
  • fileMIMEType.java - Filenames to MIME types mapper class
  • MIMEParser.java - Implements the MIMEParser
  • MIMEDynamicParser.java - Implements the MIMEDynamic Parser
  • MIMEDataSink.java - Abstract class that defines data sink for dynamic parser
  • MIMEException.java - Implements MIMEException
The mozilla/msgsdk/java/protocol/SMTP/src directory contains the following files:
  • SMTPClient.java - Class that implements the SMTP API
  • ISMTPSink.java - Interface definition for the SMTP protocol sink
  • SMTPSink.java - A default (null body) implementation of ISMTPSink
  • SMTPException.java - Implements the SMTPException
The mozilla/msgsdk/java/protocol/POP3/src directory contains the following files:
  • POP3Client.java - Class that implements the POP3 API
  • IPOP3Sink.java - Interface definition for the POP3 protocol sink
  • POP3Sink.java - A default (null body) implementation of IPOP3Sink
  • POP3Exception.java - Implements the POP3Exception
The mozilla/msgsdk/java/protocol/IMAP4/src directory contains the following files:
  • IMAP4Client.java - Class that implements the IMAP4 API
  • IIMAP4Sink.java - Interface definition for the POP3 protocol sink
  • IMAP4Sink.java - A default (null body) implementation of IIMAP4Sink
  • IMAP4Exception.java - Implements the IMAP4Exception
  • IGlobals.java - Contains definition of Global constants for this API
  • Dispatcher.java - Parses responses and dispatches to right callback in sink
  • SystemPreferences.java - Class that handles preferences like block-size, time-out etc.
NOTE: Please note that most of the directories above have an example or test sub directory that contains test or example programs for the corresponding API. These are not explicitly listed above to avoid cluttering up the main source tree description.


Copyright © 1998 Netscape Communications Corporation