diff --git a/clients/simple_client/simple_client.c b/clients/simple_client/simple_client.c index 3e6ba181..16aaad70 100644 --- a/clients/simple_client/simple_client.c +++ b/clients/simple_client/simple_client.c @@ -144,8 +144,7 @@ main(int argc, char **argv) printf("%s: got config with key '%s', value_size %d\n", __FUNCTION__, lash_config_get_key(config), lash_config_get_value_size(config)); - lash_config_free(config); - free(config); + lash_config_destroy(config); } lash_send_event(client, event); break; diff --git a/lash/types.h b/lash/types.h index be1d3ed6..b3770217 100644 --- a/lash/types.h +++ b/lash/types.h @@ -54,6 +54,8 @@ enum LASH_Client_Flag enum LASH_Event_Type { + LASH_Event_Unknown = 0, + /* for normal clients */ LASH_Client_Name = 1, /* set the client's user-visible name */ LASH_Jack_Client_Name, /* tell the server what name the client is connected to jack with */ diff --git a/lashd/appdb.c b/lashd/appdb.c index b08a9399..f2539c52 100644 --- a/lashd/appdb.c +++ b/lashd/appdb.c @@ -544,7 +544,7 @@ lash_appdb_load_dir( fail_free_path: free(directory_path); -fail: +//fail: return ret; } diff --git a/lashd/client.c b/lashd/client.c index b62daa90..577ade0d 100644 --- a/lashd/client.c +++ b/lashd/client.c @@ -33,6 +33,8 @@ #include "jack_patch.h" #include "alsa_patch.h" #include "store.h" +#include "dbus_iface_control.h" +#include "file.h" client_t * client_new(void) diff --git a/lashd/dbus_iface_server.c b/lashd/dbus_iface_server.c index 3189817b..e1012856 100644 --- a/lashd/dbus_iface_server.c +++ b/lashd/dbus_iface_server.c @@ -36,6 +36,7 @@ #include "dbus/interface.h" #include "dbus/error.h" #include "lash/types.h" +#include "store.h" static void lashd_dbus_ping(method_call_t *call) @@ -274,6 +275,7 @@ lashd_dbus_get_alsa_id(method_call_t *call) method_return_new_single(call, DBUS_TYPE_BYTE, &client->alsa_client_id); } +#if 0 static void lashd_dbus_save_project(method_call_t *call) { @@ -315,6 +317,7 @@ lashd_dbus_close_project(method_call_t *call) server_close_project(g_server, client->project); } +#endif static bool check_tasks(method_call_t *call, diff --git a/lashd/log.c b/lashd/log.c index c22c734e..3bf4996a 100644 --- a/lashd/log.c +++ b/lashd/log.c @@ -129,7 +129,7 @@ void lash_log_init() free_log_dir: free(lash_log_dir); -free_log_home: +//free_log_home: free(xdg_log_home); exit: diff --git a/lashd/main.c b/lashd/main.c index 1b60764e..cdcd098e 100644 --- a/lashd/main.c +++ b/lashd/main.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ +#define _GNU_SOURCE + #include "../config.h" #include diff --git a/lashd/project.c b/lashd/project.c index 2fdeb286..0f300f92 100644 --- a/lashd/project.c +++ b/lashd/project.c @@ -46,6 +46,7 @@ #include "file.h" #include "jack_patch.h" #include "server.h" +#include "loader.h" #include "dbus_iface_control.h" #include "common/safety.h" #include "common/debug.h" @@ -362,7 +363,6 @@ project_resume_client(project_t *project, client_t *client, client_t *lost_client) { - lash_event_t *event; char *name; bool stateless_client; @@ -591,6 +591,7 @@ project_move(project_t *project, } } +#if 0 /* This is the handler to use when calling a client's Save method. At the moment it isn't used but it will be, so don't delete. */ static void @@ -626,6 +627,7 @@ project_save_client_handler(DBusPendingCall *pending, dbus_pending_call_unref(pending); } +#endif static __inline__ void project_save_clients(project_t *project) diff --git a/lashd/project.h b/lashd/project.h index a8eee466..6383e77d 100644 --- a/lashd/project.h +++ b/lashd/project.h @@ -157,4 +157,9 @@ void project_set_modified_status(project_t *project, bool new_status); +void +project_new_client( + project_t *project, + client_t *client); + #endif /* __LASHD_PROJECT_H__ */ diff --git a/lashd/server.c b/lashd/server.c index 8f32f7d1..bbc1628d 100644 --- a/lashd/server.c +++ b/lashd/server.c @@ -400,7 +400,6 @@ server_get_newborn_project( { struct list_head * node_ptr; project_t * project_ptr; - client_t * client_ptr; project_ptr = NULL; diff --git a/lashd/store.c b/lashd/store.c index 1025e580..6521dc06 100644 --- a/lashd/store.c +++ b/lashd/store.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ +#define _GNU_SOURCE + #include #include #include @@ -76,8 +78,6 @@ void store_destroy(store_t *store) { if (store) { - struct list_head *node, *next; - lash_free(&store->dir); store_destroy_key_list(&store->keys); store_destroy_key_list(&store->removed_keys); @@ -433,7 +433,7 @@ store_write(store_t *store) bool store_set_config(store_t *store, const char *key_name, - void *value, + const void *value, size_t size, int type) { diff --git a/lashd/store.h b/lashd/store.h index 65a9bd58..b0430007 100644 --- a/lashd/store.h +++ b/lashd/store.h @@ -59,7 +59,7 @@ store_write(store_t *store); bool store_set_config(store_t *store, const char *key_name, - void *value, + const void *value, size_t size, int type); diff --git a/liblash/dbus_iface_client.c b/liblash/dbus_iface_client.c index 0e54b9e4..97c41619 100644 --- a/liblash/dbus_iface_client.c +++ b/liblash/dbus_iface_client.c @@ -390,6 +390,7 @@ fail: client->pending_task = 0; } +#if 0 static void lash_dbus_save_data_set(method_call_t *call) { @@ -406,6 +407,7 @@ lash_dbus_save_data_set(method_call_t *call) lash_new_save_data_set_task(client_ptr, task_id); } +#endif static void lash_dbus_load_data_set(method_call_t *call) @@ -517,7 +519,7 @@ void lash_new_quit_task(lash_client_t *client) { if (client->pending_task) - lash_error("Warning: Task %llu is unfinished, quitting anyway"); + lash_error("Warning: Task %llu is unfinished, quitting anyway", client->pending_task); /* Check if a quit callback has been registered */ if (client->cb.quit) { diff --git a/liblash/event.c b/liblash/event.c index 32efb7f9..f428a305 100644 --- a/liblash/event.c +++ b/liblash/event.c @@ -33,6 +33,8 @@ #include "event.h" #include "client.h" +#include "lash/client_interface.h" + #define set_string_property(property, value) \ do { \ if (property) \ @@ -347,6 +349,8 @@ lash_event_get_type(const lash_event_t *event) { if (event) return event->type; + + return LASH_Event_Unknown; } void @@ -367,6 +371,8 @@ lash_event_get_string(const lash_event_t *event) { if (event) return event->string; + + return NULL; } void @@ -382,6 +388,8 @@ lash_event_get_project(const lash_event_t *event) { if (event) return event->project; + + return NULL; } void @@ -425,6 +433,8 @@ lash_event_get_alsa_client_id(const lash_event_t *event) { if (event) return lash_str_get_alsa_client_id(event->string); + + return 0; } void diff --git a/liblash/lash.c b/liblash/lash.c index b2ed5528..83440ffe 100644 --- a/liblash/lash.c +++ b/liblash/lash.c @@ -46,6 +46,9 @@ #include "client.h" #include "lash_config.h" +#include "dbus_iface_client.h" + +#if 0 static void ping_handler(DBusPendingCall *pending, void *data) @@ -56,6 +59,7 @@ ping_handler(DBusPendingCall *pending, dbus_pending_call_unref(pending); fprintf(stderr, "Server replied: Pong!\n"); } +#endif static lash_client_t * lash_client_new_with_service(void) @@ -113,7 +117,7 @@ lash_server_signal_handler(lash_client_t *client, else if ((client->flags & LASH_Config_File)) lash_new_save_task(client, task_id); } else { - lash_dbus_error("Task %llu is unfinished", + lash_error("Task %llu is unfinished", client->pending_task); } @@ -468,8 +472,7 @@ lash_client_open(const char *class, } if (dbus_error_is_set(&err)) { - lash_error("Failed to add D-Bus match rule: %s" - "%s", err.message); + lash_error("Failed to add D-Bus match rule: %s", err.message); dbus_error_free(&err); lash_client_destroy(client); client = NULL; @@ -1150,7 +1153,6 @@ lash_send_config(lash_client_t *client, config->value, config->value_size); } -end: lash_config_destroy(config); } diff --git a/liblash/lash_config.c b/liblash/lash_config.c index 7684a9dd..f6e182e5 100644 --- a/liblash/lash_config.c +++ b/liblash/lash_config.c @@ -29,6 +29,8 @@ #include "lash_config.h" +#include "dbus/method.h" + bool lash_config_write(lash_config_handle_t *handle, const char *key,