mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
jsonrpc: make struct json_connection definition private.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
47d2a71ef0
commit
f9fd802147
@@ -31,6 +31,35 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
|
struct json_connection {
|
||||||
|
/* The global state */
|
||||||
|
struct lightningd *ld;
|
||||||
|
|
||||||
|
/* This io_conn (and our owner!) */
|
||||||
|
struct io_conn *conn;
|
||||||
|
|
||||||
|
/* Logging for this json connection. */
|
||||||
|
struct log *log;
|
||||||
|
|
||||||
|
/* The buffer (required to interpret tokens). */
|
||||||
|
char *buffer;
|
||||||
|
|
||||||
|
/* Internal state: */
|
||||||
|
/* How much is already filled. */
|
||||||
|
size_t used;
|
||||||
|
/* How much has just been filled. */
|
||||||
|
size_t len_read;
|
||||||
|
|
||||||
|
/* We've been told to stop. */
|
||||||
|
bool stop;
|
||||||
|
|
||||||
|
/* Current command. */
|
||||||
|
struct command *command;
|
||||||
|
|
||||||
|
/* Our json_stream */
|
||||||
|
struct json_stream *js;
|
||||||
|
};
|
||||||
|
|
||||||
/* jcon and cmd have separate lifetimes: we detach them on either destruction */
|
/* jcon and cmd have separate lifetimes: we detach them on either destruction */
|
||||||
static void destroy_jcon(struct json_connection *jcon)
|
static void destroy_jcon(struct json_connection *jcon)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ enum command_mode {
|
|||||||
CMD_USAGE
|
CMD_USAGE
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Context for a command (from JSON, but might outlive the connection!)
|
/* Context for a command (from JSON, but might outlive the connection!). */
|
||||||
* You can allocate off this for temporary objects. */
|
/* FIXME: move definition into jsonrpc.c */
|
||||||
struct command {
|
struct command {
|
||||||
/* The global state */
|
/* The global state */
|
||||||
struct lightningd *ld;
|
struct lightningd *ld;
|
||||||
@@ -38,35 +38,6 @@ struct command {
|
|||||||
bool have_json_stream;
|
bool have_json_stream;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct json_connection {
|
|
||||||
/* The global state */
|
|
||||||
struct lightningd *ld;
|
|
||||||
|
|
||||||
/* This io_conn (and our owner!) */
|
|
||||||
struct io_conn *conn;
|
|
||||||
|
|
||||||
/* Logging for this json connection. */
|
|
||||||
struct log *log;
|
|
||||||
|
|
||||||
/* The buffer (required to interpret tokens). */
|
|
||||||
char *buffer;
|
|
||||||
|
|
||||||
/* Internal state: */
|
|
||||||
/* How much is already filled. */
|
|
||||||
size_t used;
|
|
||||||
/* How much has just been filled. */
|
|
||||||
size_t len_read;
|
|
||||||
|
|
||||||
/* We've been told to stop. */
|
|
||||||
bool stop;
|
|
||||||
|
|
||||||
/* Current command. */
|
|
||||||
struct command *command;
|
|
||||||
|
|
||||||
/* Our json_stream */
|
|
||||||
struct json_stream *js;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct json_command {
|
struct json_command {
|
||||||
const char *name;
|
const char *name;
|
||||||
void (*dispatch)(struct command *,
|
void (*dispatch)(struct command *,
|
||||||
|
|||||||
Reference in New Issue
Block a user