merge tip with montulli branch and create montulli1

This commit is contained in:
montulli 1998-06-18 00:53:50 +00:00
parent 126dc3a360
commit 0edf3cd0fd
12 changed files with 3444 additions and 0 deletions

105
include/xp_reg.h Normal file
View File

@ -0,0 +1,105 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* shexp.h: Defines and prototypes for shell exp. match routines
*
*
* This routine will match a string with a shell expression. The expressions
* accepted are based loosely on the expressions accepted by zsh.
*
* o * matches anything
* o ? matches one character
* o \ will escape a special character
* o $ matches the end of the string
* o [abc] matches one occurence of a, b, or c. The only character that needs
* to be escaped in this is ], all others are not special.
* o [a-z] matches any character between a and z
* o [^az] matches any character except a or z
* o ~ followed by another shell expression will remove any pattern
* matching the shell expression from the match list
* o (foo|bar) will match either the substring foo, or the substring bar.
* These can be shell expressions as well.
*
* The public interface to these routines is documented below.
*
* Rob McCool
*
*/
#ifndef SHEXP_H
#define SHEXP_H
#include "xp_core.h"
/*
* Requires that the macro MALLOC be set to a "safe" malloc that will
* exit if no memory is available. If not under MCC httpd, define MALLOC
* to be the real malloc and play with fire, or make your own function.
*/
#if 0
#ifdef MCC_HTTPD
#include "../mc-httpd.h"
#endif
#endif
#include <ctype.h> /* isalnum */
#include <string.h> /* strlen */
/* --------------------------- Public routines ---------------------------- */
/*
* shexp_valid takes a shell expression exp as input. It returns:
*
* NON_SXP if exp is a standard string
* INVALID_SXP if exp is a shell expression, but invalid
* VALID_SXP if exp is a valid shell expression
*/
#define NON_SXP -1
#define INVALID_SXP -2
#define VALID_SXP 1
extern int XP_RegExpValid(char *exp);
/*
* shexp_match
*
* Takes a prevalidated shell expression exp, and a string str.
*
* Returns 0 on match and 1 on non-match.
*/
extern int XP_RegExpMatch(char *str, char *exp, Bool case_insensitive);
/*
*
* Same as above, but validates the exp first. 0 on match, 1 on non-match,
* -1 on invalid exp.
*/
extern int XP_RegExpSearch(char *str, char *exp);
/* same as above but uses case insensitive search
*/
extern int XP_RegExpCaseSearch(char *str, char *exp);
#endif

208
include/xp_sock.h Normal file
View File

@ -0,0 +1,208 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef __XP_SOCK_h_
#define __XP_SOCK_h_
#include "xp_core.h"
#include "xp_error.h"
#ifdef XP_UNIX
#ifdef AIXV3
#include <sys/signal.h>
#include <sys/select.h>
#endif /* AIXV3 */
#include <sys/types.h>
#include <string.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#ifndef __hpux
#include <arpa/inet.h>
#endif /* __hpux */
#include <netdb.h>
#endif /* XP_UNIX */
#ifdef XP_MAC
#include "macsocket.h"
#define SOCKET_BUFFER_SIZE 4096
#endif /* XP_MAC */
#ifdef XP_OS2 /* IBM-VPB050196 */
# include "os2sock.h"
# ifdef XP_OS2_DOUGSOCK
# include "dsfunc.h"
# endif
# define SOCKET_BUFFER_SIZE 4096
#endif
#ifdef XP_WIN
#include "winsock.h"
#define SOCKET_BUFFER_SIZE 4096
#ifdef __cplusplus
extern "C" {
#endif
extern int dupsocket(int foo); /* always fails */
#ifdef __cplusplus
}
#endif
#ifndef EPIPE
#define EPIPE ECONNRESET
#endif
#undef BOOLEAN
#define BOOLEAN char
#endif /* XP_WIN */
#define SOCKET_ERRNO XP_GetError()
/************************************************************************/
#ifdef XP_UNIX
/* Network i/o wrappers */
#define XP_SOCKET int
#define XP_SOCK_ERRNO errno
#define XP_SOCK_SOCKET socket
#define XP_SOCK_CONNECT connect
#define XP_SOCK_ACCEPT accept
#define XP_SOCK_BIND bind
#define XP_SOCK_LISTEN listen
#define XP_SOCK_SHUTDOWN shutdown
#define XP_SOCK_IOCTL ioctl
#define XP_SOCK_RECV recv
#define XP_SOCK_RECVFROM recvfrom
#define XP_SOCK_RECVMSG recvmsg
#define XP_SOCK_SEND send
#define XP_SOCK_SENDTO sendto
#define XP_SOCK_SENDMSG sendmsg
#define XP_SOCK_READ read
#define XP_SOCK_WRITE write
#define XP_SOCK_READV readv
#define XP_SOCK_WRITEV writev
#define XP_SOCK_GETPEERNAME getpeername
#define XP_SOCK_GETSOCKNAME getsockname
#define XP_SOCK_GETSOCKOPT getsockopt
#define XP_SOCK_SETSOCKOPT setsockopt
#define XP_SOCK_CLOSE close
#define XP_SOCK_DUP dup
#endif /* XP_UNIX */
/*IBM-DSR072296 - now using WinSock 1.1 support in OS/2 Merlin instead of DOUGSOCK...*/
#if defined(XP_WIN) || ( defined(XP_OS2) && !defined(XP_OS2_DOUGSOCK) )
#define XP_SOCKET SOCKET
#define XP_SOCK_ERRNO WSAGetLastError()
#define XP_SOCK_SOCKET socket
#define XP_SOCK_CONNECT connect
#define XP_SOCK_ACCEPT accept
#define XP_SOCK_BIND bind
#define XP_SOCK_LISTEN listen
#define XP_SOCK_SHUTDOWN shutdown
#define XP_SOCK_IOCTL ioctlsocket
#define XP_SOCK_RECV recv
#define XP_SOCK_RECVFROM recvfrom
#define XP_SOCK_RECVMSG recvmsg
#define XP_SOCK_SEND send
#define XP_SOCK_SENDTO sendto
#define XP_SOCK_SENDMSG sendmsg
#define XP_SOCK_READ(s,b,l) recv(s,b,l,0)
#define XP_SOCK_WRITE(s,b,l) send(s,b,l,0)
#define XP_SOCK_READV readv
#define XP_SOCK_WRITEV writev
#define XP_SOCK_GETPEERNAME getpeername
#define XP_SOCK_GETSOCKNAME getsockname
#define XP_SOCK_GETSOCKOPT getsockopt
#define XP_SOCK_SETSOCKOPT setsockopt
#define XP_SOCK_CLOSE closesocket
#define XP_SOCK_DUP dupsocket
#endif /* XP_WIN/ XP_OS2 && not DOUGSOCK */
#if defined(XP_OS2) && defined(XP_OS2_DOUGSOCK)
/* Network i/o wrappers */
#define XP_SOCKET int
#define XP_SOCK_ERRNO sock_errno()
#define XP_SOCK_SOCKET socket
#define XP_SOCK_CONNECT connect
#define XP_SOCK_ACCEPT accept
#define XP_SOCK_BIND bind
#define XP_SOCK_LISTEN listen
#define XP_SOCK_SHUTDOWN shutdown
#define XP_SOCK_IOCTL ioctl
#define XP_SOCK_RECV receiveAndMakeReadSocketActive
#define XP_SOCK_RECVFROM recvfrom
#define XP_SOCK_RECVMSG recvmsg
#define XP_SOCK_SEND send
#define XP_SOCK_SENDTO sendto
#define XP_SOCK_SENDMSG sendmsg
#define XP_SOCK_READ(s,b,l) receiveAndMakeReadSocketActive(s,b,l,0)
#define XP_SOCK_WRITE(s,b,l) send(s,b,l,0)
#define XP_SOCK_READV readv
#define XP_SOCK_WRITEV writev
#define XP_SOCK_GETPEERNAME getpeername
#define XP_SOCK_GETSOCKNAME getsockname
#define XP_SOCK_GETSOCKOPT getsockopt
#define XP_SOCK_SETSOCKOPT setsockopt
#define XP_SOCK_CLOSE closeAndRemoveSocketFromPostList
#define XP_SOCK_DUP dupsocket
#endif /*XP_OS2 with DOUGSOCK*/
#ifdef XP_MAC
/*
Remap unix sockets into GUSI
*/
#define XP_SOCKET int
#define XP_SOCK_ERRNO errno
#define XP_SOCK_SOCKET macsock_socket
#define XP_SOCK_CONNECT macsock_connect
#define XP_SOCK_ACCEPT macsock_accept
#define XP_SOCK_BIND macsock_bind
#define XP_SOCK_LISTEN macsock_listen
#define XP_SOCK_SHUTDOWN macsock_shutdown
#define XP_SOCK_IOCTL macsock_ioctl
#define XP_SOCK_RECV(s,b,l,f) XP_SOCK_READ(s,b,l)
#define XP_SOCK_SEND(s,b,l,f) XP_SOCK_WRITE(s,b,l)
#define XP_SOCK_READ macsock_read
#define XP_SOCK_WRITE macsock_write
#define XP_SOCK_GETPEERNAME macsock_getpeername
#define XP_SOCK_GETSOCKNAME macsock_getsockname
#define XP_SOCK_GETSOCKOPT macsock_getsockopt
#define XP_SOCK_SETSOCKOPT macsock_setsockopt
#define XP_SOCK_CLOSE macsock_close
#define XP_SOCK_DUP macsock_dup
#endif /* XP_MAC */
#endif /* __XP_SOCK_h_ */

