makefile fixups to get xptinfo working on Win32. Added xptinfo.h for public dll declarations

This commit is contained in:
jband%netscape.com 1999-03-02 07:59:53 +00:00
Родитель d3f0d5273e
Коммит 8165a55acc
24 изменённых файлов: 170 добавлений и 119 удалений

Просмотреть файл

@ -16,6 +16,6 @@
DEPTH=..\..
IGNORE_MANIFEST=1
DIRS=public src tests tools
DIRS=public src tests tools xptinfo
include <$(DEPTH)\config\rules.mak>

Просмотреть файл

@ -26,11 +26,11 @@ PROGRAMS = $(PROG1) $(PROG2)
LCFLAGS=-DUSE_NSREG
DEFINES=-DWIN32_LEAN_AND_MEAN -DDEBUG
DEFINES=-DWIN32_LEAN_AND_MEAN
REQUIRES=xpcom libxpt
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\libxpt
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\libxpt
LLIBS= \
$(DIST)\lib\xpcom32.lib \
@ -62,10 +62,6 @@ install:: $(PROGRAMS)
$(CURDIR)$(*B).c
<<KEEP
clean :: clobber
clobber::
-for %p in ($(PROGRAMS)) do $(RM) %p $(DIST)\bin\%p

Просмотреть файл

@ -23,7 +23,10 @@ include $(DEPTH)/config/autoconf.mk
MODULE = xptinfo
CFLAGS += -DEXPORT_XPCI_API
EXPORTS = xpt_cpp.h \
xptinfo.h \
nsIInterfaceInfoManager.h \
nsIInterfaceInfo.h \
$(NULL)

Просмотреть файл

@ -21,6 +21,7 @@ DEPTH=..\..\..\..
EXPORTS = nsIInterfaceInfoManager.h \
nsIInterfaceInfo.h \
xptinfo.h \
xpt_cpp.h \
$(NULL)

Просмотреть файл

@ -1,63 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* The nsIInterfaceInfoManager xpcom public declaration. */
#ifndef nsIInterfaceInfoManager_h___
#define nsIInterfaceInfoManager_h___
#include "nsIInterfaceInfo.h"
// This should be implemented as a Service
// {8B161900-BE2B-11d2-9831-006008962422}
#define NS_IINTERFACEINFO_MANAGER_IID \
{ 0x8b161900, 0xbe2b, 0x11d2, \
{ 0x98, 0x31, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
class nsIInterfaceInfoManager : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IINTERFACEINFO_MANAGER_IID)
// nsIInformationInfo management services
NS_IMETHOD GetInfoForIID(const nsIID* iid, nsIInterfaceInfo** info) = 0;
NS_IMETHOD GetInfoForName(const char* name, nsIInterfaceInfo** info) = 0;
// name <-> IID mapping services
// NOTE: these return IAllocatator alloc'd copies of the data
NS_IMETHOD GetIIDForName(const char* name, nsIID** iid) = 0;
NS_IMETHOD GetNameForIID(const nsIID* iid, char** name) = 0;
// XXX other methods?
};
// this is just for XPT_PUBLIC_API...
// should be removed with below.
#include "xpt_struct.h"
PR_BEGIN_EXTERN_C
// XXX remove this and use ServiceManager instead
XPT_PUBLIC_API(nsIInterfaceInfoManager*)
XPT_GetInterfaceInfoManager();
PR_END_EXTERN_C
#endif /* nsIInterfaceInfoManager_h___ */

