summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-12-15 14:20:16 +0100
committerMichael Adam <obnox@samba.org>2008-12-15 14:20:16 +0100
commit6244194265f7f1027c16664b2701ce114435a59b (patch)
tree2bc8a46003e8acf587eb26d540943ee37405b6d2
parent91c543f0b5a539da4194f14dee8cad0f980a117e (diff)
downloadsamba-6244194265f7f1027c16664b2701ce114435a59b.tar.gz
samba-6244194265f7f1027c16664b2701ce114435a59b.tar.bz2
samba-6244194265f7f1027c16664b2701ce114435a59b.zip
s3:loadparm: add lp_local_ptr() that operates on a service struct
and use this in lp_local_ptr_by_snum(). Michael
-rw-r--r--source3/param/loadparm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 3600266310..43fd9d9d3a 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -671,6 +671,8 @@ static void set_server_role(void);
static void set_default_server_announce_type(void);
static void set_allowed_client_auth(void);
+static void *lp_local_ptr(struct service *service, void *ptr);
+
static const struct enum_list enum_protocol[] = {
{PROTOCOL_NT1, "NT1"},
{PROTOCOL_LANMAN2, "LANMAN2"},
@@ -7167,13 +7169,23 @@ static void init_copymap(struct service *pservice)
}
/***************************************************************************
+ Return the local pointer to a parameter given a service struct and the
+ pointer into the default structure.
+***************************************************************************/
+
+static void *lp_local_ptr(struct service *service, void *ptr)
+{
+ return (void *)(((char *)service) + PTR_DIFF(ptr, &sDefault));
+}
+
+/***************************************************************************
Return the local pointer to a parameter given the service number and the
pointer into the default structure.
***************************************************************************/
void *lp_local_ptr_by_snum(int snum, void *ptr)
{
- return (void *)(((char *)ServicePtrs[snum]) + PTR_DIFF(ptr, &sDefault));
+ return lp_local_ptr(ServicePtrs[snum], ptr);
}
/***************************************************************************