#include "lib/param/param_global.h"
-#define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
-
-#ifndef N_
-#define N_(x) x
-#endif
-
-#include "lib/param/param_table.c"
+#define NUMPARAMETERS (num_parameters())
struct loadparm_service *lpcfg_default_service(struct loadparm_context *lp_ctx)
{
} def;
};
+extern struct parm_struct parm_table[];
+
struct file_lists {
struct file_lists *next;
char *name;
bool lp_include(struct loadparm_context *, int, const char *, char **);
void init_printer_values(TALLOC_CTX *, struct loadparm_service *);
+int num_parameters(void);
+
/**
* Check if two parameters are equal.
*/
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "includes.h"
+#include "lib/param/param.h"
+#include "lib/param/loadparm.h"
+#include "lib/param/param_global.h"
+#include "libcli/smb/smb_constants.h"
+
+#ifndef N_
+#define N_(x) x
+#endif
+
static const struct enum_list enum_protocol[] = {
{PROTOCOL_SMB2_10, "SMB2"}, /* for now keep PROTOCOL_SMB2_10 */
{PROTOCOL_SMB3_00, "SMB3"}, /* for now keep PROTOCOL_SMB3_00 */
#define LOCAL_VAR(name) offsetof(struct loadparm_service, name)
-static struct parm_struct parm_table[] = {
+struct parm_struct parm_table[] = {
{N_("Base Options"), P_SEP, P_SEPARATOR},
{
{NULL, P_BOOL, P_NONE, 0, NULL, NULL, 0}
};
+int num_parameters(void)
+{
+ return (sizeof(parm_table) / sizeof(struct parm_struct));
+}
private_library=True)
bld.SAMBA_LIBRARY('samba-hostconfig',
- source='loadparm.c generic.c util.c',
+ source='loadparm.c generic.c util.c param_table.c',
pc_files='samba-hostconfig.pc',
vnum='0.0.1',
deps='DYNCONFIG server-role tdb',
# burn through the preceding lines
while True:
l = f.readline()
- if l.startswith("static struct parm_struct parm_table"):
+ if l.startswith("struct parm_struct parm_table"):
break
for l in f.readlines():
static bool bGlobalOnly = false;
static struct file_lists *file_lists = NULL;
-#define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
+#define NUMPARAMETERS (num_parameters())
static void set_allowed_client_auth(void);
static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values);
static void free_param_opts(struct parmlist_entry **popts);
-#include "lib/param/param_table.c"
-
/* this is used to prevent lots of mallocs of size 1 */
static const char null_string[] = "";