//___FILEHEADER___ #import "rb_plugin.h" #import static REALstring CatString( REALstring str1, REALstring str2 ); REALmethodDefinition ___PACKAGENAMEASIDENTIFIER___Methods[] = { { (REALproc)CatString, REALnoImplementation, "CatString(str1 as string, str2 as string) as string", REALconsoleSafe | REALScopeGlobal }, }; REALmoduleDefinition ___PACKAGENAMEASIDENTIFIER___Definition = { kCurrentREALControlVersion, "___PACKAGENAMEASIDENTIFIER___", ___PACKAGENAMEASIDENTIFIER___Methods, sizeof( ___PACKAGENAMEASIDENTIFIER___Methods ) / sizeof( REALmethodDefinition ), nil, // ___PACKAGENAMEASIDENTIFIER___Constants, 0, // sizeof( ___PACKAGENAMEASIDENTIFIER___Constants ) / sizeof( REALconstant ), nil, // ___PACKAGENAMEASIDENTIFIER___Properties, 0, // sizeof( ___PACKAGENAMEASIDENTIFIER___Properties ) / sizeof( REALproperty ), }; static REALstring CatString( REALstring str1, REALstring str2 ) { REALstringData outData1, outData2; bool ret1 = REALGetStringData( str1, kREALTextEncodingUTF8, &outData1 ); bool ret2 = REALGetStringData( str2, kREALTextEncodingUTF8, &outData2 ); if ( !ret1 or !ret2 ) return REALBuildStringWithEncoding("", 1, kREALTextEncodingUTF8); const char* cstr1 = (const char*)outData1.data; const char* cstr2 = (const char*)outData2.data; std::string pstr = cstr1; pstr += " "; pstr += cstr2; const char* cstr3 = pstr.c_str(); return REALBuildStringWithEncoding(cstr3, (int)::strlen(cstr3), kREALTextEncodingUTF8); } void PluginEntry( void ) { REALRegisterModule( &___PACKAGENAMEASIDENTIFIER___Definition ); }