Просмотреть файл

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef xptiinfo_h___
#define xptiinfo_h___
#include "prtypes.h"
/*
* The linkage of XPTI API functions differs depending on whether the file is
* used within the XPTI library or not. Any source file within the XPTI
* library should define EXPORT_XPTI_API whereas any client of the library
* should not.
*/
#ifdef EXPORT_XPTI_API
#define XPTI_PUBLIC_API(t) PR_IMPLEMENT(t)
#define XPTI_PUBLIC_DATA(t) PR_IMPLEMENT_DATA(t)
#else
#ifdef _WIN32
# define XPTI_PUBLIC_API(t) _declspec(dllimport) t
# define XPTI_PUBLIC_DATA(t) _declspec(dllimport) t
#else
# define XPTI_PUBLIC_API(t) PR_IMPLEMENT(t)
# define XPTI_PUBLIC_DATA(t) t
#endif
#endif
#define XPTI_FRIEND_API(t) XPTI_PUBLIC_API(t)
#define XPTI_FRIEND_DATA(t) XPTI_PUBLIC_DATA(t)
PR_BEGIN_EXTERN_C
// Even if this is a service, it is cool to provide a direct accessor
XPTI_PUBLIC_API(nsIInterfaceInfoManager*)
XPTI_GetInterfaceInfoManager();
PR_END_EXTERN_C
#endif /* xptiinfo_h___ */

Просмотреть файл

@ -21,19 +21,22 @@ MAKE_OBJ_TYPE = DLL
DEPTH=..\..\..\..
LIBNAME = .\$(OBJDIR)\xptinfo$(MOZ_BITS)
DLL = $(LIBNAME).dll
DLLNAME = xptinfo$(MOZ_BITS)
DLL =.\$(OBJDIR)\$(DLLNAME).dll
LCFLAGS = -DEXPORT_XPT_API -DWIN32_LEAN_AND_MEAN
LCFLAGS = -DEXPORT_XPTI_API -DWIN32_LEAN_AND_MEAN
LINCS = \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\raptor \
-I$(PUBLIC)\libxpt \
-I$(PUBLIC)\xptinfo \
$(NULL)
LLIBS = \
$(DIST)\lib\libxpt$(MOZ_BITS).lib \
$(DIST)\lib\xpcom$(MOZ_BITS).lib \
$(LIBNSPR) \
$(DIST)\lib\libxpt.lib \
$(NULL)
CSRCS = \
@ -59,5 +62,5 @@ MODULE = xptinfo
include <$(DEPTH)\config\rules.mak>
libs:: $(DLL)
$(MAKE_INSTALL) $(LIBNAME).$(DLL_SUFFIX) $(DIST)\bin
$(MAKE_INSTALL) $(LIBNAME).$(LIB_SUFFIX) $(DIST)\lib
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib

Просмотреть файл

@ -25,6 +25,7 @@
#include "nsInterfaceInfo.h"
#include "nsInterfaceInfoManager.h"
#include "xptinfo.h"
static NS_DEFINE_IID(kIInterfaceInfoIID, NS_IINTERFACEINFO_IID);
NS_IMPL_ISUPPORTS(nsInterfaceInfo, kIInterfaceInfoIID);

Просмотреть файл

@ -27,6 +27,7 @@
#include "nsInterfaceInfoManager.h"
#include "nsInterfaceInfo.h"
#include "xptinfo.h"
// this after nsISupports, to pick up IID
// so that xpt stuff doesn't try to define it itself...
@ -52,7 +53,7 @@ XPTHeader *getheader() {
return NULL;
}
flen = file_stat.st_size;
in = fopen(XPTFILE, "r");
in = fopen(XPTFILE, "rb");
if (!in) {
perror("FAILED: fopen");
@ -265,8 +266,9 @@ nsInterfaceInfoManager::GetNameForIID(const nsIID* iid, char** name)
// XXX this goes away; IIM should be a service.
// ... where does decl for this go?
XPT_PUBLIC_API(nsIInterfaceInfoManager*)
XPT_GetInterfaceInfoManager()
// Even if this is a service, it is cool to provide a direct accessor
XPTI_PUBLIC_API(nsIInterfaceInfoManager*)
XPTI_GetInterfaceInfoManager()
{
return nsInterfaceInfoManager::GetInterfaceInfoManager();
}

Просмотреть файл

@ -26,6 +26,7 @@
#include "nsInterfaceInfoManager.h"
#include "xpt_cpp.h"
#include "xptinfo.h"
// Placeholder - this implementation just returns NULL.
@ -38,11 +39,12 @@ nsXPTParamInfo::GetInterface() const
if(!(mgr = nsInterfaceInfoManager::GetInterfaceInfoManager()))
return NULL;
nsIInterfaceInfo* info;
// nsIInterfaceInfo* info;
// mgr->GetInfoForIID(&InterfaceDirectoryEntryTable[type.type.interface].iid,
// &info);
NS_RELEASE(mgr);
return info;
// return info;
return NULL;
}
const nsIID*

