Changes for external content type handlers.

git-svn-id: svn://10.0.0.236/trunk@18485 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rhp%netscape.com
1999-01-25 13:29:16 +00:00
parent 13e555c340
commit 706dcd2d19
13 changed files with 8054 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src tests
DIRS = public src cthandlers tests
include $(topsrcdir)/config/config.mk

View File

@@ -47,13 +47,14 @@ MIME_GetContentType(void)
}
PUBLIC MimeObjectClass *
MIME_CreateContentTypeHandlerClass(const char *content_type)
MIME_CreateContentTypeHandlerClass(const char *content_type, PRBool *forceInline)
{
MimeObjectClass *class = (MimeObjectClass *)&mimeInlineTextCalendarClass;
/*
* Must set the superclass by hand.
*/
class->superclass = (MimeObjectClass *)MIME_GetmimeInlineTextClass();
*forceInline = PR_FALSE;
return class;
}

File diff suppressed because it is too large Load Diff

View File

@@ -55,7 +55,10 @@ OBJS= \
.\$(OBJDIR)\mimevcrd.obj \
.\$(OBJDIR)\oldvcc.obj \
.\$(OBJDIR)\oldvobj.obj \
.\$(OBJDIR)\mimeobj.obj \
.\$(OBJDIR)\oldxp.obj \
.\$(OBJDIR)\oldi18n.obj \
.\$(OBJDIR)\comi18n.obj \
.\$(OBJDIR)\oldnet.obj \
$(NULL)
#//------------------------------------------------------------------------
@@ -101,6 +104,7 @@ LLIBS= \
$(DIST)\lib\xplib.lib \
$(DIST)\lib\raptorbase.lib \
$(DIST)\lib\xpcom32.lib \
$(DIST)\lib\mime.lib \
$(NULL)
LINCS=$(LINCS) -I. \
@@ -110,7 +114,7 @@ LINCS=$(LINCS) -I. \
-I$(PUBLIC)\netlib \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\raptor \
-I..\src \
-I..\..\src \
$(NULL)
#//------------------------------------------------------------------------
@@ -121,7 +125,7 @@ LINCS=$(LINCS) -I. \
include <$(DEPTH)/config/rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME) $(DIST)\bin
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME) $(DIST)\bin\mimeplugins
clobber::
rm -f $(DIST)\bin\$(DLLNAME)

View File

@@ -16,3 +16,5 @@
LIBRARY mimect-vcard.dll
EXPORTS
MIME_GetContentType
MIME_CreateContentTypeHandlerClass

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
/* -*- 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 _MIMEVCRD_H_
#define _MIMEVCRD_H_
#include "mimetext.h"
/* The MimeInlineTextHTML class implements the text/x-vcard and (maybe?
someday?) the application/directory MIME content types.
*/
typedef struct MimeInlineTextVCardClass MimeInlineTextVCardClass;
typedef struct MimeInlineTextVCard MimeInlineTextVCard;
struct MimeInlineTextVCardClass {
MimeInlineTextClass text;
char* vCardString;
};
extern MimeInlineTextVCardClass mimeInlineTextVCardClass;
struct MimeInlineTextVCard {
MimeInlineText text;
};
#endif /* _MIMEVCRD_H_ */

View File

