-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nykwil
committed
Oct 24, 2013
1 parent
6b221df
commit 998378b
Showing
95 changed files
with
36,296 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// bulletml.cpp : DLL アプリケーション用のエントリ ポイントを定義します。 | ||
// | ||
|
||
#include "stdafx.h" | ||
#include "bulletml.h" | ||
|
||
BOOL APIENTRY DllMain( HANDLE hModule, | ||
DWORD ul_reason_for_call, | ||
LPVOID lpReserved | ||
) | ||
{ | ||
switch (ul_reason_for_call) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
case DLL_THREAD_ATTACH: | ||
case DLL_THREAD_DETACH: | ||
case DLL_PROCESS_DETACH: | ||
break; | ||
} | ||
return TRUE; | ||
} | ||
|
||
|
||
// これはエクスポートされた変数の例です。 | ||
BULLETML_API int nBulletml=0; | ||
|
||
// これはエクスポートされた関数の例です。 | ||
BULLETML_API int fnBulletml(void) | ||
{ | ||
return 42; | ||
} | ||
|
||
// これはエクスポートされたクラスのコンストラクタです。 | ||
// クラスの定義については bulletml.h を参照してください。 | ||
CBulletml::CBulletml() | ||
{ | ||
return; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
// 以下の ifdef ブロックは DLL から簡単にエクスポートさせるマクロを作成する標準的な方法です。 | ||
// この DLL 内のすべてのファイルはコマンドラインで定義された BULLETML_EXPORTS シンボル | ||
// でコンパイルされます。このシンボルはこの DLL が使用するどのプロジェクト上でも未定義でなけ | ||
// ればなりません。この方法ではソースファイルにこのファイルを含むすべてのプロジェクトが DLL | ||
// からインポートされたものとして BULLETML_API 関数を参照し、そのためこの DLL はこのマク | ||
// ロで定義されたシンボルをエクスポートされたものとして参照します。 | ||
#ifdef BULLETML_EXPORTS | ||
#define BULLETML_API __declspec(dllexport) | ||
#else | ||
#define BULLETML_API __declspec(dllimport) | ||
#endif | ||
|
||
// このクラスは bulletml.dll からエクスポートされます | ||
class BULLETML_API CBulletml { | ||
public: | ||
CBulletml(void); | ||
// TODO: この位置にメソッドを追加してください。 | ||
}; | ||
|
||
extern BULLETML_API int nBulletml; | ||
|
||
BULLETML_API int fnBulletml(void); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CXX=g++ | ||
DMD=dmd | ||
PERL=perl | ||
CPPFLAGS=-g | ||
DFLAGS=-g | ||
|
||
all: cpp_test | ||
|
||
cpp_test: cpp.o cpp_test.o | ||
$(DMD) cpp_test $(CPPFLAGS) cpp.o | ||
|
||
cpp.o: d_cpp_interface.h cpp.cpp | ||
$(CXX) $(CPPFLAGS) -c cpp.cpp | ||
|
||
cpp_test.o: cpp_inter.d cpp_test.d | ||
$(DMD) $(DFLAGS) -c cpp_test.d | ||
|
||
cpp_inter.d: cpp.cpp | ||
$(PERL) create_d_import.pl cpp.cpp cpp_inter.d | ||
|
||
clean: | ||
rm -f *.o cpp_test cpp_inter.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CXX=sc | ||
DMD=dmd | ||
PERL=perl | ||
CPPFLAGS=-g | ||
DFLAGS=-g | ||
|
||
all: cpp_test | ||
|
||
cpp_test: cpp.obj cpp_test.obj | ||
$(DMD) cpp_test $(CPPFLAGS) cpp.obj | ||
|
||
cpp.obj: d_cpp_interface.h cpp.cpp | ||
$(CXX) $(CPPFLAGS) -c cpp.cpp | ||
|
||
cpp_test.obj: cpp_inter.d cpp_test.d | ||
$(DMD) $(DFLAGS) -c cpp_test.d | ||
|
||
cpp_inter.d: cpp.cpp | ||
$(PERL) create_d_import.pl cpp.cpp cpp_inter.d | ||
|
||
clean: | ||
rm -f *.obj cpp_test cpp_inter.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
from D to C++ | ||
|
||
If you are more familiar English than Japanese, please read README.en. | ||
|
||
�������� | ||
|
||
C++ �ΰ仺(���Ǥʤ�) �� D ���鿨�뤿��Τ�ΤǤ��� | ||
extern(C++) �����ݡ��Ȥ��줿����̵��̣�˵���ޤ��� | ||
|
||
C++ ����� C �Υ����ե����������ơ� | ||
D ���餽��뤿��Υ���ݡ��ȥ饤�֥�����ʤ���Фʤ�ʤ��� | ||
�Ȥ������Ȥ�����ĺ����в�����ꤿ�������狼�뤫�Ȼפ��ޤ��� | ||
|
||
C �ؿ������/����� C++ ����������ץ�ץ����å��ǡ� | ||
D �ؿ�������� C++ ���������� perl ������ץȤ���������ޤ��� | ||
|
||
README.en ���������������뤿��˺�ä��ޡ� | ||
|
||
generating process | ||
|
||
C++ using d_cpp -----------------------> C wrapper | ||
(interface definition) | preprocesser | ||
| | ||
--------------------> D import interface | ||
perl script | ||
|
||
accessing process | ||
|
||
D client code --> D import interface --> C wrapper --> | ||
C++ using d_cpp --> C++ library code | ||
|
||
���ե���������� | ||
|
||
README: | ||
���졣 | ||
|
||
Makefile: | ||
����ץ�Ǥ���Ȥ����� cpp_test �¹ԥե�������롣 | ||
|
||
Makefile.win32: | ||
windows �Ǥ� Makefile�� | ||
|
||
d_cpp_interface.h: | ||
C++ ���� C ��������������뤿��Υإå��� | ||
|
||
create_d_import.pl: | ||
D �������ư�������� perl ������ץȡ� | ||
|
||
cpp.cc: | ||
����ץ롢�桼�����ˤ�ʤ��ΤϤ�����ʬ�Ǥ��� | ||
|
||
cpp_test.d: | ||
D ���� cpp.cc ��ºݤˤ����äƤߤ륵��ץ롣 | ||
|
||
create_d_cpp_interface.pl: | ||
���ޤ���d_cpp_interface.h ���������롣��¤���������ˤɤ����� | ||
|
||
cpp.cc ����Ⱦ�� D ����Ȥ��������饹�饤�֥�ꡢ | ||
��Ⱦ���� D �� import ����Τ�ɬ�פʺ�ȤǤ��� | ||
|
||
cpp.cc �� C �ؿ���������ޥ�������������ޤ��� | ||
���Υޥ����ϻ��� perl script �ǥѡ������뤿�ᡢ | ||
��������в��Ԥ��ʤ��Dz������� | ||
|
||
D �ˤ�� import �� create_d_import.pl ���Ѥ��� | ||
import ���뤿��Υե������������Ʋ������� | ||
���Υե�����ˤ���������ޤޤ�ʤ��Τǡ� | ||
����ѥ��롦�����ɬ�פϤ���ޤ��� | ||
|
||
����ʤ�䤳������Τ������������̵���Τǡ� | ||
cpp.cc ��į���Ŭ�������Ʋ������� | ||
|
||
������¾ | ||
|
||
�ȤƤ�ȤƤ���ǤǤ������ո�ĺ����ȤȤƤ���Ǥ��� | ||
|
||
�ʲ����º�Ū�ʼ���ȤʤäƤ��ޤ��� | ||
http://user.ecc.u-tokyo.ac.jp/~s31552/wp/bulletss/ | ||
|
||
���� BSD �饤���˽��ä����ۤ��ޤ��� | ||
|
||
Copyright (c) 2003, shinichiro.h All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* The name of the author may not be used to endorse or promote | ||
products derived from this software without specific prior | ||
written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
------------------ | ||
shinichiro.h | ||
[email protected] | ||
http://user.ecc.u-tokyo.ac.jp/~s31552/wp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
from D to C++ | ||
|
||
I'm sorry of my poor English... | ||
|
||
* Introduction | ||
|
||
This package helps to access C++ library from D. If D compiler | ||
supports such as extern(C++), this package becomes useless. | ||
|
||
* Figure | ||
|
||
generating process | ||
|
||
C++ using d_cpp -----------------------> C wrapper | ||
(interface definition) | preprocesser | ||
| | ||
--------------------> D import interface | ||
perl script | ||
|
||
accessing process | ||
|
||
D client code --> D import interface --> C wrapper --> | ||
C++ using d_cpp --> C++ library code | ||
|
||
* File Description | ||
|
||
README: | ||
this file. | ||
|
||
Makefile: | ||
linux's makefile. | ||
|
||
Makefile.win32: | ||
windows's makefile. | ||
|
||
d_cpp_interface.h: | ||
helps C++ using d_cpp to C wrapper | ||
|
||
create_d_import.pl: | ||
helps C++ using d_cpp to D import interface | ||
|
||
cpp.cc: | ||
sample of C++ using d_cpp and C++ library code. | ||
|
||
cpp_test.d: | ||
sample of D client code. | ||
|
||
create_d_cpp_interface.pl: | ||
I created d_cpp_interface.h with this script. | ||
|
||
* Misc | ||
|
||
This package is alpha release. I'm glad if you give me advice. | ||
|
||
More complicated sample is available as "barrage 360 deg.", | ||
a BulletML viewer. | ||
|
||
- Japanese page | ||
http://user.ecc.u-tokyo.ac.jp/~s31552/wp/bulletss/ | ||
- Download | ||
http://user.ecc.u-tokyo.ac.jp/~s31552/wp/bulletss/bulletss.tar.bz2 | ||
- BulletML | ||
http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html | ||
|
||
This package distributes under the modified BSD license | ||
|
||
Copyright (c) 2003, shinichiro.h All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* The name of the author may not be used to endorse or promote | ||
products derived from this software without specific prior | ||
written permission. | ||
|
||
TTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
------------------ | ||
shinichiro.h | ||
[email protected] | ||
http://user.ecc.u-tokyo.ac.jp/~s31552/wp/ | ||
|
Oops, something went wrong.