From 005645221f3d4dd432970f8f28d9092d66d61213 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Sat, 15 Feb 2014 20:16:19 +0100 Subject: ipc: Consistent coding style and major cleanup Signed-off-by: Paul Kocialkowski --- samsung-ipc/ipc.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'samsung-ipc/ipc.h') diff --git a/samsung-ipc/ipc.h b/samsung-ipc/ipc.h index 5870cdd..b50303e 100644 --- a/samsung-ipc/ipc.h +++ b/samsung-ipc/ipc.h @@ -2,6 +2,7 @@ * This file is part of libsamsung-ipc. * * Copyright (C) 2011 Simon Busch + * Copyright (C) 2014 Paul Kocialkowski * * libsamsung-ipc is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,19 +30,19 @@ * Structures */ -struct ipc_ops { - int (*bootstrap)(struct ipc_client *client); - int (*send)(struct ipc_client *client, struct ipc_message_info *); - int (*recv)(struct ipc_client *client, struct ipc_message_info *); +struct ipc_client_ops { + int (*boot)(struct ipc_client *client); + int (*send)(struct ipc_client *client, struct ipc_message *message); + int (*recv)(struct ipc_client *client, struct ipc_message *message); }; -struct ipc_handlers { +struct ipc_client_handlers { /* Transport handlers */ int (*open)(void *transport_data, int type); int (*close)(void *transport_data); - int (*read)(void *transport_data, void *buffer, unsigned int length); - int (*write)(void *transport_data, void *buffer, unsigned int length); + int (*read)(void *transport_data, void *buffer, size_t length); + int (*write)(void *transport_data, const void *buffer, size_t length); int (*poll)(void *transport_data, struct timeval *timeout); void *transport_data; @@ -63,12 +64,12 @@ struct ipc_handlers { int (*data_destroy)(void *transport_data, void *power_data, void *gprs_data); }; -struct ipc_gprs_specs { +struct ipc_client_gprs_specs { char *(*gprs_get_iface)(int cid); int (*gprs_get_capabilities)(struct ipc_client_gprs_capabilities *capabilities); }; -struct ipc_nv_data_specs { +struct ipc_client_nv_data_specs { char *nv_data_path; char *nv_data_md5_path; char *nv_data_backup_path; @@ -84,10 +85,10 @@ struct ipc_client { void (*log_callback)(void *log_data, const char *message); void *log_data; - struct ipc_ops *ops; - struct ipc_handlers *handlers; - struct ipc_gprs_specs *gprs_specs; - struct ipc_nv_data_specs *nv_data_specs; + struct ipc_client_ops *ops; + struct ipc_client_handlers *handlers; + struct ipc_client_gprs_specs *gprs_specs; + struct ipc_client_nv_data_specs *nv_data_specs; }; /* -- cgit v1.1