@@ -0,0 +1,95 @@
/* -*- 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.
*/
#include "xp.h"
#include "prmem.h"
#include "plstr.h"
#include "intl_csi.h"
INTL_CharSetInfo
LO_GetDocumentCharacterSetInfo(MWContext *context)
{
/* MOZ_FUNCTION_STUB; */
return NULL;
}
void
INTL_CharSetIDToName(int16 csid, char *charset)
{
if (charset) {
PR_ASSERT(INTL_CsidToCharsetNamePt(csid));
if (INTL_CsidToCharsetNamePt(csid))
PL_strcpy(charset,(char *)INTL_CsidToCharsetNamePt(csid));
else
charset = NULL;
}
}
/* INTL_ResourceCharSet(void) */
char *INTL_ResourceCharSet(void)
{
return ("iso-8859-1");
}
/* ----------- CSI CSID ----------- */
void
INTL_SetCSIDocCSID (INTL_CharSetInfo c, int16 doc_csid)
{
return;
}
int16
INTL_GetCSIDocCSID(INTL_CharSetInfo c)
{
return 0;
}
unsigned char *INTL_ConvertLineWithoutAutoDetect(
int16 fromcsid,
int16 tocsid,
unsigned char *pSrc,
PRUint32 block_size)
{
return NULL;
}
/*
* INTL_DocToWinCharSetID,
* Based on DefaultDocCSID, it determines which Win CSID to use for Display
*/
int16
INTL_DocToWinCharSetID(int16 csid)
{
/* MOZ_FUNCTION_STUB; */
return CS_FE_ASCII;
}
int16
INTL_DefaultDocCharSetID(iDocumentContext context)
{
return CS_DEFAULT;
}
unsigned char *INTL_ConvMailToWinCharCode(
iDocumentContext context,
unsigned char *bit7buff,
PRUint32 block_size
)
{
return NULL;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,254 @@
/* -*- 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.
*/
/*
* i18n.c - I18N depencencies
*/
#include "xp.h"
#include "prmem.h"
#include "plstr.h"
PUBLIC void *
FE_SetTimeout(TimeoutCallbackFunction func, void * closure, uint32 msecs)
{
return NULL;
}
/* RICHIE - THIS HACK MUST GO!!! - INCLUDING FILE TO TRY TO KEEP DIRECTORY CLEAN */
#ifdef XP_UNIX
#define PUBLIC
#else
#include "..\..\..\lib\xp\xp_time.c"
#endif
char *XP_AppendStr(char *in, const char *append)
{
int alen, inlen;
alen = PL_strlen(append);
if (in) {
inlen = PL_strlen(in);
in = (char*) PR_Realloc(in,inlen+alen+1);
if (in) {
memcpy(in+inlen, append, alen+1);
}
} else {
in = (char*) PR_Malloc(alen+1);
if (in) {
memcpy(in, append, alen+1);
}
}
return in;
}
#define MOZ_FUNCTION_STUB
char *
WH_TempName(XP_FileType type, const char * prefix)
{
MOZ_FUNCTION_STUB;
return NULL;
}
/*
// The caller is responsible for PR_Free()ing the return string
*/
PUBLIC char *
WH_FileName (const char *NetName, XP_FileType type)
{
MOZ_FUNCTION_STUB;
if (type == xpHTTPCookie) {
#ifdef XP_PC
return PL_strdup("cookies.txt");
#else
return PL_strdup("cookies");
#endif
} else if (type == xpCacheFAT) {
;// sprintf(newName, "%s\\fat.db", (const char *)theApp.m_pCacheDir);
} else if ((type == xpURL) || (type == xpFileToPost)) {
/*
* This is the body of XP_NetToDosFileName(...) which is implemented
* for Windows only in fegui.cpp
*/
PRBool bChopSlash = PR_FALSE;
char *p, *newName;
if(!NetName)
return NULL;
// If the name is only '/' or begins '//' keep the
// whole name else strip the leading '/'
if(NetName[0] == '/')
bChopSlash = PR_TRUE;
// save just / as a path
if(NetName[0] == '/' && NetName[1] == '\0')
bChopSlash = PR_FALSE;
// spanky Win9X path name
if(NetName[0] == '/' && NetName[1] == '/')
bChopSlash = PR_FALSE;
if(bChopSlash)
newName = PL_strdup(&(NetName[1]));
else
newName = PL_strdup(NetName);
if(!newName)
return NULL;
if( newName[1] == '|' )
newName[1] = ':';
for(p = newName; *p; p++){
if( *p == '/' )
*p = '\\';
}
return(newName);
}
return NULL;
}
PUBLIC XP_File
XP_FileOpen(const char * name, XP_FileType type, const XP_FilePerm perm)
{
MOZ_FUNCTION_STUB;
switch (type) {
case xpURL:
case xpFileToPost:
case xpHTTPCookie:
{
XP_File fp;
char* newName = WH_FileName(name, type);
if (!newName) return NULL;
fp = fopen(newName, (char *) perm);
PR_Free(newName);
return fp;
}
default:
break;
}
return NULL;
}
PUBLIC XP_Dir
XP_OpenDir(const char * name, XP_FileType type)
{
MOZ_FUNCTION_STUB;
return NULL;
}
PUBLIC void
XP_CloseDir(XP_Dir dir)
{
MOZ_FUNCTION_STUB;
}
PUBLIC XP_DirEntryStruct *
XP_ReadDir(XP_Dir dir)
{
MOZ_FUNCTION_STUB;
return NULL;
}
PUBLIC int
XP_FileRemove(const char * name, XP_FileType type)
{
if (PR_Delete(name) == PR_SUCCESS)
return 0;
return -1;
}
/* If you want to trace netlib, set this to 1, or use CTRL-ALT-T
* stroke (preferred method) to toggle it on and off */
int MKLib_trace_flag=0;
/* Used by NET_NTrace() */
PRIVATE void net_Trace(char *msg) {
#if defined(WIN32) && defined(DEBUG)
OutputDebugString(msg);
OutputDebugString("\n");
#else
PR_LogPrint(msg);
#endif
}
/* #define'd in mktrace.h to TRACEMSG */
void _MK_TraceMsg(char *fmt, ...) {
va_list ap;
char buf[512];
va_start(ap, fmt);
PR_vsnprintf(buf, sizeof(buf), fmt, ap);
net_Trace(buf);
}
PUBLIC int
XP_Stat(const char * name, XP_StatStruct * info, XP_FileType type)
{
int result = -1;
MOZ_FUNCTION_STUB;
switch (type) {
case xpURL:
case xpFileToPost: {
char *newName = WH_FileName(name, type);
if (!newName) return -1;
result = _stat( newName, info );
PR_Free(newName);
break;
}
default:
break;
}
return result;
}
char *XP_STRNCPY_SAFE (char *dest, const char *src, size_t destLength)
{
char *result = strncpy (dest, src, --destLength);
dest[destLength] = '\0';
return result;
}
int
RNG_GenerateGlobalRandomBytes(void *dest, size_t len)
{
size_t i;
char *ptr = (char *) dest;
for (i=0; i<len; i++)
{
*(ptr+i) = 1;
}
return 0;
}

View File

@@ -18,6 +18,6 @@
DEPTH=..\..
IGNORE_MANIFEST=1
DIRS=src
DIRS=src cthandlers
include <$(DEPTH)\config\rules.mak>