From b3258addb4bc861d8d0cf8842397c209ec2d3704 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 16 May 2011 22:26:00 +1000 Subject: s3-param: remove unused share_iterator functions --- source3/include/proto.h | 3 --- source3/include/smb.h | 4 ---- source3/param/loadparm.c | 48 ------------------------------------------------ 3 files changed, 55 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index 8c00e3a274..39d607c205 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1675,9 +1675,6 @@ int lp_servicenumber(const char *pszServiceName); bool share_defined(const char *service_name); struct share_params *get_share_params(TALLOC_CTX *mem_ctx, const char *sharename); -struct share_iterator *share_list_all(TALLOC_CTX *mem_ctx); -struct share_params *next_share(struct share_iterator *list); -struct share_params *next_printer(struct share_iterator *list); struct share_params *snum2params_static(int snum); const char *volume_label(int snum); bool lp_domain_master(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 863ba7cf1f..ec78317b9b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -397,10 +397,6 @@ struct share_params { int service; }; -struct share_iterator { - int next_id; -}; - typedef struct connection_struct { struct connection_struct *next, *prev; struct smbd_server_connection *sconn; /* can be NULL */ diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e245ecf594..b80c31bedf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -9775,54 +9775,6 @@ struct share_params *get_share_params(TALLOC_CTX *mem_ctx, return result; } -struct share_iterator *share_list_all(TALLOC_CTX *mem_ctx) -{ - struct share_iterator *result; - - if (!(result = TALLOC_P(mem_ctx, struct share_iterator))) { - DEBUG(0, ("talloc failed\n")); - return NULL; - } - - result->next_id = 0; - return result; -} - -struct share_params *next_share(struct share_iterator *list) -{ - struct share_params *result; - - while (!lp_snum_ok(list->next_id) && - (list->next_id < lp_numservices())) { - list->next_id += 1; - } - - if (list->next_id >= lp_numservices()) { - return NULL; - } - - if (!(result = TALLOC_P(list, struct share_params))) { - DEBUG(0, ("talloc failed\n")); - return NULL; - } - - result->service = list->next_id; - list->next_id += 1; - return result; -} - -struct share_params *next_printer(struct share_iterator *list) -{ - struct share_params *result; - - while ((result = next_share(list)) != NULL) { - if (lp_print_ok(result->service)) { - break; - } - } - return result; -} - /* * This is a hack for a transition period until we transformed all code from * service numbers to struct share_params. -- cgit