# Path: unicycler/misc.py
# def quit_with_error(message):
#     """
#     Displays the given message and ends the program's execution.
#     """
#     log.log('Error: ' + message, 0, stderr=True)
#     sys.exit(1)


import os
from ctypes import CDLL, cast, c_char_p, c_int, c_uint, c_ulong, c_double, c_void_p, c_bool, \
    c_float, POINTER
from .misc import quit_with_error
"""
Copyright 2017 Ryan Wick (rrwick@gmail.com)
https://github.com/rrwick/Unicycler

Unicycler makes use of several C++ functions which are in cpp_functions.so. This module uses ctypes
to wrap them in similarly named Python functions.

This file is part of Unicycler. Unicycler is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version. Unicycler is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
details. You should have received a copy of the GNU General Public License along with Unicycler. If
not, see <http://www.gnu.org/licenses/>.
"""



SO_FILE = 'cpp_functions.so'
SO_FILE_FULL = os.path.join(os.path.dirname(os.path.realpath(__file__)), SO_FILE)
if not os.path.isfile(SO_FILE_FULL):

# Path: unicycler/misc.py
# def quit_with_error(message):
#     """
#     Displays the given message and ends the program's execution.
#     """
#     log.log('Error: ' + message, 0, stderr=True)
#     sys.exit(1)


# Path: unicycler/cpp_wrappers.py
import os
from ctypes import CDLL, cast, c_char_p, c_int, c_uint, c_ulong, c_double, c_void_p, c_bool, \
    c_float, POINTER
from .misc import quit_with_error

"""
Copyright 2017 Ryan Wick (rrwick@gmail.com)
https://github.com/rrwick/Unicycler

Unicycler makes use of several C++ functions which are in cpp_functions.so. This module uses ctypes
to wrap them in similarly named Python functions.

This file is part of Unicycler. Unicycler is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version. Unicycler is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
details. You should have received a copy of the GNU General Public License along with Unicycler. If
not, see <http://www.gnu.org/licenses/>.
"""



SO_FILE = 'cpp_functions.so'
SO_FILE_FULL = os.path.join(os.path.dirname(os.path.realpath(__file__)), SO_FILE)
if not os.path.isfile(SO_FILE_FULL):

    quit_with_error('could not find ' + SO_FILE + '\n' +