(types)
Pass in some types and they will be registered to the global type store.

    The argument may be either a mapping from name to SimType, or a plain SimType.
    The plain SimType must be either a struct or union type with a name present.

    >>> register_types(parse_types("typedef int x; typedef float y;"))
    >>> register_types(parse_type("struct abcd { int ab; float cd; }"))
Pass in some types and they will be registered to the global type store.
Pass in some types and they will be registered to the global type store .
def register_types(types):
    """
    Pass in some types and they will be registered to the global type store.

    The argument may be either a mapping from name to SimType, or a plain SimType.
    The plain SimType must be either a struct or union type with a name present.

    >>> register_types(parse_types("typedef int x; typedef float y;"))
    >>> register_types(parse_type("struct abcd { int ab; float cd; }"))
    """
    if type(types) is SimStruct:
        if types.name == '<anon>':
            raise ValueError("Cannot register anonymous struct")
        ALL_TYPES['struct ' + types.name] = types
    elif type(types) is SimUnion:
        if types.name == '<anon>':
            raise ValueError("Cannot register anonymous union")
        ALL_TYPES['union ' + types.name] = types
    else:
        ALL_TYPES.update(types)
def register_types ( types ) : if type ( types ) is SimStruct : if types . name == '<anon>' : raise ValueError ( "Cannot register anonymous struct" ) ALL_TYPES [ 'struct ' + types . name ] = types elif type ( types ) is SimUnion : if types . name == '<anon>' : raise ValueError ( "Cannot register anonymous union" ) ALL_TYPES [ 'union ' + types . name ] = types else : ALL_TYPES . update ( types )