Skip to content

Commit

Permalink
header cleanup: sort include lines into alpha order, after config.h
Browse files Browse the repository at this point in the history
This makes merging easier in future.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jan 21, 2016
1 parent 4dafeba commit d733e82
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 12 deletions.
3 changes: 2 additions & 1 deletion bitcoin/address.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef LIGHTNING_BITCOIN_ADDRESS_H
#define LIGHTNING_BITCOIN_ADDRESS_H
#include <ccan/short_types/short_types.h>
#include "config.h"
#include <ccan/crypto/ripemd160/ripemd160.h>
#include <ccan/short_types/short_types.h>

struct pubkey;

Expand Down
2 changes: 2 additions & 0 deletions bitcoin/base58.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#ifndef LIGHTNING_BITCOIN_BASE58_H
#define LIGHTNING_BITCOIN_BASE58_H
#include "config.h"

#include <ccan/crypto/ripemd160/ripemd160.h>
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
Expand Down
1 change: 1 addition & 0 deletions bitcoin/locktime.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_BITCOIN_LOCKTIME_H
#define LIGHTNING_BITCOIN_LOCKTIME_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <stdbool.h>

Expand Down
1 change: 1 addition & 0 deletions bitcoin/privkey.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_BITCOIN_PRIVKEY_H
#define LIGHTNING_BITCOIN_PRIVKEY_H
#include "config.h"
#include <ccan/short_types/short_types.h>

/* This is a private key. Keep it secret. */
Expand Down
3 changes: 2 additions & 1 deletion bitcoin/pubkey.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef LIGHTNING_BITCOIN_PUBKEY_H
#define LIGHTNING_BITCOIN_PUBKEY_H
#include "config.h"
#include "secp256k1.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include "secp256k1.h"

struct privkey;

Expand Down
3 changes: 2 additions & 1 deletion bitcoin/script.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef LIGHTNING_BITCOIN_SCRIPT_H
#define LIGHTNING_BITCOIN_SCRIPT_H
#include "config.h"
#include "signature.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include "signature.h"

struct bitcoin_address;
struct pubkey;
Expand Down
1 change: 1 addition & 0 deletions bitcoin/shadouble.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_BITCOIN_SHADOUBLE_H
#define LIGHTNING_BITCOIN_SHADOUBLE_H
#include "config.h"
#include <ccan/crypto/sha256/sha256.h>

/* To explicitly distinguish between single sha and bitcoin's standard double */
Expand Down
3 changes: 2 additions & 1 deletion bitcoin/signature.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef LIGHTNING_BITCOIN_SIGNATURE_H
#define LIGHTNING_BITCOIN_SIGNATURE_H
#include "config.h"
#include "secp256k1.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include "secp256k1.h"

enum sighash_type {
SIGHASH_ALL = 1,
Expand Down
3 changes: 2 additions & 1 deletion bitcoin/tx.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef LIGHTNING_BITCOIN_TX_H
#define LIGHTNING_BITCOIN_TX_H
#include "config.h"
#include "shadouble.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include "shadouble.h"

/* We unpack varints for our in-memory representation */
#define varint_t u64
Expand Down
3 changes: 2 additions & 1 deletion close_tx.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef LIGHTNING_CLOSE_TX_H
#define LIGHTNING_CLOSE_TX_H
#include <ccan/tal/tal.h>
#include "config.h"
#include "lightning.pb-c.h"
#include <ccan/tal/tal.h>

struct sha256_double;

Expand Down
3 changes: 2 additions & 1 deletion commit_tx.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef LIGHTNING_COMMIT_TX_H
#define LIGHTNING_COMMIT_TX_H
#include <ccan/tal/tal.h>
#include "config.h"
#include "lightning.pb-c.h"
#include <ccan/tal/tal.h>

struct channel_state;
struct sha256_double;
Expand Down
1 change: 1 addition & 0 deletions find_p2sh_out.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_FIND_P2SH_OUT_H
#define LIGHTNING_FIND_P2SH_OUT_H
#include "config.h"
#include <ccan/short_types/short_types.h>

struct bitcoin_tx;
Expand Down
4 changes: 2 additions & 2 deletions funding.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef LIGHTNING_FUNDING_H
#define LIGHTNING_FUNDING_H
#include "config.h"
#include "lightning.pb-c.h"
#include <ccan/tal/tal.h>
#include <stdbool.h>

#include "lightning.pb-c.h"

struct channel_oneside {
/* Payment and fee is in millisatoshi. */
uint32_t pay_msat, fee_msat;
Expand Down
1 change: 1 addition & 0 deletions opt_bits.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_OPT_BITS_H
#define LIGHTNING_OPT_BITS_H
#include "config.h"
#include <ccan/opt/opt.h>
#include <ccan/short_types/short_types.h>

Expand Down
1 change: 1 addition & 0 deletions overflows.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_OVERFLOWS_H
#define LIGHTNING_OVERFLOWS_H
#include "config.h"

static inline bool add_overflows_size_t(uint64_t a, uint64_t b)
{
Expand Down
1 change: 1 addition & 0 deletions permute_tx.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_PERMUTE_TX_H
#define LIGHTNING_PERMUTE_TX_H
#include "config.h"
#include "bitcoin/tx.h"

/* Permute the transaction into BIP69 order.
Expand Down
4 changes: 3 additions & 1 deletion pkt.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#ifndef LIGHTNING_PKT_H
#define LIGHTNING_PKT_H
#include "config.h"

/* Simple (non-threadsafe!) wrapper for protobufs.
*
* This could be a simple set of macros, if the protobuf-c people hadn't
* insisted on "prettifing" the names they generate into CamelCase.
*/
#include "lightning.pb-c.h"
#include <ccan/endian/endian.h>
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include "lightning.pb-c.h"

/* A packet, ready to be de-protobuf'ed. */
struct pkt {
Expand Down
3 changes: 2 additions & 1 deletion protobuf_convert.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef LIGHTNING_PROTOBUF_CONVERT_H
#define LIGHTNING_PROTOBUF_CONVERT_H
#include "config.h"
#include "lightning.pb-c.h"
#include <ccan/tal/tal.h>
#include <stdbool.h>
#include "lightning.pb-c.h"

/* Convert to-from protobuf to internal representation. */
struct signature;
Expand Down
4 changes: 3 additions & 1 deletion state.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#ifndef LIGHTNING_STATE_H
#define LIGHTNING_STATE_H
#include "config.h"

#include <ccan/tal/tal.h>
#include <state_types.h>
#include <stdbool.h>
#include <ccan/tal/tal.h>

enum cmd_complete_status {
CMD_STATUS_ONGOING,
Expand Down
1 change: 1 addition & 0 deletions state_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_STATE_TYPES_H
#define LIGHTNING_STATE_TYPES_H
#include "config.h"
/* FIXME: cdump is really dumb, so we put these in their own header. */
#include "lightning.pb-c.h"

Expand Down
1 change: 1 addition & 0 deletions version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef LIGHTNING_VERSION_H
#define LIGHTNING_VERSION_H
#include "config.h"
#include <ccan/opt/opt.h>

char *version_and_exit(const void *unused);
Expand Down

0 comments on commit d733e82

Please sign in to comment.