def register_data_types_and_formats(formats):
    """
    Registers multiple data types and formats at once.
    To register one type/format at a time use register_custom_data_type/register_custom_data_format

    It employs a special table of types and formats described below:

    The 'formats' is a list of tuples. If a tuple has one element then it is the format to be registered with dtid=0
    If the tuple has more than one element, then tuple[0] is the data type and tuple[1:] are the data formats. For example:
    many_formats = [
      (pascal_data_type(), pascal_data_format()),
      (simplevm_data_type(), simplevm_data_format()),
      (makedword_data_format(),),
      (simplevm_data_format(),)
    ]
    The first two tuples describe data types and their associated formats.
    The last two tuples describe two data formats to be used with built-in data types.
    """
    def __reg_format(df, dtid):
        df.register(dtid)
        if dtid == 0:
            print "Registered format '%s' with built-in types, ID=%d" % (df.name, df.id)
        else:
            print "   Registered format '%s', ID=%d (dtid=%d)" % (df.name, df.id, dtid)
        return df.id != -1

    def __reg_type(dt):
        dt.register()
        print "Registered type '%s', ID=%d" % (dt.name, dt.id)
        return dt.id != -1
    ok = __walk_types_and_formats(formats, __reg_type, __reg_format, True)
    return 1 if ok else -1

# -----------------------------------------------------------------------
dataset/ETHPy150Open EiNSTeiN-/idapython/pywraps/py_custdata.py/register_data_types_and_formats/original