def c_analysis_get_workspace_dir(session_id):
    char_ptr = ctypes.c_char_p()
    check(_HISTOKAT_LIB.analysis_get_workspace_dir(
        ctypes.c_int64(session_id), ctypes.byref(char_ptr)))
    wrk_dir = char_ptr.value.decode('utf-8')
    check(_HISTOKAT_LIB.destroy_string(ctypes.byref(char_ptr)))
    return wrk_dir
def c_image_get_group_id(image_id):
    char_ptr = ctypes.c_char_p()
    check(_HISTOKAT_LIB.image_get_group_id(
        ctypes.c_int64(image_id), ctypes.byref(char_ptr)))
    grp_id = char_ptr.value.decode('utf-8')
    check(_HISTOKAT_LIB.destroy_string(ctypes.byref(char_ptr)))
    return grp_id
def c_image_get_slice_name(image_id, z):
    char_ptr = ctypes.c_char_p()
    check(_HISTOKAT_LIB.image_get_slice_name(ctypes.c_int64(
        image_id), ctypes.c_int64(z), ctypes.byref(char_ptr)))
    slice_name = char_ptr.value.decode('utf-8')
    check(_HISTOKAT_LIB.destroy_string(ctypes.byref(char_ptr)))
    return slice_name
def c_analysis_inspect_object(session_id, inspect_mode, position, level):
    char_ptr = ctypes.c_char_p()
    c_pos = convert_py_to_c_vector(position)
    check(_HISTOKAT_LIB.analysis_inspect_object(ctypes.c_int64(session_id), ctypes.c_int64(
        inspect_mode), ctypes.byref(c_pos), ctypes.c_int64(level), ctypes.byref(char_ptr)))
    inspection_value = char_ptr.value.decode('utf-8')
    check(_HISTOKAT_LIB.destroy_string(ctypes.byref(char_ptr)))
    return inspection_value
def c_get_controller_workspace_dir():
    char_ptr = ctypes.c_char_p()
    check(_HISTOKAT_LIB.get_controller_workspace_dir(ctypes.byref(char_ptr)))
    wrk_dir = char_ptr.value.decode('utf-8')
    check(_HISTOKAT_LIB.destroy_string(ctypes.byref(char_ptr)))
    return wrk_dir
def c_get_last_error():
    s = ctypes.c_char_p()
    _HISTOKAT_LIB.get_last_error(ctypes.byref(s))
    err = s.value.decode('utf-8')
    check(_HISTOKAT_LIB.destroy_string(ctypes.byref(s)))
    return err