• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ MSG_ERROR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fwd_src_mapping_set

/**
 * \brief Set a mapping of private Template ID to shared Template ID
 * \param[in,out] src Flow source
 * \param[in] old_id Private Template ID
 * \param[in] new_id Shared Template ID
 */
static void fwd_src_mapping_set(fwd_source_t *src, uint16_t old_id,
	uint16_t new_id)
{
	// Set the mapping
	uint16_t *group = src->map[old_id / GROUP_SIZE];
	if (!group) {
		// Not found -> create a new group
		uint16_t **new_grp = &src->map[old_id / GROUP_SIZE];
		*new_grp = calloc(GROUP_SIZE, sizeof(*group));
		if (*new_grp == NULL) {
			MSG_ERROR(msg_module, "Memory allocation failed (%s:%d)",
				__FILE__, __LINE__);
			return;
		}

		group = *new_grp;
	}

	if (fwd_odid_template_increment(src->maintainer, new_id)) {
		MSG_ERROR(msg_module, "Unable to update a number of references to "
			"a template (ID: %" PRIu16 ").", new_id);
	}

	MSG_DEBUG(msg_module, "A new template mapping of a source with ODID "
		"%" PRIu32 " (private: %" PRIu16 " -> share: %" PRIu16 ").",
		src->odid, old_id, new_id);
	group[old_id % GROUP_SIZE] = new_id;
}
开发者ID:SecDorks-TorchSis,项目名称:ipfixcol,代码行数:34,代码来源:templates.c


示例2: calloc

/**
 * \brief Create a template record
 * \param[in] rec Binary template record
 * \param[in] length Length of the binary template record (octets)
 * \param[in] type Type of the template (#TM_TEMPLATE or #TM_OPTIONS_TEMPLATE)
 * \param[in] new_id New Template ID
 * \return Pointer or NULL
 */
static fwd_tmplt_t *fwd_tmplt_create(const struct ipfix_template_record *rec,
	size_t length, int type, uint16_t new_id)
{
	fwd_tmplt_t *res = calloc(1, sizeof(*res));
	if (!res) {
		MSG_ERROR(msg_module, "Memory allocation failed (%s:%d)",
			__FILE__, __LINE__);
		return NULL;
	}

	// Copy the template record
	res->rec = malloc(length);
	if (!res->rec) {
		MSG_ERROR(msg_module, "Memory allocation failed (%s:%d)",
			__FILE__, __LINE__);
		free(res);
		return NULL;
	}

	memcpy(res->rec, rec, length);
	res->rec->template_id = htons(new_id);

	res->length = length;
	res->id = new_id;
	res->ref_cnt = 0;
	res->type = type;

	return res;
}
开发者ID:SecDorks-TorchSis,项目名称:ipfixcol,代码行数:37,代码来源:templates.c


示例3: sql_query

int KULLANICILAR_FORMU::CHECK_UPDATE (int p_kullanici_id )
{
    SQL_QUERY sql_query ( G_YONETIM_DB );
    sql_query.PREPARE_SELECT ( "ynt_kullanicilar","kullanici_id","kullanici_kodu = :kullanici_kodu "
                               "AND silinmis_mi = :silinmis_mi ","" );

    sql_query.SET_VALUE      ( ":kullanici_kodu" , m_ui->lineEdit_kullanici_kodu->text() );
    sql_query.SET_VALUE      ( ":silinmis_mi"   ,0 );

    if ( sql_query.SELECT() > 0 ) {

        sql_query.NEXT();
        if ( sql_query.VALUE(0).toInt() NE p_kullanici_id ) {
            MSG_ERROR(tr ( "There are registered users in the system with this code." )  , NULL);//bu kodla kullanıcı sistemde mevcut
            return ADAK_FAIL;
        }
    }

    if ( m_ui->check_box_sifre->isChecked() EQ true ) {
        if ( m_ui->line_edit_yeni_sifre->text() NE m_ui->line_edit_yeni_sifre_tekrar->text() ) {
            MSG_ERROR("New and repeat passwords do not match,Please check.",m_ui->line_edit_yeni_sifre);//Girdiğiniz yeni şifre ve tekrarı uyuşmuyor Lütfen kontrol ediniz.
            return ADAK_FAIL;
        }
    }

    ADAK_MSG_ENUM answer = MSG_YES_NO_CANCEL( tr ( "Do you approve of the changes you made?" ) , NULL);//Yapılan değişiklikleri onaylıyor musunuz?
    if ( answer EQ ADAK_CANCEL OR answer EQ ADAK_NO  ) {
        return ADAK_FAIL;
    }
    return ADAK_OK;

}
开发者ID:adakteknoloji,项目名称:FRAMEWORK,代码行数:32,代码来源:kullanicilar_formu.cpp


