import os

with open("sdk-map-23.txt", "r") as f:
    sdk_apis = [x.split()[0].split("(")[0] for x in f.readlines()]

with open("framework-map-23.txt", "r") as f:
    framework_apis = [x.split()[0].split("(")[0] for x in f.readlines()]

with open("cp-map-23.txt", "r") as f:
    cp_apis = [x.split()[0] for x in f.readlines()]
    real_cp_apis = []
    for api in cp_apis:
        real_cp_apis.append(api + ".insert")
        real_cp_apis.append(api + ".delete")
        real_cp_apis.append(api + ".update")
        real_cp_apis.append(api + ".query")

total_apis = sorted(set(sdk_apis + framework_apis + real_cp_apis))

with open("api.conf", "w") as f:
    f.writelines(["NULL %s%s" % (x, os.linesep)
                  for x in total_apis])
