Commit 11bcb72f authored by Lubos Slovak's avatar Lubos Slovak

Fixed ifdef guards.

parent 68b13c39
......@@ -5,7 +5,7 @@ Coding style
* Max line width: 80 chars
* Pointer asterisk attached to the name of the variable
* Own structures/types: _t suffix (f.e. nameserver_t)
* Header guard format: _KNOTDHEADER_H_
* Header guard format: _KNOTD__HEADER_H_
* Spaces around binary operators
* Space between keyword and bracket (f.e. "if (predicate)")
* No space between variable and typecast (f.e. "return (int)val;")
......
......@@ -24,8 +24,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _KNOTXFR_IN_H_
#define _KNOTXFR_IN_H_
#ifndef _KNOT_XFR_IN_H_
#define _KNOT_XFR_IN_H_
#include <stdint.h>
#include <string.h>
......
......@@ -12,8 +12,8 @@
* @{
*/
#ifndef _KNOTDACL_H_
#define _KNOTDACL_H_
#ifndef _KNOTD_ACL_H_
#define _KNOTD_ACL_H_
#include "common/skip-list.h"
#include "common/sockaddr.h"
......@@ -118,6 +118,6 @@ static inline skip_list_t* acl_rules(acl_t *acl) {
return acl->rules;
}
#endif /* _KNOTDACL_H_ */
#endif /* _KNOTD_ACL_H_ */
/*! @} */
......@@ -13,8 +13,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_DYNAMIC_ARRAY_H_
#define _KNOTDCOMMON_DYNAMIC_ARRAY_H_
#ifndef _KNOTD_COMMON_DYNAMIC_ARRAY_H_
#define _KNOTD_COMMON_DYNAMIC_ARRAY_H_
#include <string.h>
#include <pthread.h>
......@@ -136,6 +136,6 @@ unsigned da_get_count(const da_array_t *array);
/*----------------------------------------------------------------------------*/
#endif /* _KNOTDCOMMON_DYNAMIC_ARRAY_H_ */
#endif /* _KNOTD_COMMON_DYNAMIC_ARRAY_H_ */
/*! @} */
......@@ -10,8 +10,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_ERROR_H_
#define _KNOTDCOMMON_ERROR_H_
#ifndef _KNOTD_COMMON_ERROR_H_
#define _KNOTD_COMMON_ERROR_H_
#include <errno.h>
......@@ -60,6 +60,6 @@ const char *error_to_str(const error_table_t *table, int code);
*/
int _map_errno(int fallback_value, int arg0, ...);
#endif /* _KNOTDCOMMON_ERROR_H_ */
#endif /* _KNOTD_COMMON_ERROR_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_EVQUEUE_H_
#define _KNOTDCOMMON_EVQUEUE_H_
#ifndef _KNOTD_COMMON_EVQUEUE_H_
#define _KNOTD_COMMON_EVQUEUE_H_
#include <pthread.h>
#include <signal.h> // sigset_t
......@@ -179,6 +179,6 @@ static inline void evqueue_set(evqueue_t *q) {
s_evqueue = q;
}
#endif /* _KNOTDCOMMON_EVQUEUE_H_ */
#endif /* _KNOTD_COMMON_EVQUEUE_H_ */
/*! @} */
......@@ -48,8 +48,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_EVSCHED_H_
#define _KNOTDCOMMON_EVSCHED_H_
#ifndef _KNOTD_COMMON_EVSCHED_H_
#define _KNOTD_COMMON_EVSCHED_H_
#include <pthread.h>
#include "common/slab/slab.h"
......@@ -198,6 +198,6 @@ static inline void evsched_set(evsched_t *s) {
}
#endif /* _KNOTDCOMMON_EVSCHED_H_ */
#endif /* _KNOTD_COMMON_EVSCHED_H_ */
/*! @} */
#ifndef _KNOTDCOMMON_GENERAL_TREE_H_
#define _KNOTDCOMMON_GENERAL_TREE_H_
#ifndef _KNOTD_COMMON_GENERAL_TREE_H_
#define _KNOTD_COMMON_GENERAL_TREE_H_
#include "common/modified_tree.h"
......@@ -52,4 +52,4 @@ int gen_tree_find_less_or_equal(general_tree_t *tree,
general_tree_t *gen_tree_shallow_copy(general_tree_t *tree);
#endif // _KNOTDCOMMON_GENERAL_TREE_H_
#endif // _KNOTD_COMMON_GENERAL_TREE_H_
......@@ -12,8 +12,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_LATENCY_H_
#define _KNOTDCOMMON_LATENCY_H_
#ifndef _KNOTD_COMMON_LATENCY_H_
#define _KNOTD_COMMON_LATENCY_H_
/* Optional. */
#ifdef PROF_LATENCY
......@@ -95,6 +95,6 @@ int pf_pthread_mutex_unlock(pthread_mutex_t *mutex,
#define perf_end(d)
#endif // PROF_LATENCY
#endif // _KNOTDCOMMON_LATENCY_H_
#endif // _KNOTD_COMMON_LATENCY_H_
/*! @} */
......@@ -12,8 +12,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_PRINT_H_
#define _KNOTDCOMMON_PRINT_H_
#ifndef _KNOTD_COMMON_PRINT_H_
#define _KNOTD_COMMON_PRINT_H_
typedef int (*printf_t)(const char *fmt, ...);
......@@ -52,6 +52,6 @@ void bit_print(const char *data, int length);
*/
void bit_printf(const char *data, int length, printf_t print_handler);
#endif /* _KNOTDCOMMON_PRINT_H_ */
#endif /* _KNOTD_COMMON_PRINT_H_ */
/*! @} */
......@@ -12,8 +12,8 @@
* @{
*/
#ifndef _KNOTDREF_H_
#define _KNOTDREF_H_
#ifndef _KNOTD_REF_H_
#define _KNOTD_REF_H_
#include <stddef.h>
......@@ -70,6 +70,6 @@ void ref_retain(ref_t *p);
*/
void ref_release(ref_t *p);
#endif /* _KNOTDREF_H_ */
#endif /* _KNOTD_REF_H_ */
/*! @} */
......@@ -41,8 +41,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Retrieved from: http://en.literateprograms.org/Skip_list_(C)?oldid=12811
*/
#ifndef _KNOTDCOMMON_SKIP_LIST_H_
#define _KNOTDCOMMON_SKIP_LIST_H_
#ifndef _KNOTD_COMMON_SKIP_LIST_H_
#define _KNOTD_COMMON_SKIP_LIST_H_
/*----------------------------------------------------------------------------*/
/*!
......@@ -210,6 +210,6 @@ void skip_print_list(const skip_list_t *list,
*/
skip_list_t *skip_copy_list(const skip_list_t *list);
#endif /* _KNOTDCOMMON_SKIP_LIST_H_ */
#endif /* _KNOTD_COMMON_SKIP_LIST_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_ALLOC_COMMON_H_
#define _KNOTDCOMMON_ALLOC_COMMON_H_
#ifndef _KNOTD_COMMON_ALLOC_COMMON_H_
#define _KNOTD_COMMON_ALLOC_COMMON_H_
#include <stdio.h>
......@@ -41,6 +41,6 @@
#endif
#endif /* _KNOTDCOMMON_ALLOC_COMMON_H_ */
#endif /* _KNOTD_COMMON_ALLOC_COMMON_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_MALLOC_H_
#define _KNOTDCOMMON_MALLOC_H_
#ifndef _KNOTD_COMMON_MALLOC_H_
#define _KNOTD_COMMON_MALLOC_H_
#include <stdlib.h>
......@@ -23,6 +23,6 @@
*/
void usage_dump();
#endif // _KNOTDCOMMON_MALLOC_H_
#endif // _KNOTD_COMMON_MALLOC_H_
/*! @} */
......@@ -67,8 +67,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_SLAB_H_
#define _KNOTDCOMMON_SLAB_H_
#ifndef _KNOTD_COMMON_SLAB_H_
#define _KNOTD_COMMON_SLAB_H_
#include <pthread.h>
#include <stdint.h>
......@@ -333,6 +333,6 @@ void *slab_alloc_realloc(slab_alloc_t* alloc, void *ptr, size_t size);
*/
void slab_alloc_stats(slab_alloc_t* alloc);
#endif /* _KNOTDCOMMON_SLAB_H_ */
#endif /* _KNOTD_COMMON_SLAB_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDSOCKADDR_H_
#define _KNOTDSOCKADDR_H_
#ifndef _KNOTD_SOCKADDR_H_
#define _KNOTD_SOCKADDR_H_
/* BSD IPv6 */
#ifndef __POSIX_VISIBLE
......@@ -100,6 +100,6 @@ int sockaddr_tostr(sockaddr_t *addr, char *dst, size_t size);
*/
int sockaddr_portnum(sockaddr_t *addr);
#endif /* _KNOTDSOCKADDR_H_ */
#endif /* _KNOTD_SOCKADDR_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDCOMMON_H_
#define _KNOTDCOMMON_H_
#ifndef _KNOTD_COMMON_H_
#define _KNOTD_COMMON_H_
#include <signal.h>
#include <stdint.h>
......@@ -114,6 +114,6 @@ typedef unsigned int uint; /*!< \brief Unsigned. */
} while (0)
#endif
#endif /* _KNOTDCOMMON_H_ */
#endif /* _KNOTD_COMMON_H_ */
/*! @} */
......@@ -10,8 +10,8 @@
* @{
*/
#ifndef _KNOTDCONF_H_
#define _KNOTDCONF_H_
#ifndef _KNOTD_CONF_H_
#define _KNOTD_CONF_H_
#include <sys/types.h>
#include <sys/socket.h>
......@@ -347,6 +347,6 @@ char* strcdup(const char *s1, const char *s2);
*/
char* strcpath(char *path);
#endif /* _KNOTDCONF_H_ */
#endif /* _KNOTD_CONF_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDLOGCONF_H_
#define _KNOTDLOGCONF_H_
#ifndef _KNOTD_LOGCONF_H_
#define _KNOTD_LOGCONF_H_
struct conf_t;
......@@ -25,6 +25,6 @@ struct conf_t;
*/
int log_conf_hook(const struct conf_t *conf, void *data);
#endif /* _KNOTDLOGCONF_H_ */
#endif /* _KNOTD_LOGCONF_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDPROCESS_H_
#define _KNOTDPROCESS_H_
#ifndef _KNOTD_PROCESS_H_
#define _KNOTD_PROCESS_H_
#include <unistd.h>
......@@ -68,6 +68,6 @@ int pid_remove(const char* fn);
*/
int pid_running(pid_t pid);
#endif // _KNOTDPROCESS_H_
#endif // _KNOTD_PROCESS_H_
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDDEBUG_H_
#define _KNOTDDEBUG_H_
#ifndef _KNOTD_DEBUG_H_
#define _KNOTD_DEBUG_H_
#include "knot/other/log.h"
#include "common/print.h"
......@@ -93,6 +93,6 @@
#define DEBUG_XFR(cmds)
#endif
#endif /* _KNOTDDEBUG_H_ */
#endif /* _KNOTD_DEBUG_H_ */
/*! @} */
......@@ -10,8 +10,8 @@
* @{
*/
#ifndef _KNOTD_ERROR_H_
#define _KNOTD_ERROR_H_
#ifndef _KNOTD__ERROR_H_
#define _KNOTD__ERROR_H_
#include <errno.h>
......@@ -78,6 +78,6 @@ static inline const char *knotd_strerror(int code)
*/
#define knot_map_errno(err...) map_errno(KNOTD_ERROR, err);
#endif /* _KNOTD_ERROR_H_ */
#endif /* _KNOTD__ERROR_H_ */
/*! @} */
......@@ -15,8 +15,8 @@
* @{
*/
#ifndef _KNOTDLOG_H_
#define _KNOTDLOG_H_
#ifndef _KNOTD_LOG_H_
#define _KNOTD_LOG_H_
/*
*/
......@@ -188,6 +188,6 @@ void hex_log(int source, const char *data, int length);
#define log_zone_info(msg...) log_msg(LOG_ZONE, LOG_INFO, msg)
#define log_zone_debug(msg...) log_msg(LOG_ZONE, LOG_DEBUG, msg)
#endif /* _KNOTDLOG_H_ */
#endif /* _KNOTD_LOG_H_ */
/*! @} */
......@@ -21,8 +21,8 @@
* @{
*/
#ifndef _KNOTDDTHREADS_H_
#define _KNOTDDTHREADS_H_
#ifndef _KNOTD_DTHREADS_H_
#define _KNOTD_DTHREADS_H_
#include <pthread.h>
......@@ -333,6 +333,6 @@ int dt_unit_lock(dt_unit_t *unit);
*/
int dt_unit_unlock(dt_unit_t *unit);
#endif // _KNOTDDTHREADS_H_
#endif // _KNOTD_DTHREADS_H_
/*! @} */
......@@ -23,8 +23,8 @@
* @{
*/
#ifndef _KNOTDJOURNAL_H_
#define _KNOTDJOURNAL_H_
#ifndef _KNOTD_JOURNAL_H_
#define _KNOTD_JOURNAL_H_
#include <stdint.h>
......@@ -223,4 +223,4 @@ int journal_update(journal_t *journal, journal_node_t *n);
*/
int journal_close(journal_t *journal);
#endif /* _KNOTDJOURNAL_H_ */
#endif /* _KNOTD_JOURNAL_H_ */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDNOTIFY_H_
#define _KNOTDNOTIFY_H_
#ifndef _KNOTD_NOTIFY_H_
#define _KNOTD_NOTIFY_H_
#include <stdint.h>
#include <string.h>
......@@ -108,6 +108,6 @@ int notify_process_response(knot_nameserver_t *nameserver,
sockaddr_t *from,
uint8_t *buffer, size_t *size);
#endif /* _KNOTDNOTIFY_H_ */
#endif /* _KNOTD_NOTIFY_H_ */
/*! @} */
......@@ -18,8 +18,8 @@
* @{
*/
#ifndef _KNOTDSERVER_H_
#define _KNOTDSERVER_H_
#ifndef _KNOTD_SERVER_H_
#define _KNOTD_SERVER_H_
#include "knot/common.h"
#include "libknot/nameserver/name-server.h"
......@@ -191,6 +191,6 @@ void server_destroy(server_t **server);
*/
int server_conf_hook(const struct conf_t *conf, void *data);
#endif // _KNOTDSERVER_H_
#endif // _KNOTD_SERVER_H_
/*! @} */
......@@ -15,8 +15,8 @@
* @{
*/
#ifndef _KNOTDSOCKET_H_
#define _KNOTDSOCKET_H_
#ifndef _KNOTD_SOCKET_H_
#define _KNOTD_SOCKET_H_
/* POSIX only. */
#include <sys/socket.h>
......@@ -100,6 +100,6 @@ int socket_listen(int fd, int backlog_size);
int socket_close(int fd);
#endif // _KNOTDSOCKET_H_
#endif // _KNOTD_SOCKET_H_
/*! @} */
......@@ -15,8 +15,8 @@
* @{
*/
#ifndef _KNOTDTCPHANDLER_H_
#define _KNOTDTCPHANDLER_H_
#ifndef _KNOTD_TCPHANDLER_H_
#define _KNOTD_TCPHANDLER_H_
#include <stdint.h>
......@@ -101,6 +101,6 @@ int tcp_loop_worker(dthread_t *thread);
*/
int tcp_loop_unit(dt_unit_t *unit);
#endif // _KNOTDTCPHANDLER_H_
#endif // _KNOTD_TCPHANDLER_H_
/*! @} */
......@@ -13,8 +13,8 @@
* @{
*/
#ifndef _KNOTDUDPHANDLER_H_
#define _KNOTDUDPHANDLER_H_
#ifndef _KNOTD_UDPHANDLER_H_
#define _KNOTD_UDPHANDLER_H_
#include "knot/server/socket.h"
#include "knot/server/server.h"
......
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDXFRHANDLER_H_
#define _KNOTDXFRHANDLER_H_
#ifndef _KNOTD_XFRHANDLER_H_
#define _KNOTD_XFRHANDLER_H_
#include <ev.h>
......@@ -129,6 +129,6 @@ int xfr_master(dthread_t *thread);
*/
int xfr_client(dthread_t *thread);
#endif // _KNOTDXFRHANDLER_H_
#endif // _KNOTD_XFRHANDLER_H_
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDZONES_H_
#define _KNOTDZONES_H_
#ifndef _KNOTD_ZONES_H_
#define _KNOTD_ZONES_H_
#include "common/lists.h"
#include "common/acl.h"
......@@ -208,6 +208,6 @@ int zones_xfr_load_changesets(knot_ns_xfr_t *xfr);
*/
int zones_apply_changesets(knot_ns_xfr_t *xfr);
#endif // _KNOTDZONES_H_
#endif // _KNOTD_ZONES_H_
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDGATHERER_H_
#define _KNOTDGATHERER_H_
#ifndef _KNOTD_GATHERER_H_
#define _KNOTD_GATHERER_H_
#include <stdint.h>
......@@ -90,6 +90,6 @@ gatherer_t *new_gatherer();
*/
void gatherer_free(gatherer_t *gatherer);
#endif /* _KNOTDSTAT_GATHERER_H_ */
#endif /* _KNOTD_STAT_GATHERER_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDSTAT_COMMON_H_
#define _KNOTDSTAT_COMMON_H_
#ifndef _KNOTD_STAT_COMMON_H_
#define _KNOTD_STAT_COMMON_H_
#include <stdio.h>
......@@ -26,6 +26,6 @@
#define debug_st(msg...)
#endif
#endif /* _KNOTDSTAT_COMMON_H_ */
#endif /* _KNOTD_STAT_COMMON_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOTDSTAT_H_
#define _KNOTDSTAT_H_
#ifndef _KNOTD_STAT_H_
#define _KNOTD_STAT_H_
#include <time.h>
#include <stdbool.h>
......@@ -137,6 +137,6 @@ void stat_static_gath_free();
static inline void stat_static_gath_free() {}
#endif /* STAT_COMPILE */
#endif /* _KNOTDSTAT_H_ */
#endif /* _KNOTD_STAT_H_ */
/*! @} */
......@@ -83,6 +83,6 @@ void knot_zload_close(zloader_t *loader);
int knot_zload_rrset_deserialize(knot_rrset_t **rrset,
uint8_t *stream, size_t *size);
#endif /* _KNOTDZONELOAD_H_ */
#endif /* _KNOTD_ZONELOAD_H_ */
/*! @} */
#ifndef _KNOTDACL_TESTS_H_
#define _KNOTDACL_TESTS_H_
#ifndef _KNOTD_ACL_TESTS_H_
#define _KNOTD_ACL_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api acl_tests_api;
#endif /* _KNOTDACL_TESTS_H_ */
#endif /* _KNOTD_ACL_TESTS_H_ */
#ifndef _KNOTDDA_TESTS_H_
#define _KNOTDDA_TESTS_H_
#ifndef _KNOTD_DA_TESTS_H_
#define _KNOTD_DA_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api da_tests_api;
#endif /* _KNOTDDA_TESTS_H_ */
#endif /* _KNOTD_DA_TESTS_H_ */
#ifndef _KNOTD_EVENTS_TESTS_H_
#define _KNOTD_EVENTS_TESTS_H_
#ifndef _KNOTD__EVENTS_TESTS_H_
#define _KNOTD__EVENTS_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api events_tests_api;
#endif /* _KNOTD_EVENTS_TESTS_H_ */
#endif /* _KNOTD__EVENTS_TESTS_H_ */
#ifndef _KNOTDSKIPLIST_TESTS_H_
#define _KNOTDSKIPLIST_TESTS_H_
#ifndef _KNOTD_SKIPLIST_TESTS_H_
#define _KNOTD_SKIPLIST_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api skiplist_tests_api;
#endif /* _KNOTDSKIPLIST_TESTS_H_ */
#endif /* _KNOTD_SKIPLIST_TESTS_H_ */
#ifndef _KNOTDSLAB_TESTS_H_
#define _KNOTDSLAB_TESTS_H_
#ifndef _KNOTD_SLAB_TESTS_H_
#define _KNOTD_SLAB_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api slab_tests_api;
#endif /* _KNOTDSLAB_TESTS_H_ */
#endif /* _KNOTD_SLAB_TESTS_H_ */
#ifndef _KNOTDCONF_TESTS_H_
#define _KNOTDCONF_TESTS_H_
#ifndef _KNOTD_CONF_TESTS_H_
#define _KNOTD_CONF_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api conf_tests_api;
#endif /* _KNOTDCONF_TESTS_H_ */
#endif /* _KNOTD_CONF_TESTS_H_ */
#ifndef _KNOTDDTHREADS_TESTS_H_
#define _KNOTDDTHREADS_TESTS_H_
#ifndef _KNOTD_DTHREADS_TESTS_H_
#define _KNOTD_DTHREADS_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api dthreads_tests_api;
#endif /* _KNOTDDTHREADS_TESTS_H_ */
#endif /* _KNOTD_DTHREADS_TESTS_H_ */
#ifndef _KNOTDJOURNAL_TESTS_H_
#define _KNOTDJOURNAL_TESTS_H_
#ifndef _KNOTD_JOURNAL_TESTS_H_
#define _KNOTD_JOURNAL_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api journal_tests_api;
#endif /* _KNOTDJOURNAL_TESTS_H_ */
#endif /* _KNOTD_JOURNAL_TESTS_H_ */
#ifndef _KNOTDSERVER_TESTS_H_
#define _KNOTDSERVER_TESTS_H_
#ifndef _KNOTD_SERVER_TESTS_H_
#define _KNOTD_SERVER_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api server_tests_api;
#endif /* _KNOTDSERVER_TESTS_H_ */
#endif /* _KNOTD_SERVER_TESTS_H_ */