webOS Userland
Native system APIs for webOS
libhelpers.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 typedef struct LSHandle LSHandle;
17 typedef struct LSMessage LSMessage;
18 typedef unsigned long LSMessageToken;
19 
20 typedef bool (*LSFilterFunc) (LSHandle *sh, LSMessage *reply, void *ctx);
21 
22 
26 typedef struct HContext {
30  LSFilterFunc callback;
31  void* userdata;
32  void* unknown;
36  int multiple;
40  int pub;
41  LSMessageToken ret_token;
42 } HContext;
43 
51 int HLunaServiceCall(const char *uri, const char *payload, HContext *context);
52 
59 
65 const char *HLunaServiceMessage(LSMessage *msg);
66 
67 #ifdef __cplusplus
68 }
69 #endif
int HLunaServiceCall(const char *uri, const char *payload, HContext *context)
Send luna call.
int HUnregisterServiceCallback(HContext *context)
Unregister a service callback.
const char * HLunaServiceMessage(LSMessage *msg)
Get payload message from luna call response.
Context for luna service calls.
Definition: libhelpers.h:26
int pub
Whether the call is a public call or private call.
Definition: libhelpers.h:40
int multiple
Whether the call is multiple (like subscription), or one-shot.
Definition: libhelpers.h:36
LSFilterFunc callback
Callback function called on incoming message.
Definition: libhelpers.h:30