# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

api = {
    "algorithm": [
        "all_of",
        "any_of",
        "none_of",
        "for_each",
        "for_each_n",
        "count",
        "count_if",
        "mismatch",
        "find",
        "find_if",
        "find_if_not",
        "find_end",
        "find_first_of",
        "adjacent_find",
        "search",
        "search_n",
        "copy",
        "copy_if",
        "copy_n",
        "copy_backward",
        "move",
        "move_backward",
        "fill",
        "fill_n",
        "transform",
        "generate",
        "generate_n",
        "remove",
        "remove_if",
        "remove_copy",
        "remove_copy_if",
        "replace",
        "replace_if",
        "replace_copy",
        "replace_copy_if",
        "swap",
        "swap_ranges",
        "iter_swap",
        "reverse",
        "reverse_copy",
        "rotate",
        "rotate_copy",
        "shuffle",
        "sample",
        "unique",
        "unique_copy",
        "is_partitioned",
        "partition",
        "partition_copy",
        "stable_partition",
        "partition_point",
        "is_sorted",
        "is_sorted_until",
        "sort",
        "partial_sort",
        "partial_sort_copy",
        "stable_sort",
        "nth_element",
        "lower_bound",
        "upper_bound",
        "binary_search",
        "equal_range",
        "merge",
        "inplace_merge",
        "includes",
        "set_difference",
        "set_intersection",
        "set_symmetric_difference",
        "set_union",
        "is_heap",
        "is_heap_until",
        "make_heap",
        "push_heap",
        "pop_heap",
        "sort_heap",
        "max",
        "max_element",
        "min",
        "min_element",
        "minmax",
        "minmax_element",
        "clamp",
        "equal",
        "lexicographical_compare",
        "lexicographical_compare_three_way",
        "is_permutation",
        "next_permutation",
        "prev_permutation",
    ],
    "vector": [
        "vector",
    ],
    "list": [
        "list",
    ],
    "array": [
        "array",
        "to_array",
        "size",
    ],
    "map": [
        "map",
        "multimap",
    ],
    "set": [
        "set",
        "multiset",
    ],
    "string": [
        "char_traits",
        "string",
        "u8string",
        "u16string",
        "u32string",
        "wstring",
        "pmr::stringpmr::u8string",
        "pmr::u16string",
        "pmr::u32string",
        "pmr::wstring",
        "getline",
        "stoi",
        "stol",
        "stoll",
        "stoul",
        "stoull",
        "stof",
        "stod",
        "stold",
        "hash",
        "to_string",
        "to_wstring",
    ],
    "string_view": [
        "basic_string_view",
        "string_view",
        "u8string_view",
        "u16string_view",
        "u32string_view",
        "wstring_view",
    ],
    "numeric": [
        "iota",
        "accumulate",
        "reduce",
        "transform_reduce",
        "inner_product",
        "adjacent_difference",
        "partial_sum",
        "inclusive_scan",
        "exclusive_scan",
        "transform_inclusive_scan",
        "transform_exclusive_scan",
        "gcd",
        "midpoint",
    ],
    "tuple": [
        "tuple",
        "tuple_size",
        "tuple_element",
        "ignore",
        "make_tuple",
        "tie",
        "forward_as_tuple",
        "tuple_cat",
        "get",
        "apply",
        "make_from_tuple",
    ],
    "optional": [
        "optional",
        "bad_optional_access",
        "nullopt_t",
        "nullopt",
        "make_optional",
    ],
    "unordered_map": ["unordered_map", "unordered_multimap"],
    "unordered_set": ["unordered_set", "unordered_multiset"],
    "memory": [
        "pointer_traits",
        "pointer_safety",
        "allocator",
        "allocator_traits",
        "uses_allocator",
        "raw_storage_iterator",
        "unique_ptr",
        "shared_ptr",
        "weak_ptr",
        "owner_less",
        "enable_shared_from_this",
        "bad_weak_ptr",
        "default_delete",
        "allocator_arg",
        "allocator_arg_t",
        "addressof",
        "align",
        "uninitialized_copy",
        "uninitialized_copy_n",
        "uninitialized_fill",
        "uninitialized_fill_n",
        "uninitialized_move",
        "uninitialized_move_n",
        "uninitialized_default_construct",
        "uninitialized_default_construct_n",
        "uninitialized_value_construct",
        "uninitialized_value_construct_n",
        "destroy_at",
        "destroy",
        "destroy_n",
        "make_unique",
        "make_unique_for_overwrite",
        "make_shared",
        "make_shared_for_overwrite",
        "static_pointer_cast",
        "dynamic_pointer_cast",
        "const_pointer_cast",
        "reinterpret_pointer_cast",
        "get_deleter",
    ],
    "utility": [
        "rel_ops",
        "swap",
        "exchange",
        "forward",
        "move",
        "move_if_no_except",
        "as_const",
        "declval",
        "cmp_equal",
        "in_range",
        "make_pair",
        "pair",
        "tuple_size",
        "get",
        "tuple_element",
        "integer_sequence",
        "ignore",
        "piecewise_construct",
        "piecewise_construct_t",
        "in_place",
        "in_place_type",
        "in_place_index",
        "in_place_t",
        "in_place_type_t",
        "in_place_index_t",
    ],
    "type_traits": [
        "integral_constant",
        "bool_constant",
        "true_type",
        "false_type",
        "is_void",
        "is_null_pointer",
        "is_integral",
        "is_floating_point",
        "is_array",
        "is_enum",
        "is_union",
        "is_class",
        "is_function",
        "is_pointer",
        "is_lvalue_reference",
        "is_rvalue_reference",
        "is_member_object_pointer",
        "is_member_function_pointer",
        "is_fundamental",
        "is_arithmetic",
        "is_scalar",
        "is_object",
        "is_compound",
        "is_reference",
        "is_member_pointer",
        "is_const",
        "is_volatile",
        "is_trivial",
        "is_trivially_copyable",
        "is_standard_layout",
        "is_pod",
        "is_literal_type",
        "has_unique_object_representations",
        "is_empty",
        "is_polymorphic",
        "is_abstract",
        "is_final",
        "is_aggregate",
        "is_implicit_lifetime",
        "is_signed",
        "is_unsigned",
        "is_bounded_array",
        "is_unbounded_array",
        "is_scoped_enum",
        "is_constructible",
        "is_trivially_constructible",
        "is_nothrow_constructible",
        "is_default_constructible",
        "is_trivially_default_constructible",
        "is_nothrow_default_constructible",
        "is_copy_constructible",
        "is_trivially_copy_constructible",
        "is_nothrow_copy_constructible",
        "is_move_constructible",
        "is_trivially_move_constructible",
        "is_nothrow_move_constructible",
        "is_assignable",
        "is_trivially_assignable",
        "is_nothrow_assignable",
        "is_copy_assignable",
        "is_trivially_copy_assignable",
        "is_nothrow_copy_assignable",
        "is_move_assignable",
        "is_trivially_move_assignable",
        "is_nothrow_move_assignable",
        "is_destructible",
        "is_trivially_destructible",
        "is_nothrow_destructible",
        "has_virtual_destructor",
        "is_swappable_with",
        "is_swappable",
        "is_nothrow_swappable_with",
        "is_nothrow_swappable",
        "reference_converts_from_temporary",
        "reference_constructs_from_temporary",
        "alignment_of",
        "rank",
        "extent",
        "is_same",
        "is_base_of",
        "is_virtual_base_of",
        "is_convertibleis_nothrow_convertible",
        "is_layout_compatible",
        "is_pointer_interconvertible_base_of",
        "is_invocable",
        "is_invocable_r",
        "is_nothrow_invocable",
        "is_nothrow_invocable_r",
        "remove_cv",
        "remove_const",
        "remove_volatile",
        "add_cv",
        "add_const",
        "add_volatile",
        "remove_reference",
        "add_lvalue_reference",
        "add_rvalue_reference",
        "remove_pointer",
        "add_pointer",
        "make_signed",
        "make_unsigned",
        "remove_extent",
        "remove_all_extents",
        "aligned_storage",
        "aligned_union",
        "decay",
        "remove_cvref",
        "enable_if",
        "conditional",
        "common_type",
        "common_reference",
        "basic_common_reference",
        "underlying_type",
        "result_ofinvoke_result",
        "void_t",
        "type_identity",
        "unwrap_reference",
        "unwrap_ref_decay",
        "conjunction",
        "disjunction",
        "negation",
        "is_pointer_interconvertible_with_class",
        "is_corresponding_member",
        "is_constant_evaluated",
        "is_within_lifetime",
    ],
    "initializer_list": ["initializer_list"],
    "limits": [
        "numeric_limits",
        "float_round_style",
        "float_denorm_style",
        "round_indeterminate",
        "round_toward_zero",
        "round_to_nearest",
        "round_toward_infinity",
    ],
    "iterator": [
        "advance",
        "distance",
        "next",
        "prev",
        "begin",
        "cbegin",
        "end",
        "cend",
        "make_reverse_iterator",
        "make_move_iterator",
        "front_inserter",
        "back_inserter",
        "inserter",
        "istream_iterator",
        "ostream_iterator",
        "istreambug_iterator",
        "ostreambuf_iterator",
        "insert_iterator",
        "front_insert_iterator",
        "back_insert_iterator",
        "move_iterator",
        "reverse_iterator",
        "iterator",
        "iterator_traits",
        "input_iterator_tag",
        "output_iterator_tag",
        "forward_iterator_tag",
        "bidirectional_iterator_tag",
        "random_access_iterator_tag",
        "contiguous_iterator_tag",
    ],
}
api["type_traits"].extend(
    [f"{k}_v" for k in api["type_traits"]] + [f"{k}_t" for k in api["type_traits"]]
)