示例4: ip_init

/**
 * \brief Initialize Intermediate Process.
 */
int ip_init(struct intermediate *conf, uint32_t ip_id)
{
	int ret;

	/* Initialize plugin */
	xmlChar *ip_params = NULL;
	xmlDocDumpMemory(conf->xml_conf->xmldata, &ip_params, NULL);
	
	conf->intermediate_init((char *) ip_params, conf, ip_id, template_mgr, &(conf->plugin_config));
	if (conf->plugin_config == NULL) {
		MSG_ERROR(msg_module, "Unable to initialize intermediate process");
		return -1;
	}

	free(ip_params);
	
	/* start main thread */
	ret = pthread_create(&(conf->thread_id), NULL, ip_loop, (void *)conf);
	if (ret != 0) {
		MSG_ERROR(msg_module, "Unable to create thread for intermediate process");
		return -1;
	}

	return 0;
}
开发者ID:ADTRAN,项目名称:ipfixcol,代码行数:28,代码来源:intermediate_process.c


示例5: secapi_oem_csprng_seed_get

/*===========================================================================
*
* FUNCTION: secapi_oem_csprng_seed_get ()
*
* DESCRIPTION:
*
*   See header file
*
===========================================================================*/
secerrno_enum_type secapi_oem_csprng_seed_get (uint8* seed_ptr, uint16 seed_len)
{
	
  secerrno_enum_type stat = E_NOT_AVAILABLE;
  uint8 *_seed_ptr = (uint8*)seed_ptr;
  if ((NULL == seed_ptr) || (0 == seed_len))
  {
    return E_INVALID_ARG;
  }
   

  stat = secutil_get_nv_item( NV_SEC_CSPRNG_INIT_SEED_I,
                              _seed_ptr,
                              seed_len );
  if( E_SUCCESS == stat )
  {
    MSG_MED("sec_oem_util: nv data for csprng! retrieved", 0, 0, 0);  
  }
  else if( stat == E_NO_DATA )
  {
    MSG_ERROR("sec_oem_util: no nv data for csprng!", 0, 0, 0);
  }
  else
  {
    MSG_ERROR("sec_oem_util: error reading nv data for csprng (%d)!", stat, 0, 0);
  }
  return stat;
}
开发者ID:bgtwoigu,项目名称:1110,代码行数:37,代码来源:sec_oem_utils.c


示例6: group_init

/**
 * \brief Initialize a group structure for channels or profiles
 *
 * \param[out] grp       Pointer to the group
 * \param[in]  items_cnt Number of items (can be re-sized in the future)
 * \return On success returns 0. Otherwise returns a non-zero value and the
 *   content of the structure is undefined.
 */
static int
group_init(struct pevents_group *grp, size_t items_cnt)
{
	if (items_cnt == 0) {
		return 1;
	}

	// Clear everything
	memset(grp, 0, sizeof(*grp));

	// Allocate an array of items
	grp->all_prealloc = items_cnt;
	grp->all_ptr = calloc(items_cnt, sizeof(*(grp->all_ptr)));
	if (!grp->all_ptr) {
		MSG_ERROR(msg_module, "Unable to allocate memory (%s:%d)",
			__FILE__, __LINE__);
		return 1;
	}

	// Prepare a bitset
	grp->bitset = bitset_create(items_cnt);
	if (!grp->bitset) {
		MSG_ERROR(msg_module, "Unable to allocate memory (%s:%d)",
			__FILE__, __LINE__);
		free(grp->all_ptr);
		return 1;
	}

	return 0;
}
开发者ID:ADTRAN,项目名称:ipfixcol,代码行数:38,代码来源:profile_events.c


示例7: fwd_odid_template_remove

/**
 * \brief Remove a template definition
 * \param[in,out] odid Observation Domain (ODID) maintainer
 * \param[in] id Template ID
 */
