def METHOD_NAME(flags):
    """Extract the required #DEFINEs from deltachat.h.
    Since #DEFINEs are interpreted by the C preprocessor we can not
    use the compiler to extract these and need to parse the header
    file ourselves.
    The defines are returned in a string that can be passed to CFFIs
    cdef() method.
    """
    header = find_header(flags)
    defines_re = re.compile(
        r"""
        \#define\s+   # The start of a define.
        (             # Begin capturing group which captures the define name.
            (?:       # A nested group which is not captured, this allows us
                      #    to build the list of prefixes to extract without
                      #    creation another capture group.
                DC_EVENT
                | DC_QR
                | DC_MSG
                | DC_LP
                | DC_EMPTY
                | DC_CERTCK
                | DC_STATE
                | DC_STR
                | DC_CONTACT_ID
                | DC_GCL
                | DC_GCM
                | DC_SOCKET
                | DC_CHAT
                | DC_PROVIDER
                | DC_KEY_GEN
                | DC_IMEX
                | DC_CONNECTIVITY
                | DC_DOWNLOAD
            )         # End of prefix matching
            _[\w_]+   # Match the suffix, e.g. _RSA2048 in DC_KEY_GEN_RSA2048
        )             # Close the capturing group, this contains
                      # the entire name e.g. DC_MSG_TEXT.
        \s+\S+        # Ensure there is whitespace followed by a value.
    """,
        re.VERBOSE,
    )
    defines = []
    with open(header) as fp:
        for line in fp:
            match = defines_re.match(line)
            if match:
                defines.append(match.group(1))
    return "\n".join(f"#define {d} ..." for d in defines)