Remove generation of ssl_debug_helpers_generated.h
It's now under version control and meant to be updated manually. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
09f1ee68b6
commit
ccbc318fc5
4 changed files with 7 additions and 45 deletions
|
@ -232,10 +232,7 @@ class EnumDefinition:
|
|||
body = body.format(translation_table='\n'.join(translation_table),
|
||||
name=self._name,
|
||||
prototype=self._prototype)
|
||||
prototype = 'const char *{name}_str( {prototype} in );\n'
|
||||
prototype = prototype.format(name=self._name,
|
||||
prototype=self._prototype)
|
||||
return body, prototype
|
||||
return body
|
||||
|
||||
|
||||
OUTPUT_C_TEMPLATE = '''\
|
||||
|
@ -254,28 +251,6 @@ OUTPUT_C_TEMPLATE = '''\
|
|||
|
||||
'''
|
||||
|
||||
OUTPUT_H_TEMPLATE = '''\
|
||||
/* Automatically generated by generate_ssl_debug_helpers.py. DO NOT EDIT. */
|
||||
#ifndef MBEDTLS_SSL_DEBUG_HELPERS_H
|
||||
#define MBEDTLS_SSL_DEBUG_HELPERS_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#if defined(MBEDTLS_DEBUG_C)
|
||||
|
||||
#include "mbedtls/ssl.h"
|
||||
#include "ssl_misc.h"
|
||||
|
||||
{functions}
|
||||
|
||||
#endif /* MBEDTLS_DEBUG_C */
|
||||
|
||||
#endif /* SSL_DEBUG_HELPERS_H */
|
||||
|
||||
/* End of automatically generated file. */
|
||||
|
||||
'''
|
||||
|
||||
|
||||
def generate_ssl_debug_helpers(output_directory, mbedtls_root):
|
||||
"""
|
||||
|
@ -286,23 +261,17 @@ def generate_ssl_debug_helpers(output_directory, mbedtls_root):
|
|||
source_code = remove_c_comments(f.read())
|
||||
|
||||
definitions = dict()
|
||||
prototypes = dict()
|
||||
for start, instance in preprocess_c_source_code(source_code, EnumDefinition):
|
||||
if start in definitions:
|
||||
continue
|
||||
if isinstance(instance, EnumDefinition):
|
||||
definition, prototype = instance.generate_tranlation_function()
|
||||
definition = instance.generate_tranlation_function()
|
||||
else:
|
||||
definition = instance
|
||||
prototype = instance
|
||||
definitions[start] = definition
|
||||
prototypes[start] = prototype
|
||||
|
||||
function_definitions = [str(v) for _, v in sorted(definitions.items())]
|
||||
function_prototypes = [str(v) for _, v in sorted(prototypes.items())]
|
||||
if output_directory == sys.stdout:
|
||||
sys.stdout.write(OUTPUT_H_TEMPLATE.format(
|
||||
functions='\n'.join(function_prototypes)))
|
||||
sys.stdout.write(OUTPUT_C_TEMPLATE.format(
|
||||
functions='\n'.join(function_definitions)))
|
||||
else:
|
||||
|
@ -310,10 +279,6 @@ def generate_ssl_debug_helpers(output_directory, mbedtls_root):
|
|||
f.write(OUTPUT_C_TEMPLATE.format(
|
||||
functions='\n'.join(function_definitions)))
|
||||
|
||||
with open(os.path.join(output_directory, 'ssl_debug_helpers_generated.h'), 'w') as f:
|
||||
f.write(OUTPUT_H_TEMPLATE.format(
|
||||
functions='\n'.join(function_prototypes)))
|
||||
|
||||
|
||||
def main():
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue