<s> """<STR_LIT>""" <EOL> import ctypes <EOL> import os <EOL> import sys <EOL> base = os . path . abspath ( sys . argv [ <NUM_LIT:0> ] ) <EOL> if sys . argv [ <NUM_LIT:0> ] : base = os . path . dirname ( base ) <EOL> libname = '<STR_LIT>' + ( '<STR_LIT>' if '<STR_LIT>' in os . uname ( ) else '<STR_LIT>' ) <EOL> filenames = [ <EOL> os . path . join ( base , '<STR_LIT>' , libname ) , <EOL> os . path . join ( base , '<STR_LIT>' , libname ) , <EOL> os . path . join ( base , '<STR_LIT>' , libname ) , <EOL> libname <EOL> ] <EOL> for filename in filenames : <EOL> try : <EOL> libfab = ctypes . CDLL ( filename ) <EOL> except OSError : <EOL> continue <EOL> else : <EOL> break <EOL> else : <EOL> print '<STR_LIT>' <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def p ( t ) : return ctypes . POINTER ( t ) <EOL> def pp ( t ) : return p ( p ( t ) ) <EOL> from region import Region <EOL> libfab . split . argtypes = [ Region , p ( Region ) , ctypes . c_int ] <EOL> libfab . split . restype = ctypes . c_int <EOL> libfab . split_xy . argtypes = [ Region , p ( Region ) , ctypes . c_int ] <EOL> libfab . split_xy . restype = ctypes . c_int <EOL> libfab . octsect . argtypes = [ Region , Region * <NUM_LIT:8> ] <EOL> libfab . octsect . restype = ctypes . c_uint8 <EOL> libfab . octsect_overlap . argtypes = [ Region , Region * <NUM_LIT:8> ] <EOL> libfab . octsect_overlap . restype = ctypes . c_uint8 <EOL> libfab . build_arrays . argtypes = [ p ( Region ) ] + [ ctypes . c_float ] * <NUM_LIT:6> <EOL> libfab . free_arrays . argtypes = [ p ( Region ) ] <EOL> from vec3f import Vec3f <EOL> libfab . deproject . argtypes = [ Vec3f , ctypes . c_float * <NUM_LIT:4> ] <EOL> libfab . deproject . restype = Vec3f <EOL> libfab . project . argtypes = [ Vec3f , ctypes . c_float * <NUM_LIT:4> ] <EOL> libfab . project . restype = Vec3f <EOL> class MathTreeP ( ctypes . c_void_p ) : pass <EOL> class PackedTreeP ( ctypes . c_void_p ) : pass <EOL> libfab . render8 . argtypes = [ <EOL> PackedTreeP , Region , pp ( ctypes . c_uint8 ) , p ( ctypes . c_int ) <EOL> ] <EOL> libfab . render16 . argtypes = [ <EOL> PackedTreeP , Region , pp ( ctypes . c_uint16 ) , p ( ctypes . c_int ) <EOL> ] <EOL> libfab . free_tree . argtypes = [ MathTreeP ] <EOL> libfab . print_tree . argtypes = [ MathTreeP ] <EOL> libfab . fdprint_tree . argtypes = [ MathTreeP , ctypes . c_int ] <EOL> libfab . fdprint_tree_verbose . argtypes = [ MathTreeP , ctypes . c_int ] <EOL> libfab . clone_tree . argtypes = [ MathTreeP ] <EOL> libfab . clone_tree . restype = MathTreeP <EOL> libfab . count_nodes . argtypes = [ MathTreeP ] <EOL> libfab . count_nodes . restype = ctypes . c_uint <EOL> libfab . dot_arrays . argtypes = [ MathTreeP , p ( ctypes . c_char ) ] <EOL> libfab . dot_tree . argtypes = [ MathTreeP , p ( ctypes . c_char ) ] <EOL> libfab . make_packed . argtypes = [ MathTreeP ] <EOL> libfab . make_packed . restype = PackedTreeP <EOL> libfab . free_packed . argtypes = [ PackedTreeP ] <EOL> from interval import Interval <EOL> libfab . eval_i . argtypes = [ PackedTreeP , Interval , Interval , Interval ] <EOL> libfab . eval_i . restype = Interval <EOL> libfab . parse . argtypes = [ p ( ctypes . c_char ) ] <EOL> libfab . parse . restype = MathTreeP <EOL> from koko . c . asdf import ASDF <EOL> libfab . build_asdf . argtypes = [ <EOL> PackedTreeP , Region , ctypes . c_bool , p ( ctypes . c_int ) <EOL> ] <EOL> libfab . build_asdf . restype = p ( ASDF ) <EOL> libfab . free_asdf . argtypes = [ p ( ASDF ) ] <EOL> libfab . asdf_root . argtypes = [ PackedTreeP , Region ] <EOL> libfab . asdf_root . restype = p ( ASDF ) <EOL> libfab . count_leafs . argtypes = [ p ( ASDF ) ] <EOL> libfab . count_leafs . restype = ctypes . c_int <EOL> libfab . count_cells . argtypes = [ p ( ASDF ) ] <EOL> libfab . count_cells . restype = ctypes . c_int <EOL> libfab . asdf_scale . argtypes = [ p ( ASDF ) , ctypes . c_float ] <EOL> libfab . asdf_slice . argtypes = [ p ( ASDF ) , ctypes . c_float ] <EOL> libfab . asdf_slice . restype = p ( ASDF ) <EOL> libfab . find_dimensions . argtypes = [ p ( ASDF ) ] + [ p ( ctypes . c_int ) ] * <NUM_LIT:3> <EOL> libfab . get_d_from_children . argtypes = [ p ( ASDF ) ] <EOL> libfab . interpolate . argtypes = [ p ( ctypes . c_float ) ] + [ ctypes . c_float ] * <NUM_LIT:9> <EOL> libfab . interpolate . restype = ctypes . c_float <EOL> libfab . get_depth . argtypes = [ p ( ASDF ) ] <EOL> libfab . get_depth . restype = ctypes . c_int <EOL> libfab . asdf_get_max . argtypes = [ p ( ASDF ) ] <EOL> libfab . asdf_get_max . restype = ctypes . c_float <EOL> libfab . asdf_get_min . argtypes = [ p ( ASDF ) ] <EOL> libfab . asdf_get_min . restype = ctypes . c_float <EOL> libfab . asdf_histogram . argtypes = [ <EOL> p ( ASDF ) , p ( ctypes . c_int * <NUM_LIT:4> ) , ctypes . c_int <EOL> ] <EOL> libfab . simplify . argtypes = [ p ( ASDF ) , ctypes . c_bool ] <EOL> libfab . import_vol_region . argtypes = ( <EOL> [ p ( ctypes . c_char ) ] + [ ctypes . c_int ] * <NUM_LIT:3> + <EOL> [ Region , ctypes . c_int , ctypes . c_float , <EOL> ctypes . c_bool , ctypes . c_bool ] <EOL> ) <EOL> libfab . import_vol_region . restype = p ( ASDF ) <EOL> libfab . import_vol . argtypes = [ <EOL> p ( ctypes . c_char ) , ctypes . c_int , ctypes . c_int , ctypes . c_int , <EOL> ctypes . c_float , ctypes . c_float , ctypes . c_bool , ctypes . c_bool <EOL> ] <EOL> libfab . import_vol . restype = p ( ASDF ) <EOL> libfab . import_lattice . argtypes = [ <EOL> pp ( ctypes . c_float ) , ctypes . c_int , ctypes . c_int , <EOL> ctypes . c_float , ctypes . c_float , ctypes . c_bool <EOL> ] <EOL> libfab . import_lattice . restype = p ( ASDF ) <EOL> libfab . render_asdf . argtypes = [ <EOL> p ( ASDF ) , Region , ctypes . c_float * <NUM_LIT:4> , pp ( ctypes . c_uint16 ) <EOL> ] <EOL> libfab . render_asdf_shaded . argtypes = [ <EOL> p ( ASDF ) , Region , ctypes . c_float * <NUM_LIT:4> , <EOL> pp ( ctypes . c_uint16 ) , pp ( ctypes . c_uint16 ) , pp ( ctypes . c_uint8 * <NUM_LIT:3> ) <EOL> ] <EOL> libfab . draw_asdf_cells . argtypes = [ p ( ASDF ) , Region , pp ( ctypes . c_uint8 * <NUM_LIT:3> ) ] <EOL> libfab . draw_asdf_distance . argtypes = [ <EOL> p ( ASDF ) , Region , ctypes . c_float , ctypes . c_float , pp ( ctypes . c_uint16 ) <EOL> ] <EOL> libfab . asdf_write . argtypes = [ p ( ASDF ) , p ( ctypes . c_char ) ] <EOL> libfab . asdf_read . argtypes = [ p ( ctypes . c_char ) ] <EOL> libfab . asdf_read . restype = p ( ASDF ) <EOL> from koko . c . mesh import Mesh <EOL> libfab . triangulate . argtypes = [ <EOL> p ( ASDF ) , p ( ctypes . c_int ) <EOL> ] <EOL> libfab . triangulate . restype = p ( Mesh ) <EOL> libfab . triangulate_cms . argtypes = [ p ( ASDF ) ] <EOL> libfab . triangulate_cms . restype = p ( Mesh ) <EOL> from koko . c . path import Path <EOL> libfab . contour . argtypes = [ <EOL> p ( ASDF ) , p ( pp ( Path ) ) , p ( ctypes . c_int ) <EOL> ] <EOL> libfab . contour . restype = ctypes . c_int <EOL> libfab . asdf_offset . argtypes = [ <EOL> p ( ASDF ) , ctypes . c_float , ctypes . c_float <EOL> ] <EOL> libfab . asdf_offset . restype = p ( ASDF ) <EOL> libfab . find_support . argtypes = [ <EOL> ctypes . c_int , ctypes . c_int , pp ( ctypes . c_uint8 ) , pp ( ctypes . c_uint8 ) <EOL> ] <EOL> libfab . colorize_slice . argtypes = [ <EOL> ctypes . c_int , ctypes . c_int , pp ( ctypes . c_uint8 ) , pp ( ctypes . c_uint8 * <NUM_LIT:3> ) <EOL> ] <EOL> libfab . next_slice . argtypes = [ <EOL> ctypes . c_int , ctypes . c_int , ctypes . c_float , ctypes . c_float , <EOL> pp ( ctypes . c_uint8 ) , pp ( ctypes . c_uint8 ) <EOL> ] <EOL> libfab . distance_transform1 . argtypes = ( <EOL> [ ctypes . c_int ] * <NUM_LIT:4> + <EOL> [ pp ( ctypes . c_uint8 ) , pp ( ctypes . c_uint32 ) ] <EOL> ) <EOL> libfab . distance_transform2 . argtypes = ( <EOL> [ ctypes . c_int ] * <NUM_LIT:3> + <EOL> [ ctypes . c_float , pp ( ctypes . c_uint32 ) , pp ( ctypes . c_float ) ] <EOL> ) <EOL> libfab . distance_transform . argtypes = [ <EOL> ctypes . c_int , ctypes . c_int , ctypes . c_float , <EOL> pp ( ctypes . c_uint8 ) , pp ( ctypes . c_float ) <EOL> ] <EOL> libfab . save_png16L . argtypes = [ p ( ctypes . c_char ) , ctypes . c_int , <EOL> ctypes . c_int , ctypes . c_float * <NUM_LIT:6> , <EOL> pp ( ctypes . c_uint16 ) ] <EOL> libfab . count_by_color . argtypes = [ p ( ctypes . c_char ) , ctypes . c_int , <EOL> ctypes . c_int , ctypes . c_uint32 , <EOL> p ( ctypes . c_uint32 ) ] <EOL> libfab . depth_blit . argtypes = ( <EOL> [ pp ( ctypes . c_uint8 ) , pp ( ctypes . c_uint8 ) , pp ( ctypes . c_uint8 * <NUM_LIT:3> ) ] + <EOL> [ ctypes . c_int ] * <NUM_LIT:4> + [ ctypes . c_float ] * <NUM_LIT:3> <EOL> ) <EOL> libfab . load_png_stats . argtypes = ( <EOL> [ p ( ctypes . c_char ) ] + [ p ( ctypes . c_int ) ] * <NUM_LIT:2> + [ p ( ctypes . c_float ) ] * <NUM_LIT:3> <EOL> ) <EOL> libfab . load_png . argtypes = [ p ( ctypes . c_char ) , pp ( ctypes . c_uint16 ) ] <EOL> libfab . free_mesh . argtypes = [ p ( Mesh ) ] <EOL> libfab . increase_indices . argtypes = [ p ( Mesh ) , ctypes . c_uint32 ] <EOL> libfab . save_mesh . argtypes = [ p ( ctypes . c_char ) , p ( Mesh ) ] <EOL> libfab . load_mesh . argtypes = [ p ( ctypes . c_char ) ] <EOL> libfab . load_mesh . restype = p ( Mesh ) <EOL> libfab . merge_meshes . argtypes = [ ctypes . c_uint32 , pp ( Mesh ) ] <EOL> libfab . merge_meshes . restype = p ( Mesh ) <EOL> libfab . save_stl . argtypes = [ p ( Mesh ) , p ( ctypes . c_char ) ] <EOL> libfab . load_stl . argtypes = [ p ( ctypes . c_char ) ] <EOL> libfab . load_stl . restype = p ( Mesh ) <EOL> from koko . c . path import Path <EOL> libfab . find_paths . argtypes = [ <EOL> ctypes . c_int , ctypes . c_int , pp ( ctypes . c_float ) , <EOL> ctypes . c_float , ctypes . c_int , p ( ctypes . c_float ) , p ( pp ( Path ) ) <EOL> ] <EOL> libfab . find_paths . restype = ctypes . c_int <EOL> libfab . free_paths . argtypes = [ pp ( Path ) , ctypes . c_int ] <EOL> libfab . sort_paths . argtypes = [ pp ( Path ) , ctypes . c_int , p ( ctypes . c_int ) ] <EOL> libfab . finish_cut . argtypes = ( <EOL> [ ctypes . c_int ] * <NUM_LIT:2> + [ pp ( ctypes . c_uint16 ) ] + [ ctypes . c_float ] * <NUM_LIT:4> + <EOL> [ ctypes . c_int , p ( pp ( Path ) ) ] <EOL> ) <EOL> del p , pp </s>
