1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

param: change s3_param.h from a generated file to a static one

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I131e37ec92f7a826caec382023915c5e4b4c52be
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
This commit is contained in:
Garming Sam
2014-01-24 16:45:31 +13:00
committed by Andrew Bartlett
parent 0941789063
commit a7d2f9a08e
4 changed files with 24 additions and 38 deletions

View File

@ -35,8 +35,8 @@ parser.add_option("-f", "--file", dest="filename",
help="input file", metavar="FILE")
parser.add_option("-o", "--output", dest="output",
help='output file', metavar="FILE")
parser.add_option("--mode", type="choice", metavar="<FUNCTIONS|S3PROTO|LIBPROTO|PARAMDEFS|S3PARAM>",
choices=["FUNCTIONS", "S3PROTO", "LIBPROTO", "PARAMDEFS", "S3PARAM"], default="FUNCTIONS")
parser.add_option("--mode", type="choice", metavar="<FUNCTIONS|S3PROTO|LIBPROTO|PARAMDEFS>",
choices=["FUNCTIONS", "S3PROTO", "LIBPROTO", "PARAMDEFS"], default="FUNCTIONS")
parser.add_option("--scope", metavar="<GLOBAL|LOCAL>",
choices = ["GLOBAL", "LOCAL"], default="GLOBAL")
@ -258,33 +258,6 @@ def make_param_defs(path_in, path_out, scope):
finally:
file_out.close()
def make_s3_param(path_in, path_out):
file_out = open(path_out, 'w')
try:
file_out.write('/* This file was automatically generated by generate_param.py. DO NOT EDIT */\n\n')
header = get_header(path_out)
file_out.write("#ifndef %s\n" % header)
file_out.write("#define %s\n\n" % header)
file_out.write("struct loadparm_s3_helpers\n")
file_out.write("{\n")
file_out.write("\tconst char * (*get_parametric)(struct loadparm_service *, const char *type, const char *option);\n")
file_out.write("\tstruct parm_struct * (*get_parm_struct)(const char *param_name);\n")
file_out.write("\tvoid * (*get_parm_ptr)(struct loadparm_service *service, struct parm_struct *parm);\n")
file_out.write("\tstruct loadparm_service * (*get_service)(const char *service_name);\n")
file_out.write("\tstruct loadparm_service * (*get_default_loadparm_service)(void);\n")
file_out.write("\tstruct loadparm_service * (*get_servicebynum)(int snum);\n")
file_out.write("\tint (*get_numservices)(void);\n")
file_out.write("\tbool (*load)(const char *filename);\n")
file_out.write("\tbool (*set_cmdline)(const char *pszParmName, const char *pszParmValue);\n")
file_out.write("\tvoid (*dump)(FILE *f, bool show_defaults, int maxtoprint);\n")
file_out.write("\tconst char * (*dnsdomain)(void);\n")
file_out.write("\tchar * (*lp_string)(TALLOC_CTX *ctx, const char *in);\n")
file_out.write("\tstruct loadparm_global *globals;\n")
file_out.write("};\n")
file_out.write("\n#endif /* %s */\n\n" % header)
finally:
file_out.close()
if options.mode == 'FUNCTIONS':
generate_functions(options.filename, options.output)
elif options.mode == 'S3PROTO':
@ -293,5 +266,3 @@ elif options.mode == 'LIBPROTO':
make_lib_proto(options.filename, options.output)
elif options.mode == 'PARAMDEFS':
make_param_defs(options.filename, options.output, options.scope)
elif options.mode == 'S3PARAM':
make_s3_param(options.filename, options.output)