当前位置: 首页>>代码示例>>C++>>正文


C++ xmlrpc_parse_value函数代码示例

本文整理汇总了C++中xmlrpc_parse_value函数的典型用法代码示例。如果您正苦于以下问题:C++ xmlrpc_parse_value函数的具体用法?C++ xmlrpc_parse_value怎么用?C++ xmlrpc_parse_value使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了xmlrpc_parse_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: StartSendingVideo

xmlrpc_value* StartSendingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	MCU *mcu = (MCU *)user_data;
	MultiConf *conf = NULL;

	 //Parseamos
	int confId;
	int partId;
	char *sendVideoIp;
	int sendVideoPort;
	xmlrpc_value *rtpMap;
	xmlrpc_parse_value(env, param_array, "(iisiS)", &confId,&partId,&sendVideoIp,&sendVideoPort,&rtpMap);

	//Get the rtp map
	VideoCodec::RTPMap map;

	//Get map size
	int j = xmlrpc_struct_size(env,rtpMap);

	//Parse rtp map
	for (int i=0;i<j;i++)
	{
		xmlrpc_value *key, *val;
		const char *type;
		int codec;
		//Read member
		xmlrpc_struct_read_member(env,rtpMap,i,&key,&val);
		//Read name
		xmlrpc_parse_value(env,key,"s",&type);
		//Read value
		xmlrpc_parse_value(env,val,"i",&codec);
		//Add to map
		map[atoi(type)] = (VideoCodec::Type) codec;
		//Decrement ref counter
		xmlrpc_DECREF(key);
		xmlrpc_DECREF(val);
	}

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		xmlerror(env,"Fault occurred\n");

	//Obtenemos la referencia
	if(!mcu->GetConferenceRef(confId,&conf))
		return xmlerror(env,"Conference does not exist");

	//La borramos
	int res = conf->StartSendingVideo(partId,sendVideoIp,sendVideoPort,map) != NULL;

	//Liberamos la referencia
	mcu->ReleaseConferenceRef(confId);

	//Salimos
	if(!res)
		return xmlerror(env,"Error\n");

	//Devolvemos el resultado
	return xmlok(env);
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:59,代码来源:xmlrpcmcu.cpp

示例2: MediaGatewayStartSendingText

