Add header guards

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-04-19 09:24:56 +02:00
parent 1d8710f73d
commit b42c4231cb
5 changed files with 23 additions and 1 deletions

4
FTL.h
View File

@@ -7,6 +7,8 @@
* *
* This file is copyright under the latest version of the EUPL. * This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */ * Please see LICENSE file for your rights under this license. */
#ifndef FTL_H
#define FTL_H
#define __USE_XOPEN #define __USE_XOPEN
#define _GNU_SOURCE #define _GNU_SOURCE
@@ -322,3 +324,5 @@ clientsData* _getClient(int clientID, bool checkMagic, int line, const char * fu
domainsData* _getDomain(int domainID, bool checkMagic, int line, const char * function, const char * file); domainsData* _getDomain(int domainID, bool checkMagic, int line, const char * function, const char * file);
#define getForward(forwardID, checkMagic) _getForward(forwardID, checkMagic, __LINE__, __FUNCTION__, __FILE__) #define getForward(forwardID, checkMagic) _getForward(forwardID, checkMagic, __LINE__, __FUNCTION__, __FILE__)
forwardedData* _getForward(int forwardID, bool checkMagic, int line, const char * function, const char * file); forwardedData* _getForward(int forwardID, bool checkMagic, int line, const char * function, const char * file);
#endif // FTL_H

View File

@@ -141,11 +141,14 @@ clean:
version~: force version~: force
@echo '$(GIT_BRANCH) $(GIT_VERSION) $(GIT_DATE) $(GIT_TAG)' | cmp -s - $@ || echo '$(GIT_BRANCH) $(GIT_VERSION) $(GIT_DATE) $(GIT_TAG)' > $@ @echo '$(GIT_BRANCH) $(GIT_VERSION) $(GIT_DATE) $(GIT_TAG)' | cmp -s - $@ || echo '$(GIT_BRANCH) $(GIT_VERSION) $(GIT_DATE) $(GIT_TAG)' > $@
version.h: version~ version.h: version~
@echo '#define GIT_VERSION "$(GIT_VERSION)"' > "$@" @echo '#ifndef VERSION_H' > "$@"
@echo '#define VERSION_H' >> "$@"
@echo '#define GIT_VERSION "$(GIT_VERSION)"' >> "$@"
@echo '#define GIT_DATE "$(GIT_DATE)"' >> "$@" @echo '#define GIT_DATE "$(GIT_DATE)"' >> "$@"
@echo '#define GIT_BRANCH "$(GIT_BRANCH)"' >> "$@" @echo '#define GIT_BRANCH "$(GIT_BRANCH)"' >> "$@"
@echo '#define GIT_TAG "$(GIT_TAG)"' >> "$@" @echo '#define GIT_TAG "$(GIT_TAG)"' >> "$@"
@echo '#define GIT_HASH "$(GIT_HASH)"' >> "$@" @echo '#define GIT_HASH "$(GIT_HASH)"' >> "$@"
@echo '#endif // VERSION_H' >> "$@"
@echo "Making FTL version on branch $(GIT_BRANCH) - $(GIT_VERSION) ($(GIT_DATE))" @echo "Making FTL version on branch $(GIT_BRANCH) - $(GIT_VERSION) ($(GIT_DATE))"
prefix=/usr prefix=/usr

4
api.h
View File

@@ -7,6 +7,8 @@
* *
* This file is copyright under the latest version of the EUPL. * This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */ * Please see LICENSE file for your rights under this license. */
#ifndef API_H
#define API_H
// Statistic methods // Statistic methods
void getStats(const int *sock); void getStats(const int *sock);
@@ -42,3 +44,5 @@ void pack_float(const int sock, const float value);
bool pack_fixstr(const int sock, const char *string); bool pack_fixstr(const int sock, const char *string);
bool pack_str32(const int sock, const char *string); bool pack_str32(const int sock, const char *string);
void pack_map16_start(const int sock, const uint16_t length); void pack_map16_start(const int sock, const uint16_t length);
#endif // API_H

View File

@@ -7,6 +7,9 @@
* *
* This file is copyright under the latest version of the EUPL. * This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */ * Please see LICENSE file for your rights under this license. */
#ifndef DNSMASQ_INTERFACE_H
#define DNSMASQ_INTERFACE_H
extern int socketfd, telnetfd4, telnetfd6; extern int socketfd, telnetfd4, telnetfd6;
extern unsigned char* pihole_privacylevel; extern unsigned char* pihole_privacylevel;
enum { TCP, UDP }; enum { TCP, UDP };
@@ -38,3 +41,5 @@ void _FTL_upstream_error(const unsigned int rcode, const int id, const char* fil
void FTL_dnsmasq_reload(void); void FTL_dnsmasq_reload(void);
void FTL_fork_and_bind_sockets(struct passwd *ent_pw); void FTL_fork_and_bind_sockets(struct passwd *ent_pw);
int FTL_listsfile(const char* filename, unsigned int index, FILE *f, int cache_size, struct crec **rhash, int hashsz); int FTL_listsfile(const char* filename, unsigned int index, FILE *f, int cache_size, struct crec **rhash, int hashsz);
#endif // DNSMASQ_INTERFACE_H

View File

@@ -7,7 +7,10 @@
* *
* This file is copyright under the latest version of the EUPL. * This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */ * Please see LICENSE file for your rights under this license. */
#ifndef ROUTINES_H
#define ROUTINES_H
// daemon.c
void go_daemon(void); void go_daemon(void);
void timer_start(const int i); void timer_start(const int i);
double timer_elapsed_msec(const int i); double timer_elapsed_msec(const int i);
@@ -16,6 +19,7 @@ void savepid(void);
char * getUserName(void); char * getUserName(void);
void removepid(void); void removepid(void);
// log.c
void open_FTL_log(const bool test); void open_FTL_log(const bool test);
void logg(const char* format, ...) __attribute__ ((format (gnu_printf, 1, 2))); void logg(const char* format, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void log_counter_info(void); void log_counter_info(void);
@@ -150,3 +154,5 @@ bool check_capabilities(void);
bool create_network_table(void); bool create_network_table(void);
void parse_arp_cache(void); void parse_arp_cache(void);
void updateMACVendorRecords(void); void updateMACVendorRecords(void);
#endif // ROUTINES_H