212
lib/plugin/nsjvm.h Normal file
View File

@ -0,0 +1,212 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
// NETSCAPE JAVA VM PLUGIN EXTENSIONS
//
// This interface allows a Java virtual machine to be plugged into
// Communicator to implement the APPLET tag and host applets.
////////////////////////////////////////////////////////////////////////////////
#ifndef nsjvm_h___
#define nsjvm_h___
#include "nsplugin.h"
#include "jri.h" // XXX for now
#include "jni.h"
#include "prthread.h"
////////////////////////////////////////////////////////////////////////////////
// Java VM Plugin Manager
// This interface defines additional entry points that are available
// to JVM plugins for browsers that support JVM plugins.
class NPIJVMPluginManager : public NPIPluginManager {
public:
virtual void NP_LOADDS
BeginWaitCursor(void) = 0;
virtual void NP_LOADDS
EndWaitCursor(void) = 0;
virtual const char* NP_LOADDS
GetProgramPath(void) = 0;
virtual const char* NP_LOADDS
GetTempDirPath(void) = 0;
enum FileNameType { SIGNED_APPLET_DBNAME, TEMP_FILENAME };
virtual nsresult NP_LOADDS
GetFileName(const char* fn, FileNameType type,
char* resultBuf, PRUint32 bufLen) = 0;
virtual nsresult NP_LOADDS
NewTempFileName(const char* prefix, char* resultBuf, PRUint32 bufLen) = 0;
virtual PRBool NP_LOADDS
HandOffJSLock(PRThread* oldOwner, PRThread* newOwner) = 0;
////////////////////////////////////////////////////////////////////////////
// Debugger Stuff (XXX move to subclass)
virtual PRBool NP_LOADDS
SetDebugAgentPassword(PRInt32 pwd) = 0;
};
#define NP_IJVMPLUGINMANAGER_IID \
{ /* a1e5ed50-aa4a-11d1-85b2-00805f0e4dfe */ \
0xa1e5ed50, \
0xaa4a, \
0x11d1, \
{0x85, 0xb2, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
enum JVMStatus {
JVMStatus_Enabled, // but not Running
JVMStatus_Disabled, // explicitly disabled
JVMStatus_Running, // enabled and started
JVMStatus_Failed // enabled but failed to start
};
enum JVMError {
JVMError_Ok = NPPluginError_NoError,
JVMError_Base = 0x1000,
JVMError_InternalError = JVMError_Base,
JVMError_NoClasses,
JVMError_WrongClasses,
JVMError_JavaError,
JVMError_NoDebugger
};
enum JVMDebugPort {
JVMDebugPort_None = 0,
JVMDebugPort_SharedMemory = -1
// anything else is a port number
};
////////////////////////////////////////////////////////////////////////////////
// Java VM Plugin Interface
// This interface defines additional entry points that a plugin developer needs
// to implement in order to implement a Java virtual machine plugin.
class NPIJVMPlugin : public NPIPlugin {
public:
virtual JVMStatus NP_LOADDS
StartupJVM() = 0;
virtual JVMStatus NP_LOADDS
ShutdownJVM(PRBool fullShutdown = PR_TRUE) = 0;
virtual PRBool NP_LOADDS
GetJVMEnabled() = 0;
virtual void NP_LOADDS
SetJVMEnabled(PRBool enable) = 0;
virtual JVMStatus NP_LOADDS
GetJVMStatus() = 0;
// Find or create a JNIEnv for the specified thread. The thread
// parameter may be NULL indicating the current thread.
// XXX JNIEnv*
virtual JRIEnv* NP_LOADDS
EnsureExecEnv(PRThread* thread = NULL) = 0;
virtual void NP_LOADDS
AddToClassPath(const char* dirPath) = 0;
virtual void NP_LOADDS
ShowConsole() = 0;
virtual void NP_LOADDS
HideConsole() = 0;
virtual PRBool NP_LOADDS
IsConsoleVisible() = 0;
virtual void NP_LOADDS
PrintToConsole(const char* msg) = 0;
////////////////////////////////////////////////////////////////////////////
// Debugger Stuff (XXX move to subclass)
virtual JVMError NP_LOADDS
StartDebugger(JVMDebugPort port) = 0;
};
#define NP_IJVMPLUGIN_IID \
{ /* da6f3bc0-a1bc-11d1-85b1-00805f0e4dfe */ \
0xda6f3bc0, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// Java VM Plugin Instance Peer Interface
// This interface provides additional hooks into the plugin manager that allow
// a plugin to implement the plugin manager's Java virtual machine.
enum NPTagAttributeName {
NPTagAttributeName_Width,
NPTagAttributeName_Height,
NPTagAttributeName_Classid,
NPTagAttributeName_Code,
NPTagAttributeName_Codebase,
NPTagAttributeName_Docbase,
NPTagAttributeName_Archive,
NPTagAttributeName_Name,
NPTagAttributeName_MayScript
};
class NPIJVMPluginInstancePeer : public NPIPluginInstancePeer {
public:
// XXX Does this overlap with GetArgNames/GetArgValues?
// XXX What happens if someone says something like:
// <object codebase=...> <param name=codebase value=...>
// Which takes precedent?
virtual char* NP_LOADDS
GetAttribute(NPTagAttributeName name) = 0;
// XXX reload method?
// Returns a unique id for the current document on which the
// plugin is displayed.
virtual PRUint32 NP_LOADDS
GetDocumentID() = 0;
};
#define NP_IJVMPLUGININSTANCEPEER_IID \
{ /* 27b42df0-a1bd-11d1-85b1-00805f0e4dfe */ \
0x27b42df0, \
0xa1bd, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsjvm_h___ */

939
lib/plugin/nsplugin.h Normal file
View File

@ -0,0 +1,939 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
// INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).
//
// This superscedes the old plugin API (npapi.h, npupp.h), and
// eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp.
// Correspondences to the old API are shown throughout the file.
////////////////////////////////////////////////////////////////////////////////
// XXX THIS HEADER IS A BETA VERSION OF THE NEW PLUGIN INTERFACE.
// USE ONLY FOR EXPERIMENTAL PURPOSES!
#ifndef nsplugin_h___
#define nsplugin_h___
#ifdef __OS2__
#pragma pack(1)
#endif
// XXX Move this XP_ defining stuff to xpcom or nspr...
#if defined (__OS2__ ) || defined (OS2)
# ifndef XP_OS2
# define XP_OS2 1
# endif /* XP_OS2 */
#endif /* __OS2__ */
#ifdef _WINDOWS
# ifndef XP_WIN
# define XP_WIN 1
# endif /* XP_WIN */
#endif /* _WINDOWS */
#ifdef __MWERKS__
# define _declspec __declspec
# ifdef macintosh
# ifndef XP_MAC
# define XP_MAC 1
# endif /* XP_MAC */
# endif /* macintosh */
# ifdef __INTEL__
# undef NULL
# ifndef XP_WIN
# define XP_WIN 1
# endif /* __INTEL__ */
# endif /* XP_PC */
#endif /* __MWERKS__ */
#ifdef XP_MAC
#include <Quickdraw.h>
#include <Events.h>
#endif
#ifdef XP_UNIX
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif
#include "jri.h" // XXX change to jni.h
#include "nsISupports.h"
////////////////////////////////////////////////////////////////////////////////
/* The OS/2 version of Netscape uses RC_DATA to define the
mime types, file extentions, etc that are required.
Use a vertical bar to seperate types, end types with \0.
FileVersion and ProductVersion are 32bit ints, all other
entries are strings the MUST be terminated wwith a \0.
AN EXAMPLE:
RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
RCDATA NP_INFO_MIMEType { "video/x-video|",
"video/x-flick\0" }
RCDATA NP_INFO_FileExtents { "avi|",
"flc\0" }
RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
"MMOS2 Flc/Fli player(*.flc)\0" }
RCDATA NP_INFO_FileVersion { 1,0,0,1 }
RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }
RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"
RCDATA NP_INFO_InternalName { "NPAVI32\0" )
RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }
RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
*/
/* RC_DATA types for version info - required */
#define NP_INFO_ProductVersion 1
#define NP_INFO_MIMEType 2
#define NP_INFO_FileOpenName 3
#define NP_INFO_FileExtents 4
/* RC_DATA types for version info - used if found */
#define NP_INFO_FileDescription 5
#define NP_INFO_ProductName 6
/* RC_DATA types for version info - optional */
#define NP_INFO_CompanyName 7
#define NP_INFO_FileVersion 8
#define NP_INFO_InternalName 9
#define NP_INFO_LegalCopyright 10
#define NP_INFO_OriginalFilename 11
#ifndef RC_INVOKED
////////////////////////////////////////////////////////////////////////////////
// Structures and definitions
#ifdef XP_MAC
#pragma options align=mac68k
#endif
typedef const char* nsMIMEType;
struct nsByteRange {
PRInt32 offset; /* negative offset means from the end */
PRUint32 length;
struct nsByteRange* next;
};
struct nsRect {
PRUint16 top;
PRUint16 left;
PRUint16 bottom;
PRUint16 right;
};
////////////////////////////////////////////////////////////////////////////////
// Unix specific structures and definitions
#ifdef XP_UNIX
/*
* Callback Structures.
*
* These are used to pass additional platform specific information.
*/
enum NPPluginCallbackType {
NPPluginCallbackType_SetWindow = 1,
NPPluginCallbackType_Print
};
struct NPPluginAnyCallbackStruct {
PRInt32 type;
};
struct NPPluginSetWindowCallbackStruct {
PRInt32 type;
Display* display;
Visual* visual;
Colormap colormap;
PRUint32 depth;
};
struct NPPluginPrintCallbackStruct {
PRInt32 type;
FILE* fp;
};
#endif /* XP_UNIX */
////////////////////////////////////////////////////////////////////////////////
// List of variable names for which NPP_GetValue shall be implemented
enum NPPluginVariable {
NPPluginVariable_NameString = 1,
NPPluginVariable_DescriptionString,
NPPluginVariable_WindowBool, // XXX go away
NPPluginVariable_TransparentBool, // XXX go away?
NPPluginVariable_JavaClass, // XXX go away
NPPluginVariable_WindowSize
// XXX add MIMEDescription (for unix) (but GetValue is on the instance, not the class)
};
// List of variable names for which NPN_GetValue is implemented by Mozilla
enum NPPluginManagerVariable {
NPPluginManagerVariable_XDisplay = 1,
NPPluginManagerVariable_XtAppContext,
NPPluginManagerVariable_NetscapeWindow,
NPPluginManagerVariable_JavascriptEnabledBool, // XXX prefs accessor api
NPPluginManagerVariable_ASDEnabledBool, // XXX prefs accessor api
NPPluginManagerVariable_IsOfflineBool // XXX prefs accessor api
};
////////////////////////////////////////////////////////////////////////////////
enum NPPluginType {
NPPluginType_Embedded = 1,
NPPluginType_Full
};
// XXX this can go away now
enum NPStreamType {
NPStreamType_Normal = 1,
NPStreamType_Seek,
NPStreamType_AsFile,
NPStreamType_AsFileOnly
};
#define NP_STREAM_MAXREADY (((unsigned)(~0)<<1)>>1)
/*
* The type of a NPWindow - it specifies the type of the data structure
* returned in the window field.
*/
enum NPPluginWindowType {
NPPluginWindowType_Window = 1,
NPPluginWindowType_Drawable
};
struct NPPluginWindow {
void* window; /* Platform specific window handle */
/* OS/2: x - Position of bottom left corner */
/* OS/2: y - relative to visible netscape window */
PRUint32 x; /* Position of top left corner relative */
PRUint32 y; /* to a netscape page. */
PRUint32 width; /* Maximum window size */
PRUint32 height;
nsRect clipRect; /* Clipping rectangle in port coordinates */
/* Used by MAC only. */
#ifdef XP_UNIX
void* ws_info; /* Platform-dependent additonal data */
#endif /* XP_UNIX */
NPPluginWindowType type; /* Is this a window or a drawable? */
};
struct NPPluginFullPrint {
PRBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */
/* printing */
PRBool printOne; /* TRUE if plugin should print one copy */
/* to default printer */
void* platformPrint; /* Platform-specific printing info */
};
struct NPPluginEmbedPrint {
NPPluginWindow window;
void* platformPrint; /* Platform-specific printing info */
};
struct NPPluginPrint {
NPPluginType mode; /* NP_FULL or NPPluginType_Embedded */
union
{
NPPluginFullPrint fullPrint; /* if mode is NP_FULL */
NPPluginEmbedPrint embedPrint; /* if mode is NPPluginType_Embedded */
} print;
};
struct NPPluginEvent {
#if defined(XP_MAC)
EventRecord* event;
void* window;
#elif defined(XP_WIN)
uint16 event;
uint32 wParam;
uint32 lParam;
#elif defined(XP_OS2)
uint32 event;
uint32 wParam;
uint32 lParam;
#elif defined(XP_UNIX)
XEvent event;
#endif
};
#ifdef XP_MAC
typedef RgnHandle nsRegion;
#elif defined(XP_WIN)
typedef HRGN nsRegion;
#elif defined(XP_UNIX)
typedef Region nsRegion;
#else
typedef void *nsRegion;
#endif /* XP_MAC */
////////////////////////////////////////////////////////////////////////////////
// Mac-specific structures and definitions.
#ifdef XP_MAC
struct NPPort {
CGrafPtr port; /* Grafport */
PRInt32 portx; /* position inside the topmost window */
PRInt32 porty;
};
/*
* Non-standard event types that can be passed to HandleEvent
*/
#define getFocusEvent (osEvt + 16)
#define loseFocusEvent (osEvt + 17)
#define adjustCursorEvent (osEvt + 18)
#define menuCommandEvent (osEvt + 19)
#endif /* XP_MAC */
////////////////////////////////////////////////////////////////////////////////
// Error and Reason Code definitions
enum NPPluginError {
NPPluginError_Base = 0,
NPPluginError_NoError = 0,
NPPluginError_GenericError,
NPPluginError_InvalidInstanceError,
NPPluginError_InvalidFunctableError,
NPPluginError_ModuleLoadFailedError,
NPPluginError_OutOfMemoryError,
NPPluginError_InvalidPluginError,
NPPluginError_InvalidPluginDirError,
NPPluginError_IncompatibleVersionError,
NPPluginError_InvalidParam,
NPPluginError_InvalidUrl,
NPPluginError_FileNotFound,
NPPluginError_NoData,
NPPluginError_StreamNotSeekable
};
enum NPPluginReason {
NPPluginReason_Base = 0,
NPPluginReason_Done = 0,
NPPluginReason_NetworkErr,
NPPluginReason_UserBreak,
NPPluginReason_NoReason
};
////////////////////////////////////////////////////////////////////////////////
// Classes
////////////////////////////////////////////////////////////////////////////////
class NPIStream; // base class for all streams
// Classes that must be implemented by the plugin DLL:
class NPIPlugin; // plugin class (MIME-type handler)
class NPILiveConnectPlugin; // subclass of NPIPlugin
class NPIPluginInstance; // plugin instance
class NPIPluginStream; // stream to receive data from the browser
// Classes that are implemented by the browser:
class NPIPluginManager; // minimum browser requirements
class NPIPluginManagerStream; // stream to send data to the browser
class NPIPluginInstancePeer; // parts of NPIPluginInstance implemented by the browser
class NPILiveConnectPluginInstancePeer; // subclass of NPIPluginInstancePeer
class NPIPluginStreamPeer; // parts of NPIPluginStream implemented by the browser
class NPISeekablePluginStreamPeer; // seekable subclass of NPIPluginStreamPeer
// Plugin DLL Side Browser Side
//
//
// +-----------+ +-----------------------+
// | Plugin / | | Plugin Manager |
// | LC Plugin | | |
// +-----------+ +-----------------------+
// ^ ^
// | |
// | +-----------------------+
// | | Plugin Manager Stream |
// | +-----------------------+
// |
// |
// +-----------------+ peer +-----------------------+
// | Plugin Instance |---------->| Plugin Instance Peer |
// | | | / LC Plugin Inst Peer |
// +-----------------+ +-----------------------+
//
// +-----------------+ peer +-----------------------+
// | Plugin Stream |---------->| Plugin Stream Peer / |
// | | | Seekable P Stream Peer|
// +-----------------+ +-----------------------+
////////////////////////////////////////////////////////////////////////////////
// This is the main entry point to the plugin's DLL. The plugin manager finds
// this symbol and calls it to create the plugin class. Once the plugin object
// is returned to the plugin manager, instances on the page are created by
// calling NPIPlugin::NewInstance.
// (Corresponds to NPP_Initialize.)
extern "C" NS_EXPORT NPPluginError
NP_CreatePlugin(NPIPluginManager* mgr, NPIPlugin* *result);
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Interface
// This base class is shared by both the plugin and the plugin manager.
class NPIStream : public nsISupports {
public:
// The Release method on NPIPlugin corresponds to NPP_DestroyStream.
// (Corresponds to NPP_WriteReady.)
NS_IMETHOD_(PRInt32)
WriteReady(void) = 0;
// (Corresponds to NPP_Write and NPN_Write.)
NS_IMETHOD_(PRInt32)
Write(PRInt32 len, void* buffer) = 0;
};
#define NP_ISTREAM_IID \
{ /* 5d852ef0-a1bc-11d1-85b1-00805f0e4dfe */ \
0x5d852ef0, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// THINGS THAT MUST BE IMPLEMENTED BY THE PLUGIN...
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Plugin Interface
// This is the minimum interface plugin developers need to support in order to
// implement a plugin. The plugin manager may QueryInterface for more specific
// plugin types, e.g. NPILiveConnectPlugin.
class NPIPlugin : public nsISupports {
public:
// The Release method on NPIPlugin corresponds to NPP_Shutdown.
// The old NPP_New call has been factored into two plugin instance methods:
//
// NewInstance -- called once, after the plugin instance is created. This
// method is used to initialize the new plugin instance (although the actual
// plugin instance object will be created by the plugin manager).
//
// NPIPluginInstance::Start -- called when the plugin instance is to be
// started. This happens in two circumstances: (1) after the plugin instance
// is first initialized, and (2) after a plugin instance is returned to
// (e.g. by going back in the window history) after previously being stopped
// by the Stop method.
NS_IMETHOD_(NPPluginError)
NewInstance(NPIPluginInstancePeer* peer, NPIPluginInstance* *result) = 0;
#ifdef XP_UNIX // XXX why can't this be XP?
// (Corresponds to NPP_GetMIMEDescription.)
NS_IMETHOD_(const char*)
GetMIMEDescription(void) = 0;
#endif /* XP_UNIX */
};
#define NP_IPLUGIN_IID \
{ /* 8a623430-a1bc-11d1-85b1-00805f0e4dfe */ \
0x8a623430, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// LiveConnect Plugin Interface
// This interface defines additional entry points that a plugin developer needs
// to implement in order for the plugin to support LiveConnect, i.e. be
// scriptable by Java or JavaScript.
class NPILiveConnectPlugin : public NPIPlugin {
public:
// (Corresponds to NPP_GetJavaClass.)
NS_IMETHOD_(jclass)
GetJavaClass(void) = 0;
};
#define NP_ILIVECONNECTPLUGIN_IID \
{ /* cf134df0-a1bc-11d1-85b1-00805f0e4dfe */ \
0xcf134df0, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// Plugin Instance Interface
// (Corresponds to NPP object.)
class NPIPluginInstance : public nsISupports {
public:
// The Release method on NPIPluginInstance corresponds to NPP_Destroy.
// See comment for NPIPlugin::NewInstance, above.
NS_IMETHOD_(NPPluginError)
Start(void) = 0;
// The old NPP_Destroy call has been factored into two plugin instance
// methods:
//
// Stop -- called when the plugin instance is to be stopped (e.g. by
// displaying another plugin manager window, causing the page containing
// the plugin to become removed from the display).
//
// Release -- called once, before the plugin instance peer is to be
// destroyed. This method is used to destroy the plugin instance.
NS_IMETHOD_(NPPluginError)
Stop(void) = 0;
// (Corresponds to NPP_SetWindow.)
NS_IMETHOD_(NPPluginError)
SetWindow(NPPluginWindow* window) = 0;
// (Corresponds to NPP_NewStream.)
NS_IMETHOD_(NPPluginError)
NewStream(NPIPluginStreamPeer* peer, NPIPluginStream* *result) = 0;
// (Corresponds to NPP_Print.)
NS_IMETHOD_(void)
Print(NPPluginPrint* platformPrint) = 0;
// (Corresponds to NPP_HandleEvent.)
// Note that for Unix and Mac the NPPluginEvent structure is different
// from the old NPEvent structure -- it's no longer the native event
// record, but is instead a struct. This was done for future extensibility,
// and so that the Mac could receive the window argument too. For Windows
// and OS2, it's always been a struct, so there's no change for them.
NS_IMETHOD_(PRInt16)
HandleEvent(NPPluginEvent* event) = 0;
// (Corresponds to NPP_URLNotify.)
NS_IMETHOD_(void)
URLNotify(const char* url, const char* target,
NPPluginReason reason, void* notifyData) = 0;
// (Corresponds to NPP_GetValue.)
NS_IMETHOD_(NPPluginError)
GetValue(NPPluginVariable variable, void *value) = 0;
// (Corresponds to NPP_SetValue.)
NS_IMETHOD_(NPPluginError)
SetValue(NPPluginManagerVariable variable, void *value) = 0;
};
#define NP_IPLUGININSTANCE_IID \
{ /* b62f3a10-a1bc-11d1-85b1-00805f0e4dfe */ \
0xb62f3a10, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Interface
class NPIPluginStream : public NPIStream {
public:
// (Corresponds to NPP_NewStream's stype return parameter.)
NS_IMETHOD_(NPStreamType)
GetStreamType(void) = 0;
// (Corresponds to NPP_StreamAsFile.)
NS_IMETHOD_(void)
AsFile(const char* fname) = 0;
};
#define NP_IPLUGINSTREAM_IID \
{ /* e7a97340-a1bc-11d1-85b1-00805f0e4dfe */ \
0xe7a97340, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// THINGS IMPLEMENTED BY THE BROWSER...
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Plugin Manager Interface
// This interface defines the minimum set of functionality that a plugin
// manager will support if it implements plugins. Plugin implementations can
// QueryInterface to determine if a plugin manager implements more specific
// APIs for the plugin to use.
class NPIPluginManager : public nsISupports {
public:
// QueryInterface may be used to obtain a JRIEnv or JNIEnv
// from an NPIPluginManager.
// (Corresponds to NPN_GetJavaEnv.)
// (Corresponds to NPN_ReloadPlugins.)
NS_IMETHOD_(void)
ReloadPlugins(PRBool reloadPages) = 0;
// (Corresponds to NPN_MemAlloc.)
NS_IMETHOD_(void*)
MemAlloc(PRUint32 size) = 0;
// (Corresponds to NPN_MemFree.)
NS_IMETHOD_(void)
MemFree(void* ptr) = 0;
// (Corresponds to NPN_MemFlush.)
NS_IMETHOD_(PRUint32)
MemFlush(PRUint32 size) = 0;
};
#define NP_IPLUGINMANAGER_IID \
{ /* f10b9600-a1bc-11d1-85b1-00805f0e4dfe */ \
0xf10b9600, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
#define NP_IJRIENV_IID \
{ /* f9d4ea00-a1bc-11d1-85b1-00805f0e4dfe */ \
0xf9d4ea00, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
#define NP_IJNIENV_IID \
{ /* 04610650-a1bd-11d1-85b1-00805f0e4dfe */ \
0x04610650, \
0xa1bd, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// Plugin Instance Peer Interface
class NPIPluginInstancePeer : public nsISupports {
public:
NS_IMETHOD_(NPIPlugin*)
GetClass(void) = 0;
// (Corresponds to NPP_New's MIMEType argument.)
NS_IMETHOD_(nsMIMEType)
GetMIMEType(void) = 0;
// (Corresponds to NPP_New's mode argument.)
NS_IMETHOD_(NPPluginType)
GetMode(void) = 0;
// (Corresponds to NPP_New's argc argument.)
NS_IMETHOD_(PRUint16)
GetArgCount(void) = 0;
// (Corresponds to NPP_New's argn argument.)
NS_IMETHOD_(const char**)
GetArgNames(void) = 0;
// (Corresponds to NPP_New's argv argument.)
NS_IMETHOD_(const char**)
GetArgValues(void) = 0;
NS_IMETHOD_(NPIPluginManager*)
GetPluginManager(void) = 0;
// (Corresponds to NPN_GetURL and NPN_GetURLNotify.)
// notifyData: When present, URLNotify is called passing the notifyData back
// to the client. When NULL, this call behaves like NPN_GetURL.
// New arguments:
// altHost: An IP-address string that will be used instead of the host
// specified in the URL. This is used to prevent DNS-spoofing attacks.
// Can be defaulted to NULL meaning use the host in the URL.
// referrer:
// forceJSEnabled: Forces JavaScript to be enabled for 'javascript:' URLs,
// even if the user currently has JavaScript disabled.
NS_IMETHOD_(NPPluginError)
GetURL(const char* url, const char* target, void* notifyData = NULL,
const char* altHost = NULL, const char* referrer = NULL,
PRBool forceJSEnabled = PR_FALSE) = 0;
// (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
// notifyData: When present, URLNotify is called passing the notifyData back
// to the client. When NULL, this call behaves like NPN_GetURL.
// New arguments:
// altHost: An IP-address string that will be used instead of the host
// specified in the URL. This is used to prevent DNS-spoofing attacks.
// Can be defaulted to NULL meaning use the host in the URL.
// referrer:
// forceJSEnabled: Forces JavaScript to be enabled for 'javascript:' URLs,
// even if the user currently has JavaScript disabled.
// postHeaders: A string containing post headers.
// postHeadersLength: The length of the post headers string.
NS_IMETHOD_(NPPluginError)
PostURL(const char* url, const char* target, PRUint32 bufLen,
const char* buf, PRBool file, void* notifyData = NULL,
const char* altHost = NULL, const char* referrer = NULL,
PRBool forceJSEnabled = PR_FALSE,
PRUint32 postHeadersLength = 0, const char* postHeaders = NULL) = 0;
// (Corresponds to NPN_NewStream.)
NS_IMETHOD_(NPPluginError)
NewStream(nsMIMEType type, const char* target,
NPIPluginManagerStream* *result) = 0;
// (Corresponds to NPN_Status.)
NS_IMETHOD_(void)
ShowStatus(const char* message) = 0;
// (Corresponds to NPN_UserAgent.)
NS_IMETHOD_(const char*)
UserAgent(void) = 0;
// (Corresponds to NPN_GetValue.)
NS_IMETHOD_(NPPluginError)
GetValue(NPPluginManagerVariable variable, void *value) = 0;
// (Corresponds to NPN_SetValue.)
NS_IMETHOD_(NPPluginError)
SetValue(NPPluginVariable variable, void *value) = 0;
////////////////////////////////////////////////////////////////////////////
// XXX Only used by windowless plugin instances?...
// (Corresponds to NPN_InvalidateRect.)
NS_IMETHOD_(void)
InvalidateRect(nsRect *invalidRect) = 0;
// (Corresponds to NPN_InvalidateRegion.)
NS_IMETHOD_(void)
InvalidateRegion(nsRegion invalidRegion) = 0;
// (Corresponds to NPN_ForceRedraw.)
NS_IMETHOD_(void)
ForceRedraw(void) = 0;
// New top-level window handling calls for Mac:
NS_IMETHOD_(void)
RegisterWindow(void* window) = 0;
NS_IMETHOD_(void)
UnregisterWindow(void* window) = 0;
// Menu ID allocation calls for Mac:
NS_IMETHOD_(PRInt16)
AllocateMenuID(PRBool isSubmenu) = 0;
};
#define NP_IPLUGININSTANCEPEER_IID \
{ /* 15c75de0-a1bd-11d1-85b1-00805f0e4dfe */ \
0x15c75de0, \
0xa1bd, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// LiveConnect Plugin Instance Peer Interface
// Browsers that support LiveConnect implement this subclass of plugin instance
// peer.
// XXX Should this really be a separate subclass?
class NPILiveConnectPluginInstancePeer : public NPIPluginInstancePeer {
public:
// (Corresponds to NPN_GetJavaPeer.)
NS_IMETHOD_(jobject)
GetJavaPeer(void) = 0;
};
#define NP_ILIVECONNECTPLUGININSTANCEPEER_IID \
{ /* 1e3502a0-a1bd-11d1-85b1-00805f0e4dfe */ \
0x1e3502a0, \
0xa1bd, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// Plugin Manager Stream Interface
class NPIPluginManagerStream : public NPIStream {
public:
// (Corresponds to NPStream's url field.)
NS_IMETHOD_(const char*)
GetURL(void) = 0;
// (Corresponds to NPStream's end field.)
NS_IMETHOD_(PRUint32)
GetEnd(void) = 0;
// (Corresponds to NPStream's lastmodified field.)
NS_IMETHOD_(PRUint32)
GetLastModified(void) = 0;
// (Corresponds to NPStream's notifyData field.)
NS_IMETHOD_(void*)
GetNotifyData(void) = 0;
};
#define NP_IPLUGINMANAGERSTREAM_IID \
{ /* 30c24560-a1bd-11d1-85b1-00805f0e4dfe */ \
0x30c24560, \
0xa1bd, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Peer Interface
// A plugin stream peer is passed to a plugin instance's NewStream call in
// order to indicate that a new stream is to be created and be read by the
// plugin instance.
class NPIPluginStreamPeer : public nsISupports {
public:
// (Corresponds to NPP_DestroyStream's reason argument.)
NS_IMETHOD_(NPPluginReason)
GetReason(void) = 0;
// (Corresponds to NPP_NewStream's MIMEType argument.)
NS_IMETHOD_(nsMIMEType)
GetMIMEType(void) = 0;
NS_IMETHOD_(PRUint32)
GetContentLength(void) = 0;
#if 0
NS_IMETHOD_(const char*)
GetContentEncoding(void) = 0;
NS_IMETHOD_(const char*)
GetCharSet(void) = 0;
NS_IMETHOD_(const char*)
GetBoundary(void) = 0;
NS_IMETHOD_(const char*)
GetContentName(void) = 0;
NS_IMETHOD_(time_t)
GetExpires(void) = 0;
NS_IMETHOD_(time_t)
GetLastModified(void) = 0;
NS_IMETHOD_(time_t)
GetServerDate(void) = 0;
NS_IMETHOD_(NPServerStatus)
GetServerStatus(void) = 0;
#endif
NS_IMETHOD_(PRUint32)
GetHeaderFieldCount(void) = 0;
NS_IMETHOD_(const char*)
GetHeaderFieldKey(PRUint32 index) = 0;
NS_IMETHOD_(const char*)
GetHeaderField(PRUint32 index) = 0;
};
#define NP_IPLUGINSTREAMPEER_IID \
{ /* 38278eb0-a1bd-11d1-85b1-00805f0e4dfe */ \
0x38278eb0, \
0xa1bd, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// Seekable Plugin Stream Peer Interface
// The browser implements this subclass of plugin stream peer if a stream
// is seekable. Plugins can query interface for this type, and call the
// RequestRead method to seek to a particular position in the stream.
class NPISeekablePluginStreamPeer : public NPIPluginStreamPeer {
public:
// QueryInterface for this class corresponds to NPP_NewStream's
// seekable argument.
// (Corresponds to NPN_RequestRead.)
NS_IMETHOD_(NPPluginError)
RequestRead(nsByteRange* rangeList) = 0;
};
#define NP_ISEEKABLEPLUGINSTREAMPEER_IID \
{ /* f55c8250-a73e-11d1-85b1-00805f0e4dfe */ \
0xf55c8250, \
0xa73e, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
} \
////////////////////////////////////////////////////////////////////////////////
#ifdef XP_MAC
#pragma options align=reset
#endif
#endif /* RC_INVOKED */
#ifdef __OS2__
#pragma pack()
#endif
#endif /* nsplugin_h___ */

21
network/cache/cacheutils.h vendored Normal file
View File

@ -0,0 +1,21 @@
#ifndef CACHEUTILS_H
#define CACHEUTILS_H
/* Find an actively-loading cache file for URL_s in context, and copy the first
* nbytes of it to a new cache file. Return a cache converter stream by which
* the caller can append to the cloned cache file.
*/
extern NET_VoidStreamClass *
NET_CloneWysiwygCacheFile(MWContext *context, URL_Struct *URL_s,
uint32 nbytes, const char * wysiwyg_url,
const char * base_href);
/* Create a wysiwyg cache converter to a copy of the current entry for URL_s.
*/
extern NET_VoidStreamClass *
net_CloneWysiwygMemCacheEntry(MWContext *window_id, URL_Struct *URL_s,
uint32 nbytes, const char * wysiwyg_url,
const char * base_href);
#endif /* CACHEUTILS_H */

57
network/cache/nu/include/nsCachePref.h vendored Normal file
View File

@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsCachePref_h__
#define nsCachePref_h__
//#include "nsISupports.h"
#include <prtypes.h>
class nsCachePref //: public nsISupports
{
public:
enum Refresh
{
NEVER,
ONCE,
ALWAYS
} r;
nsCachePref();
PRUint32 MemCacheSize() const;
PRUint32 DiskCacheSize() const;
const char* DiskCacheFolder() const;
nsCachePref::Refresh
Frequency() const;
/*
NS_IMETHOD QueryInterface(const nsIID& aIID,
void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
*/
protected:
private:
nsCachePref(const nsCachePref& o);
nsCachePref& operator=(const nsCachePref& o);
};
#endif // nsCachePref_h__

292
network/main/mime.types Normal file
View File

@ -0,0 +1,292 @@
#--Netscape Communications Corporation MIME Information
# Do not delete the above line. It is used to identify the file type.
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
# This file defines all of the default file extensions recognised by Netscape.
# See also mime.types-unix and mime.types-nonunix for some platform-specific
# stuff.
# If you add a new non-"text/" type to this file, and it's primarily a
# line-based textual type, you may also want to update the list of
# application-types-that-are-really-textual in mime_type_requires_b64_p()
# in libmsg/compose.c, so that docs of that type don't always get base64
# encoded when mailed.
####################################################################
# Text
####################################################################
exts="txt,text" type=text/plain \
desc="Plain Text" icon=internal-gopher-text
exts="html,htm" type=text/html \
desc="Hypertext Markup Language" icon=internal-gopher-text
exts="xml" type=text/xml \
desc="Extensible Markup Language" icon=internal-gopher-text
exts="rtf" type=application/rtf \
desc="Rich Text Format" icon=internal-gopher-text
# note: text/richtext is *not the same format*
exts="pdf" type=application/pdf \
desc="Portable Document Format" icon=internal-gopher-text
exts="tex" type=application/x-tex \
desc="TeX Document" icon=internal-gopher-text
exts="latex" type=application/x-latex \
desc="LaTeX Document" icon=internal-gopher-text
exts="dvi" type=application/x-dvi \
desc="TeX DVI Data" icon=internal-gopher-text
exts="texi,texinfo" type=application/x-texinfo \
desc="GNU TeXinfo Document" icon=internal-gopher-text
exts="vcf" type=text/x-vcard \
desc="VCard" icon=internal-gopher-unknown
####################################################################
# Images
####################################################################
exts="gif" type=image/gif \
desc="GIF Image" icon=internal-gopher-image
exts="jpeg,jpg,jpe,jfif,pjpeg,pjp" type=image/jpeg \
desc="JPEG Image" icon=internal-gopher-image
exts="tiff,tif" type=image/tiff \
desc="TIFF Image" icon=internal-gopher-image
exts="ras" type=image/x-cmu-raster \
desc="CMU Raster Image" icon=internal-gopher-image
exts="xbm" type=image/x-xbitmap \
desc="X Bitmap" icon=internal-gopher-image
# note: have also seen "image/x-bitmap"
exts="xpm" type=image/x-xpixmap \
desc="X Pixmap" icon=internal-gopher-image
# note: have also seen "image/x-xpm"
exts="xwd" type=image/x-xwindowdump \
desc="X Window Dump Image" icon=internal-gopher-image
# note: have also seen "image/x-xwd"
exts="pnm" type=image/x-portable-anymap \
desc="PBM Image" icon=internal-gopher-image
exts="pbm" type=image/x-portable-bitmap \
desc="PBM Image" icon=internal-gopher-image
exts="pgm" type=image/x-portable-graymap \
desc="PGM Image" icon=internal-gopher-image
exts="ppm" type=image/x-portable-pixmap \
desc="PPM Image" icon=internal-gopher-image
# note: have also seen "image/x-pbm", "image/x-pgm", "image/x-ppm".
exts="rgb" type=image/x-rgb \
desc="RGB Image" icon=internal-gopher-image
exts="bmp" type=image/x-MS-bmp \
desc="Windows Bitmap" icon=internal-gopher-image
exts="pcd" type=image/x-photo-cd \
desc="PhotoCD Image" icon=internal-gopher-image
exts="png" type=image/x-png \
desc="PNG Image" icon=internal-gopher-image
exts="ief" type=image/ief \
desc="" icon=internal-gopher-image
# What is "ief"?
exts="fif" type=application/fractals \
desc="Fractal Image Format" icon=internal-gopher-image
####################################################################
# Audio
####################################################################
exts="au,snd" type=audio/basic \
desc="ULAW Audio" icon=internal-gopher-sound
exts="aif,aiff,aifc" type=audio/x-aiff \
desc="AIFF Audio" icon=internal-gopher-sound
exts="wav" type=audio/x-wav \
desc="WAV Audio" icon=internal-gopher-sound
exts="mp2,mpa,abs,mpega" type=audio/x-mpeg \
desc="MPEG Audio" icon=internal-gopher-sound
exts="ra,ram" type=audio/x-pn-realaudio \
desc="RealAudio" icon=internal-gopher-sound
####################################################################
# Video
####################################################################
exts="mpeg,mpg,mpe,mpv,vbs,mpegv" type=video/mpeg \
desc="MPEG Video" icon=internal-gopher-movie
exts="mpv2,mp2v" type=video/x-mpeg2 \
desc="MPEG2 Video" icon=internal-gopher-movie
exts="qt,mov,moov" type=video/quicktime \
desc="Quicktime Video" icon=internal-gopher-movie
exts="avi" type=video/x-msvideo \
desc="Microsoft Video" icon=internal-gopher-movie
####################################################################
# Archives
####################################################################
exts="hqx" type=application/mac-binhex40 \
desc="Macintosh BinHex Archive" icon=internal-gopher-binary
# note: have also seen "application/x-macbinhex40"
exts="sit" type=application/x-stuffit \
desc="Macintosh StuffIt Archive" icon=internal-gopher-binary
exts="zip" type=application/x-zip-compressed \
desc="Zip Compressed Data" icon=internal-gopher-binary
exts="shar" type=application/x-shar \
desc="Unix Shell Archive" icon=internal-gopher-unknown
exts="tar" type=application/x-tar \
desc="Unix Tape Archive" icon=internal-gopher-binary
exts="gtar" type=application/x-gtar \
desc="GNU Tape Archive" icon=internal-gopher-binary
exts="cpio" type=application/x-cpio \
desc="Unix CPIO Archive" icon=internal-gopher-binary
# note: have also seen "application/x-sv4cpio"
# and "application/x-bcpio" for ".bcpio" files -- what's that?
# and "application/x-sv4crc" for ".sv4crc" -- what's that?
exts="jar" type=application/java-archive \
desc="Java Archive" icon=internal-gopher-binary
####################################################################
# Programs
####################################################################
exts="exe,bin" type=application/octet-stream \
desc="Binary Executable" icon=internal-gopher-binary
exts="ai,eps,ps" type=application/postscript \
desc="Postscript Document" icon=internal-gopher-text
exts="csh" type=application/x-csh \
desc="C Shell Program" icon=internal-gopher-unknown
exts="sh" type=application/x-sh \
desc="Bourne Shell Program" icon=internal-gopher-unknown
exts="tcl" type=application/x-tcl \
desc="TCL Program" icon=internal-gopher-unknown
exts="pl" type=application/x-perl \
desc="Perl Program" icon=internal-gopher-unknown
exts="js,mocha" type=application/x-javascript \
desc="JavaScript Program" icon=internal-gopher-unknown
exts="pac" type=application/x-ns-proxy-autoconfig \
desc="Proxy Auto-Config" icon=internal-gopher-unknown
exts="jsc" type=application/x-javascript-config \
desc="JavaScript Config" icon=internal-gopher-unknown
exts="p7m,p7c" type=application/x-pkcs7-mime \
desc="PKCS7 Encrypted Data" icon=internal-gopher-binary
exts="p7s" type=application/x-pkcs7-signature \
desc="PKCS7 Signature" icon=internal-gopher-binary
exts="enc" type=application/pre-encrypted \
desc="Pre-encrypted Data" icon=internal-gopher-binary
exts="crl" type=application/x-pkcs7-crl \
desc="Certificate Revocation List" icon=internal-gopher-binary
exts="ckl" type=application/x-fortezza-ckl \
desc="Compromised Key List" icon=internal-gopher-binary
# This is too ambiguous an extension. Those losers.
#exts="src" type=application/x-wais-source \
#desc="WAIS Source" icon=internal-gopher-unknown
####################################################################
# Encodings
####################################################################
exts="uu,uue" enc=x-uuencode \
desc="UUEncoded Data" icon=internal-gopher-binary
####################################################################
# Documents
####################################################################
exts="doc,dot" type=application/msword \
desc="Microsoft Word Document" icon=internal-gopher-text
exts="xls,xlt,xlm,xld,xla,xlc,xlw,xll" type=application/vnd.ms-excel \
desc="Microsoft Excel Worksheet" icon=internal-gopher-text
exts="mdb,mda,mde" type=application/vnd.ms-access \
desc="Microsoft Access Database" icon=internal-gopher-text
exts="ppt,pot,ppa,pps,pwz" type=application/vnd.ms-powerpoint \
desc="Microsoft PowerPoint Show" icon=internal-gopher-text
exts="scd,sch,sc2" type=application/vnd.ms-schedule \
desc="Microsoft Schedule+ Application" icon=internal-gopher-text
exts="lwp,sam" type=application/vnd.lotus-wordpro \
desc="Lotus WordPro Document" icon=internal-gopher-text
exts="123,wk4,wk3,wk1" type=application/vnd.lotus-1-2-3 \
desc="Lotus 123 Document" icon=internal-gopher-text
exts="apr,vew" type=application/vnd.lotus-approach \
desc="Lotus Approach Document" icon=internal-gopher-text
exts="prz,pre" type=application/vnd.lotus-freelance \
desc="Lotus Freelance Document" icon=internal-gopher-text
exts="or3,or2,org" type=application/vnd.lotus-organizer \
desc="Lotus Organizer Document" icon=internal-gopher-text
exts="scm" type=application/vnd.lotus-screencam \
desc="Lotus ScreenCam Movie" icon=internal-gopher-text
exts="wpd,wp6" type=application/wordperfect5.1 \
desc="WordPerfect Document" icon=internal-gopher-text

View File

@ -0,0 +1,30 @@
#--Netscape Communications Corporation MIME Information
# Do not delete the above line. It is used to identify the file type.
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
# This file defines all of the default file extensions recognised by Netscape
# on non-Unix platforms. See also mime.types and mime.types-unix.
####################################################################
# Archives
####################################################################
exts="Z" type=application/x-compress \
desc="Compressed Data" icon=internal-gopher-binary
exts="gz" enc=x-gzip \
desc="GNU Zip Compressed Data" icon=internal-gopher-binary

View File

@ -0,0 +1,56 @@
#--Netscape Communications Corporation MIME Information
# Do not delete the above line. It is used to identify the file type.
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
# This file defines all of the default file extensions recognised by Netscape
# on Unix platforms. See also mime.types and mime.types-nonunix.
####################################################################
# Text
####################################################################
exts="t,tr,roff" type=application/x-troff \
desc="TROFF Document" icon=internal-gopher-text
exts="me" type=application/x-troff-me \
desc="TROFF Document" icon=internal-gopher-text
exts="ms" type=application/x-troff-ms \
desc="TROFF Document" icon=internal-gopher-text
exts="man" type=application/x-troff-man \
desc="Unix Manual Page" icon=internal-gopher-text
####################################################################
# Video
####################################################################
exts="movie" type=video/x-sgi-movie \
desc="SGI Video" icon=internal-gopher-movie
####################################################################
# Encodings
####################################################################
exts="Z" enc=x-compress \
desc="Compressed Data" icon=internal-gopher-binary
exts="gz" enc=x-gzip \
desc="GNU Zip Compressed Data" icon=internal-gopher-binary

1264
network/main/mkformat.c Normal file

File diff suppressed because it is too large Load Diff

94
network/main/mkformat.h Normal file
View File

@ -0,0 +1,94 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* cinfo.h: Content Information for a file, i.e. its type, etc.
*
* See cinfo.c for dependency information.
*
* Rob McCool
*/
#ifndef MKFORMAT_H
#define MKFORMAT_H
/* ------------------------------ Constants ------------------------------- */
/*
* This will be the first string in the file, followed by x.x version
* where x is an integer.
*
* If this magic string is not found, cinfo_merge will try to parse
* the file as a NCSA httpd mime.types file.
*/
#define MCC_MT_MAGIC "#--MCOM MIME Information"
#define MCC_MT_MAGIC_LEN 24
#define NCC_MT_MAGIC "#--Netscape Communications Corporation MIME Information"
#define NCC_MT_MAGIC_LEN 40 /* Don't bother to check it all */
/* The character which separates extensions with cinfo_find */
#define CINFO_SEPARATOR '.'
/* The maximum length of a line in this file */
#define CINFO_MAX_LEN 1024
/* The hash function for the database. Hashed on extension. */
#include <ctype.h>
#define CINFO_HASH(s) (isalpha(s[0]) ? tolower(s[0]) - 'a' : 26)
/* The hash table size for that function */
#define CINFO_HASHSIZE 27
/* ------------------------------ Structures ------------------------------ */
/* see ../include/net.h for the NET_cinfo struct */
/* ------------------------------ Prototypes ------------------------------ */
/*
* cinfo_find finds any content information for the given uri. The file name
* is the string following the last / in the uri. Multiple extensions are
* separated by CINFO_SEPARATOR. You may pass in a filename instead of uri.
*
* Returns a newly allocated cinfo structure with the information it
* finds. The elements of this structure are coming right out of the types
* database and so if you change it or want to keep it around for long you
* should strdup it. You should free only the structure itself when finished
* with it.
*
* If there is no information for any one of the extensions it
* finds, it will ignore that extension. If it cannot find information for
* any of the extensions, it will return NULL.
*/
extern NET_cinfo *NET_cinfo_find(char *uri);
extern NET_cinfo *NET_cinfo_find_type(char *uri);
extern NET_cinfo *NET_cinfo_find_enc (char *uri);
/*
* cinfo_lookup finds the information about the given content-type, and
* returns a cinfo structure so you can look up description and icon.
*/
NET_cinfo *NET_cinfo_lookup(char *type);
#endif /* MKFORMAT_H */

166
network/main/mktypes.h Normal file
View File

@ -0,0 +1,166 @@
/* Generated file - do not edit! */
"exts=\"txt,text\" type=text/plain \
desc=\"Plain Text\" icon=internal-gopher-text",
"exts=\"html,htm\" type=text/html \
desc=\"Hypertext Markup Language\" icon=internal-gopher-text",
"exts=\"xml\" type=text/xml \
desc=\"Extensible Markup Language\" icon=internal-gopher-text",
"exts=\"rtf\" type=application/rtf \
desc=\"Rich Text Format\" icon=internal-gopher-text",
"exts=\"pdf\" type=application/pdf \
desc=\"Portable Document Format\" icon=internal-gopher-text",
"exts=\"tex\" type=application/x-tex \
desc=\"TeX Document\" icon=internal-gopher-text",
"exts=\"latex\" type=application/x-latex \
desc=\"LaTeX Document\" icon=internal-gopher-text",
"exts=\"dvi\" type=application/x-dvi \
desc=\"TeX DVI Data\" icon=internal-gopher-text",
"exts=\"texi,texinfo\" type=application/x-texinfo \
desc=\"GNU TeXinfo Document\" icon=internal-gopher-text",
"exts=\"vcf\" type=text/x-vcard \
desc=\"VCard\" icon=internal-gopher-unknown",
"exts=\"gif\" type=image/gif \
desc=\"GIF Image\" icon=internal-gopher-image",
"exts=\"jpeg,jpg,jpe,jfif,pjpeg,pjp\" type=image/jpeg \
desc=\"JPEG Image\" icon=internal-gopher-image",
"exts=\"tiff,tif\" type=image/tiff \
desc=\"TIFF Image\" icon=internal-gopher-image",
"exts=\"ras\" type=image/x-cmu-raster \
desc=\"CMU Raster Image\" icon=internal-gopher-image",
"exts=\"xbm\" type=image/x-xbitmap \
desc=\"X Bitmap\" icon=internal-gopher-image",
"exts=\"xpm\" type=image/x-xpixmap \
desc=\"X Pixmap\" icon=internal-gopher-image",
"exts=\"xwd\" type=image/x-xwindowdump \
desc=\"X Window Dump Image\" icon=internal-gopher-image",
"exts=\"pnm\" type=image/x-portable-anymap \
desc=\"PBM Image\" icon=internal-gopher-image",
"exts=\"pbm\" type=image/x-portable-bitmap \
desc=\"PBM Image\" icon=internal-gopher-image",
"exts=\"pgm\" type=image/x-portable-graymap \
desc=\"PGM Image\" icon=internal-gopher-image",
"exts=\"ppm\" type=image/x-portable-pixmap \
desc=\"PPM Image\" icon=internal-gopher-image",
"exts=\"rgb\" type=image/x-rgb \
desc=\"RGB Image\" icon=internal-gopher-image",
"exts=\"bmp\" type=image/x-MS-bmp \
desc=\"Windows Bitmap\" icon=internal-gopher-image",
"exts=\"pcd\" type=image/x-photo-cd \
desc=\"PhotoCD Image\" icon=internal-gopher-image",
"exts=\"png\" type=image/x-png \
desc=\"PNG Image\" icon=internal-gopher-image",
"exts=\"ief\" type=image/ief \
desc=\"\" icon=internal-gopher-image",
"exts=\"fif\" type=application/fractals \
desc=\"Fractal Image Format\" icon=internal-gopher-image",
"exts=\"au,snd\" type=audio/basic \
desc=\"ULAW Audio\" icon=internal-gopher-sound",
"exts=\"aif,aiff,aifc\" type=audio/x-aiff \
desc=\"AIFF Audio\" icon=internal-gopher-sound",
"exts=\"wav\" type=audio/x-wav \
desc=\"WAV Audio\" icon=internal-gopher-sound",
"exts=\"mp2,mpa,abs,mpega\" type=audio/x-mpeg \
desc=\"MPEG Audio\" icon=internal-gopher-sound",
"exts=\"ra,ram\" type=audio/x-pn-realaudio \
desc=\"RealAudio\" icon=internal-gopher-sound",
"exts=\"mpeg,mpg,mpe,mpv,vbs,mpegv\" type=video/mpeg \
desc=\"MPEG Video\" icon=internal-gopher-movie",
"exts=\"mpv2,mp2v\" type=video/x-mpeg2 \
desc=\"MPEG2 Video\" icon=internal-gopher-movie",
"exts=\"qt,mov,moov\" type=video/quicktime \
desc=\"Quicktime Video\" icon=internal-gopher-movie",
"exts=\"avi\" type=video/x-msvideo \
desc=\"Microsoft Video\" icon=internal-gopher-movie",
"exts=\"hqx\" type=application/mac-binhex40 \
desc=\"Macintosh BinHex Archive\" icon=internal-gopher-binary",
"exts=\"sit\" type=application/x-stuffit \
desc=\"Macintosh StuffIt Archive\" icon=internal-gopher-binary",
"exts=\"zip\" type=application/x-zip-compressed \
desc=\"Zip Compressed Data\" icon=internal-gopher-binary",
"exts=\"shar\" type=application/x-shar \
desc=\"Unix Shell Archive\" icon=internal-gopher-unknown",
"exts=\"tar\" type=application/x-tar \
desc=\"Unix Tape Archive\" icon=internal-gopher-binary",
"exts=\"gtar\" type=application/x-gtar \
desc=\"GNU Tape Archive\" icon=internal-gopher-binary",
"exts=\"cpio\" type=application/x-cpio \
desc=\"Unix CPIO Archive\" icon=internal-gopher-binary",
"exts=\"jar\" type=application/java-archive \
desc=\"Java Archive\" icon=internal-gopher-binary",
"exts=\"exe,bin\" type=application/octet-stream \
desc=\"Binary Executable\" icon=internal-gopher-binary",
"exts=\"ai,eps,ps\" type=application/postscript \
desc=\"Postscript Document\" icon=internal-gopher-text",
"exts=\"csh\" type=application/x-csh \
desc=\"C Shell Program\" icon=internal-gopher-unknown",
"exts=\"sh\" type=application/x-sh \
desc=\"Bourne Shell Program\" icon=internal-gopher-unknown",
"exts=\"tcl\" type=application/x-tcl \
desc=\"TCL Program\" icon=internal-gopher-unknown",
"exts=\"pl\" type=application/x-perl \
desc=\"Perl Program\" icon=internal-gopher-unknown",
"exts=\"js,mocha\" type=application/x-javascript \
desc=\"JavaScript Program\" icon=internal-gopher-unknown",
"exts=\"pac\" type=application/x-ns-proxy-autoconfig \
desc=\"Proxy Auto-Config\" icon=internal-gopher-unknown",
"exts=\"jsc\" type=application/x-javascript-config \
desc=\"JavaScript Config\" icon=internal-gopher-unknown",
"exts=\"p7m,p7c\" type=application/x-pkcs7-mime \
desc=\"PKCS7 Encrypted Data\" icon=internal-gopher-binary",
"exts=\"p7s\" type=application/x-pkcs7-signature \
desc=\"PKCS7 Signature\" icon=internal-gopher-binary",
"exts=\"enc\" type=application/pre-encrypted \
desc=\"Pre-encrypted Data\" icon=internal-gopher-binary",
"exts=\"crl\" type=application/x-pkcs7-crl \
desc=\"Certificate Revocation List\" icon=internal-gopher-binary",
"exts=\"ckl\" type=application/x-fortezza-ckl \
desc=\"Compromised Key List\" icon=internal-gopher-binary",
"exts=\"uu,uue\" enc=x-uuencode \
desc=\"UUEncoded Data\" icon=internal-gopher-binary",
"exts=\"doc,dot\" type=application/msword \
desc=\"Microsoft Word Document\" icon=internal-gopher-text",
"exts=\"xls,xlt,xlm,xld,xla,xlc,xlw,xll\" type=application/vnd.ms-excel \
desc=\"Microsoft Excel Worksheet\" icon=internal-gopher-text",
"exts=\"mdb,mda,mde\" type=application/vnd.ms-access \
desc=\"Microsoft Access Database\" icon=internal-gopher-text",
"exts=\"ppt,pot,ppa,pps,pwz\" type=application/vnd.ms-powerpoint \
desc=\"Microsoft PowerPoint Show\" icon=internal-gopher-text",
"exts=\"scd,sch,sc2\" type=application/vnd.ms-schedule \
desc=\"Microsoft Schedule+ Application\" icon=internal-gopher-text",
"exts=\"lwp,sam\" type=application/vnd.lotus-wordpro \
desc=\"Lotus WordPro Document\" icon=internal-gopher-text",
"exts=\"123,wk4,wk3,wk1\" type=application/vnd.lotus-1-2-3 \
desc=\"Lotus 123 Document\" icon=internal-gopher-text",
"exts=\"apr,vew\" type=application/vnd.lotus-approach \
desc=\"Lotus Approach Document\" icon=internal-gopher-text",
"exts=\"prz,pre\" type=application/vnd.lotus-freelance \
desc=\"Lotus Freelance Document\" icon=internal-gopher-text",
"exts=\"or3,or2,org\" type=application/vnd.lotus-organizer \
desc=\"Lotus Organizer Document\" icon=internal-gopher-text",
"exts=\"scm\" type=application/vnd.lotus-screencam \
desc=\"Lotus ScreenCam Movie\" icon=internal-gopher-text",
"exts=\"wpd,wp6\" type=application/wordperfect5.1 \
desc=\"WordPerfect Document\" icon=internal-gopher-text",
#ifdef XP_UNIX
"exts=\"t,tr,roff\" type=application/x-troff \
desc=\"TROFF Document\" icon=internal-gopher-text",
"exts=\"me\" type=application/x-troff-me \
desc=\"TROFF Document\" icon=internal-gopher-text",
"exts=\"ms\" type=application/x-troff-ms \
desc=\"TROFF Document\" icon=internal-gopher-text",
"exts=\"man\" type=application/x-troff-man \
desc=\"Unix Manual Page\" icon=internal-gopher-text",
"exts=\"movie\" type=video/x-sgi-movie \
desc=\"SGI Video\" icon=internal-gopher-movie",
"exts=\"Z\" enc=x-compress \
desc=\"Compressed Data\" icon=internal-gopher-binary",
"exts=\"gz\" enc=x-gzip \
desc=\"GNU Zip Compressed Data\" icon=internal-gopher-binary",
#else /* !XP_UNIX */
"exts=\"Z\" type=application/x-compress \
desc=\"Compressed Data\" icon=internal-gopher-binary",
"exts=\"gz\" enc=x-gzip \
desc=\"GNU Zip Compressed Data\" icon=internal-gopher-binary",
#endif /* !XP_UNIX */