diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-04-04 16:02:17 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-04-04 16:02:17 +0200 |
commit | 30ccc36b8d61f2d09c3f0adeec4db0ab540619b8 (patch) | |
tree | 740fd5c06ebffb4991ede45182447d317603d115 /source4/lib | |
parent | adc09857420c4a9306148e8d15ff5faf633ba7a5 (diff) | |
parent | c26387a473fd26ac51c74c001b520d7fd7d353ec (diff) | |
download | samba-30ccc36b8d61f2d09c3f0adeec4db0ab540619b8.tar.gz samba-30ccc36b8d61f2d09c3f0adeec4db0ab540619b8.tar.bz2 samba-30ccc36b8d61f2d09c3f0adeec4db0ab540619b8.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into openchange
Conflicts:
source/headermap.txt
(This used to be commit 1b084e85c1f5963d924f7764ae751f8cd8e57364)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/messaging/irpc.h | 4 | ||||
-rw-r--r-- | source4/lib/util/util.c | 15 | ||||
-rw-r--r-- | source4/lib/util/util.h | 7 |
3 files changed, 26 insertions, 0 deletions
diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index d596c6721e..f44c0af3ec 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifndef IRPC_H +#define IRPC_H + #include "librpc/gen_ndr/irpc.h" /* @@ -123,4 +126,5 @@ struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, TALLOC_ void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status); +#endif diff --git a/source4/lib/util/util.c b/source4/lib/util/util.c index 7b6bfeeb7b..b5bb75358e 100644 --- a/source4/lib/util/util.c +++ b/source4/lib/util/util.c @@ -582,3 +582,18 @@ _PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count) return realloc(ptr, el_size * count); } +_PUBLIC_ void *talloc_check_name_abort(const void *ptr, const char *name) +{ + void *result; + + result = talloc_check_name(ptr, name); + if (result != NULL) + return result; + + DEBUG(0, ("Talloc type mismatch, expected %s, got %s\n", + name, talloc_get_name(ptr))); + smb_panic("talloc type mismatch"); + /* Keep the compiler happy */ + return NULL; +} + diff --git a/source4/lib/util/util.h b/source4/lib/util/util.h index 60c8437634..3bf6b98d2f 100644 --- a/source4/lib/util/util.h +++ b/source4/lib/util/util.h @@ -803,4 +803,11 @@ bool pm_process( const char *fileName, bool (*pfunc)(const char *, const char *, void *), void *userdata); +/** + * Add-on to talloc_get_type + */ +_PUBLIC_ void *talloc_check_name_abort(const void *ptr, const char *name); +#define talloc_get_type_abort(ptr, type) \ + (type *)talloc_check_name_abort(ptr, #type) + #endif /* _SAMBA_UTIL_H_ */ |