From 472c1f2f739a793ea90044c9c35b32cae58d27d0 Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: May 21 2015 12:06:37 +0000 Subject: Move typedefs to types.h to avoid cross-include problems. https://fedorahosted.org/bind-dyndb-ldap/ticket/151 --- diff --git a/src/acl.h b/src/acl.h index e438132..b6603a2 100644 --- a/src/acl.h +++ b/src/acl.h @@ -21,7 +21,6 @@ #ifndef _LD_ACL_H_ #define _LD_ACL_H_ -#include "ldap_entry.h" #include "types.h" #include diff --git a/src/ldap_convert.h b/src/ldap_convert.h index daa0db0..112aaac 100644 --- a/src/ldap_convert.h +++ b/src/ldap_convert.h @@ -22,10 +22,11 @@ #define _LD_LDAP_CONVERT_H_ #include +#include #include #include "str.h" -#include "zone_register.h" +#include "types.h" #define LDAP_ATTR_FORMATSIZE 32 /* "expected" maximum attribute name length */ #define LDAP_RDATATYPE_SUFFIX "Record" diff --git a/src/ldap_driver.c b/src/ldap_driver.c index 46729f9..9ff176b 100644 --- a/src/ldap_driver.c +++ b/src/ldap_driver.c @@ -53,6 +53,7 @@ #include "log.h" #include "util.h" #include "zone_manager.h" +#include "zone_register.h" #ifdef HAVE_VISIBILITY #define VISIBLE __attribute__((__visibility__("default"))) diff --git a/src/ldap_entry.c b/src/ldap_entry.c index e11c6f1..49bc2f0 100644 --- a/src/ldap_entry.c +++ b/src/ldap_entry.c @@ -32,8 +32,11 @@ #include "ldap_convert.h" #include "ldap_entry.h" +#include "mldap.h" +#include "metadb.h" #include "str.h" #include "util.h" +#include "zone_register.h" /* Represents values associated with LDAP attribute */ static void ATTR_NONNULLS diff --git a/src/ldap_entry.h b/src/ldap_entry.h index 1f87489..6fc3cbd 100644 --- a/src/ldap_entry.h +++ b/src/ldap_entry.h @@ -29,6 +29,7 @@ #include "fwd_register.h" #include "util.h" #include "str.h" +#include "types.h" #define LDAP_DEPRECATED 1 #include @@ -46,7 +47,6 @@ typedef struct ldap_attribute ldap_attribute_t; typedef LIST(ldap_attribute_t) ldap_attributelist_t; /* Represents LDAP entry and it's attributes */ -typedef struct ldap_entry ldap_entry_t; typedef LIST(ldap_entry_t) ldap_entrylist_t; struct ldap_entry { char *dn; diff --git a/src/ldap_helper.h b/src/ldap_helper.h index 834b30d..7e32822 100644 --- a/src/ldap_helper.h +++ b/src/ldap_helper.h @@ -22,13 +22,13 @@ #ifndef _LD_LDAP_HELPER_H_ #define _LD_LDAP_HELPER_H_ -#include "settings.h" #include "types.h" -#include "zone_register.h" #include #include +#include + #define LDAPDB_EVENTCLASS ISC_EVENTCLASS(0xDDDD) isc_result_t ldapdb_rdatalist_findrdatatype(ldapdb_rdatalist_t *rdatalist, diff --git a/src/lock.c b/src/lock.c index b6b2e9f..fb00927 100644 --- a/src/lock.c +++ b/src/lock.c @@ -22,6 +22,7 @@ #include #include "lock.h" +#include "ldap_helper.h" /** * Lock BIND dispatcher and allow only single task to run. diff --git a/src/lock.h b/src/lock.h index ed27164..2d0ebbd 100644 --- a/src/lock.h +++ b/src/lock.h @@ -21,8 +21,8 @@ #ifndef LOCK_H_ #define LOCK_H_ -#include "ldap_helper.h" #include "util.h" +#include "types.h" void ATTR_NONNULLS run_exclusive_enter(ldap_instance_t *inst, isc_result_t *statep); diff --git a/src/mldap.h b/src/mldap.h index a0e9b73..a44c264 100644 --- a/src/mldap.h +++ b/src/mldap.h @@ -5,10 +5,12 @@ #ifndef SRC_MLDAP_H_ #define SRC_MLDAP_H_ +#include + #include "metadb.h" +#include "types.h" #include "util.h" -typedef struct mldapdb mldapdb_t; isc_result_t ATTR_CHECKRESULT ATTR_NONNULLS mldap_new(isc_mem_t *mctx, mldapdb_t **dbp); diff --git a/src/settings.h b/src/settings.h index 610e428..300b714 100644 --- a/src/settings.h +++ b/src/settings.h @@ -33,7 +33,6 @@ #define SETTING_SET_NAME_ZONE "LDAP idnsZone object" typedef struct setting setting_t; -typedef struct settings_set settings_set_t; /* Make sure that cases in get_value_ptr() are synchronized */ typedef enum { diff --git a/src/types.h b/src/types.h index 1ca1411..047612f 100644 --- a/src/types.h +++ b/src/types.h @@ -48,5 +48,8 @@ typedef struct enum_txt_assoc { typedef struct ldap_instance ldap_instance_t; typedef struct zone_register zone_register_t; +typedef struct mldapdb mldapdb_t; +typedef struct ldap_entry ldap_entry_t; +typedef struct settings_set settings_set_t; #endif /* !_LD_TYPES_H_ */ diff --git a/src/zone_manager.h b/src/zone_manager.h index 556e66c..ee4a094 100644 --- a/src/zone_manager.h +++ b/src/zone_manager.h @@ -24,7 +24,7 @@ #include -#include "ldap_helper.h" +#include "types.h" typedef struct db_instance db_instance_t;