From 8c22bd9ee1b5effc72495ed2b0221d9fadb7c5cb Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 29 Aug 2017 01:36:01 +0930 Subject: [PATCH] headers: fix up header idempotent lines. For future reference, done via: for f in `find wire/ bitcoin/ common/ lightningd -name '*.h' ! -name 'gen*'`; do ID=`echo -n LIGHTNING/$f | tr 'a-z' 'A-Z' | tr -cs 'A-Z0-9' _`; sed 's/^#\(ifndef\|define\) .*_H$/#\1 '$ID/ < $f | sed 's,#endif /..*_H ./$,#endif /* '$ID' */,' | bagto $f; done Signed-off-by: Rusty Russell --- bitcoin/base58.h | 2 +- bitcoin/pubkey.h | 2 +- common/bip32.h | 6 +++--- common/channel_config.h | 6 +++--- common/close_tx.h | 4 ++-- common/configdir.h | 6 +++--- common/crypto_sync.h | 6 +++--- common/cryptomsg.h | 6 +++--- common/daemon_conn.h | 6 +++--- common/debug.h | 6 +++--- common/derive_basepoints.h | 6 +++--- common/dev_disconnect.h | 6 +++--- common/funding_tx.h | 6 +++--- common/htlc.h | 6 +++--- common/htlc_state.h | 6 +++--- common/htlc_tx.h | 6 +++--- common/htlc_wire.h | 6 +++--- common/json.h | 6 +++--- common/key_derive.h | 6 +++--- common/keyset.h | 6 +++--- common/msg_queue.h | 6 +++--- common/overflows.h | 6 +++--- common/peer_failed.h | 6 +++--- common/permute_tx.h | 6 +++--- common/ping.h | 6 +++--- common/pseudorand.h | 6 +++--- common/sphinx.h | 6 +++--- common/status.h | 6 +++--- common/timeout.h | 6 +++--- common/type_to_string.h | 6 +++--- common/utils.h | 6 +++--- common/utxo.h | 6 +++--- common/version.h | 6 +++--- common/withdraw_tx.h | 6 +++--- lightningd/bitcoind.h | 6 +++--- lightningd/chaintopology.h | 6 +++--- lightningd/channel/channeld_htlc.h | 6 +++--- lightningd/channel/commit_tx.h | 6 +++--- lightningd/channel/full_channel.h | 6 +++--- lightningd/dns.h | 6 +++--- lightningd/gossip/broadcast.h | 6 +++--- lightningd/gossip/routing.h | 6 +++--- lightningd/gossip_control.h | 2 +- lightningd/gossip_msg.h | 2 +- lightningd/hsm/client.h | 6 +++--- lightningd/invoice.h | 6 +++--- lightningd/jsonrpc.h | 6 +++--- lightningd/log.h | 6 +++--- lightningd/netaddr.h | 6 +++--- lightningd/onchain/onchain_types.h | 6 +++--- lightningd/onchain/onchain_wire.h | 6 +++--- lightningd/opt_time.h | 6 +++--- lightningd/options.h | 6 +++--- lightningd/watch.h | 6 +++--- 54 files changed, 153 insertions(+), 153 deletions(-) diff --git a/bitcoin/base58.h b/bitcoin/base58.h index aef2b9043..5f11ec918 100644 --- a/bitcoin/base58.h +++ b/bitcoin/base58.h @@ -50,4 +50,4 @@ bool key_from_base58(const char *base58, size_t base58_len, void base58_get_checksum(u8 csum[4], const u8 buf[], size_t buflen); -#endif /* PETTYCOIN_BITCOIN_BASE58_H */ +#endif /* LIGHTNING_BITCOIN_BASE58_H */ diff --git a/bitcoin/pubkey.h b/bitcoin/pubkey.h index 7b830d195..717fc57b1 100644 --- a/bitcoin/pubkey.h +++ b/bitcoin/pubkey.h @@ -45,4 +45,4 @@ int pubkey_cmp(const struct pubkey *a, const struct pubkey *b); * pubkey_to_hash160 - Get the hash for p2pkh payments for a given pubkey */ void pubkey_to_hash160(const struct pubkey *pk, struct ripemd160 *hash); -#endif /* LIGHTNING_PUBKEY_H */ +#endif /* LIGHTNING_BITCOIN_PUBKEY_H */ diff --git a/common/bip32.h b/common/bip32.h index 11a06f5cc..1b8bb3d6e 100644 --- a/common/bip32.h +++ b/common/bip32.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_BIP32_H -#define LIGHTNING_LIGHTNINGD_BIP32_H +#ifndef LIGHTNING_COMMON_BIP32_H +#define LIGHTNING_COMMON_BIP32_H #include "config.h" #include #include @@ -9,4 +9,4 @@ struct ext_key; void towire_ext_key(u8 **pptr, const struct ext_key *bip32); void fromwire_ext_key(const u8 **cursor, size_t *max, struct ext_key *bip32); -#endif /* LIGHTNING_LIGHTNINGD_BIP32_H */ +#endif /* LIGHTNING_COMMON_BIP32_H */ diff --git a/common/channel_config.h b/common/channel_config.h index f28db980e..ffc4b5429 100644 --- a/common/channel_config.h +++ b/common/channel_config.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_CHANNEL_CONFIG_H -#define LIGHTNING_LIGHTNINGD_CHANNEL_CONFIG_H +#ifndef LIGHTNING_COMMON_CHANNEL_CONFIG_H +#define LIGHTNING_COMMON_CHANNEL_CONFIG_H #include "config.h" #include #include @@ -45,4 +45,4 @@ struct channel_config { void towire_channel_config(u8 **pptr, const struct channel_config *config); void fromwire_channel_config(const u8 **ptr, size_t *max, struct channel_config *config); -#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_CONFIG_H */ +#endif /* LIGHTNING_COMMON_CHANNEL_CONFIG_H */ diff --git a/common/close_tx.h b/common/close_tx.h index f2051ff5b..8a94f846a 100644 --- a/common/close_tx.h +++ b/common/close_tx.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_CLOSE_TX_H -#define LIGHTNING_CLOSE_TX_H +#ifndef LIGHTNING_COMMON_CLOSE_TX_H +#define LIGHTNING_COMMON_CLOSE_TX_H #include "config.h" #include #include diff --git a/common/configdir.h b/common/configdir.h index 4e2d4c9f1..dd4790c77 100644 --- a/common/configdir.h +++ b/common/configdir.h @@ -1,9 +1,9 @@ -#ifndef LIGHTNING_DAEMON_CONFIGDIR_H -#define LIGHTNING_DAEMON_CONFIGDIR_H +#ifndef LIGHTNING_COMMON_CONFIGDIR_H +#define LIGHTNING_COMMON_CONFIGDIR_H #include "config.h" #include void configdir_register_opts(const tal_t *ctx, char **config_dir, char **rpc_filename); -#endif /* LIGHTNING_DAEMON_CONFIGDIR_H */ +#endif /* LIGHTNING_COMMON_CONFIGDIR_H */ diff --git a/common/crypto_sync.h b/common/crypto_sync.h index 4d3aff859..31c3e177a 100644 --- a/common/crypto_sync.h +++ b/common/crypto_sync.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_CRYPTO_SYNC_H -#define LIGHTNING_LIGHTNINGD_CRYPTO_SYNC_H +#ifndef LIGHTNING_COMMON_CRYPTO_SYNC_H +#define LIGHTNING_COMMON_CRYPTO_SYNC_H #include "config.h" #include #include @@ -9,4 +9,4 @@ struct crypto_state; bool sync_crypto_write(struct crypto_state *cs, int fd, const void *msg TAKES); u8 *sync_crypto_read(const tal_t *ctx, struct crypto_state *cs, int fd); -#endif /* LIGHTNING_LIGHTNINGD_CRYPTO_SYNC_H */ +#endif /* LIGHTNING_COMMON_CRYPTO_SYNC_H */ diff --git a/common/cryptomsg.h b/common/cryptomsg.h index 5bd21e41e..9c2564ff1 100644 --- a/common/cryptomsg.h +++ b/common/cryptomsg.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_CRYPTOMSG_H -#define LIGHTNING_LIGHTNINGD_CRYPTOMSG_H +#ifndef LIGHTNING_COMMON_CRYPTOMSG_H +#define LIGHTNING_COMMON_CRYPTOMSG_H #include "config.h" #include #include @@ -56,4 +56,4 @@ u8 *cryptomsg_encrypt_msg(const tal_t *ctx, bool cryptomsg_decrypt_header(struct crypto_state *cs, u8 hdr[18], u16 *lenp); u8 *cryptomsg_decrypt_body(const tal_t *ctx, struct crypto_state *cs, const u8 *in); -#endif /* LIGHTNING_LIGHTNINGD_CRYPTOMSG_H */ +#endif /* LIGHTNING_COMMON_CRYPTOMSG_H */ diff --git a/common/daemon_conn.h b/common/daemon_conn.h index eae98503f..456b1af67 100644 --- a/common/daemon_conn.h +++ b/common/daemon_conn.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_DAEMON_CONN_H -#define LIGHTNING_LIGHTNINGD_DAEMON_CONN_H +#ifndef LIGHTNING_COMMON_DAEMON_CONN_H +#define LIGHTNING_COMMON_DAEMON_CONN_H #include "config.h" #include @@ -72,4 +72,4 @@ struct io_plan *daemon_conn_read_next(struct io_conn *conn, * daemon_conn_sync_flush - Flush connection by sending all messages now.. */ bool daemon_conn_sync_flush(struct daemon_conn *dc); -#endif /* LIGHTNING_LIGHTNINGD_DAEMON_CONN_H */ +#endif /* LIGHTNING_COMMON_DAEMON_CONN_H */ diff --git a/common/debug.h b/common/debug.h index 064a6f152..cf7259a91 100644 --- a/common/debug.h +++ b/common/debug.h @@ -1,7 +1,7 @@ -#ifndef LIGHTNING_LIGHTNINGD_DEBUG_H -#define LIGHTNING_LIGHTNINGD_DEBUG_H +#ifndef LIGHTNING_COMMON_DEBUG_H +#define LIGHTNING_COMMON_DEBUG_H #include "config.h" void subdaemon_debug(int argc, char *argv[]); -#endif /* LIGHTNING_LIGHTNINGD_DEBUG_H */ +#endif /* LIGHTNING_COMMON_DEBUG_H */ diff --git a/common/derive_basepoints.h b/common/derive_basepoints.h index cd09bdef8..e36548965 100644 --- a/common/derive_basepoints.h +++ b/common/derive_basepoints.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_DERIVE_BASEPOINTS_H -#define LIGHTNING_LIGHTNINGD_DERIVE_BASEPOINTS_H +#ifndef LIGHTNING_COMMON_DERIVE_BASEPOINTS_H +#define LIGHTNING_COMMON_DERIVE_BASEPOINTS_H #include "config.h" #include #include @@ -72,4 +72,4 @@ static inline u64 revocations_received(const struct shachain *shachain) { return (1ULL << SHACHAIN_BITS) - (shachain_next_index(shachain) + 1); } -#endif /* LIGHTNING_LIGHTNINGD_DERIVE_BASEPOINTS_H */ +#endif /* LIGHTNING_COMMON_DERIVE_BASEPOINTS_H */ diff --git a/common/dev_disconnect.h b/common/dev_disconnect.h index 3146c6a5a..efa83a5d5 100644 --- a/common/dev_disconnect.h +++ b/common/dev_disconnect.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_DEV_DISCONNECT_H -#define LIGHTNING_LIGHTNINGD_DEV_DISCONNECT_H +#ifndef LIGHTNING_COMMON_DEV_DISCONNECT_H +#define LIGHTNING_COMMON_DEV_DISCONNECT_H #include "config.h" #include @@ -17,4 +17,4 @@ void dev_sabotage_fd(int fd); /* For debug code to set in daemon. */ void dev_disconnect_init(int fd); -#endif /* LIGHTNING_LIGHTNINGD_DEV_DISCONNECT_H */ +#endif /* LIGHTNING_COMMON_DEV_DISCONNECT_H */ diff --git a/common/funding_tx.h b/common/funding_tx.h index fa8dbbaae..083057018 100644 --- a/common/funding_tx.h +++ b/common/funding_tx.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_FUNDING_TX_H -#define LIGHTNING_LIGHTNINGD_FUNDING_TX_H +#ifndef LIGHTNING_COMMON_FUNDING_TX_H +#define LIGHTNING_COMMON_FUNDING_TX_H #include "config.h" #include #include @@ -41,4 +41,4 @@ struct bitcoin_tx *funding_tx(const tal_t *ctx, u64 change_satoshis, const struct pubkey *changekey, const struct ext_key *bip32_base); -#endif /* LIGHTNING_LIGHTNINGD_FUNDING_TX_H */ +#endif /* LIGHTNING_COMMON_FUNDING_TX_H */ diff --git a/common/htlc.h b/common/htlc.h index 5e80b137d..92d751586 100644 --- a/common/htlc.h +++ b/common/htlc.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_HTLC_H -#define LIGHTNING_DAEMON_HTLC_H +#ifndef LIGHTNING_COMMON_HTLC_H +#define LIGHTNING_COMMON_HTLC_H #include "config.h" #include "bitcoin/locktime.h" #include "htlc_state.h" @@ -81,4 +81,4 @@ static inline enum side str_to_side(const char *str) assert(streq(str, "REMOTE")); return REMOTE; } -#endif /* LIGHTNING_DAEMON_HTLC_H */ +#endif /* LIGHTNING_COMMON_HTLC_H */ diff --git a/common/htlc_state.h b/common/htlc_state.h index bfd125180..7818f3d4f 100644 --- a/common/htlc_state.h +++ b/common/htlc_state.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_HTLC_STATE_H -#define LIGHTNING_DAEMON_HTLC_STATE_H +#ifndef LIGHTNING_COMMON_HTLC_STATE_H +#define LIGHTNING_COMMON_HTLC_STATE_H #include "config.h" enum htlc_state { @@ -33,4 +33,4 @@ enum htlc_state { HTLC_STATE_INVALID }; -#endif /* LIGHTNING_DAEMON_HTLC_STATE_H */ +#endif /* LIGHTNING_COMMON_HTLC_STATE_H */ diff --git a/common/htlc_tx.h b/common/htlc_tx.h index 5ebb3aa3a..3ea17a337 100644 --- a/common/htlc_tx.h +++ b/common/htlc_tx.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_HTLC_TX_H -#define LIGHTNING_LIGHTNINGD_HTLC_TX_H +#ifndef LIGHTNING_COMMON_HTLC_TX_H +#define LIGHTNING_COMMON_HTLC_TX_H #include "config.h" #include @@ -86,4 +86,4 @@ u8 *htlc_offered_wscript(const tal_t *ctx, const struct ripemd160 *ripemd, const struct keyset *keyset); -#endif /* LIGHTNING_LIGHTNINGD_HTLC_TX_H */ +#endif /* LIGHTNING_COMMON_HTLC_TX_H */ diff --git a/common/htlc_wire.h b/common/htlc_wire.h index 70a0413b2..020e554f2 100644 --- a/common/htlc_wire.h +++ b/common/htlc_wire.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_HTLC_WIRE_H -#define LIGHTNING_LIGHTNINGD_HTLC_WIRE_H +#ifndef LIGHTNING_COMMON_HTLC_WIRE_H +#define LIGHTNING_COMMON_HTLC_WIRE_H #include "config.h" #include #include @@ -57,4 +57,4 @@ enum side fromwire_side(const u8 **cursor, size_t *max); void fromwire_shachain(const u8 **cursor, size_t *max, struct shachain *shachain); void fromwire_bitcoin_tx(const u8 **cursor, size_t *max, struct bitcoin_tx *tx); -#endif /* LIGHTNING_LIGHTNINGD_HTLC_WIRE_H */ +#endif /* LIGHTNING_COMMON_HTLC_WIRE_H */ diff --git a/common/json.h b/common/json.h index 3a28fa22a..c238c0525 100644 --- a/common/json.h +++ b/common/json.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_JSON_H -#define LIGHTNING_DAEMON_JSON_H +#ifndef LIGHTNING_COMMON_JSON_H +#define LIGHTNING_COMMON_JSON_H #include "config.h" #include #include @@ -106,4 +106,4 @@ void json_add_hex(struct json_result *result, const char *fieldname, void json_add_object(struct json_result *result, ...); const char *json_result_string(const struct json_result *result); -#endif /* LIGHTNING_DAEMON_JSON_H */ +#endif /* LIGHTNING_COMMON_JSON_H */ diff --git a/common/key_derive.h b/common/key_derive.h index a0ffa62b3..59be4794a 100644 --- a/common/key_derive.h +++ b/common/key_derive.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_KEY_DERIVE_H -#define LIGHTNING_LIGHTNINGD_KEY_DERIVE_H +#ifndef LIGHTNING_COMMON_KEY_DERIVE_H +#define LIGHTNING_COMMON_KEY_DERIVE_H #include "config.h" #include #include @@ -33,4 +33,4 @@ bool derive_revocation_privkey(const struct secret *base_secret, struct ext_key; bool bip32_pubkey(const struct ext_key *bip32_base, struct pubkey *pubkey, u32 index); -#endif /* LIGHTNING_LIGHTNINGD_KEY_DERIVE_H */ +#endif /* LIGHTNING_COMMON_KEY_DERIVE_H */ diff --git a/common/keyset.h b/common/keyset.h index 357a0b3d0..3ddeb8312 100644 --- a/common/keyset.h +++ b/common/keyset.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_KEYSET_H -#define LIGHTNING_LIGHTNINGD_KEYSET_H +#ifndef LIGHTNING_COMMON_KEYSET_H +#define LIGHTNING_COMMON_KEYSET_H #include "config.h" #include #include @@ -17,4 +17,4 @@ bool derive_keyset(const struct pubkey *per_commitment_point, const struct pubkey *self_delayed_basepoint, const struct pubkey *other_revocation_basepoint, struct keyset *keyset); -#endif /* LIGHTNING_LIGHTNINGD_KEYSET_H */ +#endif /* LIGHTNING_COMMON_KEYSET_H */ diff --git a/common/msg_queue.h b/common/msg_queue.h index 720bc53b5..46d6f41d4 100644 --- a/common/msg_queue.h +++ b/common/msg_queue.h @@ -1,6 +1,6 @@ /* Helper for simple message queues. */ -#ifndef LIGHTNING_LIGHTNINGD_MSG_QUEUE_H -#define LIGHTNING_LIGHTNINGD_MSG_QUEUE_H +#ifndef LIGHTNING_COMMON_MSG_QUEUE_H +#define LIGHTNING_COMMON_MSG_QUEUE_H #include "config.h" #include #include @@ -33,4 +33,4 @@ int msg_extract_fd(const u8 *msg); #define msg_queue_wait(conn, q, next, arg) \ io_out_wait((conn), (q), (next), (arg)) -#endif /* LIGHTNING_LIGHTNINGD_MSG_QUEUE_H */ +#endif /* LIGHTNING_COMMON_MSG_QUEUE_H */ diff --git a/common/overflows.h b/common/overflows.h index bffdc517f..c44274868 100644 --- a/common/overflows.h +++ b/common/overflows.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_OVERFLOWS_H -#define LIGHTNING_OVERFLOWS_H +#ifndef LIGHTNING_COMMON_OVERFLOWS_H +#define LIGHTNING_COMMON_OVERFLOWS_H #include "config.h" static inline bool add_overflows_size_t(uint64_t a, uint64_t b) @@ -31,4 +31,4 @@ static inline bool mul_overflows_u64(uint64_t a, uint64_t b) ret = a * b; return (ret / a != b); } -#endif /* LIGHTNING_OVERFLOWS_H */ +#endif /* LIGHTNING_COMMON_OVERFLOWS_H */ diff --git a/common/peer_failed.h b/common/peer_failed.h index 2449fd68d..ebe0e4f67 100644 --- a/common/peer_failed.h +++ b/common/peer_failed.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_PEER_FAILED_H -#define LIGHTNING_LIGHTNINGD_PEER_FAILED_H +#ifndef LIGHTNING_COMMON_PEER_FAILED_H +#define LIGHTNING_COMMON_PEER_FAILED_H #include "config.h" #include #include @@ -18,4 +18,4 @@ void peer_failed(int peer_fd, struct crypto_state *cs, const struct channel_id *channel_id, u16 error_code, const char *fmt, ...) PRINTF_FMT(5,6) NORETURN; -#endif /* LIGHTNING_STATUS_H */ +#endif /* LIGHTNING_COMMON_PEER_FAILED_H */ diff --git a/common/permute_tx.h b/common/permute_tx.h index 32d0aa047..f5bbfad40 100644 --- a/common/permute_tx.h +++ b/common/permute_tx.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_PERMUTE_TX_H -#define LIGHTNING_PERMUTE_TX_H +#ifndef LIGHTNING_COMMON_PERMUTE_TX_H +#define LIGHTNING_COMMON_PERMUTE_TX_H #include "config.h" #include "bitcoin/tx.h" @@ -16,4 +16,4 @@ void permute_inputs(struct bitcoin_tx_input *inputs, size_t num_inputs, */ void permute_outputs(struct bitcoin_tx_output *outputs, size_t num_outputs, const void **map); -#endif /* LIGHTNING_PERMUTE_TX_H */ +#endif /* LIGHTNING_COMMON_PERMUTE_TX_H */ diff --git a/common/ping.h b/common/ping.h index 92683493f..60678f661 100644 --- a/common/ping.h +++ b/common/ping.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_PING_H -#define LIGHTNING_LIGHTNINGD_PING_H +#ifndef LIGHTNING_COMMON_PING_H +#define LIGHTNING_COMMON_PING_H #include "config.h" #include #include @@ -10,4 +10,4 @@ bool check_ping_make_pong(const tal_t *ctx, const u8 *ping, u8 **pong); /* Make a ping packet requesting num_pong_bytes */ u8 *make_ping(const tal_t *ctx, u16 num_pong_bytes, u16 padlen); -#endif /* LIGHTNING_LIGHTNINGD_PING_H */ +#endif /* LIGHTNING_COMMON_PING_H */ diff --git a/common/pseudorand.h b/common/pseudorand.h index e91226c9e..d66435ed4 100644 --- a/common/pseudorand.h +++ b/common/pseudorand.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_PSEUDORAND_H -#define LIGHTNING_DAEMON_PSEUDORAND_H +#ifndef LIGHTNING_COMMON_PSEUDORAND_H +#define LIGHTNING_COMMON_PSEUDORAND_H #include "config.h" #include @@ -13,4 +13,4 @@ uint64_t pseudorand(uint64_t max); */ const struct siphash_seed *siphash_seed(void); -#endif /* LIGHTNING_DAEMON_PSEUDORAND_H */ +#endif /* LIGHTNING_COMMON_PSEUDORAND_H */ diff --git a/common/sphinx.h b/common/sphinx.h index 6a4506104..d63e60459 100644 --- a/common/sphinx.h +++ b/common/sphinx.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_SPHINX_H -#define LIGHTNING_DAEMON_SPHINX_H +#ifndef LIGHTNING_COMMON_SPHINX_H +#define LIGHTNING_COMMON_SPHINX_H #include "config.h" #include "bitcoin/privkey.h" @@ -196,4 +196,4 @@ struct onionreply *unwrap_onionreply(const tal_t *ctx, const struct secret *shared_secrets, const int numhops, const u8 *reply); -#endif /* LIGHTNING_DAEMON_SPHINX_H */ +#endif /* LIGHTNING_COMMON_SPHINX_H */ diff --git a/common/status.h b/common/status.h index 07c7dc107..b8a2e911f 100644 --- a/common/status.h +++ b/common/status.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_STATUS_H -#define LIGHTNING_LIGHTNINGD_STATUS_H +#ifndef LIGHTNING_COMMON_STATUS_H +#define LIGHTNING_COMMON_STATUS_H #include "config.h" #include #include @@ -27,4 +27,4 @@ void status_trace(const char *fmt, ...) PRINTF_FMT(1,2); /* Send a failure status code with printf-style msg, and exit. */ void status_failed(u16 code, const char *fmt, ...) PRINTF_FMT(2,3) NORETURN; -#endif /* LIGHTNING_LIGHTNINGD_STATUS_H */ +#endif /* LIGHTNING_COMMON_STATUS_H */ diff --git a/common/timeout.h b/common/timeout.h index 5ef96d68a..4906d0c8b 100644 --- a/common/timeout.h +++ b/common/timeout.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_TIMEOUT_H -#define LIGHTNING_DAEMON_TIMEOUT_H +#ifndef LIGHTNING_COMMON_TIMEOUT_H +#define LIGHTNING_COMMON_TIMEOUT_H #include "config.h" #include @@ -19,4 +19,4 @@ struct oneshot *new_reltimer_(struct timers *timers, void timer_expired(tal_t *ctx, struct timer *timer); -#endif /* LIGHTNING_DAEMON_TIMEOUT_H */ +#endif /* LIGHTNING_COMMON_TIMEOUT_H */ diff --git a/common/type_to_string.h b/common/type_to_string.h index c2d5989db..04c812c85 100644 --- a/common/type_to_string.h +++ b/common/type_to_string.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_TYPE_TO_STRING_H -#define LIGHTNING_TYPE_TO_STRING_H +#ifndef LIGHTNING_COMMON_TYPE_TO_STRING_H +#define LIGHTNING_COMMON_TYPE_TO_STRING_H #include "config.h" #include "utils.h" #include @@ -64,4 +64,4 @@ struct type_to_string { char *(*fmt)(const tal_t *ctx, union printable_types u); }; AUTODATA_TYPE(type_to_string, struct type_to_string); -#endif /* LIGHTNING_UTILS_H */ +#endif /* LIGHTNING_COMMON_TYPE_TO_STRING_H */ diff --git a/common/utils.h b/common/utils.h index 53b13f81c..1dd13ce79 100644 --- a/common/utils.h +++ b/common/utils.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_UTILS_H -#define LIGHTNING_UTILS_H +#ifndef LIGHTNING_COMMON_UTILS_H +#define LIGHTNING_COMMON_UTILS_H #include "config.h" #include #include @@ -20,4 +20,4 @@ u8 *tal_hexdata(const tal_t *ctx, const void *str, size_t len); tal_alloc_((ctx), 0, false, false, \ __FILE__ ":" stringify(__LINE__) ":tal_tmpctx") -#endif /* LIGHTNING_UTILS_H */ +#endif /* LIGHTNING_COMMON_UTILS_H */ diff --git a/common/utxo.h b/common/utxo.h index 174880bcc..5461541ee 100644 --- a/common/utxo.h +++ b/common/utxo.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_UTXO_H -#define LIGHTNING_LIGHTNINGD_UTXO_H +#ifndef LIGHTNING_COMMON_UTXO_H +#define LIGHTNING_COMMON_UTXO_H #include "config.h" #include #include @@ -22,4 +22,4 @@ void fromwire_utxo(const u8 **ptr, size_t *max, struct utxo *utxo); * wants arr of structs */ struct utxo *from_utxoptr_arr(const tal_t *ctx, const struct utxo **utxos); const struct utxo **to_utxoptr_arr(const tal_t *ctx, const struct utxo *utxos); -#endif /* LIGHTNING_LIGHTNINGD_UTXO_H */ +#endif /* LIGHTNING_COMMON_UTXO_H */ diff --git a/common/version.h b/common/version.h index 921115eea..66c296f62 100644 --- a/common/version.h +++ b/common/version.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_VERSION_H -#define LIGHTNING_VERSION_H +#ifndef LIGHTNING_COMMON_VERSION_H +#define LIGHTNING_COMMON_VERSION_H #include "config.h" #include @@ -10,4 +10,4 @@ const char *version(void); opt_register_early_noarg("--version|-V", version_and_exit, NULL, \ "print version to standard output and exit") -#endif /* LIGHTNING_VERSION_H */ +#endif /* LIGHTNING_COMMON_VERSION_H */ diff --git a/common/withdraw_tx.h b/common/withdraw_tx.h index fa3b9475b..769709db0 100644 --- a/common/withdraw_tx.h +++ b/common/withdraw_tx.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_WITHDRAW_TX_H -#define LIGHTNING_LIGHTNINGD_WITHDRAW_TX_H +#ifndef LIGHTNING_COMMON_WITHDRAW_TX_H +#define LIGHTNING_COMMON_WITHDRAW_TX_H #include "config.h" #include #include @@ -30,4 +30,4 @@ struct bitcoin_tx *withdraw_tx(const tal_t *ctx, const u64 changesat, const struct ext_key *bip32_base); -#endif /* LIGHTNING_LIGHTNINGD_WITHDRAW_TX_H */ +#endif /* LIGHTNING_COMMON_WITHDRAW_TX_H */ diff --git a/lightningd/bitcoind.h b/lightningd/bitcoind.h index 0b0dcf432..3138a5aaa 100644 --- a/lightningd/bitcoind.h +++ b/lightningd/bitcoind.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_BITCOIND_H -#define LIGHTNING_DAEMON_BITCOIND_H +#ifndef LIGHTNING_LIGHTNINGD_BITCOIND_H +#define LIGHTNING_LIGHTNINGD_BITCOIND_H #include "config.h" #include #include @@ -123,4 +123,4 @@ void bitcoind_getrawblock_(struct bitcoind *bitcoind, struct bitcoind *, \ struct bitcoin_block *), \ (arg)) -#endif /* LIGHTNING_DAEMON_BITCOIND_H */ +#endif /* LIGHTNING_LIGHTNINGD_BITCOIND_H */ diff --git a/lightningd/chaintopology.h b/lightningd/chaintopology.h index d7a754de9..060a44ce6 100644 --- a/lightningd/chaintopology.h +++ b/lightningd/chaintopology.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_CHAINTOPOLOGY_H -#define LIGHTNING_DAEMON_CHAINTOPOLOGY_H +#ifndef LIGHTNING_LIGHTNINGD_CHAINTOPOLOGY_H +#define LIGHTNING_LIGHTNINGD_CHAINTOPOLOGY_H #include "config.h" #include #include @@ -160,4 +160,4 @@ void json_dev_broadcast(struct command *cmd, struct chain_topology *topo, const char *buffer, const jsmntok_t *params); -#endif /* LIGHTNING_DAEMON_CRYPTOPKT_H */ +#endif /* LIGHTNING_LIGHTNINGD_CHAINTOPOLOGY_H */ diff --git a/lightningd/channel/channeld_htlc.h b/lightningd/channel/channeld_htlc.h index 5ac8d4d1e..1c8f7993f 100644 --- a/lightningd/channel/channeld_htlc.h +++ b/lightningd/channel/channeld_htlc.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNINGD_CHANNELD_HTLC_H -#define LIGHTNINGD_CHANNELD_HTLC_H +#ifndef LIGHTNING_LIGHTNINGD_CHANNEL_CHANNELD_HTLC_H +#define LIGHTNING_LIGHTNINGD_CHANNEL_CHANNELD_HTLC_H #include "config.h" #include #include @@ -76,4 +76,4 @@ static inline bool htlc_is_dead(const struct htlc *htlc) return htlc->state == RCVD_REMOVE_ACK_REVOCATION || htlc->state == SENT_REMOVE_ACK_REVOCATION; } -#endif /* LIGHTNINGD_CHANNELD_HTLC_H */ +#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_CHANNELD_HTLC_H */ diff --git a/lightningd/channel/commit_tx.h b/lightningd/channel/commit_tx.h index cd8994963..cf84271a0 100644 --- a/lightningd/channel/commit_tx.h +++ b/lightningd/channel/commit_tx.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_COMMIT_TX_H -#define LIGHTNING_LIGHTNINGD_COMMIT_TX_H +#ifndef LIGHTNING_LIGHTNINGD_CHANNEL_COMMIT_TX_H +#define LIGHTNING_LIGHTNINGD_CHANNEL_COMMIT_TX_H #include "config.h" #include #include @@ -58,4 +58,4 @@ struct bitcoin_tx *commit_tx(const tal_t *ctx, u64 obscured_commitment_number, enum side side); -#endif /* LIGHTNING_LIGHTNINGD_COMMIT_TX_H */ +#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_COMMIT_TX_H */ diff --git a/lightningd/channel/full_channel.h b/lightningd/channel/full_channel.h index 1132a8239..6e9f06193 100644 --- a/lightningd/channel/full_channel.h +++ b/lightningd/channel/full_channel.h @@ -1,6 +1,6 @@ /* This is the full channel routines, with HTLC support. */ -#ifndef LIGHTNING_LIGHTNINGD_CHANNEL_H -#define LIGHTNING_LIGHTNINGD_CHANNEL_H +#ifndef LIGHTNING_LIGHTNINGD_CHANNEL_FULL_CHANNEL_H +#define LIGHTNING_LIGHTNINGD_CHANNEL_FULL_CHANNEL_H #include "config.h" #include #include @@ -275,4 +275,4 @@ bool channel_force_htlcs(struct channel *channel, * Uses status_trace() on every HTLC. */ void dump_htlcs(const struct channel *channel, const char *prefix); -#endif /* LIGHTNING_DAEMON_CHANNEL_H */ +#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_FULL_CHANNEL_H */ diff --git a/lightningd/dns.h b/lightningd/dns.h index 687f14752..7dc4dbf5c 100644 --- a/lightningd/dns.h +++ b/lightningd/dns.h @@ -1,5 +1,5 @@ -#ifndef PETTYCOIN_DNS_H -#define PETTYCOIN_DNS_H +#ifndef LIGHTNING_LIGHTNINGD_DNS_H +#define LIGHTNING_LIGHTNINGD_DNS_H #include "config.h" #include #include @@ -50,4 +50,4 @@ struct dns_async *multiaddress_connect_(struct lightningd_state *dstate, void (*fail)(struct lightningd_state *, void *arg), void *arg); -#endif /* PETTYCOIN_DNS_H */ +#endif /* LIGHTNING_LIGHTNINGD_DNS_H */ diff --git a/lightningd/gossip/broadcast.h b/lightningd/gossip/broadcast.h index 5c002fdc1..80545c4f6 100644 --- a/lightningd/gossip/broadcast.h +++ b/lightningd/gossip/broadcast.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_BROADCAST_H -#define LIGHTNING_DAEMON_BROADCAST_H +#ifndef LIGHTNING_LIGHTNINGD_GOSSIP_BROADCAST_H +#define LIGHTNING_LIGHTNINGD_GOSSIP_BROADCAST_H #include "config.h" #include @@ -37,4 +37,4 @@ void queue_broadcast(struct broadcast_state *bstate, struct queued_message *next_broadcast_message(struct broadcast_state *bstate, u64 *last_index); -#endif /* LIGHTNING_DAEMON_BROADCAST_H */ +#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_BROADCAST_H */ diff --git a/lightningd/gossip/routing.h b/lightningd/gossip/routing.h index 610449cd1..e428c3c81 100644 --- a/lightningd/gossip/routing.h +++ b/lightningd/gossip/routing.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_ROUTING_H -#define LIGHTNING_DAEMON_ROUTING_H +#ifndef LIGHTNING_LIGHTNINGD_GOSSIP_ROUTING_H +#define LIGHTNING_LIGHTNINGD_GOSSIP_ROUTING_H #include "config.h" #include #include @@ -175,4 +175,4 @@ struct route_hop *get_route(tal_t *ctx, struct routing_state *rstate, * the direction bit the matching channel should get */ #define get_channel_direction(from, to) (pubkey_cmp(from, to) > 0) -#endif /* LIGHTNING_DAEMON_ROUTING_H */ +#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_ROUTING_H */ diff --git a/lightningd/gossip_control.h b/lightningd/gossip_control.h index d16939d66..d6b9be59b 100644 --- a/lightningd/gossip_control.h +++ b/lightningd/gossip_control.h @@ -6,4 +6,4 @@ struct lightningd; void gossip_init(struct lightningd *ld); -#endif /* LIGHTNING_LIGHTNINGD_HSM_CONTROL_H */ +#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_CONTROL_H */ diff --git a/lightningd/gossip_msg.h b/lightningd/gossip_msg.h index ec089e025..a61db8811 100644 --- a/lightningd/gossip_msg.h +++ b/lightningd/gossip_msg.h @@ -33,4 +33,4 @@ void fromwire_gossip_getchannels_entry(const u8 **pptr, size_t *max, void towire_gossip_getchannels_entry( u8 **pptr, const struct gossip_getchannels_entry *entry); -#endif /* LIGHTNING_LIGHTGNINGD_GOSSIP_MSG_H */ +#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H */ diff --git a/lightningd/hsm/client.h b/lightningd/hsm/client.h index d31e8d82e..1ee13d17d 100644 --- a/lightningd/hsm/client.h +++ b/lightningd/hsm/client.h @@ -1,6 +1,6 @@ /* API to ask the HSM for things. */ -#ifndef LIGHTNING_LIGHTNINGD_HSM_H -#define LIGHTNING_LIGHTNINGD_HSM_H +#ifndef LIGHTNING_LIGHTNINGD_HSM_CLIENT_H +#define LIGHTNING_LIGHTNINGD_HSM_CLIENT_H #include "config.h" #include #include @@ -14,4 +14,4 @@ void hsm_setup(int fd); /* Do ECDH using this node id secret. */ bool hsm_do_ecdh(struct secret *ss, const struct pubkey *point); -#endif /* LIGHTNING_LIGHTNINGD_HSM_H */ +#endif /* LIGHTNING_LIGHTNINGD_HSM_CLIENT_H */ diff --git a/lightningd/invoice.h b/lightningd/invoice.h index 565016536..cdb9536fd 100644 --- a/lightningd/invoice.h +++ b/lightningd/invoice.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_INVOICE_H -#define LIGHTNING_DAEMON_INVOICE_H +#ifndef LIGHTNING_LIGHTNINGD_INVOICE_H +#define LIGHTNING_LIGHTNINGD_INVOICE_H #include "config.h" #include #include @@ -33,4 +33,4 @@ struct invoice *find_unpaid(struct invoices *i, const struct sha256 *rhash); struct invoices *invoices_init(const tal_t *ctx); -#endif /* LIGHTNING_DAEMON_INVOICE_H */ +#endif /* LIGHTNING_LIGHTNINGD_INVOICE_H */ diff --git a/lightningd/jsonrpc.h b/lightningd/jsonrpc.h index 3eeed42ce..fc1555a2b 100644 --- a/lightningd/jsonrpc.h +++ b/lightningd/jsonrpc.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_JSONRPC_H -#define LIGHTNING_DAEMON_JSONRPC_H +#ifndef LIGHTNING_LIGHTNINGD_JSONRPC_H +#define LIGHTNING_LIGHTNINGD_JSONRPC_H #include "config.h" #include #include @@ -73,4 +73,4 @@ void json_add_address(struct json_result *response, const char *fieldname, void setup_jsonrpc(struct lightningd_state *dstate, const char *rpc_filename); AUTODATA_TYPE(json_command, struct json_command); -#endif /* LIGHTNING_DAEMON_JSONRPC_H */ +#endif /* LIGHTNING_LIGHTNINGD_JSONRPC_H */ diff --git a/lightningd/log.h b/lightningd/log.h index 9fa5d36d9..be44ed2ec 100644 --- a/lightningd/log.h +++ b/lightningd/log.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_LOG_H -#define LIGHTNING_DAEMON_LOG_H +#ifndef LIGHTNING_LIGHTNINGD_LOG_H +#define LIGHTNING_LIGHTNINGD_LOG_H #include "config.h" #include #include @@ -132,4 +132,4 @@ void crashlog_activate(struct log *log); /* Before the crashlog is activated, just prints to stderr. */ void NORETURN PRINTF_FMT(1,2) fatal(const char *fmt, ...); -#endif /* LIGHTNING_DAEMON_LOG_H */ +#endif /* LIGHTNING_LIGHTNINGD_LOG_H */ diff --git a/lightningd/netaddr.h b/lightningd/netaddr.h index de55aa08a..04345215f 100644 --- a/lightningd/netaddr.h +++ b/lightningd/netaddr.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_NETADDR_H -#define LIGHTNING_DAEMON_NETADDR_H +#ifndef LIGHTNING_LIGHTNINGD_NETADDR_H +#define LIGHTNING_LIGHTNINGD_NETADDR_H #include "config.h" #include #include @@ -31,4 +31,4 @@ bool netaddr_from_fd(int fd, int type, int protocol, struct netaddr *a); bool netaddr_from_blob(const void *linear, size_t len, struct netaddr *a); char *netaddr_to_hex(const tal_t *ctx, const struct netaddr *a); -#endif /* LIGHTNING_DAEMON_NETADDR_H */ +#endif /* LIGHTNING_LIGHTNINGD_NETADDR_H */ diff --git a/lightningd/onchain/onchain_types.h b/lightningd/onchain/onchain_types.h index fbba62f16..f3aa0d9e6 100644 --- a/lightningd/onchain/onchain_types.h +++ b/lightningd/onchain/onchain_types.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_ONCHAIN_TYPES_H -#define LIGHTNING_LIGHTNINGD_ONCHAIN_TYPES_H +#ifndef LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_TYPES_H +#define LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_TYPES_H #include "config.h" /* Different transactions we care about. */ @@ -51,4 +51,4 @@ enum output_type { }; -#endif /* LIGHTNING_LIGHTNINGD_ONCHAIN_TYPES_H */ +#endif /* LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_TYPES_H */ diff --git a/lightningd/onchain/onchain_wire.h b/lightningd/onchain/onchain_wire.h index fe4f956ab..17a8507ba 100644 --- a/lightningd/onchain/onchain_wire.h +++ b/lightningd/onchain/onchain_wire.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_LIGHTNINGD_ONCHAIN_WIRE_H -#define LIGHTNING_LIGHTNINGD_ONCHAIN_WIRE_H +#ifndef LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_WIRE_H +#define LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_WIRE_H #include "config.h" #include #include @@ -15,4 +15,4 @@ struct htlc_stub { void towire_htlc_stub(u8 **pptr, const struct htlc_stub *htlc_stub); void fromwire_htlc_stub(const u8 **cursor, size_t *max, struct htlc_stub *htlc_stub); -#endif /* LIGHTNING_LIGHTNINGD_ONCHAIN_WIRE_H */ +#endif /* LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_WIRE_H */ diff --git a/lightningd/opt_time.h b/lightningd/opt_time.h index 55bd4ba78..d1b515570 100644 --- a/lightningd/opt_time.h +++ b/lightningd/opt_time.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_OPT_TIME_H -#define LIGHTNING_DAEMON_OPT_TIME_H +#ifndef LIGHTNING_LIGHTNINGD_OPT_TIME_H +#define LIGHTNING_LIGHTNINGD_OPT_TIME_H #include "config.h" #include #include @@ -10,4 +10,4 @@ void opt_show_time(char buf[OPT_SHOW_LEN], const struct timerel *t); char *opt_set_timeabs(const char *arg, struct timeabs *t); void opt_show_timeabs(char buf[OPT_SHOW_LEN], const struct timeabs *t); -#endif /* LIGHTNING_DAEMON_OPT_TIME_H */ +#endif /* LIGHTNING_LIGHTNINGD_OPT_TIME_H */ diff --git a/lightningd/options.h b/lightningd/options.h index dd9bf3c2e..5495a428b 100644 --- a/lightningd/options.h +++ b/lightningd/options.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_OPTIONS_H -#define LIGHTNING_DAEMON_OPTIONS_H +#ifndef LIGHTNING_LIGHTNINGD_OPTIONS_H +#define LIGHTNING_LIGHTNINGD_OPTIONS_H #include "config.h" #include @@ -13,4 +13,4 @@ void register_opts(struct lightningd_state *dstate); */ bool handle_opts(struct lightningd_state *dstate, int argc, char *argv[]); -#endif /* LIGHTNING_DAEMON_OPTIONS_H */ +#endif /* LIGHTNING_LIGHTNINGD_OPTIONS_H */ diff --git a/lightningd/watch.h b/lightningd/watch.h index 2f18eb0b7..cbfdcc222 100644 --- a/lightningd/watch.h +++ b/lightningd/watch.h @@ -1,5 +1,5 @@ -#ifndef LIGHTNING_DAEMON_WATCH_H -#define LIGHTNING_DAEMON_WATCH_H +#ifndef LIGHTNING_LIGHTNINGD_WATCH_H +#define LIGHTNING_LIGHTNINGD_WATCH_H #include "config.h" #include "bitcoin/shadouble.h" #include @@ -148,4 +148,4 @@ bool watching_txid(const struct chain_topology *topo, const struct sha256_double *txid); void watch_topology_changed(struct chain_topology *topo); -#endif /* LIGHTNING_DAEMON_WATCH_H */ +#endif /* LIGHTNING_LIGHTNINGD_WATCH_H */