def _load_libenv_cdef()

in gym3/libenv.py [0:0]


def _load_libenv_cdef():
    libenv_cdef = ""
    with open(os.path.join(get_header_dir(), "libenv.h")) as f:
        inside_cdef = False
        for line in f:
            if line.startswith("// BEGIN_CDEF"):
                inside_cdef = True
            elif line.startswith("// END_CDEF"):
                inside_cdef = False
            elif line.startswith("#if") or line.startswith("#endif"):
                continue

            if inside_cdef:
                line = line.replace("LIBENV_API", "")
                libenv_cdef += line
    return libenv_cdef