12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /*##############################################################################
- Copyright (C) 2011 HPCC Systems.
- All rights reserved. This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- ############################################################################## */
- #include <time.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #include "examplelib.hpp"
- #define EXAMPLELIB_VERSION "EXAMPLELIB 1.0.00"
- const char * HoleDefinition = NULL;
- const char * EclDefinition =
- "export ExampleLib := SERVICE\n"
- " string EchoString(const string src) : c, pure,entrypoint='elEchoString'; \n"
- "END;";
- EXAMPLELIB_API bool getECLPluginDefinition(ECLPluginDefinitionBlock *pb)
- {
- if (pb->size != sizeof(ECLPluginDefinitionBlock))
- return false;
- pb->magicVersion = PLUGIN_VERSION;
- pb->version = EXAMPLELIB_VERSION " $Revision: 62376 $";
- pb->moduleName = "lib_examplelib";
- pb->ECL = EclDefinition;
- pb->Hole = HoleDefinition;
- pb->flags = PLUGIN_IMPLICIT_MODULE;
- pb->description = "ExampleLib example services library";
- return true;
- }
- namespace nsExamplelib {
- IPluginContext * parentCtx = NULL;
- }
- using namespace nsExamplelib;
- EXAMPLELIB_API void setPluginContext(IPluginContext * _ctx) { parentCtx = _ctx; }
- //-------------------------------------------------------------------------------------------------------------------------------------------
- EXAMPLELIB_API void EXAMPLELIB_CALL elEchoString(unsigned & tgtLen, char * & tgt, unsigned srcLen, const char * src)
- {
- tgt = (char *)CTXMALLOC(parentCtx, srcLen);
- memcpy(tgt,src,srcLen);
- tgtLen = srcLen;
- }
|