extern "C" void init(Planet &planet) { CLASS (OscMap, "Open udp ports and map calls from these ports.", "script: [mapping definitions] or file: [path to mapping file]") // {1} c->add_method<Script, &Script::file>("file", StringIO("path", "Set path to mappings definitions.")); // {2} c->add_method<Script, &Script::script>("script", StringIO("mappings", "Mappings definitions.")); // {3} c->add_method<Script, &Script::reload>("reload", RealIO("seconds", "How often shoudl we check file for relaod.")); c->add_method<OscMapCommand, &OscMapCommand::port>("number", RealIO("number", "Set incomming port number.")); c->add_inlet<OscMapCommand, &OscMapCommand::port>("number", RealIO("number", "Set incomming port number.")); c->add_method<OscMapCommand, &OscMapCommand::reply_port>("number", RealIO("number", "Set outgoing reply port number.")); c->add_inlet<OscMapCommand, &OscMapCommand::reply_port>("number", RealIO("number", "Set outgoing reply port number.")); }
void Planet::init() { set_context(&worker_); // build application methods // /.inspect adopt(new TMethod<Planet, &Planet::inspect>(this, Url(INSPECT_URL).name(), StringIO("url", "Returns some information on the state of a node."))); // /class classes_ = adopt(new ClassFinder(Url(CLASS_URL).name(), DEFAULT_OBJECTS_LIB_PATH)); // /rubyk Object *rubyk = adopt(new Object(Url(RUBYK_URL).name())); // /rubyk/link [[["","source url"],["", "target url"]], "Create a link between two urls."] rubyk->adopt(new TMethod<Planet, &Planet::link>(this, Url(LINK_URL).name(), JsonValue("[['','', ''],'url','op','url','Update a link between the two provided urls. Operations are '=>' (link) '||' (unlink) or '?' (pending).']"))); // /rubyk/quit rubyk->adopt(new TMethod<Planet, &Planet::quit>(this, Url(QUIT_URL).name(), NilIO("Stop all operations and quit."))); }
rpmpython python; if (_rpmpythonPool == NULL) { _rpmpythonPool = rpmioNewPool("python", sizeof(*python), -1, _rpmpython_debug, NULL, NULL, rpmpythonFini); pool = _rpmpythonPool; } return (rpmpython) rpmioGetPool(pool, sizeof(*python)); } /*@unchecked@*/ #if defined(WITH_PYTHONEMBED) static const char * rpmpythonInitStringIO = "\ import sys\n\ from cStringIO import StringIO\n\ sys.stdout = StringIO()\n\ import rpm\n\ "; #endif static rpmpython rpmpythonI(void) /*@globals _rpmpythonI @*/ /*@modifies _rpmpythonI @*/ { if (_rpmpythonI == NULL) _rpmpythonI = rpmpythonNew(NULL, 0); return _rpmpythonI; } rpmpython rpmpythonNew(char ** av, uint32_t flags) {