Просмотреть файл

@ -23,15 +23,17 @@
#include "nsISupports.h"
#include "nsIInterfaceInfo.h"
#include "nsIInterfaceInfoManager.h"
#include "xptinfo.h"
static void RegAllocator();
int main (int argc, char **argv) {
RegAllocator();
nsIInterfaceInfoManager *iim = XPT_GetInterfaceInfoManager();
nsIInterfaceInfoManager *iim = XPTI_GetInterfaceInfoManager();
nsIID *iid;
iim->GetIIDForName("Interface", &iid);
return 0;
}

Просмотреть файл

@ -25,11 +25,12 @@ PROGRAMS = $(PROG1)
LCFLAGS=-DUSE_NSREG
DEFINES=-DWIN32_LEAN_AND_MEAN -DDEBUG
DEFINES=-DWIN32_LEAN_AND_MEAN
REQUIRES=xpcom libxpt xptinfo
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\libxpt -I$(PUBLIC)\xptinfo
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \
-I$(PUBLIC)\libxpt -I$(PUBLIC)\xptinfo
LLIBS= \
$(DIST)\lib\xpcom32.lib \
@ -47,7 +48,7 @@ install:: $(PROGRAMS)
-for %p in ($(TESTCASES)) do $(MAKE_INSTALL) %p $(DIST)\bin
# Move this into config/obj.inc when it's allowed
.c{.\$(OBJDIR)\}.exe:
.cpp{.\$(OBJDIR)\}.exe:
$(CC) @<<$(CFGFILE)
$(CFLAGS)
$(LCFLAGS)
@ -59,7 +60,7 @@ install:: $(PROGRAMS)
-Fd$(PBDFILE)
-Fe.\$(OBJDIR)\
-Fo.\$(OBJDIR)\
$(CURDIR)$(*B).c
$(CURDIR)$(*B).cpp
<<KEEP
clean :: clobber

Просмотреть файл

@ -23,7 +23,10 @@ include $(DEPTH)/config/autoconf.mk
MODULE = xptinfo
CFLAGS += -DEXPORT_XPCI_API
EXPORTS = xpt_cpp.h \
xptinfo.h \
nsIInterfaceInfoManager.h \
nsIInterfaceInfo.h \
$(NULL)

Просмотреть файл

@ -21,6 +21,7 @@ DEPTH=..\..\..\..
EXPORTS = nsIInterfaceInfoManager.h \
nsIInterfaceInfo.h \
xptinfo.h \
xpt_cpp.h \
$(NULL)

Просмотреть файл

@ -48,16 +48,6 @@ public:
};
// this is just for XPT_PUBLIC_API...
// should be removed with below.
#include "xpt_struct.h"
PR_BEGIN_EXTERN_C
// XXX remove this and use ServiceManager instead
XPT_PUBLIC_API(nsIInterfaceInfoManager*)
XPT_GetInterfaceInfoManager();
PR_END_EXTERN_C
#endif /* nsIInterfaceInfoManager_h___ */