capi = {
    "assert.h": [
        "assert",
    ],
    "string.h": [
        "memcpy",
        "memmove",
        "strcpy",
        "strncpy",
        "strdup",
        "strndup",
        "strcat",
        "strncat",
        "memcmp",
        "strcmp",
        "strco",
        "strncmp",
        "strxfr",
        "memchr",
        "memch",
        "strchr",
        "strch",
        "strcspn",
        "strpbr",
        "strpbrk",
        "strrch",
        "strrchr",
        "strspn",
        "strstr",
        "strst",
        "strtok",
        "memset",
        "strerror",
        "strlen",
        "strnlen",
    ],
    "stdint.h": [
        "int8_t",
        "int16_t",
        "int32_t",
        "int64_t",
        "intN_t",
        "int_fast8_t",
        "int_fast16_t",
        "int_fast32_t",
        "int_fast64_t",
        "int_fastN_t",
        "int_least8_t",
        "int_least16_t",
        "int_least32_t",
        "int_least64_t",
        "int_leastN_t",
        "intmax_t",
        "intptr_t",
        "uint8_t",
        "uint16_t",
        "uint32_t",
        "uint64_t",
        "uintN_t",
        "uint_fast8_t",
        "uint_fast16_t",
        "uint_fast32_t",
        "uint_fast64_t",
        "uint_fastN_t",
        "uint_least8_t",
        "uint_least16_t",
        "uint_least32_t",
        "uint_least64_t",
        "uint_leastN_t",
        "uintmax_t",
        "uintptr_t",
        "INTN_MIN",
        "INTN_MAX",
        "UINTN_MAX",
        "INT_FASTN_MIN",
        "INT_FASTN_MAX",
        "UINT_FASTN_MAX",
        "INT_LEASTN_MIN",
        "INT_LEASTN_MAX",
        "UINT_LEASTN_MAX",
        "INTMAX_MIN",
        "INTMAX_MAX",
        "UINTMAX_MAX",
        "INTPTR_MIN",
        "INTPTR_MAX",
        "UINTPTR_MAX",
        "PTRDIFF_MIN",
        "PTRDIFF_MAX",
        "SIZE_MAX",
        "SIG_ATOMIC_MIN",
        "SIG_ATOMIC_MAX",
        "WCHAR_MIN",
        "WCHAR_MAX",
        "WINT_MIN",
        "WINT_MAX",
        "INTN_C",
        "UINTN_C",
        "INTMAX_C",
        "UINTMAX_C",
    ],
    "stddef.h": [
        "NULL",
        "offsetof",
        "size_t",
        "ptrdiff_t",
        "nullptr_t",
        "max_align_t",
        "byte",
        "to_integer",
    ],
    "stdarg.h": [
        "va_list",
        "va_arg",
        "va_begin",
        "va_end",
        "ca_copy",
    ],
    "stdio.h": [
        # macros
        "BUFSIZ",
        "EOF",
        "FILENAME_MAX",
        "FOPEN_MAX",
        "L_ctermid",
        "L_cuserid",
        "L_tmpnam",
        "NULL",
        "SEEK_CUR",
        "SEEK_END",
        "SEEK_SET",
        "TMP_MAX",
        "clearerr",
        "feof",
        "ferror",
        "fileno",
        "getc",
        "getchar",
        "putc",
        "putchar",
        "stderr",
        "stdin",
        "stdout",
        # typedef
        "FILE",
        # functions
        "clearerr",
        "fclose",
        "fdopen",
        "feof",
        "ferror",
        "fflush",
        "fgetc",
        "fgetpos",
        "fgets",
        "fileno",
        "fmemopen",
        "fopen",
        "fopencookie",
        "fprintf",
        "fpurge",
        "fputc",
        "fputs",
        "fread",
        "freopen",
        "fscanf",
        "fseek",
        "fseeko",
        "fsetpos",
        "ftell",
        "ftello",
        "fwrite",
        "getc",
        "getchar",
        "gets",
        "getw",
        "mktemp",
        "open_memstream",
        "open_wmemstream",
        "perror",
        "printf",
        "putc",
        "putchar",
        "puts",
        "putw",
        "remove",
        "rewind",
        "scanf",
        "setbuf",
        "setbuffer",
        "setlinebuf",
        "setvbuf",
        "snprintf",
        "snwprintf",
        "sprintf",
        "sscanf",
        "strerror",
        "sys_errlist",
        "sys_nerr",
        "tempnam",
        "tmpfile",
        "tmpnam",
        "ungetc",
        "vfprintf",
        "vfscanf",
        "vprintf",
        "vscanf",
        "vsnprintf",
        "vsprintf",
        "vsscanf",
    ],
    "stdlib.h": [
        "_Exit",
        "_exit",
        "_wtoi",
        "_wtoi_l",
        "abort",
        "abs",
        "aligned_alloc",
        "at_quick_exit",
        "atexit",
        "atof",
        "atoi",
        "atol",
        "atoll",
        "bsearch",
        "call_once",
        "calloc",
        "div",
        "div_t",
        "exit",
        "free",
        "free_aligned_sized",
        "free_sized",
        "getenv",
        "labs",
        "ldiv",
        "llabs",
        "lldiv",
        "malloc",
        "mblen",
        "mbstowcs",
        "mbtowc",
        "memalignment",
        "putenv",
        "qsort",
        "quick_exit",
        "rand",
        "realloc",
        "srand",
        "strfromd",
        "strfromf",
        "strfroml",
        "strtod",
        "strtof",
        "strtol",
        "strtold",
        "strtoll",
        "strtoul",
        "strtoull",
        "system",
        "wcstombs",
        "wctomb",
    ],
}
