本文整理汇总了C++中debug_info函数的典型用法代码示例。如果您正苦于以下问题:C++ debug_info函数的具体用法?C++ debug_info怎么用?C++ debug_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug_info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: service_send
/**
* Sends data using the given service client.
*
* @param client The service client to use for sending.
* @param data Data to send
* @param size Size of the data to send
* @param sent Number of bytes sent (can be NULL to ignore)
*
* @return SERVICE_E_SUCCESS on success,
* SERVICE_E_INVALID_ARG when one or more parameters are
* invalid, or SERVICE_E_UNKNOWN_ERROR when an unspecified
* error occurs.
*/
service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent)
{
service_error_t res = SERVICE_E_UNKNOWN_ERROR;
int bytes = 0;
if (!client || (client && !client->connection) || !data || (size == 0)) {
return SERVICE_E_INVALID_ARG;
}
debug_info("sending %d bytes", size);
res = idevice_to_service_error(idevice_connection_send(client->connection, data, size, (uint32_t*)&bytes));
if (bytes <= 0) {
debug_info("ERROR: sending to device failed.");
}
if (sent) {
*sent = (uint32_t)bytes;
}
return res;
}
开发者ID:CSRedRat,项目名称:libimobiledevice,代码行数:33,代码来源:service.c
示例2: idevice_event_subscribe
idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_data)
{
event_cb = callback;
int res = usbmuxd_subscribe(usbmux_event_cb, user_data);
if (res != 0) {
event_cb = NULL;
debug_info("ERROR: usbmuxd_subscribe() returned %d!", res);
return IDEVICE_E_UNKNOWN_ERROR;
}
return IDEVICE_E_SUCCESS;
}
开发者ID:UnveN,项目名称:libimobiledevice,代码行数:11,代码来源:idevice.c
示例3: schedule
/*
* round robin schedule
*/
int schedule(tpool_t* tp,task_t* task){
int thread_id;
conn_t* conn =(conn_t*)task->arg;
thread_id = conn->id % tp->num;
debug_info("schedule task[%lu], on thread[%d]\n", task->id, tp->threads[thread_id]->myid);
enque(&tp->threads[thread_id]->q, &task->link);
}
开发者ID:Jack-chang,项目名称:myfs,代码行数:14,代码来源:tpool.c
示例4: Pthread_cancel
/*************************************************
* Function: Pthread_cancel()
* Description: 请求取消线程包裹函数
* Input: tid---取消线程ID
* Output: N/A
* Return: 0/errno
*************************************************/
int Pthread_cancel(pthread_t tid)
{
int rval;
if((rval = pthread_cancel(tid)) != 0)
{
debug_info(DEBUG_LEVEL_3, "Pthread_cancel() failed!\n");
}
return rval;
}
开发者ID:github188,项目名称:foundationlib,代码行数:18,代码来源:pthread.c
示例5: pthreadIdVerify
/*************************************************
* Function: pthreadIdVerify()
* Description: 线程验证存在函数
* Input: tid---线程任务的ID
* Output: N/A
* Return: 0/errno
*************************************************/
int pthreadIdVerify(pthread_t tid)
{
int rval;
if((rval = pthread_kill(tid, 0)) != 0)
{
debug_info(DEBUG_LEVEL_3, "pthread_kill(0) failed!\n");
}
return rval;
}
开发者ID:github188,项目名称:foundationlib,代码行数:18,代码来源:pthread.c
示例6: Pthread_join
/*************************************************
* Function: Pthread_join()
* Description: 等待线程退出包裹函数
* Input: thread---退出线程ID
* value---退出线程返回状态集合
* Output: N/A
* Return: 0/errno
*************************************************/
int Pthread_join(pthread_t thread, void **value)
{
int rval;
if((rval = pthread_join(thread, value)) != 0)
{
debug_info(DEBUG_LEVEL_3,"Pthread_join() failed!\n");
}
return rval;
}
开发者ID:github188,项目名称:foundationlib,代码行数:19,代码来源:pthread.c
示例7: lockdownd_get_sync_data_classes
LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
if (!client->session_id)
return LOCKDOWN_E_NO_RUNNING_SESSION;
plist_t dict = NULL;
lockdownd_error_t err = LOCKDOWN_E_UNKNOWN_ERROR;
plist_t value = NULL;
char **newlist = NULL;
char *val = NULL;
*classes = NULL;
*count = 0;
err = lockdownd_get_value(client, "com.apple.mobile.iTunes", "SyncDataClasses", &dict);
if (err != LOCKDOWN_E_SUCCESS) {
if (dict) {
plist_free(dict);
}
return err;
}
if (plist_get_node_type(dict) != PLIST_ARRAY) {
plist_free(dict);
return LOCKDOWN_E_PLIST_ERROR;
}
while((value = plist_array_get_item(dict, *count)) != NULL) {
plist_get_string_val(value, &val);
newlist = (char**)realloc(*classes, sizeof(char*) * (*count+1));
str_remove_spaces(val);
if (asprintf(&newlist[*count], "com.apple.%s", val) < 0) {
debug_info("ERROR: asprintf failed");
}
free(val);
val = NULL;
*classes = newlist;
*count = *count+1;
}
newlist = (char**)realloc(*classes, sizeof(char*) * (*count+1));
newlist[*count] = NULL;
*classes = newlist;
if (dict) {
plist_free(dict);
}
return LOCKDOWN_E_SUCCESS;
}
开发者ID:Polyfun,项目名称:libimobiledevice,代码行数:54,代码来源:lockdown.c
示例8: internal_ssl_read
/**
* Internally used gnutls callback function for receiving encrypted data.
*/
static ssize_t internal_ssl_read(gnutls_transport_ptr_t transport, char *buffer, size_t length)
{
int bytes = 0, pos_start_fill = 0;
size_t tbytes = 0;
int this_len = length;
idevice_error_t res;
idevice_connection_t connection = (idevice_connection_t)transport;
char *recv_buffer;
debug_info("pre-read client wants %zi bytes", length);
recv_buffer = (char *)malloc(sizeof(char) * this_len);
/* repeat until we have the full data or an error occurs */
do {
if ((res = internal_connection_receive(connection, recv_buffer, this_len, (uint32_t*)&bytes)) != IDEVICE_E_SUCCESS) {
debug_info("ERROR: idevice_connection_receive returned %d", res);
return res;
}
debug_info("post-read we got %i bytes", bytes);
/* increase read count */
tbytes += bytes;
/* fill the buffer with what we got right now */
memcpy(buffer + pos_start_fill, recv_buffer, bytes);
pos_start_fill += bytes;
if (tbytes >= length) {
break;
}
this_len = length - tbytes;
debug_info("re-read trying to read missing %i bytes", this_len);
} while (tbytes < length);
if (recv_buffer) {
free(recv_buffer);
}
return tbytes;
}
开发者ID:HSHtime,项目名称:libiphone,代码行数:44,代码来源:idevice.c
示例9: snprintf
/* make use of /proc/uptime and the fact that it stores total idle time */
unsigned char *get_uptime()
{
FILE * p_uptime;
float uptime1=0, uptime2=0;
char *ret=NULL, string[60];
unsigned y=0, d=0, h=0, m=0;
if (( p_uptime = fopen("/proc/uptime", "r")) == NULL )
return "???";
#ifdef DEBUG
extern char debug_buf[600]; // for debugging output
snprintf(debug_buf, sizeof(debug_buf)-1, "[%s/%d] open '/proc/uptime' o.k.\n",__FUNCTION__,__LINE__);
debug_info(debug_buf);
#endif
if ( fscanf(p_uptime, "%f %f", &uptime1, &uptime2) != 2)
return "???";
d = uptime1 / 86400;
h = (uptime1 - (d * 86400)) / 3600;
m = (uptime1 - (d * 86400) - (h * 3600)) / 60;
if ((h==0) && (d==0) && (y==0))
snprintf(string, sizeof(string)-1, "%umin",m);
else if ((d==0) && (y==0))
snprintf(string, sizeof(string)-1, "%uh %umin",h,m);
else if (y==0)
snprintf(string, sizeof(string)-1, "%dT %uh %umin",d,h,m);
else
snprintf(string, sizeof(string)-1, "%dJ %dT %uh %umin",y,d,h,m);
ret=Strdup(string);
// clean things up
if ( fclose(p_uptime) != 0)
{
#ifdef DEBUG
snprintf(debug_buf, sizeof(debug_buf)-1, "[%s/%d] error closing '/proc/uptime'!\n",__FUNCTION__,__LINE__);
debug_info(debug_buf);
#endif
return "???";
}
return ret;
}
开发者ID:tijuca,项目名称:openmct,代码行数:41,代码来源:functions.c
示例10: sbservices_get_icon_state
/**
* Gets the icon state of the connected device.
*
* @param client The connected sbservices client to use.
* @param state Pointer that will point to a newly allocated plist containing
* the current icon state. It is up to the caller to free the memory.
* @param format_version A string to be passed as formatVersion along with
* the request, or NULL if no formatVersion should be passed. This is only
* supported since iOS 4.0 so for older firmware versions this must be set
* to NULL.
*
* @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
* client or state is invalid, or an SBSERVICES_E_* error code otherwise.
*/
sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version)
{
if (!client || !client->parent || !state)
return SBSERVICES_E_INVALID_ARG;
sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
plist_dict_insert_item(dict, "command", plist_new_string("getIconState"));
if (format_version) {
plist_dict_insert_item(dict, "formatVersion", plist_new_string(format_version));
}
sbs_lock(client);
res = sbservices_error(property_list_service_send_binary_plist(client->parent, dict));
if (res != SBSERVICES_E_SUCCESS) {
debug_info("could not send plist, error %d", res);
goto leave_unlock;
}
plist_free(dict);
dict = NULL;
res = sbservices_error(property_list_service_receive_plist(client->parent, state));
if (res != SBSERVICES_E_SUCCESS) {
debug_info("could not get icon state, error %d", res);
if (*state) {
plist_free(*state);
*state = NULL;
}
}
leave_unlock:
if (dict) {
plist_free(dict);
}
sbs_unlock(client);
return res;
}
开发者ID:qianguozheng,项目名称:Parse-iOS-Package,代码行数:53,代码来源:sbservices.c
示例11: restored_client_new
/**
* Creates a new restored client for the device.
*
* @param device The device to create a restored client for
* @param client The pointer to the location of the new restored_client
* @param label The label to use for communication. Usually the program name.
*
* @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client is NULL
*/
restored_error_t restored_client_new(idevice_t device, restored_client_t *client, const char *label)
{
if (!client)
return RESTORE_E_INVALID_ARG;
restored_error_t ret = RESTORE_E_SUCCESS;
static struct lockdownd_service_descriptor service = {
0xf27e, 0
};
property_list_service_client_t plistclient = NULL;
if (property_list_service_client_new(device, (lockdownd_service_descriptor_t)&service, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) {
debug_info("could not connect to restored (device %s)", device->udid);
return RESTORE_E_MUX_ERROR;
}
restored_client_t client_loc = (restored_client_t) malloc(sizeof(struct restored_client_private));
client_loc->parent = plistclient;
client_loc->udid = NULL;
client_loc->label = NULL;
client_loc->info = NULL;
if (label != NULL)
client_loc->label = _strdup(label);
ret = idevice_get_udid(device, &client_loc->udid);
if (RESTORE_E_SUCCESS != ret) {
debug_info("failed to get device udid.");
}
debug_info("device udid: %s", client_loc->udid);
if (RESTORE_E_SUCCESS == ret) {
*client = client_loc;
} else {
restored_client_free(client_loc);
}
return ret;
}
开发者ID:AmongOthers,项目名称:libimobiledevice-win32,代码行数:48,代码来源:restore.c
示例12: idevice_get_handle
idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle)
{
if (!device)
return IDEVICE_E_INVALID_ARG;
if (device->conn_type == CONNECTION_USBMUXD) {
*handle = (uint32_t)(long)device->conn_data;
return IDEVICE_E_SUCCESS;
} else {
debug_info("Unknown connection type %d", device->conn_type);
}
return IDEVICE_E_UNKNOWN_ERROR;
}
开发者ID:HSHtime,项目名称:libiphone,代码行数:13,代码来源:idevice.c
示例13: misagent_copy
/**
* Retrieves an array of all installed provisioning profiles.
*
* @param client The connected misagent to use.
* @param profiles Pointer to a plist_t that will be set to a PLIST_ARRAY
* if the function is successful.
*
* @return MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
* client is invalid, or an MISAGENT_E_* error code otherwise.
*
* @note If no provisioning profiles are installed on the device, this function
* still returns MISAGENT_E_SUCCESS and profiles will just point to an
* empty array.
*/
misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles)
{
if (!client || !client->parent || !profiles)
return MISAGENT_E_INVALID_ARG;
client->last_error = MISAGENT_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
plist_dict_insert_item(dict, "MessageType", plist_new_string("Copy"));
plist_dict_insert_item(dict, "ProfileType", plist_new_string("Provisioning"));
misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
dict = NULL;
if (res != MISAGENT_E_SUCCESS) {
debug_info("could not send plist, error %d", res);
return res;
}
res = misagent_error(property_list_service_receive_plist(client->parent, &dict));
if (res != MISAGENT_E_SUCCESS) {
debug_info("could not receive response, error %d", res);
return res;
}
if (!dict) {
debug_info("could not get response plist");
return MISAGENT_E_UNKNOWN_ERROR;
}
res = misagent_check_result(dict, &client->last_error);
if (res == MISAGENT_E_SUCCESS) {
*profiles = plist_copy(plist_dict_get_item(dict, "Payload"));
}
plist_free(dict);
return res;
}
开发者ID:AmongOthers,项目名称:libimobiledevice-win32,代码行数:53,代码来源:misagent.c
示例14: service_client_factory_start_service
/**
* Starts a new service on the specified device with given name and
* connects to it.
*
* @param device The device to connect to.
* @param service_name The name of the service to start.
* @param client Pointer that will point to a newly allocated service_client_t
* upon successful return. Must be freed using service_client_free() after
* use.
* @param label The label to use for communication. Usually the program name.
* Pass NULL to disable sending the label in requests to lockdownd.
*
* @return SERVICE_E_SUCCESS on success, or a SERVICE_E_* error code
* otherwise.
*/
service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int16_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int16_t *error_code)
{
*client = NULL;
lockdownd_client_t lckd = NULL;
if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, label)) {
debug_info("Could not create a lockdown client.");
return SERVICE_E_START_SERVICE_ERROR;
}
lockdownd_service_descriptor_t service = NULL;
lockdownd_start_service(lckd, service_name, &service);
lockdownd_client_free(lckd);
if (!service || service->port == 0) {
debug_info("Could not start service %s!", service_name);
return SERVICE_E_START_SERVICE_ERROR;
}
int16_t ec;
if (constructor_func) {
ec = (int16_t)constructor_func(device, service, client);
} else {
ec = service_client_new(device, service, (service_client_t*)client);
}
if (error_code) {
*error_code = ec;
}
if (ec != SERVICE_E_SUCCESS) {
debug_info("Could not connect to service %s! Port: %i, error: %i", service_name, service->port, ec);
}
lockdownd_service_descriptor_free(service);
service = NULL;
return (ec == SERVICE_E_SUCCESS) ? SERVICE_E_SUCCESS : SERVICE_E_START_SERVICE_ERROR;
}
开发者ID:CSRedRat,项目名称:libimobiledevice,代码行数:53,代码来源:service.c
示例15: lockdownd_activate
LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
if (!client->session_id)
return LOCKDOWN_E_NO_RUNNING_SESSION;
if (!activation_record)
return LOCKDOWN_E_INVALID_ARG;
lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
plist_dict_set_item(dict,"Request", plist_new_string("Activate"));
plist_dict_set_item(dict,"ActivationRecord", plist_copy(activation_record));
ret = lockdownd_send(client, dict);
plist_free(dict);
dict = NULL;
ret = lockdownd_receive(client, &dict);
if (!dict) {
debug_info("LOCKDOWN_E_PLIST_ERROR");
return LOCKDOWN_E_PLIST_ERROR;
}
ret = lockdown_check_result(dict, "Activate");
if (ret == LOCKDOWN_E_SUCCESS) {
debug_info("success");
}
plist_free(dict);
dict = NULL;
return ret;
}
开发者ID:skposs,项目名称:WinLibmobiledevice,代码行数:38,代码来源:lockdown.c
示例16: heartbeat_send
heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist)
{
heartbeat_error_t res = HEARTBEAT_E_UNKNOWN_ERROR;
res = heartbeat_error(property_list_service_send_binary_plist(client->parent, plist));
if (res != HEARTBEAT_E_SUCCESS) {
debug_info("Sending plist failed with error %d", res);
return res;
}
debug_plist(plist);
return res;
}
开发者ID:Iancurtis,项目名称:libimobiledevice,代码行数:14,代码来源:heartbeat.c
示例17: np_post_notification
/**
* Sends a notification to the device's notification_proxy.
*
* @param client The client to send to
* @param notification The notification message to send
*
* @return NP_E_SUCCESS on success, or an error returned by np_plist_send
*/
np_error_t np_post_notification(np_client_t client, const char *notification)
{
if (!client || !notification) {
return NP_E_INVALID_ARG;
}
np_lock(client);
plist_t dict = plist_new_dict();
plist_dict_set_item(dict,"Command", plist_new_string("PostNotification"));
plist_dict_set_item(dict,"Name", plist_new_string(notification));
np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
dict = plist_new_dict();
plist_dict_set_item(dict,"Command", plist_new_string("Shutdown"));
res = np_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
if (res != NP_E_SUCCESS) {
debug_info("Error sending XML plist to device!");
}
// try to read an answer, we just ignore errors here
dict = NULL;
property_list_service_receive_plist(client->parent, &dict);
if (dict) {
#ifndef STRIP_DEBUG_CODE
char *cmd_value = NULL;
plist_t cmd_value_node = plist_dict_get_item(dict, "Command");
if (plist_get_node_type(cmd_value_node) == PLIST_STRING) {
plist_get_string_val(cmd_value_node, &cmd_value);
}
if (cmd_value && !strcmp(cmd_value, "ProxyDeath")) {
// this is the expected answer
} else {
debug_plist(dict);
}
if (cmd_value) {
free(cmd_value);
}
#endif
plist_free(dict);
}
np_unlock(client);
return res;
}
开发者ID:KobyBo,项目名称:libimobiledevice,代码行数:58,代码来源:notification_proxy.c
示例18: child
void child()
{
sem_t *sem;
sem = sem_open(SEM_NAME, 0);
if (sem == SEM_FAILED)
{
perror("sem_open");
}
sleep(1);
debug_info("child going to post\n");
sem_post(sem);
}
开发者ID:1angJ6,项目名称:linux-ipcs,代码行数:14,代码来源:process_sem.c
示例19: instproxy_send_command
/**
* Sends a command to the device.
* Only used internally.
*
* @param client The connected installation_proxy client.
* @param command The command to execute. Required.
* @param client_options The client options to use, as PLIST_DICT, or NULL.
* @param appid The ApplicationIdentifier to add or NULL if not required.
* @param package_path The installation package path or NULL if not required.
*
* @return INSTPROXY_E_SUCCESS on success or an INSTPROXY_E_* error value if
* an error occured.
*/
static instproxy_error_t instproxy_send_command(instproxy_client_t client, plist_t command)
{
if (!client || !command)
return INSTPROXY_E_INVALID_ARG;
instproxy_error_t res = instproxy_error(property_list_service_send_xml_plist(client->parent, command));
if (res != INSTPROXY_E_SUCCESS) {
debug_info("could not send command plist, error %d", res);
return res;
}
return res;
}
开发者ID:pyraman,项目名称:DeviceCenter,代码行数:27,代码来源:installation_proxy.c
示例20: ssl_connection_start
int ssl_connection_start(FetionConnection* conn)
{
int ret;
SSL_load_error_strings();
SSL_library_init();
conn->ssl_ctx = SSL_CTX_new(SSLv23_client_method());
if ( conn->ssl_ctx == NULL ){
debug_info("Init SSL CTX failed");
return -1;
}
conn->ssl = SSL_new(conn->ssl_ctx);
if ( conn->ssl == NULL ){
debug_info("New SSL with created CTX failed");
return -1;
}
ret = SSL_set_fd(conn->ssl, conn->socketfd);
if ( ret == 0 ){
debug_info("Add ssl to tcp socket failed");
return -1;
}
RAND_poll();
while ( RAND_status() == 0 )
{
unsigned short rand_ret = rand() % 65536;
RAND_seed(&rand_ret, sizeof(rand_ret));
}
ret = SSL_connect(conn->ssl);
if( ret != 1 )
{
debug_info("SSL connection failed");
return -1;
}
return 0;
}
开发者ID:amoblin,项目名称:flyshion,代码行数:37,代码来源:fetion_connection.c
注:本文中的debug_info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论