|
Abstract The translator is filters all script. All scripts are always filtered by the translator. At this time, the translator is permitted to alter given scripts, with returning a different script from that of received. Or the translator can output the script to another one without converting them. The examples of major purposes of the translator are as follows.
home
+-ghost
+-misuzu
+-ghost
+-alias.txt
+-makoto.dll
MAKOTO/1.0 The body of the translator is a dynamic link library named "makoto.dll" which exports the "execute" function. All scripts are always spoken after through this function. You can freely design this DLL what is to do. If it returns the script without converting, it is the translator that "does nothing". extern "C" __declspec(dllexport) HGLOBAL __cdecl execute(HGLOBAL h, long *len); function execute(h: thandle; var len: longint): thandle; export; cdecl;The first argument is the global memory handle, and the second argument is the length of the data. The data is sent by "GMEM_FIXED". The translator DLL must get the strings from this entry, and if it need to process the strings, it must release the memory handle, after that, change the data to the suitable form, and set the correct length of the string into "len" parameter, finally return the new value by renewed "GMEM_FIXED". If the translator DLL doesn't process the strings, it is allowed to return the given handle as it is. The following functions are called when the translator DLL is loaded or unloaded. extern "C" __declspec(dllexport) BOOL __cdecl load(HGLOBAL h, long len); function load(h: thandle; len: longint): boolean; export; cdecl; extern "C" __declspec(dllexport) BOOL __cdecl unload(); function unload: boolean; export; cdecl;The first argument of function "load" is the directory path to the translator DLL. If it has its own data, you must get the current directory path from the first argument, and make data files, if necessary. (You must put whole files for translator DLL into its own directory.) And you must be cautious with that you must release the handle if the directory path is not necessary. The return value is boolean, but embryo does not currently refer this value.(Embryo keeps processing whatever values returned.) You must export all functions if you implement these bodies of functions or not. If they are omitted, Embryo will hang up. alias name
home
+-ghost
+-naru
+-ghost
+-master
+-alias.txt
+-makop-.dll
If alias name specified, you can use any name for dll file name.alias.txt format is follows: makoto,makop-.dllFor example, embryo uses "makop-.dll" instead of "makoto.dll". Entry can be omitted. If entry is omitted, embryo uses default(makoto.dll). nest
home
+-ghost
+-naru
+-ghost
+-master
+-alias.txt
+-makop-.dll
+-makop-2.dll
If alias name defines two or more file definition, you can be filtered script by two or more makoto.dll.If you uses nest, "alias.txt" is described as follows: makoto,[makop-.dll,makop-2.dll]For example, Script sequentially passes "makop-.dll" and "makop-2.dll". And, filal result is returned. |