Skip to content

Commit

Permalink
Mitigate possible header conflicts in platformio build system by pref…
Browse files Browse the repository at this point in the history
…ixing every header with "Nostr"
  • Loading branch information
riccardobl committed Jul 30, 2024
1 parent f1ec4af commit 100cfb5
Show file tree
Hide file tree
Showing 29 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion examples/ESP32TestNWC/ESP32TestNWC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <Arduino.h>

#include "Transport.h"
#include "NostrTransport.h"
#include "services/NWC.h"

// CONFIGURATION
Expand Down
4 changes: 2 additions & 2 deletions examples/ESP32TestNip01/ESP32TestNip01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "ArduinoJson.h"
#include "NostrEvent.h"
#include "NostrPool.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"
#include "time.h"

#define WIFI_SSID "Wokwi-GUEST"
Expand Down
4 changes: 2 additions & 2 deletions examples/ESP32TestNip01Filter/ESP32TestNip01Filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "ArduinoJson.h"
#include "NostrEvent.h"
#include "NostrPool.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"
#include "time.h"

#define WIFI_SSID "Wokwi-GUEST"
Expand Down
2 changes: 1 addition & 1 deletion examples/ESP32TestNip04/ESP32TestNip04.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <Arduino.h>

#include "Nip04.h"
#include "Transport.h"
#include "NostrTransport.h"
#include "services/NWC.h"

#define WIFI_SSID "Wokwi-GUEST"
Expand Down
4 changes: 2 additions & 2 deletions examples/ESP8266TestNip01/ESP8266TestNip01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "ArduinoJson.h"
#include "NostrEvent.h"
#include "NostrPool.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"
#include "time.h"

#define WIFI_SSID "Wokwi-GUEST"
Expand Down
4 changes: 2 additions & 2 deletions examples/PICOWTestNip01/PICOWTestNip01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include "ArduinoJson.h"
#include "NostrEvent.h"
#include "NostrPool.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"
#include "time.h"

#define WIFI_SSID "Wokwi-GUEST"
Expand Down
4 changes: 2 additions & 2 deletions examples/UNOR4TestNip01/UNOR4TestNip01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "ArduinoJson.h"
#include "NostrEvent.h"
#include "NostrPool.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"
#include "time.h"

