Lines Matching full:name

26     * name: the symbol name ('MBEDTLS_xxx').
29 * active: True if name is defined, False if a #define for name is
31 * section: the name of the section that contains this symbol.
34 def __init__(self, active, name, value='', section=None): argument
36 self.name = name
48 * `name in config` is `True` if the symbol `name` is active, `False`
49 otherwise (whether `name` is inactive or not known).
50 * `config[name]` is the value of the macro `name`. If `name` is inactive,
51 raise `KeyError` (even if `name` is known).
52 * `config[name] = value` sets the value associated to `name`. `name`
54 name to become set.
60 def __contains__(self, name): argument
66 return name in self.settings and self.settings[name].active
70 return all(self.__contains__(name) for name in names)
74 return any(self.__contains__(name) for name in names)
76 def known(self, name): argument
77 """True if a #define for name is present, whether it's commented out or not."""
78 return name in self.settings
80 def __getitem__(self, name): argument
81 """Get the value of name, i.e. what the preprocessor symbol expands to.
83 If name is not known, raise KeyError. name does not need to be active.
85 return self.settings[name].value
87 def get(self, name, default=None): argument
88 """Get the value of name. If name is inactive (not set), return default.
90 If a #define for name is present and not commented out, return
93 If a #define for name is present but commented out, return default.
95 if name in self.settings:
96 return self.settings[name].value
100 def __setitem__(self, name, value): argument
101 """If name is known, set its value.
103 If name is not known, raise KeyError.
105 self.settings[name].value = value
107 def set(self, name, value=None): argument
108 """Set name to the given value and make it active.
110 If value is None and name is already known, don't change its value.
111 If value is None and name is not known, set its value to the empty
114 if name in self.settings:
116 self.settings[name].value = value
117 self.settings[name].active = True
119 self.settings[name] = Setting(True, name, value=value)
121 def unset(self, name): argument
122 """Make name unset (inactive).
124 name remains known if it was known before.
126 if name not in self.settings:
128 self.settings[name].active = False
134 `adapter(name, active, section)` for each setting, where `active` is
135 `True` if `name` is set and `False` if `name` is known but unset,
136 and `section` is the name of the section containing `name`. If
137 `adapter` returns `True`, then set `name` (i.e. make it active),
138 otherwise unset `name` (i.e. make it known but inactive).
141 setting.active = adapter(setting.name, setting.active,
150 if regex.search(setting.name):
216 def is_seamless_alt(name): argument
228 if name in (
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)
278 def keep_in_baremetal(name): argument
280 if name in EXCLUDE_FROM_BAREMETAL:
284 def baremetal_adapter(name, active, section): argument
288 if name == 'MBEDTLS_NO_PLATFORM_ENTROPY':
291 return include_in_full(name) and keep_in_baremetal(name)
303 def baremetal_size_adapter(name, active, section): argument
304 if name in EXCLUDE_FOR_SIZE:
306 return baremetal_adapter(name, active, section)
308 def include_in_crypto(name): argument
310 if name.startswith('MBEDTLS_X509_') or \
311 name.startswith('MBEDTLS_SSL_') or \
312 name.startswith('MBEDTLS_KEY_EXCHANGE_'):
314 if name in [
325 ``crypto_adapter(adapter)(name, active, section)`` is like
326 ``adapter(name, active, section)``, but unsets all X.509 and TLS symbols.
328 def continuation(name, active, section): argument
329 if not include_in_crypto(name):
333 return adapter(name, active, section)
342 ``no_deprecated_adapter(adapter)(name, active, section)`` is like
343 ``adapter(name, active, section)``, but unsets all deprecated symbols
346 def continuation(name, active, section): argument
347 if name == 'MBEDTLS_DEPRECATED_REMOVED':
349 if name in DEPRECATED:
353 return adapter(name, active, section)
359 ``no_platform_adapter(adapter)(name, active, section)`` is like
360 ``adapter(name, active, section)``, but unsets all platform symbols other
363 def continuation(name, active, section): argument
365 if name.startswith('MBEDTLS_PLATFORM_') and name != 'MBEDTLS_PLATFORM_C':
369 return adapter(name, active, section)
404 def set(self, name, value=None): argument
405 if name not in self.settings:
406 self.templates.append((name, '', '#define ' + name + ' '))
407 super().set(name, value)
412 r'(?P<name>\w+)' +
416 _section_line_regexp = (r'\s*/?\*+\s*[\\@]name\s+SECTION:\s*' +
431 name = m.group('name')
433 template = (name,
435 m.group('define') + name +
437 self.settings[name] = Setting(active, name, value,
441 def _format_template(self, name, indent, middle): argument
444 The line has the form "<indent>#define <name> <value>"
445 where <middle> is "#define <name> ".
447 setting = self.settings[name]
451 # Normally the whitespace to separate the symbol name from the
522 whose name contains a match for
532 whose name contains a match for
536 def add_adapter(name, function, description): argument
537 subparser = subparsers.add_parser(name, help=description)