Lines Matching full:name

37     * name: the symbol name ('MBEDTLS_xxx').
40 * active: True if name is defined, False if a #define for name is
42 * section: the name of the section that contains this symbol.
45 def __init__(self, active, name, value='', section=None): argument
47 self.name = name
59 * `name in config` is `True` if the symbol `name` is active, `False`
60 otherwise (whether `name` is inactive or not known).
61 * `config[name]` is the value of the macro `name`. If `name` is inactive,
62 raise `KeyError` (even if `name` is known).
63 * `config[name] = value` sets the value associated to `name`. `name`
65 name to become set.
71 def __contains__(self, name): argument
77 return name in self.settings and self.settings[name].active
81 return all(self.__contains__(name) for name in names)
85 return any(self.__contains__(name) for name in names)
87 def known(self, name): argument
88 """True if a #define for name is present, whether it's commented out or not."""
89 return name in self.settings
91 def __getitem__(self, name): argument
92 """Get the value of name, i.e. what the preprocessor symbol expands to.
94 If name is not known, raise KeyError. name does not need to be active.
96 return self.settings[name].value
98 def get(self, name, default=None): argument
99 """Get the value of name. If name is inactive (not set), return default.
101 If a #define for name is present and not commented out, return
104 If a #define for name is present but commented out, return default.
106 if name in self.settings:
107 return self.settings[name].value
111 def __setitem__(self, name, value): argument
112 """If name is known, set its value.
114 If name is not known, raise KeyError.
116 self.settings[name].value = value
118 def set(self, name, value=None): argument
119 """Set name to the given value and make it active.
121 If value is None and name is already known, don't change its value.
122 If value is None and name is not known, set its value to the empty
125 if name in self.settings:
127 self.settings[name].value = value
128 self.settings[name].active = True
130 self.settings[name] = Setting(True, name, value=value)
132 def unset(self, name): argument
133 """Make name unset (inactive).
135 name remains known if it was known before.
137 if name not in self.settings:
139 self.settings[name].active = False
145 `adapter(name, active, section)` for each setting, where `active` is
146 `True` if `name` is set and `False` if `name` is known but unset,
147 and `section` is the name of the section containing `name`. If
148 `adapter` returns `True`, then set `name` (i.e. make it active),
149 otherwise unset `name` (i.e. make it known but inactive).
152 setting.active = adapter(setting.name, setting.active,
161 if regex.search(setting.name):
221 def is_seamless_alt(name): argument
233 if name == 'MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT':
236 return name.startswith('MBEDTLS_PLATFORM_')
238 def include_in_full(name): argument
240 if name in EXCLUDE_FROM_FULL:
242 if name.endswith('_ALT'):
243 return is_seamless_alt(name)
246 def full_adapter(name, active, section): argument
250 return include_in_full(name)
275 def keep_in_baremetal(name): argument
277 if name in EXCLUDE_FROM_BAREMETAL:
281 def baremetal_adapter(name, active, section): argument
285 if name == 'MBEDTLS_NO_PLATFORM_ENTROPY':
288 return include_in_full(name) and keep_in_baremetal(name)
300 def baremetal_size_adapter(name, active, section): argument
301 if name in EXCLUDE_FOR_SIZE:
303 return baremetal_adapter(name, active, section)
305 def include_in_crypto(name): argument
307 if name.startswith('MBEDTLS_X509_') or \
308 name.startswith('MBEDTLS_SSL_') or \
309 name.startswith('MBEDTLS_KEY_EXCHANGE_'):
311 if name in [
322 ``crypto_adapter(adapter)(name, active, section)`` is like
323 ``adapter(name, active, section)``, but unsets all X.509 and TLS symbols.
325 def continuation(name, active, section): argument
326 if not include_in_crypto(name):
330 return adapter(name, active, section)
339 ``no_deprecated_adapter(adapter)(name, active, section)`` is like
340 ``adapter(name, active, section)``, but unsets all deprecated symbols
343 def continuation(name, active, section): argument
344 if name == 'MBEDTLS_DEPRECATED_REMOVED':
346 if name in DEPRECATED:
350 return adapter(name, active, section)
385 def set(self, name, value=None): argument
386 if name not in self.settings:
387 self.templates.append((name, '', '#define ' + name + ' '))
388 super().set(name, value)
393 r'(?P<name>\w+)' +
397 _section_line_regexp = (r'\s*/?\*+\s*[\\@]name\s+SECTION:\s*' +
412 name = m.group('name')
414 template = (name,
416 m.group('define') + name +
418 self.settings[name] = Setting(active, name, value,
422 def _format_template(self, name, indent, middle): argument
425 The line has the form "<indent>#define <name> <value>"
426 where <middle> is "#define <name> ".
428 setting = self.settings[name]
432 # Normally the whitespace to separate the symbol name from the
503 whose name contains a match for
513 whose name contains a match for
517 def add_adapter(name, function, description): argument
518 subparser = subparsers.add_parser(name, help=description)