Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix(typedefs) : revert typedefs parity-clib
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasad1 committed Nov 20, 2018
1 parent d8d5e66 commit 1fa9ce9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions parity-clib/parity.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#include <stddef.h>

typedef void (callback)(void*, const char*, size_t);

/// Parameters to pass to `parity_start`.
struct ParityParams {
/// Configuration object, as handled by the `parity_config_*` functions.
Expand All @@ -33,7 +31,7 @@ struct ParityParams {
///
/// The first parameter of the callback is the value of `on_client_restart_cb_custom`.
/// The second and third parameters of the callback are the string pointer and length.
callback *on_client_restart_cb;
void (*on_client_restart_cb)(void* custom, const char* new_chain, size_t new_chain_len);

/// Custom parameter passed to the `on_client_restart_cb` callback as first parameter.
void *on_client_restart_cb_custom;
Expand Down Expand Up @@ -103,7 +101,8 @@ void parity_destroy(void* parity);
/// - On success : The parity client reference and the query string were valid
/// - On error : The parity client reference and the query string were not valid
///
int parity_rpc(const void *const parity, const char* rpc_query, size_t rpc_len, size_t timeout_ms, callback response);
int parity_rpc(const void *const parity, const char* rpc_query, size_t rpc_len, size_t timeout_ms,
void (*subscribe)(void* custom, const char* response, size_t len));


/// Subscribes to the specified websocket event
Expand All @@ -117,7 +116,8 @@ int parity_rpc(const void *const parity, const char* rpc_query, size_t rpc_len,
// which should later be used cancel the subscription
/// - On error : The function returns a null pointer
///
const void *const parity_subscribe_ws(const void *const parity, const char* ws_query, size_t len, callback response);
const void *const parity_subscribe_ws(const void *const parity, const char* ws_query, size_t len,
void (*subscribe)(void* custom, const char* response, size_t len));

/// Unsubscribes from a specific websocket event. Caution this function consumes the session object and must only be
/// exactly per session.
Expand All @@ -133,7 +133,7 @@ const void *const parity_subscribe_ws(const void *const parity, const char* ws_q
/// - On error : The function returns non-zero
//
int parity_unsubscribe_ws(const void *const parity, const void *const session, const char* ws_query,
size_t len, size_t timeout, callback response);
size_t len, size_t timeout, void (*unsubscribe)(void* custom, const char* response, size_t len));

/// Sets a callback to call when a panic happens in the Rust code.
///
Expand All @@ -150,7 +150,7 @@ int parity_unsubscribe_ws(const void *const parity, const void *const session, c
/// The callback can be called from any thread and multiple times simultaneously. Make sure that
/// your code is thread safe.
///
int parity_set_panic_hook(callback panic, void* param);
int parity_set_panic_hook(void (*cb)(void* param, const char* msg, size_t msg_len), void* param);

#ifdef __cplusplus
}
Expand Down

0 comments on commit 1fa9ce9

Please sign in to comment.