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

C++ LSErrorPrint函数代码示例

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

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



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

示例1: getMessages_method

bool getMessages_method(LSHandle* lshandle, LSMessage *message, void *ctx) {
  LSError lserror;
  LSErrorInit(&lserror);

  char filename[MAXLINLEN];

  strcpy(filename, "/var/log/messages");

  return read_file(lshandle, message, filename, true);

 error:
  LSErrorPrint(&lserror, stderr);
  LSErrorFree(&lserror);
 end:
  return false;
}
开发者ID:Herrie82,项目名称:lumberjack,代码行数:16,代码来源:luna_methods.c


示例2: SignalCancel

static void
SignalCancel(CBH *helper)
{
    bool retVal;
    LSError lserror;
    LSErrorInit(&lserror);

    retVal = LSCallCancel(gServiceHandle, helper->token, &lserror);
    if (!retVal)
    {
        LSErrorPrint(&lserror, stderr);
        LSErrorFree(&lserror);
    }

    helper->token = 0;
}
开发者ID:jukkahonkela-owo,项目名称:powerd,代码行数:16,代码来源:commands.c


示例3: luna_service_check_for_subscription_and_process

bool luna_service_check_for_subscription_and_process(LSHandle *handle, LSMessage *message)
{
	LSError lserror;
	bool subscribed = false;

	LSErrorInit(&lserror);

	if (LSMessageIsSubscription(message)) {
		if (!LSSubscriptionProcess(handle, message, &subscribed, &lserror)) {
			LSErrorPrint(&lserror, stderr);
			LSErrorFree(&lserror);
		}
	}

	return subscribed;
}
开发者ID:iscgar,项目名称:certmgrd,代码行数:16,代码来源:luna_service_utils.c


示例4: listContacts

// callback
static bool
listContacts(LSHandle *sh, LSMessage *message, void *categoryContext)
{
    bool retVal;
    LSError lserror;
    LSErrorInit(&lserror);

    retVal = LSMessageReply(sh, message, "{ JSON REPLY PAYLOAD }", &lserror);
    if (!retVal)
    {
        LSErrorPrint(&lserror, stderr);
        LSErrorFree(&lserror);
    }

    return retVal;
}
开发者ID:ctbrowser,项目名称:luna-service2,代码行数:17,代码来源:test_example.c


示例5: clearMessages_method

bool clearMessages_method(LSHandle* lshandle, LSMessage *message, void *ctx) {
  LSError lserror;
  LSErrorInit(&lserror);

  char command[MAXLINLEN];

  sprintf(command, "rm -rf /var/log/messages 2>&1");

  return simple_command(lshandle, message, command);

 error:
  LSErrorPrint(&lserror, stderr);
  LSErrorFree(&lserror);
 end:
  return false;
}
开发者ID:Herrie82,项目名称:lumberjack,代码行数:16,代码来源:luna_methods.c


示例6: send_shutdown_services

static void
send_shutdown_services()
{
    bool retVal;
    LSError lserror;
    LSErrorInit(&lserror);

    retVal = LSSignalSend(GetLunaServiceHandle(),
        "luna://com.palm.sleep/shutdown/shutdownServices",
        "{}", &lserror);
    if (!retVal)
    {
        g_critical("%s Could not send shutdown applications", __FUNCTION__);
        LSErrorPrint(&lserror, stderr);
        LSErrorFree(&lserror);
    }
}
开发者ID:jukkahonkela-owo,项目名称:sleepd,代码行数:17,代码来源:shutdown.c


示例7: dummy_method

//
// A dummy method, useful for unimplemented functions or as a status function.
// Called directly from webOS, and returns directly to webOS.
//
bool dummy_method(LSHandle* lshandle, LSMessage *message, void *ctx)
{
	log("dummy_method");

	LSError lserror;
	LSErrorInit(&lserror);

	if (!LSMessageReply(lshandle, message, "{\"returnValue\": true}", &lserror))
	{
		LSErrorPrint(&lserror, stderr);
		LSErrorFree(&lserror);

		return false;
	}

	return true;
}
开发者ID:nicbedford,项目名称:adhoc,代码行数:21,代码来源:luna_methods.c


示例8: alarm_queue_add

