param: remove FN_LOCAL_STRING
authorRalph Boehme <slow@samba.org>
Thu, 7 Nov 2019 10:37:47 +0000 (11:37 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:37 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/param/loadparm.c
source3/param/loadparm.c

index 572d8bff7acf48be76ae57fa0e0eabb20204076b..611c1b240af9ead1c6e959aad08c4892d6906429 100644 (file)
@@ -193,15 +193,12 @@ static struct loadparm_context *global_loadparm_context;
 /* Local parameters don't need the ->s3_fns because the struct
  * loadparm_service is shared and lpcfg_service() checks the ->s3_fns
  * hook */
-#define FN_LOCAL_STRING(fn_name,val) \
+#define FN_LOCAL_SUBSTITUTED_STRING(fn_name,val) \
  _PUBLIC_ char *lpcfg_ ## fn_name(struct loadparm_service *service, \
                                        struct loadparm_service *sDefault, TALLOC_CTX *ctx) { \
         return(talloc_strdup(ctx, lpcfg_string((const char *)((service != NULL && service->val != NULL) ? service->val : sDefault->val)))); \
  }
 
-/* just a copy for now */
-#define FN_LOCAL_SUBSTITUTED_STRING(fn_name,val) FN_LOCAL_STRING(fn_name,val)
-
 #define FN_LOCAL_CONST_STRING(fn_name,val) \
  _PUBLIC_ const char *lpcfg_ ## fn_name(struct loadparm_service *service, \
                                        struct loadparm_service *sDefault) { \
index 462de4f0b5f83bfa7e06806eb71cc9aaae56a1ad..ff1a057e3ee8855c4dd355eba9d24cd86ec4519e 100644 (file)
@@ -1061,8 +1061,6 @@ char *lp_ ## fn_name(TALLOC_CTX *ctx, const struct loadparm_substitution *lp_sub
 #define FN_GLOBAL_INTEGER(fn_name,ptr) \
  int lp_ ## fn_name(void) {return(*(int *)(&Globals.ptr));}
 
-#define FN_LOCAL_STRING(fn_name,val) \
-char *lp_ ## fn_name(TALLOC_CTX *ctx,int i) {return(lp_string((ctx), (LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val));}
 #define FN_LOCAL_SUBSTITUTED_STRING(fn_name,val) \
 char *lp_ ## fn_name(TALLOC_CTX *ctx, const struct loadparm_substitution *lp_sub, int i) \
  {return lpcfg_substituted_string((ctx), lp_sub, (LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val);}