xmlrpc_value* MediaGatewayStartSendingText(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	MediaGateway *mediaGateway = (MediaGateway *)user_data;
	MediaBridgeSession *session = NULL;

	 //Parseamos
	int sessionId;
	char *sendTextIp;
	int sendTextPort;
	xmlrpc_value *rtpMap;
	xmlrpc_parse_value(env, param_array, "(isiS)", &sessionId,&sendTextIp,&sendTextPort,&rtpMap);

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		return 0;

	//Get the rtp map
	TextCodec::RTPMap map;

	//Get map size
	int j = xmlrpc_struct_size(env,rtpMap);

	//Parse rtp map
	for (int i=0;i<j;i++)
	{
		xmlrpc_value *key, *val;
		const char *type;
		int codec;
		//Read member
		xmlrpc_struct_read_member(env,rtpMap,i,&key,&val);
		//Read name
		xmlrpc_parse_value(env,key,"s",&type);
		//Read value
		xmlrpc_parse_value(env,val,"i",&codec);
		//Add to map
		map[atoi(type)] = (TextCodec::Type) codec;
		//Decrement ref counter
		xmlrpc_DECREF(key);
		xmlrpc_DECREF(val);
	}

	//Obtenemos la referencia
	if(!mediaGateway->GetMediaBridgeRef(sessionId,&session))
		return xmlerror(env,"La sessionerencia no existe\n");

	//La borramos
	int res = session->StartSendingText(sendTextIp,sendTextPort,map);

	//Liberamos la referencia
	mediaGateway->ReleaseMediaBridgeRef(sessionId);

	//Salimos
	if(!res)
		return xmlerror(env,"Error\n");

	//Devolvemos el resultado
	return xmlok(env);
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:58,代码来源:xmlrpcmediagateway.cpp

示例3: StartReceivingText

xmlrpc_value* StartReceivingText(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	MCU *mcu = (MCU *)user_data;
	MultiConf *conf = NULL;

	 //Parseamos
	int confId;
	int partId;
	xmlrpc_value *rtpMap;
	xmlrpc_parse_value(env, param_array, "(iiS)", &confId,&partId,&rtpMap);

	//Get the rtp map
	TextCodec::RTPMap map;

	int j = xmlrpc_struct_size(env,rtpMap);

	//Parse rtp map
	for (int i=0;i<j;i++)
	{
		xmlrpc_value *key, *val;
		const char *type;
		int codec;
		//Read member
		xmlrpc_struct_read_member(env,rtpMap,i,&key,&val);
		//Read name
		xmlrpc_parse_value(env,key,"s",&type);
		//Read value
		xmlrpc_parse_value(env,val,"i",&codec);
		//Add to map
		map[atoi(type)] = (TextCodec::Type) codec;
		//Decrement ref counter
		xmlrpc_DECREF(key);
		xmlrpc_DECREF(val);
	}

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		xmlerror(env,"Fault occurred\n");

	//Obtenemos la referencia
	if(!mcu->GetConferenceRef(confId,&conf))
		return xmlerror(env,"Conference does not exist");

	//La borramos
	int recTextPort = conf->StartReceivingText(partId,map);

	//Liberamos la referencia
	mcu->ReleaseConferenceRef(confId);

	//Salimos
	if(!recTextPort)
		return xmlerror(env,"No se ha podido terminar la conferencia\n");

	//Devolvemos el resultado
	return xmlok(env,xmlrpc_build_value(env,"(i)",recTextPort,recTextPort));
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:56,代码来源:xmlrpcmcu.cpp

示例4: CreateConference

//CreateConference
xmlrpc_value* CreateConference(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	MCU *mcu = (MCU *)user_data;
	MultiConf *conf = NULL;
	UTF8Parser tagParser;
	 //Parseamos
	char *str;
	int queueId = 0;
	xmlrpc_parse_value(env, param_array, "(si)", &str, &queueId);

	//Comprobamos si ha habido error
	if(env->fault_occurred)
	{
		//Try with old parameters
		xmlrpc_parse_value(env, param_array, "(s)", &str);

		//Comprobamos si ha habido error
		if(env->fault_occurred)
			//Send errro
			xmlerror(env,"Fault occurred\n");
	}

	//Parse string
	tagParser.Parse((BYTE*)str,strlen(str));

	//Creamos la conferencia
	int confId = mcu->CreateConference(tagParser.GetWString(),queueId);

	//Si error
	if (!confId>0)
		return xmlerror(env,"No se puede crear la conferencia");

	//Obtenemos la referencia
	if(!mcu->GetConferenceRef(confId,&conf))
		return xmlerror(env,"Conferencia borrada antes de poder iniciarse\n");

	//La iniciamos
	int res = conf->Init();

	//Liberamos la referencia
	mcu->ReleaseConferenceRef(confId);

	//Salimos
	if(!res)
		return xmlerror(env,"No se ha podido iniciar la conferencia\n");

	//Devolvemos el resultado
	return xmlok(env,xmlrpc_build_value(env,"(i)",confId));
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:50,代码来源:xmlrpcmcu.cpp

示例5: ubigraph_new_vertex

vertex_id_t ubigraph_new_vertex()
{
    xmlrpc_env env;
    char* const methodName = "ubigraph.new_vertex";
    xmlrpc_value * resultP;

    if (!xmlrpc_initialized)
        init_xmlrpc(0);

    xmlrpc_env_init(&env);
    /* Make the remote procedure call */
    resultP = xmlrpc_client_call(&env, ubigraph_url, methodName,
            "()");
    if (print_err_if_fault_occurred(&env))
        return UBIGRAPH_FAIL;

    xmlrpc_int32 status;
    xmlrpc_parse_value(&env, resultP, "i", &status);
    /* Dispose of our result value. */
    xmlrpc_DECREF(resultP);

    if (print_err_if_fault_occurred(&env))
        return UBIGRAPH_FAIL;

    return status;
}
开发者ID:4fingers,项目名称:opencog,代码行数:26,代码来源:client.c

示例6: SetCompositionType

xmlrpc_value* SetCompositionType(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	MCU *mcu = (MCU *)user_data;
	MultiConf *conf = NULL;

	 //Parseamos
	int confId;
	int mosaicId;
	int comp;
	int size;
	xmlrpc_parse_value(env, param_array, "(iiii)", &confId,&mosaicId,&comp,&size);

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		xmlerror(env,"Fault occurred\n");
	 
	//Obtenemos la referencia
	if(!mcu->GetConferenceRef(confId,&conf))
		return xmlerror(env,"Conference does not exist");

	//La borramos
	int res = conf->SetCompositionType(mosaicId,(Mosaic::Type)comp,size);

	//Liberamos la referencia
	mcu->ReleaseConferenceRef(confId);

	//Salimos
	if(!res)
		return xmlerror(env,"Error\n");

	//Devolvemos el resultado
	return xmlok(env);
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:33,代码来源:xmlrpcmcu.cpp

示例7: StopSendingAudio

xmlrpc_value* StopSendingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	MCU *mcu = (MCU *)user_data;
	MultiConf *conf = NULL;

	 //Parseamos
	int confId;
	int partId;
	xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId);

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		xmlerror(env,"Fault occurred\n");
	 
	//Obtenemos la referencia
	if(!mcu->GetConferenceRef(confId,&conf))
		return xmlerror(env,"Conference does not exist");

	//La borramos
	int res = conf->StopSendingAudio(partId);

	//Liberamos la referencia
	mcu->ReleaseConferenceRef(confId);

	//Salimos
	if(!res)
		return xmlerror(env,"No se ha podido terminar la conferencia\n");

	//Devolvemos el resultado
	return xmlok(env);
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:31,代码来源:xmlrpcmcu.cpp

示例8: AddConferenceToken

xmlrpc_value* AddConferenceToken(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	UTF8Parser parser;
	MCU *mcu = (MCU *)user_data;
	MultiConf *conf = NULL;

	 //Parseamos
	int confId;
	char *str;
	xmlrpc_parse_value(env, param_array, "(is)", &confId, &str);

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		xmlerror(env,"Fault occurred\n");

	//Parse string
	parser.Parse((BYTE*)str,strlen(str));

	//Obtenemos la referencia
	if(!mcu->GetConferenceRef(confId,&conf))
		return xmlerror(env,"Conference does not exist");

	//La borramos
	bool res  = conf->AddBroadcastToken(parser.GetWString());

	//Liberamos la referencia
	mcu->ReleaseConferenceRef(confId);

	//Salimos
	if(!res)
		return xmlerror(env,"Could not add pin to broadcast session\n");

	//Devolvemos el resultado
	return xmlok(env);
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:35,代码来源:xmlrpcmcu.cpp

示例9: ResetMosaicOverlay

xmlrpc_value* ResetMosaicOverlay(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	MCU *mcu = (MCU *)user_data;
	MultiConf *conf = NULL;

	 //Parseamos
	int confId;
	int mosaicId;
	xmlrpc_parse_value(env, param_array, "(ii)", &confId,&mosaicId);

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		xmlerror(env,"Fault occurred\n");

	//Obtenemos la referencia
	if(!mcu->GetConferenceRef(confId,&conf))
		return xmlerror(env,"Conference does not exist");

	//La borramos
	int res = conf->ResetMosaicOverlay(mosaicId);

	//Liberamos la referencia
	mcu->ReleaseConferenceRef(confId);

	//Salimos
	if(!res)
		return xmlerror(env,"Could reset overlay image\n");

	//Devolvemos el resultado
	return xmlok(env,xmlrpc_build_value(env,"(i)",mosaicId));
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:31,代码来源:xmlrpcmcu.cpp

示例10: service_remove

static xmlrpc_value *
service_remove (xmlrpc_env   *env,
                xmlrpc_value *param_array,
                void         *user_data)
{
    char *service_identifier;
    RCWorldService *service;

    xmlrpc_parse_value (env, param_array, "(s)", &service_identifier);
    XMLRPC_FAIL_IF_FAULT (env);

    service = service_lookup (service_identifier);

    if (!service) {
        xmlrpc_env_set_fault_formatted (env, RCD_RPC_FAULT_INVALID_SERVICE,
                                        "Unable to unmount service for '%s'",
                                        service_identifier);
        goto cleanup;
    }

    rc_world_multi_remove_subworld (RC_WORLD_MULTI (rc_get_world ()),
                                    RC_WORLD (service));

    rcd_services_save ();

cleanup:
    if (env->fault_occurred)
        return NULL;

    return xmlrpc_build_value (env, "i", 0);
}
开发者ID:joeshaw,项目名称:rcd,代码行数:31,代码来源:rcd-rpc-service.c

示例11: service_add

static xmlrpc_value *
service_add (xmlrpc_env   *env,
             xmlrpc_value *param_array,
             void         *user_data)
{
    char *service_url, *mangled_url;
    GError *err = NULL;

    xmlrpc_parse_value (env, param_array, "(s)", &service_url);
    XMLRPC_FAIL_IF_FAULT (env);

    /* We always want to download data from the site */
    mangled_url = g_strconcat (service_url, "?remote_only=1", NULL);

    if (!rc_world_multi_mount_service (RC_WORLD_MULTI (rc_get_world ()),
                                       mangled_url, &err)) {
        xmlrpc_env_set_fault_formatted (env, RCD_RPC_FAULT_INVALID_SERVICE,
                                        "Unable to mount service for '%s': %s",
                                        service_url, err->message);
    } else
        rcd_services_save ();

    g_free (mangled_url);

cleanup:
    if (env->fault_occurred)
        return NULL;

    return xmlrpc_build_value (env, "i", 0);
}
开发者ID:joeshaw,项目名称:rcd,代码行数:30,代码来源:rcd-rpc-service.c

示例12: you_abort_download

static xmlrpc_value *
you_abort_download (xmlrpc_env   *env,
                    xmlrpc_value *param_array,
                    void         *user_data)
{
    int download_id;
    RCDRPCMethodData *method_data;
    int success;
    xmlrpc_value *result = NULL;

    xmlrpc_parse_value (env, param_array, "(i)", &download_id);

    if (!rc_you_transaction_is_valid (download_id)) {
        xmlrpc_env_set_fault (env, RCD_RPC_FAULT_INVALID_TRANSACTION_ID,
                              "Cannot find transaction for that id");
        return NULL;
    }

    method_data = rcd_rpc_get_method_data ();

    success = rc_you_transaction_abort (download_id, method_data->identity);

    if (success < 0) {
        xmlrpc_env_set_fault (env, RCD_RPC_FAULT_PERMISSION_DENIED,
                              "Permission denied");
        return NULL;
    }

    result = xmlrpc_build_value (env, "i", success);

    return result;
}
开发者ID:joeshaw,项目名称:rcd,代码行数:32,代码来源:you.c

示例13: MediaGatewaySetMediaBridgeOutputToken

xmlrpc_value* MediaGatewaySetMediaBridgeOutputToken(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	UTF8Parser parser;
	MediaGateway *mediaGateway = (MediaGateway *)user_data;

	//Parseamos
	int sessionId;
	char *str;
	xmlrpc_parse_value(env, param_array, "(is)", &sessionId, &str);

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		return 0;

	//Parse string
	parser.Parse((BYTE*)str,strlen(str));

	//La borramos
	bool res = mediaGateway->SetMediaBridgeOutputToken(sessionId,parser.GetWString());

	//Salimos
	if(!res)
		return xmlerror(env,"Could not set output token to bridge session\n");

	//Devolvemos el resultado
	return xmlok(env);
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:27,代码来源:xmlrpcmediagateway.cpp

示例14: MediaGatewaySendFPU

xmlrpc_value* MediaGatewaySendFPU(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data)
{
	MediaGateway *mediaGateway = (MediaGateway *)user_data;
	MediaBridgeSession *session = NULL;

	 //Parseamos
	int sessionId;
	xmlrpc_parse_value(env, param_array, "(i)", &sessionId);

	//Comprobamos si ha habido error
	if(env->fault_occurred)
		return 0;

	//Obtenemos la referencia
	if(!mediaGateway->GetMediaBridgeRef(sessionId,&session))
		return xmlerror(env,"La sessionerencia no existe\n");

	//La borramos
	int res = session->SendFPU();

	//Liberamos la referencia
	mediaGateway->ReleaseMediaBridgeRef(sessionId);

	//Salimos
	if(!res)
		return xmlerror(env,"Error\n");

	//Devolvemos el resultado
	return xmlok(env);
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:30,代码来源:xmlrpcmediagateway.cpp

示例15: xmlrpc_parse_value

xmlrpc_value *tcos_lockscreen(xmlrpc_env *env, xmlrpc_value *in, void *ud)
#endif
 {
  char *user;
  char *pass;
  char *login_ok;

  /* Parse app string */
  xmlrpc_parse_value(env, in, "(ss)", &user, &pass);
  if (env->fault_occurred)
    return xmlrpc_build_value(env, "s", "params error");

  /* need login first */
  login_ok=validate_login(user,pass);
  if( strcmp(login_ok,  LOGIN_OK ) != 0 )
    return xmlrpc_build_value(env, "s", login_ok );

  if ( strcmp(TCOS_PATH, "/sbin" ) )
    job_exe(TCOS_PATH"/lockscreen");

  else
    job_exe("lockscreen");

  return xmlrpc_build_value(env, "s", "OK" );
}
开发者ID:mariodebian,项目名称:tcos,代码行数:25,代码来源:lockscreen.c


注:本文中的xmlrpc_parse_value函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。