/**
* @brief Add a new alarm to the queue.
*
* @param  id
* @param  calendar_time
* @param  expiry
* @param  serviceName
* @param  applicationName
*
* @retval
*/
static bool
alarm_queue_add(uint32_t id, const char *key, bool calendar_time,
                time_t expiry, const char *serviceName,
                const char *applicationName,
                bool subscribe, LSMessage *message)
{
    _Alarm *alarm = g_new0(_Alarm, 1);

    alarm->key = g_strdup(key);
    alarm->id = id;
    alarm->calendar = calendar_time;
    alarm->expiry = expiry;
    alarm->serviceName = g_strdup(serviceName);
    alarm->applicationName = g_strdup(applicationName);

    if (subscribe)
    {
        LSError lserror;
        LSErrorInit(&lserror);
        bool retVal = LSSubscriptionAdd(
                          GetLunaServiceHandle(), "alarm", message, &lserror);
        if (!retVal) {
            LSErrorPrint(&lserror, stderr);
            LSErrorFree(&lserror);
            goto error;
        }
        LSMessageRef(message);
        alarm->message = message;
    }

    alarm_print(alarm);

    if (alarm->id >= gAlarmQueue->seq_id)
    {
        gAlarmQueue->seq_id = alarm->id+1;
    }

    g_sequence_insert_sorted(gAlarmQueue->alarms,
                             alarm, (GCompareDataFunc)alarm_cmp_func,
                             NULL);

    update_alarms();
    return true;
error:
    return false;
}
开发者ID:perezerah,项目名称:sleepd,代码行数:57,代码来源:alarm.c


示例9: LSErrorInit

void WindowServerLuna::slotFullEraseDevice()
{
	LSHandle* handle = SystemService::instance()->serviceHandle();
	LSError err;
	LSErrorInit(&err);

	luna_assert(handle != 0);
	LSCall(handle, "palm://com.palm.storage/erase/EraseAll", "{}", &WindowServerLuna::cbFullEraseCallback, this, NULL, &err);

	if (LSErrorIsSet(&err)) {
		LSErrorPrint(&err, stderr);
		LSErrorFree(&err);
	}
	else {
		m_fullErasePending = true;
	}
}
开发者ID:KyleMaas,项目名称:luna-sysmgr,代码行数:17,代码来源:WindowServerLuna.cpp


示例10: luna_service_message_reply_custom_error

void luna_service_message_reply_custom_error(LSHandle *handle, LSMessage *message, const char *error_text)
{
	bool ret;
	LSError lserror;
	char *payload;

	LSErrorInit(&lserror);

	payload = g_strdup_printf("{\"returnValue\":false, \"errorText\":\"%s\"}", error_text);

	ret = LSMessageReply(handle, message, payload, &lserror);
	if (!ret) {
		LSErrorPrint(&lserror, stderr);
		LSErrorFree(&lserror);
	}

	g_free(payload);
}
开发者ID:iscgar,项目名称:certmgrd,代码行数:18,代码来源:luna_service_utils.c


示例11: LSErrorInit

void HostArmPixie::getInitialSwitchStates()
{
	LSError err;
	LSErrorInit(&err);

	if (!LSCall(m_service, HIDD_RINGER_URI, HIDD_GET_STATE, HostArm::switchStateCallback, (void*)SW_RINGER, NULL, &err))
		goto Error;

	if (!LSCall(m_service, HIDD_HEADSET_URI, HIDD_GET_STATE, HostArm::switchStateCallback, (void*)SW_HEADPHONE_INSERT, NULL, &err))
		goto Error;

Error:

	if (LSErrorIsSet(&err)) {
		LSErrorPrint(&err, stderr);
		LSErrorFree(&err);
	}
}
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:18,代码来源:HostArmPixie.cpp


示例12: getLogging_method

//
// Run command to get Logging context level.
//
bool getLogging_method(LSHandle* lshandle, LSMessage *message, void *ctx) {
  LSError lserror;
  LSErrorInit(&lserror);

  // Local buffer to store the update command
  char command[MAXLINLEN];

  // Store the command, so it can be used in the error report if necessary
  sprintf(command, "PmLogCtl show 2>&1");
  
  return simple_command(lshandle, message, command);

 error:
  LSErrorPrint(&lserror, stderr);
  LSErrorFree(&lserror);
 end:
  return false;
}
开发者ID:Herrie82,项目名称:lumberjack,代码行数:21,代码来源:luna_methods.c


示例13: shutdown_init

static int
shutdown_init(void)
{
    LSError lserror;
    LSErrorInit(&lserror);

    if (!LSRegisterCategory(GetLunaServiceHandle(),
            "/shutdown", shutdown_methods, NULL, NULL, &lserror))
    {
        goto error;
    }

    return 0;

error:
    LSErrorPrint(&lserror, stderr);
    LSErrorFree(&lserror);
    return -1;
}
开发者ID:Andolamin,项目名称:powerd,代码行数:19,代码来源:shutdown.c


示例14: listConnections_method

bool listConnections_method(LSHandle* lshandle, LSMessage *message, void *ctx) {
  LSError lserror;
  LSErrorInit(&lserror);

  if (access_denied(message)) return true;

  // Local buffer to store the command
  char command[MAXLINLEN];

  sprintf(command, "cat /proc/net/nf_conntrack 2>&1");

  return simple_command(message, command);

 error:
  LSErrorPrint(&lserror, stderr);
  LSErrorFree(&lserror);
 end:
  return false;
}
开发者ID:rwhitby,项目名称:impostah,代码行数:19,代码来源:luna_methods.c


示例15: listFilecacheTypes_method

