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


C++ LSErrorPrint函数代码示例

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


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


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