#define WIFI_SSID "Wokwi-GUEST"
Expand Down
6 changes: 3 additions & 3 deletions src/Nip04.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef _NIP04_H
#define _NIP04_H
#include "NostrString.h"
#include "NostrUtils.h"
#include <Arduino.h>
#include <aes.h>
#include <NostrAES.h>
#include <vector>
#include "NostrString.h"
#include "Utils.h"
namespace nostr {
class Nip04 {
public:
Expand Down
4 changes: 2 additions & 2 deletions src/Nip47.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#include "Nip04.h"
#include "NostrEvent.h"
#include "NostrString.h"
#include "Utils.h"
#include "NostrUtils.h"
#include <initializer_list>
#include <vector>
namespace nostr {

typedef struct s_Invoice {
NostrString invoice;
unsigned long amount;
Expand Down
2 changes: 1 addition & 1 deletion src/aes.cpp → src/NostrAES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NOTE: String length must be evenly divisible by 16byte (str_len % 16 == 0)
/* Includes: */
/*****************************************************************************/
#include <string.h> // CBC mode, for memset
#include "aes.h"
#include "NostrAES.h"

/*****************************************************************************/
/* Defines: */
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/aes.hpp → src/NostrAES.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#endif //__cplusplus

extern "C" {
#include "aes.h"
#include "NostrAES.h"
}

#endif //_AES_HPP_
File renamed without changes.
4 changes: 2 additions & 2 deletions src/NostrEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include "ArduinoJson.h"
#include "NostrString.h"
#include "Utils.h"
#include <aes.h>
#include "NostrUtils.h"
#include <NostrAES.h>
#include <functional>
#include <initializer_list>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion src/NostrPool.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _NOSTR_POOL_H
#define _NOSTR_POOL_H
#include <Arduino.h>
#include <Transport.h>
#include <NostrTransport.h>
#include <functional>
#include <initializer_list>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion src/NostrString.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#endif


#include "Utils.h"
#include "NostrUtils.h"
#include <vector>

#ifdef ARDUINO
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Utils.cpp → src/NostrUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Utils.h"
#include "NostrUtils.h"

#include "uBitcoin/src/Bitcoin.h"
#include "uBitcoin/src/Hash.h"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/esp32/ESP32Platform.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef _NOSTR_ESP32_PLATFORM_H
#define _NOSTR_ESP32_PLATFORM_H 1
#include "Common.h"
#include "NostrCommon.h"

#ifdef _ESP32_BOARD_
#include "ESP32Transport.h"
#include "NostrString.h"
#include "Utils.h"
#include "NostrUtils.h"
#include "WiFi.h"
#include "bootloader_random.h"
#include "esp_random.h"
Expand Down
2 changes: 1 addition & 1 deletion src/esp32/ESP32Transport.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ESP32Transport.h"
#include "Common.h"
#include "NostrCommon.h"

#if defined(_ESP32_BOARD_) || defined(_ESP8266_BOARD_)
using namespace nostr;
Expand Down
6 changes: 3 additions & 3 deletions src/esp32/ESP32Transport.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef _NOSTR_ESP32_TRANSPORT_H
#define _NOSTR_ESP32_TRANSPORT_H 1
#include "Common.h"
#include "NostrCommon.h"

#if defined(_ESP32_BOARD_) || defined(_ESP8266_BOARD_)

#include "ArduinoJson.h"
#include "NostrString.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"
#ifdef _ESP8266_BOARD_
#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>
Expand Down
4 changes: 2 additions & 2 deletions src/esp8266/ESP8266Platform.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef _NOSTR_ESP8266_PLATFORM_H
#define _NOSTR_ESP8266_PLATFORM_H 1

#include "Common.h"
#include "NostrCommon.h"

#ifdef _ESP8266_BOARD_

#include "ESP8266Transport.h"
#include "NostrString.h"
#include "Utils.h"
#include "NostrUtils.h"
#include "time.h"
#include <ESP8266HTTPClient.h>
#include <ESP8266TrueRandom.h>
Expand Down
2 changes: 1 addition & 1 deletion src/esp8266/ESP8266Transport.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _NOSTR_ESP8266_TRANSPORT_H
#define _NOSTR_ESP8266_TRANSPORT_H 1
#include "Common.h"
#include "NostrCommon.h"

#ifdef _ESP8266_BOARD_

Expand Down
4 changes: 2 additions & 2 deletions src/picow/PICOWPlatform.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "Common.h"
#include "NostrCommon.h"
#ifndef _NOSTR_PICOW_PLATFORM_H
#define _NOSTR_PICOW_PLATFORM_H
#ifdef _PICOW_BOARD_
Expand All @@ -8,7 +8,7 @@
#include <WiFi.h>
#include "Arduino.h"
#include "NostrString.h"
#include "Utils.h"
#include "NostrUtils.h"
#include "picow/PICOWTransport.h"
#include <time.h>
namespace nostr {
Expand Down
6 changes: 3 additions & 3 deletions src/picow/PICOWTransport.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _NOSTR_PICOW_TRANSPORT_H
#define _NOSTR_PICOW_TRANSPORT_H
#include "Common.h"
#include "NostrCommon.h"

#ifdef _PICOW_BOARD_

Expand All @@ -10,8 +10,8 @@
#include "HTTPClient.h"
#include "IPAddress.h"
#include "NostrString.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"
#include <initializer_list>
#include <vector>
namespace nostr {
Expand Down
4 changes: 2 additions & 2 deletions src/services/NWC.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "NostrEvent.h"
#include "NostrPool.h"
#include "NostrString.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"

namespace nostr {
class NWCResponseCallbackBase {
Expand Down
4 changes: 2 additions & 2 deletions src/unor4/UNOR4Platform.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "Common.h"
#include "NostrCommon.h"

#ifndef _NOSTR_UNOR4_PLATFORM_H
#define _NOSTR_UNOR4_PLATFORM_H
Expand All @@ -8,7 +8,7 @@
#include "Arduino.h"
#include "NostrString.h"
#include "RTC.h"
#include "Utils.h"
#include "NostrUtils.h"
#include "unor4/UNOR4Transport.h"

#include <NTPClient.h>
Expand Down
6 changes: 3 additions & 3 deletions src/unor4/UNOR4Transport.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Common.h"
#include "NostrCommon.h"
#ifndef _NOSTR_UNOR4_TRANSPORT_H
#define _NOSTR_UNOR4_TRANSPORT_H
#ifdef _UNOR4_BOARD_
Expand All @@ -8,8 +8,8 @@
#include "ArduinoJson.h"
#include "IPAddress.h"
#include "NostrString.h"
#include "Transport.h"
#include "Utils.h"
#include "NostrTransport.h"
#include "NostrUtils.h"
#include "WiFiS3.h"
#include "WiFiSSLClient.h"
#include <initializer_list>
Expand Down

0 comments on commit 100cfb5

Please sign in to comment.