static void fwd_odid_template_remove(fwd_odid_t *odid, uint16_t id)
{
	fwd_tmplt_t **group = odid->tmplts[id / GROUP_SIZE];
	fwd_tmplt_t *rec = NULL;

	if (group) {
		rec = group[id % GROUP_SIZE];
	}

	if (!rec) {
		MSG_ERROR(msg_module, "Unable to find and delete a shared template "
			"record (ID %" PRIu16 ") from ODID %" PRIu32 ".", id, odid->odid);
		return;
	}

	MSG_DEBUG(msg_module, "A template (ID: %" PRIu16 ") removed from ODID "
		"%" PRIu32 ".", id, odid->odid);

	switch (rec->type) {
	case TM_TEMPLATE:
		odid->templates_normal--;
		break;
	case TM_OPTIONS_TEMPLATE:
		odid->templates_options--;
		break;
	default:
		MSG_ERROR(msg_module, "Internal error: Invalid type (%d) of a template "
			"(ODID: %" PRIu32 ", Template ID: %" PRIu16 ")", rec->type,
			odid->odid, rec->id);
		break;
	}

	fwd_tmplt_destroy(rec);
	group[id % GROUP_SIZE] = NULL;
}
开发者ID:SecDorks-TorchSis,项目名称:ipfixcol,代码行数:40,代码来源:templates.c


示例8: ic_init

/**
 * \brief Initiate internal configuration file - open, get xmlDoc and prepare
 * XPathContext. Also register namespace "urn:cesnet:params:xml:ns:yang:ipfixcol-internals"
 * with given namespace name.
 *
 * @param[in] ns_name Name for the "urn:cesnet:params:xml:ns:yang:ipfixcol-internals"
 * namespace in xpath queries.
 * @return XPath Context for the internal XML configuration. Caller will need to
 * free it including separated free of return->doc.
 */
static xmlXPathContextPtr ic_init(xmlChar* ns_name, char *internal_cfg)
{
	int fd;
	xmlDocPtr doc = NULL;
	xmlXPathContextPtr ctxt = NULL;

	/* open and prepare internal XML configuration file */
	if ((fd = open(internal_cfg, O_RDONLY)) == -1) {
		MSG_ERROR(msg_module, "Unable to open internal configuration file %s (%s)", internal_cfg, strerror(errno));
		return (NULL);
	}
	if ((doc = xmlReadFd(fd, NULL, NULL, XML_PARSE_NOERROR | XML_PARSE_NOWARNING | XML_PARSE_NOBLANKS)) == NULL) {
		MSG_ERROR(msg_module, "Unable to parse internal configuration file %s", internal_cfg);
		close(fd);
		return (NULL);
	}
	close(fd);

	/* create xpath evaluation context of internal configuration file */
	if ((ctxt = xmlXPathNewContext(doc)) == NULL) {
		MSG_ERROR(msg_module, "Unable to create XPath context for internal configuration (%s:%d)", __FILE__, __LINE__);
		xmlFreeDoc(doc);
		return (NULL);
	}
	/* register namespace for the context of internal configuration file */
	if (xmlXPathRegisterNs (ctxt, ns_name, BAD_CAST "urn:cesnet:params:xml:ns:yang:ipfixcol-internals") != 0) {
		MSG_ERROR(msg_module, "Unable to register namespace for internal configuration file (%s:%d)", __FILE__, __LINE__);
		xmlXPathFreeContext(ctxt);
		xmlFreeDoc(doc);
		return (NULL);
	}

	return (ctxt);
}
开发者ID:VisBlank,项目名称:ipfixcol,代码行数:44,代码来源:config.c


示例9: output_manager_start

/**
 * \brief Start Output Manager's thread(s)
 * 
 * @return 0 on success
 */
int output_manager_start()
{
	int retval;

	/* Create Output Manager thread */
	retval = pthread_create(&(conf->thread_id), NULL, &output_manager_plugin_thread, (void *) conf);
	if (retval != 0) {
		MSG_ERROR(msg_module, "Unable to create Output Manager thread");
		free(conf);
		return -1;
	}
	
	conf->running = 1;

	if (conf->stat_interval > 0) {
		retval = pthread_create(&(conf->stat_thread), NULL, &statistics_thread, (void *) conf);
		if (retval != 0) {
			MSG_ERROR(msg_module, "Unable to create statistics thread");
			free(conf);
			return -1;
		}
	}
	
	return 0;
}
开发者ID:rscampos,项目名称:ipfixcol,代码行数:30,代码来源:output_manager.c


示例10: storage_init

/**
 * \brief Storage plugin initialization.
 *
 * \param[in] params parameters for this storage plugin
 * \param[out] config the plugin specific configuration structure
 * \return 0 on success, negative value otherwise
 */
