mirror of
https://github.com/samba-team/samba.git
synced 2025-03-05 20:58:40 +03:00
loadparm: Add lp_wi_scan_share_parametrics
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15688 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 89da15756d81746d80b43c2fe04c51fc07591849)
This commit is contained in:
parent
5148ff9706
commit
0b9371aa0c
@ -1262,6 +1262,31 @@ int lp_wi_scan_global_parametrics(const char *regex_str,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int lp_wi_scan_share_parametrics(int snum,
|
||||
const char *regex_str,
|
||||
size_t max_matches,
|
||||
bool (*cb)(const char *string,
|
||||
regmatch_t matches[],
|
||||
void *private_data),
|
||||
void *private_data)
|
||||
{
|
||||
struct loadparm_service *s = NULL;
|
||||
int ret;
|
||||
|
||||
if (!LP_SNUM_OK(snum)) {
|
||||
/*
|
||||
* We return regex return values here, REG_NOMATCH is
|
||||
* the closest I could find.
|
||||
*/
|
||||
return REG_NOMATCH;
|
||||
}
|
||||
s = ServicePtrs[snum];
|
||||
|
||||
ret = lp_wi_scan_parametrics(
|
||||
s->param_opt, regex_str, max_matches, cb, private_data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define MISSING_PARAMETER(name) \
|
||||
DEBUG(0, ("%s(): value is NULL or empty!\n", #name))
|
||||
|
||||
|
@ -75,6 +75,13 @@ int lp_wi_scan_global_parametrics(
|
||||
bool (*cb)(const char *string, regmatch_t matches[],
|
||||
void *private_data),
|
||||
void *private_data);
|
||||
int lp_wi_scan_share_parametrics(int snum,
|
||||
const char *regex_str,
|
||||
size_t max_matches,
|
||||
bool (*cb)(const char *string,
|
||||
regmatch_t matches[],
|
||||
void *private_data),
|
||||
void *private_data);
|
||||
|
||||
const char *lp_parm_const_string(int snum, const char *type, const char *option, const char *def);
|
||||
struct loadparm_service;
|
||||
|
Loading…
x
Reference in New Issue
Block a user