Просмотреть файл

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef xptiinfo_h___
#define xptiinfo_h___
#include "prtypes.h"
/*
* The linkage of XPTI API functions differs depending on whether the file is
* used within the XPTI library or not. Any source file within the XPTI
* library should define EXPORT_XPTI_API whereas any client of the library
* should not.
*/
#ifdef EXPORT_XPTI_API
#define XPTI_PUBLIC_API(t) PR_IMPLEMENT(t)
#define XPTI_PUBLIC_DATA(t) PR_IMPLEMENT_DATA(t)
#else
#ifdef _WIN32
# define XPTI_PUBLIC_API(t) _declspec(dllimport) t
# define XPTI_PUBLIC_DATA(t) _declspec(dllimport) t
#else
# define XPTI_PUBLIC_API(t) PR_IMPLEMENT(t)
# define XPTI_PUBLIC_DATA(t) t
#endif
#endif
#define XPTI_FRIEND_API(t) XPTI_PUBLIC_API(t)
#define XPTI_FRIEND_DATA(t) XPTI_PUBLIC_DATA(t)
PR_BEGIN_EXTERN_C
// Even if this is a service, it is cool to provide a direct accessor
XPTI_PUBLIC_API(nsIInterfaceInfoManager*)
XPTI_GetInterfaceInfoManager();
PR_END_EXTERN_C
#endif /* xptiinfo_h___ */

Просмотреть файл

@ -21,19 +21,22 @@ MAKE_OBJ_TYPE = DLL
DEPTH=..\..\..\..
LIBNAME = .\$(OBJDIR)\xptinfo$(MOZ_BITS)
DLL = $(LIBNAME).dll
DLLNAME = xptinfo$(MOZ_BITS)
DLL =.\$(OBJDIR)\$(DLLNAME).dll
LCFLAGS = -DEXPORT_XPT_API -DWIN32_LEAN_AND_MEAN
LCFLAGS = -DEXPORT_XPTI_API -DWIN32_LEAN_AND_MEAN
LINCS = \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\raptor \
-I$(PUBLIC)\libxpt \
-I$(PUBLIC)\xptinfo \
$(NULL)
LLIBS = \
$(DIST)\lib\libxpt$(MOZ_BITS).lib \
$(DIST)\lib\xpcom$(MOZ_BITS).lib \
$(LIBNSPR) \
$(DIST)\lib\libxpt.lib \
$(NULL)
CSRCS = \
@ -59,5 +62,5 @@ MODULE = xptinfo
include <$(DEPTH)\config\rules.mak>
libs:: $(DLL)
$(MAKE_INSTALL) $(LIBNAME).$(DLL_SUFFIX) $(DIST)\bin
$(MAKE_INSTALL) $(LIBNAME).$(LIB_SUFFIX) $(DIST)\lib
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib

Просмотреть файл

@ -25,6 +25,7 @@
#include "nsInterfaceInfo.h"
#include "nsInterfaceInfoManager.h"
#include "xptinfo.h"
static NS_DEFINE_IID(kIInterfaceInfoIID, NS_IINTERFACEINFO_IID);
NS_IMPL_ISUPPORTS(nsInterfaceInfo, kIInterfaceInfoIID);

Просмотреть файл