bool listFilecacheTypes_method(LSHandle* lshandle, LSMessage *message, void *ctx) {
  LSError lserror;
  LSErrorInit(&lserror);

  if (access_denied(message)) return true;

  // Local buffer to store the command
  char command[MAXLINLEN];

  sprintf(command, "/bin/ls -1 /etc/palm/filecache_types/ 2>&1");

  return simple_command(message, command);

 error:
  LSErrorPrint(&lserror, stderr);
  LSErrorFree(&lserror);
 end:
  return false;
}
开发者ID:rwhitby,项目名称:impostah,代码行数:19,代码来源:luna_methods.c


示例16: listKeys_method

bool listKeys_method(LSHandle* lshandle, LSMessage *message, void *ctx) {
  LSError lserror;
  LSErrorInit(&lserror);

  if (access_denied(message)) return true;

  // Local buffer to store the command
  char command[MAXLINLEN];

  sprintf(command, "sqlite3 /var/palm/data/keys.db 'SELECT id,ownerId,keyId FROM keytable ;' 2>&1");

  return simple_command(message, command);

 error:
  LSErrorPrint(&lserror, stderr);
  LSErrorFree(&lserror);
 end:
  return false;
}
开发者ID:rwhitby,项目名称:impostah,代码行数:19,代码来源:luna_methods.c


示例17: com_palm_power_lunabus_init

static int
com_palm_power_lunabus_init(void)
{
    LSError lserror;
    LSErrorInit(&lserror);

    if (!LSPalmServiceRegisterCategory(GetPalmService(), "/com/palm/power",
        com_palm_power_public_methods, com_palm_power_methods, com_palm_power_signals,
        NULL, &lserror))
    {
        goto error;
    }
    return 0;

error:
    LSErrorPrint(&lserror, stderr);
    LSErrorFree(&lserror);
    return -1;
}
开发者ID:Andolamin,项目名称:powerd,代码行数:19,代码来源:com_palm_power_lunabus.c


示例18: machineShutdown

void machineShutdown(void)
{
	char *payload = g_strdup_printf("{\"reason\":\"Battery level is critical\"}");

	LSError lserror;
	LSErrorInit(&lserror);
	POWERDLOG(LOG_DEBUG,"%s: Sending payload : %s",__func__,payload);

	bool retVal = LSSignalSend(GetLunaServiceHandle(),
			"luna://com.palm.power/shutdown/machineOff",
			payload, &lserror);
	g_free(payload);

	if (!retVal)
	{
		LSErrorPrint(&lserror, stderr);
		LSErrorFree(&lserror);
	}
}
开发者ID:jukkahonkela-owo,项目名称:powerd,代码行数:19,代码来源:battery.c


示例19: g_strdup_printf

void DisplayBlocker::acquire(const char *clientName)
{
	if (!m_service)
		return;

	char *parameters = g_strdup_printf("{\"requestBlock\":true,\"client\":\"%s\"}",
					clientName);

	LSError lserror;
	LSErrorInit(&lserror);

	if (!LSCall(m_service, "palm://com.palm.display/control/setProperty",
		parameters, cbRegistrationResponse, this, &m_token, &lserror))
	{
		m_token = 0;
		LSErrorPrint(&lserror, stderr);
		LSErrorFree(&lserror);
	}
}
开发者ID:Tofee,项目名称:luna-appmanager,代码行数:19,代码来源:BootManager.cpp


示例20: _ListServiceSubscriptions

static void
_ListServiceSubscriptions(LSHandle *sh, LSFilterFunc callback, GSList *monitor_list, int total_services,
                          GSList **reply_list)
{
    LSError lserror;
    LSErrorInit(&lserror);

    _LSMonitorListInfo *cur = NULL;
    bool retVal = false;

    _SubscriptionReplyData *data = g_malloc(sizeof(_SubscriptionReplyData));

    if (!data)
    {
        g_critical("Out of memory when allocating reply data");
        exit(EXIT_FAILURE);
    }

    /* NOTE: we only allocate one of these items and pass it as the data to all the callbacks */
    data->reply_list = reply_list;
    data->total_replies = total_services;

    for (; monitor_list != NULL; monitor_list = g_slist_next(monitor_list))
    {
        cur = monitor_list->data;
        
        /* skip any non-services and the monitor itself */
        if (!_CanGetSubscriptionInfo(cur))
        {
            continue;
        }

        char *uri = g_strconcat("palm://", cur->service_name, list_subscriptions ? SUBSCRIPTION_DEBUG_METHOD : MALLOC_DEBUG_METHOD, NULL);

        retVal = LSCall(sh, uri, "{}", callback, data, NULL, &lserror);
        if (!retVal)
        {
            LSErrorPrint(&lserror, stderr);
            LSErrorFree(&lserror);
        }
        g_free(uri);
    }
}
开发者ID:anupamkaul,项目名称:luna-service2,代码行数:43,代码来源:monitor.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LSMessageGetPayload函数代码示例发布时间:2022-05-30
下一篇:
C++ LSErrorFree函数代码示例发布时间: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