/** * @brief Get the payload of the message as a JSON object. * * @deprecated Do NOT use this function anymore. It now returns NULL always. * Use LSMessageGetPayload() and use pbnjson (https://wiki.palm.com/display/CoreOS/pbnjson) * to parse the JSON. * * @param message * * @retval NULL always */ LS_DEPRECATED void* LSMessageGetPayloadJSON(LSMessage *message) { _LSErrorIfFailMsg(NULL, NULL, LS_ERROR_CODE_DEPRECATED, LS_ERROR_TEXT_DEPRECATED); return NULL; }
/** * @brief Detach a service from a glib mainloop. You should NEVER use this * function unless you are fork()'ing without exec()'ing and know what you are * doing. This will perform nearly all the same cleanup as LSUnregister(), with * the exception that it will not send out shutdown messages or flush any * buffers. It is intended to be used only when fork()'ing so that your child * process can continue without interfering with the parent's file descriptors, * since open file descriptors are duplicated during a fork(). * * @param sh * @param lserror * * @retval */ bool LSGmainDetach(LSHandle *sh, LSError *lserror) { _LSErrorIfFail(sh != NULL, lserror); _LSErrorIfFailMsg(sh->context != NULL, lserror, -1, "%s: %s", __FUNCTION__, ": No maincontext."); /* We "unregister" without actually flushing or sending shutdown messages */ return _LSUnregisterCommon(sh, false, LSHANDLE_GET_RETURN_ADDR(), lserror); }
/** * @brief Attach a service to a glib mainloop. * * @param sh * @param mainLoop * @param lserror * * @retval */ bool LSGmainAttach(LSHandle *sh, GMainLoop *mainLoop, LSError *lserror) { _LSErrorIfFail(sh != NULL, lserror); _LSErrorIfFail(mainLoop != NULL, lserror); LSHANDLE_VALIDATE(sh); GMainContext *context = g_main_loop_get_context(mainLoop); _LSErrorIfFailMsg(context != NULL, lserror, -1, "%s: %s", __FUNCTION__, ": No maincontext."); _LSTransportGmainAttach(sh->transport, context); sh->context = g_main_context_ref(context); return true; }