cshiori  1
 全て クラス ファイル 関数 変数 列挙型 列挙値 マクロ定義 ページ
shiori.h
[詳解]
1 //---------------------------------------------------------------------------
19 //
20 // 2014.11.09 作成 Narazaka: http://narazaka.net/
21 //
22 //---------------------------------------------------------------------------
23 #ifndef SHIORI_H__
24 #define SHIORI_H__
25 //-------------------------------------------------------------------------
26 #if defined(WIN32)||defined(_WIN32)||defined(_Windows)||defined(__CYGWIN__)
27 // Win32
28 # include <windows.h>
29 # ifdef __BORLANDC__
30 // Borland C++
31 # ifdef __cplusplus
32 # define SHIORI_EXPORT extern "C"
33 # else
34 # define SHIORI_EXPORT extern
35 # endif
36 # elif defined(__clang__)
37 // clang
38 # ifdef __cplusplus
39 # define SHIORI_EXPORT extern "C"
40 # else
41 # define SHIORI_EXPORT extern
42 # endif
43 # else
44 // Visual C++ / Cygwin32 / Mingw32
45 # ifdef __cplusplus
46 # define SHIORI_EXPORT extern "C" __declspec(dllexport)
47 # else
48 # define SHIORI_EXPORT extern __declspec(dllexport)
49 # endif
50 # endif
51 # define SHIORI_CALL __cdecl
52 # define MEMORY_HANDLE HGLOBAL
53 # ifdef __cplusplus
54 # define SHIORI_MALLOC(len) ::GlobalAlloc(GMEM_FIXED, len)
55 # define SHIORI_FREE(ptr) ::GlobalFree((HGLOBAL)ptr)
56 # else
57 # define SHIORI_MALLOC(len) GlobalAlloc(GMEM_FIXED, len)
58 # define SHIORI_FREE(ptr) GlobalFree((HGLOBAL)ptr)
59 # endif
60 #else
61 // Other Platform
62 # ifdef __cplusplus
63 # define SHIORI_EXPORT extern "C"
64 # else
65 # define SHIORI_EXPORT extern
66 # endif
67 # define SHIORI_CALL
68 # define MEMORY_HANDLE char *
69 # define SHIORI_MALLOC(len) malloc(len)
70 # define SHIORI_FREE(ptr) free((void *)ptr)
71 #endif
72 #ifndef BOOL
73 # define BOOL int
74 # define TRUE 1
75 # define FALSE 0
76 #endif
77 //---------------------------------------------------------------------------
86 SHIORI_EXPORT BOOL SHIORI_CALL load(const MEMORY_HANDLE h,long len);
87 //---------------------------------------------------------------------------
93 SHIORI_EXPORT BOOL SHIORI_CALL unload(void);
94 //---------------------------------------------------------------------------
104 SHIORI_EXPORT MEMORY_HANDLE SHIORI_CALL request(const MEMORY_HANDLE h,long *len);
105 //---------------------------------------------------------------------------
106 #endif // SHIORI_H__
107 //---------------------------------------------------------------------------
SHIORI_EXPORT BOOL SHIORI_CALL unload(void)
モジュール切り離し直前に呼ばれる
Definition: shiori.c:71
SHIORI_EXPORT BOOL SHIORI_CALL load(const MEMORY_HANDLE h, long len)
モジュール読み込み直後に呼ばれる
Definition: shiori.c:16
SHIORI_EXPORT MEMORY_HANDLE SHIORI_CALL request(const MEMORY_HANDLE h, long *len)
偽AIリクエスト
Definition: shiori.c:25