summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'bindings')
-rw-r--r--bindings/audio/audio-pulse.c2
-rw-r--r--bindings/intrinsics/afb-dbus-binding.c4
-rw-r--r--bindings/media/media-rygel.c4
-rw-r--r--bindings/radio/radio-api.c6
-rw-r--r--bindings/radio/radio-rtlsdr.c8
-rw-r--r--bindings/samples/AuthLogin.c36
-rw-r--r--bindings/samples/DemoContext.c16
-rw-r--r--bindings/samples/DemoPost.c2
-rw-r--r--bindings/samples/HelloWorld.c8
9 files changed, 43 insertions, 43 deletions
diff --git a/bindings/audio/audio-pulse.c b/bindings/audio/audio-pulse.c
index 34643603..a6d1e4dc 100644
--- a/bindings/audio/audio-pulse.c
+++ b/bindings/audio/audio-pulse.c
@@ -298,7 +298,7 @@ void _pulse_enumerate_cards () {
asprintf (&alsa_info[i]->synonyms, "%s:%s", alsa_info[i]->synonyms, alsa_name);
new_info = 0;
break;
- }
+ }
}
/* it was not ; create it */
if (new_info) {
diff --git a/bindings/intrinsics/afb-dbus-binding.c b/bindings/intrinsics/afb-dbus-binding.c
index 59fe78d6..dda59453 100644
--- a/bindings/intrinsics/afb-dbus-binding.c
+++ b/bindings/intrinsics/afb-dbus-binding.c
@@ -52,7 +52,7 @@ static int packlist(struct sd_bus_message *msg, const char *signature, struct js
/*
* Get the string of 'key' from 'obj'
* Returns NULL if 'key' isn't in 'obj'
- */
+ */
static const char *strval(struct json_object *obj, const char *key)
{
struct json_object *keyval;
@@ -110,7 +110,7 @@ static int lentype(const char *signature, int allows_dict, int allows_not_basic)
}
if (rc < 0)
break;
- return 1 + len;
+ return 1 + len;
case SD_BUS_TYPE_DICT_ENTRY_BEGIN:
if (!allows_not_basic || !allows_dict)
diff --git a/bindings/media/media-rygel.c b/bindings/media/media-rygel.c
index 00327795..38a8a442 100644
--- a/bindings/media/media-rygel.c
+++ b/bindings/media/media-rygel.c
@@ -146,7 +146,7 @@ json_object* _rygel_list (mediaCtxHandleT *ctx) {
json_object_object_add (json_i, "title", json_title);
json_object_array_add (json_a, json_i);
- free (id); free (title);
+ free (id); free (title);
i++;
}
@@ -549,7 +549,7 @@ static void _rygel_content_cb (GUPnPServiceProxy *content_dir, GUPnPServiceProxy
return;
if (number_returned == 1) {
- found = strstr (result, "id=\"");
+ found = strstr (result, "id=\"");
found += 4;
strncpy (subid, found, 32); subid[32] = '\0';
diff --git a/bindings/radio/radio-api.c b/bindings/radio/radio-api.c
index 0ed60e1c..7dd22b69 100644
--- a/bindings/radio/radio-api.c
+++ b/bindings/radio/radio-api.c
@@ -38,7 +38,7 @@ static pluginHandleT *the_radio = NULL;
/* detect new radio devices */
void updateRadioDevList(pluginHandleT *handle) {
- int idx;
+ int idx;
// loop on existing radio if any
for (idx = 0; idx < _radio_dev_count(); idx++) {
@@ -305,7 +305,7 @@ static void mute (struct afb_req request) { /* AFB_SESSION_CHECK */
json_object_object_add (jresp, "mute", json_object_new_string ("off"));
}
- afb_req_success (request, jresp, "Radio - Mute set");
+ afb_req_success (request, jresp, "Radio - Mute set");
}
static void play (struct afb_req request) { /* AFB_SESSION_CHECK */
@@ -318,7 +318,7 @@ static void play (struct afb_req request) { /* AFB_SESSION_CHECK */
afb_req_fail (request, "failed", "you must call 'init' first");
return;
}
-
+
/* no "?value=" parameter : return current state */
if (!value || !ctx->radio) {
ctx->is_playing ?
diff --git a/bindings/radio/radio-rtlsdr.c b/bindings/radio/radio-rtlsdr.c
index 7f76306e..00ceba63 100644
--- a/bindings/radio/radio-rtlsdr.c
+++ b/bindings/radio/radio-rtlsdr.c
@@ -37,13 +37,13 @@ static struct dev_ctx **dev_ctx = NULL;
/* Radio initialization should be done only when user start the radio and not at plugin initialization
Making this call too early would impose to restart the binder to detect a radio */
unsigned char _radio_on (unsigned int num, radioCtxHandleT *ctx) {
-
+
if (num >= _radio_dev_count())
return 0;
-
+
if (init_dev_count < _radio_dev_count()) {
init_dev_count = _radio_dev_count();
- dev_ctx = (dev_ctx_T**) realloc (dev_ctx, init_dev_count * sizeof(dev_ctx_T*));
+ dev_ctx = (dev_ctx_T**) realloc (dev_ctx, init_dev_count * sizeof(dev_ctx_T*));
}
dev_ctx[num] = (dev_ctx_T*) malloc (sizeof(dev_ctx_T));
@@ -69,7 +69,7 @@ void _radio_off (unsigned int num) {
_radio_dev_free (dev_ctx[num]);
free (dev_ctx[num]);
}
-
+
/* free(dev_ctx); */
}
diff --git a/bindings/samples/AuthLogin.c b/bindings/samples/AuthLogin.c
index efecf240..ceb833e9 100644
--- a/bindings/samples/AuthLogin.c
+++ b/bindings/samples/AuthLogin.c
@@ -23,7 +23,7 @@
// Dummy sample of Client Application Context
typedef struct {
- int something;
+ int something;
void *whateveryouwant;
} MyClientApplicationHandle;
@@ -45,33 +45,33 @@ static void clientContextConnect (struct afb_req request)
// do something intelligent to check if we should or not update level of assurance from 0(anonymous) to 1(logged)
afb_req_session_set_LOA(request, 1);
-
+
// Send response to UI
- jresp = json_object_new_object();
+ jresp = json_object_new_object();
json_object_object_add(jresp, "token", json_object_new_string ("A New Token and Session Context Was Created"));
afb_req_success(request, jresp, NULL);
-
+
}
// Before entering here token will be check and renew
static void clientContextRefresh (struct afb_req request) {
json_object *jresp;
-
+
jresp = json_object_new_object();
- json_object_object_add(jresp, "token", json_object_new_string ("Token was refreshed"));
-
+ json_object_object_add(jresp, "token", json_object_new_string ("Token was refreshed"));
+
afb_req_success(request, jresp, NULL);
}
// Session token will we verified before entering here
static void clientContextCheck (struct afb_req request) {
-
- json_object *jresp = json_object_new_object();
- json_object_object_add(jresp, "isvalid", json_object_new_boolean (TRUE));
-
+
+ json_object *jresp = json_object_new_object();
+ json_object_object_add(jresp, "isvalid", json_object_new_boolean (TRUE));
+
afb_req_success(request, jresp, NULL);
}
@@ -79,18 +79,18 @@ static void clientContextCheck (struct afb_req request) {
// Close and Free context
static void clientContextLogout (struct afb_req request) {
json_object *jresp;
-
+
/* after this call token will be reset
- * - no further access to API will be possible
+ * - no further access to API will be possible
* - every context from any used plugin will be freed
*/
-
+
jresp = json_object_new_object();
json_object_object_add(jresp, "info", json_object_new_string ("Token and all resources are released"));
-
- // WARNING: if you free context resource manually here do not forget to set *request.context=NULL;
+
+ // WARNING: if you free context resource manually here do not forget to set *request.context=NULL;
afb_req_success(request, jresp, NULL);
-
+
afb_req_session_set_LOA(request, 0);
}
// Close and Free context
@@ -100,7 +100,7 @@ static void clientGetPing (struct afb_req request) {
jresp = json_object_new_object();
json_object_object_add(jresp, "count", json_object_new_int (count ++));
-
+
afb_req_success(request, jresp, NULL);
}
diff --git a/bindings/samples/DemoContext.c b/bindings/samples/DemoContext.c
index ef703759..243ed687 100644
--- a/bindings/samples/DemoContext.c
+++ b/bindings/samples/DemoContext.c
@@ -22,10 +22,10 @@
#include <afb/afb-plugin.h>
typedef struct {
- /*
+ /*
* client context is attached a session but private to a each plugin.
* Context is passed to each API under request->context
- *
+ *
* Note:
* -client context is free when a session is closed. Developer should not
* forget that even if context is private to each plugin, session is unique
@@ -38,13 +38,13 @@ typedef struct {
* -when an API use AFB_SESSION_RESET this close the session and each plugin
* will be notified to free ressources.
*/
-
+
int count;
char *abcd;
-
+
} MyClientContextT;
-// This function is call at session open time. Any client trying to
+// This function is call at session open time. Any client trying to
// call it with an already open session will be denied.
// Ex: http://localhost:1234/api/context/create?token=123456789
static void myCreate (struct afb_req request)
@@ -53,7 +53,7 @@ static void myCreate (struct afb_req request)
// store something in our plugin private client context
ctx->count = 0;
- ctx->abcd = "SomeThingUseful";
+ ctx->abcd = "SomeThingUseful";
afb_req_context_set(request, ctx, free);
afb_req_success_f(request, NULL, "SUCCESS: create client context for plugin [%s]", ctx->abcd);
@@ -66,7 +66,7 @@ static void myCreate (struct afb_req request)
static void myAction (struct afb_req request)
{
MyClientContextT *ctx = (MyClientContextT*) afb_req_context_get(request);
-
+
// store something in our plugin private client context
ctx->count++;
afb_req_success_f(request, NULL, "SUCCESS: plugin [%s] Check=[%d]\n", ctx->abcd, ctx->count);
@@ -79,7 +79,7 @@ static void myAction (struct afb_req request)
static void myClose (struct afb_req request)
{
MyClientContextT *ctx = (MyClientContextT*) afb_req_context_get(request);
-
+
// store something in our plugin private client context
ctx->count++;
afb_req_success_f(request, NULL, "SUCCESS: plugin [%s] Close=[%d]\n", ctx->abcd, ctx->count);
diff --git a/bindings/samples/DemoPost.c b/bindings/samples/DemoPost.c
index b61b91c4..69de5572 100644
--- a/bindings/samples/DemoPost.c
+++ b/bindings/samples/DemoPost.c
@@ -67,7 +67,7 @@ static void UploadMusic (struct afb_req request)
}
// PostForm callback is called multiple times (one or each key within form, or once per file buffer)
-// When file has been fully uploaded call is call with item==NULL
+// When file has been fully uploaded call is call with item==NULL
static void UploadImage (struct afb_req request)
{
Uploads(request, "images");
diff --git a/bindings/samples/HelloWorld.c b/bindings/samples/HelloWorld.c
index b6f49b78..15544895 100644
--- a/bindings/samples/HelloWorld.c
+++ b/bindings/samples/HelloWorld.c
@@ -144,16 +144,16 @@ static void pingEvent(struct afb_req request)
// For samples https://linuxprograms.wordpress.com/2010/05/20/json-c-libjson-tutorial/
static void pingJson (struct afb_req request) {
- json_object *jresp, *embed;
-
+ json_object *jresp, *embed;
+
jresp = json_object_new_object();
json_object_object_add(jresp, "myString", json_object_new_string ("Some String"));
json_object_object_add(jresp, "myInt", json_object_new_int (1234));
-
+
embed = json_object_new_object();
json_object_object_add(embed, "subObjString", json_object_new_string ("Some String"));
json_object_object_add(embed, "subObjInt", json_object_new_int (5678));
-
+
json_object_object_add(jresp,"eobj", embed);
ping(request, jresp, "pingJson");