int storage_init(char *params, void **config)
{
	MSG_INFO(msg_module, "Dummy plugin: storage_init called");

	struct dummy_config *conf;
	xmlDocPtr doc;
	xmlNodePtr cur;

	/* allocate space for config structure */
	conf = (struct dummy_config *) malloc(sizeof(*conf));
	if (conf == NULL) {
		MSG_ERROR(msg_module, "Not enough memory (%s:%d)", __FILE__, __LINE__);
		return -1;
	}

	/* try to parse configuration file */
	doc = xmlReadMemory(params, strlen(params), "nobase.xml", NULL, 0);
	if (doc == NULL) {
		MSG_ERROR(msg_module, "Plugin configuration parsing failed");
		goto err_read_conf;
	}
	cur = xmlDocGetRootElement(doc);
	if (cur == NULL) {
		MSG_ERROR(msg_module, "Empty configuration");
		goto err_init;
	}
	if (xmlStrcmp(cur->name, (const xmlChar *) "fileWriter")) {
		MSG_ERROR(msg_module, "Root node != fileWriter");
		goto err_init;
	}
	
	/* default delay */
	conf->delay = 0;

	cur = cur->xmlChildrenNode;
	while (cur != NULL) {
		/* find out the desired delay */
		if ((!xmlStrcmp(cur->name, (const xmlChar *) "delay"))) {
			conf->delay = atoi((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
			break;
		}
		cur = cur->next;
	}

	MSG_INFO(msg_module, "Dummy plugin: delay set to %ius", conf->delay);

	/* we don't need this xml tree anymore */
	xmlFreeDoc(doc);

	/* pass config to core */
	*config = conf;

	return 0;
	
	err_init:
	xmlFreeDoc(doc);
	err_read_conf:
	free(conf);
	return -1;
}
开发者ID:VisBlank,项目名称:ipfixcol,代码行数:67,代码来源:dummy_output.c


示例11: fwd_src_withdraw_type

/**
 * \brief Remove all templates of a defined type from a Flow source
 * \param[in,out] src Flow source
 * \param[in] type Type of the templates (#TM_TEMPLATE or #TM_OPTIONS_TEMPLATE)
 */
static void fwd_src_withdraw_type(fwd_source_t *src, int type)
{
	const unsigned int min = IPFIX_MIN_RECORD_FLOWSET_ID;
	const unsigned int max = FWD_MAX_RECORD_FLOWSET_ID;

	if (type != TM_TEMPLATE && type != TM_OPTIONS_TEMPLATE) {
		MSG_ERROR(msg_module, "Trying to delete invalid type of templates.");
		return;
	}

	unsigned int private_id;
	for (private_id = min; private_id <= max; ++private_id) {
		// Get a mapping of the ID
		uint16_t shared_id = fwd_src_mapping_get(src, private_id);
		if (shared_id == 0) {
			continue;
		}

		// Check a type of a template
		const fwd_tmplt_t *tmplt;
		tmplt = fwd_odid_template_get(src->maintainer, shared_id);
		if (!tmplt) {
			MSG_ERROR(msg_module, "Unable to get a reference to a shared "
				"template (ID: %" PRIu16 ").", shared_id);
			continue;
		}

		if (tmplt->type != type) {
			continue;
		}

		fwd_src_mapping_remove(src, private_id);
	}
}
开发者ID:SecDorks-TorchSis,项目名称:ipfixcol,代码行数:39,代码来源:templates.c


示例12: load_types_from_xml

int load_types_from_xml(struct fastbit_config *conf) {
	pugi::xml_document doc;
	pugi::xml_parse_result result;
	uint32_t en;
	uint16_t id;
	enum store_type type;
	std::string str_value;

	result = doc.load_file("/etc/ipfixcol/ipfix-elements.xml");

	/* Check for errors */
	if (!result) {
		MSG_ERROR(MSG_MODULE, "/etc/ipfixcol/ipfix-elements.xml parsed with errors!");
		MSG_ERROR(MSG_MODULE, "Error description: %s", result.description());

		return -1;
	}

	pugi::xpath_node_set elements = doc.select_nodes("/ipfix-elements/element");
	for (pugi::xpath_node_set::const_iterator it = elements.begin(); it != elements.end(); ++it)
	{
		//pugi::xpath_node node = *it;

		str_value = it->node().child_value("enterprise");
		en = strtoul(str_value.c_str(),NULL,0);
		str_value = it->node().child_value("id");
		id = strtoul(str_value.c_str(),NULL,0);

		str_value = it->node().child_value("dataType");

		if (str_value =="unsigned8" or  str_value =="unsigned16" or str_value =="unsigned32" or str_value =="unsigned64" or \
		   str_value =="dateTimeSeconds" or str_value =="dateTimeMilliseconds" or str_value =="dateTimeMicroseconds" or \
	           str_value =="dateTimeNanoseconds" or str_value =="ipv4Address" or str_value =="macAddress" or str_value == "boolean") {
			type =UINT;
		} else if (str_value =="signed8" or str_value =="signed16" or str_value =="signed32" or str_value =="signed64" ) {
			type = INT;
		} else if (str_value =="ipv6Address") {
			type = IPv6;
		} else if (str_value =="float32" or str_value =="float64") {
			type = FLOAT;
		} else if (str_value =="string") {
			type = TEXT;
		} else if (str_value =="octetArray" or str_value =="basicList" or str_value =="subTemplateList" or str_value=="subTemplateMultiList") {
			type = BLOB;
		} else {
			type = UNKNOWN;
		}
		//conf->elements_types->insert(std::make_pair(en , std::make_pair(id, type)));
		(*conf->elements_types)[en][id] = type;
		//std::cout << "el loaded: " << en << ":" << id <<":"<< type << std::endl;
	}

	return 0;
}
开发者ID:evertlammerts,项目名称:ipfixcol,代码行数:54,代码来源:fastbit_element.cpp


示例13: MSG_ERROR

int KULLANICILAR_FORMU::CHECK_EMPTY ()
{
    if ( m_ui->lineEdit_kullanici_kodu->text().isEmpty() EQ true ) {
        MSG_ERROR(tr ( "User code can not be empty." ) , m_ui->lineEdit_kullanici_kodu );//Kullanıcı kodu boş bırakılamaz
        return ADAK_FAIL;
    }
    if ( m_ui->lineEdit_kullanici_adi->text().isEmpty() EQ true ) {
        MSG_ERROR(tr ( "User name can not be empty." ) , m_ui->lineEdit_kullanici_adi);
        return ADAK_FAIL;
    }
    return ADAK_OK;
}
开发者ID:adakteknoloji,项目名称:FRAMEWORK,代码行数:12,代码来源:kullanicilar_formu.cpp


示例14: fwd_odid_template_insert

/**
 * \brief Insert a template definition
 *
 * Find an unused Template ID among shared templates in ODID and then insert
 * the template with this new ID to the ODID maintainer.
 * \param[in,out] odid Observation Domain (ODID) maintainer
 * \param[in] rec Template record
 * \param[in] rec_len Length of the template record
 * \param[in] rec_type Type of the template (#TM_TEMPLATE or #TM_OPTIONS_TEMPLATE)
 * \return On success returns new Template ID assigned to the template (>= 256).
 * Otherwise returns 0.
 */
static uint16_t fwd_odid_template_insert(fwd_odid_t *odid,
	const struct ipfix_template_record *rec, size_t rec_len, int rec_type)
{
	// Create a template record
	const uint16_t old_id = ntohs(rec->template_id);
	const uint16_t new_id = fwd_odid_template_unused_id(odid, old_id);
	if (new_id == 0) {
		MSG_ERROR(msg_module, "Unable to add a new template to the Observation "
			"Domain ID %" PRIu32 ". All available Template IDs are already "
			"used. Some flows will be definitely lost.", odid->odid);
		return 0;
	}

	if (rec_type != TM_TEMPLATE && rec_type != TM_OPTIONS_TEMPLATE) {
		MSG_ERROR(msg_module, "Unable to add a new template to the Observation "
			"Domain ID %" PRIu32 ". Invalid type (%d) of the template .",
			odid->odid, rec_type);
		return 0;
	}

	fwd_tmplt_t *tmplt = fwd_tmplt_create(rec, rec_len, rec_type, new_id);
	if (!tmplt) {
		return 0;
	}

	// Store the template
	fwd_tmplt_t **group = odid->tmplts[new_id / GROUP_SIZE];
	if (!group) {
		// Not found -> create a new group
		fwd_tmplt_t ***new_grp = &odid->tmplts[new_id / GROUP_SIZE];
		*new_grp = calloc(GROUP_SIZE, sizeof(*group));
		if (*new_grp == NULL) {
			MSG_ERROR(msg_module, "Memory allocation failed (%s:%d)",
				__FILE__, __LINE__);
			fwd_tmplt_destroy(tmplt);
			return 0;
		}

		group = *new_grp;
	}

	odid->to_remove++; // There are no references to this template yet
	if (rec_type == TM_TEMPLATE) {
		odid->templates_normal++;
	} else {
		odid->templates_options++;
	}

	MSG_DEBUG(msg_module, "New template (ID: %" PRIu16 ") added to ODID "
		"%" PRIu32 ".", new_id, odid->odid);
	group[new_id % GROUP_SIZE] = tmplt;
	return new_id;
}
开发者ID:SecDorks-TorchSis,项目名称:ipfixcol,代码行数:65,代码来源:templates.c


示例15: gstk_send_ss_cnf_cleanup

/*===========================================================================
FUNCTION gstk_send_ss_cnf_cleanup

DESCRIPTION
  This function cleans up any allocated pointer on the stack.

PARAMETERS
  send_ss_cnf_ptr:  [Input] Pointer to message that is required to
                            be processed and sent to UIM
  STK_response_ptr: [Input] Pointer to the STK intermediate message
  has_cc          : [Input] has call control
  has_ussd_string : [Input] contains ussd string

DEPENDENCIES
  None

RETURN VALUE
  None

COMMENTS
  None

SIDE EFFECTS
  None

SEE ALSO
  None
===========================================================================*/
static void gstk_send_ss_cnf_cleanup(
  gstk_send_ss_cnf_type                             *send_ss_cnf_ptr,
  setup_call_send_ss_terminal_response_type         *STK_response_ptr,
  boolean                                           has_cc,
  boolean                                           has_ussd_string)
{
  if(STK_response_ptr == NULL)
  {
    MSG_ERROR("STK_response_ptr ERR:NULL",0,0,0);
    return;
  }

  if(send_ss_cnf_ptr == NULL)
  {
    MSG_ERROR("send_ss_cnf_ptr ERR:NULL",0,0,0);
    return;
  }
  /* free the text string byte pointer from STK_response_ptr and send_ss_cnf_ptr */
  /* STK_response_ptr:
        cc_req_action: ussd string, alpha
        text string 2
        result 2's additional info */
  gstk_util_release_upper_layer_cmd_memory(
    (gstk_cmd_type*)send_ss_cnf_ptr);/*lint !e826 area too small */

  if (has_cc) {
    if (STK_response_ptr->cc_req_action.alpha.alpha != NULL) {
      gstk_free(STK_response_ptr->cc_req_action.alpha.alpha);
      STK_response_ptr->cc_req_action.alpha.alpha = NULL;
    }
    if (STK_response_ptr->result2_for_cc.additional_info != NULL) {
      gstk_free(STK_response_ptr->result2_for_cc.additional_info);
      STK_response_ptr->result2_for_cc.additional_info = NULL;
    }

    if (has_ussd_string) {
      if (STK_response_ptr->cc_req_action.gstk_address_string_tlv.ussd_string.text != NULL) {
        gstk_free(STK_response_ptr->cc_req_action.gstk_address_string_tlv.ussd_string.text);
        STK_response_ptr->cc_req_action.gstk_address_string_tlv.ussd_string.text = NULL;
      }
      if (STK_response_ptr->cc_mod_text2.text != NULL) {
        gstk_free(STK_response_ptr->cc_mod_text2.text);
        STK_response_ptr->cc_mod_text2.text = NULL;
      }
    }
  }
  
  if (STK_response_ptr->header.result.additional_info != NULL) {
    gstk_free(STK_response_ptr->header.result.additional_info);
  }

} /* gstk_send_ss_cnf_cleanup */
开发者ID:bgtwoigu,项目名称:1110,代码行数:80,代码来源:gstk_send_ss.c


示例16: calloc

/**
 * \brief Initialize the iterator of IPFIX elements over a XML document
 *
 * After success intilialization call #elem_iter_next to get first element.
 * \param[in] fd An opened file descriptor of XML document
 * \return On success returns pointer to the initialized iterator. Otherwise
 * returns NULL.
 */
static struct elem_xml_iter *elem_iter_init(int fd)
{
	struct elem_xml_iter *iter;
	iter = (struct elem_xml_iter *) calloc(1, sizeof(struct elem_xml_iter));
	if (!iter) {
		MSG_ERROR(msg_module, "CALLOC FAILED! (%s:%d)", __FILE__, __LINE__);
		return NULL;
	}

	// Load XML document	
	iter->doc = xmlReadFd(fd, NULL, NULL, 
		XML_PARSE_NOERROR | XML_PARSE_NOWARNING | XML_PARSE_NOBLANKS | 
		XML_PARSE_BIG_LINES);
	if (!iter->doc) {
		MSG_ERROR(msg_module, "Unable to parse XML document with IPFIX "
			" elements.");
		free(iter);
		return NULL;
	}
	
	// Get XPath context and evaluate expression
	iter->xpath_ctx = xmlXPathNewContext(iter->doc);
	if (!iter->xpath_ctx) {
		MSG_ERROR(msg_module, "Unable to get XPath context of XML document "
			"with IPFIX elements.");
		xmlFreeDoc(iter->doc);
		free(iter);
		return NULL;
	}
	
	iter->xpath_obj = xmlXPathEvalExpression(BAD_CAST ELEM_XML_XPATH,
		iter->xpath_ctx);
	if (!iter->xpath_obj) {
		MSG_ERROR(msg_module, "Unable to evaluate XPath expression.");
		xmlXPathFreeContext(iter->xpath_ctx);
		xmlFreeDoc(iter->doc);
		free(iter);
		return NULL;
	}
	
	if (xmlXPathNodeSetIsEmpty(iter->xpath_obj->nodesetval)) {
		MSG_ERROR(msg_module, "No IPFIX elements in XML document.");
		xmlXPathFreeObject(iter->xpath_obj);
		xmlXPathFreeContext(iter->xpath_ctx);
		xmlFreeDoc(iter->doc);
		free(iter);
		return NULL;
	}
	
	return iter;
}
开发者ID:ADTRAN,项目名称:ipfixcol,代码行数:59,代码来源:element.c


示例17: ds707_data_session_reg_iface_events

/*===========================================================================
FUNCTION      DS707_DATA_SESSION_REG_IFACE_EVENTS

DESCRIPTION   
  This function registers for iface up and iface down event for v4 iface.

PARAMETERS    None

DEPENDENCIES  None

RETURN VALUE  None

SIDE EFFECTS  None
===========================================================================*/
void ds707_data_session_reg_iface_events(void)
{
  ps_iface_type  * iface_ptr;    /* ptr to 1x iface */
  void           * iface_buf_ptr;
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
    
  iface_ptr = GET_PS_IFACE_PTR( DS707_DEF_PKT_INSTANCE );
  if( iface_ptr == NULL )
  {
    MSG_ERROR(" NULL iface pointer ",0,0,0);
    ASSERT(0);
  }

  /*-----------------------------------------------------------------------
    Initialize and register the iface down ind callback info.
  -----------------------------------------------------------------------*/

  iface_buf_ptr = ps_iface_alloc_event_cback_buf (
    ds707_data_session_iface_event_cb, (void *)DS707_DEF_PKT_INSTANCE );
  
  if ( iface_buf_ptr == NULL )
  {
    MSG_ERROR("Event buf allocation failed",0,0,0);
    ASSERT(0);
  }

  if( ps_iface_event_cback_reg( iface_ptr, IFACE_DOWN_EV,
                                iface_buf_ptr  ) < 0 )
  {
    MSG_ERROR("IFACE_DOWN event reg failed", 0, 0, 0 );
  }

 /*-----------------------------------------------------------------------
    Initialize and register the iface up ind callback info.
  -----------------------------------------------------------------------*/
 iface_buf_ptr = ps_iface_alloc_event_cback_buf (
   ds707_data_session_iface_event_cb, (void *)DS707_DEF_PKT_INSTANCE );
  
  if ( iface_buf_ptr == NULL )
  {
    MSG_ERROR("Event buf allocation failed",0,0,0);
    ASSERT(0);
  }

  if( ps_iface_event_cback_reg( iface_ptr, IFACE_UP_EV,
                                iface_buf_ptr  ) < 0 )
  {
    MSG_ERROR( "IFACE_UP event reg failed", 0, 0, 0 );
  }
   
}
开发者ID:bgtwoigu,项目名称:1110,代码行数:65,代码来源:ds707_data_session_profile.c


示例18: MIP_EVENT_ALLOC

/*===========================================================================
FUNCTION MIP_EVENT_ALLOC()

DESCRIPTION
  This function will allocate a MIP event information structure and 
  register callback functions.

PARAMETERS
  mip_cb_f:         callback function to call
  user_data:        user data to be returned with the callback fn.

RETURN VALUE
  NULL on error
  handle to the MIP event information structure on success

DEPENDENCIES
  None

SIDE EFFECTS
  Allocates a MIP event information structure and places it on the event
  queue.  Initializes event masks and registers callbacks for MIP protocol.
===========================================================================*/
void *mip_event_alloc
(
  mip_event_cback_f_ptr_type  mip_cb_f,
  void                        *user_data
)
{
  mip_event_info_s_type *event_info_ptr = NULL;
  mip_session_info_type *mip_session;
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

  /*-------------------------------------------------------------------------
    Check  that the callback is not NULL.
  -------------------------------------------------------------------------*/
  if( NULL == mip_cb_f )
  {
    MSG_ERROR("NULL functions passed", 0, 0, 0);
    ASSERT( 0 );
    return NULL;
  }

  /*-------------------------------------------------------------------------
    Get default MIP session
  -------------------------------------------------------------------------*/
  mip_session = &mip_ses_info_array[0];

  if( mip_session->mip_event_client_cnt >= MIP_EVENT_CLIENT_MAX )
  {
    MSG_ERROR("Couldn't allocate event info structure", 0, 0, 0);
    ASSERT( 0 );
  }
  else
  {
    /*-------------------------------------------------------------------------
      Get a new event information structure
    -------------------------------------------------------------------------*/
    event_info_ptr = &mip_event_buf[mip_session->mip_event_client_cnt++];

    /*-----------------------------------------------------------------------
      Initialize the event information structure
    -----------------------------------------------------------------------*/
    memset( event_info_ptr, 0, sizeof(mip_event_info_s_type) );

    /*-----------------------------------------------------------------------
      Fill the structure with the passed callbacks and user_data cookies
    -----------------------------------------------------------------------*/
    event_info_ptr->cback             = mip_cb_f;
    event_info_ptr->user_data         = user_data;
  }

  return event_info_ptr;
} /* mip_event_alloc() */
开发者ID:bgtwoigu,项目名称:1110,代码行数:73,代码来源:dsmip.c


示例19: switch

void ADRES_RAPOR_FILTRESI_BATCH::RUN_BATCH()
{

    switch ( m_adres_rapor_turu ) {
    case ADRES_ILETISIM_RAPORU :
    default                 :
        if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) {
            return;
        }
        OPEN_REPORT_SHOWER ( OPEN_ADRES_KAYITLARI_RAPORU ( ADRES_ILETISIM_RAPORU, m_adres_kayit_turu, M_ADRES_KAYIT_RAPORU_BILGILERI), nativeParentWidget() );
        break;
    case ADRES_BILGILERI_RAPORU:
        if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) {
            return;
        }
        OPEN_REPORT_SHOWER ( OPEN_ADRES_KAYITLARI_RAPORU ( ADRES_BILGILERI_RAPORU,m_adres_kayit_turu, M_ADRES_ETIKET_BILGILERI ), nativeParentWidget() );
        break;
    case ADRES_ETIKETLERI_RAPORU :
        if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) {
            return;
        }
        OPEN_ADRES_ETIKETLERI_BATCH ( M_ADRES_ETIKET_BILGILERI, this );
        break;

    case TOPLU_MAIL_GONDERIMI :
        if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) {
            return;
        }
        if ( M_TOPLU_MAIL_BILGILERI.isEmpty() EQ true ) {
            MSG_ERROR ( "E-Posta gönderilebilecek kayıt bulunamadı." , NULL );
            return;
        }
        OPEN_ADRES_TOPLU_MAIL_GONDERIMI_BATCH ( M_TOPLU_MAIL_BILGILERI, this );
        break;
    case TOPLU_SMS_GONDERIMI:
        if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) {
            return;
        }
        if ( M_SMS_BILGILERI.isEmpty() EQ true ) {
            MSG_ERROR ( "SMS gönderilebilecek kayıtlı bir cep telefon bulunamadı." , NULL );
            return;
        }
        else {
            MSG_INFO (QString("SMS Gönderilecek Numaralar:\n%1").arg(M_SMS_BILGILERI),NULL);
        }

        SHOW_SMS_GUI("",M_SMS_BILGILERI,"",this);
        break;
    }
}
开发者ID:adakteknoloji,项目名称:E9,代码行数:50,代码来源:adres_rapor_filtresi_batch.cpp


示例20: sep

//-----------------------------------------------------------------------------
// Purpose: Parse another file specified in argument
//-----------------------------------------------------------------------------
void GlobalVars::ExecFileCmds(string line)
{
    typedef tokenizer<char_separator<char>> my_tok;

    char_separator<char> sep(" ");

    my_tok tok(line, sep);

	vector<string> str;

    for (my_tok::const_iterator i = tok.begin(); i != tok.end(); i++)
    {
		str.push_back(*i);		
    }

	ifstream file(str[1].c_str());

	if (file)
	{
		string line;

		while (getline(file, line))
		{
			if (file.fail())
			{
				MSG_ERROR("An exception has occurred in the file");
			}

			if (line.find("//") == string::npos)
			{
				if (line.find("=") != string::npos)
				{
					SplitString(line);
				}

				if (line.find("exec") != string::npos)
				{
					ExecFileCmds(line);
				}
			}
		}

		file.close();
	}

	else
	{
		MSG_ERROR("Couldn't open the file");
	}
}
开发者ID:tersfeld,项目名称:ETC,代码行数:53,代码来源:GlobalVars.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MSG_INTL函数代码示例发布时间:2022-05-30
下一篇:
C++ MSG_ERR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap