本文整理汇总了C++中soap_strdup函数的典型用法代码示例。如果您正苦于以下问题:C++ soap_strdup函数的具体用法?C++ soap_strdup怎么用?C++ soap_strdup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了soap_strdup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ns__poller_data_read_queue
int
ns__poller_data_read_queue(soap* soap, int sessionID, int count, struct RadarDataInfoArray* result)
{
DarxendClient* client = client_manager_get_client(sessionID);
if (!client)
return die_bad_client(soap);
RadarDataInfo* infos = darxend_client_read_queue(client, count);
if (infos)
{
result->__size = count;
result->array = (RadarDataInfo*)soap_malloc(soap, sizeof(RadarDataInfo) * count);
int i;
for (i = 0; i < count; i++)
{
result->array[i] = infos[i];
result->array[i].site = soap_strdup(soap, result->array[i].site);
result->array[i].product = soap_strdup(soap, result->array[i].product);
free(infos[i].site);
free(infos[i].product);
}
free(infos);
}
else
{
result->__size = -1;
}
return SOAP_OK;
}
示例2: bes_InvalidActivityFaultDOM
struct soap_dom_element*
bes_InvalidActivityFaultDOM(struct soap *s,
const char *faultstring, const char *message)
{
struct soap_dom_element *fault, *besdetail, *messageElt;
fault = createBESFaultElement(s, "InvalidActivityIdentifierFault", faultstring, &besdetail);
if (fault == NULL) {
return NULL;
}
messageElt = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element));
if (messageElt == NULL) {
return NULL;
}
memset(messageElt, 0, sizeof(struct soap_dom_element));
messageElt->name = soap_strdup(s, "Message");
messageElt->nstr = soap_strdup(s, BES_NS);
messageElt->data = soap_strdup(s, message);
messageElt->prnt = besdetail;
messageElt->soap = s;
besdetail->elts = messageElt;
return fault;
}
示例3: soap_default_xsd__anyType
soap_dom_element::soap_dom_element(struct soap *soap, const char *nstr, const char *name, void *node, int type)
{ soap_default_xsd__anyType(soap, this);
this->nstr = soap_strdup(soap, nstr);
this->name = soap_strdup(soap, name);
this->node = node;
this->type = type;
}
示例4: allocate_fault
static struct SOAP_ENV__Fault*
allocate_fault(struct soap *s,
const char *faultcode, const char *faultstring)
{
struct SOAP_ENV__Fault *fault;
/* require a faultcode */
if (faultcode == NULL) {
return NULL;
}
fault = (struct SOAP_ENV__Fault*)soap_malloc(s,
sizeof(struct SOAP_ENV__Fault));
if (fault == NULL) {
return NULL;
}
soap_default_SOAP_ENV__Fault(s, fault);
fault->faultcode = soap_strdup(s, faultcode);
if (faultstring) {
fault->faultstring = soap_strdup(s, faultstring);
}
fault->detail = (struct SOAP_ENV__Detail*)soap_malloc(s,
sizeof(struct SOAP_ENV__Detail));
if (fault->detail) {
soap_default_SOAP_ENV__Detail(s, fault->detail);
}
return fault;
}
示例5: http_da_session_start
static void http_da_session_start(const char *realm, const char *nonce, const char *opaque)
{
struct http_da_session *session;
time_t now = time(NULL);
if (now % 10 == 0) /* don't do this all the time to improve efficiency */
http_da_session_cleanup();
#ifdef SOAP_DEBUG
fprintf(stderr, "Starting session realm=%s nonce=%s\n", realm, nonce);
#endif
MUTEX_LOCK(http_da_session_lock);
session = (struct http_da_session*)malloc(sizeof(struct http_da_session));
if (session)
{
session->next = http_da_session;
session->modified = now;
session->realm = soap_strdup(NULL, realm);
session->nonce = soap_strdup(NULL, nonce);
session->opaque = soap_strdup(NULL, opaque);
session->nc = 0;
http_da_session = session;
}
MUTEX_UNLOCK(http_da_session_lock);
}
示例6: soap_strdup
soap_dom_attribute::soap_dom_attribute(struct soap *soap, const char *nstr, const char *name, const char *data)
{ this->soap = soap;
this->next = NULL;
this->nstr = soap_strdup(soap, nstr);
this->name = soap_strdup(soap, name);
this->data = soap_strdup(soap, data);
this->wide = NULL;
}
示例7: ONVIF_FAULT
GMI_RESULT ONVIF_FAULT(struct soap *soap_ptr, const char *Object, const char *Value1, const char *Value2, const char *Reason)
{
//fault code
soap_ptr->fault = (struct SOAP_ENV__Fault*)soap_malloc_zero(soap_ptr, (sizeof(struct SOAP_ENV__Fault)));
soap_ptr->fault->SOAP_ENV__Code = (struct SOAP_ENV__Code*)soap_malloc_zero(soap_ptr, (sizeof(struct SOAP_ENV__Code)));
if (NULL == soap_ptr->fault->SOAP_ENV__Code)
{
return GMI_OUT_OF_MEMORY;
}
soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Value = soap_strdup(soap_ptr, Object);
//fault subcode
soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode = (struct SOAP_ENV__Code*)soap_malloc_zero(soap_ptr, (sizeof(struct SOAP_ENV__Code)));
if (NULL == soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode)
{
return GMI_OUT_OF_MEMORY;
}
soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value = soap_strdup(soap_ptr, Value1);
//fault subcode subcode
if (NULL != Value2)
{
soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode = (struct SOAP_ENV__Code*)soap_malloc_zero(soap_ptr, (sizeof(struct SOAP_ENV__Code)));
if (NULL == soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode)
{
return GMI_OUT_OF_MEMORY;
}
soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode->SOAP_ENV__Value = soap_strdup(soap_ptr, Value2);
soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode->SOAP_ENV__Subcode = NULL;
}
else
{
soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode = NULL;
}
soap_ptr->fault->faultcode = NULL;
soap_ptr->fault->faultstring = NULL;
soap_ptr->fault->faultactor = NULL;
soap_ptr->fault->detail = NULL;
//fault reason
if (NULL != Reason)
{
soap_ptr->fault->SOAP_ENV__Reason = (struct SOAP_ENV__Reason *)soap_malloc_zero(soap_ptr, sizeof(struct SOAP_ENV__Reason));
if (NULL == soap_ptr->fault->SOAP_ENV__Reason)
{
return GMI_OUT_OF_MEMORY;
}
soap_ptr->fault->SOAP_ENV__Reason->SOAP_ENV__Text = soap_strdup(soap_ptr, Reason);
}
else
{
soap_ptr->fault->SOAP_ENV__Reason = NULL;
}
soap_ptr->fault->SOAP_ENV__Node = NULL;
soap_ptr->fault->SOAP_ENV__Role = NULL;
soap_ptr->fault->SOAP_ENV__Detail = NULL;
return GMI_SUCCESS;
}
示例8: DBG
static void *dime_write_open(struct soap *soap, const char *id, const char *type, const char *options)
{
DBG("\n");
// we can return NULL without setting soap->error if we don't want to use the streaming callback for this DIME attachment
struct dime_write_handle *handle = (struct dime_write_handle*)soap_malloc(soap, sizeof(struct dime_write_handle));
if (!handle)
{
soap->error = SOAP_EOM;
return NULL;
}
#if 0
char *name = tempnam(TMPDIR, "data");
fprintf(stderr, "Saving file %s\n", name);
handle->name = soap_strdup(soap, name);
free(name);
#else
time_t t = time(NULL);
struct tm tm = *localtime(&t);
char name[64];
memset(name, '\0', sizeof(name));
switch(bkev){
case EVENT_SET_FILENAME_CONFIG:
sprintf(name, "configuration-%d-%d-%d-%d-%d-%d.conf",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
break;
case EVENT_SET_FILENAME_FIRMWARE:
sprintf(name, "firmware-%d-%d-%d-%d-%d-%d.ctfw",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
break;
default:
sprintf(name, "%d-%d-%d-%d-%d-%d",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
break;
}
DBG("tmpname: %s\n", name);
handle->name = soap_strdup(soap, name);
#endif
handle->fd = fopen(handle->name, "wb");
if (!handle->fd)
{
soap->error = SOAP_EOF; // could not open file for writing
soap->errnum = errno; // get reason
return NULL;
}
return (void*)handle;
}
示例9: soap_wsse_add_Security_actor
/**
@fn _wsse__Security* soap_wsse_add_Security_actor(struct soap *soap, const char *actor)
@brief Adds Security header element with actor or role attribute.
@param soap context
@param actor string
@return _wsse__Security object
*/
struct _wsse__Security*
soap_wsse_add_Security_actor(struct soap *soap, const char *actor)
{ _wsse__Security *security = soap_wsse_add_Security(soap);
DBGFUN1("soap_wsse_add_Security_actor", "actor=%s", actor);
if (soap->namespaces && !strcmp(soap->namespaces[0].ns, "http://schemas.xmlsoap.org/soap/envelope/"))
security->SOAP_ENV__actor = soap_strdup(soap, actor);
else
security->SOAP_ENV__role = soap_strdup(soap, actor);
return security;
}
示例10: my_soap_copy_fault
static int my_soap_copy_fault(struct soap *soap, const char *faultcode,
const char *faultsubcodeQName, const char *faultstring,
const char *faultdetailXML) {
char *r = NULL, *s = NULL, *t = NULL;
if (faultsubcodeQName)
r = soap_strdup(soap, faultsubcodeQName);
if (faultstring)
s = soap_strdup(soap, faultstring);
if (faultdetailXML)
t = soap_strdup(soap, faultdetailXML);
return my_soap_set_error(soap, faultcode, r, s, t, SOAP_FAULT);
}
示例11: soap_strdup
soap_dom_element::soap_dom_element(struct soap *soap, const char *nstr, const char *name, const char *data)
{ this->soap = soap;
this->next = NULL;
this->prnt = NULL;
this->nstr = soap_strdup(soap, nstr);
this->name = soap_strdup(soap, name);
this->data = soap_strdup(soap, data);
this->wide = NULL;
this->atts = NULL;
this->elts = NULL;
this->node = NULL;
this->type = 0;
}
示例12: jp2s_error
static struct jptype__genericFault* jp2s_error(struct soap *soap, const glite_jp_error_t *err)
{
struct jptype__genericFault *ret = NULL;
if (err) {
ret = soap_malloc(soap,sizeof *ret);
memset(ret,0,sizeof *ret);
ret->code = err->code;
ret->source = soap_strdup(soap,err->source);
ret->text = soap_strdup(soap,strerror(err->code));
ret->description = err->desc ? soap_strdup(soap,err->desc) : NULL;
ret->reason = jp2s_error(soap,err->reason);
}
return ret;
}
示例13: createBESFaultElement
static struct soap_dom_element*
createBESFaultElement(struct soap *s,
const char *bescode, const char *faultstring,
struct soap_dom_element **besdetailpp)
{
struct soap_dom_element *fault, *faultcode, *faultstr;
struct soap_dom_element *detail, *besdetail;
if (!s || !bescode || !faultstring || !besdetailpp) {
return NULL;
}
fault = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element));
faultcode = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element));
faultstr = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element));
detail = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element));
besdetail = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element));
if (!fault || !faultcode || !faultstr || !detail || !besdetail) {
return NULL;
}
memset(fault, 0, sizeof(struct soap_dom_element));
memset(faultcode, 0, sizeof(struct soap_dom_element));
memset(faultstr, 0, sizeof(struct soap_dom_element));
memset(detail, 0, sizeof(struct soap_dom_element));
memset(besdetail, 0, sizeof(struct soap_dom_element));
faultcode->name = soap_strdup(s, "faultcode");
faultcode->data = (char*)soap_malloc(s, strlen("bes:") + strlen(bescode) + 1);
sprintf(faultcode->data, "bes:%s", bescode);
faultcode->prnt = fault;
faultcode->next = faultstr;
faultcode->soap = s;
faultstr->name = soap_strdup(s, "faultstring");
faultstr->data = soap_strdup(s, faultstring);
faultstr->prnt = fault;
faultstr->next = detail;
faultstr->soap = s;
detail->name = soap_strdup(s, "detail");
detail->elts = besdetail;
detail->prnt = fault;
detail->soap = s;
besdetail->name = soap_strdup(s, bescode);
besdetail->nstr = soap_strdup(s, BES_NS);
besdetail->prnt = detail;
besdetail->soap = s;
fault->nstr = soap_strdup(s, BES_NS);
fault->name = soap_strdup(s, "Fault");
fault->elts = faultcode;
fault->soap = s;
*besdetailpp = besdetail;
return fault;
}
示例14: ns1__executeCommand
/*
Code used for generating stubs:
int ns1__executeCommand(char* command, char** result);
*/
int ns1__executeCommand(soap* soap, char* command, char** result)
{
// security check
if (!soap->userid || !soap->passwd)
{
DEBUG_LOG("MaNGOSsoap: Client didn't provide login information");
return 401;
}
uint32 accountId = sAccountMgr.GetId(soap->userid);
if(!accountId)
{
DEBUG_LOG("MaNGOSsoap: Client used invalid username '%s'", soap->userid);
return 401;
}
if(!sAccountMgr.CheckPassword(accountId, soap->passwd))
{
DEBUG_LOG("MaNGOSsoap: invalid password for account '%s'", soap->userid);
return 401;
}
if(sAccountMgr.GetSecurity(accountId) < SECURITY_ADMINISTRATOR)
{
DEBUG_LOG("MaNGOSsoap: %s's gmlevel is too low", soap->userid);
return 403;
}
if(!command || !*command)
return soap_sender_fault(soap, "Command mustn't be empty", "The supplied command was an empty string");
DEBUG_LOG("MaNGOSsoap: got command '%s'", command);
SOAPCommand connection;
// commands are executed in the world thread. We have to wait for them to be completed
{
// CliCommandHolder will be deleted from world, accessing after queueing is NOT save
CliCommandHolder* cmd = new CliCommandHolder(accountId, SECURITY_CONSOLE, &connection, command, &SOAPCommand::print, &SOAPCommand::commandFinished);
sWorld.QueueCliCommand(cmd);
}
// wait for callback to complete command
int acc = connection.pendingCommands.acquire();
if(acc)
{
sLog.outError("MaNGOSsoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno);
}
// alright, command finished
char* printBuffer = soap_strdup(soap, connection.m_printBuffer.c_str());
if(connection.hasCommandSucceeded())
{
*result = printBuffer;
return SOAP_OK;
}
else
return soap_sender_fault(soap, printBuffer, printBuffer);
}
示例15: bes_UnsupportedFault
struct SOAP_ENV__Fault*
bes_UnsupportedFault(struct soap* s,
const char *faultstring, const char *element)
{
struct SOAP_ENV__Fault *fault;
fault = allocate_fault(s, BES_FAULT_UNSUPPORTED, faultstring);
if (fault == NULL) {
return NULL;
}
if (fault->detail) {
fault->detail->bes__UnsupportedFeatureFault
= (struct bes__UnsupportedFeatureFaultType*)soap_malloc(s,
sizeof(struct bes__UnsupportedFeatureFaultType));
if (fault->detail->bes__UnsupportedFeatureFault) {
memset(fault->detail->bes__UnsupportedFeatureFault, 0,
sizeof(struct bes__UnsupportedFeatureFaultType));
}
fault->detail->bes__UnsupportedFeatureFault->Feature = (char**)soap_malloc(s, sizeof(char*));
if (!fault->detail->bes__UnsupportedFeatureFault->Feature) {
return NULL;
}
*fault->detail->bes__UnsupportedFeatureFault->Feature = soap_strdup(s,
element?element:"");
if (!*fault->detail->bes__UnsupportedFeatureFault->Feature) {
return NULL;
}
fault->detail->bes__UnsupportedFeatureFault->__sizeFeature = 1;
}
return fault;
}