@ -27,6 +27,7 @@
#include "nsInterfaceInfoManager.h"
#include "nsInterfaceInfo.h"
#include "xptinfo.h"
// this after nsISupports, to pick up IID
// so that xpt stuff doesn't try to define it itself...
@ -52,7 +53,7 @@ XPTHeader *getheader() {
return NULL;
}
flen = file_stat.st_size;
in = fopen(XPTFILE, "r");
in = fopen(XPTFILE, "rb");
if (!in) {
perror("FAILED: fopen");
@ -265,8 +266,9 @@ nsInterfaceInfoManager::GetNameForIID(const nsIID* iid, char** name)
// XXX this goes away; IIM should be a service.
// ... where does decl for this go?
XPT_PUBLIC_API(nsIInterfaceInfoManager*)
XPT_GetInterfaceInfoManager()
// Even if this is a service, it is cool to provide a direct accessor
XPTI_PUBLIC_API(nsIInterfaceInfoManager*)
XPTI_GetInterfaceInfoManager()
{
return nsInterfaceInfoManager::GetInterfaceInfoManager();
}

Просмотреть файл

@ -26,6 +26,7 @@
#include "nsInterfaceInfoManager.h"
#include "xpt_cpp.h"
#include "xptinfo.h"
// Placeholder - this implementation just returns NULL.
@ -38,11 +39,12 @@ nsXPTParamInfo::GetInterface() const
if(!(mgr = nsInterfaceInfoManager::GetInterfaceInfoManager()))
return NULL;
nsIInterfaceInfo* info;
// nsIInterfaceInfo* info;
// mgr->GetInfoForIID(&InterfaceDirectoryEntryTable[type.type.interface].iid,
// &info);
NS_RELEASE(mgr);
return info;
// return info;
return NULL;
}
const nsIID*

Просмотреть файл

@ -23,15 +23,17 @@
#include "nsISupports.h"
#include "nsIInterfaceInfo.h"
#include "nsIInterfaceInfoManager.h"
#include "xptinfo.h"
static void RegAllocator();
int main (int argc, char **argv) {
RegAllocator();
nsIInterfaceInfoManager *iim = XPT_GetInterfaceInfoManager();
nsIInterfaceInfoManager *iim = XPTI_GetInterfaceInfoManager();
nsIID *iid;
iim->GetIIDForName("Interface", &iid);
return 0;
}

Просмотреть файл

@ -25,11 +25,12 @@ PROGRAMS = $(PROG1)
LCFLAGS=-DUSE_NSREG
DEFINES=-DWIN32_LEAN_AND_MEAN -DDEBUG
DEFINES=-DWIN32_LEAN_AND_MEAN
REQUIRES=xpcom libxpt xptinfo
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\libxpt -I$(PUBLIC)\xptinfo
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \
-I$(PUBLIC)\libxpt -I$(PUBLIC)\xptinfo
LLIBS= \
$(DIST)\lib\xpcom32.lib \
@ -47,7 +48,7 @@ install:: $(PROGRAMS)
-for %p in ($(TESTCASES)) do $(MAKE_INSTALL) %p $(DIST)\bin
# Move this into config/obj.inc when it's allowed
.c{.\$(OBJDIR)\}.exe:
.cpp{.\$(OBJDIR)\}.exe:
$(CC) @<<$(CFGFILE)
$(CFLAGS)
$(LCFLAGS)
@ -59,7 +60,7 @@ install:: $(PROGRAMS)
-Fd$(PBDFILE)
-Fe.\$(OBJDIR)\
-Fo.\$(OBJDIR)\
$(CURDIR)$(*B).c
$(CURDIR)$(*B).cpp
<<KEEP
clean :: clobber

Просмотреть файл

@ -16,6 +16,6 @@
DEPTH=..\..
IGNORE_MANIFEST=1
DIRS=public src tests tools
DIRS=public src tests tools xptinfo
include <$(DEPTH)\config\rules.mak>

Просмотреть файл

@ -26,11 +26,11 @@ PROGRAMS = $(PROG1) $(PROG2)
LCFLAGS=-DUSE_NSREG
DEFINES=-DWIN32_LEAN_AND_MEAN -DDEBUG
DEFINES=-DWIN32_LEAN_AND_MEAN
REQUIRES=xpcom libxpt
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\libxpt
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\libxpt
LLIBS= \
$(DIST)\lib\xpcom32.lib \
@ -62,10 +62,6 @@ install:: $(PROGRAMS)
$(CURDIR)$(*B).c
<<KEEP
clean :: clobber
clobber::
-for %p in ($(PROGRAMS)) do $(RM) %p $(DIST)\bin\%p