annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pysam/libchtslib.c @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 /* Generated by Cython 3.0.11 */
jpayne@68 2
jpayne@68 3 /* BEGIN: Cython Metadata
jpayne@68 4 {
jpayne@68 5 "distutils": {
jpayne@68 6 "define_macros": [
jpayne@68 7 [
jpayne@68 8 "BUILDING_WHEEL",
jpayne@68 9 null
jpayne@68 10 ]
jpayne@68 11 ],
jpayne@68 12 "depends": [
jpayne@68 13 "/project/htslib/htslib/bgzf.h",
jpayne@68 14 "/project/htslib/htslib/cram.h",
jpayne@68 15 "/project/htslib/htslib/faidx.h",
jpayne@68 16 "/project/htslib/htslib/hfile.h",
jpayne@68 17 "/project/htslib/htslib/hts.h",
jpayne@68 18 "/project/htslib/htslib/kstring.h",
jpayne@68 19 "/project/htslib/htslib/sam.h",
jpayne@68 20 "/project/htslib/htslib/tbx.h",
jpayne@68 21 "/project/htslib/htslib/vcf.h",
jpayne@68 22 "/project/htslib/htslib/vcfutils.h",
jpayne@68 23 "/project/pysam/htslib_util.h"
jpayne@68 24 ],
jpayne@68 25 "extra_compile_args": [
jpayne@68 26 "-Wno-unused",
jpayne@68 27 "-Wno-strict-prototypes",
jpayne@68 28 "-Wno-sign-compare",
jpayne@68 29 "-Wno-error=declaration-after-statement"
jpayne@68 30 ],
jpayne@68 31 "extra_link_args": [
jpayne@68 32 "-Wl,-rpath,$ORIGIN"
jpayne@68 33 ],
jpayne@68 34 "extra_objects": [
jpayne@68 35 "htslib/kfunc.o",
jpayne@68 36 "htslib/kstring.o",
jpayne@68 37 "htslib/bcf_sr_sort.o",
jpayne@68 38 "htslib/bgzf.o",
jpayne@68 39 "htslib/errmod.o",
jpayne@68 40 "htslib/faidx.o",
jpayne@68 41 "htslib/header.o",
jpayne@68 42 "htslib/hfile.o",
jpayne@68 43 "htslib/hts.o",
jpayne@68 44 "htslib/hts_expr.o",
jpayne@68 45 "htslib/hts_os.o",
jpayne@68 46 "htslib/md5.o",
jpayne@68 47 "htslib/multipart.o",
jpayne@68 48 "htslib/probaln.o",
jpayne@68 49 "htslib/realn.o",
jpayne@68 50 "htslib/regidx.o",
jpayne@68 51 "htslib/region.o",
jpayne@68 52 "htslib/sam.o",
jpayne@68 53 "htslib/sam_mods.o",
jpayne@68 54 "htslib/simd.o",
jpayne@68 55 "htslib/synced_bcf_reader.o",
jpayne@68 56 "htslib/vcf_sweep.o",
jpayne@68 57 "htslib/tbx.o",
jpayne@68 58 "htslib/textutils.o",
jpayne@68 59 "htslib/thread_pool.o",
jpayne@68 60 "htslib/vcf.o",
jpayne@68 61 "htslib/vcfutils.o",
jpayne@68 62 "htslib/cram/cram_codecs.o",
jpayne@68 63 "htslib/cram/cram_decode.o",
jpayne@68 64 "htslib/cram/cram_encode.o",
jpayne@68 65 "htslib/cram/cram_external.o",
jpayne@68 66 "htslib/cram/cram_index.o",
jpayne@68 67 "htslib/cram/cram_io.o",
jpayne@68 68 "htslib/cram/cram_stats.o",
jpayne@68 69 "htslib/cram/mFILE.o",
jpayne@68 70 "htslib/cram/open_trace_file.o",
jpayne@68 71 "htslib/cram/pooled_alloc.o",
jpayne@68 72 "htslib/cram/string_alloc.o",
jpayne@68 73 "htslib/htscodecs/htscodecs/arith_dynamic.o",
jpayne@68 74 "htslib/htscodecs/htscodecs/fqzcomp_qual.o",
jpayne@68 75 "htslib/htscodecs/htscodecs/htscodecs.o",
jpayne@68 76 "htslib/htscodecs/htscodecs/pack.o",
jpayne@68 77 "htslib/htscodecs/htscodecs/rANS_static4x16pr.o",
jpayne@68 78 "htslib/htscodecs/htscodecs/rANS_static32x16pr_avx2.o",
jpayne@68 79 "htslib/htscodecs/htscodecs/rANS_static32x16pr_avx512.o",
jpayne@68 80 "htslib/htscodecs/htscodecs/rANS_static32x16pr_sse4.o",
jpayne@68 81 "htslib/htscodecs/htscodecs/rANS_static32x16pr_neon.o",
jpayne@68 82 "htslib/htscodecs/htscodecs/rANS_static32x16pr.o",
jpayne@68 83 "htslib/htscodecs/htscodecs/rANS_static.o",
jpayne@68 84 "htslib/htscodecs/htscodecs/rle.o",
jpayne@68 85 "htslib/htscodecs/htscodecs/tokenise_name3.o",
jpayne@68 86 "htslib/htscodecs/htscodecs/utils.o",
jpayne@68 87 "htslib/hfile_libcurl.o",
jpayne@68 88 "htslib/hfile_gcs.o",
jpayne@68 89 "htslib/hfile_s3.o",
jpayne@68 90 "htslib/hfile_s3_write.o"
jpayne@68 91 ],
jpayne@68 92 "include_dirs": [
jpayne@68 93 "pysam",
jpayne@68 94 "/project/pysam",
jpayne@68 95 "/project/htslib",
jpayne@68 96 "/project/samtools",
jpayne@68 97 "/project/samtools/lz4",
jpayne@68 98 "/project/bcftools",
jpayne@68 99 "/project"
jpayne@68 100 ],
jpayne@68 101 "language": "c",
jpayne@68 102 "libraries": [
jpayne@68 103 "z",
jpayne@68 104 "lzma",
jpayne@68 105 "bz2",
jpayne@68 106 "z",
jpayne@68 107 "m",
jpayne@68 108 "curl",
jpayne@68 109 "crypto"
jpayne@68 110 ],
jpayne@68 111 "library_dirs": [
jpayne@68 112 "/project/pysam",
jpayne@68 113 "/project",
jpayne@68 114 "build/lib.linux-x86_64-cpython-37/pysam"
jpayne@68 115 ],
jpayne@68 116 "name": "pysam.libchtslib",
jpayne@68 117 "sources": [
jpayne@68 118 "pysam/libchtslib.pyx",
jpayne@68 119 "pysam/htslib_util.c"
jpayne@68 120 ]
jpayne@68 121 },
jpayne@68 122 "module_name": "pysam.libchtslib"
jpayne@68 123 }
jpayne@68 124 END: Cython Metadata */
jpayne@68 125
jpayne@68 126 #ifndef PY_SSIZE_T_CLEAN
jpayne@68 127 #define PY_SSIZE_T_CLEAN
jpayne@68 128 #endif /* PY_SSIZE_T_CLEAN */
jpayne@68 129 #if defined(CYTHON_LIMITED_API) && 0
jpayne@68 130 #ifndef Py_LIMITED_API
jpayne@68 131 #if CYTHON_LIMITED_API+0 > 0x03030000
jpayne@68 132 #define Py_LIMITED_API CYTHON_LIMITED_API
jpayne@68 133 #else
jpayne@68 134 #define Py_LIMITED_API 0x03030000
jpayne@68 135 #endif
jpayne@68 136 #endif
jpayne@68 137 #endif
jpayne@68 138
jpayne@68 139 #include "Python.h"
jpayne@68 140
jpayne@68 141 #if PY_MAJOR_VERSION >= 3
jpayne@68 142 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj)
jpayne@68 143 #else
jpayne@68 144 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL)
jpayne@68 145 #endif
jpayne@68 146
jpayne@68 147
jpayne@68 148 #if PY_MAJOR_VERSION <= 2
jpayne@68 149 #define PyDict_GetItemWithError _PyDict_GetItemWithError
jpayne@68 150 #endif
jpayne@68 151
jpayne@68 152
jpayne@68 153 #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get)
jpayne@68 154 #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) )
jpayne@68 155 #endif
jpayne@68 156
jpayne@68 157 #ifndef Py_PYTHON_H
jpayne@68 158 #error Python headers needed to compile C extensions, please install development version of Python.
jpayne@68 159 #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
jpayne@68 160 #error Cython requires Python 2.7+ or Python 3.3+.
jpayne@68 161 #else
jpayne@68 162 #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
jpayne@68 163 #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
jpayne@68 164 #else
jpayne@68 165 #define __PYX_EXTRA_ABI_MODULE_NAME ""
jpayne@68 166 #endif
jpayne@68 167 #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
jpayne@68 168 #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
jpayne@68 169 #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
jpayne@68 170 #define CYTHON_HEX_VERSION 0x03000BF0
jpayne@68 171 #define CYTHON_FUTURE_DIVISION 1
jpayne@68 172 #include <stddef.h>
jpayne@68 173 #ifndef offsetof
jpayne@68 174 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
jpayne@68 175 #endif
jpayne@68 176 #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
jpayne@68 177 #ifndef __stdcall
jpayne@68 178 #define __stdcall
jpayne@68 179 #endif
jpayne@68 180 #ifndef __cdecl
jpayne@68 181 #define __cdecl
jpayne@68 182 #endif
jpayne@68 183 #ifndef __fastcall
jpayne@68 184 #define __fastcall
jpayne@68 185 #endif
jpayne@68 186 #endif
jpayne@68 187 #ifndef DL_IMPORT
jpayne@68 188 #define DL_IMPORT(t) t
jpayne@68 189 #endif
jpayne@68 190 #ifndef DL_EXPORT
jpayne@68 191 #define DL_EXPORT(t) t
jpayne@68 192 #endif
jpayne@68 193 #define __PYX_COMMA ,
jpayne@68 194 #ifndef HAVE_LONG_LONG
jpayne@68 195 #define HAVE_LONG_LONG
jpayne@68 196 #endif
jpayne@68 197 #ifndef PY_LONG_LONG
jpayne@68 198 #define PY_LONG_LONG LONG_LONG
jpayne@68 199 #endif
jpayne@68 200 #ifndef Py_HUGE_VAL
jpayne@68 201 #define Py_HUGE_VAL HUGE_VAL
jpayne@68 202 #endif
jpayne@68 203 #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
jpayne@68 204 #if defined(GRAALVM_PYTHON)
jpayne@68 205 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
jpayne@68 206 The existence of this section does not imply that anything works or is even tested */
jpayne@68 207 #define CYTHON_COMPILING_IN_PYPY 0
jpayne@68 208 #define CYTHON_COMPILING_IN_CPYTHON 0
jpayne@68 209 #define CYTHON_COMPILING_IN_LIMITED_API 0
jpayne@68 210 #define CYTHON_COMPILING_IN_GRAAL 1
jpayne@68 211 #define CYTHON_COMPILING_IN_NOGIL 0
jpayne@68 212 #undef CYTHON_USE_TYPE_SLOTS
jpayne@68 213 #define CYTHON_USE_TYPE_SLOTS 0
jpayne@68 214 #undef CYTHON_USE_TYPE_SPECS
jpayne@68 215 #define CYTHON_USE_TYPE_SPECS 0
jpayne@68 216 #undef CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 217 #define CYTHON_USE_PYTYPE_LOOKUP 0
jpayne@68 218 #if PY_VERSION_HEX < 0x03050000
jpayne@68 219 #undef CYTHON_USE_ASYNC_SLOTS
jpayne@68 220 #define CYTHON_USE_ASYNC_SLOTS 0
jpayne@68 221 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
jpayne@68 222 #define CYTHON_USE_ASYNC_SLOTS 1
jpayne@68 223 #endif
jpayne@68 224 #undef CYTHON_USE_PYLIST_INTERNALS
jpayne@68 225 #define CYTHON_USE_PYLIST_INTERNALS 0
jpayne@68 226 #undef CYTHON_USE_UNICODE_INTERNALS
jpayne@68 227 #define CYTHON_USE_UNICODE_INTERNALS 0
jpayne@68 228 #undef CYTHON_USE_UNICODE_WRITER
jpayne@68 229 #define CYTHON_USE_UNICODE_WRITER 0
jpayne@68 230 #undef CYTHON_USE_PYLONG_INTERNALS
jpayne@68 231 #define CYTHON_USE_PYLONG_INTERNALS 0
jpayne@68 232 #undef CYTHON_AVOID_BORROWED_REFS
jpayne@68 233 #define CYTHON_AVOID_BORROWED_REFS 1
jpayne@68 234 #undef CYTHON_ASSUME_SAFE_MACROS
jpayne@68 235 #define CYTHON_ASSUME_SAFE_MACROS 0
jpayne@68 236 #undef CYTHON_UNPACK_METHODS
jpayne@68 237 #define CYTHON_UNPACK_METHODS 0
jpayne@68 238 #undef CYTHON_FAST_THREAD_STATE
jpayne@68 239 #define CYTHON_FAST_THREAD_STATE 0
jpayne@68 240 #undef CYTHON_FAST_GIL
jpayne@68 241 #define CYTHON_FAST_GIL 0
jpayne@68 242 #undef CYTHON_METH_FASTCALL
jpayne@68 243 #define CYTHON_METH_FASTCALL 0
jpayne@68 244 #undef CYTHON_FAST_PYCALL
jpayne@68 245 #define CYTHON_FAST_PYCALL 0
jpayne@68 246 #ifndef CYTHON_PEP487_INIT_SUBCLASS
jpayne@68 247 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
jpayne@68 248 #endif
jpayne@68 249 #undef CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 250 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
jpayne@68 251 #undef CYTHON_USE_MODULE_STATE
jpayne@68 252 #define CYTHON_USE_MODULE_STATE 0
jpayne@68 253 #undef CYTHON_USE_TP_FINALIZE
jpayne@68 254 #define CYTHON_USE_TP_FINALIZE 0
jpayne@68 255 #undef CYTHON_USE_DICT_VERSIONS
jpayne@68 256 #define CYTHON_USE_DICT_VERSIONS 0
jpayne@68 257 #undef CYTHON_USE_EXC_INFO_STACK
jpayne@68 258 #define CYTHON_USE_EXC_INFO_STACK 0
jpayne@68 259 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
jpayne@68 260 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
jpayne@68 261 #endif
jpayne@68 262 #undef CYTHON_USE_FREELISTS
jpayne@68 263 #define CYTHON_USE_FREELISTS 0
jpayne@68 264 #elif defined(PYPY_VERSION)
jpayne@68 265 #define CYTHON_COMPILING_IN_PYPY 1
jpayne@68 266 #define CYTHON_COMPILING_IN_CPYTHON 0
jpayne@68 267 #define CYTHON_COMPILING_IN_LIMITED_API 0
jpayne@68 268 #define CYTHON_COMPILING_IN_GRAAL 0
jpayne@68 269 #define CYTHON_COMPILING_IN_NOGIL 0
jpayne@68 270 #undef CYTHON_USE_TYPE_SLOTS
jpayne@68 271 #define CYTHON_USE_TYPE_SLOTS 0
jpayne@68 272 #ifndef CYTHON_USE_TYPE_SPECS
jpayne@68 273 #define CYTHON_USE_TYPE_SPECS 0
jpayne@68 274 #endif
jpayne@68 275 #undef CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 276 #define CYTHON_USE_PYTYPE_LOOKUP 0
jpayne@68 277 #if PY_VERSION_HEX < 0x03050000
jpayne@68 278 #undef CYTHON_USE_ASYNC_SLOTS
jpayne@68 279 #define CYTHON_USE_ASYNC_SLOTS 0
jpayne@68 280 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
jpayne@68 281 #define CYTHON_USE_ASYNC_SLOTS 1
jpayne@68 282 #endif
jpayne@68 283 #undef CYTHON_USE_PYLIST_INTERNALS
jpayne@68 284 #define CYTHON_USE_PYLIST_INTERNALS 0
jpayne@68 285 #undef CYTHON_USE_UNICODE_INTERNALS
jpayne@68 286 #define CYTHON_USE_UNICODE_INTERNALS 0
jpayne@68 287 #undef CYTHON_USE_UNICODE_WRITER
jpayne@68 288 #define CYTHON_USE_UNICODE_WRITER 0
jpayne@68 289 #undef CYTHON_USE_PYLONG_INTERNALS
jpayne@68 290 #define CYTHON_USE_PYLONG_INTERNALS 0
jpayne@68 291 #undef CYTHON_AVOID_BORROWED_REFS
jpayne@68 292 #define CYTHON_AVOID_BORROWED_REFS 1
jpayne@68 293 #undef CYTHON_ASSUME_SAFE_MACROS
jpayne@68 294 #define CYTHON_ASSUME_SAFE_MACROS 0
jpayne@68 295 #undef CYTHON_UNPACK_METHODS
jpayne@68 296 #define CYTHON_UNPACK_METHODS 0
jpayne@68 297 #undef CYTHON_FAST_THREAD_STATE
jpayne@68 298 #define CYTHON_FAST_THREAD_STATE 0
jpayne@68 299 #undef CYTHON_FAST_GIL
jpayne@68 300 #define CYTHON_FAST_GIL 0
jpayne@68 301 #undef CYTHON_METH_FASTCALL
jpayne@68 302 #define CYTHON_METH_FASTCALL 0
jpayne@68 303 #undef CYTHON_FAST_PYCALL
jpayne@68 304 #define CYTHON_FAST_PYCALL 0
jpayne@68 305 #ifndef CYTHON_PEP487_INIT_SUBCLASS
jpayne@68 306 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
jpayne@68 307 #endif
jpayne@68 308 #if PY_VERSION_HEX < 0x03090000
jpayne@68 309 #undef CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 310 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
jpayne@68 311 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
jpayne@68 312 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
jpayne@68 313 #endif
jpayne@68 314 #undef CYTHON_USE_MODULE_STATE
jpayne@68 315 #define CYTHON_USE_MODULE_STATE 0
jpayne@68 316 #undef CYTHON_USE_TP_FINALIZE
jpayne@68 317 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
jpayne@68 318 #undef CYTHON_USE_DICT_VERSIONS
jpayne@68 319 #define CYTHON_USE_DICT_VERSIONS 0
jpayne@68 320 #undef CYTHON_USE_EXC_INFO_STACK
jpayne@68 321 #define CYTHON_USE_EXC_INFO_STACK 0
jpayne@68 322 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
jpayne@68 323 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
jpayne@68 324 #endif
jpayne@68 325 #undef CYTHON_USE_FREELISTS
jpayne@68 326 #define CYTHON_USE_FREELISTS 0
jpayne@68 327 #elif defined(CYTHON_LIMITED_API)
jpayne@68 328 #ifdef Py_LIMITED_API
jpayne@68 329 #undef __PYX_LIMITED_VERSION_HEX
jpayne@68 330 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
jpayne@68 331 #endif
jpayne@68 332 #define CYTHON_COMPILING_IN_PYPY 0
jpayne@68 333 #define CYTHON_COMPILING_IN_CPYTHON 0
jpayne@68 334 #define CYTHON_COMPILING_IN_LIMITED_API 1
jpayne@68 335 #define CYTHON_COMPILING_IN_GRAAL 0
jpayne@68 336 #define CYTHON_COMPILING_IN_NOGIL 0
jpayne@68 337 #undef CYTHON_CLINE_IN_TRACEBACK
jpayne@68 338 #define CYTHON_CLINE_IN_TRACEBACK 0
jpayne@68 339 #undef CYTHON_USE_TYPE_SLOTS
jpayne@68 340 #define CYTHON_USE_TYPE_SLOTS 0
jpayne@68 341 #undef CYTHON_USE_TYPE_SPECS
jpayne@68 342 #define CYTHON_USE_TYPE_SPECS 1
jpayne@68 343 #undef CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 344 #define CYTHON_USE_PYTYPE_LOOKUP 0
jpayne@68 345 #undef CYTHON_USE_ASYNC_SLOTS
jpayne@68 346 #define CYTHON_USE_ASYNC_SLOTS 0
jpayne@68 347 #undef CYTHON_USE_PYLIST_INTERNALS
jpayne@68 348 #define CYTHON_USE_PYLIST_INTERNALS 0
jpayne@68 349 #undef CYTHON_USE_UNICODE_INTERNALS
jpayne@68 350 #define CYTHON_USE_UNICODE_INTERNALS 0
jpayne@68 351 #ifndef CYTHON_USE_UNICODE_WRITER
jpayne@68 352 #define CYTHON_USE_UNICODE_WRITER 0
jpayne@68 353 #endif
jpayne@68 354 #undef CYTHON_USE_PYLONG_INTERNALS
jpayne@68 355 #define CYTHON_USE_PYLONG_INTERNALS 0
jpayne@68 356 #ifndef CYTHON_AVOID_BORROWED_REFS
jpayne@68 357 #define CYTHON_AVOID_BORROWED_REFS 0
jpayne@68 358 #endif
jpayne@68 359 #undef CYTHON_ASSUME_SAFE_MACROS
jpayne@68 360 #define CYTHON_ASSUME_SAFE_MACROS 0
jpayne@68 361 #undef CYTHON_UNPACK_METHODS
jpayne@68 362 #define CYTHON_UNPACK_METHODS 0
jpayne@68 363 #undef CYTHON_FAST_THREAD_STATE
jpayne@68 364 #define CYTHON_FAST_THREAD_STATE 0
jpayne@68 365 #undef CYTHON_FAST_GIL
jpayne@68 366 #define CYTHON_FAST_GIL 0
jpayne@68 367 #undef CYTHON_METH_FASTCALL
jpayne@68 368 #define CYTHON_METH_FASTCALL 0
jpayne@68 369 #undef CYTHON_FAST_PYCALL
jpayne@68 370 #define CYTHON_FAST_PYCALL 0
jpayne@68 371 #ifndef CYTHON_PEP487_INIT_SUBCLASS
jpayne@68 372 #define CYTHON_PEP487_INIT_SUBCLASS 1
jpayne@68 373 #endif
jpayne@68 374 #undef CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 375 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
jpayne@68 376 #undef CYTHON_USE_MODULE_STATE
jpayne@68 377 #define CYTHON_USE_MODULE_STATE 1
jpayne@68 378 #ifndef CYTHON_USE_TP_FINALIZE
jpayne@68 379 #define CYTHON_USE_TP_FINALIZE 0
jpayne@68 380 #endif
jpayne@68 381 #undef CYTHON_USE_DICT_VERSIONS
jpayne@68 382 #define CYTHON_USE_DICT_VERSIONS 0
jpayne@68 383 #undef CYTHON_USE_EXC_INFO_STACK
jpayne@68 384 #define CYTHON_USE_EXC_INFO_STACK 0
jpayne@68 385 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
jpayne@68 386 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
jpayne@68 387 #endif
jpayne@68 388 #undef CYTHON_USE_FREELISTS
jpayne@68 389 #define CYTHON_USE_FREELISTS 0
jpayne@68 390 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
jpayne@68 391 #define CYTHON_COMPILING_IN_PYPY 0
jpayne@68 392 #define CYTHON_COMPILING_IN_CPYTHON 0
jpayne@68 393 #define CYTHON_COMPILING_IN_LIMITED_API 0
jpayne@68 394 #define CYTHON_COMPILING_IN_GRAAL 0
jpayne@68 395 #define CYTHON_COMPILING_IN_NOGIL 1
jpayne@68 396 #ifndef CYTHON_USE_TYPE_SLOTS
jpayne@68 397 #define CYTHON_USE_TYPE_SLOTS 1
jpayne@68 398 #endif
jpayne@68 399 #ifndef CYTHON_USE_TYPE_SPECS
jpayne@68 400 #define CYTHON_USE_TYPE_SPECS 0
jpayne@68 401 #endif
jpayne@68 402 #undef CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 403 #define CYTHON_USE_PYTYPE_LOOKUP 0
jpayne@68 404 #ifndef CYTHON_USE_ASYNC_SLOTS
jpayne@68 405 #define CYTHON_USE_ASYNC_SLOTS 1
jpayne@68 406 #endif
jpayne@68 407 #ifndef CYTHON_USE_PYLONG_INTERNALS
jpayne@68 408 #define CYTHON_USE_PYLONG_INTERNALS 0
jpayne@68 409 #endif
jpayne@68 410 #undef CYTHON_USE_PYLIST_INTERNALS
jpayne@68 411 #define CYTHON_USE_PYLIST_INTERNALS 0
jpayne@68 412 #ifndef CYTHON_USE_UNICODE_INTERNALS
jpayne@68 413 #define CYTHON_USE_UNICODE_INTERNALS 1
jpayne@68 414 #endif
jpayne@68 415 #undef CYTHON_USE_UNICODE_WRITER
jpayne@68 416 #define CYTHON_USE_UNICODE_WRITER 0
jpayne@68 417 #ifndef CYTHON_AVOID_BORROWED_REFS
jpayne@68 418 #define CYTHON_AVOID_BORROWED_REFS 0
jpayne@68 419 #endif
jpayne@68 420 #ifndef CYTHON_ASSUME_SAFE_MACROS
jpayne@68 421 #define CYTHON_ASSUME_SAFE_MACROS 1
jpayne@68 422 #endif
jpayne@68 423 #ifndef CYTHON_UNPACK_METHODS
jpayne@68 424 #define CYTHON_UNPACK_METHODS 1
jpayne@68 425 #endif
jpayne@68 426 #undef CYTHON_FAST_THREAD_STATE
jpayne@68 427 #define CYTHON_FAST_THREAD_STATE 0
jpayne@68 428 #undef CYTHON_FAST_GIL
jpayne@68 429 #define CYTHON_FAST_GIL 0
jpayne@68 430 #ifndef CYTHON_METH_FASTCALL
jpayne@68 431 #define CYTHON_METH_FASTCALL 1
jpayne@68 432 #endif
jpayne@68 433 #undef CYTHON_FAST_PYCALL
jpayne@68 434 #define CYTHON_FAST_PYCALL 0
jpayne@68 435 #ifndef CYTHON_PEP487_INIT_SUBCLASS
jpayne@68 436 #define CYTHON_PEP487_INIT_SUBCLASS 1
jpayne@68 437 #endif
jpayne@68 438 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 439 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
jpayne@68 440 #endif
jpayne@68 441 #ifndef CYTHON_USE_MODULE_STATE
jpayne@68 442 #define CYTHON_USE_MODULE_STATE 0
jpayne@68 443 #endif
jpayne@68 444 #ifndef CYTHON_USE_TP_FINALIZE
jpayne@68 445 #define CYTHON_USE_TP_FINALIZE 1
jpayne@68 446 #endif
jpayne@68 447 #undef CYTHON_USE_DICT_VERSIONS
jpayne@68 448 #define CYTHON_USE_DICT_VERSIONS 0
jpayne@68 449 #undef CYTHON_USE_EXC_INFO_STACK
jpayne@68 450 #define CYTHON_USE_EXC_INFO_STACK 0
jpayne@68 451 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
jpayne@68 452 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
jpayne@68 453 #endif
jpayne@68 454 #ifndef CYTHON_USE_FREELISTS
jpayne@68 455 #define CYTHON_USE_FREELISTS 0
jpayne@68 456 #endif
jpayne@68 457 #else
jpayne@68 458 #define CYTHON_COMPILING_IN_PYPY 0
jpayne@68 459 #define CYTHON_COMPILING_IN_CPYTHON 1
jpayne@68 460 #define CYTHON_COMPILING_IN_LIMITED_API 0
jpayne@68 461 #define CYTHON_COMPILING_IN_GRAAL 0
jpayne@68 462 #define CYTHON_COMPILING_IN_NOGIL 0
jpayne@68 463 #ifndef CYTHON_USE_TYPE_SLOTS
jpayne@68 464 #define CYTHON_USE_TYPE_SLOTS 1
jpayne@68 465 #endif
jpayne@68 466 #ifndef CYTHON_USE_TYPE_SPECS
jpayne@68 467 #define CYTHON_USE_TYPE_SPECS 0
jpayne@68 468 #endif
jpayne@68 469 #ifndef CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 470 #define CYTHON_USE_PYTYPE_LOOKUP 1
jpayne@68 471 #endif
jpayne@68 472 #if PY_MAJOR_VERSION < 3
jpayne@68 473 #undef CYTHON_USE_ASYNC_SLOTS
jpayne@68 474 #define CYTHON_USE_ASYNC_SLOTS 0
jpayne@68 475 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
jpayne@68 476 #define CYTHON_USE_ASYNC_SLOTS 1
jpayne@68 477 #endif
jpayne@68 478 #ifndef CYTHON_USE_PYLONG_INTERNALS
jpayne@68 479 #define CYTHON_USE_PYLONG_INTERNALS 1
jpayne@68 480 #endif
jpayne@68 481 #ifndef CYTHON_USE_PYLIST_INTERNALS
jpayne@68 482 #define CYTHON_USE_PYLIST_INTERNALS 1
jpayne@68 483 #endif
jpayne@68 484 #ifndef CYTHON_USE_UNICODE_INTERNALS
jpayne@68 485 #define CYTHON_USE_UNICODE_INTERNALS 1
jpayne@68 486 #endif
jpayne@68 487 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
jpayne@68 488 #undef CYTHON_USE_UNICODE_WRITER
jpayne@68 489 #define CYTHON_USE_UNICODE_WRITER 0
jpayne@68 490 #elif !defined(CYTHON_USE_UNICODE_WRITER)
jpayne@68 491 #define CYTHON_USE_UNICODE_WRITER 1
jpayne@68 492 #endif
jpayne@68 493 #ifndef CYTHON_AVOID_BORROWED_REFS
jpayne@68 494 #define CYTHON_AVOID_BORROWED_REFS 0
jpayne@68 495 #endif
jpayne@68 496 #ifndef CYTHON_ASSUME_SAFE_MACROS
jpayne@68 497 #define CYTHON_ASSUME_SAFE_MACROS 1
jpayne@68 498 #endif
jpayne@68 499 #ifndef CYTHON_UNPACK_METHODS
jpayne@68 500 #define CYTHON_UNPACK_METHODS 1
jpayne@68 501 #endif
jpayne@68 502 #ifndef CYTHON_FAST_THREAD_STATE
jpayne@68 503 #define CYTHON_FAST_THREAD_STATE 1
jpayne@68 504 #endif
jpayne@68 505 #ifndef CYTHON_FAST_GIL
jpayne@68 506 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
jpayne@68 507 #endif
jpayne@68 508 #ifndef CYTHON_METH_FASTCALL
jpayne@68 509 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
jpayne@68 510 #endif
jpayne@68 511 #ifndef CYTHON_FAST_PYCALL
jpayne@68 512 #define CYTHON_FAST_PYCALL 1
jpayne@68 513 #endif
jpayne@68 514 #ifndef CYTHON_PEP487_INIT_SUBCLASS
jpayne@68 515 #define CYTHON_PEP487_INIT_SUBCLASS 1
jpayne@68 516 #endif
jpayne@68 517 #if PY_VERSION_HEX < 0x03050000
jpayne@68 518 #undef CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 519 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
jpayne@68 520 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
jpayne@68 521 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
jpayne@68 522 #endif
jpayne@68 523 #ifndef CYTHON_USE_MODULE_STATE
jpayne@68 524 #define CYTHON_USE_MODULE_STATE 0
jpayne@68 525 #endif
jpayne@68 526 #if PY_VERSION_HEX < 0x030400a1
jpayne@68 527 #undef CYTHON_USE_TP_FINALIZE
jpayne@68 528 #define CYTHON_USE_TP_FINALIZE 0
jpayne@68 529 #elif !defined(CYTHON_USE_TP_FINALIZE)
jpayne@68 530 #define CYTHON_USE_TP_FINALIZE 1
jpayne@68 531 #endif
jpayne@68 532 #if PY_VERSION_HEX < 0x030600B1
jpayne@68 533 #undef CYTHON_USE_DICT_VERSIONS
jpayne@68 534 #define CYTHON_USE_DICT_VERSIONS 0
jpayne@68 535 #elif !defined(CYTHON_USE_DICT_VERSIONS)
jpayne@68 536 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
jpayne@68 537 #endif
jpayne@68 538 #if PY_VERSION_HEX < 0x030700A3
jpayne@68 539 #undef CYTHON_USE_EXC_INFO_STACK
jpayne@68 540 #define CYTHON_USE_EXC_INFO_STACK 0
jpayne@68 541 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
jpayne@68 542 #define CYTHON_USE_EXC_INFO_STACK 1
jpayne@68 543 #endif
jpayne@68 544 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
jpayne@68 545 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
jpayne@68 546 #endif
jpayne@68 547 #ifndef CYTHON_USE_FREELISTS
jpayne@68 548 #define CYTHON_USE_FREELISTS 1
jpayne@68 549 #endif
jpayne@68 550 #endif
jpayne@68 551 #if !defined(CYTHON_FAST_PYCCALL)
jpayne@68 552 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
jpayne@68 553 #endif
jpayne@68 554 #if !defined(CYTHON_VECTORCALL)
jpayne@68 555 #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
jpayne@68 556 #endif
jpayne@68 557 #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
jpayne@68 558 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 559 #if PY_MAJOR_VERSION < 3
jpayne@68 560 #include "longintrepr.h"
jpayne@68 561 #endif
jpayne@68 562 #undef SHIFT
jpayne@68 563 #undef BASE
jpayne@68 564 #undef MASK
jpayne@68 565 #ifdef SIZEOF_VOID_P
jpayne@68 566 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
jpayne@68 567 #endif
jpayne@68 568 #endif
jpayne@68 569 #ifndef __has_attribute
jpayne@68 570 #define __has_attribute(x) 0
jpayne@68 571 #endif
jpayne@68 572 #ifndef __has_cpp_attribute
jpayne@68 573 #define __has_cpp_attribute(x) 0
jpayne@68 574 #endif
jpayne@68 575 #ifndef CYTHON_RESTRICT
jpayne@68 576 #if defined(__GNUC__)
jpayne@68 577 #define CYTHON_RESTRICT __restrict__
jpayne@68 578 #elif defined(_MSC_VER) && _MSC_VER >= 1400
jpayne@68 579 #define CYTHON_RESTRICT __restrict
jpayne@68 580 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
jpayne@68 581 #define CYTHON_RESTRICT restrict
jpayne@68 582 #else
jpayne@68 583 #define CYTHON_RESTRICT
jpayne@68 584 #endif
jpayne@68 585 #endif
jpayne@68 586 #ifndef CYTHON_UNUSED
jpayne@68 587 #if defined(__cplusplus)
jpayne@68 588 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
jpayne@68 589 * but leads to warnings with -pedantic, since it is a C++17 feature */
jpayne@68 590 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
jpayne@68 591 #if __has_cpp_attribute(maybe_unused)
jpayne@68 592 #define CYTHON_UNUSED [[maybe_unused]]
jpayne@68 593 #endif
jpayne@68 594 #endif
jpayne@68 595 #endif
jpayne@68 596 #endif
jpayne@68 597 #ifndef CYTHON_UNUSED
jpayne@68 598 # if defined(__GNUC__)
jpayne@68 599 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
jpayne@68 600 # define CYTHON_UNUSED __attribute__ ((__unused__))
jpayne@68 601 # else
jpayne@68 602 # define CYTHON_UNUSED
jpayne@68 603 # endif
jpayne@68 604 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
jpayne@68 605 # define CYTHON_UNUSED __attribute__ ((__unused__))
jpayne@68 606 # else
jpayne@68 607 # define CYTHON_UNUSED
jpayne@68 608 # endif
jpayne@68 609 #endif
jpayne@68 610 #ifndef CYTHON_UNUSED_VAR
jpayne@68 611 # if defined(__cplusplus)
jpayne@68 612 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
jpayne@68 613 # else
jpayne@68 614 # define CYTHON_UNUSED_VAR(x) (void)(x)
jpayne@68 615 # endif
jpayne@68 616 #endif
jpayne@68 617 #ifndef CYTHON_MAYBE_UNUSED_VAR
jpayne@68 618 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
jpayne@68 619 #endif
jpayne@68 620 #ifndef CYTHON_NCP_UNUSED
jpayne@68 621 # if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 622 # define CYTHON_NCP_UNUSED
jpayne@68 623 # else
jpayne@68 624 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
jpayne@68 625 # endif
jpayne@68 626 #endif
jpayne@68 627 #ifndef CYTHON_USE_CPP_STD_MOVE
jpayne@68 628 #if defined(__cplusplus) && (\
jpayne@68 629 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
jpayne@68 630 #define CYTHON_USE_CPP_STD_MOVE 1
jpayne@68 631 #else
jpayne@68 632 #define CYTHON_USE_CPP_STD_MOVE 0
jpayne@68 633 #endif
jpayne@68 634 #endif
jpayne@68 635 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
jpayne@68 636 #ifdef _MSC_VER
jpayne@68 637 #ifndef _MSC_STDINT_H_
jpayne@68 638 #if _MSC_VER < 1300
jpayne@68 639 typedef unsigned char uint8_t;
jpayne@68 640 typedef unsigned short uint16_t;
jpayne@68 641 typedef unsigned int uint32_t;
jpayne@68 642 #else
jpayne@68 643 typedef unsigned __int8 uint8_t;
jpayne@68 644 typedef unsigned __int16 uint16_t;
jpayne@68 645 typedef unsigned __int32 uint32_t;
jpayne@68 646 #endif
jpayne@68 647 #endif
jpayne@68 648 #if _MSC_VER < 1300
jpayne@68 649 #ifdef _WIN64
jpayne@68 650 typedef unsigned long long __pyx_uintptr_t;
jpayne@68 651 #else
jpayne@68 652 typedef unsigned int __pyx_uintptr_t;
jpayne@68 653 #endif
jpayne@68 654 #else
jpayne@68 655 #ifdef _WIN64
jpayne@68 656 typedef unsigned __int64 __pyx_uintptr_t;
jpayne@68 657 #else
jpayne@68 658 typedef unsigned __int32 __pyx_uintptr_t;
jpayne@68 659 #endif
jpayne@68 660 #endif
jpayne@68 661 #else
jpayne@68 662 #include <stdint.h>
jpayne@68 663 typedef uintptr_t __pyx_uintptr_t;
jpayne@68 664 #endif
jpayne@68 665 #ifndef CYTHON_FALLTHROUGH
jpayne@68 666 #if defined(__cplusplus)
jpayne@68 667 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
jpayne@68 668 * but leads to warnings with -pedantic, since it is a C++17 feature */
jpayne@68 669 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
jpayne@68 670 #if __has_cpp_attribute(fallthrough)
jpayne@68 671 #define CYTHON_FALLTHROUGH [[fallthrough]]
jpayne@68 672 #endif
jpayne@68 673 #endif
jpayne@68 674 #ifndef CYTHON_FALLTHROUGH
jpayne@68 675 #if __has_cpp_attribute(clang::fallthrough)
jpayne@68 676 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
jpayne@68 677 #elif __has_cpp_attribute(gnu::fallthrough)
jpayne@68 678 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
jpayne@68 679 #endif
jpayne@68 680 #endif
jpayne@68 681 #endif
jpayne@68 682 #ifndef CYTHON_FALLTHROUGH
jpayne@68 683 #if __has_attribute(fallthrough)
jpayne@68 684 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
jpayne@68 685 #else
jpayne@68 686 #define CYTHON_FALLTHROUGH
jpayne@68 687 #endif
jpayne@68 688 #endif
jpayne@68 689 #if defined(__clang__) && defined(__apple_build_version__)
jpayne@68 690 #if __apple_build_version__ < 7000000
jpayne@68 691 #undef CYTHON_FALLTHROUGH
jpayne@68 692 #define CYTHON_FALLTHROUGH
jpayne@68 693 #endif
jpayne@68 694 #endif
jpayne@68 695 #endif
jpayne@68 696 #ifdef __cplusplus
jpayne@68 697 template <typename T>
jpayne@68 698 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
jpayne@68 699 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
jpayne@68 700 #else
jpayne@68 701 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
jpayne@68 702 #endif
jpayne@68 703 #if CYTHON_COMPILING_IN_PYPY == 1
jpayne@68 704 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
jpayne@68 705 #else
jpayne@68 706 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
jpayne@68 707 #endif
jpayne@68 708 #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
jpayne@68 709
jpayne@68 710 #ifndef CYTHON_INLINE
jpayne@68 711 #if defined(__clang__)
jpayne@68 712 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
jpayne@68 713 #elif defined(__GNUC__)
jpayne@68 714 #define CYTHON_INLINE __inline__
jpayne@68 715 #elif defined(_MSC_VER)
jpayne@68 716 #define CYTHON_INLINE __inline
jpayne@68 717 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
jpayne@68 718 #define CYTHON_INLINE inline
jpayne@68 719 #else
jpayne@68 720 #define CYTHON_INLINE
jpayne@68 721 #endif
jpayne@68 722 #endif
jpayne@68 723
jpayne@68 724 #define __PYX_BUILD_PY_SSIZE_T "n"
jpayne@68 725 #define CYTHON_FORMAT_SSIZE_T "z"
jpayne@68 726 #if PY_MAJOR_VERSION < 3
jpayne@68 727 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
jpayne@68 728 #define __Pyx_DefaultClassType PyClass_Type
jpayne@68 729 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
jpayne@68 730 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
jpayne@68 731 #else
jpayne@68 732 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
jpayne@68 733 #define __Pyx_DefaultClassType PyType_Type
jpayne@68 734 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 735 static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
jpayne@68 736 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
jpayne@68 737 PyObject *fv, PyObject *cell, PyObject* fn,
jpayne@68 738 PyObject *name, int fline, PyObject *lnos) {
jpayne@68 739 PyObject *exception_table = NULL;
jpayne@68 740 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
jpayne@68 741 #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
jpayne@68 742 PyObject *version_info;
jpayne@68 743 PyObject *py_minor_version = NULL;
jpayne@68 744 #endif
jpayne@68 745 long minor_version = 0;
jpayne@68 746 PyObject *type, *value, *traceback;
jpayne@68 747 PyErr_Fetch(&type, &value, &traceback);
jpayne@68 748 #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
jpayne@68 749 minor_version = 11;
jpayne@68 750 #else
jpayne@68 751 if (!(version_info = PySys_GetObject("version_info"))) goto end;
jpayne@68 752 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
jpayne@68 753 minor_version = PyLong_AsLong(py_minor_version);
jpayne@68 754 Py_DECREF(py_minor_version);
jpayne@68 755 if (minor_version == -1 && PyErr_Occurred()) goto end;
jpayne@68 756 #endif
jpayne@68 757 if (!(types_module = PyImport_ImportModule("types"))) goto end;
jpayne@68 758 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
jpayne@68 759 if (minor_version <= 7) {
jpayne@68 760 (void)p;
jpayne@68 761 result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
jpayne@68 762 c, n, v, fn, name, fline, lnos, fv, cell);
jpayne@68 763 } else if (minor_version <= 10) {
jpayne@68 764 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
jpayne@68 765 c, n, v, fn, name, fline, lnos, fv, cell);
jpayne@68 766 } else {
jpayne@68 767 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
jpayne@68 768 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
jpayne@68 769 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
jpayne@68 770 }
jpayne@68 771 end:
jpayne@68 772 Py_XDECREF(code_type);
jpayne@68 773 Py_XDECREF(exception_table);
jpayne@68 774 Py_XDECREF(types_module);
jpayne@68 775 if (type) {
jpayne@68 776 PyErr_Restore(type, value, traceback);
jpayne@68 777 }
jpayne@68 778 return result;
jpayne@68 779 }
jpayne@68 780 #ifndef CO_OPTIMIZED
jpayne@68 781 #define CO_OPTIMIZED 0x0001
jpayne@68 782 #endif
jpayne@68 783 #ifndef CO_NEWLOCALS
jpayne@68 784 #define CO_NEWLOCALS 0x0002
jpayne@68 785 #endif
jpayne@68 786 #ifndef CO_VARARGS
jpayne@68 787 #define CO_VARARGS 0x0004
jpayne@68 788 #endif
jpayne@68 789 #ifndef CO_VARKEYWORDS
jpayne@68 790 #define CO_VARKEYWORDS 0x0008
jpayne@68 791 #endif
jpayne@68 792 #ifndef CO_ASYNC_GENERATOR
jpayne@68 793 #define CO_ASYNC_GENERATOR 0x0200
jpayne@68 794 #endif
jpayne@68 795 #ifndef CO_GENERATOR
jpayne@68 796 #define CO_GENERATOR 0x0020
jpayne@68 797 #endif
jpayne@68 798 #ifndef CO_COROUTINE
jpayne@68 799 #define CO_COROUTINE 0x0080
jpayne@68 800 #endif
jpayne@68 801 #elif PY_VERSION_HEX >= 0x030B0000
jpayne@68 802 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
jpayne@68 803 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
jpayne@68 804 PyObject *fv, PyObject *cell, PyObject* fn,
jpayne@68 805 PyObject *name, int fline, PyObject *lnos) {
jpayne@68 806 PyCodeObject *result;
jpayne@68 807 PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
jpayne@68 808 if (!empty_bytes) return NULL;
jpayne@68 809 result =
jpayne@68 810 #if PY_VERSION_HEX >= 0x030C0000
jpayne@68 811 PyUnstable_Code_NewWithPosOnlyArgs
jpayne@68 812 #else
jpayne@68 813 PyCode_NewWithPosOnlyArgs
jpayne@68 814 #endif
jpayne@68 815 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
jpayne@68 816 Py_DECREF(empty_bytes);
jpayne@68 817 return result;
jpayne@68 818 }
jpayne@68 819 #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
jpayne@68 820 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
jpayne@68 821 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
jpayne@68 822 #else
jpayne@68 823 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
jpayne@68 824 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
jpayne@68 825 #endif
jpayne@68 826 #endif
jpayne@68 827 #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
jpayne@68 828 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
jpayne@68 829 #else
jpayne@68 830 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
jpayne@68 831 #endif
jpayne@68 832 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
jpayne@68 833 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
jpayne@68 834 #else
jpayne@68 835 #define __Pyx_Py_Is(x, y) ((x) == (y))
jpayne@68 836 #endif
jpayne@68 837 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
jpayne@68 838 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
jpayne@68 839 #else
jpayne@68 840 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
jpayne@68 841 #endif
jpayne@68 842 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
jpayne@68 843 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
jpayne@68 844 #else
jpayne@68 845 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
jpayne@68 846 #endif
jpayne@68 847 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
jpayne@68 848 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
jpayne@68 849 #else
jpayne@68 850 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
jpayne@68 851 #endif
jpayne@68 852 #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
jpayne@68 853 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
jpayne@68 854 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
jpayne@68 855 #else
jpayne@68 856 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
jpayne@68 857 #endif
jpayne@68 858 #ifndef CO_COROUTINE
jpayne@68 859 #define CO_COROUTINE 0x80
jpayne@68 860 #endif
jpayne@68 861 #ifndef CO_ASYNC_GENERATOR
jpayne@68 862 #define CO_ASYNC_GENERATOR 0x200
jpayne@68 863 #endif
jpayne@68 864 #ifndef Py_TPFLAGS_CHECKTYPES
jpayne@68 865 #define Py_TPFLAGS_CHECKTYPES 0
jpayne@68 866 #endif
jpayne@68 867 #ifndef Py_TPFLAGS_HAVE_INDEX
jpayne@68 868 #define Py_TPFLAGS_HAVE_INDEX 0
jpayne@68 869 #endif
jpayne@68 870 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
jpayne@68 871 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
jpayne@68 872 #endif
jpayne@68 873 #ifndef Py_TPFLAGS_HAVE_FINALIZE
jpayne@68 874 #define Py_TPFLAGS_HAVE_FINALIZE 0
jpayne@68 875 #endif
jpayne@68 876 #ifndef Py_TPFLAGS_SEQUENCE
jpayne@68 877 #define Py_TPFLAGS_SEQUENCE 0
jpayne@68 878 #endif
jpayne@68 879 #ifndef Py_TPFLAGS_MAPPING
jpayne@68 880 #define Py_TPFLAGS_MAPPING 0
jpayne@68 881 #endif
jpayne@68 882 #ifndef METH_STACKLESS
jpayne@68 883 #define METH_STACKLESS 0
jpayne@68 884 #endif
jpayne@68 885 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
jpayne@68 886 #ifndef METH_FASTCALL
jpayne@68 887 #define METH_FASTCALL 0x80
jpayne@68 888 #endif
jpayne@68 889 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
jpayne@68 890 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
jpayne@68 891 Py_ssize_t nargs, PyObject *kwnames);
jpayne@68 892 #else
jpayne@68 893 #if PY_VERSION_HEX >= 0x030d00A4
jpayne@68 894 # define __Pyx_PyCFunctionFast PyCFunctionFast
jpayne@68 895 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
jpayne@68 896 #else
jpayne@68 897 # define __Pyx_PyCFunctionFast _PyCFunctionFast
jpayne@68 898 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
jpayne@68 899 #endif
jpayne@68 900 #endif
jpayne@68 901 #if CYTHON_METH_FASTCALL
jpayne@68 902 #define __Pyx_METH_FASTCALL METH_FASTCALL
jpayne@68 903 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
jpayne@68 904 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
jpayne@68 905 #else
jpayne@68 906 #define __Pyx_METH_FASTCALL METH_VARARGS
jpayne@68 907 #define __Pyx_PyCFunction_FastCall PyCFunction
jpayne@68 908 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
jpayne@68 909 #endif
jpayne@68 910 #if CYTHON_VECTORCALL
jpayne@68 911 #define __pyx_vectorcallfunc vectorcallfunc
jpayne@68 912 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
jpayne@68 913 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
jpayne@68 914 #elif CYTHON_BACKPORT_VECTORCALL
jpayne@68 915 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
jpayne@68 916 size_t nargsf, PyObject *kwnames);
jpayne@68 917 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
jpayne@68 918 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
jpayne@68 919 #else
jpayne@68 920 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
jpayne@68 921 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
jpayne@68 922 #endif
jpayne@68 923 #if PY_MAJOR_VERSION >= 0x030900B1
jpayne@68 924 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
jpayne@68 925 #else
jpayne@68 926 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
jpayne@68 927 #endif
jpayne@68 928 #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
jpayne@68 929 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 930 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
jpayne@68 931 #elif !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 932 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
jpayne@68 933 #endif
jpayne@68 934 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 935 #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
jpayne@68 936 static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
jpayne@68 937 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
jpayne@68 938 }
jpayne@68 939 #endif
jpayne@68 940 static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
jpayne@68 941 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 942 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
jpayne@68 943 #else
jpayne@68 944 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
jpayne@68 945 #endif
jpayne@68 946 }
jpayne@68 947 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
jpayne@68 948 #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
jpayne@68 949 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
jpayne@68 950 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
jpayne@68 951 #else
jpayne@68 952 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
jpayne@68 953 #define __Pyx_PyCMethod PyCMethod
jpayne@68 954 #endif
jpayne@68 955 #ifndef METH_METHOD
jpayne@68 956 #define METH_METHOD 0x200
jpayne@68 957 #endif
jpayne@68 958 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
jpayne@68 959 #define PyObject_Malloc(s) PyMem_Malloc(s)
jpayne@68 960 #define PyObject_Free(p) PyMem_Free(p)
jpayne@68 961 #define PyObject_Realloc(p) PyMem_Realloc(p)
jpayne@68 962 #endif
jpayne@68 963 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 964 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
jpayne@68 965 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
jpayne@68 966 #else
jpayne@68 967 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
jpayne@68 968 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
jpayne@68 969 #endif
jpayne@68 970 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 971 #define __Pyx_PyThreadState_Current PyThreadState_Get()
jpayne@68 972 #elif !CYTHON_FAST_THREAD_STATE
jpayne@68 973 #define __Pyx_PyThreadState_Current PyThreadState_GET()
jpayne@68 974 #elif PY_VERSION_HEX >= 0x030d00A1
jpayne@68 975 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
jpayne@68 976 #elif PY_VERSION_HEX >= 0x03060000
jpayne@68 977 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
jpayne@68 978 #elif PY_VERSION_HEX >= 0x03000000
jpayne@68 979 #define __Pyx_PyThreadState_Current PyThreadState_GET()
jpayne@68 980 #else
jpayne@68 981 #define __Pyx_PyThreadState_Current _PyThreadState_Current
jpayne@68 982 #endif
jpayne@68 983 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 984 static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
jpayne@68 985 {
jpayne@68 986 void *result;
jpayne@68 987 result = PyModule_GetState(op);
jpayne@68 988 if (!result)
jpayne@68 989 Py_FatalError("Couldn't find the module state");
jpayne@68 990 return result;
jpayne@68 991 }
jpayne@68 992 #endif
jpayne@68 993 #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
jpayne@68 994 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 995 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
jpayne@68 996 #else
jpayne@68 997 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
jpayne@68 998 #endif
jpayne@68 999 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
jpayne@68 1000 #include "pythread.h"
jpayne@68 1001 #define Py_tss_NEEDS_INIT 0
jpayne@68 1002 typedef int Py_tss_t;
jpayne@68 1003 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
jpayne@68 1004 *key = PyThread_create_key();
jpayne@68 1005 return 0;
jpayne@68 1006 }
jpayne@68 1007 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
jpayne@68 1008 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
jpayne@68 1009 *key = Py_tss_NEEDS_INIT;
jpayne@68 1010 return key;
jpayne@68 1011 }
jpayne@68 1012 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
jpayne@68 1013 PyObject_Free(key);
jpayne@68 1014 }
jpayne@68 1015 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
jpayne@68 1016 return *key != Py_tss_NEEDS_INIT;
jpayne@68 1017 }
jpayne@68 1018 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
jpayne@68 1019 PyThread_delete_key(*key);
jpayne@68 1020 *key = Py_tss_NEEDS_INIT;
jpayne@68 1021 }
jpayne@68 1022 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
jpayne@68 1023 return PyThread_set_key_value(*key, value);
jpayne@68 1024 }
jpayne@68 1025 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
jpayne@68 1026 return PyThread_get_key_value(*key);
jpayne@68 1027 }
jpayne@68 1028 #endif
jpayne@68 1029 #if PY_MAJOR_VERSION < 3
jpayne@68 1030 #if CYTHON_COMPILING_IN_PYPY
jpayne@68 1031 #if PYPY_VERSION_NUM < 0x07030600
jpayne@68 1032 #if defined(__cplusplus) && __cplusplus >= 201402L
jpayne@68 1033 [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
jpayne@68 1034 #elif defined(__GNUC__) || defined(__clang__)
jpayne@68 1035 __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
jpayne@68 1036 #elif defined(_MSC_VER)
jpayne@68 1037 __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
jpayne@68 1038 #endif
jpayne@68 1039 static CYTHON_INLINE int PyGILState_Check(void) {
jpayne@68 1040 return 0;
jpayne@68 1041 }
jpayne@68 1042 #else // PYPY_VERSION_NUM < 0x07030600
jpayne@68 1043 #endif // PYPY_VERSION_NUM < 0x07030600
jpayne@68 1044 #else
jpayne@68 1045 static CYTHON_INLINE int PyGILState_Check(void) {
jpayne@68 1046 PyThreadState * tstate = _PyThreadState_Current;
jpayne@68 1047 return tstate && (tstate == PyGILState_GetThisThreadState());
jpayne@68 1048 }
jpayne@68 1049 #endif
jpayne@68 1050 #endif
jpayne@68 1051 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
jpayne@68 1052 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
jpayne@68 1053 #else
jpayne@68 1054 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
jpayne@68 1055 #endif
jpayne@68 1056 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
jpayne@68 1057 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
jpayne@68 1058 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
jpayne@68 1059 #else
jpayne@68 1060 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
jpayne@68 1061 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
jpayne@68 1062 #endif
jpayne@68 1063 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
jpayne@68 1064 #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
jpayne@68 1065 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
jpayne@68 1066 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
jpayne@68 1067 if (res == NULL) PyErr_Clear();
jpayne@68 1068 return res;
jpayne@68 1069 }
jpayne@68 1070 #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
jpayne@68 1071 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
jpayne@68 1072 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
jpayne@68 1073 #else
jpayne@68 1074 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
jpayne@68 1075 #if CYTHON_COMPILING_IN_PYPY
jpayne@68 1076 return PyDict_GetItem(dict, name);
jpayne@68 1077 #else
jpayne@68 1078 PyDictEntry *ep;
jpayne@68 1079 PyDictObject *mp = (PyDictObject*) dict;
jpayne@68 1080 long hash = ((PyStringObject *) name)->ob_shash;
jpayne@68 1081 assert(hash != -1);
jpayne@68 1082 ep = (mp->ma_lookup)(mp, name, hash);
jpayne@68 1083 if (ep == NULL) {
jpayne@68 1084 return NULL;
jpayne@68 1085 }
jpayne@68 1086 return ep->me_value;
jpayne@68 1087 #endif
jpayne@68 1088 }
jpayne@68 1089 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
jpayne@68 1090 #endif
jpayne@68 1091 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 1092 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
jpayne@68 1093 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
jpayne@68 1094 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
jpayne@68 1095 #else
jpayne@68 1096 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
jpayne@68 1097 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
jpayne@68 1098 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
jpayne@68 1099 #endif
jpayne@68 1100 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 1101 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
jpayne@68 1102 #else
jpayne@68 1103 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
jpayne@68 1104 #endif
jpayne@68 1105 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
jpayne@68 1106 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
jpayne@68 1107 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
jpayne@68 1108 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
jpayne@68 1109 PyObject_GC_Del(obj);\
jpayne@68 1110 Py_DECREF(type);\
jpayne@68 1111 }
jpayne@68 1112 #else
jpayne@68 1113 #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
jpayne@68 1114 #endif
jpayne@68 1115 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 1116 #define CYTHON_PEP393_ENABLED 1
jpayne@68 1117 #define __Pyx_PyUnicode_READY(op) (0)
jpayne@68 1118 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
jpayne@68 1119 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
jpayne@68 1120 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
jpayne@68 1121 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
jpayne@68 1122 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
jpayne@68 1123 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
jpayne@68 1124 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
jpayne@68 1125 #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
jpayne@68 1126 #define CYTHON_PEP393_ENABLED 1
jpayne@68 1127 #if PY_VERSION_HEX >= 0x030C0000
jpayne@68 1128 #define __Pyx_PyUnicode_READY(op) (0)
jpayne@68 1129 #else
jpayne@68 1130 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
jpayne@68 1131 0 : _PyUnicode_Ready((PyObject *)(op)))
jpayne@68 1132 #endif
jpayne@68 1133 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
jpayne@68 1134 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
jpayne@68 1135 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
jpayne@68 1136 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
jpayne@68 1137 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
jpayne@68 1138 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
jpayne@68 1139 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
jpayne@68 1140 #if PY_VERSION_HEX >= 0x030C0000
jpayne@68 1141 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
jpayne@68 1142 #else
jpayne@68 1143 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
jpayne@68 1144 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
jpayne@68 1145 #else
jpayne@68 1146 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
jpayne@68 1147 #endif
jpayne@68 1148 #endif
jpayne@68 1149 #else
jpayne@68 1150 #define CYTHON_PEP393_ENABLED 0
jpayne@68 1151 #define PyUnicode_1BYTE_KIND 1
jpayne@68 1152 #define PyUnicode_2BYTE_KIND 2
jpayne@68 1153 #define PyUnicode_4BYTE_KIND 4
jpayne@68 1154 #define __Pyx_PyUnicode_READY(op) (0)
jpayne@68 1155 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
jpayne@68 1156 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
jpayne@68 1157 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
jpayne@68 1158 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
jpayne@68 1159 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
jpayne@68 1160 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
jpayne@68 1161 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
jpayne@68 1162 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
jpayne@68 1163 #endif
jpayne@68 1164 #if CYTHON_COMPILING_IN_PYPY
jpayne@68 1165 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
jpayne@68 1166 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
jpayne@68 1167 #else
jpayne@68 1168 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
jpayne@68 1169 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
jpayne@68 1170 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
jpayne@68 1171 #endif
jpayne@68 1172 #if CYTHON_COMPILING_IN_PYPY
jpayne@68 1173 #if !defined(PyUnicode_DecodeUnicodeEscape)
jpayne@68 1174 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
jpayne@68 1175 #endif
jpayne@68 1176 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
jpayne@68 1177 #undef PyUnicode_Contains
jpayne@68 1178 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
jpayne@68 1179 #endif
jpayne@68 1180 #if !defined(PyByteArray_Check)
jpayne@68 1181 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
jpayne@68 1182 #endif
jpayne@68 1183 #if !defined(PyObject_Format)
jpayne@68 1184 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
jpayne@68 1185 #endif
jpayne@68 1186 #endif
jpayne@68 1187 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
jpayne@68 1188 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
jpayne@68 1189 #if PY_MAJOR_VERSION >= 3
jpayne@68 1190 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
jpayne@68 1191 #else
jpayne@68 1192 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
jpayne@68 1193 #endif
jpayne@68 1194 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
jpayne@68 1195 #define PyObject_ASCII(o) PyObject_Repr(o)
jpayne@68 1196 #endif
jpayne@68 1197 #if PY_MAJOR_VERSION >= 3
jpayne@68 1198 #define PyBaseString_Type PyUnicode_Type
jpayne@68 1199 #define PyStringObject PyUnicodeObject
jpayne@68 1200 #define PyString_Type PyUnicode_Type
jpayne@68 1201 #define PyString_Check PyUnicode_Check
jpayne@68 1202 #define PyString_CheckExact PyUnicode_CheckExact
jpayne@68 1203 #ifndef PyObject_Unicode
jpayne@68 1204 #define PyObject_Unicode PyObject_Str
jpayne@68 1205 #endif
jpayne@68 1206 #endif
jpayne@68 1207 #if PY_MAJOR_VERSION >= 3
jpayne@68 1208 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
jpayne@68 1209 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
jpayne@68 1210 #else
jpayne@68 1211 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
jpayne@68 1212 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
jpayne@68 1213 #endif
jpayne@68 1214 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 1215 #define __Pyx_PySequence_ListKeepNew(obj)\
jpayne@68 1216 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
jpayne@68 1217 #else
jpayne@68 1218 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
jpayne@68 1219 #endif
jpayne@68 1220 #ifndef PySet_CheckExact
jpayne@68 1221 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
jpayne@68 1222 #endif
jpayne@68 1223 #if PY_VERSION_HEX >= 0x030900A4
jpayne@68 1224 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
jpayne@68 1225 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
jpayne@68 1226 #else
jpayne@68 1227 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
jpayne@68 1228 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
jpayne@68 1229 #endif
jpayne@68 1230 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 1231 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
jpayne@68 1232 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
jpayne@68 1233 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
jpayne@68 1234 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
jpayne@68 1235 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
jpayne@68 1236 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
jpayne@68 1237 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
jpayne@68 1238 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
jpayne@68 1239 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
jpayne@68 1240 #else
jpayne@68 1241 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
jpayne@68 1242 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
jpayne@68 1243 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
jpayne@68 1244 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
jpayne@68 1245 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
jpayne@68 1246 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
jpayne@68 1247 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
jpayne@68 1248 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
jpayne@68 1249 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
jpayne@68 1250 #endif
jpayne@68 1251 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
jpayne@68 1252 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
jpayne@68 1253 #else
jpayne@68 1254 static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
jpayne@68 1255 PyObject *module = PyImport_AddModule(name);
jpayne@68 1256 Py_XINCREF(module);
jpayne@68 1257 return module;
jpayne@68 1258 }
jpayne@68 1259 #endif
jpayne@68 1260 #if PY_MAJOR_VERSION >= 3
jpayne@68 1261 #define PyIntObject PyLongObject
jpayne@68 1262 #define PyInt_Type PyLong_Type
jpayne@68 1263 #define PyInt_Check(op) PyLong_Check(op)
jpayne@68 1264 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
jpayne@68 1265 #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
jpayne@68 1266 #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
jpayne@68 1267 #define PyInt_FromString PyLong_FromString
jpayne@68 1268 #define PyInt_FromUnicode PyLong_FromUnicode
jpayne@68 1269 #define PyInt_FromLong PyLong_FromLong
jpayne@68 1270 #define PyInt_FromSize_t PyLong_FromSize_t
jpayne@68 1271 #define PyInt_FromSsize_t PyLong_FromSsize_t
jpayne@68 1272 #define PyInt_AsLong PyLong_AsLong
jpayne@68 1273 #define PyInt_AS_LONG PyLong_AS_LONG
jpayne@68 1274 #define PyInt_AsSsize_t PyLong_AsSsize_t
jpayne@68 1275 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
jpayne@68 1276 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
jpayne@68 1277 #define PyNumber_Int PyNumber_Long
jpayne@68 1278 #else
jpayne@68 1279 #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
jpayne@68 1280 #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
jpayne@68 1281 #endif
jpayne@68 1282 #if PY_MAJOR_VERSION >= 3
jpayne@68 1283 #define PyBoolObject PyLongObject
jpayne@68 1284 #endif
jpayne@68 1285 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
jpayne@68 1286 #ifndef PyUnicode_InternFromString
jpayne@68 1287 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
jpayne@68 1288 #endif
jpayne@68 1289 #endif
jpayne@68 1290 #if PY_VERSION_HEX < 0x030200A4
jpayne@68 1291 typedef long Py_hash_t;
jpayne@68 1292 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
jpayne@68 1293 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
jpayne@68 1294 #else
jpayne@68 1295 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
jpayne@68 1296 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
jpayne@68 1297 #endif
jpayne@68 1298 #if CYTHON_USE_ASYNC_SLOTS
jpayne@68 1299 #if PY_VERSION_HEX >= 0x030500B1
jpayne@68 1300 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
jpayne@68 1301 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
jpayne@68 1302 #else
jpayne@68 1303 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
jpayne@68 1304 #endif
jpayne@68 1305 #else
jpayne@68 1306 #define __Pyx_PyType_AsAsync(obj) NULL
jpayne@68 1307 #endif
jpayne@68 1308 #ifndef __Pyx_PyAsyncMethodsStruct
jpayne@68 1309 typedef struct {
jpayne@68 1310 unaryfunc am_await;
jpayne@68 1311 unaryfunc am_aiter;
jpayne@68 1312 unaryfunc am_anext;
jpayne@68 1313 } __Pyx_PyAsyncMethodsStruct;
jpayne@68 1314 #endif
jpayne@68 1315
jpayne@68 1316 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
jpayne@68 1317 #if !defined(_USE_MATH_DEFINES)
jpayne@68 1318 #define _USE_MATH_DEFINES
jpayne@68 1319 #endif
jpayne@68 1320 #endif
jpayne@68 1321 #include <math.h>
jpayne@68 1322 #ifdef NAN
jpayne@68 1323 #define __PYX_NAN() ((float) NAN)
jpayne@68 1324 #else
jpayne@68 1325 static CYTHON_INLINE float __PYX_NAN() {
jpayne@68 1326 float value;
jpayne@68 1327 memset(&value, 0xFF, sizeof(value));
jpayne@68 1328 return value;
jpayne@68 1329 }
jpayne@68 1330 #endif
jpayne@68 1331 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
jpayne@68 1332 #define __Pyx_truncl trunc
jpayne@68 1333 #else
jpayne@68 1334 #define __Pyx_truncl truncl
jpayne@68 1335 #endif
jpayne@68 1336
jpayne@68 1337 #define __PYX_MARK_ERR_POS(f_index, lineno) \
jpayne@68 1338 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
jpayne@68 1339 #define __PYX_ERR(f_index, lineno, Ln_error) \
jpayne@68 1340 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
jpayne@68 1341
jpayne@68 1342 #ifdef CYTHON_EXTERN_C
jpayne@68 1343 #undef __PYX_EXTERN_C
jpayne@68 1344 #define __PYX_EXTERN_C CYTHON_EXTERN_C
jpayne@68 1345 #elif defined(__PYX_EXTERN_C)
jpayne@68 1346 #ifdef _MSC_VER
jpayne@68 1347 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
jpayne@68 1348 #else
jpayne@68 1349 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
jpayne@68 1350 #endif
jpayne@68 1351 #else
jpayne@68 1352 #ifdef __cplusplus
jpayne@68 1353 #define __PYX_EXTERN_C extern "C"
jpayne@68 1354 #else
jpayne@68 1355 #define __PYX_EXTERN_C extern
jpayne@68 1356 #endif
jpayne@68 1357 #endif
jpayne@68 1358
jpayne@68 1359 #define __PYX_HAVE__pysam__libchtslib
jpayne@68 1360 #define __PYX_HAVE_API__pysam__libchtslib
jpayne@68 1361 /* Early includes */
jpayne@68 1362 #include <stdint.h>
jpayne@68 1363 #include <string.h>
jpayne@68 1364 #include <stdlib.h>
jpayne@68 1365 #include <stdio.h>
jpayne@68 1366 #include <sys/types.h>
jpayne@68 1367 #include "stdarg.h"
jpayne@68 1368 #include "htslib/kstring.h"
jpayne@68 1369 #include "htslib_util.h"
jpayne@68 1370 #include "htslib/hfile.h"
jpayne@68 1371 #include "htslib/bgzf.h"
jpayne@68 1372 #include "htslib/hts.h"
jpayne@68 1373 #include "htslib/sam.h"
jpayne@68 1374 #include "htslib/faidx.h"
jpayne@68 1375 #include "htslib/tbx.h"
jpayne@68 1376 #include "htslib/vcf.h"
jpayne@68 1377 #include "htslib/vcfutils.h"
jpayne@68 1378 #include "htslib/cram.h"
jpayne@68 1379 #include <unistd.h>
jpayne@68 1380 #include <errno.h>
jpayne@68 1381 #include <stddef.h>
jpayne@68 1382 #include "pythread.h"
jpayne@68 1383
jpayne@68 1384 #if CYTHON_COMPILING_IN_PYPY
jpayne@68 1385 #ifdef _MSC_VER
jpayne@68 1386 #pragma message ("This module uses CPython specific internals of 'array.array', which are not available in PyPy.")
jpayne@68 1387 #else
jpayne@68 1388 #warning This module uses CPython specific internals of 'array.array', which are not available in PyPy.
jpayne@68 1389 #endif
jpayne@68 1390 #endif
jpayne@68 1391
jpayne@68 1392 #ifdef _OPENMP
jpayne@68 1393 #include <omp.h>
jpayne@68 1394 #endif /* _OPENMP */
jpayne@68 1395
jpayne@68 1396 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
jpayne@68 1397 #define CYTHON_WITHOUT_ASSERTIONS
jpayne@68 1398 #endif
jpayne@68 1399
jpayne@68 1400 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
jpayne@68 1401 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
jpayne@68 1402
jpayne@68 1403 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
jpayne@68 1404 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
jpayne@68 1405 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
jpayne@68 1406 #define __PYX_DEFAULT_STRING_ENCODING ""
jpayne@68 1407 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
jpayne@68 1408 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
jpayne@68 1409 #define __Pyx_uchar_cast(c) ((unsigned char)c)
jpayne@68 1410 #define __Pyx_long_cast(x) ((long)x)
jpayne@68 1411 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
jpayne@68 1412 (sizeof(type) < sizeof(Py_ssize_t)) ||\
jpayne@68 1413 (sizeof(type) > sizeof(Py_ssize_t) &&\
jpayne@68 1414 likely(v < (type)PY_SSIZE_T_MAX ||\
jpayne@68 1415 v == (type)PY_SSIZE_T_MAX) &&\
jpayne@68 1416 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
jpayne@68 1417 v == (type)PY_SSIZE_T_MIN))) ||\
jpayne@68 1418 (sizeof(type) == sizeof(Py_ssize_t) &&\
jpayne@68 1419 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
jpayne@68 1420 v == (type)PY_SSIZE_T_MAX))) )
jpayne@68 1421 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
jpayne@68 1422 return (size_t) i < (size_t) limit;
jpayne@68 1423 }
jpayne@68 1424 #if defined (__cplusplus) && __cplusplus >= 201103L
jpayne@68 1425 #include <cstdlib>
jpayne@68 1426 #define __Pyx_sst_abs(value) std::abs(value)
jpayne@68 1427 #elif SIZEOF_INT >= SIZEOF_SIZE_T
jpayne@68 1428 #define __Pyx_sst_abs(value) abs(value)
jpayne@68 1429 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
jpayne@68 1430 #define __Pyx_sst_abs(value) labs(value)
jpayne@68 1431 #elif defined (_MSC_VER)
jpayne@68 1432 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
jpayne@68 1433 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
jpayne@68 1434 #define __Pyx_sst_abs(value) llabs(value)
jpayne@68 1435 #elif defined (__GNUC__)
jpayne@68 1436 #define __Pyx_sst_abs(value) __builtin_llabs(value)
jpayne@68 1437 #else
jpayne@68 1438 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
jpayne@68 1439 #endif
jpayne@68 1440 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
jpayne@68 1441 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
jpayne@68 1442 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
jpayne@68 1443 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
jpayne@68 1444 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
jpayne@68 1445 #define __Pyx_PyBytes_FromString PyBytes_FromString
jpayne@68 1446 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
jpayne@68 1447 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
jpayne@68 1448 #if PY_MAJOR_VERSION < 3
jpayne@68 1449 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
jpayne@68 1450 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
jpayne@68 1451 #else
jpayne@68 1452 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
jpayne@68 1453 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
jpayne@68 1454 #endif
jpayne@68 1455 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
jpayne@68 1456 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
jpayne@68 1457 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
jpayne@68 1458 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
jpayne@68 1459 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
jpayne@68 1460 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
jpayne@68 1461 #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
jpayne@68 1462 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
jpayne@68 1463 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
jpayne@68 1464 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
jpayne@68 1465 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
jpayne@68 1466 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
jpayne@68 1467 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
jpayne@68 1468 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
jpayne@68 1469 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
jpayne@68 1470 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
jpayne@68 1471 #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
jpayne@68 1472 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
jpayne@68 1473 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
jpayne@68 1474 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
jpayne@68 1475 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
jpayne@68 1476 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
jpayne@68 1477 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
jpayne@68 1478 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
jpayne@68 1479 #define __Pyx_PySequence_Tuple(obj)\
jpayne@68 1480 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
jpayne@68 1481 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
jpayne@68 1482 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
jpayne@68 1483 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
jpayne@68 1484 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 1485 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
jpayne@68 1486 #else
jpayne@68 1487 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
jpayne@68 1488 #endif
jpayne@68 1489 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
jpayne@68 1490 #if PY_MAJOR_VERSION >= 3
jpayne@68 1491 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
jpayne@68 1492 #else
jpayne@68 1493 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
jpayne@68 1494 #endif
jpayne@68 1495 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 1496 #if PY_VERSION_HEX >= 0x030C00A7
jpayne@68 1497 #ifndef _PyLong_SIGN_MASK
jpayne@68 1498 #define _PyLong_SIGN_MASK 3
jpayne@68 1499 #endif
jpayne@68 1500 #ifndef _PyLong_NON_SIZE_BITS
jpayne@68 1501 #define _PyLong_NON_SIZE_BITS 3
jpayne@68 1502 #endif
jpayne@68 1503 #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
jpayne@68 1504 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
jpayne@68 1505 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
jpayne@68 1506 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
jpayne@68 1507 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
jpayne@68 1508 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
jpayne@68 1509 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
jpayne@68 1510 #define __Pyx_PyLong_SignedDigitCount(x)\
jpayne@68 1511 ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
jpayne@68 1512 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
jpayne@68 1513 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
jpayne@68 1514 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
jpayne@68 1515 #else
jpayne@68 1516 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
jpayne@68 1517 #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
jpayne@68 1518 #endif
jpayne@68 1519 typedef Py_ssize_t __Pyx_compact_pylong;
jpayne@68 1520 typedef size_t __Pyx_compact_upylong;
jpayne@68 1521 #else
jpayne@68 1522 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
jpayne@68 1523 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
jpayne@68 1524 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
jpayne@68 1525 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
jpayne@68 1526 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
jpayne@68 1527 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
jpayne@68 1528 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
jpayne@68 1529 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
jpayne@68 1530 #define __Pyx_PyLong_CompactValue(x)\
jpayne@68 1531 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
jpayne@68 1532 typedef sdigit __Pyx_compact_pylong;
jpayne@68 1533 typedef digit __Pyx_compact_upylong;
jpayne@68 1534 #endif
jpayne@68 1535 #if PY_VERSION_HEX >= 0x030C00A5
jpayne@68 1536 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
jpayne@68 1537 #else
jpayne@68 1538 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
jpayne@68 1539 #endif
jpayne@68 1540 #endif
jpayne@68 1541 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
jpayne@68 1542 #include <string.h>
jpayne@68 1543 static int __Pyx_sys_getdefaultencoding_not_ascii;
jpayne@68 1544 static int __Pyx_init_sys_getdefaultencoding_params(void) {
jpayne@68 1545 PyObject* sys;
jpayne@68 1546 PyObject* default_encoding = NULL;
jpayne@68 1547 PyObject* ascii_chars_u = NULL;
jpayne@68 1548 PyObject* ascii_chars_b = NULL;
jpayne@68 1549 const char* default_encoding_c;
jpayne@68 1550 sys = PyImport_ImportModule("sys");
jpayne@68 1551 if (!sys) goto bad;
jpayne@68 1552 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
jpayne@68 1553 Py_DECREF(sys);
jpayne@68 1554 if (!default_encoding) goto bad;
jpayne@68 1555 default_encoding_c = PyBytes_AsString(default_encoding);
jpayne@68 1556 if (!default_encoding_c) goto bad;
jpayne@68 1557 if (strcmp(default_encoding_c, "ascii") == 0) {
jpayne@68 1558 __Pyx_sys_getdefaultencoding_not_ascii = 0;
jpayne@68 1559 } else {
jpayne@68 1560 char ascii_chars[128];
jpayne@68 1561 int c;
jpayne@68 1562 for (c = 0; c < 128; c++) {
jpayne@68 1563 ascii_chars[c] = (char) c;
jpayne@68 1564 }
jpayne@68 1565 __Pyx_sys_getdefaultencoding_not_ascii = 1;
jpayne@68 1566 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
jpayne@68 1567 if (!ascii_chars_u) goto bad;
jpayne@68 1568 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
jpayne@68 1569 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
jpayne@68 1570 PyErr_Format(
jpayne@68 1571 PyExc_ValueError,
jpayne@68 1572 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
jpayne@68 1573 default_encoding_c);
jpayne@68 1574 goto bad;
jpayne@68 1575 }
jpayne@68 1576 Py_DECREF(ascii_chars_u);
jpayne@68 1577 Py_DECREF(ascii_chars_b);
jpayne@68 1578 }
jpayne@68 1579 Py_DECREF(default_encoding);
jpayne@68 1580 return 0;
jpayne@68 1581 bad:
jpayne@68 1582 Py_XDECREF(default_encoding);
jpayne@68 1583 Py_XDECREF(ascii_chars_u);
jpayne@68 1584 Py_XDECREF(ascii_chars_b);
jpayne@68 1585 return -1;
jpayne@68 1586 }
jpayne@68 1587 #endif
jpayne@68 1588 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
jpayne@68 1589 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
jpayne@68 1590 #else
jpayne@68 1591 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
jpayne@68 1592 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
jpayne@68 1593 #include <string.h>
jpayne@68 1594 static char* __PYX_DEFAULT_STRING_ENCODING;
jpayne@68 1595 static int __Pyx_init_sys_getdefaultencoding_params(void) {
jpayne@68 1596 PyObject* sys;
jpayne@68 1597 PyObject* default_encoding = NULL;
jpayne@68 1598 char* default_encoding_c;
jpayne@68 1599 sys = PyImport_ImportModule("sys");
jpayne@68 1600 if (!sys) goto bad;
jpayne@68 1601 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
jpayne@68 1602 Py_DECREF(sys);
jpayne@68 1603 if (!default_encoding) goto bad;
jpayne@68 1604 default_encoding_c = PyBytes_AsString(default_encoding);
jpayne@68 1605 if (!default_encoding_c) goto bad;
jpayne@68 1606 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
jpayne@68 1607 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
jpayne@68 1608 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
jpayne@68 1609 Py_DECREF(default_encoding);
jpayne@68 1610 return 0;
jpayne@68 1611 bad:
jpayne@68 1612 Py_XDECREF(default_encoding);
jpayne@68 1613 return -1;
jpayne@68 1614 }
jpayne@68 1615 #endif
jpayne@68 1616 #endif
jpayne@68 1617
jpayne@68 1618
jpayne@68 1619 /* Test for GCC > 2.95 */
jpayne@68 1620 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
jpayne@68 1621 #define likely(x) __builtin_expect(!!(x), 1)
jpayne@68 1622 #define unlikely(x) __builtin_expect(!!(x), 0)
jpayne@68 1623 #else /* !__GNUC__ or GCC < 2.95 */
jpayne@68 1624 #define likely(x) (x)
jpayne@68 1625 #define unlikely(x) (x)
jpayne@68 1626 #endif /* __GNUC__ */
jpayne@68 1627 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
jpayne@68 1628
jpayne@68 1629 #if !CYTHON_USE_MODULE_STATE
jpayne@68 1630 static PyObject *__pyx_m = NULL;
jpayne@68 1631 #endif
jpayne@68 1632 static int __pyx_lineno;
jpayne@68 1633 static int __pyx_clineno = 0;
jpayne@68 1634 static const char * __pyx_cfilenm = __FILE__;
jpayne@68 1635 static const char *__pyx_filename;
jpayne@68 1636
jpayne@68 1637 /* #### Code section: filename_table ### */
jpayne@68 1638
jpayne@68 1639 static const char *__pyx_f[] = {
jpayne@68 1640 "pysam/libchtslib.pyx",
jpayne@68 1641 "<stringsource>",
jpayne@68 1642 "contextvars.pxd",
jpayne@68 1643 "array.pxd",
jpayne@68 1644 "pysam/libchtslib.pxd",
jpayne@68 1645 "type.pxd",
jpayne@68 1646 "bool.pxd",
jpayne@68 1647 "complex.pxd",
jpayne@68 1648 };
jpayne@68 1649 /* #### Code section: utility_code_proto_before_types ### */
jpayne@68 1650 /* ForceInitThreads.proto */
jpayne@68 1651 #ifndef __PYX_FORCE_INIT_THREADS
jpayne@68 1652 #define __PYX_FORCE_INIT_THREADS 0
jpayne@68 1653 #endif
jpayne@68 1654
jpayne@68 1655 /* NoFastGil.proto */
jpayne@68 1656 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
jpayne@68 1657 #define __Pyx_PyGILState_Release PyGILState_Release
jpayne@68 1658 #define __Pyx_FastGIL_Remember()
jpayne@68 1659 #define __Pyx_FastGIL_Forget()
jpayne@68 1660 #define __Pyx_FastGilFuncInit()
jpayne@68 1661
jpayne@68 1662 /* #### Code section: numeric_typedefs ### */
jpayne@68 1663 /* #### Code section: complex_type_declarations ### */
jpayne@68 1664 /* #### Code section: type_declarations ### */
jpayne@68 1665
jpayne@68 1666 /*--- Type declarations ---*/
jpayne@68 1667 #ifndef _ARRAYARRAY_H
jpayne@68 1668 struct arrayobject;
jpayne@68 1669 typedef struct arrayobject arrayobject;
jpayne@68 1670 #endif
jpayne@68 1671 struct __pyx_obj_5pysam_10libchtslib_HTSFile;
jpayne@68 1672 struct __pyx_obj_5pysam_10libchtslib_HFile;
jpayne@68 1673 struct __pyx_opt_args_7cpython_11contextvars_get_value;
jpayne@68 1674 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;
jpayne@68 1675
jpayne@68 1676 /* "cpython/contextvars.pxd":112
jpayne@68 1677 *
jpayne@68 1678 *
jpayne@68 1679 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
jpayne@68 1680 * """Return a new reference to the value of the context variable,
jpayne@68 1681 * or the default value of the context variable,
jpayne@68 1682 */
jpayne@68 1683 struct __pyx_opt_args_7cpython_11contextvars_get_value {
jpayne@68 1684 int __pyx_n;
jpayne@68 1685 PyObject *default_value;
jpayne@68 1686 };
jpayne@68 1687
jpayne@68 1688 /* "cpython/contextvars.pxd":129
jpayne@68 1689 *
jpayne@68 1690 *
jpayne@68 1691 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
jpayne@68 1692 * """Return a new reference to the value of the context variable,
jpayne@68 1693 * or the provided default value if no such value was found.
jpayne@68 1694 */
jpayne@68 1695 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
jpayne@68 1696 int __pyx_n;
jpayne@68 1697 PyObject *default_value;
jpayne@68 1698 };
jpayne@68 1699 struct __pyx_opt_args_5pysam_9libcutils_parse_region;
jpayne@68 1700 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array;
jpayne@68 1701 struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring;
jpayne@68 1702 struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring;
jpayne@68 1703 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str;
jpayne@68 1704 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes;
jpayne@68 1705 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len;
jpayne@68 1706 struct __pyx_opt_args_5pysam_9libcutils_force_str;
jpayne@68 1707 struct __pyx_opt_args_5pysam_9libcutils_force_bytes;
jpayne@68 1708 struct __pyx_opt_args_5pysam_9libcutils_decode_bytes;
jpayne@68 1709
jpayne@68 1710 /* "pysam/libcutils.pxd":8
jpayne@68 1711 * from cpython cimport array as c_array
jpayne@68 1712 *
jpayne@68 1713 * cpdef parse_region(contig=*, start=*, stop=*, region=*, reference=*, end=*) # <<<<<<<<<<<<<<
jpayne@68 1714 *
jpayne@68 1715 * cdef int libc_whence_from_io(int whence)
jpayne@68 1716 */
jpayne@68 1717 struct __pyx_opt_args_5pysam_9libcutils_parse_region {
jpayne@68 1718 int __pyx_n;
jpayne@68 1719 PyObject *contig;
jpayne@68 1720 PyObject *start;
jpayne@68 1721 PyObject *stop;
jpayne@68 1722 PyObject *region;
jpayne@68 1723 PyObject *reference;
jpayne@68 1724 PyObject *end;
jpayne@68 1725 };
jpayne@68 1726
jpayne@68 1727 /* "pysam/libcutils.pxd":15
jpayne@68 1728 * # Utility functions for quality string conversions
jpayne@68 1729 *
jpayne@68 1730 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) # <<<<<<<<<<<<<<
jpayne@68 1731 * cpdef array_to_qualitystring(c_array.array arr, int offset=*)
jpayne@68 1732 * cpdef qualities_to_qualitystring(qualities, int offset=*)
jpayne@68 1733 */
jpayne@68 1734 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array {
jpayne@68 1735 int __pyx_n;
jpayne@68 1736 int offset;
jpayne@68 1737 };
jpayne@68 1738
jpayne@68 1739 /* "pysam/libcutils.pxd":16
jpayne@68 1740 *
jpayne@68 1741 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*)
jpayne@68 1742 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) # <<<<<<<<<<<<<<
jpayne@68 1743 * cpdef qualities_to_qualitystring(qualities, int offset=*)
jpayne@68 1744 *
jpayne@68 1745 */
jpayne@68 1746 struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring {
jpayne@68 1747 int __pyx_n;
jpayne@68 1748 int offset;
jpayne@68 1749 };
jpayne@68 1750
jpayne@68 1751 /* "pysam/libcutils.pxd":17
jpayne@68 1752 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*)
jpayne@68 1753 * cpdef array_to_qualitystring(c_array.array arr, int offset=*)
jpayne@68 1754 * cpdef qualities_to_qualitystring(qualities, int offset=*) # <<<<<<<<<<<<<<
jpayne@68 1755 *
jpayne@68 1756 * ########################################################################
jpayne@68 1757 */
jpayne@68 1758 struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring {
jpayne@68 1759 int __pyx_n;
jpayne@68 1760 int offset;
jpayne@68 1761 };
jpayne@68 1762
jpayne@68 1763 /* "pysam/libcutils.pxd":29
jpayne@68 1764 * ## Python 3 compatibility functions
jpayne@68 1765 * ########################################################################
jpayne@68 1766 * cdef charptr_to_str(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<<
jpayne@68 1767 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*)
jpayne@68 1768 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*)
jpayne@68 1769 */
jpayne@68 1770 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str {
jpayne@68 1771 int __pyx_n;
jpayne@68 1772 PyObject *encoding;
jpayne@68 1773 PyObject *errors;
jpayne@68 1774 };
jpayne@68 1775
jpayne@68 1776 /* "pysam/libcutils.pxd":30
jpayne@68 1777 * ########################################################################
jpayne@68 1778 * cdef charptr_to_str(const char *s, encoding=*, errors=*)
jpayne@68 1779 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<<
jpayne@68 1780 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*)
jpayne@68 1781 * cdef force_str(object s, encoding=*, errors=*)
jpayne@68 1782 */
jpayne@68 1783 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes {
jpayne@68 1784 int __pyx_n;
jpayne@68 1785 PyObject *encoding;
jpayne@68 1786 PyObject *errors;
jpayne@68 1787 };
jpayne@68 1788
jpayne@68 1789 /* "pysam/libcutils.pxd":31
jpayne@68 1790 * cdef charptr_to_str(const char *s, encoding=*, errors=*)
jpayne@68 1791 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*)
jpayne@68 1792 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) # <<<<<<<<<<<<<<
jpayne@68 1793 * cdef force_str(object s, encoding=*, errors=*)
jpayne@68 1794 * cdef bytes force_bytes(object s, encoding=*, errors=*)
jpayne@68 1795 */
jpayne@68 1796 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len {
jpayne@68 1797 int __pyx_n;
jpayne@68 1798 PyObject *encoding;
jpayne@68 1799 PyObject *errors;
jpayne@68 1800 };
jpayne@68 1801
jpayne@68 1802 /* "pysam/libcutils.pxd":32
jpayne@68 1803 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*)
jpayne@68 1804 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*)
jpayne@68 1805 * cdef force_str(object s, encoding=*, errors=*) # <<<<<<<<<<<<<<
jpayne@68 1806 * cdef bytes force_bytes(object s, encoding=*, errors=*)
jpayne@68 1807 * cdef decode_bytes(bytes s, encoding=*, errors=*)
jpayne@68 1808 */
jpayne@68 1809 struct __pyx_opt_args_5pysam_9libcutils_force_str {
jpayne@68 1810 int __pyx_n;
jpayne@68 1811 PyObject *encoding;
jpayne@68 1812 PyObject *errors;
jpayne@68 1813 };
jpayne@68 1814
jpayne@68 1815 /* "pysam/libcutils.pxd":33
jpayne@68 1816 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*)
jpayne@68 1817 * cdef force_str(object s, encoding=*, errors=*)
jpayne@68 1818 * cdef bytes force_bytes(object s, encoding=*, errors=*) # <<<<<<<<<<<<<<
jpayne@68 1819 * cdef decode_bytes(bytes s, encoding=*, errors=*)
jpayne@68 1820 * cdef bytes encode_filename(object filename)
jpayne@68 1821 */
jpayne@68 1822 struct __pyx_opt_args_5pysam_9libcutils_force_bytes {
jpayne@68 1823 int __pyx_n;
jpayne@68 1824 PyObject *encoding;
jpayne@68 1825 PyObject *errors;
jpayne@68 1826 };
jpayne@68 1827
jpayne@68 1828 /* "pysam/libcutils.pxd":34
jpayne@68 1829 * cdef force_str(object s, encoding=*, errors=*)
jpayne@68 1830 * cdef bytes force_bytes(object s, encoding=*, errors=*)
jpayne@68 1831 * cdef decode_bytes(bytes s, encoding=*, errors=*) # <<<<<<<<<<<<<<
jpayne@68 1832 * cdef bytes encode_filename(object filename)
jpayne@68 1833 * cdef from_string_and_size(const char *s, size_t length)
jpayne@68 1834 */
jpayne@68 1835 struct __pyx_opt_args_5pysam_9libcutils_decode_bytes {
jpayne@68 1836 int __pyx_n;
jpayne@68 1837 PyObject *encoding;
jpayne@68 1838 PyObject *errors;
jpayne@68 1839 };
jpayne@68 1840 struct __pyx_opt_args_5pysam_10libchtslib_5HFile__open;
jpayne@68 1841
jpayne@68 1842 /* "pysam/libchtslib.pyx":81
jpayne@68 1843 * return self.fp == NULL
jpayne@68 1844 *
jpayne@68 1845 * cdef _open(self, name, mode, closefd=True): # <<<<<<<<<<<<<<
jpayne@68 1846 * self.name = name
jpayne@68 1847 * self.mode = mode
jpayne@68 1848 */
jpayne@68 1849 struct __pyx_opt_args_5pysam_10libchtslib_5HFile__open {
jpayne@68 1850 int __pyx_n;
jpayne@68 1851 PyObject *closefd;
jpayne@68 1852 };
jpayne@68 1853
jpayne@68 1854 /* "pysam/libchtslib.pxd":2706
jpayne@68 1855 *
jpayne@68 1856 *
jpayne@68 1857 * cdef class HTSFile(object): # <<<<<<<<<<<<<<
jpayne@68 1858 * cdef htsFile *htsfile # pointer to htsFile structure
jpayne@68 1859 * cdef int64_t start_offset # BGZF offset of first record
jpayne@68 1860 */
jpayne@68 1861 struct __pyx_obj_5pysam_10libchtslib_HTSFile {
jpayne@68 1862 PyObject_HEAD
jpayne@68 1863 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtab;
jpayne@68 1864 htsFile *htsfile;
jpayne@68 1865 int64_t start_offset;
jpayne@68 1866 PyObject *filename;
jpayne@68 1867 PyObject *mode;
jpayne@68 1868 PyObject *threads;
jpayne@68 1869 PyObject *index_filename;
jpayne@68 1870 int is_stream;
jpayne@68 1871 int is_remote;
jpayne@68 1872 int duplicate_filehandle;
jpayne@68 1873 };
jpayne@68 1874
jpayne@68 1875
jpayne@68 1876 /* "pysam/libchtslib.pyx":67
jpayne@68 1877 * ########################################################################
jpayne@68 1878 *
jpayne@68 1879 * cdef class HFile(object): # <<<<<<<<<<<<<<
jpayne@68 1880 * cdef hFILE *fp
jpayne@68 1881 * cdef readonly object name, mode
jpayne@68 1882 */
jpayne@68 1883 struct __pyx_obj_5pysam_10libchtslib_HFile {
jpayne@68 1884 PyObject_HEAD
jpayne@68 1885 struct __pyx_vtabstruct_5pysam_10libchtslib_HFile *__pyx_vtab;
jpayne@68 1886 hFILE *fp;
jpayne@68 1887 PyObject *name;
jpayne@68 1888 PyObject *mode;
jpayne@68 1889 };
jpayne@68 1890
jpayne@68 1891
jpayne@68 1892
jpayne@68 1893 /* "pysam/libchtslib.pyx":321
jpayne@68 1894 * ########################################################################
jpayne@68 1895 *
jpayne@68 1896 * cdef class HTSFile(object): # <<<<<<<<<<<<<<
jpayne@68 1897 * """
jpayne@68 1898 * Base class for HTS file types
jpayne@68 1899 */
jpayne@68 1900
jpayne@68 1901 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile {
jpayne@68 1902 htsFile *(*_open_htsfile)(struct __pyx_obj_5pysam_10libchtslib_HTSFile *);
jpayne@68 1903 };
jpayne@68 1904 static struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtabptr_5pysam_10libchtslib_HTSFile;
jpayne@68 1905
jpayne@68 1906
jpayne@68 1907 /* "pysam/libchtslib.pyx":67
jpayne@68 1908 * ########################################################################
jpayne@68 1909 *
jpayne@68 1910 * cdef class HFile(object): # <<<<<<<<<<<<<<
jpayne@68 1911 * cdef hFILE *fp
jpayne@68 1912 * cdef readonly object name, mode
jpayne@68 1913 */
jpayne@68 1914
jpayne@68 1915 struct __pyx_vtabstruct_5pysam_10libchtslib_HFile {
jpayne@68 1916 PyObject *(*_open)(struct __pyx_obj_5pysam_10libchtslib_HFile *, PyObject *, PyObject *, struct __pyx_opt_args_5pysam_10libchtslib_5HFile__open *__pyx_optional_args);
jpayne@68 1917 };
jpayne@68 1918 static struct __pyx_vtabstruct_5pysam_10libchtslib_HFile *__pyx_vtabptr_5pysam_10libchtslib_HFile;
jpayne@68 1919 /* #### Code section: utility_code_proto ### */
jpayne@68 1920
jpayne@68 1921 /* --- Runtime support code (head) --- */
jpayne@68 1922 /* Refnanny.proto */
jpayne@68 1923 #ifndef CYTHON_REFNANNY
jpayne@68 1924 #define CYTHON_REFNANNY 0
jpayne@68 1925 #endif
jpayne@68 1926 #if CYTHON_REFNANNY
jpayne@68 1927 typedef struct {
jpayne@68 1928 void (*INCREF)(void*, PyObject*, Py_ssize_t);
jpayne@68 1929 void (*DECREF)(void*, PyObject*, Py_ssize_t);
jpayne@68 1930 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
jpayne@68 1931 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
jpayne@68 1932 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
jpayne@68 1933 void (*FinishContext)(void**);
jpayne@68 1934 } __Pyx_RefNannyAPIStruct;
jpayne@68 1935 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
jpayne@68 1936 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
jpayne@68 1937 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
jpayne@68 1938 #ifdef WITH_THREAD
jpayne@68 1939 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
jpayne@68 1940 if (acquire_gil) {\
jpayne@68 1941 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
jpayne@68 1942 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
jpayne@68 1943 PyGILState_Release(__pyx_gilstate_save);\
jpayne@68 1944 } else {\
jpayne@68 1945 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
jpayne@68 1946 }
jpayne@68 1947 #define __Pyx_RefNannyFinishContextNogil() {\
jpayne@68 1948 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
jpayne@68 1949 __Pyx_RefNannyFinishContext();\
jpayne@68 1950 PyGILState_Release(__pyx_gilstate_save);\
jpayne@68 1951 }
jpayne@68 1952 #else
jpayne@68 1953 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
jpayne@68 1954 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
jpayne@68 1955 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
jpayne@68 1956 #endif
jpayne@68 1957 #define __Pyx_RefNannyFinishContextNogil() {\
jpayne@68 1958 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
jpayne@68 1959 __Pyx_RefNannyFinishContext();\
jpayne@68 1960 PyGILState_Release(__pyx_gilstate_save);\
jpayne@68 1961 }
jpayne@68 1962 #define __Pyx_RefNannyFinishContext()\
jpayne@68 1963 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
jpayne@68 1964 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
jpayne@68 1965 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
jpayne@68 1966 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
jpayne@68 1967 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
jpayne@68 1968 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
jpayne@68 1969 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
jpayne@68 1970 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
jpayne@68 1971 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
jpayne@68 1972 #else
jpayne@68 1973 #define __Pyx_RefNannyDeclarations
jpayne@68 1974 #define __Pyx_RefNannySetupContext(name, acquire_gil)
jpayne@68 1975 #define __Pyx_RefNannyFinishContextNogil()
jpayne@68 1976 #define __Pyx_RefNannyFinishContext()
jpayne@68 1977 #define __Pyx_INCREF(r) Py_INCREF(r)
jpayne@68 1978 #define __Pyx_DECREF(r) Py_DECREF(r)
jpayne@68 1979 #define __Pyx_GOTREF(r)
jpayne@68 1980 #define __Pyx_GIVEREF(r)
jpayne@68 1981 #define __Pyx_XINCREF(r) Py_XINCREF(r)
jpayne@68 1982 #define __Pyx_XDECREF(r) Py_XDECREF(r)
jpayne@68 1983 #define __Pyx_XGOTREF(r)
jpayne@68 1984 #define __Pyx_XGIVEREF(r)
jpayne@68 1985 #endif
jpayne@68 1986 #define __Pyx_Py_XDECREF_SET(r, v) do {\
jpayne@68 1987 PyObject *tmp = (PyObject *) r;\
jpayne@68 1988 r = v; Py_XDECREF(tmp);\
jpayne@68 1989 } while (0)
jpayne@68 1990 #define __Pyx_XDECREF_SET(r, v) do {\
jpayne@68 1991 PyObject *tmp = (PyObject *) r;\
jpayne@68 1992 r = v; __Pyx_XDECREF(tmp);\
jpayne@68 1993 } while (0)
jpayne@68 1994 #define __Pyx_DECREF_SET(r, v) do {\
jpayne@68 1995 PyObject *tmp = (PyObject *) r;\
jpayne@68 1996 r = v; __Pyx_DECREF(tmp);\
jpayne@68 1997 } while (0)
jpayne@68 1998 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
jpayne@68 1999 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
jpayne@68 2000
jpayne@68 2001 /* PyErrExceptionMatches.proto */
jpayne@68 2002 #if CYTHON_FAST_THREAD_STATE
jpayne@68 2003 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
jpayne@68 2004 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
jpayne@68 2005 #else
jpayne@68 2006 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
jpayne@68 2007 #endif
jpayne@68 2008
jpayne@68 2009 /* PyThreadStateGet.proto */
jpayne@68 2010 #if CYTHON_FAST_THREAD_STATE
jpayne@68 2011 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
jpayne@68 2012 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
jpayne@68 2013 #if PY_VERSION_HEX >= 0x030C00A6
jpayne@68 2014 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
jpayne@68 2015 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
jpayne@68 2016 #else
jpayne@68 2017 #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
jpayne@68 2018 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
jpayne@68 2019 #endif
jpayne@68 2020 #else
jpayne@68 2021 #define __Pyx_PyThreadState_declare
jpayne@68 2022 #define __Pyx_PyThreadState_assign
jpayne@68 2023 #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
jpayne@68 2024 #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
jpayne@68 2025 #endif
jpayne@68 2026
jpayne@68 2027 /* PyErrFetchRestore.proto */
jpayne@68 2028 #if CYTHON_FAST_THREAD_STATE
jpayne@68 2029 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
jpayne@68 2030 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
jpayne@68 2031 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
jpayne@68 2032 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
jpayne@68 2033 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
jpayne@68 2034 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
jpayne@68 2035 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
jpayne@68 2036 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
jpayne@68 2037 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
jpayne@68 2038 #else
jpayne@68 2039 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
jpayne@68 2040 #endif
jpayne@68 2041 #else
jpayne@68 2042 #define __Pyx_PyErr_Clear() PyErr_Clear()
jpayne@68 2043 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
jpayne@68 2044 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
jpayne@68 2045 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
jpayne@68 2046 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
jpayne@68 2047 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
jpayne@68 2048 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
jpayne@68 2049 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
jpayne@68 2050 #endif
jpayne@68 2051
jpayne@68 2052 /* PyObjectGetAttrStr.proto */
jpayne@68 2053 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 2054 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
jpayne@68 2055 #else
jpayne@68 2056 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
jpayne@68 2057 #endif
jpayne@68 2058
jpayne@68 2059 /* PyObjectGetAttrStrNoError.proto */
jpayne@68 2060 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
jpayne@68 2061
jpayne@68 2062 /* GetBuiltinName.proto */
jpayne@68 2063 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
jpayne@68 2064
jpayne@68 2065 /* TupleAndListFromArray.proto */
jpayne@68 2066 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 2067 static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
jpayne@68 2068 static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
jpayne@68 2069 #endif
jpayne@68 2070
jpayne@68 2071 /* IncludeStringH.proto */
jpayne@68 2072 #include <string.h>
jpayne@68 2073
jpayne@68 2074 /* BytesEquals.proto */
jpayne@68 2075 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
jpayne@68 2076
jpayne@68 2077 /* UnicodeEquals.proto */
jpayne@68 2078 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
jpayne@68 2079
jpayne@68 2080 /* fastcall.proto */
jpayne@68 2081 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 2082 #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
jpayne@68 2083 #elif CYTHON_ASSUME_SAFE_MACROS
jpayne@68 2084 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
jpayne@68 2085 #else
jpayne@68 2086 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
jpayne@68 2087 #endif
jpayne@68 2088 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 2089 #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
jpayne@68 2090 #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
jpayne@68 2091 #else
jpayne@68 2092 #define __Pyx_Arg_NewRef_VARARGS(arg) arg
jpayne@68 2093 #define __Pyx_Arg_XDECREF_VARARGS(arg)
jpayne@68 2094 #endif
jpayne@68 2095 #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
jpayne@68 2096 #define __Pyx_KwValues_VARARGS(args, nargs) NULL
jpayne@68 2097 #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
jpayne@68 2098 #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
jpayne@68 2099 #if CYTHON_METH_FASTCALL
jpayne@68 2100 #define __Pyx_Arg_FASTCALL(args, i) args[i]
jpayne@68 2101 #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
jpayne@68 2102 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
jpayne@68 2103 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
jpayne@68 2104 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
jpayne@68 2105 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
jpayne@68 2106 #else
jpayne@68 2107 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
jpayne@68 2108 #endif
jpayne@68 2109 #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
jpayne@68 2110 to have the same reference counting */
jpayne@68 2111 #define __Pyx_Arg_XDECREF_FASTCALL(arg)
jpayne@68 2112 #else
jpayne@68 2113 #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
jpayne@68 2114 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
jpayne@68 2115 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
jpayne@68 2116 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
jpayne@68 2117 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
jpayne@68 2118 #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
jpayne@68 2119 #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
jpayne@68 2120 #endif
jpayne@68 2121 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 2122 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
jpayne@68 2123 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
jpayne@68 2124 #else
jpayne@68 2125 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
jpayne@68 2126 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
jpayne@68 2127 #endif
jpayne@68 2128
jpayne@68 2129 /* Profile.proto */
jpayne@68 2130 #ifndef CYTHON_PROFILE
jpayne@68 2131 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
jpayne@68 2132 #define CYTHON_PROFILE 0
jpayne@68 2133 #else
jpayne@68 2134 #define CYTHON_PROFILE 1
jpayne@68 2135 #endif
jpayne@68 2136 #endif
jpayne@68 2137 #ifndef CYTHON_TRACE_NOGIL
jpayne@68 2138 #define CYTHON_TRACE_NOGIL 0
jpayne@68 2139 #else
jpayne@68 2140 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
jpayne@68 2141 #define CYTHON_TRACE 1
jpayne@68 2142 #endif
jpayne@68 2143 #endif
jpayne@68 2144 #ifndef CYTHON_TRACE
jpayne@68 2145 #define CYTHON_TRACE 0
jpayne@68 2146 #endif
jpayne@68 2147 #if CYTHON_TRACE
jpayne@68 2148 #undef CYTHON_PROFILE_REUSE_FRAME
jpayne@68 2149 #endif
jpayne@68 2150 #ifndef CYTHON_PROFILE_REUSE_FRAME
jpayne@68 2151 #define CYTHON_PROFILE_REUSE_FRAME 0
jpayne@68 2152 #endif
jpayne@68 2153 #if CYTHON_PROFILE || CYTHON_TRACE
jpayne@68 2154 #include "compile.h"
jpayne@68 2155 #include "frameobject.h"
jpayne@68 2156 #include "traceback.h"
jpayne@68 2157 #if PY_VERSION_HEX >= 0x030b00a6
jpayne@68 2158 #ifndef Py_BUILD_CORE
jpayne@68 2159 #define Py_BUILD_CORE 1
jpayne@68 2160 #endif
jpayne@68 2161 #include "internal/pycore_frame.h"
jpayne@68 2162 #endif
jpayne@68 2163 #if CYTHON_PROFILE_REUSE_FRAME
jpayne@68 2164 #define CYTHON_FRAME_MODIFIER static
jpayne@68 2165 #define CYTHON_FRAME_DEL(frame)
jpayne@68 2166 #else
jpayne@68 2167 #define CYTHON_FRAME_MODIFIER
jpayne@68 2168 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
jpayne@68 2169 #endif
jpayne@68 2170 #define __Pyx_TraceDeclarations\
jpayne@68 2171 static PyCodeObject *__pyx_frame_code = NULL;\
jpayne@68 2172 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
jpayne@68 2173 int __Pyx_use_tracing = 0;
jpayne@68 2174 #define __Pyx_TraceFrameInit(codeobj)\
jpayne@68 2175 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
jpayne@68 2176 #if PY_VERSION_HEX >= 0x030b00a2
jpayne@68 2177 #if PY_VERSION_HEX >= 0x030C00b1
jpayne@68 2178 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
jpayne@68 2179 ((!(check_tracing) || !(tstate)->tracing) &&\
jpayne@68 2180 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
jpayne@68 2181 #else
jpayne@68 2182 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
jpayne@68 2183 (unlikely((tstate)->cframe->use_tracing) &&\
jpayne@68 2184 (!(check_tracing) || !(tstate)->tracing) &&\
jpayne@68 2185 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
jpayne@68 2186 #endif
jpayne@68 2187 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
jpayne@68 2188 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
jpayne@68 2189 #elif PY_VERSION_HEX >= 0x030a00b1
jpayne@68 2190 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
jpayne@68 2191 (unlikely((tstate)->cframe->use_tracing) &&\
jpayne@68 2192 (!(check_tracing) || !(tstate)->tracing) &&\
jpayne@68 2193 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
jpayne@68 2194 #define __Pyx_EnterTracing(tstate)\
jpayne@68 2195 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
jpayne@68 2196 #define __Pyx_LeaveTracing(tstate)\
jpayne@68 2197 do {\
jpayne@68 2198 tstate->tracing--;\
jpayne@68 2199 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
jpayne@68 2200 || tstate->c_profilefunc != NULL);\
jpayne@68 2201 } while (0)
jpayne@68 2202 #else
jpayne@68 2203 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
jpayne@68 2204 (unlikely((tstate)->use_tracing) &&\
jpayne@68 2205 (!(check_tracing) || !(tstate)->tracing) &&\
jpayne@68 2206 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
jpayne@68 2207 #define __Pyx_EnterTracing(tstate)\
jpayne@68 2208 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
jpayne@68 2209 #define __Pyx_LeaveTracing(tstate)\
jpayne@68 2210 do {\
jpayne@68 2211 tstate->tracing--;\
jpayne@68 2212 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
jpayne@68 2213 || tstate->c_profilefunc != NULL);\
jpayne@68 2214 } while (0)
jpayne@68 2215 #endif
jpayne@68 2216 #ifdef WITH_THREAD
jpayne@68 2217 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
jpayne@68 2218 if (nogil) {\
jpayne@68 2219 if (CYTHON_TRACE_NOGIL) {\
jpayne@68 2220 PyThreadState *tstate;\
jpayne@68 2221 PyGILState_STATE state = PyGILState_Ensure();\
jpayne@68 2222 tstate = __Pyx_PyThreadState_Current;\
jpayne@68 2223 if (__Pyx_IsTracing(tstate, 1, 1)) {\
jpayne@68 2224 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
jpayne@68 2225 }\
jpayne@68 2226 PyGILState_Release(state);\
jpayne@68 2227 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
jpayne@68 2228 }\
jpayne@68 2229 } else {\
jpayne@68 2230 PyThreadState* tstate = PyThreadState_GET();\
jpayne@68 2231 if (__Pyx_IsTracing(tstate, 1, 1)) {\
jpayne@68 2232 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
jpayne@68 2233 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
jpayne@68 2234 }\
jpayne@68 2235 }
jpayne@68 2236 #else
jpayne@68 2237 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
jpayne@68 2238 { PyThreadState* tstate = PyThreadState_GET();\
jpayne@68 2239 if (__Pyx_IsTracing(tstate, 1, 1)) {\
jpayne@68 2240 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
jpayne@68 2241 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
jpayne@68 2242 }\
jpayne@68 2243 }
jpayne@68 2244 #endif
jpayne@68 2245 #define __Pyx_TraceException()\
jpayne@68 2246 if (likely(!__Pyx_use_tracing)); else {\
jpayne@68 2247 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
jpayne@68 2248 if (__Pyx_IsTracing(tstate, 0, 1)) {\
jpayne@68 2249 __Pyx_EnterTracing(tstate);\
jpayne@68 2250 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
jpayne@68 2251 if (exc_info) {\
jpayne@68 2252 if (CYTHON_TRACE && tstate->c_tracefunc)\
jpayne@68 2253 tstate->c_tracefunc(\
jpayne@68 2254 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
jpayne@68 2255 tstate->c_profilefunc(\
jpayne@68 2256 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
jpayne@68 2257 Py_DECREF(exc_info);\
jpayne@68 2258 }\
jpayne@68 2259 __Pyx_LeaveTracing(tstate);\
jpayne@68 2260 }\
jpayne@68 2261 }
jpayne@68 2262 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
jpayne@68 2263 PyObject *type, *value, *traceback;
jpayne@68 2264 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
jpayne@68 2265 __Pyx_EnterTracing(tstate);
jpayne@68 2266 if (CYTHON_TRACE && tstate->c_tracefunc)
jpayne@68 2267 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
jpayne@68 2268 if (tstate->c_profilefunc)
jpayne@68 2269 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
jpayne@68 2270 CYTHON_FRAME_DEL(frame);
jpayne@68 2271 __Pyx_LeaveTracing(tstate);
jpayne@68 2272 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
jpayne@68 2273 }
jpayne@68 2274 #ifdef WITH_THREAD
jpayne@68 2275 #define __Pyx_TraceReturn(result, nogil)\
jpayne@68 2276 if (likely(!__Pyx_use_tracing)); else {\
jpayne@68 2277 if (nogil) {\
jpayne@68 2278 if (CYTHON_TRACE_NOGIL) {\
jpayne@68 2279 PyThreadState *tstate;\
jpayne@68 2280 PyGILState_STATE state = PyGILState_Ensure();\
jpayne@68 2281 tstate = __Pyx_PyThreadState_Current;\
jpayne@68 2282 if (__Pyx_IsTracing(tstate, 0, 0)) {\
jpayne@68 2283 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
jpayne@68 2284 }\
jpayne@68 2285 PyGILState_Release(state);\
jpayne@68 2286 }\
jpayne@68 2287 } else {\
jpayne@68 2288 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
jpayne@68 2289 if (__Pyx_IsTracing(tstate, 0, 0)) {\
jpayne@68 2290 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
jpayne@68 2291 }\
jpayne@68 2292 }\
jpayne@68 2293 }
jpayne@68 2294 #else
jpayne@68 2295 #define __Pyx_TraceReturn(result, nogil)\
jpayne@68 2296 if (likely(!__Pyx_use_tracing)); else {\
jpayne@68 2297 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
jpayne@68 2298 if (__Pyx_IsTracing(tstate, 0, 0)) {\
jpayne@68 2299 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
jpayne@68 2300 }\
jpayne@68 2301 }
jpayne@68 2302 #endif
jpayne@68 2303 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
jpayne@68 2304 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
jpayne@68 2305 #else
jpayne@68 2306 #define __Pyx_TraceDeclarations
jpayne@68 2307 #define __Pyx_TraceFrameInit(codeobj)
jpayne@68 2308 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
jpayne@68 2309 #define __Pyx_TraceException()
jpayne@68 2310 #define __Pyx_TraceReturn(result, nogil)
jpayne@68 2311 #endif
jpayne@68 2312 #if CYTHON_TRACE
jpayne@68 2313 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
jpayne@68 2314 int ret;
jpayne@68 2315 PyObject *type, *value, *traceback;
jpayne@68 2316 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
jpayne@68 2317 __Pyx_PyFrame_SetLineNumber(frame, lineno);
jpayne@68 2318 __Pyx_EnterTracing(tstate);
jpayne@68 2319 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
jpayne@68 2320 __Pyx_LeaveTracing(tstate);
jpayne@68 2321 if (likely(!ret)) {
jpayne@68 2322 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
jpayne@68 2323 } else {
jpayne@68 2324 Py_XDECREF(type);
jpayne@68 2325 Py_XDECREF(value);
jpayne@68 2326 Py_XDECREF(traceback);
jpayne@68 2327 }
jpayne@68 2328 return ret;
jpayne@68 2329 }
jpayne@68 2330 #ifdef WITH_THREAD
jpayne@68 2331 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
jpayne@68 2332 if (likely(!__Pyx_use_tracing)); else {\
jpayne@68 2333 if (nogil) {\
jpayne@68 2334 if (CYTHON_TRACE_NOGIL) {\
jpayne@68 2335 int ret = 0;\
jpayne@68 2336 PyThreadState *tstate;\
jpayne@68 2337 PyGILState_STATE state = __Pyx_PyGILState_Ensure();\
jpayne@68 2338 tstate = __Pyx_PyThreadState_Current;\
jpayne@68 2339 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
jpayne@68 2340 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
jpayne@68 2341 }\
jpayne@68 2342 __Pyx_PyGILState_Release(state);\
jpayne@68 2343 if (unlikely(ret)) goto_error;\
jpayne@68 2344 }\
jpayne@68 2345 } else {\
jpayne@68 2346 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
jpayne@68 2347 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
jpayne@68 2348 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
jpayne@68 2349 if (unlikely(ret)) goto_error;\
jpayne@68 2350 }\
jpayne@68 2351 }\
jpayne@68 2352 }
jpayne@68 2353 #else
jpayne@68 2354 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
jpayne@68 2355 if (likely(!__Pyx_use_tracing)); else {\
jpayne@68 2356 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
jpayne@68 2357 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
jpayne@68 2358 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
jpayne@68 2359 if (unlikely(ret)) goto_error;\
jpayne@68 2360 }\
jpayne@68 2361 }
jpayne@68 2362 #endif
jpayne@68 2363 #else
jpayne@68 2364 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
jpayne@68 2365 #endif
jpayne@68 2366
jpayne@68 2367 /* RaiseDoubleKeywords.proto */
jpayne@68 2368 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
jpayne@68 2369
jpayne@68 2370 /* ParseKeywords.proto */
jpayne@68 2371 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
jpayne@68 2372 PyObject **argnames[],
jpayne@68 2373 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
jpayne@68 2374 const char* function_name);
jpayne@68 2375
jpayne@68 2376 /* RaiseArgTupleInvalid.proto */
jpayne@68 2377 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
jpayne@68 2378 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
jpayne@68 2379
jpayne@68 2380 /* PyFunctionFastCall.proto */
jpayne@68 2381 #if CYTHON_FAST_PYCALL
jpayne@68 2382 #if !CYTHON_VECTORCALL
jpayne@68 2383 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
jpayne@68 2384 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
jpayne@68 2385 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
jpayne@68 2386 #endif
jpayne@68 2387 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
jpayne@68 2388 (sizeof(char [1 - 2*!(cond)]) - 1)
jpayne@68 2389 #ifndef Py_MEMBER_SIZE
jpayne@68 2390 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
jpayne@68 2391 #endif
jpayne@68 2392 #if !CYTHON_VECTORCALL
jpayne@68 2393 #if PY_VERSION_HEX >= 0x03080000
jpayne@68 2394 #include "frameobject.h"
jpayne@68 2395 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2396 #ifndef Py_BUILD_CORE
jpayne@68 2397 #define Py_BUILD_CORE 1
jpayne@68 2398 #endif
jpayne@68 2399 #include "internal/pycore_frame.h"
jpayne@68 2400 #endif
jpayne@68 2401 #define __Pxy_PyFrame_Initialize_Offsets()
jpayne@68 2402 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
jpayne@68 2403 #else
jpayne@68 2404 static size_t __pyx_pyframe_localsplus_offset = 0;
jpayne@68 2405 #include "frameobject.h"
jpayne@68 2406 #define __Pxy_PyFrame_Initialize_Offsets()\
jpayne@68 2407 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
jpayne@68 2408 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
jpayne@68 2409 #define __Pyx_PyFrame_GetLocalsplus(frame)\
jpayne@68 2410 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
jpayne@68 2411 #endif
jpayne@68 2412 #endif
jpayne@68 2413 #endif
jpayne@68 2414
jpayne@68 2415 /* PyObjectCall.proto */
jpayne@68 2416 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 2417 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
jpayne@68 2418 #else
jpayne@68 2419 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
jpayne@68 2420 #endif
jpayne@68 2421
jpayne@68 2422 /* PyObjectCallMethO.proto */
jpayne@68 2423 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 2424 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
jpayne@68 2425 #endif
jpayne@68 2426
jpayne@68 2427 /* PyObjectFastCall.proto */
jpayne@68 2428 #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
jpayne@68 2429 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
jpayne@68 2430
jpayne@68 2431 /* WriteUnraisableException.proto */
jpayne@68 2432 static void __Pyx_WriteUnraisable(const char *name, int clineno,
jpayne@68 2433 int lineno, const char *filename,
jpayne@68 2434 int full_traceback, int nogil);
jpayne@68 2435
jpayne@68 2436 /* RaiseException.proto */
jpayne@68 2437 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
jpayne@68 2438
jpayne@68 2439 /* KeywordStringCheck.proto */
jpayne@68 2440 static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
jpayne@68 2441
jpayne@68 2442 /* PySequenceContains.proto */
jpayne@68 2443 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
jpayne@68 2444 int result = PySequence_Contains(seq, item);
jpayne@68 2445 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
jpayne@68 2446 }
jpayne@68 2447
jpayne@68 2448 /* ListAppend.proto */
jpayne@68 2449 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
jpayne@68 2450 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
jpayne@68 2451 PyListObject* L = (PyListObject*) list;
jpayne@68 2452 Py_ssize_t len = Py_SIZE(list);
jpayne@68 2453 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
jpayne@68 2454 Py_INCREF(x);
jpayne@68 2455 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
jpayne@68 2456 L->ob_item[len] = x;
jpayne@68 2457 #else
jpayne@68 2458 PyList_SET_ITEM(list, len, x);
jpayne@68 2459 #endif
jpayne@68 2460 __Pyx_SET_SIZE(list, len + 1);
jpayne@68 2461 return 0;
jpayne@68 2462 }
jpayne@68 2463 return PyList_Append(list, x);
jpayne@68 2464 }
jpayne@68 2465 #else
jpayne@68 2466 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
jpayne@68 2467 #endif
jpayne@68 2468
jpayne@68 2469 /* PyObjectCall2Args.proto */
jpayne@68 2470 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
jpayne@68 2471
jpayne@68 2472 /* PyObjectCallOneArg.proto */
jpayne@68 2473 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
jpayne@68 2474
jpayne@68 2475 /* PyObjectGetMethod.proto */
jpayne@68 2476 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
jpayne@68 2477
jpayne@68 2478 /* PyObjectCallMethod1.proto */
jpayne@68 2479 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
jpayne@68 2480
jpayne@68 2481 /* StringJoin.proto */
jpayne@68 2482 #if PY_MAJOR_VERSION < 3
jpayne@68 2483 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
jpayne@68 2484 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
jpayne@68 2485 #else
jpayne@68 2486 #define __Pyx_PyString_Join PyUnicode_Join
jpayne@68 2487 #define __Pyx_PyBaseString_Join PyUnicode_Join
jpayne@68 2488 #endif
jpayne@68 2489 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
jpayne@68 2490
jpayne@68 2491 /* PyObjectCallNoArg.proto */
jpayne@68 2492 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
jpayne@68 2493
jpayne@68 2494 /* ArgTypeTest.proto */
jpayne@68 2495 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
jpayne@68 2496 ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
jpayne@68 2497 __Pyx__ArgTypeTest(obj, type, name, exact))
jpayne@68 2498 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
jpayne@68 2499
jpayne@68 2500 /* PyObjectSetAttrStr.proto */
jpayne@68 2501 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 2502 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
jpayne@68 2503 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
jpayne@68 2504 #else
jpayne@68 2505 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
jpayne@68 2506 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
jpayne@68 2507 #endif
jpayne@68 2508
jpayne@68 2509 /* PyObjectFormatSimple.proto */
jpayne@68 2510 #if CYTHON_COMPILING_IN_PYPY
jpayne@68 2511 #define __Pyx_PyObject_FormatSimple(s, f) (\
jpayne@68 2512 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
jpayne@68 2513 PyObject_Format(s, f))
jpayne@68 2514 #elif PY_MAJOR_VERSION < 3
jpayne@68 2515 #define __Pyx_PyObject_FormatSimple(s, f) (\
jpayne@68 2516 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
jpayne@68 2517 likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
jpayne@68 2518 PyObject_Format(s, f))
jpayne@68 2519 #elif CYTHON_USE_TYPE_SLOTS
jpayne@68 2520 #define __Pyx_PyObject_FormatSimple(s, f) (\
jpayne@68 2521 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
jpayne@68 2522 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
jpayne@68 2523 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
jpayne@68 2524 PyObject_Format(s, f))
jpayne@68 2525 #else
jpayne@68 2526 #define __Pyx_PyObject_FormatSimple(s, f) (\
jpayne@68 2527 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
jpayne@68 2528 PyObject_Format(s, f))
jpayne@68 2529 #endif
jpayne@68 2530
jpayne@68 2531 /* JoinPyUnicode.proto */
jpayne@68 2532 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
jpayne@68 2533 Py_UCS4 max_char);
jpayne@68 2534
jpayne@68 2535 /* PyDictVersioning.proto */
jpayne@68 2536 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
jpayne@68 2537 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
jpayne@68 2538 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
jpayne@68 2539 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
jpayne@68 2540 (version_var) = __PYX_GET_DICT_VERSION(dict);\
jpayne@68 2541 (cache_var) = (value);
jpayne@68 2542 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
jpayne@68 2543 static PY_UINT64_T __pyx_dict_version = 0;\
jpayne@68 2544 static PyObject *__pyx_dict_cached_value = NULL;\
jpayne@68 2545 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
jpayne@68 2546 (VAR) = __pyx_dict_cached_value;\
jpayne@68 2547 } else {\
jpayne@68 2548 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
jpayne@68 2549 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
jpayne@68 2550 }\
jpayne@68 2551 }
jpayne@68 2552 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
jpayne@68 2553 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
jpayne@68 2554 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
jpayne@68 2555 #else
jpayne@68 2556 #define __PYX_GET_DICT_VERSION(dict) (0)
jpayne@68 2557 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
jpayne@68 2558 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
jpayne@68 2559 #endif
jpayne@68 2560
jpayne@68 2561 /* GetModuleGlobalName.proto */
jpayne@68 2562 #if CYTHON_USE_DICT_VERSIONS
jpayne@68 2563 #define __Pyx_GetModuleGlobalName(var, name) do {\
jpayne@68 2564 static PY_UINT64_T __pyx_dict_version = 0;\
jpayne@68 2565 static PyObject *__pyx_dict_cached_value = NULL;\
jpayne@68 2566 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
jpayne@68 2567 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
jpayne@68 2568 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
jpayne@68 2569 } while(0)
jpayne@68 2570 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
jpayne@68 2571 PY_UINT64_T __pyx_dict_version;\
jpayne@68 2572 PyObject *__pyx_dict_cached_value;\
jpayne@68 2573 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
jpayne@68 2574 } while(0)
jpayne@68 2575 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
jpayne@68 2576 #else
jpayne@68 2577 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
jpayne@68 2578 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
jpayne@68 2579 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
jpayne@68 2580 #endif
jpayne@68 2581
jpayne@68 2582 /* GetItemInt.proto */
jpayne@68 2583 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
jpayne@68 2584 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
jpayne@68 2585 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
jpayne@68 2586 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
jpayne@68 2587 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
jpayne@68 2588 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
jpayne@68 2589 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
jpayne@68 2590 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
jpayne@68 2591 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
jpayne@68 2592 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
jpayne@68 2593 int wraparound, int boundscheck);
jpayne@68 2594 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
jpayne@68 2595 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
jpayne@68 2596 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
jpayne@68 2597 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
jpayne@68 2598 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
jpayne@68 2599 int wraparound, int boundscheck);
jpayne@68 2600 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
jpayne@68 2601 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
jpayne@68 2602 int is_list, int wraparound, int boundscheck);
jpayne@68 2603
jpayne@68 2604 /* ObjectGetItem.proto */
jpayne@68 2605 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 2606 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
jpayne@68 2607 #else
jpayne@68 2608 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
jpayne@68 2609 #endif
jpayne@68 2610
jpayne@68 2611 /* GetException.proto */
jpayne@68 2612 #if CYTHON_FAST_THREAD_STATE
jpayne@68 2613 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
jpayne@68 2614 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
jpayne@68 2615 #else
jpayne@68 2616 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
jpayne@68 2617 #endif
jpayne@68 2618
jpayne@68 2619 /* SwapException.proto */
jpayne@68 2620 #if CYTHON_FAST_THREAD_STATE
jpayne@68 2621 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
jpayne@68 2622 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
jpayne@68 2623 #else
jpayne@68 2624 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
jpayne@68 2625 #endif
jpayne@68 2626
jpayne@68 2627 /* GetTopmostException.proto */
jpayne@68 2628 #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
jpayne@68 2629 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
jpayne@68 2630 #endif
jpayne@68 2631
jpayne@68 2632 /* SaveResetException.proto */
jpayne@68 2633 #if CYTHON_FAST_THREAD_STATE
jpayne@68 2634 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
jpayne@68 2635 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
jpayne@68 2636 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
jpayne@68 2637 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
jpayne@68 2638 #else
jpayne@68 2639 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
jpayne@68 2640 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
jpayne@68 2641 #endif
jpayne@68 2642
jpayne@68 2643 /* PyIntBinop.proto */
jpayne@68 2644 #if !CYTHON_COMPILING_IN_PYPY
jpayne@68 2645 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
jpayne@68 2646 #else
jpayne@68 2647 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
jpayne@68 2648 (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
jpayne@68 2649 #endif
jpayne@68 2650
jpayne@68 2651 /* PyObject_Unicode.proto */
jpayne@68 2652 #if PY_MAJOR_VERSION >= 3
jpayne@68 2653 #define __Pyx_PyObject_Unicode(obj)\
jpayne@68 2654 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
jpayne@68 2655 #else
jpayne@68 2656 #define __Pyx_PyObject_Unicode(obj)\
jpayne@68 2657 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
jpayne@68 2658 #endif
jpayne@68 2659
jpayne@68 2660 /* RaiseTooManyValuesToUnpack.proto */
jpayne@68 2661 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
jpayne@68 2662
jpayne@68 2663 /* RaiseNeedMoreValuesToUnpack.proto */
jpayne@68 2664 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
jpayne@68 2665
jpayne@68 2666 /* IterFinish.proto */
jpayne@68 2667 static CYTHON_INLINE int __Pyx_IterFinish(void);
jpayne@68 2668
jpayne@68 2669 /* UnpackItemEndCheck.proto */
jpayne@68 2670 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
jpayne@68 2671
jpayne@68 2672 /* PyIntCompare.proto */
jpayne@68 2673 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
jpayne@68 2674
jpayne@68 2675 /* IncludeStructmemberH.proto */
jpayne@68 2676 #include <structmember.h>
jpayne@68 2677
jpayne@68 2678 /* FixUpExtensionType.proto */
jpayne@68 2679 #if CYTHON_USE_TYPE_SPECS
jpayne@68 2680 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
jpayne@68 2681 #endif
jpayne@68 2682
jpayne@68 2683 /* PyObjectCallMethod0.proto */
jpayne@68 2684 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
jpayne@68 2685
jpayne@68 2686 /* ValidateBasesTuple.proto */
jpayne@68 2687 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
jpayne@68 2688 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
jpayne@68 2689 #endif
jpayne@68 2690
jpayne@68 2691 /* PyType_Ready.proto */
jpayne@68 2692 CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
jpayne@68 2693
jpayne@68 2694 /* PyObject_GenericGetAttrNoDict.proto */
jpayne@68 2695 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
jpayne@68 2696 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
jpayne@68 2697 #else
jpayne@68 2698 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
jpayne@68 2699 #endif
jpayne@68 2700
jpayne@68 2701 /* PyObject_GenericGetAttr.proto */
jpayne@68 2702 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
jpayne@68 2703 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
jpayne@68 2704 #else
jpayne@68 2705 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
jpayne@68 2706 #endif
jpayne@68 2707
jpayne@68 2708 /* SetVTable.proto */
jpayne@68 2709 static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
jpayne@68 2710
jpayne@68 2711 /* GetVTable.proto */
jpayne@68 2712 static void* __Pyx_GetVtable(PyTypeObject *type);
jpayne@68 2713
jpayne@68 2714 /* MergeVTables.proto */
jpayne@68 2715 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2716 static int __Pyx_MergeVtables(PyTypeObject *type);
jpayne@68 2717 #endif
jpayne@68 2718
jpayne@68 2719 /* SetupReduce.proto */
jpayne@68 2720 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2721 static int __Pyx_setup_reduce(PyObject* type_obj);
jpayne@68 2722 #endif
jpayne@68 2723
jpayne@68 2724 /* TypeImport.proto */
jpayne@68 2725 #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
jpayne@68 2726 #define __PYX_HAVE_RT_ImportType_proto_3_0_11
jpayne@68 2727 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
jpayne@68 2728 #include <stdalign.h>
jpayne@68 2729 #endif
jpayne@68 2730 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
jpayne@68 2731 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
jpayne@68 2732 #else
jpayne@68 2733 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
jpayne@68 2734 #endif
jpayne@68 2735 enum __Pyx_ImportType_CheckSize_3_0_11 {
jpayne@68 2736 __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
jpayne@68 2737 __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
jpayne@68 2738 __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
jpayne@68 2739 };
jpayne@68 2740 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
jpayne@68 2741 #endif
jpayne@68 2742
jpayne@68 2743 /* Import.proto */
jpayne@68 2744 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
jpayne@68 2745
jpayne@68 2746 /* ImportDottedModule.proto */
jpayne@68 2747 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
jpayne@68 2748 #if PY_MAJOR_VERSION >= 3
jpayne@68 2749 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
jpayne@68 2750 #endif
jpayne@68 2751
jpayne@68 2752 /* ImportFrom.proto */
jpayne@68 2753 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
jpayne@68 2754
jpayne@68 2755 /* FetchSharedCythonModule.proto */
jpayne@68 2756 static PyObject *__Pyx_FetchSharedCythonABIModule(void);
jpayne@68 2757
jpayne@68 2758 /* FetchCommonType.proto */
jpayne@68 2759 #if !CYTHON_USE_TYPE_SPECS
jpayne@68 2760 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
jpayne@68 2761 #else
jpayne@68 2762 static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
jpayne@68 2763 #endif
jpayne@68 2764
jpayne@68 2765 /* PyMethodNew.proto */
jpayne@68 2766 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2767 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
jpayne@68 2768 PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
jpayne@68 2769 CYTHON_UNUSED_VAR(typ);
jpayne@68 2770 if (!self)
jpayne@68 2771 return __Pyx_NewRef(func);
jpayne@68 2772 typesModule = PyImport_ImportModule("types");
jpayne@68 2773 if (!typesModule) return NULL;
jpayne@68 2774 methodType = PyObject_GetAttrString(typesModule, "MethodType");
jpayne@68 2775 Py_DECREF(typesModule);
jpayne@68 2776 if (!methodType) return NULL;
jpayne@68 2777 result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
jpayne@68 2778 Py_DECREF(methodType);
jpayne@68 2779 return result;
jpayne@68 2780 }
jpayne@68 2781 #elif PY_MAJOR_VERSION >= 3
jpayne@68 2782 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
jpayne@68 2783 CYTHON_UNUSED_VAR(typ);
jpayne@68 2784 if (!self)
jpayne@68 2785 return __Pyx_NewRef(func);
jpayne@68 2786 return PyMethod_New(func, self);
jpayne@68 2787 }
jpayne@68 2788 #else
jpayne@68 2789 #define __Pyx_PyMethod_New PyMethod_New
jpayne@68 2790 #endif
jpayne@68 2791
jpayne@68 2792 /* PyVectorcallFastCallDict.proto */
jpayne@68 2793 #if CYTHON_METH_FASTCALL
jpayne@68 2794 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
jpayne@68 2795 #endif
jpayne@68 2796
jpayne@68 2797 /* CythonFunctionShared.proto */
jpayne@68 2798 #define __Pyx_CyFunction_USED
jpayne@68 2799 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
jpayne@68 2800 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
jpayne@68 2801 #define __Pyx_CYFUNCTION_CCLASS 0x04
jpayne@68 2802 #define __Pyx_CYFUNCTION_COROUTINE 0x08
jpayne@68 2803 #define __Pyx_CyFunction_GetClosure(f)\
jpayne@68 2804 (((__pyx_CyFunctionObject *) (f))->func_closure)
jpayne@68 2805 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2806 #define __Pyx_CyFunction_GetClassObj(f)\
jpayne@68 2807 (((__pyx_CyFunctionObject *) (f))->func_classobj)
jpayne@68 2808 #else
jpayne@68 2809 #define __Pyx_CyFunction_GetClassObj(f)\
jpayne@68 2810 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
jpayne@68 2811 #endif
jpayne@68 2812 #define __Pyx_CyFunction_SetClassObj(f, classobj)\
jpayne@68 2813 __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
jpayne@68 2814 #define __Pyx_CyFunction_Defaults(type, f)\
jpayne@68 2815 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
jpayne@68 2816 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
jpayne@68 2817 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
jpayne@68 2818 typedef struct {
jpayne@68 2819 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2820 PyObject_HEAD
jpayne@68 2821 PyObject *func;
jpayne@68 2822 #elif PY_VERSION_HEX < 0x030900B1
jpayne@68 2823 PyCFunctionObject func;
jpayne@68 2824 #else
jpayne@68 2825 PyCMethodObject func;
jpayne@68 2826 #endif
jpayne@68 2827 #if CYTHON_BACKPORT_VECTORCALL
jpayne@68 2828 __pyx_vectorcallfunc func_vectorcall;
jpayne@68 2829 #endif
jpayne@68 2830 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2831 PyObject *func_weakreflist;
jpayne@68 2832 #endif
jpayne@68 2833 PyObject *func_dict;
jpayne@68 2834 PyObject *func_name;
jpayne@68 2835 PyObject *func_qualname;
jpayne@68 2836 PyObject *func_doc;
jpayne@68 2837 PyObject *func_globals;
jpayne@68 2838 PyObject *func_code;
jpayne@68 2839 PyObject *func_closure;
jpayne@68 2840 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2841 PyObject *func_classobj;
jpayne@68 2842 #endif
jpayne@68 2843 void *defaults;
jpayne@68 2844 int defaults_pyobjects;
jpayne@68 2845 size_t defaults_size;
jpayne@68 2846 int flags;
jpayne@68 2847 PyObject *defaults_tuple;
jpayne@68 2848 PyObject *defaults_kwdict;
jpayne@68 2849 PyObject *(*defaults_getter)(PyObject *);
jpayne@68 2850 PyObject *func_annotations;
jpayne@68 2851 PyObject *func_is_coroutine;
jpayne@68 2852 } __pyx_CyFunctionObject;
jpayne@68 2853 #undef __Pyx_CyOrPyCFunction_Check
jpayne@68 2854 #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
jpayne@68 2855 #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
jpayne@68 2856 #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
jpayne@68 2857 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
jpayne@68 2858 #undef __Pyx_IsSameCFunction
jpayne@68 2859 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
jpayne@68 2860 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
jpayne@68 2861 int flags, PyObject* qualname,
jpayne@68 2862 PyObject *closure,
jpayne@68 2863 PyObject *module, PyObject *globals,
jpayne@68 2864 PyObject* code);
jpayne@68 2865 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
jpayne@68 2866 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
jpayne@68 2867 size_t size,
jpayne@68 2868 int pyobjects);
jpayne@68 2869 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
jpayne@68 2870 PyObject *tuple);
jpayne@68 2871 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
jpayne@68 2872 PyObject *dict);
jpayne@68 2873 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
jpayne@68 2874 PyObject *dict);
jpayne@68 2875 static int __pyx_CyFunction_init(PyObject *module);
jpayne@68 2876 #if CYTHON_METH_FASTCALL
jpayne@68 2877 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
jpayne@68 2878 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
jpayne@68 2879 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
jpayne@68 2880 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
jpayne@68 2881 #if CYTHON_BACKPORT_VECTORCALL
jpayne@68 2882 #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
jpayne@68 2883 #else
jpayne@68 2884 #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
jpayne@68 2885 #endif
jpayne@68 2886 #endif
jpayne@68 2887
jpayne@68 2888 /* CythonFunction.proto */
jpayne@68 2889 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
jpayne@68 2890 int flags, PyObject* qualname,
jpayne@68 2891 PyObject *closure,
jpayne@68 2892 PyObject *module, PyObject *globals,
jpayne@68 2893 PyObject* code);
jpayne@68 2894
jpayne@68 2895 /* Py3UpdateBases.proto */
jpayne@68 2896 static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
jpayne@68 2897
jpayne@68 2898 /* CalculateMetaclass.proto */
jpayne@68 2899 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
jpayne@68 2900
jpayne@68 2901 /* SetNameInClass.proto */
jpayne@68 2902 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
jpayne@68 2903 #define __Pyx_SetNameInClass(ns, name, value)\
jpayne@68 2904 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
jpayne@68 2905 #elif CYTHON_COMPILING_IN_CPYTHON
jpayne@68 2906 #define __Pyx_SetNameInClass(ns, name, value)\
jpayne@68 2907 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
jpayne@68 2908 #else
jpayne@68 2909 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
jpayne@68 2910 #endif
jpayne@68 2911
jpayne@68 2912 /* PyObjectLookupSpecial.proto */
jpayne@68 2913 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
jpayne@68 2914 #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
jpayne@68 2915 #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
jpayne@68 2916 static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
jpayne@68 2917 #else
jpayne@68 2918 #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
jpayne@68 2919 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
jpayne@68 2920 #endif
jpayne@68 2921
jpayne@68 2922 /* Py3ClassCreate.proto */
jpayne@68 2923 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
jpayne@68 2924 PyObject *mkw, PyObject *modname, PyObject *doc);
jpayne@68 2925 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
jpayne@68 2926 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
jpayne@68 2927
jpayne@68 2928 /* CLineInTraceback.proto */
jpayne@68 2929 #ifdef CYTHON_CLINE_IN_TRACEBACK
jpayne@68 2930 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
jpayne@68 2931 #else
jpayne@68 2932 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
jpayne@68 2933 #endif
jpayne@68 2934
jpayne@68 2935 /* CodeObjectCache.proto */
jpayne@68 2936 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 2937 typedef struct {
jpayne@68 2938 PyCodeObject* code_object;
jpayne@68 2939 int code_line;
jpayne@68 2940 } __Pyx_CodeObjectCacheEntry;
jpayne@68 2941 struct __Pyx_CodeObjectCache {
jpayne@68 2942 int count;
jpayne@68 2943 int max_count;
jpayne@68 2944 __Pyx_CodeObjectCacheEntry* entries;
jpayne@68 2945 };
jpayne@68 2946 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
jpayne@68 2947 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
jpayne@68 2948 static PyCodeObject *__pyx_find_code_object(int code_line);
jpayne@68 2949 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
jpayne@68 2950 #endif
jpayne@68 2951
jpayne@68 2952 /* AddTraceback.proto */
jpayne@68 2953 static void __Pyx_AddTraceback(const char *funcname, int c_line,
jpayne@68 2954 int py_line, const char *filename);
jpayne@68 2955
jpayne@68 2956 /* GCCDiagnostics.proto */
jpayne@68 2957 #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
jpayne@68 2958 #define __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 2959 #endif
jpayne@68 2960
jpayne@68 2961 /* ArrayAPI.proto */
jpayne@68 2962 #ifndef _ARRAYARRAY_H
jpayne@68 2963 #define _ARRAYARRAY_H
jpayne@68 2964 typedef struct arraydescr {
jpayne@68 2965 int typecode;
jpayne@68 2966 int itemsize;
jpayne@68 2967 PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
jpayne@68 2968 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
jpayne@68 2969 #if PY_MAJOR_VERSION >= 3
jpayne@68 2970 char *formats;
jpayne@68 2971 #endif
jpayne@68 2972 } arraydescr;
jpayne@68 2973 struct arrayobject {
jpayne@68 2974 PyObject_HEAD
jpayne@68 2975 Py_ssize_t ob_size;
jpayne@68 2976 union {
jpayne@68 2977 char *ob_item;
jpayne@68 2978 float *as_floats;
jpayne@68 2979 double *as_doubles;
jpayne@68 2980 int *as_ints;
jpayne@68 2981 unsigned int *as_uints;
jpayne@68 2982 unsigned char *as_uchars;
jpayne@68 2983 signed char *as_schars;
jpayne@68 2984 char *as_chars;
jpayne@68 2985 unsigned long *as_ulongs;
jpayne@68 2986 long *as_longs;
jpayne@68 2987 #if PY_MAJOR_VERSION >= 3
jpayne@68 2988 unsigned long long *as_ulonglongs;
jpayne@68 2989 long long *as_longlongs;
jpayne@68 2990 #endif
jpayne@68 2991 short *as_shorts;
jpayne@68 2992 unsigned short *as_ushorts;
jpayne@68 2993 Py_UNICODE *as_pyunicodes;
jpayne@68 2994 void *as_voidptr;
jpayne@68 2995 } data;
jpayne@68 2996 Py_ssize_t allocated;
jpayne@68 2997 struct arraydescr *ob_descr;
jpayne@68 2998 PyObject *weakreflist;
jpayne@68 2999 #if PY_MAJOR_VERSION >= 3
jpayne@68 3000 int ob_exports;
jpayne@68 3001 #endif
jpayne@68 3002 };
jpayne@68 3003 #ifndef NO_NEWARRAY_INLINE
jpayne@68 3004 static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
jpayne@68 3005 struct arraydescr *descr) {
jpayne@68 3006 arrayobject *op;
jpayne@68 3007 size_t nbytes;
jpayne@68 3008 if (size < 0) {
jpayne@68 3009 PyErr_BadInternalCall();
jpayne@68 3010 return NULL;
jpayne@68 3011 }
jpayne@68 3012 nbytes = size * descr->itemsize;
jpayne@68 3013 if (nbytes / descr->itemsize != (size_t)size) {
jpayne@68 3014 return PyErr_NoMemory();
jpayne@68 3015 }
jpayne@68 3016 op = (arrayobject *) type->tp_alloc(type, 0);
jpayne@68 3017 if (op == NULL) {
jpayne@68 3018 return NULL;
jpayne@68 3019 }
jpayne@68 3020 op->ob_descr = descr;
jpayne@68 3021 op->allocated = size;
jpayne@68 3022 op->weakreflist = NULL;
jpayne@68 3023 __Pyx_SET_SIZE(op, size);
jpayne@68 3024 if (size <= 0) {
jpayne@68 3025 op->data.ob_item = NULL;
jpayne@68 3026 }
jpayne@68 3027 else {
jpayne@68 3028 op->data.ob_item = PyMem_NEW(char, nbytes);
jpayne@68 3029 if (op->data.ob_item == NULL) {
jpayne@68 3030 Py_DECREF(op);
jpayne@68 3031 return PyErr_NoMemory();
jpayne@68 3032 }
jpayne@68 3033 }
jpayne@68 3034 return (PyObject *) op;
jpayne@68 3035 }
jpayne@68 3036 #else
jpayne@68 3037 PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
jpayne@68 3038 struct arraydescr *descr);
jpayne@68 3039 #endif
jpayne@68 3040 static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
jpayne@68 3041 void *items = (void*) self->data.ob_item;
jpayne@68 3042 PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
jpayne@68 3043 if (items == NULL) {
jpayne@68 3044 PyErr_NoMemory();
jpayne@68 3045 return -1;
jpayne@68 3046 }
jpayne@68 3047 self->data.ob_item = (char*) items;
jpayne@68 3048 __Pyx_SET_SIZE(self, n);
jpayne@68 3049 self->allocated = n;
jpayne@68 3050 return 0;
jpayne@68 3051 }
jpayne@68 3052 static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
jpayne@68 3053 void *items = (void*) self->data.ob_item;
jpayne@68 3054 Py_ssize_t newsize;
jpayne@68 3055 if (n < self->allocated && n*4 > self->allocated) {
jpayne@68 3056 __Pyx_SET_SIZE(self, n);
jpayne@68 3057 return 0;
jpayne@68 3058 }
jpayne@68 3059 newsize = n + (n / 2) + 1;
jpayne@68 3060 if (newsize <= n) {
jpayne@68 3061 PyErr_NoMemory();
jpayne@68 3062 return -1;
jpayne@68 3063 }
jpayne@68 3064 PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
jpayne@68 3065 if (items == NULL) {
jpayne@68 3066 PyErr_NoMemory();
jpayne@68 3067 return -1;
jpayne@68 3068 }
jpayne@68 3069 self->data.ob_item = (char*) items;
jpayne@68 3070 __Pyx_SET_SIZE(self, n);
jpayne@68 3071 self->allocated = newsize;
jpayne@68 3072 return 0;
jpayne@68 3073 }
jpayne@68 3074 #endif
jpayne@68 3075
jpayne@68 3076 /* CIntFromPy.proto */
jpayne@68 3077 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
jpayne@68 3078
jpayne@68 3079 /* CIntToPy.proto */
jpayne@68 3080 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
jpayne@68 3081
jpayne@68 3082 /* CIntFromPy.proto */
jpayne@68 3083 static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);
jpayne@68 3084
jpayne@68 3085 /* CIntToPy.proto */
jpayne@68 3086 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_off_t(off_t value);
jpayne@68 3087
jpayne@68 3088 /* CIntToPy.proto */
jpayne@68 3089 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__htsFormatCategory(enum htsFormatCategory value);
jpayne@68 3090
jpayne@68 3091 /* CIntToPy.proto */
jpayne@68 3092 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__htsExactFormat(enum htsExactFormat value);
jpayne@68 3093
jpayne@68 3094 /* CIntToPy.proto */
jpayne@68 3095 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value);
jpayne@68 3096
jpayne@68 3097 /* CIntToPy.proto */
jpayne@68 3098 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__htsCompression(enum htsCompression value);
jpayne@68 3099
jpayne@68 3100 /* CIntToPy.proto */
jpayne@68 3101 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);
jpayne@68 3102
jpayne@68 3103 /* CIntFromPy.proto */
jpayne@68 3104 static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *);
jpayne@68 3105
jpayne@68 3106 /* CIntToPy.proto */
jpayne@68 3107 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
jpayne@68 3108
jpayne@68 3109 /* CIntToPy.proto */
jpayne@68 3110 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);
jpayne@68 3111
jpayne@68 3112 /* FormatTypeName.proto */
jpayne@68 3113 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 3114 typedef PyObject *__Pyx_TypeName;
jpayne@68 3115 #define __Pyx_FMT_TYPENAME "%U"
jpayne@68 3116 static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
jpayne@68 3117 #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
jpayne@68 3118 #else
jpayne@68 3119 typedef const char *__Pyx_TypeName;
jpayne@68 3120 #define __Pyx_FMT_TYPENAME "%.200s"
jpayne@68 3121 #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
jpayne@68 3122 #define __Pyx_DECREF_TypeName(obj)
jpayne@68 3123 #endif
jpayne@68 3124
jpayne@68 3125 /* CIntFromPy.proto */
jpayne@68 3126 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
jpayne@68 3127
jpayne@68 3128 /* FastTypeChecks.proto */
jpayne@68 3129 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 3130 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
jpayne@68 3131 #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
jpayne@68 3132 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
jpayne@68 3133 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
jpayne@68 3134 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
jpayne@68 3135 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
jpayne@68 3136 #else
jpayne@68 3137 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
jpayne@68 3138 #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
jpayne@68 3139 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
jpayne@68 3140 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
jpayne@68 3141 #endif
jpayne@68 3142 #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
jpayne@68 3143 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
jpayne@68 3144
jpayne@68 3145 /* CheckBinaryVersion.proto */
jpayne@68 3146 static unsigned long __Pyx_get_runtime_version(void);
jpayne@68 3147 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
jpayne@68 3148
jpayne@68 3149 /* FunctionImport.proto */
jpayne@68 3150 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
jpayne@68 3151
jpayne@68 3152 /* InitStrings.proto */
jpayne@68 3153 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
jpayne@68 3154
jpayne@68 3155 /* #### Code section: module_declarations ### */
jpayne@68 3156 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
jpayne@68 3157 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
jpayne@68 3158 static PyObject *__pyx_f_5pysam_10libchtslib_5HFile__open(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, struct __pyx_opt_args_5pysam_10libchtslib_5HFile__open *__pyx_optional_args); /* proto*/
jpayne@68 3159 static htsFile *__pyx_f_5pysam_10libchtslib_7HTSFile__open_htsfile(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto*/
jpayne@68 3160
jpayne@68 3161 /* Module declarations from "libc.stdint" */
jpayne@68 3162
jpayne@68 3163 /* Module declarations from "libc.string" */
jpayne@68 3164
jpayne@68 3165 /* Module declarations from "libc.stdlib" */
jpayne@68 3166
jpayne@68 3167 /* Module declarations from "libc.stdio" */
jpayne@68 3168
jpayne@68 3169 /* Module declarations from "posix.types" */
jpayne@68 3170
jpayne@68 3171 /* Module declarations from "posix.unistd" */
jpayne@68 3172
jpayne@68 3173 /* Module declarations from "libc.errno" */
jpayne@68 3174
jpayne@68 3175 /* Module declarations from "cpython.version" */
jpayne@68 3176
jpayne@68 3177 /* Module declarations from "__builtin__" */
jpayne@68 3178
jpayne@68 3179 /* Module declarations from "cpython.type" */
jpayne@68 3180
jpayne@68 3181 /* Module declarations from "cpython.object" */
jpayne@68 3182
jpayne@68 3183 /* Module declarations from "cpython.ref" */
jpayne@68 3184
jpayne@68 3185 /* Module declarations from "cpython.exc" */
jpayne@68 3186
jpayne@68 3187 /* Module declarations from "cpython.module" */
jpayne@68 3188
jpayne@68 3189 /* Module declarations from "cpython.mem" */
jpayne@68 3190
jpayne@68 3191 /* Module declarations from "cpython.tuple" */
jpayne@68 3192
jpayne@68 3193 /* Module declarations from "cpython.list" */
jpayne@68 3194
jpayne@68 3195 /* Module declarations from "cpython.sequence" */
jpayne@68 3196
jpayne@68 3197 /* Module declarations from "cpython.mapping" */
jpayne@68 3198
jpayne@68 3199 /* Module declarations from "cpython.iterator" */
jpayne@68 3200
jpayne@68 3201 /* Module declarations from "cpython.number" */
jpayne@68 3202
jpayne@68 3203 /* Module declarations from "cpython.int" */
jpayne@68 3204
jpayne@68 3205 /* Module declarations from "__builtin__" */
jpayne@68 3206
jpayne@68 3207 /* Module declarations from "cpython.bool" */
jpayne@68 3208
jpayne@68 3209 /* Module declarations from "cpython.long" */
jpayne@68 3210
jpayne@68 3211 /* Module declarations from "cpython.float" */
jpayne@68 3212
jpayne@68 3213 /* Module declarations from "__builtin__" */
jpayne@68 3214
jpayne@68 3215 /* Module declarations from "cpython.complex" */
jpayne@68 3216
jpayne@68 3217 /* Module declarations from "cpython.string" */
jpayne@68 3218
jpayne@68 3219 /* Module declarations from "libc.stddef" */
jpayne@68 3220
jpayne@68 3221 /* Module declarations from "cpython.unicode" */
jpayne@68 3222
jpayne@68 3223 /* Module declarations from "cpython.pyport" */
jpayne@68 3224
jpayne@68 3225 /* Module declarations from "cpython.dict" */
jpayne@68 3226
jpayne@68 3227 /* Module declarations from "cpython.instance" */
jpayne@68 3228
jpayne@68 3229 /* Module declarations from "cpython.function" */
jpayne@68 3230
jpayne@68 3231 /* Module declarations from "cpython.method" */
jpayne@68 3232
jpayne@68 3233 /* Module declarations from "cpython.weakref" */
jpayne@68 3234
jpayne@68 3235 /* Module declarations from "cpython.getargs" */
jpayne@68 3236
jpayne@68 3237 /* Module declarations from "cpython.pythread" */
jpayne@68 3238
jpayne@68 3239 /* Module declarations from "cpython.pystate" */
jpayne@68 3240
jpayne@68 3241 /* Module declarations from "cpython.cobject" */
jpayne@68 3242
jpayne@68 3243 /* Module declarations from "cpython.oldbuffer" */
jpayne@68 3244
jpayne@68 3245 /* Module declarations from "cpython.set" */
jpayne@68 3246
jpayne@68 3247 /* Module declarations from "cpython.buffer" */
jpayne@68 3248
jpayne@68 3249 /* Module declarations from "cpython.bytes" */
jpayne@68 3250
jpayne@68 3251 /* Module declarations from "cpython.pycapsule" */
jpayne@68 3252
jpayne@68 3253 /* Module declarations from "cpython.contextvars" */
jpayne@68 3254
jpayne@68 3255 /* Module declarations from "cpython" */
jpayne@68 3256
jpayne@68 3257 /* Module declarations from "cython" */
jpayne@68 3258
jpayne@68 3259 /* Module declarations from "array" */
jpayne@68 3260
jpayne@68 3261 /* Module declarations from "cpython.array" */
jpayne@68 3262 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/
jpayne@68 3263
jpayne@68 3264 /* Module declarations from "pysam.libcutils" */
jpayne@68 3265 static int (*__pyx_f_5pysam_9libcutils_libc_whence_from_io)(int); /*proto*/
jpayne@68 3266 static PyObject *(*__pyx_f_5pysam_9libcutils_charptr_to_str)(char const *, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str *__pyx_optional_args); /*proto*/
jpayne@68 3267 static PyObject *(*__pyx_f_5pysam_9libcutils_charptr_to_str_w_len)(char const *, size_t, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len *__pyx_optional_args); /*proto*/
jpayne@68 3268 static PyObject *(*__pyx_f_5pysam_9libcutils_force_str)(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args); /*proto*/
jpayne@68 3269 static PyObject *(*__pyx_f_5pysam_9libcutils_force_bytes)(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_bytes *__pyx_optional_args); /*proto*/
jpayne@68 3270 static PyObject *(*__pyx_f_5pysam_9libcutils_encode_filename)(PyObject *); /*proto*/
jpayne@68 3271 static PyObject *(*__pyx_f_5pysam_9libcutils_from_string_and_size)(char const *, size_t); /*proto*/
jpayne@68 3272
jpayne@68 3273 /* Module declarations from "pysam.libchtslib" */
jpayne@68 3274 static int __pyx_v_5pysam_10libchtslib_MAX_POS;
jpayne@68 3275 static PyObject *__pyx_v_5pysam_10libchtslib_FORMAT_CATEGORIES = 0;
jpayne@68 3276 static PyObject *__pyx_v_5pysam_10libchtslib_FORMATS = 0;
jpayne@68 3277 static PyObject *__pyx_v_5pysam_10libchtslib_COMPRESSION = 0;
jpayne@68 3278 static PyObject *__pyx_f_5pysam_10libchtslib_set_verbosity(int, int __pyx_skip_dispatch); /*proto*/
jpayne@68 3279 static PyObject *__pyx_f_5pysam_10libchtslib_get_verbosity(int __pyx_skip_dispatch); /*proto*/
jpayne@68 3280 /* #### Code section: typeinfo ### */
jpayne@68 3281 /* #### Code section: before_global_var ### */
jpayne@68 3282 #define __Pyx_MODULE_NAME "pysam.libchtslib"
jpayne@68 3283 extern int __pyx_module_is_main_pysam__libchtslib;
jpayne@68 3284 int __pyx_module_is_main_pysam__libchtslib = 0;
jpayne@68 3285
jpayne@68 3286 /* Implementation of "pysam.libchtslib" */
jpayne@68 3287 /* #### Code section: global_var ### */
jpayne@68 3288 static PyObject *__pyx_builtin_object;
jpayne@68 3289 static PyObject *__pyx_builtin_IOError;
jpayne@68 3290 static PyObject *__pyx_builtin_AttributeError;
jpayne@68 3291 static PyObject *__pyx_builtin_StopIteration;
jpayne@68 3292 static PyObject *__pyx_builtin_NotImplementedError;
jpayne@68 3293 static PyObject *__pyx_builtin_TypeError;
jpayne@68 3294 static PyObject *__pyx_builtin_OSError;
jpayne@68 3295 static PyObject *__pyx_builtin_ValueError;
jpayne@68 3296 static PyObject *__pyx_builtin_RuntimeError;
jpayne@68 3297 static PyObject *__pyx_builtin_OverflowError;
jpayne@68 3298 static PyObject *__pyx_builtin_IndexError;
jpayne@68 3299 static PyObject *__pyx_builtin_MemoryError;
jpayne@68 3300 /* #### Code section: string_decls ### */
jpayne@68 3301 static const char __pyx_k_b[] = "b";
jpayne@68 3302 static const char __pyx_k_c[] = "c";
jpayne@68 3303 static const char __pyx_k_r[] = "r";
jpayne@68 3304 static const char __pyx_k_w[] = "w";
jpayne@68 3305 static const char __pyx_k_eq[] = "__eq__";
jpayne@68 3306 static const char __pyx_k_fd[] = "<fd:{}>";
jpayne@68 3307 static const char __pyx_k_fp[] = "fp";
jpayne@68 3308 static const char __pyx_k_gc[] = "gc";
jpayne@68 3309 static const char __pyx_k_io[] = "io";
jpayne@68 3310 static const char __pyx_k_mv[] = "mv";
jpayne@68 3311 static const char __pyx_k_ne[] = "__ne__";
jpayne@68 3312 static const char __pyx_k_os[] = "os";
jpayne@68 3313 static const char __pyx_k_re[] = "re";
jpayne@68 3314 static const char __pyx_k_tb[] = "tb";
jpayne@68 3315 static const char __pyx_k_BAI[] = "BAI";
jpayne@68 3316 static const char __pyx_k_BAM[] = "BAM";
jpayne@68 3317 static const char __pyx_k_BCF[] = "BCF";
jpayne@68 3318 static const char __pyx_k_BED[] = "BED";
jpayne@68 3319 static const char __pyx_k_CSI[] = "CSI";
jpayne@68 3320 static const char __pyx_k_GZI[] = "GZI";
jpayne@68 3321 static const char __pyx_k_SAM[] = "SAM";
jpayne@68 3322 static const char __pyx_k_TBI[] = "TBI";
jpayne@68 3323 static const char __pyx_k_VCF[] = "VCF";
jpayne@68 3324 static const char __pyx_k__13[] = "";
jpayne@68 3325 static const char __pyx_k__55[] = ":";
jpayne@68 3326 static const char __pyx_k__56[] = "-";
jpayne@68 3327 static const char __pyx_k__58[] = "*";
jpayne@68 3328 static const char __pyx_k__59[] = ".";
jpayne@68 3329 static const char __pyx_k__97[] = "?";
jpayne@68 3330 static const char __pyx_k_all[] = "__all__";
jpayne@68 3331 static const char __pyx_k_buf[] = "buf";
jpayne@68 3332 static const char __pyx_k_doc[] = "__doc__";
jpayne@68 3333 static const char __pyx_k_end[] = "end";
jpayne@68 3334 static const char __pyx_k_got[] = "got";
jpayne@68 3335 static const char __pyx_k_msg[] = "msg";
jpayne@68 3336 static const char __pyx_k_off[] = "off";
jpayne@68 3337 static const char __pyx_k_ret[] = "ret";
jpayne@68 3338 static const char __pyx_k_tid[] = "tid";
jpayne@68 3339 static const char __pyx_k_BGZF[] = "BGZF";
jpayne@68 3340 static const char __pyx_k_CRAI[] = "CRAI";
jpayne@68 3341 static const char __pyx_k_CRAM[] = "CRAM";
jpayne@68 3342 static const char __pyx_k_GZIP[] = "GZIP";
jpayne@68 3343 static const char __pyx_k_NONE[] = "NONE";
jpayne@68 3344 static const char __pyx_k_bool[] = "__bool__";
jpayne@68 3345 static const char __pyx_k_call[] = "__call__";
jpayne@68 3346 static const char __pyx_k_dict[] = "__dict__";
jpayne@68 3347 static const char __pyx_k_exit[] = "__exit__";
jpayne@68 3348 static const char __pyx_k_init[] = "__init__";
jpayne@68 3349 static const char __pyx_k_join[] = "join";
jpayne@68 3350 static const char __pyx_k_line[] = "line";
jpayne@68 3351 static const char __pyx_k_main[] = "__main__";
jpayne@68 3352 static const char __pyx_k_mode[] = "mode";
jpayne@68 3353 static const char __pyx_k_name[] = "name";
jpayne@68 3354 static const char __pyx_k_opts[] = "opts";
jpayne@68 3355 static const char __pyx_k_part[] = "part";
jpayne@68 3356 static const char __pyx_k_read[] = "read";
jpayne@68 3357 static const char __pyx_k_rtid[] = "rtid";
jpayne@68 3358 static const char __pyx_k_rval[] = "rval";
jpayne@68 3359 static const char __pyx_k_seek[] = "seek";
jpayne@68 3360 static const char __pyx_k_self[] = "self";
jpayne@68 3361 static const char __pyx_k_size[] = "size";
jpayne@68 3362 static const char __pyx_k_spec[] = "__spec__";
jpayne@68 3363 static const char __pyx_k_stop[] = "stop";
jpayne@68 3364 static const char __pyx_k_tell[] = "tell";
jpayne@68 3365 static const char __pyx_k_test[] = "__test__";
jpayne@68 3366 static const char __pyx_k_type[] = "type";
jpayne@68 3367 static const char __pyx_k_warn[] = "warn";
jpayne@68 3368 static const char __pyx_k_CTrue[] = "CTrue";
jpayne@68 3369 static const char __pyx_k_HFile[] = "HFile";
jpayne@68 3370 static const char __pyx_k_INDEX[] = "INDEX";
jpayne@68 3371 static const char __pyx_k_bgzfp[] = "bgzfp";
jpayne@68 3372 static const char __pyx_k_close[] = "close";
jpayne@68 3373 static const char __pyx_k_coord[] = "coord";
jpayne@68 3374 static const char __pyx_k_cpart[] = "cpart";
jpayne@68 3375 static const char __pyx_k_enter[] = "__enter__";
jpayne@68 3376 static const char __pyx_k_flush[] = "flush";
jpayne@68 3377 static const char __pyx_k_lines[] = "lines";
jpayne@68 3378 static const char __pyx_k_other[] = "other";
jpayne@68 3379 static const char __pyx_k_parts[] = "parts";
jpayne@68 3380 static const char __pyx_k_reset[] = "reset";
jpayne@68 3381 static const char __pyx_k_rstop[] = "rstop";
jpayne@68 3382 static const char __pyx_k_split[] = "split";
jpayne@68 3383 static const char __pyx_k_start[] = "start";
jpayne@68 3384 static const char __pyx_k_super[] = "super";
jpayne@68 3385 static const char __pyx_k_value[] = "value";
jpayne@68 3386 static const char __pyx_k_write[] = "write";
jpayne@68 3387 static const char __pyx_k_CFalse[] = "CFalse";
jpayne@68 3388 static const char __pyx_k_CUSTOM[] = "CUSTOM";
jpayne@68 3389 static const char __pyx_k_contig[] = "contig";
jpayne@68 3390 static const char __pyx_k_enable[] = "enable";
jpayne@68 3391 static const char __pyx_k_failed[] = " failed";
jpayne@68 3392 static const char __pyx_k_fileno[] = "fileno";
jpayne@68 3393 static const char __pyx_k_format[] = "format";
jpayne@68 3394 static const char __pyx_k_import[] = "__import__";
jpayne@68 3395 static const char __pyx_k_isatty[] = "isatty";
jpayne@68 3396 static const char __pyx_k_module[] = "__module__";
jpayne@68 3397 static const char __pyx_k_name_2[] = "__name__";
jpayne@68 3398 static const char __pyx_k_object[] = "object";
jpayne@68 3399 static const char __pyx_k_offset[] = "offset";
jpayne@68 3400 static const char __pyx_k_reduce[] = "__reduce__";
jpayne@68 3401 static const char __pyx_k_region[] = "region";
jpayne@68 3402 static const char __pyx_k_rstart[] = "rstart";
jpayne@68 3403 static const char __pyx_k_whence[] = "whence";
jpayne@68 3404 static const char __pyx_k_HTSFile[] = "HTSFile";
jpayne@68 3405 static const char __pyx_k_IOError[] = "IOError";
jpayne@68 3406 static const char __pyx_k_OSError[] = "OSError";
jpayne@68 3407 static const char __pyx_k_REGIONS[] = "REGIONS";
jpayne@68 3408 static const char __pyx_k_UNKNOWN[] = "UNKNOWN";
jpayne@68 3409 static const char __pyx_k_closefd[] = "closefd";
jpayne@68 3410 static const char __pyx_k_disable[] = "disable";
jpayne@68 3411 static const char __pyx_k_get_tid[] = "get_tid";
jpayne@68 3412 static const char __pyx_k_is_open[] = "is_open";
jpayne@68 3413 static const char __pyx_k_nonzero[] = "__nonzero__";
jpayne@68 3414 static const char __pyx_k_prepare[] = "__prepare__";
jpayne@68 3415 static const char __pyx_k_readall[] = "readall";
jpayne@68 3416 static const char __pyx_k_replace[] = "replace";
jpayne@68 3417 static const char __pyx_k_Flushing[] = "Flushing ";
jpayne@68 3418 static const char __pyx_k_SEEK_SET[] = "SEEK_SET";
jpayne@68 3419 static const char __pyx_k_VARIANTS[] = "VARIANTS";
jpayne@68 3420 static const char __pyx_k_exc_type[] = "exc_type";
jpayne@68 3421 static const char __pyx_k_getstate[] = "__getstate__";
jpayne@68 3422 static const char __pyx_k_qualname[] = "__qualname__";
jpayne@68 3423 static const char __pyx_k_readable[] = "readable";
jpayne@68 3424 static const char __pyx_k_readinto[] = "readinto";
jpayne@68 3425 static const char __pyx_k_readline[] = "readline";
jpayne@68 3426 static const char __pyx_k_seekable[] = "seekable";
jpayne@68 3427 static const char __pyx_k_set_name[] = "__set_name__";
jpayne@68 3428 static const char __pyx_k_setstate[] = "__setstate__";
jpayne@68 3429 static const char __pyx_k_truncate[] = "truncate";
jpayne@68 3430 static const char __pyx_k_warnings[] = "warnings";
jpayne@68 3431 static const char __pyx_k_writable[] = "writable";
jpayne@68 3432 static const char __pyx_k_TypeError[] = "TypeError";
jpayne@68 3433 static const char __pyx_k_exc_value[] = "exc_value";
jpayne@68 3434 static const char __pyx_k_isenabled[] = "isenabled";
jpayne@68 3435 static const char __pyx_k_metaclass[] = "__metaclass__";
jpayne@68 3436 static const char __pyx_k_pyx_state[] = "__pyx_state";
jpayne@68 3437 static const char __pyx_k_readlines[] = "readlines";
jpayne@68 3438 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
jpayne@68 3439 static const char __pyx_k_reference[] = "reference";
jpayne@68 3440 static const char __pyx_k_traceback[] = "traceback";
jpayne@68 3441 static const char __pyx_k_verbosity[] = "verbosity";
jpayne@68 3442 static const char __pyx_k_ALIGNMENTS[] = "ALIGNMENTS";
jpayne@68 3443 static const char __pyx_k_HFile_read[] = "HFile.read";
jpayne@68 3444 static const char __pyx_k_HFile_seek[] = "HFile.seek";
jpayne@68 3445 static const char __pyx_k_HFile_tell[] = "HFile.tell";
jpayne@68 3446 static const char __pyx_k_IndexError[] = "IndexError";
jpayne@68 3447 static const char __pyx_k_ValueError[] = "ValueError";
jpayne@68 3448 static const char __pyx_k_bytes_read[] = "bytes_read";
jpayne@68 3449 static const char __pyx_k_chunk_size[] = "chunk_size";
jpayne@68 3450 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
jpayne@68 3451 static const char __pyx_k_writelines[] = "writelines";
jpayne@68 3452 static const char __pyx_k_HFile_close[] = "HFile.close";
jpayne@68 3453 static const char __pyx_k_HFile_flush[] = "HFile.flush";
jpayne@68 3454 static const char __pyx_k_HFile_write[] = "HFile.write";
jpayne@68 3455 static const char __pyx_k_MemoryError[] = "MemoryError";
jpayne@68 3456 static const char __pyx_k_TEXT_FORMAT[] = "TEXT_FORMAT";
jpayne@68 3457 static const char __pyx_k_invalid_tid[] = "invalid tid";
jpayne@68 3458 static const char __pyx_k_mro_entries[] = "__mro_entries__";
jpayne@68 3459 static const char __pyx_k_HFile___exit[] = "HFile.__exit__";
jpayne@68 3460 static const char __pyx_k_HFile_fileno[] = "HFile.fileno";
jpayne@68 3461 static const char __pyx_k_HFile_isatty[] = "HFile.isatty";
jpayne@68 3462 static const char __pyx_k_HTSFile_seek[] = "HTSFile.seek";
jpayne@68 3463 static const char __pyx_k_HTSFile_tell[] = "HTSFile.tell";
jpayne@68 3464 static const char __pyx_k_RuntimeError[] = "RuntimeError";
jpayne@68 3465 static const char __pyx_k_initializing[] = "_initializing";
jpayne@68 3466 static const char __pyx_k_is_coroutine[] = "_is_coroutine";
jpayne@68 3467 static const char __pyx_k_is_valid_tid[] = "is_valid_tid";
jpayne@68 3468 static const char __pyx_k_parse_region[] = "parse_region";
jpayne@68 3469 static const char __pyx_k_stringsource[] = "<stringsource>";
jpayne@68 3470 static const char __pyx_k_BINARY_FORMAT[] = "BINARY_FORMAT";
jpayne@68 3471 static const char __pyx_k_CallableValue[] = "CallableValue";
jpayne@68 3472 static const char __pyx_k_HFile___enter[] = "HFile.__enter__";
jpayne@68 3473 static const char __pyx_k_HFile_readall[] = "HFile.readall";
jpayne@68 3474 static const char __pyx_k_HTSFile_close[] = "HTSFile.close";
jpayne@68 3475 static const char __pyx_k_HTSFile_flush[] = "HTSFile.flush";
jpayne@68 3476 static const char __pyx_k_HTSFile_reset[] = "HTSFile.reset";
jpayne@68 3477 static const char __pyx_k_OverflowError[] = "OverflowError";
jpayne@68 3478 static const char __pyx_k_StopIteration[] = "StopIteration";
jpayne@68 3479 static const char __pyx_k_class_getitem[] = "__class_getitem__";
jpayne@68 3480 static const char __pyx_k_format_option[] = "format_option";
jpayne@68 3481 static const char __pyx_k_get_verbosity[] = "get_verbosity";
jpayne@68 3482 static const char __pyx_k_init_subclass[] = "__init_subclass__";
jpayne@68 3483 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
jpayne@68 3484 static const char __pyx_k_set_verbosity[] = "set_verbosity";
jpayne@68 3485 static const char __pyx_k_AttributeError[] = "AttributeError";
jpayne@68 3486 static const char __pyx_k_HFile_readable[] = "HFile.readable";
jpayne@68 3487 static const char __pyx_k_HFile_readinto[] = "HFile.readinto";
jpayne@68 3488 static const char __pyx_k_HFile_readline[] = "HFile.readline";
jpayne@68 3489 static const char __pyx_k_HFile_seekable[] = "HFile.seekable";
jpayne@68 3490 static const char __pyx_k_HFile_truncate[] = "HFile.truncate";
jpayne@68 3491 static const char __pyx_k_HFile_writable[] = "HFile.writable";
jpayne@68 3492 static const char __pyx_k_HTSFile___exit[] = "HTSFile.__exit__";
jpayne@68 3493 static const char __pyx_k_format_options[] = "format_options";
jpayne@68 3494 static const char __pyx_k_HFile_readlines[] = "HFile.readlines";
jpayne@68 3495 static const char __pyx_k_HTSFile___enter[] = "HTSFile.__enter__";
jpayne@68 3496 static const char __pyx_k_HTSFile_get_tid[] = "HTSFile.get_tid";
jpayne@68 3497 static const char __pyx_k_add_hts_options[] = "add_hts_options";
jpayne@68 3498 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
jpayne@68 3499 static const char __pyx_k_HFile_writelines[] = "HFile.writelines";
jpayne@68 3500 static const char __pyx_k_check_truncation[] = "check_truncation";
jpayne@68 3501 static const char __pyx_k_invalid_contig_s[] = "invalid contig `%s`";
jpayne@68 3502 static const char __pyx_k_pysam_libchtslib[] = "pysam.libchtslib";
jpayne@68 3503 static const char __pyx_k_ignore_truncation[] = "ignore_truncation";
jpayne@68 3504 static const char __pyx_k_CallableValue___eq[] = "CallableValue.__eq__";
jpayne@68 3505 static const char __pyx_k_CallableValue___ne[] = "CallableValue.__ne__";
jpayne@68 3506 static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
jpayne@68 3507 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
jpayne@68 3508 static const char __pyx_k_get_reference_name[] = "get_reference_name";
jpayne@68 3509 static const char __pyx_k_Cannot_create_hfile[] = "Cannot create hfile";
jpayne@68 3510 static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
jpayne@68 3511 static const char __pyx_k_stop_out_of_range_i[] = "stop out of range (%i)";
jpayne@68 3512 static const char __pyx_k_CallableValue___bool[] = "CallableValue.__bool__";
jpayne@68 3513 static const char __pyx_k_CallableValue___call[] = "CallableValue.__call__";
jpayne@68 3514 static const char __pyx_k_CallableValue___init[] = "CallableValue.__init__";
jpayne@68 3515 static const char __pyx_k_HTSFile_is_valid_tid[] = "HTSFile.is_valid_tid";
jpayne@68 3516 static const char __pyx_k_HTSFile_parse_region[] = "HTSFile.parse_region";
jpayne@68 3517 static const char __pyx_k_failed_to_open_HFile[] = "failed to open HFile";
jpayne@68 3518 static const char __pyx_k_failed_to_read_HFile[] = "failed to read HFile";
jpayne@68 3519 static const char __pyx_k_fileno_not_available[] = "fileno not available";
jpayne@68 3520 static const char __pyx_k_pysam_libchtslib_pyx[] = "pysam/libchtslib.pyx";
jpayne@68 3521 static const char __pyx_k_seek_failed_on_HFile[] = "seek failed on HFile";
jpayne@68 3522 static const char __pyx_k_start_out_of_range_i[] = "start out of range (%i)";
jpayne@68 3523 static const char __pyx_k_tell_failed_on_HFile[] = "tell failed on HFile";
jpayne@68 3524 static const char __pyx_k_HFile___reduce_cython[] = "HFile.__reduce_cython__";
jpayne@68 3525 static const char __pyx_k_failed_to_close_HFile[] = "failed to close HFile";
jpayne@68 3526 static const char __pyx_k_failed_to_flush_HFile[] = "failed to flush HFile";
jpayne@68 3527 static const char __pyx_k_write_failed_on_HFile[] = "write failed on HFile";
jpayne@68 3528 static const char __pyx_k_CallableValue___nonzero[] = "CallableValue.__nonzero__";
jpayne@68 3529 static const char __pyx_k_HFile___setstate_cython[] = "HFile.__setstate_cython__";
jpayne@68 3530 static const char __pyx_k_HTSFile___reduce_cython[] = "HTSFile.__reduce_cython__";
jpayne@68 3531 static const char __pyx_k_HTSFile_add_hts_options[] = "HTSFile.add_hts_options";
jpayne@68 3532 static const char __pyx_k_is_valid_reference_name[] = "is_valid_reference_name";
jpayne@68 3533 static const char __pyx_k_HTSFile_check_truncation[] = "HTSFile.check_truncation";
jpayne@68 3534 static const char __pyx_k_HTSFile___setstate_cython[] = "HTSFile.__setstate_cython__";
jpayne@68 3535 static const char __pyx_k_operation_on_closed_HFile[] = "operation on closed HFile";
jpayne@68 3536 static const char __pyx_k_HTSFile_get_reference_name[] = "HTSFile.get_reference_name";
jpayne@68 3537 static const char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file";
jpayne@68 3538 static const char __pyx_k_error_checking_for_EOF_marker[] = "error checking for EOF marker";
jpayne@68 3539 static const char __pyx_k_seek_not_available_in_streams[] = "seek not available in streams";
jpayne@68 3540 static const char __pyx_k_tell_not_available_in_streams[] = "tell not available in streams";
jpayne@68 3541 static const char __pyx_k_HTSFile_is_valid_reference_name[] = "HTSFile.is_valid_reference_name";
jpayne@68 3542 static const char __pyx_k_Invalid_format_option_specified[] = "Invalid format option ({}) specified";
jpayne@68 3543 static const char __pyx_k_contig_and_reference_should_not[] = "contig and reference should not both be specified";
jpayne@68 3544 static const char __pyx_k_stop_and_end_should_not_both_be[] = "stop and end should not both be specified";
jpayne@68 3545 static const char __pyx_k_An_error_occurred_while_applying[] = "An error occurred while applying the requested format options";
jpayne@68 3546 static const char __pyx_k_invalid_coordinates_start_i_stop[] = "invalid coordinates: start (%i) > stop (%i)";
jpayne@68 3547 static const char __pyx_k_metadata_not_available_on_closed[] = "metadata not available on closed file";
jpayne@68 3548 static const char __pyx_k_no_BGZF_EOF_marker_file_may_be_t[] = "no BGZF EOF marker; file may be truncated";
jpayne@68 3549 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
jpayne@68 3550 static const char __pyx_k_seek_not_implemented_in_files_co[] = "seek not implemented in files compressed by method {}";
jpayne@68 3551 static const char __pyx_k_self_fp_cannot_be_converted_to_a[] = "self.fp cannot be converted to a Python object for pickling";
jpayne@68 3552 /* #### Code section: decls ### */
jpayne@68 3553 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
jpayne@68 3554 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
jpayne@68 3555 static PyObject *__pyx_pf_5pysam_10libchtslib_set_verbosity(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_verbosity); /* proto */
jpayne@68 3556 static PyObject *__pyx_pf_5pysam_10libchtslib_2get_verbosity(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
jpayne@68 3557 static int __pyx_pf_5pysam_10libchtslib_5HFile___init__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, CYTHON_UNUSED PyObject *__pyx_v_closefd); /* proto */
jpayne@68 3558 static void __pyx_pf_5pysam_10libchtslib_5HFile_2__dealloc__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3559 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_6closed___get__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3560 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_4close(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3561 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_6fileno(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3562 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_8__enter__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3563 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_10__exit__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */
jpayne@68 3564 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_12__iter__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3565 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_14__next__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3566 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_16flush(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3567 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_18isatty(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3568 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_20readable(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3569 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_22read(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, Py_ssize_t __pyx_v_size); /* proto */
jpayne@68 3570 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_24readall(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3571 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_26readinto(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */
jpayne@68 3572 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_28readline(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, Py_ssize_t __pyx_v_size); /* proto */
jpayne@68 3573 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_30readlines(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3574 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_32seek(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, Py_ssize_t __pyx_v_offset, int __pyx_v_whence); /* proto */
jpayne@68 3575 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_34tell(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3576 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_36seekable(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3577 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_38truncate(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */
jpayne@68 3578 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_40writable(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3579 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_42write(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_b); /* proto */
jpayne@68 3580 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_44writelines(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_lines); /* proto */
jpayne@68 3581 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_4name___get__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3582 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_4mode___get__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3583 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self); /* proto */
jpayne@68 3584 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
jpayne@68 3585 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
jpayne@68 3586 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
jpayne@68 3587 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_4__bool__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
jpayne@68 3588 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_6__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
jpayne@68 3589 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
jpayne@68 3590 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
jpayne@68 3591 static int __pyx_pf_5pysam_10libchtslib_7HTSFile___cinit__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
jpayne@68 3592 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_2close(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3593 static void __pyx_pf_5pysam_10libchtslib_7HTSFile_4__dealloc__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3594 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6flush(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3595 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_8check_truncation(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, PyObject *__pyx_v_ignore_truncation); /* proto */
jpayne@68 3596 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_10__enter__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3597 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_12__exit__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
jpayne@68 3598 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_8category___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3599 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6format___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3600 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7version___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3601 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_11compression___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3602 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_11description___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3603 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7is_open___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3604 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_9is_closed___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3605 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6closed___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3606 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_8is_write___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3607 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7is_read___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3608 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6is_sam___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3609 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6is_bam___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3610 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7is_cram___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3611 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6is_vcf___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3612 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6is_bcf___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3613 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_14reset(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3614 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_16seek(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, uint64_t __pyx_v_offset, int __pyx_v_whence); /* proto */
jpayne@68 3615 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_18tell(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3616 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_20add_hts_options(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, PyObject *__pyx_v_format_options); /* proto */
jpayne@68 3617 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_22parse_region(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, PyObject *__pyx_v_contig, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_region, PyObject *__pyx_v_tid, PyObject *__pyx_v_reference, PyObject *__pyx_v_end); /* proto */
jpayne@68 3618 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_24is_valid_tid(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_tid); /* proto */
jpayne@68 3619 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_26is_valid_reference_name(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, PyObject *__pyx_v_contig); /* proto */
jpayne@68 3620 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_28get_tid(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_contig); /* proto */
jpayne@68 3621 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_30get_reference_name(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_tid); /* proto */
jpayne@68 3622 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_8filename___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3623 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_4mode___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3624 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7threads___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3625 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_14index_filename___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3626 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_9is_stream___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3627 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_9is_remote___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3628 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_20duplicate_filehandle___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3629 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self); /* proto */
jpayne@68 3630 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
jpayne@68 3631 static PyObject *__pyx_tp_new_5pysam_10libchtslib_HTSFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
jpayne@68 3632 static PyObject *__pyx_tp_new_5pysam_10libchtslib_HFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
jpayne@68 3633 /* #### Code section: late_includes ### */
jpayne@68 3634 /* #### Code section: module_state ### */
jpayne@68 3635 typedef struct {
jpayne@68 3636 PyObject *__pyx_d;
jpayne@68 3637 PyObject *__pyx_b;
jpayne@68 3638 PyObject *__pyx_cython_runtime;
jpayne@68 3639 PyObject *__pyx_empty_tuple;
jpayne@68 3640 PyObject *__pyx_empty_bytes;
jpayne@68 3641 PyObject *__pyx_empty_unicode;
jpayne@68 3642 #ifdef __Pyx_CyFunction_USED
jpayne@68 3643 PyTypeObject *__pyx_CyFunctionType;
jpayne@68 3644 #endif
jpayne@68 3645 #ifdef __Pyx_FusedFunction_USED
jpayne@68 3646 PyTypeObject *__pyx_FusedFunctionType;
jpayne@68 3647 #endif
jpayne@68 3648 #ifdef __Pyx_Generator_USED
jpayne@68 3649 PyTypeObject *__pyx_GeneratorType;
jpayne@68 3650 #endif
jpayne@68 3651 #ifdef __Pyx_IterableCoroutine_USED
jpayne@68 3652 PyTypeObject *__pyx_IterableCoroutineType;
jpayne@68 3653 #endif
jpayne@68 3654 #ifdef __Pyx_Coroutine_USED
jpayne@68 3655 PyTypeObject *__pyx_CoroutineAwaitType;
jpayne@68 3656 #endif
jpayne@68 3657 #ifdef __Pyx_Coroutine_USED
jpayne@68 3658 PyTypeObject *__pyx_CoroutineType;
jpayne@68 3659 #endif
jpayne@68 3660 #if CYTHON_USE_MODULE_STATE
jpayne@68 3661 #endif
jpayne@68 3662 #if CYTHON_USE_MODULE_STATE
jpayne@68 3663 #endif
jpayne@68 3664 #if CYTHON_USE_MODULE_STATE
jpayne@68 3665 #endif
jpayne@68 3666 #if CYTHON_USE_MODULE_STATE
jpayne@68 3667 #endif
jpayne@68 3668 #if CYTHON_USE_MODULE_STATE
jpayne@68 3669 #endif
jpayne@68 3670 #if CYTHON_USE_MODULE_STATE
jpayne@68 3671 #endif
jpayne@68 3672 #if CYTHON_USE_MODULE_STATE
jpayne@68 3673 #endif
jpayne@68 3674 #if CYTHON_USE_MODULE_STATE
jpayne@68 3675 #endif
jpayne@68 3676 #if CYTHON_USE_MODULE_STATE
jpayne@68 3677 #endif
jpayne@68 3678 #if CYTHON_USE_MODULE_STATE
jpayne@68 3679 #endif
jpayne@68 3680 PyTypeObject *__pyx_ptype_7cpython_4type_type;
jpayne@68 3681 #if CYTHON_USE_MODULE_STATE
jpayne@68 3682 #endif
jpayne@68 3683 #if CYTHON_USE_MODULE_STATE
jpayne@68 3684 #endif
jpayne@68 3685 #if CYTHON_USE_MODULE_STATE
jpayne@68 3686 #endif
jpayne@68 3687 #if CYTHON_USE_MODULE_STATE
jpayne@68 3688 #endif
jpayne@68 3689 #if CYTHON_USE_MODULE_STATE
jpayne@68 3690 #endif
jpayne@68 3691 #if CYTHON_USE_MODULE_STATE
jpayne@68 3692 #endif
jpayne@68 3693 #if CYTHON_USE_MODULE_STATE
jpayne@68 3694 #endif
jpayne@68 3695 #if CYTHON_USE_MODULE_STATE
jpayne@68 3696 #endif
jpayne@68 3697 #if CYTHON_USE_MODULE_STATE
jpayne@68 3698 #endif
jpayne@68 3699 #if CYTHON_USE_MODULE_STATE
jpayne@68 3700 #endif
jpayne@68 3701 #if CYTHON_USE_MODULE_STATE
jpayne@68 3702 #endif
jpayne@68 3703 #if CYTHON_USE_MODULE_STATE
jpayne@68 3704 #endif
jpayne@68 3705 #if CYTHON_USE_MODULE_STATE
jpayne@68 3706 #endif
jpayne@68 3707 #if CYTHON_USE_MODULE_STATE
jpayne@68 3708 #endif
jpayne@68 3709 PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
jpayne@68 3710 #if CYTHON_USE_MODULE_STATE
jpayne@68 3711 #endif
jpayne@68 3712 #if CYTHON_USE_MODULE_STATE
jpayne@68 3713 #endif
jpayne@68 3714 #if CYTHON_USE_MODULE_STATE
jpayne@68 3715 #endif
jpayne@68 3716 #if CYTHON_USE_MODULE_STATE
jpayne@68 3717 #endif
jpayne@68 3718 PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
jpayne@68 3719 #if CYTHON_USE_MODULE_STATE
jpayne@68 3720 #endif
jpayne@68 3721 #if CYTHON_USE_MODULE_STATE
jpayne@68 3722 #endif
jpayne@68 3723 #if CYTHON_USE_MODULE_STATE
jpayne@68 3724 #endif
jpayne@68 3725 #if CYTHON_USE_MODULE_STATE
jpayne@68 3726 #endif
jpayne@68 3727 #if CYTHON_USE_MODULE_STATE
jpayne@68 3728 #endif
jpayne@68 3729 #if CYTHON_USE_MODULE_STATE
jpayne@68 3730 #endif
jpayne@68 3731 #if CYTHON_USE_MODULE_STATE
jpayne@68 3732 #endif
jpayne@68 3733 #if CYTHON_USE_MODULE_STATE
jpayne@68 3734 #endif
jpayne@68 3735 #if CYTHON_USE_MODULE_STATE
jpayne@68 3736 #endif
jpayne@68 3737 #if CYTHON_USE_MODULE_STATE
jpayne@68 3738 #endif
jpayne@68 3739 #if CYTHON_USE_MODULE_STATE
jpayne@68 3740 #endif
jpayne@68 3741 #if CYTHON_USE_MODULE_STATE
jpayne@68 3742 #endif
jpayne@68 3743 #if CYTHON_USE_MODULE_STATE
jpayne@68 3744 #endif
jpayne@68 3745 #if CYTHON_USE_MODULE_STATE
jpayne@68 3746 #endif
jpayne@68 3747 #if CYTHON_USE_MODULE_STATE
jpayne@68 3748 #endif
jpayne@68 3749 #if CYTHON_USE_MODULE_STATE
jpayne@68 3750 #endif
jpayne@68 3751 #if CYTHON_USE_MODULE_STATE
jpayne@68 3752 #endif
jpayne@68 3753 #if CYTHON_USE_MODULE_STATE
jpayne@68 3754 #endif
jpayne@68 3755 #if CYTHON_USE_MODULE_STATE
jpayne@68 3756 #endif
jpayne@68 3757 #if CYTHON_USE_MODULE_STATE
jpayne@68 3758 #endif
jpayne@68 3759 #if CYTHON_USE_MODULE_STATE
jpayne@68 3760 #endif
jpayne@68 3761 #if CYTHON_USE_MODULE_STATE
jpayne@68 3762 #endif
jpayne@68 3763 #if CYTHON_USE_MODULE_STATE
jpayne@68 3764 #endif
jpayne@68 3765 PyTypeObject *__pyx_ptype_7cpython_5array_array;
jpayne@68 3766 #if CYTHON_USE_MODULE_STATE
jpayne@68 3767 #endif
jpayne@68 3768 #if CYTHON_USE_MODULE_STATE
jpayne@68 3769 PyObject *__pyx_type_5pysam_10libchtslib_HTSFile;
jpayne@68 3770 PyObject *__pyx_type_5pysam_10libchtslib_HFile;
jpayne@68 3771 #endif
jpayne@68 3772 PyTypeObject *__pyx_ptype_5pysam_10libchtslib_HTSFile;
jpayne@68 3773 PyTypeObject *__pyx_ptype_5pysam_10libchtslib_HFile;
jpayne@68 3774 PyObject *__pyx_n_u_ALIGNMENTS;
jpayne@68 3775 PyObject *__pyx_kp_u_An_error_occurred_while_applying;
jpayne@68 3776 PyObject *__pyx_n_s_AttributeError;
jpayne@68 3777 PyObject *__pyx_n_u_BAI;
jpayne@68 3778 PyObject *__pyx_n_u_BAM;
jpayne@68 3779 PyObject *__pyx_n_u_BCF;
jpayne@68 3780 PyObject *__pyx_n_u_BED;
jpayne@68 3781 PyObject *__pyx_n_u_BGZF;
jpayne@68 3782 PyObject *__pyx_n_u_BINARY_FORMAT;
jpayne@68 3783 PyObject *__pyx_n_s_CFalse;
jpayne@68 3784 PyObject *__pyx_n_u_CRAI;
jpayne@68 3785 PyObject *__pyx_n_u_CRAM;
jpayne@68 3786 PyObject *__pyx_n_u_CSI;
jpayne@68 3787 PyObject *__pyx_n_s_CTrue;
jpayne@68 3788 PyObject *__pyx_n_u_CUSTOM;
jpayne@68 3789 PyObject *__pyx_n_s_CallableValue;
jpayne@68 3790 PyObject *__pyx_n_s_CallableValue___bool;
jpayne@68 3791 PyObject *__pyx_n_s_CallableValue___call;
jpayne@68 3792 PyObject *__pyx_n_s_CallableValue___eq;
jpayne@68 3793 PyObject *__pyx_n_s_CallableValue___init;
jpayne@68 3794 PyObject *__pyx_n_s_CallableValue___ne;
jpayne@68 3795 PyObject *__pyx_n_s_CallableValue___nonzero;
jpayne@68 3796 PyObject *__pyx_kp_u_Cannot_create_hfile;
jpayne@68 3797 PyObject *__pyx_kp_u_Flushing;
jpayne@68 3798 PyObject *__pyx_n_u_GZI;
jpayne@68 3799 PyObject *__pyx_n_u_GZIP;
jpayne@68 3800 PyObject *__pyx_n_s_HFile;
jpayne@68 3801 PyObject *__pyx_n_u_HFile;
jpayne@68 3802 PyObject *__pyx_n_s_HFile___enter;
jpayne@68 3803 PyObject *__pyx_n_s_HFile___exit;
jpayne@68 3804 PyObject *__pyx_n_s_HFile___reduce_cython;
jpayne@68 3805 PyObject *__pyx_n_s_HFile___setstate_cython;
jpayne@68 3806 PyObject *__pyx_n_s_HFile_close;
jpayne@68 3807 PyObject *__pyx_n_s_HFile_fileno;
jpayne@68 3808 PyObject *__pyx_n_s_HFile_flush;
jpayne@68 3809 PyObject *__pyx_n_s_HFile_isatty;
jpayne@68 3810 PyObject *__pyx_n_s_HFile_read;
jpayne@68 3811 PyObject *__pyx_n_s_HFile_readable;
jpayne@68 3812 PyObject *__pyx_n_s_HFile_readall;
jpayne@68 3813 PyObject *__pyx_n_s_HFile_readinto;
jpayne@68 3814 PyObject *__pyx_n_s_HFile_readline;
jpayne@68 3815 PyObject *__pyx_n_s_HFile_readlines;
jpayne@68 3816 PyObject *__pyx_n_s_HFile_seek;
jpayne@68 3817 PyObject *__pyx_n_s_HFile_seekable;
jpayne@68 3818 PyObject *__pyx_n_s_HFile_tell;
jpayne@68 3819 PyObject *__pyx_n_s_HFile_truncate;
jpayne@68 3820 PyObject *__pyx_n_s_HFile_writable;
jpayne@68 3821 PyObject *__pyx_n_s_HFile_write;
jpayne@68 3822 PyObject *__pyx_n_s_HFile_writelines;
jpayne@68 3823 PyObject *__pyx_n_s_HTSFile;
jpayne@68 3824 PyObject *__pyx_n_u_HTSFile;
jpayne@68 3825 PyObject *__pyx_n_s_HTSFile___enter;
jpayne@68 3826 PyObject *__pyx_n_s_HTSFile___exit;
jpayne@68 3827 PyObject *__pyx_n_s_HTSFile___reduce_cython;
jpayne@68 3828 PyObject *__pyx_n_s_HTSFile___setstate_cython;
jpayne@68 3829 PyObject *__pyx_n_s_HTSFile_add_hts_options;
jpayne@68 3830 PyObject *__pyx_n_s_HTSFile_check_truncation;
jpayne@68 3831 PyObject *__pyx_n_s_HTSFile_close;
jpayne@68 3832 PyObject *__pyx_n_s_HTSFile_flush;
jpayne@68 3833 PyObject *__pyx_n_s_HTSFile_get_reference_name;
jpayne@68 3834 PyObject *__pyx_n_s_HTSFile_get_tid;
jpayne@68 3835 PyObject *__pyx_n_s_HTSFile_is_valid_reference_name;
jpayne@68 3836 PyObject *__pyx_n_s_HTSFile_is_valid_tid;
jpayne@68 3837 PyObject *__pyx_n_s_HTSFile_parse_region;
jpayne@68 3838 PyObject *__pyx_n_s_HTSFile_reset;
jpayne@68 3839 PyObject *__pyx_n_s_HTSFile_seek;
jpayne@68 3840 PyObject *__pyx_n_s_HTSFile_tell;
jpayne@68 3841 PyObject *__pyx_n_u_INDEX;
jpayne@68 3842 PyObject *__pyx_n_s_IOError;
jpayne@68 3843 PyObject *__pyx_kp_u_I_O_operation_on_closed_file;
jpayne@68 3844 PyObject *__pyx_n_s_IndexError;
jpayne@68 3845 PyObject *__pyx_kp_u_Invalid_format_option_specified;
jpayne@68 3846 PyObject *__pyx_n_s_MemoryError;
jpayne@68 3847 PyObject *__pyx_n_u_NONE;
jpayne@68 3848 PyObject *__pyx_n_s_NotImplementedError;
jpayne@68 3849 PyObject *__pyx_n_s_OSError;
jpayne@68 3850 PyObject *__pyx_n_s_OverflowError;
jpayne@68 3851 PyObject *__pyx_n_u_REGIONS;
jpayne@68 3852 PyObject *__pyx_n_s_RuntimeError;
jpayne@68 3853 PyObject *__pyx_n_u_SAM;
jpayne@68 3854 PyObject *__pyx_n_s_SEEK_SET;
jpayne@68 3855 PyObject *__pyx_n_s_StopIteration;
jpayne@68 3856 PyObject *__pyx_n_u_TBI;
jpayne@68 3857 PyObject *__pyx_n_u_TEXT_FORMAT;
jpayne@68 3858 PyObject *__pyx_n_s_TypeError;
jpayne@68 3859 PyObject *__pyx_n_u_UNKNOWN;
jpayne@68 3860 PyObject *__pyx_n_u_VARIANTS;
jpayne@68 3861 PyObject *__pyx_n_u_VCF;
jpayne@68 3862 PyObject *__pyx_n_s_ValueError;
jpayne@68 3863 PyObject *__pyx_kp_b__13;
jpayne@68 3864 PyObject *__pyx_kp_u__55;
jpayne@68 3865 PyObject *__pyx_kp_u__56;
jpayne@68 3866 PyObject *__pyx_n_s__58;
jpayne@68 3867 PyObject *__pyx_kp_u__58;
jpayne@68 3868 PyObject *__pyx_kp_u__59;
jpayne@68 3869 PyObject *__pyx_n_s__97;
jpayne@68 3870 PyObject *__pyx_n_s_add_hts_options;
jpayne@68 3871 PyObject *__pyx_n_s_all;
jpayne@68 3872 PyObject *__pyx_n_s_asyncio_coroutines;
jpayne@68 3873 PyObject *__pyx_n_b_b;
jpayne@68 3874 PyObject *__pyx_n_s_b;
jpayne@68 3875 PyObject *__pyx_n_s_bgzfp;
jpayne@68 3876 PyObject *__pyx_n_s_bool;
jpayne@68 3877 PyObject *__pyx_n_s_buf;
jpayne@68 3878 PyObject *__pyx_n_s_bytes_read;
jpayne@68 3879 PyObject *__pyx_n_b_c;
jpayne@68 3880 PyObject *__pyx_n_s_call;
jpayne@68 3881 PyObject *__pyx_n_s_check_truncation;
jpayne@68 3882 PyObject *__pyx_n_s_chunk_size;
jpayne@68 3883 PyObject *__pyx_n_s_class_getitem;
jpayne@68 3884 PyObject *__pyx_n_s_cline_in_traceback;
jpayne@68 3885 PyObject *__pyx_n_s_close;
jpayne@68 3886 PyObject *__pyx_n_s_closefd;
jpayne@68 3887 PyObject *__pyx_n_s_contig;
jpayne@68 3888 PyObject *__pyx_kp_u_contig_and_reference_should_not;
jpayne@68 3889 PyObject *__pyx_n_s_coord;
jpayne@68 3890 PyObject *__pyx_n_s_cpart;
jpayne@68 3891 PyObject *__pyx_n_s_dict;
jpayne@68 3892 PyObject *__pyx_kp_u_disable;
jpayne@68 3893 PyObject *__pyx_n_s_doc;
jpayne@68 3894 PyObject *__pyx_kp_u_enable;
jpayne@68 3895 PyObject *__pyx_n_s_end;
jpayne@68 3896 PyObject *__pyx_n_s_enter;
jpayne@68 3897 PyObject *__pyx_n_s_eq;
jpayne@68 3898 PyObject *__pyx_kp_u_error_checking_for_EOF_marker;
jpayne@68 3899 PyObject *__pyx_n_s_exc_type;
jpayne@68 3900 PyObject *__pyx_n_s_exc_value;
jpayne@68 3901 PyObject *__pyx_n_s_exit;
jpayne@68 3902 PyObject *__pyx_kp_u_failed;
jpayne@68 3903 PyObject *__pyx_kp_u_failed_to_close_HFile;
jpayne@68 3904 PyObject *__pyx_kp_u_failed_to_flush_HFile;
jpayne@68 3905 PyObject *__pyx_kp_u_failed_to_open_HFile;
jpayne@68 3906 PyObject *__pyx_kp_u_failed_to_read_HFile;
jpayne@68 3907 PyObject *__pyx_kp_u_fd;
jpayne@68 3908 PyObject *__pyx_n_s_fileno;
jpayne@68 3909 PyObject *__pyx_kp_u_fileno_not_available;
jpayne@68 3910 PyObject *__pyx_n_s_flush;
jpayne@68 3911 PyObject *__pyx_n_s_format;
jpayne@68 3912 PyObject *__pyx_n_s_format_option;
jpayne@68 3913 PyObject *__pyx_n_s_format_options;
jpayne@68 3914 PyObject *__pyx_n_s_fp;
jpayne@68 3915 PyObject *__pyx_kp_u_gc;
jpayne@68 3916 PyObject *__pyx_n_s_get_reference_name;
jpayne@68 3917 PyObject *__pyx_n_s_get_tid;
jpayne@68 3918 PyObject *__pyx_n_s_get_verbosity;
jpayne@68 3919 PyObject *__pyx_n_u_get_verbosity;
jpayne@68 3920 PyObject *__pyx_n_s_getstate;
jpayne@68 3921 PyObject *__pyx_n_s_got;
jpayne@68 3922 PyObject *__pyx_n_s_ignore_truncation;
jpayne@68 3923 PyObject *__pyx_n_s_import;
jpayne@68 3924 PyObject *__pyx_n_s_init;
jpayne@68 3925 PyObject *__pyx_n_s_init_subclass;
jpayne@68 3926 PyObject *__pyx_n_s_initializing;
jpayne@68 3927 PyObject *__pyx_kp_u_invalid_contig_s;
jpayne@68 3928 PyObject *__pyx_kp_u_invalid_coordinates_start_i_stop;
jpayne@68 3929 PyObject *__pyx_kp_u_invalid_tid;
jpayne@68 3930 PyObject *__pyx_n_s_io;
jpayne@68 3931 PyObject *__pyx_n_s_is_coroutine;
jpayne@68 3932 PyObject *__pyx_n_s_is_open;
jpayne@68 3933 PyObject *__pyx_n_s_is_valid_reference_name;
jpayne@68 3934 PyObject *__pyx_n_s_is_valid_tid;
jpayne@68 3935 PyObject *__pyx_n_s_isatty;
jpayne@68 3936 PyObject *__pyx_kp_u_isenabled;
jpayne@68 3937 PyObject *__pyx_n_s_join;
jpayne@68 3938 PyObject *__pyx_n_s_line;
jpayne@68 3939 PyObject *__pyx_n_s_lines;
jpayne@68 3940 PyObject *__pyx_n_s_main;
jpayne@68 3941 PyObject *__pyx_n_s_metaclass;
jpayne@68 3942 PyObject *__pyx_kp_u_metadata_not_available_on_closed;
jpayne@68 3943 PyObject *__pyx_n_s_mode;
jpayne@68 3944 PyObject *__pyx_n_s_module;
jpayne@68 3945 PyObject *__pyx_n_s_mro_entries;
jpayne@68 3946 PyObject *__pyx_n_s_msg;
jpayne@68 3947 PyObject *__pyx_n_s_mv;
jpayne@68 3948 PyObject *__pyx_n_s_name;
jpayne@68 3949 PyObject *__pyx_n_s_name_2;
jpayne@68 3950 PyObject *__pyx_n_s_ne;
jpayne@68 3951 PyObject *__pyx_kp_u_no_BGZF_EOF_marker_file_may_be_t;
jpayne@68 3952 PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
jpayne@68 3953 PyObject *__pyx_n_s_nonzero;
jpayne@68 3954 PyObject *__pyx_n_s_object;
jpayne@68 3955 PyObject *__pyx_n_s_off;
jpayne@68 3956 PyObject *__pyx_n_s_offset;
jpayne@68 3957 PyObject *__pyx_kp_u_operation_on_closed_HFile;
jpayne@68 3958 PyObject *__pyx_n_s_opts;
jpayne@68 3959 PyObject *__pyx_n_s_os;
jpayne@68 3960 PyObject *__pyx_n_s_other;
jpayne@68 3961 PyObject *__pyx_n_s_parse_region;
jpayne@68 3962 PyObject *__pyx_n_s_part;
jpayne@68 3963 PyObject *__pyx_n_s_parts;
jpayne@68 3964 PyObject *__pyx_n_s_prepare;
jpayne@68 3965 PyObject *__pyx_n_s_pysam_libchtslib;
jpayne@68 3966 PyObject *__pyx_kp_s_pysam_libchtslib_pyx;
jpayne@68 3967 PyObject *__pyx_n_s_pyx_state;
jpayne@68 3968 PyObject *__pyx_n_s_pyx_vtable;
jpayne@68 3969 PyObject *__pyx_n_s_qualname;
jpayne@68 3970 PyObject *__pyx_n_u_r;
jpayne@68 3971 PyObject *__pyx_n_s_re;
jpayne@68 3972 PyObject *__pyx_n_s_read;
jpayne@68 3973 PyObject *__pyx_n_s_readable;
jpayne@68 3974 PyObject *__pyx_n_s_readall;
jpayne@68 3975 PyObject *__pyx_n_s_readinto;
jpayne@68 3976 PyObject *__pyx_n_s_readline;
jpayne@68 3977 PyObject *__pyx_n_s_readlines;
jpayne@68 3978 PyObject *__pyx_n_s_reduce;
jpayne@68 3979 PyObject *__pyx_n_s_reduce_cython;
jpayne@68 3980 PyObject *__pyx_n_s_reduce_ex;
jpayne@68 3981 PyObject *__pyx_n_s_reference;
jpayne@68 3982 PyObject *__pyx_n_s_region;
jpayne@68 3983 PyObject *__pyx_n_s_replace;
jpayne@68 3984 PyObject *__pyx_n_s_reset;
jpayne@68 3985 PyObject *__pyx_n_s_ret;
jpayne@68 3986 PyObject *__pyx_n_s_rstart;
jpayne@68 3987 PyObject *__pyx_n_s_rstop;
jpayne@68 3988 PyObject *__pyx_n_s_rtid;
jpayne@68 3989 PyObject *__pyx_n_s_rval;
jpayne@68 3990 PyObject *__pyx_n_s_seek;
jpayne@68 3991 PyObject *__pyx_kp_u_seek_failed_on_HFile;
jpayne@68 3992 PyObject *__pyx_kp_u_seek_not_available_in_streams;
jpayne@68 3993 PyObject *__pyx_kp_u_seek_not_implemented_in_files_co;
jpayne@68 3994 PyObject *__pyx_n_s_seekable;
jpayne@68 3995 PyObject *__pyx_n_s_self;
jpayne@68 3996 PyObject *__pyx_kp_s_self_fp_cannot_be_converted_to_a;
jpayne@68 3997 PyObject *__pyx_n_s_set_name;
jpayne@68 3998 PyObject *__pyx_n_s_set_verbosity;
jpayne@68 3999 PyObject *__pyx_n_u_set_verbosity;
jpayne@68 4000 PyObject *__pyx_n_s_setstate;
jpayne@68 4001 PyObject *__pyx_n_s_setstate_cython;
jpayne@68 4002 PyObject *__pyx_n_s_size;
jpayne@68 4003 PyObject *__pyx_n_s_spec;
jpayne@68 4004 PyObject *__pyx_n_s_split;
jpayne@68 4005 PyObject *__pyx_n_s_start;
jpayne@68 4006 PyObject *__pyx_kp_u_start_out_of_range_i;
jpayne@68 4007 PyObject *__pyx_n_s_stop;
jpayne@68 4008 PyObject *__pyx_kp_u_stop_and_end_should_not_both_be;
jpayne@68 4009 PyObject *__pyx_kp_u_stop_out_of_range_i;
jpayne@68 4010 PyObject *__pyx_kp_s_stringsource;
jpayne@68 4011 PyObject *__pyx_n_s_super;
jpayne@68 4012 PyObject *__pyx_n_s_tb;
jpayne@68 4013 PyObject *__pyx_n_s_tell;
jpayne@68 4014 PyObject *__pyx_kp_u_tell_failed_on_HFile;
jpayne@68 4015 PyObject *__pyx_kp_u_tell_not_available_in_streams;
jpayne@68 4016 PyObject *__pyx_n_s_test;
jpayne@68 4017 PyObject *__pyx_n_s_tid;
jpayne@68 4018 PyObject *__pyx_n_s_traceback;
jpayne@68 4019 PyObject *__pyx_n_s_truncate;
jpayne@68 4020 PyObject *__pyx_n_s_type;
jpayne@68 4021 PyObject *__pyx_n_s_value;
jpayne@68 4022 PyObject *__pyx_n_s_verbosity;
jpayne@68 4023 PyObject *__pyx_n_u_w;
jpayne@68 4024 PyObject *__pyx_n_s_warn;
jpayne@68 4025 PyObject *__pyx_n_s_warnings;
jpayne@68 4026 PyObject *__pyx_n_s_whence;
jpayne@68 4027 PyObject *__pyx_n_s_writable;
jpayne@68 4028 PyObject *__pyx_n_s_write;
jpayne@68 4029 PyObject *__pyx_kp_u_write_failed_on_HFile;
jpayne@68 4030 PyObject *__pyx_n_s_writelines;
jpayne@68 4031 PyObject *__pyx_int_0;
jpayne@68 4032 PyObject *__pyx_int_1;
jpayne@68 4033 PyObject *__pyx_int_neg_1;
jpayne@68 4034 int __pyx_k__18;
jpayne@68 4035 int __pyx_k__41;
jpayne@68 4036 PyObject *__pyx_codeobj_;
jpayne@68 4037 PyObject *__pyx_tuple__5;
jpayne@68 4038 PyObject *__pyx_tuple__6;
jpayne@68 4039 PyObject *__pyx_tuple__39;
jpayne@68 4040 PyObject *__pyx_tuple__43;
jpayne@68 4041 PyObject *__pyx_tuple__44;
jpayne@68 4042 PyObject *__pyx_tuple__46;
jpayne@68 4043 PyObject *__pyx_tuple__47;
jpayne@68 4044 PyObject *__pyx_tuple__48;
jpayne@68 4045 PyObject *__pyx_tuple__49;
jpayne@68 4046 PyObject *__pyx_tuple__51;
jpayne@68 4047 PyObject *__pyx_tuple__53;
jpayne@68 4048 PyObject *__pyx_tuple__54;
jpayne@68 4049 PyObject *__pyx_tuple__57;
jpayne@68 4050 PyObject *__pyx_tuple__66;
jpayne@68 4051 PyObject *__pyx_tuple__67;
jpayne@68 4052 PyObject *__pyx_tuple__68;
jpayne@68 4053 PyObject *__pyx_tuple__69;
jpayne@68 4054 PyObject *__pyx_tuple__70;
jpayne@68 4055 PyObject *__pyx_tuple__71;
jpayne@68 4056 PyObject *__pyx_tuple__72;
jpayne@68 4057 PyObject *__pyx_tuple__73;
jpayne@68 4058 PyObject *__pyx_tuple__74;
jpayne@68 4059 PyObject *__pyx_tuple__75;
jpayne@68 4060 PyObject *__pyx_tuple__76;
jpayne@68 4061 PyObject *__pyx_tuple__77;
jpayne@68 4062 PyObject *__pyx_tuple__78;
jpayne@68 4063 PyObject *__pyx_tuple__79;
jpayne@68 4064 PyObject *__pyx_tuple__80;
jpayne@68 4065 PyObject *__pyx_tuple__81;
jpayne@68 4066 PyObject *__pyx_tuple__82;
jpayne@68 4067 PyObject *__pyx_tuple__83;
jpayne@68 4068 PyObject *__pyx_tuple__84;
jpayne@68 4069 PyObject *__pyx_tuple__85;
jpayne@68 4070 PyObject *__pyx_tuple__86;
jpayne@68 4071 PyObject *__pyx_tuple__87;
jpayne@68 4072 PyObject *__pyx_tuple__88;
jpayne@68 4073 PyObject *__pyx_tuple__89;
jpayne@68 4074 PyObject *__pyx_tuple__90;
jpayne@68 4075 PyObject *__pyx_tuple__91;
jpayne@68 4076 PyObject *__pyx_tuple__92;
jpayne@68 4077 PyObject *__pyx_tuple__93;
jpayne@68 4078 PyObject *__pyx_tuple__94;
jpayne@68 4079 PyObject *__pyx_tuple__95;
jpayne@68 4080 PyObject *__pyx_tuple__96;
jpayne@68 4081 PyObject *__pyx_codeobj__2;
jpayne@68 4082 PyObject *__pyx_codeobj__3;
jpayne@68 4083 PyObject *__pyx_codeobj__4;
jpayne@68 4084 PyObject *__pyx_codeobj__7;
jpayne@68 4085 PyObject *__pyx_codeobj__8;
jpayne@68 4086 PyObject *__pyx_codeobj__9;
jpayne@68 4087 PyObject *__pyx_codeobj__10;
jpayne@68 4088 PyObject *__pyx_codeobj__11;
jpayne@68 4089 PyObject *__pyx_codeobj__12;
jpayne@68 4090 PyObject *__pyx_codeobj__14;
jpayne@68 4091 PyObject *__pyx_codeobj__15;
jpayne@68 4092 PyObject *__pyx_codeobj__16;
jpayne@68 4093 PyObject *__pyx_codeobj__17;
jpayne@68 4094 PyObject *__pyx_codeobj__19;
jpayne@68 4095 PyObject *__pyx_codeobj__20;
jpayne@68 4096 PyObject *__pyx_codeobj__21;
jpayne@68 4097 PyObject *__pyx_codeobj__22;
jpayne@68 4098 PyObject *__pyx_codeobj__23;
jpayne@68 4099 PyObject *__pyx_codeobj__24;
jpayne@68 4100 PyObject *__pyx_codeobj__25;
jpayne@68 4101 PyObject *__pyx_codeobj__26;
jpayne@68 4102 PyObject *__pyx_codeobj__27;
jpayne@68 4103 PyObject *__pyx_codeobj__28;
jpayne@68 4104 PyObject *__pyx_codeobj__29;
jpayne@68 4105 PyObject *__pyx_codeobj__30;
jpayne@68 4106 PyObject *__pyx_codeobj__31;
jpayne@68 4107 PyObject *__pyx_codeobj__32;
jpayne@68 4108 PyObject *__pyx_codeobj__33;
jpayne@68 4109 PyObject *__pyx_codeobj__34;
jpayne@68 4110 PyObject *__pyx_codeobj__35;
jpayne@68 4111 PyObject *__pyx_codeobj__36;
jpayne@68 4112 PyObject *__pyx_codeobj__37;
jpayne@68 4113 PyObject *__pyx_codeobj__38;
jpayne@68 4114 PyObject *__pyx_codeobj__40;
jpayne@68 4115 PyObject *__pyx_codeobj__42;
jpayne@68 4116 PyObject *__pyx_codeobj__45;
jpayne@68 4117 PyObject *__pyx_codeobj__50;
jpayne@68 4118 PyObject *__pyx_codeobj__52;
jpayne@68 4119 PyObject *__pyx_codeobj__60;
jpayne@68 4120 PyObject *__pyx_codeobj__61;
jpayne@68 4121 PyObject *__pyx_codeobj__62;
jpayne@68 4122 PyObject *__pyx_codeobj__63;
jpayne@68 4123 PyObject *__pyx_codeobj__64;
jpayne@68 4124 PyObject *__pyx_codeobj__65;
jpayne@68 4125 } __pyx_mstate;
jpayne@68 4126
jpayne@68 4127 #if CYTHON_USE_MODULE_STATE
jpayne@68 4128 #ifdef __cplusplus
jpayne@68 4129 namespace {
jpayne@68 4130 extern struct PyModuleDef __pyx_moduledef;
jpayne@68 4131 } /* anonymous namespace */
jpayne@68 4132 #else
jpayne@68 4133 static struct PyModuleDef __pyx_moduledef;
jpayne@68 4134 #endif
jpayne@68 4135
jpayne@68 4136 #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
jpayne@68 4137
jpayne@68 4138 #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
jpayne@68 4139
jpayne@68 4140 #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
jpayne@68 4141 #else
jpayne@68 4142 static __pyx_mstate __pyx_mstate_global_static =
jpayne@68 4143 #ifdef __cplusplus
jpayne@68 4144 {};
jpayne@68 4145 #else
jpayne@68 4146 {0};
jpayne@68 4147 #endif
jpayne@68 4148 static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
jpayne@68 4149 #endif
jpayne@68 4150 /* #### Code section: module_state_clear ### */
jpayne@68 4151 #if CYTHON_USE_MODULE_STATE
jpayne@68 4152 static int __pyx_m_clear(PyObject *m) {
jpayne@68 4153 __pyx_mstate *clear_module_state = __pyx_mstate(m);
jpayne@68 4154 if (!clear_module_state) return 0;
jpayne@68 4155 Py_CLEAR(clear_module_state->__pyx_d);
jpayne@68 4156 Py_CLEAR(clear_module_state->__pyx_b);
jpayne@68 4157 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
jpayne@68 4158 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
jpayne@68 4159 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
jpayne@68 4160 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
jpayne@68 4161 #ifdef __Pyx_CyFunction_USED
jpayne@68 4162 Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
jpayne@68 4163 #endif
jpayne@68 4164 #ifdef __Pyx_FusedFunction_USED
jpayne@68 4165 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
jpayne@68 4166 #endif
jpayne@68 4167 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
jpayne@68 4168 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
jpayne@68 4169 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
jpayne@68 4170 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_5array_array);
jpayne@68 4171 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 4172 Py_CLEAR(clear_module_state->__pyx_type_5pysam_10libchtslib_HTSFile);
jpayne@68 4173 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 4174 Py_CLEAR(clear_module_state->__pyx_type_5pysam_10libchtslib_HFile);
jpayne@68 4175 Py_CLEAR(clear_module_state->__pyx_n_u_ALIGNMENTS);
jpayne@68 4176 Py_CLEAR(clear_module_state->__pyx_kp_u_An_error_occurred_while_applying);
jpayne@68 4177 Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError);
jpayne@68 4178 Py_CLEAR(clear_module_state->__pyx_n_u_BAI);
jpayne@68 4179 Py_CLEAR(clear_module_state->__pyx_n_u_BAM);
jpayne@68 4180 Py_CLEAR(clear_module_state->__pyx_n_u_BCF);
jpayne@68 4181 Py_CLEAR(clear_module_state->__pyx_n_u_BED);
jpayne@68 4182 Py_CLEAR(clear_module_state->__pyx_n_u_BGZF);
jpayne@68 4183 Py_CLEAR(clear_module_state->__pyx_n_u_BINARY_FORMAT);
jpayne@68 4184 Py_CLEAR(clear_module_state->__pyx_n_s_CFalse);
jpayne@68 4185 Py_CLEAR(clear_module_state->__pyx_n_u_CRAI);
jpayne@68 4186 Py_CLEAR(clear_module_state->__pyx_n_u_CRAM);
jpayne@68 4187 Py_CLEAR(clear_module_state->__pyx_n_u_CSI);
jpayne@68 4188 Py_CLEAR(clear_module_state->__pyx_n_s_CTrue);
jpayne@68 4189 Py_CLEAR(clear_module_state->__pyx_n_u_CUSTOM);
jpayne@68 4190 Py_CLEAR(clear_module_state->__pyx_n_s_CallableValue);
jpayne@68 4191 Py_CLEAR(clear_module_state->__pyx_n_s_CallableValue___bool);
jpayne@68 4192 Py_CLEAR(clear_module_state->__pyx_n_s_CallableValue___call);
jpayne@68 4193 Py_CLEAR(clear_module_state->__pyx_n_s_CallableValue___eq);
jpayne@68 4194 Py_CLEAR(clear_module_state->__pyx_n_s_CallableValue___init);
jpayne@68 4195 Py_CLEAR(clear_module_state->__pyx_n_s_CallableValue___ne);
jpayne@68 4196 Py_CLEAR(clear_module_state->__pyx_n_s_CallableValue___nonzero);
jpayne@68 4197 Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_create_hfile);
jpayne@68 4198 Py_CLEAR(clear_module_state->__pyx_kp_u_Flushing);
jpayne@68 4199 Py_CLEAR(clear_module_state->__pyx_n_u_GZI);
jpayne@68 4200 Py_CLEAR(clear_module_state->__pyx_n_u_GZIP);
jpayne@68 4201 Py_CLEAR(clear_module_state->__pyx_n_s_HFile);
jpayne@68 4202 Py_CLEAR(clear_module_state->__pyx_n_u_HFile);
jpayne@68 4203 Py_CLEAR(clear_module_state->__pyx_n_s_HFile___enter);
jpayne@68 4204 Py_CLEAR(clear_module_state->__pyx_n_s_HFile___exit);
jpayne@68 4205 Py_CLEAR(clear_module_state->__pyx_n_s_HFile___reduce_cython);
jpayne@68 4206 Py_CLEAR(clear_module_state->__pyx_n_s_HFile___setstate_cython);
jpayne@68 4207 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_close);
jpayne@68 4208 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_fileno);
jpayne@68 4209 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_flush);
jpayne@68 4210 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_isatty);
jpayne@68 4211 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_read);
jpayne@68 4212 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_readable);
jpayne@68 4213 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_readall);
jpayne@68 4214 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_readinto);
jpayne@68 4215 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_readline);
jpayne@68 4216 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_readlines);
jpayne@68 4217 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_seek);
jpayne@68 4218 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_seekable);
jpayne@68 4219 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_tell);
jpayne@68 4220 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_truncate);
jpayne@68 4221 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_writable);
jpayne@68 4222 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_write);
jpayne@68 4223 Py_CLEAR(clear_module_state->__pyx_n_s_HFile_writelines);
jpayne@68 4224 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile);
jpayne@68 4225 Py_CLEAR(clear_module_state->__pyx_n_u_HTSFile);
jpayne@68 4226 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile___enter);
jpayne@68 4227 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile___exit);
jpayne@68 4228 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile___reduce_cython);
jpayne@68 4229 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile___setstate_cython);
jpayne@68 4230 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_add_hts_options);
jpayne@68 4231 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_check_truncation);
jpayne@68 4232 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_close);
jpayne@68 4233 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_flush);
jpayne@68 4234 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_get_reference_name);
jpayne@68 4235 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_get_tid);
jpayne@68 4236 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_is_valid_reference_name);
jpayne@68 4237 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_is_valid_tid);
jpayne@68 4238 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_parse_region);
jpayne@68 4239 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_reset);
jpayne@68 4240 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_seek);
jpayne@68 4241 Py_CLEAR(clear_module_state->__pyx_n_s_HTSFile_tell);
jpayne@68 4242 Py_CLEAR(clear_module_state->__pyx_n_u_INDEX);
jpayne@68 4243 Py_CLEAR(clear_module_state->__pyx_n_s_IOError);
jpayne@68 4244 Py_CLEAR(clear_module_state->__pyx_kp_u_I_O_operation_on_closed_file);
jpayne@68 4245 Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
jpayne@68 4246 Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_format_option_specified);
jpayne@68 4247 Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
jpayne@68 4248 Py_CLEAR(clear_module_state->__pyx_n_u_NONE);
jpayne@68 4249 Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError);
jpayne@68 4250 Py_CLEAR(clear_module_state->__pyx_n_s_OSError);
jpayne@68 4251 Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError);
jpayne@68 4252 Py_CLEAR(clear_module_state->__pyx_n_u_REGIONS);
jpayne@68 4253 Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError);
jpayne@68 4254 Py_CLEAR(clear_module_state->__pyx_n_u_SAM);
jpayne@68 4255 Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_SET);
jpayne@68 4256 Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration);
jpayne@68 4257 Py_CLEAR(clear_module_state->__pyx_n_u_TBI);
jpayne@68 4258 Py_CLEAR(clear_module_state->__pyx_n_u_TEXT_FORMAT);
jpayne@68 4259 Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
jpayne@68 4260 Py_CLEAR(clear_module_state->__pyx_n_u_UNKNOWN);
jpayne@68 4261 Py_CLEAR(clear_module_state->__pyx_n_u_VARIANTS);
jpayne@68 4262 Py_CLEAR(clear_module_state->__pyx_n_u_VCF);
jpayne@68 4263 Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
jpayne@68 4264 Py_CLEAR(clear_module_state->__pyx_kp_b__13);
jpayne@68 4265 Py_CLEAR(clear_module_state->__pyx_kp_u__55);
jpayne@68 4266 Py_CLEAR(clear_module_state->__pyx_kp_u__56);
jpayne@68 4267 Py_CLEAR(clear_module_state->__pyx_n_s__58);
jpayne@68 4268 Py_CLEAR(clear_module_state->__pyx_kp_u__58);
jpayne@68 4269 Py_CLEAR(clear_module_state->__pyx_kp_u__59);
jpayne@68 4270 Py_CLEAR(clear_module_state->__pyx_n_s__97);
jpayne@68 4271 Py_CLEAR(clear_module_state->__pyx_n_s_add_hts_options);
jpayne@68 4272 Py_CLEAR(clear_module_state->__pyx_n_s_all);
jpayne@68 4273 Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
jpayne@68 4274 Py_CLEAR(clear_module_state->__pyx_n_b_b);
jpayne@68 4275 Py_CLEAR(clear_module_state->__pyx_n_s_b);
jpayne@68 4276 Py_CLEAR(clear_module_state->__pyx_n_s_bgzfp);
jpayne@68 4277 Py_CLEAR(clear_module_state->__pyx_n_s_bool);
jpayne@68 4278 Py_CLEAR(clear_module_state->__pyx_n_s_buf);
jpayne@68 4279 Py_CLEAR(clear_module_state->__pyx_n_s_bytes_read);
jpayne@68 4280 Py_CLEAR(clear_module_state->__pyx_n_b_c);
jpayne@68 4281 Py_CLEAR(clear_module_state->__pyx_n_s_call);
jpayne@68 4282 Py_CLEAR(clear_module_state->__pyx_n_s_check_truncation);
jpayne@68 4283 Py_CLEAR(clear_module_state->__pyx_n_s_chunk_size);
jpayne@68 4284 Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
jpayne@68 4285 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
jpayne@68 4286 Py_CLEAR(clear_module_state->__pyx_n_s_close);
jpayne@68 4287 Py_CLEAR(clear_module_state->__pyx_n_s_closefd);
jpayne@68 4288 Py_CLEAR(clear_module_state->__pyx_n_s_contig);
jpayne@68 4289 Py_CLEAR(clear_module_state->__pyx_kp_u_contig_and_reference_should_not);
jpayne@68 4290 Py_CLEAR(clear_module_state->__pyx_n_s_coord);
jpayne@68 4291 Py_CLEAR(clear_module_state->__pyx_n_s_cpart);
jpayne@68 4292 Py_CLEAR(clear_module_state->__pyx_n_s_dict);
jpayne@68 4293 Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
jpayne@68 4294 Py_CLEAR(clear_module_state->__pyx_n_s_doc);
jpayne@68 4295 Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
jpayne@68 4296 Py_CLEAR(clear_module_state->__pyx_n_s_end);
jpayne@68 4297 Py_CLEAR(clear_module_state->__pyx_n_s_enter);
jpayne@68 4298 Py_CLEAR(clear_module_state->__pyx_n_s_eq);
jpayne@68 4299 Py_CLEAR(clear_module_state->__pyx_kp_u_error_checking_for_EOF_marker);
jpayne@68 4300 Py_CLEAR(clear_module_state->__pyx_n_s_exc_type);
jpayne@68 4301 Py_CLEAR(clear_module_state->__pyx_n_s_exc_value);
jpayne@68 4302 Py_CLEAR(clear_module_state->__pyx_n_s_exit);
jpayne@68 4303 Py_CLEAR(clear_module_state->__pyx_kp_u_failed);
jpayne@68 4304 Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_close_HFile);
jpayne@68 4305 Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_flush_HFile);
jpayne@68 4306 Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_open_HFile);
jpayne@68 4307 Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_read_HFile);
jpayne@68 4308 Py_CLEAR(clear_module_state->__pyx_kp_u_fd);
jpayne@68 4309 Py_CLEAR(clear_module_state->__pyx_n_s_fileno);
jpayne@68 4310 Py_CLEAR(clear_module_state->__pyx_kp_u_fileno_not_available);
jpayne@68 4311 Py_CLEAR(clear_module_state->__pyx_n_s_flush);
jpayne@68 4312 Py_CLEAR(clear_module_state->__pyx_n_s_format);
jpayne@68 4313 Py_CLEAR(clear_module_state->__pyx_n_s_format_option);
jpayne@68 4314 Py_CLEAR(clear_module_state->__pyx_n_s_format_options);
jpayne@68 4315 Py_CLEAR(clear_module_state->__pyx_n_s_fp);
jpayne@68 4316 Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
jpayne@68 4317 Py_CLEAR(clear_module_state->__pyx_n_s_get_reference_name);
jpayne@68 4318 Py_CLEAR(clear_module_state->__pyx_n_s_get_tid);
jpayne@68 4319 Py_CLEAR(clear_module_state->__pyx_n_s_get_verbosity);
jpayne@68 4320 Py_CLEAR(clear_module_state->__pyx_n_u_get_verbosity);
jpayne@68 4321 Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
jpayne@68 4322 Py_CLEAR(clear_module_state->__pyx_n_s_got);
jpayne@68 4323 Py_CLEAR(clear_module_state->__pyx_n_s_ignore_truncation);
jpayne@68 4324 Py_CLEAR(clear_module_state->__pyx_n_s_import);
jpayne@68 4325 Py_CLEAR(clear_module_state->__pyx_n_s_init);
jpayne@68 4326 Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
jpayne@68 4327 Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
jpayne@68 4328 Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_contig_s);
jpayne@68 4329 Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_coordinates_start_i_stop);
jpayne@68 4330 Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_tid);
jpayne@68 4331 Py_CLEAR(clear_module_state->__pyx_n_s_io);
jpayne@68 4332 Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
jpayne@68 4333 Py_CLEAR(clear_module_state->__pyx_n_s_is_open);
jpayne@68 4334 Py_CLEAR(clear_module_state->__pyx_n_s_is_valid_reference_name);
jpayne@68 4335 Py_CLEAR(clear_module_state->__pyx_n_s_is_valid_tid);
jpayne@68 4336 Py_CLEAR(clear_module_state->__pyx_n_s_isatty);
jpayne@68 4337 Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
jpayne@68 4338 Py_CLEAR(clear_module_state->__pyx_n_s_join);
jpayne@68 4339 Py_CLEAR(clear_module_state->__pyx_n_s_line);
jpayne@68 4340 Py_CLEAR(clear_module_state->__pyx_n_s_lines);
jpayne@68 4341 Py_CLEAR(clear_module_state->__pyx_n_s_main);
jpayne@68 4342 Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
jpayne@68 4343 Py_CLEAR(clear_module_state->__pyx_kp_u_metadata_not_available_on_closed);
jpayne@68 4344 Py_CLEAR(clear_module_state->__pyx_n_s_mode);
jpayne@68 4345 Py_CLEAR(clear_module_state->__pyx_n_s_module);
jpayne@68 4346 Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
jpayne@68 4347 Py_CLEAR(clear_module_state->__pyx_n_s_msg);
jpayne@68 4348 Py_CLEAR(clear_module_state->__pyx_n_s_mv);
jpayne@68 4349 Py_CLEAR(clear_module_state->__pyx_n_s_name);
jpayne@68 4350 Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
jpayne@68 4351 Py_CLEAR(clear_module_state->__pyx_n_s_ne);
jpayne@68 4352 Py_CLEAR(clear_module_state->__pyx_kp_u_no_BGZF_EOF_marker_file_may_be_t);
jpayne@68 4353 Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
jpayne@68 4354 Py_CLEAR(clear_module_state->__pyx_n_s_nonzero);
jpayne@68 4355 Py_CLEAR(clear_module_state->__pyx_n_s_object);
jpayne@68 4356 Py_CLEAR(clear_module_state->__pyx_n_s_off);
jpayne@68 4357 Py_CLEAR(clear_module_state->__pyx_n_s_offset);
jpayne@68 4358 Py_CLEAR(clear_module_state->__pyx_kp_u_operation_on_closed_HFile);
jpayne@68 4359 Py_CLEAR(clear_module_state->__pyx_n_s_opts);
jpayne@68 4360 Py_CLEAR(clear_module_state->__pyx_n_s_os);
jpayne@68 4361 Py_CLEAR(clear_module_state->__pyx_n_s_other);
jpayne@68 4362 Py_CLEAR(clear_module_state->__pyx_n_s_parse_region);
jpayne@68 4363 Py_CLEAR(clear_module_state->__pyx_n_s_part);
jpayne@68 4364 Py_CLEAR(clear_module_state->__pyx_n_s_parts);
jpayne@68 4365 Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
jpayne@68 4366 Py_CLEAR(clear_module_state->__pyx_n_s_pysam_libchtslib);
jpayne@68 4367 Py_CLEAR(clear_module_state->__pyx_kp_s_pysam_libchtslib_pyx);
jpayne@68 4368 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
jpayne@68 4369 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
jpayne@68 4370 Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
jpayne@68 4371 Py_CLEAR(clear_module_state->__pyx_n_u_r);
jpayne@68 4372 Py_CLEAR(clear_module_state->__pyx_n_s_re);
jpayne@68 4373 Py_CLEAR(clear_module_state->__pyx_n_s_read);
jpayne@68 4374 Py_CLEAR(clear_module_state->__pyx_n_s_readable);
jpayne@68 4375 Py_CLEAR(clear_module_state->__pyx_n_s_readall);
jpayne@68 4376 Py_CLEAR(clear_module_state->__pyx_n_s_readinto);
jpayne@68 4377 Py_CLEAR(clear_module_state->__pyx_n_s_readline);
jpayne@68 4378 Py_CLEAR(clear_module_state->__pyx_n_s_readlines);
jpayne@68 4379 Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
jpayne@68 4380 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
jpayne@68 4381 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
jpayne@68 4382 Py_CLEAR(clear_module_state->__pyx_n_s_reference);
jpayne@68 4383 Py_CLEAR(clear_module_state->__pyx_n_s_region);
jpayne@68 4384 Py_CLEAR(clear_module_state->__pyx_n_s_replace);
jpayne@68 4385 Py_CLEAR(clear_module_state->__pyx_n_s_reset);
jpayne@68 4386 Py_CLEAR(clear_module_state->__pyx_n_s_ret);
jpayne@68 4387 Py_CLEAR(clear_module_state->__pyx_n_s_rstart);
jpayne@68 4388 Py_CLEAR(clear_module_state->__pyx_n_s_rstop);
jpayne@68 4389 Py_CLEAR(clear_module_state->__pyx_n_s_rtid);
jpayne@68 4390 Py_CLEAR(clear_module_state->__pyx_n_s_rval);
jpayne@68 4391 Py_CLEAR(clear_module_state->__pyx_n_s_seek);
jpayne@68 4392 Py_CLEAR(clear_module_state->__pyx_kp_u_seek_failed_on_HFile);
jpayne@68 4393 Py_CLEAR(clear_module_state->__pyx_kp_u_seek_not_available_in_streams);
jpayne@68 4394 Py_CLEAR(clear_module_state->__pyx_kp_u_seek_not_implemented_in_files_co);
jpayne@68 4395 Py_CLEAR(clear_module_state->__pyx_n_s_seekable);
jpayne@68 4396 Py_CLEAR(clear_module_state->__pyx_n_s_self);
jpayne@68 4397 Py_CLEAR(clear_module_state->__pyx_kp_s_self_fp_cannot_be_converted_to_a);
jpayne@68 4398 Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
jpayne@68 4399 Py_CLEAR(clear_module_state->__pyx_n_s_set_verbosity);
jpayne@68 4400 Py_CLEAR(clear_module_state->__pyx_n_u_set_verbosity);
jpayne@68 4401 Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
jpayne@68 4402 Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
jpayne@68 4403 Py_CLEAR(clear_module_state->__pyx_n_s_size);
jpayne@68 4404 Py_CLEAR(clear_module_state->__pyx_n_s_spec);
jpayne@68 4405 Py_CLEAR(clear_module_state->__pyx_n_s_split);
jpayne@68 4406 Py_CLEAR(clear_module_state->__pyx_n_s_start);
jpayne@68 4407 Py_CLEAR(clear_module_state->__pyx_kp_u_start_out_of_range_i);
jpayne@68 4408 Py_CLEAR(clear_module_state->__pyx_n_s_stop);
jpayne@68 4409 Py_CLEAR(clear_module_state->__pyx_kp_u_stop_and_end_should_not_both_be);
jpayne@68 4410 Py_CLEAR(clear_module_state->__pyx_kp_u_stop_out_of_range_i);
jpayne@68 4411 Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
jpayne@68 4412 Py_CLEAR(clear_module_state->__pyx_n_s_super);
jpayne@68 4413 Py_CLEAR(clear_module_state->__pyx_n_s_tb);
jpayne@68 4414 Py_CLEAR(clear_module_state->__pyx_n_s_tell);
jpayne@68 4415 Py_CLEAR(clear_module_state->__pyx_kp_u_tell_failed_on_HFile);
jpayne@68 4416 Py_CLEAR(clear_module_state->__pyx_kp_u_tell_not_available_in_streams);
jpayne@68 4417 Py_CLEAR(clear_module_state->__pyx_n_s_test);
jpayne@68 4418 Py_CLEAR(clear_module_state->__pyx_n_s_tid);
jpayne@68 4419 Py_CLEAR(clear_module_state->__pyx_n_s_traceback);
jpayne@68 4420 Py_CLEAR(clear_module_state->__pyx_n_s_truncate);
jpayne@68 4421 Py_CLEAR(clear_module_state->__pyx_n_s_type);
jpayne@68 4422 Py_CLEAR(clear_module_state->__pyx_n_s_value);
jpayne@68 4423 Py_CLEAR(clear_module_state->__pyx_n_s_verbosity);
jpayne@68 4424 Py_CLEAR(clear_module_state->__pyx_n_u_w);
jpayne@68 4425 Py_CLEAR(clear_module_state->__pyx_n_s_warn);
jpayne@68 4426 Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
jpayne@68 4427 Py_CLEAR(clear_module_state->__pyx_n_s_whence);
jpayne@68 4428 Py_CLEAR(clear_module_state->__pyx_n_s_writable);
jpayne@68 4429 Py_CLEAR(clear_module_state->__pyx_n_s_write);
jpayne@68 4430 Py_CLEAR(clear_module_state->__pyx_kp_u_write_failed_on_HFile);
jpayne@68 4431 Py_CLEAR(clear_module_state->__pyx_n_s_writelines);
jpayne@68 4432 Py_CLEAR(clear_module_state->__pyx_int_0);
jpayne@68 4433 Py_CLEAR(clear_module_state->__pyx_int_1);
jpayne@68 4434 Py_CLEAR(clear_module_state->__pyx_int_neg_1);
jpayne@68 4435 Py_CLEAR(clear_module_state->__pyx_codeobj_);
jpayne@68 4436 Py_CLEAR(clear_module_state->__pyx_tuple__5);
jpayne@68 4437 Py_CLEAR(clear_module_state->__pyx_tuple__6);
jpayne@68 4438 Py_CLEAR(clear_module_state->__pyx_tuple__39);
jpayne@68 4439 Py_CLEAR(clear_module_state->__pyx_tuple__43);
jpayne@68 4440 Py_CLEAR(clear_module_state->__pyx_tuple__44);
jpayne@68 4441 Py_CLEAR(clear_module_state->__pyx_tuple__46);
jpayne@68 4442 Py_CLEAR(clear_module_state->__pyx_tuple__47);
jpayne@68 4443 Py_CLEAR(clear_module_state->__pyx_tuple__48);
jpayne@68 4444 Py_CLEAR(clear_module_state->__pyx_tuple__49);
jpayne@68 4445 Py_CLEAR(clear_module_state->__pyx_tuple__51);
jpayne@68 4446 Py_CLEAR(clear_module_state->__pyx_tuple__53);
jpayne@68 4447 Py_CLEAR(clear_module_state->__pyx_tuple__54);
jpayne@68 4448 Py_CLEAR(clear_module_state->__pyx_tuple__57);
jpayne@68 4449 Py_CLEAR(clear_module_state->__pyx_tuple__66);
jpayne@68 4450 Py_CLEAR(clear_module_state->__pyx_tuple__67);
jpayne@68 4451 Py_CLEAR(clear_module_state->__pyx_tuple__68);
jpayne@68 4452 Py_CLEAR(clear_module_state->__pyx_tuple__69);
jpayne@68 4453 Py_CLEAR(clear_module_state->__pyx_tuple__70);
jpayne@68 4454 Py_CLEAR(clear_module_state->__pyx_tuple__71);
jpayne@68 4455 Py_CLEAR(clear_module_state->__pyx_tuple__72);
jpayne@68 4456 Py_CLEAR(clear_module_state->__pyx_tuple__73);
jpayne@68 4457 Py_CLEAR(clear_module_state->__pyx_tuple__74);
jpayne@68 4458 Py_CLEAR(clear_module_state->__pyx_tuple__75);
jpayne@68 4459 Py_CLEAR(clear_module_state->__pyx_tuple__76);
jpayne@68 4460 Py_CLEAR(clear_module_state->__pyx_tuple__77);
jpayne@68 4461 Py_CLEAR(clear_module_state->__pyx_tuple__78);
jpayne@68 4462 Py_CLEAR(clear_module_state->__pyx_tuple__79);
jpayne@68 4463 Py_CLEAR(clear_module_state->__pyx_tuple__80);
jpayne@68 4464 Py_CLEAR(clear_module_state->__pyx_tuple__81);
jpayne@68 4465 Py_CLEAR(clear_module_state->__pyx_tuple__82);
jpayne@68 4466 Py_CLEAR(clear_module_state->__pyx_tuple__83);
jpayne@68 4467 Py_CLEAR(clear_module_state->__pyx_tuple__84);
jpayne@68 4468 Py_CLEAR(clear_module_state->__pyx_tuple__85);
jpayne@68 4469 Py_CLEAR(clear_module_state->__pyx_tuple__86);
jpayne@68 4470 Py_CLEAR(clear_module_state->__pyx_tuple__87);
jpayne@68 4471 Py_CLEAR(clear_module_state->__pyx_tuple__88);
jpayne@68 4472 Py_CLEAR(clear_module_state->__pyx_tuple__89);
jpayne@68 4473 Py_CLEAR(clear_module_state->__pyx_tuple__90);
jpayne@68 4474 Py_CLEAR(clear_module_state->__pyx_tuple__91);
jpayne@68 4475 Py_CLEAR(clear_module_state->__pyx_tuple__92);
jpayne@68 4476 Py_CLEAR(clear_module_state->__pyx_tuple__93);
jpayne@68 4477 Py_CLEAR(clear_module_state->__pyx_tuple__94);
jpayne@68 4478 Py_CLEAR(clear_module_state->__pyx_tuple__95);
jpayne@68 4479 Py_CLEAR(clear_module_state->__pyx_tuple__96);
jpayne@68 4480 Py_CLEAR(clear_module_state->__pyx_codeobj__2);
jpayne@68 4481 Py_CLEAR(clear_module_state->__pyx_codeobj__3);
jpayne@68 4482 Py_CLEAR(clear_module_state->__pyx_codeobj__4);
jpayne@68 4483 Py_CLEAR(clear_module_state->__pyx_codeobj__7);
jpayne@68 4484 Py_CLEAR(clear_module_state->__pyx_codeobj__8);
jpayne@68 4485 Py_CLEAR(clear_module_state->__pyx_codeobj__9);
jpayne@68 4486 Py_CLEAR(clear_module_state->__pyx_codeobj__10);
jpayne@68 4487 Py_CLEAR(clear_module_state->__pyx_codeobj__11);
jpayne@68 4488 Py_CLEAR(clear_module_state->__pyx_codeobj__12);
jpayne@68 4489 Py_CLEAR(clear_module_state->__pyx_codeobj__14);
jpayne@68 4490 Py_CLEAR(clear_module_state->__pyx_codeobj__15);
jpayne@68 4491 Py_CLEAR(clear_module_state->__pyx_codeobj__16);
jpayne@68 4492 Py_CLEAR(clear_module_state->__pyx_codeobj__17);
jpayne@68 4493 Py_CLEAR(clear_module_state->__pyx_codeobj__19);
jpayne@68 4494 Py_CLEAR(clear_module_state->__pyx_codeobj__20);
jpayne@68 4495 Py_CLEAR(clear_module_state->__pyx_codeobj__21);
jpayne@68 4496 Py_CLEAR(clear_module_state->__pyx_codeobj__22);
jpayne@68 4497 Py_CLEAR(clear_module_state->__pyx_codeobj__23);
jpayne@68 4498 Py_CLEAR(clear_module_state->__pyx_codeobj__24);
jpayne@68 4499 Py_CLEAR(clear_module_state->__pyx_codeobj__25);
jpayne@68 4500 Py_CLEAR(clear_module_state->__pyx_codeobj__26);
jpayne@68 4501 Py_CLEAR(clear_module_state->__pyx_codeobj__27);
jpayne@68 4502 Py_CLEAR(clear_module_state->__pyx_codeobj__28);
jpayne@68 4503 Py_CLEAR(clear_module_state->__pyx_codeobj__29);
jpayne@68 4504 Py_CLEAR(clear_module_state->__pyx_codeobj__30);
jpayne@68 4505 Py_CLEAR(clear_module_state->__pyx_codeobj__31);
jpayne@68 4506 Py_CLEAR(clear_module_state->__pyx_codeobj__32);
jpayne@68 4507 Py_CLEAR(clear_module_state->__pyx_codeobj__33);
jpayne@68 4508 Py_CLEAR(clear_module_state->__pyx_codeobj__34);
jpayne@68 4509 Py_CLEAR(clear_module_state->__pyx_codeobj__35);
jpayne@68 4510 Py_CLEAR(clear_module_state->__pyx_codeobj__36);
jpayne@68 4511 Py_CLEAR(clear_module_state->__pyx_codeobj__37);
jpayne@68 4512 Py_CLEAR(clear_module_state->__pyx_codeobj__38);
jpayne@68 4513 Py_CLEAR(clear_module_state->__pyx_codeobj__40);
jpayne@68 4514 Py_CLEAR(clear_module_state->__pyx_codeobj__42);
jpayne@68 4515 Py_CLEAR(clear_module_state->__pyx_codeobj__45);
jpayne@68 4516 Py_CLEAR(clear_module_state->__pyx_codeobj__50);
jpayne@68 4517 Py_CLEAR(clear_module_state->__pyx_codeobj__52);
jpayne@68 4518 Py_CLEAR(clear_module_state->__pyx_codeobj__60);
jpayne@68 4519 Py_CLEAR(clear_module_state->__pyx_codeobj__61);
jpayne@68 4520 Py_CLEAR(clear_module_state->__pyx_codeobj__62);
jpayne@68 4521 Py_CLEAR(clear_module_state->__pyx_codeobj__63);
jpayne@68 4522 Py_CLEAR(clear_module_state->__pyx_codeobj__64);
jpayne@68 4523 Py_CLEAR(clear_module_state->__pyx_codeobj__65);
jpayne@68 4524 return 0;
jpayne@68 4525 }
jpayne@68 4526 #endif
jpayne@68 4527 /* #### Code section: module_state_traverse ### */
jpayne@68 4528 #if CYTHON_USE_MODULE_STATE
jpayne@68 4529 static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
jpayne@68 4530 __pyx_mstate *traverse_module_state = __pyx_mstate(m);
jpayne@68 4531 if (!traverse_module_state) return 0;
jpayne@68 4532 Py_VISIT(traverse_module_state->__pyx_d);
jpayne@68 4533 Py_VISIT(traverse_module_state->__pyx_b);
jpayne@68 4534 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
jpayne@68 4535 Py_VISIT(traverse_module_state->__pyx_empty_tuple);
jpayne@68 4536 Py_VISIT(traverse_module_state->__pyx_empty_bytes);
jpayne@68 4537 Py_VISIT(traverse_module_state->__pyx_empty_unicode);
jpayne@68 4538 #ifdef __Pyx_CyFunction_USED
jpayne@68 4539 Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
jpayne@68 4540 #endif
jpayne@68 4541 #ifdef __Pyx_FusedFunction_USED
jpayne@68 4542 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
jpayne@68 4543 #endif
jpayne@68 4544 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
jpayne@68 4545 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
jpayne@68 4546 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
jpayne@68 4547 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_5array_array);
jpayne@68 4548 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 4549 Py_VISIT(traverse_module_state->__pyx_type_5pysam_10libchtslib_HTSFile);
jpayne@68 4550 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 4551 Py_VISIT(traverse_module_state->__pyx_type_5pysam_10libchtslib_HFile);
jpayne@68 4552 Py_VISIT(traverse_module_state->__pyx_n_u_ALIGNMENTS);
jpayne@68 4553 Py_VISIT(traverse_module_state->__pyx_kp_u_An_error_occurred_while_applying);
jpayne@68 4554 Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError);
jpayne@68 4555 Py_VISIT(traverse_module_state->__pyx_n_u_BAI);
jpayne@68 4556 Py_VISIT(traverse_module_state->__pyx_n_u_BAM);
jpayne@68 4557 Py_VISIT(traverse_module_state->__pyx_n_u_BCF);
jpayne@68 4558 Py_VISIT(traverse_module_state->__pyx_n_u_BED);
jpayne@68 4559 Py_VISIT(traverse_module_state->__pyx_n_u_BGZF);
jpayne@68 4560 Py_VISIT(traverse_module_state->__pyx_n_u_BINARY_FORMAT);
jpayne@68 4561 Py_VISIT(traverse_module_state->__pyx_n_s_CFalse);
jpayne@68 4562 Py_VISIT(traverse_module_state->__pyx_n_u_CRAI);
jpayne@68 4563 Py_VISIT(traverse_module_state->__pyx_n_u_CRAM);
jpayne@68 4564 Py_VISIT(traverse_module_state->__pyx_n_u_CSI);
jpayne@68 4565 Py_VISIT(traverse_module_state->__pyx_n_s_CTrue);
jpayne@68 4566 Py_VISIT(traverse_module_state->__pyx_n_u_CUSTOM);
jpayne@68 4567 Py_VISIT(traverse_module_state->__pyx_n_s_CallableValue);
jpayne@68 4568 Py_VISIT(traverse_module_state->__pyx_n_s_CallableValue___bool);
jpayne@68 4569 Py_VISIT(traverse_module_state->__pyx_n_s_CallableValue___call);
jpayne@68 4570 Py_VISIT(traverse_module_state->__pyx_n_s_CallableValue___eq);
jpayne@68 4571 Py_VISIT(traverse_module_state->__pyx_n_s_CallableValue___init);
jpayne@68 4572 Py_VISIT(traverse_module_state->__pyx_n_s_CallableValue___ne);
jpayne@68 4573 Py_VISIT(traverse_module_state->__pyx_n_s_CallableValue___nonzero);
jpayne@68 4574 Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_create_hfile);
jpayne@68 4575 Py_VISIT(traverse_module_state->__pyx_kp_u_Flushing);
jpayne@68 4576 Py_VISIT(traverse_module_state->__pyx_n_u_GZI);
jpayne@68 4577 Py_VISIT(traverse_module_state->__pyx_n_u_GZIP);
jpayne@68 4578 Py_VISIT(traverse_module_state->__pyx_n_s_HFile);
jpayne@68 4579 Py_VISIT(traverse_module_state->__pyx_n_u_HFile);
jpayne@68 4580 Py_VISIT(traverse_module_state->__pyx_n_s_HFile___enter);
jpayne@68 4581 Py_VISIT(traverse_module_state->__pyx_n_s_HFile___exit);
jpayne@68 4582 Py_VISIT(traverse_module_state->__pyx_n_s_HFile___reduce_cython);
jpayne@68 4583 Py_VISIT(traverse_module_state->__pyx_n_s_HFile___setstate_cython);
jpayne@68 4584 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_close);
jpayne@68 4585 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_fileno);
jpayne@68 4586 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_flush);
jpayne@68 4587 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_isatty);
jpayne@68 4588 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_read);
jpayne@68 4589 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_readable);
jpayne@68 4590 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_readall);
jpayne@68 4591 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_readinto);
jpayne@68 4592 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_readline);
jpayne@68 4593 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_readlines);
jpayne@68 4594 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_seek);
jpayne@68 4595 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_seekable);
jpayne@68 4596 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_tell);
jpayne@68 4597 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_truncate);
jpayne@68 4598 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_writable);
jpayne@68 4599 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_write);
jpayne@68 4600 Py_VISIT(traverse_module_state->__pyx_n_s_HFile_writelines);
jpayne@68 4601 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile);
jpayne@68 4602 Py_VISIT(traverse_module_state->__pyx_n_u_HTSFile);
jpayne@68 4603 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile___enter);
jpayne@68 4604 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile___exit);
jpayne@68 4605 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile___reduce_cython);
jpayne@68 4606 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile___setstate_cython);
jpayne@68 4607 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_add_hts_options);
jpayne@68 4608 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_check_truncation);
jpayne@68 4609 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_close);
jpayne@68 4610 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_flush);
jpayne@68 4611 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_get_reference_name);
jpayne@68 4612 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_get_tid);
jpayne@68 4613 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_is_valid_reference_name);
jpayne@68 4614 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_is_valid_tid);
jpayne@68 4615 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_parse_region);
jpayne@68 4616 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_reset);
jpayne@68 4617 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_seek);
jpayne@68 4618 Py_VISIT(traverse_module_state->__pyx_n_s_HTSFile_tell);
jpayne@68 4619 Py_VISIT(traverse_module_state->__pyx_n_u_INDEX);
jpayne@68 4620 Py_VISIT(traverse_module_state->__pyx_n_s_IOError);
jpayne@68 4621 Py_VISIT(traverse_module_state->__pyx_kp_u_I_O_operation_on_closed_file);
jpayne@68 4622 Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
jpayne@68 4623 Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_format_option_specified);
jpayne@68 4624 Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
jpayne@68 4625 Py_VISIT(traverse_module_state->__pyx_n_u_NONE);
jpayne@68 4626 Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError);
jpayne@68 4627 Py_VISIT(traverse_module_state->__pyx_n_s_OSError);
jpayne@68 4628 Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError);
jpayne@68 4629 Py_VISIT(traverse_module_state->__pyx_n_u_REGIONS);
jpayne@68 4630 Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError);
jpayne@68 4631 Py_VISIT(traverse_module_state->__pyx_n_u_SAM);
jpayne@68 4632 Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_SET);
jpayne@68 4633 Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration);
jpayne@68 4634 Py_VISIT(traverse_module_state->__pyx_n_u_TBI);
jpayne@68 4635 Py_VISIT(traverse_module_state->__pyx_n_u_TEXT_FORMAT);
jpayne@68 4636 Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
jpayne@68 4637 Py_VISIT(traverse_module_state->__pyx_n_u_UNKNOWN);
jpayne@68 4638 Py_VISIT(traverse_module_state->__pyx_n_u_VARIANTS);
jpayne@68 4639 Py_VISIT(traverse_module_state->__pyx_n_u_VCF);
jpayne@68 4640 Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
jpayne@68 4641 Py_VISIT(traverse_module_state->__pyx_kp_b__13);
jpayne@68 4642 Py_VISIT(traverse_module_state->__pyx_kp_u__55);
jpayne@68 4643 Py_VISIT(traverse_module_state->__pyx_kp_u__56);
jpayne@68 4644 Py_VISIT(traverse_module_state->__pyx_n_s__58);
jpayne@68 4645 Py_VISIT(traverse_module_state->__pyx_kp_u__58);
jpayne@68 4646 Py_VISIT(traverse_module_state->__pyx_kp_u__59);
jpayne@68 4647 Py_VISIT(traverse_module_state->__pyx_n_s__97);
jpayne@68 4648 Py_VISIT(traverse_module_state->__pyx_n_s_add_hts_options);
jpayne@68 4649 Py_VISIT(traverse_module_state->__pyx_n_s_all);
jpayne@68 4650 Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
jpayne@68 4651 Py_VISIT(traverse_module_state->__pyx_n_b_b);
jpayne@68 4652 Py_VISIT(traverse_module_state->__pyx_n_s_b);
jpayne@68 4653 Py_VISIT(traverse_module_state->__pyx_n_s_bgzfp);
jpayne@68 4654 Py_VISIT(traverse_module_state->__pyx_n_s_bool);
jpayne@68 4655 Py_VISIT(traverse_module_state->__pyx_n_s_buf);
jpayne@68 4656 Py_VISIT(traverse_module_state->__pyx_n_s_bytes_read);
jpayne@68 4657 Py_VISIT(traverse_module_state->__pyx_n_b_c);
jpayne@68 4658 Py_VISIT(traverse_module_state->__pyx_n_s_call);
jpayne@68 4659 Py_VISIT(traverse_module_state->__pyx_n_s_check_truncation);
jpayne@68 4660 Py_VISIT(traverse_module_state->__pyx_n_s_chunk_size);
jpayne@68 4661 Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
jpayne@68 4662 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
jpayne@68 4663 Py_VISIT(traverse_module_state->__pyx_n_s_close);
jpayne@68 4664 Py_VISIT(traverse_module_state->__pyx_n_s_closefd);
jpayne@68 4665 Py_VISIT(traverse_module_state->__pyx_n_s_contig);
jpayne@68 4666 Py_VISIT(traverse_module_state->__pyx_kp_u_contig_and_reference_should_not);
jpayne@68 4667 Py_VISIT(traverse_module_state->__pyx_n_s_coord);
jpayne@68 4668 Py_VISIT(traverse_module_state->__pyx_n_s_cpart);
jpayne@68 4669 Py_VISIT(traverse_module_state->__pyx_n_s_dict);
jpayne@68 4670 Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
jpayne@68 4671 Py_VISIT(traverse_module_state->__pyx_n_s_doc);
jpayne@68 4672 Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
jpayne@68 4673 Py_VISIT(traverse_module_state->__pyx_n_s_end);
jpayne@68 4674 Py_VISIT(traverse_module_state->__pyx_n_s_enter);
jpayne@68 4675 Py_VISIT(traverse_module_state->__pyx_n_s_eq);
jpayne@68 4676 Py_VISIT(traverse_module_state->__pyx_kp_u_error_checking_for_EOF_marker);
jpayne@68 4677 Py_VISIT(traverse_module_state->__pyx_n_s_exc_type);
jpayne@68 4678 Py_VISIT(traverse_module_state->__pyx_n_s_exc_value);
jpayne@68 4679 Py_VISIT(traverse_module_state->__pyx_n_s_exit);
jpayne@68 4680 Py_VISIT(traverse_module_state->__pyx_kp_u_failed);
jpayne@68 4681 Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_close_HFile);
jpayne@68 4682 Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_flush_HFile);
jpayne@68 4683 Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_open_HFile);
jpayne@68 4684 Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_read_HFile);
jpayne@68 4685 Py_VISIT(traverse_module_state->__pyx_kp_u_fd);
jpayne@68 4686 Py_VISIT(traverse_module_state->__pyx_n_s_fileno);
jpayne@68 4687 Py_VISIT(traverse_module_state->__pyx_kp_u_fileno_not_available);
jpayne@68 4688 Py_VISIT(traverse_module_state->__pyx_n_s_flush);
jpayne@68 4689 Py_VISIT(traverse_module_state->__pyx_n_s_format);
jpayne@68 4690 Py_VISIT(traverse_module_state->__pyx_n_s_format_option);
jpayne@68 4691 Py_VISIT(traverse_module_state->__pyx_n_s_format_options);
jpayne@68 4692 Py_VISIT(traverse_module_state->__pyx_n_s_fp);
jpayne@68 4693 Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
jpayne@68 4694 Py_VISIT(traverse_module_state->__pyx_n_s_get_reference_name);
jpayne@68 4695 Py_VISIT(traverse_module_state->__pyx_n_s_get_tid);
jpayne@68 4696 Py_VISIT(traverse_module_state->__pyx_n_s_get_verbosity);
jpayne@68 4697 Py_VISIT(traverse_module_state->__pyx_n_u_get_verbosity);
jpayne@68 4698 Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
jpayne@68 4699 Py_VISIT(traverse_module_state->__pyx_n_s_got);
jpayne@68 4700 Py_VISIT(traverse_module_state->__pyx_n_s_ignore_truncation);
jpayne@68 4701 Py_VISIT(traverse_module_state->__pyx_n_s_import);
jpayne@68 4702 Py_VISIT(traverse_module_state->__pyx_n_s_init);
jpayne@68 4703 Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
jpayne@68 4704 Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
jpayne@68 4705 Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_contig_s);
jpayne@68 4706 Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_coordinates_start_i_stop);
jpayne@68 4707 Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_tid);
jpayne@68 4708 Py_VISIT(traverse_module_state->__pyx_n_s_io);
jpayne@68 4709 Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
jpayne@68 4710 Py_VISIT(traverse_module_state->__pyx_n_s_is_open);
jpayne@68 4711 Py_VISIT(traverse_module_state->__pyx_n_s_is_valid_reference_name);
jpayne@68 4712 Py_VISIT(traverse_module_state->__pyx_n_s_is_valid_tid);
jpayne@68 4713 Py_VISIT(traverse_module_state->__pyx_n_s_isatty);
jpayne@68 4714 Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
jpayne@68 4715 Py_VISIT(traverse_module_state->__pyx_n_s_join);
jpayne@68 4716 Py_VISIT(traverse_module_state->__pyx_n_s_line);
jpayne@68 4717 Py_VISIT(traverse_module_state->__pyx_n_s_lines);
jpayne@68 4718 Py_VISIT(traverse_module_state->__pyx_n_s_main);
jpayne@68 4719 Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
jpayne@68 4720 Py_VISIT(traverse_module_state->__pyx_kp_u_metadata_not_available_on_closed);
jpayne@68 4721 Py_VISIT(traverse_module_state->__pyx_n_s_mode);
jpayne@68 4722 Py_VISIT(traverse_module_state->__pyx_n_s_module);
jpayne@68 4723 Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
jpayne@68 4724 Py_VISIT(traverse_module_state->__pyx_n_s_msg);
jpayne@68 4725 Py_VISIT(traverse_module_state->__pyx_n_s_mv);
jpayne@68 4726 Py_VISIT(traverse_module_state->__pyx_n_s_name);
jpayne@68 4727 Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
jpayne@68 4728 Py_VISIT(traverse_module_state->__pyx_n_s_ne);
jpayne@68 4729 Py_VISIT(traverse_module_state->__pyx_kp_u_no_BGZF_EOF_marker_file_may_be_t);
jpayne@68 4730 Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
jpayne@68 4731 Py_VISIT(traverse_module_state->__pyx_n_s_nonzero);
jpayne@68 4732 Py_VISIT(traverse_module_state->__pyx_n_s_object);
jpayne@68 4733 Py_VISIT(traverse_module_state->__pyx_n_s_off);
jpayne@68 4734 Py_VISIT(traverse_module_state->__pyx_n_s_offset);
jpayne@68 4735 Py_VISIT(traverse_module_state->__pyx_kp_u_operation_on_closed_HFile);
jpayne@68 4736 Py_VISIT(traverse_module_state->__pyx_n_s_opts);
jpayne@68 4737 Py_VISIT(traverse_module_state->__pyx_n_s_os);
jpayne@68 4738 Py_VISIT(traverse_module_state->__pyx_n_s_other);
jpayne@68 4739 Py_VISIT(traverse_module_state->__pyx_n_s_parse_region);
jpayne@68 4740 Py_VISIT(traverse_module_state->__pyx_n_s_part);
jpayne@68 4741 Py_VISIT(traverse_module_state->__pyx_n_s_parts);
jpayne@68 4742 Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
jpayne@68 4743 Py_VISIT(traverse_module_state->__pyx_n_s_pysam_libchtslib);
jpayne@68 4744 Py_VISIT(traverse_module_state->__pyx_kp_s_pysam_libchtslib_pyx);
jpayne@68 4745 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
jpayne@68 4746 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
jpayne@68 4747 Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
jpayne@68 4748 Py_VISIT(traverse_module_state->__pyx_n_u_r);
jpayne@68 4749 Py_VISIT(traverse_module_state->__pyx_n_s_re);
jpayne@68 4750 Py_VISIT(traverse_module_state->__pyx_n_s_read);
jpayne@68 4751 Py_VISIT(traverse_module_state->__pyx_n_s_readable);
jpayne@68 4752 Py_VISIT(traverse_module_state->__pyx_n_s_readall);
jpayne@68 4753 Py_VISIT(traverse_module_state->__pyx_n_s_readinto);
jpayne@68 4754 Py_VISIT(traverse_module_state->__pyx_n_s_readline);
jpayne@68 4755 Py_VISIT(traverse_module_state->__pyx_n_s_readlines);
jpayne@68 4756 Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
jpayne@68 4757 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
jpayne@68 4758 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
jpayne@68 4759 Py_VISIT(traverse_module_state->__pyx_n_s_reference);
jpayne@68 4760 Py_VISIT(traverse_module_state->__pyx_n_s_region);
jpayne@68 4761 Py_VISIT(traverse_module_state->__pyx_n_s_replace);
jpayne@68 4762 Py_VISIT(traverse_module_state->__pyx_n_s_reset);
jpayne@68 4763 Py_VISIT(traverse_module_state->__pyx_n_s_ret);
jpayne@68 4764 Py_VISIT(traverse_module_state->__pyx_n_s_rstart);
jpayne@68 4765 Py_VISIT(traverse_module_state->__pyx_n_s_rstop);
jpayne@68 4766 Py_VISIT(traverse_module_state->__pyx_n_s_rtid);
jpayne@68 4767 Py_VISIT(traverse_module_state->__pyx_n_s_rval);
jpayne@68 4768 Py_VISIT(traverse_module_state->__pyx_n_s_seek);
jpayne@68 4769 Py_VISIT(traverse_module_state->__pyx_kp_u_seek_failed_on_HFile);
jpayne@68 4770 Py_VISIT(traverse_module_state->__pyx_kp_u_seek_not_available_in_streams);
jpayne@68 4771 Py_VISIT(traverse_module_state->__pyx_kp_u_seek_not_implemented_in_files_co);
jpayne@68 4772 Py_VISIT(traverse_module_state->__pyx_n_s_seekable);
jpayne@68 4773 Py_VISIT(traverse_module_state->__pyx_n_s_self);
jpayne@68 4774 Py_VISIT(traverse_module_state->__pyx_kp_s_self_fp_cannot_be_converted_to_a);
jpayne@68 4775 Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
jpayne@68 4776 Py_VISIT(traverse_module_state->__pyx_n_s_set_verbosity);
jpayne@68 4777 Py_VISIT(traverse_module_state->__pyx_n_u_set_verbosity);
jpayne@68 4778 Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
jpayne@68 4779 Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
jpayne@68 4780 Py_VISIT(traverse_module_state->__pyx_n_s_size);
jpayne@68 4781 Py_VISIT(traverse_module_state->__pyx_n_s_spec);
jpayne@68 4782 Py_VISIT(traverse_module_state->__pyx_n_s_split);
jpayne@68 4783 Py_VISIT(traverse_module_state->__pyx_n_s_start);
jpayne@68 4784 Py_VISIT(traverse_module_state->__pyx_kp_u_start_out_of_range_i);
jpayne@68 4785 Py_VISIT(traverse_module_state->__pyx_n_s_stop);
jpayne@68 4786 Py_VISIT(traverse_module_state->__pyx_kp_u_stop_and_end_should_not_both_be);
jpayne@68 4787 Py_VISIT(traverse_module_state->__pyx_kp_u_stop_out_of_range_i);
jpayne@68 4788 Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
jpayne@68 4789 Py_VISIT(traverse_module_state->__pyx_n_s_super);
jpayne@68 4790 Py_VISIT(traverse_module_state->__pyx_n_s_tb);
jpayne@68 4791 Py_VISIT(traverse_module_state->__pyx_n_s_tell);
jpayne@68 4792 Py_VISIT(traverse_module_state->__pyx_kp_u_tell_failed_on_HFile);
jpayne@68 4793 Py_VISIT(traverse_module_state->__pyx_kp_u_tell_not_available_in_streams);
jpayne@68 4794 Py_VISIT(traverse_module_state->__pyx_n_s_test);
jpayne@68 4795 Py_VISIT(traverse_module_state->__pyx_n_s_tid);
jpayne@68 4796 Py_VISIT(traverse_module_state->__pyx_n_s_traceback);
jpayne@68 4797 Py_VISIT(traverse_module_state->__pyx_n_s_truncate);
jpayne@68 4798 Py_VISIT(traverse_module_state->__pyx_n_s_type);
jpayne@68 4799 Py_VISIT(traverse_module_state->__pyx_n_s_value);
jpayne@68 4800 Py_VISIT(traverse_module_state->__pyx_n_s_verbosity);
jpayne@68 4801 Py_VISIT(traverse_module_state->__pyx_n_u_w);
jpayne@68 4802 Py_VISIT(traverse_module_state->__pyx_n_s_warn);
jpayne@68 4803 Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
jpayne@68 4804 Py_VISIT(traverse_module_state->__pyx_n_s_whence);
jpayne@68 4805 Py_VISIT(traverse_module_state->__pyx_n_s_writable);
jpayne@68 4806 Py_VISIT(traverse_module_state->__pyx_n_s_write);
jpayne@68 4807 Py_VISIT(traverse_module_state->__pyx_kp_u_write_failed_on_HFile);
jpayne@68 4808 Py_VISIT(traverse_module_state->__pyx_n_s_writelines);
jpayne@68 4809 Py_VISIT(traverse_module_state->__pyx_int_0);
jpayne@68 4810 Py_VISIT(traverse_module_state->__pyx_int_1);
jpayne@68 4811 Py_VISIT(traverse_module_state->__pyx_int_neg_1);
jpayne@68 4812 Py_VISIT(traverse_module_state->__pyx_codeobj_);
jpayne@68 4813 Py_VISIT(traverse_module_state->__pyx_tuple__5);
jpayne@68 4814 Py_VISIT(traverse_module_state->__pyx_tuple__6);
jpayne@68 4815 Py_VISIT(traverse_module_state->__pyx_tuple__39);
jpayne@68 4816 Py_VISIT(traverse_module_state->__pyx_tuple__43);
jpayne@68 4817 Py_VISIT(traverse_module_state->__pyx_tuple__44);
jpayne@68 4818 Py_VISIT(traverse_module_state->__pyx_tuple__46);
jpayne@68 4819 Py_VISIT(traverse_module_state->__pyx_tuple__47);
jpayne@68 4820 Py_VISIT(traverse_module_state->__pyx_tuple__48);
jpayne@68 4821 Py_VISIT(traverse_module_state->__pyx_tuple__49);
jpayne@68 4822 Py_VISIT(traverse_module_state->__pyx_tuple__51);
jpayne@68 4823 Py_VISIT(traverse_module_state->__pyx_tuple__53);
jpayne@68 4824 Py_VISIT(traverse_module_state->__pyx_tuple__54);
jpayne@68 4825 Py_VISIT(traverse_module_state->__pyx_tuple__57);
jpayne@68 4826 Py_VISIT(traverse_module_state->__pyx_tuple__66);
jpayne@68 4827 Py_VISIT(traverse_module_state->__pyx_tuple__67);
jpayne@68 4828 Py_VISIT(traverse_module_state->__pyx_tuple__68);
jpayne@68 4829 Py_VISIT(traverse_module_state->__pyx_tuple__69);
jpayne@68 4830 Py_VISIT(traverse_module_state->__pyx_tuple__70);
jpayne@68 4831 Py_VISIT(traverse_module_state->__pyx_tuple__71);
jpayne@68 4832 Py_VISIT(traverse_module_state->__pyx_tuple__72);
jpayne@68 4833 Py_VISIT(traverse_module_state->__pyx_tuple__73);
jpayne@68 4834 Py_VISIT(traverse_module_state->__pyx_tuple__74);
jpayne@68 4835 Py_VISIT(traverse_module_state->__pyx_tuple__75);
jpayne@68 4836 Py_VISIT(traverse_module_state->__pyx_tuple__76);
jpayne@68 4837 Py_VISIT(traverse_module_state->__pyx_tuple__77);
jpayne@68 4838 Py_VISIT(traverse_module_state->__pyx_tuple__78);
jpayne@68 4839 Py_VISIT(traverse_module_state->__pyx_tuple__79);
jpayne@68 4840 Py_VISIT(traverse_module_state->__pyx_tuple__80);
jpayne@68 4841 Py_VISIT(traverse_module_state->__pyx_tuple__81);
jpayne@68 4842 Py_VISIT(traverse_module_state->__pyx_tuple__82);
jpayne@68 4843 Py_VISIT(traverse_module_state->__pyx_tuple__83);
jpayne@68 4844 Py_VISIT(traverse_module_state->__pyx_tuple__84);
jpayne@68 4845 Py_VISIT(traverse_module_state->__pyx_tuple__85);
jpayne@68 4846 Py_VISIT(traverse_module_state->__pyx_tuple__86);
jpayne@68 4847 Py_VISIT(traverse_module_state->__pyx_tuple__87);
jpayne@68 4848 Py_VISIT(traverse_module_state->__pyx_tuple__88);
jpayne@68 4849 Py_VISIT(traverse_module_state->__pyx_tuple__89);
jpayne@68 4850 Py_VISIT(traverse_module_state->__pyx_tuple__90);
jpayne@68 4851 Py_VISIT(traverse_module_state->__pyx_tuple__91);
jpayne@68 4852 Py_VISIT(traverse_module_state->__pyx_tuple__92);
jpayne@68 4853 Py_VISIT(traverse_module_state->__pyx_tuple__93);
jpayne@68 4854 Py_VISIT(traverse_module_state->__pyx_tuple__94);
jpayne@68 4855 Py_VISIT(traverse_module_state->__pyx_tuple__95);
jpayne@68 4856 Py_VISIT(traverse_module_state->__pyx_tuple__96);
jpayne@68 4857 Py_VISIT(traverse_module_state->__pyx_codeobj__2);
jpayne@68 4858 Py_VISIT(traverse_module_state->__pyx_codeobj__3);
jpayne@68 4859 Py_VISIT(traverse_module_state->__pyx_codeobj__4);
jpayne@68 4860 Py_VISIT(traverse_module_state->__pyx_codeobj__7);
jpayne@68 4861 Py_VISIT(traverse_module_state->__pyx_codeobj__8);
jpayne@68 4862 Py_VISIT(traverse_module_state->__pyx_codeobj__9);
jpayne@68 4863 Py_VISIT(traverse_module_state->__pyx_codeobj__10);
jpayne@68 4864 Py_VISIT(traverse_module_state->__pyx_codeobj__11);
jpayne@68 4865 Py_VISIT(traverse_module_state->__pyx_codeobj__12);
jpayne@68 4866 Py_VISIT(traverse_module_state->__pyx_codeobj__14);
jpayne@68 4867 Py_VISIT(traverse_module_state->__pyx_codeobj__15);
jpayne@68 4868 Py_VISIT(traverse_module_state->__pyx_codeobj__16);
jpayne@68 4869 Py_VISIT(traverse_module_state->__pyx_codeobj__17);
jpayne@68 4870 Py_VISIT(traverse_module_state->__pyx_codeobj__19);
jpayne@68 4871 Py_VISIT(traverse_module_state->__pyx_codeobj__20);
jpayne@68 4872 Py_VISIT(traverse_module_state->__pyx_codeobj__21);
jpayne@68 4873 Py_VISIT(traverse_module_state->__pyx_codeobj__22);
jpayne@68 4874 Py_VISIT(traverse_module_state->__pyx_codeobj__23);
jpayne@68 4875 Py_VISIT(traverse_module_state->__pyx_codeobj__24);
jpayne@68 4876 Py_VISIT(traverse_module_state->__pyx_codeobj__25);
jpayne@68 4877 Py_VISIT(traverse_module_state->__pyx_codeobj__26);
jpayne@68 4878 Py_VISIT(traverse_module_state->__pyx_codeobj__27);
jpayne@68 4879 Py_VISIT(traverse_module_state->__pyx_codeobj__28);
jpayne@68 4880 Py_VISIT(traverse_module_state->__pyx_codeobj__29);
jpayne@68 4881 Py_VISIT(traverse_module_state->__pyx_codeobj__30);
jpayne@68 4882 Py_VISIT(traverse_module_state->__pyx_codeobj__31);
jpayne@68 4883 Py_VISIT(traverse_module_state->__pyx_codeobj__32);
jpayne@68 4884 Py_VISIT(traverse_module_state->__pyx_codeobj__33);
jpayne@68 4885 Py_VISIT(traverse_module_state->__pyx_codeobj__34);
jpayne@68 4886 Py_VISIT(traverse_module_state->__pyx_codeobj__35);
jpayne@68 4887 Py_VISIT(traverse_module_state->__pyx_codeobj__36);
jpayne@68 4888 Py_VISIT(traverse_module_state->__pyx_codeobj__37);
jpayne@68 4889 Py_VISIT(traverse_module_state->__pyx_codeobj__38);
jpayne@68 4890 Py_VISIT(traverse_module_state->__pyx_codeobj__40);
jpayne@68 4891 Py_VISIT(traverse_module_state->__pyx_codeobj__42);
jpayne@68 4892 Py_VISIT(traverse_module_state->__pyx_codeobj__45);
jpayne@68 4893 Py_VISIT(traverse_module_state->__pyx_codeobj__50);
jpayne@68 4894 Py_VISIT(traverse_module_state->__pyx_codeobj__52);
jpayne@68 4895 Py_VISIT(traverse_module_state->__pyx_codeobj__60);
jpayne@68 4896 Py_VISIT(traverse_module_state->__pyx_codeobj__61);
jpayne@68 4897 Py_VISIT(traverse_module_state->__pyx_codeobj__62);
jpayne@68 4898 Py_VISIT(traverse_module_state->__pyx_codeobj__63);
jpayne@68 4899 Py_VISIT(traverse_module_state->__pyx_codeobj__64);
jpayne@68 4900 Py_VISIT(traverse_module_state->__pyx_codeobj__65);
jpayne@68 4901 return 0;
jpayne@68 4902 }
jpayne@68 4903 #endif
jpayne@68 4904 /* #### Code section: module_state_defines ### */
jpayne@68 4905 #define __pyx_d __pyx_mstate_global->__pyx_d
jpayne@68 4906 #define __pyx_b __pyx_mstate_global->__pyx_b
jpayne@68 4907 #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
jpayne@68 4908 #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
jpayne@68 4909 #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
jpayne@68 4910 #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
jpayne@68 4911 #ifdef __Pyx_CyFunction_USED
jpayne@68 4912 #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
jpayne@68 4913 #endif
jpayne@68 4914 #ifdef __Pyx_FusedFunction_USED
jpayne@68 4915 #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
jpayne@68 4916 #endif
jpayne@68 4917 #ifdef __Pyx_Generator_USED
jpayne@68 4918 #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
jpayne@68 4919 #endif
jpayne@68 4920 #ifdef __Pyx_IterableCoroutine_USED
jpayne@68 4921 #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
jpayne@68 4922 #endif
jpayne@68 4923 #ifdef __Pyx_Coroutine_USED
jpayne@68 4924 #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
jpayne@68 4925 #endif
jpayne@68 4926 #ifdef __Pyx_Coroutine_USED
jpayne@68 4927 #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
jpayne@68 4928 #endif
jpayne@68 4929 #if CYTHON_USE_MODULE_STATE
jpayne@68 4930 #endif
jpayne@68 4931 #if CYTHON_USE_MODULE_STATE
jpayne@68 4932 #endif
jpayne@68 4933 #if CYTHON_USE_MODULE_STATE
jpayne@68 4934 #endif
jpayne@68 4935 #if CYTHON_USE_MODULE_STATE
jpayne@68 4936 #endif
jpayne@68 4937 #if CYTHON_USE_MODULE_STATE
jpayne@68 4938 #endif
jpayne@68 4939 #if CYTHON_USE_MODULE_STATE
jpayne@68 4940 #endif
jpayne@68 4941 #if CYTHON_USE_MODULE_STATE
jpayne@68 4942 #endif
jpayne@68 4943 #if CYTHON_USE_MODULE_STATE
jpayne@68 4944 #endif
jpayne@68 4945 #if CYTHON_USE_MODULE_STATE
jpayne@68 4946 #endif
jpayne@68 4947 #if CYTHON_USE_MODULE_STATE
jpayne@68 4948 #endif
jpayne@68 4949 #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
jpayne@68 4950 #if CYTHON_USE_MODULE_STATE
jpayne@68 4951 #endif
jpayne@68 4952 #if CYTHON_USE_MODULE_STATE
jpayne@68 4953 #endif
jpayne@68 4954 #if CYTHON_USE_MODULE_STATE
jpayne@68 4955 #endif
jpayne@68 4956 #if CYTHON_USE_MODULE_STATE
jpayne@68 4957 #endif
jpayne@68 4958 #if CYTHON_USE_MODULE_STATE
jpayne@68 4959 #endif
jpayne@68 4960 #if CYTHON_USE_MODULE_STATE
jpayne@68 4961 #endif
jpayne@68 4962 #if CYTHON_USE_MODULE_STATE
jpayne@68 4963 #endif
jpayne@68 4964 #if CYTHON_USE_MODULE_STATE
jpayne@68 4965 #endif
jpayne@68 4966 #if CYTHON_USE_MODULE_STATE
jpayne@68 4967 #endif
jpayne@68 4968 #if CYTHON_USE_MODULE_STATE
jpayne@68 4969 #endif
jpayne@68 4970 #if CYTHON_USE_MODULE_STATE
jpayne@68 4971 #endif
jpayne@68 4972 #if CYTHON_USE_MODULE_STATE
jpayne@68 4973 #endif
jpayne@68 4974 #if CYTHON_USE_MODULE_STATE
jpayne@68 4975 #endif
jpayne@68 4976 #if CYTHON_USE_MODULE_STATE
jpayne@68 4977 #endif
jpayne@68 4978 #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool
jpayne@68 4979 #if CYTHON_USE_MODULE_STATE
jpayne@68 4980 #endif
jpayne@68 4981 #if CYTHON_USE_MODULE_STATE
jpayne@68 4982 #endif
jpayne@68 4983 #if CYTHON_USE_MODULE_STATE
jpayne@68 4984 #endif
jpayne@68 4985 #if CYTHON_USE_MODULE_STATE
jpayne@68 4986 #endif
jpayne@68 4987 #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex
jpayne@68 4988 #if CYTHON_USE_MODULE_STATE
jpayne@68 4989 #endif
jpayne@68 4990 #if CYTHON_USE_MODULE_STATE
jpayne@68 4991 #endif
jpayne@68 4992 #if CYTHON_USE_MODULE_STATE
jpayne@68 4993 #endif
jpayne@68 4994 #if CYTHON_USE_MODULE_STATE
jpayne@68 4995 #endif
jpayne@68 4996 #if CYTHON_USE_MODULE_STATE
jpayne@68 4997 #endif
jpayne@68 4998 #if CYTHON_USE_MODULE_STATE
jpayne@68 4999 #endif
jpayne@68 5000 #if CYTHON_USE_MODULE_STATE
jpayne@68 5001 #endif
jpayne@68 5002 #if CYTHON_USE_MODULE_STATE
jpayne@68 5003 #endif
jpayne@68 5004 #if CYTHON_USE_MODULE_STATE
jpayne@68 5005 #endif
jpayne@68 5006 #if CYTHON_USE_MODULE_STATE
jpayne@68 5007 #endif
jpayne@68 5008 #if CYTHON_USE_MODULE_STATE
jpayne@68 5009 #endif
jpayne@68 5010 #if CYTHON_USE_MODULE_STATE
jpayne@68 5011 #endif
jpayne@68 5012 #if CYTHON_USE_MODULE_STATE
jpayne@68 5013 #endif
jpayne@68 5014 #if CYTHON_USE_MODULE_STATE
jpayne@68 5015 #endif
jpayne@68 5016 #if CYTHON_USE_MODULE_STATE
jpayne@68 5017 #endif
jpayne@68 5018 #if CYTHON_USE_MODULE_STATE
jpayne@68 5019 #endif
jpayne@68 5020 #if CYTHON_USE_MODULE_STATE
jpayne@68 5021 #endif
jpayne@68 5022 #if CYTHON_USE_MODULE_STATE
jpayne@68 5023 #endif
jpayne@68 5024 #if CYTHON_USE_MODULE_STATE
jpayne@68 5025 #endif
jpayne@68 5026 #if CYTHON_USE_MODULE_STATE
jpayne@68 5027 #endif
jpayne@68 5028 #if CYTHON_USE_MODULE_STATE
jpayne@68 5029 #endif
jpayne@68 5030 #if CYTHON_USE_MODULE_STATE
jpayne@68 5031 #endif
jpayne@68 5032 #if CYTHON_USE_MODULE_STATE
jpayne@68 5033 #endif
jpayne@68 5034 #define __pyx_ptype_7cpython_5array_array __pyx_mstate_global->__pyx_ptype_7cpython_5array_array
jpayne@68 5035 #if CYTHON_USE_MODULE_STATE
jpayne@68 5036 #endif
jpayne@68 5037 #if CYTHON_USE_MODULE_STATE
jpayne@68 5038 #define __pyx_type_5pysam_10libchtslib_HTSFile __pyx_mstate_global->__pyx_type_5pysam_10libchtslib_HTSFile
jpayne@68 5039 #define __pyx_type_5pysam_10libchtslib_HFile __pyx_mstate_global->__pyx_type_5pysam_10libchtslib_HFile
jpayne@68 5040 #endif
jpayne@68 5041 #define __pyx_ptype_5pysam_10libchtslib_HTSFile __pyx_mstate_global->__pyx_ptype_5pysam_10libchtslib_HTSFile
jpayne@68 5042 #define __pyx_ptype_5pysam_10libchtslib_HFile __pyx_mstate_global->__pyx_ptype_5pysam_10libchtslib_HFile
jpayne@68 5043 #define __pyx_n_u_ALIGNMENTS __pyx_mstate_global->__pyx_n_u_ALIGNMENTS
jpayne@68 5044 #define __pyx_kp_u_An_error_occurred_while_applying __pyx_mstate_global->__pyx_kp_u_An_error_occurred_while_applying
jpayne@68 5045 #define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError
jpayne@68 5046 #define __pyx_n_u_BAI __pyx_mstate_global->__pyx_n_u_BAI
jpayne@68 5047 #define __pyx_n_u_BAM __pyx_mstate_global->__pyx_n_u_BAM
jpayne@68 5048 #define __pyx_n_u_BCF __pyx_mstate_global->__pyx_n_u_BCF
jpayne@68 5049 #define __pyx_n_u_BED __pyx_mstate_global->__pyx_n_u_BED
jpayne@68 5050 #define __pyx_n_u_BGZF __pyx_mstate_global->__pyx_n_u_BGZF
jpayne@68 5051 #define __pyx_n_u_BINARY_FORMAT __pyx_mstate_global->__pyx_n_u_BINARY_FORMAT
jpayne@68 5052 #define __pyx_n_s_CFalse __pyx_mstate_global->__pyx_n_s_CFalse
jpayne@68 5053 #define __pyx_n_u_CRAI __pyx_mstate_global->__pyx_n_u_CRAI
jpayne@68 5054 #define __pyx_n_u_CRAM __pyx_mstate_global->__pyx_n_u_CRAM
jpayne@68 5055 #define __pyx_n_u_CSI __pyx_mstate_global->__pyx_n_u_CSI
jpayne@68 5056 #define __pyx_n_s_CTrue __pyx_mstate_global->__pyx_n_s_CTrue
jpayne@68 5057 #define __pyx_n_u_CUSTOM __pyx_mstate_global->__pyx_n_u_CUSTOM
jpayne@68 5058 #define __pyx_n_s_CallableValue __pyx_mstate_global->__pyx_n_s_CallableValue
jpayne@68 5059 #define __pyx_n_s_CallableValue___bool __pyx_mstate_global->__pyx_n_s_CallableValue___bool
jpayne@68 5060 #define __pyx_n_s_CallableValue___call __pyx_mstate_global->__pyx_n_s_CallableValue___call
jpayne@68 5061 #define __pyx_n_s_CallableValue___eq __pyx_mstate_global->__pyx_n_s_CallableValue___eq
jpayne@68 5062 #define __pyx_n_s_CallableValue___init __pyx_mstate_global->__pyx_n_s_CallableValue___init
jpayne@68 5063 #define __pyx_n_s_CallableValue___ne __pyx_mstate_global->__pyx_n_s_CallableValue___ne
jpayne@68 5064 #define __pyx_n_s_CallableValue___nonzero __pyx_mstate_global->__pyx_n_s_CallableValue___nonzero
jpayne@68 5065 #define __pyx_kp_u_Cannot_create_hfile __pyx_mstate_global->__pyx_kp_u_Cannot_create_hfile
jpayne@68 5066 #define __pyx_kp_u_Flushing __pyx_mstate_global->__pyx_kp_u_Flushing
jpayne@68 5067 #define __pyx_n_u_GZI __pyx_mstate_global->__pyx_n_u_GZI
jpayne@68 5068 #define __pyx_n_u_GZIP __pyx_mstate_global->__pyx_n_u_GZIP
jpayne@68 5069 #define __pyx_n_s_HFile __pyx_mstate_global->__pyx_n_s_HFile
jpayne@68 5070 #define __pyx_n_u_HFile __pyx_mstate_global->__pyx_n_u_HFile
jpayne@68 5071 #define __pyx_n_s_HFile___enter __pyx_mstate_global->__pyx_n_s_HFile___enter
jpayne@68 5072 #define __pyx_n_s_HFile___exit __pyx_mstate_global->__pyx_n_s_HFile___exit
jpayne@68 5073 #define __pyx_n_s_HFile___reduce_cython __pyx_mstate_global->__pyx_n_s_HFile___reduce_cython
jpayne@68 5074 #define __pyx_n_s_HFile___setstate_cython __pyx_mstate_global->__pyx_n_s_HFile___setstate_cython
jpayne@68 5075 #define __pyx_n_s_HFile_close __pyx_mstate_global->__pyx_n_s_HFile_close
jpayne@68 5076 #define __pyx_n_s_HFile_fileno __pyx_mstate_global->__pyx_n_s_HFile_fileno
jpayne@68 5077 #define __pyx_n_s_HFile_flush __pyx_mstate_global->__pyx_n_s_HFile_flush
jpayne@68 5078 #define __pyx_n_s_HFile_isatty __pyx_mstate_global->__pyx_n_s_HFile_isatty
jpayne@68 5079 #define __pyx_n_s_HFile_read __pyx_mstate_global->__pyx_n_s_HFile_read
jpayne@68 5080 #define __pyx_n_s_HFile_readable __pyx_mstate_global->__pyx_n_s_HFile_readable
jpayne@68 5081 #define __pyx_n_s_HFile_readall __pyx_mstate_global->__pyx_n_s_HFile_readall
jpayne@68 5082 #define __pyx_n_s_HFile_readinto __pyx_mstate_global->__pyx_n_s_HFile_readinto
jpayne@68 5083 #define __pyx_n_s_HFile_readline __pyx_mstate_global->__pyx_n_s_HFile_readline
jpayne@68 5084 #define __pyx_n_s_HFile_readlines __pyx_mstate_global->__pyx_n_s_HFile_readlines
jpayne@68 5085 #define __pyx_n_s_HFile_seek __pyx_mstate_global->__pyx_n_s_HFile_seek
jpayne@68 5086 #define __pyx_n_s_HFile_seekable __pyx_mstate_global->__pyx_n_s_HFile_seekable
jpayne@68 5087 #define __pyx_n_s_HFile_tell __pyx_mstate_global->__pyx_n_s_HFile_tell
jpayne@68 5088 #define __pyx_n_s_HFile_truncate __pyx_mstate_global->__pyx_n_s_HFile_truncate
jpayne@68 5089 #define __pyx_n_s_HFile_writable __pyx_mstate_global->__pyx_n_s_HFile_writable
jpayne@68 5090 #define __pyx_n_s_HFile_write __pyx_mstate_global->__pyx_n_s_HFile_write
jpayne@68 5091 #define __pyx_n_s_HFile_writelines __pyx_mstate_global->__pyx_n_s_HFile_writelines
jpayne@68 5092 #define __pyx_n_s_HTSFile __pyx_mstate_global->__pyx_n_s_HTSFile
jpayne@68 5093 #define __pyx_n_u_HTSFile __pyx_mstate_global->__pyx_n_u_HTSFile
jpayne@68 5094 #define __pyx_n_s_HTSFile___enter __pyx_mstate_global->__pyx_n_s_HTSFile___enter
jpayne@68 5095 #define __pyx_n_s_HTSFile___exit __pyx_mstate_global->__pyx_n_s_HTSFile___exit
jpayne@68 5096 #define __pyx_n_s_HTSFile___reduce_cython __pyx_mstate_global->__pyx_n_s_HTSFile___reduce_cython
jpayne@68 5097 #define __pyx_n_s_HTSFile___setstate_cython __pyx_mstate_global->__pyx_n_s_HTSFile___setstate_cython
jpayne@68 5098 #define __pyx_n_s_HTSFile_add_hts_options __pyx_mstate_global->__pyx_n_s_HTSFile_add_hts_options
jpayne@68 5099 #define __pyx_n_s_HTSFile_check_truncation __pyx_mstate_global->__pyx_n_s_HTSFile_check_truncation
jpayne@68 5100 #define __pyx_n_s_HTSFile_close __pyx_mstate_global->__pyx_n_s_HTSFile_close
jpayne@68 5101 #define __pyx_n_s_HTSFile_flush __pyx_mstate_global->__pyx_n_s_HTSFile_flush
jpayne@68 5102 #define __pyx_n_s_HTSFile_get_reference_name __pyx_mstate_global->__pyx_n_s_HTSFile_get_reference_name
jpayne@68 5103 #define __pyx_n_s_HTSFile_get_tid __pyx_mstate_global->__pyx_n_s_HTSFile_get_tid
jpayne@68 5104 #define __pyx_n_s_HTSFile_is_valid_reference_name __pyx_mstate_global->__pyx_n_s_HTSFile_is_valid_reference_name
jpayne@68 5105 #define __pyx_n_s_HTSFile_is_valid_tid __pyx_mstate_global->__pyx_n_s_HTSFile_is_valid_tid
jpayne@68 5106 #define __pyx_n_s_HTSFile_parse_region __pyx_mstate_global->__pyx_n_s_HTSFile_parse_region
jpayne@68 5107 #define __pyx_n_s_HTSFile_reset __pyx_mstate_global->__pyx_n_s_HTSFile_reset
jpayne@68 5108 #define __pyx_n_s_HTSFile_seek __pyx_mstate_global->__pyx_n_s_HTSFile_seek
jpayne@68 5109 #define __pyx_n_s_HTSFile_tell __pyx_mstate_global->__pyx_n_s_HTSFile_tell
jpayne@68 5110 #define __pyx_n_u_INDEX __pyx_mstate_global->__pyx_n_u_INDEX
jpayne@68 5111 #define __pyx_n_s_IOError __pyx_mstate_global->__pyx_n_s_IOError
jpayne@68 5112 #define __pyx_kp_u_I_O_operation_on_closed_file __pyx_mstate_global->__pyx_kp_u_I_O_operation_on_closed_file
jpayne@68 5113 #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
jpayne@68 5114 #define __pyx_kp_u_Invalid_format_option_specified __pyx_mstate_global->__pyx_kp_u_Invalid_format_option_specified
jpayne@68 5115 #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
jpayne@68 5116 #define __pyx_n_u_NONE __pyx_mstate_global->__pyx_n_u_NONE
jpayne@68 5117 #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError
jpayne@68 5118 #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError
jpayne@68 5119 #define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError
jpayne@68 5120 #define __pyx_n_u_REGIONS __pyx_mstate_global->__pyx_n_u_REGIONS
jpayne@68 5121 #define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError
jpayne@68 5122 #define __pyx_n_u_SAM __pyx_mstate_global->__pyx_n_u_SAM
jpayne@68 5123 #define __pyx_n_s_SEEK_SET __pyx_mstate_global->__pyx_n_s_SEEK_SET
jpayne@68 5124 #define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration
jpayne@68 5125 #define __pyx_n_u_TBI __pyx_mstate_global->__pyx_n_u_TBI
jpayne@68 5126 #define __pyx_n_u_TEXT_FORMAT __pyx_mstate_global->__pyx_n_u_TEXT_FORMAT
jpayne@68 5127 #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
jpayne@68 5128 #define __pyx_n_u_UNKNOWN __pyx_mstate_global->__pyx_n_u_UNKNOWN
jpayne@68 5129 #define __pyx_n_u_VARIANTS __pyx_mstate_global->__pyx_n_u_VARIANTS
jpayne@68 5130 #define __pyx_n_u_VCF __pyx_mstate_global->__pyx_n_u_VCF
jpayne@68 5131 #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
jpayne@68 5132 #define __pyx_kp_b__13 __pyx_mstate_global->__pyx_kp_b__13
jpayne@68 5133 #define __pyx_kp_u__55 __pyx_mstate_global->__pyx_kp_u__55
jpayne@68 5134 #define __pyx_kp_u__56 __pyx_mstate_global->__pyx_kp_u__56
jpayne@68 5135 #define __pyx_n_s__58 __pyx_mstate_global->__pyx_n_s__58
jpayne@68 5136 #define __pyx_kp_u__58 __pyx_mstate_global->__pyx_kp_u__58
jpayne@68 5137 #define __pyx_kp_u__59 __pyx_mstate_global->__pyx_kp_u__59
jpayne@68 5138 #define __pyx_n_s__97 __pyx_mstate_global->__pyx_n_s__97
jpayne@68 5139 #define __pyx_n_s_add_hts_options __pyx_mstate_global->__pyx_n_s_add_hts_options
jpayne@68 5140 #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
jpayne@68 5141 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
jpayne@68 5142 #define __pyx_n_b_b __pyx_mstate_global->__pyx_n_b_b
jpayne@68 5143 #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b
jpayne@68 5144 #define __pyx_n_s_bgzfp __pyx_mstate_global->__pyx_n_s_bgzfp
jpayne@68 5145 #define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool
jpayne@68 5146 #define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf
jpayne@68 5147 #define __pyx_n_s_bytes_read __pyx_mstate_global->__pyx_n_s_bytes_read
jpayne@68 5148 #define __pyx_n_b_c __pyx_mstate_global->__pyx_n_b_c
jpayne@68 5149 #define __pyx_n_s_call __pyx_mstate_global->__pyx_n_s_call
jpayne@68 5150 #define __pyx_n_s_check_truncation __pyx_mstate_global->__pyx_n_s_check_truncation
jpayne@68 5151 #define __pyx_n_s_chunk_size __pyx_mstate_global->__pyx_n_s_chunk_size
jpayne@68 5152 #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
jpayne@68 5153 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
jpayne@68 5154 #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close
jpayne@68 5155 #define __pyx_n_s_closefd __pyx_mstate_global->__pyx_n_s_closefd
jpayne@68 5156 #define __pyx_n_s_contig __pyx_mstate_global->__pyx_n_s_contig
jpayne@68 5157 #define __pyx_kp_u_contig_and_reference_should_not __pyx_mstate_global->__pyx_kp_u_contig_and_reference_should_not
jpayne@68 5158 #define __pyx_n_s_coord __pyx_mstate_global->__pyx_n_s_coord
jpayne@68 5159 #define __pyx_n_s_cpart __pyx_mstate_global->__pyx_n_s_cpart
jpayne@68 5160 #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
jpayne@68 5161 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
jpayne@68 5162 #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
jpayne@68 5163 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
jpayne@68 5164 #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end
jpayne@68 5165 #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter
jpayne@68 5166 #define __pyx_n_s_eq __pyx_mstate_global->__pyx_n_s_eq
jpayne@68 5167 #define __pyx_kp_u_error_checking_for_EOF_marker __pyx_mstate_global->__pyx_kp_u_error_checking_for_EOF_marker
jpayne@68 5168 #define __pyx_n_s_exc_type __pyx_mstate_global->__pyx_n_s_exc_type
jpayne@68 5169 #define __pyx_n_s_exc_value __pyx_mstate_global->__pyx_n_s_exc_value
jpayne@68 5170 #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit
jpayne@68 5171 #define __pyx_kp_u_failed __pyx_mstate_global->__pyx_kp_u_failed
jpayne@68 5172 #define __pyx_kp_u_failed_to_close_HFile __pyx_mstate_global->__pyx_kp_u_failed_to_close_HFile
jpayne@68 5173 #define __pyx_kp_u_failed_to_flush_HFile __pyx_mstate_global->__pyx_kp_u_failed_to_flush_HFile
jpayne@68 5174 #define __pyx_kp_u_failed_to_open_HFile __pyx_mstate_global->__pyx_kp_u_failed_to_open_HFile
jpayne@68 5175 #define __pyx_kp_u_failed_to_read_HFile __pyx_mstate_global->__pyx_kp_u_failed_to_read_HFile
jpayne@68 5176 #define __pyx_kp_u_fd __pyx_mstate_global->__pyx_kp_u_fd
jpayne@68 5177 #define __pyx_n_s_fileno __pyx_mstate_global->__pyx_n_s_fileno
jpayne@68 5178 #define __pyx_kp_u_fileno_not_available __pyx_mstate_global->__pyx_kp_u_fileno_not_available
jpayne@68 5179 #define __pyx_n_s_flush __pyx_mstate_global->__pyx_n_s_flush
jpayne@68 5180 #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
jpayne@68 5181 #define __pyx_n_s_format_option __pyx_mstate_global->__pyx_n_s_format_option
jpayne@68 5182 #define __pyx_n_s_format_options __pyx_mstate_global->__pyx_n_s_format_options
jpayne@68 5183 #define __pyx_n_s_fp __pyx_mstate_global->__pyx_n_s_fp
jpayne@68 5184 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
jpayne@68 5185 #define __pyx_n_s_get_reference_name __pyx_mstate_global->__pyx_n_s_get_reference_name
jpayne@68 5186 #define __pyx_n_s_get_tid __pyx_mstate_global->__pyx_n_s_get_tid
jpayne@68 5187 #define __pyx_n_s_get_verbosity __pyx_mstate_global->__pyx_n_s_get_verbosity
jpayne@68 5188 #define __pyx_n_u_get_verbosity __pyx_mstate_global->__pyx_n_u_get_verbosity
jpayne@68 5189 #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
jpayne@68 5190 #define __pyx_n_s_got __pyx_mstate_global->__pyx_n_s_got
jpayne@68 5191 #define __pyx_n_s_ignore_truncation __pyx_mstate_global->__pyx_n_s_ignore_truncation
jpayne@68 5192 #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
jpayne@68 5193 #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init
jpayne@68 5194 #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
jpayne@68 5195 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
jpayne@68 5196 #define __pyx_kp_u_invalid_contig_s __pyx_mstate_global->__pyx_kp_u_invalid_contig_s
jpayne@68 5197 #define __pyx_kp_u_invalid_coordinates_start_i_stop __pyx_mstate_global->__pyx_kp_u_invalid_coordinates_start_i_stop
jpayne@68 5198 #define __pyx_kp_u_invalid_tid __pyx_mstate_global->__pyx_kp_u_invalid_tid
jpayne@68 5199 #define __pyx_n_s_io __pyx_mstate_global->__pyx_n_s_io
jpayne@68 5200 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
jpayne@68 5201 #define __pyx_n_s_is_open __pyx_mstate_global->__pyx_n_s_is_open
jpayne@68 5202 #define __pyx_n_s_is_valid_reference_name __pyx_mstate_global->__pyx_n_s_is_valid_reference_name
jpayne@68 5203 #define __pyx_n_s_is_valid_tid __pyx_mstate_global->__pyx_n_s_is_valid_tid
jpayne@68 5204 #define __pyx_n_s_isatty __pyx_mstate_global->__pyx_n_s_isatty
jpayne@68 5205 #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
jpayne@68 5206 #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join
jpayne@68 5207 #define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line
jpayne@68 5208 #define __pyx_n_s_lines __pyx_mstate_global->__pyx_n_s_lines
jpayne@68 5209 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
jpayne@68 5210 #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
jpayne@68 5211 #define __pyx_kp_u_metadata_not_available_on_closed __pyx_mstate_global->__pyx_kp_u_metadata_not_available_on_closed
jpayne@68 5212 #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
jpayne@68 5213 #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
jpayne@68 5214 #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
jpayne@68 5215 #define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg
jpayne@68 5216 #define __pyx_n_s_mv __pyx_mstate_global->__pyx_n_s_mv
jpayne@68 5217 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
jpayne@68 5218 #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
jpayne@68 5219 #define __pyx_n_s_ne __pyx_mstate_global->__pyx_n_s_ne
jpayne@68 5220 #define __pyx_kp_u_no_BGZF_EOF_marker_file_may_be_t __pyx_mstate_global->__pyx_kp_u_no_BGZF_EOF_marker_file_may_be_t
jpayne@68 5221 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
jpayne@68 5222 #define __pyx_n_s_nonzero __pyx_mstate_global->__pyx_n_s_nonzero
jpayne@68 5223 #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object
jpayne@68 5224 #define __pyx_n_s_off __pyx_mstate_global->__pyx_n_s_off
jpayne@68 5225 #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset
jpayne@68 5226 #define __pyx_kp_u_operation_on_closed_HFile __pyx_mstate_global->__pyx_kp_u_operation_on_closed_HFile
jpayne@68 5227 #define __pyx_n_s_opts __pyx_mstate_global->__pyx_n_s_opts
jpayne@68 5228 #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os
jpayne@68 5229 #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other
jpayne@68 5230 #define __pyx_n_s_parse_region __pyx_mstate_global->__pyx_n_s_parse_region
jpayne@68 5231 #define __pyx_n_s_part __pyx_mstate_global->__pyx_n_s_part
jpayne@68 5232 #define __pyx_n_s_parts __pyx_mstate_global->__pyx_n_s_parts
jpayne@68 5233 #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
jpayne@68 5234 #define __pyx_n_s_pysam_libchtslib __pyx_mstate_global->__pyx_n_s_pysam_libchtslib
jpayne@68 5235 #define __pyx_kp_s_pysam_libchtslib_pyx __pyx_mstate_global->__pyx_kp_s_pysam_libchtslib_pyx
jpayne@68 5236 #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
jpayne@68 5237 #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
jpayne@68 5238 #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
jpayne@68 5239 #define __pyx_n_u_r __pyx_mstate_global->__pyx_n_u_r
jpayne@68 5240 #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re
jpayne@68 5241 #define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read
jpayne@68 5242 #define __pyx_n_s_readable __pyx_mstate_global->__pyx_n_s_readable
jpayne@68 5243 #define __pyx_n_s_readall __pyx_mstate_global->__pyx_n_s_readall
jpayne@68 5244 #define __pyx_n_s_readinto __pyx_mstate_global->__pyx_n_s_readinto
jpayne@68 5245 #define __pyx_n_s_readline __pyx_mstate_global->__pyx_n_s_readline
jpayne@68 5246 #define __pyx_n_s_readlines __pyx_mstate_global->__pyx_n_s_readlines
jpayne@68 5247 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
jpayne@68 5248 #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
jpayne@68 5249 #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
jpayne@68 5250 #define __pyx_n_s_reference __pyx_mstate_global->__pyx_n_s_reference
jpayne@68 5251 #define __pyx_n_s_region __pyx_mstate_global->__pyx_n_s_region
jpayne@68 5252 #define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace
jpayne@68 5253 #define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset
jpayne@68 5254 #define __pyx_n_s_ret __pyx_mstate_global->__pyx_n_s_ret
jpayne@68 5255 #define __pyx_n_s_rstart __pyx_mstate_global->__pyx_n_s_rstart
jpayne@68 5256 #define __pyx_n_s_rstop __pyx_mstate_global->__pyx_n_s_rstop
jpayne@68 5257 #define __pyx_n_s_rtid __pyx_mstate_global->__pyx_n_s_rtid
jpayne@68 5258 #define __pyx_n_s_rval __pyx_mstate_global->__pyx_n_s_rval
jpayne@68 5259 #define __pyx_n_s_seek __pyx_mstate_global->__pyx_n_s_seek
jpayne@68 5260 #define __pyx_kp_u_seek_failed_on_HFile __pyx_mstate_global->__pyx_kp_u_seek_failed_on_HFile
jpayne@68 5261 #define __pyx_kp_u_seek_not_available_in_streams __pyx_mstate_global->__pyx_kp_u_seek_not_available_in_streams
jpayne@68 5262 #define __pyx_kp_u_seek_not_implemented_in_files_co __pyx_mstate_global->__pyx_kp_u_seek_not_implemented_in_files_co
jpayne@68 5263 #define __pyx_n_s_seekable __pyx_mstate_global->__pyx_n_s_seekable
jpayne@68 5264 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
jpayne@68 5265 #define __pyx_kp_s_self_fp_cannot_be_converted_to_a __pyx_mstate_global->__pyx_kp_s_self_fp_cannot_be_converted_to_a
jpayne@68 5266 #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
jpayne@68 5267 #define __pyx_n_s_set_verbosity __pyx_mstate_global->__pyx_n_s_set_verbosity
jpayne@68 5268 #define __pyx_n_u_set_verbosity __pyx_mstate_global->__pyx_n_u_set_verbosity
jpayne@68 5269 #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
jpayne@68 5270 #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
jpayne@68 5271 #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
jpayne@68 5272 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
jpayne@68 5273 #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split
jpayne@68 5274 #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
jpayne@68 5275 #define __pyx_kp_u_start_out_of_range_i __pyx_mstate_global->__pyx_kp_u_start_out_of_range_i
jpayne@68 5276 #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
jpayne@68 5277 #define __pyx_kp_u_stop_and_end_should_not_both_be __pyx_mstate_global->__pyx_kp_u_stop_and_end_should_not_both_be
jpayne@68 5278 #define __pyx_kp_u_stop_out_of_range_i __pyx_mstate_global->__pyx_kp_u_stop_out_of_range_i
jpayne@68 5279 #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
jpayne@68 5280 #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
jpayne@68 5281 #define __pyx_n_s_tb __pyx_mstate_global->__pyx_n_s_tb
jpayne@68 5282 #define __pyx_n_s_tell __pyx_mstate_global->__pyx_n_s_tell
jpayne@68 5283 #define __pyx_kp_u_tell_failed_on_HFile __pyx_mstate_global->__pyx_kp_u_tell_failed_on_HFile
jpayne@68 5284 #define __pyx_kp_u_tell_not_available_in_streams __pyx_mstate_global->__pyx_kp_u_tell_not_available_in_streams
jpayne@68 5285 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
jpayne@68 5286 #define __pyx_n_s_tid __pyx_mstate_global->__pyx_n_s_tid
jpayne@68 5287 #define __pyx_n_s_traceback __pyx_mstate_global->__pyx_n_s_traceback
jpayne@68 5288 #define __pyx_n_s_truncate __pyx_mstate_global->__pyx_n_s_truncate
jpayne@68 5289 #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type
jpayne@68 5290 #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value
jpayne@68 5291 #define __pyx_n_s_verbosity __pyx_mstate_global->__pyx_n_s_verbosity
jpayne@68 5292 #define __pyx_n_u_w __pyx_mstate_global->__pyx_n_u_w
jpayne@68 5293 #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn
jpayne@68 5294 #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
jpayne@68 5295 #define __pyx_n_s_whence __pyx_mstate_global->__pyx_n_s_whence
jpayne@68 5296 #define __pyx_n_s_writable __pyx_mstate_global->__pyx_n_s_writable
jpayne@68 5297 #define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write
jpayne@68 5298 #define __pyx_kp_u_write_failed_on_HFile __pyx_mstate_global->__pyx_kp_u_write_failed_on_HFile
jpayne@68 5299 #define __pyx_n_s_writelines __pyx_mstate_global->__pyx_n_s_writelines
jpayne@68 5300 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
jpayne@68 5301 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
jpayne@68 5302 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
jpayne@68 5303 #define __pyx_k__18 __pyx_mstate_global->__pyx_k__18
jpayne@68 5304 #define __pyx_k__41 __pyx_mstate_global->__pyx_k__41
jpayne@68 5305 #define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_
jpayne@68 5306 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
jpayne@68 5307 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
jpayne@68 5308 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39
jpayne@68 5309 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43
jpayne@68 5310 #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
jpayne@68 5311 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
jpayne@68 5312 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47
jpayne@68 5313 #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
jpayne@68 5314 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49
jpayne@68 5315 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51
jpayne@68 5316 #define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53
jpayne@68 5317 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54
jpayne@68 5318 #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57
jpayne@68 5319 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66
jpayne@68 5320 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67
jpayne@68 5321 #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68
jpayne@68 5322 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69
jpayne@68 5323 #define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70
jpayne@68 5324 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71
jpayne@68 5325 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72
jpayne@68 5326 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73
jpayne@68 5327 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74
jpayne@68 5328 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75
jpayne@68 5329 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76
jpayne@68 5330 #define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77
jpayne@68 5331 #define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78
jpayne@68 5332 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79
jpayne@68 5333 #define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80
jpayne@68 5334 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81
jpayne@68 5335 #define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82
jpayne@68 5336 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83
jpayne@68 5337 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84
jpayne@68 5338 #define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85
jpayne@68 5339 #define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86
jpayne@68 5340 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87
jpayne@68 5341 #define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88
jpayne@68 5342 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89
jpayne@68 5343 #define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90
jpayne@68 5344 #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91
jpayne@68 5345 #define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92
jpayne@68 5346 #define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93
jpayne@68 5347 #define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94
jpayne@68 5348 #define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95
jpayne@68 5349 #define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
jpayne@68 5350 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2
jpayne@68 5351 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3
jpayne@68 5352 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4
jpayne@68 5353 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7
jpayne@68 5354 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8
jpayne@68 5355 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9
jpayne@68 5356 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10
jpayne@68 5357 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11
jpayne@68 5358 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12
jpayne@68 5359 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14
jpayne@68 5360 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15
jpayne@68 5361 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16
jpayne@68 5362 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17
jpayne@68 5363 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19
jpayne@68 5364 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20
jpayne@68 5365 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21
jpayne@68 5366 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22
jpayne@68 5367 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23
jpayne@68 5368 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24
jpayne@68 5369 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25
jpayne@68 5370 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26
jpayne@68 5371 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27
jpayne@68 5372 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28
jpayne@68 5373 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29
jpayne@68 5374 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30
jpayne@68 5375 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31
jpayne@68 5376 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32
jpayne@68 5377 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33
jpayne@68 5378 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34
jpayne@68 5379 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35
jpayne@68 5380 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36
jpayne@68 5381 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37
jpayne@68 5382 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38
jpayne@68 5383 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40
jpayne@68 5384 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42
jpayne@68 5385 #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45
jpayne@68 5386 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50
jpayne@68 5387 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52
jpayne@68 5388 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60
jpayne@68 5389 #define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61
jpayne@68 5390 #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62
jpayne@68 5391 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63
jpayne@68 5392 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64
jpayne@68 5393 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65
jpayne@68 5394 /* #### Code section: module_code ### */
jpayne@68 5395
jpayne@68 5396 /* "cpython/complex.pxd":19
jpayne@68 5397 *
jpayne@68 5398 * @property
jpayne@68 5399 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<<
jpayne@68 5400 * return self.cval.real
jpayne@68 5401 *
jpayne@68 5402 */
jpayne@68 5403
jpayne@68 5404 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
jpayne@68 5405 double __pyx_r;
jpayne@68 5406
jpayne@68 5407 /* "cpython/complex.pxd":20
jpayne@68 5408 * @property
jpayne@68 5409 * cdef inline double real(self) noexcept:
jpayne@68 5410 * return self.cval.real # <<<<<<<<<<<<<<
jpayne@68 5411 *
jpayne@68 5412 * @property
jpayne@68 5413 */
jpayne@68 5414 __pyx_r = __pyx_v_self->cval.real;
jpayne@68 5415 goto __pyx_L0;
jpayne@68 5416
jpayne@68 5417 /* "cpython/complex.pxd":19
jpayne@68 5418 *
jpayne@68 5419 * @property
jpayne@68 5420 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<<
jpayne@68 5421 * return self.cval.real
jpayne@68 5422 *
jpayne@68 5423 */
jpayne@68 5424
jpayne@68 5425 /* function exit code */
jpayne@68 5426 __pyx_L0:;
jpayne@68 5427 return __pyx_r;
jpayne@68 5428 }
jpayne@68 5429
jpayne@68 5430 /* "cpython/complex.pxd":23
jpayne@68 5431 *
jpayne@68 5432 * @property
jpayne@68 5433 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<<
jpayne@68 5434 * return self.cval.imag
jpayne@68 5435 *
jpayne@68 5436 */
jpayne@68 5437
jpayne@68 5438 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
jpayne@68 5439 double __pyx_r;
jpayne@68 5440
jpayne@68 5441 /* "cpython/complex.pxd":24
jpayne@68 5442 * @property
jpayne@68 5443 * cdef inline double imag(self) noexcept:
jpayne@68 5444 * return self.cval.imag # <<<<<<<<<<<<<<
jpayne@68 5445 *
jpayne@68 5446 * # PyTypeObject PyComplex_Type
jpayne@68 5447 */
jpayne@68 5448 __pyx_r = __pyx_v_self->cval.imag;
jpayne@68 5449 goto __pyx_L0;
jpayne@68 5450
jpayne@68 5451 /* "cpython/complex.pxd":23
jpayne@68 5452 *
jpayne@68 5453 * @property
jpayne@68 5454 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<<
jpayne@68 5455 * return self.cval.imag
jpayne@68 5456 *
jpayne@68 5457 */
jpayne@68 5458
jpayne@68 5459 /* function exit code */
jpayne@68 5460 __pyx_L0:;
jpayne@68 5461 return __pyx_r;
jpayne@68 5462 }
jpayne@68 5463
jpayne@68 5464 /* "cpython/contextvars.pxd":112
jpayne@68 5465 *
jpayne@68 5466 *
jpayne@68 5467 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
jpayne@68 5468 * """Return a new reference to the value of the context variable,
jpayne@68 5469 * or the default value of the context variable,
jpayne@68 5470 */
jpayne@68 5471
jpayne@68 5472 static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {
jpayne@68 5473 PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
jpayne@68 5474 PyObject *__pyx_v_value;
jpayne@68 5475 PyObject *__pyx_v_pyvalue = NULL;
jpayne@68 5476 PyObject *__pyx_r = NULL;
jpayne@68 5477 __Pyx_RefNannyDeclarations
jpayne@68 5478 int __pyx_t_1;
jpayne@68 5479 int __pyx_t_2;
jpayne@68 5480 PyObject *__pyx_t_3 = NULL;
jpayne@68 5481 int __pyx_lineno = 0;
jpayne@68 5482 const char *__pyx_filename = NULL;
jpayne@68 5483 int __pyx_clineno = 0;
jpayne@68 5484 __Pyx_RefNannySetupContext("get_value", 1);
jpayne@68 5485 if (__pyx_optional_args) {
jpayne@68 5486 if (__pyx_optional_args->__pyx_n > 0) {
jpayne@68 5487 __pyx_v_default_value = __pyx_optional_args->default_value;
jpayne@68 5488 }
jpayne@68 5489 }
jpayne@68 5490
jpayne@68 5491 /* "cpython/contextvars.pxd":117
jpayne@68 5492 * or None if no such value or default was found.
jpayne@68 5493 * """
jpayne@68 5494 * cdef PyObject *value = NULL # <<<<<<<<<<<<<<
jpayne@68 5495 * PyContextVar_Get(var, NULL, &value)
jpayne@68 5496 * if value is NULL:
jpayne@68 5497 */
jpayne@68 5498 __pyx_v_value = NULL;
jpayne@68 5499
jpayne@68 5500 /* "cpython/contextvars.pxd":118
jpayne@68 5501 * """
jpayne@68 5502 * cdef PyObject *value = NULL
jpayne@68 5503 * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<<
jpayne@68 5504 * if value is NULL:
jpayne@68 5505 * # context variable does not have a default
jpayne@68 5506 */
jpayne@68 5507 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 118, __pyx_L1_error)
jpayne@68 5508
jpayne@68 5509 /* "cpython/contextvars.pxd":119
jpayne@68 5510 * cdef PyObject *value = NULL
jpayne@68 5511 * PyContextVar_Get(var, NULL, &value)
jpayne@68 5512 * if value is NULL: # <<<<<<<<<<<<<<
jpayne@68 5513 * # context variable does not have a default
jpayne@68 5514 * pyvalue = default_value
jpayne@68 5515 */
jpayne@68 5516 __pyx_t_2 = (__pyx_v_value == NULL);
jpayne@68 5517 if (__pyx_t_2) {
jpayne@68 5518
jpayne@68 5519 /* "cpython/contextvars.pxd":121
jpayne@68 5520 * if value is NULL:
jpayne@68 5521 * # context variable does not have a default
jpayne@68 5522 * pyvalue = default_value # <<<<<<<<<<<<<<
jpayne@68 5523 * else:
jpayne@68 5524 * # value or default value of context variable
jpayne@68 5525 */
jpayne@68 5526 __Pyx_INCREF(__pyx_v_default_value);
jpayne@68 5527 __pyx_v_pyvalue = __pyx_v_default_value;
jpayne@68 5528
jpayne@68 5529 /* "cpython/contextvars.pxd":119
jpayne@68 5530 * cdef PyObject *value = NULL
jpayne@68 5531 * PyContextVar_Get(var, NULL, &value)
jpayne@68 5532 * if value is NULL: # <<<<<<<<<<<<<<
jpayne@68 5533 * # context variable does not have a default
jpayne@68 5534 * pyvalue = default_value
jpayne@68 5535 */
jpayne@68 5536 goto __pyx_L3;
jpayne@68 5537 }
jpayne@68 5538
jpayne@68 5539 /* "cpython/contextvars.pxd":124
jpayne@68 5540 * else:
jpayne@68 5541 * # value or default value of context variable
jpayne@68 5542 * pyvalue = <object>value # <<<<<<<<<<<<<<
jpayne@68 5543 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
jpayne@68 5544 * return pyvalue
jpayne@68 5545 */
jpayne@68 5546 /*else*/ {
jpayne@68 5547 __pyx_t_3 = ((PyObject *)__pyx_v_value);
jpayne@68 5548 __Pyx_INCREF(__pyx_t_3);
jpayne@68 5549 __pyx_v_pyvalue = __pyx_t_3;
jpayne@68 5550 __pyx_t_3 = 0;
jpayne@68 5551
jpayne@68 5552 /* "cpython/contextvars.pxd":125
jpayne@68 5553 * # value or default value of context variable
jpayne@68 5554 * pyvalue = <object>value
jpayne@68 5555 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<<
jpayne@68 5556 * return pyvalue
jpayne@68 5557 *
jpayne@68 5558 */
jpayne@68 5559 Py_XDECREF(__pyx_v_value);
jpayne@68 5560 }
jpayne@68 5561 __pyx_L3:;
jpayne@68 5562
jpayne@68 5563 /* "cpython/contextvars.pxd":126
jpayne@68 5564 * pyvalue = <object>value
jpayne@68 5565 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
jpayne@68 5566 * return pyvalue # <<<<<<<<<<<<<<
jpayne@68 5567 *
jpayne@68 5568 *
jpayne@68 5569 */
jpayne@68 5570 __Pyx_XDECREF(__pyx_r);
jpayne@68 5571 __Pyx_INCREF(__pyx_v_pyvalue);
jpayne@68 5572 __pyx_r = __pyx_v_pyvalue;
jpayne@68 5573 goto __pyx_L0;
jpayne@68 5574
jpayne@68 5575 /* "cpython/contextvars.pxd":112
jpayne@68 5576 *
jpayne@68 5577 *
jpayne@68 5578 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
jpayne@68 5579 * """Return a new reference to the value of the context variable,
jpayne@68 5580 * or the default value of the context variable,
jpayne@68 5581 */
jpayne@68 5582
jpayne@68 5583 /* function exit code */
jpayne@68 5584 __pyx_L1_error:;
jpayne@68 5585 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 5586 __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 5587 __pyx_r = 0;
jpayne@68 5588 __pyx_L0:;
jpayne@68 5589 __Pyx_XDECREF(__pyx_v_pyvalue);
jpayne@68 5590 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 5591 __Pyx_RefNannyFinishContext();
jpayne@68 5592 return __pyx_r;
jpayne@68 5593 }
jpayne@68 5594
jpayne@68 5595 /* "cpython/contextvars.pxd":129
jpayne@68 5596 *
jpayne@68 5597 *
jpayne@68 5598 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
jpayne@68 5599 * """Return a new reference to the value of the context variable,
jpayne@68 5600 * or the provided default value if no such value was found.
jpayne@68 5601 */
jpayne@68 5602
jpayne@68 5603 static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {
jpayne@68 5604 PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
jpayne@68 5605 PyObject *__pyx_v_value;
jpayne@68 5606 PyObject *__pyx_v_pyvalue = NULL;
jpayne@68 5607 PyObject *__pyx_r = NULL;
jpayne@68 5608 __Pyx_RefNannyDeclarations
jpayne@68 5609 int __pyx_t_1;
jpayne@68 5610 PyObject *__pyx_t_2 = NULL;
jpayne@68 5611 int __pyx_lineno = 0;
jpayne@68 5612 const char *__pyx_filename = NULL;
jpayne@68 5613 int __pyx_clineno = 0;
jpayne@68 5614 __Pyx_RefNannySetupContext("get_value_no_default", 1);
jpayne@68 5615 if (__pyx_optional_args) {
jpayne@68 5616 if (__pyx_optional_args->__pyx_n > 0) {
jpayne@68 5617 __pyx_v_default_value = __pyx_optional_args->default_value;
jpayne@68 5618 }
jpayne@68 5619 }
jpayne@68 5620
jpayne@68 5621 /* "cpython/contextvars.pxd":135
jpayne@68 5622 * Ignores the default value of the context variable, if any.
jpayne@68 5623 * """
jpayne@68 5624 * cdef PyObject *value = NULL # <<<<<<<<<<<<<<
jpayne@68 5625 * PyContextVar_Get(var, <PyObject*>default_value, &value)
jpayne@68 5626 * # value of context variable or 'default_value'
jpayne@68 5627 */
jpayne@68 5628 __pyx_v_value = NULL;
jpayne@68 5629
jpayne@68 5630 /* "cpython/contextvars.pxd":136
jpayne@68 5631 * """
jpayne@68 5632 * cdef PyObject *value = NULL
jpayne@68 5633 * PyContextVar_Get(var, <PyObject*>default_value, &value) # <<<<<<<<<<<<<<
jpayne@68 5634 * # value of context variable or 'default_value'
jpayne@68 5635 * pyvalue = <object>value
jpayne@68 5636 */
jpayne@68 5637 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 136, __pyx_L1_error)
jpayne@68 5638
jpayne@68 5639 /* "cpython/contextvars.pxd":138
jpayne@68 5640 * PyContextVar_Get(var, <PyObject*>default_value, &value)
jpayne@68 5641 * # value of context variable or 'default_value'
jpayne@68 5642 * pyvalue = <object>value # <<<<<<<<<<<<<<
jpayne@68 5643 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
jpayne@68 5644 * return pyvalue
jpayne@68 5645 */
jpayne@68 5646 __pyx_t_2 = ((PyObject *)__pyx_v_value);
jpayne@68 5647 __Pyx_INCREF(__pyx_t_2);
jpayne@68 5648 __pyx_v_pyvalue = __pyx_t_2;
jpayne@68 5649 __pyx_t_2 = 0;
jpayne@68 5650
jpayne@68 5651 /* "cpython/contextvars.pxd":139
jpayne@68 5652 * # value of context variable or 'default_value'
jpayne@68 5653 * pyvalue = <object>value
jpayne@68 5654 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<<
jpayne@68 5655 * return pyvalue
jpayne@68 5656 */
jpayne@68 5657 Py_XDECREF(__pyx_v_value);
jpayne@68 5658
jpayne@68 5659 /* "cpython/contextvars.pxd":140
jpayne@68 5660 * pyvalue = <object>value
jpayne@68 5661 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
jpayne@68 5662 * return pyvalue # <<<<<<<<<<<<<<
jpayne@68 5663 */
jpayne@68 5664 __Pyx_XDECREF(__pyx_r);
jpayne@68 5665 __Pyx_INCREF(__pyx_v_pyvalue);
jpayne@68 5666 __pyx_r = __pyx_v_pyvalue;
jpayne@68 5667 goto __pyx_L0;
jpayne@68 5668
jpayne@68 5669 /* "cpython/contextvars.pxd":129
jpayne@68 5670 *
jpayne@68 5671 *
jpayne@68 5672 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
jpayne@68 5673 * """Return a new reference to the value of the context variable,
jpayne@68 5674 * or the provided default value if no such value was found.
jpayne@68 5675 */
jpayne@68 5676
jpayne@68 5677 /* function exit code */
jpayne@68 5678 __pyx_L1_error:;
jpayne@68 5679 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 5680 __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 5681 __pyx_r = 0;
jpayne@68 5682 __pyx_L0:;
jpayne@68 5683 __Pyx_XDECREF(__pyx_v_pyvalue);
jpayne@68 5684 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 5685 __Pyx_RefNannyFinishContext();
jpayne@68 5686 return __pyx_r;
jpayne@68 5687 }
jpayne@68 5688
jpayne@68 5689 /* "array.pxd":104
jpayne@68 5690 * __data_union data
jpayne@68 5691 *
jpayne@68 5692 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
jpayne@68 5693 * # This implementation of getbuffer is geared towards Cython
jpayne@68 5694 * # requirements, and does not yet fulfill the PEP.
jpayne@68 5695 */
jpayne@68 5696
jpayne@68 5697 /* Python wrapper */
jpayne@68 5698 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
jpayne@68 5699 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
jpayne@68 5700 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 5701 int __pyx_r;
jpayne@68 5702 __Pyx_RefNannyDeclarations
jpayne@68 5703 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
jpayne@68 5704 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 5705 __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
jpayne@68 5706
jpayne@68 5707 /* function exit code */
jpayne@68 5708 __Pyx_RefNannyFinishContext();
jpayne@68 5709 return __pyx_r;
jpayne@68 5710 }
jpayne@68 5711
jpayne@68 5712 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
jpayne@68 5713 PyObject *__pyx_v_item_count = NULL;
jpayne@68 5714 int __pyx_r;
jpayne@68 5715 __Pyx_RefNannyDeclarations
jpayne@68 5716 PyObject *__pyx_t_1 = NULL;
jpayne@68 5717 char *__pyx_t_2;
jpayne@68 5718 int __pyx_t_3;
jpayne@68 5719 PyObject *__pyx_t_4 = NULL;
jpayne@68 5720 Py_ssize_t __pyx_t_5;
jpayne@68 5721 int __pyx_t_6;
jpayne@68 5722 char __pyx_t_7;
jpayne@68 5723 int __pyx_lineno = 0;
jpayne@68 5724 const char *__pyx_filename = NULL;
jpayne@68 5725 int __pyx_clineno = 0;
jpayne@68 5726 if (unlikely(__pyx_v_info == NULL)) {
jpayne@68 5727 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
jpayne@68 5728 return -1;
jpayne@68 5729 }
jpayne@68 5730 __Pyx_RefNannySetupContext("__getbuffer__", 0);
jpayne@68 5731 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 5732 __Pyx_GIVEREF(__pyx_v_info->obj);
jpayne@68 5733
jpayne@68 5734 /* "array.pxd":109
jpayne@68 5735 * # In particular strided access is always provided regardless
jpayne@68 5736 * # of flags
jpayne@68 5737 * item_count = Py_SIZE(self) # <<<<<<<<<<<<<<
jpayne@68 5738 *
jpayne@68 5739 * info.suboffsets = NULL
jpayne@68 5740 */
jpayne@68 5741 __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 109, __pyx_L1_error)
jpayne@68 5742 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 5743 __pyx_v_item_count = __pyx_t_1;
jpayne@68 5744 __pyx_t_1 = 0;
jpayne@68 5745
jpayne@68 5746 /* "array.pxd":111
jpayne@68 5747 * item_count = Py_SIZE(self)
jpayne@68 5748 *
jpayne@68 5749 * info.suboffsets = NULL # <<<<<<<<<<<<<<
jpayne@68 5750 * info.buf = self.data.as_chars
jpayne@68 5751 * info.readonly = 0
jpayne@68 5752 */
jpayne@68 5753 __pyx_v_info->suboffsets = NULL;
jpayne@68 5754
jpayne@68 5755 /* "array.pxd":112
jpayne@68 5756 *
jpayne@68 5757 * info.suboffsets = NULL
jpayne@68 5758 * info.buf = self.data.as_chars # <<<<<<<<<<<<<<
jpayne@68 5759 * info.readonly = 0
jpayne@68 5760 * info.ndim = 1
jpayne@68 5761 */
jpayne@68 5762 __pyx_t_2 = __pyx_v_self->data.as_chars;
jpayne@68 5763 __pyx_v_info->buf = __pyx_t_2;
jpayne@68 5764
jpayne@68 5765 /* "array.pxd":113
jpayne@68 5766 * info.suboffsets = NULL
jpayne@68 5767 * info.buf = self.data.as_chars
jpayne@68 5768 * info.readonly = 0 # <<<<<<<<<<<<<<
jpayne@68 5769 * info.ndim = 1
jpayne@68 5770 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
jpayne@68 5771 */
jpayne@68 5772 __pyx_v_info->readonly = 0;
jpayne@68 5773
jpayne@68 5774 /* "array.pxd":114
jpayne@68 5775 * info.buf = self.data.as_chars
jpayne@68 5776 * info.readonly = 0
jpayne@68 5777 * info.ndim = 1 # <<<<<<<<<<<<<<
jpayne@68 5778 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
jpayne@68 5779 * info.len = info.itemsize * item_count
jpayne@68 5780 */
jpayne@68 5781 __pyx_v_info->ndim = 1;
jpayne@68 5782
jpayne@68 5783 /* "array.pxd":115
jpayne@68 5784 * info.readonly = 0
jpayne@68 5785 * info.ndim = 1
jpayne@68 5786 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<<
jpayne@68 5787 * info.len = info.itemsize * item_count
jpayne@68 5788 *
jpayne@68 5789 */
jpayne@68 5790 __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
jpayne@68 5791 __pyx_v_info->itemsize = __pyx_t_3;
jpayne@68 5792
jpayne@68 5793 /* "array.pxd":116
jpayne@68 5794 * info.ndim = 1
jpayne@68 5795 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
jpayne@68 5796 * info.len = info.itemsize * item_count # <<<<<<<<<<<<<<
jpayne@68 5797 *
jpayne@68 5798 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
jpayne@68 5799 */
jpayne@68 5800 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 116, __pyx_L1_error)
jpayne@68 5801 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 5802 __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 116, __pyx_L1_error)
jpayne@68 5803 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 5804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 5805 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 116, __pyx_L1_error)
jpayne@68 5806 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 5807 __pyx_v_info->len = __pyx_t_5;
jpayne@68 5808
jpayne@68 5809 /* "array.pxd":118
jpayne@68 5810 * info.len = info.itemsize * item_count
jpayne@68 5811 *
jpayne@68 5812 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<<
jpayne@68 5813 * if not info.shape:
jpayne@68 5814 * raise MemoryError()
jpayne@68 5815 */
jpayne@68 5816 __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2)));
jpayne@68 5817
jpayne@68 5818 /* "array.pxd":119
jpayne@68 5819 *
jpayne@68 5820 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
jpayne@68 5821 * if not info.shape: # <<<<<<<<<<<<<<
jpayne@68 5822 * raise MemoryError()
jpayne@68 5823 * info.shape[0] = item_count # constant regardless of resizing
jpayne@68 5824 */
jpayne@68 5825 __pyx_t_6 = (!(__pyx_v_info->shape != 0));
jpayne@68 5826 if (unlikely(__pyx_t_6)) {
jpayne@68 5827
jpayne@68 5828 /* "array.pxd":120
jpayne@68 5829 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
jpayne@68 5830 * if not info.shape:
jpayne@68 5831 * raise MemoryError() # <<<<<<<<<<<<<<
jpayne@68 5832 * info.shape[0] = item_count # constant regardless of resizing
jpayne@68 5833 * info.strides = &info.itemsize
jpayne@68 5834 */
jpayne@68 5835 PyErr_NoMemory(); __PYX_ERR(3, 120, __pyx_L1_error)
jpayne@68 5836
jpayne@68 5837 /* "array.pxd":119
jpayne@68 5838 *
jpayne@68 5839 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
jpayne@68 5840 * if not info.shape: # <<<<<<<<<<<<<<
jpayne@68 5841 * raise MemoryError()
jpayne@68 5842 * info.shape[0] = item_count # constant regardless of resizing
jpayne@68 5843 */
jpayne@68 5844 }
jpayne@68 5845
jpayne@68 5846 /* "array.pxd":121
jpayne@68 5847 * if not info.shape:
jpayne@68 5848 * raise MemoryError()
jpayne@68 5849 * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<<
jpayne@68 5850 * info.strides = &info.itemsize
jpayne@68 5851 *
jpayne@68 5852 */
jpayne@68 5853 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L1_error)
jpayne@68 5854 (__pyx_v_info->shape[0]) = __pyx_t_5;
jpayne@68 5855
jpayne@68 5856 /* "array.pxd":122
jpayne@68 5857 * raise MemoryError()
jpayne@68 5858 * info.shape[0] = item_count # constant regardless of resizing
jpayne@68 5859 * info.strides = &info.itemsize # <<<<<<<<<<<<<<
jpayne@68 5860 *
jpayne@68 5861 * info.format = <char*> (info.shape + 1)
jpayne@68 5862 */
jpayne@68 5863 __pyx_v_info->strides = (&__pyx_v_info->itemsize);
jpayne@68 5864
jpayne@68 5865 /* "array.pxd":124
jpayne@68 5866 * info.strides = &info.itemsize
jpayne@68 5867 *
jpayne@68 5868 * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<<
jpayne@68 5869 * info.format[0] = self.ob_descr.typecode
jpayne@68 5870 * info.format[1] = 0
jpayne@68 5871 */
jpayne@68 5872 __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
jpayne@68 5873
jpayne@68 5874 /* "array.pxd":125
jpayne@68 5875 *
jpayne@68 5876 * info.format = <char*> (info.shape + 1)
jpayne@68 5877 * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<<
jpayne@68 5878 * info.format[1] = 0
jpayne@68 5879 * info.obj = self
jpayne@68 5880 */
jpayne@68 5881 __pyx_t_7 = __pyx_v_self->ob_descr->typecode;
jpayne@68 5882 (__pyx_v_info->format[0]) = __pyx_t_7;
jpayne@68 5883
jpayne@68 5884 /* "array.pxd":126
jpayne@68 5885 * info.format = <char*> (info.shape + 1)
jpayne@68 5886 * info.format[0] = self.ob_descr.typecode
jpayne@68 5887 * info.format[1] = 0 # <<<<<<<<<<<<<<
jpayne@68 5888 * info.obj = self
jpayne@68 5889 *
jpayne@68 5890 */
jpayne@68 5891 (__pyx_v_info->format[1]) = 0;
jpayne@68 5892
jpayne@68 5893 /* "array.pxd":127
jpayne@68 5894 * info.format[0] = self.ob_descr.typecode
jpayne@68 5895 * info.format[1] = 0
jpayne@68 5896 * info.obj = self # <<<<<<<<<<<<<<
jpayne@68 5897 *
jpayne@68 5898 * def __releasebuffer__(self, Py_buffer* info):
jpayne@68 5899 */
jpayne@68 5900 __Pyx_INCREF((PyObject *)__pyx_v_self);
jpayne@68 5901 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
jpayne@68 5902 __Pyx_GOTREF(__pyx_v_info->obj);
jpayne@68 5903 __Pyx_DECREF(__pyx_v_info->obj);
jpayne@68 5904 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
jpayne@68 5905
jpayne@68 5906 /* "array.pxd":104
jpayne@68 5907 * __data_union data
jpayne@68 5908 *
jpayne@68 5909 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
jpayne@68 5910 * # This implementation of getbuffer is geared towards Cython
jpayne@68 5911 * # requirements, and does not yet fulfill the PEP.
jpayne@68 5912 */
jpayne@68 5913
jpayne@68 5914 /* function exit code */
jpayne@68 5915 __pyx_r = 0;
jpayne@68 5916 goto __pyx_L0;
jpayne@68 5917 __pyx_L1_error:;
jpayne@68 5918 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 5919 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 5920 __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 5921 __pyx_r = -1;
jpayne@68 5922 if (__pyx_v_info->obj != NULL) {
jpayne@68 5923 __Pyx_GOTREF(__pyx_v_info->obj);
jpayne@68 5924 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
jpayne@68 5925 }
jpayne@68 5926 goto __pyx_L2;
jpayne@68 5927 __pyx_L0:;
jpayne@68 5928 if (__pyx_v_info->obj == Py_None) {
jpayne@68 5929 __Pyx_GOTREF(__pyx_v_info->obj);
jpayne@68 5930 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
jpayne@68 5931 }
jpayne@68 5932 __pyx_L2:;
jpayne@68 5933 __Pyx_XDECREF(__pyx_v_item_count);
jpayne@68 5934 __Pyx_RefNannyFinishContext();
jpayne@68 5935 return __pyx_r;
jpayne@68 5936 }
jpayne@68 5937
jpayne@68 5938 /* "array.pxd":129
jpayne@68 5939 * info.obj = self
jpayne@68 5940 *
jpayne@68 5941 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
jpayne@68 5942 * PyObject_Free(info.shape)
jpayne@68 5943 *
jpayne@68 5944 */
jpayne@68 5945
jpayne@68 5946 /* Python wrapper */
jpayne@68 5947 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
jpayne@68 5948 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
jpayne@68 5949 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 5950 __Pyx_RefNannyDeclarations
jpayne@68 5951 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
jpayne@68 5952 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 5953 __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
jpayne@68 5954
jpayne@68 5955 /* function exit code */
jpayne@68 5956 __Pyx_RefNannyFinishContext();
jpayne@68 5957 }
jpayne@68 5958
jpayne@68 5959 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
jpayne@68 5960
jpayne@68 5961 /* "array.pxd":130
jpayne@68 5962 *
jpayne@68 5963 * def __releasebuffer__(self, Py_buffer* info):
jpayne@68 5964 * PyObject_Free(info.shape) # <<<<<<<<<<<<<<
jpayne@68 5965 *
jpayne@68 5966 * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
jpayne@68 5967 */
jpayne@68 5968 PyObject_Free(__pyx_v_info->shape);
jpayne@68 5969
jpayne@68 5970 /* "array.pxd":129
jpayne@68 5971 * info.obj = self
jpayne@68 5972 *
jpayne@68 5973 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
jpayne@68 5974 * PyObject_Free(info.shape)
jpayne@68 5975 *
jpayne@68 5976 */
jpayne@68 5977
jpayne@68 5978 /* function exit code */
jpayne@68 5979 }
jpayne@68 5980
jpayne@68 5981 /* "array.pxd":141
jpayne@68 5982 *
jpayne@68 5983 *
jpayne@68 5984 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
jpayne@68 5985 * """ fast creation of a new array, given a template array.
jpayne@68 5986 * type will be same as template.
jpayne@68 5987 */
jpayne@68 5988
jpayne@68 5989 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
jpayne@68 5990 arrayobject *__pyx_v_op = 0;
jpayne@68 5991 arrayobject *__pyx_r = NULL;
jpayne@68 5992 __Pyx_RefNannyDeclarations
jpayne@68 5993 PyObject *__pyx_t_1 = NULL;
jpayne@68 5994 int __pyx_t_2;
jpayne@68 5995 int __pyx_t_3;
jpayne@68 5996 int __pyx_lineno = 0;
jpayne@68 5997 const char *__pyx_filename = NULL;
jpayne@68 5998 int __pyx_clineno = 0;
jpayne@68 5999 __Pyx_RefNannySetupContext("clone", 1);
jpayne@68 6000
jpayne@68 6001 /* "array.pxd":145
jpayne@68 6002 * type will be same as template.
jpayne@68 6003 * if zero is true, new array will be initialized with zeroes."""
jpayne@68 6004 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<<
jpayne@68 6005 * if zero and op is not None:
jpayne@68 6006 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
jpayne@68 6007 */
jpayne@68 6008 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 145, __pyx_L1_error)
jpayne@68 6009 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6010 __pyx_v_op = ((arrayobject *)__pyx_t_1);
jpayne@68 6011 __pyx_t_1 = 0;
jpayne@68 6012
jpayne@68 6013 /* "array.pxd":146
jpayne@68 6014 * if zero is true, new array will be initialized with zeroes."""
jpayne@68 6015 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
jpayne@68 6016 * if zero and op is not None: # <<<<<<<<<<<<<<
jpayne@68 6017 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
jpayne@68 6018 * return op
jpayne@68 6019 */
jpayne@68 6020 if (__pyx_v_zero) {
jpayne@68 6021 } else {
jpayne@68 6022 __pyx_t_2 = __pyx_v_zero;
jpayne@68 6023 goto __pyx_L4_bool_binop_done;
jpayne@68 6024 }
jpayne@68 6025 __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
jpayne@68 6026 __pyx_t_2 = __pyx_t_3;
jpayne@68 6027 __pyx_L4_bool_binop_done:;
jpayne@68 6028 if (__pyx_t_2) {
jpayne@68 6029
jpayne@68 6030 /* "array.pxd":147
jpayne@68 6031 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
jpayne@68 6032 * if zero and op is not None:
jpayne@68 6033 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
jpayne@68 6034 * return op
jpayne@68 6035 *
jpayne@68 6036 */
jpayne@68 6037 (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));
jpayne@68 6038
jpayne@68 6039 /* "array.pxd":146
jpayne@68 6040 * if zero is true, new array will be initialized with zeroes."""
jpayne@68 6041 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
jpayne@68 6042 * if zero and op is not None: # <<<<<<<<<<<<<<
jpayne@68 6043 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
jpayne@68 6044 * return op
jpayne@68 6045 */
jpayne@68 6046 }
jpayne@68 6047
jpayne@68 6048 /* "array.pxd":148
jpayne@68 6049 * if zero and op is not None:
jpayne@68 6050 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
jpayne@68 6051 * return op # <<<<<<<<<<<<<<
jpayne@68 6052 *
jpayne@68 6053 * cdef inline array copy(array self):
jpayne@68 6054 */
jpayne@68 6055 __Pyx_XDECREF((PyObject *)__pyx_r);
jpayne@68 6056 __Pyx_INCREF((PyObject *)__pyx_v_op);
jpayne@68 6057 __pyx_r = __pyx_v_op;
jpayne@68 6058 goto __pyx_L0;
jpayne@68 6059
jpayne@68 6060 /* "array.pxd":141
jpayne@68 6061 *
jpayne@68 6062 *
jpayne@68 6063 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
jpayne@68 6064 * """ fast creation of a new array, given a template array.
jpayne@68 6065 * type will be same as template.
jpayne@68 6066 */
jpayne@68 6067
jpayne@68 6068 /* function exit code */
jpayne@68 6069 __pyx_L1_error:;
jpayne@68 6070 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6071 __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6072 __pyx_r = 0;
jpayne@68 6073 __pyx_L0:;
jpayne@68 6074 __Pyx_XDECREF((PyObject *)__pyx_v_op);
jpayne@68 6075 __Pyx_XGIVEREF((PyObject *)__pyx_r);
jpayne@68 6076 __Pyx_RefNannyFinishContext();
jpayne@68 6077 return __pyx_r;
jpayne@68 6078 }
jpayne@68 6079
jpayne@68 6080 /* "array.pxd":150
jpayne@68 6081 * return op
jpayne@68 6082 *
jpayne@68 6083 * cdef inline array copy(array self): # <<<<<<<<<<<<<<
jpayne@68 6084 * """ make a copy of an array. """
jpayne@68 6085 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
jpayne@68 6086 */
jpayne@68 6087
jpayne@68 6088 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
jpayne@68 6089 arrayobject *__pyx_v_op = 0;
jpayne@68 6090 arrayobject *__pyx_r = NULL;
jpayne@68 6091 __Pyx_RefNannyDeclarations
jpayne@68 6092 PyObject *__pyx_t_1 = NULL;
jpayne@68 6093 int __pyx_lineno = 0;
jpayne@68 6094 const char *__pyx_filename = NULL;
jpayne@68 6095 int __pyx_clineno = 0;
jpayne@68 6096 __Pyx_RefNannySetupContext("copy", 1);
jpayne@68 6097
jpayne@68 6098 /* "array.pxd":152
jpayne@68 6099 * cdef inline array copy(array self):
jpayne@68 6100 * """ make a copy of an array. """
jpayne@68 6101 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<<
jpayne@68 6102 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
jpayne@68 6103 * return op
jpayne@68 6104 */
jpayne@68 6105 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 152, __pyx_L1_error)
jpayne@68 6106 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6107 __pyx_v_op = ((arrayobject *)__pyx_t_1);
jpayne@68 6108 __pyx_t_1 = 0;
jpayne@68 6109
jpayne@68 6110 /* "array.pxd":153
jpayne@68 6111 * """ make a copy of an array. """
jpayne@68 6112 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
jpayne@68 6113 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
jpayne@68 6114 * return op
jpayne@68 6115 *
jpayne@68 6116 */
jpayne@68 6117 (void)(memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize)));
jpayne@68 6118
jpayne@68 6119 /* "array.pxd":154
jpayne@68 6120 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
jpayne@68 6121 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
jpayne@68 6122 * return op # <<<<<<<<<<<<<<
jpayne@68 6123 *
jpayne@68 6124 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
jpayne@68 6125 */
jpayne@68 6126 __Pyx_XDECREF((PyObject *)__pyx_r);
jpayne@68 6127 __Pyx_INCREF((PyObject *)__pyx_v_op);
jpayne@68 6128 __pyx_r = __pyx_v_op;
jpayne@68 6129 goto __pyx_L0;
jpayne@68 6130
jpayne@68 6131 /* "array.pxd":150
jpayne@68 6132 * return op
jpayne@68 6133 *
jpayne@68 6134 * cdef inline array copy(array self): # <<<<<<<<<<<<<<
jpayne@68 6135 * """ make a copy of an array. """
jpayne@68 6136 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
jpayne@68 6137 */
jpayne@68 6138
jpayne@68 6139 /* function exit code */
jpayne@68 6140 __pyx_L1_error:;
jpayne@68 6141 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6142 __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6143 __pyx_r = 0;
jpayne@68 6144 __pyx_L0:;
jpayne@68 6145 __Pyx_XDECREF((PyObject *)__pyx_v_op);
jpayne@68 6146 __Pyx_XGIVEREF((PyObject *)__pyx_r);
jpayne@68 6147 __Pyx_RefNannyFinishContext();
jpayne@68 6148 return __pyx_r;
jpayne@68 6149 }
jpayne@68 6150
jpayne@68 6151 /* "array.pxd":156
jpayne@68 6152 * return op
jpayne@68 6153 *
jpayne@68 6154 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
jpayne@68 6155 * """ efficient appending of new stuff of same type
jpayne@68 6156 * (e.g. of same array type)
jpayne@68 6157 */
jpayne@68 6158
jpayne@68 6159 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
jpayne@68 6160 Py_ssize_t __pyx_v_itemsize;
jpayne@68 6161 Py_ssize_t __pyx_v_origsize;
jpayne@68 6162 int __pyx_r;
jpayne@68 6163 int __pyx_t_1;
jpayne@68 6164 int __pyx_lineno = 0;
jpayne@68 6165 const char *__pyx_filename = NULL;
jpayne@68 6166 int __pyx_clineno = 0;
jpayne@68 6167
jpayne@68 6168 /* "array.pxd":160
jpayne@68 6169 * (e.g. of same array type)
jpayne@68 6170 * n: number of elements (not number of bytes!) """
jpayne@68 6171 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<<
jpayne@68 6172 * cdef Py_ssize_t origsize = Py_SIZE(self)
jpayne@68 6173 * resize_smart(self, origsize + n)
jpayne@68 6174 */
jpayne@68 6175 __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
jpayne@68 6176 __pyx_v_itemsize = __pyx_t_1;
jpayne@68 6177
jpayne@68 6178 /* "array.pxd":161
jpayne@68 6179 * n: number of elements (not number of bytes!) """
jpayne@68 6180 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
jpayne@68 6181 * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<<
jpayne@68 6182 * resize_smart(self, origsize + n)
jpayne@68 6183 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
jpayne@68 6184 */
jpayne@68 6185 __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
jpayne@68 6186
jpayne@68 6187 /* "array.pxd":162
jpayne@68 6188 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
jpayne@68 6189 * cdef Py_ssize_t origsize = Py_SIZE(self)
jpayne@68 6190 * resize_smart(self, origsize + n) # <<<<<<<<<<<<<<
jpayne@68 6191 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
jpayne@68 6192 * return 0
jpayne@68 6193 */
jpayne@68 6194 __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 162, __pyx_L1_error)
jpayne@68 6195
jpayne@68 6196 /* "array.pxd":163
jpayne@68 6197 * cdef Py_ssize_t origsize = Py_SIZE(self)
jpayne@68 6198 * resize_smart(self, origsize + n)
jpayne@68 6199 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<<
jpayne@68 6200 * return 0
jpayne@68 6201 *
jpayne@68 6202 */
jpayne@68 6203 (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));
jpayne@68 6204
jpayne@68 6205 /* "array.pxd":164
jpayne@68 6206 * resize_smart(self, origsize + n)
jpayne@68 6207 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
jpayne@68 6208 * return 0 # <<<<<<<<<<<<<<
jpayne@68 6209 *
jpayne@68 6210 * cdef inline int extend(array self, array other) except -1:
jpayne@68 6211 */
jpayne@68 6212 __pyx_r = 0;
jpayne@68 6213 goto __pyx_L0;
jpayne@68 6214
jpayne@68 6215 /* "array.pxd":156
jpayne@68 6216 * return op
jpayne@68 6217 *
jpayne@68 6218 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
jpayne@68 6219 * """ efficient appending of new stuff of same type
jpayne@68 6220 * (e.g. of same array type)
jpayne@68 6221 */
jpayne@68 6222
jpayne@68 6223 /* function exit code */
jpayne@68 6224 __pyx_L1_error:;
jpayne@68 6225 __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6226 __pyx_r = -1;
jpayne@68 6227 __pyx_L0:;
jpayne@68 6228 return __pyx_r;
jpayne@68 6229 }
jpayne@68 6230
jpayne@68 6231 /* "array.pxd":166
jpayne@68 6232 * return 0
jpayne@68 6233 *
jpayne@68 6234 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
jpayne@68 6235 * """ extend array with data from another array; types must match. """
jpayne@68 6236 * if self.ob_descr.typecode != other.ob_descr.typecode:
jpayne@68 6237 */
jpayne@68 6238
jpayne@68 6239 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
jpayne@68 6240 int __pyx_r;
jpayne@68 6241 int __pyx_t_1;
jpayne@68 6242 int __pyx_t_2;
jpayne@68 6243 int __pyx_lineno = 0;
jpayne@68 6244 const char *__pyx_filename = NULL;
jpayne@68 6245 int __pyx_clineno = 0;
jpayne@68 6246
jpayne@68 6247 /* "array.pxd":168
jpayne@68 6248 * cdef inline int extend(array self, array other) except -1:
jpayne@68 6249 * """ extend array with data from another array; types must match. """
jpayne@68 6250 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
jpayne@68 6251 * PyErr_BadArgument()
jpayne@68 6252 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
jpayne@68 6253 */
jpayne@68 6254 __pyx_t_1 = (__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode);
jpayne@68 6255 if (__pyx_t_1) {
jpayne@68 6256
jpayne@68 6257 /* "array.pxd":169
jpayne@68 6258 * """ extend array with data from another array; types must match. """
jpayne@68 6259 * if self.ob_descr.typecode != other.ob_descr.typecode:
jpayne@68 6260 * PyErr_BadArgument() # <<<<<<<<<<<<<<
jpayne@68 6261 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
jpayne@68 6262 *
jpayne@68 6263 */
jpayne@68 6264 __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 169, __pyx_L1_error)
jpayne@68 6265
jpayne@68 6266 /* "array.pxd":168
jpayne@68 6267 * cdef inline int extend(array self, array other) except -1:
jpayne@68 6268 * """ extend array with data from another array; types must match. """
jpayne@68 6269 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
jpayne@68 6270 * PyErr_BadArgument()
jpayne@68 6271 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
jpayne@68 6272 */
jpayne@68 6273 }
jpayne@68 6274
jpayne@68 6275 /* "array.pxd":170
jpayne@68 6276 * if self.ob_descr.typecode != other.ob_descr.typecode:
jpayne@68 6277 * PyErr_BadArgument()
jpayne@68 6278 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<<
jpayne@68 6279 *
jpayne@68 6280 * cdef inline void zero(array self) noexcept:
jpayne@68 6281 */
jpayne@68 6282 __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 170, __pyx_L1_error)
jpayne@68 6283 __pyx_r = __pyx_t_2;
jpayne@68 6284 goto __pyx_L0;
jpayne@68 6285
jpayne@68 6286 /* "array.pxd":166
jpayne@68 6287 * return 0
jpayne@68 6288 *
jpayne@68 6289 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
jpayne@68 6290 * """ extend array with data from another array; types must match. """
jpayne@68 6291 * if self.ob_descr.typecode != other.ob_descr.typecode:
jpayne@68 6292 */
jpayne@68 6293
jpayne@68 6294 /* function exit code */
jpayne@68 6295 __pyx_L1_error:;
jpayne@68 6296 __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6297 __pyx_r = -1;
jpayne@68 6298 __pyx_L0:;
jpayne@68 6299 return __pyx_r;
jpayne@68 6300 }
jpayne@68 6301
jpayne@68 6302 /* "array.pxd":172
jpayne@68 6303 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
jpayne@68 6304 *
jpayne@68 6305 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<<
jpayne@68 6306 * """ set all elements of array to zero. """
jpayne@68 6307 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
jpayne@68 6308 */
jpayne@68 6309
jpayne@68 6310 static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
jpayne@68 6311
jpayne@68 6312 /* "array.pxd":174
jpayne@68 6313 * cdef inline void zero(array self) noexcept:
jpayne@68 6314 * """ set all elements of array to zero. """
jpayne@68 6315 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<<
jpayne@68 6316 */
jpayne@68 6317 (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));
jpayne@68 6318
jpayne@68 6319 /* "array.pxd":172
jpayne@68 6320 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
jpayne@68 6321 *
jpayne@68 6322 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<<
jpayne@68 6323 * """ set all elements of array to zero. """
jpayne@68 6324 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
jpayne@68 6325 */
jpayne@68 6326
jpayne@68 6327 /* function exit code */
jpayne@68 6328 }
jpayne@68 6329
jpayne@68 6330 /* "pysam/libchtslib.pyx":53
jpayne@68 6331 *
jpayne@68 6332 *
jpayne@68 6333 * cpdef set_verbosity(int verbosity): # <<<<<<<<<<<<<<
jpayne@68 6334 * """Set htslib's hts_verbose global variable to the specified value."""
jpayne@68 6335 * return hts_set_verbosity(verbosity)
jpayne@68 6336 */
jpayne@68 6337
jpayne@68 6338 static PyObject *__pyx_pw_5pysam_10libchtslib_1set_verbosity(PyObject *__pyx_self,
jpayne@68 6339 #if CYTHON_METH_FASTCALL
jpayne@68 6340 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 6341 #else
jpayne@68 6342 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 6343 #endif
jpayne@68 6344 ); /*proto*/
jpayne@68 6345 static PyObject *__pyx_f_5pysam_10libchtslib_set_verbosity(int __pyx_v_verbosity, CYTHON_UNUSED int __pyx_skip_dispatch) {
jpayne@68 6346 PyObject *__pyx_r = NULL;
jpayne@68 6347 __Pyx_TraceDeclarations
jpayne@68 6348 __Pyx_RefNannyDeclarations
jpayne@68 6349 PyObject *__pyx_t_1 = NULL;
jpayne@68 6350 int __pyx_lineno = 0;
jpayne@68 6351 const char *__pyx_filename = NULL;
jpayne@68 6352 int __pyx_clineno = 0;
jpayne@68 6353 __Pyx_TraceFrameInit(__pyx_codeobj_)
jpayne@68 6354 __Pyx_RefNannySetupContext("set_verbosity", 1);
jpayne@68 6355 __Pyx_TraceCall("set_verbosity", __pyx_f[0], 53, 0, __PYX_ERR(0, 53, __pyx_L1_error));
jpayne@68 6356
jpayne@68 6357 /* "pysam/libchtslib.pyx":55
jpayne@68 6358 * cpdef set_verbosity(int verbosity):
jpayne@68 6359 * """Set htslib's hts_verbose global variable to the specified value."""
jpayne@68 6360 * return hts_set_verbosity(verbosity) # <<<<<<<<<<<<<<
jpayne@68 6361 *
jpayne@68 6362 * cpdef get_verbosity():
jpayne@68 6363 */
jpayne@68 6364 __Pyx_XDECREF(__pyx_r);
jpayne@68 6365 __pyx_t_1 = __Pyx_PyInt_From_int(hts_set_verbosity(__pyx_v_verbosity)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
jpayne@68 6366 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6367 __pyx_r = __pyx_t_1;
jpayne@68 6368 __pyx_t_1 = 0;
jpayne@68 6369 goto __pyx_L0;
jpayne@68 6370
jpayne@68 6371 /* "pysam/libchtslib.pyx":53
jpayne@68 6372 *
jpayne@68 6373 *
jpayne@68 6374 * cpdef set_verbosity(int verbosity): # <<<<<<<<<<<<<<
jpayne@68 6375 * """Set htslib's hts_verbose global variable to the specified value."""
jpayne@68 6376 * return hts_set_verbosity(verbosity)
jpayne@68 6377 */
jpayne@68 6378
jpayne@68 6379 /* function exit code */
jpayne@68 6380 __pyx_L1_error:;
jpayne@68 6381 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6382 __Pyx_AddTraceback("pysam.libchtslib.set_verbosity", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6383 __pyx_r = 0;
jpayne@68 6384 __pyx_L0:;
jpayne@68 6385 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 6386 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 6387 __Pyx_RefNannyFinishContext();
jpayne@68 6388 return __pyx_r;
jpayne@68 6389 }
jpayne@68 6390
jpayne@68 6391 /* Python wrapper */
jpayne@68 6392 static PyObject *__pyx_pw_5pysam_10libchtslib_1set_verbosity(PyObject *__pyx_self,
jpayne@68 6393 #if CYTHON_METH_FASTCALL
jpayne@68 6394 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 6395 #else
jpayne@68 6396 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 6397 #endif
jpayne@68 6398 ); /*proto*/
jpayne@68 6399 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_set_verbosity, "set_verbosity(int verbosity)\nSet htslib's hts_verbose global variable to the specified value.");
jpayne@68 6400 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_1set_verbosity = {"set_verbosity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_1set_verbosity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_set_verbosity};
jpayne@68 6401 static PyObject *__pyx_pw_5pysam_10libchtslib_1set_verbosity(PyObject *__pyx_self,
jpayne@68 6402 #if CYTHON_METH_FASTCALL
jpayne@68 6403 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 6404 #else
jpayne@68 6405 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 6406 #endif
jpayne@68 6407 ) {
jpayne@68 6408 int __pyx_v_verbosity;
jpayne@68 6409 #if !CYTHON_METH_FASTCALL
jpayne@68 6410 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 6411 #endif
jpayne@68 6412 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 6413 PyObject* values[1] = {0};
jpayne@68 6414 int __pyx_lineno = 0;
jpayne@68 6415 const char *__pyx_filename = NULL;
jpayne@68 6416 int __pyx_clineno = 0;
jpayne@68 6417 PyObject *__pyx_r = 0;
jpayne@68 6418 __Pyx_RefNannyDeclarations
jpayne@68 6419 __Pyx_RefNannySetupContext("set_verbosity (wrapper)", 0);
jpayne@68 6420 #if !CYTHON_METH_FASTCALL
jpayne@68 6421 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 6422 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 6423 #else
jpayne@68 6424 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 6425 #endif
jpayne@68 6426 #endif
jpayne@68 6427 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 6428 {
jpayne@68 6429 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_verbosity,0};
jpayne@68 6430 if (__pyx_kwds) {
jpayne@68 6431 Py_ssize_t kw_args;
jpayne@68 6432 switch (__pyx_nargs) {
jpayne@68 6433 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 6434 CYTHON_FALLTHROUGH;
jpayne@68 6435 case 0: break;
jpayne@68 6436 default: goto __pyx_L5_argtuple_error;
jpayne@68 6437 }
jpayne@68 6438 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 6439 switch (__pyx_nargs) {
jpayne@68 6440 case 0:
jpayne@68 6441 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbosity)) != 0)) {
jpayne@68 6442 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 6443 kw_args--;
jpayne@68 6444 }
jpayne@68 6445 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error)
jpayne@68 6446 else goto __pyx_L5_argtuple_error;
jpayne@68 6447 }
jpayne@68 6448 if (unlikely(kw_args > 0)) {
jpayne@68 6449 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 6450 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_verbosity") < 0)) __PYX_ERR(0, 53, __pyx_L3_error)
jpayne@68 6451 }
jpayne@68 6452 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 6453 goto __pyx_L5_argtuple_error;
jpayne@68 6454 } else {
jpayne@68 6455 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 6456 }
jpayne@68 6457 __pyx_v_verbosity = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_verbosity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error)
jpayne@68 6458 }
jpayne@68 6459 goto __pyx_L6_skip;
jpayne@68 6460 __pyx_L5_argtuple_error:;
jpayne@68 6461 __Pyx_RaiseArgtupleInvalid("set_verbosity", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 53, __pyx_L3_error)
jpayne@68 6462 __pyx_L6_skip:;
jpayne@68 6463 goto __pyx_L4_argument_unpacking_done;
jpayne@68 6464 __pyx_L3_error:;
jpayne@68 6465 {
jpayne@68 6466 Py_ssize_t __pyx_temp;
jpayne@68 6467 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 6468 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 6469 }
jpayne@68 6470 }
jpayne@68 6471 __Pyx_AddTraceback("pysam.libchtslib.set_verbosity", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6472 __Pyx_RefNannyFinishContext();
jpayne@68 6473 return NULL;
jpayne@68 6474 __pyx_L4_argument_unpacking_done:;
jpayne@68 6475 __pyx_r = __pyx_pf_5pysam_10libchtslib_set_verbosity(__pyx_self, __pyx_v_verbosity);
jpayne@68 6476
jpayne@68 6477 /* function exit code */
jpayne@68 6478 {
jpayne@68 6479 Py_ssize_t __pyx_temp;
jpayne@68 6480 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 6481 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 6482 }
jpayne@68 6483 }
jpayne@68 6484 __Pyx_RefNannyFinishContext();
jpayne@68 6485 return __pyx_r;
jpayne@68 6486 }
jpayne@68 6487
jpayne@68 6488 static PyObject *__pyx_pf_5pysam_10libchtslib_set_verbosity(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_verbosity) {
jpayne@68 6489 PyObject *__pyx_r = NULL;
jpayne@68 6490 __Pyx_TraceDeclarations
jpayne@68 6491 __Pyx_RefNannyDeclarations
jpayne@68 6492 PyObject *__pyx_t_1 = NULL;
jpayne@68 6493 int __pyx_lineno = 0;
jpayne@68 6494 const char *__pyx_filename = NULL;
jpayne@68 6495 int __pyx_clineno = 0;
jpayne@68 6496 __Pyx_TraceFrameInit(__pyx_codeobj_)
jpayne@68 6497 __Pyx_RefNannySetupContext("set_verbosity", 1);
jpayne@68 6498 __Pyx_TraceCall("set_verbosity (wrapper)", __pyx_f[0], 53, 0, __PYX_ERR(0, 53, __pyx_L1_error));
jpayne@68 6499 __Pyx_XDECREF(__pyx_r);
jpayne@68 6500 __pyx_t_1 = __pyx_f_5pysam_10libchtslib_set_verbosity(__pyx_v_verbosity, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
jpayne@68 6501 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6502 __pyx_r = __pyx_t_1;
jpayne@68 6503 __pyx_t_1 = 0;
jpayne@68 6504 goto __pyx_L0;
jpayne@68 6505
jpayne@68 6506 /* function exit code */
jpayne@68 6507 __pyx_L1_error:;
jpayne@68 6508 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6509 __Pyx_AddTraceback("pysam.libchtslib.set_verbosity", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6510 __pyx_r = NULL;
jpayne@68 6511 __pyx_L0:;
jpayne@68 6512 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 6513 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 6514 __Pyx_RefNannyFinishContext();
jpayne@68 6515 return __pyx_r;
jpayne@68 6516 }
jpayne@68 6517
jpayne@68 6518 /* "pysam/libchtslib.pyx":57
jpayne@68 6519 * return hts_set_verbosity(verbosity)
jpayne@68 6520 *
jpayne@68 6521 * cpdef get_verbosity(): # <<<<<<<<<<<<<<
jpayne@68 6522 * """Return the value of htslib's hts_verbose global variable."""
jpayne@68 6523 * return hts_get_verbosity()
jpayne@68 6524 */
jpayne@68 6525
jpayne@68 6526 static PyObject *__pyx_pw_5pysam_10libchtslib_3get_verbosity(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
jpayne@68 6527 static PyObject *__pyx_f_5pysam_10libchtslib_get_verbosity(CYTHON_UNUSED int __pyx_skip_dispatch) {
jpayne@68 6528 PyObject *__pyx_r = NULL;
jpayne@68 6529 __Pyx_TraceDeclarations
jpayne@68 6530 __Pyx_RefNannyDeclarations
jpayne@68 6531 PyObject *__pyx_t_1 = NULL;
jpayne@68 6532 int __pyx_lineno = 0;
jpayne@68 6533 const char *__pyx_filename = NULL;
jpayne@68 6534 int __pyx_clineno = 0;
jpayne@68 6535 __Pyx_TraceFrameInit(__pyx_codeobj__2)
jpayne@68 6536 __Pyx_RefNannySetupContext("get_verbosity", 1);
jpayne@68 6537 __Pyx_TraceCall("get_verbosity", __pyx_f[0], 57, 0, __PYX_ERR(0, 57, __pyx_L1_error));
jpayne@68 6538
jpayne@68 6539 /* "pysam/libchtslib.pyx":59
jpayne@68 6540 * cpdef get_verbosity():
jpayne@68 6541 * """Return the value of htslib's hts_verbose global variable."""
jpayne@68 6542 * return hts_get_verbosity() # <<<<<<<<<<<<<<
jpayne@68 6543 *
jpayne@68 6544 *
jpayne@68 6545 */
jpayne@68 6546 __Pyx_XDECREF(__pyx_r);
jpayne@68 6547 __pyx_t_1 = __Pyx_PyInt_From_int(hts_get_verbosity()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
jpayne@68 6548 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6549 __pyx_r = __pyx_t_1;
jpayne@68 6550 __pyx_t_1 = 0;
jpayne@68 6551 goto __pyx_L0;
jpayne@68 6552
jpayne@68 6553 /* "pysam/libchtslib.pyx":57
jpayne@68 6554 * return hts_set_verbosity(verbosity)
jpayne@68 6555 *
jpayne@68 6556 * cpdef get_verbosity(): # <<<<<<<<<<<<<<
jpayne@68 6557 * """Return the value of htslib's hts_verbose global variable."""
jpayne@68 6558 * return hts_get_verbosity()
jpayne@68 6559 */
jpayne@68 6560
jpayne@68 6561 /* function exit code */
jpayne@68 6562 __pyx_L1_error:;
jpayne@68 6563 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6564 __Pyx_AddTraceback("pysam.libchtslib.get_verbosity", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6565 __pyx_r = 0;
jpayne@68 6566 __pyx_L0:;
jpayne@68 6567 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 6568 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 6569 __Pyx_RefNannyFinishContext();
jpayne@68 6570 return __pyx_r;
jpayne@68 6571 }
jpayne@68 6572
jpayne@68 6573 /* Python wrapper */
jpayne@68 6574 static PyObject *__pyx_pw_5pysam_10libchtslib_3get_verbosity(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
jpayne@68 6575 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_2get_verbosity, "get_verbosity()\nReturn the value of htslib's hts_verbose global variable.");
jpayne@68 6576 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_3get_verbosity = {"get_verbosity", (PyCFunction)__pyx_pw_5pysam_10libchtslib_3get_verbosity, METH_NOARGS, __pyx_doc_5pysam_10libchtslib_2get_verbosity};
jpayne@68 6577 static PyObject *__pyx_pw_5pysam_10libchtslib_3get_verbosity(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
jpayne@68 6578 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 6579 PyObject *__pyx_r = 0;
jpayne@68 6580 __Pyx_RefNannyDeclarations
jpayne@68 6581 __Pyx_RefNannySetupContext("get_verbosity (wrapper)", 0);
jpayne@68 6582 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 6583 __pyx_r = __pyx_pf_5pysam_10libchtslib_2get_verbosity(__pyx_self);
jpayne@68 6584
jpayne@68 6585 /* function exit code */
jpayne@68 6586 __Pyx_RefNannyFinishContext();
jpayne@68 6587 return __pyx_r;
jpayne@68 6588 }
jpayne@68 6589
jpayne@68 6590 static PyObject *__pyx_pf_5pysam_10libchtslib_2get_verbosity(CYTHON_UNUSED PyObject *__pyx_self) {
jpayne@68 6591 PyObject *__pyx_r = NULL;
jpayne@68 6592 __Pyx_TraceDeclarations
jpayne@68 6593 __Pyx_RefNannyDeclarations
jpayne@68 6594 PyObject *__pyx_t_1 = NULL;
jpayne@68 6595 int __pyx_lineno = 0;
jpayne@68 6596 const char *__pyx_filename = NULL;
jpayne@68 6597 int __pyx_clineno = 0;
jpayne@68 6598 __Pyx_TraceFrameInit(__pyx_codeobj__2)
jpayne@68 6599 __Pyx_RefNannySetupContext("get_verbosity", 1);
jpayne@68 6600 __Pyx_TraceCall("get_verbosity (wrapper)", __pyx_f[0], 57, 0, __PYX_ERR(0, 57, __pyx_L1_error));
jpayne@68 6601 __Pyx_XDECREF(__pyx_r);
jpayne@68 6602 __pyx_t_1 = __pyx_f_5pysam_10libchtslib_get_verbosity(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
jpayne@68 6603 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6604 __pyx_r = __pyx_t_1;
jpayne@68 6605 __pyx_t_1 = 0;
jpayne@68 6606 goto __pyx_L0;
jpayne@68 6607
jpayne@68 6608 /* function exit code */
jpayne@68 6609 __pyx_L1_error:;
jpayne@68 6610 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6611 __Pyx_AddTraceback("pysam.libchtslib.get_verbosity", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6612 __pyx_r = NULL;
jpayne@68 6613 __pyx_L0:;
jpayne@68 6614 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 6615 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 6616 __Pyx_RefNannyFinishContext();
jpayne@68 6617 return __pyx_r;
jpayne@68 6618 }
jpayne@68 6619
jpayne@68 6620 /* "pysam/libchtslib.pyx":71
jpayne@68 6621 * cdef readonly object name, mode
jpayne@68 6622 *
jpayne@68 6623 * def __init__(self, name, mode='r', closefd=True): # <<<<<<<<<<<<<<
jpayne@68 6624 * self._open(name, mode, closefd=True)
jpayne@68 6625 *
jpayne@68 6626 */
jpayne@68 6627
jpayne@68 6628 /* Python wrapper */
jpayne@68 6629 static int __pyx_pw_5pysam_10libchtslib_5HFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
jpayne@68 6630 static int __pyx_pw_5pysam_10libchtslib_5HFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
jpayne@68 6631 PyObject *__pyx_v_name = 0;
jpayne@68 6632 PyObject *__pyx_v_mode = 0;
jpayne@68 6633 CYTHON_UNUSED PyObject *__pyx_v_closefd = 0;
jpayne@68 6634 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 6635 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 6636 PyObject* values[3] = {0,0,0};
jpayne@68 6637 int __pyx_lineno = 0;
jpayne@68 6638 const char *__pyx_filename = NULL;
jpayne@68 6639 int __pyx_clineno = 0;
jpayne@68 6640 int __pyx_r;
jpayne@68 6641 __Pyx_RefNannyDeclarations
jpayne@68 6642 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
jpayne@68 6643 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 6644 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 6645 #else
jpayne@68 6646 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
jpayne@68 6647 #endif
jpayne@68 6648 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 6649 {
jpayne@68 6650 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_closefd,0};
jpayne@68 6651 values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_u_r));
jpayne@68 6652 values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_True));
jpayne@68 6653 if (__pyx_kwds) {
jpayne@68 6654 Py_ssize_t kw_args;
jpayne@68 6655 switch (__pyx_nargs) {
jpayne@68 6656 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
jpayne@68 6657 CYTHON_FALLTHROUGH;
jpayne@68 6658 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
jpayne@68 6659 CYTHON_FALLTHROUGH;
jpayne@68 6660 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
jpayne@68 6661 CYTHON_FALLTHROUGH;
jpayne@68 6662 case 0: break;
jpayne@68 6663 default: goto __pyx_L5_argtuple_error;
jpayne@68 6664 }
jpayne@68 6665 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
jpayne@68 6666 switch (__pyx_nargs) {
jpayne@68 6667 case 0:
jpayne@68 6668 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
jpayne@68 6669 (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
jpayne@68 6670 kw_args--;
jpayne@68 6671 }
jpayne@68 6672 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error)
jpayne@68 6673 else goto __pyx_L5_argtuple_error;
jpayne@68 6674 CYTHON_FALLTHROUGH;
jpayne@68 6675 case 1:
jpayne@68 6676 if (kw_args > 0) {
jpayne@68 6677 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
jpayne@68 6678 if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
jpayne@68 6679 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error)
jpayne@68 6680 }
jpayne@68 6681 CYTHON_FALLTHROUGH;
jpayne@68 6682 case 2:
jpayne@68 6683 if (kw_args > 0) {
jpayne@68 6684 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_closefd);
jpayne@68 6685 if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
jpayne@68 6686 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error)
jpayne@68 6687 }
jpayne@68 6688 }
jpayne@68 6689 if (unlikely(kw_args > 0)) {
jpayne@68 6690 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 6691 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 71, __pyx_L3_error)
jpayne@68 6692 }
jpayne@68 6693 } else {
jpayne@68 6694 switch (__pyx_nargs) {
jpayne@68 6695 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
jpayne@68 6696 CYTHON_FALLTHROUGH;
jpayne@68 6697 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
jpayne@68 6698 CYTHON_FALLTHROUGH;
jpayne@68 6699 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
jpayne@68 6700 break;
jpayne@68 6701 default: goto __pyx_L5_argtuple_error;
jpayne@68 6702 }
jpayne@68 6703 }
jpayne@68 6704 __pyx_v_name = values[0];
jpayne@68 6705 __pyx_v_mode = values[1];
jpayne@68 6706 __pyx_v_closefd = values[2];
jpayne@68 6707 }
jpayne@68 6708 goto __pyx_L6_skip;
jpayne@68 6709 __pyx_L5_argtuple_error:;
jpayne@68 6710 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 71, __pyx_L3_error)
jpayne@68 6711 __pyx_L6_skip:;
jpayne@68 6712 goto __pyx_L4_argument_unpacking_done;
jpayne@68 6713 __pyx_L3_error:;
jpayne@68 6714 {
jpayne@68 6715 Py_ssize_t __pyx_temp;
jpayne@68 6716 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 6717 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
jpayne@68 6718 }
jpayne@68 6719 }
jpayne@68 6720 __Pyx_AddTraceback("pysam.libchtslib.HFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6721 __Pyx_RefNannyFinishContext();
jpayne@68 6722 return -1;
jpayne@68 6723 __pyx_L4_argument_unpacking_done:;
jpayne@68 6724 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile___init__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_closefd);
jpayne@68 6725
jpayne@68 6726 /* function exit code */
jpayne@68 6727 {
jpayne@68 6728 Py_ssize_t __pyx_temp;
jpayne@68 6729 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 6730 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
jpayne@68 6731 }
jpayne@68 6732 }
jpayne@68 6733 __Pyx_RefNannyFinishContext();
jpayne@68 6734 return __pyx_r;
jpayne@68 6735 }
jpayne@68 6736
jpayne@68 6737 static int __pyx_pf_5pysam_10libchtslib_5HFile___init__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, CYTHON_UNUSED PyObject *__pyx_v_closefd) {
jpayne@68 6738 int __pyx_r;
jpayne@68 6739 __Pyx_TraceDeclarations
jpayne@68 6740 __Pyx_RefNannyDeclarations
jpayne@68 6741 PyObject *__pyx_t_1 = NULL;
jpayne@68 6742 struct __pyx_opt_args_5pysam_10libchtslib_5HFile__open __pyx_t_2;
jpayne@68 6743 int __pyx_lineno = 0;
jpayne@68 6744 const char *__pyx_filename = NULL;
jpayne@68 6745 int __pyx_clineno = 0;
jpayne@68 6746 __Pyx_RefNannySetupContext("__init__", 1);
jpayne@68 6747 __Pyx_TraceCall("__init__", __pyx_f[0], 71, 0, __PYX_ERR(0, 71, __pyx_L1_error));
jpayne@68 6748
jpayne@68 6749 /* "pysam/libchtslib.pyx":72
jpayne@68 6750 *
jpayne@68 6751 * def __init__(self, name, mode='r', closefd=True):
jpayne@68 6752 * self._open(name, mode, closefd=True) # <<<<<<<<<<<<<<
jpayne@68 6753 *
jpayne@68 6754 * def __dealloc__(self):
jpayne@68 6755 */
jpayne@68 6756 __pyx_t_2.__pyx_n = 1;
jpayne@68 6757 __pyx_t_2.closefd = Py_True;
jpayne@68 6758 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_10libchtslib_HFile *)__pyx_v_self->__pyx_vtab)->_open(__pyx_v_self, __pyx_v_name, __pyx_v_mode, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
jpayne@68 6759 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6760 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 6761
jpayne@68 6762 /* "pysam/libchtslib.pyx":71
jpayne@68 6763 * cdef readonly object name, mode
jpayne@68 6764 *
jpayne@68 6765 * def __init__(self, name, mode='r', closefd=True): # <<<<<<<<<<<<<<
jpayne@68 6766 * self._open(name, mode, closefd=True)
jpayne@68 6767 *
jpayne@68 6768 */
jpayne@68 6769
jpayne@68 6770 /* function exit code */
jpayne@68 6771 __pyx_r = 0;
jpayne@68 6772 goto __pyx_L0;
jpayne@68 6773 __pyx_L1_error:;
jpayne@68 6774 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6775 __Pyx_AddTraceback("pysam.libchtslib.HFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6776 __pyx_r = -1;
jpayne@68 6777 __pyx_L0:;
jpayne@68 6778 __Pyx_TraceReturn(Py_None, 0);
jpayne@68 6779 __Pyx_RefNannyFinishContext();
jpayne@68 6780 return __pyx_r;
jpayne@68 6781 }
jpayne@68 6782
jpayne@68 6783 /* "pysam/libchtslib.pyx":74
jpayne@68 6784 * self._open(name, mode, closefd=True)
jpayne@68 6785 *
jpayne@68 6786 * def __dealloc__(self): # <<<<<<<<<<<<<<
jpayne@68 6787 * self.close()
jpayne@68 6788 *
jpayne@68 6789 */
jpayne@68 6790
jpayne@68 6791 /* Python wrapper */
jpayne@68 6792 static void __pyx_pw_5pysam_10libchtslib_5HFile_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 6793 static void __pyx_pw_5pysam_10libchtslib_5HFile_3__dealloc__(PyObject *__pyx_v_self) {
jpayne@68 6794 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 6795 __Pyx_RefNannyDeclarations
jpayne@68 6796 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
jpayne@68 6797 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 6798 __pyx_pf_5pysam_10libchtslib_5HFile_2__dealloc__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 6799
jpayne@68 6800 /* function exit code */
jpayne@68 6801 __Pyx_RefNannyFinishContext();
jpayne@68 6802 }
jpayne@68 6803
jpayne@68 6804 static void __pyx_pf_5pysam_10libchtslib_5HFile_2__dealloc__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 6805 __Pyx_TraceDeclarations
jpayne@68 6806 __Pyx_RefNannyDeclarations
jpayne@68 6807 PyObject *__pyx_t_1 = NULL;
jpayne@68 6808 PyObject *__pyx_t_2 = NULL;
jpayne@68 6809 PyObject *__pyx_t_3 = NULL;
jpayne@68 6810 unsigned int __pyx_t_4;
jpayne@68 6811 int __pyx_lineno = 0;
jpayne@68 6812 const char *__pyx_filename = NULL;
jpayne@68 6813 int __pyx_clineno = 0;
jpayne@68 6814 __Pyx_RefNannySetupContext("__dealloc__", 1);
jpayne@68 6815 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 74, 0, __PYX_ERR(0, 74, __pyx_L1_error));
jpayne@68 6816
jpayne@68 6817 /* "pysam/libchtslib.pyx":75
jpayne@68 6818 *
jpayne@68 6819 * def __dealloc__(self):
jpayne@68 6820 * self.close() # <<<<<<<<<<<<<<
jpayne@68 6821 *
jpayne@68 6822 * @property
jpayne@68 6823 */
jpayne@68 6824 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
jpayne@68 6825 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 6826 __pyx_t_3 = NULL;
jpayne@68 6827 __pyx_t_4 = 0;
jpayne@68 6828 #if CYTHON_UNPACK_METHODS
jpayne@68 6829 if (likely(PyMethod_Check(__pyx_t_2))) {
jpayne@68 6830 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
jpayne@68 6831 if (likely(__pyx_t_3)) {
jpayne@68 6832 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
jpayne@68 6833 __Pyx_INCREF(__pyx_t_3);
jpayne@68 6834 __Pyx_INCREF(function);
jpayne@68 6835 __Pyx_DECREF_SET(__pyx_t_2, function);
jpayne@68 6836 __pyx_t_4 = 1;
jpayne@68 6837 }
jpayne@68 6838 }
jpayne@68 6839 #endif
jpayne@68 6840 {
jpayne@68 6841 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
jpayne@68 6842 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
jpayne@68 6843 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 6844 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
jpayne@68 6845 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6846 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 6847 }
jpayne@68 6848 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 6849
jpayne@68 6850 /* "pysam/libchtslib.pyx":74
jpayne@68 6851 * self._open(name, mode, closefd=True)
jpayne@68 6852 *
jpayne@68 6853 * def __dealloc__(self): # <<<<<<<<<<<<<<
jpayne@68 6854 * self.close()
jpayne@68 6855 *
jpayne@68 6856 */
jpayne@68 6857
jpayne@68 6858 /* function exit code */
jpayne@68 6859 goto __pyx_L0;
jpayne@68 6860 __pyx_L1_error:;
jpayne@68 6861 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6862 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 6863 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 6864 __Pyx_WriteUnraisable("pysam.libchtslib.HFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
jpayne@68 6865 __pyx_L0:;
jpayne@68 6866 __Pyx_TraceReturn(Py_None, 0);
jpayne@68 6867 __Pyx_RefNannyFinishContext();
jpayne@68 6868 }
jpayne@68 6869
jpayne@68 6870 /* "pysam/libchtslib.pyx":77
jpayne@68 6871 * self.close()
jpayne@68 6872 *
jpayne@68 6873 * @property # <<<<<<<<<<<<<<
jpayne@68 6874 * def closed(self):
jpayne@68 6875 * return self.fp == NULL
jpayne@68 6876 */
jpayne@68 6877
jpayne@68 6878 /* Python wrapper */
jpayne@68 6879 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 6880 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_6closed_1__get__(PyObject *__pyx_v_self) {
jpayne@68 6881 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 6882 PyObject *__pyx_r = 0;
jpayne@68 6883 __Pyx_RefNannyDeclarations
jpayne@68 6884 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 6885 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 6886 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_6closed___get__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 6887
jpayne@68 6888 /* function exit code */
jpayne@68 6889 __Pyx_RefNannyFinishContext();
jpayne@68 6890 return __pyx_r;
jpayne@68 6891 }
jpayne@68 6892
jpayne@68 6893 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_6closed___get__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 6894 PyObject *__pyx_r = NULL;
jpayne@68 6895 __Pyx_TraceDeclarations
jpayne@68 6896 __Pyx_RefNannyDeclarations
jpayne@68 6897 PyObject *__pyx_t_1 = NULL;
jpayne@68 6898 int __pyx_lineno = 0;
jpayne@68 6899 const char *__pyx_filename = NULL;
jpayne@68 6900 int __pyx_clineno = 0;
jpayne@68 6901 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 6902 __Pyx_TraceCall("__get__", __pyx_f[0], 77, 0, __PYX_ERR(0, 77, __pyx_L1_error));
jpayne@68 6903
jpayne@68 6904 /* "pysam/libchtslib.pyx":79
jpayne@68 6905 * @property
jpayne@68 6906 * def closed(self):
jpayne@68 6907 * return self.fp == NULL # <<<<<<<<<<<<<<
jpayne@68 6908 *
jpayne@68 6909 * cdef _open(self, name, mode, closefd=True):
jpayne@68 6910 */
jpayne@68 6911 __Pyx_XDECREF(__pyx_r);
jpayne@68 6912 __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->fp == NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
jpayne@68 6913 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 6914 __pyx_r = __pyx_t_1;
jpayne@68 6915 __pyx_t_1 = 0;
jpayne@68 6916 goto __pyx_L0;
jpayne@68 6917
jpayne@68 6918 /* "pysam/libchtslib.pyx":77
jpayne@68 6919 * self.close()
jpayne@68 6920 *
jpayne@68 6921 * @property # <<<<<<<<<<<<<<
jpayne@68 6922 * def closed(self):
jpayne@68 6923 * return self.fp == NULL
jpayne@68 6924 */
jpayne@68 6925
jpayne@68 6926 /* function exit code */
jpayne@68 6927 __pyx_L1_error:;
jpayne@68 6928 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 6929 __Pyx_AddTraceback("pysam.libchtslib.HFile.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 6930 __pyx_r = NULL;
jpayne@68 6931 __pyx_L0:;
jpayne@68 6932 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 6933 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 6934 __Pyx_RefNannyFinishContext();
jpayne@68 6935 return __pyx_r;
jpayne@68 6936 }
jpayne@68 6937
jpayne@68 6938 /* "pysam/libchtslib.pyx":81
jpayne@68 6939 * return self.fp == NULL
jpayne@68 6940 *
jpayne@68 6941 * cdef _open(self, name, mode, closefd=True): # <<<<<<<<<<<<<<
jpayne@68 6942 * self.name = name
jpayne@68 6943 * self.mode = mode
jpayne@68 6944 */
jpayne@68 6945
jpayne@68 6946 static PyObject *__pyx_f_5pysam_10libchtslib_5HFile__open(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, struct __pyx_opt_args_5pysam_10libchtslib_5HFile__open *__pyx_optional_args) {
jpayne@68 6947 PyObject *__pyx_r = NULL;
jpayne@68 6948 __Pyx_TraceDeclarations
jpayne@68 6949 __Pyx_RefNannyDeclarations
jpayne@68 6950 PyObject *__pyx_t_1 = NULL;
jpayne@68 6951 int __pyx_t_2;
jpayne@68 6952 int __pyx_t_3;
jpayne@68 6953 char const *__pyx_t_4;
jpayne@68 6954 char const *__pyx_t_5;
jpayne@68 6955 char const *__pyx_t_6;
jpayne@68 6956 PyObject *__pyx_t_7 = NULL;
jpayne@68 6957 int __pyx_lineno = 0;
jpayne@68 6958 const char *__pyx_filename = NULL;
jpayne@68 6959 int __pyx_clineno = 0;
jpayne@68 6960 __Pyx_RefNannySetupContext("_open", 0);
jpayne@68 6961 __Pyx_TraceCall("_open", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
jpayne@68 6962 if (__pyx_optional_args) {
jpayne@68 6963 }
jpayne@68 6964 __Pyx_INCREF(__pyx_v_name);
jpayne@68 6965 __Pyx_INCREF(__pyx_v_mode);
jpayne@68 6966
jpayne@68 6967 /* "pysam/libchtslib.pyx":82
jpayne@68 6968 *
jpayne@68 6969 * cdef _open(self, name, mode, closefd=True):
jpayne@68 6970 * self.name = name # <<<<<<<<<<<<<<
jpayne@68 6971 * self.mode = mode
jpayne@68 6972 *
jpayne@68 6973 */
jpayne@68 6974 __Pyx_INCREF(__pyx_v_name);
jpayne@68 6975 __Pyx_GIVEREF(__pyx_v_name);
jpayne@68 6976 __Pyx_GOTREF(__pyx_v_self->name);
jpayne@68 6977 __Pyx_DECREF(__pyx_v_self->name);
jpayne@68 6978 __pyx_v_self->name = __pyx_v_name;
jpayne@68 6979
jpayne@68 6980 /* "pysam/libchtslib.pyx":83
jpayne@68 6981 * cdef _open(self, name, mode, closefd=True):
jpayne@68 6982 * self.name = name
jpayne@68 6983 * self.mode = mode # <<<<<<<<<<<<<<
jpayne@68 6984 *
jpayne@68 6985 * mode = force_bytes(mode)
jpayne@68 6986 */
jpayne@68 6987 __Pyx_INCREF(__pyx_v_mode);
jpayne@68 6988 __Pyx_GIVEREF(__pyx_v_mode);
jpayne@68 6989 __Pyx_GOTREF(__pyx_v_self->mode);
jpayne@68 6990 __Pyx_DECREF(__pyx_v_self->mode);
jpayne@68 6991 __pyx_v_self->mode = __pyx_v_mode;
jpayne@68 6992
jpayne@68 6993 /* "pysam/libchtslib.pyx":85
jpayne@68 6994 * self.mode = mode
jpayne@68 6995 *
jpayne@68 6996 * mode = force_bytes(mode) # <<<<<<<<<<<<<<
jpayne@68 6997 *
jpayne@68 6998 * if isinstance(name, int):
jpayne@68 6999 */
jpayne@68 7000 __pyx_t_1 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_mode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
jpayne@68 7001 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 7002 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_1);
jpayne@68 7003 __pyx_t_1 = 0;
jpayne@68 7004
jpayne@68 7005 /* "pysam/libchtslib.pyx":87
jpayne@68 7006 * mode = force_bytes(mode)
jpayne@68 7007 *
jpayne@68 7008 * if isinstance(name, int): # <<<<<<<<<<<<<<
jpayne@68 7009 * if self.fp != NULL:
jpayne@68 7010 * name = dup(name)
jpayne@68 7011 */
jpayne@68 7012 __pyx_t_2 = PyInt_Check(__pyx_v_name);
jpayne@68 7013 if (__pyx_t_2) {
jpayne@68 7014
jpayne@68 7015 /* "pysam/libchtslib.pyx":88
jpayne@68 7016 *
jpayne@68 7017 * if isinstance(name, int):
jpayne@68 7018 * if self.fp != NULL: # <<<<<<<<<<<<<<
jpayne@68 7019 * name = dup(name)
jpayne@68 7020 * self.fp = hdopen(name, mode)
jpayne@68 7021 */
jpayne@68 7022 __pyx_t_2 = (__pyx_v_self->fp != NULL);
jpayne@68 7023 if (__pyx_t_2) {
jpayne@68 7024
jpayne@68 7025 /* "pysam/libchtslib.pyx":89
jpayne@68 7026 * if isinstance(name, int):
jpayne@68 7027 * if self.fp != NULL:
jpayne@68 7028 * name = dup(name) # <<<<<<<<<<<<<<
jpayne@68 7029 * self.fp = hdopen(name, mode)
jpayne@68 7030 * else:
jpayne@68 7031 */
jpayne@68 7032 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_name); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error)
jpayne@68 7033 __pyx_t_1 = __Pyx_PyInt_From_int(dup(__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
jpayne@68 7034 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 7035 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
jpayne@68 7036 __pyx_t_1 = 0;
jpayne@68 7037
jpayne@68 7038 /* "pysam/libchtslib.pyx":88
jpayne@68 7039 *
jpayne@68 7040 * if isinstance(name, int):
jpayne@68 7041 * if self.fp != NULL: # <<<<<<<<<<<<<<
jpayne@68 7042 * name = dup(name)
jpayne@68 7043 * self.fp = hdopen(name, mode)
jpayne@68 7044 */
jpayne@68 7045 }
jpayne@68 7046
jpayne@68 7047 /* "pysam/libchtslib.pyx":90
jpayne@68 7048 * if self.fp != NULL:
jpayne@68 7049 * name = dup(name)
jpayne@68 7050 * self.fp = hdopen(name, mode) # <<<<<<<<<<<<<<
jpayne@68 7051 * else:
jpayne@68 7052 * name = encode_filename(name)
jpayne@68 7053 */
jpayne@68 7054 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_name); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error)
jpayne@68 7055 __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error)
jpayne@68 7056 __pyx_v_self->fp = hdopen(__pyx_t_3, __pyx_t_4);
jpayne@68 7057
jpayne@68 7058 /* "pysam/libchtslib.pyx":87
jpayne@68 7059 * mode = force_bytes(mode)
jpayne@68 7060 *
jpayne@68 7061 * if isinstance(name, int): # <<<<<<<<<<<<<<
jpayne@68 7062 * if self.fp != NULL:
jpayne@68 7063 * name = dup(name)
jpayne@68 7064 */
jpayne@68 7065 goto __pyx_L3;
jpayne@68 7066 }
jpayne@68 7067
jpayne@68 7068 /* "pysam/libchtslib.pyx":92
jpayne@68 7069 * self.fp = hdopen(name, mode)
jpayne@68 7070 * else:
jpayne@68 7071 * name = encode_filename(name) # <<<<<<<<<<<<<<
jpayne@68 7072 * self.fp = hopen(name, mode)
jpayne@68 7073 *
jpayne@68 7074 */
jpayne@68 7075 /*else*/ {
jpayne@68 7076 __pyx_t_1 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
jpayne@68 7077 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 7078 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
jpayne@68 7079 __pyx_t_1 = 0;
jpayne@68 7080
jpayne@68 7081 /* "pysam/libchtslib.pyx":93
jpayne@68 7082 * else:
jpayne@68 7083 * name = encode_filename(name)
jpayne@68 7084 * self.fp = hopen(name, mode) # <<<<<<<<<<<<<<
jpayne@68 7085 *
jpayne@68 7086 * if not self.fp:
jpayne@68 7087 */
jpayne@68 7088 __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error)
jpayne@68 7089 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error)
jpayne@68 7090 __pyx_v_self->fp = hopen(__pyx_t_5, __pyx_t_6);
jpayne@68 7091 }
jpayne@68 7092 __pyx_L3:;
jpayne@68 7093
jpayne@68 7094 /* "pysam/libchtslib.pyx":95
jpayne@68 7095 * self.fp = hopen(name, mode)
jpayne@68 7096 *
jpayne@68 7097 * if not self.fp: # <<<<<<<<<<<<<<
jpayne@68 7098 * raise IOError(errno, 'failed to open HFile', self.name)
jpayne@68 7099 *
jpayne@68 7100 */
jpayne@68 7101 __pyx_t_2 = (!(__pyx_v_self->fp != 0));
jpayne@68 7102 if (unlikely(__pyx_t_2)) {
jpayne@68 7103
jpayne@68 7104 /* "pysam/libchtslib.pyx":96
jpayne@68 7105 *
jpayne@68 7106 * if not self.fp:
jpayne@68 7107 * raise IOError(errno, 'failed to open HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 7108 *
jpayne@68 7109 * def close(self):
jpayne@68 7110 */
jpayne@68 7111 __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
jpayne@68 7112 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 7113 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error)
jpayne@68 7114 __Pyx_GOTREF(__pyx_t_7);
jpayne@68 7115 __Pyx_GIVEREF(__pyx_t_1);
jpayne@68 7116 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error);
jpayne@68 7117 __Pyx_INCREF(__pyx_kp_u_failed_to_open_HFile);
jpayne@68 7118 __Pyx_GIVEREF(__pyx_kp_u_failed_to_open_HFile);
jpayne@68 7119 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u_failed_to_open_HFile)) __PYX_ERR(0, 96, __pyx_L1_error);
jpayne@68 7120 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 7121 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 7122 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_self->name)) __PYX_ERR(0, 96, __pyx_L1_error);
jpayne@68 7123 __pyx_t_1 = 0;
jpayne@68 7124 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
jpayne@68 7125 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 7126 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
jpayne@68 7127 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 7128 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 7129 __PYX_ERR(0, 96, __pyx_L1_error)
jpayne@68 7130
jpayne@68 7131 /* "pysam/libchtslib.pyx":95
jpayne@68 7132 * self.fp = hopen(name, mode)
jpayne@68 7133 *
jpayne@68 7134 * if not self.fp: # <<<<<<<<<<<<<<
jpayne@68 7135 * raise IOError(errno, 'failed to open HFile', self.name)
jpayne@68 7136 *
jpayne@68 7137 */
jpayne@68 7138 }
jpayne@68 7139
jpayne@68 7140 /* "pysam/libchtslib.pyx":81
jpayne@68 7141 * return self.fp == NULL
jpayne@68 7142 *
jpayne@68 7143 * cdef _open(self, name, mode, closefd=True): # <<<<<<<<<<<<<<
jpayne@68 7144 * self.name = name
jpayne@68 7145 * self.mode = mode
jpayne@68 7146 */
jpayne@68 7147
jpayne@68 7148 /* function exit code */
jpayne@68 7149 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 7150 goto __pyx_L0;
jpayne@68 7151 __pyx_L1_error:;
jpayne@68 7152 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 7153 __Pyx_XDECREF(__pyx_t_7);
jpayne@68 7154 __Pyx_AddTraceback("pysam.libchtslib.HFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 7155 __pyx_r = 0;
jpayne@68 7156 __pyx_L0:;
jpayne@68 7157 __Pyx_XDECREF(__pyx_v_name);
jpayne@68 7158 __Pyx_XDECREF(__pyx_v_mode);
jpayne@68 7159 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 7160 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 7161 __Pyx_RefNannyFinishContext();
jpayne@68 7162 return __pyx_r;
jpayne@68 7163 }
jpayne@68 7164
jpayne@68 7165 /* "pysam/libchtslib.pyx":98
jpayne@68 7166 * raise IOError(errno, 'failed to open HFile', self.name)
jpayne@68 7167 *
jpayne@68 7168 * def close(self): # <<<<<<<<<<<<<<
jpayne@68 7169 * if self.fp == NULL:
jpayne@68 7170 * return
jpayne@68 7171 */
jpayne@68 7172
jpayne@68 7173 /* Python wrapper */
jpayne@68 7174 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_5close(PyObject *__pyx_v_self,
jpayne@68 7175 #if CYTHON_METH_FASTCALL
jpayne@68 7176 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 7177 #else
jpayne@68 7178 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 7179 #endif
jpayne@68 7180 ); /*proto*/
jpayne@68 7181 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_4close, "HFile.close(self)");
jpayne@68 7182 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_5close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_5close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_4close};
jpayne@68 7183 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_5close(PyObject *__pyx_v_self,
jpayne@68 7184 #if CYTHON_METH_FASTCALL
jpayne@68 7185 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 7186 #else
jpayne@68 7187 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 7188 #endif
jpayne@68 7189 ) {
jpayne@68 7190 #if !CYTHON_METH_FASTCALL
jpayne@68 7191 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 7192 #endif
jpayne@68 7193 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 7194 PyObject *__pyx_r = 0;
jpayne@68 7195 __Pyx_RefNannyDeclarations
jpayne@68 7196 __Pyx_RefNannySetupContext("close (wrapper)", 0);
jpayne@68 7197 #if !CYTHON_METH_FASTCALL
jpayne@68 7198 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 7199 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 7200 #else
jpayne@68 7201 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 7202 #endif
jpayne@68 7203 #endif
jpayne@68 7204 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 7205 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 7206 __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 7207 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL;
jpayne@68 7208 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_4close(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 7209
jpayne@68 7210 /* function exit code */
jpayne@68 7211 __Pyx_RefNannyFinishContext();
jpayne@68 7212 return __pyx_r;
jpayne@68 7213 }
jpayne@68 7214
jpayne@68 7215 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_4close(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 7216 hFILE *__pyx_v_fp;
jpayne@68 7217 PyObject *__pyx_r = NULL;
jpayne@68 7218 __Pyx_TraceDeclarations
jpayne@68 7219 __Pyx_RefNannyDeclarations
jpayne@68 7220 int __pyx_t_1;
jpayne@68 7221 hFILE *__pyx_t_2;
jpayne@68 7222 PyObject *__pyx_t_3 = NULL;
jpayne@68 7223 PyObject *__pyx_t_4 = NULL;
jpayne@68 7224 int __pyx_lineno = 0;
jpayne@68 7225 const char *__pyx_filename = NULL;
jpayne@68 7226 int __pyx_clineno = 0;
jpayne@68 7227 __Pyx_TraceFrameInit(__pyx_codeobj__3)
jpayne@68 7228 __Pyx_RefNannySetupContext("close", 1);
jpayne@68 7229 __Pyx_TraceCall("close", __pyx_f[0], 98, 0, __PYX_ERR(0, 98, __pyx_L1_error));
jpayne@68 7230
jpayne@68 7231 /* "pysam/libchtslib.pyx":99
jpayne@68 7232 *
jpayne@68 7233 * def close(self):
jpayne@68 7234 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 7235 * return
jpayne@68 7236 *
jpayne@68 7237 */
jpayne@68 7238 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 7239 if (__pyx_t_1) {
jpayne@68 7240
jpayne@68 7241 /* "pysam/libchtslib.pyx":100
jpayne@68 7242 * def close(self):
jpayne@68 7243 * if self.fp == NULL:
jpayne@68 7244 * return # <<<<<<<<<<<<<<
jpayne@68 7245 *
jpayne@68 7246 * cdef hFILE *fp = self.fp
jpayne@68 7247 */
jpayne@68 7248 __Pyx_XDECREF(__pyx_r);
jpayne@68 7249 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 7250 goto __pyx_L0;
jpayne@68 7251
jpayne@68 7252 /* "pysam/libchtslib.pyx":99
jpayne@68 7253 *
jpayne@68 7254 * def close(self):
jpayne@68 7255 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 7256 * return
jpayne@68 7257 *
jpayne@68 7258 */
jpayne@68 7259 }
jpayne@68 7260
jpayne@68 7261 /* "pysam/libchtslib.pyx":102
jpayne@68 7262 * return
jpayne@68 7263 *
jpayne@68 7264 * cdef hFILE *fp = self.fp # <<<<<<<<<<<<<<
jpayne@68 7265 * self.fp = NULL
jpayne@68 7266 *
jpayne@68 7267 */
jpayne@68 7268 __pyx_t_2 = __pyx_v_self->fp;
jpayne@68 7269 __pyx_v_fp = __pyx_t_2;
jpayne@68 7270
jpayne@68 7271 /* "pysam/libchtslib.pyx":103
jpayne@68 7272 *
jpayne@68 7273 * cdef hFILE *fp = self.fp
jpayne@68 7274 * self.fp = NULL # <<<<<<<<<<<<<<
jpayne@68 7275 *
jpayne@68 7276 * if hclose(fp) != 0:
jpayne@68 7277 */
jpayne@68 7278 __pyx_v_self->fp = NULL;
jpayne@68 7279
jpayne@68 7280 /* "pysam/libchtslib.pyx":105
jpayne@68 7281 * self.fp = NULL
jpayne@68 7282 *
jpayne@68 7283 * if hclose(fp) != 0: # <<<<<<<<<<<<<<
jpayne@68 7284 * raise IOError(errno, 'failed to close HFile', self.name)
jpayne@68 7285 *
jpayne@68 7286 */
jpayne@68 7287 __pyx_t_1 = (hclose(__pyx_v_fp) != 0);
jpayne@68 7288 if (unlikely(__pyx_t_1)) {
jpayne@68 7289
jpayne@68 7290 /* "pysam/libchtslib.pyx":106
jpayne@68 7291 *
jpayne@68 7292 * if hclose(fp) != 0:
jpayne@68 7293 * raise IOError(errno, 'failed to close HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 7294 *
jpayne@68 7295 * def fileno(self):
jpayne@68 7296 */
jpayne@68 7297 __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
jpayne@68 7298 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 7299 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
jpayne@68 7300 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 7301 __Pyx_GIVEREF(__pyx_t_3);
jpayne@68 7302 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error);
jpayne@68 7303 __Pyx_INCREF(__pyx_kp_u_failed_to_close_HFile);
jpayne@68 7304 __Pyx_GIVEREF(__pyx_kp_u_failed_to_close_HFile);
jpayne@68 7305 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u_failed_to_close_HFile)) __PYX_ERR(0, 106, __pyx_L1_error);
jpayne@68 7306 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 7307 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 7308 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->name)) __PYX_ERR(0, 106, __pyx_L1_error);
jpayne@68 7309 __pyx_t_3 = 0;
jpayne@68 7310 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
jpayne@68 7311 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 7312 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 7313 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
jpayne@68 7314 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 7315 __PYX_ERR(0, 106, __pyx_L1_error)
jpayne@68 7316
jpayne@68 7317 /* "pysam/libchtslib.pyx":105
jpayne@68 7318 * self.fp = NULL
jpayne@68 7319 *
jpayne@68 7320 * if hclose(fp) != 0: # <<<<<<<<<<<<<<
jpayne@68 7321 * raise IOError(errno, 'failed to close HFile', self.name)
jpayne@68 7322 *
jpayne@68 7323 */
jpayne@68 7324 }
jpayne@68 7325
jpayne@68 7326 /* "pysam/libchtslib.pyx":98
jpayne@68 7327 * raise IOError(errno, 'failed to open HFile', self.name)
jpayne@68 7328 *
jpayne@68 7329 * def close(self): # <<<<<<<<<<<<<<
jpayne@68 7330 * if self.fp == NULL:
jpayne@68 7331 * return
jpayne@68 7332 */
jpayne@68 7333
jpayne@68 7334 /* function exit code */
jpayne@68 7335 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 7336 goto __pyx_L0;
jpayne@68 7337 __pyx_L1_error:;
jpayne@68 7338 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 7339 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 7340 __Pyx_AddTraceback("pysam.libchtslib.HFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 7341 __pyx_r = NULL;
jpayne@68 7342 __pyx_L0:;
jpayne@68 7343 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 7344 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 7345 __Pyx_RefNannyFinishContext();
jpayne@68 7346 return __pyx_r;
jpayne@68 7347 }
jpayne@68 7348
jpayne@68 7349 /* "pysam/libchtslib.pyx":108
jpayne@68 7350 * raise IOError(errno, 'failed to close HFile', self.name)
jpayne@68 7351 *
jpayne@68 7352 * def fileno(self): # <<<<<<<<<<<<<<
jpayne@68 7353 * if self.fp == NULL:
jpayne@68 7354 * raise IOError('operation on closed HFile')
jpayne@68 7355 */
jpayne@68 7356
jpayne@68 7357 /* Python wrapper */
jpayne@68 7358 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_7fileno(PyObject *__pyx_v_self,
jpayne@68 7359 #if CYTHON_METH_FASTCALL
jpayne@68 7360 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 7361 #else
jpayne@68 7362 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 7363 #endif
jpayne@68 7364 ); /*proto*/
jpayne@68 7365 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_6fileno, "HFile.fileno(self)");
jpayne@68 7366 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_7fileno = {"fileno", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_7fileno, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_6fileno};
jpayne@68 7367 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_7fileno(PyObject *__pyx_v_self,
jpayne@68 7368 #if CYTHON_METH_FASTCALL
jpayne@68 7369 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 7370 #else
jpayne@68 7371 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 7372 #endif
jpayne@68 7373 ) {
jpayne@68 7374 #if !CYTHON_METH_FASTCALL
jpayne@68 7375 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 7376 #endif
jpayne@68 7377 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 7378 PyObject *__pyx_r = 0;
jpayne@68 7379 __Pyx_RefNannyDeclarations
jpayne@68 7380 __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
jpayne@68 7381 #if !CYTHON_METH_FASTCALL
jpayne@68 7382 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 7383 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 7384 #else
jpayne@68 7385 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 7386 #endif
jpayne@68 7387 #endif
jpayne@68 7388 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 7389 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 7390 __Pyx_RaiseArgtupleInvalid("fileno", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 7391 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fileno", 0))) return NULL;
jpayne@68 7392 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_6fileno(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 7393
jpayne@68 7394 /* function exit code */
jpayne@68 7395 __Pyx_RefNannyFinishContext();
jpayne@68 7396 return __pyx_r;
jpayne@68 7397 }
jpayne@68 7398
jpayne@68 7399 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_6fileno(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 7400 PyObject *__pyx_r = NULL;
jpayne@68 7401 __Pyx_TraceDeclarations
jpayne@68 7402 __Pyx_RefNannyDeclarations
jpayne@68 7403 int __pyx_t_1;
jpayne@68 7404 PyObject *__pyx_t_2 = NULL;
jpayne@68 7405 int __pyx_lineno = 0;
jpayne@68 7406 const char *__pyx_filename = NULL;
jpayne@68 7407 int __pyx_clineno = 0;
jpayne@68 7408 __Pyx_TraceFrameInit(__pyx_codeobj__4)
jpayne@68 7409 __Pyx_RefNannySetupContext("fileno", 1);
jpayne@68 7410 __Pyx_TraceCall("fileno", __pyx_f[0], 108, 0, __PYX_ERR(0, 108, __pyx_L1_error));
jpayne@68 7411
jpayne@68 7412 /* "pysam/libchtslib.pyx":109
jpayne@68 7413 *
jpayne@68 7414 * def fileno(self):
jpayne@68 7415 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 7416 * raise IOError('operation on closed HFile')
jpayne@68 7417 * if isinstance(self.name, int):
jpayne@68 7418 */
jpayne@68 7419 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 7420 if (unlikely(__pyx_t_1)) {
jpayne@68 7421
jpayne@68 7422 /* "pysam/libchtslib.pyx":110
jpayne@68 7423 * def fileno(self):
jpayne@68 7424 * if self.fp == NULL:
jpayne@68 7425 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 7426 * if isinstance(self.name, int):
jpayne@68 7427 * return self.name
jpayne@68 7428 */
jpayne@68 7429 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
jpayne@68 7430 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 7431 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 7432 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 7433 __PYX_ERR(0, 110, __pyx_L1_error)
jpayne@68 7434
jpayne@68 7435 /* "pysam/libchtslib.pyx":109
jpayne@68 7436 *
jpayne@68 7437 * def fileno(self):
jpayne@68 7438 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 7439 * raise IOError('operation on closed HFile')
jpayne@68 7440 * if isinstance(self.name, int):
jpayne@68 7441 */
jpayne@68 7442 }
jpayne@68 7443
jpayne@68 7444 /* "pysam/libchtslib.pyx":111
jpayne@68 7445 * if self.fp == NULL:
jpayne@68 7446 * raise IOError('operation on closed HFile')
jpayne@68 7447 * if isinstance(self.name, int): # <<<<<<<<<<<<<<
jpayne@68 7448 * return self.name
jpayne@68 7449 * else:
jpayne@68 7450 */
jpayne@68 7451 __pyx_t_2 = __pyx_v_self->name;
jpayne@68 7452 __Pyx_INCREF(__pyx_t_2);
jpayne@68 7453 __pyx_t_1 = PyInt_Check(__pyx_t_2);
jpayne@68 7454 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 7455 if (likely(__pyx_t_1)) {
jpayne@68 7456
jpayne@68 7457 /* "pysam/libchtslib.pyx":112
jpayne@68 7458 * raise IOError('operation on closed HFile')
jpayne@68 7459 * if isinstance(self.name, int):
jpayne@68 7460 * return self.name # <<<<<<<<<<<<<<
jpayne@68 7461 * else:
jpayne@68 7462 * raise AttributeError('fileno not available')
jpayne@68 7463 */
jpayne@68 7464 __Pyx_XDECREF(__pyx_r);
jpayne@68 7465 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 7466 __pyx_r = __pyx_v_self->name;
jpayne@68 7467 goto __pyx_L0;
jpayne@68 7468
jpayne@68 7469 /* "pysam/libchtslib.pyx":111
jpayne@68 7470 * if self.fp == NULL:
jpayne@68 7471 * raise IOError('operation on closed HFile')
jpayne@68 7472 * if isinstance(self.name, int): # <<<<<<<<<<<<<<
jpayne@68 7473 * return self.name
jpayne@68 7474 * else:
jpayne@68 7475 */
jpayne@68 7476 }
jpayne@68 7477
jpayne@68 7478 /* "pysam/libchtslib.pyx":114
jpayne@68 7479 * return self.name
jpayne@68 7480 * else:
jpayne@68 7481 * raise AttributeError('fileno not available') # <<<<<<<<<<<<<<
jpayne@68 7482 *
jpayne@68 7483 * def __enter__(self):
jpayne@68 7484 */
jpayne@68 7485 /*else*/ {
jpayne@68 7486 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
jpayne@68 7487 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 7488 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 7489 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 7490 __PYX_ERR(0, 114, __pyx_L1_error)
jpayne@68 7491 }
jpayne@68 7492
jpayne@68 7493 /* "pysam/libchtslib.pyx":108
jpayne@68 7494 * raise IOError(errno, 'failed to close HFile', self.name)
jpayne@68 7495 *
jpayne@68 7496 * def fileno(self): # <<<<<<<<<<<<<<
jpayne@68 7497 * if self.fp == NULL:
jpayne@68 7498 * raise IOError('operation on closed HFile')
jpayne@68 7499 */
jpayne@68 7500
jpayne@68 7501 /* function exit code */
jpayne@68 7502 __pyx_L1_error:;
jpayne@68 7503 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 7504 __Pyx_AddTraceback("pysam.libchtslib.HFile.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 7505 __pyx_r = NULL;
jpayne@68 7506 __pyx_L0:;
jpayne@68 7507 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 7508 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 7509 __Pyx_RefNannyFinishContext();
jpayne@68 7510 return __pyx_r;
jpayne@68 7511 }
jpayne@68 7512
jpayne@68 7513 /* "pysam/libchtslib.pyx":116
jpayne@68 7514 * raise AttributeError('fileno not available')
jpayne@68 7515 *
jpayne@68 7516 * def __enter__(self): # <<<<<<<<<<<<<<
jpayne@68 7517 * return self
jpayne@68 7518 *
jpayne@68 7519 */
jpayne@68 7520
jpayne@68 7521 /* Python wrapper */
jpayne@68 7522 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_9__enter__(PyObject *__pyx_v_self,
jpayne@68 7523 #if CYTHON_METH_FASTCALL
jpayne@68 7524 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 7525 #else
jpayne@68 7526 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 7527 #endif
jpayne@68 7528 ); /*proto*/
jpayne@68 7529 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_8__enter__, "HFile.__enter__(self)");
jpayne@68 7530 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_9__enter__ = {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_9__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_8__enter__};
jpayne@68 7531 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_9__enter__(PyObject *__pyx_v_self,
jpayne@68 7532 #if CYTHON_METH_FASTCALL
jpayne@68 7533 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 7534 #else
jpayne@68 7535 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 7536 #endif
jpayne@68 7537 ) {
jpayne@68 7538 #if !CYTHON_METH_FASTCALL
jpayne@68 7539 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 7540 #endif
jpayne@68 7541 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 7542 PyObject *__pyx_r = 0;
jpayne@68 7543 __Pyx_RefNannyDeclarations
jpayne@68 7544 __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
jpayne@68 7545 #if !CYTHON_METH_FASTCALL
jpayne@68 7546 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 7547 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 7548 #else
jpayne@68 7549 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 7550 #endif
jpayne@68 7551 #endif
jpayne@68 7552 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 7553 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 7554 __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 7555 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
jpayne@68 7556 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_8__enter__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 7557
jpayne@68 7558 /* function exit code */
jpayne@68 7559 __Pyx_RefNannyFinishContext();
jpayne@68 7560 return __pyx_r;
jpayne@68 7561 }
jpayne@68 7562
jpayne@68 7563 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_8__enter__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 7564 PyObject *__pyx_r = NULL;
jpayne@68 7565 __Pyx_TraceDeclarations
jpayne@68 7566 __Pyx_RefNannyDeclarations
jpayne@68 7567 int __pyx_lineno = 0;
jpayne@68 7568 const char *__pyx_filename = NULL;
jpayne@68 7569 int __pyx_clineno = 0;
jpayne@68 7570 __Pyx_TraceFrameInit(__pyx_codeobj__7)
jpayne@68 7571 __Pyx_RefNannySetupContext("__enter__", 1);
jpayne@68 7572 __Pyx_TraceCall("__enter__", __pyx_f[0], 116, 0, __PYX_ERR(0, 116, __pyx_L1_error));
jpayne@68 7573
jpayne@68 7574 /* "pysam/libchtslib.pyx":117
jpayne@68 7575 *
jpayne@68 7576 * def __enter__(self):
jpayne@68 7577 * return self # <<<<<<<<<<<<<<
jpayne@68 7578 *
jpayne@68 7579 * def __exit__(self, type, value, tb):
jpayne@68 7580 */
jpayne@68 7581 __Pyx_XDECREF(__pyx_r);
jpayne@68 7582 __Pyx_INCREF((PyObject *)__pyx_v_self);
jpayne@68 7583 __pyx_r = ((PyObject *)__pyx_v_self);
jpayne@68 7584 goto __pyx_L0;
jpayne@68 7585
jpayne@68 7586 /* "pysam/libchtslib.pyx":116
jpayne@68 7587 * raise AttributeError('fileno not available')
jpayne@68 7588 *
jpayne@68 7589 * def __enter__(self): # <<<<<<<<<<<<<<
jpayne@68 7590 * return self
jpayne@68 7591 *
jpayne@68 7592 */
jpayne@68 7593
jpayne@68 7594 /* function exit code */
jpayne@68 7595 __pyx_L1_error:;
jpayne@68 7596 __Pyx_AddTraceback("pysam.libchtslib.HFile.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 7597 __pyx_r = NULL;
jpayne@68 7598 __pyx_L0:;
jpayne@68 7599 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 7600 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 7601 __Pyx_RefNannyFinishContext();
jpayne@68 7602 return __pyx_r;
jpayne@68 7603 }
jpayne@68 7604
jpayne@68 7605 /* "pysam/libchtslib.pyx":119
jpayne@68 7606 * return self
jpayne@68 7607 *
jpayne@68 7608 * def __exit__(self, type, value, tb): # <<<<<<<<<<<<<<
jpayne@68 7609 * self.close()
jpayne@68 7610 *
jpayne@68 7611 */
jpayne@68 7612
jpayne@68 7613 /* Python wrapper */
jpayne@68 7614 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_11__exit__(PyObject *__pyx_v_self,
jpayne@68 7615 #if CYTHON_METH_FASTCALL
jpayne@68 7616 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 7617 #else
jpayne@68 7618 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 7619 #endif
jpayne@68 7620 ); /*proto*/
jpayne@68 7621 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_10__exit__, "HFile.__exit__(self, type, value, tb)");
jpayne@68 7622 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_11__exit__ = {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_11__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_10__exit__};
jpayne@68 7623 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_11__exit__(PyObject *__pyx_v_self,
jpayne@68 7624 #if CYTHON_METH_FASTCALL
jpayne@68 7625 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 7626 #else
jpayne@68 7627 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 7628 #endif
jpayne@68 7629 ) {
jpayne@68 7630 CYTHON_UNUSED PyObject *__pyx_v_type = 0;
jpayne@68 7631 CYTHON_UNUSED PyObject *__pyx_v_value = 0;
jpayne@68 7632 CYTHON_UNUSED PyObject *__pyx_v_tb = 0;
jpayne@68 7633 #if !CYTHON_METH_FASTCALL
jpayne@68 7634 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 7635 #endif
jpayne@68 7636 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 7637 PyObject* values[3] = {0,0,0};
jpayne@68 7638 int __pyx_lineno = 0;
jpayne@68 7639 const char *__pyx_filename = NULL;
jpayne@68 7640 int __pyx_clineno = 0;
jpayne@68 7641 PyObject *__pyx_r = 0;
jpayne@68 7642 __Pyx_RefNannyDeclarations
jpayne@68 7643 __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
jpayne@68 7644 #if !CYTHON_METH_FASTCALL
jpayne@68 7645 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 7646 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 7647 #else
jpayne@68 7648 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 7649 #endif
jpayne@68 7650 #endif
jpayne@68 7651 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 7652 {
jpayne@68 7653 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0};
jpayne@68 7654 if (__pyx_kwds) {
jpayne@68 7655 Py_ssize_t kw_args;
jpayne@68 7656 switch (__pyx_nargs) {
jpayne@68 7657 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
jpayne@68 7658 CYTHON_FALLTHROUGH;
jpayne@68 7659 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 7660 CYTHON_FALLTHROUGH;
jpayne@68 7661 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 7662 CYTHON_FALLTHROUGH;
jpayne@68 7663 case 0: break;
jpayne@68 7664 default: goto __pyx_L5_argtuple_error;
jpayne@68 7665 }
jpayne@68 7666 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 7667 switch (__pyx_nargs) {
jpayne@68 7668 case 0:
jpayne@68 7669 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) {
jpayne@68 7670 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 7671 kw_args--;
jpayne@68 7672 }
jpayne@68 7673 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
jpayne@68 7674 else goto __pyx_L5_argtuple_error;
jpayne@68 7675 CYTHON_FALLTHROUGH;
jpayne@68 7676 case 1:
jpayne@68 7677 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
jpayne@68 7678 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
jpayne@68 7679 kw_args--;
jpayne@68 7680 }
jpayne@68 7681 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
jpayne@68 7682 else {
jpayne@68 7683 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 119, __pyx_L3_error)
jpayne@68 7684 }
jpayne@68 7685 CYTHON_FALLTHROUGH;
jpayne@68 7686 case 2:
jpayne@68 7687 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tb)) != 0)) {
jpayne@68 7688 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
jpayne@68 7689 kw_args--;
jpayne@68 7690 }
jpayne@68 7691 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
jpayne@68 7692 else {
jpayne@68 7693 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 119, __pyx_L3_error)
jpayne@68 7694 }
jpayne@68 7695 }
jpayne@68 7696 if (unlikely(kw_args > 0)) {
jpayne@68 7697 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 7698 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__exit__") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
jpayne@68 7699 }
jpayne@68 7700 } else if (unlikely(__pyx_nargs != 3)) {
jpayne@68 7701 goto __pyx_L5_argtuple_error;
jpayne@68 7702 } else {
jpayne@68 7703 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 7704 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 7705 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
jpayne@68 7706 }
jpayne@68 7707 __pyx_v_type = values[0];
jpayne@68 7708 __pyx_v_value = values[1];
jpayne@68 7709 __pyx_v_tb = values[2];
jpayne@68 7710 }
jpayne@68 7711 goto __pyx_L6_skip;
jpayne@68 7712 __pyx_L5_argtuple_error:;
jpayne@68 7713 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 119, __pyx_L3_error)
jpayne@68 7714 __pyx_L6_skip:;
jpayne@68 7715 goto __pyx_L4_argument_unpacking_done;
jpayne@68 7716 __pyx_L3_error:;
jpayne@68 7717 {
jpayne@68 7718 Py_ssize_t __pyx_temp;
jpayne@68 7719 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 7720 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 7721 }
jpayne@68 7722 }
jpayne@68 7723 __Pyx_AddTraceback("pysam.libchtslib.HFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 7724 __Pyx_RefNannyFinishContext();
jpayne@68 7725 return NULL;
jpayne@68 7726 __pyx_L4_argument_unpacking_done:;
jpayne@68 7727 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_10__exit__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_tb);
jpayne@68 7728
jpayne@68 7729 /* function exit code */
jpayne@68 7730 {
jpayne@68 7731 Py_ssize_t __pyx_temp;
jpayne@68 7732 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 7733 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 7734 }
jpayne@68 7735 }
jpayne@68 7736 __Pyx_RefNannyFinishContext();
jpayne@68 7737 return __pyx_r;
jpayne@68 7738 }
jpayne@68 7739
jpayne@68 7740 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_10__exit__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb) {
jpayne@68 7741 PyObject *__pyx_r = NULL;
jpayne@68 7742 __Pyx_TraceDeclarations
jpayne@68 7743 __Pyx_RefNannyDeclarations
jpayne@68 7744 PyObject *__pyx_t_1 = NULL;
jpayne@68 7745 PyObject *__pyx_t_2 = NULL;
jpayne@68 7746 PyObject *__pyx_t_3 = NULL;
jpayne@68 7747 unsigned int __pyx_t_4;
jpayne@68 7748 int __pyx_lineno = 0;
jpayne@68 7749 const char *__pyx_filename = NULL;
jpayne@68 7750 int __pyx_clineno = 0;
jpayne@68 7751 __Pyx_TraceFrameInit(__pyx_codeobj__8)
jpayne@68 7752 __Pyx_RefNannySetupContext("__exit__", 1);
jpayne@68 7753 __Pyx_TraceCall("__exit__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
jpayne@68 7754
jpayne@68 7755 /* "pysam/libchtslib.pyx":120
jpayne@68 7756 *
jpayne@68 7757 * def __exit__(self, type, value, tb):
jpayne@68 7758 * self.close() # <<<<<<<<<<<<<<
jpayne@68 7759 *
jpayne@68 7760 * def __iter__(self):
jpayne@68 7761 */
jpayne@68 7762 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
jpayne@68 7763 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 7764 __pyx_t_3 = NULL;
jpayne@68 7765 __pyx_t_4 = 0;
jpayne@68 7766 #if CYTHON_UNPACK_METHODS
jpayne@68 7767 if (likely(PyMethod_Check(__pyx_t_2))) {
jpayne@68 7768 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
jpayne@68 7769 if (likely(__pyx_t_3)) {
jpayne@68 7770 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
jpayne@68 7771 __Pyx_INCREF(__pyx_t_3);
jpayne@68 7772 __Pyx_INCREF(function);
jpayne@68 7773 __Pyx_DECREF_SET(__pyx_t_2, function);
jpayne@68 7774 __pyx_t_4 = 1;
jpayne@68 7775 }
jpayne@68 7776 }
jpayne@68 7777 #endif
jpayne@68 7778 {
jpayne@68 7779 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
jpayne@68 7780 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
jpayne@68 7781 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 7782 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
jpayne@68 7783 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 7784 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 7785 }
jpayne@68 7786 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 7787
jpayne@68 7788 /* "pysam/libchtslib.pyx":119
jpayne@68 7789 * return self
jpayne@68 7790 *
jpayne@68 7791 * def __exit__(self, type, value, tb): # <<<<<<<<<<<<<<
jpayne@68 7792 * self.close()
jpayne@68 7793 *
jpayne@68 7794 */
jpayne@68 7795
jpayne@68 7796 /* function exit code */
jpayne@68 7797 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 7798 goto __pyx_L0;
jpayne@68 7799 __pyx_L1_error:;
jpayne@68 7800 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 7801 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 7802 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 7803 __Pyx_AddTraceback("pysam.libchtslib.HFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 7804 __pyx_r = NULL;
jpayne@68 7805 __pyx_L0:;
jpayne@68 7806 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 7807 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 7808 __Pyx_RefNannyFinishContext();
jpayne@68 7809 return __pyx_r;
jpayne@68 7810 }
jpayne@68 7811
jpayne@68 7812 /* "pysam/libchtslib.pyx":122
jpayne@68 7813 * self.close()
jpayne@68 7814 *
jpayne@68 7815 * def __iter__(self): # <<<<<<<<<<<<<<
jpayne@68 7816 * return self
jpayne@68 7817 *
jpayne@68 7818 */
jpayne@68 7819
jpayne@68 7820 /* Python wrapper */
jpayne@68 7821 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_13__iter__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 7822 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_13__iter__(PyObject *__pyx_v_self) {
jpayne@68 7823 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 7824 PyObject *__pyx_r = 0;
jpayne@68 7825 __Pyx_RefNannyDeclarations
jpayne@68 7826 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
jpayne@68 7827 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 7828 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_12__iter__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 7829
jpayne@68 7830 /* function exit code */
jpayne@68 7831 __Pyx_RefNannyFinishContext();
jpayne@68 7832 return __pyx_r;
jpayne@68 7833 }
jpayne@68 7834
jpayne@68 7835 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_12__iter__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 7836 PyObject *__pyx_r = NULL;
jpayne@68 7837 __Pyx_TraceDeclarations
jpayne@68 7838 __Pyx_RefNannyDeclarations
jpayne@68 7839 int __pyx_lineno = 0;
jpayne@68 7840 const char *__pyx_filename = NULL;
jpayne@68 7841 int __pyx_clineno = 0;
jpayne@68 7842 __Pyx_RefNannySetupContext("__iter__", 1);
jpayne@68 7843 __Pyx_TraceCall("__iter__", __pyx_f[0], 122, 0, __PYX_ERR(0, 122, __pyx_L1_error));
jpayne@68 7844
jpayne@68 7845 /* "pysam/libchtslib.pyx":123
jpayne@68 7846 *
jpayne@68 7847 * def __iter__(self):
jpayne@68 7848 * return self # <<<<<<<<<<<<<<
jpayne@68 7849 *
jpayne@68 7850 * def __next__(self):
jpayne@68 7851 */
jpayne@68 7852 __Pyx_XDECREF(__pyx_r);
jpayne@68 7853 __Pyx_INCREF((PyObject *)__pyx_v_self);
jpayne@68 7854 __pyx_r = ((PyObject *)__pyx_v_self);
jpayne@68 7855 goto __pyx_L0;
jpayne@68 7856
jpayne@68 7857 /* "pysam/libchtslib.pyx":122
jpayne@68 7858 * self.close()
jpayne@68 7859 *
jpayne@68 7860 * def __iter__(self): # <<<<<<<<<<<<<<
jpayne@68 7861 * return self
jpayne@68 7862 *
jpayne@68 7863 */
jpayne@68 7864
jpayne@68 7865 /* function exit code */
jpayne@68 7866 __pyx_L1_error:;
jpayne@68 7867 __Pyx_AddTraceback("pysam.libchtslib.HFile.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 7868 __pyx_r = NULL;
jpayne@68 7869 __pyx_L0:;
jpayne@68 7870 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 7871 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 7872 __Pyx_RefNannyFinishContext();
jpayne@68 7873 return __pyx_r;
jpayne@68 7874 }
jpayne@68 7875
jpayne@68 7876 /* "pysam/libchtslib.pyx":125
jpayne@68 7877 * return self
jpayne@68 7878 *
jpayne@68 7879 * def __next__(self): # <<<<<<<<<<<<<<
jpayne@68 7880 * line = self.readline()
jpayne@68 7881 * if not line:
jpayne@68 7882 */
jpayne@68 7883
jpayne@68 7884 /* Python wrapper */
jpayne@68 7885 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_15__next__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 7886 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_15__next__(PyObject *__pyx_v_self) {
jpayne@68 7887 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 7888 PyObject *__pyx_r = 0;
jpayne@68 7889 __Pyx_RefNannyDeclarations
jpayne@68 7890 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
jpayne@68 7891 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 7892 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_14__next__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 7893
jpayne@68 7894 /* function exit code */
jpayne@68 7895 __Pyx_RefNannyFinishContext();
jpayne@68 7896 return __pyx_r;
jpayne@68 7897 }
jpayne@68 7898
jpayne@68 7899 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_14__next__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 7900 PyObject *__pyx_v_line = NULL;
jpayne@68 7901 PyObject *__pyx_r = NULL;
jpayne@68 7902 __Pyx_TraceDeclarations
jpayne@68 7903 __Pyx_RefNannyDeclarations
jpayne@68 7904 int __pyx_error_without_exception = 0; /* StopIteration */
jpayne@68 7905 PyObject *__pyx_t_1 = NULL;
jpayne@68 7906 PyObject *__pyx_t_2 = NULL;
jpayne@68 7907 PyObject *__pyx_t_3 = NULL;
jpayne@68 7908 unsigned int __pyx_t_4;
jpayne@68 7909 int __pyx_t_5;
jpayne@68 7910 int __pyx_t_6;
jpayne@68 7911 int __pyx_lineno = 0;
jpayne@68 7912 const char *__pyx_filename = NULL;
jpayne@68 7913 int __pyx_clineno = 0;
jpayne@68 7914 __Pyx_RefNannySetupContext("__next__", 1);
jpayne@68 7915 __Pyx_TraceCall("__next__", __pyx_f[0], 125, 0, __PYX_ERR(0, 125, __pyx_L1_error));
jpayne@68 7916
jpayne@68 7917 /* "pysam/libchtslib.pyx":126
jpayne@68 7918 *
jpayne@68 7919 * def __next__(self):
jpayne@68 7920 * line = self.readline() # <<<<<<<<<<<<<<
jpayne@68 7921 * if not line:
jpayne@68 7922 * raise StopIteration()
jpayne@68 7923 */
jpayne@68 7924 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
jpayne@68 7925 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 7926 __pyx_t_3 = NULL;
jpayne@68 7927 __pyx_t_4 = 0;
jpayne@68 7928 #if CYTHON_UNPACK_METHODS
jpayne@68 7929 if (likely(PyMethod_Check(__pyx_t_2))) {
jpayne@68 7930 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
jpayne@68 7931 if (likely(__pyx_t_3)) {
jpayne@68 7932 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
jpayne@68 7933 __Pyx_INCREF(__pyx_t_3);
jpayne@68 7934 __Pyx_INCREF(function);
jpayne@68 7935 __Pyx_DECREF_SET(__pyx_t_2, function);
jpayne@68 7936 __pyx_t_4 = 1;
jpayne@68 7937 }
jpayne@68 7938 }
jpayne@68 7939 #endif
jpayne@68 7940 {
jpayne@68 7941 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
jpayne@68 7942 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
jpayne@68 7943 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 7944 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
jpayne@68 7945 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 7946 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 7947 }
jpayne@68 7948 __pyx_v_line = __pyx_t_1;
jpayne@68 7949 __pyx_t_1 = 0;
jpayne@68 7950
jpayne@68 7951 /* "pysam/libchtslib.pyx":127
jpayne@68 7952 * def __next__(self):
jpayne@68 7953 * line = self.readline()
jpayne@68 7954 * if not line: # <<<<<<<<<<<<<<
jpayne@68 7955 * raise StopIteration()
jpayne@68 7956 * return line
jpayne@68 7957 */
jpayne@68 7958 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_line); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 127, __pyx_L1_error)
jpayne@68 7959 __pyx_t_6 = (!__pyx_t_5);
jpayne@68 7960 if (unlikely(__pyx_t_6)) {
jpayne@68 7961
jpayne@68 7962 /* "pysam/libchtslib.pyx":128
jpayne@68 7963 * line = self.readline()
jpayne@68 7964 * if not line:
jpayne@68 7965 * raise StopIteration() # <<<<<<<<<<<<<<
jpayne@68 7966 * return line
jpayne@68 7967 *
jpayne@68 7968 */
jpayne@68 7969 __pyx_error_without_exception = 1;
jpayne@68 7970 goto __pyx_L1_error;;
jpayne@68 7971
jpayne@68 7972 /* "pysam/libchtslib.pyx":127
jpayne@68 7973 * def __next__(self):
jpayne@68 7974 * line = self.readline()
jpayne@68 7975 * if not line: # <<<<<<<<<<<<<<
jpayne@68 7976 * raise StopIteration()
jpayne@68 7977 * return line
jpayne@68 7978 */
jpayne@68 7979 }
jpayne@68 7980
jpayne@68 7981 /* "pysam/libchtslib.pyx":129
jpayne@68 7982 * if not line:
jpayne@68 7983 * raise StopIteration()
jpayne@68 7984 * return line # <<<<<<<<<<<<<<
jpayne@68 7985 *
jpayne@68 7986 * def flush(self):
jpayne@68 7987 */
jpayne@68 7988 __Pyx_XDECREF(__pyx_r);
jpayne@68 7989 __Pyx_INCREF(__pyx_v_line);
jpayne@68 7990 __pyx_r = __pyx_v_line;
jpayne@68 7991 goto __pyx_L0;
jpayne@68 7992
jpayne@68 7993 /* "pysam/libchtslib.pyx":125
jpayne@68 7994 * return self
jpayne@68 7995 *
jpayne@68 7996 * def __next__(self): # <<<<<<<<<<<<<<
jpayne@68 7997 * line = self.readline()
jpayne@68 7998 * if not line:
jpayne@68 7999 */
jpayne@68 8000
jpayne@68 8001 /* function exit code */
jpayne@68 8002 __pyx_L1_error:;
jpayne@68 8003 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 8004 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 8005 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 8006 if (!__pyx_error_without_exception) {
jpayne@68 8007 __Pyx_AddTraceback("pysam.libchtslib.HFile.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 8008 }
jpayne@68 8009 __pyx_r = NULL;
jpayne@68 8010 __pyx_L0:;
jpayne@68 8011 __Pyx_XDECREF(__pyx_v_line);
jpayne@68 8012 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 8013 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 8014 __Pyx_RefNannyFinishContext();
jpayne@68 8015 return __pyx_r;
jpayne@68 8016 }
jpayne@68 8017
jpayne@68 8018 /* "pysam/libchtslib.pyx":131
jpayne@68 8019 * return line
jpayne@68 8020 *
jpayne@68 8021 * def flush(self): # <<<<<<<<<<<<<<
jpayne@68 8022 * if self.fp == NULL:
jpayne@68 8023 * raise IOError('operation on closed HFile')
jpayne@68 8024 */
jpayne@68 8025
jpayne@68 8026 /* Python wrapper */
jpayne@68 8027 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_17flush(PyObject *__pyx_v_self,
jpayne@68 8028 #if CYTHON_METH_FASTCALL
jpayne@68 8029 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8030 #else
jpayne@68 8031 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8032 #endif
jpayne@68 8033 ); /*proto*/
jpayne@68 8034 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_16flush, "HFile.flush(self)");
jpayne@68 8035 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_17flush = {"flush", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_17flush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_16flush};
jpayne@68 8036 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_17flush(PyObject *__pyx_v_self,
jpayne@68 8037 #if CYTHON_METH_FASTCALL
jpayne@68 8038 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8039 #else
jpayne@68 8040 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8041 #endif
jpayne@68 8042 ) {
jpayne@68 8043 #if !CYTHON_METH_FASTCALL
jpayne@68 8044 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 8045 #endif
jpayne@68 8046 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 8047 PyObject *__pyx_r = 0;
jpayne@68 8048 __Pyx_RefNannyDeclarations
jpayne@68 8049 __Pyx_RefNannySetupContext("flush (wrapper)", 0);
jpayne@68 8050 #if !CYTHON_METH_FASTCALL
jpayne@68 8051 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 8052 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 8053 #else
jpayne@68 8054 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 8055 #endif
jpayne@68 8056 #endif
jpayne@68 8057 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 8058 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 8059 __Pyx_RaiseArgtupleInvalid("flush", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 8060 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flush", 0))) return NULL;
jpayne@68 8061 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_16flush(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 8062
jpayne@68 8063 /* function exit code */
jpayne@68 8064 __Pyx_RefNannyFinishContext();
jpayne@68 8065 return __pyx_r;
jpayne@68 8066 }
jpayne@68 8067
jpayne@68 8068 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_16flush(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 8069 PyObject *__pyx_r = NULL;
jpayne@68 8070 __Pyx_TraceDeclarations
jpayne@68 8071 __Pyx_RefNannyDeclarations
jpayne@68 8072 int __pyx_t_1;
jpayne@68 8073 PyObject *__pyx_t_2 = NULL;
jpayne@68 8074 PyObject *__pyx_t_3 = NULL;
jpayne@68 8075 int __pyx_lineno = 0;
jpayne@68 8076 const char *__pyx_filename = NULL;
jpayne@68 8077 int __pyx_clineno = 0;
jpayne@68 8078 __Pyx_TraceFrameInit(__pyx_codeobj__9)
jpayne@68 8079 __Pyx_RefNannySetupContext("flush", 1);
jpayne@68 8080 __Pyx_TraceCall("flush", __pyx_f[0], 131, 0, __PYX_ERR(0, 131, __pyx_L1_error));
jpayne@68 8081
jpayne@68 8082 /* "pysam/libchtslib.pyx":132
jpayne@68 8083 *
jpayne@68 8084 * def flush(self):
jpayne@68 8085 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 8086 * raise IOError('operation on closed HFile')
jpayne@68 8087 * if hflush(self.fp) != 0:
jpayne@68 8088 */
jpayne@68 8089 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 8090 if (unlikely(__pyx_t_1)) {
jpayne@68 8091
jpayne@68 8092 /* "pysam/libchtslib.pyx":133
jpayne@68 8093 * def flush(self):
jpayne@68 8094 * if self.fp == NULL:
jpayne@68 8095 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 8096 * if hflush(self.fp) != 0:
jpayne@68 8097 * raise IOError(herrno(self.fp), 'failed to flush HFile', self.name)
jpayne@68 8098 */
jpayne@68 8099 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
jpayne@68 8100 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8101 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 8102 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 8103 __PYX_ERR(0, 133, __pyx_L1_error)
jpayne@68 8104
jpayne@68 8105 /* "pysam/libchtslib.pyx":132
jpayne@68 8106 *
jpayne@68 8107 * def flush(self):
jpayne@68 8108 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 8109 * raise IOError('operation on closed HFile')
jpayne@68 8110 * if hflush(self.fp) != 0:
jpayne@68 8111 */
jpayne@68 8112 }
jpayne@68 8113
jpayne@68 8114 /* "pysam/libchtslib.pyx":134
jpayne@68 8115 * if self.fp == NULL:
jpayne@68 8116 * raise IOError('operation on closed HFile')
jpayne@68 8117 * if hflush(self.fp) != 0: # <<<<<<<<<<<<<<
jpayne@68 8118 * raise IOError(herrno(self.fp), 'failed to flush HFile', self.name)
jpayne@68 8119 *
jpayne@68 8120 */
jpayne@68 8121 __pyx_t_1 = (hflush(__pyx_v_self->fp) != 0);
jpayne@68 8122 if (unlikely(__pyx_t_1)) {
jpayne@68 8123
jpayne@68 8124 /* "pysam/libchtslib.pyx":135
jpayne@68 8125 * raise IOError('operation on closed HFile')
jpayne@68 8126 * if hflush(self.fp) != 0:
jpayne@68 8127 * raise IOError(herrno(self.fp), 'failed to flush HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 8128 *
jpayne@68 8129 * def isatty(self):
jpayne@68 8130 */
jpayne@68 8131 __pyx_t_2 = __Pyx_PyInt_From_int(herrno(__pyx_v_self->fp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
jpayne@68 8132 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8133 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
jpayne@68 8134 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 8135 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 8136 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error);
jpayne@68 8137 __Pyx_INCREF(__pyx_kp_u_failed_to_flush_HFile);
jpayne@68 8138 __Pyx_GIVEREF(__pyx_kp_u_failed_to_flush_HFile);
jpayne@68 8139 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_failed_to_flush_HFile)) __PYX_ERR(0, 135, __pyx_L1_error);
jpayne@68 8140 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 8141 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 8142 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->name)) __PYX_ERR(0, 135, __pyx_L1_error);
jpayne@68 8143 __pyx_t_2 = 0;
jpayne@68 8144 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
jpayne@68 8145 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8146 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 8147 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 8148 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 8149 __PYX_ERR(0, 135, __pyx_L1_error)
jpayne@68 8150
jpayne@68 8151 /* "pysam/libchtslib.pyx":134
jpayne@68 8152 * if self.fp == NULL:
jpayne@68 8153 * raise IOError('operation on closed HFile')
jpayne@68 8154 * if hflush(self.fp) != 0: # <<<<<<<<<<<<<<
jpayne@68 8155 * raise IOError(herrno(self.fp), 'failed to flush HFile', self.name)
jpayne@68 8156 *
jpayne@68 8157 */
jpayne@68 8158 }
jpayne@68 8159
jpayne@68 8160 /* "pysam/libchtslib.pyx":131
jpayne@68 8161 * return line
jpayne@68 8162 *
jpayne@68 8163 * def flush(self): # <<<<<<<<<<<<<<
jpayne@68 8164 * if self.fp == NULL:
jpayne@68 8165 * raise IOError('operation on closed HFile')
jpayne@68 8166 */
jpayne@68 8167
jpayne@68 8168 /* function exit code */
jpayne@68 8169 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 8170 goto __pyx_L0;
jpayne@68 8171 __pyx_L1_error:;
jpayne@68 8172 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 8173 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 8174 __Pyx_AddTraceback("pysam.libchtslib.HFile.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 8175 __pyx_r = NULL;
jpayne@68 8176 __pyx_L0:;
jpayne@68 8177 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 8178 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 8179 __Pyx_RefNannyFinishContext();
jpayne@68 8180 return __pyx_r;
jpayne@68 8181 }
jpayne@68 8182
jpayne@68 8183 /* "pysam/libchtslib.pyx":137
jpayne@68 8184 * raise IOError(herrno(self.fp), 'failed to flush HFile', self.name)
jpayne@68 8185 *
jpayne@68 8186 * def isatty(self): # <<<<<<<<<<<<<<
jpayne@68 8187 * if self.fp == NULL:
jpayne@68 8188 * raise IOError('operation on closed HFile')
jpayne@68 8189 */
jpayne@68 8190
jpayne@68 8191 /* Python wrapper */
jpayne@68 8192 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_19isatty(PyObject *__pyx_v_self,
jpayne@68 8193 #if CYTHON_METH_FASTCALL
jpayne@68 8194 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8195 #else
jpayne@68 8196 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8197 #endif
jpayne@68 8198 ); /*proto*/
jpayne@68 8199 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_18isatty, "HFile.isatty(self)");
jpayne@68 8200 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_19isatty = {"isatty", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_19isatty, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_18isatty};
jpayne@68 8201 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_19isatty(PyObject *__pyx_v_self,
jpayne@68 8202 #if CYTHON_METH_FASTCALL
jpayne@68 8203 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8204 #else
jpayne@68 8205 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8206 #endif
jpayne@68 8207 ) {
jpayne@68 8208 #if !CYTHON_METH_FASTCALL
jpayne@68 8209 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 8210 #endif
jpayne@68 8211 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 8212 PyObject *__pyx_r = 0;
jpayne@68 8213 __Pyx_RefNannyDeclarations
jpayne@68 8214 __Pyx_RefNannySetupContext("isatty (wrapper)", 0);
jpayne@68 8215 #if !CYTHON_METH_FASTCALL
jpayne@68 8216 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 8217 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 8218 #else
jpayne@68 8219 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 8220 #endif
jpayne@68 8221 #endif
jpayne@68 8222 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 8223 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 8224 __Pyx_RaiseArgtupleInvalid("isatty", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 8225 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isatty", 0))) return NULL;
jpayne@68 8226 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_18isatty(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 8227
jpayne@68 8228 /* function exit code */
jpayne@68 8229 __Pyx_RefNannyFinishContext();
jpayne@68 8230 return __pyx_r;
jpayne@68 8231 }
jpayne@68 8232
jpayne@68 8233 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_18isatty(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 8234 PyObject *__pyx_r = NULL;
jpayne@68 8235 __Pyx_TraceDeclarations
jpayne@68 8236 __Pyx_RefNannyDeclarations
jpayne@68 8237 int __pyx_t_1;
jpayne@68 8238 PyObject *__pyx_t_2 = NULL;
jpayne@68 8239 int __pyx_lineno = 0;
jpayne@68 8240 const char *__pyx_filename = NULL;
jpayne@68 8241 int __pyx_clineno = 0;
jpayne@68 8242 __Pyx_TraceFrameInit(__pyx_codeobj__10)
jpayne@68 8243 __Pyx_RefNannySetupContext("isatty", 1);
jpayne@68 8244 __Pyx_TraceCall("isatty", __pyx_f[0], 137, 0, __PYX_ERR(0, 137, __pyx_L1_error));
jpayne@68 8245
jpayne@68 8246 /* "pysam/libchtslib.pyx":138
jpayne@68 8247 *
jpayne@68 8248 * def isatty(self):
jpayne@68 8249 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 8250 * raise IOError('operation on closed HFile')
jpayne@68 8251 * return False
jpayne@68 8252 */
jpayne@68 8253 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 8254 if (unlikely(__pyx_t_1)) {
jpayne@68 8255
jpayne@68 8256 /* "pysam/libchtslib.pyx":139
jpayne@68 8257 * def isatty(self):
jpayne@68 8258 * if self.fp == NULL:
jpayne@68 8259 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 8260 * return False
jpayne@68 8261 *
jpayne@68 8262 */
jpayne@68 8263 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
jpayne@68 8264 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8265 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 8266 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 8267 __PYX_ERR(0, 139, __pyx_L1_error)
jpayne@68 8268
jpayne@68 8269 /* "pysam/libchtslib.pyx":138
jpayne@68 8270 *
jpayne@68 8271 * def isatty(self):
jpayne@68 8272 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 8273 * raise IOError('operation on closed HFile')
jpayne@68 8274 * return False
jpayne@68 8275 */
jpayne@68 8276 }
jpayne@68 8277
jpayne@68 8278 /* "pysam/libchtslib.pyx":140
jpayne@68 8279 * if self.fp == NULL:
jpayne@68 8280 * raise IOError('operation on closed HFile')
jpayne@68 8281 * return False # <<<<<<<<<<<<<<
jpayne@68 8282 *
jpayne@68 8283 * def readable(self):
jpayne@68 8284 */
jpayne@68 8285 __Pyx_XDECREF(__pyx_r);
jpayne@68 8286 __Pyx_INCREF(Py_False);
jpayne@68 8287 __pyx_r = Py_False;
jpayne@68 8288 goto __pyx_L0;
jpayne@68 8289
jpayne@68 8290 /* "pysam/libchtslib.pyx":137
jpayne@68 8291 * raise IOError(herrno(self.fp), 'failed to flush HFile', self.name)
jpayne@68 8292 *
jpayne@68 8293 * def isatty(self): # <<<<<<<<<<<<<<
jpayne@68 8294 * if self.fp == NULL:
jpayne@68 8295 * raise IOError('operation on closed HFile')
jpayne@68 8296 */
jpayne@68 8297
jpayne@68 8298 /* function exit code */
jpayne@68 8299 __pyx_L1_error:;
jpayne@68 8300 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 8301 __Pyx_AddTraceback("pysam.libchtslib.HFile.isatty", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 8302 __pyx_r = NULL;
jpayne@68 8303 __pyx_L0:;
jpayne@68 8304 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 8305 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 8306 __Pyx_RefNannyFinishContext();
jpayne@68 8307 return __pyx_r;
jpayne@68 8308 }
jpayne@68 8309
jpayne@68 8310 /* "pysam/libchtslib.pyx":142
jpayne@68 8311 * return False
jpayne@68 8312 *
jpayne@68 8313 * def readable(self): # <<<<<<<<<<<<<<
jpayne@68 8314 * return self.fp != NULL and 'r' in self.mode
jpayne@68 8315 *
jpayne@68 8316 */
jpayne@68 8317
jpayne@68 8318 /* Python wrapper */
jpayne@68 8319 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_21readable(PyObject *__pyx_v_self,
jpayne@68 8320 #if CYTHON_METH_FASTCALL
jpayne@68 8321 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8322 #else
jpayne@68 8323 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8324 #endif
jpayne@68 8325 ); /*proto*/
jpayne@68 8326 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_20readable, "HFile.readable(self)");
jpayne@68 8327 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_21readable = {"readable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_21readable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_20readable};
jpayne@68 8328 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_21readable(PyObject *__pyx_v_self,
jpayne@68 8329 #if CYTHON_METH_FASTCALL
jpayne@68 8330 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8331 #else
jpayne@68 8332 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8333 #endif
jpayne@68 8334 ) {
jpayne@68 8335 #if !CYTHON_METH_FASTCALL
jpayne@68 8336 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 8337 #endif
jpayne@68 8338 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 8339 PyObject *__pyx_r = 0;
jpayne@68 8340 __Pyx_RefNannyDeclarations
jpayne@68 8341 __Pyx_RefNannySetupContext("readable (wrapper)", 0);
jpayne@68 8342 #if !CYTHON_METH_FASTCALL
jpayne@68 8343 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 8344 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 8345 #else
jpayne@68 8346 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 8347 #endif
jpayne@68 8348 #endif
jpayne@68 8349 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 8350 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 8351 __Pyx_RaiseArgtupleInvalid("readable", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 8352 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "readable", 0))) return NULL;
jpayne@68 8353 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_20readable(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 8354
jpayne@68 8355 /* function exit code */
jpayne@68 8356 __Pyx_RefNannyFinishContext();
jpayne@68 8357 return __pyx_r;
jpayne@68 8358 }
jpayne@68 8359
jpayne@68 8360 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_20readable(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 8361 PyObject *__pyx_r = NULL;
jpayne@68 8362 __Pyx_TraceDeclarations
jpayne@68 8363 __Pyx_RefNannyDeclarations
jpayne@68 8364 PyObject *__pyx_t_1 = NULL;
jpayne@68 8365 int __pyx_t_2;
jpayne@68 8366 PyObject *__pyx_t_3 = NULL;
jpayne@68 8367 int __pyx_lineno = 0;
jpayne@68 8368 const char *__pyx_filename = NULL;
jpayne@68 8369 int __pyx_clineno = 0;
jpayne@68 8370 __Pyx_TraceFrameInit(__pyx_codeobj__11)
jpayne@68 8371 __Pyx_RefNannySetupContext("readable", 1);
jpayne@68 8372 __Pyx_TraceCall("readable", __pyx_f[0], 142, 0, __PYX_ERR(0, 142, __pyx_L1_error));
jpayne@68 8373
jpayne@68 8374 /* "pysam/libchtslib.pyx":143
jpayne@68 8375 *
jpayne@68 8376 * def readable(self):
jpayne@68 8377 * return self.fp != NULL and 'r' in self.mode # <<<<<<<<<<<<<<
jpayne@68 8378 *
jpayne@68 8379 * def read(self, Py_ssize_t size=-1):
jpayne@68 8380 */
jpayne@68 8381 __Pyx_XDECREF(__pyx_r);
jpayne@68 8382 __pyx_t_2 = (__pyx_v_self->fp != NULL);
jpayne@68 8383 if (__pyx_t_2) {
jpayne@68 8384 } else {
jpayne@68 8385 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
jpayne@68 8386 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 8387 __pyx_t_1 = __pyx_t_3;
jpayne@68 8388 __pyx_t_3 = 0;
jpayne@68 8389 goto __pyx_L3_bool_binop_done;
jpayne@68 8390 }
jpayne@68 8391 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_r, __pyx_v_self->mode, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 143, __pyx_L1_error)
jpayne@68 8392 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
jpayne@68 8393 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 8394 __pyx_t_1 = __pyx_t_3;
jpayne@68 8395 __pyx_t_3 = 0;
jpayne@68 8396 __pyx_L3_bool_binop_done:;
jpayne@68 8397 __pyx_r = __pyx_t_1;
jpayne@68 8398 __pyx_t_1 = 0;
jpayne@68 8399 goto __pyx_L0;
jpayne@68 8400
jpayne@68 8401 /* "pysam/libchtslib.pyx":142
jpayne@68 8402 * return False
jpayne@68 8403 *
jpayne@68 8404 * def readable(self): # <<<<<<<<<<<<<<
jpayne@68 8405 * return self.fp != NULL and 'r' in self.mode
jpayne@68 8406 *
jpayne@68 8407 */
jpayne@68 8408
jpayne@68 8409 /* function exit code */
jpayne@68 8410 __pyx_L1_error:;
jpayne@68 8411 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 8412 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 8413 __Pyx_AddTraceback("pysam.libchtslib.HFile.readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 8414 __pyx_r = NULL;
jpayne@68 8415 __pyx_L0:;
jpayne@68 8416 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 8417 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 8418 __Pyx_RefNannyFinishContext();
jpayne@68 8419 return __pyx_r;
jpayne@68 8420 }
jpayne@68 8421
jpayne@68 8422 /* "pysam/libchtslib.pyx":145
jpayne@68 8423 * return self.fp != NULL and 'r' in self.mode
jpayne@68 8424 *
jpayne@68 8425 * def read(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<<
jpayne@68 8426 * if self.fp == NULL:
jpayne@68 8427 * raise IOError('operation on closed HFile')
jpayne@68 8428 */
jpayne@68 8429
jpayne@68 8430 /* Python wrapper */
jpayne@68 8431 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_23read(PyObject *__pyx_v_self,
jpayne@68 8432 #if CYTHON_METH_FASTCALL
jpayne@68 8433 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8434 #else
jpayne@68 8435 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8436 #endif
jpayne@68 8437 ); /*proto*/
jpayne@68 8438 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_22read, "HFile.read(self, Py_ssize_t size=-1)");
jpayne@68 8439 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_23read = {"read", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_23read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_22read};
jpayne@68 8440 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_23read(PyObject *__pyx_v_self,
jpayne@68 8441 #if CYTHON_METH_FASTCALL
jpayne@68 8442 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8443 #else
jpayne@68 8444 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8445 #endif
jpayne@68 8446 ) {
jpayne@68 8447 Py_ssize_t __pyx_v_size;
jpayne@68 8448 #if !CYTHON_METH_FASTCALL
jpayne@68 8449 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 8450 #endif
jpayne@68 8451 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 8452 PyObject* values[1] = {0};
jpayne@68 8453 int __pyx_lineno = 0;
jpayne@68 8454 const char *__pyx_filename = NULL;
jpayne@68 8455 int __pyx_clineno = 0;
jpayne@68 8456 PyObject *__pyx_r = 0;
jpayne@68 8457 __Pyx_RefNannyDeclarations
jpayne@68 8458 __Pyx_RefNannySetupContext("read (wrapper)", 0);
jpayne@68 8459 #if !CYTHON_METH_FASTCALL
jpayne@68 8460 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 8461 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 8462 #else
jpayne@68 8463 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 8464 #endif
jpayne@68 8465 #endif
jpayne@68 8466 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 8467 {
jpayne@68 8468 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
jpayne@68 8469 if (__pyx_kwds) {
jpayne@68 8470 Py_ssize_t kw_args;
jpayne@68 8471 switch (__pyx_nargs) {
jpayne@68 8472 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 8473 CYTHON_FALLTHROUGH;
jpayne@68 8474 case 0: break;
jpayne@68 8475 default: goto __pyx_L5_argtuple_error;
jpayne@68 8476 }
jpayne@68 8477 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 8478 switch (__pyx_nargs) {
jpayne@68 8479 case 0:
jpayne@68 8480 if (kw_args > 0) {
jpayne@68 8481 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
jpayne@68 8482 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 8483 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L3_error)
jpayne@68 8484 }
jpayne@68 8485 }
jpayne@68 8486 if (unlikely(kw_args > 0)) {
jpayne@68 8487 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 8488 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "read") < 0)) __PYX_ERR(0, 145, __pyx_L3_error)
jpayne@68 8489 }
jpayne@68 8490 } else {
jpayne@68 8491 switch (__pyx_nargs) {
jpayne@68 8492 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 8493 CYTHON_FALLTHROUGH;
jpayne@68 8494 case 0: break;
jpayne@68 8495 default: goto __pyx_L5_argtuple_error;
jpayne@68 8496 }
jpayne@68 8497 }
jpayne@68 8498 if (values[0]) {
jpayne@68 8499 __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L3_error)
jpayne@68 8500 } else {
jpayne@68 8501 __pyx_v_size = ((Py_ssize_t)-1L);
jpayne@68 8502 }
jpayne@68 8503 }
jpayne@68 8504 goto __pyx_L6_skip;
jpayne@68 8505 __pyx_L5_argtuple_error:;
jpayne@68 8506 __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 145, __pyx_L3_error)
jpayne@68 8507 __pyx_L6_skip:;
jpayne@68 8508 goto __pyx_L4_argument_unpacking_done;
jpayne@68 8509 __pyx_L3_error:;
jpayne@68 8510 {
jpayne@68 8511 Py_ssize_t __pyx_temp;
jpayne@68 8512 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 8513 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 8514 }
jpayne@68 8515 }
jpayne@68 8516 __Pyx_AddTraceback("pysam.libchtslib.HFile.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 8517 __Pyx_RefNannyFinishContext();
jpayne@68 8518 return NULL;
jpayne@68 8519 __pyx_L4_argument_unpacking_done:;
jpayne@68 8520 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_22read(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_size);
jpayne@68 8521
jpayne@68 8522 /* function exit code */
jpayne@68 8523 {
jpayne@68 8524 Py_ssize_t __pyx_temp;
jpayne@68 8525 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 8526 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 8527 }
jpayne@68 8528 }
jpayne@68 8529 __Pyx_RefNannyFinishContext();
jpayne@68 8530 return __pyx_r;
jpayne@68 8531 }
jpayne@68 8532
jpayne@68 8533 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_22read(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, Py_ssize_t __pyx_v_size) {
jpayne@68 8534 PyObject *__pyx_v_parts = 0;
jpayne@68 8535 PyObject *__pyx_v_part = 0;
jpayne@68 8536 Py_ssize_t __pyx_v_chunk_size;
jpayne@68 8537 Py_ssize_t __pyx_v_ret;
jpayne@68 8538 Py_ssize_t __pyx_v_bytes_read;
jpayne@68 8539 char *__pyx_v_cpart;
jpayne@68 8540 PyObject *__pyx_r = NULL;
jpayne@68 8541 __Pyx_TraceDeclarations
jpayne@68 8542 __Pyx_RefNannyDeclarations
jpayne@68 8543 int __pyx_t_1;
jpayne@68 8544 PyObject *__pyx_t_2 = NULL;
jpayne@68 8545 int __pyx_t_3;
jpayne@68 8546 Py_ssize_t __pyx_t_4;
jpayne@68 8547 Py_ssize_t __pyx_t_5;
jpayne@68 8548 Py_ssize_t __pyx_t_6;
jpayne@68 8549 char *__pyx_t_7;
jpayne@68 8550 PyObject *__pyx_t_8 = NULL;
jpayne@68 8551 int __pyx_t_9;
jpayne@68 8552 int __pyx_lineno = 0;
jpayne@68 8553 const char *__pyx_filename = NULL;
jpayne@68 8554 int __pyx_clineno = 0;
jpayne@68 8555 __Pyx_TraceFrameInit(__pyx_codeobj__12)
jpayne@68 8556 __Pyx_RefNannySetupContext("read", 1);
jpayne@68 8557 __Pyx_TraceCall("read", __pyx_f[0], 145, 0, __PYX_ERR(0, 145, __pyx_L1_error));
jpayne@68 8558
jpayne@68 8559 /* "pysam/libchtslib.pyx":146
jpayne@68 8560 *
jpayne@68 8561 * def read(self, Py_ssize_t size=-1):
jpayne@68 8562 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 8563 * raise IOError('operation on closed HFile')
jpayne@68 8564 *
jpayne@68 8565 */
jpayne@68 8566 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 8567 if (unlikely(__pyx_t_1)) {
jpayne@68 8568
jpayne@68 8569 /* "pysam/libchtslib.pyx":147
jpayne@68 8570 * def read(self, Py_ssize_t size=-1):
jpayne@68 8571 * if self.fp == NULL:
jpayne@68 8572 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 8573 *
jpayne@68 8574 * if size == 0:
jpayne@68 8575 */
jpayne@68 8576 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
jpayne@68 8577 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8578 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 8579 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 8580 __PYX_ERR(0, 147, __pyx_L1_error)
jpayne@68 8581
jpayne@68 8582 /* "pysam/libchtslib.pyx":146
jpayne@68 8583 *
jpayne@68 8584 * def read(self, Py_ssize_t size=-1):
jpayne@68 8585 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 8586 * raise IOError('operation on closed HFile')
jpayne@68 8587 *
jpayne@68 8588 */
jpayne@68 8589 }
jpayne@68 8590
jpayne@68 8591 /* "pysam/libchtslib.pyx":149
jpayne@68 8592 * raise IOError('operation on closed HFile')
jpayne@68 8593 *
jpayne@68 8594 * if size == 0: # <<<<<<<<<<<<<<
jpayne@68 8595 * return b''
jpayne@68 8596 *
jpayne@68 8597 */
jpayne@68 8598 __pyx_t_1 = (__pyx_v_size == 0);
jpayne@68 8599 if (__pyx_t_1) {
jpayne@68 8600
jpayne@68 8601 /* "pysam/libchtslib.pyx":150
jpayne@68 8602 *
jpayne@68 8603 * if size == 0:
jpayne@68 8604 * return b'' # <<<<<<<<<<<<<<
jpayne@68 8605 *
jpayne@68 8606 * cdef list parts = []
jpayne@68 8607 */
jpayne@68 8608 __Pyx_XDECREF(__pyx_r);
jpayne@68 8609 __Pyx_INCREF(__pyx_kp_b__13);
jpayne@68 8610 __pyx_r = __pyx_kp_b__13;
jpayne@68 8611 goto __pyx_L0;
jpayne@68 8612
jpayne@68 8613 /* "pysam/libchtslib.pyx":149
jpayne@68 8614 * raise IOError('operation on closed HFile')
jpayne@68 8615 *
jpayne@68 8616 * if size == 0: # <<<<<<<<<<<<<<
jpayne@68 8617 * return b''
jpayne@68 8618 *
jpayne@68 8619 */
jpayne@68 8620 }
jpayne@68 8621
jpayne@68 8622 /* "pysam/libchtslib.pyx":152
jpayne@68 8623 * return b''
jpayne@68 8624 *
jpayne@68 8625 * cdef list parts = [] # <<<<<<<<<<<<<<
jpayne@68 8626 * cdef bytes part
jpayne@68 8627 * cdef Py_ssize_t chunk_size, ret, bytes_read = 0
jpayne@68 8628 */
jpayne@68 8629 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
jpayne@68 8630 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8631 __pyx_v_parts = ((PyObject*)__pyx_t_2);
jpayne@68 8632 __pyx_t_2 = 0;
jpayne@68 8633
jpayne@68 8634 /* "pysam/libchtslib.pyx":154
jpayne@68 8635 * cdef list parts = []
jpayne@68 8636 * cdef bytes part
jpayne@68 8637 * cdef Py_ssize_t chunk_size, ret, bytes_read = 0 # <<<<<<<<<<<<<<
jpayne@68 8638 * cdef char *cpart
jpayne@68 8639 *
jpayne@68 8640 */
jpayne@68 8641 __pyx_v_bytes_read = 0;
jpayne@68 8642
jpayne@68 8643 /* "pysam/libchtslib.pyx":157
jpayne@68 8644 * cdef char *cpart
jpayne@68 8645 *
jpayne@68 8646 * while size == -1 or bytes_read < size: # <<<<<<<<<<<<<<
jpayne@68 8647 * chunk_size = 4096
jpayne@68 8648 * if size != -1:
jpayne@68 8649 */
jpayne@68 8650 while (1) {
jpayne@68 8651 __pyx_t_3 = (__pyx_v_size == -1L);
jpayne@68 8652 if (!__pyx_t_3) {
jpayne@68 8653 } else {
jpayne@68 8654 __pyx_t_1 = __pyx_t_3;
jpayne@68 8655 goto __pyx_L7_bool_binop_done;
jpayne@68 8656 }
jpayne@68 8657 __pyx_t_3 = (__pyx_v_bytes_read < __pyx_v_size);
jpayne@68 8658 __pyx_t_1 = __pyx_t_3;
jpayne@68 8659 __pyx_L7_bool_binop_done:;
jpayne@68 8660 if (!__pyx_t_1) break;
jpayne@68 8661
jpayne@68 8662 /* "pysam/libchtslib.pyx":158
jpayne@68 8663 *
jpayne@68 8664 * while size == -1 or bytes_read < size:
jpayne@68 8665 * chunk_size = 4096 # <<<<<<<<<<<<<<
jpayne@68 8666 * if size != -1:
jpayne@68 8667 * chunk_size = min(chunk_size, size - bytes_read)
jpayne@68 8668 */
jpayne@68 8669 __pyx_v_chunk_size = 0x1000;
jpayne@68 8670
jpayne@68 8671 /* "pysam/libchtslib.pyx":159
jpayne@68 8672 * while size == -1 or bytes_read < size:
jpayne@68 8673 * chunk_size = 4096
jpayne@68 8674 * if size != -1: # <<<<<<<<<<<<<<
jpayne@68 8675 * chunk_size = min(chunk_size, size - bytes_read)
jpayne@68 8676 *
jpayne@68 8677 */
jpayne@68 8678 __pyx_t_1 = (__pyx_v_size != -1L);
jpayne@68 8679 if (__pyx_t_1) {
jpayne@68 8680
jpayne@68 8681 /* "pysam/libchtslib.pyx":160
jpayne@68 8682 * chunk_size = 4096
jpayne@68 8683 * if size != -1:
jpayne@68 8684 * chunk_size = min(chunk_size, size - bytes_read) # <<<<<<<<<<<<<<
jpayne@68 8685 *
jpayne@68 8686 * part = PyBytes_FromStringAndSize(NULL, chunk_size)
jpayne@68 8687 */
jpayne@68 8688 __pyx_t_4 = (__pyx_v_size - __pyx_v_bytes_read);
jpayne@68 8689 __pyx_t_5 = __pyx_v_chunk_size;
jpayne@68 8690 __pyx_t_1 = (__pyx_t_4 < __pyx_t_5);
jpayne@68 8691 if (__pyx_t_1) {
jpayne@68 8692 __pyx_t_6 = __pyx_t_4;
jpayne@68 8693 } else {
jpayne@68 8694 __pyx_t_6 = __pyx_t_5;
jpayne@68 8695 }
jpayne@68 8696 __pyx_v_chunk_size = __pyx_t_6;
jpayne@68 8697
jpayne@68 8698 /* "pysam/libchtslib.pyx":159
jpayne@68 8699 * while size == -1 or bytes_read < size:
jpayne@68 8700 * chunk_size = 4096
jpayne@68 8701 * if size != -1: # <<<<<<<<<<<<<<
jpayne@68 8702 * chunk_size = min(chunk_size, size - bytes_read)
jpayne@68 8703 *
jpayne@68 8704 */
jpayne@68 8705 }
jpayne@68 8706
jpayne@68 8707 /* "pysam/libchtslib.pyx":162
jpayne@68 8708 * chunk_size = min(chunk_size, size - bytes_read)
jpayne@68 8709 *
jpayne@68 8710 * part = PyBytes_FromStringAndSize(NULL, chunk_size) # <<<<<<<<<<<<<<
jpayne@68 8711 * cpart = <char *>part
jpayne@68 8712 * ret = hread(self.fp, <void *>cpart, chunk_size)
jpayne@68 8713 */
jpayne@68 8714 __pyx_t_2 = PyBytes_FromStringAndSize(NULL, __pyx_v_chunk_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
jpayne@68 8715 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8716 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
jpayne@68 8717 __pyx_t_2 = 0;
jpayne@68 8718
jpayne@68 8719 /* "pysam/libchtslib.pyx":163
jpayne@68 8720 *
jpayne@68 8721 * part = PyBytes_FromStringAndSize(NULL, chunk_size)
jpayne@68 8722 * cpart = <char *>part # <<<<<<<<<<<<<<
jpayne@68 8723 * ret = hread(self.fp, <void *>cpart, chunk_size)
jpayne@68 8724 *
jpayne@68 8725 */
jpayne@68 8726 if (unlikely(__pyx_v_part == Py_None)) {
jpayne@68 8727 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
jpayne@68 8728 __PYX_ERR(0, 163, __pyx_L1_error)
jpayne@68 8729 }
jpayne@68 8730 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_part); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
jpayne@68 8731 __pyx_v_cpart = ((char *)__pyx_t_7);
jpayne@68 8732
jpayne@68 8733 /* "pysam/libchtslib.pyx":164
jpayne@68 8734 * part = PyBytes_FromStringAndSize(NULL, chunk_size)
jpayne@68 8735 * cpart = <char *>part
jpayne@68 8736 * ret = hread(self.fp, <void *>cpart, chunk_size) # <<<<<<<<<<<<<<
jpayne@68 8737 *
jpayne@68 8738 * if ret < 0:
jpayne@68 8739 */
jpayne@68 8740 __pyx_v_ret = hread(__pyx_v_self->fp, ((void *)__pyx_v_cpart), __pyx_v_chunk_size);
jpayne@68 8741
jpayne@68 8742 /* "pysam/libchtslib.pyx":166
jpayne@68 8743 * ret = hread(self.fp, <void *>cpart, chunk_size)
jpayne@68 8744 *
jpayne@68 8745 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 8746 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 8747 * elif not ret:
jpayne@68 8748 */
jpayne@68 8749 __pyx_t_1 = (__pyx_v_ret < 0);
jpayne@68 8750 if (__pyx_t_1) {
jpayne@68 8751
jpayne@68 8752 /* "pysam/libchtslib.pyx":167
jpayne@68 8753 *
jpayne@68 8754 * if ret < 0:
jpayne@68 8755 * IOError(herrno(self.fp), 'failed to read HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 8756 * elif not ret:
jpayne@68 8757 * break
jpayne@68 8758 */
jpayne@68 8759 __pyx_t_2 = __Pyx_PyInt_From_int(herrno(__pyx_v_self->fp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
jpayne@68 8760 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8761 __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error)
jpayne@68 8762 __Pyx_GOTREF(__pyx_t_8);
jpayne@68 8763 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 8764 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error);
jpayne@68 8765 __Pyx_INCREF(__pyx_kp_u_failed_to_read_HFile);
jpayne@68 8766 __Pyx_GIVEREF(__pyx_kp_u_failed_to_read_HFile);
jpayne@68 8767 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_kp_u_failed_to_read_HFile)) __PYX_ERR(0, 167, __pyx_L1_error);
jpayne@68 8768 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 8769 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 8770 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_self->name)) __PYX_ERR(0, 167, __pyx_L1_error);
jpayne@68 8771 __pyx_t_2 = 0;
jpayne@68 8772 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
jpayne@68 8773 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8774 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
jpayne@68 8775 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 8776
jpayne@68 8777 /* "pysam/libchtslib.pyx":166
jpayne@68 8778 * ret = hread(self.fp, <void *>cpart, chunk_size)
jpayne@68 8779 *
jpayne@68 8780 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 8781 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 8782 * elif not ret:
jpayne@68 8783 */
jpayne@68 8784 goto __pyx_L10;
jpayne@68 8785 }
jpayne@68 8786
jpayne@68 8787 /* "pysam/libchtslib.pyx":168
jpayne@68 8788 * if ret < 0:
jpayne@68 8789 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 8790 * elif not ret: # <<<<<<<<<<<<<<
jpayne@68 8791 * break
jpayne@68 8792 *
jpayne@68 8793 */
jpayne@68 8794 __pyx_t_1 = (!(__pyx_v_ret != 0));
jpayne@68 8795 if (__pyx_t_1) {
jpayne@68 8796
jpayne@68 8797 /* "pysam/libchtslib.pyx":169
jpayne@68 8798 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 8799 * elif not ret:
jpayne@68 8800 * break # <<<<<<<<<<<<<<
jpayne@68 8801 *
jpayne@68 8802 * bytes_read += ret
jpayne@68 8803 */
jpayne@68 8804 goto __pyx_L6_break;
jpayne@68 8805
jpayne@68 8806 /* "pysam/libchtslib.pyx":168
jpayne@68 8807 * if ret < 0:
jpayne@68 8808 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 8809 * elif not ret: # <<<<<<<<<<<<<<
jpayne@68 8810 * break
jpayne@68 8811 *
jpayne@68 8812 */
jpayne@68 8813 }
jpayne@68 8814 __pyx_L10:;
jpayne@68 8815
jpayne@68 8816 /* "pysam/libchtslib.pyx":171
jpayne@68 8817 * break
jpayne@68 8818 *
jpayne@68 8819 * bytes_read += ret # <<<<<<<<<<<<<<
jpayne@68 8820 *
jpayne@68 8821 * if ret < chunk_size:
jpayne@68 8822 */
jpayne@68 8823 __pyx_v_bytes_read = (__pyx_v_bytes_read + __pyx_v_ret);
jpayne@68 8824
jpayne@68 8825 /* "pysam/libchtslib.pyx":173
jpayne@68 8826 * bytes_read += ret
jpayne@68 8827 *
jpayne@68 8828 * if ret < chunk_size: # <<<<<<<<<<<<<<
jpayne@68 8829 * part = cpart[:ret]
jpayne@68 8830 *
jpayne@68 8831 */
jpayne@68 8832 __pyx_t_1 = (__pyx_v_ret < __pyx_v_chunk_size);
jpayne@68 8833 if (__pyx_t_1) {
jpayne@68 8834
jpayne@68 8835 /* "pysam/libchtslib.pyx":174
jpayne@68 8836 *
jpayne@68 8837 * if ret < chunk_size:
jpayne@68 8838 * part = cpart[:ret] # <<<<<<<<<<<<<<
jpayne@68 8839 *
jpayne@68 8840 * parts.append(part)
jpayne@68 8841 */
jpayne@68 8842 __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cpart + 0, __pyx_v_ret - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
jpayne@68 8843 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8844 __Pyx_DECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
jpayne@68 8845 __pyx_t_2 = 0;
jpayne@68 8846
jpayne@68 8847 /* "pysam/libchtslib.pyx":173
jpayne@68 8848 * bytes_read += ret
jpayne@68 8849 *
jpayne@68 8850 * if ret < chunk_size: # <<<<<<<<<<<<<<
jpayne@68 8851 * part = cpart[:ret]
jpayne@68 8852 *
jpayne@68 8853 */
jpayne@68 8854 }
jpayne@68 8855
jpayne@68 8856 /* "pysam/libchtslib.pyx":176
jpayne@68 8857 * part = cpart[:ret]
jpayne@68 8858 *
jpayne@68 8859 * parts.append(part) # <<<<<<<<<<<<<<
jpayne@68 8860 *
jpayne@68 8861 * return b''.join(parts)
jpayne@68 8862 */
jpayne@68 8863 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_v_part); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error)
jpayne@68 8864 }
jpayne@68 8865 __pyx_L6_break:;
jpayne@68 8866
jpayne@68 8867 /* "pysam/libchtslib.pyx":178
jpayne@68 8868 * parts.append(part)
jpayne@68 8869 *
jpayne@68 8870 * return b''.join(parts) # <<<<<<<<<<<<<<
jpayne@68 8871 *
jpayne@68 8872 * def readall(self):
jpayne@68 8873 */
jpayne@68 8874 __Pyx_XDECREF(__pyx_r);
jpayne@68 8875 __pyx_t_2 = __Pyx_PyBytes_Join(__pyx_kp_b__13, __pyx_v_parts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
jpayne@68 8876 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8877 __pyx_r = __pyx_t_2;
jpayne@68 8878 __pyx_t_2 = 0;
jpayne@68 8879 goto __pyx_L0;
jpayne@68 8880
jpayne@68 8881 /* "pysam/libchtslib.pyx":145
jpayne@68 8882 * return self.fp != NULL and 'r' in self.mode
jpayne@68 8883 *
jpayne@68 8884 * def read(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<<
jpayne@68 8885 * if self.fp == NULL:
jpayne@68 8886 * raise IOError('operation on closed HFile')
jpayne@68 8887 */
jpayne@68 8888
jpayne@68 8889 /* function exit code */
jpayne@68 8890 __pyx_L1_error:;
jpayne@68 8891 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 8892 __Pyx_XDECREF(__pyx_t_8);
jpayne@68 8893 __Pyx_AddTraceback("pysam.libchtslib.HFile.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 8894 __pyx_r = NULL;
jpayne@68 8895 __pyx_L0:;
jpayne@68 8896 __Pyx_XDECREF(__pyx_v_parts);
jpayne@68 8897 __Pyx_XDECREF(__pyx_v_part);
jpayne@68 8898 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 8899 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 8900 __Pyx_RefNannyFinishContext();
jpayne@68 8901 return __pyx_r;
jpayne@68 8902 }
jpayne@68 8903
jpayne@68 8904 /* "pysam/libchtslib.pyx":180
jpayne@68 8905 * return b''.join(parts)
jpayne@68 8906 *
jpayne@68 8907 * def readall(self): # <<<<<<<<<<<<<<
jpayne@68 8908 * return self.read()
jpayne@68 8909 *
jpayne@68 8910 */
jpayne@68 8911
jpayne@68 8912 /* Python wrapper */
jpayne@68 8913 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_25readall(PyObject *__pyx_v_self,
jpayne@68 8914 #if CYTHON_METH_FASTCALL
jpayne@68 8915 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8916 #else
jpayne@68 8917 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8918 #endif
jpayne@68 8919 ); /*proto*/
jpayne@68 8920 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_24readall, "HFile.readall(self)");
jpayne@68 8921 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_25readall = {"readall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_25readall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_24readall};
jpayne@68 8922 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_25readall(PyObject *__pyx_v_self,
jpayne@68 8923 #if CYTHON_METH_FASTCALL
jpayne@68 8924 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 8925 #else
jpayne@68 8926 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 8927 #endif
jpayne@68 8928 ) {
jpayne@68 8929 #if !CYTHON_METH_FASTCALL
jpayne@68 8930 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 8931 #endif
jpayne@68 8932 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 8933 PyObject *__pyx_r = 0;
jpayne@68 8934 __Pyx_RefNannyDeclarations
jpayne@68 8935 __Pyx_RefNannySetupContext("readall (wrapper)", 0);
jpayne@68 8936 #if !CYTHON_METH_FASTCALL
jpayne@68 8937 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 8938 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 8939 #else
jpayne@68 8940 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 8941 #endif
jpayne@68 8942 #endif
jpayne@68 8943 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 8944 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 8945 __Pyx_RaiseArgtupleInvalid("readall", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 8946 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "readall", 0))) return NULL;
jpayne@68 8947 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_24readall(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 8948
jpayne@68 8949 /* function exit code */
jpayne@68 8950 __Pyx_RefNannyFinishContext();
jpayne@68 8951 return __pyx_r;
jpayne@68 8952 }
jpayne@68 8953
jpayne@68 8954 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_24readall(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 8955 PyObject *__pyx_r = NULL;
jpayne@68 8956 __Pyx_TraceDeclarations
jpayne@68 8957 __Pyx_RefNannyDeclarations
jpayne@68 8958 PyObject *__pyx_t_1 = NULL;
jpayne@68 8959 PyObject *__pyx_t_2 = NULL;
jpayne@68 8960 PyObject *__pyx_t_3 = NULL;
jpayne@68 8961 unsigned int __pyx_t_4;
jpayne@68 8962 int __pyx_lineno = 0;
jpayne@68 8963 const char *__pyx_filename = NULL;
jpayne@68 8964 int __pyx_clineno = 0;
jpayne@68 8965 __Pyx_TraceFrameInit(__pyx_codeobj__14)
jpayne@68 8966 __Pyx_RefNannySetupContext("readall", 1);
jpayne@68 8967 __Pyx_TraceCall("readall", __pyx_f[0], 180, 0, __PYX_ERR(0, 180, __pyx_L1_error));
jpayne@68 8968
jpayne@68 8969 /* "pysam/libchtslib.pyx":181
jpayne@68 8970 *
jpayne@68 8971 * def readall(self):
jpayne@68 8972 * return self.read() # <<<<<<<<<<<<<<
jpayne@68 8973 *
jpayne@68 8974 * def readinto(self, buf):
jpayne@68 8975 */
jpayne@68 8976 __Pyx_XDECREF(__pyx_r);
jpayne@68 8977 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
jpayne@68 8978 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 8979 __pyx_t_3 = NULL;
jpayne@68 8980 __pyx_t_4 = 0;
jpayne@68 8981 #if CYTHON_UNPACK_METHODS
jpayne@68 8982 if (likely(PyMethod_Check(__pyx_t_2))) {
jpayne@68 8983 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
jpayne@68 8984 if (likely(__pyx_t_3)) {
jpayne@68 8985 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
jpayne@68 8986 __Pyx_INCREF(__pyx_t_3);
jpayne@68 8987 __Pyx_INCREF(function);
jpayne@68 8988 __Pyx_DECREF_SET(__pyx_t_2, function);
jpayne@68 8989 __pyx_t_4 = 1;
jpayne@68 8990 }
jpayne@68 8991 }
jpayne@68 8992 #endif
jpayne@68 8993 {
jpayne@68 8994 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
jpayne@68 8995 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
jpayne@68 8996 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 8997 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
jpayne@68 8998 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 8999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 9000 }
jpayne@68 9001 __pyx_r = __pyx_t_1;
jpayne@68 9002 __pyx_t_1 = 0;
jpayne@68 9003 goto __pyx_L0;
jpayne@68 9004
jpayne@68 9005 /* "pysam/libchtslib.pyx":180
jpayne@68 9006 * return b''.join(parts)
jpayne@68 9007 *
jpayne@68 9008 * def readall(self): # <<<<<<<<<<<<<<
jpayne@68 9009 * return self.read()
jpayne@68 9010 *
jpayne@68 9011 */
jpayne@68 9012
jpayne@68 9013 /* function exit code */
jpayne@68 9014 __pyx_L1_error:;
jpayne@68 9015 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 9016 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 9017 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 9018 __Pyx_AddTraceback("pysam.libchtslib.HFile.readall", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 9019 __pyx_r = NULL;
jpayne@68 9020 __pyx_L0:;
jpayne@68 9021 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 9022 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 9023 __Pyx_RefNannyFinishContext();
jpayne@68 9024 return __pyx_r;
jpayne@68 9025 }
jpayne@68 9026
jpayne@68 9027 /* "pysam/libchtslib.pyx":183
jpayne@68 9028 * return self.read()
jpayne@68 9029 *
jpayne@68 9030 * def readinto(self, buf): # <<<<<<<<<<<<<<
jpayne@68 9031 * if self.fp == NULL:
jpayne@68 9032 * raise IOError('operation on closed HFile')
jpayne@68 9033 */
jpayne@68 9034
jpayne@68 9035 /* Python wrapper */
jpayne@68 9036 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_27readinto(PyObject *__pyx_v_self,
jpayne@68 9037 #if CYTHON_METH_FASTCALL
jpayne@68 9038 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 9039 #else
jpayne@68 9040 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 9041 #endif
jpayne@68 9042 ); /*proto*/
jpayne@68 9043 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_26readinto, "HFile.readinto(self, buf)");
jpayne@68 9044 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_27readinto = {"readinto", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_27readinto, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_26readinto};
jpayne@68 9045 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_27readinto(PyObject *__pyx_v_self,
jpayne@68 9046 #if CYTHON_METH_FASTCALL
jpayne@68 9047 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 9048 #else
jpayne@68 9049 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 9050 #endif
jpayne@68 9051 ) {
jpayne@68 9052 PyObject *__pyx_v_buf = 0;
jpayne@68 9053 #if !CYTHON_METH_FASTCALL
jpayne@68 9054 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 9055 #endif
jpayne@68 9056 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 9057 PyObject* values[1] = {0};
jpayne@68 9058 int __pyx_lineno = 0;
jpayne@68 9059 const char *__pyx_filename = NULL;
jpayne@68 9060 int __pyx_clineno = 0;
jpayne@68 9061 PyObject *__pyx_r = 0;
jpayne@68 9062 __Pyx_RefNannyDeclarations
jpayne@68 9063 __Pyx_RefNannySetupContext("readinto (wrapper)", 0);
jpayne@68 9064 #if !CYTHON_METH_FASTCALL
jpayne@68 9065 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 9066 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 9067 #else
jpayne@68 9068 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 9069 #endif
jpayne@68 9070 #endif
jpayne@68 9071 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 9072 {
jpayne@68 9073 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buf,0};
jpayne@68 9074 if (__pyx_kwds) {
jpayne@68 9075 Py_ssize_t kw_args;
jpayne@68 9076 switch (__pyx_nargs) {
jpayne@68 9077 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 9078 CYTHON_FALLTHROUGH;
jpayne@68 9079 case 0: break;
jpayne@68 9080 default: goto __pyx_L5_argtuple_error;
jpayne@68 9081 }
jpayne@68 9082 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 9083 switch (__pyx_nargs) {
jpayne@68 9084 case 0:
jpayne@68 9085 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buf)) != 0)) {
jpayne@68 9086 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 9087 kw_args--;
jpayne@68 9088 }
jpayne@68 9089 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error)
jpayne@68 9090 else goto __pyx_L5_argtuple_error;
jpayne@68 9091 }
jpayne@68 9092 if (unlikely(kw_args > 0)) {
jpayne@68 9093 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 9094 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "readinto") < 0)) __PYX_ERR(0, 183, __pyx_L3_error)
jpayne@68 9095 }
jpayne@68 9096 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 9097 goto __pyx_L5_argtuple_error;
jpayne@68 9098 } else {
jpayne@68 9099 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 9100 }
jpayne@68 9101 __pyx_v_buf = values[0];
jpayne@68 9102 }
jpayne@68 9103 goto __pyx_L6_skip;
jpayne@68 9104 __pyx_L5_argtuple_error:;
jpayne@68 9105 __Pyx_RaiseArgtupleInvalid("readinto", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 183, __pyx_L3_error)
jpayne@68 9106 __pyx_L6_skip:;
jpayne@68 9107 goto __pyx_L4_argument_unpacking_done;
jpayne@68 9108 __pyx_L3_error:;
jpayne@68 9109 {
jpayne@68 9110 Py_ssize_t __pyx_temp;
jpayne@68 9111 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 9112 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 9113 }
jpayne@68 9114 }
jpayne@68 9115 __Pyx_AddTraceback("pysam.libchtslib.HFile.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 9116 __Pyx_RefNannyFinishContext();
jpayne@68 9117 return NULL;
jpayne@68 9118 __pyx_L4_argument_unpacking_done:;
jpayne@68 9119 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_26readinto(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_buf);
jpayne@68 9120
jpayne@68 9121 /* function exit code */
jpayne@68 9122 {
jpayne@68 9123 Py_ssize_t __pyx_temp;
jpayne@68 9124 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 9125 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 9126 }
jpayne@68 9127 }
jpayne@68 9128 __Pyx_RefNannyFinishContext();
jpayne@68 9129 return __pyx_r;
jpayne@68 9130 }
jpayne@68 9131
jpayne@68 9132 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_26readinto(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_buf) {
jpayne@68 9133 Py_ssize_t __pyx_v_size;
jpayne@68 9134 PyObject *__pyx_v_mv = NULL;
jpayne@68 9135 Py_ssize_t __pyx_v_ret;
jpayne@68 9136 PyObject *__pyx_r = NULL;
jpayne@68 9137 __Pyx_TraceDeclarations
jpayne@68 9138 __Pyx_RefNannyDeclarations
jpayne@68 9139 int __pyx_t_1;
jpayne@68 9140 PyObject *__pyx_t_2 = NULL;
jpayne@68 9141 Py_ssize_t __pyx_t_3;
jpayne@68 9142 PyObject *__pyx_t_4 = NULL;
jpayne@68 9143 int __pyx_lineno = 0;
jpayne@68 9144 const char *__pyx_filename = NULL;
jpayne@68 9145 int __pyx_clineno = 0;
jpayne@68 9146 __Pyx_TraceFrameInit(__pyx_codeobj__15)
jpayne@68 9147 __Pyx_RefNannySetupContext("readinto", 1);
jpayne@68 9148 __Pyx_TraceCall("readinto", __pyx_f[0], 183, 0, __PYX_ERR(0, 183, __pyx_L1_error));
jpayne@68 9149
jpayne@68 9150 /* "pysam/libchtslib.pyx":184
jpayne@68 9151 *
jpayne@68 9152 * def readinto(self, buf):
jpayne@68 9153 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 9154 * raise IOError('operation on closed HFile')
jpayne@68 9155 *
jpayne@68 9156 */
jpayne@68 9157 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 9158 if (unlikely(__pyx_t_1)) {
jpayne@68 9159
jpayne@68 9160 /* "pysam/libchtslib.pyx":185
jpayne@68 9161 * def readinto(self, buf):
jpayne@68 9162 * if self.fp == NULL:
jpayne@68 9163 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 9164 *
jpayne@68 9165 * size = len(buf)
jpayne@68 9166 */
jpayne@68 9167 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
jpayne@68 9168 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9169 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 9170 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 9171 __PYX_ERR(0, 185, __pyx_L1_error)
jpayne@68 9172
jpayne@68 9173 /* "pysam/libchtslib.pyx":184
jpayne@68 9174 *
jpayne@68 9175 * def readinto(self, buf):
jpayne@68 9176 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 9177 * raise IOError('operation on closed HFile')
jpayne@68 9178 *
jpayne@68 9179 */
jpayne@68 9180 }
jpayne@68 9181
jpayne@68 9182 /* "pysam/libchtslib.pyx":187
jpayne@68 9183 * raise IOError('operation on closed HFile')
jpayne@68 9184 *
jpayne@68 9185 * size = len(buf) # <<<<<<<<<<<<<<
jpayne@68 9186 *
jpayne@68 9187 * if size == 0:
jpayne@68 9188 */
jpayne@68 9189 __pyx_t_3 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 187, __pyx_L1_error)
jpayne@68 9190 __pyx_v_size = __pyx_t_3;
jpayne@68 9191
jpayne@68 9192 /* "pysam/libchtslib.pyx":189
jpayne@68 9193 * size = len(buf)
jpayne@68 9194 *
jpayne@68 9195 * if size == 0: # <<<<<<<<<<<<<<
jpayne@68 9196 * return size
jpayne@68 9197 *
jpayne@68 9198 */
jpayne@68 9199 __pyx_t_1 = (__pyx_v_size == 0);
jpayne@68 9200 if (__pyx_t_1) {
jpayne@68 9201
jpayne@68 9202 /* "pysam/libchtslib.pyx":190
jpayne@68 9203 *
jpayne@68 9204 * if size == 0:
jpayne@68 9205 * return size # <<<<<<<<<<<<<<
jpayne@68 9206 *
jpayne@68 9207 * mv = memoryview(buf)
jpayne@68 9208 */
jpayne@68 9209 __Pyx_XDECREF(__pyx_r);
jpayne@68 9210 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
jpayne@68 9211 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9212 __pyx_r = __pyx_t_2;
jpayne@68 9213 __pyx_t_2 = 0;
jpayne@68 9214 goto __pyx_L0;
jpayne@68 9215
jpayne@68 9216 /* "pysam/libchtslib.pyx":189
jpayne@68 9217 * size = len(buf)
jpayne@68 9218 *
jpayne@68 9219 * if size == 0: # <<<<<<<<<<<<<<
jpayne@68 9220 * return size
jpayne@68 9221 *
jpayne@68 9222 */
jpayne@68 9223 }
jpayne@68 9224
jpayne@68 9225 /* "pysam/libchtslib.pyx":192
jpayne@68 9226 * return size
jpayne@68 9227 *
jpayne@68 9228 * mv = memoryview(buf) # <<<<<<<<<<<<<<
jpayne@68 9229 * ret = hread(self.fp, <void *>mv, size)
jpayne@68 9230 *
jpayne@68 9231 */
jpayne@68 9232 __pyx_t_2 = PyMemoryView_FromObject(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
jpayne@68 9233 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9234 __pyx_v_mv = ((PyObject*)__pyx_t_2);
jpayne@68 9235 __pyx_t_2 = 0;
jpayne@68 9236
jpayne@68 9237 /* "pysam/libchtslib.pyx":193
jpayne@68 9238 *
jpayne@68 9239 * mv = memoryview(buf)
jpayne@68 9240 * ret = hread(self.fp, <void *>mv, size) # <<<<<<<<<<<<<<
jpayne@68 9241 *
jpayne@68 9242 * if ret < 0:
jpayne@68 9243 */
jpayne@68 9244 __pyx_v_ret = hread(__pyx_v_self->fp, ((void *)__pyx_v_mv), __pyx_v_size);
jpayne@68 9245
jpayne@68 9246 /* "pysam/libchtslib.pyx":195
jpayne@68 9247 * ret = hread(self.fp, <void *>mv, size)
jpayne@68 9248 *
jpayne@68 9249 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 9250 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 9251 *
jpayne@68 9252 */
jpayne@68 9253 __pyx_t_1 = (__pyx_v_ret < 0);
jpayne@68 9254 if (__pyx_t_1) {
jpayne@68 9255
jpayne@68 9256 /* "pysam/libchtslib.pyx":196
jpayne@68 9257 *
jpayne@68 9258 * if ret < 0:
jpayne@68 9259 * IOError(herrno(self.fp), 'failed to read HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 9260 *
jpayne@68 9261 * return ret
jpayne@68 9262 */
jpayne@68 9263 __pyx_t_2 = __Pyx_PyInt_From_int(herrno(__pyx_v_self->fp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
jpayne@68 9264 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9265 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
jpayne@68 9266 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 9267 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 9268 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error);
jpayne@68 9269 __Pyx_INCREF(__pyx_kp_u_failed_to_read_HFile);
jpayne@68 9270 __Pyx_GIVEREF(__pyx_kp_u_failed_to_read_HFile);
jpayne@68 9271 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u_failed_to_read_HFile)) __PYX_ERR(0, 196, __pyx_L1_error);
jpayne@68 9272 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 9273 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 9274 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->name)) __PYX_ERR(0, 196, __pyx_L1_error);
jpayne@68 9275 __pyx_t_2 = 0;
jpayne@68 9276 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
jpayne@68 9277 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9278 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 9279 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 9280
jpayne@68 9281 /* "pysam/libchtslib.pyx":195
jpayne@68 9282 * ret = hread(self.fp, <void *>mv, size)
jpayne@68 9283 *
jpayne@68 9284 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 9285 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 9286 *
jpayne@68 9287 */
jpayne@68 9288 }
jpayne@68 9289
jpayne@68 9290 /* "pysam/libchtslib.pyx":198
jpayne@68 9291 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 9292 *
jpayne@68 9293 * return ret # <<<<<<<<<<<<<<
jpayne@68 9294 *
jpayne@68 9295 * def readline(self, Py_ssize_t size=-1):
jpayne@68 9296 */
jpayne@68 9297 __Pyx_XDECREF(__pyx_r);
jpayne@68 9298 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
jpayne@68 9299 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9300 __pyx_r = __pyx_t_2;
jpayne@68 9301 __pyx_t_2 = 0;
jpayne@68 9302 goto __pyx_L0;
jpayne@68 9303
jpayne@68 9304 /* "pysam/libchtslib.pyx":183
jpayne@68 9305 * return self.read()
jpayne@68 9306 *
jpayne@68 9307 * def readinto(self, buf): # <<<<<<<<<<<<<<
jpayne@68 9308 * if self.fp == NULL:
jpayne@68 9309 * raise IOError('operation on closed HFile')
jpayne@68 9310 */
jpayne@68 9311
jpayne@68 9312 /* function exit code */
jpayne@68 9313 __pyx_L1_error:;
jpayne@68 9314 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 9315 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 9316 __Pyx_AddTraceback("pysam.libchtslib.HFile.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 9317 __pyx_r = NULL;
jpayne@68 9318 __pyx_L0:;
jpayne@68 9319 __Pyx_XDECREF(__pyx_v_mv);
jpayne@68 9320 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 9321 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 9322 __Pyx_RefNannyFinishContext();
jpayne@68 9323 return __pyx_r;
jpayne@68 9324 }
jpayne@68 9325
jpayne@68 9326 /* "pysam/libchtslib.pyx":200
jpayne@68 9327 * return ret
jpayne@68 9328 *
jpayne@68 9329 * def readline(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<<
jpayne@68 9330 * if self.fp == NULL:
jpayne@68 9331 * raise IOError('operation on closed HFile')
jpayne@68 9332 */
jpayne@68 9333
jpayne@68 9334 /* Python wrapper */
jpayne@68 9335 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_29readline(PyObject *__pyx_v_self,
jpayne@68 9336 #if CYTHON_METH_FASTCALL
jpayne@68 9337 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 9338 #else
jpayne@68 9339 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 9340 #endif
jpayne@68 9341 ); /*proto*/
jpayne@68 9342 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_28readline, "HFile.readline(self, Py_ssize_t size=-1)");
jpayne@68 9343 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_29readline = {"readline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_29readline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_28readline};
jpayne@68 9344 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_29readline(PyObject *__pyx_v_self,
jpayne@68 9345 #if CYTHON_METH_FASTCALL
jpayne@68 9346 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 9347 #else
jpayne@68 9348 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 9349 #endif
jpayne@68 9350 ) {
jpayne@68 9351 Py_ssize_t __pyx_v_size;
jpayne@68 9352 #if !CYTHON_METH_FASTCALL
jpayne@68 9353 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 9354 #endif
jpayne@68 9355 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 9356 PyObject* values[1] = {0};
jpayne@68 9357 int __pyx_lineno = 0;
jpayne@68 9358 const char *__pyx_filename = NULL;
jpayne@68 9359 int __pyx_clineno = 0;
jpayne@68 9360 PyObject *__pyx_r = 0;
jpayne@68 9361 __Pyx_RefNannyDeclarations
jpayne@68 9362 __Pyx_RefNannySetupContext("readline (wrapper)", 0);
jpayne@68 9363 #if !CYTHON_METH_FASTCALL
jpayne@68 9364 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 9365 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 9366 #else
jpayne@68 9367 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 9368 #endif
jpayne@68 9369 #endif
jpayne@68 9370 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 9371 {
jpayne@68 9372 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
jpayne@68 9373 if (__pyx_kwds) {
jpayne@68 9374 Py_ssize_t kw_args;
jpayne@68 9375 switch (__pyx_nargs) {
jpayne@68 9376 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 9377 CYTHON_FALLTHROUGH;
jpayne@68 9378 case 0: break;
jpayne@68 9379 default: goto __pyx_L5_argtuple_error;
jpayne@68 9380 }
jpayne@68 9381 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 9382 switch (__pyx_nargs) {
jpayne@68 9383 case 0:
jpayne@68 9384 if (kw_args > 0) {
jpayne@68 9385 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
jpayne@68 9386 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 9387 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error)
jpayne@68 9388 }
jpayne@68 9389 }
jpayne@68 9390 if (unlikely(kw_args > 0)) {
jpayne@68 9391 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 9392 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "readline") < 0)) __PYX_ERR(0, 200, __pyx_L3_error)
jpayne@68 9393 }
jpayne@68 9394 } else {
jpayne@68 9395 switch (__pyx_nargs) {
jpayne@68 9396 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 9397 CYTHON_FALLTHROUGH;
jpayne@68 9398 case 0: break;
jpayne@68 9399 default: goto __pyx_L5_argtuple_error;
jpayne@68 9400 }
jpayne@68 9401 }
jpayne@68 9402 if (values[0]) {
jpayne@68 9403 __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error)
jpayne@68 9404 } else {
jpayne@68 9405 __pyx_v_size = ((Py_ssize_t)-1L);
jpayne@68 9406 }
jpayne@68 9407 }
jpayne@68 9408 goto __pyx_L6_skip;
jpayne@68 9409 __pyx_L5_argtuple_error:;
jpayne@68 9410 __Pyx_RaiseArgtupleInvalid("readline", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 200, __pyx_L3_error)
jpayne@68 9411 __pyx_L6_skip:;
jpayne@68 9412 goto __pyx_L4_argument_unpacking_done;
jpayne@68 9413 __pyx_L3_error:;
jpayne@68 9414 {
jpayne@68 9415 Py_ssize_t __pyx_temp;
jpayne@68 9416 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 9417 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 9418 }
jpayne@68 9419 }
jpayne@68 9420 __Pyx_AddTraceback("pysam.libchtslib.HFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 9421 __Pyx_RefNannyFinishContext();
jpayne@68 9422 return NULL;
jpayne@68 9423 __pyx_L4_argument_unpacking_done:;
jpayne@68 9424 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_28readline(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_size);
jpayne@68 9425
jpayne@68 9426 /* function exit code */
jpayne@68 9427 {
jpayne@68 9428 Py_ssize_t __pyx_temp;
jpayne@68 9429 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 9430 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 9431 }
jpayne@68 9432 }
jpayne@68 9433 __Pyx_RefNannyFinishContext();
jpayne@68 9434 return __pyx_r;
jpayne@68 9435 }
jpayne@68 9436
jpayne@68 9437 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_28readline(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, Py_ssize_t __pyx_v_size) {
jpayne@68 9438 PyObject *__pyx_v_parts = 0;
jpayne@68 9439 PyObject *__pyx_v_part = 0;
jpayne@68 9440 Py_ssize_t __pyx_v_chunk_size;
jpayne@68 9441 Py_ssize_t __pyx_v_ret;
jpayne@68 9442 Py_ssize_t __pyx_v_bytes_read;
jpayne@68 9443 char *__pyx_v_cpart;
jpayne@68 9444 PyObject *__pyx_r = NULL;
jpayne@68 9445 __Pyx_TraceDeclarations
jpayne@68 9446 __Pyx_RefNannyDeclarations
jpayne@68 9447 int __pyx_t_1;
jpayne@68 9448 PyObject *__pyx_t_2 = NULL;
jpayne@68 9449 int __pyx_t_3;
jpayne@68 9450 Py_ssize_t __pyx_t_4;
jpayne@68 9451 Py_ssize_t __pyx_t_5;
jpayne@68 9452 Py_ssize_t __pyx_t_6;
jpayne@68 9453 char *__pyx_t_7;
jpayne@68 9454 PyObject *__pyx_t_8 = NULL;
jpayne@68 9455 int __pyx_t_9;
jpayne@68 9456 int __pyx_lineno = 0;
jpayne@68 9457 const char *__pyx_filename = NULL;
jpayne@68 9458 int __pyx_clineno = 0;
jpayne@68 9459 __Pyx_TraceFrameInit(__pyx_codeobj__16)
jpayne@68 9460 __Pyx_RefNannySetupContext("readline", 1);
jpayne@68 9461 __Pyx_TraceCall("readline", __pyx_f[0], 200, 0, __PYX_ERR(0, 200, __pyx_L1_error));
jpayne@68 9462
jpayne@68 9463 /* "pysam/libchtslib.pyx":201
jpayne@68 9464 *
jpayne@68 9465 * def readline(self, Py_ssize_t size=-1):
jpayne@68 9466 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 9467 * raise IOError('operation on closed HFile')
jpayne@68 9468 *
jpayne@68 9469 */
jpayne@68 9470 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 9471 if (unlikely(__pyx_t_1)) {
jpayne@68 9472
jpayne@68 9473 /* "pysam/libchtslib.pyx":202
jpayne@68 9474 * def readline(self, Py_ssize_t size=-1):
jpayne@68 9475 * if self.fp == NULL:
jpayne@68 9476 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 9477 *
jpayne@68 9478 * if size == 0:
jpayne@68 9479 */
jpayne@68 9480 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
jpayne@68 9481 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9482 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 9483 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 9484 __PYX_ERR(0, 202, __pyx_L1_error)
jpayne@68 9485
jpayne@68 9486 /* "pysam/libchtslib.pyx":201
jpayne@68 9487 *
jpayne@68 9488 * def readline(self, Py_ssize_t size=-1):
jpayne@68 9489 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 9490 * raise IOError('operation on closed HFile')
jpayne@68 9491 *
jpayne@68 9492 */
jpayne@68 9493 }
jpayne@68 9494
jpayne@68 9495 /* "pysam/libchtslib.pyx":204
jpayne@68 9496 * raise IOError('operation on closed HFile')
jpayne@68 9497 *
jpayne@68 9498 * if size == 0: # <<<<<<<<<<<<<<
jpayne@68 9499 * return b''
jpayne@68 9500 *
jpayne@68 9501 */
jpayne@68 9502 __pyx_t_1 = (__pyx_v_size == 0);
jpayne@68 9503 if (__pyx_t_1) {
jpayne@68 9504
jpayne@68 9505 /* "pysam/libchtslib.pyx":205
jpayne@68 9506 *
jpayne@68 9507 * if size == 0:
jpayne@68 9508 * return b'' # <<<<<<<<<<<<<<
jpayne@68 9509 *
jpayne@68 9510 * cdef list parts = []
jpayne@68 9511 */
jpayne@68 9512 __Pyx_XDECREF(__pyx_r);
jpayne@68 9513 __Pyx_INCREF(__pyx_kp_b__13);
jpayne@68 9514 __pyx_r = __pyx_kp_b__13;
jpayne@68 9515 goto __pyx_L0;
jpayne@68 9516
jpayne@68 9517 /* "pysam/libchtslib.pyx":204
jpayne@68 9518 * raise IOError('operation on closed HFile')
jpayne@68 9519 *
jpayne@68 9520 * if size == 0: # <<<<<<<<<<<<<<
jpayne@68 9521 * return b''
jpayne@68 9522 *
jpayne@68 9523 */
jpayne@68 9524 }
jpayne@68 9525
jpayne@68 9526 /* "pysam/libchtslib.pyx":207
jpayne@68 9527 * return b''
jpayne@68 9528 *
jpayne@68 9529 * cdef list parts = [] # <<<<<<<<<<<<<<
jpayne@68 9530 * cdef bytes part
jpayne@68 9531 * cdef Py_ssize_t chunk_size, ret, bytes_read = 0
jpayne@68 9532 */
jpayne@68 9533 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
jpayne@68 9534 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9535 __pyx_v_parts = ((PyObject*)__pyx_t_2);
jpayne@68 9536 __pyx_t_2 = 0;
jpayne@68 9537
jpayne@68 9538 /* "pysam/libchtslib.pyx":209
jpayne@68 9539 * cdef list parts = []
jpayne@68 9540 * cdef bytes part
jpayne@68 9541 * cdef Py_ssize_t chunk_size, ret, bytes_read = 0 # <<<<<<<<<<<<<<
jpayne@68 9542 * cdef char *cpart
jpayne@68 9543 *
jpayne@68 9544 */
jpayne@68 9545 __pyx_v_bytes_read = 0;
jpayne@68 9546
jpayne@68 9547 /* "pysam/libchtslib.pyx":212
jpayne@68 9548 * cdef char *cpart
jpayne@68 9549 *
jpayne@68 9550 * while size == -1 or bytes_read < size: # <<<<<<<<<<<<<<
jpayne@68 9551 * chunk_size = 4096
jpayne@68 9552 * if size != -1:
jpayne@68 9553 */
jpayne@68 9554 while (1) {
jpayne@68 9555 __pyx_t_3 = (__pyx_v_size == -1L);
jpayne@68 9556 if (!__pyx_t_3) {
jpayne@68 9557 } else {
jpayne@68 9558 __pyx_t_1 = __pyx_t_3;
jpayne@68 9559 goto __pyx_L7_bool_binop_done;
jpayne@68 9560 }
jpayne@68 9561 __pyx_t_3 = (__pyx_v_bytes_read < __pyx_v_size);
jpayne@68 9562 __pyx_t_1 = __pyx_t_3;
jpayne@68 9563 __pyx_L7_bool_binop_done:;
jpayne@68 9564 if (!__pyx_t_1) break;
jpayne@68 9565
jpayne@68 9566 /* "pysam/libchtslib.pyx":213
jpayne@68 9567 *
jpayne@68 9568 * while size == -1 or bytes_read < size:
jpayne@68 9569 * chunk_size = 4096 # <<<<<<<<<<<<<<
jpayne@68 9570 * if size != -1:
jpayne@68 9571 * chunk_size = min(chunk_size, size - bytes_read)
jpayne@68 9572 */
jpayne@68 9573 __pyx_v_chunk_size = 0x1000;
jpayne@68 9574
jpayne@68 9575 /* "pysam/libchtslib.pyx":214
jpayne@68 9576 * while size == -1 or bytes_read < size:
jpayne@68 9577 * chunk_size = 4096
jpayne@68 9578 * if size != -1: # <<<<<<<<<<<<<<
jpayne@68 9579 * chunk_size = min(chunk_size, size - bytes_read)
jpayne@68 9580 *
jpayne@68 9581 */
jpayne@68 9582 __pyx_t_1 = (__pyx_v_size != -1L);
jpayne@68 9583 if (__pyx_t_1) {
jpayne@68 9584
jpayne@68 9585 /* "pysam/libchtslib.pyx":215
jpayne@68 9586 * chunk_size = 4096
jpayne@68 9587 * if size != -1:
jpayne@68 9588 * chunk_size = min(chunk_size, size - bytes_read) # <<<<<<<<<<<<<<
jpayne@68 9589 *
jpayne@68 9590 * part = PyBytes_FromStringAndSize(NULL, chunk_size)
jpayne@68 9591 */
jpayne@68 9592 __pyx_t_4 = (__pyx_v_size - __pyx_v_bytes_read);
jpayne@68 9593 __pyx_t_5 = __pyx_v_chunk_size;
jpayne@68 9594 __pyx_t_1 = (__pyx_t_4 < __pyx_t_5);
jpayne@68 9595 if (__pyx_t_1) {
jpayne@68 9596 __pyx_t_6 = __pyx_t_4;
jpayne@68 9597 } else {
jpayne@68 9598 __pyx_t_6 = __pyx_t_5;
jpayne@68 9599 }
jpayne@68 9600 __pyx_v_chunk_size = __pyx_t_6;
jpayne@68 9601
jpayne@68 9602 /* "pysam/libchtslib.pyx":214
jpayne@68 9603 * while size == -1 or bytes_read < size:
jpayne@68 9604 * chunk_size = 4096
jpayne@68 9605 * if size != -1: # <<<<<<<<<<<<<<
jpayne@68 9606 * chunk_size = min(chunk_size, size - bytes_read)
jpayne@68 9607 *
jpayne@68 9608 */
jpayne@68 9609 }
jpayne@68 9610
jpayne@68 9611 /* "pysam/libchtslib.pyx":217
jpayne@68 9612 * chunk_size = min(chunk_size, size - bytes_read)
jpayne@68 9613 *
jpayne@68 9614 * part = PyBytes_FromStringAndSize(NULL, chunk_size) # <<<<<<<<<<<<<<
jpayne@68 9615 * cpart = <char *>part
jpayne@68 9616 *
jpayne@68 9617 */
jpayne@68 9618 __pyx_t_2 = PyBytes_FromStringAndSize(NULL, __pyx_v_chunk_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
jpayne@68 9619 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9620 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
jpayne@68 9621 __pyx_t_2 = 0;
jpayne@68 9622
jpayne@68 9623 /* "pysam/libchtslib.pyx":218
jpayne@68 9624 *
jpayne@68 9625 * part = PyBytes_FromStringAndSize(NULL, chunk_size)
jpayne@68 9626 * cpart = <char *>part # <<<<<<<<<<<<<<
jpayne@68 9627 *
jpayne@68 9628 * # Python bytes objects allocate an extra byte for a null terminator
jpayne@68 9629 */
jpayne@68 9630 if (unlikely(__pyx_v_part == Py_None)) {
jpayne@68 9631 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
jpayne@68 9632 __PYX_ERR(0, 218, __pyx_L1_error)
jpayne@68 9633 }
jpayne@68 9634 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_part); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error)
jpayne@68 9635 __pyx_v_cpart = ((char *)__pyx_t_7);
jpayne@68 9636
jpayne@68 9637 /* "pysam/libchtslib.pyx":221
jpayne@68 9638 *
jpayne@68 9639 * # Python bytes objects allocate an extra byte for a null terminator
jpayne@68 9640 * ret = hgetln(cpart, chunk_size+1, self.fp) # <<<<<<<<<<<<<<
jpayne@68 9641 *
jpayne@68 9642 * if ret < 0:
jpayne@68 9643 */
jpayne@68 9644 __pyx_v_ret = hgetln(__pyx_v_cpart, (__pyx_v_chunk_size + 1), __pyx_v_self->fp);
jpayne@68 9645
jpayne@68 9646 /* "pysam/libchtslib.pyx":223
jpayne@68 9647 * ret = hgetln(cpart, chunk_size+1, self.fp)
jpayne@68 9648 *
jpayne@68 9649 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 9650 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 9651 * elif not ret:
jpayne@68 9652 */
jpayne@68 9653 __pyx_t_1 = (__pyx_v_ret < 0);
jpayne@68 9654 if (__pyx_t_1) {
jpayne@68 9655
jpayne@68 9656 /* "pysam/libchtslib.pyx":224
jpayne@68 9657 *
jpayne@68 9658 * if ret < 0:
jpayne@68 9659 * IOError(herrno(self.fp), 'failed to read HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 9660 * elif not ret:
jpayne@68 9661 * break
jpayne@68 9662 */
jpayne@68 9663 __pyx_t_2 = __Pyx_PyInt_From_int(herrno(__pyx_v_self->fp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
jpayne@68 9664 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9665 __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 224, __pyx_L1_error)
jpayne@68 9666 __Pyx_GOTREF(__pyx_t_8);
jpayne@68 9667 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 9668 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error);
jpayne@68 9669 __Pyx_INCREF(__pyx_kp_u_failed_to_read_HFile);
jpayne@68 9670 __Pyx_GIVEREF(__pyx_kp_u_failed_to_read_HFile);
jpayne@68 9671 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_kp_u_failed_to_read_HFile)) __PYX_ERR(0, 224, __pyx_L1_error);
jpayne@68 9672 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 9673 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 9674 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_self->name)) __PYX_ERR(0, 224, __pyx_L1_error);
jpayne@68 9675 __pyx_t_2 = 0;
jpayne@68 9676 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
jpayne@68 9677 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9678 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
jpayne@68 9679 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 9680
jpayne@68 9681 /* "pysam/libchtslib.pyx":223
jpayne@68 9682 * ret = hgetln(cpart, chunk_size+1, self.fp)
jpayne@68 9683 *
jpayne@68 9684 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 9685 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 9686 * elif not ret:
jpayne@68 9687 */
jpayne@68 9688 goto __pyx_L10;
jpayne@68 9689 }
jpayne@68 9690
jpayne@68 9691 /* "pysam/libchtslib.pyx":225
jpayne@68 9692 * if ret < 0:
jpayne@68 9693 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 9694 * elif not ret: # <<<<<<<<<<<<<<
jpayne@68 9695 * break
jpayne@68 9696 *
jpayne@68 9697 */
jpayne@68 9698 __pyx_t_1 = (!(__pyx_v_ret != 0));
jpayne@68 9699 if (__pyx_t_1) {
jpayne@68 9700
jpayne@68 9701 /* "pysam/libchtslib.pyx":226
jpayne@68 9702 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 9703 * elif not ret:
jpayne@68 9704 * break # <<<<<<<<<<<<<<
jpayne@68 9705 *
jpayne@68 9706 * bytes_read += ret
jpayne@68 9707 */
jpayne@68 9708 goto __pyx_L6_break;
jpayne@68 9709
jpayne@68 9710 /* "pysam/libchtslib.pyx":225
jpayne@68 9711 * if ret < 0:
jpayne@68 9712 * IOError(herrno(self.fp), 'failed to read HFile', self.name)
jpayne@68 9713 * elif not ret: # <<<<<<<<<<<<<<
jpayne@68 9714 * break
jpayne@68 9715 *
jpayne@68 9716 */
jpayne@68 9717 }
jpayne@68 9718 __pyx_L10:;
jpayne@68 9719
jpayne@68 9720 /* "pysam/libchtslib.pyx":228
jpayne@68 9721 * break
jpayne@68 9722 *
jpayne@68 9723 * bytes_read += ret # <<<<<<<<<<<<<<
jpayne@68 9724 *
jpayne@68 9725 * if ret < chunk_size:
jpayne@68 9726 */
jpayne@68 9727 __pyx_v_bytes_read = (__pyx_v_bytes_read + __pyx_v_ret);
jpayne@68 9728
jpayne@68 9729 /* "pysam/libchtslib.pyx":230
jpayne@68 9730 * bytes_read += ret
jpayne@68 9731 *
jpayne@68 9732 * if ret < chunk_size: # <<<<<<<<<<<<<<
jpayne@68 9733 * part = cpart[:ret]
jpayne@68 9734 * cpart = <char *>part
jpayne@68 9735 */
jpayne@68 9736 __pyx_t_1 = (__pyx_v_ret < __pyx_v_chunk_size);
jpayne@68 9737 if (__pyx_t_1) {
jpayne@68 9738
jpayne@68 9739 /* "pysam/libchtslib.pyx":231
jpayne@68 9740 *
jpayne@68 9741 * if ret < chunk_size:
jpayne@68 9742 * part = cpart[:ret] # <<<<<<<<<<<<<<
jpayne@68 9743 * cpart = <char *>part
jpayne@68 9744 *
jpayne@68 9745 */
jpayne@68 9746 __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cpart + 0, __pyx_v_ret - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
jpayne@68 9747 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9748 __Pyx_DECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
jpayne@68 9749 __pyx_t_2 = 0;
jpayne@68 9750
jpayne@68 9751 /* "pysam/libchtslib.pyx":232
jpayne@68 9752 * if ret < chunk_size:
jpayne@68 9753 * part = cpart[:ret]
jpayne@68 9754 * cpart = <char *>part # <<<<<<<<<<<<<<
jpayne@68 9755 *
jpayne@68 9756 * parts.append(part)
jpayne@68 9757 */
jpayne@68 9758 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_part); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
jpayne@68 9759 __pyx_v_cpart = ((char *)__pyx_t_7);
jpayne@68 9760
jpayne@68 9761 /* "pysam/libchtslib.pyx":230
jpayne@68 9762 * bytes_read += ret
jpayne@68 9763 *
jpayne@68 9764 * if ret < chunk_size: # <<<<<<<<<<<<<<
jpayne@68 9765 * part = cpart[:ret]
jpayne@68 9766 * cpart = <char *>part
jpayne@68 9767 */
jpayne@68 9768 }
jpayne@68 9769
jpayne@68 9770 /* "pysam/libchtslib.pyx":234
jpayne@68 9771 * cpart = <char *>part
jpayne@68 9772 *
jpayne@68 9773 * parts.append(part) # <<<<<<<<<<<<<<
jpayne@68 9774 *
jpayne@68 9775 * if cpart[ret-1] == b'\n':
jpayne@68 9776 */
jpayne@68 9777 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_v_part); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 234, __pyx_L1_error)
jpayne@68 9778
jpayne@68 9779 /* "pysam/libchtslib.pyx":236
jpayne@68 9780 * parts.append(part)
jpayne@68 9781 *
jpayne@68 9782 * if cpart[ret-1] == b'\n': # <<<<<<<<<<<<<<
jpayne@68 9783 * break
jpayne@68 9784 *
jpayne@68 9785 */
jpayne@68 9786 __pyx_t_1 = ((__pyx_v_cpart[(__pyx_v_ret - 1)]) == '\n');
jpayne@68 9787 if (__pyx_t_1) {
jpayne@68 9788
jpayne@68 9789 /* "pysam/libchtslib.pyx":237
jpayne@68 9790 *
jpayne@68 9791 * if cpart[ret-1] == b'\n':
jpayne@68 9792 * break # <<<<<<<<<<<<<<
jpayne@68 9793 *
jpayne@68 9794 * return b''.join(parts)
jpayne@68 9795 */
jpayne@68 9796 goto __pyx_L6_break;
jpayne@68 9797
jpayne@68 9798 /* "pysam/libchtslib.pyx":236
jpayne@68 9799 * parts.append(part)
jpayne@68 9800 *
jpayne@68 9801 * if cpart[ret-1] == b'\n': # <<<<<<<<<<<<<<
jpayne@68 9802 * break
jpayne@68 9803 *
jpayne@68 9804 */
jpayne@68 9805 }
jpayne@68 9806 }
jpayne@68 9807 __pyx_L6_break:;
jpayne@68 9808
jpayne@68 9809 /* "pysam/libchtslib.pyx":239
jpayne@68 9810 * break
jpayne@68 9811 *
jpayne@68 9812 * return b''.join(parts) # <<<<<<<<<<<<<<
jpayne@68 9813 *
jpayne@68 9814 * def readlines(self):
jpayne@68 9815 */
jpayne@68 9816 __Pyx_XDECREF(__pyx_r);
jpayne@68 9817 __pyx_t_2 = __Pyx_PyBytes_Join(__pyx_kp_b__13, __pyx_v_parts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
jpayne@68 9818 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 9819 __pyx_r = __pyx_t_2;
jpayne@68 9820 __pyx_t_2 = 0;
jpayne@68 9821 goto __pyx_L0;
jpayne@68 9822
jpayne@68 9823 /* "pysam/libchtslib.pyx":200
jpayne@68 9824 * return ret
jpayne@68 9825 *
jpayne@68 9826 * def readline(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<<
jpayne@68 9827 * if self.fp == NULL:
jpayne@68 9828 * raise IOError('operation on closed HFile')
jpayne@68 9829 */
jpayne@68 9830
jpayne@68 9831 /* function exit code */
jpayne@68 9832 __pyx_L1_error:;
jpayne@68 9833 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 9834 __Pyx_XDECREF(__pyx_t_8);
jpayne@68 9835 __Pyx_AddTraceback("pysam.libchtslib.HFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 9836 __pyx_r = NULL;
jpayne@68 9837 __pyx_L0:;
jpayne@68 9838 __Pyx_XDECREF(__pyx_v_parts);
jpayne@68 9839 __Pyx_XDECREF(__pyx_v_part);
jpayne@68 9840 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 9841 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 9842 __Pyx_RefNannyFinishContext();
jpayne@68 9843 return __pyx_r;
jpayne@68 9844 }
jpayne@68 9845
jpayne@68 9846 /* "pysam/libchtslib.pyx":241
jpayne@68 9847 * return b''.join(parts)
jpayne@68 9848 *
jpayne@68 9849 * def readlines(self): # <<<<<<<<<<<<<<
jpayne@68 9850 * return list(self)
jpayne@68 9851 *
jpayne@68 9852 */
jpayne@68 9853
jpayne@68 9854 /* Python wrapper */
jpayne@68 9855 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_31readlines(PyObject *__pyx_v_self,
jpayne@68 9856 #if CYTHON_METH_FASTCALL
jpayne@68 9857 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 9858 #else
jpayne@68 9859 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 9860 #endif
jpayne@68 9861 ); /*proto*/
jpayne@68 9862 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_30readlines, "HFile.readlines(self)");
jpayne@68 9863 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_31readlines = {"readlines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_31readlines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_30readlines};
jpayne@68 9864 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_31readlines(PyObject *__pyx_v_self,
jpayne@68 9865 #if CYTHON_METH_FASTCALL
jpayne@68 9866 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 9867 #else
jpayne@68 9868 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 9869 #endif
jpayne@68 9870 ) {
jpayne@68 9871 #if !CYTHON_METH_FASTCALL
jpayne@68 9872 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 9873 #endif
jpayne@68 9874 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 9875 PyObject *__pyx_r = 0;
jpayne@68 9876 __Pyx_RefNannyDeclarations
jpayne@68 9877 __Pyx_RefNannySetupContext("readlines (wrapper)", 0);
jpayne@68 9878 #if !CYTHON_METH_FASTCALL
jpayne@68 9879 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 9880 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 9881 #else
jpayne@68 9882 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 9883 #endif
jpayne@68 9884 #endif
jpayne@68 9885 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 9886 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 9887 __Pyx_RaiseArgtupleInvalid("readlines", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 9888 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "readlines", 0))) return NULL;
jpayne@68 9889 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_30readlines(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 9890
jpayne@68 9891 /* function exit code */
jpayne@68 9892 __Pyx_RefNannyFinishContext();
jpayne@68 9893 return __pyx_r;
jpayne@68 9894 }
jpayne@68 9895
jpayne@68 9896 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_30readlines(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 9897 PyObject *__pyx_r = NULL;
jpayne@68 9898 __Pyx_TraceDeclarations
jpayne@68 9899 __Pyx_RefNannyDeclarations
jpayne@68 9900 PyObject *__pyx_t_1 = NULL;
jpayne@68 9901 int __pyx_lineno = 0;
jpayne@68 9902 const char *__pyx_filename = NULL;
jpayne@68 9903 int __pyx_clineno = 0;
jpayne@68 9904 __Pyx_TraceFrameInit(__pyx_codeobj__17)
jpayne@68 9905 __Pyx_RefNannySetupContext("readlines", 1);
jpayne@68 9906 __Pyx_TraceCall("readlines", __pyx_f[0], 241, 0, __PYX_ERR(0, 241, __pyx_L1_error));
jpayne@68 9907
jpayne@68 9908 /* "pysam/libchtslib.pyx":242
jpayne@68 9909 *
jpayne@68 9910 * def readlines(self):
jpayne@68 9911 * return list(self) # <<<<<<<<<<<<<<
jpayne@68 9912 *
jpayne@68 9913 * def seek(self, Py_ssize_t offset, int whence=io.SEEK_SET):
jpayne@68 9914 */
jpayne@68 9915 __Pyx_XDECREF(__pyx_r);
jpayne@68 9916 __pyx_t_1 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
jpayne@68 9917 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 9918 __pyx_r = __pyx_t_1;
jpayne@68 9919 __pyx_t_1 = 0;
jpayne@68 9920 goto __pyx_L0;
jpayne@68 9921
jpayne@68 9922 /* "pysam/libchtslib.pyx":241
jpayne@68 9923 * return b''.join(parts)
jpayne@68 9924 *
jpayne@68 9925 * def readlines(self): # <<<<<<<<<<<<<<
jpayne@68 9926 * return list(self)
jpayne@68 9927 *
jpayne@68 9928 */
jpayne@68 9929
jpayne@68 9930 /* function exit code */
jpayne@68 9931 __pyx_L1_error:;
jpayne@68 9932 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 9933 __Pyx_AddTraceback("pysam.libchtslib.HFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 9934 __pyx_r = NULL;
jpayne@68 9935 __pyx_L0:;
jpayne@68 9936 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 9937 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 9938 __Pyx_RefNannyFinishContext();
jpayne@68 9939 return __pyx_r;
jpayne@68 9940 }
jpayne@68 9941
jpayne@68 9942 /* "pysam/libchtslib.pyx":244
jpayne@68 9943 * return list(self)
jpayne@68 9944 *
jpayne@68 9945 * def seek(self, Py_ssize_t offset, int whence=io.SEEK_SET): # <<<<<<<<<<<<<<
jpayne@68 9946 * if self.fp == NULL:
jpayne@68 9947 * raise IOError('operation on closed HFile')
jpayne@68 9948 */
jpayne@68 9949
jpayne@68 9950 /* Python wrapper */
jpayne@68 9951 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_33seek(PyObject *__pyx_v_self,
jpayne@68 9952 #if CYTHON_METH_FASTCALL
jpayne@68 9953 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 9954 #else
jpayne@68 9955 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 9956 #endif
jpayne@68 9957 ); /*proto*/
jpayne@68 9958 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_32seek, "HFile.seek(self, Py_ssize_t offset, int whence=io.SEEK_SET)");
jpayne@68 9959 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_33seek = {"seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_33seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_32seek};
jpayne@68 9960 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_33seek(PyObject *__pyx_v_self,
jpayne@68 9961 #if CYTHON_METH_FASTCALL
jpayne@68 9962 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 9963 #else
jpayne@68 9964 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 9965 #endif
jpayne@68 9966 ) {
jpayne@68 9967 Py_ssize_t __pyx_v_offset;
jpayne@68 9968 int __pyx_v_whence;
jpayne@68 9969 #if !CYTHON_METH_FASTCALL
jpayne@68 9970 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 9971 #endif
jpayne@68 9972 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 9973 PyObject* values[2] = {0,0};
jpayne@68 9974 int __pyx_lineno = 0;
jpayne@68 9975 const char *__pyx_filename = NULL;
jpayne@68 9976 int __pyx_clineno = 0;
jpayne@68 9977 PyObject *__pyx_r = 0;
jpayne@68 9978 __Pyx_RefNannyDeclarations
jpayne@68 9979 __Pyx_RefNannySetupContext("seek (wrapper)", 0);
jpayne@68 9980 #if !CYTHON_METH_FASTCALL
jpayne@68 9981 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 9982 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 9983 #else
jpayne@68 9984 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 9985 #endif
jpayne@68 9986 #endif
jpayne@68 9987 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 9988 {
jpayne@68 9989 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_whence,0};
jpayne@68 9990 if (__pyx_kwds) {
jpayne@68 9991 Py_ssize_t kw_args;
jpayne@68 9992 switch (__pyx_nargs) {
jpayne@68 9993 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 9994 CYTHON_FALLTHROUGH;
jpayne@68 9995 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 9996 CYTHON_FALLTHROUGH;
jpayne@68 9997 case 0: break;
jpayne@68 9998 default: goto __pyx_L5_argtuple_error;
jpayne@68 9999 }
jpayne@68 10000 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 10001 switch (__pyx_nargs) {
jpayne@68 10002 case 0:
jpayne@68 10003 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
jpayne@68 10004 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 10005 kw_args--;
jpayne@68 10006 }
jpayne@68 10007 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error)
jpayne@68 10008 else goto __pyx_L5_argtuple_error;
jpayne@68 10009 CYTHON_FALLTHROUGH;
jpayne@68 10010 case 1:
jpayne@68 10011 if (kw_args > 0) {
jpayne@68 10012 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_whence);
jpayne@68 10013 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 10014 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error)
jpayne@68 10015 }
jpayne@68 10016 }
jpayne@68 10017 if (unlikely(kw_args > 0)) {
jpayne@68 10018 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 10019 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "seek") < 0)) __PYX_ERR(0, 244, __pyx_L3_error)
jpayne@68 10020 }
jpayne@68 10021 } else {
jpayne@68 10022 switch (__pyx_nargs) {
jpayne@68 10023 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 10024 CYTHON_FALLTHROUGH;
jpayne@68 10025 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 10026 break;
jpayne@68 10027 default: goto __pyx_L5_argtuple_error;
jpayne@68 10028 }
jpayne@68 10029 }
jpayne@68 10030 __pyx_v_offset = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_offset == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error)
jpayne@68 10031 if (values[1]) {
jpayne@68 10032 __pyx_v_whence = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error)
jpayne@68 10033 } else {
jpayne@68 10034 __pyx_v_whence = __pyx_k__18;
jpayne@68 10035 }
jpayne@68 10036 }
jpayne@68 10037 goto __pyx_L6_skip;
jpayne@68 10038 __pyx_L5_argtuple_error:;
jpayne@68 10039 __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 244, __pyx_L3_error)
jpayne@68 10040 __pyx_L6_skip:;
jpayne@68 10041 goto __pyx_L4_argument_unpacking_done;
jpayne@68 10042 __pyx_L3_error:;
jpayne@68 10043 {
jpayne@68 10044 Py_ssize_t __pyx_temp;
jpayne@68 10045 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 10046 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 10047 }
jpayne@68 10048 }
jpayne@68 10049 __Pyx_AddTraceback("pysam.libchtslib.HFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10050 __Pyx_RefNannyFinishContext();
jpayne@68 10051 return NULL;
jpayne@68 10052 __pyx_L4_argument_unpacking_done:;
jpayne@68 10053 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_32seek(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_offset, __pyx_v_whence);
jpayne@68 10054
jpayne@68 10055 /* function exit code */
jpayne@68 10056 {
jpayne@68 10057 Py_ssize_t __pyx_temp;
jpayne@68 10058 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 10059 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 10060 }
jpayne@68 10061 }
jpayne@68 10062 __Pyx_RefNannyFinishContext();
jpayne@68 10063 return __pyx_r;
jpayne@68 10064 }
jpayne@68 10065
jpayne@68 10066 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_32seek(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, Py_ssize_t __pyx_v_offset, int __pyx_v_whence) {
jpayne@68 10067 Py_ssize_t __pyx_v_off;
jpayne@68 10068 PyObject *__pyx_r = NULL;
jpayne@68 10069 __Pyx_TraceDeclarations
jpayne@68 10070 __Pyx_RefNannyDeclarations
jpayne@68 10071 int __pyx_t_1;
jpayne@68 10072 PyObject *__pyx_t_2 = NULL;
jpayne@68 10073 int __pyx_t_3;
jpayne@68 10074 PyObject *__pyx_t_4 = NULL;
jpayne@68 10075 int __pyx_lineno = 0;
jpayne@68 10076 const char *__pyx_filename = NULL;
jpayne@68 10077 int __pyx_clineno = 0;
jpayne@68 10078 __Pyx_TraceFrameInit(__pyx_codeobj__19)
jpayne@68 10079 __Pyx_RefNannySetupContext("seek", 1);
jpayne@68 10080 __Pyx_TraceCall("seek", __pyx_f[0], 244, 0, __PYX_ERR(0, 244, __pyx_L1_error));
jpayne@68 10081
jpayne@68 10082 /* "pysam/libchtslib.pyx":245
jpayne@68 10083 *
jpayne@68 10084 * def seek(self, Py_ssize_t offset, int whence=io.SEEK_SET):
jpayne@68 10085 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 10086 * raise IOError('operation on closed HFile')
jpayne@68 10087 *
jpayne@68 10088 */
jpayne@68 10089 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 10090 if (unlikely(__pyx_t_1)) {
jpayne@68 10091
jpayne@68 10092 /* "pysam/libchtslib.pyx":246
jpayne@68 10093 * def seek(self, Py_ssize_t offset, int whence=io.SEEK_SET):
jpayne@68 10094 * if self.fp == NULL:
jpayne@68 10095 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 10096 *
jpayne@68 10097 * cdef Py_ssize_t off = hseek(self.fp, offset, libc_whence_from_io(whence))
jpayne@68 10098 */
jpayne@68 10099 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
jpayne@68 10100 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10101 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 10102 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 10103 __PYX_ERR(0, 246, __pyx_L1_error)
jpayne@68 10104
jpayne@68 10105 /* "pysam/libchtslib.pyx":245
jpayne@68 10106 *
jpayne@68 10107 * def seek(self, Py_ssize_t offset, int whence=io.SEEK_SET):
jpayne@68 10108 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 10109 * raise IOError('operation on closed HFile')
jpayne@68 10110 *
jpayne@68 10111 */
jpayne@68 10112 }
jpayne@68 10113
jpayne@68 10114 /* "pysam/libchtslib.pyx":248
jpayne@68 10115 * raise IOError('operation on closed HFile')
jpayne@68 10116 *
jpayne@68 10117 * cdef Py_ssize_t off = hseek(self.fp, offset, libc_whence_from_io(whence)) # <<<<<<<<<<<<<<
jpayne@68 10118 *
jpayne@68 10119 * if off < 0:
jpayne@68 10120 */
jpayne@68 10121 __pyx_t_3 = __pyx_f_5pysam_9libcutils_libc_whence_from_io(__pyx_v_whence); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L1_error)
jpayne@68 10122 __pyx_v_off = hseek(__pyx_v_self->fp, __pyx_v_offset, __pyx_t_3);
jpayne@68 10123
jpayne@68 10124 /* "pysam/libchtslib.pyx":250
jpayne@68 10125 * cdef Py_ssize_t off = hseek(self.fp, offset, libc_whence_from_io(whence))
jpayne@68 10126 *
jpayne@68 10127 * if off < 0: # <<<<<<<<<<<<<<
jpayne@68 10128 * raise IOError(herrno(self.fp), 'seek failed on HFile', self.name)
jpayne@68 10129 *
jpayne@68 10130 */
jpayne@68 10131 __pyx_t_1 = (__pyx_v_off < 0);
jpayne@68 10132 if (unlikely(__pyx_t_1)) {
jpayne@68 10133
jpayne@68 10134 /* "pysam/libchtslib.pyx":251
jpayne@68 10135 *
jpayne@68 10136 * if off < 0:
jpayne@68 10137 * raise IOError(herrno(self.fp), 'seek failed on HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 10138 *
jpayne@68 10139 * return off
jpayne@68 10140 */
jpayne@68 10141 __pyx_t_2 = __Pyx_PyInt_From_int(herrno(__pyx_v_self->fp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
jpayne@68 10142 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10143 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
jpayne@68 10144 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 10145 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 10146 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error);
jpayne@68 10147 __Pyx_INCREF(__pyx_kp_u_seek_failed_on_HFile);
jpayne@68 10148 __Pyx_GIVEREF(__pyx_kp_u_seek_failed_on_HFile);
jpayne@68 10149 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u_seek_failed_on_HFile)) __PYX_ERR(0, 251, __pyx_L1_error);
jpayne@68 10150 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 10151 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 10152 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->name)) __PYX_ERR(0, 251, __pyx_L1_error);
jpayne@68 10153 __pyx_t_2 = 0;
jpayne@68 10154 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
jpayne@68 10155 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10156 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 10157 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 10158 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 10159 __PYX_ERR(0, 251, __pyx_L1_error)
jpayne@68 10160
jpayne@68 10161 /* "pysam/libchtslib.pyx":250
jpayne@68 10162 * cdef Py_ssize_t off = hseek(self.fp, offset, libc_whence_from_io(whence))
jpayne@68 10163 *
jpayne@68 10164 * if off < 0: # <<<<<<<<<<<<<<
jpayne@68 10165 * raise IOError(herrno(self.fp), 'seek failed on HFile', self.name)
jpayne@68 10166 *
jpayne@68 10167 */
jpayne@68 10168 }
jpayne@68 10169
jpayne@68 10170 /* "pysam/libchtslib.pyx":253
jpayne@68 10171 * raise IOError(herrno(self.fp), 'seek failed on HFile', self.name)
jpayne@68 10172 *
jpayne@68 10173 * return off # <<<<<<<<<<<<<<
jpayne@68 10174 *
jpayne@68 10175 * def tell(self):
jpayne@68 10176 */
jpayne@68 10177 __Pyx_XDECREF(__pyx_r);
jpayne@68 10178 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_off); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
jpayne@68 10179 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10180 __pyx_r = __pyx_t_2;
jpayne@68 10181 __pyx_t_2 = 0;
jpayne@68 10182 goto __pyx_L0;
jpayne@68 10183
jpayne@68 10184 /* "pysam/libchtslib.pyx":244
jpayne@68 10185 * return list(self)
jpayne@68 10186 *
jpayne@68 10187 * def seek(self, Py_ssize_t offset, int whence=io.SEEK_SET): # <<<<<<<<<<<<<<
jpayne@68 10188 * if self.fp == NULL:
jpayne@68 10189 * raise IOError('operation on closed HFile')
jpayne@68 10190 */
jpayne@68 10191
jpayne@68 10192 /* function exit code */
jpayne@68 10193 __pyx_L1_error:;
jpayne@68 10194 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 10195 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 10196 __Pyx_AddTraceback("pysam.libchtslib.HFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10197 __pyx_r = NULL;
jpayne@68 10198 __pyx_L0:;
jpayne@68 10199 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 10200 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 10201 __Pyx_RefNannyFinishContext();
jpayne@68 10202 return __pyx_r;
jpayne@68 10203 }
jpayne@68 10204
jpayne@68 10205 /* "pysam/libchtslib.pyx":255
jpayne@68 10206 * return off
jpayne@68 10207 *
jpayne@68 10208 * def tell(self): # <<<<<<<<<<<<<<
jpayne@68 10209 * if self.fp == NULL:
jpayne@68 10210 * raise IOError('operation on closed HFile')
jpayne@68 10211 */
jpayne@68 10212
jpayne@68 10213 /* Python wrapper */
jpayne@68 10214 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_35tell(PyObject *__pyx_v_self,
jpayne@68 10215 #if CYTHON_METH_FASTCALL
jpayne@68 10216 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10217 #else
jpayne@68 10218 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10219 #endif
jpayne@68 10220 ); /*proto*/
jpayne@68 10221 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_34tell, "HFile.tell(self)");
jpayne@68 10222 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_35tell = {"tell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_35tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_34tell};
jpayne@68 10223 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_35tell(PyObject *__pyx_v_self,
jpayne@68 10224 #if CYTHON_METH_FASTCALL
jpayne@68 10225 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10226 #else
jpayne@68 10227 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10228 #endif
jpayne@68 10229 ) {
jpayne@68 10230 #if !CYTHON_METH_FASTCALL
jpayne@68 10231 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 10232 #endif
jpayne@68 10233 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 10234 PyObject *__pyx_r = 0;
jpayne@68 10235 __Pyx_RefNannyDeclarations
jpayne@68 10236 __Pyx_RefNannySetupContext("tell (wrapper)", 0);
jpayne@68 10237 #if !CYTHON_METH_FASTCALL
jpayne@68 10238 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 10239 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 10240 #else
jpayne@68 10241 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 10242 #endif
jpayne@68 10243 #endif
jpayne@68 10244 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 10245 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 10246 __Pyx_RaiseArgtupleInvalid("tell", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 10247 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "tell", 0))) return NULL;
jpayne@68 10248 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_34tell(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 10249
jpayne@68 10250 /* function exit code */
jpayne@68 10251 __Pyx_RefNannyFinishContext();
jpayne@68 10252 return __pyx_r;
jpayne@68 10253 }
jpayne@68 10254
jpayne@68 10255 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_34tell(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 10256 off_t __pyx_v_ret;
jpayne@68 10257 PyObject *__pyx_r = NULL;
jpayne@68 10258 __Pyx_TraceDeclarations
jpayne@68 10259 __Pyx_RefNannyDeclarations
jpayne@68 10260 int __pyx_t_1;
jpayne@68 10261 PyObject *__pyx_t_2 = NULL;
jpayne@68 10262 PyObject *__pyx_t_3 = NULL;
jpayne@68 10263 int __pyx_lineno = 0;
jpayne@68 10264 const char *__pyx_filename = NULL;
jpayne@68 10265 int __pyx_clineno = 0;
jpayne@68 10266 __Pyx_TraceFrameInit(__pyx_codeobj__20)
jpayne@68 10267 __Pyx_RefNannySetupContext("tell", 1);
jpayne@68 10268 __Pyx_TraceCall("tell", __pyx_f[0], 255, 0, __PYX_ERR(0, 255, __pyx_L1_error));
jpayne@68 10269
jpayne@68 10270 /* "pysam/libchtslib.pyx":256
jpayne@68 10271 *
jpayne@68 10272 * def tell(self):
jpayne@68 10273 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 10274 * raise IOError('operation on closed HFile')
jpayne@68 10275 *
jpayne@68 10276 */
jpayne@68 10277 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 10278 if (unlikely(__pyx_t_1)) {
jpayne@68 10279
jpayne@68 10280 /* "pysam/libchtslib.pyx":257
jpayne@68 10281 * def tell(self):
jpayne@68 10282 * if self.fp == NULL:
jpayne@68 10283 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 10284 *
jpayne@68 10285 * ret = htell(self.fp)
jpayne@68 10286 */
jpayne@68 10287 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
jpayne@68 10288 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10289 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 10290 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 10291 __PYX_ERR(0, 257, __pyx_L1_error)
jpayne@68 10292
jpayne@68 10293 /* "pysam/libchtslib.pyx":256
jpayne@68 10294 *
jpayne@68 10295 * def tell(self):
jpayne@68 10296 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 10297 * raise IOError('operation on closed HFile')
jpayne@68 10298 *
jpayne@68 10299 */
jpayne@68 10300 }
jpayne@68 10301
jpayne@68 10302 /* "pysam/libchtslib.pyx":259
jpayne@68 10303 * raise IOError('operation on closed HFile')
jpayne@68 10304 *
jpayne@68 10305 * ret = htell(self.fp) # <<<<<<<<<<<<<<
jpayne@68 10306 *
jpayne@68 10307 * if ret < 0:
jpayne@68 10308 */
jpayne@68 10309 __pyx_v_ret = htell(__pyx_v_self->fp);
jpayne@68 10310
jpayne@68 10311 /* "pysam/libchtslib.pyx":261
jpayne@68 10312 * ret = htell(self.fp)
jpayne@68 10313 *
jpayne@68 10314 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 10315 * raise IOError(herrno(self.fp), 'tell failed on HFile', self.name)
jpayne@68 10316 *
jpayne@68 10317 */
jpayne@68 10318 __pyx_t_1 = (__pyx_v_ret < 0);
jpayne@68 10319 if (unlikely(__pyx_t_1)) {
jpayne@68 10320
jpayne@68 10321 /* "pysam/libchtslib.pyx":262
jpayne@68 10322 *
jpayne@68 10323 * if ret < 0:
jpayne@68 10324 * raise IOError(herrno(self.fp), 'tell failed on HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 10325 *
jpayne@68 10326 * return ret
jpayne@68 10327 */
jpayne@68 10328 __pyx_t_2 = __Pyx_PyInt_From_int(herrno(__pyx_v_self->fp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
jpayne@68 10329 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10330 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
jpayne@68 10331 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 10332 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 10333 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error);
jpayne@68 10334 __Pyx_INCREF(__pyx_kp_u_tell_failed_on_HFile);
jpayne@68 10335 __Pyx_GIVEREF(__pyx_kp_u_tell_failed_on_HFile);
jpayne@68 10336 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_tell_failed_on_HFile)) __PYX_ERR(0, 262, __pyx_L1_error);
jpayne@68 10337 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 10338 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 10339 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->name)) __PYX_ERR(0, 262, __pyx_L1_error);
jpayne@68 10340 __pyx_t_2 = 0;
jpayne@68 10341 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
jpayne@68 10342 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10343 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 10344 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 10345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 10346 __PYX_ERR(0, 262, __pyx_L1_error)
jpayne@68 10347
jpayne@68 10348 /* "pysam/libchtslib.pyx":261
jpayne@68 10349 * ret = htell(self.fp)
jpayne@68 10350 *
jpayne@68 10351 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 10352 * raise IOError(herrno(self.fp), 'tell failed on HFile', self.name)
jpayne@68 10353 *
jpayne@68 10354 */
jpayne@68 10355 }
jpayne@68 10356
jpayne@68 10357 /* "pysam/libchtslib.pyx":264
jpayne@68 10358 * raise IOError(herrno(self.fp), 'tell failed on HFile', self.name)
jpayne@68 10359 *
jpayne@68 10360 * return ret # <<<<<<<<<<<<<<
jpayne@68 10361 *
jpayne@68 10362 * def seekable(self):
jpayne@68 10363 */
jpayne@68 10364 __Pyx_XDECREF(__pyx_r);
jpayne@68 10365 __pyx_t_2 = __Pyx_PyInt_From_off_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
jpayne@68 10366 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10367 __pyx_r = __pyx_t_2;
jpayne@68 10368 __pyx_t_2 = 0;
jpayne@68 10369 goto __pyx_L0;
jpayne@68 10370
jpayne@68 10371 /* "pysam/libchtslib.pyx":255
jpayne@68 10372 * return off
jpayne@68 10373 *
jpayne@68 10374 * def tell(self): # <<<<<<<<<<<<<<
jpayne@68 10375 * if self.fp == NULL:
jpayne@68 10376 * raise IOError('operation on closed HFile')
jpayne@68 10377 */
jpayne@68 10378
jpayne@68 10379 /* function exit code */
jpayne@68 10380 __pyx_L1_error:;
jpayne@68 10381 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 10382 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 10383 __Pyx_AddTraceback("pysam.libchtslib.HFile.tell", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10384 __pyx_r = NULL;
jpayne@68 10385 __pyx_L0:;
jpayne@68 10386 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 10387 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 10388 __Pyx_RefNannyFinishContext();
jpayne@68 10389 return __pyx_r;
jpayne@68 10390 }
jpayne@68 10391
jpayne@68 10392 /* "pysam/libchtslib.pyx":266
jpayne@68 10393 * return ret
jpayne@68 10394 *
jpayne@68 10395 * def seekable(self): # <<<<<<<<<<<<<<
jpayne@68 10396 * return self.fp != NULL
jpayne@68 10397 *
jpayne@68 10398 */
jpayne@68 10399
jpayne@68 10400 /* Python wrapper */
jpayne@68 10401 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_37seekable(PyObject *__pyx_v_self,
jpayne@68 10402 #if CYTHON_METH_FASTCALL
jpayne@68 10403 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10404 #else
jpayne@68 10405 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10406 #endif
jpayne@68 10407 ); /*proto*/
jpayne@68 10408 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_36seekable, "HFile.seekable(self)");
jpayne@68 10409 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_37seekable = {"seekable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_37seekable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_36seekable};
jpayne@68 10410 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_37seekable(PyObject *__pyx_v_self,
jpayne@68 10411 #if CYTHON_METH_FASTCALL
jpayne@68 10412 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10413 #else
jpayne@68 10414 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10415 #endif
jpayne@68 10416 ) {
jpayne@68 10417 #if !CYTHON_METH_FASTCALL
jpayne@68 10418 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 10419 #endif
jpayne@68 10420 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 10421 PyObject *__pyx_r = 0;
jpayne@68 10422 __Pyx_RefNannyDeclarations
jpayne@68 10423 __Pyx_RefNannySetupContext("seekable (wrapper)", 0);
jpayne@68 10424 #if !CYTHON_METH_FASTCALL
jpayne@68 10425 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 10426 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 10427 #else
jpayne@68 10428 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 10429 #endif
jpayne@68 10430 #endif
jpayne@68 10431 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 10432 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 10433 __Pyx_RaiseArgtupleInvalid("seekable", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 10434 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "seekable", 0))) return NULL;
jpayne@68 10435 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_36seekable(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 10436
jpayne@68 10437 /* function exit code */
jpayne@68 10438 __Pyx_RefNannyFinishContext();
jpayne@68 10439 return __pyx_r;
jpayne@68 10440 }
jpayne@68 10441
jpayne@68 10442 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_36seekable(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 10443 PyObject *__pyx_r = NULL;
jpayne@68 10444 __Pyx_TraceDeclarations
jpayne@68 10445 __Pyx_RefNannyDeclarations
jpayne@68 10446 PyObject *__pyx_t_1 = NULL;
jpayne@68 10447 int __pyx_lineno = 0;
jpayne@68 10448 const char *__pyx_filename = NULL;
jpayne@68 10449 int __pyx_clineno = 0;
jpayne@68 10450 __Pyx_TraceFrameInit(__pyx_codeobj__21)
jpayne@68 10451 __Pyx_RefNannySetupContext("seekable", 1);
jpayne@68 10452 __Pyx_TraceCall("seekable", __pyx_f[0], 266, 0, __PYX_ERR(0, 266, __pyx_L1_error));
jpayne@68 10453
jpayne@68 10454 /* "pysam/libchtslib.pyx":267
jpayne@68 10455 *
jpayne@68 10456 * def seekable(self):
jpayne@68 10457 * return self.fp != NULL # <<<<<<<<<<<<<<
jpayne@68 10458 *
jpayne@68 10459 * def truncate(self, size=None):
jpayne@68 10460 */
jpayne@68 10461 __Pyx_XDECREF(__pyx_r);
jpayne@68 10462 __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->fp != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
jpayne@68 10463 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 10464 __pyx_r = __pyx_t_1;
jpayne@68 10465 __pyx_t_1 = 0;
jpayne@68 10466 goto __pyx_L0;
jpayne@68 10467
jpayne@68 10468 /* "pysam/libchtslib.pyx":266
jpayne@68 10469 * return ret
jpayne@68 10470 *
jpayne@68 10471 * def seekable(self): # <<<<<<<<<<<<<<
jpayne@68 10472 * return self.fp != NULL
jpayne@68 10473 *
jpayne@68 10474 */
jpayne@68 10475
jpayne@68 10476 /* function exit code */
jpayne@68 10477 __pyx_L1_error:;
jpayne@68 10478 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 10479 __Pyx_AddTraceback("pysam.libchtslib.HFile.seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10480 __pyx_r = NULL;
jpayne@68 10481 __pyx_L0:;
jpayne@68 10482 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 10483 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 10484 __Pyx_RefNannyFinishContext();
jpayne@68 10485 return __pyx_r;
jpayne@68 10486 }
jpayne@68 10487
jpayne@68 10488 /* "pysam/libchtslib.pyx":269
jpayne@68 10489 * return self.fp != NULL
jpayne@68 10490 *
jpayne@68 10491 * def truncate(self, size=None): # <<<<<<<<<<<<<<
jpayne@68 10492 * raise NotImplementedError()
jpayne@68 10493 *
jpayne@68 10494 */
jpayne@68 10495
jpayne@68 10496 /* Python wrapper */
jpayne@68 10497 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_39truncate(PyObject *__pyx_v_self,
jpayne@68 10498 #if CYTHON_METH_FASTCALL
jpayne@68 10499 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10500 #else
jpayne@68 10501 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10502 #endif
jpayne@68 10503 ); /*proto*/
jpayne@68 10504 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_38truncate, "HFile.truncate(self, size=None)");
jpayne@68 10505 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_39truncate = {"truncate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_39truncate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_38truncate};
jpayne@68 10506 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_39truncate(PyObject *__pyx_v_self,
jpayne@68 10507 #if CYTHON_METH_FASTCALL
jpayne@68 10508 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10509 #else
jpayne@68 10510 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10511 #endif
jpayne@68 10512 ) {
jpayne@68 10513 CYTHON_UNUSED PyObject *__pyx_v_size = 0;
jpayne@68 10514 #if !CYTHON_METH_FASTCALL
jpayne@68 10515 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 10516 #endif
jpayne@68 10517 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 10518 PyObject* values[1] = {0};
jpayne@68 10519 int __pyx_lineno = 0;
jpayne@68 10520 const char *__pyx_filename = NULL;
jpayne@68 10521 int __pyx_clineno = 0;
jpayne@68 10522 PyObject *__pyx_r = 0;
jpayne@68 10523 __Pyx_RefNannyDeclarations
jpayne@68 10524 __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
jpayne@68 10525 #if !CYTHON_METH_FASTCALL
jpayne@68 10526 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 10527 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 10528 #else
jpayne@68 10529 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 10530 #endif
jpayne@68 10531 #endif
jpayne@68 10532 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 10533 {
jpayne@68 10534 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
jpayne@68 10535 values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 10536 if (__pyx_kwds) {
jpayne@68 10537 Py_ssize_t kw_args;
jpayne@68 10538 switch (__pyx_nargs) {
jpayne@68 10539 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 10540 CYTHON_FALLTHROUGH;
jpayne@68 10541 case 0: break;
jpayne@68 10542 default: goto __pyx_L5_argtuple_error;
jpayne@68 10543 }
jpayne@68 10544 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 10545 switch (__pyx_nargs) {
jpayne@68 10546 case 0:
jpayne@68 10547 if (kw_args > 0) {
jpayne@68 10548 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
jpayne@68 10549 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 10550 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L3_error)
jpayne@68 10551 }
jpayne@68 10552 }
jpayne@68 10553 if (unlikely(kw_args > 0)) {
jpayne@68 10554 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 10555 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "truncate") < 0)) __PYX_ERR(0, 269, __pyx_L3_error)
jpayne@68 10556 }
jpayne@68 10557 } else {
jpayne@68 10558 switch (__pyx_nargs) {
jpayne@68 10559 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 10560 CYTHON_FALLTHROUGH;
jpayne@68 10561 case 0: break;
jpayne@68 10562 default: goto __pyx_L5_argtuple_error;
jpayne@68 10563 }
jpayne@68 10564 }
jpayne@68 10565 __pyx_v_size = values[0];
jpayne@68 10566 }
jpayne@68 10567 goto __pyx_L6_skip;
jpayne@68 10568 __pyx_L5_argtuple_error:;
jpayne@68 10569 __Pyx_RaiseArgtupleInvalid("truncate", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 269, __pyx_L3_error)
jpayne@68 10570 __pyx_L6_skip:;
jpayne@68 10571 goto __pyx_L4_argument_unpacking_done;
jpayne@68 10572 __pyx_L3_error:;
jpayne@68 10573 {
jpayne@68 10574 Py_ssize_t __pyx_temp;
jpayne@68 10575 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 10576 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 10577 }
jpayne@68 10578 }
jpayne@68 10579 __Pyx_AddTraceback("pysam.libchtslib.HFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10580 __Pyx_RefNannyFinishContext();
jpayne@68 10581 return NULL;
jpayne@68 10582 __pyx_L4_argument_unpacking_done:;
jpayne@68 10583 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_38truncate(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_size);
jpayne@68 10584
jpayne@68 10585 /* function exit code */
jpayne@68 10586 {
jpayne@68 10587 Py_ssize_t __pyx_temp;
jpayne@68 10588 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 10589 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 10590 }
jpayne@68 10591 }
jpayne@68 10592 __Pyx_RefNannyFinishContext();
jpayne@68 10593 return __pyx_r;
jpayne@68 10594 }
jpayne@68 10595
jpayne@68 10596 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_38truncate(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) {
jpayne@68 10597 PyObject *__pyx_r = NULL;
jpayne@68 10598 __Pyx_TraceDeclarations
jpayne@68 10599 __Pyx_RefNannyDeclarations
jpayne@68 10600 PyObject *__pyx_t_1 = NULL;
jpayne@68 10601 int __pyx_lineno = 0;
jpayne@68 10602 const char *__pyx_filename = NULL;
jpayne@68 10603 int __pyx_clineno = 0;
jpayne@68 10604 __Pyx_TraceFrameInit(__pyx_codeobj__22)
jpayne@68 10605 __Pyx_RefNannySetupContext("truncate", 1);
jpayne@68 10606 __Pyx_TraceCall("truncate", __pyx_f[0], 269, 0, __PYX_ERR(0, 269, __pyx_L1_error));
jpayne@68 10607
jpayne@68 10608 /* "pysam/libchtslib.pyx":270
jpayne@68 10609 *
jpayne@68 10610 * def truncate(self, size=None):
jpayne@68 10611 * raise NotImplementedError() # <<<<<<<<<<<<<<
jpayne@68 10612 *
jpayne@68 10613 * def writable(self):
jpayne@68 10614 */
jpayne@68 10615 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
jpayne@68 10616 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 10617 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 10618 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 10619 __PYX_ERR(0, 270, __pyx_L1_error)
jpayne@68 10620
jpayne@68 10621 /* "pysam/libchtslib.pyx":269
jpayne@68 10622 * return self.fp != NULL
jpayne@68 10623 *
jpayne@68 10624 * def truncate(self, size=None): # <<<<<<<<<<<<<<
jpayne@68 10625 * raise NotImplementedError()
jpayne@68 10626 *
jpayne@68 10627 */
jpayne@68 10628
jpayne@68 10629 /* function exit code */
jpayne@68 10630 __pyx_L1_error:;
jpayne@68 10631 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 10632 __Pyx_AddTraceback("pysam.libchtslib.HFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10633 __pyx_r = NULL;
jpayne@68 10634 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 10635 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 10636 __Pyx_RefNannyFinishContext();
jpayne@68 10637 return __pyx_r;
jpayne@68 10638 }
jpayne@68 10639
jpayne@68 10640 /* "pysam/libchtslib.pyx":272
jpayne@68 10641 * raise NotImplementedError()
jpayne@68 10642 *
jpayne@68 10643 * def writable(self): # <<<<<<<<<<<<<<
jpayne@68 10644 * return self.fp != NULL and 'w' in self.mode
jpayne@68 10645 *
jpayne@68 10646 */
jpayne@68 10647
jpayne@68 10648 /* Python wrapper */
jpayne@68 10649 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_41writable(PyObject *__pyx_v_self,
jpayne@68 10650 #if CYTHON_METH_FASTCALL
jpayne@68 10651 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10652 #else
jpayne@68 10653 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10654 #endif
jpayne@68 10655 ); /*proto*/
jpayne@68 10656 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_40writable, "HFile.writable(self)");
jpayne@68 10657 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_41writable = {"writable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_41writable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_40writable};
jpayne@68 10658 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_41writable(PyObject *__pyx_v_self,
jpayne@68 10659 #if CYTHON_METH_FASTCALL
jpayne@68 10660 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10661 #else
jpayne@68 10662 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10663 #endif
jpayne@68 10664 ) {
jpayne@68 10665 #if !CYTHON_METH_FASTCALL
jpayne@68 10666 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 10667 #endif
jpayne@68 10668 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 10669 PyObject *__pyx_r = 0;
jpayne@68 10670 __Pyx_RefNannyDeclarations
jpayne@68 10671 __Pyx_RefNannySetupContext("writable (wrapper)", 0);
jpayne@68 10672 #if !CYTHON_METH_FASTCALL
jpayne@68 10673 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 10674 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 10675 #else
jpayne@68 10676 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 10677 #endif
jpayne@68 10678 #endif
jpayne@68 10679 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 10680 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 10681 __Pyx_RaiseArgtupleInvalid("writable", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 10682 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "writable", 0))) return NULL;
jpayne@68 10683 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_40writable(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 10684
jpayne@68 10685 /* function exit code */
jpayne@68 10686 __Pyx_RefNannyFinishContext();
jpayne@68 10687 return __pyx_r;
jpayne@68 10688 }
jpayne@68 10689
jpayne@68 10690 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_40writable(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 10691 PyObject *__pyx_r = NULL;
jpayne@68 10692 __Pyx_TraceDeclarations
jpayne@68 10693 __Pyx_RefNannyDeclarations
jpayne@68 10694 PyObject *__pyx_t_1 = NULL;
jpayne@68 10695 int __pyx_t_2;
jpayne@68 10696 PyObject *__pyx_t_3 = NULL;
jpayne@68 10697 int __pyx_lineno = 0;
jpayne@68 10698 const char *__pyx_filename = NULL;
jpayne@68 10699 int __pyx_clineno = 0;
jpayne@68 10700 __Pyx_TraceFrameInit(__pyx_codeobj__23)
jpayne@68 10701 __Pyx_RefNannySetupContext("writable", 1);
jpayne@68 10702 __Pyx_TraceCall("writable", __pyx_f[0], 272, 0, __PYX_ERR(0, 272, __pyx_L1_error));
jpayne@68 10703
jpayne@68 10704 /* "pysam/libchtslib.pyx":273
jpayne@68 10705 *
jpayne@68 10706 * def writable(self):
jpayne@68 10707 * return self.fp != NULL and 'w' in self.mode # <<<<<<<<<<<<<<
jpayne@68 10708 *
jpayne@68 10709 * def write(self, bytes b):
jpayne@68 10710 */
jpayne@68 10711 __Pyx_XDECREF(__pyx_r);
jpayne@68 10712 __pyx_t_2 = (__pyx_v_self->fp != NULL);
jpayne@68 10713 if (__pyx_t_2) {
jpayne@68 10714 } else {
jpayne@68 10715 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
jpayne@68 10716 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 10717 __pyx_t_1 = __pyx_t_3;
jpayne@68 10718 __pyx_t_3 = 0;
jpayne@68 10719 goto __pyx_L3_bool_binop_done;
jpayne@68 10720 }
jpayne@68 10721 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_w, __pyx_v_self->mode, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 273, __pyx_L1_error)
jpayne@68 10722 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
jpayne@68 10723 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 10724 __pyx_t_1 = __pyx_t_3;
jpayne@68 10725 __pyx_t_3 = 0;
jpayne@68 10726 __pyx_L3_bool_binop_done:;
jpayne@68 10727 __pyx_r = __pyx_t_1;
jpayne@68 10728 __pyx_t_1 = 0;
jpayne@68 10729 goto __pyx_L0;
jpayne@68 10730
jpayne@68 10731 /* "pysam/libchtslib.pyx":272
jpayne@68 10732 * raise NotImplementedError()
jpayne@68 10733 *
jpayne@68 10734 * def writable(self): # <<<<<<<<<<<<<<
jpayne@68 10735 * return self.fp != NULL and 'w' in self.mode
jpayne@68 10736 *
jpayne@68 10737 */
jpayne@68 10738
jpayne@68 10739 /* function exit code */
jpayne@68 10740 __pyx_L1_error:;
jpayne@68 10741 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 10742 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 10743 __Pyx_AddTraceback("pysam.libchtslib.HFile.writable", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10744 __pyx_r = NULL;
jpayne@68 10745 __pyx_L0:;
jpayne@68 10746 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 10747 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 10748 __Pyx_RefNannyFinishContext();
jpayne@68 10749 return __pyx_r;
jpayne@68 10750 }
jpayne@68 10751
jpayne@68 10752 /* "pysam/libchtslib.pyx":275
jpayne@68 10753 * return self.fp != NULL and 'w' in self.mode
jpayne@68 10754 *
jpayne@68 10755 * def write(self, bytes b): # <<<<<<<<<<<<<<
jpayne@68 10756 * if self.fp == NULL:
jpayne@68 10757 * raise IOError('operation on closed HFile')
jpayne@68 10758 */
jpayne@68 10759
jpayne@68 10760 /* Python wrapper */
jpayne@68 10761 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_43write(PyObject *__pyx_v_self,
jpayne@68 10762 #if CYTHON_METH_FASTCALL
jpayne@68 10763 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10764 #else
jpayne@68 10765 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10766 #endif
jpayne@68 10767 ); /*proto*/
jpayne@68 10768 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_42write, "HFile.write(self, bytes b)");
jpayne@68 10769 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_43write = {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_43write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_42write};
jpayne@68 10770 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_43write(PyObject *__pyx_v_self,
jpayne@68 10771 #if CYTHON_METH_FASTCALL
jpayne@68 10772 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 10773 #else
jpayne@68 10774 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 10775 #endif
jpayne@68 10776 ) {
jpayne@68 10777 PyObject *__pyx_v_b = 0;
jpayne@68 10778 #if !CYTHON_METH_FASTCALL
jpayne@68 10779 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 10780 #endif
jpayne@68 10781 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 10782 PyObject* values[1] = {0};
jpayne@68 10783 int __pyx_lineno = 0;
jpayne@68 10784 const char *__pyx_filename = NULL;
jpayne@68 10785 int __pyx_clineno = 0;
jpayne@68 10786 PyObject *__pyx_r = 0;
jpayne@68 10787 __Pyx_RefNannyDeclarations
jpayne@68 10788 __Pyx_RefNannySetupContext("write (wrapper)", 0);
jpayne@68 10789 #if !CYTHON_METH_FASTCALL
jpayne@68 10790 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 10791 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 10792 #else
jpayne@68 10793 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 10794 #endif
jpayne@68 10795 #endif
jpayne@68 10796 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 10797 {
jpayne@68 10798 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,0};
jpayne@68 10799 if (__pyx_kwds) {
jpayne@68 10800 Py_ssize_t kw_args;
jpayne@68 10801 switch (__pyx_nargs) {
jpayne@68 10802 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 10803 CYTHON_FALLTHROUGH;
jpayne@68 10804 case 0: break;
jpayne@68 10805 default: goto __pyx_L5_argtuple_error;
jpayne@68 10806 }
jpayne@68 10807 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 10808 switch (__pyx_nargs) {
jpayne@68 10809 case 0:
jpayne@68 10810 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) {
jpayne@68 10811 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 10812 kw_args--;
jpayne@68 10813 }
jpayne@68 10814 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
jpayne@68 10815 else goto __pyx_L5_argtuple_error;
jpayne@68 10816 }
jpayne@68 10817 if (unlikely(kw_args > 0)) {
jpayne@68 10818 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 10819 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write") < 0)) __PYX_ERR(0, 275, __pyx_L3_error)
jpayne@68 10820 }
jpayne@68 10821 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 10822 goto __pyx_L5_argtuple_error;
jpayne@68 10823 } else {
jpayne@68 10824 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 10825 }
jpayne@68 10826 __pyx_v_b = ((PyObject*)values[0]);
jpayne@68 10827 }
jpayne@68 10828 goto __pyx_L6_skip;
jpayne@68 10829 __pyx_L5_argtuple_error:;
jpayne@68 10830 __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 275, __pyx_L3_error)
jpayne@68 10831 __pyx_L6_skip:;
jpayne@68 10832 goto __pyx_L4_argument_unpacking_done;
jpayne@68 10833 __pyx_L3_error:;
jpayne@68 10834 {
jpayne@68 10835 Py_ssize_t __pyx_temp;
jpayne@68 10836 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 10837 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 10838 }
jpayne@68 10839 }
jpayne@68 10840 __Pyx_AddTraceback("pysam.libchtslib.HFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10841 __Pyx_RefNannyFinishContext();
jpayne@68 10842 return NULL;
jpayne@68 10843 __pyx_L4_argument_unpacking_done:;
jpayne@68 10844 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), (&PyBytes_Type), 1, "b", 1))) __PYX_ERR(0, 275, __pyx_L1_error)
jpayne@68 10845 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_42write(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_b);
jpayne@68 10846
jpayne@68 10847 /* function exit code */
jpayne@68 10848 goto __pyx_L0;
jpayne@68 10849 __pyx_L1_error:;
jpayne@68 10850 __pyx_r = NULL;
jpayne@68 10851 __pyx_L0:;
jpayne@68 10852 {
jpayne@68 10853 Py_ssize_t __pyx_temp;
jpayne@68 10854 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 10855 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 10856 }
jpayne@68 10857 }
jpayne@68 10858 __Pyx_RefNannyFinishContext();
jpayne@68 10859 return __pyx_r;
jpayne@68 10860 }
jpayne@68 10861
jpayne@68 10862 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_42write(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_b) {
jpayne@68 10863 Py_ssize_t __pyx_v_got;
jpayne@68 10864 PyObject *__pyx_r = NULL;
jpayne@68 10865 __Pyx_TraceDeclarations
jpayne@68 10866 __Pyx_RefNannyDeclarations
jpayne@68 10867 int __pyx_t_1;
jpayne@68 10868 PyObject *__pyx_t_2 = NULL;
jpayne@68 10869 Py_ssize_t __pyx_t_3;
jpayne@68 10870 PyObject *__pyx_t_4 = NULL;
jpayne@68 10871 int __pyx_lineno = 0;
jpayne@68 10872 const char *__pyx_filename = NULL;
jpayne@68 10873 int __pyx_clineno = 0;
jpayne@68 10874 __Pyx_TraceFrameInit(__pyx_codeobj__24)
jpayne@68 10875 __Pyx_RefNannySetupContext("write", 1);
jpayne@68 10876 __Pyx_TraceCall("write", __pyx_f[0], 275, 0, __PYX_ERR(0, 275, __pyx_L1_error));
jpayne@68 10877
jpayne@68 10878 /* "pysam/libchtslib.pyx":276
jpayne@68 10879 *
jpayne@68 10880 * def write(self, bytes b):
jpayne@68 10881 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 10882 * raise IOError('operation on closed HFile')
jpayne@68 10883 *
jpayne@68 10884 */
jpayne@68 10885 __pyx_t_1 = (__pyx_v_self->fp == NULL);
jpayne@68 10886 if (unlikely(__pyx_t_1)) {
jpayne@68 10887
jpayne@68 10888 /* "pysam/libchtslib.pyx":277
jpayne@68 10889 * def write(self, bytes b):
jpayne@68 10890 * if self.fp == NULL:
jpayne@68 10891 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 10892 *
jpayne@68 10893 * got = hwrite(self.fp, <void *>b, len(b))
jpayne@68 10894 */
jpayne@68 10895 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
jpayne@68 10896 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10897 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 10898 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 10899 __PYX_ERR(0, 277, __pyx_L1_error)
jpayne@68 10900
jpayne@68 10901 /* "pysam/libchtslib.pyx":276
jpayne@68 10902 *
jpayne@68 10903 * def write(self, bytes b):
jpayne@68 10904 * if self.fp == NULL: # <<<<<<<<<<<<<<
jpayne@68 10905 * raise IOError('operation on closed HFile')
jpayne@68 10906 *
jpayne@68 10907 */
jpayne@68 10908 }
jpayne@68 10909
jpayne@68 10910 /* "pysam/libchtslib.pyx":279
jpayne@68 10911 * raise IOError('operation on closed HFile')
jpayne@68 10912 *
jpayne@68 10913 * got = hwrite(self.fp, <void *>b, len(b)) # <<<<<<<<<<<<<<
jpayne@68 10914 *
jpayne@68 10915 * if got < 0:
jpayne@68 10916 */
jpayne@68 10917 if (unlikely(__pyx_v_b == Py_None)) {
jpayne@68 10918 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
jpayne@68 10919 __PYX_ERR(0, 279, __pyx_L1_error)
jpayne@68 10920 }
jpayne@68 10921 __pyx_t_3 = __Pyx_PyBytes_GET_SIZE(__pyx_v_b); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 279, __pyx_L1_error)
jpayne@68 10922 __pyx_v_got = hwrite(__pyx_v_self->fp, ((void *)__pyx_v_b), __pyx_t_3);
jpayne@68 10923
jpayne@68 10924 /* "pysam/libchtslib.pyx":281
jpayne@68 10925 * got = hwrite(self.fp, <void *>b, len(b))
jpayne@68 10926 *
jpayne@68 10927 * if got < 0: # <<<<<<<<<<<<<<
jpayne@68 10928 * raise IOError(herrno(self.fp), 'write failed on HFile', self.name)
jpayne@68 10929 *
jpayne@68 10930 */
jpayne@68 10931 __pyx_t_1 = (__pyx_v_got < 0);
jpayne@68 10932 if (unlikely(__pyx_t_1)) {
jpayne@68 10933
jpayne@68 10934 /* "pysam/libchtslib.pyx":282
jpayne@68 10935 *
jpayne@68 10936 * if got < 0:
jpayne@68 10937 * raise IOError(herrno(self.fp), 'write failed on HFile', self.name) # <<<<<<<<<<<<<<
jpayne@68 10938 *
jpayne@68 10939 * return got
jpayne@68 10940 */
jpayne@68 10941 __pyx_t_2 = __Pyx_PyInt_From_int(herrno(__pyx_v_self->fp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
jpayne@68 10942 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10943 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
jpayne@68 10944 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 10945 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 10946 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error);
jpayne@68 10947 __Pyx_INCREF(__pyx_kp_u_write_failed_on_HFile);
jpayne@68 10948 __Pyx_GIVEREF(__pyx_kp_u_write_failed_on_HFile);
jpayne@68 10949 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u_write_failed_on_HFile)) __PYX_ERR(0, 282, __pyx_L1_error);
jpayne@68 10950 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 10951 __Pyx_GIVEREF(__pyx_v_self->name);
jpayne@68 10952 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->name)) __PYX_ERR(0, 282, __pyx_L1_error);
jpayne@68 10953 __pyx_t_2 = 0;
jpayne@68 10954 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
jpayne@68 10955 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10956 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 10957 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 10958 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 10959 __PYX_ERR(0, 282, __pyx_L1_error)
jpayne@68 10960
jpayne@68 10961 /* "pysam/libchtslib.pyx":281
jpayne@68 10962 * got = hwrite(self.fp, <void *>b, len(b))
jpayne@68 10963 *
jpayne@68 10964 * if got < 0: # <<<<<<<<<<<<<<
jpayne@68 10965 * raise IOError(herrno(self.fp), 'write failed on HFile', self.name)
jpayne@68 10966 *
jpayne@68 10967 */
jpayne@68 10968 }
jpayne@68 10969
jpayne@68 10970 /* "pysam/libchtslib.pyx":284
jpayne@68 10971 * raise IOError(herrno(self.fp), 'write failed on HFile', self.name)
jpayne@68 10972 *
jpayne@68 10973 * return got # <<<<<<<<<<<<<<
jpayne@68 10974 *
jpayne@68 10975 * def writelines(self, lines):
jpayne@68 10976 */
jpayne@68 10977 __Pyx_XDECREF(__pyx_r);
jpayne@68 10978 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_got); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
jpayne@68 10979 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 10980 __pyx_r = __pyx_t_2;
jpayne@68 10981 __pyx_t_2 = 0;
jpayne@68 10982 goto __pyx_L0;
jpayne@68 10983
jpayne@68 10984 /* "pysam/libchtslib.pyx":275
jpayne@68 10985 * return self.fp != NULL and 'w' in self.mode
jpayne@68 10986 *
jpayne@68 10987 * def write(self, bytes b): # <<<<<<<<<<<<<<
jpayne@68 10988 * if self.fp == NULL:
jpayne@68 10989 * raise IOError('operation on closed HFile')
jpayne@68 10990 */
jpayne@68 10991
jpayne@68 10992 /* function exit code */
jpayne@68 10993 __pyx_L1_error:;
jpayne@68 10994 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 10995 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 10996 __Pyx_AddTraceback("pysam.libchtslib.HFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 10997 __pyx_r = NULL;
jpayne@68 10998 __pyx_L0:;
jpayne@68 10999 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 11000 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 11001 __Pyx_RefNannyFinishContext();
jpayne@68 11002 return __pyx_r;
jpayne@68 11003 }
jpayne@68 11004
jpayne@68 11005 /* "pysam/libchtslib.pyx":286
jpayne@68 11006 * return got
jpayne@68 11007 *
jpayne@68 11008 * def writelines(self, lines): # <<<<<<<<<<<<<<
jpayne@68 11009 * for line in lines:
jpayne@68 11010 * self.write(line)
jpayne@68 11011 */
jpayne@68 11012
jpayne@68 11013 /* Python wrapper */
jpayne@68 11014 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_45writelines(PyObject *__pyx_v_self,
jpayne@68 11015 #if CYTHON_METH_FASTCALL
jpayne@68 11016 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11017 #else
jpayne@68 11018 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11019 #endif
jpayne@68 11020 ); /*proto*/
jpayne@68 11021 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_44writelines, "HFile.writelines(self, lines)");
jpayne@68 11022 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_45writelines = {"writelines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_45writelines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_44writelines};
jpayne@68 11023 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_45writelines(PyObject *__pyx_v_self,
jpayne@68 11024 #if CYTHON_METH_FASTCALL
jpayne@68 11025 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11026 #else
jpayne@68 11027 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11028 #endif
jpayne@68 11029 ) {
jpayne@68 11030 PyObject *__pyx_v_lines = 0;
jpayne@68 11031 #if !CYTHON_METH_FASTCALL
jpayne@68 11032 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 11033 #endif
jpayne@68 11034 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 11035 PyObject* values[1] = {0};
jpayne@68 11036 int __pyx_lineno = 0;
jpayne@68 11037 const char *__pyx_filename = NULL;
jpayne@68 11038 int __pyx_clineno = 0;
jpayne@68 11039 PyObject *__pyx_r = 0;
jpayne@68 11040 __Pyx_RefNannyDeclarations
jpayne@68 11041 __Pyx_RefNannySetupContext("writelines (wrapper)", 0);
jpayne@68 11042 #if !CYTHON_METH_FASTCALL
jpayne@68 11043 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 11044 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 11045 #else
jpayne@68 11046 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 11047 #endif
jpayne@68 11048 #endif
jpayne@68 11049 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 11050 {
jpayne@68 11051 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lines,0};
jpayne@68 11052 if (__pyx_kwds) {
jpayne@68 11053 Py_ssize_t kw_args;
jpayne@68 11054 switch (__pyx_nargs) {
jpayne@68 11055 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11056 CYTHON_FALLTHROUGH;
jpayne@68 11057 case 0: break;
jpayne@68 11058 default: goto __pyx_L5_argtuple_error;
jpayne@68 11059 }
jpayne@68 11060 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 11061 switch (__pyx_nargs) {
jpayne@68 11062 case 0:
jpayne@68 11063 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lines)) != 0)) {
jpayne@68 11064 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 11065 kw_args--;
jpayne@68 11066 }
jpayne@68 11067 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L3_error)
jpayne@68 11068 else goto __pyx_L5_argtuple_error;
jpayne@68 11069 }
jpayne@68 11070 if (unlikely(kw_args > 0)) {
jpayne@68 11071 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 11072 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "writelines") < 0)) __PYX_ERR(0, 286, __pyx_L3_error)
jpayne@68 11073 }
jpayne@68 11074 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 11075 goto __pyx_L5_argtuple_error;
jpayne@68 11076 } else {
jpayne@68 11077 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11078 }
jpayne@68 11079 __pyx_v_lines = values[0];
jpayne@68 11080 }
jpayne@68 11081 goto __pyx_L6_skip;
jpayne@68 11082 __pyx_L5_argtuple_error:;
jpayne@68 11083 __Pyx_RaiseArgtupleInvalid("writelines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 286, __pyx_L3_error)
jpayne@68 11084 __pyx_L6_skip:;
jpayne@68 11085 goto __pyx_L4_argument_unpacking_done;
jpayne@68 11086 __pyx_L3_error:;
jpayne@68 11087 {
jpayne@68 11088 Py_ssize_t __pyx_temp;
jpayne@68 11089 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11090 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11091 }
jpayne@68 11092 }
jpayne@68 11093 __Pyx_AddTraceback("pysam.libchtslib.HFile.writelines", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11094 __Pyx_RefNannyFinishContext();
jpayne@68 11095 return NULL;
jpayne@68 11096 __pyx_L4_argument_unpacking_done:;
jpayne@68 11097 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_44writelines(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v_lines);
jpayne@68 11098
jpayne@68 11099 /* function exit code */
jpayne@68 11100 {
jpayne@68 11101 Py_ssize_t __pyx_temp;
jpayne@68 11102 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11103 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11104 }
jpayne@68 11105 }
jpayne@68 11106 __Pyx_RefNannyFinishContext();
jpayne@68 11107 return __pyx_r;
jpayne@68 11108 }
jpayne@68 11109
jpayne@68 11110 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_44writelines(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, PyObject *__pyx_v_lines) {
jpayne@68 11111 PyObject *__pyx_v_line = NULL;
jpayne@68 11112 PyObject *__pyx_r = NULL;
jpayne@68 11113 __Pyx_TraceDeclarations
jpayne@68 11114 __Pyx_RefNannyDeclarations
jpayne@68 11115 PyObject *__pyx_t_1 = NULL;
jpayne@68 11116 Py_ssize_t __pyx_t_2;
jpayne@68 11117 PyObject *(*__pyx_t_3)(PyObject *);
jpayne@68 11118 PyObject *__pyx_t_4 = NULL;
jpayne@68 11119 PyObject *__pyx_t_5 = NULL;
jpayne@68 11120 PyObject *__pyx_t_6 = NULL;
jpayne@68 11121 unsigned int __pyx_t_7;
jpayne@68 11122 int __pyx_lineno = 0;
jpayne@68 11123 const char *__pyx_filename = NULL;
jpayne@68 11124 int __pyx_clineno = 0;
jpayne@68 11125 __Pyx_TraceFrameInit(__pyx_codeobj__25)
jpayne@68 11126 __Pyx_RefNannySetupContext("writelines", 1);
jpayne@68 11127 __Pyx_TraceCall("writelines", __pyx_f[0], 286, 0, __PYX_ERR(0, 286, __pyx_L1_error));
jpayne@68 11128
jpayne@68 11129 /* "pysam/libchtslib.pyx":287
jpayne@68 11130 *
jpayne@68 11131 * def writelines(self, lines):
jpayne@68 11132 * for line in lines: # <<<<<<<<<<<<<<
jpayne@68 11133 * self.write(line)
jpayne@68 11134 *
jpayne@68 11135 */
jpayne@68 11136 if (likely(PyList_CheckExact(__pyx_v_lines)) || PyTuple_CheckExact(__pyx_v_lines)) {
jpayne@68 11137 __pyx_t_1 = __pyx_v_lines; __Pyx_INCREF(__pyx_t_1);
jpayne@68 11138 __pyx_t_2 = 0;
jpayne@68 11139 __pyx_t_3 = NULL;
jpayne@68 11140 } else {
jpayne@68 11141 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11142 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 11143 __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11144 }
jpayne@68 11145 for (;;) {
jpayne@68 11146 if (likely(!__pyx_t_3)) {
jpayne@68 11147 if (likely(PyList_CheckExact(__pyx_t_1))) {
jpayne@68 11148 {
jpayne@68 11149 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
jpayne@68 11150 #if !CYTHON_ASSUME_SAFE_MACROS
jpayne@68 11151 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11152 #endif
jpayne@68 11153 if (__pyx_t_2 >= __pyx_temp) break;
jpayne@68 11154 }
jpayne@68 11155 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 11156 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11157 #else
jpayne@68 11158 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11159 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 11160 #endif
jpayne@68 11161 } else {
jpayne@68 11162 {
jpayne@68 11163 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
jpayne@68 11164 #if !CYTHON_ASSUME_SAFE_MACROS
jpayne@68 11165 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11166 #endif
jpayne@68 11167 if (__pyx_t_2 >= __pyx_temp) break;
jpayne@68 11168 }
jpayne@68 11169 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 11170 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11171 #else
jpayne@68 11172 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11173 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 11174 #endif
jpayne@68 11175 }
jpayne@68 11176 } else {
jpayne@68 11177 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
jpayne@68 11178 if (unlikely(!__pyx_t_4)) {
jpayne@68 11179 PyObject* exc_type = PyErr_Occurred();
jpayne@68 11180 if (exc_type) {
jpayne@68 11181 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
jpayne@68 11182 else __PYX_ERR(0, 287, __pyx_L1_error)
jpayne@68 11183 }
jpayne@68 11184 break;
jpayne@68 11185 }
jpayne@68 11186 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 11187 }
jpayne@68 11188 __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_4);
jpayne@68 11189 __pyx_t_4 = 0;
jpayne@68 11190
jpayne@68 11191 /* "pysam/libchtslib.pyx":288
jpayne@68 11192 * def writelines(self, lines):
jpayne@68 11193 * for line in lines:
jpayne@68 11194 * self.write(line) # <<<<<<<<<<<<<<
jpayne@68 11195 *
jpayne@68 11196 *
jpayne@68 11197 */
jpayne@68 11198 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
jpayne@68 11199 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 11200 __pyx_t_6 = NULL;
jpayne@68 11201 __pyx_t_7 = 0;
jpayne@68 11202 #if CYTHON_UNPACK_METHODS
jpayne@68 11203 if (likely(PyMethod_Check(__pyx_t_5))) {
jpayne@68 11204 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
jpayne@68 11205 if (likely(__pyx_t_6)) {
jpayne@68 11206 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
jpayne@68 11207 __Pyx_INCREF(__pyx_t_6);
jpayne@68 11208 __Pyx_INCREF(function);
jpayne@68 11209 __Pyx_DECREF_SET(__pyx_t_5, function);
jpayne@68 11210 __pyx_t_7 = 1;
jpayne@68 11211 }
jpayne@68 11212 }
jpayne@68 11213 #endif
jpayne@68 11214 {
jpayne@68 11215 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_line};
jpayne@68 11216 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
jpayne@68 11217 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 11218 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
jpayne@68 11219 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 11220 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 11221 }
jpayne@68 11222 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 11223
jpayne@68 11224 /* "pysam/libchtslib.pyx":287
jpayne@68 11225 *
jpayne@68 11226 * def writelines(self, lines):
jpayne@68 11227 * for line in lines: # <<<<<<<<<<<<<<
jpayne@68 11228 * self.write(line)
jpayne@68 11229 *
jpayne@68 11230 */
jpayne@68 11231 }
jpayne@68 11232 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 11233
jpayne@68 11234 /* "pysam/libchtslib.pyx":286
jpayne@68 11235 * return got
jpayne@68 11236 *
jpayne@68 11237 * def writelines(self, lines): # <<<<<<<<<<<<<<
jpayne@68 11238 * for line in lines:
jpayne@68 11239 * self.write(line)
jpayne@68 11240 */
jpayne@68 11241
jpayne@68 11242 /* function exit code */
jpayne@68 11243 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 11244 goto __pyx_L0;
jpayne@68 11245 __pyx_L1_error:;
jpayne@68 11246 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 11247 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 11248 __Pyx_XDECREF(__pyx_t_5);
jpayne@68 11249 __Pyx_XDECREF(__pyx_t_6);
jpayne@68 11250 __Pyx_AddTraceback("pysam.libchtslib.HFile.writelines", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11251 __pyx_r = NULL;
jpayne@68 11252 __pyx_L0:;
jpayne@68 11253 __Pyx_XDECREF(__pyx_v_line);
jpayne@68 11254 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 11255 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 11256 __Pyx_RefNannyFinishContext();
jpayne@68 11257 return __pyx_r;
jpayne@68 11258 }
jpayne@68 11259
jpayne@68 11260 /* "pysam/libchtslib.pyx":69
jpayne@68 11261 * cdef class HFile(object):
jpayne@68 11262 * cdef hFILE *fp
jpayne@68 11263 * cdef readonly object name, mode # <<<<<<<<<<<<<<
jpayne@68 11264 *
jpayne@68 11265 * def __init__(self, name, mode='r', closefd=True):
jpayne@68 11266 */
jpayne@68 11267
jpayne@68 11268 /* Python wrapper */
jpayne@68 11269 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 11270 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_4name_1__get__(PyObject *__pyx_v_self) {
jpayne@68 11271 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 11272 PyObject *__pyx_r = 0;
jpayne@68 11273 __Pyx_RefNannyDeclarations
jpayne@68 11274 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 11275 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 11276 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_4name___get__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 11277
jpayne@68 11278 /* function exit code */
jpayne@68 11279 __Pyx_RefNannyFinishContext();
jpayne@68 11280 return __pyx_r;
jpayne@68 11281 }
jpayne@68 11282
jpayne@68 11283 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_4name___get__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 11284 PyObject *__pyx_r = NULL;
jpayne@68 11285 __Pyx_TraceDeclarations
jpayne@68 11286 __Pyx_RefNannyDeclarations
jpayne@68 11287 int __pyx_lineno = 0;
jpayne@68 11288 const char *__pyx_filename = NULL;
jpayne@68 11289 int __pyx_clineno = 0;
jpayne@68 11290 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 11291 __Pyx_TraceCall("__get__", __pyx_f[0], 69, 0, __PYX_ERR(0, 69, __pyx_L1_error));
jpayne@68 11292 __Pyx_XDECREF(__pyx_r);
jpayne@68 11293 __Pyx_INCREF(__pyx_v_self->name);
jpayne@68 11294 __pyx_r = __pyx_v_self->name;
jpayne@68 11295 goto __pyx_L0;
jpayne@68 11296
jpayne@68 11297 /* function exit code */
jpayne@68 11298 __pyx_L1_error:;
jpayne@68 11299 __Pyx_AddTraceback("pysam.libchtslib.HFile.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11300 __pyx_r = NULL;
jpayne@68 11301 __pyx_L0:;
jpayne@68 11302 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 11303 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 11304 __Pyx_RefNannyFinishContext();
jpayne@68 11305 return __pyx_r;
jpayne@68 11306 }
jpayne@68 11307
jpayne@68 11308 /* Python wrapper */
jpayne@68 11309 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 11310 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_4mode_1__get__(PyObject *__pyx_v_self) {
jpayne@68 11311 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 11312 PyObject *__pyx_r = 0;
jpayne@68 11313 __Pyx_RefNannyDeclarations
jpayne@68 11314 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 11315 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 11316 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_4mode___get__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 11317
jpayne@68 11318 /* function exit code */
jpayne@68 11319 __Pyx_RefNannyFinishContext();
jpayne@68 11320 return __pyx_r;
jpayne@68 11321 }
jpayne@68 11322
jpayne@68 11323 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_4mode___get__(struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 11324 PyObject *__pyx_r = NULL;
jpayne@68 11325 __Pyx_TraceDeclarations
jpayne@68 11326 __Pyx_RefNannyDeclarations
jpayne@68 11327 int __pyx_lineno = 0;
jpayne@68 11328 const char *__pyx_filename = NULL;
jpayne@68 11329 int __pyx_clineno = 0;
jpayne@68 11330 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 11331 __Pyx_TraceCall("__get__", __pyx_f[0], 69, 0, __PYX_ERR(0, 69, __pyx_L1_error));
jpayne@68 11332 __Pyx_XDECREF(__pyx_r);
jpayne@68 11333 __Pyx_INCREF(__pyx_v_self->mode);
jpayne@68 11334 __pyx_r = __pyx_v_self->mode;
jpayne@68 11335 goto __pyx_L0;
jpayne@68 11336
jpayne@68 11337 /* function exit code */
jpayne@68 11338 __pyx_L1_error:;
jpayne@68 11339 __Pyx_AddTraceback("pysam.libchtslib.HFile.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11340 __pyx_r = NULL;
jpayne@68 11341 __pyx_L0:;
jpayne@68 11342 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 11343 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 11344 __Pyx_RefNannyFinishContext();
jpayne@68 11345 return __pyx_r;
jpayne@68 11346 }
jpayne@68 11347
jpayne@68 11348 /* "(tree fragment)":1
jpayne@68 11349 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
jpayne@68 11350 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 11351 * def __setstate_cython__(self, __pyx_state):
jpayne@68 11352 */
jpayne@68 11353
jpayne@68 11354 /* Python wrapper */
jpayne@68 11355 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_47__reduce_cython__(PyObject *__pyx_v_self,
jpayne@68 11356 #if CYTHON_METH_FASTCALL
jpayne@68 11357 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11358 #else
jpayne@68 11359 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11360 #endif
jpayne@68 11361 ); /*proto*/
jpayne@68 11362 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_46__reduce_cython__, "HFile.__reduce_cython__(self)");
jpayne@68 11363 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_47__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_47__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_46__reduce_cython__};
jpayne@68 11364 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_47__reduce_cython__(PyObject *__pyx_v_self,
jpayne@68 11365 #if CYTHON_METH_FASTCALL
jpayne@68 11366 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11367 #else
jpayne@68 11368 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11369 #endif
jpayne@68 11370 ) {
jpayne@68 11371 #if !CYTHON_METH_FASTCALL
jpayne@68 11372 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 11373 #endif
jpayne@68 11374 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 11375 PyObject *__pyx_r = 0;
jpayne@68 11376 __Pyx_RefNannyDeclarations
jpayne@68 11377 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
jpayne@68 11378 #if !CYTHON_METH_FASTCALL
jpayne@68 11379 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 11380 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 11381 #else
jpayne@68 11382 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 11383 #endif
jpayne@68 11384 #endif
jpayne@68 11385 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 11386 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 11387 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 11388 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
jpayne@68 11389 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_46__reduce_cython__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self));
jpayne@68 11390
jpayne@68 11391 /* function exit code */
jpayne@68 11392 __Pyx_RefNannyFinishContext();
jpayne@68 11393 return __pyx_r;
jpayne@68 11394 }
jpayne@68 11395
jpayne@68 11396 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self) {
jpayne@68 11397 PyObject *__pyx_r = NULL;
jpayne@68 11398 __Pyx_TraceDeclarations
jpayne@68 11399 __Pyx_RefNannyDeclarations
jpayne@68 11400 int __pyx_lineno = 0;
jpayne@68 11401 const char *__pyx_filename = NULL;
jpayne@68 11402 int __pyx_clineno = 0;
jpayne@68 11403 __Pyx_TraceFrameInit(__pyx_codeobj__26)
jpayne@68 11404 __Pyx_RefNannySetupContext("__reduce_cython__", 1);
jpayne@68 11405 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
jpayne@68 11406
jpayne@68 11407 /* "(tree fragment)":2
jpayne@68 11408 * def __reduce_cython__(self):
jpayne@68 11409 * raise TypeError, "self.fp cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
jpayne@68 11410 * def __setstate_cython__(self, __pyx_state):
jpayne@68 11411 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 11412 */
jpayne@68 11413 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_fp_cannot_be_converted_to_a, 0, 0);
jpayne@68 11414 __PYX_ERR(1, 2, __pyx_L1_error)
jpayne@68 11415
jpayne@68 11416 /* "(tree fragment)":1
jpayne@68 11417 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
jpayne@68 11418 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 11419 * def __setstate_cython__(self, __pyx_state):
jpayne@68 11420 */
jpayne@68 11421
jpayne@68 11422 /* function exit code */
jpayne@68 11423 __pyx_L1_error:;
jpayne@68 11424 __Pyx_AddTraceback("pysam.libchtslib.HFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11425 __pyx_r = NULL;
jpayne@68 11426 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 11427 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 11428 __Pyx_RefNannyFinishContext();
jpayne@68 11429 return __pyx_r;
jpayne@68 11430 }
jpayne@68 11431
jpayne@68 11432 /* "(tree fragment)":3
jpayne@68 11433 * def __reduce_cython__(self):
jpayne@68 11434 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 11435 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
jpayne@68 11436 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 11437 */
jpayne@68 11438
jpayne@68 11439 /* Python wrapper */
jpayne@68 11440 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_49__setstate_cython__(PyObject *__pyx_v_self,
jpayne@68 11441 #if CYTHON_METH_FASTCALL
jpayne@68 11442 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11443 #else
jpayne@68 11444 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11445 #endif
jpayne@68 11446 ); /*proto*/
jpayne@68 11447 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_5HFile_48__setstate_cython__, "HFile.__setstate_cython__(self, __pyx_state)");
jpayne@68 11448 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_5HFile_49__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_49__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_48__setstate_cython__};
jpayne@68 11449 static PyObject *__pyx_pw_5pysam_10libchtslib_5HFile_49__setstate_cython__(PyObject *__pyx_v_self,
jpayne@68 11450 #if CYTHON_METH_FASTCALL
jpayne@68 11451 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11452 #else
jpayne@68 11453 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11454 #endif
jpayne@68 11455 ) {
jpayne@68 11456 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
jpayne@68 11457 #if !CYTHON_METH_FASTCALL
jpayne@68 11458 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 11459 #endif
jpayne@68 11460 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 11461 PyObject* values[1] = {0};
jpayne@68 11462 int __pyx_lineno = 0;
jpayne@68 11463 const char *__pyx_filename = NULL;
jpayne@68 11464 int __pyx_clineno = 0;
jpayne@68 11465 PyObject *__pyx_r = 0;
jpayne@68 11466 __Pyx_RefNannyDeclarations
jpayne@68 11467 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
jpayne@68 11468 #if !CYTHON_METH_FASTCALL
jpayne@68 11469 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 11470 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 11471 #else
jpayne@68 11472 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 11473 #endif
jpayne@68 11474 #endif
jpayne@68 11475 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 11476 {
jpayne@68 11477 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
jpayne@68 11478 if (__pyx_kwds) {
jpayne@68 11479 Py_ssize_t kw_args;
jpayne@68 11480 switch (__pyx_nargs) {
jpayne@68 11481 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11482 CYTHON_FALLTHROUGH;
jpayne@68 11483 case 0: break;
jpayne@68 11484 default: goto __pyx_L5_argtuple_error;
jpayne@68 11485 }
jpayne@68 11486 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 11487 switch (__pyx_nargs) {
jpayne@68 11488 case 0:
jpayne@68 11489 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
jpayne@68 11490 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 11491 kw_args--;
jpayne@68 11492 }
jpayne@68 11493 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
jpayne@68 11494 else goto __pyx_L5_argtuple_error;
jpayne@68 11495 }
jpayne@68 11496 if (unlikely(kw_args > 0)) {
jpayne@68 11497 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 11498 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
jpayne@68 11499 }
jpayne@68 11500 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 11501 goto __pyx_L5_argtuple_error;
jpayne@68 11502 } else {
jpayne@68 11503 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11504 }
jpayne@68 11505 __pyx_v___pyx_state = values[0];
jpayne@68 11506 }
jpayne@68 11507 goto __pyx_L6_skip;
jpayne@68 11508 __pyx_L5_argtuple_error:;
jpayne@68 11509 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
jpayne@68 11510 __pyx_L6_skip:;
jpayne@68 11511 goto __pyx_L4_argument_unpacking_done;
jpayne@68 11512 __pyx_L3_error:;
jpayne@68 11513 {
jpayne@68 11514 Py_ssize_t __pyx_temp;
jpayne@68 11515 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11516 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11517 }
jpayne@68 11518 }
jpayne@68 11519 __Pyx_AddTraceback("pysam.libchtslib.HFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11520 __Pyx_RefNannyFinishContext();
jpayne@68 11521 return NULL;
jpayne@68 11522 __pyx_L4_argument_unpacking_done:;
jpayne@68 11523 __pyx_r = __pyx_pf_5pysam_10libchtslib_5HFile_48__setstate_cython__(((struct __pyx_obj_5pysam_10libchtslib_HFile *)__pyx_v_self), __pyx_v___pyx_state);
jpayne@68 11524
jpayne@68 11525 /* function exit code */
jpayne@68 11526 {
jpayne@68 11527 Py_ssize_t __pyx_temp;
jpayne@68 11528 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11529 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11530 }
jpayne@68 11531 }
jpayne@68 11532 __Pyx_RefNannyFinishContext();
jpayne@68 11533 return __pyx_r;
jpayne@68 11534 }
jpayne@68 11535
jpayne@68 11536 static PyObject *__pyx_pf_5pysam_10libchtslib_5HFile_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
jpayne@68 11537 PyObject *__pyx_r = NULL;
jpayne@68 11538 __Pyx_TraceDeclarations
jpayne@68 11539 __Pyx_RefNannyDeclarations
jpayne@68 11540 int __pyx_lineno = 0;
jpayne@68 11541 const char *__pyx_filename = NULL;
jpayne@68 11542 int __pyx_clineno = 0;
jpayne@68 11543 __Pyx_TraceFrameInit(__pyx_codeobj__27)
jpayne@68 11544 __Pyx_RefNannySetupContext("__setstate_cython__", 1);
jpayne@68 11545 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
jpayne@68 11546
jpayne@68 11547 /* "(tree fragment)":4
jpayne@68 11548 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 11549 * def __setstate_cython__(self, __pyx_state):
jpayne@68 11550 * raise TypeError, "self.fp cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
jpayne@68 11551 */
jpayne@68 11552 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_fp_cannot_be_converted_to_a, 0, 0);
jpayne@68 11553 __PYX_ERR(1, 4, __pyx_L1_error)
jpayne@68 11554
jpayne@68 11555 /* "(tree fragment)":3
jpayne@68 11556 * def __reduce_cython__(self):
jpayne@68 11557 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 11558 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
jpayne@68 11559 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 11560 */
jpayne@68 11561
jpayne@68 11562 /* function exit code */
jpayne@68 11563 __pyx_L1_error:;
jpayne@68 11564 __Pyx_AddTraceback("pysam.libchtslib.HFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11565 __pyx_r = NULL;
jpayne@68 11566 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 11567 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 11568 __Pyx_RefNannyFinishContext();
jpayne@68 11569 return __pyx_r;
jpayne@68 11570 }
jpayne@68 11571
jpayne@68 11572 /* "pysam/libchtslib.pyx":298
jpayne@68 11573 *
jpayne@68 11574 * class CallableValue(object):
jpayne@68 11575 * def __init__(self, value): # <<<<<<<<<<<<<<
jpayne@68 11576 * self.value = value
jpayne@68 11577 * def __call__(self):
jpayne@68 11578 */
jpayne@68 11579
jpayne@68 11580 /* Python wrapper */
jpayne@68 11581 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_1__init__(PyObject *__pyx_self,
jpayne@68 11582 #if CYTHON_METH_FASTCALL
jpayne@68 11583 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11584 #else
jpayne@68 11585 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11586 #endif
jpayne@68 11587 ); /*proto*/
jpayne@68 11588 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_13CallableValue___init__, "CallableValue.__init__(self, value)");
jpayne@68 11589 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_13CallableValue_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_13CallableValue_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_13CallableValue___init__};
jpayne@68 11590 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_1__init__(PyObject *__pyx_self,
jpayne@68 11591 #if CYTHON_METH_FASTCALL
jpayne@68 11592 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11593 #else
jpayne@68 11594 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11595 #endif
jpayne@68 11596 ) {
jpayne@68 11597 PyObject *__pyx_v_self = 0;
jpayne@68 11598 PyObject *__pyx_v_value = 0;
jpayne@68 11599 #if !CYTHON_METH_FASTCALL
jpayne@68 11600 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 11601 #endif
jpayne@68 11602 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 11603 PyObject* values[2] = {0,0};
jpayne@68 11604 int __pyx_lineno = 0;
jpayne@68 11605 const char *__pyx_filename = NULL;
jpayne@68 11606 int __pyx_clineno = 0;
jpayne@68 11607 PyObject *__pyx_r = 0;
jpayne@68 11608 __Pyx_RefNannyDeclarations
jpayne@68 11609 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
jpayne@68 11610 #if !CYTHON_METH_FASTCALL
jpayne@68 11611 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 11612 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 11613 #else
jpayne@68 11614 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 11615 #endif
jpayne@68 11616 #endif
jpayne@68 11617 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 11618 {
jpayne@68 11619 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0};
jpayne@68 11620 if (__pyx_kwds) {
jpayne@68 11621 Py_ssize_t kw_args;
jpayne@68 11622 switch (__pyx_nargs) {
jpayne@68 11623 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 11624 CYTHON_FALLTHROUGH;
jpayne@68 11625 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11626 CYTHON_FALLTHROUGH;
jpayne@68 11627 case 0: break;
jpayne@68 11628 default: goto __pyx_L5_argtuple_error;
jpayne@68 11629 }
jpayne@68 11630 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 11631 switch (__pyx_nargs) {
jpayne@68 11632 case 0:
jpayne@68 11633 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
jpayne@68 11634 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 11635 kw_args--;
jpayne@68 11636 }
jpayne@68 11637 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L3_error)
jpayne@68 11638 else goto __pyx_L5_argtuple_error;
jpayne@68 11639 CYTHON_FALLTHROUGH;
jpayne@68 11640 case 1:
jpayne@68 11641 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
jpayne@68 11642 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
jpayne@68 11643 kw_args--;
jpayne@68 11644 }
jpayne@68 11645 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L3_error)
jpayne@68 11646 else {
jpayne@68 11647 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 298, __pyx_L3_error)
jpayne@68 11648 }
jpayne@68 11649 }
jpayne@68 11650 if (unlikely(kw_args > 0)) {
jpayne@68 11651 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 11652 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 298, __pyx_L3_error)
jpayne@68 11653 }
jpayne@68 11654 } else if (unlikely(__pyx_nargs != 2)) {
jpayne@68 11655 goto __pyx_L5_argtuple_error;
jpayne@68 11656 } else {
jpayne@68 11657 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11658 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 11659 }
jpayne@68 11660 __pyx_v_self = values[0];
jpayne@68 11661 __pyx_v_value = values[1];
jpayne@68 11662 }
jpayne@68 11663 goto __pyx_L6_skip;
jpayne@68 11664 __pyx_L5_argtuple_error:;
jpayne@68 11665 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 298, __pyx_L3_error)
jpayne@68 11666 __pyx_L6_skip:;
jpayne@68 11667 goto __pyx_L4_argument_unpacking_done;
jpayne@68 11668 __pyx_L3_error:;
jpayne@68 11669 {
jpayne@68 11670 Py_ssize_t __pyx_temp;
jpayne@68 11671 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11672 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11673 }
jpayne@68 11674 }
jpayne@68 11675 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11676 __Pyx_RefNannyFinishContext();
jpayne@68 11677 return NULL;
jpayne@68 11678 __pyx_L4_argument_unpacking_done:;
jpayne@68 11679 __pyx_r = __pyx_pf_5pysam_10libchtslib_13CallableValue___init__(__pyx_self, __pyx_v_self, __pyx_v_value);
jpayne@68 11680
jpayne@68 11681 /* function exit code */
jpayne@68 11682 {
jpayne@68 11683 Py_ssize_t __pyx_temp;
jpayne@68 11684 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11685 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11686 }
jpayne@68 11687 }
jpayne@68 11688 __Pyx_RefNannyFinishContext();
jpayne@68 11689 return __pyx_r;
jpayne@68 11690 }
jpayne@68 11691
jpayne@68 11692 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
jpayne@68 11693 PyObject *__pyx_r = NULL;
jpayne@68 11694 __Pyx_TraceDeclarations
jpayne@68 11695 __Pyx_RefNannyDeclarations
jpayne@68 11696 int __pyx_lineno = 0;
jpayne@68 11697 const char *__pyx_filename = NULL;
jpayne@68 11698 int __pyx_clineno = 0;
jpayne@68 11699 __Pyx_TraceFrameInit(__pyx_codeobj__28)
jpayne@68 11700 __Pyx_RefNannySetupContext("__init__", 1);
jpayne@68 11701 __Pyx_TraceCall("__init__", __pyx_f[0], 298, 0, __PYX_ERR(0, 298, __pyx_L1_error));
jpayne@68 11702
jpayne@68 11703 /* "pysam/libchtslib.pyx":299
jpayne@68 11704 * class CallableValue(object):
jpayne@68 11705 * def __init__(self, value):
jpayne@68 11706 * self.value = value # <<<<<<<<<<<<<<
jpayne@68 11707 * def __call__(self):
jpayne@68 11708 * return self.value
jpayne@68 11709 */
jpayne@68 11710 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_v_value) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
jpayne@68 11711
jpayne@68 11712 /* "pysam/libchtslib.pyx":298
jpayne@68 11713 *
jpayne@68 11714 * class CallableValue(object):
jpayne@68 11715 * def __init__(self, value): # <<<<<<<<<<<<<<
jpayne@68 11716 * self.value = value
jpayne@68 11717 * def __call__(self):
jpayne@68 11718 */
jpayne@68 11719
jpayne@68 11720 /* function exit code */
jpayne@68 11721 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 11722 goto __pyx_L0;
jpayne@68 11723 __pyx_L1_error:;
jpayne@68 11724 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11725 __pyx_r = NULL;
jpayne@68 11726 __pyx_L0:;
jpayne@68 11727 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 11728 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 11729 __Pyx_RefNannyFinishContext();
jpayne@68 11730 return __pyx_r;
jpayne@68 11731 }
jpayne@68 11732
jpayne@68 11733 /* "pysam/libchtslib.pyx":300
jpayne@68 11734 * def __init__(self, value):
jpayne@68 11735 * self.value = value
jpayne@68 11736 * def __call__(self): # <<<<<<<<<<<<<<
jpayne@68 11737 * return self.value
jpayne@68 11738 * def __bool__(self):
jpayne@68 11739 */
jpayne@68 11740
jpayne@68 11741 /* Python wrapper */
jpayne@68 11742 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_3__call__(PyObject *__pyx_self,
jpayne@68 11743 #if CYTHON_METH_FASTCALL
jpayne@68 11744 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11745 #else
jpayne@68 11746 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11747 #endif
jpayne@68 11748 ); /*proto*/
jpayne@68 11749 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_13CallableValue_2__call__, "CallableValue.__call__(self)");
jpayne@68 11750 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_13CallableValue_3__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_13CallableValue_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_13CallableValue_2__call__};
jpayne@68 11751 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_3__call__(PyObject *__pyx_self,
jpayne@68 11752 #if CYTHON_METH_FASTCALL
jpayne@68 11753 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11754 #else
jpayne@68 11755 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11756 #endif
jpayne@68 11757 ) {
jpayne@68 11758 PyObject *__pyx_v_self = 0;
jpayne@68 11759 #if !CYTHON_METH_FASTCALL
jpayne@68 11760 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 11761 #endif
jpayne@68 11762 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 11763 PyObject* values[1] = {0};
jpayne@68 11764 int __pyx_lineno = 0;
jpayne@68 11765 const char *__pyx_filename = NULL;
jpayne@68 11766 int __pyx_clineno = 0;
jpayne@68 11767 PyObject *__pyx_r = 0;
jpayne@68 11768 __Pyx_RefNannyDeclarations
jpayne@68 11769 __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
jpayne@68 11770 #if !CYTHON_METH_FASTCALL
jpayne@68 11771 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 11772 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 11773 #else
jpayne@68 11774 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 11775 #endif
jpayne@68 11776 #endif
jpayne@68 11777 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 11778 {
jpayne@68 11779 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
jpayne@68 11780 if (__pyx_kwds) {
jpayne@68 11781 Py_ssize_t kw_args;
jpayne@68 11782 switch (__pyx_nargs) {
jpayne@68 11783 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11784 CYTHON_FALLTHROUGH;
jpayne@68 11785 case 0: break;
jpayne@68 11786 default: goto __pyx_L5_argtuple_error;
jpayne@68 11787 }
jpayne@68 11788 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 11789 switch (__pyx_nargs) {
jpayne@68 11790 case 0:
jpayne@68 11791 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
jpayne@68 11792 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 11793 kw_args--;
jpayne@68 11794 }
jpayne@68 11795 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error)
jpayne@68 11796 else goto __pyx_L5_argtuple_error;
jpayne@68 11797 }
jpayne@68 11798 if (unlikely(kw_args > 0)) {
jpayne@68 11799 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 11800 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 300, __pyx_L3_error)
jpayne@68 11801 }
jpayne@68 11802 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 11803 goto __pyx_L5_argtuple_error;
jpayne@68 11804 } else {
jpayne@68 11805 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11806 }
jpayne@68 11807 __pyx_v_self = values[0];
jpayne@68 11808 }
jpayne@68 11809 goto __pyx_L6_skip;
jpayne@68 11810 __pyx_L5_argtuple_error:;
jpayne@68 11811 __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 300, __pyx_L3_error)
jpayne@68 11812 __pyx_L6_skip:;
jpayne@68 11813 goto __pyx_L4_argument_unpacking_done;
jpayne@68 11814 __pyx_L3_error:;
jpayne@68 11815 {
jpayne@68 11816 Py_ssize_t __pyx_temp;
jpayne@68 11817 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11818 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11819 }
jpayne@68 11820 }
jpayne@68 11821 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11822 __Pyx_RefNannyFinishContext();
jpayne@68 11823 return NULL;
jpayne@68 11824 __pyx_L4_argument_unpacking_done:;
jpayne@68 11825 __pyx_r = __pyx_pf_5pysam_10libchtslib_13CallableValue_2__call__(__pyx_self, __pyx_v_self);
jpayne@68 11826
jpayne@68 11827 /* function exit code */
jpayne@68 11828 {
jpayne@68 11829 Py_ssize_t __pyx_temp;
jpayne@68 11830 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11831 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11832 }
jpayne@68 11833 }
jpayne@68 11834 __Pyx_RefNannyFinishContext();
jpayne@68 11835 return __pyx_r;
jpayne@68 11836 }
jpayne@68 11837
jpayne@68 11838 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
jpayne@68 11839 PyObject *__pyx_r = NULL;
jpayne@68 11840 __Pyx_TraceDeclarations
jpayne@68 11841 __Pyx_RefNannyDeclarations
jpayne@68 11842 PyObject *__pyx_t_1 = NULL;
jpayne@68 11843 int __pyx_lineno = 0;
jpayne@68 11844 const char *__pyx_filename = NULL;
jpayne@68 11845 int __pyx_clineno = 0;
jpayne@68 11846 __Pyx_TraceFrameInit(__pyx_codeobj__29)
jpayne@68 11847 __Pyx_RefNannySetupContext("__call__", 1);
jpayne@68 11848 __Pyx_TraceCall("__call__", __pyx_f[0], 300, 0, __PYX_ERR(0, 300, __pyx_L1_error));
jpayne@68 11849
jpayne@68 11850 /* "pysam/libchtslib.pyx":301
jpayne@68 11851 * self.value = value
jpayne@68 11852 * def __call__(self):
jpayne@68 11853 * return self.value # <<<<<<<<<<<<<<
jpayne@68 11854 * def __bool__(self):
jpayne@68 11855 * return self.value
jpayne@68 11856 */
jpayne@68 11857 __Pyx_XDECREF(__pyx_r);
jpayne@68 11858 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
jpayne@68 11859 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 11860 __pyx_r = __pyx_t_1;
jpayne@68 11861 __pyx_t_1 = 0;
jpayne@68 11862 goto __pyx_L0;
jpayne@68 11863
jpayne@68 11864 /* "pysam/libchtslib.pyx":300
jpayne@68 11865 * def __init__(self, value):
jpayne@68 11866 * self.value = value
jpayne@68 11867 * def __call__(self): # <<<<<<<<<<<<<<
jpayne@68 11868 * return self.value
jpayne@68 11869 * def __bool__(self):
jpayne@68 11870 */
jpayne@68 11871
jpayne@68 11872 /* function exit code */
jpayne@68 11873 __pyx_L1_error:;
jpayne@68 11874 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 11875 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11876 __pyx_r = NULL;
jpayne@68 11877 __pyx_L0:;
jpayne@68 11878 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 11879 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 11880 __Pyx_RefNannyFinishContext();
jpayne@68 11881 return __pyx_r;
jpayne@68 11882 }
jpayne@68 11883
jpayne@68 11884 /* "pysam/libchtslib.pyx":302
jpayne@68 11885 * def __call__(self):
jpayne@68 11886 * return self.value
jpayne@68 11887 * def __bool__(self): # <<<<<<<<<<<<<<
jpayne@68 11888 * return self.value
jpayne@68 11889 * def __nonzero__(self):
jpayne@68 11890 */
jpayne@68 11891
jpayne@68 11892 /* Python wrapper */
jpayne@68 11893 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_5__bool__(PyObject *__pyx_self,
jpayne@68 11894 #if CYTHON_METH_FASTCALL
jpayne@68 11895 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11896 #else
jpayne@68 11897 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11898 #endif
jpayne@68 11899 ); /*proto*/
jpayne@68 11900 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_13CallableValue_4__bool__, "CallableValue.__bool__(self)");
jpayne@68 11901 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_13CallableValue_5__bool__ = {"__bool__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_13CallableValue_5__bool__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_13CallableValue_4__bool__};
jpayne@68 11902 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_5__bool__(PyObject *__pyx_self,
jpayne@68 11903 #if CYTHON_METH_FASTCALL
jpayne@68 11904 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 11905 #else
jpayne@68 11906 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 11907 #endif
jpayne@68 11908 ) {
jpayne@68 11909 PyObject *__pyx_v_self = 0;
jpayne@68 11910 #if !CYTHON_METH_FASTCALL
jpayne@68 11911 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 11912 #endif
jpayne@68 11913 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 11914 PyObject* values[1] = {0};
jpayne@68 11915 int __pyx_lineno = 0;
jpayne@68 11916 const char *__pyx_filename = NULL;
jpayne@68 11917 int __pyx_clineno = 0;
jpayne@68 11918 PyObject *__pyx_r = 0;
jpayne@68 11919 __Pyx_RefNannyDeclarations
jpayne@68 11920 __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0);
jpayne@68 11921 #if !CYTHON_METH_FASTCALL
jpayne@68 11922 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 11923 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 11924 #else
jpayne@68 11925 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 11926 #endif
jpayne@68 11927 #endif
jpayne@68 11928 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 11929 {
jpayne@68 11930 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
jpayne@68 11931 if (__pyx_kwds) {
jpayne@68 11932 Py_ssize_t kw_args;
jpayne@68 11933 switch (__pyx_nargs) {
jpayne@68 11934 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11935 CYTHON_FALLTHROUGH;
jpayne@68 11936 case 0: break;
jpayne@68 11937 default: goto __pyx_L5_argtuple_error;
jpayne@68 11938 }
jpayne@68 11939 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 11940 switch (__pyx_nargs) {
jpayne@68 11941 case 0:
jpayne@68 11942 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
jpayne@68 11943 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 11944 kw_args--;
jpayne@68 11945 }
jpayne@68 11946 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error)
jpayne@68 11947 else goto __pyx_L5_argtuple_error;
jpayne@68 11948 }
jpayne@68 11949 if (unlikely(kw_args > 0)) {
jpayne@68 11950 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 11951 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__bool__") < 0)) __PYX_ERR(0, 302, __pyx_L3_error)
jpayne@68 11952 }
jpayne@68 11953 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 11954 goto __pyx_L5_argtuple_error;
jpayne@68 11955 } else {
jpayne@68 11956 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 11957 }
jpayne@68 11958 __pyx_v_self = values[0];
jpayne@68 11959 }
jpayne@68 11960 goto __pyx_L6_skip;
jpayne@68 11961 __pyx_L5_argtuple_error:;
jpayne@68 11962 __Pyx_RaiseArgtupleInvalid("__bool__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 302, __pyx_L3_error)
jpayne@68 11963 __pyx_L6_skip:;
jpayne@68 11964 goto __pyx_L4_argument_unpacking_done;
jpayne@68 11965 __pyx_L3_error:;
jpayne@68 11966 {
jpayne@68 11967 Py_ssize_t __pyx_temp;
jpayne@68 11968 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11969 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11970 }
jpayne@68 11971 }
jpayne@68 11972 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__bool__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 11973 __Pyx_RefNannyFinishContext();
jpayne@68 11974 return NULL;
jpayne@68 11975 __pyx_L4_argument_unpacking_done:;
jpayne@68 11976 __pyx_r = __pyx_pf_5pysam_10libchtslib_13CallableValue_4__bool__(__pyx_self, __pyx_v_self);
jpayne@68 11977
jpayne@68 11978 /* function exit code */
jpayne@68 11979 {
jpayne@68 11980 Py_ssize_t __pyx_temp;
jpayne@68 11981 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 11982 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 11983 }
jpayne@68 11984 }
jpayne@68 11985 __Pyx_RefNannyFinishContext();
jpayne@68 11986 return __pyx_r;
jpayne@68 11987 }
jpayne@68 11988
jpayne@68 11989 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_4__bool__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
jpayne@68 11990 PyObject *__pyx_r = NULL;
jpayne@68 11991 __Pyx_TraceDeclarations
jpayne@68 11992 __Pyx_RefNannyDeclarations
jpayne@68 11993 PyObject *__pyx_t_1 = NULL;
jpayne@68 11994 int __pyx_lineno = 0;
jpayne@68 11995 const char *__pyx_filename = NULL;
jpayne@68 11996 int __pyx_clineno = 0;
jpayne@68 11997 __Pyx_TraceFrameInit(__pyx_codeobj__30)
jpayne@68 11998 __Pyx_RefNannySetupContext("__bool__", 1);
jpayne@68 11999 __Pyx_TraceCall("__bool__", __pyx_f[0], 302, 0, __PYX_ERR(0, 302, __pyx_L1_error));
jpayne@68 12000
jpayne@68 12001 /* "pysam/libchtslib.pyx":303
jpayne@68 12002 * return self.value
jpayne@68 12003 * def __bool__(self):
jpayne@68 12004 * return self.value # <<<<<<<<<<<<<<
jpayne@68 12005 * def __nonzero__(self):
jpayne@68 12006 * return self.value
jpayne@68 12007 */
jpayne@68 12008 __Pyx_XDECREF(__pyx_r);
jpayne@68 12009 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
jpayne@68 12010 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 12011 __pyx_r = __pyx_t_1;
jpayne@68 12012 __pyx_t_1 = 0;
jpayne@68 12013 goto __pyx_L0;
jpayne@68 12014
jpayne@68 12015 /* "pysam/libchtslib.pyx":302
jpayne@68 12016 * def __call__(self):
jpayne@68 12017 * return self.value
jpayne@68 12018 * def __bool__(self): # <<<<<<<<<<<<<<
jpayne@68 12019 * return self.value
jpayne@68 12020 * def __nonzero__(self):
jpayne@68 12021 */
jpayne@68 12022
jpayne@68 12023 /* function exit code */
jpayne@68 12024 __pyx_L1_error:;
jpayne@68 12025 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 12026 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__bool__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12027 __pyx_r = NULL;
jpayne@68 12028 __pyx_L0:;
jpayne@68 12029 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 12030 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 12031 __Pyx_RefNannyFinishContext();
jpayne@68 12032 return __pyx_r;
jpayne@68 12033 }
jpayne@68 12034
jpayne@68 12035 /* "pysam/libchtslib.pyx":304
jpayne@68 12036 * def __bool__(self):
jpayne@68 12037 * return self.value
jpayne@68 12038 * def __nonzero__(self): # <<<<<<<<<<<<<<
jpayne@68 12039 * return self.value
jpayne@68 12040 * def __eq__(self, other):
jpayne@68 12041 */
jpayne@68 12042
jpayne@68 12043 /* Python wrapper */
jpayne@68 12044 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_7__nonzero__(PyObject *__pyx_self,
jpayne@68 12045 #if CYTHON_METH_FASTCALL
jpayne@68 12046 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12047 #else
jpayne@68 12048 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12049 #endif
jpayne@68 12050 ); /*proto*/
jpayne@68 12051 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_13CallableValue_6__nonzero__, "CallableValue.__nonzero__(self)");
jpayne@68 12052 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_13CallableValue_7__nonzero__ = {"__nonzero__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_13CallableValue_7__nonzero__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_13CallableValue_6__nonzero__};
jpayne@68 12053 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_7__nonzero__(PyObject *__pyx_self,
jpayne@68 12054 #if CYTHON_METH_FASTCALL
jpayne@68 12055 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12056 #else
jpayne@68 12057 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12058 #endif
jpayne@68 12059 ) {
jpayne@68 12060 PyObject *__pyx_v_self = 0;
jpayne@68 12061 #if !CYTHON_METH_FASTCALL
jpayne@68 12062 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 12063 #endif
jpayne@68 12064 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 12065 PyObject* values[1] = {0};
jpayne@68 12066 int __pyx_lineno = 0;
jpayne@68 12067 const char *__pyx_filename = NULL;
jpayne@68 12068 int __pyx_clineno = 0;
jpayne@68 12069 PyObject *__pyx_r = 0;
jpayne@68 12070 __Pyx_RefNannyDeclarations
jpayne@68 12071 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
jpayne@68 12072 #if !CYTHON_METH_FASTCALL
jpayne@68 12073 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 12074 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 12075 #else
jpayne@68 12076 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 12077 #endif
jpayne@68 12078 #endif
jpayne@68 12079 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 12080 {
jpayne@68 12081 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
jpayne@68 12082 if (__pyx_kwds) {
jpayne@68 12083 Py_ssize_t kw_args;
jpayne@68 12084 switch (__pyx_nargs) {
jpayne@68 12085 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 12086 CYTHON_FALLTHROUGH;
jpayne@68 12087 case 0: break;
jpayne@68 12088 default: goto __pyx_L5_argtuple_error;
jpayne@68 12089 }
jpayne@68 12090 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 12091 switch (__pyx_nargs) {
jpayne@68 12092 case 0:
jpayne@68 12093 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
jpayne@68 12094 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 12095 kw_args--;
jpayne@68 12096 }
jpayne@68 12097 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L3_error)
jpayne@68 12098 else goto __pyx_L5_argtuple_error;
jpayne@68 12099 }
jpayne@68 12100 if (unlikely(kw_args > 0)) {
jpayne@68 12101 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 12102 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__nonzero__") < 0)) __PYX_ERR(0, 304, __pyx_L3_error)
jpayne@68 12103 }
jpayne@68 12104 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 12105 goto __pyx_L5_argtuple_error;
jpayne@68 12106 } else {
jpayne@68 12107 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 12108 }
jpayne@68 12109 __pyx_v_self = values[0];
jpayne@68 12110 }
jpayne@68 12111 goto __pyx_L6_skip;
jpayne@68 12112 __pyx_L5_argtuple_error:;
jpayne@68 12113 __Pyx_RaiseArgtupleInvalid("__nonzero__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 304, __pyx_L3_error)
jpayne@68 12114 __pyx_L6_skip:;
jpayne@68 12115 goto __pyx_L4_argument_unpacking_done;
jpayne@68 12116 __pyx_L3_error:;
jpayne@68 12117 {
jpayne@68 12118 Py_ssize_t __pyx_temp;
jpayne@68 12119 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 12120 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 12121 }
jpayne@68 12122 }
jpayne@68 12123 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12124 __Pyx_RefNannyFinishContext();
jpayne@68 12125 return NULL;
jpayne@68 12126 __pyx_L4_argument_unpacking_done:;
jpayne@68 12127 __pyx_r = __pyx_pf_5pysam_10libchtslib_13CallableValue_6__nonzero__(__pyx_self, __pyx_v_self);
jpayne@68 12128
jpayne@68 12129 /* function exit code */
jpayne@68 12130 {
jpayne@68 12131 Py_ssize_t __pyx_temp;
jpayne@68 12132 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 12133 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 12134 }
jpayne@68 12135 }
jpayne@68 12136 __Pyx_RefNannyFinishContext();
jpayne@68 12137 return __pyx_r;
jpayne@68 12138 }
jpayne@68 12139
jpayne@68 12140 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_6__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
jpayne@68 12141 PyObject *__pyx_r = NULL;
jpayne@68 12142 __Pyx_TraceDeclarations
jpayne@68 12143 __Pyx_RefNannyDeclarations
jpayne@68 12144 PyObject *__pyx_t_1 = NULL;
jpayne@68 12145 int __pyx_lineno = 0;
jpayne@68 12146 const char *__pyx_filename = NULL;
jpayne@68 12147 int __pyx_clineno = 0;
jpayne@68 12148 __Pyx_TraceFrameInit(__pyx_codeobj__31)
jpayne@68 12149 __Pyx_RefNannySetupContext("__nonzero__", 1);
jpayne@68 12150 __Pyx_TraceCall("__nonzero__", __pyx_f[0], 304, 0, __PYX_ERR(0, 304, __pyx_L1_error));
jpayne@68 12151
jpayne@68 12152 /* "pysam/libchtslib.pyx":305
jpayne@68 12153 * return self.value
jpayne@68 12154 * def __nonzero__(self):
jpayne@68 12155 * return self.value # <<<<<<<<<<<<<<
jpayne@68 12156 * def __eq__(self, other):
jpayne@68 12157 * return self.value == other
jpayne@68 12158 */
jpayne@68 12159 __Pyx_XDECREF(__pyx_r);
jpayne@68 12160 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
jpayne@68 12161 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 12162 __pyx_r = __pyx_t_1;
jpayne@68 12163 __pyx_t_1 = 0;
jpayne@68 12164 goto __pyx_L0;
jpayne@68 12165
jpayne@68 12166 /* "pysam/libchtslib.pyx":304
jpayne@68 12167 * def __bool__(self):
jpayne@68 12168 * return self.value
jpayne@68 12169 * def __nonzero__(self): # <<<<<<<<<<<<<<
jpayne@68 12170 * return self.value
jpayne@68 12171 * def __eq__(self, other):
jpayne@68 12172 */
jpayne@68 12173
jpayne@68 12174 /* function exit code */
jpayne@68 12175 __pyx_L1_error:;
jpayne@68 12176 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 12177 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12178 __pyx_r = NULL;
jpayne@68 12179 __pyx_L0:;
jpayne@68 12180 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 12181 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 12182 __Pyx_RefNannyFinishContext();
jpayne@68 12183 return __pyx_r;
jpayne@68 12184 }
jpayne@68 12185
jpayne@68 12186 /* "pysam/libchtslib.pyx":306
jpayne@68 12187 * def __nonzero__(self):
jpayne@68 12188 * return self.value
jpayne@68 12189 * def __eq__(self, other): # <<<<<<<<<<<<<<
jpayne@68 12190 * return self.value == other
jpayne@68 12191 * def __ne__(self, other):
jpayne@68 12192 */
jpayne@68 12193
jpayne@68 12194 /* Python wrapper */
jpayne@68 12195 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_9__eq__(PyObject *__pyx_self,
jpayne@68 12196 #if CYTHON_METH_FASTCALL
jpayne@68 12197 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12198 #else
jpayne@68 12199 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12200 #endif
jpayne@68 12201 ); /*proto*/
jpayne@68 12202 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_13CallableValue_8__eq__, "CallableValue.__eq__(self, other)");
jpayne@68 12203 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_13CallableValue_9__eq__ = {"__eq__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_13CallableValue_9__eq__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_13CallableValue_8__eq__};
jpayne@68 12204 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_9__eq__(PyObject *__pyx_self,
jpayne@68 12205 #if CYTHON_METH_FASTCALL
jpayne@68 12206 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12207 #else
jpayne@68 12208 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12209 #endif
jpayne@68 12210 ) {
jpayne@68 12211 PyObject *__pyx_v_self = 0;
jpayne@68 12212 PyObject *__pyx_v_other = 0;
jpayne@68 12213 #if !CYTHON_METH_FASTCALL
jpayne@68 12214 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 12215 #endif
jpayne@68 12216 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 12217 PyObject* values[2] = {0,0};
jpayne@68 12218 int __pyx_lineno = 0;
jpayne@68 12219 const char *__pyx_filename = NULL;
jpayne@68 12220 int __pyx_clineno = 0;
jpayne@68 12221 PyObject *__pyx_r = 0;
jpayne@68 12222 __Pyx_RefNannyDeclarations
jpayne@68 12223 __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
jpayne@68 12224 #if !CYTHON_METH_FASTCALL
jpayne@68 12225 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 12226 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 12227 #else
jpayne@68 12228 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 12229 #endif
jpayne@68 12230 #endif
jpayne@68 12231 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 12232 {
jpayne@68 12233 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
jpayne@68 12234 if (__pyx_kwds) {
jpayne@68 12235 Py_ssize_t kw_args;
jpayne@68 12236 switch (__pyx_nargs) {
jpayne@68 12237 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 12238 CYTHON_FALLTHROUGH;
jpayne@68 12239 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 12240 CYTHON_FALLTHROUGH;
jpayne@68 12241 case 0: break;
jpayne@68 12242 default: goto __pyx_L5_argtuple_error;
jpayne@68 12243 }
jpayne@68 12244 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 12245 switch (__pyx_nargs) {
jpayne@68 12246 case 0:
jpayne@68 12247 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
jpayne@68 12248 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 12249 kw_args--;
jpayne@68 12250 }
jpayne@68 12251 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L3_error)
jpayne@68 12252 else goto __pyx_L5_argtuple_error;
jpayne@68 12253 CYTHON_FALLTHROUGH;
jpayne@68 12254 case 1:
jpayne@68 12255 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) {
jpayne@68 12256 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
jpayne@68 12257 kw_args--;
jpayne@68 12258 }
jpayne@68 12259 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L3_error)
jpayne@68 12260 else {
jpayne@68 12261 __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 306, __pyx_L3_error)
jpayne@68 12262 }
jpayne@68 12263 }
jpayne@68 12264 if (unlikely(kw_args > 0)) {
jpayne@68 12265 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 12266 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__eq__") < 0)) __PYX_ERR(0, 306, __pyx_L3_error)
jpayne@68 12267 }
jpayne@68 12268 } else if (unlikely(__pyx_nargs != 2)) {
jpayne@68 12269 goto __pyx_L5_argtuple_error;
jpayne@68 12270 } else {
jpayne@68 12271 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 12272 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 12273 }
jpayne@68 12274 __pyx_v_self = values[0];
jpayne@68 12275 __pyx_v_other = values[1];
jpayne@68 12276 }
jpayne@68 12277 goto __pyx_L6_skip;
jpayne@68 12278 __pyx_L5_argtuple_error:;
jpayne@68 12279 __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 306, __pyx_L3_error)
jpayne@68 12280 __pyx_L6_skip:;
jpayne@68 12281 goto __pyx_L4_argument_unpacking_done;
jpayne@68 12282 __pyx_L3_error:;
jpayne@68 12283 {
jpayne@68 12284 Py_ssize_t __pyx_temp;
jpayne@68 12285 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 12286 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 12287 }
jpayne@68 12288 }
jpayne@68 12289 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12290 __Pyx_RefNannyFinishContext();
jpayne@68 12291 return NULL;
jpayne@68 12292 __pyx_L4_argument_unpacking_done:;
jpayne@68 12293 __pyx_r = __pyx_pf_5pysam_10libchtslib_13CallableValue_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other);
jpayne@68 12294
jpayne@68 12295 /* function exit code */
jpayne@68 12296 {
jpayne@68 12297 Py_ssize_t __pyx_temp;
jpayne@68 12298 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 12299 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 12300 }
jpayne@68 12301 }
jpayne@68 12302 __Pyx_RefNannyFinishContext();
jpayne@68 12303 return __pyx_r;
jpayne@68 12304 }
jpayne@68 12305
jpayne@68 12306 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
jpayne@68 12307 PyObject *__pyx_r = NULL;
jpayne@68 12308 __Pyx_TraceDeclarations
jpayne@68 12309 __Pyx_RefNannyDeclarations
jpayne@68 12310 PyObject *__pyx_t_1 = NULL;
jpayne@68 12311 PyObject *__pyx_t_2 = NULL;
jpayne@68 12312 int __pyx_lineno = 0;
jpayne@68 12313 const char *__pyx_filename = NULL;
jpayne@68 12314 int __pyx_clineno = 0;
jpayne@68 12315 __Pyx_TraceFrameInit(__pyx_codeobj__32)
jpayne@68 12316 __Pyx_RefNannySetupContext("__eq__", 1);
jpayne@68 12317 __Pyx_TraceCall("__eq__", __pyx_f[0], 306, 0, __PYX_ERR(0, 306, __pyx_L1_error));
jpayne@68 12318
jpayne@68 12319 /* "pysam/libchtslib.pyx":307
jpayne@68 12320 * return self.value
jpayne@68 12321 * def __eq__(self, other):
jpayne@68 12322 * return self.value == other # <<<<<<<<<<<<<<
jpayne@68 12323 * def __ne__(self, other):
jpayne@68 12324 * return self.value != other
jpayne@68 12325 */
jpayne@68 12326 __Pyx_XDECREF(__pyx_r);
jpayne@68 12327 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
jpayne@68 12328 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 12329 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
jpayne@68 12330 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 12331 __pyx_r = __pyx_t_2;
jpayne@68 12332 __pyx_t_2 = 0;
jpayne@68 12333 goto __pyx_L0;
jpayne@68 12334
jpayne@68 12335 /* "pysam/libchtslib.pyx":306
jpayne@68 12336 * def __nonzero__(self):
jpayne@68 12337 * return self.value
jpayne@68 12338 * def __eq__(self, other): # <<<<<<<<<<<<<<
jpayne@68 12339 * return self.value == other
jpayne@68 12340 * def __ne__(self, other):
jpayne@68 12341 */
jpayne@68 12342
jpayne@68 12343 /* function exit code */
jpayne@68 12344 __pyx_L1_error:;
jpayne@68 12345 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 12346 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 12347 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12348 __pyx_r = NULL;
jpayne@68 12349 __pyx_L0:;
jpayne@68 12350 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 12351 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 12352 __Pyx_RefNannyFinishContext();
jpayne@68 12353 return __pyx_r;
jpayne@68 12354 }
jpayne@68 12355
jpayne@68 12356 /* "pysam/libchtslib.pyx":308
jpayne@68 12357 * def __eq__(self, other):
jpayne@68 12358 * return self.value == other
jpayne@68 12359 * def __ne__(self, other): # <<<<<<<<<<<<<<
jpayne@68 12360 * return self.value != other
jpayne@68 12361 *
jpayne@68 12362 */
jpayne@68 12363
jpayne@68 12364 /* Python wrapper */
jpayne@68 12365 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_11__ne__(PyObject *__pyx_self,
jpayne@68 12366 #if CYTHON_METH_FASTCALL
jpayne@68 12367 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12368 #else
jpayne@68 12369 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12370 #endif
jpayne@68 12371 ); /*proto*/
jpayne@68 12372 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_13CallableValue_10__ne__, "CallableValue.__ne__(self, other)");
jpayne@68 12373 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_13CallableValue_11__ne__ = {"__ne__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_13CallableValue_11__ne__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_13CallableValue_10__ne__};
jpayne@68 12374 static PyObject *__pyx_pw_5pysam_10libchtslib_13CallableValue_11__ne__(PyObject *__pyx_self,
jpayne@68 12375 #if CYTHON_METH_FASTCALL
jpayne@68 12376 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12377 #else
jpayne@68 12378 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12379 #endif
jpayne@68 12380 ) {
jpayne@68 12381 PyObject *__pyx_v_self = 0;
jpayne@68 12382 PyObject *__pyx_v_other = 0;
jpayne@68 12383 #if !CYTHON_METH_FASTCALL
jpayne@68 12384 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 12385 #endif
jpayne@68 12386 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 12387 PyObject* values[2] = {0,0};
jpayne@68 12388 int __pyx_lineno = 0;
jpayne@68 12389 const char *__pyx_filename = NULL;
jpayne@68 12390 int __pyx_clineno = 0;
jpayne@68 12391 PyObject *__pyx_r = 0;
jpayne@68 12392 __Pyx_RefNannyDeclarations
jpayne@68 12393 __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
jpayne@68 12394 #if !CYTHON_METH_FASTCALL
jpayne@68 12395 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 12396 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 12397 #else
jpayne@68 12398 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 12399 #endif
jpayne@68 12400 #endif
jpayne@68 12401 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 12402 {
jpayne@68 12403 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
jpayne@68 12404 if (__pyx_kwds) {
jpayne@68 12405 Py_ssize_t kw_args;
jpayne@68 12406 switch (__pyx_nargs) {
jpayne@68 12407 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 12408 CYTHON_FALLTHROUGH;
jpayne@68 12409 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 12410 CYTHON_FALLTHROUGH;
jpayne@68 12411 case 0: break;
jpayne@68 12412 default: goto __pyx_L5_argtuple_error;
jpayne@68 12413 }
jpayne@68 12414 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 12415 switch (__pyx_nargs) {
jpayne@68 12416 case 0:
jpayne@68 12417 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
jpayne@68 12418 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 12419 kw_args--;
jpayne@68 12420 }
jpayne@68 12421 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
jpayne@68 12422 else goto __pyx_L5_argtuple_error;
jpayne@68 12423 CYTHON_FALLTHROUGH;
jpayne@68 12424 case 1:
jpayne@68 12425 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) {
jpayne@68 12426 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
jpayne@68 12427 kw_args--;
jpayne@68 12428 }
jpayne@68 12429 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
jpayne@68 12430 else {
jpayne@68 12431 __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 308, __pyx_L3_error)
jpayne@68 12432 }
jpayne@68 12433 }
jpayne@68 12434 if (unlikely(kw_args > 0)) {
jpayne@68 12435 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 12436 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__ne__") < 0)) __PYX_ERR(0, 308, __pyx_L3_error)
jpayne@68 12437 }
jpayne@68 12438 } else if (unlikely(__pyx_nargs != 2)) {
jpayne@68 12439 goto __pyx_L5_argtuple_error;
jpayne@68 12440 } else {
jpayne@68 12441 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 12442 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 12443 }
jpayne@68 12444 __pyx_v_self = values[0];
jpayne@68 12445 __pyx_v_other = values[1];
jpayne@68 12446 }
jpayne@68 12447 goto __pyx_L6_skip;
jpayne@68 12448 __pyx_L5_argtuple_error:;
jpayne@68 12449 __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 308, __pyx_L3_error)
jpayne@68 12450 __pyx_L6_skip:;
jpayne@68 12451 goto __pyx_L4_argument_unpacking_done;
jpayne@68 12452 __pyx_L3_error:;
jpayne@68 12453 {
jpayne@68 12454 Py_ssize_t __pyx_temp;
jpayne@68 12455 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 12456 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 12457 }
jpayne@68 12458 }
jpayne@68 12459 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12460 __Pyx_RefNannyFinishContext();
jpayne@68 12461 return NULL;
jpayne@68 12462 __pyx_L4_argument_unpacking_done:;
jpayne@68 12463 __pyx_r = __pyx_pf_5pysam_10libchtslib_13CallableValue_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other);
jpayne@68 12464
jpayne@68 12465 /* function exit code */
jpayne@68 12466 {
jpayne@68 12467 Py_ssize_t __pyx_temp;
jpayne@68 12468 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 12469 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 12470 }
jpayne@68 12471 }
jpayne@68 12472 __Pyx_RefNannyFinishContext();
jpayne@68 12473 return __pyx_r;
jpayne@68 12474 }
jpayne@68 12475
jpayne@68 12476 static PyObject *__pyx_pf_5pysam_10libchtslib_13CallableValue_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
jpayne@68 12477 PyObject *__pyx_r = NULL;
jpayne@68 12478 __Pyx_TraceDeclarations
jpayne@68 12479 __Pyx_RefNannyDeclarations
jpayne@68 12480 PyObject *__pyx_t_1 = NULL;
jpayne@68 12481 PyObject *__pyx_t_2 = NULL;
jpayne@68 12482 int __pyx_lineno = 0;
jpayne@68 12483 const char *__pyx_filename = NULL;
jpayne@68 12484 int __pyx_clineno = 0;
jpayne@68 12485 __Pyx_TraceFrameInit(__pyx_codeobj__33)
jpayne@68 12486 __Pyx_RefNannySetupContext("__ne__", 1);
jpayne@68 12487 __Pyx_TraceCall("__ne__", __pyx_f[0], 308, 0, __PYX_ERR(0, 308, __pyx_L1_error));
jpayne@68 12488
jpayne@68 12489 /* "pysam/libchtslib.pyx":309
jpayne@68 12490 * return self.value == other
jpayne@68 12491 * def __ne__(self, other):
jpayne@68 12492 * return self.value != other # <<<<<<<<<<<<<<
jpayne@68 12493 *
jpayne@68 12494 *
jpayne@68 12495 */
jpayne@68 12496 __Pyx_XDECREF(__pyx_r);
jpayne@68 12497 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
jpayne@68 12498 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 12499 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_other, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
jpayne@68 12500 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 12501 __pyx_r = __pyx_t_2;
jpayne@68 12502 __pyx_t_2 = 0;
jpayne@68 12503 goto __pyx_L0;
jpayne@68 12504
jpayne@68 12505 /* "pysam/libchtslib.pyx":308
jpayne@68 12506 * def __eq__(self, other):
jpayne@68 12507 * return self.value == other
jpayne@68 12508 * def __ne__(self, other): # <<<<<<<<<<<<<<
jpayne@68 12509 * return self.value != other
jpayne@68 12510 *
jpayne@68 12511 */
jpayne@68 12512
jpayne@68 12513 /* function exit code */
jpayne@68 12514 __pyx_L1_error:;
jpayne@68 12515 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 12516 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 12517 __Pyx_AddTraceback("pysam.libchtslib.CallableValue.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12518 __pyx_r = NULL;
jpayne@68 12519 __pyx_L0:;
jpayne@68 12520 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 12521 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 12522 __Pyx_RefNannyFinishContext();
jpayne@68 12523 return __pyx_r;
jpayne@68 12524 }
jpayne@68 12525
jpayne@68 12526 /* "pysam/libchtslib.pyx":326
jpayne@68 12527 * """
jpayne@68 12528 *
jpayne@68 12529 * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<<
jpayne@68 12530 * self.htsfile = NULL
jpayne@68 12531 * self.threads = 1
jpayne@68 12532 */
jpayne@68 12533
jpayne@68 12534 /* Python wrapper */
jpayne@68 12535 static int __pyx_pw_5pysam_10libchtslib_7HTSFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
jpayne@68 12536 static int __pyx_pw_5pysam_10libchtslib_7HTSFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
jpayne@68 12537 CYTHON_UNUSED PyObject *__pyx_v_args = 0;
jpayne@68 12538 CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
jpayne@68 12539 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 12540 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 12541 int __pyx_r;
jpayne@68 12542 __Pyx_RefNannyDeclarations
jpayne@68 12543 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
jpayne@68 12544 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 12545 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 12546 #else
jpayne@68 12547 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
jpayne@68 12548 #endif
jpayne@68 12549 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 12550 if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
jpayne@68 12551 __Pyx_INCREF(__pyx_args);
jpayne@68 12552 __pyx_v_args = __pyx_args;
jpayne@68 12553 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile___cinit__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
jpayne@68 12554
jpayne@68 12555 /* function exit code */
jpayne@68 12556 __Pyx_DECREF(__pyx_v_args);
jpayne@68 12557 __Pyx_XDECREF(__pyx_v_kwargs);
jpayne@68 12558 __Pyx_RefNannyFinishContext();
jpayne@68 12559 return __pyx_r;
jpayne@68 12560 }
jpayne@68 12561
jpayne@68 12562 static int __pyx_pf_5pysam_10libchtslib_7HTSFile___cinit__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
jpayne@68 12563 int __pyx_r;
jpayne@68 12564 __Pyx_TraceDeclarations
jpayne@68 12565 __Pyx_RefNannyDeclarations
jpayne@68 12566 int __pyx_lineno = 0;
jpayne@68 12567 const char *__pyx_filename = NULL;
jpayne@68 12568 int __pyx_clineno = 0;
jpayne@68 12569 __Pyx_RefNannySetupContext("__cinit__", 1);
jpayne@68 12570 __Pyx_TraceCall("__cinit__", __pyx_f[0], 326, 0, __PYX_ERR(0, 326, __pyx_L1_error));
jpayne@68 12571
jpayne@68 12572 /* "pysam/libchtslib.pyx":327
jpayne@68 12573 *
jpayne@68 12574 * def __cinit__(self, *args, **kwargs):
jpayne@68 12575 * self.htsfile = NULL # <<<<<<<<<<<<<<
jpayne@68 12576 * self.threads = 1
jpayne@68 12577 * self.duplicate_filehandle = True
jpayne@68 12578 */
jpayne@68 12579 __pyx_v_self->htsfile = NULL;
jpayne@68 12580
jpayne@68 12581 /* "pysam/libchtslib.pyx":328
jpayne@68 12582 * def __cinit__(self, *args, **kwargs):
jpayne@68 12583 * self.htsfile = NULL
jpayne@68 12584 * self.threads = 1 # <<<<<<<<<<<<<<
jpayne@68 12585 * self.duplicate_filehandle = True
jpayne@68 12586 *
jpayne@68 12587 */
jpayne@68 12588 __Pyx_INCREF(__pyx_int_1);
jpayne@68 12589 __Pyx_GIVEREF(__pyx_int_1);
jpayne@68 12590 __Pyx_GOTREF(__pyx_v_self->threads);
jpayne@68 12591 __Pyx_DECREF(__pyx_v_self->threads);
jpayne@68 12592 __pyx_v_self->threads = __pyx_int_1;
jpayne@68 12593
jpayne@68 12594 /* "pysam/libchtslib.pyx":329
jpayne@68 12595 * self.htsfile = NULL
jpayne@68 12596 * self.threads = 1
jpayne@68 12597 * self.duplicate_filehandle = True # <<<<<<<<<<<<<<
jpayne@68 12598 *
jpayne@68 12599 * def close(self):
jpayne@68 12600 */
jpayne@68 12601 __pyx_v_self->duplicate_filehandle = 1;
jpayne@68 12602
jpayne@68 12603 /* "pysam/libchtslib.pyx":326
jpayne@68 12604 * """
jpayne@68 12605 *
jpayne@68 12606 * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<<
jpayne@68 12607 * self.htsfile = NULL
jpayne@68 12608 * self.threads = 1
jpayne@68 12609 */
jpayne@68 12610
jpayne@68 12611 /* function exit code */
jpayne@68 12612 __pyx_r = 0;
jpayne@68 12613 goto __pyx_L0;
jpayne@68 12614 __pyx_L1_error:;
jpayne@68 12615 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12616 __pyx_r = -1;
jpayne@68 12617 __pyx_L0:;
jpayne@68 12618 __Pyx_TraceReturn(Py_None, 0);
jpayne@68 12619 __Pyx_RefNannyFinishContext();
jpayne@68 12620 return __pyx_r;
jpayne@68 12621 }
jpayne@68 12622
jpayne@68 12623 /* "pysam/libchtslib.pyx":331
jpayne@68 12624 * self.duplicate_filehandle = True
jpayne@68 12625 *
jpayne@68 12626 * def close(self): # <<<<<<<<<<<<<<
jpayne@68 12627 * if self.htsfile:
jpayne@68 12628 * hts_close(self.htsfile)
jpayne@68 12629 */
jpayne@68 12630
jpayne@68 12631 /* Python wrapper */
jpayne@68 12632 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_3close(PyObject *__pyx_v_self,
jpayne@68 12633 #if CYTHON_METH_FASTCALL
jpayne@68 12634 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12635 #else
jpayne@68 12636 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12637 #endif
jpayne@68 12638 ); /*proto*/
jpayne@68 12639 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_2close, "HTSFile.close(self)");
jpayne@68 12640 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_3close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_3close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_2close};
jpayne@68 12641 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_3close(PyObject *__pyx_v_self,
jpayne@68 12642 #if CYTHON_METH_FASTCALL
jpayne@68 12643 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12644 #else
jpayne@68 12645 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12646 #endif
jpayne@68 12647 ) {
jpayne@68 12648 #if !CYTHON_METH_FASTCALL
jpayne@68 12649 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 12650 #endif
jpayne@68 12651 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 12652 PyObject *__pyx_r = 0;
jpayne@68 12653 __Pyx_RefNannyDeclarations
jpayne@68 12654 __Pyx_RefNannySetupContext("close (wrapper)", 0);
jpayne@68 12655 #if !CYTHON_METH_FASTCALL
jpayne@68 12656 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 12657 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 12658 #else
jpayne@68 12659 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 12660 #endif
jpayne@68 12661 #endif
jpayne@68 12662 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 12663 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 12664 __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 12665 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL;
jpayne@68 12666 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_2close(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 12667
jpayne@68 12668 /* function exit code */
jpayne@68 12669 __Pyx_RefNannyFinishContext();
jpayne@68 12670 return __pyx_r;
jpayne@68 12671 }
jpayne@68 12672
jpayne@68 12673 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_2close(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 12674 PyObject *__pyx_r = NULL;
jpayne@68 12675 __Pyx_TraceDeclarations
jpayne@68 12676 __Pyx_RefNannyDeclarations
jpayne@68 12677 int __pyx_t_1;
jpayne@68 12678 int __pyx_lineno = 0;
jpayne@68 12679 const char *__pyx_filename = NULL;
jpayne@68 12680 int __pyx_clineno = 0;
jpayne@68 12681 __Pyx_TraceFrameInit(__pyx_codeobj__34)
jpayne@68 12682 __Pyx_RefNannySetupContext("close", 1);
jpayne@68 12683 __Pyx_TraceCall("close", __pyx_f[0], 331, 0, __PYX_ERR(0, 331, __pyx_L1_error));
jpayne@68 12684
jpayne@68 12685 /* "pysam/libchtslib.pyx":332
jpayne@68 12686 *
jpayne@68 12687 * def close(self):
jpayne@68 12688 * if self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 12689 * hts_close(self.htsfile)
jpayne@68 12690 * self.htsfile = NULL
jpayne@68 12691 */
jpayne@68 12692 __pyx_t_1 = (__pyx_v_self->htsfile != 0);
jpayne@68 12693 if (__pyx_t_1) {
jpayne@68 12694
jpayne@68 12695 /* "pysam/libchtslib.pyx":333
jpayne@68 12696 * def close(self):
jpayne@68 12697 * if self.htsfile:
jpayne@68 12698 * hts_close(self.htsfile) # <<<<<<<<<<<<<<
jpayne@68 12699 * self.htsfile = NULL
jpayne@68 12700 *
jpayne@68 12701 */
jpayne@68 12702 (void)(hts_close(__pyx_v_self->htsfile));
jpayne@68 12703
jpayne@68 12704 /* "pysam/libchtslib.pyx":334
jpayne@68 12705 * if self.htsfile:
jpayne@68 12706 * hts_close(self.htsfile)
jpayne@68 12707 * self.htsfile = NULL # <<<<<<<<<<<<<<
jpayne@68 12708 *
jpayne@68 12709 * def __dealloc__(self):
jpayne@68 12710 */
jpayne@68 12711 __pyx_v_self->htsfile = NULL;
jpayne@68 12712
jpayne@68 12713 /* "pysam/libchtslib.pyx":332
jpayne@68 12714 *
jpayne@68 12715 * def close(self):
jpayne@68 12716 * if self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 12717 * hts_close(self.htsfile)
jpayne@68 12718 * self.htsfile = NULL
jpayne@68 12719 */
jpayne@68 12720 }
jpayne@68 12721
jpayne@68 12722 /* "pysam/libchtslib.pyx":331
jpayne@68 12723 * self.duplicate_filehandle = True
jpayne@68 12724 *
jpayne@68 12725 * def close(self): # <<<<<<<<<<<<<<
jpayne@68 12726 * if self.htsfile:
jpayne@68 12727 * hts_close(self.htsfile)
jpayne@68 12728 */
jpayne@68 12729
jpayne@68 12730 /* function exit code */
jpayne@68 12731 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 12732 goto __pyx_L0;
jpayne@68 12733 __pyx_L1_error:;
jpayne@68 12734 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 12735 __pyx_r = NULL;
jpayne@68 12736 __pyx_L0:;
jpayne@68 12737 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 12738 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 12739 __Pyx_RefNannyFinishContext();
jpayne@68 12740 return __pyx_r;
jpayne@68 12741 }
jpayne@68 12742
jpayne@68 12743 /* "pysam/libchtslib.pyx":336
jpayne@68 12744 * self.htsfile = NULL
jpayne@68 12745 *
jpayne@68 12746 * def __dealloc__(self): # <<<<<<<<<<<<<<
jpayne@68 12747 * if self.htsfile:
jpayne@68 12748 * hts_close(self.htsfile)
jpayne@68 12749 */
jpayne@68 12750
jpayne@68 12751 /* Python wrapper */
jpayne@68 12752 static void __pyx_pw_5pysam_10libchtslib_7HTSFile_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 12753 static void __pyx_pw_5pysam_10libchtslib_7HTSFile_5__dealloc__(PyObject *__pyx_v_self) {
jpayne@68 12754 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 12755 __Pyx_RefNannyDeclarations
jpayne@68 12756 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
jpayne@68 12757 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 12758 __pyx_pf_5pysam_10libchtslib_7HTSFile_4__dealloc__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 12759
jpayne@68 12760 /* function exit code */
jpayne@68 12761 __Pyx_RefNannyFinishContext();
jpayne@68 12762 }
jpayne@68 12763
jpayne@68 12764 static void __pyx_pf_5pysam_10libchtslib_7HTSFile_4__dealloc__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 12765 __Pyx_TraceDeclarations
jpayne@68 12766 int __pyx_t_1;
jpayne@68 12767 int __pyx_lineno = 0;
jpayne@68 12768 const char *__pyx_filename = NULL;
jpayne@68 12769 int __pyx_clineno = 0;
jpayne@68 12770 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 336, 0, __PYX_ERR(0, 336, __pyx_L1_error));
jpayne@68 12771
jpayne@68 12772 /* "pysam/libchtslib.pyx":337
jpayne@68 12773 *
jpayne@68 12774 * def __dealloc__(self):
jpayne@68 12775 * if self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 12776 * hts_close(self.htsfile)
jpayne@68 12777 * self.htsfile = NULL
jpayne@68 12778 */
jpayne@68 12779 __pyx_t_1 = (__pyx_v_self->htsfile != 0);
jpayne@68 12780 if (__pyx_t_1) {
jpayne@68 12781
jpayne@68 12782 /* "pysam/libchtslib.pyx":338
jpayne@68 12783 * def __dealloc__(self):
jpayne@68 12784 * if self.htsfile:
jpayne@68 12785 * hts_close(self.htsfile) # <<<<<<<<<<<<<<
jpayne@68 12786 * self.htsfile = NULL
jpayne@68 12787 *
jpayne@68 12788 */
jpayne@68 12789 (void)(hts_close(__pyx_v_self->htsfile));
jpayne@68 12790
jpayne@68 12791 /* "pysam/libchtslib.pyx":339
jpayne@68 12792 * if self.htsfile:
jpayne@68 12793 * hts_close(self.htsfile)
jpayne@68 12794 * self.htsfile = NULL # <<<<<<<<<<<<<<
jpayne@68 12795 *
jpayne@68 12796 * def flush(self):
jpayne@68 12797 */
jpayne@68 12798 __pyx_v_self->htsfile = NULL;
jpayne@68 12799
jpayne@68 12800 /* "pysam/libchtslib.pyx":337
jpayne@68 12801 *
jpayne@68 12802 * def __dealloc__(self):
jpayne@68 12803 * if self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 12804 * hts_close(self.htsfile)
jpayne@68 12805 * self.htsfile = NULL
jpayne@68 12806 */
jpayne@68 12807 }
jpayne@68 12808
jpayne@68 12809 /* "pysam/libchtslib.pyx":336
jpayne@68 12810 * self.htsfile = NULL
jpayne@68 12811 *
jpayne@68 12812 * def __dealloc__(self): # <<<<<<<<<<<<<<
jpayne@68 12813 * if self.htsfile:
jpayne@68 12814 * hts_close(self.htsfile)
jpayne@68 12815 */
jpayne@68 12816
jpayne@68 12817 /* function exit code */
jpayne@68 12818 goto __pyx_L0;
jpayne@68 12819 __pyx_L1_error:;
jpayne@68 12820 __Pyx_WriteUnraisable("pysam.libchtslib.HTSFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
jpayne@68 12821 __pyx_L0:;
jpayne@68 12822 __Pyx_TraceReturn(Py_None, 0);
jpayne@68 12823 }
jpayne@68 12824
jpayne@68 12825 /* "pysam/libchtslib.pyx":341
jpayne@68 12826 * self.htsfile = NULL
jpayne@68 12827 *
jpayne@68 12828 * def flush(self): # <<<<<<<<<<<<<<
jpayne@68 12829 * """Flush any buffered data to the underlying output stream."""
jpayne@68 12830 * if self.htsfile:
jpayne@68 12831 */
jpayne@68 12832
jpayne@68 12833 /* Python wrapper */
jpayne@68 12834 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7flush(PyObject *__pyx_v_self,
jpayne@68 12835 #if CYTHON_METH_FASTCALL
jpayne@68 12836 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12837 #else
jpayne@68 12838 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12839 #endif
jpayne@68 12840 ); /*proto*/
jpayne@68 12841 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_6flush, "HTSFile.flush(self)\nFlush any buffered data to the underlying output stream.");
jpayne@68 12842 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_7flush = {"flush", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_7flush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_6flush};
jpayne@68 12843 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7flush(PyObject *__pyx_v_self,
jpayne@68 12844 #if CYTHON_METH_FASTCALL
jpayne@68 12845 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 12846 #else
jpayne@68 12847 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 12848 #endif
jpayne@68 12849 ) {
jpayne@68 12850 #if !CYTHON_METH_FASTCALL
jpayne@68 12851 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 12852 #endif
jpayne@68 12853 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 12854 PyObject *__pyx_r = 0;
jpayne@68 12855 __Pyx_RefNannyDeclarations
jpayne@68 12856 __Pyx_RefNannySetupContext("flush (wrapper)", 0);
jpayne@68 12857 #if !CYTHON_METH_FASTCALL
jpayne@68 12858 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 12859 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 12860 #else
jpayne@68 12861 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 12862 #endif
jpayne@68 12863 #endif
jpayne@68 12864 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 12865 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 12866 __Pyx_RaiseArgtupleInvalid("flush", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 12867 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flush", 0))) return NULL;
jpayne@68 12868 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_6flush(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 12869
jpayne@68 12870 /* function exit code */
jpayne@68 12871 __Pyx_RefNannyFinishContext();
jpayne@68 12872 return __pyx_r;
jpayne@68 12873 }
jpayne@68 12874
jpayne@68 12875 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6flush(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 12876 PyObject *__pyx_r = NULL;
jpayne@68 12877 __Pyx_TraceDeclarations
jpayne@68 12878 __Pyx_RefNannyDeclarations
jpayne@68 12879 int __pyx_t_1;
jpayne@68 12880 PyObject *__pyx_t_2 = NULL;
jpayne@68 12881 PyObject *__pyx_t_3 = NULL;
jpayne@68 12882 Py_ssize_t __pyx_t_4;
jpayne@68 12883 Py_UCS4 __pyx_t_5;
jpayne@68 12884 PyObject *__pyx_t_6 = NULL;
jpayne@68 12885 PyObject *__pyx_t_7 = NULL;
jpayne@68 12886 int __pyx_lineno = 0;
jpayne@68 12887 const char *__pyx_filename = NULL;
jpayne@68 12888 int __pyx_clineno = 0;
jpayne@68 12889 __Pyx_TraceFrameInit(__pyx_codeobj__35)
jpayne@68 12890 __Pyx_RefNannySetupContext("flush", 1);
jpayne@68 12891 __Pyx_TraceCall("flush", __pyx_f[0], 341, 0, __PYX_ERR(0, 341, __pyx_L1_error));
jpayne@68 12892
jpayne@68 12893 /* "pysam/libchtslib.pyx":343
jpayne@68 12894 * def flush(self):
jpayne@68 12895 * """Flush any buffered data to the underlying output stream."""
jpayne@68 12896 * if self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 12897 * if hts_flush(self.htsfile) < 0:
jpayne@68 12898 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename))
jpayne@68 12899 */
jpayne@68 12900 __pyx_t_1 = (__pyx_v_self->htsfile != 0);
jpayne@68 12901 if (__pyx_t_1) {
jpayne@68 12902
jpayne@68 12903 /* "pysam/libchtslib.pyx":344
jpayne@68 12904 * """Flush any buffered data to the underlying output stream."""
jpayne@68 12905 * if self.htsfile:
jpayne@68 12906 * if hts_flush(self.htsfile) < 0: # <<<<<<<<<<<<<<
jpayne@68 12907 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename))
jpayne@68 12908 *
jpayne@68 12909 */
jpayne@68 12910 __pyx_t_1 = (hts_flush(__pyx_v_self->htsfile) < 0);
jpayne@68 12911 if (unlikely(__pyx_t_1)) {
jpayne@68 12912
jpayne@68 12913 /* "pysam/libchtslib.pyx":345
jpayne@68 12914 * if self.htsfile:
jpayne@68 12915 * if hts_flush(self.htsfile) < 0:
jpayne@68 12916 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename)) # <<<<<<<<<<<<<<
jpayne@68 12917 *
jpayne@68 12918 * def check_truncation(self, ignore_truncation=False):
jpayne@68 12919 */
jpayne@68 12920 __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12921 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 12922 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12923 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 12924 __pyx_t_4 = 0;
jpayne@68 12925 __pyx_t_5 = 127;
jpayne@68 12926 __Pyx_INCREF(__pyx_kp_u_Flushing);
jpayne@68 12927 __pyx_t_4 += 9;
jpayne@68 12928 __Pyx_GIVEREF(__pyx_kp_u_Flushing);
jpayne@68 12929 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Flushing);
jpayne@68 12930 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12931 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 12932 __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12933 __Pyx_GOTREF(__pyx_t_7);
jpayne@68 12934 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 12935 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
jpayne@68 12936 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
jpayne@68 12937 __Pyx_GIVEREF(__pyx_t_7);
jpayne@68 12938 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
jpayne@68 12939 __pyx_t_7 = 0;
jpayne@68 12940 __Pyx_INCREF(__pyx_kp_u_failed);
jpayne@68 12941 __pyx_t_4 += 7;
jpayne@68 12942 __Pyx_GIVEREF(__pyx_kp_u_failed);
jpayne@68 12943 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_failed);
jpayne@68 12944 __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12945 __Pyx_GOTREF(__pyx_t_7);
jpayne@68 12946 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 12947 __pyx_t_3 = __pyx_v_self->filename;
jpayne@68 12948 __Pyx_INCREF(__pyx_t_3);
jpayne@68 12949 __pyx_t_6 = __pyx_f_5pysam_9libcutils_force_str(__pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12950 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 12951 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 12952 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12953 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 12954 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 12955 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error);
jpayne@68 12956 __Pyx_GIVEREF(__pyx_t_7);
jpayne@68 12957 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error);
jpayne@68 12958 __Pyx_GIVEREF(__pyx_t_6);
jpayne@68 12959 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error);
jpayne@68 12960 __pyx_t_2 = 0;
jpayne@68 12961 __pyx_t_7 = 0;
jpayne@68 12962 __pyx_t_6 = 0;
jpayne@68 12963 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12964 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 12965 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 12966 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
jpayne@68 12967 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 12968 __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 12969
jpayne@68 12970 /* "pysam/libchtslib.pyx":344
jpayne@68 12971 * """Flush any buffered data to the underlying output stream."""
jpayne@68 12972 * if self.htsfile:
jpayne@68 12973 * if hts_flush(self.htsfile) < 0: # <<<<<<<<<<<<<<
jpayne@68 12974 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename))
jpayne@68 12975 *
jpayne@68 12976 */
jpayne@68 12977 }
jpayne@68 12978
jpayne@68 12979 /* "pysam/libchtslib.pyx":343
jpayne@68 12980 * def flush(self):
jpayne@68 12981 * """Flush any buffered data to the underlying output stream."""
jpayne@68 12982 * if self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 12983 * if hts_flush(self.htsfile) < 0:
jpayne@68 12984 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename))
jpayne@68 12985 */
jpayne@68 12986 }
jpayne@68 12987
jpayne@68 12988 /* "pysam/libchtslib.pyx":341
jpayne@68 12989 * self.htsfile = NULL
jpayne@68 12990 *
jpayne@68 12991 * def flush(self): # <<<<<<<<<<<<<<
jpayne@68 12992 * """Flush any buffered data to the underlying output stream."""
jpayne@68 12993 * if self.htsfile:
jpayne@68 12994 */
jpayne@68 12995
jpayne@68 12996 /* function exit code */
jpayne@68 12997 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 12998 goto __pyx_L0;
jpayne@68 12999 __pyx_L1_error:;
jpayne@68 13000 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 13001 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 13002 __Pyx_XDECREF(__pyx_t_6);
jpayne@68 13003 __Pyx_XDECREF(__pyx_t_7);
jpayne@68 13004 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 13005 __pyx_r = NULL;
jpayne@68 13006 __pyx_L0:;
jpayne@68 13007 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 13008 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 13009 __Pyx_RefNannyFinishContext();
jpayne@68 13010 return __pyx_r;
jpayne@68 13011 }
jpayne@68 13012
jpayne@68 13013 /* "pysam/libchtslib.pyx":347
jpayne@68 13014 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename))
jpayne@68 13015 *
jpayne@68 13016 * def check_truncation(self, ignore_truncation=False): # <<<<<<<<<<<<<<
jpayne@68 13017 * """Check if file is truncated."""
jpayne@68 13018 * if not self.htsfile:
jpayne@68 13019 */
jpayne@68 13020
jpayne@68 13021 /* Python wrapper */
jpayne@68 13022 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_9check_truncation(PyObject *__pyx_v_self,
jpayne@68 13023 #if CYTHON_METH_FASTCALL
jpayne@68 13024 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 13025 #else
jpayne@68 13026 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 13027 #endif
jpayne@68 13028 ); /*proto*/
jpayne@68 13029 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_8check_truncation, "HTSFile.check_truncation(self, ignore_truncation=False)\nCheck if file is truncated.");
jpayne@68 13030 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_9check_truncation = {"check_truncation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_9check_truncation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_8check_truncation};
jpayne@68 13031 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_9check_truncation(PyObject *__pyx_v_self,
jpayne@68 13032 #if CYTHON_METH_FASTCALL
jpayne@68 13033 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 13034 #else
jpayne@68 13035 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 13036 #endif
jpayne@68 13037 ) {
jpayne@68 13038 PyObject *__pyx_v_ignore_truncation = 0;
jpayne@68 13039 #if !CYTHON_METH_FASTCALL
jpayne@68 13040 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 13041 #endif
jpayne@68 13042 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 13043 PyObject* values[1] = {0};
jpayne@68 13044 int __pyx_lineno = 0;
jpayne@68 13045 const char *__pyx_filename = NULL;
jpayne@68 13046 int __pyx_clineno = 0;
jpayne@68 13047 PyObject *__pyx_r = 0;
jpayne@68 13048 __Pyx_RefNannyDeclarations
jpayne@68 13049 __Pyx_RefNannySetupContext("check_truncation (wrapper)", 0);
jpayne@68 13050 #if !CYTHON_METH_FASTCALL
jpayne@68 13051 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 13052 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 13053 #else
jpayne@68 13054 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 13055 #endif
jpayne@68 13056 #endif
jpayne@68 13057 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 13058 {
jpayne@68 13059 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ignore_truncation,0};
jpayne@68 13060 values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
jpayne@68 13061 if (__pyx_kwds) {
jpayne@68 13062 Py_ssize_t kw_args;
jpayne@68 13063 switch (__pyx_nargs) {
jpayne@68 13064 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 13065 CYTHON_FALLTHROUGH;
jpayne@68 13066 case 0: break;
jpayne@68 13067 default: goto __pyx_L5_argtuple_error;
jpayne@68 13068 }
jpayne@68 13069 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 13070 switch (__pyx_nargs) {
jpayne@68 13071 case 0:
jpayne@68 13072 if (kw_args > 0) {
jpayne@68 13073 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ignore_truncation);
jpayne@68 13074 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 13075 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error)
jpayne@68 13076 }
jpayne@68 13077 }
jpayne@68 13078 if (unlikely(kw_args > 0)) {
jpayne@68 13079 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 13080 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "check_truncation") < 0)) __PYX_ERR(0, 347, __pyx_L3_error)
jpayne@68 13081 }
jpayne@68 13082 } else {
jpayne@68 13083 switch (__pyx_nargs) {
jpayne@68 13084 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 13085 CYTHON_FALLTHROUGH;
jpayne@68 13086 case 0: break;
jpayne@68 13087 default: goto __pyx_L5_argtuple_error;
jpayne@68 13088 }
jpayne@68 13089 }
jpayne@68 13090 __pyx_v_ignore_truncation = values[0];
jpayne@68 13091 }
jpayne@68 13092 goto __pyx_L6_skip;
jpayne@68 13093 __pyx_L5_argtuple_error:;
jpayne@68 13094 __Pyx_RaiseArgtupleInvalid("check_truncation", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 347, __pyx_L3_error)
jpayne@68 13095 __pyx_L6_skip:;
jpayne@68 13096 goto __pyx_L4_argument_unpacking_done;
jpayne@68 13097 __pyx_L3_error:;
jpayne@68 13098 {
jpayne@68 13099 Py_ssize_t __pyx_temp;
jpayne@68 13100 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 13101 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 13102 }
jpayne@68 13103 }
jpayne@68 13104 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.check_truncation", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 13105 __Pyx_RefNannyFinishContext();
jpayne@68 13106 return NULL;
jpayne@68 13107 __pyx_L4_argument_unpacking_done:;
jpayne@68 13108 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_8check_truncation(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_ignore_truncation);
jpayne@68 13109
jpayne@68 13110 /* function exit code */
jpayne@68 13111 {
jpayne@68 13112 Py_ssize_t __pyx_temp;
jpayne@68 13113 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 13114 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 13115 }
jpayne@68 13116 }
jpayne@68 13117 __Pyx_RefNannyFinishContext();
jpayne@68 13118 return __pyx_r;
jpayne@68 13119 }
jpayne@68 13120
jpayne@68 13121 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_8check_truncation(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, PyObject *__pyx_v_ignore_truncation) {
jpayne@68 13122 BGZF *__pyx_v_bgzfp;
jpayne@68 13123 int __pyx_v_ret;
jpayne@68 13124 PyObject *__pyx_v_msg = NULL;
jpayne@68 13125 PyObject *__pyx_r = NULL;
jpayne@68 13126 __Pyx_TraceDeclarations
jpayne@68 13127 __Pyx_RefNannyDeclarations
jpayne@68 13128 int __pyx_t_1;
jpayne@68 13129 PyObject *__pyx_t_2 = NULL;
jpayne@68 13130 PyObject *__pyx_t_3 = NULL;
jpayne@68 13131 PyObject *__pyx_t_4 = NULL;
jpayne@68 13132 unsigned int __pyx_t_5;
jpayne@68 13133 int __pyx_lineno = 0;
jpayne@68 13134 const char *__pyx_filename = NULL;
jpayne@68 13135 int __pyx_clineno = 0;
jpayne@68 13136 __Pyx_TraceFrameInit(__pyx_codeobj__36)
jpayne@68 13137 __Pyx_RefNannySetupContext("check_truncation", 1);
jpayne@68 13138 __Pyx_TraceCall("check_truncation", __pyx_f[0], 347, 0, __PYX_ERR(0, 347, __pyx_L1_error));
jpayne@68 13139
jpayne@68 13140 /* "pysam/libchtslib.pyx":349
jpayne@68 13141 * def check_truncation(self, ignore_truncation=False):
jpayne@68 13142 * """Check if file is truncated."""
jpayne@68 13143 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 13144 * return
jpayne@68 13145 *
jpayne@68 13146 */
jpayne@68 13147 __pyx_t_1 = (!(__pyx_v_self->htsfile != 0));
jpayne@68 13148 if (__pyx_t_1) {
jpayne@68 13149
jpayne@68 13150 /* "pysam/libchtslib.pyx":350
jpayne@68 13151 * """Check if file is truncated."""
jpayne@68 13152 * if not self.htsfile:
jpayne@68 13153 * return # <<<<<<<<<<<<<<
jpayne@68 13154 *
jpayne@68 13155 * if self.htsfile.format.compression != bgzf:
jpayne@68 13156 */
jpayne@68 13157 __Pyx_XDECREF(__pyx_r);
jpayne@68 13158 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 13159 goto __pyx_L0;
jpayne@68 13160
jpayne@68 13161 /* "pysam/libchtslib.pyx":349
jpayne@68 13162 * def check_truncation(self, ignore_truncation=False):
jpayne@68 13163 * """Check if file is truncated."""
jpayne@68 13164 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 13165 * return
jpayne@68 13166 *
jpayne@68 13167 */
jpayne@68 13168 }
jpayne@68 13169
jpayne@68 13170 /* "pysam/libchtslib.pyx":352
jpayne@68 13171 * return
jpayne@68 13172 *
jpayne@68 13173 * if self.htsfile.format.compression != bgzf: # <<<<<<<<<<<<<<
jpayne@68 13174 * return
jpayne@68 13175 *
jpayne@68 13176 */
jpayne@68 13177 __pyx_t_1 = (__pyx_v_self->htsfile->format.compression != bgzf);
jpayne@68 13178 if (__pyx_t_1) {
jpayne@68 13179
jpayne@68 13180 /* "pysam/libchtslib.pyx":353
jpayne@68 13181 *
jpayne@68 13182 * if self.htsfile.format.compression != bgzf:
jpayne@68 13183 * return # <<<<<<<<<<<<<<
jpayne@68 13184 *
jpayne@68 13185 * cdef BGZF *bgzfp = hts_get_bgzfp(self.htsfile)
jpayne@68 13186 */
jpayne@68 13187 __Pyx_XDECREF(__pyx_r);
jpayne@68 13188 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 13189 goto __pyx_L0;
jpayne@68 13190
jpayne@68 13191 /* "pysam/libchtslib.pyx":352
jpayne@68 13192 * return
jpayne@68 13193 *
jpayne@68 13194 * if self.htsfile.format.compression != bgzf: # <<<<<<<<<<<<<<
jpayne@68 13195 * return
jpayne@68 13196 *
jpayne@68 13197 */
jpayne@68 13198 }
jpayne@68 13199
jpayne@68 13200 /* "pysam/libchtslib.pyx":355
jpayne@68 13201 * return
jpayne@68 13202 *
jpayne@68 13203 * cdef BGZF *bgzfp = hts_get_bgzfp(self.htsfile) # <<<<<<<<<<<<<<
jpayne@68 13204 * if not bgzfp:
jpayne@68 13205 * return
jpayne@68 13206 */
jpayne@68 13207 __pyx_v_bgzfp = hts_get_bgzfp(__pyx_v_self->htsfile);
jpayne@68 13208
jpayne@68 13209 /* "pysam/libchtslib.pyx":356
jpayne@68 13210 *
jpayne@68 13211 * cdef BGZF *bgzfp = hts_get_bgzfp(self.htsfile)
jpayne@68 13212 * if not bgzfp: # <<<<<<<<<<<<<<
jpayne@68 13213 * return
jpayne@68 13214 *
jpayne@68 13215 */
jpayne@68 13216 __pyx_t_1 = (!(__pyx_v_bgzfp != 0));
jpayne@68 13217 if (__pyx_t_1) {
jpayne@68 13218
jpayne@68 13219 /* "pysam/libchtslib.pyx":357
jpayne@68 13220 * cdef BGZF *bgzfp = hts_get_bgzfp(self.htsfile)
jpayne@68 13221 * if not bgzfp:
jpayne@68 13222 * return # <<<<<<<<<<<<<<
jpayne@68 13223 *
jpayne@68 13224 * cdef int ret = bgzf_check_EOF(bgzfp)
jpayne@68 13225 */
jpayne@68 13226 __Pyx_XDECREF(__pyx_r);
jpayne@68 13227 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 13228 goto __pyx_L0;
jpayne@68 13229
jpayne@68 13230 /* "pysam/libchtslib.pyx":356
jpayne@68 13231 *
jpayne@68 13232 * cdef BGZF *bgzfp = hts_get_bgzfp(self.htsfile)
jpayne@68 13233 * if not bgzfp: # <<<<<<<<<<<<<<
jpayne@68 13234 * return
jpayne@68 13235 *
jpayne@68 13236 */
jpayne@68 13237 }
jpayne@68 13238
jpayne@68 13239 /* "pysam/libchtslib.pyx":359
jpayne@68 13240 * return
jpayne@68 13241 *
jpayne@68 13242 * cdef int ret = bgzf_check_EOF(bgzfp) # <<<<<<<<<<<<<<
jpayne@68 13243 * if ret < 0:
jpayne@68 13244 * raise IOError(errno, 'error checking for EOF marker')
jpayne@68 13245 */
jpayne@68 13246 __pyx_v_ret = bgzf_check_EOF(__pyx_v_bgzfp);
jpayne@68 13247
jpayne@68 13248 /* "pysam/libchtslib.pyx":360
jpayne@68 13249 *
jpayne@68 13250 * cdef int ret = bgzf_check_EOF(bgzfp)
jpayne@68 13251 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 13252 * raise IOError(errno, 'error checking for EOF marker')
jpayne@68 13253 * elif ret == 0:
jpayne@68 13254 */
jpayne@68 13255 __pyx_t_1 = (__pyx_v_ret < 0);
jpayne@68 13256 if (unlikely(__pyx_t_1)) {
jpayne@68 13257
jpayne@68 13258 /* "pysam/libchtslib.pyx":361
jpayne@68 13259 * cdef int ret = bgzf_check_EOF(bgzfp)
jpayne@68 13260 * if ret < 0:
jpayne@68 13261 * raise IOError(errno, 'error checking for EOF marker') # <<<<<<<<<<<<<<
jpayne@68 13262 * elif ret == 0:
jpayne@68 13263 * msg = 'no BGZF EOF marker; file may be truncated'.format(self.filename)
jpayne@68 13264 */
jpayne@68 13265 __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
jpayne@68 13266 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13267 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
jpayne@68 13268 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 13269 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 13270 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error);
jpayne@68 13271 __Pyx_INCREF(__pyx_kp_u_error_checking_for_EOF_marker);
jpayne@68 13272 __Pyx_GIVEREF(__pyx_kp_u_error_checking_for_EOF_marker);
jpayne@68 13273 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_error_checking_for_EOF_marker)) __PYX_ERR(0, 361, __pyx_L1_error);
jpayne@68 13274 __pyx_t_2 = 0;
jpayne@68 13275 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
jpayne@68 13276 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13277 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 13278 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 13279 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 13280 __PYX_ERR(0, 361, __pyx_L1_error)
jpayne@68 13281
jpayne@68 13282 /* "pysam/libchtslib.pyx":360
jpayne@68 13283 *
jpayne@68 13284 * cdef int ret = bgzf_check_EOF(bgzfp)
jpayne@68 13285 * if ret < 0: # <<<<<<<<<<<<<<
jpayne@68 13286 * raise IOError(errno, 'error checking for EOF marker')
jpayne@68 13287 * elif ret == 0:
jpayne@68 13288 */
jpayne@68 13289 }
jpayne@68 13290
jpayne@68 13291 /* "pysam/libchtslib.pyx":362
jpayne@68 13292 * if ret < 0:
jpayne@68 13293 * raise IOError(errno, 'error checking for EOF marker')
jpayne@68 13294 * elif ret == 0: # <<<<<<<<<<<<<<
jpayne@68 13295 * msg = 'no BGZF EOF marker; file may be truncated'.format(self.filename)
jpayne@68 13296 * if ignore_truncation:
jpayne@68 13297 */
jpayne@68 13298 __pyx_t_1 = (__pyx_v_ret == 0);
jpayne@68 13299 if (__pyx_t_1) {
jpayne@68 13300
jpayne@68 13301 /* "pysam/libchtslib.pyx":363
jpayne@68 13302 * raise IOError(errno, 'error checking for EOF marker')
jpayne@68 13303 * elif ret == 0:
jpayne@68 13304 * msg = 'no BGZF EOF marker; file may be truncated'.format(self.filename) # <<<<<<<<<<<<<<
jpayne@68 13305 * if ignore_truncation:
jpayne@68 13306 * warn(msg)
jpayne@68 13307 */
jpayne@68 13308 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_BGZF_EOF_marker_file_may_be_t, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error)
jpayne@68 13309 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 13310 __pyx_t_4 = NULL;
jpayne@68 13311 __pyx_t_5 = 0;
jpayne@68 13312 #if CYTHON_UNPACK_METHODS
jpayne@68 13313 if (likely(PyMethod_Check(__pyx_t_3))) {
jpayne@68 13314 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
jpayne@68 13315 if (likely(__pyx_t_4)) {
jpayne@68 13316 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
jpayne@68 13317 __Pyx_INCREF(__pyx_t_4);
jpayne@68 13318 __Pyx_INCREF(function);
jpayne@68 13319 __Pyx_DECREF_SET(__pyx_t_3, function);
jpayne@68 13320 __pyx_t_5 = 1;
jpayne@68 13321 }
jpayne@68 13322 }
jpayne@68 13323 #endif
jpayne@68 13324 {
jpayne@68 13325 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->filename};
jpayne@68 13326 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
jpayne@68 13327 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 13328 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
jpayne@68 13329 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13330 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 13331 }
jpayne@68 13332 __pyx_v_msg = __pyx_t_2;
jpayne@68 13333 __pyx_t_2 = 0;
jpayne@68 13334
jpayne@68 13335 /* "pysam/libchtslib.pyx":364
jpayne@68 13336 * elif ret == 0:
jpayne@68 13337 * msg = 'no BGZF EOF marker; file may be truncated'.format(self.filename)
jpayne@68 13338 * if ignore_truncation: # <<<<<<<<<<<<<<
jpayne@68 13339 * warn(msg)
jpayne@68 13340 * else:
jpayne@68 13341 */
jpayne@68 13342 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_truncation); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 364, __pyx_L1_error)
jpayne@68 13343 if (likely(__pyx_t_1)) {
jpayne@68 13344
jpayne@68 13345 /* "pysam/libchtslib.pyx":365
jpayne@68 13346 * msg = 'no BGZF EOF marker; file may be truncated'.format(self.filename)
jpayne@68 13347 * if ignore_truncation:
jpayne@68 13348 * warn(msg) # <<<<<<<<<<<<<<
jpayne@68 13349 * else:
jpayne@68 13350 * raise IOError(msg)
jpayne@68 13351 */
jpayne@68 13352 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
jpayne@68 13353 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 13354 __pyx_t_4 = NULL;
jpayne@68 13355 __pyx_t_5 = 0;
jpayne@68 13356 #if CYTHON_UNPACK_METHODS
jpayne@68 13357 if (unlikely(PyMethod_Check(__pyx_t_3))) {
jpayne@68 13358 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
jpayne@68 13359 if (likely(__pyx_t_4)) {
jpayne@68 13360 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
jpayne@68 13361 __Pyx_INCREF(__pyx_t_4);
jpayne@68 13362 __Pyx_INCREF(function);
jpayne@68 13363 __Pyx_DECREF_SET(__pyx_t_3, function);
jpayne@68 13364 __pyx_t_5 = 1;
jpayne@68 13365 }
jpayne@68 13366 }
jpayne@68 13367 #endif
jpayne@68 13368 {
jpayne@68 13369 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_msg};
jpayne@68 13370 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
jpayne@68 13371 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 13372 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
jpayne@68 13373 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13374 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 13375 }
jpayne@68 13376 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 13377
jpayne@68 13378 /* "pysam/libchtslib.pyx":364
jpayne@68 13379 * elif ret == 0:
jpayne@68 13380 * msg = 'no BGZF EOF marker; file may be truncated'.format(self.filename)
jpayne@68 13381 * if ignore_truncation: # <<<<<<<<<<<<<<
jpayne@68 13382 * warn(msg)
jpayne@68 13383 * else:
jpayne@68 13384 */
jpayne@68 13385 goto __pyx_L7;
jpayne@68 13386 }
jpayne@68 13387
jpayne@68 13388 /* "pysam/libchtslib.pyx":367
jpayne@68 13389 * warn(msg)
jpayne@68 13390 * else:
jpayne@68 13391 * raise IOError(msg) # <<<<<<<<<<<<<<
jpayne@68 13392 *
jpayne@68 13393 * def __enter__(self):
jpayne@68 13394 */
jpayne@68 13395 /*else*/ {
jpayne@68 13396 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
jpayne@68 13397 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13398 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 13399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 13400 __PYX_ERR(0, 367, __pyx_L1_error)
jpayne@68 13401 }
jpayne@68 13402 __pyx_L7:;
jpayne@68 13403
jpayne@68 13404 /* "pysam/libchtslib.pyx":362
jpayne@68 13405 * if ret < 0:
jpayne@68 13406 * raise IOError(errno, 'error checking for EOF marker')
jpayne@68 13407 * elif ret == 0: # <<<<<<<<<<<<<<
jpayne@68 13408 * msg = 'no BGZF EOF marker; file may be truncated'.format(self.filename)
jpayne@68 13409 * if ignore_truncation:
jpayne@68 13410 */
jpayne@68 13411 }
jpayne@68 13412
jpayne@68 13413 /* "pysam/libchtslib.pyx":347
jpayne@68 13414 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename))
jpayne@68 13415 *
jpayne@68 13416 * def check_truncation(self, ignore_truncation=False): # <<<<<<<<<<<<<<
jpayne@68 13417 * """Check if file is truncated."""
jpayne@68 13418 * if not self.htsfile:
jpayne@68 13419 */
jpayne@68 13420
jpayne@68 13421 /* function exit code */
jpayne@68 13422 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 13423 goto __pyx_L0;
jpayne@68 13424 __pyx_L1_error:;
jpayne@68 13425 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 13426 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 13427 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 13428 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.check_truncation", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 13429 __pyx_r = NULL;
jpayne@68 13430 __pyx_L0:;
jpayne@68 13431 __Pyx_XDECREF(__pyx_v_msg);
jpayne@68 13432 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 13433 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 13434 __Pyx_RefNannyFinishContext();
jpayne@68 13435 return __pyx_r;
jpayne@68 13436 }
jpayne@68 13437
jpayne@68 13438 /* "pysam/libchtslib.pyx":369
jpayne@68 13439 * raise IOError(msg)
jpayne@68 13440 *
jpayne@68 13441 * def __enter__(self): # <<<<<<<<<<<<<<
jpayne@68 13442 * return self
jpayne@68 13443 *
jpayne@68 13444 */
jpayne@68 13445
jpayne@68 13446 /* Python wrapper */
jpayne@68 13447 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_11__enter__(PyObject *__pyx_v_self,
jpayne@68 13448 #if CYTHON_METH_FASTCALL
jpayne@68 13449 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 13450 #else
jpayne@68 13451 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 13452 #endif
jpayne@68 13453 ); /*proto*/
jpayne@68 13454 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_10__enter__, "HTSFile.__enter__(self)");
jpayne@68 13455 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_11__enter__ = {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_11__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_10__enter__};
jpayne@68 13456 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_11__enter__(PyObject *__pyx_v_self,
jpayne@68 13457 #if CYTHON_METH_FASTCALL
jpayne@68 13458 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 13459 #else
jpayne@68 13460 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 13461 #endif
jpayne@68 13462 ) {
jpayne@68 13463 #if !CYTHON_METH_FASTCALL
jpayne@68 13464 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 13465 #endif
jpayne@68 13466 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 13467 PyObject *__pyx_r = 0;
jpayne@68 13468 __Pyx_RefNannyDeclarations
jpayne@68 13469 __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
jpayne@68 13470 #if !CYTHON_METH_FASTCALL
jpayne@68 13471 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 13472 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 13473 #else
jpayne@68 13474 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 13475 #endif
jpayne@68 13476 #endif
jpayne@68 13477 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 13478 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 13479 __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 13480 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
jpayne@68 13481 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_10__enter__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 13482
jpayne@68 13483 /* function exit code */
jpayne@68 13484 __Pyx_RefNannyFinishContext();
jpayne@68 13485 return __pyx_r;
jpayne@68 13486 }
jpayne@68 13487
jpayne@68 13488 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_10__enter__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 13489 PyObject *__pyx_r = NULL;
jpayne@68 13490 __Pyx_TraceDeclarations
jpayne@68 13491 __Pyx_RefNannyDeclarations
jpayne@68 13492 int __pyx_lineno = 0;
jpayne@68 13493 const char *__pyx_filename = NULL;
jpayne@68 13494 int __pyx_clineno = 0;
jpayne@68 13495 __Pyx_TraceFrameInit(__pyx_codeobj__37)
jpayne@68 13496 __Pyx_RefNannySetupContext("__enter__", 1);
jpayne@68 13497 __Pyx_TraceCall("__enter__", __pyx_f[0], 369, 0, __PYX_ERR(0, 369, __pyx_L1_error));
jpayne@68 13498
jpayne@68 13499 /* "pysam/libchtslib.pyx":370
jpayne@68 13500 *
jpayne@68 13501 * def __enter__(self):
jpayne@68 13502 * return self # <<<<<<<<<<<<<<
jpayne@68 13503 *
jpayne@68 13504 * def __exit__(self, exc_type, exc_value, traceback):
jpayne@68 13505 */
jpayne@68 13506 __Pyx_XDECREF(__pyx_r);
jpayne@68 13507 __Pyx_INCREF((PyObject *)__pyx_v_self);
jpayne@68 13508 __pyx_r = ((PyObject *)__pyx_v_self);
jpayne@68 13509 goto __pyx_L0;
jpayne@68 13510
jpayne@68 13511 /* "pysam/libchtslib.pyx":369
jpayne@68 13512 * raise IOError(msg)
jpayne@68 13513 *
jpayne@68 13514 * def __enter__(self): # <<<<<<<<<<<<<<
jpayne@68 13515 * return self
jpayne@68 13516 *
jpayne@68 13517 */
jpayne@68 13518
jpayne@68 13519 /* function exit code */
jpayne@68 13520 __pyx_L1_error:;
jpayne@68 13521 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 13522 __pyx_r = NULL;
jpayne@68 13523 __pyx_L0:;
jpayne@68 13524 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 13525 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 13526 __Pyx_RefNannyFinishContext();
jpayne@68 13527 return __pyx_r;
jpayne@68 13528 }
jpayne@68 13529
jpayne@68 13530 /* "pysam/libchtslib.pyx":372
jpayne@68 13531 * return self
jpayne@68 13532 *
jpayne@68 13533 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<<
jpayne@68 13534 * self.close()
jpayne@68 13535 * return False
jpayne@68 13536 */
jpayne@68 13537
jpayne@68 13538 /* Python wrapper */
jpayne@68 13539 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_13__exit__(PyObject *__pyx_v_self,
jpayne@68 13540 #if CYTHON_METH_FASTCALL
jpayne@68 13541 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 13542 #else
jpayne@68 13543 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 13544 #endif
jpayne@68 13545 ); /*proto*/
jpayne@68 13546 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_12__exit__, "HTSFile.__exit__(self, exc_type, exc_value, traceback)");
jpayne@68 13547 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_13__exit__ = {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_13__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_12__exit__};
jpayne@68 13548 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_13__exit__(PyObject *__pyx_v_self,
jpayne@68 13549 #if CYTHON_METH_FASTCALL
jpayne@68 13550 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 13551 #else
jpayne@68 13552 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 13553 #endif
jpayne@68 13554 ) {
jpayne@68 13555 CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
jpayne@68 13556 CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0;
jpayne@68 13557 CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
jpayne@68 13558 #if !CYTHON_METH_FASTCALL
jpayne@68 13559 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 13560 #endif
jpayne@68 13561 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 13562 PyObject* values[3] = {0,0,0};
jpayne@68 13563 int __pyx_lineno = 0;
jpayne@68 13564 const char *__pyx_filename = NULL;
jpayne@68 13565 int __pyx_clineno = 0;
jpayne@68 13566 PyObject *__pyx_r = 0;
jpayne@68 13567 __Pyx_RefNannyDeclarations
jpayne@68 13568 __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
jpayne@68 13569 #if !CYTHON_METH_FASTCALL
jpayne@68 13570 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 13571 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 13572 #else
jpayne@68 13573 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 13574 #endif
jpayne@68 13575 #endif
jpayne@68 13576 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 13577 {
jpayne@68 13578 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_value,&__pyx_n_s_traceback,0};
jpayne@68 13579 if (__pyx_kwds) {
jpayne@68 13580 Py_ssize_t kw_args;
jpayne@68 13581 switch (__pyx_nargs) {
jpayne@68 13582 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
jpayne@68 13583 CYTHON_FALLTHROUGH;
jpayne@68 13584 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 13585 CYTHON_FALLTHROUGH;
jpayne@68 13586 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 13587 CYTHON_FALLTHROUGH;
jpayne@68 13588 case 0: break;
jpayne@68 13589 default: goto __pyx_L5_argtuple_error;
jpayne@68 13590 }
jpayne@68 13591 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 13592 switch (__pyx_nargs) {
jpayne@68 13593 case 0:
jpayne@68 13594 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_type)) != 0)) {
jpayne@68 13595 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 13596 kw_args--;
jpayne@68 13597 }
jpayne@68 13598 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
jpayne@68 13599 else goto __pyx_L5_argtuple_error;
jpayne@68 13600 CYTHON_FALLTHROUGH;
jpayne@68 13601 case 1:
jpayne@68 13602 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_value)) != 0)) {
jpayne@68 13603 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
jpayne@68 13604 kw_args--;
jpayne@68 13605 }
jpayne@68 13606 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
jpayne@68 13607 else {
jpayne@68 13608 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 372, __pyx_L3_error)
jpayne@68 13609 }
jpayne@68 13610 CYTHON_FALLTHROUGH;
jpayne@68 13611 case 2:
jpayne@68 13612 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_traceback)) != 0)) {
jpayne@68 13613 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
jpayne@68 13614 kw_args--;
jpayne@68 13615 }
jpayne@68 13616 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
jpayne@68 13617 else {
jpayne@68 13618 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 372, __pyx_L3_error)
jpayne@68 13619 }
jpayne@68 13620 }
jpayne@68 13621 if (unlikely(kw_args > 0)) {
jpayne@68 13622 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 13623 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__exit__") < 0)) __PYX_ERR(0, 372, __pyx_L3_error)
jpayne@68 13624 }
jpayne@68 13625 } else if (unlikely(__pyx_nargs != 3)) {
jpayne@68 13626 goto __pyx_L5_argtuple_error;
jpayne@68 13627 } else {
jpayne@68 13628 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 13629 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 13630 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
jpayne@68 13631 }
jpayne@68 13632 __pyx_v_exc_type = values[0];
jpayne@68 13633 __pyx_v_exc_value = values[1];
jpayne@68 13634 __pyx_v_traceback = values[2];
jpayne@68 13635 }
jpayne@68 13636 goto __pyx_L6_skip;
jpayne@68 13637 __pyx_L5_argtuple_error:;
jpayne@68 13638 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 372, __pyx_L3_error)
jpayne@68 13639 __pyx_L6_skip:;
jpayne@68 13640 goto __pyx_L4_argument_unpacking_done;
jpayne@68 13641 __pyx_L3_error:;
jpayne@68 13642 {
jpayne@68 13643 Py_ssize_t __pyx_temp;
jpayne@68 13644 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 13645 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 13646 }
jpayne@68 13647 }
jpayne@68 13648 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 13649 __Pyx_RefNannyFinishContext();
jpayne@68 13650 return NULL;
jpayne@68 13651 __pyx_L4_argument_unpacking_done:;
jpayne@68 13652 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_12__exit__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_traceback);
jpayne@68 13653
jpayne@68 13654 /* function exit code */
jpayne@68 13655 {
jpayne@68 13656 Py_ssize_t __pyx_temp;
jpayne@68 13657 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 13658 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 13659 }
jpayne@68 13660 }
jpayne@68 13661 __Pyx_RefNannyFinishContext();
jpayne@68 13662 return __pyx_r;
jpayne@68 13663 }
jpayne@68 13664
jpayne@68 13665 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_12__exit__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
jpayne@68 13666 PyObject *__pyx_r = NULL;
jpayne@68 13667 __Pyx_TraceDeclarations
jpayne@68 13668 __Pyx_RefNannyDeclarations
jpayne@68 13669 PyObject *__pyx_t_1 = NULL;
jpayne@68 13670 PyObject *__pyx_t_2 = NULL;
jpayne@68 13671 PyObject *__pyx_t_3 = NULL;
jpayne@68 13672 unsigned int __pyx_t_4;
jpayne@68 13673 int __pyx_lineno = 0;
jpayne@68 13674 const char *__pyx_filename = NULL;
jpayne@68 13675 int __pyx_clineno = 0;
jpayne@68 13676 __Pyx_TraceFrameInit(__pyx_codeobj__38)
jpayne@68 13677 __Pyx_RefNannySetupContext("__exit__", 1);
jpayne@68 13678 __Pyx_TraceCall("__exit__", __pyx_f[0], 372, 0, __PYX_ERR(0, 372, __pyx_L1_error));
jpayne@68 13679
jpayne@68 13680 /* "pysam/libchtslib.pyx":373
jpayne@68 13681 *
jpayne@68 13682 * def __exit__(self, exc_type, exc_value, traceback):
jpayne@68 13683 * self.close() # <<<<<<<<<<<<<<
jpayne@68 13684 * return False
jpayne@68 13685 *
jpayne@68 13686 */
jpayne@68 13687 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
jpayne@68 13688 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13689 __pyx_t_3 = NULL;
jpayne@68 13690 __pyx_t_4 = 0;
jpayne@68 13691 #if CYTHON_UNPACK_METHODS
jpayne@68 13692 if (likely(PyMethod_Check(__pyx_t_2))) {
jpayne@68 13693 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
jpayne@68 13694 if (likely(__pyx_t_3)) {
jpayne@68 13695 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
jpayne@68 13696 __Pyx_INCREF(__pyx_t_3);
jpayne@68 13697 __Pyx_INCREF(function);
jpayne@68 13698 __Pyx_DECREF_SET(__pyx_t_2, function);
jpayne@68 13699 __pyx_t_4 = 1;
jpayne@68 13700 }
jpayne@68 13701 }
jpayne@68 13702 #endif
jpayne@68 13703 {
jpayne@68 13704 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
jpayne@68 13705 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
jpayne@68 13706 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 13707 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
jpayne@68 13708 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 13709 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 13710 }
jpayne@68 13711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 13712
jpayne@68 13713 /* "pysam/libchtslib.pyx":374
jpayne@68 13714 * def __exit__(self, exc_type, exc_value, traceback):
jpayne@68 13715 * self.close()
jpayne@68 13716 * return False # <<<<<<<<<<<<<<
jpayne@68 13717 *
jpayne@68 13718 * @property
jpayne@68 13719 */
jpayne@68 13720 __Pyx_XDECREF(__pyx_r);
jpayne@68 13721 __Pyx_INCREF(Py_False);
jpayne@68 13722 __pyx_r = Py_False;
jpayne@68 13723 goto __pyx_L0;
jpayne@68 13724
jpayne@68 13725 /* "pysam/libchtslib.pyx":372
jpayne@68 13726 * return self
jpayne@68 13727 *
jpayne@68 13728 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<<
jpayne@68 13729 * self.close()
jpayne@68 13730 * return False
jpayne@68 13731 */
jpayne@68 13732
jpayne@68 13733 /* function exit code */
jpayne@68 13734 __pyx_L1_error:;
jpayne@68 13735 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 13736 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 13737 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 13738 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 13739 __pyx_r = NULL;
jpayne@68 13740 __pyx_L0:;
jpayne@68 13741 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 13742 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 13743 __Pyx_RefNannyFinishContext();
jpayne@68 13744 return __pyx_r;
jpayne@68 13745 }
jpayne@68 13746
jpayne@68 13747 /* "pysam/libchtslib.pyx":376
jpayne@68 13748 * return False
jpayne@68 13749 *
jpayne@68 13750 * @property # <<<<<<<<<<<<<<
jpayne@68 13751 * def category(self):
jpayne@68 13752 * """General file format category. One of UNKNOWN, ALIGNMENTS,
jpayne@68 13753 */
jpayne@68 13754
jpayne@68 13755 /* Python wrapper */
jpayne@68 13756 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_8category_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 13757 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_8category_1__get__(PyObject *__pyx_v_self) {
jpayne@68 13758 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 13759 PyObject *__pyx_r = 0;
jpayne@68 13760 __Pyx_RefNannyDeclarations
jpayne@68 13761 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 13762 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 13763 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_8category___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 13764
jpayne@68 13765 /* function exit code */
jpayne@68 13766 __Pyx_RefNannyFinishContext();
jpayne@68 13767 return __pyx_r;
jpayne@68 13768 }
jpayne@68 13769
jpayne@68 13770 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_8category___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 13771 PyObject *__pyx_r = NULL;
jpayne@68 13772 __Pyx_TraceDeclarations
jpayne@68 13773 __Pyx_RefNannyDeclarations
jpayne@68 13774 int __pyx_t_1;
jpayne@68 13775 PyObject *__pyx_t_2 = NULL;
jpayne@68 13776 PyObject *__pyx_t_3 = NULL;
jpayne@68 13777 int __pyx_lineno = 0;
jpayne@68 13778 const char *__pyx_filename = NULL;
jpayne@68 13779 int __pyx_clineno = 0;
jpayne@68 13780 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 13781 __Pyx_TraceCall("__get__", __pyx_f[0], 376, 0, __PYX_ERR(0, 376, __pyx_L1_error));
jpayne@68 13782
jpayne@68 13783 /* "pysam/libchtslib.pyx":380
jpayne@68 13784 * """General file format category. One of UNKNOWN, ALIGNMENTS,
jpayne@68 13785 * VARIANTS, INDEX, REGIONS"""
jpayne@68 13786 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 13787 * raise ValueError('metadata not available on closed file')
jpayne@68 13788 * return FORMAT_CATEGORIES[self.htsfile.format.category]
jpayne@68 13789 */
jpayne@68 13790 __pyx_t_1 = (!(__pyx_v_self->htsfile != 0));
jpayne@68 13791 if (unlikely(__pyx_t_1)) {
jpayne@68 13792
jpayne@68 13793 /* "pysam/libchtslib.pyx":381
jpayne@68 13794 * VARIANTS, INDEX, REGIONS"""
jpayne@68 13795 * if not self.htsfile:
jpayne@68 13796 * raise ValueError('metadata not available on closed file') # <<<<<<<<<<<<<<
jpayne@68 13797 * return FORMAT_CATEGORIES[self.htsfile.format.category]
jpayne@68 13798 *
jpayne@68 13799 */
jpayne@68 13800 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
jpayne@68 13801 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13802 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 13803 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 13804 __PYX_ERR(0, 381, __pyx_L1_error)
jpayne@68 13805
jpayne@68 13806 /* "pysam/libchtslib.pyx":380
jpayne@68 13807 * """General file format category. One of UNKNOWN, ALIGNMENTS,
jpayne@68 13808 * VARIANTS, INDEX, REGIONS"""
jpayne@68 13809 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 13810 * raise ValueError('metadata not available on closed file')
jpayne@68 13811 * return FORMAT_CATEGORIES[self.htsfile.format.category]
jpayne@68 13812 */
jpayne@68 13813 }
jpayne@68 13814
jpayne@68 13815 /* "pysam/libchtslib.pyx":382
jpayne@68 13816 * if not self.htsfile:
jpayne@68 13817 * raise ValueError('metadata not available on closed file')
jpayne@68 13818 * return FORMAT_CATEGORIES[self.htsfile.format.category] # <<<<<<<<<<<<<<
jpayne@68 13819 *
jpayne@68 13820 * @property
jpayne@68 13821 */
jpayne@68 13822 __Pyx_XDECREF(__pyx_r);
jpayne@68 13823 if (unlikely(__pyx_v_5pysam_10libchtslib_FORMAT_CATEGORIES == Py_None)) {
jpayne@68 13824 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
jpayne@68 13825 __PYX_ERR(0, 382, __pyx_L1_error)
jpayne@68 13826 }
jpayne@68 13827 __pyx_t_2 = __Pyx_PyInt_From_enum__htsFormatCategory(__pyx_v_self->htsfile->format.category); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
jpayne@68 13828 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13829 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_5pysam_10libchtslib_FORMAT_CATEGORIES, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
jpayne@68 13830 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 13831 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 13832 __pyx_r = __pyx_t_3;
jpayne@68 13833 __pyx_t_3 = 0;
jpayne@68 13834 goto __pyx_L0;
jpayne@68 13835
jpayne@68 13836 /* "pysam/libchtslib.pyx":376
jpayne@68 13837 * return False
jpayne@68 13838 *
jpayne@68 13839 * @property # <<<<<<<<<<<<<<
jpayne@68 13840 * def category(self):
jpayne@68 13841 * """General file format category. One of UNKNOWN, ALIGNMENTS,
jpayne@68 13842 */
jpayne@68 13843
jpayne@68 13844 /* function exit code */
jpayne@68 13845 __pyx_L1_error:;
jpayne@68 13846 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 13847 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 13848 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.category.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 13849 __pyx_r = NULL;
jpayne@68 13850 __pyx_L0:;
jpayne@68 13851 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 13852 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 13853 __Pyx_RefNannyFinishContext();
jpayne@68 13854 return __pyx_r;
jpayne@68 13855 }
jpayne@68 13856
jpayne@68 13857 /* "pysam/libchtslib.pyx":384
jpayne@68 13858 * return FORMAT_CATEGORIES[self.htsfile.format.category]
jpayne@68 13859 *
jpayne@68 13860 * @property # <<<<<<<<<<<<<<
jpayne@68 13861 * def format(self):
jpayne@68 13862 * """File format.
jpayne@68 13863 */
jpayne@68 13864
jpayne@68 13865 /* Python wrapper */
jpayne@68 13866 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6format_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 13867 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6format_1__get__(PyObject *__pyx_v_self) {
jpayne@68 13868 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 13869 PyObject *__pyx_r = 0;
jpayne@68 13870 __Pyx_RefNannyDeclarations
jpayne@68 13871 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 13872 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 13873 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_6format___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 13874
jpayne@68 13875 /* function exit code */
jpayne@68 13876 __Pyx_RefNannyFinishContext();
jpayne@68 13877 return __pyx_r;
jpayne@68 13878 }
jpayne@68 13879
jpayne@68 13880 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6format___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 13881 PyObject *__pyx_r = NULL;
jpayne@68 13882 __Pyx_TraceDeclarations
jpayne@68 13883 __Pyx_RefNannyDeclarations
jpayne@68 13884 int __pyx_t_1;
jpayne@68 13885 PyObject *__pyx_t_2 = NULL;
jpayne@68 13886 PyObject *__pyx_t_3 = NULL;
jpayne@68 13887 int __pyx_lineno = 0;
jpayne@68 13888 const char *__pyx_filename = NULL;
jpayne@68 13889 int __pyx_clineno = 0;
jpayne@68 13890 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 13891 __Pyx_TraceCall("__get__", __pyx_f[0], 384, 0, __PYX_ERR(0, 384, __pyx_L1_error));
jpayne@68 13892
jpayne@68 13893 /* "pysam/libchtslib.pyx":391
jpayne@68 13894 * BAI, CRAM, CRAI, VCF, BCF, CSI, GZI, TBI, BED.
jpayne@68 13895 * """
jpayne@68 13896 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 13897 * raise ValueError('metadata not available on closed file')
jpayne@68 13898 * return FORMATS[self.htsfile.format.format]
jpayne@68 13899 */
jpayne@68 13900 __pyx_t_1 = (!(__pyx_v_self->htsfile != 0));
jpayne@68 13901 if (unlikely(__pyx_t_1)) {
jpayne@68 13902
jpayne@68 13903 /* "pysam/libchtslib.pyx":392
jpayne@68 13904 * """
jpayne@68 13905 * if not self.htsfile:
jpayne@68 13906 * raise ValueError('metadata not available on closed file') # <<<<<<<<<<<<<<
jpayne@68 13907 * return FORMATS[self.htsfile.format.format]
jpayne@68 13908 *
jpayne@68 13909 */
jpayne@68 13910 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
jpayne@68 13911 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13912 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 13913 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 13914 __PYX_ERR(0, 392, __pyx_L1_error)
jpayne@68 13915
jpayne@68 13916 /* "pysam/libchtslib.pyx":391
jpayne@68 13917 * BAI, CRAM, CRAI, VCF, BCF, CSI, GZI, TBI, BED.
jpayne@68 13918 * """
jpayne@68 13919 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 13920 * raise ValueError('metadata not available on closed file')
jpayne@68 13921 * return FORMATS[self.htsfile.format.format]
jpayne@68 13922 */
jpayne@68 13923 }
jpayne@68 13924
jpayne@68 13925 /* "pysam/libchtslib.pyx":393
jpayne@68 13926 * if not self.htsfile:
jpayne@68 13927 * raise ValueError('metadata not available on closed file')
jpayne@68 13928 * return FORMATS[self.htsfile.format.format] # <<<<<<<<<<<<<<
jpayne@68 13929 *
jpayne@68 13930 * @property
jpayne@68 13931 */
jpayne@68 13932 __Pyx_XDECREF(__pyx_r);
jpayne@68 13933 if (unlikely(__pyx_v_5pysam_10libchtslib_FORMATS == Py_None)) {
jpayne@68 13934 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
jpayne@68 13935 __PYX_ERR(0, 393, __pyx_L1_error)
jpayne@68 13936 }
jpayne@68 13937 __pyx_t_2 = __Pyx_PyInt_From_enum__htsExactFormat(__pyx_v_self->htsfile->format.format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
jpayne@68 13938 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 13939 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_5pysam_10libchtslib_FORMATS, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
jpayne@68 13940 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 13941 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 13942 __pyx_r = __pyx_t_3;
jpayne@68 13943 __pyx_t_3 = 0;
jpayne@68 13944 goto __pyx_L0;
jpayne@68 13945
jpayne@68 13946 /* "pysam/libchtslib.pyx":384
jpayne@68 13947 * return FORMAT_CATEGORIES[self.htsfile.format.category]
jpayne@68 13948 *
jpayne@68 13949 * @property # <<<<<<<<<<<<<<
jpayne@68 13950 * def format(self):
jpayne@68 13951 * """File format.
jpayne@68 13952 */
jpayne@68 13953
jpayne@68 13954 /* function exit code */
jpayne@68 13955 __pyx_L1_error:;
jpayne@68 13956 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 13957 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 13958 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.format.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 13959 __pyx_r = NULL;
jpayne@68 13960 __pyx_L0:;
jpayne@68 13961 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 13962 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 13963 __Pyx_RefNannyFinishContext();
jpayne@68 13964 return __pyx_r;
jpayne@68 13965 }
jpayne@68 13966
jpayne@68 13967 /* "pysam/libchtslib.pyx":395
jpayne@68 13968 * return FORMATS[self.htsfile.format.format]
jpayne@68 13969 *
jpayne@68 13970 * @property # <<<<<<<<<<<<<<
jpayne@68 13971 * def version(self):
jpayne@68 13972 * """Tuple of file format version numbers (major, minor)"""
jpayne@68 13973 */
jpayne@68 13974
jpayne@68 13975 /* Python wrapper */
jpayne@68 13976 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7version_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 13977 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7version_1__get__(PyObject *__pyx_v_self) {
jpayne@68 13978 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 13979 PyObject *__pyx_r = 0;
jpayne@68 13980 __Pyx_RefNannyDeclarations
jpayne@68 13981 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 13982 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 13983 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_7version___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 13984
jpayne@68 13985 /* function exit code */
jpayne@68 13986 __Pyx_RefNannyFinishContext();
jpayne@68 13987 return __pyx_r;
jpayne@68 13988 }
jpayne@68 13989
jpayne@68 13990 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7version___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 13991 PyObject *__pyx_r = NULL;
jpayne@68 13992 __Pyx_TraceDeclarations
jpayne@68 13993 __Pyx_RefNannyDeclarations
jpayne@68 13994 int __pyx_t_1;
jpayne@68 13995 PyObject *__pyx_t_2 = NULL;
jpayne@68 13996 PyObject *__pyx_t_3 = NULL;
jpayne@68 13997 PyObject *__pyx_t_4 = NULL;
jpayne@68 13998 int __pyx_lineno = 0;
jpayne@68 13999 const char *__pyx_filename = NULL;
jpayne@68 14000 int __pyx_clineno = 0;
jpayne@68 14001 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14002 __Pyx_TraceCall("__get__", __pyx_f[0], 395, 0, __PYX_ERR(0, 395, __pyx_L1_error));
jpayne@68 14003
jpayne@68 14004 /* "pysam/libchtslib.pyx":398
jpayne@68 14005 * def version(self):
jpayne@68 14006 * """Tuple of file format version numbers (major, minor)"""
jpayne@68 14007 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 14008 * raise ValueError('metadata not available on closed file')
jpayne@68 14009 * return self.htsfile.format.version.major, self.htsfile.format.version.minor
jpayne@68 14010 */
jpayne@68 14011 __pyx_t_1 = (!(__pyx_v_self->htsfile != 0));
jpayne@68 14012 if (unlikely(__pyx_t_1)) {
jpayne@68 14013
jpayne@68 14014 /* "pysam/libchtslib.pyx":399
jpayne@68 14015 * """Tuple of file format version numbers (major, minor)"""
jpayne@68 14016 * if not self.htsfile:
jpayne@68 14017 * raise ValueError('metadata not available on closed file') # <<<<<<<<<<<<<<
jpayne@68 14018 * return self.htsfile.format.version.major, self.htsfile.format.version.minor
jpayne@68 14019 *
jpayne@68 14020 */
jpayne@68 14021 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
jpayne@68 14022 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 14023 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 14024 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 14025 __PYX_ERR(0, 399, __pyx_L1_error)
jpayne@68 14026
jpayne@68 14027 /* "pysam/libchtslib.pyx":398
jpayne@68 14028 * def version(self):
jpayne@68 14029 * """Tuple of file format version numbers (major, minor)"""
jpayne@68 14030 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 14031 * raise ValueError('metadata not available on closed file')
jpayne@68 14032 * return self.htsfile.format.version.major, self.htsfile.format.version.minor
jpayne@68 14033 */
jpayne@68 14034 }
jpayne@68 14035
jpayne@68 14036 /* "pysam/libchtslib.pyx":400
jpayne@68 14037 * if not self.htsfile:
jpayne@68 14038 * raise ValueError('metadata not available on closed file')
jpayne@68 14039 * return self.htsfile.format.version.major, self.htsfile.format.version.minor # <<<<<<<<<<<<<<
jpayne@68 14040 *
jpayne@68 14041 * @property
jpayne@68 14042 */
jpayne@68 14043 __Pyx_XDECREF(__pyx_r);
jpayne@68 14044 __pyx_t_2 = __Pyx_PyInt_From_short(__pyx_v_self->htsfile->format.version.major); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
jpayne@68 14045 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 14046 __pyx_t_3 = __Pyx_PyInt_From_short(__pyx_v_self->htsfile->format.version.minor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
jpayne@68 14047 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14048 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
jpayne@68 14049 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 14050 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 14051 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error);
jpayne@68 14052 __Pyx_GIVEREF(__pyx_t_3);
jpayne@68 14053 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error);
jpayne@68 14054 __pyx_t_2 = 0;
jpayne@68 14055 __pyx_t_3 = 0;
jpayne@68 14056 __pyx_r = __pyx_t_4;
jpayne@68 14057 __pyx_t_4 = 0;
jpayne@68 14058 goto __pyx_L0;
jpayne@68 14059
jpayne@68 14060 /* "pysam/libchtslib.pyx":395
jpayne@68 14061 * return FORMATS[self.htsfile.format.format]
jpayne@68 14062 *
jpayne@68 14063 * @property # <<<<<<<<<<<<<<
jpayne@68 14064 * def version(self):
jpayne@68 14065 * """Tuple of file format version numbers (major, minor)"""
jpayne@68 14066 */
jpayne@68 14067
jpayne@68 14068 /* function exit code */
jpayne@68 14069 __pyx_L1_error:;
jpayne@68 14070 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 14071 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 14072 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 14073 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14074 __pyx_r = NULL;
jpayne@68 14075 __pyx_L0:;
jpayne@68 14076 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14077 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14078 __Pyx_RefNannyFinishContext();
jpayne@68 14079 return __pyx_r;
jpayne@68 14080 }
jpayne@68 14081
jpayne@68 14082 /* "pysam/libchtslib.pyx":402
jpayne@68 14083 * return self.htsfile.format.version.major, self.htsfile.format.version.minor
jpayne@68 14084 *
jpayne@68 14085 * @property # <<<<<<<<<<<<<<
jpayne@68 14086 * def compression(self):
jpayne@68 14087 * """File compression.
jpayne@68 14088 */
jpayne@68 14089
jpayne@68 14090 /* Python wrapper */
jpayne@68 14091 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_11compression_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14092 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_11compression_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14093 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14094 PyObject *__pyx_r = 0;
jpayne@68 14095 __Pyx_RefNannyDeclarations
jpayne@68 14096 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14097 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14098 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_11compression___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14099
jpayne@68 14100 /* function exit code */
jpayne@68 14101 __Pyx_RefNannyFinishContext();
jpayne@68 14102 return __pyx_r;
jpayne@68 14103 }
jpayne@68 14104
jpayne@68 14105 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_11compression___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14106 PyObject *__pyx_r = NULL;
jpayne@68 14107 __Pyx_TraceDeclarations
jpayne@68 14108 __Pyx_RefNannyDeclarations
jpayne@68 14109 int __pyx_t_1;
jpayne@68 14110 PyObject *__pyx_t_2 = NULL;
jpayne@68 14111 PyObject *__pyx_t_3 = NULL;
jpayne@68 14112 int __pyx_lineno = 0;
jpayne@68 14113 const char *__pyx_filename = NULL;
jpayne@68 14114 int __pyx_clineno = 0;
jpayne@68 14115 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14116 __Pyx_TraceCall("__get__", __pyx_f[0], 402, 0, __PYX_ERR(0, 402, __pyx_L1_error));
jpayne@68 14117
jpayne@68 14118 /* "pysam/libchtslib.pyx":407
jpayne@68 14119 *
jpayne@68 14120 * One of NONE, GZIP, BGZF, CUSTOM."""
jpayne@68 14121 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 14122 * raise ValueError('metadata not available on closed file')
jpayne@68 14123 * return COMPRESSION[self.htsfile.format.compression]
jpayne@68 14124 */
jpayne@68 14125 __pyx_t_1 = (!(__pyx_v_self->htsfile != 0));
jpayne@68 14126 if (unlikely(__pyx_t_1)) {
jpayne@68 14127
jpayne@68 14128 /* "pysam/libchtslib.pyx":408
jpayne@68 14129 * One of NONE, GZIP, BGZF, CUSTOM."""
jpayne@68 14130 * if not self.htsfile:
jpayne@68 14131 * raise ValueError('metadata not available on closed file') # <<<<<<<<<<<<<<
jpayne@68 14132 * return COMPRESSION[self.htsfile.format.compression]
jpayne@68 14133 *
jpayne@68 14134 */
jpayne@68 14135 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error)
jpayne@68 14136 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 14137 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 14138 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 14139 __PYX_ERR(0, 408, __pyx_L1_error)
jpayne@68 14140
jpayne@68 14141 /* "pysam/libchtslib.pyx":407
jpayne@68 14142 *
jpayne@68 14143 * One of NONE, GZIP, BGZF, CUSTOM."""
jpayne@68 14144 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 14145 * raise ValueError('metadata not available on closed file')
jpayne@68 14146 * return COMPRESSION[self.htsfile.format.compression]
jpayne@68 14147 */
jpayne@68 14148 }
jpayne@68 14149
jpayne@68 14150 /* "pysam/libchtslib.pyx":409
jpayne@68 14151 * if not self.htsfile:
jpayne@68 14152 * raise ValueError('metadata not available on closed file')
jpayne@68 14153 * return COMPRESSION[self.htsfile.format.compression] # <<<<<<<<<<<<<<
jpayne@68 14154 *
jpayne@68 14155 * @property
jpayne@68 14156 */
jpayne@68 14157 __Pyx_XDECREF(__pyx_r);
jpayne@68 14158 if (unlikely(__pyx_v_5pysam_10libchtslib_COMPRESSION == Py_None)) {
jpayne@68 14159 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
jpayne@68 14160 __PYX_ERR(0, 409, __pyx_L1_error)
jpayne@68 14161 }
jpayne@68 14162 __pyx_t_2 = __Pyx_PyInt_From_enum__htsCompression(__pyx_v_self->htsfile->format.compression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
jpayne@68 14163 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 14164 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_5pysam_10libchtslib_COMPRESSION, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
jpayne@68 14165 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14166 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 14167 __pyx_r = __pyx_t_3;
jpayne@68 14168 __pyx_t_3 = 0;
jpayne@68 14169 goto __pyx_L0;
jpayne@68 14170
jpayne@68 14171 /* "pysam/libchtslib.pyx":402
jpayne@68 14172 * return self.htsfile.format.version.major, self.htsfile.format.version.minor
jpayne@68 14173 *
jpayne@68 14174 * @property # <<<<<<<<<<<<<<
jpayne@68 14175 * def compression(self):
jpayne@68 14176 * """File compression.
jpayne@68 14177 */
jpayne@68 14178
jpayne@68 14179 /* function exit code */
jpayne@68 14180 __pyx_L1_error:;
jpayne@68 14181 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 14182 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 14183 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.compression.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14184 __pyx_r = NULL;
jpayne@68 14185 __pyx_L0:;
jpayne@68 14186 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14187 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14188 __Pyx_RefNannyFinishContext();
jpayne@68 14189 return __pyx_r;
jpayne@68 14190 }
jpayne@68 14191
jpayne@68 14192 /* "pysam/libchtslib.pyx":411
jpayne@68 14193 * return COMPRESSION[self.htsfile.format.compression]
jpayne@68 14194 *
jpayne@68 14195 * @property # <<<<<<<<<<<<<<
jpayne@68 14196 * def description(self):
jpayne@68 14197 * """Vaguely human readable description of the file format"""
jpayne@68 14198 */
jpayne@68 14199
jpayne@68 14200 /* Python wrapper */
jpayne@68 14201 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_11description_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14202 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_11description_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14203 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14204 PyObject *__pyx_r = 0;
jpayne@68 14205 __Pyx_RefNannyDeclarations
jpayne@68 14206 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14207 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14208 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_11description___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14209
jpayne@68 14210 /* function exit code */
jpayne@68 14211 __Pyx_RefNannyFinishContext();
jpayne@68 14212 return __pyx_r;
jpayne@68 14213 }
jpayne@68 14214
jpayne@68 14215 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_11description___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14216 char *__pyx_v_desc;
jpayne@68 14217 PyObject *__pyx_r = NULL;
jpayne@68 14218 __Pyx_TraceDeclarations
jpayne@68 14219 __Pyx_RefNannyDeclarations
jpayne@68 14220 int __pyx_t_1;
jpayne@68 14221 PyObject *__pyx_t_2 = NULL;
jpayne@68 14222 int __pyx_t_3;
jpayne@68 14223 int __pyx_t_4;
jpayne@68 14224 char const *__pyx_t_5;
jpayne@68 14225 PyObject *__pyx_t_6 = NULL;
jpayne@68 14226 PyObject *__pyx_t_7 = NULL;
jpayne@68 14227 PyObject *__pyx_t_8 = NULL;
jpayne@68 14228 PyObject *__pyx_t_9 = NULL;
jpayne@68 14229 PyObject *__pyx_t_10 = NULL;
jpayne@68 14230 PyObject *__pyx_t_11 = NULL;
jpayne@68 14231 int __pyx_lineno = 0;
jpayne@68 14232 const char *__pyx_filename = NULL;
jpayne@68 14233 int __pyx_clineno = 0;
jpayne@68 14234 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14235 __Pyx_TraceCall("__get__", __pyx_f[0], 411, 0, __PYX_ERR(0, 411, __pyx_L1_error));
jpayne@68 14236
jpayne@68 14237 /* "pysam/libchtslib.pyx":414
jpayne@68 14238 * def description(self):
jpayne@68 14239 * """Vaguely human readable description of the file format"""
jpayne@68 14240 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 14241 * raise ValueError('metadata not available on closed file')
jpayne@68 14242 * cdef char *desc = hts_format_description(&self.htsfile.format)
jpayne@68 14243 */
jpayne@68 14244 __pyx_t_1 = (!(__pyx_v_self->htsfile != 0));
jpayne@68 14245 if (unlikely(__pyx_t_1)) {
jpayne@68 14246
jpayne@68 14247 /* "pysam/libchtslib.pyx":415
jpayne@68 14248 * """Vaguely human readable description of the file format"""
jpayne@68 14249 * if not self.htsfile:
jpayne@68 14250 * raise ValueError('metadata not available on closed file') # <<<<<<<<<<<<<<
jpayne@68 14251 * cdef char *desc = hts_format_description(&self.htsfile.format)
jpayne@68 14252 * try:
jpayne@68 14253 */
jpayne@68 14254 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error)
jpayne@68 14255 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 14256 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 14257 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 14258 __PYX_ERR(0, 415, __pyx_L1_error)
jpayne@68 14259
jpayne@68 14260 /* "pysam/libchtslib.pyx":414
jpayne@68 14261 * def description(self):
jpayne@68 14262 * """Vaguely human readable description of the file format"""
jpayne@68 14263 * if not self.htsfile: # <<<<<<<<<<<<<<
jpayne@68 14264 * raise ValueError('metadata not available on closed file')
jpayne@68 14265 * cdef char *desc = hts_format_description(&self.htsfile.format)
jpayne@68 14266 */
jpayne@68 14267 }
jpayne@68 14268
jpayne@68 14269 /* "pysam/libchtslib.pyx":416
jpayne@68 14270 * if not self.htsfile:
jpayne@68 14271 * raise ValueError('metadata not available on closed file')
jpayne@68 14272 * cdef char *desc = hts_format_description(&self.htsfile.format) # <<<<<<<<<<<<<<
jpayne@68 14273 * try:
jpayne@68 14274 * return charptr_to_str(desc)
jpayne@68 14275 */
jpayne@68 14276 __pyx_v_desc = hts_format_description((&__pyx_v_self->htsfile->format));
jpayne@68 14277
jpayne@68 14278 /* "pysam/libchtslib.pyx":417
jpayne@68 14279 * raise ValueError('metadata not available on closed file')
jpayne@68 14280 * cdef char *desc = hts_format_description(&self.htsfile.format)
jpayne@68 14281 * try: # <<<<<<<<<<<<<<
jpayne@68 14282 * return charptr_to_str(desc)
jpayne@68 14283 * finally:
jpayne@68 14284 */
jpayne@68 14285 /*try:*/ {
jpayne@68 14286
jpayne@68 14287 /* "pysam/libchtslib.pyx":418
jpayne@68 14288 * cdef char *desc = hts_format_description(&self.htsfile.format)
jpayne@68 14289 * try:
jpayne@68 14290 * return charptr_to_str(desc) # <<<<<<<<<<<<<<
jpayne@68 14291 * finally:
jpayne@68 14292 * free(desc)
jpayne@68 14293 */
jpayne@68 14294 __Pyx_XDECREF(__pyx_r);
jpayne@68 14295 __pyx_t_2 = __pyx_f_5pysam_9libcutils_charptr_to_str(__pyx_v_desc, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L5_error)
jpayne@68 14296 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 14297 __pyx_r = __pyx_t_2;
jpayne@68 14298 __pyx_t_2 = 0;
jpayne@68 14299 goto __pyx_L4_return;
jpayne@68 14300 }
jpayne@68 14301
jpayne@68 14302 /* "pysam/libchtslib.pyx":420
jpayne@68 14303 * return charptr_to_str(desc)
jpayne@68 14304 * finally:
jpayne@68 14305 * free(desc) # <<<<<<<<<<<<<<
jpayne@68 14306 *
jpayne@68 14307 * @property
jpayne@68 14308 */
jpayne@68 14309 /*finally:*/ {
jpayne@68 14310 __pyx_L5_error:;
jpayne@68 14311 /*exception exit:*/{
jpayne@68 14312 __Pyx_PyThreadState_declare
jpayne@68 14313 __Pyx_PyThreadState_assign
jpayne@68 14314 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
jpayne@68 14315 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 14316 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
jpayne@68 14317 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
jpayne@68 14318 __Pyx_XGOTREF(__pyx_t_6);
jpayne@68 14319 __Pyx_XGOTREF(__pyx_t_7);
jpayne@68 14320 __Pyx_XGOTREF(__pyx_t_8);
jpayne@68 14321 __Pyx_XGOTREF(__pyx_t_9);
jpayne@68 14322 __Pyx_XGOTREF(__pyx_t_10);
jpayne@68 14323 __Pyx_XGOTREF(__pyx_t_11);
jpayne@68 14324 __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
jpayne@68 14325 {
jpayne@68 14326 free(__pyx_v_desc);
jpayne@68 14327 }
jpayne@68 14328 if (PY_MAJOR_VERSION >= 3) {
jpayne@68 14329 __Pyx_XGIVEREF(__pyx_t_9);
jpayne@68 14330 __Pyx_XGIVEREF(__pyx_t_10);
jpayne@68 14331 __Pyx_XGIVEREF(__pyx_t_11);
jpayne@68 14332 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
jpayne@68 14333 }
jpayne@68 14334 __Pyx_XGIVEREF(__pyx_t_6);
jpayne@68 14335 __Pyx_XGIVEREF(__pyx_t_7);
jpayne@68 14336 __Pyx_XGIVEREF(__pyx_t_8);
jpayne@68 14337 __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
jpayne@68 14338 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
jpayne@68 14339 __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
jpayne@68 14340 goto __pyx_L1_error;
jpayne@68 14341 }
jpayne@68 14342 __pyx_L4_return: {
jpayne@68 14343 __pyx_t_11 = __pyx_r;
jpayne@68 14344 __pyx_r = 0;
jpayne@68 14345 free(__pyx_v_desc);
jpayne@68 14346 __pyx_r = __pyx_t_11;
jpayne@68 14347 __pyx_t_11 = 0;
jpayne@68 14348 goto __pyx_L0;
jpayne@68 14349 }
jpayne@68 14350 }
jpayne@68 14351
jpayne@68 14352 /* "pysam/libchtslib.pyx":411
jpayne@68 14353 * return COMPRESSION[self.htsfile.format.compression]
jpayne@68 14354 *
jpayne@68 14355 * @property # <<<<<<<<<<<<<<
jpayne@68 14356 * def description(self):
jpayne@68 14357 * """Vaguely human readable description of the file format"""
jpayne@68 14358 */
jpayne@68 14359
jpayne@68 14360 /* function exit code */
jpayne@68 14361 __pyx_L1_error:;
jpayne@68 14362 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 14363 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.description.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14364 __pyx_r = NULL;
jpayne@68 14365 __pyx_L0:;
jpayne@68 14366 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14367 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14368 __Pyx_RefNannyFinishContext();
jpayne@68 14369 return __pyx_r;
jpayne@68 14370 }
jpayne@68 14371
jpayne@68 14372 /* "pysam/libchtslib.pyx":422
jpayne@68 14373 * free(desc)
jpayne@68 14374 *
jpayne@68 14375 * @property # <<<<<<<<<<<<<<
jpayne@68 14376 * def is_open(self):
jpayne@68 14377 * """return True if HTSFile is open and in a valid state."""
jpayne@68 14378 */
jpayne@68 14379
jpayne@68 14380 /* Python wrapper */
jpayne@68 14381 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7is_open_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14382 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7is_open_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14383 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14384 PyObject *__pyx_r = 0;
jpayne@68 14385 __Pyx_RefNannyDeclarations
jpayne@68 14386 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14387 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14388 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_7is_open___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14389
jpayne@68 14390 /* function exit code */
jpayne@68 14391 __Pyx_RefNannyFinishContext();
jpayne@68 14392 return __pyx_r;
jpayne@68 14393 }
jpayne@68 14394
jpayne@68 14395 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7is_open___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14396 PyObject *__pyx_r = NULL;
jpayne@68 14397 __Pyx_TraceDeclarations
jpayne@68 14398 __Pyx_RefNannyDeclarations
jpayne@68 14399 PyObject *__pyx_t_1 = NULL;
jpayne@68 14400 int __pyx_t_2;
jpayne@68 14401 PyObject *__pyx_t_3 = NULL;
jpayne@68 14402 int __pyx_lineno = 0;
jpayne@68 14403 const char *__pyx_filename = NULL;
jpayne@68 14404 int __pyx_clineno = 0;
jpayne@68 14405 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14406 __Pyx_TraceCall("__get__", __pyx_f[0], 422, 0, __PYX_ERR(0, 422, __pyx_L1_error));
jpayne@68 14407
jpayne@68 14408 /* "pysam/libchtslib.pyx":425
jpayne@68 14409 * def is_open(self):
jpayne@68 14410 * """return True if HTSFile is open and in a valid state."""
jpayne@68 14411 * return CTrue if self.htsfile != NULL else CFalse # <<<<<<<<<<<<<<
jpayne@68 14412 *
jpayne@68 14413 * @property
jpayne@68 14414 */
jpayne@68 14415 __Pyx_XDECREF(__pyx_r);
jpayne@68 14416 __pyx_t_2 = (__pyx_v_self->htsfile != NULL);
jpayne@68 14417 if (__pyx_t_2) {
jpayne@68 14418 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CTrue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
jpayne@68 14419 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14420 __pyx_t_1 = __pyx_t_3;
jpayne@68 14421 __pyx_t_3 = 0;
jpayne@68 14422 } else {
jpayne@68 14423 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CFalse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
jpayne@68 14424 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14425 __pyx_t_1 = __pyx_t_3;
jpayne@68 14426 __pyx_t_3 = 0;
jpayne@68 14427 }
jpayne@68 14428 __pyx_r = __pyx_t_1;
jpayne@68 14429 __pyx_t_1 = 0;
jpayne@68 14430 goto __pyx_L0;
jpayne@68 14431
jpayne@68 14432 /* "pysam/libchtslib.pyx":422
jpayne@68 14433 * free(desc)
jpayne@68 14434 *
jpayne@68 14435 * @property # <<<<<<<<<<<<<<
jpayne@68 14436 * def is_open(self):
jpayne@68 14437 * """return True if HTSFile is open and in a valid state."""
jpayne@68 14438 */
jpayne@68 14439
jpayne@68 14440 /* function exit code */
jpayne@68 14441 __pyx_L1_error:;
jpayne@68 14442 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 14443 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 14444 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_open.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14445 __pyx_r = NULL;
jpayne@68 14446 __pyx_L0:;
jpayne@68 14447 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14448 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14449 __Pyx_RefNannyFinishContext();
jpayne@68 14450 return __pyx_r;
jpayne@68 14451 }
jpayne@68 14452
jpayne@68 14453 /* "pysam/libchtslib.pyx":427
jpayne@68 14454 * return CTrue if self.htsfile != NULL else CFalse
jpayne@68 14455 *
jpayne@68 14456 * @property # <<<<<<<<<<<<<<
jpayne@68 14457 * def is_closed(self):
jpayne@68 14458 * """return True if HTSFile is closed."""
jpayne@68 14459 */
jpayne@68 14460
jpayne@68 14461 /* Python wrapper */
jpayne@68 14462 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_9is_closed_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14463 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_9is_closed_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14464 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14465 PyObject *__pyx_r = 0;
jpayne@68 14466 __Pyx_RefNannyDeclarations
jpayne@68 14467 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14468 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14469 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_9is_closed___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14470
jpayne@68 14471 /* function exit code */
jpayne@68 14472 __Pyx_RefNannyFinishContext();
jpayne@68 14473 return __pyx_r;
jpayne@68 14474 }
jpayne@68 14475
jpayne@68 14476 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_9is_closed___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14477 PyObject *__pyx_r = NULL;
jpayne@68 14478 __Pyx_TraceDeclarations
jpayne@68 14479 __Pyx_RefNannyDeclarations
jpayne@68 14480 PyObject *__pyx_t_1 = NULL;
jpayne@68 14481 int __pyx_lineno = 0;
jpayne@68 14482 const char *__pyx_filename = NULL;
jpayne@68 14483 int __pyx_clineno = 0;
jpayne@68 14484 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14485 __Pyx_TraceCall("__get__", __pyx_f[0], 427, 0, __PYX_ERR(0, 427, __pyx_L1_error));
jpayne@68 14486
jpayne@68 14487 /* "pysam/libchtslib.pyx":430
jpayne@68 14488 * def is_closed(self):
jpayne@68 14489 * """return True if HTSFile is closed."""
jpayne@68 14490 * return self.htsfile == NULL # <<<<<<<<<<<<<<
jpayne@68 14491 *
jpayne@68 14492 * @property
jpayne@68 14493 */
jpayne@68 14494 __Pyx_XDECREF(__pyx_r);
jpayne@68 14495 __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->htsfile == NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
jpayne@68 14496 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 14497 __pyx_r = __pyx_t_1;
jpayne@68 14498 __pyx_t_1 = 0;
jpayne@68 14499 goto __pyx_L0;
jpayne@68 14500
jpayne@68 14501 /* "pysam/libchtslib.pyx":427
jpayne@68 14502 * return CTrue if self.htsfile != NULL else CFalse
jpayne@68 14503 *
jpayne@68 14504 * @property # <<<<<<<<<<<<<<
jpayne@68 14505 * def is_closed(self):
jpayne@68 14506 * """return True if HTSFile is closed."""
jpayne@68 14507 */
jpayne@68 14508
jpayne@68 14509 /* function exit code */
jpayne@68 14510 __pyx_L1_error:;
jpayne@68 14511 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 14512 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14513 __pyx_r = NULL;
jpayne@68 14514 __pyx_L0:;
jpayne@68 14515 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14516 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14517 __Pyx_RefNannyFinishContext();
jpayne@68 14518 return __pyx_r;
jpayne@68 14519 }
jpayne@68 14520
jpayne@68 14521 /* "pysam/libchtslib.pyx":432
jpayne@68 14522 * return self.htsfile == NULL
jpayne@68 14523 *
jpayne@68 14524 * @property # <<<<<<<<<<<<<<
jpayne@68 14525 * def closed(self):
jpayne@68 14526 * """return True if HTSFile is closed."""
jpayne@68 14527 */
jpayne@68 14528
jpayne@68 14529 /* Python wrapper */
jpayne@68 14530 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14531 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6closed_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14532 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14533 PyObject *__pyx_r = 0;
jpayne@68 14534 __Pyx_RefNannyDeclarations
jpayne@68 14535 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14536 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14537 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_6closed___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14538
jpayne@68 14539 /* function exit code */
jpayne@68 14540 __Pyx_RefNannyFinishContext();
jpayne@68 14541 return __pyx_r;
jpayne@68 14542 }
jpayne@68 14543
jpayne@68 14544 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6closed___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14545 PyObject *__pyx_r = NULL;
jpayne@68 14546 __Pyx_TraceDeclarations
jpayne@68 14547 __Pyx_RefNannyDeclarations
jpayne@68 14548 PyObject *__pyx_t_1 = NULL;
jpayne@68 14549 int __pyx_lineno = 0;
jpayne@68 14550 const char *__pyx_filename = NULL;
jpayne@68 14551 int __pyx_clineno = 0;
jpayne@68 14552 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14553 __Pyx_TraceCall("__get__", __pyx_f[0], 432, 0, __PYX_ERR(0, 432, __pyx_L1_error));
jpayne@68 14554
jpayne@68 14555 /* "pysam/libchtslib.pyx":435
jpayne@68 14556 * def closed(self):
jpayne@68 14557 * """return True if HTSFile is closed."""
jpayne@68 14558 * return self.htsfile == NULL # <<<<<<<<<<<<<<
jpayne@68 14559 *
jpayne@68 14560 * @property
jpayne@68 14561 */
jpayne@68 14562 __Pyx_XDECREF(__pyx_r);
jpayne@68 14563 __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->htsfile == NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
jpayne@68 14564 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 14565 __pyx_r = __pyx_t_1;
jpayne@68 14566 __pyx_t_1 = 0;
jpayne@68 14567 goto __pyx_L0;
jpayne@68 14568
jpayne@68 14569 /* "pysam/libchtslib.pyx":432
jpayne@68 14570 * return self.htsfile == NULL
jpayne@68 14571 *
jpayne@68 14572 * @property # <<<<<<<<<<<<<<
jpayne@68 14573 * def closed(self):
jpayne@68 14574 * """return True if HTSFile is closed."""
jpayne@68 14575 */
jpayne@68 14576
jpayne@68 14577 /* function exit code */
jpayne@68 14578 __pyx_L1_error:;
jpayne@68 14579 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 14580 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14581 __pyx_r = NULL;
jpayne@68 14582 __pyx_L0:;
jpayne@68 14583 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14584 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14585 __Pyx_RefNannyFinishContext();
jpayne@68 14586 return __pyx_r;
jpayne@68 14587 }
jpayne@68 14588
jpayne@68 14589 /* "pysam/libchtslib.pyx":437
jpayne@68 14590 * return self.htsfile == NULL
jpayne@68 14591 *
jpayne@68 14592 * @property # <<<<<<<<<<<<<<
jpayne@68 14593 * def is_write(self):
jpayne@68 14594 * """return True if HTSFile is open for writing"""
jpayne@68 14595 */
jpayne@68 14596
jpayne@68 14597 /* Python wrapper */
jpayne@68 14598 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_8is_write_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14599 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_8is_write_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14600 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14601 PyObject *__pyx_r = 0;
jpayne@68 14602 __Pyx_RefNannyDeclarations
jpayne@68 14603 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14604 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14605 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_8is_write___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14606
jpayne@68 14607 /* function exit code */
jpayne@68 14608 __Pyx_RefNannyFinishContext();
jpayne@68 14609 return __pyx_r;
jpayne@68 14610 }
jpayne@68 14611
jpayne@68 14612 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_8is_write___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14613 PyObject *__pyx_r = NULL;
jpayne@68 14614 __Pyx_TraceDeclarations
jpayne@68 14615 __Pyx_RefNannyDeclarations
jpayne@68 14616 PyObject *__pyx_t_1 = NULL;
jpayne@68 14617 int __pyx_t_2;
jpayne@68 14618 PyObject *__pyx_t_3 = NULL;
jpayne@68 14619 int __pyx_lineno = 0;
jpayne@68 14620 const char *__pyx_filename = NULL;
jpayne@68 14621 int __pyx_clineno = 0;
jpayne@68 14622 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14623 __Pyx_TraceCall("__get__", __pyx_f[0], 437, 0, __PYX_ERR(0, 437, __pyx_L1_error));
jpayne@68 14624
jpayne@68 14625 /* "pysam/libchtslib.pyx":440
jpayne@68 14626 * def is_write(self):
jpayne@68 14627 * """return True if HTSFile is open for writing"""
jpayne@68 14628 * return self.htsfile != NULL and self.htsfile.is_write != 0 # <<<<<<<<<<<<<<
jpayne@68 14629 *
jpayne@68 14630 * @property
jpayne@68 14631 */
jpayne@68 14632 __Pyx_XDECREF(__pyx_r);
jpayne@68 14633 __pyx_t_2 = (__pyx_v_self->htsfile != NULL);
jpayne@68 14634 if (__pyx_t_2) {
jpayne@68 14635 } else {
jpayne@68 14636 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
jpayne@68 14637 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14638 __pyx_t_1 = __pyx_t_3;
jpayne@68 14639 __pyx_t_3 = 0;
jpayne@68 14640 goto __pyx_L3_bool_binop_done;
jpayne@68 14641 }
jpayne@68 14642 __pyx_t_2 = (__pyx_v_self->htsfile->is_write != 0);
jpayne@68 14643 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
jpayne@68 14644 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14645 __pyx_t_1 = __pyx_t_3;
jpayne@68 14646 __pyx_t_3 = 0;
jpayne@68 14647 __pyx_L3_bool_binop_done:;
jpayne@68 14648 __pyx_r = __pyx_t_1;
jpayne@68 14649 __pyx_t_1 = 0;
jpayne@68 14650 goto __pyx_L0;
jpayne@68 14651
jpayne@68 14652 /* "pysam/libchtslib.pyx":437
jpayne@68 14653 * return self.htsfile == NULL
jpayne@68 14654 *
jpayne@68 14655 * @property # <<<<<<<<<<<<<<
jpayne@68 14656 * def is_write(self):
jpayne@68 14657 * """return True if HTSFile is open for writing"""
jpayne@68 14658 */
jpayne@68 14659
jpayne@68 14660 /* function exit code */
jpayne@68 14661 __pyx_L1_error:;
jpayne@68 14662 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 14663 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 14664 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_write.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14665 __pyx_r = NULL;
jpayne@68 14666 __pyx_L0:;
jpayne@68 14667 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14668 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14669 __Pyx_RefNannyFinishContext();
jpayne@68 14670 return __pyx_r;
jpayne@68 14671 }
jpayne@68 14672
jpayne@68 14673 /* "pysam/libchtslib.pyx":442
jpayne@68 14674 * return self.htsfile != NULL and self.htsfile.is_write != 0
jpayne@68 14675 *
jpayne@68 14676 * @property # <<<<<<<<<<<<<<
jpayne@68 14677 * def is_read(self):
jpayne@68 14678 * """return True if HTSFile is open for reading"""
jpayne@68 14679 */
jpayne@68 14680
jpayne@68 14681 /* Python wrapper */
jpayne@68 14682 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7is_read_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14683 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7is_read_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14684 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14685 PyObject *__pyx_r = 0;
jpayne@68 14686 __Pyx_RefNannyDeclarations
jpayne@68 14687 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14688 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14689 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_7is_read___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14690
jpayne@68 14691 /* function exit code */
jpayne@68 14692 __Pyx_RefNannyFinishContext();
jpayne@68 14693 return __pyx_r;
jpayne@68 14694 }
jpayne@68 14695
jpayne@68 14696 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7is_read___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14697 PyObject *__pyx_r = NULL;
jpayne@68 14698 __Pyx_TraceDeclarations
jpayne@68 14699 __Pyx_RefNannyDeclarations
jpayne@68 14700 PyObject *__pyx_t_1 = NULL;
jpayne@68 14701 int __pyx_t_2;
jpayne@68 14702 PyObject *__pyx_t_3 = NULL;
jpayne@68 14703 int __pyx_lineno = 0;
jpayne@68 14704 const char *__pyx_filename = NULL;
jpayne@68 14705 int __pyx_clineno = 0;
jpayne@68 14706 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14707 __Pyx_TraceCall("__get__", __pyx_f[0], 442, 0, __PYX_ERR(0, 442, __pyx_L1_error));
jpayne@68 14708
jpayne@68 14709 /* "pysam/libchtslib.pyx":445
jpayne@68 14710 * def is_read(self):
jpayne@68 14711 * """return True if HTSFile is open for reading"""
jpayne@68 14712 * return self.htsfile != NULL and self.htsfile.is_write == 0 # <<<<<<<<<<<<<<
jpayne@68 14713 *
jpayne@68 14714 * @property
jpayne@68 14715 */
jpayne@68 14716 __Pyx_XDECREF(__pyx_r);
jpayne@68 14717 __pyx_t_2 = (__pyx_v_self->htsfile != NULL);
jpayne@68 14718 if (__pyx_t_2) {
jpayne@68 14719 } else {
jpayne@68 14720 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
jpayne@68 14721 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14722 __pyx_t_1 = __pyx_t_3;
jpayne@68 14723 __pyx_t_3 = 0;
jpayne@68 14724 goto __pyx_L3_bool_binop_done;
jpayne@68 14725 }
jpayne@68 14726 __pyx_t_2 = (__pyx_v_self->htsfile->is_write == 0);
jpayne@68 14727 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
jpayne@68 14728 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14729 __pyx_t_1 = __pyx_t_3;
jpayne@68 14730 __pyx_t_3 = 0;
jpayne@68 14731 __pyx_L3_bool_binop_done:;
jpayne@68 14732 __pyx_r = __pyx_t_1;
jpayne@68 14733 __pyx_t_1 = 0;
jpayne@68 14734 goto __pyx_L0;
jpayne@68 14735
jpayne@68 14736 /* "pysam/libchtslib.pyx":442
jpayne@68 14737 * return self.htsfile != NULL and self.htsfile.is_write != 0
jpayne@68 14738 *
jpayne@68 14739 * @property # <<<<<<<<<<<<<<
jpayne@68 14740 * def is_read(self):
jpayne@68 14741 * """return True if HTSFile is open for reading"""
jpayne@68 14742 */
jpayne@68 14743
jpayne@68 14744 /* function exit code */
jpayne@68 14745 __pyx_L1_error:;
jpayne@68 14746 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 14747 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 14748 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_read.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14749 __pyx_r = NULL;
jpayne@68 14750 __pyx_L0:;
jpayne@68 14751 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14752 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14753 __Pyx_RefNannyFinishContext();
jpayne@68 14754 return __pyx_r;
jpayne@68 14755 }
jpayne@68 14756
jpayne@68 14757 /* "pysam/libchtslib.pyx":447
jpayne@68 14758 * return self.htsfile != NULL and self.htsfile.is_write == 0
jpayne@68 14759 *
jpayne@68 14760 * @property # <<<<<<<<<<<<<<
jpayne@68 14761 * def is_sam(self):
jpayne@68 14762 * """return True if HTSFile is reading or writing a SAM alignment file"""
jpayne@68 14763 */
jpayne@68 14764
jpayne@68 14765 /* Python wrapper */
jpayne@68 14766 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6is_sam_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14767 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6is_sam_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14768 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14769 PyObject *__pyx_r = 0;
jpayne@68 14770 __Pyx_RefNannyDeclarations
jpayne@68 14771 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14772 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14773 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_6is_sam___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14774
jpayne@68 14775 /* function exit code */
jpayne@68 14776 __Pyx_RefNannyFinishContext();
jpayne@68 14777 return __pyx_r;
jpayne@68 14778 }
jpayne@68 14779
jpayne@68 14780 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6is_sam___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14781 PyObject *__pyx_r = NULL;
jpayne@68 14782 __Pyx_TraceDeclarations
jpayne@68 14783 __Pyx_RefNannyDeclarations
jpayne@68 14784 PyObject *__pyx_t_1 = NULL;
jpayne@68 14785 int __pyx_t_2;
jpayne@68 14786 PyObject *__pyx_t_3 = NULL;
jpayne@68 14787 int __pyx_lineno = 0;
jpayne@68 14788 const char *__pyx_filename = NULL;
jpayne@68 14789 int __pyx_clineno = 0;
jpayne@68 14790 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14791 __Pyx_TraceCall("__get__", __pyx_f[0], 447, 0, __PYX_ERR(0, 447, __pyx_L1_error));
jpayne@68 14792
jpayne@68 14793 /* "pysam/libchtslib.pyx":450
jpayne@68 14794 * def is_sam(self):
jpayne@68 14795 * """return True if HTSFile is reading or writing a SAM alignment file"""
jpayne@68 14796 * return self.htsfile != NULL and self.htsfile.format.format == sam # <<<<<<<<<<<<<<
jpayne@68 14797 *
jpayne@68 14798 * @property
jpayne@68 14799 */
jpayne@68 14800 __Pyx_XDECREF(__pyx_r);
jpayne@68 14801 __pyx_t_2 = (__pyx_v_self->htsfile != NULL);
jpayne@68 14802 if (__pyx_t_2) {
jpayne@68 14803 } else {
jpayne@68 14804 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
jpayne@68 14805 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14806 __pyx_t_1 = __pyx_t_3;
jpayne@68 14807 __pyx_t_3 = 0;
jpayne@68 14808 goto __pyx_L3_bool_binop_done;
jpayne@68 14809 }
jpayne@68 14810 __pyx_t_2 = (__pyx_v_self->htsfile->format.format == sam);
jpayne@68 14811 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
jpayne@68 14812 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14813 __pyx_t_1 = __pyx_t_3;
jpayne@68 14814 __pyx_t_3 = 0;
jpayne@68 14815 __pyx_L3_bool_binop_done:;
jpayne@68 14816 __pyx_r = __pyx_t_1;
jpayne@68 14817 __pyx_t_1 = 0;
jpayne@68 14818 goto __pyx_L0;
jpayne@68 14819
jpayne@68 14820 /* "pysam/libchtslib.pyx":447
jpayne@68 14821 * return self.htsfile != NULL and self.htsfile.is_write == 0
jpayne@68 14822 *
jpayne@68 14823 * @property # <<<<<<<<<<<<<<
jpayne@68 14824 * def is_sam(self):
jpayne@68 14825 * """return True if HTSFile is reading or writing a SAM alignment file"""
jpayne@68 14826 */
jpayne@68 14827
jpayne@68 14828 /* function exit code */
jpayne@68 14829 __pyx_L1_error:;
jpayne@68 14830 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 14831 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 14832 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_sam.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14833 __pyx_r = NULL;
jpayne@68 14834 __pyx_L0:;
jpayne@68 14835 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14836 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14837 __Pyx_RefNannyFinishContext();
jpayne@68 14838 return __pyx_r;
jpayne@68 14839 }
jpayne@68 14840
jpayne@68 14841 /* "pysam/libchtslib.pyx":452
jpayne@68 14842 * return self.htsfile != NULL and self.htsfile.format.format == sam
jpayne@68 14843 *
jpayne@68 14844 * @property # <<<<<<<<<<<<<<
jpayne@68 14845 * def is_bam(self):
jpayne@68 14846 * """return True if HTSFile is reading or writing a BAM alignment file"""
jpayne@68 14847 */
jpayne@68 14848
jpayne@68 14849 /* Python wrapper */
jpayne@68 14850 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6is_bam_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14851 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6is_bam_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14852 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14853 PyObject *__pyx_r = 0;
jpayne@68 14854 __Pyx_RefNannyDeclarations
jpayne@68 14855 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14856 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14857 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_6is_bam___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14858
jpayne@68 14859 /* function exit code */
jpayne@68 14860 __Pyx_RefNannyFinishContext();
jpayne@68 14861 return __pyx_r;
jpayne@68 14862 }
jpayne@68 14863
jpayne@68 14864 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6is_bam___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14865 PyObject *__pyx_r = NULL;
jpayne@68 14866 __Pyx_TraceDeclarations
jpayne@68 14867 __Pyx_RefNannyDeclarations
jpayne@68 14868 PyObject *__pyx_t_1 = NULL;
jpayne@68 14869 int __pyx_t_2;
jpayne@68 14870 PyObject *__pyx_t_3 = NULL;
jpayne@68 14871 int __pyx_lineno = 0;
jpayne@68 14872 const char *__pyx_filename = NULL;
jpayne@68 14873 int __pyx_clineno = 0;
jpayne@68 14874 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14875 __Pyx_TraceCall("__get__", __pyx_f[0], 452, 0, __PYX_ERR(0, 452, __pyx_L1_error));
jpayne@68 14876
jpayne@68 14877 /* "pysam/libchtslib.pyx":455
jpayne@68 14878 * def is_bam(self):
jpayne@68 14879 * """return True if HTSFile is reading or writing a BAM alignment file"""
jpayne@68 14880 * return self.htsfile != NULL and self.htsfile.format.format == bam # <<<<<<<<<<<<<<
jpayne@68 14881 *
jpayne@68 14882 * @property
jpayne@68 14883 */
jpayne@68 14884 __Pyx_XDECREF(__pyx_r);
jpayne@68 14885 __pyx_t_2 = (__pyx_v_self->htsfile != NULL);
jpayne@68 14886 if (__pyx_t_2) {
jpayne@68 14887 } else {
jpayne@68 14888 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
jpayne@68 14889 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14890 __pyx_t_1 = __pyx_t_3;
jpayne@68 14891 __pyx_t_3 = 0;
jpayne@68 14892 goto __pyx_L3_bool_binop_done;
jpayne@68 14893 }
jpayne@68 14894 __pyx_t_2 = (__pyx_v_self->htsfile->format.format == bam);
jpayne@68 14895 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
jpayne@68 14896 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14897 __pyx_t_1 = __pyx_t_3;
jpayne@68 14898 __pyx_t_3 = 0;
jpayne@68 14899 __pyx_L3_bool_binop_done:;
jpayne@68 14900 __pyx_r = __pyx_t_1;
jpayne@68 14901 __pyx_t_1 = 0;
jpayne@68 14902 goto __pyx_L0;
jpayne@68 14903
jpayne@68 14904 /* "pysam/libchtslib.pyx":452
jpayne@68 14905 * return self.htsfile != NULL and self.htsfile.format.format == sam
jpayne@68 14906 *
jpayne@68 14907 * @property # <<<<<<<<<<<<<<
jpayne@68 14908 * def is_bam(self):
jpayne@68 14909 * """return True if HTSFile is reading or writing a BAM alignment file"""
jpayne@68 14910 */
jpayne@68 14911
jpayne@68 14912 /* function exit code */
jpayne@68 14913 __pyx_L1_error:;
jpayne@68 14914 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 14915 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 14916 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_bam.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 14917 __pyx_r = NULL;
jpayne@68 14918 __pyx_L0:;
jpayne@68 14919 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 14920 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 14921 __Pyx_RefNannyFinishContext();
jpayne@68 14922 return __pyx_r;
jpayne@68 14923 }
jpayne@68 14924
jpayne@68 14925 /* "pysam/libchtslib.pyx":457
jpayne@68 14926 * return self.htsfile != NULL and self.htsfile.format.format == bam
jpayne@68 14927 *
jpayne@68 14928 * @property # <<<<<<<<<<<<<<
jpayne@68 14929 * def is_cram(self):
jpayne@68 14930 * """return True if HTSFile is reading or writing a BAM alignment file"""
jpayne@68 14931 */
jpayne@68 14932
jpayne@68 14933 /* Python wrapper */
jpayne@68 14934 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7is_cram_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 14935 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7is_cram_1__get__(PyObject *__pyx_v_self) {
jpayne@68 14936 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 14937 PyObject *__pyx_r = 0;
jpayne@68 14938 __Pyx_RefNannyDeclarations
jpayne@68 14939 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 14940 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 14941 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_7is_cram___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 14942
jpayne@68 14943 /* function exit code */
jpayne@68 14944 __Pyx_RefNannyFinishContext();
jpayne@68 14945 return __pyx_r;
jpayne@68 14946 }
jpayne@68 14947
jpayne@68 14948 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7is_cram___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 14949 PyObject *__pyx_r = NULL;
jpayne@68 14950 __Pyx_TraceDeclarations
jpayne@68 14951 __Pyx_RefNannyDeclarations
jpayne@68 14952 PyObject *__pyx_t_1 = NULL;
jpayne@68 14953 int __pyx_t_2;
jpayne@68 14954 PyObject *__pyx_t_3 = NULL;
jpayne@68 14955 int __pyx_lineno = 0;
jpayne@68 14956 const char *__pyx_filename = NULL;
jpayne@68 14957 int __pyx_clineno = 0;
jpayne@68 14958 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 14959 __Pyx_TraceCall("__get__", __pyx_f[0], 457, 0, __PYX_ERR(0, 457, __pyx_L1_error));
jpayne@68 14960
jpayne@68 14961 /* "pysam/libchtslib.pyx":460
jpayne@68 14962 * def is_cram(self):
jpayne@68 14963 * """return True if HTSFile is reading or writing a BAM alignment file"""
jpayne@68 14964 * return self.htsfile != NULL and self.htsfile.format.format == cram # <<<<<<<<<<<<<<
jpayne@68 14965 *
jpayne@68 14966 * @property
jpayne@68 14967 */
jpayne@68 14968 __Pyx_XDECREF(__pyx_r);
jpayne@68 14969 __pyx_t_2 = (__pyx_v_self->htsfile != NULL);
jpayne@68 14970 if (__pyx_t_2) {
jpayne@68 14971 } else {
jpayne@68 14972 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error)
jpayne@68 14973 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14974 __pyx_t_1 = __pyx_t_3;
jpayne@68 14975 __pyx_t_3 = 0;
jpayne@68 14976 goto __pyx_L3_bool_binop_done;
jpayne@68 14977 }
jpayne@68 14978 __pyx_t_2 = (__pyx_v_self->htsfile->format.format == cram);
jpayne@68 14979 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error)
jpayne@68 14980 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 14981 __pyx_t_1 = __pyx_t_3;
jpayne@68 14982 __pyx_t_3 = 0;
jpayne@68 14983 __pyx_L3_bool_binop_done:;
jpayne@68 14984 __pyx_r = __pyx_t_1;
jpayne@68 14985 __pyx_t_1 = 0;
jpayne@68 14986 goto __pyx_L0;
jpayne@68 14987
jpayne@68 14988 /* "pysam/libchtslib.pyx":457
jpayne@68 14989 * return self.htsfile != NULL and self.htsfile.format.format == bam
jpayne@68 14990 *
jpayne@68 14991 * @property # <<<<<<<<<<<<<<
jpayne@68 14992 * def is_cram(self):
jpayne@68 14993 * """return True if HTSFile is reading or writing a BAM alignment file"""
jpayne@68 14994 */
jpayne@68 14995
jpayne@68 14996 /* function exit code */
jpayne@68 14997 __pyx_L1_error:;
jpayne@68 14998 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 14999 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 15000 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_cram.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 15001 __pyx_r = NULL;
jpayne@68 15002 __pyx_L0:;
jpayne@68 15003 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 15004 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 15005 __Pyx_RefNannyFinishContext();
jpayne@68 15006 return __pyx_r;
jpayne@68 15007 }
jpayne@68 15008
jpayne@68 15009 /* "pysam/libchtslib.pyx":462
jpayne@68 15010 * return self.htsfile != NULL and self.htsfile.format.format == cram
jpayne@68 15011 *
jpayne@68 15012 * @property # <<<<<<<<<<<<<<
jpayne@68 15013 * def is_vcf(self):
jpayne@68 15014 * """return True if HTSFile is reading or writing a VCF variant file"""
jpayne@68 15015 */
jpayne@68 15016
jpayne@68 15017 /* Python wrapper */
jpayne@68 15018 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6is_vcf_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 15019 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6is_vcf_1__get__(PyObject *__pyx_v_self) {
jpayne@68 15020 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 15021 PyObject *__pyx_r = 0;
jpayne@68 15022 __Pyx_RefNannyDeclarations
jpayne@68 15023 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 15024 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 15025 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_6is_vcf___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 15026
jpayne@68 15027 /* function exit code */
jpayne@68 15028 __Pyx_RefNannyFinishContext();
jpayne@68 15029 return __pyx_r;
jpayne@68 15030 }
jpayne@68 15031
jpayne@68 15032 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6is_vcf___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 15033 PyObject *__pyx_r = NULL;
jpayne@68 15034 __Pyx_TraceDeclarations
jpayne@68 15035 __Pyx_RefNannyDeclarations
jpayne@68 15036 PyObject *__pyx_t_1 = NULL;
jpayne@68 15037 int __pyx_t_2;
jpayne@68 15038 PyObject *__pyx_t_3 = NULL;
jpayne@68 15039 int __pyx_lineno = 0;
jpayne@68 15040 const char *__pyx_filename = NULL;
jpayne@68 15041 int __pyx_clineno = 0;
jpayne@68 15042 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 15043 __Pyx_TraceCall("__get__", __pyx_f[0], 462, 0, __PYX_ERR(0, 462, __pyx_L1_error));
jpayne@68 15044
jpayne@68 15045 /* "pysam/libchtslib.pyx":465
jpayne@68 15046 * def is_vcf(self):
jpayne@68 15047 * """return True if HTSFile is reading or writing a VCF variant file"""
jpayne@68 15048 * return self.htsfile != NULL and self.htsfile.format.format == vcf # <<<<<<<<<<<<<<
jpayne@68 15049 *
jpayne@68 15050 * @property
jpayne@68 15051 */
jpayne@68 15052 __Pyx_XDECREF(__pyx_r);
jpayne@68 15053 __pyx_t_2 = (__pyx_v_self->htsfile != NULL);
jpayne@68 15054 if (__pyx_t_2) {
jpayne@68 15055 } else {
jpayne@68 15056 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
jpayne@68 15057 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 15058 __pyx_t_1 = __pyx_t_3;
jpayne@68 15059 __pyx_t_3 = 0;
jpayne@68 15060 goto __pyx_L3_bool_binop_done;
jpayne@68 15061 }
jpayne@68 15062 __pyx_t_2 = (__pyx_v_self->htsfile->format.format == vcf);
jpayne@68 15063 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
jpayne@68 15064 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 15065 __pyx_t_1 = __pyx_t_3;
jpayne@68 15066 __pyx_t_3 = 0;
jpayne@68 15067 __pyx_L3_bool_binop_done:;
jpayne@68 15068 __pyx_r = __pyx_t_1;
jpayne@68 15069 __pyx_t_1 = 0;
jpayne@68 15070 goto __pyx_L0;
jpayne@68 15071
jpayne@68 15072 /* "pysam/libchtslib.pyx":462
jpayne@68 15073 * return self.htsfile != NULL and self.htsfile.format.format == cram
jpayne@68 15074 *
jpayne@68 15075 * @property # <<<<<<<<<<<<<<
jpayne@68 15076 * def is_vcf(self):
jpayne@68 15077 * """return True if HTSFile is reading or writing a VCF variant file"""
jpayne@68 15078 */
jpayne@68 15079
jpayne@68 15080 /* function exit code */
jpayne@68 15081 __pyx_L1_error:;
jpayne@68 15082 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 15083 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 15084 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_vcf.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 15085 __pyx_r = NULL;
jpayne@68 15086 __pyx_L0:;
jpayne@68 15087 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 15088 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 15089 __Pyx_RefNannyFinishContext();
jpayne@68 15090 return __pyx_r;
jpayne@68 15091 }
jpayne@68 15092
jpayne@68 15093 /* "pysam/libchtslib.pyx":467
jpayne@68 15094 * return self.htsfile != NULL and self.htsfile.format.format == vcf
jpayne@68 15095 *
jpayne@68 15096 * @property # <<<<<<<<<<<<<<
jpayne@68 15097 * def is_bcf(self):
jpayne@68 15098 * """return True if HTSFile is reading or writing a BCF variant file"""
jpayne@68 15099 */
jpayne@68 15100
jpayne@68 15101 /* Python wrapper */
jpayne@68 15102 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6is_bcf_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 15103 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_6is_bcf_1__get__(PyObject *__pyx_v_self) {
jpayne@68 15104 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 15105 PyObject *__pyx_r = 0;
jpayne@68 15106 __Pyx_RefNannyDeclarations
jpayne@68 15107 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 15108 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 15109 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_6is_bcf___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 15110
jpayne@68 15111 /* function exit code */
jpayne@68 15112 __Pyx_RefNannyFinishContext();
jpayne@68 15113 return __pyx_r;
jpayne@68 15114 }
jpayne@68 15115
jpayne@68 15116 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_6is_bcf___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 15117 PyObject *__pyx_r = NULL;
jpayne@68 15118 __Pyx_TraceDeclarations
jpayne@68 15119 __Pyx_RefNannyDeclarations
jpayne@68 15120 PyObject *__pyx_t_1 = NULL;
jpayne@68 15121 int __pyx_t_2;
jpayne@68 15122 PyObject *__pyx_t_3 = NULL;
jpayne@68 15123 int __pyx_lineno = 0;
jpayne@68 15124 const char *__pyx_filename = NULL;
jpayne@68 15125 int __pyx_clineno = 0;
jpayne@68 15126 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 15127 __Pyx_TraceCall("__get__", __pyx_f[0], 467, 0, __PYX_ERR(0, 467, __pyx_L1_error));
jpayne@68 15128
jpayne@68 15129 /* "pysam/libchtslib.pyx":470
jpayne@68 15130 * def is_bcf(self):
jpayne@68 15131 * """return True if HTSFile is reading or writing a BCF variant file"""
jpayne@68 15132 * return self.htsfile != NULL and self.htsfile.format.format == bcf # <<<<<<<<<<<<<<
jpayne@68 15133 *
jpayne@68 15134 * def reset(self):
jpayne@68 15135 */
jpayne@68 15136 __Pyx_XDECREF(__pyx_r);
jpayne@68 15137 __pyx_t_2 = (__pyx_v_self->htsfile != NULL);
jpayne@68 15138 if (__pyx_t_2) {
jpayne@68 15139 } else {
jpayne@68 15140 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error)
jpayne@68 15141 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 15142 __pyx_t_1 = __pyx_t_3;
jpayne@68 15143 __pyx_t_3 = 0;
jpayne@68 15144 goto __pyx_L3_bool_binop_done;
jpayne@68 15145 }
jpayne@68 15146 __pyx_t_2 = (__pyx_v_self->htsfile->format.format == bcf);
jpayne@68 15147 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error)
jpayne@68 15148 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 15149 __pyx_t_1 = __pyx_t_3;
jpayne@68 15150 __pyx_t_3 = 0;
jpayne@68 15151 __pyx_L3_bool_binop_done:;
jpayne@68 15152 __pyx_r = __pyx_t_1;
jpayne@68 15153 __pyx_t_1 = 0;
jpayne@68 15154 goto __pyx_L0;
jpayne@68 15155
jpayne@68 15156 /* "pysam/libchtslib.pyx":467
jpayne@68 15157 * return self.htsfile != NULL and self.htsfile.format.format == vcf
jpayne@68 15158 *
jpayne@68 15159 * @property # <<<<<<<<<<<<<<
jpayne@68 15160 * def is_bcf(self):
jpayne@68 15161 * """return True if HTSFile is reading or writing a BCF variant file"""
jpayne@68 15162 */
jpayne@68 15163
jpayne@68 15164 /* function exit code */
jpayne@68 15165 __pyx_L1_error:;
jpayne@68 15166 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 15167 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 15168 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_bcf.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 15169 __pyx_r = NULL;
jpayne@68 15170 __pyx_L0:;
jpayne@68 15171 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 15172 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 15173 __Pyx_RefNannyFinishContext();
jpayne@68 15174 return __pyx_r;
jpayne@68 15175 }
jpayne@68 15176
jpayne@68 15177 /* "pysam/libchtslib.pyx":472
jpayne@68 15178 * return self.htsfile != NULL and self.htsfile.format.format == bcf
jpayne@68 15179 *
jpayne@68 15180 * def reset(self): # <<<<<<<<<<<<<<
jpayne@68 15181 * """reset file position to beginning of file just after the header.
jpayne@68 15182 *
jpayne@68 15183 */
jpayne@68 15184
jpayne@68 15185 /* Python wrapper */
jpayne@68 15186 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_15reset(PyObject *__pyx_v_self,
jpayne@68 15187 #if CYTHON_METH_FASTCALL
jpayne@68 15188 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 15189 #else
jpayne@68 15190 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 15191 #endif
jpayne@68 15192 ); /*proto*/
jpayne@68 15193 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_14reset, "HTSFile.reset(self)\nreset file position to beginning of file just after the header.\n\n Returns\n -------\n\n The file position after moving the file pointer. : pointer\n\n ");
jpayne@68 15194 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_15reset = {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_15reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_14reset};
jpayne@68 15195 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_15reset(PyObject *__pyx_v_self,
jpayne@68 15196 #if CYTHON_METH_FASTCALL
jpayne@68 15197 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 15198 #else
jpayne@68 15199 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 15200 #endif
jpayne@68 15201 ) {
jpayne@68 15202 #if !CYTHON_METH_FASTCALL
jpayne@68 15203 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 15204 #endif
jpayne@68 15205 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 15206 PyObject *__pyx_r = 0;
jpayne@68 15207 __Pyx_RefNannyDeclarations
jpayne@68 15208 __Pyx_RefNannySetupContext("reset (wrapper)", 0);
jpayne@68 15209 #if !CYTHON_METH_FASTCALL
jpayne@68 15210 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 15211 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 15212 #else
jpayne@68 15213 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 15214 #endif
jpayne@68 15215 #endif
jpayne@68 15216 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 15217 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 15218 __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 15219 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL;
jpayne@68 15220 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_14reset(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 15221
jpayne@68 15222 /* function exit code */
jpayne@68 15223 __Pyx_RefNannyFinishContext();
jpayne@68 15224 return __pyx_r;
jpayne@68 15225 }
jpayne@68 15226
jpayne@68 15227 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_14reset(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 15228 PyObject *__pyx_r = NULL;
jpayne@68 15229 __Pyx_TraceDeclarations
jpayne@68 15230 __Pyx_RefNannyDeclarations
jpayne@68 15231 PyObject *__pyx_t_1 = NULL;
jpayne@68 15232 PyObject *__pyx_t_2 = NULL;
jpayne@68 15233 PyObject *__pyx_t_3 = NULL;
jpayne@68 15234 PyObject *__pyx_t_4 = NULL;
jpayne@68 15235 unsigned int __pyx_t_5;
jpayne@68 15236 int __pyx_lineno = 0;
jpayne@68 15237 const char *__pyx_filename = NULL;
jpayne@68 15238 int __pyx_clineno = 0;
jpayne@68 15239 __Pyx_TraceFrameInit(__pyx_codeobj__40)
jpayne@68 15240 __Pyx_RefNannySetupContext("reset", 1);
jpayne@68 15241 __Pyx_TraceCall("reset", __pyx_f[0], 472, 0, __PYX_ERR(0, 472, __pyx_L1_error));
jpayne@68 15242
jpayne@68 15243 /* "pysam/libchtslib.pyx":481
jpayne@68 15244 *
jpayne@68 15245 * """
jpayne@68 15246 * return self.seek(self.start_offset) # <<<<<<<<<<<<<<
jpayne@68 15247 *
jpayne@68 15248 * def seek(self, uint64_t offset, int whence=io.SEEK_SET):
jpayne@68 15249 */
jpayne@68 15250 __Pyx_XDECREF(__pyx_r);
jpayne@68 15251 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
jpayne@68 15252 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 15253 __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_self->start_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
jpayne@68 15254 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 15255 __pyx_t_4 = NULL;
jpayne@68 15256 __pyx_t_5 = 0;
jpayne@68 15257 #if CYTHON_UNPACK_METHODS
jpayne@68 15258 if (likely(PyMethod_Check(__pyx_t_2))) {
jpayne@68 15259 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
jpayne@68 15260 if (likely(__pyx_t_4)) {
jpayne@68 15261 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
jpayne@68 15262 __Pyx_INCREF(__pyx_t_4);
jpayne@68 15263 __Pyx_INCREF(function);
jpayne@68 15264 __Pyx_DECREF_SET(__pyx_t_2, function);
jpayne@68 15265 __pyx_t_5 = 1;
jpayne@68 15266 }
jpayne@68 15267 }
jpayne@68 15268 #endif
jpayne@68 15269 {
jpayne@68 15270 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
jpayne@68 15271 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
jpayne@68 15272 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 15273 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 15274 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
jpayne@68 15275 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 15276 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 15277 }
jpayne@68 15278 __pyx_r = __pyx_t_1;
jpayne@68 15279 __pyx_t_1 = 0;
jpayne@68 15280 goto __pyx_L0;
jpayne@68 15281
jpayne@68 15282 /* "pysam/libchtslib.pyx":472
jpayne@68 15283 * return self.htsfile != NULL and self.htsfile.format.format == bcf
jpayne@68 15284 *
jpayne@68 15285 * def reset(self): # <<<<<<<<<<<<<<
jpayne@68 15286 * """reset file position to beginning of file just after the header.
jpayne@68 15287 *
jpayne@68 15288 */
jpayne@68 15289
jpayne@68 15290 /* function exit code */
jpayne@68 15291 __pyx_L1_error:;
jpayne@68 15292 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 15293 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 15294 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 15295 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 15296 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 15297 __pyx_r = NULL;
jpayne@68 15298 __pyx_L0:;
jpayne@68 15299 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 15300 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 15301 __Pyx_RefNannyFinishContext();
jpayne@68 15302 return __pyx_r;
jpayne@68 15303 }
jpayne@68 15304
jpayne@68 15305 /* "pysam/libchtslib.pyx":483
jpayne@68 15306 * return self.seek(self.start_offset)
jpayne@68 15307 *
jpayne@68 15308 * def seek(self, uint64_t offset, int whence=io.SEEK_SET): # <<<<<<<<<<<<<<
jpayne@68 15309 * """move file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`."""
jpayne@68 15310 * if not self.is_open:
jpayne@68 15311 */
jpayne@68 15312
jpayne@68 15313 /* Python wrapper */
jpayne@68 15314 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_17seek(PyObject *__pyx_v_self,
jpayne@68 15315 #if CYTHON_METH_FASTCALL
jpayne@68 15316 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 15317 #else
jpayne@68 15318 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 15319 #endif
jpayne@68 15320 ); /*proto*/
jpayne@68 15321 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_16seek, "HTSFile.seek(self, uint64_t offset, int whence=io.SEEK_SET)\nmove file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`.");
jpayne@68 15322 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_17seek = {"seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_17seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_16seek};
jpayne@68 15323 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_17seek(PyObject *__pyx_v_self,
jpayne@68 15324 #if CYTHON_METH_FASTCALL
jpayne@68 15325 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 15326 #else
jpayne@68 15327 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 15328 #endif
jpayne@68 15329 ) {
jpayne@68 15330 uint64_t __pyx_v_offset;
jpayne@68 15331 int __pyx_v_whence;
jpayne@68 15332 #if !CYTHON_METH_FASTCALL
jpayne@68 15333 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 15334 #endif
jpayne@68 15335 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 15336 PyObject* values[2] = {0,0};
jpayne@68 15337 int __pyx_lineno = 0;
jpayne@68 15338 const char *__pyx_filename = NULL;
jpayne@68 15339 int __pyx_clineno = 0;
jpayne@68 15340 PyObject *__pyx_r = 0;
jpayne@68 15341 __Pyx_RefNannyDeclarations
jpayne@68 15342 __Pyx_RefNannySetupContext("seek (wrapper)", 0);
jpayne@68 15343 #if !CYTHON_METH_FASTCALL
jpayne@68 15344 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 15345 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 15346 #else
jpayne@68 15347 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 15348 #endif
jpayne@68 15349 #endif
jpayne@68 15350 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 15351 {
jpayne@68 15352 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_whence,0};
jpayne@68 15353 if (__pyx_kwds) {
jpayne@68 15354 Py_ssize_t kw_args;
jpayne@68 15355 switch (__pyx_nargs) {
jpayne@68 15356 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 15357 CYTHON_FALLTHROUGH;
jpayne@68 15358 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 15359 CYTHON_FALLTHROUGH;
jpayne@68 15360 case 0: break;
jpayne@68 15361 default: goto __pyx_L5_argtuple_error;
jpayne@68 15362 }
jpayne@68 15363 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 15364 switch (__pyx_nargs) {
jpayne@68 15365 case 0:
jpayne@68 15366 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
jpayne@68 15367 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 15368 kw_args--;
jpayne@68 15369 }
jpayne@68 15370 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error)
jpayne@68 15371 else goto __pyx_L5_argtuple_error;
jpayne@68 15372 CYTHON_FALLTHROUGH;
jpayne@68 15373 case 1:
jpayne@68 15374 if (kw_args > 0) {
jpayne@68 15375 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_whence);
jpayne@68 15376 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 15377 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error)
jpayne@68 15378 }
jpayne@68 15379 }
jpayne@68 15380 if (unlikely(kw_args > 0)) {
jpayne@68 15381 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 15382 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "seek") < 0)) __PYX_ERR(0, 483, __pyx_L3_error)
jpayne@68 15383 }
jpayne@68 15384 } else {
jpayne@68 15385 switch (__pyx_nargs) {
jpayne@68 15386 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 15387 CYTHON_FALLTHROUGH;
jpayne@68 15388 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 15389 break;
jpayne@68 15390 default: goto __pyx_L5_argtuple_error;
jpayne@68 15391 }
jpayne@68 15392 }
jpayne@68 15393 __pyx_v_offset = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_offset == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error)
jpayne@68 15394 if (values[1]) {
jpayne@68 15395 __pyx_v_whence = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error)
jpayne@68 15396 } else {
jpayne@68 15397 __pyx_v_whence = __pyx_k__41;
jpayne@68 15398 }
jpayne@68 15399 }
jpayne@68 15400 goto __pyx_L6_skip;
jpayne@68 15401 __pyx_L5_argtuple_error:;
jpayne@68 15402 __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 483, __pyx_L3_error)
jpayne@68 15403 __pyx_L6_skip:;
jpayne@68 15404 goto __pyx_L4_argument_unpacking_done;
jpayne@68 15405 __pyx_L3_error:;
jpayne@68 15406 {
jpayne@68 15407 Py_ssize_t __pyx_temp;
jpayne@68 15408 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 15409 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 15410 }
jpayne@68 15411 }
jpayne@68 15412 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 15413 __Pyx_RefNannyFinishContext();
jpayne@68 15414 return NULL;
jpayne@68 15415 __pyx_L4_argument_unpacking_done:;
jpayne@68 15416 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_16seek(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_offset, __pyx_v_whence);
jpayne@68 15417
jpayne@68 15418 /* function exit code */
jpayne@68 15419 {
jpayne@68 15420 Py_ssize_t __pyx_temp;
jpayne@68 15421 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 15422 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 15423 }
jpayne@68 15424 }
jpayne@68 15425 __Pyx_RefNannyFinishContext();
jpayne@68 15426 return __pyx_r;
jpayne@68 15427 }
jpayne@68 15428
jpayne@68 15429 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_16seek(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, uint64_t __pyx_v_offset, int __pyx_v_whence) {
jpayne@68 15430 int64_t __pyx_v_ret;
jpayne@68 15431 PyObject *__pyx_r = NULL;
jpayne@68 15432 __Pyx_TraceDeclarations
jpayne@68 15433 __Pyx_RefNannyDeclarations
jpayne@68 15434 PyObject *__pyx_t_1 = NULL;
jpayne@68 15435 int __pyx_t_2;
jpayne@68 15436 int __pyx_t_3;
jpayne@68 15437 int __pyx_t_4;
jpayne@68 15438 int64_t __pyx_t_5;
jpayne@68 15439 PyObject *__pyx_t_6 = NULL;
jpayne@68 15440 PyObject *__pyx_t_7 = NULL;
jpayne@68 15441 PyObject *__pyx_t_8 = NULL;
jpayne@68 15442 unsigned int __pyx_t_9;
jpayne@68 15443 int __pyx_lineno = 0;
jpayne@68 15444 const char *__pyx_filename = NULL;
jpayne@68 15445 int __pyx_clineno = 0;
jpayne@68 15446 __Pyx_TraceFrameInit(__pyx_codeobj__42)
jpayne@68 15447 __Pyx_RefNannySetupContext("seek", 1);
jpayne@68 15448 __Pyx_TraceCall("seek", __pyx_f[0], 483, 0, __PYX_ERR(0, 483, __pyx_L1_error));
jpayne@68 15449
jpayne@68 15450 /* "pysam/libchtslib.pyx":485
jpayne@68 15451 * def seek(self, uint64_t offset, int whence=io.SEEK_SET):
jpayne@68 15452 * """move file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`."""
jpayne@68 15453 * if not self.is_open: # <<<<<<<<<<<<<<
jpayne@68 15454 * raise ValueError('I/O operation on closed file')
jpayne@68 15455 * if self.is_stream:
jpayne@68 15456 */
jpayne@68 15457 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
jpayne@68 15458 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 15459 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 485, __pyx_L1_error)
jpayne@68 15460 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 15461 __pyx_t_3 = (!__pyx_t_2);
jpayne@68 15462 if (unlikely(__pyx_t_3)) {
jpayne@68 15463
jpayne@68 15464 /* "pysam/libchtslib.pyx":486
jpayne@68 15465 * """move file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`."""
jpayne@68 15466 * if not self.is_open:
jpayne@68 15467 * raise ValueError('I/O operation on closed file') # <<<<<<<<<<<<<<
jpayne@68 15468 * if self.is_stream:
jpayne@68 15469 * raise IOError('seek not available in streams')
jpayne@68 15470 */
jpayne@68 15471 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
jpayne@68 15472 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 15473 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 15474 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 15475 __PYX_ERR(0, 486, __pyx_L1_error)
jpayne@68 15476
jpayne@68 15477 /* "pysam/libchtslib.pyx":485
jpayne@68 15478 * def seek(self, uint64_t offset, int whence=io.SEEK_SET):
jpayne@68 15479 * """move file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`."""
jpayne@68 15480 * if not self.is_open: # <<<<<<<<<<<<<<
jpayne@68 15481 * raise ValueError('I/O operation on closed file')
jpayne@68 15482 * if self.is_stream:
jpayne@68 15483 */
jpayne@68 15484 }
jpayne@68 15485
jpayne@68 15486 /* "pysam/libchtslib.pyx":487
jpayne@68 15487 * if not self.is_open:
jpayne@68 15488 * raise ValueError('I/O operation on closed file')
jpayne@68 15489 * if self.is_stream: # <<<<<<<<<<<<<<
jpayne@68 15490 * raise IOError('seek not available in streams')
jpayne@68 15491 *
jpayne@68 15492 */
jpayne@68 15493 if (unlikely(__pyx_v_self->is_stream)) {
jpayne@68 15494
jpayne@68 15495 /* "pysam/libchtslib.pyx":488
jpayne@68 15496 * raise ValueError('I/O operation on closed file')
jpayne@68 15497 * if self.is_stream:
jpayne@68 15498 * raise IOError('seek not available in streams') # <<<<<<<<<<<<<<
jpayne@68 15499 *
jpayne@68 15500 * whence = libc_whence_from_io(whence)
jpayne@68 15501 */
jpayne@68 15502 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
jpayne@68 15503 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 15504 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 15505 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 15506 __PYX_ERR(0, 488, __pyx_L1_error)
jpayne@68 15507
jpayne@68 15508 /* "pysam/libchtslib.pyx":487
jpayne@68 15509 * if not self.is_open:
jpayne@68 15510 * raise ValueError('I/O operation on closed file')
jpayne@68 15511 * if self.is_stream: # <<<<<<<<<<<<<<
jpayne@68 15512 * raise IOError('seek not available in streams')
jpayne@68 15513 *
jpayne@68 15514 */
jpayne@68 15515 }
jpayne@68 15516
jpayne@68 15517 /* "pysam/libchtslib.pyx":490
jpayne@68 15518 * raise IOError('seek not available in streams')
jpayne@68 15519 *
jpayne@68 15520 * whence = libc_whence_from_io(whence) # <<<<<<<<<<<<<<
jpayne@68 15521 *
jpayne@68 15522 * cdef int64_t ret
jpayne@68 15523 */
jpayne@68 15524 __pyx_t_4 = __pyx_f_5pysam_9libcutils_libc_whence_from_io(__pyx_v_whence); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L1_error)
jpayne@68 15525 __pyx_v_whence = __pyx_t_4;
jpayne@68 15526
jpayne@68 15527 /* "pysam/libchtslib.pyx":493
jpayne@68 15528 *
jpayne@68 15529 * cdef int64_t ret
jpayne@68 15530 * if self.htsfile.format.compression == bgzf: # <<<<<<<<<<<<<<
jpayne@68 15531 * with nogil:
jpayne@68 15532 * ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, whence)
jpayne@68 15533 */
jpayne@68 15534 switch (__pyx_v_self->htsfile->format.compression) {
jpayne@68 15535 case bgzf:
jpayne@68 15536
jpayne@68 15537 /* "pysam/libchtslib.pyx":494
jpayne@68 15538 * cdef int64_t ret
jpayne@68 15539 * if self.htsfile.format.compression == bgzf:
jpayne@68 15540 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 15541 * ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, whence)
jpayne@68 15542 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15543 */
jpayne@68 15544 {
jpayne@68 15545 #ifdef WITH_THREAD
jpayne@68 15546 PyThreadState *_save;
jpayne@68 15547 _save = NULL;
jpayne@68 15548 Py_UNBLOCK_THREADS
jpayne@68 15549 __Pyx_FastGIL_Remember();
jpayne@68 15550 #endif
jpayne@68 15551 /*try:*/ {
jpayne@68 15552
jpayne@68 15553 /* "pysam/libchtslib.pyx":495
jpayne@68 15554 * if self.htsfile.format.compression == bgzf:
jpayne@68 15555 * with nogil:
jpayne@68 15556 * ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, whence) # <<<<<<<<<<<<<<
jpayne@68 15557 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15558 * ret = 0 if (hseek(self.htsfile.fp.hfile, offset, whence) >= 0) else -1
jpayne@68 15559 */
jpayne@68 15560 __pyx_v_ret = bgzf_seek(hts_get_bgzfp(__pyx_v_self->htsfile), __pyx_v_offset, __pyx_v_whence);
jpayne@68 15561 }
jpayne@68 15562
jpayne@68 15563 /* "pysam/libchtslib.pyx":494
jpayne@68 15564 * cdef int64_t ret
jpayne@68 15565 * if self.htsfile.format.compression == bgzf:
jpayne@68 15566 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 15567 * ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, whence)
jpayne@68 15568 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15569 */
jpayne@68 15570 /*finally:*/ {
jpayne@68 15571 /*normal exit:*/{
jpayne@68 15572 #ifdef WITH_THREAD
jpayne@68 15573 __Pyx_FastGIL_Forget();
jpayne@68 15574 Py_BLOCK_THREADS
jpayne@68 15575 #endif
jpayne@68 15576 goto __pyx_L7;
jpayne@68 15577 }
jpayne@68 15578 __pyx_L7:;
jpayne@68 15579 }
jpayne@68 15580 }
jpayne@68 15581
jpayne@68 15582 /* "pysam/libchtslib.pyx":493
jpayne@68 15583 *
jpayne@68 15584 * cdef int64_t ret
jpayne@68 15585 * if self.htsfile.format.compression == bgzf: # <<<<<<<<<<<<<<
jpayne@68 15586 * with nogil:
jpayne@68 15587 * ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, whence)
jpayne@68 15588 */
jpayne@68 15589 break;
jpayne@68 15590 case no_compression:
jpayne@68 15591
jpayne@68 15592 /* "pysam/libchtslib.pyx":497
jpayne@68 15593 * ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, whence)
jpayne@68 15594 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15595 * ret = 0 if (hseek(self.htsfile.fp.hfile, offset, whence) >= 0) else -1 # <<<<<<<<<<<<<<
jpayne@68 15596 * else:
jpayne@68 15597 * raise NotImplementedError("seek not implemented in files compressed by method {}".format(
jpayne@68 15598 */
jpayne@68 15599 __pyx_t_3 = (hseek(__pyx_v_self->htsfile->fp.hfile, __pyx_v_offset, __pyx_v_whence) >= 0);
jpayne@68 15600 if (__pyx_t_3) {
jpayne@68 15601 __pyx_t_5 = 0;
jpayne@68 15602 } else {
jpayne@68 15603 __pyx_t_5 = -1L;
jpayne@68 15604 }
jpayne@68 15605 __pyx_v_ret = __pyx_t_5;
jpayne@68 15606
jpayne@68 15607 /* "pysam/libchtslib.pyx":496
jpayne@68 15608 * with nogil:
jpayne@68 15609 * ret = bgzf_seek(hts_get_bgzfp(self.htsfile), offset, whence)
jpayne@68 15610 * elif self.htsfile.format.compression == no_compression: # <<<<<<<<<<<<<<
jpayne@68 15611 * ret = 0 if (hseek(self.htsfile.fp.hfile, offset, whence) >= 0) else -1
jpayne@68 15612 * else:
jpayne@68 15613 */
jpayne@68 15614 break;
jpayne@68 15615 default:
jpayne@68 15616
jpayne@68 15617 /* "pysam/libchtslib.pyx":499
jpayne@68 15618 * ret = 0 if (hseek(self.htsfile.fp.hfile, offset, whence) >= 0) else -1
jpayne@68 15619 * else:
jpayne@68 15620 * raise NotImplementedError("seek not implemented in files compressed by method {}".format( # <<<<<<<<<<<<<<
jpayne@68 15621 * self.htsfile.format.compression))
jpayne@68 15622 * return ret
jpayne@68 15623 */
jpayne@68 15624 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_seek_not_implemented_in_files_co, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error)
jpayne@68 15625 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 15626
jpayne@68 15627 /* "pysam/libchtslib.pyx":500
jpayne@68 15628 * else:
jpayne@68 15629 * raise NotImplementedError("seek not implemented in files compressed by method {}".format(
jpayne@68 15630 * self.htsfile.format.compression)) # <<<<<<<<<<<<<<
jpayne@68 15631 * return ret
jpayne@68 15632 *
jpayne@68 15633 */
jpayne@68 15634 __pyx_t_7 = __Pyx_PyInt_From_enum__htsCompression(__pyx_v_self->htsfile->format.compression); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error)
jpayne@68 15635 __Pyx_GOTREF(__pyx_t_7);
jpayne@68 15636 __pyx_t_8 = NULL;
jpayne@68 15637 __pyx_t_9 = 0;
jpayne@68 15638 #if CYTHON_UNPACK_METHODS
jpayne@68 15639 if (likely(PyMethod_Check(__pyx_t_6))) {
jpayne@68 15640 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
jpayne@68 15641 if (likely(__pyx_t_8)) {
jpayne@68 15642 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
jpayne@68 15643 __Pyx_INCREF(__pyx_t_8);
jpayne@68 15644 __Pyx_INCREF(function);
jpayne@68 15645 __Pyx_DECREF_SET(__pyx_t_6, function);
jpayne@68 15646 __pyx_t_9 = 1;
jpayne@68 15647 }
jpayne@68 15648 }
jpayne@68 15649 #endif
jpayne@68 15650 {
jpayne@68 15651 PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
jpayne@68 15652 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
jpayne@68 15653 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
jpayne@68 15654 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
jpayne@68 15655 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
jpayne@68 15656 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 15657 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 15658 }
jpayne@68 15659
jpayne@68 15660 /* "pysam/libchtslib.pyx":499
jpayne@68 15661 * ret = 0 if (hseek(self.htsfile.fp.hfile, offset, whence) >= 0) else -1
jpayne@68 15662 * else:
jpayne@68 15663 * raise NotImplementedError("seek not implemented in files compressed by method {}".format( # <<<<<<<<<<<<<<
jpayne@68 15664 * self.htsfile.format.compression))
jpayne@68 15665 * return ret
jpayne@68 15666 */
jpayne@68 15667 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error)
jpayne@68 15668 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 15669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 15670 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
jpayne@68 15671 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 15672 __PYX_ERR(0, 499, __pyx_L1_error)
jpayne@68 15673 break;
jpayne@68 15674 }
jpayne@68 15675
jpayne@68 15676 /* "pysam/libchtslib.pyx":501
jpayne@68 15677 * raise NotImplementedError("seek not implemented in files compressed by method {}".format(
jpayne@68 15678 * self.htsfile.format.compression))
jpayne@68 15679 * return ret # <<<<<<<<<<<<<<
jpayne@68 15680 *
jpayne@68 15681 * def tell(self):
jpayne@68 15682 */
jpayne@68 15683 __Pyx_XDECREF(__pyx_r);
jpayne@68 15684 __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error)
jpayne@68 15685 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 15686 __pyx_r = __pyx_t_6;
jpayne@68 15687 __pyx_t_6 = 0;
jpayne@68 15688 goto __pyx_L0;
jpayne@68 15689
jpayne@68 15690 /* "pysam/libchtslib.pyx":483
jpayne@68 15691 * return self.seek(self.start_offset)
jpayne@68 15692 *
jpayne@68 15693 * def seek(self, uint64_t offset, int whence=io.SEEK_SET): # <<<<<<<<<<<<<<
jpayne@68 15694 * """move file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`."""
jpayne@68 15695 * if not self.is_open:
jpayne@68 15696 */
jpayne@68 15697
jpayne@68 15698 /* function exit code */
jpayne@68 15699 __pyx_L1_error:;
jpayne@68 15700 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 15701 __Pyx_XDECREF(__pyx_t_6);
jpayne@68 15702 __Pyx_XDECREF(__pyx_t_7);
jpayne@68 15703 __Pyx_XDECREF(__pyx_t_8);
jpayne@68 15704 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 15705 __pyx_r = NULL;
jpayne@68 15706 __pyx_L0:;
jpayne@68 15707 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 15708 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 15709 __Pyx_RefNannyFinishContext();
jpayne@68 15710 return __pyx_r;
jpayne@68 15711 }
jpayne@68 15712
jpayne@68 15713 /* "pysam/libchtslib.pyx":503
jpayne@68 15714 * return ret
jpayne@68 15715 *
jpayne@68 15716 * def tell(self): # <<<<<<<<<<<<<<
jpayne@68 15717 * """return current file position, see :meth:`pysam.HTSFile.seek`."""
jpayne@68 15718 * if not self.is_open:
jpayne@68 15719 */
jpayne@68 15720
jpayne@68 15721 /* Python wrapper */
jpayne@68 15722 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_19tell(PyObject *__pyx_v_self,
jpayne@68 15723 #if CYTHON_METH_FASTCALL
jpayne@68 15724 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 15725 #else
jpayne@68 15726 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 15727 #endif
jpayne@68 15728 ); /*proto*/
jpayne@68 15729 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_18tell, "HTSFile.tell(self)\nreturn current file position, see :meth:`pysam.HTSFile.seek`.");
jpayne@68 15730 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_19tell = {"tell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_19tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_18tell};
jpayne@68 15731 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_19tell(PyObject *__pyx_v_self,
jpayne@68 15732 #if CYTHON_METH_FASTCALL
jpayne@68 15733 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 15734 #else
jpayne@68 15735 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 15736 #endif
jpayne@68 15737 ) {
jpayne@68 15738 #if !CYTHON_METH_FASTCALL
jpayne@68 15739 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 15740 #endif
jpayne@68 15741 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 15742 PyObject *__pyx_r = 0;
jpayne@68 15743 __Pyx_RefNannyDeclarations
jpayne@68 15744 __Pyx_RefNannySetupContext("tell (wrapper)", 0);
jpayne@68 15745 #if !CYTHON_METH_FASTCALL
jpayne@68 15746 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 15747 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 15748 #else
jpayne@68 15749 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 15750 #endif
jpayne@68 15751 #endif
jpayne@68 15752 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 15753 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 15754 __Pyx_RaiseArgtupleInvalid("tell", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 15755 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "tell", 0))) return NULL;
jpayne@68 15756 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_18tell(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 15757
jpayne@68 15758 /* function exit code */
jpayne@68 15759 __Pyx_RefNannyFinishContext();
jpayne@68 15760 return __pyx_r;
jpayne@68 15761 }
jpayne@68 15762
jpayne@68 15763 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_18tell(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 15764 int64_t __pyx_v_ret;
jpayne@68 15765 PyObject *__pyx_r = NULL;
jpayne@68 15766 __Pyx_TraceDeclarations
jpayne@68 15767 __Pyx_RefNannyDeclarations
jpayne@68 15768 PyObject *__pyx_t_1 = NULL;
jpayne@68 15769 int __pyx_t_2;
jpayne@68 15770 int __pyx_t_3;
jpayne@68 15771 PyObject *__pyx_t_4 = NULL;
jpayne@68 15772 PyObject *__pyx_t_5 = NULL;
jpayne@68 15773 PyObject *__pyx_t_6 = NULL;
jpayne@68 15774 unsigned int __pyx_t_7;
jpayne@68 15775 int __pyx_lineno = 0;
jpayne@68 15776 const char *__pyx_filename = NULL;
jpayne@68 15777 int __pyx_clineno = 0;
jpayne@68 15778 __Pyx_TraceFrameInit(__pyx_codeobj__45)
jpayne@68 15779 __Pyx_RefNannySetupContext("tell", 1);
jpayne@68 15780 __Pyx_TraceCall("tell", __pyx_f[0], 503, 0, __PYX_ERR(0, 503, __pyx_L1_error));
jpayne@68 15781
jpayne@68 15782 /* "pysam/libchtslib.pyx":505
jpayne@68 15783 * def tell(self):
jpayne@68 15784 * """return current file position, see :meth:`pysam.HTSFile.seek`."""
jpayne@68 15785 * if not self.is_open: # <<<<<<<<<<<<<<
jpayne@68 15786 * raise ValueError('I/O operation on closed file')
jpayne@68 15787 * if self.is_stream:
jpayne@68 15788 */
jpayne@68 15789 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
jpayne@68 15790 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 15791 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 505, __pyx_L1_error)
jpayne@68 15792 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 15793 __pyx_t_3 = (!__pyx_t_2);
jpayne@68 15794 if (unlikely(__pyx_t_3)) {
jpayne@68 15795
jpayne@68 15796 /* "pysam/libchtslib.pyx":506
jpayne@68 15797 * """return current file position, see :meth:`pysam.HTSFile.seek`."""
jpayne@68 15798 * if not self.is_open:
jpayne@68 15799 * raise ValueError('I/O operation on closed file') # <<<<<<<<<<<<<<
jpayne@68 15800 * if self.is_stream:
jpayne@68 15801 * raise IOError('tell not available in streams')
jpayne@68 15802 */
jpayne@68 15803 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
jpayne@68 15804 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 15805 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 15806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 15807 __PYX_ERR(0, 506, __pyx_L1_error)
jpayne@68 15808
jpayne@68 15809 /* "pysam/libchtslib.pyx":505
jpayne@68 15810 * def tell(self):
jpayne@68 15811 * """return current file position, see :meth:`pysam.HTSFile.seek`."""
jpayne@68 15812 * if not self.is_open: # <<<<<<<<<<<<<<
jpayne@68 15813 * raise ValueError('I/O operation on closed file')
jpayne@68 15814 * if self.is_stream:
jpayne@68 15815 */
jpayne@68 15816 }
jpayne@68 15817
jpayne@68 15818 /* "pysam/libchtslib.pyx":507
jpayne@68 15819 * if not self.is_open:
jpayne@68 15820 * raise ValueError('I/O operation on closed file')
jpayne@68 15821 * if self.is_stream: # <<<<<<<<<<<<<<
jpayne@68 15822 * raise IOError('tell not available in streams')
jpayne@68 15823 *
jpayne@68 15824 */
jpayne@68 15825 if (unlikely(__pyx_v_self->is_stream)) {
jpayne@68 15826
jpayne@68 15827 /* "pysam/libchtslib.pyx":508
jpayne@68 15828 * raise ValueError('I/O operation on closed file')
jpayne@68 15829 * if self.is_stream:
jpayne@68 15830 * raise IOError('tell not available in streams') # <<<<<<<<<<<<<<
jpayne@68 15831 *
jpayne@68 15832 * cdef int64_t ret
jpayne@68 15833 */
jpayne@68 15834 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
jpayne@68 15835 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 15836 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 15837 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 15838 __PYX_ERR(0, 508, __pyx_L1_error)
jpayne@68 15839
jpayne@68 15840 /* "pysam/libchtslib.pyx":507
jpayne@68 15841 * if not self.is_open:
jpayne@68 15842 * raise ValueError('I/O operation on closed file')
jpayne@68 15843 * if self.is_stream: # <<<<<<<<<<<<<<
jpayne@68 15844 * raise IOError('tell not available in streams')
jpayne@68 15845 *
jpayne@68 15846 */
jpayne@68 15847 }
jpayne@68 15848
jpayne@68 15849 /* "pysam/libchtslib.pyx":511
jpayne@68 15850 *
jpayne@68 15851 * cdef int64_t ret
jpayne@68 15852 * if self.htsfile.format.compression == bgzf: # <<<<<<<<<<<<<<
jpayne@68 15853 * with nogil:
jpayne@68 15854 * ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
jpayne@68 15855 */
jpayne@68 15856 __pyx_t_3 = (__pyx_v_self->htsfile->format.compression == bgzf);
jpayne@68 15857 if (__pyx_t_3) {
jpayne@68 15858
jpayne@68 15859 /* "pysam/libchtslib.pyx":512
jpayne@68 15860 * cdef int64_t ret
jpayne@68 15861 * if self.htsfile.format.compression == bgzf:
jpayne@68 15862 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 15863 * ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
jpayne@68 15864 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15865 */
jpayne@68 15866 {
jpayne@68 15867 #ifdef WITH_THREAD
jpayne@68 15868 PyThreadState *_save;
jpayne@68 15869 _save = NULL;
jpayne@68 15870 Py_UNBLOCK_THREADS
jpayne@68 15871 __Pyx_FastGIL_Remember();
jpayne@68 15872 #endif
jpayne@68 15873 /*try:*/ {
jpayne@68 15874
jpayne@68 15875 /* "pysam/libchtslib.pyx":513
jpayne@68 15876 * if self.htsfile.format.compression == bgzf:
jpayne@68 15877 * with nogil:
jpayne@68 15878 * ret = bgzf_tell(hts_get_bgzfp(self.htsfile)) # <<<<<<<<<<<<<<
jpayne@68 15879 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15880 * ret = htell(self.htsfile.fp.hfile)
jpayne@68 15881 */
jpayne@68 15882 __pyx_v_ret = bgzf_tell(hts_get_bgzfp(__pyx_v_self->htsfile));
jpayne@68 15883 }
jpayne@68 15884
jpayne@68 15885 /* "pysam/libchtslib.pyx":512
jpayne@68 15886 * cdef int64_t ret
jpayne@68 15887 * if self.htsfile.format.compression == bgzf:
jpayne@68 15888 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 15889 * ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
jpayne@68 15890 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15891 */
jpayne@68 15892 /*finally:*/ {
jpayne@68 15893 /*normal exit:*/{
jpayne@68 15894 #ifdef WITH_THREAD
jpayne@68 15895 __Pyx_FastGIL_Forget();
jpayne@68 15896 Py_BLOCK_THREADS
jpayne@68 15897 #endif
jpayne@68 15898 goto __pyx_L8;
jpayne@68 15899 }
jpayne@68 15900 __pyx_L8:;
jpayne@68 15901 }
jpayne@68 15902 }
jpayne@68 15903
jpayne@68 15904 /* "pysam/libchtslib.pyx":511
jpayne@68 15905 *
jpayne@68 15906 * cdef int64_t ret
jpayne@68 15907 * if self.htsfile.format.compression == bgzf: # <<<<<<<<<<<<<<
jpayne@68 15908 * with nogil:
jpayne@68 15909 * ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
jpayne@68 15910 */
jpayne@68 15911 goto __pyx_L5;
jpayne@68 15912 }
jpayne@68 15913
jpayne@68 15914 /* "pysam/libchtslib.pyx":514
jpayne@68 15915 * with nogil:
jpayne@68 15916 * ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
jpayne@68 15917 * elif self.htsfile.format.compression == no_compression: # <<<<<<<<<<<<<<
jpayne@68 15918 * ret = htell(self.htsfile.fp.hfile)
jpayne@68 15919 * elif self.htsfile.format.format == cram:
jpayne@68 15920 */
jpayne@68 15921 __pyx_t_3 = (__pyx_v_self->htsfile->format.compression == no_compression);
jpayne@68 15922 if (__pyx_t_3) {
jpayne@68 15923
jpayne@68 15924 /* "pysam/libchtslib.pyx":515
jpayne@68 15925 * ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
jpayne@68 15926 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15927 * ret = htell(self.htsfile.fp.hfile) # <<<<<<<<<<<<<<
jpayne@68 15928 * elif self.htsfile.format.format == cram:
jpayne@68 15929 * with nogil:
jpayne@68 15930 */
jpayne@68 15931 __pyx_v_ret = htell(__pyx_v_self->htsfile->fp.hfile);
jpayne@68 15932
jpayne@68 15933 /* "pysam/libchtslib.pyx":514
jpayne@68 15934 * with nogil:
jpayne@68 15935 * ret = bgzf_tell(hts_get_bgzfp(self.htsfile))
jpayne@68 15936 * elif self.htsfile.format.compression == no_compression: # <<<<<<<<<<<<<<
jpayne@68 15937 * ret = htell(self.htsfile.fp.hfile)
jpayne@68 15938 * elif self.htsfile.format.format == cram:
jpayne@68 15939 */
jpayne@68 15940 goto __pyx_L5;
jpayne@68 15941 }
jpayne@68 15942
jpayne@68 15943 /* "pysam/libchtslib.pyx":516
jpayne@68 15944 * elif self.htsfile.format.compression == no_compression:
jpayne@68 15945 * ret = htell(self.htsfile.fp.hfile)
jpayne@68 15946 * elif self.htsfile.format.format == cram: # <<<<<<<<<<<<<<
jpayne@68 15947 * with nogil:
jpayne@68 15948 * ret = htell(cram_fd_get_fp(self.htsfile.fp.cram))
jpayne@68 15949 */
jpayne@68 15950 __pyx_t_3 = (__pyx_v_self->htsfile->format.format == cram);
jpayne@68 15951 if (likely(__pyx_t_3)) {
jpayne@68 15952
jpayne@68 15953 /* "pysam/libchtslib.pyx":517
jpayne@68 15954 * ret = htell(self.htsfile.fp.hfile)
jpayne@68 15955 * elif self.htsfile.format.format == cram:
jpayne@68 15956 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 15957 * ret = htell(cram_fd_get_fp(self.htsfile.fp.cram))
jpayne@68 15958 * else:
jpayne@68 15959 */
jpayne@68 15960 {
jpayne@68 15961 #ifdef WITH_THREAD
jpayne@68 15962 PyThreadState *_save;
jpayne@68 15963 _save = NULL;
jpayne@68 15964 Py_UNBLOCK_THREADS
jpayne@68 15965 __Pyx_FastGIL_Remember();
jpayne@68 15966 #endif
jpayne@68 15967 /*try:*/ {
jpayne@68 15968
jpayne@68 15969 /* "pysam/libchtslib.pyx":518
jpayne@68 15970 * elif self.htsfile.format.format == cram:
jpayne@68 15971 * with nogil:
jpayne@68 15972 * ret = htell(cram_fd_get_fp(self.htsfile.fp.cram)) # <<<<<<<<<<<<<<
jpayne@68 15973 * else:
jpayne@68 15974 * raise NotImplementedError("seek not implemented in files compressed by method {}".format(
jpayne@68 15975 */
jpayne@68 15976 __pyx_v_ret = htell(cram_fd_get_fp(__pyx_v_self->htsfile->fp.cram));
jpayne@68 15977 }
jpayne@68 15978
jpayne@68 15979 /* "pysam/libchtslib.pyx":517
jpayne@68 15980 * ret = htell(self.htsfile.fp.hfile)
jpayne@68 15981 * elif self.htsfile.format.format == cram:
jpayne@68 15982 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 15983 * ret = htell(cram_fd_get_fp(self.htsfile.fp.cram))
jpayne@68 15984 * else:
jpayne@68 15985 */
jpayne@68 15986 /*finally:*/ {
jpayne@68 15987 /*normal exit:*/{
jpayne@68 15988 #ifdef WITH_THREAD
jpayne@68 15989 __Pyx_FastGIL_Forget();
jpayne@68 15990 Py_BLOCK_THREADS
jpayne@68 15991 #endif
jpayne@68 15992 goto __pyx_L11;
jpayne@68 15993 }
jpayne@68 15994 __pyx_L11:;
jpayne@68 15995 }
jpayne@68 15996 }
jpayne@68 15997
jpayne@68 15998 /* "pysam/libchtslib.pyx":516
jpayne@68 15999 * elif self.htsfile.format.compression == no_compression:
jpayne@68 16000 * ret = htell(self.htsfile.fp.hfile)
jpayne@68 16001 * elif self.htsfile.format.format == cram: # <<<<<<<<<<<<<<
jpayne@68 16002 * with nogil:
jpayne@68 16003 * ret = htell(cram_fd_get_fp(self.htsfile.fp.cram))
jpayne@68 16004 */
jpayne@68 16005 goto __pyx_L5;
jpayne@68 16006 }
jpayne@68 16007
jpayne@68 16008 /* "pysam/libchtslib.pyx":520
jpayne@68 16009 * ret = htell(cram_fd_get_fp(self.htsfile.fp.cram))
jpayne@68 16010 * else:
jpayne@68 16011 * raise NotImplementedError("seek not implemented in files compressed by method {}".format( # <<<<<<<<<<<<<<
jpayne@68 16012 * self.htsfile.format.compression))
jpayne@68 16013 *
jpayne@68 16014 */
jpayne@68 16015 /*else*/ {
jpayne@68 16016 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_seek_not_implemented_in_files_co, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
jpayne@68 16017 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 16018
jpayne@68 16019 /* "pysam/libchtslib.pyx":521
jpayne@68 16020 * else:
jpayne@68 16021 * raise NotImplementedError("seek not implemented in files compressed by method {}".format(
jpayne@68 16022 * self.htsfile.format.compression)) # <<<<<<<<<<<<<<
jpayne@68 16023 *
jpayne@68 16024 * return ret
jpayne@68 16025 */
jpayne@68 16026 __pyx_t_5 = __Pyx_PyInt_From_enum__htsCompression(__pyx_v_self->htsfile->format.compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 521, __pyx_L1_error)
jpayne@68 16027 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16028 __pyx_t_6 = NULL;
jpayne@68 16029 __pyx_t_7 = 0;
jpayne@68 16030 #if CYTHON_UNPACK_METHODS
jpayne@68 16031 if (likely(PyMethod_Check(__pyx_t_4))) {
jpayne@68 16032 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
jpayne@68 16033 if (likely(__pyx_t_6)) {
jpayne@68 16034 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
jpayne@68 16035 __Pyx_INCREF(__pyx_t_6);
jpayne@68 16036 __Pyx_INCREF(function);
jpayne@68 16037 __Pyx_DECREF_SET(__pyx_t_4, function);
jpayne@68 16038 __pyx_t_7 = 1;
jpayne@68 16039 }
jpayne@68 16040 }
jpayne@68 16041 #endif
jpayne@68 16042 {
jpayne@68 16043 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
jpayne@68 16044 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
jpayne@68 16045 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 16046 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 16047 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error)
jpayne@68 16048 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 16049 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 16050 }
jpayne@68 16051
jpayne@68 16052 /* "pysam/libchtslib.pyx":520
jpayne@68 16053 * ret = htell(cram_fd_get_fp(self.htsfile.fp.cram))
jpayne@68 16054 * else:
jpayne@68 16055 * raise NotImplementedError("seek not implemented in files compressed by method {}".format( # <<<<<<<<<<<<<<
jpayne@68 16056 * self.htsfile.format.compression))
jpayne@68 16057 *
jpayne@68 16058 */
jpayne@68 16059 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
jpayne@68 16060 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 16061 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 16062 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
jpayne@68 16063 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 16064 __PYX_ERR(0, 520, __pyx_L1_error)
jpayne@68 16065 }
jpayne@68 16066 __pyx_L5:;
jpayne@68 16067
jpayne@68 16068 /* "pysam/libchtslib.pyx":523
jpayne@68 16069 * self.htsfile.format.compression))
jpayne@68 16070 *
jpayne@68 16071 * return ret # <<<<<<<<<<<<<<
jpayne@68 16072 *
jpayne@68 16073 * cdef htsFile *_open_htsfile(self) except? NULL:
jpayne@68 16074 */
jpayne@68 16075 __Pyx_XDECREF(__pyx_r);
jpayne@68 16076 __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
jpayne@68 16077 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 16078 __pyx_r = __pyx_t_4;
jpayne@68 16079 __pyx_t_4 = 0;
jpayne@68 16080 goto __pyx_L0;
jpayne@68 16081
jpayne@68 16082 /* "pysam/libchtslib.pyx":503
jpayne@68 16083 * return ret
jpayne@68 16084 *
jpayne@68 16085 * def tell(self): # <<<<<<<<<<<<<<
jpayne@68 16086 * """return current file position, see :meth:`pysam.HTSFile.seek`."""
jpayne@68 16087 * if not self.is_open:
jpayne@68 16088 */
jpayne@68 16089
jpayne@68 16090 /* function exit code */
jpayne@68 16091 __pyx_L1_error:;
jpayne@68 16092 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 16093 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 16094 __Pyx_XDECREF(__pyx_t_5);
jpayne@68 16095 __Pyx_XDECREF(__pyx_t_6);
jpayne@68 16096 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.tell", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 16097 __pyx_r = NULL;
jpayne@68 16098 __pyx_L0:;
jpayne@68 16099 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 16100 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 16101 __Pyx_RefNannyFinishContext();
jpayne@68 16102 return __pyx_r;
jpayne@68 16103 }
jpayne@68 16104
jpayne@68 16105 /* "pysam/libchtslib.pyx":525
jpayne@68 16106 * return ret
jpayne@68 16107 *
jpayne@68 16108 * cdef htsFile *_open_htsfile(self) except? NULL: # <<<<<<<<<<<<<<
jpayne@68 16109 * cdef char *cfilename
jpayne@68 16110 * cdef char *cmode = self.mode
jpayne@68 16111 */
jpayne@68 16112
jpayne@68 16113 static htsFile *__pyx_f_5pysam_10libchtslib_7HTSFile__open_htsfile(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 16114 char *__pyx_v_cfilename;
jpayne@68 16115 char *__pyx_v_cmode;
jpayne@68 16116 int __pyx_v_fd;
jpayne@68 16117 int __pyx_v_dup_fd;
jpayne@68 16118 int __pyx_v_threads;
jpayne@68 16119 htsFile *__pyx_v_htsfile;
jpayne@68 16120 PyObject *__pyx_v_smode = NULL;
jpayne@68 16121 hFILE *__pyx_v_hfile;
jpayne@68 16122 PyObject *__pyx_v_filename = NULL;
jpayne@68 16123 htsFile *__pyx_r;
jpayne@68 16124 __Pyx_TraceDeclarations
jpayne@68 16125 __Pyx_RefNannyDeclarations
jpayne@68 16126 char *__pyx_t_1;
jpayne@68 16127 PyObject *__pyx_t_2 = NULL;
jpayne@68 16128 int __pyx_t_3;
jpayne@68 16129 int __pyx_t_4;
jpayne@68 16130 PyObject *__pyx_t_5 = NULL;
jpayne@68 16131 PyObject *__pyx_t_6 = NULL;
jpayne@68 16132 unsigned int __pyx_t_7;
jpayne@68 16133 PyObject *__pyx_t_8 = NULL;
jpayne@68 16134 PyObject *__pyx_t_9 = NULL;
jpayne@68 16135 PyObject *__pyx_t_10 = NULL;
jpayne@68 16136 PyObject *__pyx_t_11 = NULL;
jpayne@68 16137 PyObject *__pyx_t_12 = NULL;
jpayne@68 16138 PyObject *__pyx_t_13 = NULL;
jpayne@68 16139 PyObject *__pyx_t_14 = NULL;
jpayne@68 16140 int __pyx_lineno = 0;
jpayne@68 16141 const char *__pyx_filename = NULL;
jpayne@68 16142 int __pyx_clineno = 0;
jpayne@68 16143 __Pyx_RefNannySetupContext("_open_htsfile", 1);
jpayne@68 16144 __Pyx_TraceCall("_open_htsfile", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error));
jpayne@68 16145
jpayne@68 16146 /* "pysam/libchtslib.pyx":527
jpayne@68 16147 * cdef htsFile *_open_htsfile(self) except? NULL:
jpayne@68 16148 * cdef char *cfilename
jpayne@68 16149 * cdef char *cmode = self.mode # <<<<<<<<<<<<<<
jpayne@68 16150 * cdef int fd, dup_fd, threads
jpayne@68 16151 *
jpayne@68 16152 */
jpayne@68 16153 __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_self->mode); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 527, __pyx_L1_error)
jpayne@68 16154 __pyx_v_cmode = __pyx_t_1;
jpayne@68 16155
jpayne@68 16156 /* "pysam/libchtslib.pyx":530
jpayne@68 16157 * cdef int fd, dup_fd, threads
jpayne@68 16158 *
jpayne@68 16159 * threads = self.threads - 1 # <<<<<<<<<<<<<<
jpayne@68 16160 * if isinstance(self.filename, bytes):
jpayne@68 16161 * cfilename = self.filename
jpayne@68 16162 */
jpayne@68 16163 __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_self->threads, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
jpayne@68 16164 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 16165 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
jpayne@68 16166 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 16167 __pyx_v_threads = __pyx_t_3;
jpayne@68 16168
jpayne@68 16169 /* "pysam/libchtslib.pyx":531
jpayne@68 16170 *
jpayne@68 16171 * threads = self.threads - 1
jpayne@68 16172 * if isinstance(self.filename, bytes): # <<<<<<<<<<<<<<
jpayne@68 16173 * cfilename = self.filename
jpayne@68 16174 * with nogil:
jpayne@68 16175 */
jpayne@68 16176 __pyx_t_2 = __pyx_v_self->filename;
jpayne@68 16177 __Pyx_INCREF(__pyx_t_2);
jpayne@68 16178 __pyx_t_4 = PyBytes_Check(__pyx_t_2);
jpayne@68 16179 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 16180 if (__pyx_t_4) {
jpayne@68 16181
jpayne@68 16182 /* "pysam/libchtslib.pyx":532
jpayne@68 16183 * threads = self.threads - 1
jpayne@68 16184 * if isinstance(self.filename, bytes):
jpayne@68 16185 * cfilename = self.filename # <<<<<<<<<<<<<<
jpayne@68 16186 * with nogil:
jpayne@68 16187 * htsfile = hts_open(cfilename, cmode)
jpayne@68 16188 */
jpayne@68 16189 __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_self->filename); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error)
jpayne@68 16190 __pyx_v_cfilename = __pyx_t_1;
jpayne@68 16191
jpayne@68 16192 /* "pysam/libchtslib.pyx":533
jpayne@68 16193 * if isinstance(self.filename, bytes):
jpayne@68 16194 * cfilename = self.filename
jpayne@68 16195 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 16196 * htsfile = hts_open(cfilename, cmode)
jpayne@68 16197 * if htsfile != NULL:
jpayne@68 16198 */
jpayne@68 16199 {
jpayne@68 16200 #ifdef WITH_THREAD
jpayne@68 16201 PyThreadState *_save;
jpayne@68 16202 _save = NULL;
jpayne@68 16203 Py_UNBLOCK_THREADS
jpayne@68 16204 __Pyx_FastGIL_Remember();
jpayne@68 16205 #endif
jpayne@68 16206 /*try:*/ {
jpayne@68 16207
jpayne@68 16208 /* "pysam/libchtslib.pyx":534
jpayne@68 16209 * cfilename = self.filename
jpayne@68 16210 * with nogil:
jpayne@68 16211 * htsfile = hts_open(cfilename, cmode) # <<<<<<<<<<<<<<
jpayne@68 16212 * if htsfile != NULL:
jpayne@68 16213 * hts_set_threads(htsfile, threads)
jpayne@68 16214 */
jpayne@68 16215 __pyx_v_htsfile = hts_open(__pyx_v_cfilename, __pyx_v_cmode);
jpayne@68 16216
jpayne@68 16217 /* "pysam/libchtslib.pyx":535
jpayne@68 16218 * with nogil:
jpayne@68 16219 * htsfile = hts_open(cfilename, cmode)
jpayne@68 16220 * if htsfile != NULL: # <<<<<<<<<<<<<<
jpayne@68 16221 * hts_set_threads(htsfile, threads)
jpayne@68 16222 * return htsfile
jpayne@68 16223 */
jpayne@68 16224 __pyx_t_4 = (__pyx_v_htsfile != NULL);
jpayne@68 16225 if (__pyx_t_4) {
jpayne@68 16226
jpayne@68 16227 /* "pysam/libchtslib.pyx":536
jpayne@68 16228 * htsfile = hts_open(cfilename, cmode)
jpayne@68 16229 * if htsfile != NULL:
jpayne@68 16230 * hts_set_threads(htsfile, threads) # <<<<<<<<<<<<<<
jpayne@68 16231 * return htsfile
jpayne@68 16232 * else:
jpayne@68 16233 */
jpayne@68 16234 (void)(hts_set_threads(__pyx_v_htsfile, __pyx_v_threads));
jpayne@68 16235
jpayne@68 16236 /* "pysam/libchtslib.pyx":535
jpayne@68 16237 * with nogil:
jpayne@68 16238 * htsfile = hts_open(cfilename, cmode)
jpayne@68 16239 * if htsfile != NULL: # <<<<<<<<<<<<<<
jpayne@68 16240 * hts_set_threads(htsfile, threads)
jpayne@68 16241 * return htsfile
jpayne@68 16242 */
jpayne@68 16243 }
jpayne@68 16244
jpayne@68 16245 /* "pysam/libchtslib.pyx":537
jpayne@68 16246 * if htsfile != NULL:
jpayne@68 16247 * hts_set_threads(htsfile, threads)
jpayne@68 16248 * return htsfile # <<<<<<<<<<<<<<
jpayne@68 16249 * else:
jpayne@68 16250 * if isinstance(self.filename, int):
jpayne@68 16251 */
jpayne@68 16252 __pyx_r = __pyx_v_htsfile;
jpayne@68 16253 goto __pyx_L4_return;
jpayne@68 16254 }
jpayne@68 16255
jpayne@68 16256 /* "pysam/libchtslib.pyx":533
jpayne@68 16257 * if isinstance(self.filename, bytes):
jpayne@68 16258 * cfilename = self.filename
jpayne@68 16259 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 16260 * htsfile = hts_open(cfilename, cmode)
jpayne@68 16261 * if htsfile != NULL:
jpayne@68 16262 */
jpayne@68 16263 /*finally:*/ {
jpayne@68 16264 __pyx_L4_return: {
jpayne@68 16265 #ifdef WITH_THREAD
jpayne@68 16266 __Pyx_FastGIL_Forget();
jpayne@68 16267 Py_BLOCK_THREADS
jpayne@68 16268 #endif
jpayne@68 16269 goto __pyx_L0;
jpayne@68 16270 }
jpayne@68 16271 }
jpayne@68 16272 }
jpayne@68 16273
jpayne@68 16274 /* "pysam/libchtslib.pyx":531
jpayne@68 16275 *
jpayne@68 16276 * threads = self.threads - 1
jpayne@68 16277 * if isinstance(self.filename, bytes): # <<<<<<<<<<<<<<
jpayne@68 16278 * cfilename = self.filename
jpayne@68 16279 * with nogil:
jpayne@68 16280 */
jpayne@68 16281 }
jpayne@68 16282
jpayne@68 16283 /* "pysam/libchtslib.pyx":539
jpayne@68 16284 * return htsfile
jpayne@68 16285 * else:
jpayne@68 16286 * if isinstance(self.filename, int): # <<<<<<<<<<<<<<
jpayne@68 16287 * fd = self.filename
jpayne@68 16288 * else:
jpayne@68 16289 */
jpayne@68 16290 /*else*/ {
jpayne@68 16291 __pyx_t_2 = __pyx_v_self->filename;
jpayne@68 16292 __Pyx_INCREF(__pyx_t_2);
jpayne@68 16293 __pyx_t_4 = PyInt_Check(__pyx_t_2);
jpayne@68 16294 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 16295 if (__pyx_t_4) {
jpayne@68 16296
jpayne@68 16297 /* "pysam/libchtslib.pyx":540
jpayne@68 16298 * else:
jpayne@68 16299 * if isinstance(self.filename, int):
jpayne@68 16300 * fd = self.filename # <<<<<<<<<<<<<<
jpayne@68 16301 * else:
jpayne@68 16302 * fd = self.filename.fileno()
jpayne@68 16303 */
jpayne@68 16304 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_self->filename); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L1_error)
jpayne@68 16305 __pyx_v_fd = __pyx_t_3;
jpayne@68 16306
jpayne@68 16307 /* "pysam/libchtslib.pyx":539
jpayne@68 16308 * return htsfile
jpayne@68 16309 * else:
jpayne@68 16310 * if isinstance(self.filename, int): # <<<<<<<<<<<<<<
jpayne@68 16311 * fd = self.filename
jpayne@68 16312 * else:
jpayne@68 16313 */
jpayne@68 16314 goto __pyx_L8;
jpayne@68 16315 }
jpayne@68 16316
jpayne@68 16317 /* "pysam/libchtslib.pyx":542
jpayne@68 16318 * fd = self.filename
jpayne@68 16319 * else:
jpayne@68 16320 * fd = self.filename.fileno() # <<<<<<<<<<<<<<
jpayne@68 16321 *
jpayne@68 16322 * if self.duplicate_filehandle:
jpayne@68 16323 */
jpayne@68 16324 /*else*/ {
jpayne@68 16325 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->filename, __pyx_n_s_fileno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
jpayne@68 16326 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16327 __pyx_t_6 = NULL;
jpayne@68 16328 __pyx_t_7 = 0;
jpayne@68 16329 #if CYTHON_UNPACK_METHODS
jpayne@68 16330 if (likely(PyMethod_Check(__pyx_t_5))) {
jpayne@68 16331 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
jpayne@68 16332 if (likely(__pyx_t_6)) {
jpayne@68 16333 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
jpayne@68 16334 __Pyx_INCREF(__pyx_t_6);
jpayne@68 16335 __Pyx_INCREF(function);
jpayne@68 16336 __Pyx_DECREF_SET(__pyx_t_5, function);
jpayne@68 16337 __pyx_t_7 = 1;
jpayne@68 16338 }
jpayne@68 16339 }
jpayne@68 16340 #endif
jpayne@68 16341 {
jpayne@68 16342 PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
jpayne@68 16343 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
jpayne@68 16344 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 16345 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
jpayne@68 16346 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 16347 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 16348 }
jpayne@68 16349 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error)
jpayne@68 16350 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 16351 __pyx_v_fd = __pyx_t_3;
jpayne@68 16352 }
jpayne@68 16353 __pyx_L8:;
jpayne@68 16354
jpayne@68 16355 /* "pysam/libchtslib.pyx":544
jpayne@68 16356 * fd = self.filename.fileno()
jpayne@68 16357 *
jpayne@68 16358 * if self.duplicate_filehandle: # <<<<<<<<<<<<<<
jpayne@68 16359 * dup_fd = dup(fd)
jpayne@68 16360 * else:
jpayne@68 16361 */
jpayne@68 16362 if (__pyx_v_self->duplicate_filehandle) {
jpayne@68 16363
jpayne@68 16364 /* "pysam/libchtslib.pyx":545
jpayne@68 16365 *
jpayne@68 16366 * if self.duplicate_filehandle:
jpayne@68 16367 * dup_fd = dup(fd) # <<<<<<<<<<<<<<
jpayne@68 16368 * else:
jpayne@68 16369 * dup_fd = fd
jpayne@68 16370 */
jpayne@68 16371 __pyx_v_dup_fd = dup(__pyx_v_fd);
jpayne@68 16372
jpayne@68 16373 /* "pysam/libchtslib.pyx":544
jpayne@68 16374 * fd = self.filename.fileno()
jpayne@68 16375 *
jpayne@68 16376 * if self.duplicate_filehandle: # <<<<<<<<<<<<<<
jpayne@68 16377 * dup_fd = dup(fd)
jpayne@68 16378 * else:
jpayne@68 16379 */
jpayne@68 16380 goto __pyx_L9;
jpayne@68 16381 }
jpayne@68 16382
jpayne@68 16383 /* "pysam/libchtslib.pyx":547
jpayne@68 16384 * dup_fd = dup(fd)
jpayne@68 16385 * else:
jpayne@68 16386 * dup_fd = fd # <<<<<<<<<<<<<<
jpayne@68 16387 *
jpayne@68 16388 * # Replicate mode normalization done in hts_open_format
jpayne@68 16389 */
jpayne@68 16390 /*else*/ {
jpayne@68 16391 __pyx_v_dup_fd = __pyx_v_fd;
jpayne@68 16392 }
jpayne@68 16393 __pyx_L9:;
jpayne@68 16394
jpayne@68 16395 /* "pysam/libchtslib.pyx":550
jpayne@68 16396 *
jpayne@68 16397 * # Replicate mode normalization done in hts_open_format
jpayne@68 16398 * smode = self.mode.replace(b'b', b'').replace(b'c', b'') # <<<<<<<<<<<<<<
jpayne@68 16399 * if b'b' in self.mode:
jpayne@68 16400 * smode += b'b'
jpayne@68 16401 */
jpayne@68 16402 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mode, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error)
jpayne@68 16403 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 16404 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error)
jpayne@68 16405 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16406 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 16407 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error)
jpayne@68 16408 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 16409 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 16410 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error)
jpayne@68 16411 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16412 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 16413 __pyx_v_smode = __pyx_t_5;
jpayne@68 16414 __pyx_t_5 = 0;
jpayne@68 16415
jpayne@68 16416 /* "pysam/libchtslib.pyx":551
jpayne@68 16417 * # Replicate mode normalization done in hts_open_format
jpayne@68 16418 * smode = self.mode.replace(b'b', b'').replace(b'c', b'')
jpayne@68 16419 * if b'b' in self.mode: # <<<<<<<<<<<<<<
jpayne@68 16420 * smode += b'b'
jpayne@68 16421 * elif b'c' in self.mode:
jpayne@68 16422 */
jpayne@68 16423 __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_b_b, __pyx_v_self->mode, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 551, __pyx_L1_error)
jpayne@68 16424 if (__pyx_t_4) {
jpayne@68 16425
jpayne@68 16426 /* "pysam/libchtslib.pyx":552
jpayne@68 16427 * smode = self.mode.replace(b'b', b'').replace(b'c', b'')
jpayne@68 16428 * if b'b' in self.mode:
jpayne@68 16429 * smode += b'b' # <<<<<<<<<<<<<<
jpayne@68 16430 * elif b'c' in self.mode:
jpayne@68 16431 * smode += b'c'
jpayne@68 16432 */
jpayne@68 16433 __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_smode, __pyx_n_b_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L1_error)
jpayne@68 16434 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16435 __Pyx_DECREF_SET(__pyx_v_smode, __pyx_t_5);
jpayne@68 16436 __pyx_t_5 = 0;
jpayne@68 16437
jpayne@68 16438 /* "pysam/libchtslib.pyx":551
jpayne@68 16439 * # Replicate mode normalization done in hts_open_format
jpayne@68 16440 * smode = self.mode.replace(b'b', b'').replace(b'c', b'')
jpayne@68 16441 * if b'b' in self.mode: # <<<<<<<<<<<<<<
jpayne@68 16442 * smode += b'b'
jpayne@68 16443 * elif b'c' in self.mode:
jpayne@68 16444 */
jpayne@68 16445 goto __pyx_L10;
jpayne@68 16446 }
jpayne@68 16447
jpayne@68 16448 /* "pysam/libchtslib.pyx":553
jpayne@68 16449 * if b'b' in self.mode:
jpayne@68 16450 * smode += b'b'
jpayne@68 16451 * elif b'c' in self.mode: # <<<<<<<<<<<<<<
jpayne@68 16452 * smode += b'c'
jpayne@68 16453 * cmode = smode
jpayne@68 16454 */
jpayne@68 16455 __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_b_c, __pyx_v_self->mode, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 553, __pyx_L1_error)
jpayne@68 16456 if (__pyx_t_4) {
jpayne@68 16457
jpayne@68 16458 /* "pysam/libchtslib.pyx":554
jpayne@68 16459 * smode += b'b'
jpayne@68 16460 * elif b'c' in self.mode:
jpayne@68 16461 * smode += b'c' # <<<<<<<<<<<<<<
jpayne@68 16462 * cmode = smode
jpayne@68 16463 *
jpayne@68 16464 */
jpayne@68 16465 __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_smode, __pyx_n_b_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
jpayne@68 16466 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16467 __Pyx_DECREF_SET(__pyx_v_smode, __pyx_t_5);
jpayne@68 16468 __pyx_t_5 = 0;
jpayne@68 16469
jpayne@68 16470 /* "pysam/libchtslib.pyx":553
jpayne@68 16471 * if b'b' in self.mode:
jpayne@68 16472 * smode += b'b'
jpayne@68 16473 * elif b'c' in self.mode: # <<<<<<<<<<<<<<
jpayne@68 16474 * smode += b'c'
jpayne@68 16475 * cmode = smode
jpayne@68 16476 */
jpayne@68 16477 }
jpayne@68 16478 __pyx_L10:;
jpayne@68 16479
jpayne@68 16480 /* "pysam/libchtslib.pyx":555
jpayne@68 16481 * elif b'c' in self.mode:
jpayne@68 16482 * smode += b'c'
jpayne@68 16483 * cmode = smode # <<<<<<<<<<<<<<
jpayne@68 16484 *
jpayne@68 16485 * hfile = hdopen(dup_fd, cmode)
jpayne@68 16486 */
jpayne@68 16487 __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_smode); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L1_error)
jpayne@68 16488 __pyx_v_cmode = __pyx_t_1;
jpayne@68 16489
jpayne@68 16490 /* "pysam/libchtslib.pyx":557
jpayne@68 16491 * cmode = smode
jpayne@68 16492 *
jpayne@68 16493 * hfile = hdopen(dup_fd, cmode) # <<<<<<<<<<<<<<
jpayne@68 16494 * if hfile == NULL:
jpayne@68 16495 * raise IOError('Cannot create hfile')
jpayne@68 16496 */
jpayne@68 16497 __pyx_v_hfile = hdopen(__pyx_v_dup_fd, __pyx_v_cmode);
jpayne@68 16498
jpayne@68 16499 /* "pysam/libchtslib.pyx":558
jpayne@68 16500 *
jpayne@68 16501 * hfile = hdopen(dup_fd, cmode)
jpayne@68 16502 * if hfile == NULL: # <<<<<<<<<<<<<<
jpayne@68 16503 * raise IOError('Cannot create hfile')
jpayne@68 16504 *
jpayne@68 16505 */
jpayne@68 16506 __pyx_t_4 = (__pyx_v_hfile == NULL);
jpayne@68 16507 if (unlikely(__pyx_t_4)) {
jpayne@68 16508
jpayne@68 16509 /* "pysam/libchtslib.pyx":559
jpayne@68 16510 * hfile = hdopen(dup_fd, cmode)
jpayne@68 16511 * if hfile == NULL:
jpayne@68 16512 * raise IOError('Cannot create hfile') # <<<<<<<<<<<<<<
jpayne@68 16513 *
jpayne@68 16514 * try:
jpayne@68 16515 */
jpayne@68 16516 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
jpayne@68 16517 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16518 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
jpayne@68 16519 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 16520 __PYX_ERR(0, 559, __pyx_L1_error)
jpayne@68 16521
jpayne@68 16522 /* "pysam/libchtslib.pyx":558
jpayne@68 16523 *
jpayne@68 16524 * hfile = hdopen(dup_fd, cmode)
jpayne@68 16525 * if hfile == NULL: # <<<<<<<<<<<<<<
jpayne@68 16526 * raise IOError('Cannot create hfile')
jpayne@68 16527 *
jpayne@68 16528 */
jpayne@68 16529 }
jpayne@68 16530
jpayne@68 16531 /* "pysam/libchtslib.pyx":561
jpayne@68 16532 * raise IOError('Cannot create hfile')
jpayne@68 16533 *
jpayne@68 16534 * try: # <<<<<<<<<<<<<<
jpayne@68 16535 * # filename.name can be an int
jpayne@68 16536 * filename = str(self.filename.name)
jpayne@68 16537 */
jpayne@68 16538 {
jpayne@68 16539 __Pyx_PyThreadState_declare
jpayne@68 16540 __Pyx_PyThreadState_assign
jpayne@68 16541 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
jpayne@68 16542 __Pyx_XGOTREF(__pyx_t_8);
jpayne@68 16543 __Pyx_XGOTREF(__pyx_t_9);
jpayne@68 16544 __Pyx_XGOTREF(__pyx_t_10);
jpayne@68 16545 /*try:*/ {
jpayne@68 16546
jpayne@68 16547 /* "pysam/libchtslib.pyx":563
jpayne@68 16548 * try:
jpayne@68 16549 * # filename.name can be an int
jpayne@68 16550 * filename = str(self.filename.name) # <<<<<<<<<<<<<<
jpayne@68 16551 * except AttributeError:
jpayne@68 16552 * filename = '<fd:{}>'.format(fd)
jpayne@68 16553 */
jpayne@68 16554 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->filename, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L12_error)
jpayne@68 16555 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16556 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L12_error)
jpayne@68 16557 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 16558 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 16559 __pyx_v_filename = __pyx_t_2;
jpayne@68 16560 __pyx_t_2 = 0;
jpayne@68 16561
jpayne@68 16562 /* "pysam/libchtslib.pyx":561
jpayne@68 16563 * raise IOError('Cannot create hfile')
jpayne@68 16564 *
jpayne@68 16565 * try: # <<<<<<<<<<<<<<
jpayne@68 16566 * # filename.name can be an int
jpayne@68 16567 * filename = str(self.filename.name)
jpayne@68 16568 */
jpayne@68 16569 }
jpayne@68 16570 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
jpayne@68 16571 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
jpayne@68 16572 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 16573 goto __pyx_L17_try_end;
jpayne@68 16574 __pyx_L12_error:;
jpayne@68 16575 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 16576 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 16577 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 16578
jpayne@68 16579 /* "pysam/libchtslib.pyx":564
jpayne@68 16580 * # filename.name can be an int
jpayne@68 16581 * filename = str(self.filename.name)
jpayne@68 16582 * except AttributeError: # <<<<<<<<<<<<<<
jpayne@68 16583 * filename = '<fd:{}>'.format(fd)
jpayne@68 16584 *
jpayne@68 16585 */
jpayne@68 16586 __pyx_t_3 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
jpayne@68 16587 if (__pyx_t_3) {
jpayne@68 16588 __Pyx_AddTraceback("pysam.libchtslib.HTSFile._open_htsfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 16589 if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 564, __pyx_L14_except_error)
jpayne@68 16590 __Pyx_XGOTREF(__pyx_t_2);
jpayne@68 16591 __Pyx_XGOTREF(__pyx_t_5);
jpayne@68 16592 __Pyx_XGOTREF(__pyx_t_6);
jpayne@68 16593
jpayne@68 16594 /* "pysam/libchtslib.pyx":565
jpayne@68 16595 * filename = str(self.filename.name)
jpayne@68 16596 * except AttributeError:
jpayne@68 16597 * filename = '<fd:{}>'.format(fd) # <<<<<<<<<<<<<<
jpayne@68 16598 *
jpayne@68 16599 * filename = encode_filename(filename)
jpayne@68 16600 */
jpayne@68 16601 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_fd, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 565, __pyx_L14_except_error)
jpayne@68 16602 __Pyx_GOTREF(__pyx_t_12);
jpayne@68 16603 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 565, __pyx_L14_except_error)
jpayne@68 16604 __Pyx_GOTREF(__pyx_t_13);
jpayne@68 16605 __pyx_t_14 = NULL;
jpayne@68 16606 __pyx_t_7 = 0;
jpayne@68 16607 #if CYTHON_UNPACK_METHODS
jpayne@68 16608 if (likely(PyMethod_Check(__pyx_t_12))) {
jpayne@68 16609 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
jpayne@68 16610 if (likely(__pyx_t_14)) {
jpayne@68 16611 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
jpayne@68 16612 __Pyx_INCREF(__pyx_t_14);
jpayne@68 16613 __Pyx_INCREF(function);
jpayne@68 16614 __Pyx_DECREF_SET(__pyx_t_12, function);
jpayne@68 16615 __pyx_t_7 = 1;
jpayne@68 16616 }
jpayne@68 16617 }
jpayne@68 16618 #endif
jpayne@68 16619 {
jpayne@68 16620 PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13};
jpayne@68 16621 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
jpayne@68 16622 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
jpayne@68 16623 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
jpayne@68 16624 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 565, __pyx_L14_except_error)
jpayne@68 16625 __Pyx_GOTREF(__pyx_t_11);
jpayne@68 16626 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
jpayne@68 16627 }
jpayne@68 16628 __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_11);
jpayne@68 16629 __pyx_t_11 = 0;
jpayne@68 16630 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 16631 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 16632 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 16633 goto __pyx_L13_exception_handled;
jpayne@68 16634 }
jpayne@68 16635 goto __pyx_L14_except_error;
jpayne@68 16636
jpayne@68 16637 /* "pysam/libchtslib.pyx":561
jpayne@68 16638 * raise IOError('Cannot create hfile')
jpayne@68 16639 *
jpayne@68 16640 * try: # <<<<<<<<<<<<<<
jpayne@68 16641 * # filename.name can be an int
jpayne@68 16642 * filename = str(self.filename.name)
jpayne@68 16643 */
jpayne@68 16644 __pyx_L14_except_error:;
jpayne@68 16645 __Pyx_XGIVEREF(__pyx_t_8);
jpayne@68 16646 __Pyx_XGIVEREF(__pyx_t_9);
jpayne@68 16647 __Pyx_XGIVEREF(__pyx_t_10);
jpayne@68 16648 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
jpayne@68 16649 goto __pyx_L1_error;
jpayne@68 16650 __pyx_L13_exception_handled:;
jpayne@68 16651 __Pyx_XGIVEREF(__pyx_t_8);
jpayne@68 16652 __Pyx_XGIVEREF(__pyx_t_9);
jpayne@68 16653 __Pyx_XGIVEREF(__pyx_t_10);
jpayne@68 16654 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
jpayne@68 16655 __pyx_L17_try_end:;
jpayne@68 16656 }
jpayne@68 16657
jpayne@68 16658 /* "pysam/libchtslib.pyx":567
jpayne@68 16659 * filename = '<fd:{}>'.format(fd)
jpayne@68 16660 *
jpayne@68 16661 * filename = encode_filename(filename) # <<<<<<<<<<<<<<
jpayne@68 16662 * cfilename = filename
jpayne@68 16663 * with nogil:
jpayne@68 16664 */
jpayne@68 16665 __pyx_t_6 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
jpayne@68 16666 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 16667 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_6);
jpayne@68 16668 __pyx_t_6 = 0;
jpayne@68 16669
jpayne@68 16670 /* "pysam/libchtslib.pyx":568
jpayne@68 16671 *
jpayne@68 16672 * filename = encode_filename(filename)
jpayne@68 16673 * cfilename = filename # <<<<<<<<<<<<<<
jpayne@68 16674 * with nogil:
jpayne@68 16675 * htsfile = hts_hopen(hfile, cfilename, cmode)
jpayne@68 16676 */
jpayne@68 16677 __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_filename); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L1_error)
jpayne@68 16678 __pyx_v_cfilename = __pyx_t_1;
jpayne@68 16679
jpayne@68 16680 /* "pysam/libchtslib.pyx":569
jpayne@68 16681 * filename = encode_filename(filename)
jpayne@68 16682 * cfilename = filename
jpayne@68 16683 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 16684 * htsfile = hts_hopen(hfile, cfilename, cmode)
jpayne@68 16685 * if htsfile != NULL:
jpayne@68 16686 */
jpayne@68 16687 {
jpayne@68 16688 #ifdef WITH_THREAD
jpayne@68 16689 PyThreadState *_save;
jpayne@68 16690 _save = NULL;
jpayne@68 16691 Py_UNBLOCK_THREADS
jpayne@68 16692 __Pyx_FastGIL_Remember();
jpayne@68 16693 #endif
jpayne@68 16694 /*try:*/ {
jpayne@68 16695
jpayne@68 16696 /* "pysam/libchtslib.pyx":570
jpayne@68 16697 * cfilename = filename
jpayne@68 16698 * with nogil:
jpayne@68 16699 * htsfile = hts_hopen(hfile, cfilename, cmode) # <<<<<<<<<<<<<<
jpayne@68 16700 * if htsfile != NULL:
jpayne@68 16701 * hts_set_threads(htsfile, threads)
jpayne@68 16702 */
jpayne@68 16703 __pyx_v_htsfile = hts_hopen(__pyx_v_hfile, __pyx_v_cfilename, __pyx_v_cmode);
jpayne@68 16704
jpayne@68 16705 /* "pysam/libchtslib.pyx":571
jpayne@68 16706 * with nogil:
jpayne@68 16707 * htsfile = hts_hopen(hfile, cfilename, cmode)
jpayne@68 16708 * if htsfile != NULL: # <<<<<<<<<<<<<<
jpayne@68 16709 * hts_set_threads(htsfile, threads)
jpayne@68 16710 * return htsfile
jpayne@68 16711 */
jpayne@68 16712 __pyx_t_4 = (__pyx_v_htsfile != NULL);
jpayne@68 16713 if (__pyx_t_4) {
jpayne@68 16714
jpayne@68 16715 /* "pysam/libchtslib.pyx":572
jpayne@68 16716 * htsfile = hts_hopen(hfile, cfilename, cmode)
jpayne@68 16717 * if htsfile != NULL:
jpayne@68 16718 * hts_set_threads(htsfile, threads) # <<<<<<<<<<<<<<
jpayne@68 16719 * return htsfile
jpayne@68 16720 *
jpayne@68 16721 */
jpayne@68 16722 (void)(hts_set_threads(__pyx_v_htsfile, __pyx_v_threads));
jpayne@68 16723
jpayne@68 16724 /* "pysam/libchtslib.pyx":571
jpayne@68 16725 * with nogil:
jpayne@68 16726 * htsfile = hts_hopen(hfile, cfilename, cmode)
jpayne@68 16727 * if htsfile != NULL: # <<<<<<<<<<<<<<
jpayne@68 16728 * hts_set_threads(htsfile, threads)
jpayne@68 16729 * return htsfile
jpayne@68 16730 */
jpayne@68 16731 }
jpayne@68 16732
jpayne@68 16733 /* "pysam/libchtslib.pyx":573
jpayne@68 16734 * if htsfile != NULL:
jpayne@68 16735 * hts_set_threads(htsfile, threads)
jpayne@68 16736 * return htsfile # <<<<<<<<<<<<<<
jpayne@68 16737 *
jpayne@68 16738 * def add_hts_options(self, format_options=None):
jpayne@68 16739 */
jpayne@68 16740 __pyx_r = __pyx_v_htsfile;
jpayne@68 16741 goto __pyx_L20_return;
jpayne@68 16742 }
jpayne@68 16743
jpayne@68 16744 /* "pysam/libchtslib.pyx":569
jpayne@68 16745 * filename = encode_filename(filename)
jpayne@68 16746 * cfilename = filename
jpayne@68 16747 * with nogil: # <<<<<<<<<<<<<<
jpayne@68 16748 * htsfile = hts_hopen(hfile, cfilename, cmode)
jpayne@68 16749 * if htsfile != NULL:
jpayne@68 16750 */
jpayne@68 16751 /*finally:*/ {
jpayne@68 16752 __pyx_L20_return: {
jpayne@68 16753 #ifdef WITH_THREAD
jpayne@68 16754 __Pyx_FastGIL_Forget();
jpayne@68 16755 Py_BLOCK_THREADS
jpayne@68 16756 #endif
jpayne@68 16757 goto __pyx_L0;
jpayne@68 16758 }
jpayne@68 16759 }
jpayne@68 16760 }
jpayne@68 16761 }
jpayne@68 16762
jpayne@68 16763 /* "pysam/libchtslib.pyx":525
jpayne@68 16764 * return ret
jpayne@68 16765 *
jpayne@68 16766 * cdef htsFile *_open_htsfile(self) except? NULL: # <<<<<<<<<<<<<<
jpayne@68 16767 * cdef char *cfilename
jpayne@68 16768 * cdef char *cmode = self.mode
jpayne@68 16769 */
jpayne@68 16770
jpayne@68 16771 /* function exit code */
jpayne@68 16772 __pyx_L1_error:;
jpayne@68 16773 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 16774 __Pyx_XDECREF(__pyx_t_5);
jpayne@68 16775 __Pyx_XDECREF(__pyx_t_6);
jpayne@68 16776 __Pyx_XDECREF(__pyx_t_11);
jpayne@68 16777 __Pyx_XDECREF(__pyx_t_12);
jpayne@68 16778 __Pyx_XDECREF(__pyx_t_13);
jpayne@68 16779 __Pyx_XDECREF(__pyx_t_14);
jpayne@68 16780 __Pyx_AddTraceback("pysam.libchtslib.HTSFile._open_htsfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 16781 __pyx_r = NULL;
jpayne@68 16782 __pyx_L0:;
jpayne@68 16783 __Pyx_XDECREF(__pyx_v_smode);
jpayne@68 16784 __Pyx_XDECREF(__pyx_v_filename);
jpayne@68 16785 __Pyx_TraceReturn(Py_None, 0);
jpayne@68 16786 __Pyx_RefNannyFinishContext();
jpayne@68 16787 return __pyx_r;
jpayne@68 16788 }
jpayne@68 16789
jpayne@68 16790 /* "pysam/libchtslib.pyx":575
jpayne@68 16791 * return htsfile
jpayne@68 16792 *
jpayne@68 16793 * def add_hts_options(self, format_options=None): # <<<<<<<<<<<<<<
jpayne@68 16794 * """Given a list of key=value format option strings, add them to an open htsFile
jpayne@68 16795 * """
jpayne@68 16796 */
jpayne@68 16797
jpayne@68 16798 /* Python wrapper */
jpayne@68 16799 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_21add_hts_options(PyObject *__pyx_v_self,
jpayne@68 16800 #if CYTHON_METH_FASTCALL
jpayne@68 16801 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 16802 #else
jpayne@68 16803 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 16804 #endif
jpayne@68 16805 ); /*proto*/
jpayne@68 16806 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_20add_hts_options, "HTSFile.add_hts_options(self, format_options=None)\nGiven a list of key=value format option strings, add them to an open htsFile\n ");
jpayne@68 16807 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_21add_hts_options = {"add_hts_options", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_21add_hts_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_20add_hts_options};
jpayne@68 16808 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_21add_hts_options(PyObject *__pyx_v_self,
jpayne@68 16809 #if CYTHON_METH_FASTCALL
jpayne@68 16810 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 16811 #else
jpayne@68 16812 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 16813 #endif
jpayne@68 16814 ) {
jpayne@68 16815 PyObject *__pyx_v_format_options = 0;
jpayne@68 16816 #if !CYTHON_METH_FASTCALL
jpayne@68 16817 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 16818 #endif
jpayne@68 16819 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 16820 PyObject* values[1] = {0};
jpayne@68 16821 int __pyx_lineno = 0;
jpayne@68 16822 const char *__pyx_filename = NULL;
jpayne@68 16823 int __pyx_clineno = 0;
jpayne@68 16824 PyObject *__pyx_r = 0;
jpayne@68 16825 __Pyx_RefNannyDeclarations
jpayne@68 16826 __Pyx_RefNannySetupContext("add_hts_options (wrapper)", 0);
jpayne@68 16827 #if !CYTHON_METH_FASTCALL
jpayne@68 16828 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 16829 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 16830 #else
jpayne@68 16831 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 16832 #endif
jpayne@68 16833 #endif
jpayne@68 16834 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 16835 {
jpayne@68 16836 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format_options,0};
jpayne@68 16837 values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 16838 if (__pyx_kwds) {
jpayne@68 16839 Py_ssize_t kw_args;
jpayne@68 16840 switch (__pyx_nargs) {
jpayne@68 16841 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 16842 CYTHON_FALLTHROUGH;
jpayne@68 16843 case 0: break;
jpayne@68 16844 default: goto __pyx_L5_argtuple_error;
jpayne@68 16845 }
jpayne@68 16846 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 16847 switch (__pyx_nargs) {
jpayne@68 16848 case 0:
jpayne@68 16849 if (kw_args > 0) {
jpayne@68 16850 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format_options);
jpayne@68 16851 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 16852 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L3_error)
jpayne@68 16853 }
jpayne@68 16854 }
jpayne@68 16855 if (unlikely(kw_args > 0)) {
jpayne@68 16856 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 16857 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_hts_options") < 0)) __PYX_ERR(0, 575, __pyx_L3_error)
jpayne@68 16858 }
jpayne@68 16859 } else {
jpayne@68 16860 switch (__pyx_nargs) {
jpayne@68 16861 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 16862 CYTHON_FALLTHROUGH;
jpayne@68 16863 case 0: break;
jpayne@68 16864 default: goto __pyx_L5_argtuple_error;
jpayne@68 16865 }
jpayne@68 16866 }
jpayne@68 16867 __pyx_v_format_options = values[0];
jpayne@68 16868 }
jpayne@68 16869 goto __pyx_L6_skip;
jpayne@68 16870 __pyx_L5_argtuple_error:;
jpayne@68 16871 __Pyx_RaiseArgtupleInvalid("add_hts_options", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 575, __pyx_L3_error)
jpayne@68 16872 __pyx_L6_skip:;
jpayne@68 16873 goto __pyx_L4_argument_unpacking_done;
jpayne@68 16874 __pyx_L3_error:;
jpayne@68 16875 {
jpayne@68 16876 Py_ssize_t __pyx_temp;
jpayne@68 16877 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 16878 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 16879 }
jpayne@68 16880 }
jpayne@68 16881 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.add_hts_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 16882 __Pyx_RefNannyFinishContext();
jpayne@68 16883 return NULL;
jpayne@68 16884 __pyx_L4_argument_unpacking_done:;
jpayne@68 16885 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_20add_hts_options(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_format_options);
jpayne@68 16886
jpayne@68 16887 /* function exit code */
jpayne@68 16888 {
jpayne@68 16889 Py_ssize_t __pyx_temp;
jpayne@68 16890 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 16891 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 16892 }
jpayne@68 16893 }
jpayne@68 16894 __Pyx_RefNannyFinishContext();
jpayne@68 16895 return __pyx_r;
jpayne@68 16896 }
jpayne@68 16897
jpayne@68 16898 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_20add_hts_options(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, PyObject *__pyx_v_format_options) {
jpayne@68 16899 int __pyx_v_rval;
jpayne@68 16900 hts_opt *__pyx_v_opts;
jpayne@68 16901 PyObject *__pyx_v_format_option = NULL;
jpayne@68 16902 PyObject *__pyx_r = NULL;
jpayne@68 16903 __Pyx_TraceDeclarations
jpayne@68 16904 __Pyx_RefNannyDeclarations
jpayne@68 16905 int __pyx_t_1;
jpayne@68 16906 PyObject *__pyx_t_2 = NULL;
jpayne@68 16907 Py_ssize_t __pyx_t_3;
jpayne@68 16908 PyObject *(*__pyx_t_4)(PyObject *);
jpayne@68 16909 PyObject *__pyx_t_5 = NULL;
jpayne@68 16910 char const *__pyx_t_6;
jpayne@68 16911 PyObject *__pyx_t_7 = NULL;
jpayne@68 16912 PyObject *__pyx_t_8 = NULL;
jpayne@68 16913 unsigned int __pyx_t_9;
jpayne@68 16914 int __pyx_lineno = 0;
jpayne@68 16915 const char *__pyx_filename = NULL;
jpayne@68 16916 int __pyx_clineno = 0;
jpayne@68 16917 __Pyx_TraceFrameInit(__pyx_codeobj__50)
jpayne@68 16918 __Pyx_RefNannySetupContext("add_hts_options", 1);
jpayne@68 16919 __Pyx_TraceCall("add_hts_options", __pyx_f[0], 575, 0, __PYX_ERR(0, 575, __pyx_L1_error));
jpayne@68 16920
jpayne@68 16921 /* "pysam/libchtslib.pyx":579
jpayne@68 16922 * """
jpayne@68 16923 * cdef int rval
jpayne@68 16924 * cdef hts_opt *opts = NULL # <<<<<<<<<<<<<<
jpayne@68 16925 *
jpayne@68 16926 * if format_options:
jpayne@68 16927 */
jpayne@68 16928 __pyx_v_opts = NULL;
jpayne@68 16929
jpayne@68 16930 /* "pysam/libchtslib.pyx":581
jpayne@68 16931 * cdef hts_opt *opts = NULL
jpayne@68 16932 *
jpayne@68 16933 * if format_options: # <<<<<<<<<<<<<<
jpayne@68 16934 * for format_option in format_options:
jpayne@68 16935 * rval = hts_opt_add(&opts, format_option)
jpayne@68 16936 */
jpayne@68 16937 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_format_options); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 581, __pyx_L1_error)
jpayne@68 16938 if (__pyx_t_1) {
jpayne@68 16939
jpayne@68 16940 /* "pysam/libchtslib.pyx":582
jpayne@68 16941 *
jpayne@68 16942 * if format_options:
jpayne@68 16943 * for format_option in format_options: # <<<<<<<<<<<<<<
jpayne@68 16944 * rval = hts_opt_add(&opts, format_option)
jpayne@68 16945 * if rval != 0:
jpayne@68 16946 */
jpayne@68 16947 if (likely(PyList_CheckExact(__pyx_v_format_options)) || PyTuple_CheckExact(__pyx_v_format_options)) {
jpayne@68 16948 __pyx_t_2 = __pyx_v_format_options; __Pyx_INCREF(__pyx_t_2);
jpayne@68 16949 __pyx_t_3 = 0;
jpayne@68 16950 __pyx_t_4 = NULL;
jpayne@68 16951 } else {
jpayne@68 16952 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_format_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16953 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 16954 __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16955 }
jpayne@68 16956 for (;;) {
jpayne@68 16957 if (likely(!__pyx_t_4)) {
jpayne@68 16958 if (likely(PyList_CheckExact(__pyx_t_2))) {
jpayne@68 16959 {
jpayne@68 16960 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
jpayne@68 16961 #if !CYTHON_ASSUME_SAFE_MACROS
jpayne@68 16962 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16963 #endif
jpayne@68 16964 if (__pyx_t_3 >= __pyx_temp) break;
jpayne@68 16965 }
jpayne@68 16966 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 16967 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16968 #else
jpayne@68 16969 __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16970 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16971 #endif
jpayne@68 16972 } else {
jpayne@68 16973 {
jpayne@68 16974 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
jpayne@68 16975 #if !CYTHON_ASSUME_SAFE_MACROS
jpayne@68 16976 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16977 #endif
jpayne@68 16978 if (__pyx_t_3 >= __pyx_temp) break;
jpayne@68 16979 }
jpayne@68 16980 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 16981 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16982 #else
jpayne@68 16983 __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16984 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16985 #endif
jpayne@68 16986 }
jpayne@68 16987 } else {
jpayne@68 16988 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
jpayne@68 16989 if (unlikely(!__pyx_t_5)) {
jpayne@68 16990 PyObject* exc_type = PyErr_Occurred();
jpayne@68 16991 if (exc_type) {
jpayne@68 16992 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
jpayne@68 16993 else __PYX_ERR(0, 582, __pyx_L1_error)
jpayne@68 16994 }
jpayne@68 16995 break;
jpayne@68 16996 }
jpayne@68 16997 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 16998 }
jpayne@68 16999 __Pyx_XDECREF_SET(__pyx_v_format_option, __pyx_t_5);
jpayne@68 17000 __pyx_t_5 = 0;
jpayne@68 17001
jpayne@68 17002 /* "pysam/libchtslib.pyx":583
jpayne@68 17003 * if format_options:
jpayne@68 17004 * for format_option in format_options:
jpayne@68 17005 * rval = hts_opt_add(&opts, format_option) # <<<<<<<<<<<<<<
jpayne@68 17006 * if rval != 0:
jpayne@68 17007 * if opts != NULL:
jpayne@68 17008 */
jpayne@68 17009 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_format_option); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L1_error)
jpayne@68 17010 __pyx_v_rval = hts_opt_add((&__pyx_v_opts), __pyx_t_6);
jpayne@68 17011
jpayne@68 17012 /* "pysam/libchtslib.pyx":584
jpayne@68 17013 * for format_option in format_options:
jpayne@68 17014 * rval = hts_opt_add(&opts, format_option)
jpayne@68 17015 * if rval != 0: # <<<<<<<<<<<<<<
jpayne@68 17016 * if opts != NULL:
jpayne@68 17017 * hts_opt_free(opts)
jpayne@68 17018 */
jpayne@68 17019 __pyx_t_1 = (__pyx_v_rval != 0);
jpayne@68 17020 if (__pyx_t_1) {
jpayne@68 17021
jpayne@68 17022 /* "pysam/libchtslib.pyx":585
jpayne@68 17023 * rval = hts_opt_add(&opts, format_option)
jpayne@68 17024 * if rval != 0:
jpayne@68 17025 * if opts != NULL: # <<<<<<<<<<<<<<
jpayne@68 17026 * hts_opt_free(opts)
jpayne@68 17027 * raise RuntimeError('Invalid format option ({}) specified'.format(format_option))
jpayne@68 17028 */
jpayne@68 17029 __pyx_t_1 = (__pyx_v_opts != NULL);
jpayne@68 17030 if (__pyx_t_1) {
jpayne@68 17031
jpayne@68 17032 /* "pysam/libchtslib.pyx":586
jpayne@68 17033 * if rval != 0:
jpayne@68 17034 * if opts != NULL:
jpayne@68 17035 * hts_opt_free(opts) # <<<<<<<<<<<<<<
jpayne@68 17036 * raise RuntimeError('Invalid format option ({}) specified'.format(format_option))
jpayne@68 17037 * if opts != NULL:
jpayne@68 17038 */
jpayne@68 17039 hts_opt_free(__pyx_v_opts);
jpayne@68 17040
jpayne@68 17041 /* "pysam/libchtslib.pyx":585
jpayne@68 17042 * rval = hts_opt_add(&opts, format_option)
jpayne@68 17043 * if rval != 0:
jpayne@68 17044 * if opts != NULL: # <<<<<<<<<<<<<<
jpayne@68 17045 * hts_opt_free(opts)
jpayne@68 17046 * raise RuntimeError('Invalid format option ({}) specified'.format(format_option))
jpayne@68 17047 */
jpayne@68 17048 }
jpayne@68 17049
jpayne@68 17050 /* "pysam/libchtslib.pyx":587
jpayne@68 17051 * if opts != NULL:
jpayne@68 17052 * hts_opt_free(opts)
jpayne@68 17053 * raise RuntimeError('Invalid format option ({}) specified'.format(format_option)) # <<<<<<<<<<<<<<
jpayne@68 17054 * if opts != NULL:
jpayne@68 17055 * rval = hts_opt_apply(self.htsfile, opts)
jpayne@68 17056 */
jpayne@68 17057 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_format_option_specified, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 587, __pyx_L1_error)
jpayne@68 17058 __Pyx_GOTREF(__pyx_t_7);
jpayne@68 17059 __pyx_t_8 = NULL;
jpayne@68 17060 __pyx_t_9 = 0;
jpayne@68 17061 #if CYTHON_UNPACK_METHODS
jpayne@68 17062 if (likely(PyMethod_Check(__pyx_t_7))) {
jpayne@68 17063 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
jpayne@68 17064 if (likely(__pyx_t_8)) {
jpayne@68 17065 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
jpayne@68 17066 __Pyx_INCREF(__pyx_t_8);
jpayne@68 17067 __Pyx_INCREF(function);
jpayne@68 17068 __Pyx_DECREF_SET(__pyx_t_7, function);
jpayne@68 17069 __pyx_t_9 = 1;
jpayne@68 17070 }
jpayne@68 17071 }
jpayne@68 17072 #endif
jpayne@68 17073 {
jpayne@68 17074 PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_format_option};
jpayne@68 17075 __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
jpayne@68 17076 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
jpayne@68 17077 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L1_error)
jpayne@68 17078 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 17079 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
jpayne@68 17080 }
jpayne@68 17081 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 587, __pyx_L1_error)
jpayne@68 17082 __Pyx_GOTREF(__pyx_t_7);
jpayne@68 17083 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 17084 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
jpayne@68 17085 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
jpayne@68 17086 __PYX_ERR(0, 587, __pyx_L1_error)
jpayne@68 17087
jpayne@68 17088 /* "pysam/libchtslib.pyx":584
jpayne@68 17089 * for format_option in format_options:
jpayne@68 17090 * rval = hts_opt_add(&opts, format_option)
jpayne@68 17091 * if rval != 0: # <<<<<<<<<<<<<<
jpayne@68 17092 * if opts != NULL:
jpayne@68 17093 * hts_opt_free(opts)
jpayne@68 17094 */
jpayne@68 17095 }
jpayne@68 17096
jpayne@68 17097 /* "pysam/libchtslib.pyx":582
jpayne@68 17098 *
jpayne@68 17099 * if format_options:
jpayne@68 17100 * for format_option in format_options: # <<<<<<<<<<<<<<
jpayne@68 17101 * rval = hts_opt_add(&opts, format_option)
jpayne@68 17102 * if rval != 0:
jpayne@68 17103 */
jpayne@68 17104 }
jpayne@68 17105 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 17106
jpayne@68 17107 /* "pysam/libchtslib.pyx":588
jpayne@68 17108 * hts_opt_free(opts)
jpayne@68 17109 * raise RuntimeError('Invalid format option ({}) specified'.format(format_option))
jpayne@68 17110 * if opts != NULL: # <<<<<<<<<<<<<<
jpayne@68 17111 * rval = hts_opt_apply(self.htsfile, opts)
jpayne@68 17112 * if rval != 0:
jpayne@68 17113 */
jpayne@68 17114 __pyx_t_1 = (__pyx_v_opts != NULL);
jpayne@68 17115 if (__pyx_t_1) {
jpayne@68 17116
jpayne@68 17117 /* "pysam/libchtslib.pyx":589
jpayne@68 17118 * raise RuntimeError('Invalid format option ({}) specified'.format(format_option))
jpayne@68 17119 * if opts != NULL:
jpayne@68 17120 * rval = hts_opt_apply(self.htsfile, opts) # <<<<<<<<<<<<<<
jpayne@68 17121 * if rval != 0:
jpayne@68 17122 * hts_opt_free(opts)
jpayne@68 17123 */
jpayne@68 17124 __pyx_v_rval = hts_opt_apply(__pyx_v_self->htsfile, __pyx_v_opts);
jpayne@68 17125
jpayne@68 17126 /* "pysam/libchtslib.pyx":590
jpayne@68 17127 * if opts != NULL:
jpayne@68 17128 * rval = hts_opt_apply(self.htsfile, opts)
jpayne@68 17129 * if rval != 0: # <<<<<<<<<<<<<<
jpayne@68 17130 * hts_opt_free(opts)
jpayne@68 17131 * raise RuntimeError('An error occurred while applying the requested format options')
jpayne@68 17132 */
jpayne@68 17133 __pyx_t_1 = (__pyx_v_rval != 0);
jpayne@68 17134 if (unlikely(__pyx_t_1)) {
jpayne@68 17135
jpayne@68 17136 /* "pysam/libchtslib.pyx":591
jpayne@68 17137 * rval = hts_opt_apply(self.htsfile, opts)
jpayne@68 17138 * if rval != 0:
jpayne@68 17139 * hts_opt_free(opts) # <<<<<<<<<<<<<<
jpayne@68 17140 * raise RuntimeError('An error occurred while applying the requested format options')
jpayne@68 17141 * hts_opt_free(opts)
jpayne@68 17142 */
jpayne@68 17143 hts_opt_free(__pyx_v_opts);
jpayne@68 17144
jpayne@68 17145 /* "pysam/libchtslib.pyx":592
jpayne@68 17146 * if rval != 0:
jpayne@68 17147 * hts_opt_free(opts)
jpayne@68 17148 * raise RuntimeError('An error occurred while applying the requested format options') # <<<<<<<<<<<<<<
jpayne@68 17149 * hts_opt_free(opts)
jpayne@68 17150 *
jpayne@68 17151 */
jpayne@68 17152 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error)
jpayne@68 17153 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 17154 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 17155 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 17156 __PYX_ERR(0, 592, __pyx_L1_error)
jpayne@68 17157
jpayne@68 17158 /* "pysam/libchtslib.pyx":590
jpayne@68 17159 * if opts != NULL:
jpayne@68 17160 * rval = hts_opt_apply(self.htsfile, opts)
jpayne@68 17161 * if rval != 0: # <<<<<<<<<<<<<<
jpayne@68 17162 * hts_opt_free(opts)
jpayne@68 17163 * raise RuntimeError('An error occurred while applying the requested format options')
jpayne@68 17164 */
jpayne@68 17165 }
jpayne@68 17166
jpayne@68 17167 /* "pysam/libchtslib.pyx":593
jpayne@68 17168 * hts_opt_free(opts)
jpayne@68 17169 * raise RuntimeError('An error occurred while applying the requested format options')
jpayne@68 17170 * hts_opt_free(opts) # <<<<<<<<<<<<<<
jpayne@68 17171 *
jpayne@68 17172 * def parse_region(self, contig=None, start=None, stop=None,
jpayne@68 17173 */
jpayne@68 17174 hts_opt_free(__pyx_v_opts);
jpayne@68 17175
jpayne@68 17176 /* "pysam/libchtslib.pyx":588
jpayne@68 17177 * hts_opt_free(opts)
jpayne@68 17178 * raise RuntimeError('Invalid format option ({}) specified'.format(format_option))
jpayne@68 17179 * if opts != NULL: # <<<<<<<<<<<<<<
jpayne@68 17180 * rval = hts_opt_apply(self.htsfile, opts)
jpayne@68 17181 * if rval != 0:
jpayne@68 17182 */
jpayne@68 17183 }
jpayne@68 17184
jpayne@68 17185 /* "pysam/libchtslib.pyx":581
jpayne@68 17186 * cdef hts_opt *opts = NULL
jpayne@68 17187 *
jpayne@68 17188 * if format_options: # <<<<<<<<<<<<<<
jpayne@68 17189 * for format_option in format_options:
jpayne@68 17190 * rval = hts_opt_add(&opts, format_option)
jpayne@68 17191 */
jpayne@68 17192 }
jpayne@68 17193
jpayne@68 17194 /* "pysam/libchtslib.pyx":575
jpayne@68 17195 * return htsfile
jpayne@68 17196 *
jpayne@68 17197 * def add_hts_options(self, format_options=None): # <<<<<<<<<<<<<<
jpayne@68 17198 * """Given a list of key=value format option strings, add them to an open htsFile
jpayne@68 17199 * """
jpayne@68 17200 */
jpayne@68 17201
jpayne@68 17202 /* function exit code */
jpayne@68 17203 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
jpayne@68 17204 goto __pyx_L0;
jpayne@68 17205 __pyx_L1_error:;
jpayne@68 17206 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 17207 __Pyx_XDECREF(__pyx_t_5);
jpayne@68 17208 __Pyx_XDECREF(__pyx_t_7);
jpayne@68 17209 __Pyx_XDECREF(__pyx_t_8);
jpayne@68 17210 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.add_hts_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 17211 __pyx_r = NULL;
jpayne@68 17212 __pyx_L0:;
jpayne@68 17213 __Pyx_XDECREF(__pyx_v_format_option);
jpayne@68 17214 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 17215 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 17216 __Pyx_RefNannyFinishContext();
jpayne@68 17217 return __pyx_r;
jpayne@68 17218 }
jpayne@68 17219
jpayne@68 17220 /* "pysam/libchtslib.pyx":595
jpayne@68 17221 * hts_opt_free(opts)
jpayne@68 17222 *
jpayne@68 17223 * def parse_region(self, contig=None, start=None, stop=None, # <<<<<<<<<<<<<<
jpayne@68 17224 * region=None, tid=None,
jpayne@68 17225 * reference=None, end=None):
jpayne@68 17226 */
jpayne@68 17227
jpayne@68 17228 /* Python wrapper */
jpayne@68 17229 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_23parse_region(PyObject *__pyx_v_self,
jpayne@68 17230 #if CYTHON_METH_FASTCALL
jpayne@68 17231 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 17232 #else
jpayne@68 17233 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 17234 #endif
jpayne@68 17235 ); /*proto*/
jpayne@68 17236 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_22parse_region, "HTSFile.parse_region(self, contig=None, start=None, stop=None, region=None, tid=None, reference=None, end=None)\nparse alternative ways to specify a genomic region. A region can\n either be specified by :term:`contig`, `start` and\n `stop`. `start` and `stop` denote 0-based, half-open\n intervals. :term:`reference` and `end` are also accepted for\n backward compatibility as synonyms for :term:`contig` and\n `stop`, respectively.\n\n Alternatively, a samtools :term:`region` string can be\n supplied.\n\n If any of the coordinates are missing they will be replaced by\n the minimum (`start`) or maximum (`stop`) coordinate.\n\n Note that region strings are 1-based inclusive, while `start`\n and `stop` denote an interval in 0-based, half-open\n coordinates (like BED files and Python slices).\n\n If `contig` or `region` or are ``*``, unmapped reads at the end\n of a BAM file will be returned. Setting either to ``.`` will\n iterate from the beginning of the file.\n\n Returns\n -------\n\n tuple :\n a tuple of `flag`, :term:`tid`, `start` and\n `stop`. The flag indicates whether no coordinates were\n supplied and the genomic region is the complete genomic space.\n\n Raises\n ------\n\n ValueError\n for invalid or out of bounds regions.\n\n ");
jpayne@68 17237 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_23parse_region = {"parse_region", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_23parse_region, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_22parse_region};
jpayne@68 17238 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_23parse_region(PyObject *__pyx_v_self,
jpayne@68 17239 #if CYTHON_METH_FASTCALL
jpayne@68 17240 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 17241 #else
jpayne@68 17242 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 17243 #endif
jpayne@68 17244 ) {
jpayne@68 17245 PyObject *__pyx_v_contig = 0;
jpayne@68 17246 PyObject *__pyx_v_start = 0;
jpayne@68 17247 PyObject *__pyx_v_stop = 0;
jpayne@68 17248 PyObject *__pyx_v_region = 0;
jpayne@68 17249 PyObject *__pyx_v_tid = 0;
jpayne@68 17250 PyObject *__pyx_v_reference = 0;
jpayne@68 17251 PyObject *__pyx_v_end = 0;
jpayne@68 17252 #if !CYTHON_METH_FASTCALL
jpayne@68 17253 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 17254 #endif
jpayne@68 17255 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 17256 PyObject* values[7] = {0,0,0,0,0,0,0};
jpayne@68 17257 int __pyx_lineno = 0;
jpayne@68 17258 const char *__pyx_filename = NULL;
jpayne@68 17259 int __pyx_clineno = 0;
jpayne@68 17260 PyObject *__pyx_r = 0;
jpayne@68 17261 __Pyx_RefNannyDeclarations
jpayne@68 17262 __Pyx_RefNannySetupContext("parse_region (wrapper)", 0);
jpayne@68 17263 #if !CYTHON_METH_FASTCALL
jpayne@68 17264 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 17265 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 17266 #else
jpayne@68 17267 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 17268 #endif
jpayne@68 17269 #endif
jpayne@68 17270 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 17271 {
jpayne@68 17272 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_contig,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_region,&__pyx_n_s_tid,&__pyx_n_s_reference,&__pyx_n_s_end,0};
jpayne@68 17273 values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 17274 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 17275 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 17276
jpayne@68 17277 /* "pysam/libchtslib.pyx":596
jpayne@68 17278 *
jpayne@68 17279 * def parse_region(self, contig=None, start=None, stop=None,
jpayne@68 17280 * region=None, tid=None, # <<<<<<<<<<<<<<
jpayne@68 17281 * reference=None, end=None):
jpayne@68 17282 * """parse alternative ways to specify a genomic region. A region can
jpayne@68 17283 */
jpayne@68 17284 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 17285 values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 17286
jpayne@68 17287 /* "pysam/libchtslib.pyx":597
jpayne@68 17288 * def parse_region(self, contig=None, start=None, stop=None,
jpayne@68 17289 * region=None, tid=None,
jpayne@68 17290 * reference=None, end=None): # <<<<<<<<<<<<<<
jpayne@68 17291 * """parse alternative ways to specify a genomic region. A region can
jpayne@68 17292 * either be specified by :term:`contig`, `start` and
jpayne@68 17293 */
jpayne@68 17294 values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 17295 values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
jpayne@68 17296 if (__pyx_kwds) {
jpayne@68 17297 Py_ssize_t kw_args;
jpayne@68 17298 switch (__pyx_nargs) {
jpayne@68 17299 case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
jpayne@68 17300 CYTHON_FALLTHROUGH;
jpayne@68 17301 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
jpayne@68 17302 CYTHON_FALLTHROUGH;
jpayne@68 17303 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
jpayne@68 17304 CYTHON_FALLTHROUGH;
jpayne@68 17305 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
jpayne@68 17306 CYTHON_FALLTHROUGH;
jpayne@68 17307 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
jpayne@68 17308 CYTHON_FALLTHROUGH;
jpayne@68 17309 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 17310 CYTHON_FALLTHROUGH;
jpayne@68 17311 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 17312 CYTHON_FALLTHROUGH;
jpayne@68 17313 case 0: break;
jpayne@68 17314 default: goto __pyx_L5_argtuple_error;
jpayne@68 17315 }
jpayne@68 17316 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 17317 switch (__pyx_nargs) {
jpayne@68 17318 case 0:
jpayne@68 17319 if (kw_args > 0) {
jpayne@68 17320 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_contig);
jpayne@68 17321 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 17322 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17323 }
jpayne@68 17324 CYTHON_FALLTHROUGH;
jpayne@68 17325 case 1:
jpayne@68 17326 if (kw_args > 0) {
jpayne@68 17327 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start);
jpayne@68 17328 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 17329 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17330 }
jpayne@68 17331 CYTHON_FALLTHROUGH;
jpayne@68 17332 case 2:
jpayne@68 17333 if (kw_args > 0) {
jpayne@68 17334 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stop);
jpayne@68 17335 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 17336 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17337 }
jpayne@68 17338 CYTHON_FALLTHROUGH;
jpayne@68 17339 case 3:
jpayne@68 17340 if (kw_args > 0) {
jpayne@68 17341 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_region);
jpayne@68 17342 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 17343 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17344 }
jpayne@68 17345 CYTHON_FALLTHROUGH;
jpayne@68 17346 case 4:
jpayne@68 17347 if (kw_args > 0) {
jpayne@68 17348 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tid);
jpayne@68 17349 if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 17350 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17351 }
jpayne@68 17352 CYTHON_FALLTHROUGH;
jpayne@68 17353 case 5:
jpayne@68 17354 if (kw_args > 0) {
jpayne@68 17355 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reference);
jpayne@68 17356 if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 17357 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17358 }
jpayne@68 17359 CYTHON_FALLTHROUGH;
jpayne@68 17360 case 6:
jpayne@68 17361 if (kw_args > 0) {
jpayne@68 17362 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end);
jpayne@68 17363 if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
jpayne@68 17364 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17365 }
jpayne@68 17366 }
jpayne@68 17367 if (unlikely(kw_args > 0)) {
jpayne@68 17368 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 17369 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_region") < 0)) __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17370 }
jpayne@68 17371 } else {
jpayne@68 17372 switch (__pyx_nargs) {
jpayne@68 17373 case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
jpayne@68 17374 CYTHON_FALLTHROUGH;
jpayne@68 17375 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
jpayne@68 17376 CYTHON_FALLTHROUGH;
jpayne@68 17377 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
jpayne@68 17378 CYTHON_FALLTHROUGH;
jpayne@68 17379 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
jpayne@68 17380 CYTHON_FALLTHROUGH;
jpayne@68 17381 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
jpayne@68 17382 CYTHON_FALLTHROUGH;
jpayne@68 17383 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
jpayne@68 17384 CYTHON_FALLTHROUGH;
jpayne@68 17385 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 17386 CYTHON_FALLTHROUGH;
jpayne@68 17387 case 0: break;
jpayne@68 17388 default: goto __pyx_L5_argtuple_error;
jpayne@68 17389 }
jpayne@68 17390 }
jpayne@68 17391 __pyx_v_contig = values[0];
jpayne@68 17392 __pyx_v_start = values[1];
jpayne@68 17393 __pyx_v_stop = values[2];
jpayne@68 17394 __pyx_v_region = values[3];
jpayne@68 17395 __pyx_v_tid = values[4];
jpayne@68 17396 __pyx_v_reference = values[5];
jpayne@68 17397 __pyx_v_end = values[6];
jpayne@68 17398 }
jpayne@68 17399 goto __pyx_L6_skip;
jpayne@68 17400 __pyx_L5_argtuple_error:;
jpayne@68 17401 __Pyx_RaiseArgtupleInvalid("parse_region", 0, 0, 7, __pyx_nargs); __PYX_ERR(0, 595, __pyx_L3_error)
jpayne@68 17402 __pyx_L6_skip:;
jpayne@68 17403 goto __pyx_L4_argument_unpacking_done;
jpayne@68 17404 __pyx_L3_error:;
jpayne@68 17405 {
jpayne@68 17406 Py_ssize_t __pyx_temp;
jpayne@68 17407 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 17408 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 17409 }
jpayne@68 17410 }
jpayne@68 17411 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 17412 __Pyx_RefNannyFinishContext();
jpayne@68 17413 return NULL;
jpayne@68 17414 __pyx_L4_argument_unpacking_done:;
jpayne@68 17415 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_22parse_region(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_contig, __pyx_v_start, __pyx_v_stop, __pyx_v_region, __pyx_v_tid, __pyx_v_reference, __pyx_v_end);
jpayne@68 17416
jpayne@68 17417 /* "pysam/libchtslib.pyx":595
jpayne@68 17418 * hts_opt_free(opts)
jpayne@68 17419 *
jpayne@68 17420 * def parse_region(self, contig=None, start=None, stop=None, # <<<<<<<<<<<<<<
jpayne@68 17421 * region=None, tid=None,
jpayne@68 17422 * reference=None, end=None):
jpayne@68 17423 */
jpayne@68 17424
jpayne@68 17425 /* function exit code */
jpayne@68 17426 {
jpayne@68 17427 Py_ssize_t __pyx_temp;
jpayne@68 17428 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 17429 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 17430 }
jpayne@68 17431 }
jpayne@68 17432 __Pyx_RefNannyFinishContext();
jpayne@68 17433 return __pyx_r;
jpayne@68 17434 }
jpayne@68 17435
jpayne@68 17436 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_22parse_region(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, PyObject *__pyx_v_contig, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_region, PyObject *__pyx_v_tid, PyObject *__pyx_v_reference, PyObject *__pyx_v_end) {
jpayne@68 17437 int __pyx_v_rtid;
jpayne@68 17438 int32_t __pyx_v_rstart;
jpayne@68 17439 int32_t __pyx_v_rstop;
jpayne@68 17440 PyObject *__pyx_v_coord = NULL;
jpayne@68 17441 PyObject *__pyx_v_parts = NULL;
jpayne@68 17442 PyObject *__pyx_r = NULL;
jpayne@68 17443 __Pyx_TraceDeclarations
jpayne@68 17444 __Pyx_RefNannyDeclarations
jpayne@68 17445 int __pyx_t_1;
jpayne@68 17446 PyObject *__pyx_t_2 = NULL;
jpayne@68 17447 int __pyx_t_3;
jpayne@68 17448 PyObject *__pyx_t_4 = NULL;
jpayne@68 17449 PyObject *__pyx_t_5 = NULL;
jpayne@68 17450 PyObject *__pyx_t_6 = NULL;
jpayne@68 17451 PyObject *__pyx_t_7 = NULL;
jpayne@68 17452 int32_t __pyx_t_8;
jpayne@68 17453 int __pyx_t_9;
jpayne@68 17454 PyObject *__pyx_t_10 = NULL;
jpayne@68 17455 PyObject *__pyx_t_11 = NULL;
jpayne@68 17456 PyObject *__pyx_t_12 = NULL;
jpayne@68 17457 unsigned int __pyx_t_13;
jpayne@68 17458 PyObject *(*__pyx_t_14)(PyObject *);
jpayne@68 17459 Py_ssize_t __pyx_t_15;
jpayne@68 17460 int __pyx_lineno = 0;
jpayne@68 17461 const char *__pyx_filename = NULL;
jpayne@68 17462 int __pyx_clineno = 0;
jpayne@68 17463 __Pyx_TraceFrameInit(__pyx_codeobj__52)
jpayne@68 17464 __Pyx_RefNannySetupContext("parse_region", 0);
jpayne@68 17465 __Pyx_TraceCall("parse_region", __pyx_f[0], 595, 0, __PYX_ERR(0, 595, __pyx_L1_error));
jpayne@68 17466 __Pyx_INCREF(__pyx_v_contig);
jpayne@68 17467 __Pyx_INCREF(__pyx_v_stop);
jpayne@68 17468 __Pyx_INCREF(__pyx_v_region);
jpayne@68 17469
jpayne@68 17470 /* "pysam/libchtslib.pyx":638
jpayne@68 17471 * cdef int32_t rstop
jpayne@68 17472 *
jpayne@68 17473 * if reference is not None: # <<<<<<<<<<<<<<
jpayne@68 17474 * if contig is not None:
jpayne@68 17475 * raise ValueError('contig and reference should not both be specified')
jpayne@68 17476 */
jpayne@68 17477 __pyx_t_1 = (__pyx_v_reference != Py_None);
jpayne@68 17478 if (__pyx_t_1) {
jpayne@68 17479
jpayne@68 17480 /* "pysam/libchtslib.pyx":639
jpayne@68 17481 *
jpayne@68 17482 * if reference is not None:
jpayne@68 17483 * if contig is not None: # <<<<<<<<<<<<<<
jpayne@68 17484 * raise ValueError('contig and reference should not both be specified')
jpayne@68 17485 * contig = reference
jpayne@68 17486 */
jpayne@68 17487 __pyx_t_1 = (__pyx_v_contig != Py_None);
jpayne@68 17488 if (unlikely(__pyx_t_1)) {
jpayne@68 17489
jpayne@68 17490 /* "pysam/libchtslib.pyx":640
jpayne@68 17491 * if reference is not None:
jpayne@68 17492 * if contig is not None:
jpayne@68 17493 * raise ValueError('contig and reference should not both be specified') # <<<<<<<<<<<<<<
jpayne@68 17494 * contig = reference
jpayne@68 17495 *
jpayne@68 17496 */
jpayne@68 17497 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
jpayne@68 17498 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 17499 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 17500 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 17501 __PYX_ERR(0, 640, __pyx_L1_error)
jpayne@68 17502
jpayne@68 17503 /* "pysam/libchtslib.pyx":639
jpayne@68 17504 *
jpayne@68 17505 * if reference is not None:
jpayne@68 17506 * if contig is not None: # <<<<<<<<<<<<<<
jpayne@68 17507 * raise ValueError('contig and reference should not both be specified')
jpayne@68 17508 * contig = reference
jpayne@68 17509 */
jpayne@68 17510 }
jpayne@68 17511
jpayne@68 17512 /* "pysam/libchtslib.pyx":641
jpayne@68 17513 * if contig is not None:
jpayne@68 17514 * raise ValueError('contig and reference should not both be specified')
jpayne@68 17515 * contig = reference # <<<<<<<<<<<<<<
jpayne@68 17516 *
jpayne@68 17517 * if end is not None:
jpayne@68 17518 */
jpayne@68 17519 __Pyx_INCREF(__pyx_v_reference);
jpayne@68 17520 __Pyx_DECREF_SET(__pyx_v_contig, __pyx_v_reference);
jpayne@68 17521
jpayne@68 17522 /* "pysam/libchtslib.pyx":638
jpayne@68 17523 * cdef int32_t rstop
jpayne@68 17524 *
jpayne@68 17525 * if reference is not None: # <<<<<<<<<<<<<<
jpayne@68 17526 * if contig is not None:
jpayne@68 17527 * raise ValueError('contig and reference should not both be specified')
jpayne@68 17528 */
jpayne@68 17529 }
jpayne@68 17530
jpayne@68 17531 /* "pysam/libchtslib.pyx":643
jpayne@68 17532 * contig = reference
jpayne@68 17533 *
jpayne@68 17534 * if end is not None: # <<<<<<<<<<<<<<
jpayne@68 17535 * if stop is not None:
jpayne@68 17536 * raise ValueError('stop and end should not both be specified')
jpayne@68 17537 */
jpayne@68 17538 __pyx_t_1 = (__pyx_v_end != Py_None);
jpayne@68 17539 if (__pyx_t_1) {
jpayne@68 17540
jpayne@68 17541 /* "pysam/libchtslib.pyx":644
jpayne@68 17542 *
jpayne@68 17543 * if end is not None:
jpayne@68 17544 * if stop is not None: # <<<<<<<<<<<<<<
jpayne@68 17545 * raise ValueError('stop and end should not both be specified')
jpayne@68 17546 * stop = end
jpayne@68 17547 */
jpayne@68 17548 __pyx_t_1 = (__pyx_v_stop != Py_None);
jpayne@68 17549 if (unlikely(__pyx_t_1)) {
jpayne@68 17550
jpayne@68 17551 /* "pysam/libchtslib.pyx":645
jpayne@68 17552 * if end is not None:
jpayne@68 17553 * if stop is not None:
jpayne@68 17554 * raise ValueError('stop and end should not both be specified') # <<<<<<<<<<<<<<
jpayne@68 17555 * stop = end
jpayne@68 17556 *
jpayne@68 17557 */
jpayne@68 17558 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error)
jpayne@68 17559 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 17560 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 17561 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 17562 __PYX_ERR(0, 645, __pyx_L1_error)
jpayne@68 17563
jpayne@68 17564 /* "pysam/libchtslib.pyx":644
jpayne@68 17565 *
jpayne@68 17566 * if end is not None:
jpayne@68 17567 * if stop is not None: # <<<<<<<<<<<<<<
jpayne@68 17568 * raise ValueError('stop and end should not both be specified')
jpayne@68 17569 * stop = end
jpayne@68 17570 */
jpayne@68 17571 }
jpayne@68 17572
jpayne@68 17573 /* "pysam/libchtslib.pyx":646
jpayne@68 17574 * if stop is not None:
jpayne@68 17575 * raise ValueError('stop and end should not both be specified')
jpayne@68 17576 * stop = end # <<<<<<<<<<<<<<
jpayne@68 17577 *
jpayne@68 17578 * if contig is None and tid is None and region is None:
jpayne@68 17579 */
jpayne@68 17580 __Pyx_INCREF(__pyx_v_end);
jpayne@68 17581 __Pyx_DECREF_SET(__pyx_v_stop, __pyx_v_end);
jpayne@68 17582
jpayne@68 17583 /* "pysam/libchtslib.pyx":643
jpayne@68 17584 * contig = reference
jpayne@68 17585 *
jpayne@68 17586 * if end is not None: # <<<<<<<<<<<<<<
jpayne@68 17587 * if stop is not None:
jpayne@68 17588 * raise ValueError('stop and end should not both be specified')
jpayne@68 17589 */
jpayne@68 17590 }
jpayne@68 17591
jpayne@68 17592 /* "pysam/libchtslib.pyx":648
jpayne@68 17593 * stop = end
jpayne@68 17594 *
jpayne@68 17595 * if contig is None and tid is None and region is None: # <<<<<<<<<<<<<<
jpayne@68 17596 * return 0, 0, 0, MAX_POS
jpayne@68 17597 *
jpayne@68 17598 */
jpayne@68 17599 __pyx_t_3 = (__pyx_v_contig == Py_None);
jpayne@68 17600 if (__pyx_t_3) {
jpayne@68 17601 } else {
jpayne@68 17602 __pyx_t_1 = __pyx_t_3;
jpayne@68 17603 goto __pyx_L8_bool_binop_done;
jpayne@68 17604 }
jpayne@68 17605 __pyx_t_3 = (__pyx_v_tid == Py_None);
jpayne@68 17606 if (__pyx_t_3) {
jpayne@68 17607 } else {
jpayne@68 17608 __pyx_t_1 = __pyx_t_3;
jpayne@68 17609 goto __pyx_L8_bool_binop_done;
jpayne@68 17610 }
jpayne@68 17611 __pyx_t_3 = (__pyx_v_region == Py_None);
jpayne@68 17612 __pyx_t_1 = __pyx_t_3;
jpayne@68 17613 __pyx_L8_bool_binop_done:;
jpayne@68 17614 if (__pyx_t_1) {
jpayne@68 17615
jpayne@68 17616 /* "pysam/libchtslib.pyx":649
jpayne@68 17617 *
jpayne@68 17618 * if contig is None and tid is None and region is None:
jpayne@68 17619 * return 0, 0, 0, MAX_POS # <<<<<<<<<<<<<<
jpayne@68 17620 *
jpayne@68 17621 * rtid = -1
jpayne@68 17622 */
jpayne@68 17623 __Pyx_XDECREF(__pyx_r);
jpayne@68 17624 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_5pysam_10libchtslib_MAX_POS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
jpayne@68 17625 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 17626 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
jpayne@68 17627 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 17628 __Pyx_INCREF(__pyx_int_0);
jpayne@68 17629 __Pyx_GIVEREF(__pyx_int_0);
jpayne@68 17630 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 649, __pyx_L1_error);
jpayne@68 17631 __Pyx_INCREF(__pyx_int_0);
jpayne@68 17632 __Pyx_GIVEREF(__pyx_int_0);
jpayne@68 17633 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(0, 649, __pyx_L1_error);
jpayne@68 17634 __Pyx_INCREF(__pyx_int_0);
jpayne@68 17635 __Pyx_GIVEREF(__pyx_int_0);
jpayne@68 17636 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_0)) __PYX_ERR(0, 649, __pyx_L1_error);
jpayne@68 17637 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 17638 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error);
jpayne@68 17639 __pyx_t_2 = 0;
jpayne@68 17640 __pyx_r = __pyx_t_4;
jpayne@68 17641 __pyx_t_4 = 0;
jpayne@68 17642 goto __pyx_L0;
jpayne@68 17643
jpayne@68 17644 /* "pysam/libchtslib.pyx":648
jpayne@68 17645 * stop = end
jpayne@68 17646 *
jpayne@68 17647 * if contig is None and tid is None and region is None: # <<<<<<<<<<<<<<
jpayne@68 17648 * return 0, 0, 0, MAX_POS
jpayne@68 17649 *
jpayne@68 17650 */
jpayne@68 17651 }
jpayne@68 17652
jpayne@68 17653 /* "pysam/libchtslib.pyx":651
jpayne@68 17654 * return 0, 0, 0, MAX_POS
jpayne@68 17655 *
jpayne@68 17656 * rtid = -1 # <<<<<<<<<<<<<<
jpayne@68 17657 * rstart = 0
jpayne@68 17658 * rstop = MAX_POS
jpayne@68 17659 */
jpayne@68 17660 __pyx_v_rtid = -1;
jpayne@68 17661
jpayne@68 17662 /* "pysam/libchtslib.pyx":652
jpayne@68 17663 *
jpayne@68 17664 * rtid = -1
jpayne@68 17665 * rstart = 0 # <<<<<<<<<<<<<<
jpayne@68 17666 * rstop = MAX_POS
jpayne@68 17667 * if start is not None:
jpayne@68 17668 */
jpayne@68 17669 __pyx_v_rstart = 0;
jpayne@68 17670
jpayne@68 17671 /* "pysam/libchtslib.pyx":653
jpayne@68 17672 * rtid = -1
jpayne@68 17673 * rstart = 0
jpayne@68 17674 * rstop = MAX_POS # <<<<<<<<<<<<<<
jpayne@68 17675 * if start is not None:
jpayne@68 17676 * try:
jpayne@68 17677 */
jpayne@68 17678 __pyx_v_rstop = __pyx_v_5pysam_10libchtslib_MAX_POS;
jpayne@68 17679
jpayne@68 17680 /* "pysam/libchtslib.pyx":654
jpayne@68 17681 * rstart = 0
jpayne@68 17682 * rstop = MAX_POS
jpayne@68 17683 * if start is not None: # <<<<<<<<<<<<<<
jpayne@68 17684 * try:
jpayne@68 17685 * rstart = start
jpayne@68 17686 */
jpayne@68 17687 __pyx_t_1 = (__pyx_v_start != Py_None);
jpayne@68 17688 if (__pyx_t_1) {
jpayne@68 17689
jpayne@68 17690 /* "pysam/libchtslib.pyx":655
jpayne@68 17691 * rstop = MAX_POS
jpayne@68 17692 * if start is not None:
jpayne@68 17693 * try: # <<<<<<<<<<<<<<
jpayne@68 17694 * rstart = start
jpayne@68 17695 * except OverflowError:
jpayne@68 17696 */
jpayne@68 17697 {
jpayne@68 17698 __Pyx_PyThreadState_declare
jpayne@68 17699 __Pyx_PyThreadState_assign
jpayne@68 17700 __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
jpayne@68 17701 __Pyx_XGOTREF(__pyx_t_5);
jpayne@68 17702 __Pyx_XGOTREF(__pyx_t_6);
jpayne@68 17703 __Pyx_XGOTREF(__pyx_t_7);
jpayne@68 17704 /*try:*/ {
jpayne@68 17705
jpayne@68 17706 /* "pysam/libchtslib.pyx":656
jpayne@68 17707 * if start is not None:
jpayne@68 17708 * try:
jpayne@68 17709 * rstart = start # <<<<<<<<<<<<<<
jpayne@68 17710 * except OverflowError:
jpayne@68 17711 * raise ValueError('start out of range (%i)' % start)
jpayne@68 17712 */
jpayne@68 17713 __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_start); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L12_error)
jpayne@68 17714 __pyx_v_rstart = __pyx_t_8;
jpayne@68 17715
jpayne@68 17716 /* "pysam/libchtslib.pyx":655
jpayne@68 17717 * rstop = MAX_POS
jpayne@68 17718 * if start is not None:
jpayne@68 17719 * try: # <<<<<<<<<<<<<<
jpayne@68 17720 * rstart = start
jpayne@68 17721 * except OverflowError:
jpayne@68 17722 */
jpayne@68 17723 }
jpayne@68 17724 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 17725 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 17726 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
jpayne@68 17727 goto __pyx_L17_try_end;
jpayne@68 17728 __pyx_L12_error:;
jpayne@68 17729 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 17730 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 17731
jpayne@68 17732 /* "pysam/libchtslib.pyx":657
jpayne@68 17733 * try:
jpayne@68 17734 * rstart = start
jpayne@68 17735 * except OverflowError: # <<<<<<<<<<<<<<
jpayne@68 17736 * raise ValueError('start out of range (%i)' % start)
jpayne@68 17737 *
jpayne@68 17738 */
jpayne@68 17739 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
jpayne@68 17740 if (__pyx_t_9) {
jpayne@68 17741 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 17742 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 657, __pyx_L14_except_error)
jpayne@68 17743 __Pyx_XGOTREF(__pyx_t_4);
jpayne@68 17744 __Pyx_XGOTREF(__pyx_t_2);
jpayne@68 17745 __Pyx_XGOTREF(__pyx_t_10);
jpayne@68 17746
jpayne@68 17747 /* "pysam/libchtslib.pyx":658
jpayne@68 17748 * rstart = start
jpayne@68 17749 * except OverflowError:
jpayne@68 17750 * raise ValueError('start out of range (%i)' % start) # <<<<<<<<<<<<<<
jpayne@68 17751 *
jpayne@68 17752 * if stop is not None:
jpayne@68 17753 */
jpayne@68 17754 __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_start_out_of_range_i, __pyx_v_start); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 658, __pyx_L14_except_error)
jpayne@68 17755 __Pyx_GOTREF(__pyx_t_11);
jpayne@68 17756 __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 658, __pyx_L14_except_error)
jpayne@68 17757 __Pyx_GOTREF(__pyx_t_12);
jpayne@68 17758 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
jpayne@68 17759 __Pyx_Raise(__pyx_t_12, 0, 0, 0);
jpayne@68 17760 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
jpayne@68 17761 __PYX_ERR(0, 658, __pyx_L14_except_error)
jpayne@68 17762 }
jpayne@68 17763 goto __pyx_L14_except_error;
jpayne@68 17764
jpayne@68 17765 /* "pysam/libchtslib.pyx":655
jpayne@68 17766 * rstop = MAX_POS
jpayne@68 17767 * if start is not None:
jpayne@68 17768 * try: # <<<<<<<<<<<<<<
jpayne@68 17769 * rstart = start
jpayne@68 17770 * except OverflowError:
jpayne@68 17771 */
jpayne@68 17772 __pyx_L14_except_error:;
jpayne@68 17773 __Pyx_XGIVEREF(__pyx_t_5);
jpayne@68 17774 __Pyx_XGIVEREF(__pyx_t_6);
jpayne@68 17775 __Pyx_XGIVEREF(__pyx_t_7);
jpayne@68 17776 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
jpayne@68 17777 goto __pyx_L1_error;
jpayne@68 17778 __pyx_L17_try_end:;
jpayne@68 17779 }
jpayne@68 17780
jpayne@68 17781 /* "pysam/libchtslib.pyx":654
jpayne@68 17782 * rstart = 0
jpayne@68 17783 * rstop = MAX_POS
jpayne@68 17784 * if start is not None: # <<<<<<<<<<<<<<
jpayne@68 17785 * try:
jpayne@68 17786 * rstart = start
jpayne@68 17787 */
jpayne@68 17788 }
jpayne@68 17789
jpayne@68 17790 /* "pysam/libchtslib.pyx":660
jpayne@68 17791 * raise ValueError('start out of range (%i)' % start)
jpayne@68 17792 *
jpayne@68 17793 * if stop is not None: # <<<<<<<<<<<<<<
jpayne@68 17794 * try:
jpayne@68 17795 * rstop = stop
jpayne@68 17796 */
jpayne@68 17797 __pyx_t_1 = (__pyx_v_stop != Py_None);
jpayne@68 17798 if (__pyx_t_1) {
jpayne@68 17799
jpayne@68 17800 /* "pysam/libchtslib.pyx":661
jpayne@68 17801 *
jpayne@68 17802 * if stop is not None:
jpayne@68 17803 * try: # <<<<<<<<<<<<<<
jpayne@68 17804 * rstop = stop
jpayne@68 17805 * except OverflowError:
jpayne@68 17806 */
jpayne@68 17807 {
jpayne@68 17808 __Pyx_PyThreadState_declare
jpayne@68 17809 __Pyx_PyThreadState_assign
jpayne@68 17810 __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
jpayne@68 17811 __Pyx_XGOTREF(__pyx_t_7);
jpayne@68 17812 __Pyx_XGOTREF(__pyx_t_6);
jpayne@68 17813 __Pyx_XGOTREF(__pyx_t_5);
jpayne@68 17814 /*try:*/ {
jpayne@68 17815
jpayne@68 17816 /* "pysam/libchtslib.pyx":662
jpayne@68 17817 * if stop is not None:
jpayne@68 17818 * try:
jpayne@68 17819 * rstop = stop # <<<<<<<<<<<<<<
jpayne@68 17820 * except OverflowError:
jpayne@68 17821 * raise ValueError('stop out of range (%i)' % stop)
jpayne@68 17822 */
jpayne@68 17823 __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_stop); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L21_error)
jpayne@68 17824 __pyx_v_rstop = __pyx_t_8;
jpayne@68 17825
jpayne@68 17826 /* "pysam/libchtslib.pyx":661
jpayne@68 17827 *
jpayne@68 17828 * if stop is not None:
jpayne@68 17829 * try: # <<<<<<<<<<<<<<
jpayne@68 17830 * rstop = stop
jpayne@68 17831 * except OverflowError:
jpayne@68 17832 */
jpayne@68 17833 }
jpayne@68 17834 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
jpayne@68 17835 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 17836 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 17837 goto __pyx_L26_try_end;
jpayne@68 17838 __pyx_L21_error:;
jpayne@68 17839 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 17840 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
jpayne@68 17841 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
jpayne@68 17842 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 17843 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 17844
jpayne@68 17845 /* "pysam/libchtslib.pyx":663
jpayne@68 17846 * try:
jpayne@68 17847 * rstop = stop
jpayne@68 17848 * except OverflowError: # <<<<<<<<<<<<<<
jpayne@68 17849 * raise ValueError('stop out of range (%i)' % stop)
jpayne@68 17850 *
jpayne@68 17851 */
jpayne@68 17852 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
jpayne@68 17853 if (__pyx_t_9) {
jpayne@68 17854 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 17855 if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(0, 663, __pyx_L23_except_error)
jpayne@68 17856 __Pyx_XGOTREF(__pyx_t_10);
jpayne@68 17857 __Pyx_XGOTREF(__pyx_t_2);
jpayne@68 17858 __Pyx_XGOTREF(__pyx_t_4);
jpayne@68 17859
jpayne@68 17860 /* "pysam/libchtslib.pyx":664
jpayne@68 17861 * rstop = stop
jpayne@68 17862 * except OverflowError:
jpayne@68 17863 * raise ValueError('stop out of range (%i)' % stop) # <<<<<<<<<<<<<<
jpayne@68 17864 *
jpayne@68 17865 * if region:
jpayne@68 17866 */
jpayne@68 17867 __pyx_t_12 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_stop_out_of_range_i, __pyx_v_stop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L23_except_error)
jpayne@68 17868 __Pyx_GOTREF(__pyx_t_12);
jpayne@68 17869 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 664, __pyx_L23_except_error)
jpayne@68 17870 __Pyx_GOTREF(__pyx_t_11);
jpayne@68 17871 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
jpayne@68 17872 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
jpayne@68 17873 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
jpayne@68 17874 __PYX_ERR(0, 664, __pyx_L23_except_error)
jpayne@68 17875 }
jpayne@68 17876 goto __pyx_L23_except_error;
jpayne@68 17877
jpayne@68 17878 /* "pysam/libchtslib.pyx":661
jpayne@68 17879 *
jpayne@68 17880 * if stop is not None:
jpayne@68 17881 * try: # <<<<<<<<<<<<<<
jpayne@68 17882 * rstop = stop
jpayne@68 17883 * except OverflowError:
jpayne@68 17884 */
jpayne@68 17885 __pyx_L23_except_error:;
jpayne@68 17886 __Pyx_XGIVEREF(__pyx_t_7);
jpayne@68 17887 __Pyx_XGIVEREF(__pyx_t_6);
jpayne@68 17888 __Pyx_XGIVEREF(__pyx_t_5);
jpayne@68 17889 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
jpayne@68 17890 goto __pyx_L1_error;
jpayne@68 17891 __pyx_L26_try_end:;
jpayne@68 17892 }
jpayne@68 17893
jpayne@68 17894 /* "pysam/libchtslib.pyx":660
jpayne@68 17895 * raise ValueError('start out of range (%i)' % start)
jpayne@68 17896 *
jpayne@68 17897 * if stop is not None: # <<<<<<<<<<<<<<
jpayne@68 17898 * try:
jpayne@68 17899 * rstop = stop
jpayne@68 17900 */
jpayne@68 17901 }
jpayne@68 17902
jpayne@68 17903 /* "pysam/libchtslib.pyx":666
jpayne@68 17904 * raise ValueError('stop out of range (%i)' % stop)
jpayne@68 17905 *
jpayne@68 17906 * if region: # <<<<<<<<<<<<<<
jpayne@68 17907 * region = force_str(region)
jpayne@68 17908 * if ":" in region:
jpayne@68 17909 */
jpayne@68 17910 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 666, __pyx_L1_error)
jpayne@68 17911 if (__pyx_t_1) {
jpayne@68 17912
jpayne@68 17913 /* "pysam/libchtslib.pyx":667
jpayne@68 17914 *
jpayne@68 17915 * if region:
jpayne@68 17916 * region = force_str(region) # <<<<<<<<<<<<<<
jpayne@68 17917 * if ":" in region:
jpayne@68 17918 * contig, coord = region.split(":")
jpayne@68 17919 */
jpayne@68 17920 __pyx_t_4 = __pyx_f_5pysam_9libcutils_force_str(__pyx_v_region, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error)
jpayne@68 17921 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 17922 __Pyx_DECREF_SET(__pyx_v_region, __pyx_t_4);
jpayne@68 17923 __pyx_t_4 = 0;
jpayne@68 17924
jpayne@68 17925 /* "pysam/libchtslib.pyx":668
jpayne@68 17926 * if region:
jpayne@68 17927 * region = force_str(region)
jpayne@68 17928 * if ":" in region: # <<<<<<<<<<<<<<
jpayne@68 17929 * contig, coord = region.split(":")
jpayne@68 17930 * parts = coord.split("-")
jpayne@68 17931 */
jpayne@68 17932 __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__55, __pyx_v_region, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 668, __pyx_L1_error)
jpayne@68 17933 if (__pyx_t_1) {
jpayne@68 17934
jpayne@68 17935 /* "pysam/libchtslib.pyx":669
jpayne@68 17936 * region = force_str(region)
jpayne@68 17937 * if ":" in region:
jpayne@68 17938 * contig, coord = region.split(":") # <<<<<<<<<<<<<<
jpayne@68 17939 * parts = coord.split("-")
jpayne@68 17940 * rstart = int(parts[0]) - 1
jpayne@68 17941 */
jpayne@68 17942 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_region, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
jpayne@68 17943 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 17944 __pyx_t_10 = NULL;
jpayne@68 17945 __pyx_t_13 = 0;
jpayne@68 17946 #if CYTHON_UNPACK_METHODS
jpayne@68 17947 if (likely(PyMethod_Check(__pyx_t_2))) {
jpayne@68 17948 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
jpayne@68 17949 if (likely(__pyx_t_10)) {
jpayne@68 17950 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
jpayne@68 17951 __Pyx_INCREF(__pyx_t_10);
jpayne@68 17952 __Pyx_INCREF(function);
jpayne@68 17953 __Pyx_DECREF_SET(__pyx_t_2, function);
jpayne@68 17954 __pyx_t_13 = 1;
jpayne@68 17955 }
jpayne@68 17956 }
jpayne@68 17957 #endif
jpayne@68 17958 {
jpayne@68 17959 PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_kp_u__55};
jpayne@68 17960 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
jpayne@68 17961 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 17962 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error)
jpayne@68 17963 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 17964 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 17965 }
jpayne@68 17966 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
jpayne@68 17967 PyObject* sequence = __pyx_t_4;
jpayne@68 17968 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
jpayne@68 17969 if (unlikely(size != 2)) {
jpayne@68 17970 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
jpayne@68 17971 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
jpayne@68 17972 __PYX_ERR(0, 669, __pyx_L1_error)
jpayne@68 17973 }
jpayne@68 17974 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 17975 if (likely(PyTuple_CheckExact(sequence))) {
jpayne@68 17976 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
jpayne@68 17977 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
jpayne@68 17978 } else {
jpayne@68 17979 __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
jpayne@68 17980 __pyx_t_10 = PyList_GET_ITEM(sequence, 1);
jpayne@68 17981 }
jpayne@68 17982 __Pyx_INCREF(__pyx_t_2);
jpayne@68 17983 __Pyx_INCREF(__pyx_t_10);
jpayne@68 17984 #else
jpayne@68 17985 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
jpayne@68 17986 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 17987 __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 669, __pyx_L1_error)
jpayne@68 17988 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 17989 #endif
jpayne@68 17990 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 17991 } else {
jpayne@68 17992 Py_ssize_t index = -1;
jpayne@68 17993 __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 669, __pyx_L1_error)
jpayne@68 17994 __Pyx_GOTREF(__pyx_t_11);
jpayne@68 17995 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 17996 __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
jpayne@68 17997 index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L31_unpacking_failed;
jpayne@68 17998 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 17999 index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L31_unpacking_failed;
jpayne@68 18000 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18001 if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_11), 2) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
jpayne@68 18002 __pyx_t_14 = NULL;
jpayne@68 18003 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
jpayne@68 18004 goto __pyx_L32_unpacking_done;
jpayne@68 18005 __pyx_L31_unpacking_failed:;
jpayne@68 18006 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
jpayne@68 18007 __pyx_t_14 = NULL;
jpayne@68 18008 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
jpayne@68 18009 __PYX_ERR(0, 669, __pyx_L1_error)
jpayne@68 18010 __pyx_L32_unpacking_done:;
jpayne@68 18011 }
jpayne@68 18012 __Pyx_DECREF_SET(__pyx_v_contig, __pyx_t_2);
jpayne@68 18013 __pyx_t_2 = 0;
jpayne@68 18014 __pyx_v_coord = __pyx_t_10;
jpayne@68 18015 __pyx_t_10 = 0;
jpayne@68 18016
jpayne@68 18017 /* "pysam/libchtslib.pyx":670
jpayne@68 18018 * if ":" in region:
jpayne@68 18019 * contig, coord = region.split(":")
jpayne@68 18020 * parts = coord.split("-") # <<<<<<<<<<<<<<
jpayne@68 18021 * rstart = int(parts[0]) - 1
jpayne@68 18022 * if len(parts) >= 1:
jpayne@68 18023 */
jpayne@68 18024 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_coord, __pyx_n_s_split); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 670, __pyx_L1_error)
jpayne@68 18025 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18026 __pyx_t_2 = NULL;
jpayne@68 18027 __pyx_t_13 = 0;
jpayne@68 18028 #if CYTHON_UNPACK_METHODS
jpayne@68 18029 if (likely(PyMethod_Check(__pyx_t_10))) {
jpayne@68 18030 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
jpayne@68 18031 if (likely(__pyx_t_2)) {
jpayne@68 18032 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
jpayne@68 18033 __Pyx_INCREF(__pyx_t_2);
jpayne@68 18034 __Pyx_INCREF(function);
jpayne@68 18035 __Pyx_DECREF_SET(__pyx_t_10, function);
jpayne@68 18036 __pyx_t_13 = 1;
jpayne@68 18037 }
jpayne@68 18038 }
jpayne@68 18039 #endif
jpayne@68 18040 {
jpayne@68 18041 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u__56};
jpayne@68 18042 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
jpayne@68 18043 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18044 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error)
jpayne@68 18045 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18046 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18047 }
jpayne@68 18048 __pyx_v_parts = __pyx_t_4;
jpayne@68 18049 __pyx_t_4 = 0;
jpayne@68 18050
jpayne@68 18051 /* "pysam/libchtslib.pyx":671
jpayne@68 18052 * contig, coord = region.split(":")
jpayne@68 18053 * parts = coord.split("-")
jpayne@68 18054 * rstart = int(parts[0]) - 1 # <<<<<<<<<<<<<<
jpayne@68 18055 * if len(parts) >= 1:
jpayne@68 18056 * rstop = int(parts[1])
jpayne@68 18057 */
jpayne@68 18058 __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_parts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
jpayne@68 18059 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18060 __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 671, __pyx_L1_error)
jpayne@68 18061 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18062 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 18063 __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
jpayne@68 18064 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18065 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18066 __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L1_error)
jpayne@68 18067 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 18068 __pyx_v_rstart = __pyx_t_8;
jpayne@68 18069
jpayne@68 18070 /* "pysam/libchtslib.pyx":672
jpayne@68 18071 * parts = coord.split("-")
jpayne@68 18072 * rstart = int(parts[0]) - 1
jpayne@68 18073 * if len(parts) >= 1: # <<<<<<<<<<<<<<
jpayne@68 18074 * rstop = int(parts[1])
jpayne@68 18075 * else:
jpayne@68 18076 */
jpayne@68 18077 __pyx_t_15 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 672, __pyx_L1_error)
jpayne@68 18078 __pyx_t_1 = (__pyx_t_15 >= 1);
jpayne@68 18079 if (__pyx_t_1) {
jpayne@68 18080
jpayne@68 18081 /* "pysam/libchtslib.pyx":673
jpayne@68 18082 * rstart = int(parts[0]) - 1
jpayne@68 18083 * if len(parts) >= 1:
jpayne@68 18084 * rstop = int(parts[1]) # <<<<<<<<<<<<<<
jpayne@68 18085 * else:
jpayne@68 18086 * contig = region
jpayne@68 18087 */
jpayne@68 18088 __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_parts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error)
jpayne@68 18089 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18090 __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 673, __pyx_L1_error)
jpayne@68 18091 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18092 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 18093 __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_10); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L1_error)
jpayne@68 18094 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18095 __pyx_v_rstop = __pyx_t_8;
jpayne@68 18096
jpayne@68 18097 /* "pysam/libchtslib.pyx":672
jpayne@68 18098 * parts = coord.split("-")
jpayne@68 18099 * rstart = int(parts[0]) - 1
jpayne@68 18100 * if len(parts) >= 1: # <<<<<<<<<<<<<<
jpayne@68 18101 * rstop = int(parts[1])
jpayne@68 18102 * else:
jpayne@68 18103 */
jpayne@68 18104 }
jpayne@68 18105
jpayne@68 18106 /* "pysam/libchtslib.pyx":668
jpayne@68 18107 * if region:
jpayne@68 18108 * region = force_str(region)
jpayne@68 18109 * if ":" in region: # <<<<<<<<<<<<<<
jpayne@68 18110 * contig, coord = region.split(":")
jpayne@68 18111 * parts = coord.split("-")
jpayne@68 18112 */
jpayne@68 18113 goto __pyx_L30;
jpayne@68 18114 }
jpayne@68 18115
jpayne@68 18116 /* "pysam/libchtslib.pyx":675
jpayne@68 18117 * rstop = int(parts[1])
jpayne@68 18118 * else:
jpayne@68 18119 * contig = region # <<<<<<<<<<<<<<
jpayne@68 18120 *
jpayne@68 18121 * if tid is not None:
jpayne@68 18122 */
jpayne@68 18123 /*else*/ {
jpayne@68 18124 __Pyx_INCREF(__pyx_v_region);
jpayne@68 18125 __Pyx_DECREF_SET(__pyx_v_contig, __pyx_v_region);
jpayne@68 18126 }
jpayne@68 18127 __pyx_L30:;
jpayne@68 18128
jpayne@68 18129 /* "pysam/libchtslib.pyx":666
jpayne@68 18130 * raise ValueError('stop out of range (%i)' % stop)
jpayne@68 18131 *
jpayne@68 18132 * if region: # <<<<<<<<<<<<<<
jpayne@68 18133 * region = force_str(region)
jpayne@68 18134 * if ":" in region:
jpayne@68 18135 */
jpayne@68 18136 }
jpayne@68 18137
jpayne@68 18138 /* "pysam/libchtslib.pyx":677
jpayne@68 18139 * contig = region
jpayne@68 18140 *
jpayne@68 18141 * if tid is not None: # <<<<<<<<<<<<<<
jpayne@68 18142 * if not self.is_valid_tid(tid):
jpayne@68 18143 * raise IndexError('invalid tid')
jpayne@68 18144 */
jpayne@68 18145 __pyx_t_1 = (__pyx_v_tid != Py_None);
jpayne@68 18146 if (__pyx_t_1) {
jpayne@68 18147
jpayne@68 18148 /* "pysam/libchtslib.pyx":678
jpayne@68 18149 *
jpayne@68 18150 * if tid is not None:
jpayne@68 18151 * if not self.is_valid_tid(tid): # <<<<<<<<<<<<<<
jpayne@68 18152 * raise IndexError('invalid tid')
jpayne@68 18153 * rtid = tid
jpayne@68 18154 */
jpayne@68 18155 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_valid_tid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error)
jpayne@68 18156 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18157 __pyx_t_2 = NULL;
jpayne@68 18158 __pyx_t_13 = 0;
jpayne@68 18159 #if CYTHON_UNPACK_METHODS
jpayne@68 18160 if (likely(PyMethod_Check(__pyx_t_4))) {
jpayne@68 18161 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
jpayne@68 18162 if (likely(__pyx_t_2)) {
jpayne@68 18163 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
jpayne@68 18164 __Pyx_INCREF(__pyx_t_2);
jpayne@68 18165 __Pyx_INCREF(function);
jpayne@68 18166 __Pyx_DECREF_SET(__pyx_t_4, function);
jpayne@68 18167 __pyx_t_13 = 1;
jpayne@68 18168 }
jpayne@68 18169 }
jpayne@68 18170 #endif
jpayne@68 18171 {
jpayne@68 18172 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_tid};
jpayne@68 18173 __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
jpayne@68 18174 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18175 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 678, __pyx_L1_error)
jpayne@68 18176 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18177 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 18178 }
jpayne@68 18179 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 678, __pyx_L1_error)
jpayne@68 18180 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18181 __pyx_t_3 = (!__pyx_t_1);
jpayne@68 18182 if (unlikely(__pyx_t_3)) {
jpayne@68 18183
jpayne@68 18184 /* "pysam/libchtslib.pyx":679
jpayne@68 18185 * if tid is not None:
jpayne@68 18186 * if not self.is_valid_tid(tid):
jpayne@68 18187 * raise IndexError('invalid tid') # <<<<<<<<<<<<<<
jpayne@68 18188 * rtid = tid
jpayne@68 18189 * else:
jpayne@68 18190 */
jpayne@68 18191 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 679, __pyx_L1_error)
jpayne@68 18192 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18193 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
jpayne@68 18194 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18195 __PYX_ERR(0, 679, __pyx_L1_error)
jpayne@68 18196
jpayne@68 18197 /* "pysam/libchtslib.pyx":678
jpayne@68 18198 *
jpayne@68 18199 * if tid is not None:
jpayne@68 18200 * if not self.is_valid_tid(tid): # <<<<<<<<<<<<<<
jpayne@68 18201 * raise IndexError('invalid tid')
jpayne@68 18202 * rtid = tid
jpayne@68 18203 */
jpayne@68 18204 }
jpayne@68 18205
jpayne@68 18206 /* "pysam/libchtslib.pyx":680
jpayne@68 18207 * if not self.is_valid_tid(tid):
jpayne@68 18208 * raise IndexError('invalid tid')
jpayne@68 18209 * rtid = tid # <<<<<<<<<<<<<<
jpayne@68 18210 * else:
jpayne@68 18211 * if contig == "*":
jpayne@68 18212 */
jpayne@68 18213 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_tid); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error)
jpayne@68 18214 __pyx_v_rtid = __pyx_t_9;
jpayne@68 18215
jpayne@68 18216 /* "pysam/libchtslib.pyx":677
jpayne@68 18217 * contig = region
jpayne@68 18218 *
jpayne@68 18219 * if tid is not None: # <<<<<<<<<<<<<<
jpayne@68 18220 * if not self.is_valid_tid(tid):
jpayne@68 18221 * raise IndexError('invalid tid')
jpayne@68 18222 */
jpayne@68 18223 goto __pyx_L34;
jpayne@68 18224 }
jpayne@68 18225
jpayne@68 18226 /* "pysam/libchtslib.pyx":682
jpayne@68 18227 * rtid = tid
jpayne@68 18228 * else:
jpayne@68 18229 * if contig == "*": # <<<<<<<<<<<<<<
jpayne@68 18230 * rtid = HTS_IDX_NOCOOR
jpayne@68 18231 * elif contig == ".":
jpayne@68 18232 */
jpayne@68 18233 /*else*/ {
jpayne@68 18234 __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_contig, __pyx_kp_u__58, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 682, __pyx_L1_error)
jpayne@68 18235 if (__pyx_t_3) {
jpayne@68 18236
jpayne@68 18237 /* "pysam/libchtslib.pyx":683
jpayne@68 18238 * else:
jpayne@68 18239 * if contig == "*":
jpayne@68 18240 * rtid = HTS_IDX_NOCOOR # <<<<<<<<<<<<<<
jpayne@68 18241 * elif contig == ".":
jpayne@68 18242 * rtid = HTS_IDX_START
jpayne@68 18243 */
jpayne@68 18244 __pyx_v_rtid = HTS_IDX_NOCOOR;
jpayne@68 18245
jpayne@68 18246 /* "pysam/libchtslib.pyx":682
jpayne@68 18247 * rtid = tid
jpayne@68 18248 * else:
jpayne@68 18249 * if contig == "*": # <<<<<<<<<<<<<<
jpayne@68 18250 * rtid = HTS_IDX_NOCOOR
jpayne@68 18251 * elif contig == ".":
jpayne@68 18252 */
jpayne@68 18253 goto __pyx_L36;
jpayne@68 18254 }
jpayne@68 18255
jpayne@68 18256 /* "pysam/libchtslib.pyx":684
jpayne@68 18257 * if contig == "*":
jpayne@68 18258 * rtid = HTS_IDX_NOCOOR
jpayne@68 18259 * elif contig == ".": # <<<<<<<<<<<<<<
jpayne@68 18260 * rtid = HTS_IDX_START
jpayne@68 18261 * else:
jpayne@68 18262 */
jpayne@68 18263 __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_contig, __pyx_kp_u__59, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 684, __pyx_L1_error)
jpayne@68 18264 if (__pyx_t_3) {
jpayne@68 18265
jpayne@68 18266 /* "pysam/libchtslib.pyx":685
jpayne@68 18267 * rtid = HTS_IDX_NOCOOR
jpayne@68 18268 * elif contig == ".":
jpayne@68 18269 * rtid = HTS_IDX_START # <<<<<<<<<<<<<<
jpayne@68 18270 * else:
jpayne@68 18271 * rtid = self.get_tid(contig)
jpayne@68 18272 */
jpayne@68 18273 __pyx_v_rtid = HTS_IDX_START;
jpayne@68 18274
jpayne@68 18275 /* "pysam/libchtslib.pyx":684
jpayne@68 18276 * if contig == "*":
jpayne@68 18277 * rtid = HTS_IDX_NOCOOR
jpayne@68 18278 * elif contig == ".": # <<<<<<<<<<<<<<
jpayne@68 18279 * rtid = HTS_IDX_START
jpayne@68 18280 * else:
jpayne@68 18281 */
jpayne@68 18282 goto __pyx_L36;
jpayne@68 18283 }
jpayne@68 18284
jpayne@68 18285 /* "pysam/libchtslib.pyx":687
jpayne@68 18286 * rtid = HTS_IDX_START
jpayne@68 18287 * else:
jpayne@68 18288 * rtid = self.get_tid(contig) # <<<<<<<<<<<<<<
jpayne@68 18289 * if rtid < 0:
jpayne@68 18290 * raise ValueError('invalid contig `%s`' % contig)
jpayne@68 18291 */
jpayne@68 18292 /*else*/ {
jpayne@68 18293 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_tid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
jpayne@68 18294 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18295 __pyx_t_2 = NULL;
jpayne@68 18296 __pyx_t_13 = 0;
jpayne@68 18297 #if CYTHON_UNPACK_METHODS
jpayne@68 18298 if (likely(PyMethod_Check(__pyx_t_4))) {
jpayne@68 18299 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
jpayne@68 18300 if (likely(__pyx_t_2)) {
jpayne@68 18301 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
jpayne@68 18302 __Pyx_INCREF(__pyx_t_2);
jpayne@68 18303 __Pyx_INCREF(function);
jpayne@68 18304 __Pyx_DECREF_SET(__pyx_t_4, function);
jpayne@68 18305 __pyx_t_13 = 1;
jpayne@68 18306 }
jpayne@68 18307 }
jpayne@68 18308 #endif
jpayne@68 18309 {
jpayne@68 18310 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_contig};
jpayne@68 18311 __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
jpayne@68 18312 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18313 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 687, __pyx_L1_error)
jpayne@68 18314 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18315 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 18316 }
jpayne@68 18317 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L1_error)
jpayne@68 18318 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18319 __pyx_v_rtid = __pyx_t_9;
jpayne@68 18320
jpayne@68 18321 /* "pysam/libchtslib.pyx":688
jpayne@68 18322 * else:
jpayne@68 18323 * rtid = self.get_tid(contig)
jpayne@68 18324 * if rtid < 0: # <<<<<<<<<<<<<<
jpayne@68 18325 * raise ValueError('invalid contig `%s`' % contig)
jpayne@68 18326 *
jpayne@68 18327 */
jpayne@68 18328 __pyx_t_3 = (__pyx_v_rtid < 0);
jpayne@68 18329 if (unlikely(__pyx_t_3)) {
jpayne@68 18330
jpayne@68 18331 /* "pysam/libchtslib.pyx":689
jpayne@68 18332 * rtid = self.get_tid(contig)
jpayne@68 18333 * if rtid < 0:
jpayne@68 18334 * raise ValueError('invalid contig `%s`' % contig) # <<<<<<<<<<<<<<
jpayne@68 18335 *
jpayne@68 18336 * if rstart > rstop:
jpayne@68 18337 */
jpayne@68 18338 __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_invalid_contig_s, __pyx_v_contig); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 689, __pyx_L1_error)
jpayne@68 18339 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18340 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
jpayne@68 18341 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18342 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18343 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
jpayne@68 18344 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
jpayne@68 18345 __PYX_ERR(0, 689, __pyx_L1_error)
jpayne@68 18346
jpayne@68 18347 /* "pysam/libchtslib.pyx":688
jpayne@68 18348 * else:
jpayne@68 18349 * rtid = self.get_tid(contig)
jpayne@68 18350 * if rtid < 0: # <<<<<<<<<<<<<<
jpayne@68 18351 * raise ValueError('invalid contig `%s`' % contig)
jpayne@68 18352 *
jpayne@68 18353 */
jpayne@68 18354 }
jpayne@68 18355 }
jpayne@68 18356 __pyx_L36:;
jpayne@68 18357 }
jpayne@68 18358 __pyx_L34:;
jpayne@68 18359
jpayne@68 18360 /* "pysam/libchtslib.pyx":691
jpayne@68 18361 * raise ValueError('invalid contig `%s`' % contig)
jpayne@68 18362 *
jpayne@68 18363 * if rstart > rstop: # <<<<<<<<<<<<<<
jpayne@68 18364 * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop))
jpayne@68 18365 * if not 0 <= rstart < MAX_POS:
jpayne@68 18366 */
jpayne@68 18367 __pyx_t_3 = (__pyx_v_rstart > __pyx_v_rstop);
jpayne@68 18368 if (unlikely(__pyx_t_3)) {
jpayne@68 18369
jpayne@68 18370 /* "pysam/libchtslib.pyx":692
jpayne@68 18371 *
jpayne@68 18372 * if rstart > rstop:
jpayne@68 18373 * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop)) # <<<<<<<<<<<<<<
jpayne@68 18374 * if not 0 <= rstart < MAX_POS:
jpayne@68 18375 * raise ValueError('start out of range (%i)' % rstart)
jpayne@68 18376 */
jpayne@68 18377 __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_rstart); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
jpayne@68 18378 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18379 __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_rstop); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 692, __pyx_L1_error)
jpayne@68 18380 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18381 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
jpayne@68 18382 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18383 __Pyx_GIVEREF(__pyx_t_4);
jpayne@68 18384 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error);
jpayne@68 18385 __Pyx_GIVEREF(__pyx_t_10);
jpayne@68 18386 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_10)) __PYX_ERR(0, 692, __pyx_L1_error);
jpayne@68 18387 __pyx_t_4 = 0;
jpayne@68 18388 __pyx_t_10 = 0;
jpayne@68 18389 __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_invalid_coordinates_start_i_stop, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 692, __pyx_L1_error)
jpayne@68 18390 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18392 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
jpayne@68 18393 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18394 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18395 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 18396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18397 __PYX_ERR(0, 692, __pyx_L1_error)
jpayne@68 18398
jpayne@68 18399 /* "pysam/libchtslib.pyx":691
jpayne@68 18400 * raise ValueError('invalid contig `%s`' % contig)
jpayne@68 18401 *
jpayne@68 18402 * if rstart > rstop: # <<<<<<<<<<<<<<
jpayne@68 18403 * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop))
jpayne@68 18404 * if not 0 <= rstart < MAX_POS:
jpayne@68 18405 */
jpayne@68 18406 }
jpayne@68 18407
jpayne@68 18408 /* "pysam/libchtslib.pyx":693
jpayne@68 18409 * if rstart > rstop:
jpayne@68 18410 * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop))
jpayne@68 18411 * if not 0 <= rstart < MAX_POS: # <<<<<<<<<<<<<<
jpayne@68 18412 * raise ValueError('start out of range (%i)' % rstart)
jpayne@68 18413 * if not 0 <= rstop <= MAX_POS:
jpayne@68 18414 */
jpayne@68 18415 __pyx_t_3 = (0 <= __pyx_v_rstart);
jpayne@68 18416 if (__pyx_t_3) {
jpayne@68 18417 __pyx_t_3 = (__pyx_v_rstart < __pyx_v_5pysam_10libchtslib_MAX_POS);
jpayne@68 18418 }
jpayne@68 18419 __pyx_t_1 = (!__pyx_t_3);
jpayne@68 18420 if (unlikely(__pyx_t_1)) {
jpayne@68 18421
jpayne@68 18422 /* "pysam/libchtslib.pyx":694
jpayne@68 18423 * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop))
jpayne@68 18424 * if not 0 <= rstart < MAX_POS:
jpayne@68 18425 * raise ValueError('start out of range (%i)' % rstart) # <<<<<<<<<<<<<<
jpayne@68 18426 * if not 0 <= rstop <= MAX_POS:
jpayne@68 18427 * raise ValueError('stop out of range (%i)' % rstop)
jpayne@68 18428 */
jpayne@68 18429 __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_rstart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
jpayne@68 18430 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18431 __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_start_out_of_range_i, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 694, __pyx_L1_error)
jpayne@68 18432 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18433 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18434 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
jpayne@68 18435 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18436 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18437 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 18438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18439 __PYX_ERR(0, 694, __pyx_L1_error)
jpayne@68 18440
jpayne@68 18441 /* "pysam/libchtslib.pyx":693
jpayne@68 18442 * if rstart > rstop:
jpayne@68 18443 * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop))
jpayne@68 18444 * if not 0 <= rstart < MAX_POS: # <<<<<<<<<<<<<<
jpayne@68 18445 * raise ValueError('start out of range (%i)' % rstart)
jpayne@68 18446 * if not 0 <= rstop <= MAX_POS:
jpayne@68 18447 */
jpayne@68 18448 }
jpayne@68 18449
jpayne@68 18450 /* "pysam/libchtslib.pyx":695
jpayne@68 18451 * if not 0 <= rstart < MAX_POS:
jpayne@68 18452 * raise ValueError('start out of range (%i)' % rstart)
jpayne@68 18453 * if not 0 <= rstop <= MAX_POS: # <<<<<<<<<<<<<<
jpayne@68 18454 * raise ValueError('stop out of range (%i)' % rstop)
jpayne@68 18455 *
jpayne@68 18456 */
jpayne@68 18457 __pyx_t_1 = (0 <= __pyx_v_rstop);
jpayne@68 18458 if (__pyx_t_1) {
jpayne@68 18459 __pyx_t_1 = (__pyx_v_rstop <= __pyx_v_5pysam_10libchtslib_MAX_POS);
jpayne@68 18460 }
jpayne@68 18461 __pyx_t_3 = (!__pyx_t_1);
jpayne@68 18462 if (unlikely(__pyx_t_3)) {
jpayne@68 18463
jpayne@68 18464 /* "pysam/libchtslib.pyx":696
jpayne@68 18465 * raise ValueError('start out of range (%i)' % rstart)
jpayne@68 18466 * if not 0 <= rstop <= MAX_POS:
jpayne@68 18467 * raise ValueError('stop out of range (%i)' % rstop) # <<<<<<<<<<<<<<
jpayne@68 18468 *
jpayne@68 18469 * return 1, rtid, rstart, rstop
jpayne@68 18470 */
jpayne@68 18471 __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_rstop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
jpayne@68 18472 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18473 __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_stop_out_of_range_i, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 696, __pyx_L1_error)
jpayne@68 18474 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18475 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18476 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
jpayne@68 18477 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18478 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
jpayne@68 18479 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
jpayne@68 18480 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18481 __PYX_ERR(0, 696, __pyx_L1_error)
jpayne@68 18482
jpayne@68 18483 /* "pysam/libchtslib.pyx":695
jpayne@68 18484 * if not 0 <= rstart < MAX_POS:
jpayne@68 18485 * raise ValueError('start out of range (%i)' % rstart)
jpayne@68 18486 * if not 0 <= rstop <= MAX_POS: # <<<<<<<<<<<<<<
jpayne@68 18487 * raise ValueError('stop out of range (%i)' % rstop)
jpayne@68 18488 *
jpayne@68 18489 */
jpayne@68 18490 }
jpayne@68 18491
jpayne@68 18492 /* "pysam/libchtslib.pyx":698
jpayne@68 18493 * raise ValueError('stop out of range (%i)' % rstop)
jpayne@68 18494 *
jpayne@68 18495 * return 1, rtid, rstart, rstop # <<<<<<<<<<<<<<
jpayne@68 18496 *
jpayne@68 18497 * def is_valid_tid(self, tid):
jpayne@68 18498 */
jpayne@68 18499 __Pyx_XDECREF(__pyx_r);
jpayne@68 18500 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rtid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
jpayne@68 18501 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18502 __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_rstart); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 698, __pyx_L1_error)
jpayne@68 18503 __Pyx_GOTREF(__pyx_t_10);
jpayne@68 18504 __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_rstop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
jpayne@68 18505 __Pyx_GOTREF(__pyx_t_4);
jpayne@68 18506 __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 698, __pyx_L1_error)
jpayne@68 18507 __Pyx_GOTREF(__pyx_t_11);
jpayne@68 18508 __Pyx_INCREF(__pyx_int_1);
jpayne@68 18509 __Pyx_GIVEREF(__pyx_int_1);
jpayne@68 18510 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_int_1)) __PYX_ERR(0, 698, __pyx_L1_error);
jpayne@68 18511 __Pyx_GIVEREF(__pyx_t_2);
jpayne@68 18512 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error);
jpayne@68 18513 __Pyx_GIVEREF(__pyx_t_10);
jpayne@68 18514 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10)) __PYX_ERR(0, 698, __pyx_L1_error);
jpayne@68 18515 __Pyx_GIVEREF(__pyx_t_4);
jpayne@68 18516 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error);
jpayne@68 18517 __pyx_t_2 = 0;
jpayne@68 18518 __pyx_t_10 = 0;
jpayne@68 18519 __pyx_t_4 = 0;
jpayne@68 18520 __pyx_r = __pyx_t_11;
jpayne@68 18521 __pyx_t_11 = 0;
jpayne@68 18522 goto __pyx_L0;
jpayne@68 18523
jpayne@68 18524 /* "pysam/libchtslib.pyx":595
jpayne@68 18525 * hts_opt_free(opts)
jpayne@68 18526 *
jpayne@68 18527 * def parse_region(self, contig=None, start=None, stop=None, # <<<<<<<<<<<<<<
jpayne@68 18528 * region=None, tid=None,
jpayne@68 18529 * reference=None, end=None):
jpayne@68 18530 */
jpayne@68 18531
jpayne@68 18532 /* function exit code */
jpayne@68 18533 __pyx_L1_error:;
jpayne@68 18534 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 18535 __Pyx_XDECREF(__pyx_t_4);
jpayne@68 18536 __Pyx_XDECREF(__pyx_t_10);
jpayne@68 18537 __Pyx_XDECREF(__pyx_t_11);
jpayne@68 18538 __Pyx_XDECREF(__pyx_t_12);
jpayne@68 18539 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 18540 __pyx_r = NULL;
jpayne@68 18541 __pyx_L0:;
jpayne@68 18542 __Pyx_XDECREF(__pyx_v_coord);
jpayne@68 18543 __Pyx_XDECREF(__pyx_v_parts);
jpayne@68 18544 __Pyx_XDECREF(__pyx_v_contig);
jpayne@68 18545 __Pyx_XDECREF(__pyx_v_stop);
jpayne@68 18546 __Pyx_XDECREF(__pyx_v_region);
jpayne@68 18547 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 18548 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 18549 __Pyx_RefNannyFinishContext();
jpayne@68 18550 return __pyx_r;
jpayne@68 18551 }
jpayne@68 18552
jpayne@68 18553 /* "pysam/libchtslib.pyx":700
jpayne@68 18554 * return 1, rtid, rstart, rstop
jpayne@68 18555 *
jpayne@68 18556 * def is_valid_tid(self, tid): # <<<<<<<<<<<<<<
jpayne@68 18557 * """
jpayne@68 18558 * return True if the numerical :term:`tid` is valid; False otherwise.
jpayne@68 18559 */
jpayne@68 18560
jpayne@68 18561 /* Python wrapper */
jpayne@68 18562 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_25is_valid_tid(PyObject *__pyx_v_self,
jpayne@68 18563 #if CYTHON_METH_FASTCALL
jpayne@68 18564 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 18565 #else
jpayne@68 18566 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 18567 #endif
jpayne@68 18568 ); /*proto*/
jpayne@68 18569 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_24is_valid_tid, "HTSFile.is_valid_tid(self, tid)\n\n return True if the numerical :term:`tid` is valid; False otherwise.\n\n returns -1 if contig is not known.\n ");
jpayne@68 18570 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_25is_valid_tid = {"is_valid_tid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_25is_valid_tid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_24is_valid_tid};
jpayne@68 18571 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_25is_valid_tid(PyObject *__pyx_v_self,
jpayne@68 18572 #if CYTHON_METH_FASTCALL
jpayne@68 18573 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 18574 #else
jpayne@68 18575 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 18576 #endif
jpayne@68 18577 ) {
jpayne@68 18578 CYTHON_UNUSED PyObject *__pyx_v_tid = 0;
jpayne@68 18579 #if !CYTHON_METH_FASTCALL
jpayne@68 18580 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 18581 #endif
jpayne@68 18582 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 18583 PyObject* values[1] = {0};
jpayne@68 18584 int __pyx_lineno = 0;
jpayne@68 18585 const char *__pyx_filename = NULL;
jpayne@68 18586 int __pyx_clineno = 0;
jpayne@68 18587 PyObject *__pyx_r = 0;
jpayne@68 18588 __Pyx_RefNannyDeclarations
jpayne@68 18589 __Pyx_RefNannySetupContext("is_valid_tid (wrapper)", 0);
jpayne@68 18590 #if !CYTHON_METH_FASTCALL
jpayne@68 18591 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 18592 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 18593 #else
jpayne@68 18594 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 18595 #endif
jpayne@68 18596 #endif
jpayne@68 18597 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 18598 {
jpayne@68 18599 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tid,0};
jpayne@68 18600 if (__pyx_kwds) {
jpayne@68 18601 Py_ssize_t kw_args;
jpayne@68 18602 switch (__pyx_nargs) {
jpayne@68 18603 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 18604 CYTHON_FALLTHROUGH;
jpayne@68 18605 case 0: break;
jpayne@68 18606 default: goto __pyx_L5_argtuple_error;
jpayne@68 18607 }
jpayne@68 18608 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 18609 switch (__pyx_nargs) {
jpayne@68 18610 case 0:
jpayne@68 18611 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tid)) != 0)) {
jpayne@68 18612 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 18613 kw_args--;
jpayne@68 18614 }
jpayne@68 18615 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error)
jpayne@68 18616 else goto __pyx_L5_argtuple_error;
jpayne@68 18617 }
jpayne@68 18618 if (unlikely(kw_args > 0)) {
jpayne@68 18619 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 18620 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_valid_tid") < 0)) __PYX_ERR(0, 700, __pyx_L3_error)
jpayne@68 18621 }
jpayne@68 18622 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 18623 goto __pyx_L5_argtuple_error;
jpayne@68 18624 } else {
jpayne@68 18625 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 18626 }
jpayne@68 18627 __pyx_v_tid = values[0];
jpayne@68 18628 }
jpayne@68 18629 goto __pyx_L6_skip;
jpayne@68 18630 __pyx_L5_argtuple_error:;
jpayne@68 18631 __Pyx_RaiseArgtupleInvalid("is_valid_tid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 700, __pyx_L3_error)
jpayne@68 18632 __pyx_L6_skip:;
jpayne@68 18633 goto __pyx_L4_argument_unpacking_done;
jpayne@68 18634 __pyx_L3_error:;
jpayne@68 18635 {
jpayne@68 18636 Py_ssize_t __pyx_temp;
jpayne@68 18637 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 18638 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 18639 }
jpayne@68 18640 }
jpayne@68 18641 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_valid_tid", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 18642 __Pyx_RefNannyFinishContext();
jpayne@68 18643 return NULL;
jpayne@68 18644 __pyx_L4_argument_unpacking_done:;
jpayne@68 18645 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_24is_valid_tid(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_tid);
jpayne@68 18646
jpayne@68 18647 /* function exit code */
jpayne@68 18648 {
jpayne@68 18649 Py_ssize_t __pyx_temp;
jpayne@68 18650 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 18651 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 18652 }
jpayne@68 18653 }
jpayne@68 18654 __Pyx_RefNannyFinishContext();
jpayne@68 18655 return __pyx_r;
jpayne@68 18656 }
jpayne@68 18657
jpayne@68 18658 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_24is_valid_tid(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_tid) {
jpayne@68 18659 PyObject *__pyx_r = NULL;
jpayne@68 18660 __Pyx_TraceDeclarations
jpayne@68 18661 __Pyx_RefNannyDeclarations
jpayne@68 18662 PyObject *__pyx_t_1 = NULL;
jpayne@68 18663 int __pyx_lineno = 0;
jpayne@68 18664 const char *__pyx_filename = NULL;
jpayne@68 18665 int __pyx_clineno = 0;
jpayne@68 18666 __Pyx_TraceFrameInit(__pyx_codeobj__60)
jpayne@68 18667 __Pyx_RefNannySetupContext("is_valid_tid", 1);
jpayne@68 18668 __Pyx_TraceCall("is_valid_tid", __pyx_f[0], 700, 0, __PYX_ERR(0, 700, __pyx_L1_error));
jpayne@68 18669
jpayne@68 18670 /* "pysam/libchtslib.pyx":706
jpayne@68 18671 * returns -1 if contig is not known.
jpayne@68 18672 * """
jpayne@68 18673 * raise NotImplementedError() # <<<<<<<<<<<<<<
jpayne@68 18674 *
jpayne@68 18675 * def is_valid_reference_name(self, contig):
jpayne@68 18676 */
jpayne@68 18677 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
jpayne@68 18678 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 18679 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 18680 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 18681 __PYX_ERR(0, 706, __pyx_L1_error)
jpayne@68 18682
jpayne@68 18683 /* "pysam/libchtslib.pyx":700
jpayne@68 18684 * return 1, rtid, rstart, rstop
jpayne@68 18685 *
jpayne@68 18686 * def is_valid_tid(self, tid): # <<<<<<<<<<<<<<
jpayne@68 18687 * """
jpayne@68 18688 * return True if the numerical :term:`tid` is valid; False otherwise.
jpayne@68 18689 */
jpayne@68 18690
jpayne@68 18691 /* function exit code */
jpayne@68 18692 __pyx_L1_error:;
jpayne@68 18693 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 18694 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_valid_tid", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 18695 __pyx_r = NULL;
jpayne@68 18696 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 18697 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 18698 __Pyx_RefNannyFinishContext();
jpayne@68 18699 return __pyx_r;
jpayne@68 18700 }
jpayne@68 18701
jpayne@68 18702 /* "pysam/libchtslib.pyx":708
jpayne@68 18703 * raise NotImplementedError()
jpayne@68 18704 *
jpayne@68 18705 * def is_valid_reference_name(self, contig): # <<<<<<<<<<<<<<
jpayne@68 18706 * """
jpayne@68 18707 * return True if the contig name :term:`contig` is valid; False otherwise.
jpayne@68 18708 */
jpayne@68 18709
jpayne@68 18710 /* Python wrapper */
jpayne@68 18711 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_27is_valid_reference_name(PyObject *__pyx_v_self,
jpayne@68 18712 #if CYTHON_METH_FASTCALL
jpayne@68 18713 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 18714 #else
jpayne@68 18715 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 18716 #endif
jpayne@68 18717 ); /*proto*/
jpayne@68 18718 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_26is_valid_reference_name, "HTSFile.is_valid_reference_name(self, contig)\n\n return True if the contig name :term:`contig` is valid; False otherwise.\n ");
jpayne@68 18719 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_27is_valid_reference_name = {"is_valid_reference_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_27is_valid_reference_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_26is_valid_reference_name};
jpayne@68 18720 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_27is_valid_reference_name(PyObject *__pyx_v_self,
jpayne@68 18721 #if CYTHON_METH_FASTCALL
jpayne@68 18722 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 18723 #else
jpayne@68 18724 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 18725 #endif
jpayne@68 18726 ) {
jpayne@68 18727 PyObject *__pyx_v_contig = 0;
jpayne@68 18728 #if !CYTHON_METH_FASTCALL
jpayne@68 18729 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 18730 #endif
jpayne@68 18731 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 18732 PyObject* values[1] = {0};
jpayne@68 18733 int __pyx_lineno = 0;
jpayne@68 18734 const char *__pyx_filename = NULL;
jpayne@68 18735 int __pyx_clineno = 0;
jpayne@68 18736 PyObject *__pyx_r = 0;
jpayne@68 18737 __Pyx_RefNannyDeclarations
jpayne@68 18738 __Pyx_RefNannySetupContext("is_valid_reference_name (wrapper)", 0);
jpayne@68 18739 #if !CYTHON_METH_FASTCALL
jpayne@68 18740 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 18741 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 18742 #else
jpayne@68 18743 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 18744 #endif
jpayne@68 18745 #endif
jpayne@68 18746 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 18747 {
jpayne@68 18748 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_contig,0};
jpayne@68 18749 if (__pyx_kwds) {
jpayne@68 18750 Py_ssize_t kw_args;
jpayne@68 18751 switch (__pyx_nargs) {
jpayne@68 18752 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 18753 CYTHON_FALLTHROUGH;
jpayne@68 18754 case 0: break;
jpayne@68 18755 default: goto __pyx_L5_argtuple_error;
jpayne@68 18756 }
jpayne@68 18757 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 18758 switch (__pyx_nargs) {
jpayne@68 18759 case 0:
jpayne@68 18760 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_contig)) != 0)) {
jpayne@68 18761 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 18762 kw_args--;
jpayne@68 18763 }
jpayne@68 18764 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error)
jpayne@68 18765 else goto __pyx_L5_argtuple_error;
jpayne@68 18766 }
jpayne@68 18767 if (unlikely(kw_args > 0)) {
jpayne@68 18768 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 18769 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_valid_reference_name") < 0)) __PYX_ERR(0, 708, __pyx_L3_error)
jpayne@68 18770 }
jpayne@68 18771 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 18772 goto __pyx_L5_argtuple_error;
jpayne@68 18773 } else {
jpayne@68 18774 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 18775 }
jpayne@68 18776 __pyx_v_contig = values[0];
jpayne@68 18777 }
jpayne@68 18778 goto __pyx_L6_skip;
jpayne@68 18779 __pyx_L5_argtuple_error:;
jpayne@68 18780 __Pyx_RaiseArgtupleInvalid("is_valid_reference_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 708, __pyx_L3_error)
jpayne@68 18781 __pyx_L6_skip:;
jpayne@68 18782 goto __pyx_L4_argument_unpacking_done;
jpayne@68 18783 __pyx_L3_error:;
jpayne@68 18784 {
jpayne@68 18785 Py_ssize_t __pyx_temp;
jpayne@68 18786 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 18787 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 18788 }
jpayne@68 18789 }
jpayne@68 18790 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_valid_reference_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 18791 __Pyx_RefNannyFinishContext();
jpayne@68 18792 return NULL;
jpayne@68 18793 __pyx_L4_argument_unpacking_done:;
jpayne@68 18794 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_26is_valid_reference_name(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_contig);
jpayne@68 18795
jpayne@68 18796 /* function exit code */
jpayne@68 18797 {
jpayne@68 18798 Py_ssize_t __pyx_temp;
jpayne@68 18799 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 18800 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 18801 }
jpayne@68 18802 }
jpayne@68 18803 __Pyx_RefNannyFinishContext();
jpayne@68 18804 return __pyx_r;
jpayne@68 18805 }
jpayne@68 18806
jpayne@68 18807 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_26is_valid_reference_name(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, PyObject *__pyx_v_contig) {
jpayne@68 18808 PyObject *__pyx_r = NULL;
jpayne@68 18809 __Pyx_TraceDeclarations
jpayne@68 18810 __Pyx_RefNannyDeclarations
jpayne@68 18811 PyObject *__pyx_t_1 = NULL;
jpayne@68 18812 PyObject *__pyx_t_2 = NULL;
jpayne@68 18813 PyObject *__pyx_t_3 = NULL;
jpayne@68 18814 unsigned int __pyx_t_4;
jpayne@68 18815 int __pyx_lineno = 0;
jpayne@68 18816 const char *__pyx_filename = NULL;
jpayne@68 18817 int __pyx_clineno = 0;
jpayne@68 18818 __Pyx_TraceFrameInit(__pyx_codeobj__61)
jpayne@68 18819 __Pyx_RefNannySetupContext("is_valid_reference_name", 1);
jpayne@68 18820 __Pyx_TraceCall("is_valid_reference_name", __pyx_f[0], 708, 0, __PYX_ERR(0, 708, __pyx_L1_error));
jpayne@68 18821
jpayne@68 18822 /* "pysam/libchtslib.pyx":712
jpayne@68 18823 * return True if the contig name :term:`contig` is valid; False otherwise.
jpayne@68 18824 * """
jpayne@68 18825 * return self.get_tid(contig) != -1 # <<<<<<<<<<<<<<
jpayne@68 18826 *
jpayne@68 18827 * def get_tid(self, contig):
jpayne@68 18828 */
jpayne@68 18829 __Pyx_XDECREF(__pyx_r);
jpayne@68 18830 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_tid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
jpayne@68 18831 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18832 __pyx_t_3 = NULL;
jpayne@68 18833 __pyx_t_4 = 0;
jpayne@68 18834 #if CYTHON_UNPACK_METHODS
jpayne@68 18835 if (likely(PyMethod_Check(__pyx_t_2))) {
jpayne@68 18836 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
jpayne@68 18837 if (likely(__pyx_t_3)) {
jpayne@68 18838 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
jpayne@68 18839 __Pyx_INCREF(__pyx_t_3);
jpayne@68 18840 __Pyx_INCREF(function);
jpayne@68 18841 __Pyx_DECREF_SET(__pyx_t_2, function);
jpayne@68 18842 __pyx_t_4 = 1;
jpayne@68 18843 }
jpayne@68 18844 }
jpayne@68 18845 #endif
jpayne@68 18846 {
jpayne@68 18847 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_contig};
jpayne@68 18848 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
jpayne@68 18849 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 18850 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
jpayne@68 18851 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 18852 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 18853 }
jpayne@68 18854 __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
jpayne@68 18855 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 18856 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 18857 __pyx_r = __pyx_t_2;
jpayne@68 18858 __pyx_t_2 = 0;
jpayne@68 18859 goto __pyx_L0;
jpayne@68 18860
jpayne@68 18861 /* "pysam/libchtslib.pyx":708
jpayne@68 18862 * raise NotImplementedError()
jpayne@68 18863 *
jpayne@68 18864 * def is_valid_reference_name(self, contig): # <<<<<<<<<<<<<<
jpayne@68 18865 * """
jpayne@68 18866 * return True if the contig name :term:`contig` is valid; False otherwise.
jpayne@68 18867 */
jpayne@68 18868
jpayne@68 18869 /* function exit code */
jpayne@68 18870 __pyx_L1_error:;
jpayne@68 18871 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 18872 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 18873 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 18874 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_valid_reference_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 18875 __pyx_r = NULL;
jpayne@68 18876 __pyx_L0:;
jpayne@68 18877 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 18878 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 18879 __Pyx_RefNannyFinishContext();
jpayne@68 18880 return __pyx_r;
jpayne@68 18881 }
jpayne@68 18882
jpayne@68 18883 /* "pysam/libchtslib.pyx":714
jpayne@68 18884 * return self.get_tid(contig) != -1
jpayne@68 18885 *
jpayne@68 18886 * def get_tid(self, contig): # <<<<<<<<<<<<<<
jpayne@68 18887 * """
jpayne@68 18888 * return the numerical :term:`tid` corresponding to
jpayne@68 18889 */
jpayne@68 18890
jpayne@68 18891 /* Python wrapper */
jpayne@68 18892 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_29get_tid(PyObject *__pyx_v_self,
jpayne@68 18893 #if CYTHON_METH_FASTCALL
jpayne@68 18894 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 18895 #else
jpayne@68 18896 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 18897 #endif
jpayne@68 18898 ); /*proto*/
jpayne@68 18899 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_28get_tid, "HTSFile.get_tid(self, contig)\n\n return the numerical :term:`tid` corresponding to\n :term:`contig`\n\n returns -1 if contig is not known.\n ");
jpayne@68 18900 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_29get_tid = {"get_tid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_29get_tid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_28get_tid};
jpayne@68 18901 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_29get_tid(PyObject *__pyx_v_self,
jpayne@68 18902 #if CYTHON_METH_FASTCALL
jpayne@68 18903 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 18904 #else
jpayne@68 18905 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 18906 #endif
jpayne@68 18907 ) {
jpayne@68 18908 CYTHON_UNUSED PyObject *__pyx_v_contig = 0;
jpayne@68 18909 #if !CYTHON_METH_FASTCALL
jpayne@68 18910 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 18911 #endif
jpayne@68 18912 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 18913 PyObject* values[1] = {0};
jpayne@68 18914 int __pyx_lineno = 0;
jpayne@68 18915 const char *__pyx_filename = NULL;
jpayne@68 18916 int __pyx_clineno = 0;
jpayne@68 18917 PyObject *__pyx_r = 0;
jpayne@68 18918 __Pyx_RefNannyDeclarations
jpayne@68 18919 __Pyx_RefNannySetupContext("get_tid (wrapper)", 0);
jpayne@68 18920 #if !CYTHON_METH_FASTCALL
jpayne@68 18921 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 18922 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 18923 #else
jpayne@68 18924 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 18925 #endif
jpayne@68 18926 #endif
jpayne@68 18927 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 18928 {
jpayne@68 18929 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_contig,0};
jpayne@68 18930 if (__pyx_kwds) {
jpayne@68 18931 Py_ssize_t kw_args;
jpayne@68 18932 switch (__pyx_nargs) {
jpayne@68 18933 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 18934 CYTHON_FALLTHROUGH;
jpayne@68 18935 case 0: break;
jpayne@68 18936 default: goto __pyx_L5_argtuple_error;
jpayne@68 18937 }
jpayne@68 18938 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 18939 switch (__pyx_nargs) {
jpayne@68 18940 case 0:
jpayne@68 18941 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_contig)) != 0)) {
jpayne@68 18942 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 18943 kw_args--;
jpayne@68 18944 }
jpayne@68 18945 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L3_error)
jpayne@68 18946 else goto __pyx_L5_argtuple_error;
jpayne@68 18947 }
jpayne@68 18948 if (unlikely(kw_args > 0)) {
jpayne@68 18949 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 18950 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_tid") < 0)) __PYX_ERR(0, 714, __pyx_L3_error)
jpayne@68 18951 }
jpayne@68 18952 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 18953 goto __pyx_L5_argtuple_error;
jpayne@68 18954 } else {
jpayne@68 18955 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 18956 }
jpayne@68 18957 __pyx_v_contig = values[0];
jpayne@68 18958 }
jpayne@68 18959 goto __pyx_L6_skip;
jpayne@68 18960 __pyx_L5_argtuple_error:;
jpayne@68 18961 __Pyx_RaiseArgtupleInvalid("get_tid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 714, __pyx_L3_error)
jpayne@68 18962 __pyx_L6_skip:;
jpayne@68 18963 goto __pyx_L4_argument_unpacking_done;
jpayne@68 18964 __pyx_L3_error:;
jpayne@68 18965 {
jpayne@68 18966 Py_ssize_t __pyx_temp;
jpayne@68 18967 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 18968 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 18969 }
jpayne@68 18970 }
jpayne@68 18971 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.get_tid", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 18972 __Pyx_RefNannyFinishContext();
jpayne@68 18973 return NULL;
jpayne@68 18974 __pyx_L4_argument_unpacking_done:;
jpayne@68 18975 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_28get_tid(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_contig);
jpayne@68 18976
jpayne@68 18977 /* function exit code */
jpayne@68 18978 {
jpayne@68 18979 Py_ssize_t __pyx_temp;
jpayne@68 18980 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 18981 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 18982 }
jpayne@68 18983 }
jpayne@68 18984 __Pyx_RefNannyFinishContext();
jpayne@68 18985 return __pyx_r;
jpayne@68 18986 }
jpayne@68 18987
jpayne@68 18988 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_28get_tid(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_contig) {
jpayne@68 18989 PyObject *__pyx_r = NULL;
jpayne@68 18990 __Pyx_TraceDeclarations
jpayne@68 18991 __Pyx_RefNannyDeclarations
jpayne@68 18992 PyObject *__pyx_t_1 = NULL;
jpayne@68 18993 int __pyx_lineno = 0;
jpayne@68 18994 const char *__pyx_filename = NULL;
jpayne@68 18995 int __pyx_clineno = 0;
jpayne@68 18996 __Pyx_TraceFrameInit(__pyx_codeobj__62)
jpayne@68 18997 __Pyx_RefNannySetupContext("get_tid", 1);
jpayne@68 18998 __Pyx_TraceCall("get_tid", __pyx_f[0], 714, 0, __PYX_ERR(0, 714, __pyx_L1_error));
jpayne@68 18999
jpayne@68 19000 /* "pysam/libchtslib.pyx":721
jpayne@68 19001 * returns -1 if contig is not known.
jpayne@68 19002 * """
jpayne@68 19003 * raise NotImplementedError() # <<<<<<<<<<<<<<
jpayne@68 19004 *
jpayne@68 19005 * def get_reference_name(self, tid):
jpayne@68 19006 */
jpayne@68 19007 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
jpayne@68 19008 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 19009 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 19010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 19011 __PYX_ERR(0, 721, __pyx_L1_error)
jpayne@68 19012
jpayne@68 19013 /* "pysam/libchtslib.pyx":714
jpayne@68 19014 * return self.get_tid(contig) != -1
jpayne@68 19015 *
jpayne@68 19016 * def get_tid(self, contig): # <<<<<<<<<<<<<<
jpayne@68 19017 * """
jpayne@68 19018 * return the numerical :term:`tid` corresponding to
jpayne@68 19019 */
jpayne@68 19020
jpayne@68 19021 /* function exit code */
jpayne@68 19022 __pyx_L1_error:;
jpayne@68 19023 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 19024 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.get_tid", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19025 __pyx_r = NULL;
jpayne@68 19026 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19027 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19028 __Pyx_RefNannyFinishContext();
jpayne@68 19029 return __pyx_r;
jpayne@68 19030 }
jpayne@68 19031
jpayne@68 19032 /* "pysam/libchtslib.pyx":723
jpayne@68 19033 * raise NotImplementedError()
jpayne@68 19034 *
jpayne@68 19035 * def get_reference_name(self, tid): # <<<<<<<<<<<<<<
jpayne@68 19036 * """
jpayne@68 19037 * return :term:`contig` name corresponding to numerical :term:`tid`
jpayne@68 19038 */
jpayne@68 19039
jpayne@68 19040 /* Python wrapper */
jpayne@68 19041 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_31get_reference_name(PyObject *__pyx_v_self,
jpayne@68 19042 #if CYTHON_METH_FASTCALL
jpayne@68 19043 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 19044 #else
jpayne@68 19045 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 19046 #endif
jpayne@68 19047 ); /*proto*/
jpayne@68 19048 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_30get_reference_name, "HTSFile.get_reference_name(self, tid)\n\n return :term:`contig` name corresponding to numerical :term:`tid`\n ");
jpayne@68 19049 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_31get_reference_name = {"get_reference_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_31get_reference_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_30get_reference_name};
jpayne@68 19050 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_31get_reference_name(PyObject *__pyx_v_self,
jpayne@68 19051 #if CYTHON_METH_FASTCALL
jpayne@68 19052 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 19053 #else
jpayne@68 19054 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 19055 #endif
jpayne@68 19056 ) {
jpayne@68 19057 CYTHON_UNUSED PyObject *__pyx_v_tid = 0;
jpayne@68 19058 #if !CYTHON_METH_FASTCALL
jpayne@68 19059 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 19060 #endif
jpayne@68 19061 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19062 PyObject* values[1] = {0};
jpayne@68 19063 int __pyx_lineno = 0;
jpayne@68 19064 const char *__pyx_filename = NULL;
jpayne@68 19065 int __pyx_clineno = 0;
jpayne@68 19066 PyObject *__pyx_r = 0;
jpayne@68 19067 __Pyx_RefNannyDeclarations
jpayne@68 19068 __Pyx_RefNannySetupContext("get_reference_name (wrapper)", 0);
jpayne@68 19069 #if !CYTHON_METH_FASTCALL
jpayne@68 19070 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 19071 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 19072 #else
jpayne@68 19073 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 19074 #endif
jpayne@68 19075 #endif
jpayne@68 19076 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 19077 {
jpayne@68 19078 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tid,0};
jpayne@68 19079 if (__pyx_kwds) {
jpayne@68 19080 Py_ssize_t kw_args;
jpayne@68 19081 switch (__pyx_nargs) {
jpayne@68 19082 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 19083 CYTHON_FALLTHROUGH;
jpayne@68 19084 case 0: break;
jpayne@68 19085 default: goto __pyx_L5_argtuple_error;
jpayne@68 19086 }
jpayne@68 19087 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 19088 switch (__pyx_nargs) {
jpayne@68 19089 case 0:
jpayne@68 19090 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tid)) != 0)) {
jpayne@68 19091 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 19092 kw_args--;
jpayne@68 19093 }
jpayne@68 19094 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error)
jpayne@68 19095 else goto __pyx_L5_argtuple_error;
jpayne@68 19096 }
jpayne@68 19097 if (unlikely(kw_args > 0)) {
jpayne@68 19098 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 19099 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_reference_name") < 0)) __PYX_ERR(0, 723, __pyx_L3_error)
jpayne@68 19100 }
jpayne@68 19101 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 19102 goto __pyx_L5_argtuple_error;
jpayne@68 19103 } else {
jpayne@68 19104 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 19105 }
jpayne@68 19106 __pyx_v_tid = values[0];
jpayne@68 19107 }
jpayne@68 19108 goto __pyx_L6_skip;
jpayne@68 19109 __pyx_L5_argtuple_error:;
jpayne@68 19110 __Pyx_RaiseArgtupleInvalid("get_reference_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 723, __pyx_L3_error)
jpayne@68 19111 __pyx_L6_skip:;
jpayne@68 19112 goto __pyx_L4_argument_unpacking_done;
jpayne@68 19113 __pyx_L3_error:;
jpayne@68 19114 {
jpayne@68 19115 Py_ssize_t __pyx_temp;
jpayne@68 19116 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 19117 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 19118 }
jpayne@68 19119 }
jpayne@68 19120 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.get_reference_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19121 __Pyx_RefNannyFinishContext();
jpayne@68 19122 return NULL;
jpayne@68 19123 __pyx_L4_argument_unpacking_done:;
jpayne@68 19124 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_30get_reference_name(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v_tid);
jpayne@68 19125
jpayne@68 19126 /* function exit code */
jpayne@68 19127 {
jpayne@68 19128 Py_ssize_t __pyx_temp;
jpayne@68 19129 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 19130 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 19131 }
jpayne@68 19132 }
jpayne@68 19133 __Pyx_RefNannyFinishContext();
jpayne@68 19134 return __pyx_r;
jpayne@68 19135 }
jpayne@68 19136
jpayne@68 19137 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_30get_reference_name(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_tid) {
jpayne@68 19138 PyObject *__pyx_r = NULL;
jpayne@68 19139 __Pyx_TraceDeclarations
jpayne@68 19140 __Pyx_RefNannyDeclarations
jpayne@68 19141 PyObject *__pyx_t_1 = NULL;
jpayne@68 19142 int __pyx_lineno = 0;
jpayne@68 19143 const char *__pyx_filename = NULL;
jpayne@68 19144 int __pyx_clineno = 0;
jpayne@68 19145 __Pyx_TraceFrameInit(__pyx_codeobj__63)
jpayne@68 19146 __Pyx_RefNannySetupContext("get_reference_name", 1);
jpayne@68 19147 __Pyx_TraceCall("get_reference_name", __pyx_f[0], 723, 0, __PYX_ERR(0, 723, __pyx_L1_error));
jpayne@68 19148
jpayne@68 19149 /* "pysam/libchtslib.pyx":727
jpayne@68 19150 * return :term:`contig` name corresponding to numerical :term:`tid`
jpayne@68 19151 * """
jpayne@68 19152 * raise NotImplementedError() # <<<<<<<<<<<<<<
jpayne@68 19153 */
jpayne@68 19154 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error)
jpayne@68 19155 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 19156 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
jpayne@68 19157 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 19158 __PYX_ERR(0, 727, __pyx_L1_error)
jpayne@68 19159
jpayne@68 19160 /* "pysam/libchtslib.pyx":723
jpayne@68 19161 * raise NotImplementedError()
jpayne@68 19162 *
jpayne@68 19163 * def get_reference_name(self, tid): # <<<<<<<<<<<<<<
jpayne@68 19164 * """
jpayne@68 19165 * return :term:`contig` name corresponding to numerical :term:`tid`
jpayne@68 19166 */
jpayne@68 19167
jpayne@68 19168 /* function exit code */
jpayne@68 19169 __pyx_L1_error:;
jpayne@68 19170 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 19171 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.get_reference_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19172 __pyx_r = NULL;
jpayne@68 19173 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19174 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19175 __Pyx_RefNannyFinishContext();
jpayne@68 19176 return __pyx_r;
jpayne@68 19177 }
jpayne@68 19178
jpayne@68 19179 /* "pysam/libchtslib.pxd":2710
jpayne@68 19180 * cdef int64_t start_offset # BGZF offset of first record
jpayne@68 19181 *
jpayne@68 19182 * cdef readonly object filename # filename as supplied by user # <<<<<<<<<<<<<<
jpayne@68 19183 * cdef readonly object mode # file opening mode
jpayne@68 19184 * cdef readonly object threads # number of threads to use
jpayne@68 19185 */
jpayne@68 19186
jpayne@68 19187 /* Python wrapper */
jpayne@68 19188 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_8filename_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 19189 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_8filename_1__get__(PyObject *__pyx_v_self) {
jpayne@68 19190 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19191 PyObject *__pyx_r = 0;
jpayne@68 19192 __Pyx_RefNannyDeclarations
jpayne@68 19193 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 19194 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 19195 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_8filename___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 19196
jpayne@68 19197 /* function exit code */
jpayne@68 19198 __Pyx_RefNannyFinishContext();
jpayne@68 19199 return __pyx_r;
jpayne@68 19200 }
jpayne@68 19201
jpayne@68 19202 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_8filename___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 19203 PyObject *__pyx_r = NULL;
jpayne@68 19204 __Pyx_TraceDeclarations
jpayne@68 19205 __Pyx_RefNannyDeclarations
jpayne@68 19206 int __pyx_lineno = 0;
jpayne@68 19207 const char *__pyx_filename = NULL;
jpayne@68 19208 int __pyx_clineno = 0;
jpayne@68 19209 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 19210 __Pyx_TraceCall("__get__", __pyx_f[4], 2710, 0, __PYX_ERR(4, 2710, __pyx_L1_error));
jpayne@68 19211 __Pyx_XDECREF(__pyx_r);
jpayne@68 19212 __Pyx_INCREF(__pyx_v_self->filename);
jpayne@68 19213 __pyx_r = __pyx_v_self->filename;
jpayne@68 19214 goto __pyx_L0;
jpayne@68 19215
jpayne@68 19216 /* function exit code */
jpayne@68 19217 __pyx_L1_error:;
jpayne@68 19218 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19219 __pyx_r = NULL;
jpayne@68 19220 __pyx_L0:;
jpayne@68 19221 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19222 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19223 __Pyx_RefNannyFinishContext();
jpayne@68 19224 return __pyx_r;
jpayne@68 19225 }
jpayne@68 19226
jpayne@68 19227 /* "pysam/libchtslib.pxd":2711
jpayne@68 19228 *
jpayne@68 19229 * cdef readonly object filename # filename as supplied by user
jpayne@68 19230 * cdef readonly object mode # file opening mode # <<<<<<<<<<<<<<
jpayne@68 19231 * cdef readonly object threads # number of threads to use
jpayne@68 19232 * cdef readonly object index_filename # filename of index, if supplied by user
jpayne@68 19233 */
jpayne@68 19234
jpayne@68 19235 /* Python wrapper */
jpayne@68 19236 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 19237 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_4mode_1__get__(PyObject *__pyx_v_self) {
jpayne@68 19238 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19239 PyObject *__pyx_r = 0;
jpayne@68 19240 __Pyx_RefNannyDeclarations
jpayne@68 19241 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 19242 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 19243 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_4mode___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 19244
jpayne@68 19245 /* function exit code */
jpayne@68 19246 __Pyx_RefNannyFinishContext();
jpayne@68 19247 return __pyx_r;
jpayne@68 19248 }
jpayne@68 19249
jpayne@68 19250 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_4mode___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 19251 PyObject *__pyx_r = NULL;
jpayne@68 19252 __Pyx_TraceDeclarations
jpayne@68 19253 __Pyx_RefNannyDeclarations
jpayne@68 19254 int __pyx_lineno = 0;
jpayne@68 19255 const char *__pyx_filename = NULL;
jpayne@68 19256 int __pyx_clineno = 0;
jpayne@68 19257 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 19258 __Pyx_TraceCall("__get__", __pyx_f[4], 2711, 0, __PYX_ERR(4, 2711, __pyx_L1_error));
jpayne@68 19259 __Pyx_XDECREF(__pyx_r);
jpayne@68 19260 __Pyx_INCREF(__pyx_v_self->mode);
jpayne@68 19261 __pyx_r = __pyx_v_self->mode;
jpayne@68 19262 goto __pyx_L0;
jpayne@68 19263
jpayne@68 19264 /* function exit code */
jpayne@68 19265 __pyx_L1_error:;
jpayne@68 19266 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19267 __pyx_r = NULL;
jpayne@68 19268 __pyx_L0:;
jpayne@68 19269 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19270 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19271 __Pyx_RefNannyFinishContext();
jpayne@68 19272 return __pyx_r;
jpayne@68 19273 }
jpayne@68 19274
jpayne@68 19275 /* "pysam/libchtslib.pxd":2712
jpayne@68 19276 * cdef readonly object filename # filename as supplied by user
jpayne@68 19277 * cdef readonly object mode # file opening mode
jpayne@68 19278 * cdef readonly object threads # number of threads to use # <<<<<<<<<<<<<<
jpayne@68 19279 * cdef readonly object index_filename # filename of index, if supplied by user
jpayne@68 19280 *
jpayne@68 19281 */
jpayne@68 19282
jpayne@68 19283 /* Python wrapper */
jpayne@68 19284 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7threads_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 19285 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_7threads_1__get__(PyObject *__pyx_v_self) {
jpayne@68 19286 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19287 PyObject *__pyx_r = 0;
jpayne@68 19288 __Pyx_RefNannyDeclarations
jpayne@68 19289 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 19290 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 19291 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_7threads___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 19292
jpayne@68 19293 /* function exit code */
jpayne@68 19294 __Pyx_RefNannyFinishContext();
jpayne@68 19295 return __pyx_r;
jpayne@68 19296 }
jpayne@68 19297
jpayne@68 19298 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_7threads___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 19299 PyObject *__pyx_r = NULL;
jpayne@68 19300 __Pyx_TraceDeclarations
jpayne@68 19301 __Pyx_RefNannyDeclarations
jpayne@68 19302 int __pyx_lineno = 0;
jpayne@68 19303 const char *__pyx_filename = NULL;
jpayne@68 19304 int __pyx_clineno = 0;
jpayne@68 19305 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 19306 __Pyx_TraceCall("__get__", __pyx_f[4], 2712, 0, __PYX_ERR(4, 2712, __pyx_L1_error));
jpayne@68 19307 __Pyx_XDECREF(__pyx_r);
jpayne@68 19308 __Pyx_INCREF(__pyx_v_self->threads);
jpayne@68 19309 __pyx_r = __pyx_v_self->threads;
jpayne@68 19310 goto __pyx_L0;
jpayne@68 19311
jpayne@68 19312 /* function exit code */
jpayne@68 19313 __pyx_L1_error:;
jpayne@68 19314 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.threads.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19315 __pyx_r = NULL;
jpayne@68 19316 __pyx_L0:;
jpayne@68 19317 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19318 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19319 __Pyx_RefNannyFinishContext();
jpayne@68 19320 return __pyx_r;
jpayne@68 19321 }
jpayne@68 19322
jpayne@68 19323 /* "pysam/libchtslib.pxd":2713
jpayne@68 19324 * cdef readonly object mode # file opening mode
jpayne@68 19325 * cdef readonly object threads # number of threads to use
jpayne@68 19326 * cdef readonly object index_filename # filename of index, if supplied by user # <<<<<<<<<<<<<<
jpayne@68 19327 *
jpayne@68 19328 * cdef readonly bint is_stream # Is htsfile a non-seekable stream
jpayne@68 19329 */
jpayne@68 19330
jpayne@68 19331 /* Python wrapper */
jpayne@68 19332 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_14index_filename_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 19333 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_14index_filename_1__get__(PyObject *__pyx_v_self) {
jpayne@68 19334 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19335 PyObject *__pyx_r = 0;
jpayne@68 19336 __Pyx_RefNannyDeclarations
jpayne@68 19337 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 19338 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 19339 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_14index_filename___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 19340
jpayne@68 19341 /* function exit code */
jpayne@68 19342 __Pyx_RefNannyFinishContext();
jpayne@68 19343 return __pyx_r;
jpayne@68 19344 }
jpayne@68 19345
jpayne@68 19346 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_14index_filename___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 19347 PyObject *__pyx_r = NULL;
jpayne@68 19348 __Pyx_TraceDeclarations
jpayne@68 19349 __Pyx_RefNannyDeclarations
jpayne@68 19350 int __pyx_lineno = 0;
jpayne@68 19351 const char *__pyx_filename = NULL;
jpayne@68 19352 int __pyx_clineno = 0;
jpayne@68 19353 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 19354 __Pyx_TraceCall("__get__", __pyx_f[4], 2713, 0, __PYX_ERR(4, 2713, __pyx_L1_error));
jpayne@68 19355 __Pyx_XDECREF(__pyx_r);
jpayne@68 19356 __Pyx_INCREF(__pyx_v_self->index_filename);
jpayne@68 19357 __pyx_r = __pyx_v_self->index_filename;
jpayne@68 19358 goto __pyx_L0;
jpayne@68 19359
jpayne@68 19360 /* function exit code */
jpayne@68 19361 __pyx_L1_error:;
jpayne@68 19362 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.index_filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19363 __pyx_r = NULL;
jpayne@68 19364 __pyx_L0:;
jpayne@68 19365 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19366 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19367 __Pyx_RefNannyFinishContext();
jpayne@68 19368 return __pyx_r;
jpayne@68 19369 }
jpayne@68 19370
jpayne@68 19371 /* "pysam/libchtslib.pxd":2715
jpayne@68 19372 * cdef readonly object index_filename # filename of index, if supplied by user
jpayne@68 19373 *
jpayne@68 19374 * cdef readonly bint is_stream # Is htsfile a non-seekable stream # <<<<<<<<<<<<<<
jpayne@68 19375 * cdef readonly bint is_remote # Is htsfile a remote stream
jpayne@68 19376 * cdef readonly bint duplicate_filehandle # Duplicate filehandle when opening via fh
jpayne@68 19377 */
jpayne@68 19378
jpayne@68 19379 /* Python wrapper */
jpayne@68 19380 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_9is_stream_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 19381 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_9is_stream_1__get__(PyObject *__pyx_v_self) {
jpayne@68 19382 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19383 PyObject *__pyx_r = 0;
jpayne@68 19384 __Pyx_RefNannyDeclarations
jpayne@68 19385 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 19386 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 19387 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_9is_stream___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 19388
jpayne@68 19389 /* function exit code */
jpayne@68 19390 __Pyx_RefNannyFinishContext();
jpayne@68 19391 return __pyx_r;
jpayne@68 19392 }
jpayne@68 19393
jpayne@68 19394 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_9is_stream___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 19395 PyObject *__pyx_r = NULL;
jpayne@68 19396 __Pyx_TraceDeclarations
jpayne@68 19397 __Pyx_RefNannyDeclarations
jpayne@68 19398 PyObject *__pyx_t_1 = NULL;
jpayne@68 19399 int __pyx_lineno = 0;
jpayne@68 19400 const char *__pyx_filename = NULL;
jpayne@68 19401 int __pyx_clineno = 0;
jpayne@68 19402 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 19403 __Pyx_TraceCall("__get__", __pyx_f[4], 2715, 0, __PYX_ERR(4, 2715, __pyx_L1_error));
jpayne@68 19404 __Pyx_XDECREF(__pyx_r);
jpayne@68 19405 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_stream); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2715, __pyx_L1_error)
jpayne@68 19406 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 19407 __pyx_r = __pyx_t_1;
jpayne@68 19408 __pyx_t_1 = 0;
jpayne@68 19409 goto __pyx_L0;
jpayne@68 19410
jpayne@68 19411 /* function exit code */
jpayne@68 19412 __pyx_L1_error:;
jpayne@68 19413 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 19414 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_stream.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19415 __pyx_r = NULL;
jpayne@68 19416 __pyx_L0:;
jpayne@68 19417 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19418 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19419 __Pyx_RefNannyFinishContext();
jpayne@68 19420 return __pyx_r;
jpayne@68 19421 }
jpayne@68 19422
jpayne@68 19423 /* "pysam/libchtslib.pxd":2716
jpayne@68 19424 *
jpayne@68 19425 * cdef readonly bint is_stream # Is htsfile a non-seekable stream
jpayne@68 19426 * cdef readonly bint is_remote # Is htsfile a remote stream # <<<<<<<<<<<<<<
jpayne@68 19427 * cdef readonly bint duplicate_filehandle # Duplicate filehandle when opening via fh
jpayne@68 19428 *
jpayne@68 19429 */
jpayne@68 19430
jpayne@68 19431 /* Python wrapper */
jpayne@68 19432 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_9is_remote_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 19433 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_9is_remote_1__get__(PyObject *__pyx_v_self) {
jpayne@68 19434 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19435 PyObject *__pyx_r = 0;
jpayne@68 19436 __Pyx_RefNannyDeclarations
jpayne@68 19437 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 19438 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 19439 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_9is_remote___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 19440
jpayne@68 19441 /* function exit code */
jpayne@68 19442 __Pyx_RefNannyFinishContext();
jpayne@68 19443 return __pyx_r;
jpayne@68 19444 }
jpayne@68 19445
jpayne@68 19446 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_9is_remote___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 19447 PyObject *__pyx_r = NULL;
jpayne@68 19448 __Pyx_TraceDeclarations
jpayne@68 19449 __Pyx_RefNannyDeclarations
jpayne@68 19450 PyObject *__pyx_t_1 = NULL;
jpayne@68 19451 int __pyx_lineno = 0;
jpayne@68 19452 const char *__pyx_filename = NULL;
jpayne@68 19453 int __pyx_clineno = 0;
jpayne@68 19454 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 19455 __Pyx_TraceCall("__get__", __pyx_f[4], 2716, 0, __PYX_ERR(4, 2716, __pyx_L1_error));
jpayne@68 19456 __Pyx_XDECREF(__pyx_r);
jpayne@68 19457 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_remote); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2716, __pyx_L1_error)
jpayne@68 19458 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 19459 __pyx_r = __pyx_t_1;
jpayne@68 19460 __pyx_t_1 = 0;
jpayne@68 19461 goto __pyx_L0;
jpayne@68 19462
jpayne@68 19463 /* function exit code */
jpayne@68 19464 __pyx_L1_error:;
jpayne@68 19465 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 19466 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.is_remote.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19467 __pyx_r = NULL;
jpayne@68 19468 __pyx_L0:;
jpayne@68 19469 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19470 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19471 __Pyx_RefNannyFinishContext();
jpayne@68 19472 return __pyx_r;
jpayne@68 19473 }
jpayne@68 19474
jpayne@68 19475 /* "pysam/libchtslib.pxd":2717
jpayne@68 19476 * cdef readonly bint is_stream # Is htsfile a non-seekable stream
jpayne@68 19477 * cdef readonly bint is_remote # Is htsfile a remote stream
jpayne@68 19478 * cdef readonly bint duplicate_filehandle # Duplicate filehandle when opening via fh # <<<<<<<<<<<<<<
jpayne@68 19479 *
jpayne@68 19480 * cdef htsFile *_open_htsfile(self) except? NULL
jpayne@68 19481 */
jpayne@68 19482
jpayne@68 19483 /* Python wrapper */
jpayne@68 19484 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_20duplicate_filehandle_1__get__(PyObject *__pyx_v_self); /*proto*/
jpayne@68 19485 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_20duplicate_filehandle_1__get__(PyObject *__pyx_v_self) {
jpayne@68 19486 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19487 PyObject *__pyx_r = 0;
jpayne@68 19488 __Pyx_RefNannyDeclarations
jpayne@68 19489 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
jpayne@68 19490 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
jpayne@68 19491 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_20duplicate_filehandle___get__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 19492
jpayne@68 19493 /* function exit code */
jpayne@68 19494 __Pyx_RefNannyFinishContext();
jpayne@68 19495 return __pyx_r;
jpayne@68 19496 }
jpayne@68 19497
jpayne@68 19498 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_20duplicate_filehandle___get__(struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 19499 PyObject *__pyx_r = NULL;
jpayne@68 19500 __Pyx_TraceDeclarations
jpayne@68 19501 __Pyx_RefNannyDeclarations
jpayne@68 19502 PyObject *__pyx_t_1 = NULL;
jpayne@68 19503 int __pyx_lineno = 0;
jpayne@68 19504 const char *__pyx_filename = NULL;
jpayne@68 19505 int __pyx_clineno = 0;
jpayne@68 19506 __Pyx_RefNannySetupContext("__get__", 1);
jpayne@68 19507 __Pyx_TraceCall("__get__", __pyx_f[4], 2717, 0, __PYX_ERR(4, 2717, __pyx_L1_error));
jpayne@68 19508 __Pyx_XDECREF(__pyx_r);
jpayne@68 19509 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->duplicate_filehandle); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2717, __pyx_L1_error)
jpayne@68 19510 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 19511 __pyx_r = __pyx_t_1;
jpayne@68 19512 __pyx_t_1 = 0;
jpayne@68 19513 goto __pyx_L0;
jpayne@68 19514
jpayne@68 19515 /* function exit code */
jpayne@68 19516 __pyx_L1_error:;
jpayne@68 19517 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 19518 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.duplicate_filehandle.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19519 __pyx_r = NULL;
jpayne@68 19520 __pyx_L0:;
jpayne@68 19521 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19522 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19523 __Pyx_RefNannyFinishContext();
jpayne@68 19524 return __pyx_r;
jpayne@68 19525 }
jpayne@68 19526
jpayne@68 19527 /* "(tree fragment)":1
jpayne@68 19528 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
jpayne@68 19529 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 19530 * def __setstate_cython__(self, __pyx_state):
jpayne@68 19531 */
jpayne@68 19532
jpayne@68 19533 /* Python wrapper */
jpayne@68 19534 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_33__reduce_cython__(PyObject *__pyx_v_self,
jpayne@68 19535 #if CYTHON_METH_FASTCALL
jpayne@68 19536 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 19537 #else
jpayne@68 19538 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 19539 #endif
jpayne@68 19540 ); /*proto*/
jpayne@68 19541 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_32__reduce_cython__, "HTSFile.__reduce_cython__(self)");
jpayne@68 19542 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_32__reduce_cython__};
jpayne@68 19543 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_33__reduce_cython__(PyObject *__pyx_v_self,
jpayne@68 19544 #if CYTHON_METH_FASTCALL
jpayne@68 19545 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 19546 #else
jpayne@68 19547 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 19548 #endif
jpayne@68 19549 ) {
jpayne@68 19550 #if !CYTHON_METH_FASTCALL
jpayne@68 19551 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 19552 #endif
jpayne@68 19553 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19554 PyObject *__pyx_r = 0;
jpayne@68 19555 __Pyx_RefNannyDeclarations
jpayne@68 19556 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
jpayne@68 19557 #if !CYTHON_METH_FASTCALL
jpayne@68 19558 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 19559 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 19560 #else
jpayne@68 19561 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 19562 #endif
jpayne@68 19563 #endif
jpayne@68 19564 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 19565 if (unlikely(__pyx_nargs > 0)) {
jpayne@68 19566 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
jpayne@68 19567 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
jpayne@68 19568 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_32__reduce_cython__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self));
jpayne@68 19569
jpayne@68 19570 /* function exit code */
jpayne@68 19571 __Pyx_RefNannyFinishContext();
jpayne@68 19572 return __pyx_r;
jpayne@68 19573 }
jpayne@68 19574
jpayne@68 19575 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self) {
jpayne@68 19576 PyObject *__pyx_r = NULL;
jpayne@68 19577 __Pyx_TraceDeclarations
jpayne@68 19578 __Pyx_RefNannyDeclarations
jpayne@68 19579 int __pyx_lineno = 0;
jpayne@68 19580 const char *__pyx_filename = NULL;
jpayne@68 19581 int __pyx_clineno = 0;
jpayne@68 19582 __Pyx_TraceFrameInit(__pyx_codeobj__64)
jpayne@68 19583 __Pyx_RefNannySetupContext("__reduce_cython__", 1);
jpayne@68 19584 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
jpayne@68 19585
jpayne@68 19586 /* "(tree fragment)":2
jpayne@68 19587 * def __reduce_cython__(self):
jpayne@68 19588 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
jpayne@68 19589 * def __setstate_cython__(self, __pyx_state):
jpayne@68 19590 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 19591 */
jpayne@68 19592 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
jpayne@68 19593 __PYX_ERR(1, 2, __pyx_L1_error)
jpayne@68 19594
jpayne@68 19595 /* "(tree fragment)":1
jpayne@68 19596 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
jpayne@68 19597 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 19598 * def __setstate_cython__(self, __pyx_state):
jpayne@68 19599 */
jpayne@68 19600
jpayne@68 19601 /* function exit code */
jpayne@68 19602 __pyx_L1_error:;
jpayne@68 19603 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19604 __pyx_r = NULL;
jpayne@68 19605 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19606 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19607 __Pyx_RefNannyFinishContext();
jpayne@68 19608 return __pyx_r;
jpayne@68 19609 }
jpayne@68 19610
jpayne@68 19611 /* "(tree fragment)":3
jpayne@68 19612 * def __reduce_cython__(self):
jpayne@68 19613 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 19614 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
jpayne@68 19615 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 19616 */
jpayne@68 19617
jpayne@68 19618 /* Python wrapper */
jpayne@68 19619 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_35__setstate_cython__(PyObject *__pyx_v_self,
jpayne@68 19620 #if CYTHON_METH_FASTCALL
jpayne@68 19621 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 19622 #else
jpayne@68 19623 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 19624 #endif
jpayne@68 19625 ); /*proto*/
jpayne@68 19626 PyDoc_STRVAR(__pyx_doc_5pysam_10libchtslib_7HTSFile_34__setstate_cython__, "HTSFile.__setstate_cython__(self, __pyx_state)");
jpayne@68 19627 static PyMethodDef __pyx_mdef_5pysam_10libchtslib_7HTSFile_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_34__setstate_cython__};
jpayne@68 19628 static PyObject *__pyx_pw_5pysam_10libchtslib_7HTSFile_35__setstate_cython__(PyObject *__pyx_v_self,
jpayne@68 19629 #if CYTHON_METH_FASTCALL
jpayne@68 19630 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
jpayne@68 19631 #else
jpayne@68 19632 PyObject *__pyx_args, PyObject *__pyx_kwds
jpayne@68 19633 #endif
jpayne@68 19634 ) {
jpayne@68 19635 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
jpayne@68 19636 #if !CYTHON_METH_FASTCALL
jpayne@68 19637 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
jpayne@68 19638 #endif
jpayne@68 19639 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
jpayne@68 19640 PyObject* values[1] = {0};
jpayne@68 19641 int __pyx_lineno = 0;
jpayne@68 19642 const char *__pyx_filename = NULL;
jpayne@68 19643 int __pyx_clineno = 0;
jpayne@68 19644 PyObject *__pyx_r = 0;
jpayne@68 19645 __Pyx_RefNannyDeclarations
jpayne@68 19646 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
jpayne@68 19647 #if !CYTHON_METH_FASTCALL
jpayne@68 19648 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 19649 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
jpayne@68 19650 #else
jpayne@68 19651 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
jpayne@68 19652 #endif
jpayne@68 19653 #endif
jpayne@68 19654 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
jpayne@68 19655 {
jpayne@68 19656 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
jpayne@68 19657 if (__pyx_kwds) {
jpayne@68 19658 Py_ssize_t kw_args;
jpayne@68 19659 switch (__pyx_nargs) {
jpayne@68 19660 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 19661 CYTHON_FALLTHROUGH;
jpayne@68 19662 case 0: break;
jpayne@68 19663 default: goto __pyx_L5_argtuple_error;
jpayne@68 19664 }
jpayne@68 19665 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
jpayne@68 19666 switch (__pyx_nargs) {
jpayne@68 19667 case 0:
jpayne@68 19668 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
jpayne@68 19669 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
jpayne@68 19670 kw_args--;
jpayne@68 19671 }
jpayne@68 19672 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
jpayne@68 19673 else goto __pyx_L5_argtuple_error;
jpayne@68 19674 }
jpayne@68 19675 if (unlikely(kw_args > 0)) {
jpayne@68 19676 const Py_ssize_t kwd_pos_args = __pyx_nargs;
jpayne@68 19677 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
jpayne@68 19678 }
jpayne@68 19679 } else if (unlikely(__pyx_nargs != 1)) {
jpayne@68 19680 goto __pyx_L5_argtuple_error;
jpayne@68 19681 } else {
jpayne@68 19682 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
jpayne@68 19683 }
jpayne@68 19684 __pyx_v___pyx_state = values[0];
jpayne@68 19685 }
jpayne@68 19686 goto __pyx_L6_skip;
jpayne@68 19687 __pyx_L5_argtuple_error:;
jpayne@68 19688 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
jpayne@68 19689 __pyx_L6_skip:;
jpayne@68 19690 goto __pyx_L4_argument_unpacking_done;
jpayne@68 19691 __pyx_L3_error:;
jpayne@68 19692 {
jpayne@68 19693 Py_ssize_t __pyx_temp;
jpayne@68 19694 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 19695 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 19696 }
jpayne@68 19697 }
jpayne@68 19698 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19699 __Pyx_RefNannyFinishContext();
jpayne@68 19700 return NULL;
jpayne@68 19701 __pyx_L4_argument_unpacking_done:;
jpayne@68 19702 __pyx_r = __pyx_pf_5pysam_10libchtslib_7HTSFile_34__setstate_cython__(((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)__pyx_v_self), __pyx_v___pyx_state);
jpayne@68 19703
jpayne@68 19704 /* function exit code */
jpayne@68 19705 {
jpayne@68 19706 Py_ssize_t __pyx_temp;
jpayne@68 19707 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
jpayne@68 19708 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
jpayne@68 19709 }
jpayne@68 19710 }
jpayne@68 19711 __Pyx_RefNannyFinishContext();
jpayne@68 19712 return __pyx_r;
jpayne@68 19713 }
jpayne@68 19714
jpayne@68 19715 static PyObject *__pyx_pf_5pysam_10libchtslib_7HTSFile_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_10libchtslib_HTSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
jpayne@68 19716 PyObject *__pyx_r = NULL;
jpayne@68 19717 __Pyx_TraceDeclarations
jpayne@68 19718 __Pyx_RefNannyDeclarations
jpayne@68 19719 int __pyx_lineno = 0;
jpayne@68 19720 const char *__pyx_filename = NULL;
jpayne@68 19721 int __pyx_clineno = 0;
jpayne@68 19722 __Pyx_TraceFrameInit(__pyx_codeobj__65)
jpayne@68 19723 __Pyx_RefNannySetupContext("__setstate_cython__", 1);
jpayne@68 19724 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
jpayne@68 19725
jpayne@68 19726 /* "(tree fragment)":4
jpayne@68 19727 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 19728 * def __setstate_cython__(self, __pyx_state):
jpayne@68 19729 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
jpayne@68 19730 */
jpayne@68 19731 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
jpayne@68 19732 __PYX_ERR(1, 4, __pyx_L1_error)
jpayne@68 19733
jpayne@68 19734 /* "(tree fragment)":3
jpayne@68 19735 * def __reduce_cython__(self):
jpayne@68 19736 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 19737 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
jpayne@68 19738 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 19739 */
jpayne@68 19740
jpayne@68 19741 /* function exit code */
jpayne@68 19742 __pyx_L1_error:;
jpayne@68 19743 __Pyx_AddTraceback("pysam.libchtslib.HTSFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 19744 __pyx_r = NULL;
jpayne@68 19745 __Pyx_XGIVEREF(__pyx_r);
jpayne@68 19746 __Pyx_TraceReturn(__pyx_r, 0);
jpayne@68 19747 __Pyx_RefNannyFinishContext();
jpayne@68 19748 return __pyx_r;
jpayne@68 19749 }
jpayne@68 19750 static struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile __pyx_vtable_5pysam_10libchtslib_HTSFile;
jpayne@68 19751
jpayne@68 19752 static PyObject *__pyx_tp_new_5pysam_10libchtslib_HTSFile(PyTypeObject *t, PyObject *a, PyObject *k) {
jpayne@68 19753 struct __pyx_obj_5pysam_10libchtslib_HTSFile *p;
jpayne@68 19754 PyObject *o;
jpayne@68 19755 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 19756 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
jpayne@68 19757 o = alloc_func(t, 0);
jpayne@68 19758 #else
jpayne@68 19759 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
jpayne@68 19760 o = (*t->tp_alloc)(t, 0);
jpayne@68 19761 } else {
jpayne@68 19762 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
jpayne@68 19763 }
jpayne@68 19764 if (unlikely(!o)) return 0;
jpayne@68 19765 #endif
jpayne@68 19766 p = ((struct __pyx_obj_5pysam_10libchtslib_HTSFile *)o);
jpayne@68 19767 p->__pyx_vtab = __pyx_vtabptr_5pysam_10libchtslib_HTSFile;
jpayne@68 19768 p->filename = Py_None; Py_INCREF(Py_None);
jpayne@68 19769 p->mode = Py_None; Py_INCREF(Py_None);
jpayne@68 19770 p->threads = Py_None; Py_INCREF(Py_None);
jpayne@68 19771 p->index_filename = Py_None; Py_INCREF(Py_None);
jpayne@68 19772 if (unlikely(__pyx_pw_5pysam_10libchtslib_7HTSFile_1__cinit__(o, a, k) < 0)) goto bad;
jpayne@68 19773 return o;
jpayne@68 19774 bad:
jpayne@68 19775 Py_DECREF(o); o = 0;
jpayne@68 19776 return NULL;
jpayne@68 19777 }
jpayne@68 19778
jpayne@68 19779 static void __pyx_tp_dealloc_5pysam_10libchtslib_HTSFile(PyObject *o) {
jpayne@68 19780 struct __pyx_obj_5pysam_10libchtslib_HTSFile *p = (struct __pyx_obj_5pysam_10libchtslib_HTSFile *)o;
jpayne@68 19781 #if CYTHON_USE_TP_FINALIZE
jpayne@68 19782 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
jpayne@68 19783 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_10libchtslib_HTSFile) {
jpayne@68 19784 if (PyObject_CallFinalizerFromDealloc(o)) return;
jpayne@68 19785 }
jpayne@68 19786 }
jpayne@68 19787 #endif
jpayne@68 19788 PyObject_GC_UnTrack(o);
jpayne@68 19789 {
jpayne@68 19790 PyObject *etype, *eval, *etb;
jpayne@68 19791 PyErr_Fetch(&etype, &eval, &etb);
jpayne@68 19792 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
jpayne@68 19793 __pyx_pw_5pysam_10libchtslib_7HTSFile_5__dealloc__(o);
jpayne@68 19794 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
jpayne@68 19795 PyErr_Restore(etype, eval, etb);
jpayne@68 19796 }
jpayne@68 19797 Py_CLEAR(p->filename);
jpayne@68 19798 Py_CLEAR(p->mode);
jpayne@68 19799 Py_CLEAR(p->threads);
jpayne@68 19800 Py_CLEAR(p->index_filename);
jpayne@68 19801 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
jpayne@68 19802 (*Py_TYPE(o)->tp_free)(o);
jpayne@68 19803 #else
jpayne@68 19804 {
jpayne@68 19805 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
jpayne@68 19806 if (tp_free) tp_free(o);
jpayne@68 19807 }
jpayne@68 19808 #endif
jpayne@68 19809 }
jpayne@68 19810
jpayne@68 19811 static int __pyx_tp_traverse_5pysam_10libchtslib_HTSFile(PyObject *o, visitproc v, void *a) {
jpayne@68 19812 int e;
jpayne@68 19813 struct __pyx_obj_5pysam_10libchtslib_HTSFile *p = (struct __pyx_obj_5pysam_10libchtslib_HTSFile *)o;
jpayne@68 19814 if (p->filename) {
jpayne@68 19815 e = (*v)(p->filename, a); if (e) return e;
jpayne@68 19816 }
jpayne@68 19817 if (p->mode) {
jpayne@68 19818 e = (*v)(p->mode, a); if (e) return e;
jpayne@68 19819 }
jpayne@68 19820 if (p->threads) {
jpayne@68 19821 e = (*v)(p->threads, a); if (e) return e;
jpayne@68 19822 }
jpayne@68 19823 if (p->index_filename) {
jpayne@68 19824 e = (*v)(p->index_filename, a); if (e) return e;
jpayne@68 19825 }
jpayne@68 19826 return 0;
jpayne@68 19827 }
jpayne@68 19828
jpayne@68 19829 static int __pyx_tp_clear_5pysam_10libchtslib_HTSFile(PyObject *o) {
jpayne@68 19830 PyObject* tmp;
jpayne@68 19831 struct __pyx_obj_5pysam_10libchtslib_HTSFile *p = (struct __pyx_obj_5pysam_10libchtslib_HTSFile *)o;
jpayne@68 19832 tmp = ((PyObject*)p->filename);
jpayne@68 19833 p->filename = Py_None; Py_INCREF(Py_None);
jpayne@68 19834 Py_XDECREF(tmp);
jpayne@68 19835 tmp = ((PyObject*)p->mode);
jpayne@68 19836 p->mode = Py_None; Py_INCREF(Py_None);
jpayne@68 19837 Py_XDECREF(tmp);
jpayne@68 19838 tmp = ((PyObject*)p->threads);
jpayne@68 19839 p->threads = Py_None; Py_INCREF(Py_None);
jpayne@68 19840 Py_XDECREF(tmp);
jpayne@68 19841 tmp = ((PyObject*)p->index_filename);
jpayne@68 19842 p->index_filename = Py_None; Py_INCREF(Py_None);
jpayne@68 19843 Py_XDECREF(tmp);
jpayne@68 19844 return 0;
jpayne@68 19845 }
jpayne@68 19846
jpayne@68 19847 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_category(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19848 return __pyx_pw_5pysam_10libchtslib_7HTSFile_8category_1__get__(o);
jpayne@68 19849 }
jpayne@68 19850
jpayne@68 19851 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_format(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19852 return __pyx_pw_5pysam_10libchtslib_7HTSFile_6format_1__get__(o);
jpayne@68 19853 }
jpayne@68 19854
jpayne@68 19855 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_version(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19856 return __pyx_pw_5pysam_10libchtslib_7HTSFile_7version_1__get__(o);
jpayne@68 19857 }
jpayne@68 19858
jpayne@68 19859 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_compression(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19860 return __pyx_pw_5pysam_10libchtslib_7HTSFile_11compression_1__get__(o);
jpayne@68 19861 }
jpayne@68 19862
jpayne@68 19863 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_description(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19864 return __pyx_pw_5pysam_10libchtslib_7HTSFile_11description_1__get__(o);
jpayne@68 19865 }
jpayne@68 19866
jpayne@68 19867 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_open(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19868 return __pyx_pw_5pysam_10libchtslib_7HTSFile_7is_open_1__get__(o);
jpayne@68 19869 }
jpayne@68 19870
jpayne@68 19871 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_closed(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19872 return __pyx_pw_5pysam_10libchtslib_7HTSFile_9is_closed_1__get__(o);
jpayne@68 19873 }
jpayne@68 19874
jpayne@68 19875 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_closed(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19876 return __pyx_pw_5pysam_10libchtslib_7HTSFile_6closed_1__get__(o);
jpayne@68 19877 }
jpayne@68 19878
jpayne@68 19879 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_write(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19880 return __pyx_pw_5pysam_10libchtslib_7HTSFile_8is_write_1__get__(o);
jpayne@68 19881 }
jpayne@68 19882
jpayne@68 19883 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_read(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19884 return __pyx_pw_5pysam_10libchtslib_7HTSFile_7is_read_1__get__(o);
jpayne@68 19885 }
jpayne@68 19886
jpayne@68 19887 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_sam(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19888 return __pyx_pw_5pysam_10libchtslib_7HTSFile_6is_sam_1__get__(o);
jpayne@68 19889 }
jpayne@68 19890
jpayne@68 19891 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_bam(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19892 return __pyx_pw_5pysam_10libchtslib_7HTSFile_6is_bam_1__get__(o);
jpayne@68 19893 }
jpayne@68 19894
jpayne@68 19895 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_cram(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19896 return __pyx_pw_5pysam_10libchtslib_7HTSFile_7is_cram_1__get__(o);
jpayne@68 19897 }
jpayne@68 19898
jpayne@68 19899 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_vcf(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19900 return __pyx_pw_5pysam_10libchtslib_7HTSFile_6is_vcf_1__get__(o);
jpayne@68 19901 }
jpayne@68 19902
jpayne@68 19903 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_bcf(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19904 return __pyx_pw_5pysam_10libchtslib_7HTSFile_6is_bcf_1__get__(o);
jpayne@68 19905 }
jpayne@68 19906
jpayne@68 19907 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_filename(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19908 return __pyx_pw_5pysam_10libchtslib_7HTSFile_8filename_1__get__(o);
jpayne@68 19909 }
jpayne@68 19910
jpayne@68 19911 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19912 return __pyx_pw_5pysam_10libchtslib_7HTSFile_4mode_1__get__(o);
jpayne@68 19913 }
jpayne@68 19914
jpayne@68 19915 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_threads(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19916 return __pyx_pw_5pysam_10libchtslib_7HTSFile_7threads_1__get__(o);
jpayne@68 19917 }
jpayne@68 19918
jpayne@68 19919 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_index_filename(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19920 return __pyx_pw_5pysam_10libchtslib_7HTSFile_14index_filename_1__get__(o);
jpayne@68 19921 }
jpayne@68 19922
jpayne@68 19923 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_stream(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19924 return __pyx_pw_5pysam_10libchtslib_7HTSFile_9is_stream_1__get__(o);
jpayne@68 19925 }
jpayne@68 19926
jpayne@68 19927 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_is_remote(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19928 return __pyx_pw_5pysam_10libchtslib_7HTSFile_9is_remote_1__get__(o);
jpayne@68 19929 }
jpayne@68 19930
jpayne@68 19931 static PyObject *__pyx_getprop_5pysam_10libchtslib_7HTSFile_duplicate_filehandle(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 19932 return __pyx_pw_5pysam_10libchtslib_7HTSFile_20duplicate_filehandle_1__get__(o);
jpayne@68 19933 }
jpayne@68 19934
jpayne@68 19935 static PyMethodDef __pyx_methods_5pysam_10libchtslib_HTSFile[] = {
jpayne@68 19936 {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_3close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_2close},
jpayne@68 19937 {"flush", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_7flush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_6flush},
jpayne@68 19938 {"check_truncation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_9check_truncation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_8check_truncation},
jpayne@68 19939 {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_11__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_10__enter__},
jpayne@68 19940 {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_13__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_12__exit__},
jpayne@68 19941 {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_15reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_14reset},
jpayne@68 19942 {"seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_17seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_16seek},
jpayne@68 19943 {"tell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_19tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_18tell},
jpayne@68 19944 {"add_hts_options", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_21add_hts_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_20add_hts_options},
jpayne@68 19945 {"parse_region", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_23parse_region, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_22parse_region},
jpayne@68 19946 {"is_valid_tid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_25is_valid_tid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_24is_valid_tid},
jpayne@68 19947 {"is_valid_reference_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_27is_valid_reference_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_26is_valid_reference_name},
jpayne@68 19948 {"get_tid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_29get_tid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_28get_tid},
jpayne@68 19949 {"get_reference_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_31get_reference_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_30get_reference_name},
jpayne@68 19950 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_32__reduce_cython__},
jpayne@68 19951 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_7HTSFile_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_7HTSFile_34__setstate_cython__},
jpayne@68 19952 {0, 0, 0, 0}
jpayne@68 19953 };
jpayne@68 19954
jpayne@68 19955 static struct PyGetSetDef __pyx_getsets_5pysam_10libchtslib_HTSFile[] = {
jpayne@68 19956 {(char *)"category", __pyx_getprop_5pysam_10libchtslib_7HTSFile_category, 0, (char *)PyDoc_STR("General file format category. One of UNKNOWN, ALIGNMENTS,\n VARIANTS, INDEX, REGIONS"), 0},
jpayne@68 19957 {(char *)"format", __pyx_getprop_5pysam_10libchtslib_7HTSFile_format, 0, (char *)PyDoc_STR("File format.\n\n One of UNKNOWN, BINARY_FORMAT, TEXT_FORMAT, SAM, BAM,\n BAI, CRAM, CRAI, VCF, BCF, CSI, GZI, TBI, BED.\n "), 0},
jpayne@68 19958 {(char *)"version", __pyx_getprop_5pysam_10libchtslib_7HTSFile_version, 0, (char *)PyDoc_STR("Tuple of file format version numbers (major, minor)"), 0},
jpayne@68 19959 {(char *)"compression", __pyx_getprop_5pysam_10libchtslib_7HTSFile_compression, 0, (char *)PyDoc_STR("File compression.\n\n One of NONE, GZIP, BGZF, CUSTOM."), 0},
jpayne@68 19960 {(char *)"description", __pyx_getprop_5pysam_10libchtslib_7HTSFile_description, 0, (char *)PyDoc_STR("Vaguely human readable description of the file format"), 0},
jpayne@68 19961 {(char *)"is_open", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_open, 0, (char *)PyDoc_STR("return True if HTSFile is open and in a valid state."), 0},
jpayne@68 19962 {(char *)"is_closed", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_closed, 0, (char *)PyDoc_STR("return True if HTSFile is closed."), 0},
jpayne@68 19963 {(char *)"closed", __pyx_getprop_5pysam_10libchtslib_7HTSFile_closed, 0, (char *)PyDoc_STR("return True if HTSFile is closed."), 0},
jpayne@68 19964 {(char *)"is_write", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_write, 0, (char *)PyDoc_STR("return True if HTSFile is open for writing"), 0},
jpayne@68 19965 {(char *)"is_read", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_read, 0, (char *)PyDoc_STR("return True if HTSFile is open for reading"), 0},
jpayne@68 19966 {(char *)"is_sam", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_sam, 0, (char *)PyDoc_STR("return True if HTSFile is reading or writing a SAM alignment file"), 0},
jpayne@68 19967 {(char *)"is_bam", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_bam, 0, (char *)PyDoc_STR("return True if HTSFile is reading or writing a BAM alignment file"), 0},
jpayne@68 19968 {(char *)"is_cram", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_cram, 0, (char *)PyDoc_STR("return True if HTSFile is reading or writing a BAM alignment file"), 0},
jpayne@68 19969 {(char *)"is_vcf", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_vcf, 0, (char *)PyDoc_STR("return True if HTSFile is reading or writing a VCF variant file"), 0},
jpayne@68 19970 {(char *)"is_bcf", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_bcf, 0, (char *)PyDoc_STR("return True if HTSFile is reading or writing a BCF variant file"), 0},
jpayne@68 19971 {(char *)"filename", __pyx_getprop_5pysam_10libchtslib_7HTSFile_filename, 0, (char *)0, 0},
jpayne@68 19972 {(char *)"mode", __pyx_getprop_5pysam_10libchtslib_7HTSFile_mode, 0, (char *)0, 0},
jpayne@68 19973 {(char *)"threads", __pyx_getprop_5pysam_10libchtslib_7HTSFile_threads, 0, (char *)0, 0},
jpayne@68 19974 {(char *)"index_filename", __pyx_getprop_5pysam_10libchtslib_7HTSFile_index_filename, 0, (char *)0, 0},
jpayne@68 19975 {(char *)"is_stream", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_stream, 0, (char *)0, 0},
jpayne@68 19976 {(char *)"is_remote", __pyx_getprop_5pysam_10libchtslib_7HTSFile_is_remote, 0, (char *)0, 0},
jpayne@68 19977 {(char *)"duplicate_filehandle", __pyx_getprop_5pysam_10libchtslib_7HTSFile_duplicate_filehandle, 0, (char *)0, 0},
jpayne@68 19978 {0, 0, 0, 0, 0}
jpayne@68 19979 };
jpayne@68 19980 #if CYTHON_USE_TYPE_SPECS
jpayne@68 19981 static PyType_Slot __pyx_type_5pysam_10libchtslib_HTSFile_slots[] = {
jpayne@68 19982 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_10libchtslib_HTSFile},
jpayne@68 19983 {Py_tp_doc, (void *)PyDoc_STR("\n Base class for HTS file types\n ")},
jpayne@68 19984 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_10libchtslib_HTSFile},
jpayne@68 19985 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_10libchtslib_HTSFile},
jpayne@68 19986 {Py_tp_methods, (void *)__pyx_methods_5pysam_10libchtslib_HTSFile},
jpayne@68 19987 {Py_tp_getset, (void *)__pyx_getsets_5pysam_10libchtslib_HTSFile},
jpayne@68 19988 {Py_tp_new, (void *)__pyx_tp_new_5pysam_10libchtslib_HTSFile},
jpayne@68 19989 {0, 0},
jpayne@68 19990 };
jpayne@68 19991 static PyType_Spec __pyx_type_5pysam_10libchtslib_HTSFile_spec = {
jpayne@68 19992 "pysam.libchtslib.HTSFile",
jpayne@68 19993 sizeof(struct __pyx_obj_5pysam_10libchtslib_HTSFile),
jpayne@68 19994 0,
jpayne@68 19995 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
jpayne@68 19996 __pyx_type_5pysam_10libchtslib_HTSFile_slots,
jpayne@68 19997 };
jpayne@68 19998 #else
jpayne@68 19999
jpayne@68 20000 static PyTypeObject __pyx_type_5pysam_10libchtslib_HTSFile = {
jpayne@68 20001 PyVarObject_HEAD_INIT(0, 0)
jpayne@68 20002 "pysam.libchtslib.""HTSFile", /*tp_name*/
jpayne@68 20003 sizeof(struct __pyx_obj_5pysam_10libchtslib_HTSFile), /*tp_basicsize*/
jpayne@68 20004 0, /*tp_itemsize*/
jpayne@68 20005 __pyx_tp_dealloc_5pysam_10libchtslib_HTSFile, /*tp_dealloc*/
jpayne@68 20006 #if PY_VERSION_HEX < 0x030800b4
jpayne@68 20007 0, /*tp_print*/
jpayne@68 20008 #endif
jpayne@68 20009 #if PY_VERSION_HEX >= 0x030800b4
jpayne@68 20010 0, /*tp_vectorcall_offset*/
jpayne@68 20011 #endif
jpayne@68 20012 0, /*tp_getattr*/
jpayne@68 20013 0, /*tp_setattr*/
jpayne@68 20014 #if PY_MAJOR_VERSION < 3
jpayne@68 20015 0, /*tp_compare*/
jpayne@68 20016 #endif
jpayne@68 20017 #if PY_MAJOR_VERSION >= 3
jpayne@68 20018 0, /*tp_as_async*/
jpayne@68 20019 #endif
jpayne@68 20020 0, /*tp_repr*/
jpayne@68 20021 0, /*tp_as_number*/
jpayne@68 20022 0, /*tp_as_sequence*/
jpayne@68 20023 0, /*tp_as_mapping*/
jpayne@68 20024 0, /*tp_hash*/
jpayne@68 20025 0, /*tp_call*/
jpayne@68 20026 0, /*tp_str*/
jpayne@68 20027 0, /*tp_getattro*/
jpayne@68 20028 0, /*tp_setattro*/
jpayne@68 20029 0, /*tp_as_buffer*/
jpayne@68 20030 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
jpayne@68 20031 PyDoc_STR("\n Base class for HTS file types\n "), /*tp_doc*/
jpayne@68 20032 __pyx_tp_traverse_5pysam_10libchtslib_HTSFile, /*tp_traverse*/
jpayne@68 20033 __pyx_tp_clear_5pysam_10libchtslib_HTSFile, /*tp_clear*/
jpayne@68 20034 0, /*tp_richcompare*/
jpayne@68 20035 0, /*tp_weaklistoffset*/
jpayne@68 20036 0, /*tp_iter*/
jpayne@68 20037 0, /*tp_iternext*/
jpayne@68 20038 __pyx_methods_5pysam_10libchtslib_HTSFile, /*tp_methods*/
jpayne@68 20039 0, /*tp_members*/
jpayne@68 20040 __pyx_getsets_5pysam_10libchtslib_HTSFile, /*tp_getset*/
jpayne@68 20041 0, /*tp_base*/
jpayne@68 20042 0, /*tp_dict*/
jpayne@68 20043 0, /*tp_descr_get*/
jpayne@68 20044 0, /*tp_descr_set*/
jpayne@68 20045 #if !CYTHON_USE_TYPE_SPECS
jpayne@68 20046 0, /*tp_dictoffset*/
jpayne@68 20047 #endif
jpayne@68 20048 0, /*tp_init*/
jpayne@68 20049 0, /*tp_alloc*/
jpayne@68 20050 __pyx_tp_new_5pysam_10libchtslib_HTSFile, /*tp_new*/
jpayne@68 20051 0, /*tp_free*/
jpayne@68 20052 0, /*tp_is_gc*/
jpayne@68 20053 0, /*tp_bases*/
jpayne@68 20054 0, /*tp_mro*/
jpayne@68 20055 0, /*tp_cache*/
jpayne@68 20056 0, /*tp_subclasses*/
jpayne@68 20057 0, /*tp_weaklist*/
jpayne@68 20058 0, /*tp_del*/
jpayne@68 20059 0, /*tp_version_tag*/
jpayne@68 20060 #if PY_VERSION_HEX >= 0x030400a1
jpayne@68 20061 #if CYTHON_USE_TP_FINALIZE
jpayne@68 20062 0, /*tp_finalize*/
jpayne@68 20063 #else
jpayne@68 20064 NULL, /*tp_finalize*/
jpayne@68 20065 #endif
jpayne@68 20066 #endif
jpayne@68 20067 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
jpayne@68 20068 0, /*tp_vectorcall*/
jpayne@68 20069 #endif
jpayne@68 20070 #if __PYX_NEED_TP_PRINT_SLOT == 1
jpayne@68 20071 0, /*tp_print*/
jpayne@68 20072 #endif
jpayne@68 20073 #if PY_VERSION_HEX >= 0x030C0000
jpayne@68 20074 0, /*tp_watched*/
jpayne@68 20075 #endif
jpayne@68 20076 #if PY_VERSION_HEX >= 0x030d00A4
jpayne@68 20077 0, /*tp_versions_used*/
jpayne@68 20078 #endif
jpayne@68 20079 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
jpayne@68 20080 0, /*tp_pypy_flags*/
jpayne@68 20081 #endif
jpayne@68 20082 };
jpayne@68 20083 #endif
jpayne@68 20084 static struct __pyx_vtabstruct_5pysam_10libchtslib_HFile __pyx_vtable_5pysam_10libchtslib_HFile;
jpayne@68 20085
jpayne@68 20086 static PyObject *__pyx_tp_new_5pysam_10libchtslib_HFile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
jpayne@68 20087 struct __pyx_obj_5pysam_10libchtslib_HFile *p;
jpayne@68 20088 PyObject *o;
jpayne@68 20089 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 20090 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
jpayne@68 20091 o = alloc_func(t, 0);
jpayne@68 20092 #else
jpayne@68 20093 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
jpayne@68 20094 o = (*t->tp_alloc)(t, 0);
jpayne@68 20095 } else {
jpayne@68 20096 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
jpayne@68 20097 }
jpayne@68 20098 if (unlikely(!o)) return 0;
jpayne@68 20099 #endif
jpayne@68 20100 p = ((struct __pyx_obj_5pysam_10libchtslib_HFile *)o);
jpayne@68 20101 p->__pyx_vtab = __pyx_vtabptr_5pysam_10libchtslib_HFile;
jpayne@68 20102 p->name = Py_None; Py_INCREF(Py_None);
jpayne@68 20103 p->mode = Py_None; Py_INCREF(Py_None);
jpayne@68 20104 return o;
jpayne@68 20105 }
jpayne@68 20106
jpayne@68 20107 static void __pyx_tp_dealloc_5pysam_10libchtslib_HFile(PyObject *o) {
jpayne@68 20108 struct __pyx_obj_5pysam_10libchtslib_HFile *p = (struct __pyx_obj_5pysam_10libchtslib_HFile *)o;
jpayne@68 20109 #if CYTHON_USE_TP_FINALIZE
jpayne@68 20110 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
jpayne@68 20111 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_10libchtslib_HFile) {
jpayne@68 20112 if (PyObject_CallFinalizerFromDealloc(o)) return;
jpayne@68 20113 }
jpayne@68 20114 }
jpayne@68 20115 #endif
jpayne@68 20116 PyObject_GC_UnTrack(o);
jpayne@68 20117 {
jpayne@68 20118 PyObject *etype, *eval, *etb;
jpayne@68 20119 PyErr_Fetch(&etype, &eval, &etb);
jpayne@68 20120 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
jpayne@68 20121 __pyx_pw_5pysam_10libchtslib_5HFile_3__dealloc__(o);
jpayne@68 20122 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
jpayne@68 20123 PyErr_Restore(etype, eval, etb);
jpayne@68 20124 }
jpayne@68 20125 Py_CLEAR(p->name);
jpayne@68 20126 Py_CLEAR(p->mode);
jpayne@68 20127 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
jpayne@68 20128 (*Py_TYPE(o)->tp_free)(o);
jpayne@68 20129 #else
jpayne@68 20130 {
jpayne@68 20131 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
jpayne@68 20132 if (tp_free) tp_free(o);
jpayne@68 20133 }
jpayne@68 20134 #endif
jpayne@68 20135 }
jpayne@68 20136
jpayne@68 20137 static int __pyx_tp_traverse_5pysam_10libchtslib_HFile(PyObject *o, visitproc v, void *a) {
jpayne@68 20138 int e;
jpayne@68 20139 struct __pyx_obj_5pysam_10libchtslib_HFile *p = (struct __pyx_obj_5pysam_10libchtslib_HFile *)o;
jpayne@68 20140 if (p->name) {
jpayne@68 20141 e = (*v)(p->name, a); if (e) return e;
jpayne@68 20142 }
jpayne@68 20143 if (p->mode) {
jpayne@68 20144 e = (*v)(p->mode, a); if (e) return e;
jpayne@68 20145 }
jpayne@68 20146 return 0;
jpayne@68 20147 }
jpayne@68 20148
jpayne@68 20149 static int __pyx_tp_clear_5pysam_10libchtslib_HFile(PyObject *o) {
jpayne@68 20150 PyObject* tmp;
jpayne@68 20151 struct __pyx_obj_5pysam_10libchtslib_HFile *p = (struct __pyx_obj_5pysam_10libchtslib_HFile *)o;
jpayne@68 20152 tmp = ((PyObject*)p->name);
jpayne@68 20153 p->name = Py_None; Py_INCREF(Py_None);
jpayne@68 20154 Py_XDECREF(tmp);
jpayne@68 20155 tmp = ((PyObject*)p->mode);
jpayne@68 20156 p->mode = Py_None; Py_INCREF(Py_None);
jpayne@68 20157 Py_XDECREF(tmp);
jpayne@68 20158 return 0;
jpayne@68 20159 }
jpayne@68 20160
jpayne@68 20161 static PyObject *__pyx_getprop_5pysam_10libchtslib_5HFile_closed(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 20162 return __pyx_pw_5pysam_10libchtslib_5HFile_6closed_1__get__(o);
jpayne@68 20163 }
jpayne@68 20164
jpayne@68 20165 static PyObject *__pyx_getprop_5pysam_10libchtslib_5HFile_name(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 20166 return __pyx_pw_5pysam_10libchtslib_5HFile_4name_1__get__(o);
jpayne@68 20167 }
jpayne@68 20168
jpayne@68 20169 static PyObject *__pyx_getprop_5pysam_10libchtslib_5HFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
jpayne@68 20170 return __pyx_pw_5pysam_10libchtslib_5HFile_4mode_1__get__(o);
jpayne@68 20171 }
jpayne@68 20172
jpayne@68 20173 static PyObject *__pyx_specialmethod___pyx_pw_5pysam_10libchtslib_5HFile_15__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
jpayne@68 20174 PyObject *res = __pyx_pw_5pysam_10libchtslib_5HFile_15__next__(self);
jpayne@68 20175 if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
jpayne@68 20176 return res;
jpayne@68 20177 }
jpayne@68 20178
jpayne@68 20179 static PyMethodDef __pyx_methods_5pysam_10libchtslib_HFile[] = {
jpayne@68 20180 {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_5close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_4close},
jpayne@68 20181 {"fileno", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_7fileno, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_6fileno},
jpayne@68 20182 {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_9__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_8__enter__},
jpayne@68 20183 {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_11__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_10__exit__},
jpayne@68 20184 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_5pysam_10libchtslib_5HFile_15__next__, METH_NOARGS|METH_COEXIST, 0},
jpayne@68 20185 {"flush", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_17flush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_16flush},
jpayne@68 20186 {"isatty", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_19isatty, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_18isatty},
jpayne@68 20187 {"readable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_21readable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_20readable},
jpayne@68 20188 {"read", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_23read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_22read},
jpayne@68 20189 {"readall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_25readall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_24readall},
jpayne@68 20190 {"readinto", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_27readinto, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_26readinto},
jpayne@68 20191 {"readline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_29readline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_28readline},
jpayne@68 20192 {"readlines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_31readlines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_30readlines},
jpayne@68 20193 {"seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_33seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_32seek},
jpayne@68 20194 {"tell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_35tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_34tell},
jpayne@68 20195 {"seekable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_37seekable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_36seekable},
jpayne@68 20196 {"truncate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_39truncate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_38truncate},
jpayne@68 20197 {"writable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_41writable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_40writable},
jpayne@68 20198 {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_43write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_42write},
jpayne@68 20199 {"writelines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_45writelines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_44writelines},
jpayne@68 20200 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_47__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_46__reduce_cython__},
jpayne@68 20201 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_10libchtslib_5HFile_49__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_10libchtslib_5HFile_48__setstate_cython__},
jpayne@68 20202 {0, 0, 0, 0}
jpayne@68 20203 };
jpayne@68 20204
jpayne@68 20205 static struct PyGetSetDef __pyx_getsets_5pysam_10libchtslib_HFile[] = {
jpayne@68 20206 {(char *)"closed", __pyx_getprop_5pysam_10libchtslib_5HFile_closed, 0, (char *)0, 0},
jpayne@68 20207 {(char *)"name", __pyx_getprop_5pysam_10libchtslib_5HFile_name, 0, (char *)0, 0},
jpayne@68 20208 {(char *)"mode", __pyx_getprop_5pysam_10libchtslib_5HFile_mode, 0, (char *)0, 0},
jpayne@68 20209 {0, 0, 0, 0, 0}
jpayne@68 20210 };
jpayne@68 20211 #if CYTHON_USE_TYPE_SPECS
jpayne@68 20212 static PyType_Slot __pyx_type_5pysam_10libchtslib_HFile_slots[] = {
jpayne@68 20213 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_10libchtslib_HFile},
jpayne@68 20214 {Py_tp_doc, (void *)PyDoc_STR("HFile(name, mode=u'r', closefd=True)")},
jpayne@68 20215 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_10libchtslib_HFile},
jpayne@68 20216 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_10libchtslib_HFile},
jpayne@68 20217 {Py_tp_iter, (void *)__pyx_pw_5pysam_10libchtslib_5HFile_13__iter__},
jpayne@68 20218 {Py_tp_iternext, (void *)__pyx_pw_5pysam_10libchtslib_5HFile_15__next__},
jpayne@68 20219 {Py_tp_methods, (void *)__pyx_methods_5pysam_10libchtslib_HFile},
jpayne@68 20220 {Py_tp_getset, (void *)__pyx_getsets_5pysam_10libchtslib_HFile},
jpayne@68 20221 {Py_tp_init, (void *)__pyx_pw_5pysam_10libchtslib_5HFile_1__init__},
jpayne@68 20222 {Py_tp_new, (void *)__pyx_tp_new_5pysam_10libchtslib_HFile},
jpayne@68 20223 {0, 0},
jpayne@68 20224 };
jpayne@68 20225 static PyType_Spec __pyx_type_5pysam_10libchtslib_HFile_spec = {
jpayne@68 20226 "pysam.libchtslib.HFile",
jpayne@68 20227 sizeof(struct __pyx_obj_5pysam_10libchtslib_HFile),
jpayne@68 20228 0,
jpayne@68 20229 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
jpayne@68 20230 __pyx_type_5pysam_10libchtslib_HFile_slots,
jpayne@68 20231 };
jpayne@68 20232 #else
jpayne@68 20233
jpayne@68 20234 static PyTypeObject __pyx_type_5pysam_10libchtslib_HFile = {
jpayne@68 20235 PyVarObject_HEAD_INIT(0, 0)
jpayne@68 20236 "pysam.libchtslib.""HFile", /*tp_name*/
jpayne@68 20237 sizeof(struct __pyx_obj_5pysam_10libchtslib_HFile), /*tp_basicsize*/
jpayne@68 20238 0, /*tp_itemsize*/
jpayne@68 20239 __pyx_tp_dealloc_5pysam_10libchtslib_HFile, /*tp_dealloc*/
jpayne@68 20240 #if PY_VERSION_HEX < 0x030800b4
jpayne@68 20241 0, /*tp_print*/
jpayne@68 20242 #endif
jpayne@68 20243 #if PY_VERSION_HEX >= 0x030800b4
jpayne@68 20244 0, /*tp_vectorcall_offset*/
jpayne@68 20245 #endif
jpayne@68 20246 0, /*tp_getattr*/
jpayne@68 20247 0, /*tp_setattr*/
jpayne@68 20248 #if PY_MAJOR_VERSION < 3
jpayne@68 20249 0, /*tp_compare*/
jpayne@68 20250 #endif
jpayne@68 20251 #if PY_MAJOR_VERSION >= 3
jpayne@68 20252 0, /*tp_as_async*/
jpayne@68 20253 #endif
jpayne@68 20254 0, /*tp_repr*/
jpayne@68 20255 0, /*tp_as_number*/
jpayne@68 20256 0, /*tp_as_sequence*/
jpayne@68 20257 0, /*tp_as_mapping*/
jpayne@68 20258 0, /*tp_hash*/
jpayne@68 20259 0, /*tp_call*/
jpayne@68 20260 0, /*tp_str*/
jpayne@68 20261 0, /*tp_getattro*/
jpayne@68 20262 0, /*tp_setattro*/
jpayne@68 20263 0, /*tp_as_buffer*/
jpayne@68 20264 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
jpayne@68 20265 PyDoc_STR("HFile(name, mode=u'r', closefd=True)"), /*tp_doc*/
jpayne@68 20266 __pyx_tp_traverse_5pysam_10libchtslib_HFile, /*tp_traverse*/
jpayne@68 20267 __pyx_tp_clear_5pysam_10libchtslib_HFile, /*tp_clear*/
jpayne@68 20268 0, /*tp_richcompare*/
jpayne@68 20269 0, /*tp_weaklistoffset*/
jpayne@68 20270 __pyx_pw_5pysam_10libchtslib_5HFile_13__iter__, /*tp_iter*/
jpayne@68 20271 __pyx_pw_5pysam_10libchtslib_5HFile_15__next__, /*tp_iternext*/
jpayne@68 20272 __pyx_methods_5pysam_10libchtslib_HFile, /*tp_methods*/
jpayne@68 20273 0, /*tp_members*/
jpayne@68 20274 __pyx_getsets_5pysam_10libchtslib_HFile, /*tp_getset*/
jpayne@68 20275 0, /*tp_base*/
jpayne@68 20276 0, /*tp_dict*/
jpayne@68 20277 0, /*tp_descr_get*/
jpayne@68 20278 0, /*tp_descr_set*/
jpayne@68 20279 #if !CYTHON_USE_TYPE_SPECS
jpayne@68 20280 0, /*tp_dictoffset*/
jpayne@68 20281 #endif
jpayne@68 20282 __pyx_pw_5pysam_10libchtslib_5HFile_1__init__, /*tp_init*/
jpayne@68 20283 0, /*tp_alloc*/
jpayne@68 20284 __pyx_tp_new_5pysam_10libchtslib_HFile, /*tp_new*/
jpayne@68 20285 0, /*tp_free*/
jpayne@68 20286 0, /*tp_is_gc*/
jpayne@68 20287 0, /*tp_bases*/
jpayne@68 20288 0, /*tp_mro*/
jpayne@68 20289 0, /*tp_cache*/
jpayne@68 20290 0, /*tp_subclasses*/
jpayne@68 20291 0, /*tp_weaklist*/
jpayne@68 20292 0, /*tp_del*/
jpayne@68 20293 0, /*tp_version_tag*/
jpayne@68 20294 #if PY_VERSION_HEX >= 0x030400a1
jpayne@68 20295 #if CYTHON_USE_TP_FINALIZE
jpayne@68 20296 0, /*tp_finalize*/
jpayne@68 20297 #else
jpayne@68 20298 NULL, /*tp_finalize*/
jpayne@68 20299 #endif
jpayne@68 20300 #endif
jpayne@68 20301 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
jpayne@68 20302 0, /*tp_vectorcall*/
jpayne@68 20303 #endif
jpayne@68 20304 #if __PYX_NEED_TP_PRINT_SLOT == 1
jpayne@68 20305 0, /*tp_print*/
jpayne@68 20306 #endif
jpayne@68 20307 #if PY_VERSION_HEX >= 0x030C0000
jpayne@68 20308 0, /*tp_watched*/
jpayne@68 20309 #endif
jpayne@68 20310 #if PY_VERSION_HEX >= 0x030d00A4
jpayne@68 20311 0, /*tp_versions_used*/
jpayne@68 20312 #endif
jpayne@68 20313 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
jpayne@68 20314 0, /*tp_pypy_flags*/
jpayne@68 20315 #endif
jpayne@68 20316 };
jpayne@68 20317 #endif
jpayne@68 20318
jpayne@68 20319 static PyMethodDef __pyx_methods[] = {
jpayne@68 20320 {0, 0, 0, 0}
jpayne@68 20321 };
jpayne@68 20322 #ifndef CYTHON_SMALL_CODE
jpayne@68 20323 #if defined(__clang__)
jpayne@68 20324 #define CYTHON_SMALL_CODE
jpayne@68 20325 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
jpayne@68 20326 #define CYTHON_SMALL_CODE __attribute__((cold))
jpayne@68 20327 #else
jpayne@68 20328 #define CYTHON_SMALL_CODE
jpayne@68 20329 #endif
jpayne@68 20330 #endif
jpayne@68 20331 /* #### Code section: pystring_table ### */
jpayne@68 20332
jpayne@68 20333 static int __Pyx_CreateStringTabAndInitStrings(void) {
jpayne@68 20334 __Pyx_StringTabEntry __pyx_string_tab[] = {
jpayne@68 20335 {&__pyx_n_u_ALIGNMENTS, __pyx_k_ALIGNMENTS, sizeof(__pyx_k_ALIGNMENTS), 0, 1, 0, 1},
jpayne@68 20336 {&__pyx_kp_u_An_error_occurred_while_applying, __pyx_k_An_error_occurred_while_applying, sizeof(__pyx_k_An_error_occurred_while_applying), 0, 1, 0, 0},
jpayne@68 20337 {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
jpayne@68 20338 {&__pyx_n_u_BAI, __pyx_k_BAI, sizeof(__pyx_k_BAI), 0, 1, 0, 1},
jpayne@68 20339 {&__pyx_n_u_BAM, __pyx_k_BAM, sizeof(__pyx_k_BAM), 0, 1, 0, 1},
jpayne@68 20340 {&__pyx_n_u_BCF, __pyx_k_BCF, sizeof(__pyx_k_BCF), 0, 1, 0, 1},
jpayne@68 20341 {&__pyx_n_u_BED, __pyx_k_BED, sizeof(__pyx_k_BED), 0, 1, 0, 1},
jpayne@68 20342 {&__pyx_n_u_BGZF, __pyx_k_BGZF, sizeof(__pyx_k_BGZF), 0, 1, 0, 1},
jpayne@68 20343 {&__pyx_n_u_BINARY_FORMAT, __pyx_k_BINARY_FORMAT, sizeof(__pyx_k_BINARY_FORMAT), 0, 1, 0, 1},
jpayne@68 20344 {&__pyx_n_s_CFalse, __pyx_k_CFalse, sizeof(__pyx_k_CFalse), 0, 0, 1, 1},
jpayne@68 20345 {&__pyx_n_u_CRAI, __pyx_k_CRAI, sizeof(__pyx_k_CRAI), 0, 1, 0, 1},
jpayne@68 20346 {&__pyx_n_u_CRAM, __pyx_k_CRAM, sizeof(__pyx_k_CRAM), 0, 1, 0, 1},
jpayne@68 20347 {&__pyx_n_u_CSI, __pyx_k_CSI, sizeof(__pyx_k_CSI), 0, 1, 0, 1},
jpayne@68 20348 {&__pyx_n_s_CTrue, __pyx_k_CTrue, sizeof(__pyx_k_CTrue), 0, 0, 1, 1},
jpayne@68 20349 {&__pyx_n_u_CUSTOM, __pyx_k_CUSTOM, sizeof(__pyx_k_CUSTOM), 0, 1, 0, 1},
jpayne@68 20350 {&__pyx_n_s_CallableValue, __pyx_k_CallableValue, sizeof(__pyx_k_CallableValue), 0, 0, 1, 1},
jpayne@68 20351 {&__pyx_n_s_CallableValue___bool, __pyx_k_CallableValue___bool, sizeof(__pyx_k_CallableValue___bool), 0, 0, 1, 1},
jpayne@68 20352 {&__pyx_n_s_CallableValue___call, __pyx_k_CallableValue___call, sizeof(__pyx_k_CallableValue___call), 0, 0, 1, 1},
jpayne@68 20353 {&__pyx_n_s_CallableValue___eq, __pyx_k_CallableValue___eq, sizeof(__pyx_k_CallableValue___eq), 0, 0, 1, 1},
jpayne@68 20354 {&__pyx_n_s_CallableValue___init, __pyx_k_CallableValue___init, sizeof(__pyx_k_CallableValue___init), 0, 0, 1, 1},
jpayne@68 20355 {&__pyx_n_s_CallableValue___ne, __pyx_k_CallableValue___ne, sizeof(__pyx_k_CallableValue___ne), 0, 0, 1, 1},
jpayne@68 20356 {&__pyx_n_s_CallableValue___nonzero, __pyx_k_CallableValue___nonzero, sizeof(__pyx_k_CallableValue___nonzero), 0, 0, 1, 1},
jpayne@68 20357 {&__pyx_kp_u_Cannot_create_hfile, __pyx_k_Cannot_create_hfile, sizeof(__pyx_k_Cannot_create_hfile), 0, 1, 0, 0},
jpayne@68 20358 {&__pyx_kp_u_Flushing, __pyx_k_Flushing, sizeof(__pyx_k_Flushing), 0, 1, 0, 0},
jpayne@68 20359 {&__pyx_n_u_GZI, __pyx_k_GZI, sizeof(__pyx_k_GZI), 0, 1, 0, 1},
jpayne@68 20360 {&__pyx_n_u_GZIP, __pyx_k_GZIP, sizeof(__pyx_k_GZIP), 0, 1, 0, 1},
jpayne@68 20361 {&__pyx_n_s_HFile, __pyx_k_HFile, sizeof(__pyx_k_HFile), 0, 0, 1, 1},
jpayne@68 20362 {&__pyx_n_u_HFile, __pyx_k_HFile, sizeof(__pyx_k_HFile), 0, 1, 0, 1},
jpayne@68 20363 {&__pyx_n_s_HFile___enter, __pyx_k_HFile___enter, sizeof(__pyx_k_HFile___enter), 0, 0, 1, 1},
jpayne@68 20364 {&__pyx_n_s_HFile___exit, __pyx_k_HFile___exit, sizeof(__pyx_k_HFile___exit), 0, 0, 1, 1},
jpayne@68 20365 {&__pyx_n_s_HFile___reduce_cython, __pyx_k_HFile___reduce_cython, sizeof(__pyx_k_HFile___reduce_cython), 0, 0, 1, 1},
jpayne@68 20366 {&__pyx_n_s_HFile___setstate_cython, __pyx_k_HFile___setstate_cython, sizeof(__pyx_k_HFile___setstate_cython), 0, 0, 1, 1},
jpayne@68 20367 {&__pyx_n_s_HFile_close, __pyx_k_HFile_close, sizeof(__pyx_k_HFile_close), 0, 0, 1, 1},
jpayne@68 20368 {&__pyx_n_s_HFile_fileno, __pyx_k_HFile_fileno, sizeof(__pyx_k_HFile_fileno), 0, 0, 1, 1},
jpayne@68 20369 {&__pyx_n_s_HFile_flush, __pyx_k_HFile_flush, sizeof(__pyx_k_HFile_flush), 0, 0, 1, 1},
jpayne@68 20370 {&__pyx_n_s_HFile_isatty, __pyx_k_HFile_isatty, sizeof(__pyx_k_HFile_isatty), 0, 0, 1, 1},
jpayne@68 20371 {&__pyx_n_s_HFile_read, __pyx_k_HFile_read, sizeof(__pyx_k_HFile_read), 0, 0, 1, 1},
jpayne@68 20372 {&__pyx_n_s_HFile_readable, __pyx_k_HFile_readable, sizeof(__pyx_k_HFile_readable), 0, 0, 1, 1},
jpayne@68 20373 {&__pyx_n_s_HFile_readall, __pyx_k_HFile_readall, sizeof(__pyx_k_HFile_readall), 0, 0, 1, 1},
jpayne@68 20374 {&__pyx_n_s_HFile_readinto, __pyx_k_HFile_readinto, sizeof(__pyx_k_HFile_readinto), 0, 0, 1, 1},
jpayne@68 20375 {&__pyx_n_s_HFile_readline, __pyx_k_HFile_readline, sizeof(__pyx_k_HFile_readline), 0, 0, 1, 1},
jpayne@68 20376 {&__pyx_n_s_HFile_readlines, __pyx_k_HFile_readlines, sizeof(__pyx_k_HFile_readlines), 0, 0, 1, 1},
jpayne@68 20377 {&__pyx_n_s_HFile_seek, __pyx_k_HFile_seek, sizeof(__pyx_k_HFile_seek), 0, 0, 1, 1},
jpayne@68 20378 {&__pyx_n_s_HFile_seekable, __pyx_k_HFile_seekable, sizeof(__pyx_k_HFile_seekable), 0, 0, 1, 1},
jpayne@68 20379 {&__pyx_n_s_HFile_tell, __pyx_k_HFile_tell, sizeof(__pyx_k_HFile_tell), 0, 0, 1, 1},
jpayne@68 20380 {&__pyx_n_s_HFile_truncate, __pyx_k_HFile_truncate, sizeof(__pyx_k_HFile_truncate), 0, 0, 1, 1},
jpayne@68 20381 {&__pyx_n_s_HFile_writable, __pyx_k_HFile_writable, sizeof(__pyx_k_HFile_writable), 0, 0, 1, 1},
jpayne@68 20382 {&__pyx_n_s_HFile_write, __pyx_k_HFile_write, sizeof(__pyx_k_HFile_write), 0, 0, 1, 1},
jpayne@68 20383 {&__pyx_n_s_HFile_writelines, __pyx_k_HFile_writelines, sizeof(__pyx_k_HFile_writelines), 0, 0, 1, 1},
jpayne@68 20384 {&__pyx_n_s_HTSFile, __pyx_k_HTSFile, sizeof(__pyx_k_HTSFile), 0, 0, 1, 1},
jpayne@68 20385 {&__pyx_n_u_HTSFile, __pyx_k_HTSFile, sizeof(__pyx_k_HTSFile), 0, 1, 0, 1},
jpayne@68 20386 {&__pyx_n_s_HTSFile___enter, __pyx_k_HTSFile___enter, sizeof(__pyx_k_HTSFile___enter), 0, 0, 1, 1},
jpayne@68 20387 {&__pyx_n_s_HTSFile___exit, __pyx_k_HTSFile___exit, sizeof(__pyx_k_HTSFile___exit), 0, 0, 1, 1},
jpayne@68 20388 {&__pyx_n_s_HTSFile___reduce_cython, __pyx_k_HTSFile___reduce_cython, sizeof(__pyx_k_HTSFile___reduce_cython), 0, 0, 1, 1},
jpayne@68 20389 {&__pyx_n_s_HTSFile___setstate_cython, __pyx_k_HTSFile___setstate_cython, sizeof(__pyx_k_HTSFile___setstate_cython), 0, 0, 1, 1},
jpayne@68 20390 {&__pyx_n_s_HTSFile_add_hts_options, __pyx_k_HTSFile_add_hts_options, sizeof(__pyx_k_HTSFile_add_hts_options), 0, 0, 1, 1},
jpayne@68 20391 {&__pyx_n_s_HTSFile_check_truncation, __pyx_k_HTSFile_check_truncation, sizeof(__pyx_k_HTSFile_check_truncation), 0, 0, 1, 1},
jpayne@68 20392 {&__pyx_n_s_HTSFile_close, __pyx_k_HTSFile_close, sizeof(__pyx_k_HTSFile_close), 0, 0, 1, 1},
jpayne@68 20393 {&__pyx_n_s_HTSFile_flush, __pyx_k_HTSFile_flush, sizeof(__pyx_k_HTSFile_flush), 0, 0, 1, 1},
jpayne@68 20394 {&__pyx_n_s_HTSFile_get_reference_name, __pyx_k_HTSFile_get_reference_name, sizeof(__pyx_k_HTSFile_get_reference_name), 0, 0, 1, 1},
jpayne@68 20395 {&__pyx_n_s_HTSFile_get_tid, __pyx_k_HTSFile_get_tid, sizeof(__pyx_k_HTSFile_get_tid), 0, 0, 1, 1},
jpayne@68 20396 {&__pyx_n_s_HTSFile_is_valid_reference_name, __pyx_k_HTSFile_is_valid_reference_name, sizeof(__pyx_k_HTSFile_is_valid_reference_name), 0, 0, 1, 1},
jpayne@68 20397 {&__pyx_n_s_HTSFile_is_valid_tid, __pyx_k_HTSFile_is_valid_tid, sizeof(__pyx_k_HTSFile_is_valid_tid), 0, 0, 1, 1},
jpayne@68 20398 {&__pyx_n_s_HTSFile_parse_region, __pyx_k_HTSFile_parse_region, sizeof(__pyx_k_HTSFile_parse_region), 0, 0, 1, 1},
jpayne@68 20399 {&__pyx_n_s_HTSFile_reset, __pyx_k_HTSFile_reset, sizeof(__pyx_k_HTSFile_reset), 0, 0, 1, 1},
jpayne@68 20400 {&__pyx_n_s_HTSFile_seek, __pyx_k_HTSFile_seek, sizeof(__pyx_k_HTSFile_seek), 0, 0, 1, 1},
jpayne@68 20401 {&__pyx_n_s_HTSFile_tell, __pyx_k_HTSFile_tell, sizeof(__pyx_k_HTSFile_tell), 0, 0, 1, 1},
jpayne@68 20402 {&__pyx_n_u_INDEX, __pyx_k_INDEX, sizeof(__pyx_k_INDEX), 0, 1, 0, 1},
jpayne@68 20403 {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
jpayne@68 20404 {&__pyx_kp_u_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 1, 0, 0},
jpayne@68 20405 {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
jpayne@68 20406 {&__pyx_kp_u_Invalid_format_option_specified, __pyx_k_Invalid_format_option_specified, sizeof(__pyx_k_Invalid_format_option_specified), 0, 1, 0, 0},
jpayne@68 20407 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
jpayne@68 20408 {&__pyx_n_u_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 1, 0, 1},
jpayne@68 20409 {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
jpayne@68 20410 {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
jpayne@68 20411 {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
jpayne@68 20412 {&__pyx_n_u_REGIONS, __pyx_k_REGIONS, sizeof(__pyx_k_REGIONS), 0, 1, 0, 1},
jpayne@68 20413 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
jpayne@68 20414 {&__pyx_n_u_SAM, __pyx_k_SAM, sizeof(__pyx_k_SAM), 0, 1, 0, 1},
jpayne@68 20415 {&__pyx_n_s_SEEK_SET, __pyx_k_SEEK_SET, sizeof(__pyx_k_SEEK_SET), 0, 0, 1, 1},
jpayne@68 20416 {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
jpayne@68 20417 {&__pyx_n_u_TBI, __pyx_k_TBI, sizeof(__pyx_k_TBI), 0, 1, 0, 1},
jpayne@68 20418 {&__pyx_n_u_TEXT_FORMAT, __pyx_k_TEXT_FORMAT, sizeof(__pyx_k_TEXT_FORMAT), 0, 1, 0, 1},
jpayne@68 20419 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
jpayne@68 20420 {&__pyx_n_u_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 1, 0, 1},
jpayne@68 20421 {&__pyx_n_u_VARIANTS, __pyx_k_VARIANTS, sizeof(__pyx_k_VARIANTS), 0, 1, 0, 1},
jpayne@68 20422 {&__pyx_n_u_VCF, __pyx_k_VCF, sizeof(__pyx_k_VCF), 0, 1, 0, 1},
jpayne@68 20423 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
jpayne@68 20424 {&__pyx_kp_b__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 0, 0},
jpayne@68 20425 {&__pyx_kp_u__55, __pyx_k__55, sizeof(__pyx_k__55), 0, 1, 0, 0},
jpayne@68 20426 {&__pyx_kp_u__56, __pyx_k__56, sizeof(__pyx_k__56), 0, 1, 0, 0},
jpayne@68 20427 {&__pyx_n_s__58, __pyx_k__58, sizeof(__pyx_k__58), 0, 0, 1, 1},
jpayne@68 20428 {&__pyx_kp_u__58, __pyx_k__58, sizeof(__pyx_k__58), 0, 1, 0, 0},
jpayne@68 20429 {&__pyx_kp_u__59, __pyx_k__59, sizeof(__pyx_k__59), 0, 1, 0, 0},
jpayne@68 20430 {&__pyx_n_s__97, __pyx_k__97, sizeof(__pyx_k__97), 0, 0, 1, 1},
jpayne@68 20431 {&__pyx_n_s_add_hts_options, __pyx_k_add_hts_options, sizeof(__pyx_k_add_hts_options), 0, 0, 1, 1},
jpayne@68 20432 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
jpayne@68 20433 {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
jpayne@68 20434 {&__pyx_n_b_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 0, 1},
jpayne@68 20435 {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
jpayne@68 20436 {&__pyx_n_s_bgzfp, __pyx_k_bgzfp, sizeof(__pyx_k_bgzfp), 0, 0, 1, 1},
jpayne@68 20437 {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
jpayne@68 20438 {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
jpayne@68 20439 {&__pyx_n_s_bytes_read, __pyx_k_bytes_read, sizeof(__pyx_k_bytes_read), 0, 0, 1, 1},
jpayne@68 20440 {&__pyx_n_b_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 0, 1},
jpayne@68 20441 {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
jpayne@68 20442 {&__pyx_n_s_check_truncation, __pyx_k_check_truncation, sizeof(__pyx_k_check_truncation), 0, 0, 1, 1},
jpayne@68 20443 {&__pyx_n_s_chunk_size, __pyx_k_chunk_size, sizeof(__pyx_k_chunk_size), 0, 0, 1, 1},
jpayne@68 20444 {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
jpayne@68 20445 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
jpayne@68 20446 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
jpayne@68 20447 {&__pyx_n_s_closefd, __pyx_k_closefd, sizeof(__pyx_k_closefd), 0, 0, 1, 1},
jpayne@68 20448 {&__pyx_n_s_contig, __pyx_k_contig, sizeof(__pyx_k_contig), 0, 0, 1, 1},
jpayne@68 20449 {&__pyx_kp_u_contig_and_reference_should_not, __pyx_k_contig_and_reference_should_not, sizeof(__pyx_k_contig_and_reference_should_not), 0, 1, 0, 0},
jpayne@68 20450 {&__pyx_n_s_coord, __pyx_k_coord, sizeof(__pyx_k_coord), 0, 0, 1, 1},
jpayne@68 20451 {&__pyx_n_s_cpart, __pyx_k_cpart, sizeof(__pyx_k_cpart), 0, 0, 1, 1},
jpayne@68 20452 {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
jpayne@68 20453 {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
jpayne@68 20454 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
jpayne@68 20455 {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
jpayne@68 20456 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
jpayne@68 20457 {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
jpayne@68 20458 {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1},
jpayne@68 20459 {&__pyx_kp_u_error_checking_for_EOF_marker, __pyx_k_error_checking_for_EOF_marker, sizeof(__pyx_k_error_checking_for_EOF_marker), 0, 1, 0, 0},
jpayne@68 20460 {&__pyx_n_s_exc_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 0, 0, 1, 1},
jpayne@68 20461 {&__pyx_n_s_exc_value, __pyx_k_exc_value, sizeof(__pyx_k_exc_value), 0, 0, 1, 1},
jpayne@68 20462 {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
jpayne@68 20463 {&__pyx_kp_u_failed, __pyx_k_failed, sizeof(__pyx_k_failed), 0, 1, 0, 0},
jpayne@68 20464 {&__pyx_kp_u_failed_to_close_HFile, __pyx_k_failed_to_close_HFile, sizeof(__pyx_k_failed_to_close_HFile), 0, 1, 0, 0},
jpayne@68 20465 {&__pyx_kp_u_failed_to_flush_HFile, __pyx_k_failed_to_flush_HFile, sizeof(__pyx_k_failed_to_flush_HFile), 0, 1, 0, 0},
jpayne@68 20466 {&__pyx_kp_u_failed_to_open_HFile, __pyx_k_failed_to_open_HFile, sizeof(__pyx_k_failed_to_open_HFile), 0, 1, 0, 0},
jpayne@68 20467 {&__pyx_kp_u_failed_to_read_HFile, __pyx_k_failed_to_read_HFile, sizeof(__pyx_k_failed_to_read_HFile), 0, 1, 0, 0},
jpayne@68 20468 {&__pyx_kp_u_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 1, 0, 0},
jpayne@68 20469 {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1},
jpayne@68 20470 {&__pyx_kp_u_fileno_not_available, __pyx_k_fileno_not_available, sizeof(__pyx_k_fileno_not_available), 0, 1, 0, 0},
jpayne@68 20471 {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
jpayne@68 20472 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
jpayne@68 20473 {&__pyx_n_s_format_option, __pyx_k_format_option, sizeof(__pyx_k_format_option), 0, 0, 1, 1},
jpayne@68 20474 {&__pyx_n_s_format_options, __pyx_k_format_options, sizeof(__pyx_k_format_options), 0, 0, 1, 1},
jpayne@68 20475 {&__pyx_n_s_fp, __pyx_k_fp, sizeof(__pyx_k_fp), 0, 0, 1, 1},
jpayne@68 20476 {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
jpayne@68 20477 {&__pyx_n_s_get_reference_name, __pyx_k_get_reference_name, sizeof(__pyx_k_get_reference_name), 0, 0, 1, 1},
jpayne@68 20478 {&__pyx_n_s_get_tid, __pyx_k_get_tid, sizeof(__pyx_k_get_tid), 0, 0, 1, 1},
jpayne@68 20479 {&__pyx_n_s_get_verbosity, __pyx_k_get_verbosity, sizeof(__pyx_k_get_verbosity), 0, 0, 1, 1},
jpayne@68 20480 {&__pyx_n_u_get_verbosity, __pyx_k_get_verbosity, sizeof(__pyx_k_get_verbosity), 0, 1, 0, 1},
jpayne@68 20481 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
jpayne@68 20482 {&__pyx_n_s_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 0, 1, 1},
jpayne@68 20483 {&__pyx_n_s_ignore_truncation, __pyx_k_ignore_truncation, sizeof(__pyx_k_ignore_truncation), 0, 0, 1, 1},
jpayne@68 20484 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
jpayne@68 20485 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
jpayne@68 20486 {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
jpayne@68 20487 {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
jpayne@68 20488 {&__pyx_kp_u_invalid_contig_s, __pyx_k_invalid_contig_s, sizeof(__pyx_k_invalid_contig_s), 0, 1, 0, 0},
jpayne@68 20489 {&__pyx_kp_u_invalid_coordinates_start_i_stop, __pyx_k_invalid_coordinates_start_i_stop, sizeof(__pyx_k_invalid_coordinates_start_i_stop), 0, 1, 0, 0},
jpayne@68 20490 {&__pyx_kp_u_invalid_tid, __pyx_k_invalid_tid, sizeof(__pyx_k_invalid_tid), 0, 1, 0, 0},
jpayne@68 20491 {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
jpayne@68 20492 {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
jpayne@68 20493 {&__pyx_n_s_is_open, __pyx_k_is_open, sizeof(__pyx_k_is_open), 0, 0, 1, 1},
jpayne@68 20494 {&__pyx_n_s_is_valid_reference_name, __pyx_k_is_valid_reference_name, sizeof(__pyx_k_is_valid_reference_name), 0, 0, 1, 1},
jpayne@68 20495 {&__pyx_n_s_is_valid_tid, __pyx_k_is_valid_tid, sizeof(__pyx_k_is_valid_tid), 0, 0, 1, 1},
jpayne@68 20496 {&__pyx_n_s_isatty, __pyx_k_isatty, sizeof(__pyx_k_isatty), 0, 0, 1, 1},
jpayne@68 20497 {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
jpayne@68 20498 {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
jpayne@68 20499 {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
jpayne@68 20500 {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1},
jpayne@68 20501 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
jpayne@68 20502 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
jpayne@68 20503 {&__pyx_kp_u_metadata_not_available_on_closed, __pyx_k_metadata_not_available_on_closed, sizeof(__pyx_k_metadata_not_available_on_closed), 0, 1, 0, 0},
jpayne@68 20504 {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
jpayne@68 20505 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
jpayne@68 20506 {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
jpayne@68 20507 {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
jpayne@68 20508 {&__pyx_n_s_mv, __pyx_k_mv, sizeof(__pyx_k_mv), 0, 0, 1, 1},
jpayne@68 20509 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
jpayne@68 20510 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
jpayne@68 20511 {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1},
jpayne@68 20512 {&__pyx_kp_u_no_BGZF_EOF_marker_file_may_be_t, __pyx_k_no_BGZF_EOF_marker_file_may_be_t, sizeof(__pyx_k_no_BGZF_EOF_marker_file_may_be_t), 0, 1, 0, 0},
jpayne@68 20513 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
jpayne@68 20514 {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1},
jpayne@68 20515 {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
jpayne@68 20516 {&__pyx_n_s_off, __pyx_k_off, sizeof(__pyx_k_off), 0, 0, 1, 1},
jpayne@68 20517 {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
jpayne@68 20518 {&__pyx_kp_u_operation_on_closed_HFile, __pyx_k_operation_on_closed_HFile, sizeof(__pyx_k_operation_on_closed_HFile), 0, 1, 0, 0},
jpayne@68 20519 {&__pyx_n_s_opts, __pyx_k_opts, sizeof(__pyx_k_opts), 0, 0, 1, 1},
jpayne@68 20520 {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
jpayne@68 20521 {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
jpayne@68 20522 {&__pyx_n_s_parse_region, __pyx_k_parse_region, sizeof(__pyx_k_parse_region), 0, 0, 1, 1},
jpayne@68 20523 {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1},
jpayne@68 20524 {&__pyx_n_s_parts, __pyx_k_parts, sizeof(__pyx_k_parts), 0, 0, 1, 1},
jpayne@68 20525 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
jpayne@68 20526 {&__pyx_n_s_pysam_libchtslib, __pyx_k_pysam_libchtslib, sizeof(__pyx_k_pysam_libchtslib), 0, 0, 1, 1},
jpayne@68 20527 {&__pyx_kp_s_pysam_libchtslib_pyx, __pyx_k_pysam_libchtslib_pyx, sizeof(__pyx_k_pysam_libchtslib_pyx), 0, 0, 1, 0},
jpayne@68 20528 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
jpayne@68 20529 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
jpayne@68 20530 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
jpayne@68 20531 {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
jpayne@68 20532 {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
jpayne@68 20533 {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
jpayne@68 20534 {&__pyx_n_s_readable, __pyx_k_readable, sizeof(__pyx_k_readable), 0, 0, 1, 1},
jpayne@68 20535 {&__pyx_n_s_readall, __pyx_k_readall, sizeof(__pyx_k_readall), 0, 0, 1, 1},
jpayne@68 20536 {&__pyx_n_s_readinto, __pyx_k_readinto, sizeof(__pyx_k_readinto), 0, 0, 1, 1},
jpayne@68 20537 {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1},
jpayne@68 20538 {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1},
jpayne@68 20539 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
jpayne@68 20540 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
jpayne@68 20541 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
jpayne@68 20542 {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1},
jpayne@68 20543 {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1},
jpayne@68 20544 {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
jpayne@68 20545 {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
jpayne@68 20546 {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
jpayne@68 20547 {&__pyx_n_s_rstart, __pyx_k_rstart, sizeof(__pyx_k_rstart), 0, 0, 1, 1},
jpayne@68 20548 {&__pyx_n_s_rstop, __pyx_k_rstop, sizeof(__pyx_k_rstop), 0, 0, 1, 1},
jpayne@68 20549 {&__pyx_n_s_rtid, __pyx_k_rtid, sizeof(__pyx_k_rtid), 0, 0, 1, 1},
jpayne@68 20550 {&__pyx_n_s_rval, __pyx_k_rval, sizeof(__pyx_k_rval), 0, 0, 1, 1},
jpayne@68 20551 {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
jpayne@68 20552 {&__pyx_kp_u_seek_failed_on_HFile, __pyx_k_seek_failed_on_HFile, sizeof(__pyx_k_seek_failed_on_HFile), 0, 1, 0, 0},
jpayne@68 20553 {&__pyx_kp_u_seek_not_available_in_streams, __pyx_k_seek_not_available_in_streams, sizeof(__pyx_k_seek_not_available_in_streams), 0, 1, 0, 0},
jpayne@68 20554 {&__pyx_kp_u_seek_not_implemented_in_files_co, __pyx_k_seek_not_implemented_in_files_co, sizeof(__pyx_k_seek_not_implemented_in_files_co), 0, 1, 0, 0},
jpayne@68 20555 {&__pyx_n_s_seekable, __pyx_k_seekable, sizeof(__pyx_k_seekable), 0, 0, 1, 1},
jpayne@68 20556 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
jpayne@68 20557 {&__pyx_kp_s_self_fp_cannot_be_converted_to_a, __pyx_k_self_fp_cannot_be_converted_to_a, sizeof(__pyx_k_self_fp_cannot_be_converted_to_a), 0, 0, 1, 0},
jpayne@68 20558 {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
jpayne@68 20559 {&__pyx_n_s_set_verbosity, __pyx_k_set_verbosity, sizeof(__pyx_k_set_verbosity), 0, 0, 1, 1},
jpayne@68 20560 {&__pyx_n_u_set_verbosity, __pyx_k_set_verbosity, sizeof(__pyx_k_set_verbosity), 0, 1, 0, 1},
jpayne@68 20561 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
jpayne@68 20562 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
jpayne@68 20563 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
jpayne@68 20564 {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
jpayne@68 20565 {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
jpayne@68 20566 {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
jpayne@68 20567 {&__pyx_kp_u_start_out_of_range_i, __pyx_k_start_out_of_range_i, sizeof(__pyx_k_start_out_of_range_i), 0, 1, 0, 0},
jpayne@68 20568 {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
jpayne@68 20569 {&__pyx_kp_u_stop_and_end_should_not_both_be, __pyx_k_stop_and_end_should_not_both_be, sizeof(__pyx_k_stop_and_end_should_not_both_be), 0, 1, 0, 0},
jpayne@68 20570 {&__pyx_kp_u_stop_out_of_range_i, __pyx_k_stop_out_of_range_i, sizeof(__pyx_k_stop_out_of_range_i), 0, 1, 0, 0},
jpayne@68 20571 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
jpayne@68 20572 {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
jpayne@68 20573 {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1},
jpayne@68 20574 {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
jpayne@68 20575 {&__pyx_kp_u_tell_failed_on_HFile, __pyx_k_tell_failed_on_HFile, sizeof(__pyx_k_tell_failed_on_HFile), 0, 1, 0, 0},
jpayne@68 20576 {&__pyx_kp_u_tell_not_available_in_streams, __pyx_k_tell_not_available_in_streams, sizeof(__pyx_k_tell_not_available_in_streams), 0, 1, 0, 0},
jpayne@68 20577 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
jpayne@68 20578 {&__pyx_n_s_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 0, 1, 1},
jpayne@68 20579 {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
jpayne@68 20580 {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
jpayne@68 20581 {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
jpayne@68 20582 {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
jpayne@68 20583 {&__pyx_n_s_verbosity, __pyx_k_verbosity, sizeof(__pyx_k_verbosity), 0, 0, 1, 1},
jpayne@68 20584 {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1},
jpayne@68 20585 {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
jpayne@68 20586 {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
jpayne@68 20587 {&__pyx_n_s_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 0, 0, 1, 1},
jpayne@68 20588 {&__pyx_n_s_writable, __pyx_k_writable, sizeof(__pyx_k_writable), 0, 0, 1, 1},
jpayne@68 20589 {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
jpayne@68 20590 {&__pyx_kp_u_write_failed_on_HFile, __pyx_k_write_failed_on_HFile, sizeof(__pyx_k_write_failed_on_HFile), 0, 1, 0, 0},
jpayne@68 20591 {&__pyx_n_s_writelines, __pyx_k_writelines, sizeof(__pyx_k_writelines), 0, 0, 1, 1},
jpayne@68 20592 {0, 0, 0, 0, 0, 0, 0}
jpayne@68 20593 };
jpayne@68 20594 return __Pyx_InitStrings(__pyx_string_tab);
jpayne@68 20595 }
jpayne@68 20596 /* #### Code section: cached_builtins ### */
jpayne@68 20597 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
jpayne@68 20598 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 20599 __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 96, __pyx_L1_error)
jpayne@68 20600 __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 114, __pyx_L1_error)
jpayne@68 20601 __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 128, __pyx_L1_error)
jpayne@68 20602 __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 270, __pyx_L1_error)
jpayne@68 20603 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
jpayne@68 20604 __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 345, __pyx_L1_error)
jpayne@68 20605 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 381, __pyx_L1_error)
jpayne@68 20606 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 587, __pyx_L1_error)
jpayne@68 20607 __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(0, 657, __pyx_L1_error)
jpayne@68 20608 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 679, __pyx_L1_error)
jpayne@68 20609 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 120, __pyx_L1_error)
jpayne@68 20610 return 0;
jpayne@68 20611 __pyx_L1_error:;
jpayne@68 20612 return -1;
jpayne@68 20613 }
jpayne@68 20614 /* #### Code section: cached_constants ### */
jpayne@68 20615
jpayne@68 20616 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
jpayne@68 20617 __Pyx_RefNannyDeclarations
jpayne@68 20618 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
jpayne@68 20619
jpayne@68 20620 /* "pysam/libchtslib.pyx":110
jpayne@68 20621 * def fileno(self):
jpayne@68 20622 * if self.fp == NULL:
jpayne@68 20623 * raise IOError('operation on closed HFile') # <<<<<<<<<<<<<<
jpayne@68 20624 * if isinstance(self.name, int):
jpayne@68 20625 * return self.name
jpayne@68 20626 */
jpayne@68 20627 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_operation_on_closed_HFile); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 110, __pyx_L1_error)
jpayne@68 20628 __Pyx_GOTREF(__pyx_tuple__5);
jpayne@68 20629 __Pyx_GIVEREF(__pyx_tuple__5);
jpayne@68 20630
jpayne@68 20631 /* "pysam/libchtslib.pyx":114
jpayne@68 20632 * return self.name
jpayne@68 20633 * else:
jpayne@68 20634 * raise AttributeError('fileno not available') # <<<<<<<<<<<<<<
jpayne@68 20635 *
jpayne@68 20636 * def __enter__(self):
jpayne@68 20637 */
jpayne@68 20638 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_fileno_not_available); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 114, __pyx_L1_error)
jpayne@68 20639 __Pyx_GOTREF(__pyx_tuple__6);
jpayne@68 20640 __Pyx_GIVEREF(__pyx_tuple__6);
jpayne@68 20641
jpayne@68 20642 /* "pysam/libchtslib.pyx":381
jpayne@68 20643 * VARIANTS, INDEX, REGIONS"""
jpayne@68 20644 * if not self.htsfile:
jpayne@68 20645 * raise ValueError('metadata not available on closed file') # <<<<<<<<<<<<<<
jpayne@68 20646 * return FORMAT_CATEGORIES[self.htsfile.format.category]
jpayne@68 20647 *
jpayne@68 20648 */
jpayne@68 20649 __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_metadata_not_available_on_closed); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 381, __pyx_L1_error)
jpayne@68 20650 __Pyx_GOTREF(__pyx_tuple__39);
jpayne@68 20651 __Pyx_GIVEREF(__pyx_tuple__39);
jpayne@68 20652
jpayne@68 20653 /* "pysam/libchtslib.pyx":486
jpayne@68 20654 * """move file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`."""
jpayne@68 20655 * if not self.is_open:
jpayne@68 20656 * raise ValueError('I/O operation on closed file') # <<<<<<<<<<<<<<
jpayne@68 20657 * if self.is_stream:
jpayne@68 20658 * raise IOError('seek not available in streams')
jpayne@68 20659 */
jpayne@68 20660 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 486, __pyx_L1_error)
jpayne@68 20661 __Pyx_GOTREF(__pyx_tuple__43);
jpayne@68 20662 __Pyx_GIVEREF(__pyx_tuple__43);
jpayne@68 20663
jpayne@68 20664 /* "pysam/libchtslib.pyx":488
jpayne@68 20665 * raise ValueError('I/O operation on closed file')
jpayne@68 20666 * if self.is_stream:
jpayne@68 20667 * raise IOError('seek not available in streams') # <<<<<<<<<<<<<<
jpayne@68 20668 *
jpayne@68 20669 * whence = libc_whence_from_io(whence)
jpayne@68 20670 */
jpayne@68 20671 __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_seek_not_available_in_streams); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 488, __pyx_L1_error)
jpayne@68 20672 __Pyx_GOTREF(__pyx_tuple__44);
jpayne@68 20673 __Pyx_GIVEREF(__pyx_tuple__44);
jpayne@68 20674
jpayne@68 20675 /* "pysam/libchtslib.pyx":508
jpayne@68 20676 * raise ValueError('I/O operation on closed file')
jpayne@68 20677 * if self.is_stream:
jpayne@68 20678 * raise IOError('tell not available in streams') # <<<<<<<<<<<<<<
jpayne@68 20679 *
jpayne@68 20680 * cdef int64_t ret
jpayne@68 20681 */
jpayne@68 20682 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_tell_not_available_in_streams); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 508, __pyx_L1_error)
jpayne@68 20683 __Pyx_GOTREF(__pyx_tuple__46);
jpayne@68 20684 __Pyx_GIVEREF(__pyx_tuple__46);
jpayne@68 20685
jpayne@68 20686 /* "pysam/libchtslib.pyx":550
jpayne@68 20687 *
jpayne@68 20688 * # Replicate mode normalization done in hts_open_format
jpayne@68 20689 * smode = self.mode.replace(b'b', b'').replace(b'c', b'') # <<<<<<<<<<<<<<
jpayne@68 20690 * if b'b' in self.mode:
jpayne@68 20691 * smode += b'b'
jpayne@68 20692 */
jpayne@68 20693 __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_b_b, __pyx_kp_b__13); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 550, __pyx_L1_error)
jpayne@68 20694 __Pyx_GOTREF(__pyx_tuple__47);
jpayne@68 20695 __Pyx_GIVEREF(__pyx_tuple__47);
jpayne@68 20696 __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_b_c, __pyx_kp_b__13); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 550, __pyx_L1_error)
jpayne@68 20697 __Pyx_GOTREF(__pyx_tuple__48);
jpayne@68 20698 __Pyx_GIVEREF(__pyx_tuple__48);
jpayne@68 20699
jpayne@68 20700 /* "pysam/libchtslib.pyx":559
jpayne@68 20701 * hfile = hdopen(dup_fd, cmode)
jpayne@68 20702 * if hfile == NULL:
jpayne@68 20703 * raise IOError('Cannot create hfile') # <<<<<<<<<<<<<<
jpayne@68 20704 *
jpayne@68 20705 * try:
jpayne@68 20706 */
jpayne@68 20707 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_u_Cannot_create_hfile); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 559, __pyx_L1_error)
jpayne@68 20708 __Pyx_GOTREF(__pyx_tuple__49);
jpayne@68 20709 __Pyx_GIVEREF(__pyx_tuple__49);
jpayne@68 20710
jpayne@68 20711 /* "pysam/libchtslib.pyx":592
jpayne@68 20712 * if rval != 0:
jpayne@68 20713 * hts_opt_free(opts)
jpayne@68 20714 * raise RuntimeError('An error occurred while applying the requested format options') # <<<<<<<<<<<<<<
jpayne@68 20715 * hts_opt_free(opts)
jpayne@68 20716 *
jpayne@68 20717 */
jpayne@68 20718 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_u_An_error_occurred_while_applying); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 592, __pyx_L1_error)
jpayne@68 20719 __Pyx_GOTREF(__pyx_tuple__51);
jpayne@68 20720 __Pyx_GIVEREF(__pyx_tuple__51);
jpayne@68 20721
jpayne@68 20722 /* "pysam/libchtslib.pyx":640
jpayne@68 20723 * if reference is not None:
jpayne@68 20724 * if contig is not None:
jpayne@68 20725 * raise ValueError('contig and reference should not both be specified') # <<<<<<<<<<<<<<
jpayne@68 20726 * contig = reference
jpayne@68 20727 *
jpayne@68 20728 */
jpayne@68 20729 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_u_contig_and_reference_should_not); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 640, __pyx_L1_error)
jpayne@68 20730 __Pyx_GOTREF(__pyx_tuple__53);
jpayne@68 20731 __Pyx_GIVEREF(__pyx_tuple__53);
jpayne@68 20732
jpayne@68 20733 /* "pysam/libchtslib.pyx":645
jpayne@68 20734 * if end is not None:
jpayne@68 20735 * if stop is not None:
jpayne@68 20736 * raise ValueError('stop and end should not both be specified') # <<<<<<<<<<<<<<
jpayne@68 20737 * stop = end
jpayne@68 20738 *
jpayne@68 20739 */
jpayne@68 20740 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_u_stop_and_end_should_not_both_be); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 645, __pyx_L1_error)
jpayne@68 20741 __Pyx_GOTREF(__pyx_tuple__54);
jpayne@68 20742 __Pyx_GIVEREF(__pyx_tuple__54);
jpayne@68 20743
jpayne@68 20744 /* "pysam/libchtslib.pyx":679
jpayne@68 20745 * if tid is not None:
jpayne@68 20746 * if not self.is_valid_tid(tid):
jpayne@68 20747 * raise IndexError('invalid tid') # <<<<<<<<<<<<<<
jpayne@68 20748 * rtid = tid
jpayne@68 20749 * else:
jpayne@68 20750 */
jpayne@68 20751 __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_u_invalid_tid); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 679, __pyx_L1_error)
jpayne@68 20752 __Pyx_GOTREF(__pyx_tuple__57);
jpayne@68 20753 __Pyx_GIVEREF(__pyx_tuple__57);
jpayne@68 20754
jpayne@68 20755 /* "pysam/libchtslib.pyx":41
jpayne@68 20756 * cdef int MAX_POS = (1 << 31) - 1
jpayne@68 20757 *
jpayne@68 20758 * cdef tuple FORMAT_CATEGORIES = ('UNKNOWN', 'ALIGNMENTS', 'VARIANTS', 'INDEX', 'REGIONS') # <<<<<<<<<<<<<<
jpayne@68 20759 * cdef tuple FORMATS = ('UNKNOWN', 'BINARY_FORMAT', 'TEXT_FORMAT', 'SAM', 'BAM', 'BAI', 'CRAM', 'CRAI',
jpayne@68 20760 * 'VCF', 'BCF', 'CSI', 'GZI', 'TBI', 'BED')
jpayne@68 20761 */
jpayne@68 20762 __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_u_UNKNOWN, __pyx_n_u_ALIGNMENTS, __pyx_n_u_VARIANTS, __pyx_n_u_INDEX, __pyx_n_u_REGIONS); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 41, __pyx_L1_error)
jpayne@68 20763 __Pyx_GOTREF(__pyx_tuple__66);
jpayne@68 20764 __Pyx_GIVEREF(__pyx_tuple__66);
jpayne@68 20765
jpayne@68 20766 /* "pysam/libchtslib.pyx":42
jpayne@68 20767 *
jpayne@68 20768 * cdef tuple FORMAT_CATEGORIES = ('UNKNOWN', 'ALIGNMENTS', 'VARIANTS', 'INDEX', 'REGIONS')
jpayne@68 20769 * cdef tuple FORMATS = ('UNKNOWN', 'BINARY_FORMAT', 'TEXT_FORMAT', 'SAM', 'BAM', 'BAI', 'CRAM', 'CRAI', # <<<<<<<<<<<<<<
jpayne@68 20770 * 'VCF', 'BCF', 'CSI', 'GZI', 'TBI', 'BED')
jpayne@68 20771 * cdef tuple COMPRESSION = ('NONE', 'GZIP', 'BGZF', 'CUSTOM')
jpayne@68 20772 */
jpayne@68 20773 __pyx_tuple__67 = PyTuple_Pack(14, __pyx_n_u_UNKNOWN, __pyx_n_u_BINARY_FORMAT, __pyx_n_u_TEXT_FORMAT, __pyx_n_u_SAM, __pyx_n_u_BAM, __pyx_n_u_BAI, __pyx_n_u_CRAM, __pyx_n_u_CRAI, __pyx_n_u_VCF, __pyx_n_u_BCF, __pyx_n_u_CSI, __pyx_n_u_GZI, __pyx_n_u_TBI, __pyx_n_u_BED); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 42, __pyx_L1_error)
jpayne@68 20774 __Pyx_GOTREF(__pyx_tuple__67);
jpayne@68 20775 __Pyx_GIVEREF(__pyx_tuple__67);
jpayne@68 20776
jpayne@68 20777 /* "pysam/libchtslib.pyx":44
jpayne@68 20778 * cdef tuple FORMATS = ('UNKNOWN', 'BINARY_FORMAT', 'TEXT_FORMAT', 'SAM', 'BAM', 'BAI', 'CRAM', 'CRAI',
jpayne@68 20779 * 'VCF', 'BCF', 'CSI', 'GZI', 'TBI', 'BED')
jpayne@68 20780 * cdef tuple COMPRESSION = ('NONE', 'GZIP', 'BGZF', 'CUSTOM') # <<<<<<<<<<<<<<
jpayne@68 20781 *
jpayne@68 20782 *
jpayne@68 20783 */
jpayne@68 20784 __pyx_tuple__68 = PyTuple_Pack(4, __pyx_n_u_NONE, __pyx_n_u_GZIP, __pyx_n_u_BGZF, __pyx_n_u_CUSTOM); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 44, __pyx_L1_error)
jpayne@68 20785 __Pyx_GOTREF(__pyx_tuple__68);
jpayne@68 20786 __Pyx_GIVEREF(__pyx_tuple__68);
jpayne@68 20787
jpayne@68 20788 /* "pysam/libchtslib.pyx":53
jpayne@68 20789 *
jpayne@68 20790 *
jpayne@68 20791 * cpdef set_verbosity(int verbosity): # <<<<<<<<<<<<<<
jpayne@68 20792 * """Set htslib's hts_verbose global variable to the specified value."""
jpayne@68 20793 * return hts_set_verbosity(verbosity)
jpayne@68 20794 */
jpayne@68 20795 __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_verbosity); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 53, __pyx_L1_error)
jpayne@68 20796 __Pyx_GOTREF(__pyx_tuple__69);
jpayne@68 20797 __Pyx_GIVEREF(__pyx_tuple__69);
jpayne@68 20798 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_set_verbosity, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 53, __pyx_L1_error)
jpayne@68 20799
jpayne@68 20800 /* "pysam/libchtslib.pyx":57
jpayne@68 20801 * return hts_set_verbosity(verbosity)
jpayne@68 20802 *
jpayne@68 20803 * cpdef get_verbosity(): # <<<<<<<<<<<<<<
jpayne@68 20804 * """Return the value of htslib's hts_verbose global variable."""
jpayne@68 20805 * return hts_get_verbosity()
jpayne@68 20806 */
jpayne@68 20807 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_get_verbosity, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 57, __pyx_L1_error)
jpayne@68 20808
jpayne@68 20809 /* "pysam/libchtslib.pyx":98
jpayne@68 20810 * raise IOError(errno, 'failed to open HFile', self.name)
jpayne@68 20811 *
jpayne@68 20812 * def close(self): # <<<<<<<<<<<<<<
jpayne@68 20813 * if self.fp == NULL:
jpayne@68 20814 * return
jpayne@68 20815 */
jpayne@68 20816 __pyx_tuple__70 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_fp); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 98, __pyx_L1_error)
jpayne@68 20817 __Pyx_GOTREF(__pyx_tuple__70);
jpayne@68 20818 __Pyx_GIVEREF(__pyx_tuple__70);
jpayne@68 20819 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_close, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 98, __pyx_L1_error)
jpayne@68 20820
jpayne@68 20821 /* "pysam/libchtslib.pyx":108
jpayne@68 20822 * raise IOError(errno, 'failed to close HFile', self.name)
jpayne@68 20823 *
jpayne@68 20824 * def fileno(self): # <<<<<<<<<<<<<<
jpayne@68 20825 * if self.fp == NULL:
jpayne@68 20826 * raise IOError('operation on closed HFile')
jpayne@68 20827 */
jpayne@68 20828 __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 108, __pyx_L1_error)
jpayne@68 20829 __Pyx_GOTREF(__pyx_tuple__71);
jpayne@68 20830 __Pyx_GIVEREF(__pyx_tuple__71);
jpayne@68 20831 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_fileno, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 108, __pyx_L1_error)
jpayne@68 20832
jpayne@68 20833 /* "pysam/libchtslib.pyx":116
jpayne@68 20834 * raise AttributeError('fileno not available')
jpayne@68 20835 *
jpayne@68 20836 * def __enter__(self): # <<<<<<<<<<<<<<
jpayne@68 20837 * return self
jpayne@68 20838 *
jpayne@68 20839 */
jpayne@68 20840 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_enter, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 116, __pyx_L1_error)
jpayne@68 20841
jpayne@68 20842 /* "pysam/libchtslib.pyx":119
jpayne@68 20843 * return self
jpayne@68 20844 *
jpayne@68 20845 * def __exit__(self, type, value, tb): # <<<<<<<<<<<<<<
jpayne@68 20846 * self.close()
jpayne@68 20847 *
jpayne@68 20848 */
jpayne@68 20849 __pyx_tuple__72 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_value, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 119, __pyx_L1_error)
jpayne@68 20850 __Pyx_GOTREF(__pyx_tuple__72);
jpayne@68 20851 __Pyx_GIVEREF(__pyx_tuple__72);
jpayne@68 20852 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_exit, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 119, __pyx_L1_error)
jpayne@68 20853
jpayne@68 20854 /* "pysam/libchtslib.pyx":131
jpayne@68 20855 * return line
jpayne@68 20856 *
jpayne@68 20857 * def flush(self): # <<<<<<<<<<<<<<
jpayne@68 20858 * if self.fp == NULL:
jpayne@68 20859 * raise IOError('operation on closed HFile')
jpayne@68 20860 */
jpayne@68 20861 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_flush, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 131, __pyx_L1_error)
jpayne@68 20862
jpayne@68 20863 /* "pysam/libchtslib.pyx":137
jpayne@68 20864 * raise IOError(herrno(self.fp), 'failed to flush HFile', self.name)
jpayne@68 20865 *
jpayne@68 20866 * def isatty(self): # <<<<<<<<<<<<<<
jpayne@68 20867 * if self.fp == NULL:
jpayne@68 20868 * raise IOError('operation on closed HFile')
jpayne@68 20869 */
jpayne@68 20870 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_isatty, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 137, __pyx_L1_error)
jpayne@68 20871
jpayne@68 20872 /* "pysam/libchtslib.pyx":142
jpayne@68 20873 * return False
jpayne@68 20874 *
jpayne@68 20875 * def readable(self): # <<<<<<<<<<<<<<
jpayne@68 20876 * return self.fp != NULL and 'r' in self.mode
jpayne@68 20877 *
jpayne@68 20878 */
jpayne@68 20879 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_readable, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 142, __pyx_L1_error)
jpayne@68 20880
jpayne@68 20881 /* "pysam/libchtslib.pyx":145
jpayne@68 20882 * return self.fp != NULL and 'r' in self.mode
jpayne@68 20883 *
jpayne@68 20884 * def read(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<<
jpayne@68 20885 * if self.fp == NULL:
jpayne@68 20886 * raise IOError('operation on closed HFile')
jpayne@68 20887 */
jpayne@68 20888 __pyx_tuple__73 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_parts, __pyx_n_s_part, __pyx_n_s_chunk_size, __pyx_n_s_ret, __pyx_n_s_bytes_read, __pyx_n_s_cpart); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 145, __pyx_L1_error)
jpayne@68 20889 __Pyx_GOTREF(__pyx_tuple__73);
jpayne@68 20890 __Pyx_GIVEREF(__pyx_tuple__73);
jpayne@68 20891 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_read, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 145, __pyx_L1_error)
jpayne@68 20892 __pyx_tuple__74 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 145, __pyx_L1_error)
jpayne@68 20893 __Pyx_GOTREF(__pyx_tuple__74);
jpayne@68 20894 __Pyx_GIVEREF(__pyx_tuple__74);
jpayne@68 20895
jpayne@68 20896 /* "pysam/libchtslib.pyx":180
jpayne@68 20897 * return b''.join(parts)
jpayne@68 20898 *
jpayne@68 20899 * def readall(self): # <<<<<<<<<<<<<<
jpayne@68 20900 * return self.read()
jpayne@68 20901 *
jpayne@68 20902 */
jpayne@68 20903 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_readall, 180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 180, __pyx_L1_error)
jpayne@68 20904
jpayne@68 20905 /* "pysam/libchtslib.pyx":183
jpayne@68 20906 * return self.read()
jpayne@68 20907 *
jpayne@68 20908 * def readinto(self, buf): # <<<<<<<<<<<<<<
jpayne@68 20909 * if self.fp == NULL:
jpayne@68 20910 * raise IOError('operation on closed HFile')
jpayne@68 20911 */
jpayne@68 20912 __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_size, __pyx_n_s_mv, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 183, __pyx_L1_error)
jpayne@68 20913 __Pyx_GOTREF(__pyx_tuple__75);
jpayne@68 20914 __Pyx_GIVEREF(__pyx_tuple__75);
jpayne@68 20915 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_readinto, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 183, __pyx_L1_error)
jpayne@68 20916
jpayne@68 20917 /* "pysam/libchtslib.pyx":200
jpayne@68 20918 * return ret
jpayne@68 20919 *
jpayne@68 20920 * def readline(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<<
jpayne@68 20921 * if self.fp == NULL:
jpayne@68 20922 * raise IOError('operation on closed HFile')
jpayne@68 20923 */
jpayne@68 20924 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_readline, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 200, __pyx_L1_error)
jpayne@68 20925
jpayne@68 20926 /* "pysam/libchtslib.pyx":241
jpayne@68 20927 * return b''.join(parts)
jpayne@68 20928 *
jpayne@68 20929 * def readlines(self): # <<<<<<<<<<<<<<
jpayne@68 20930 * return list(self)
jpayne@68 20931 *
jpayne@68 20932 */
jpayne@68 20933 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_readlines, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 241, __pyx_L1_error)
jpayne@68 20934
jpayne@68 20935 /* "pysam/libchtslib.pyx":244
jpayne@68 20936 * return list(self)
jpayne@68 20937 *
jpayne@68 20938 * def seek(self, Py_ssize_t offset, int whence=io.SEEK_SET): # <<<<<<<<<<<<<<
jpayne@68 20939 * if self.fp == NULL:
jpayne@68 20940 * raise IOError('operation on closed HFile')
jpayne@68 20941 */
jpayne@68 20942 __pyx_tuple__76 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_whence, __pyx_n_s_off); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 20943 __Pyx_GOTREF(__pyx_tuple__76);
jpayne@68 20944 __Pyx_GIVEREF(__pyx_tuple__76);
jpayne@68 20945 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_seek, 244, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 20946
jpayne@68 20947 /* "pysam/libchtslib.pyx":255
jpayne@68 20948 * return off
jpayne@68 20949 *
jpayne@68 20950 * def tell(self): # <<<<<<<<<<<<<<
jpayne@68 20951 * if self.fp == NULL:
jpayne@68 20952 * raise IOError('operation on closed HFile')
jpayne@68 20953 */
jpayne@68 20954 __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 255, __pyx_L1_error)
jpayne@68 20955 __Pyx_GOTREF(__pyx_tuple__77);
jpayne@68 20956 __Pyx_GIVEREF(__pyx_tuple__77);
jpayne@68 20957 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_tell, 255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 255, __pyx_L1_error)
jpayne@68 20958
jpayne@68 20959 /* "pysam/libchtslib.pyx":266
jpayne@68 20960 * return ret
jpayne@68 20961 *
jpayne@68 20962 * def seekable(self): # <<<<<<<<<<<<<<
jpayne@68 20963 * return self.fp != NULL
jpayne@68 20964 *
jpayne@68 20965 */
jpayne@68 20966 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_seekable, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 266, __pyx_L1_error)
jpayne@68 20967
jpayne@68 20968 /* "pysam/libchtslib.pyx":269
jpayne@68 20969 * return self.fp != NULL
jpayne@68 20970 *
jpayne@68 20971 * def truncate(self, size=None): # <<<<<<<<<<<<<<
jpayne@68 20972 * raise NotImplementedError()
jpayne@68 20973 *
jpayne@68 20974 */
jpayne@68 20975 __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_size); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 269, __pyx_L1_error)
jpayne@68 20976 __Pyx_GOTREF(__pyx_tuple__78);
jpayne@68 20977 __Pyx_GIVEREF(__pyx_tuple__78);
jpayne@68 20978 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_truncate, 269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 269, __pyx_L1_error)
jpayne@68 20979 __pyx_tuple__79 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 269, __pyx_L1_error)
jpayne@68 20980 __Pyx_GOTREF(__pyx_tuple__79);
jpayne@68 20981 __Pyx_GIVEREF(__pyx_tuple__79);
jpayne@68 20982
jpayne@68 20983 /* "pysam/libchtslib.pyx":272
jpayne@68 20984 * raise NotImplementedError()
jpayne@68 20985 *
jpayne@68 20986 * def writable(self): # <<<<<<<<<<<<<<
jpayne@68 20987 * return self.fp != NULL and 'w' in self.mode
jpayne@68 20988 *
jpayne@68 20989 */
jpayne@68 20990 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_writable, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 272, __pyx_L1_error)
jpayne@68 20991
jpayne@68 20992 /* "pysam/libchtslib.pyx":275
jpayne@68 20993 * return self.fp != NULL and 'w' in self.mode
jpayne@68 20994 *
jpayne@68 20995 * def write(self, bytes b): # <<<<<<<<<<<<<<
jpayne@68 20996 * if self.fp == NULL:
jpayne@68 20997 * raise IOError('operation on closed HFile')
jpayne@68 20998 */
jpayne@68 20999 __pyx_tuple__80 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_b, __pyx_n_s_got); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 275, __pyx_L1_error)
jpayne@68 21000 __Pyx_GOTREF(__pyx_tuple__80);
jpayne@68 21001 __Pyx_GIVEREF(__pyx_tuple__80);
jpayne@68 21002 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_write, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 275, __pyx_L1_error)
jpayne@68 21003
jpayne@68 21004 /* "pysam/libchtslib.pyx":286
jpayne@68 21005 * return got
jpayne@68 21006 *
jpayne@68 21007 * def writelines(self, lines): # <<<<<<<<<<<<<<
jpayne@68 21008 * for line in lines:
jpayne@68 21009 * self.write(line)
jpayne@68 21010 */
jpayne@68 21011 __pyx_tuple__81 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_lines, __pyx_n_s_line); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 286, __pyx_L1_error)
jpayne@68 21012 __Pyx_GOTREF(__pyx_tuple__81);
jpayne@68 21013 __Pyx_GIVEREF(__pyx_tuple__81);
jpayne@68 21014 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_writelines, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 286, __pyx_L1_error)
jpayne@68 21015
jpayne@68 21016 /* "(tree fragment)":1
jpayne@68 21017 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
jpayne@68 21018 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 21019 * def __setstate_cython__(self, __pyx_state):
jpayne@68 21020 */
jpayne@68 21021 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 1, __pyx_L1_error)
jpayne@68 21022
jpayne@68 21023 /* "(tree fragment)":3
jpayne@68 21024 * def __reduce_cython__(self):
jpayne@68 21025 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 21026 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
jpayne@68 21027 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 21028 */
jpayne@68 21029 __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(1, 3, __pyx_L1_error)
jpayne@68 21030 __Pyx_GOTREF(__pyx_tuple__82);
jpayne@68 21031 __Pyx_GIVEREF(__pyx_tuple__82);
jpayne@68 21032 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 3, __pyx_L1_error)
jpayne@68 21033
jpayne@68 21034 /* "pysam/libchtslib.pyx":297
jpayne@68 21035 * ########################################################################
jpayne@68 21036 *
jpayne@68 21037 * class CallableValue(object): # <<<<<<<<<<<<<<
jpayne@68 21038 * def __init__(self, value):
jpayne@68 21039 * self.value = value
jpayne@68 21040 */
jpayne@68 21041 __pyx_tuple__83 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 21042 __Pyx_GOTREF(__pyx_tuple__83);
jpayne@68 21043 __Pyx_GIVEREF(__pyx_tuple__83);
jpayne@68 21044 __pyx_tuple__84 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 21045 __Pyx_GOTREF(__pyx_tuple__84);
jpayne@68 21046 __Pyx_GIVEREF(__pyx_tuple__84);
jpayne@68 21047
jpayne@68 21048 /* "pysam/libchtslib.pyx":298
jpayne@68 21049 *
jpayne@68 21050 * class CallableValue(object):
jpayne@68 21051 * def __init__(self, value): # <<<<<<<<<<<<<<
jpayne@68 21052 * self.value = value
jpayne@68 21053 * def __call__(self):
jpayne@68 21054 */
jpayne@68 21055 __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 298, __pyx_L1_error)
jpayne@68 21056 __Pyx_GOTREF(__pyx_tuple__85);
jpayne@68 21057 __Pyx_GIVEREF(__pyx_tuple__85);
jpayne@68 21058 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_init, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 298, __pyx_L1_error)
jpayne@68 21059
jpayne@68 21060 /* "pysam/libchtslib.pyx":300
jpayne@68 21061 * def __init__(self, value):
jpayne@68 21062 * self.value = value
jpayne@68 21063 * def __call__(self): # <<<<<<<<<<<<<<
jpayne@68 21064 * return self.value
jpayne@68 21065 * def __bool__(self):
jpayne@68 21066 */
jpayne@68 21067 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_call, 300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 300, __pyx_L1_error)
jpayne@68 21068
jpayne@68 21069 /* "pysam/libchtslib.pyx":302
jpayne@68 21070 * def __call__(self):
jpayne@68 21071 * return self.value
jpayne@68 21072 * def __bool__(self): # <<<<<<<<<<<<<<
jpayne@68 21073 * return self.value
jpayne@68 21074 * def __nonzero__(self):
jpayne@68 21075 */
jpayne@68 21076 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_bool, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 302, __pyx_L1_error)
jpayne@68 21077
jpayne@68 21078 /* "pysam/libchtslib.pyx":304
jpayne@68 21079 * def __bool__(self):
jpayne@68 21080 * return self.value
jpayne@68 21081 * def __nonzero__(self): # <<<<<<<<<<<<<<
jpayne@68 21082 * return self.value
jpayne@68 21083 * def __eq__(self, other):
jpayne@68 21084 */
jpayne@68 21085 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_nonzero, 304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 304, __pyx_L1_error)
jpayne@68 21086
jpayne@68 21087 /* "pysam/libchtslib.pyx":306
jpayne@68 21088 * def __nonzero__(self):
jpayne@68 21089 * return self.value
jpayne@68 21090 * def __eq__(self, other): # <<<<<<<<<<<<<<
jpayne@68 21091 * return self.value == other
jpayne@68 21092 * def __ne__(self, other):
jpayne@68 21093 */
jpayne@68 21094 __pyx_tuple__86 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 306, __pyx_L1_error)
jpayne@68 21095 __Pyx_GOTREF(__pyx_tuple__86);
jpayne@68 21096 __Pyx_GIVEREF(__pyx_tuple__86);
jpayne@68 21097 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_eq, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 306, __pyx_L1_error)
jpayne@68 21098
jpayne@68 21099 /* "pysam/libchtslib.pyx":308
jpayne@68 21100 * def __eq__(self, other):
jpayne@68 21101 * return self.value == other
jpayne@68 21102 * def __ne__(self, other): # <<<<<<<<<<<<<<
jpayne@68 21103 * return self.value != other
jpayne@68 21104 *
jpayne@68 21105 */
jpayne@68 21106 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_ne, 308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 308, __pyx_L1_error)
jpayne@68 21107
jpayne@68 21108 /* "pysam/libchtslib.pyx":312
jpayne@68 21109 *
jpayne@68 21110 *
jpayne@68 21111 * CTrue = CallableValue(True) # <<<<<<<<<<<<<<
jpayne@68 21112 * CFalse = CallableValue(False)
jpayne@68 21113 *
jpayne@68 21114 */
jpayne@68 21115 __pyx_tuple__87 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 312, __pyx_L1_error)
jpayne@68 21116 __Pyx_GOTREF(__pyx_tuple__87);
jpayne@68 21117 __Pyx_GIVEREF(__pyx_tuple__87);
jpayne@68 21118
jpayne@68 21119 /* "pysam/libchtslib.pyx":313
jpayne@68 21120 *
jpayne@68 21121 * CTrue = CallableValue(True)
jpayne@68 21122 * CFalse = CallableValue(False) # <<<<<<<<<<<<<<
jpayne@68 21123 *
jpayne@68 21124 *
jpayne@68 21125 */
jpayne@68 21126 __pyx_tuple__88 = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 313, __pyx_L1_error)
jpayne@68 21127 __Pyx_GOTREF(__pyx_tuple__88);
jpayne@68 21128 __Pyx_GIVEREF(__pyx_tuple__88);
jpayne@68 21129
jpayne@68 21130 /* "pysam/libchtslib.pyx":331
jpayne@68 21131 * self.duplicate_filehandle = True
jpayne@68 21132 *
jpayne@68 21133 * def close(self): # <<<<<<<<<<<<<<
jpayne@68 21134 * if self.htsfile:
jpayne@68 21135 * hts_close(self.htsfile)
jpayne@68 21136 */
jpayne@68 21137 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_close, 331, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 331, __pyx_L1_error)
jpayne@68 21138
jpayne@68 21139 /* "pysam/libchtslib.pyx":341
jpayne@68 21140 * self.htsfile = NULL
jpayne@68 21141 *
jpayne@68 21142 * def flush(self): # <<<<<<<<<<<<<<
jpayne@68 21143 * """Flush any buffered data to the underlying output stream."""
jpayne@68 21144 * if self.htsfile:
jpayne@68 21145 */
jpayne@68 21146 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_flush, 341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 341, __pyx_L1_error)
jpayne@68 21147
jpayne@68 21148 /* "pysam/libchtslib.pyx":347
jpayne@68 21149 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename))
jpayne@68 21150 *
jpayne@68 21151 * def check_truncation(self, ignore_truncation=False): # <<<<<<<<<<<<<<
jpayne@68 21152 * """Check if file is truncated."""
jpayne@68 21153 * if not self.htsfile:
jpayne@68 21154 */
jpayne@68 21155 __pyx_tuple__89 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_ignore_truncation, __pyx_n_s_bgzfp, __pyx_n_s_ret, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 347, __pyx_L1_error)
jpayne@68 21156 __Pyx_GOTREF(__pyx_tuple__89);
jpayne@68 21157 __Pyx_GIVEREF(__pyx_tuple__89);
jpayne@68 21158 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_check_truncation, 347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 347, __pyx_L1_error)
jpayne@68 21159
jpayne@68 21160 /* "pysam/libchtslib.pyx":369
jpayne@68 21161 * raise IOError(msg)
jpayne@68 21162 *
jpayne@68 21163 * def __enter__(self): # <<<<<<<<<<<<<<
jpayne@68 21164 * return self
jpayne@68 21165 *
jpayne@68 21166 */
jpayne@68 21167 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_enter, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 369, __pyx_L1_error)
jpayne@68 21168
jpayne@68 21169 /* "pysam/libchtslib.pyx":372
jpayne@68 21170 * return self
jpayne@68 21171 *
jpayne@68 21172 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<<
jpayne@68 21173 * self.close()
jpayne@68 21174 * return False
jpayne@68 21175 */
jpayne@68 21176 __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_value, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 372, __pyx_L1_error)
jpayne@68 21177 __Pyx_GOTREF(__pyx_tuple__90);
jpayne@68 21178 __Pyx_GIVEREF(__pyx_tuple__90);
jpayne@68 21179 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_exit, 372, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 372, __pyx_L1_error)
jpayne@68 21180
jpayne@68 21181 /* "pysam/libchtslib.pyx":472
jpayne@68 21182 * return self.htsfile != NULL and self.htsfile.format.format == bcf
jpayne@68 21183 *
jpayne@68 21184 * def reset(self): # <<<<<<<<<<<<<<
jpayne@68 21185 * """reset file position to beginning of file just after the header.
jpayne@68 21186 *
jpayne@68 21187 */
jpayne@68 21188 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_reset, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 472, __pyx_L1_error)
jpayne@68 21189
jpayne@68 21190 /* "pysam/libchtslib.pyx":483
jpayne@68 21191 * return self.seek(self.start_offset)
jpayne@68 21192 *
jpayne@68 21193 * def seek(self, uint64_t offset, int whence=io.SEEK_SET): # <<<<<<<<<<<<<<
jpayne@68 21194 * """move file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`."""
jpayne@68 21195 * if not self.is_open:
jpayne@68 21196 */
jpayne@68 21197 __pyx_tuple__91 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_whence, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 21198 __Pyx_GOTREF(__pyx_tuple__91);
jpayne@68 21199 __Pyx_GIVEREF(__pyx_tuple__91);
jpayne@68 21200 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_seek, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 21201
jpayne@68 21202 /* "pysam/libchtslib.pyx":503
jpayne@68 21203 * return ret
jpayne@68 21204 *
jpayne@68 21205 * def tell(self): # <<<<<<<<<<<<<<
jpayne@68 21206 * """return current file position, see :meth:`pysam.HTSFile.seek`."""
jpayne@68 21207 * if not self.is_open:
jpayne@68 21208 */
jpayne@68 21209 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_tell, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 503, __pyx_L1_error)
jpayne@68 21210
jpayne@68 21211 /* "pysam/libchtslib.pyx":575
jpayne@68 21212 * return htsfile
jpayne@68 21213 *
jpayne@68 21214 * def add_hts_options(self, format_options=None): # <<<<<<<<<<<<<<
jpayne@68 21215 * """Given a list of key=value format option strings, add them to an open htsFile
jpayne@68 21216 * """
jpayne@68 21217 */
jpayne@68 21218 __pyx_tuple__92 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_format_options, __pyx_n_s_rval, __pyx_n_s_opts, __pyx_n_s_format_option); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 575, __pyx_L1_error)
jpayne@68 21219 __Pyx_GOTREF(__pyx_tuple__92);
jpayne@68 21220 __Pyx_GIVEREF(__pyx_tuple__92);
jpayne@68 21221 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_add_hts_options, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 575, __pyx_L1_error)
jpayne@68 21222
jpayne@68 21223 /* "pysam/libchtslib.pyx":595
jpayne@68 21224 * hts_opt_free(opts)
jpayne@68 21225 *
jpayne@68 21226 * def parse_region(self, contig=None, start=None, stop=None, # <<<<<<<<<<<<<<
jpayne@68 21227 * region=None, tid=None,
jpayne@68 21228 * reference=None, end=None):
jpayne@68 21229 */
jpayne@68 21230 __pyx_tuple__93 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_contig, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_region, __pyx_n_s_tid, __pyx_n_s_reference, __pyx_n_s_end, __pyx_n_s_rtid, __pyx_n_s_rstart, __pyx_n_s_rstop, __pyx_n_s_coord, __pyx_n_s_parts); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 595, __pyx_L1_error)
jpayne@68 21231 __Pyx_GOTREF(__pyx_tuple__93);
jpayne@68 21232 __Pyx_GIVEREF(__pyx_tuple__93);
jpayne@68 21233 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_parse_region, 595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 595, __pyx_L1_error)
jpayne@68 21234 __pyx_tuple__94 = PyTuple_Pack(7, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 595, __pyx_L1_error)
jpayne@68 21235 __Pyx_GOTREF(__pyx_tuple__94);
jpayne@68 21236 __Pyx_GIVEREF(__pyx_tuple__94);
jpayne@68 21237
jpayne@68 21238 /* "pysam/libchtslib.pyx":700
jpayne@68 21239 * return 1, rtid, rstart, rstop
jpayne@68 21240 *
jpayne@68 21241 * def is_valid_tid(self, tid): # <<<<<<<<<<<<<<
jpayne@68 21242 * """
jpayne@68 21243 * return True if the numerical :term:`tid` is valid; False otherwise.
jpayne@68 21244 */
jpayne@68 21245 __pyx_tuple__95 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tid); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 700, __pyx_L1_error)
jpayne@68 21246 __Pyx_GOTREF(__pyx_tuple__95);
jpayne@68 21247 __Pyx_GIVEREF(__pyx_tuple__95);
jpayne@68 21248 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_is_valid_tid, 700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 700, __pyx_L1_error)
jpayne@68 21249
jpayne@68 21250 /* "pysam/libchtslib.pyx":708
jpayne@68 21251 * raise NotImplementedError()
jpayne@68 21252 *
jpayne@68 21253 * def is_valid_reference_name(self, contig): # <<<<<<<<<<<<<<
jpayne@68 21254 * """
jpayne@68 21255 * return True if the contig name :term:`contig` is valid; False otherwise.
jpayne@68 21256 */
jpayne@68 21257 __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_contig); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 708, __pyx_L1_error)
jpayne@68 21258 __Pyx_GOTREF(__pyx_tuple__96);
jpayne@68 21259 __Pyx_GIVEREF(__pyx_tuple__96);
jpayne@68 21260 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_is_valid_reference_name, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 708, __pyx_L1_error)
jpayne@68 21261
jpayne@68 21262 /* "pysam/libchtslib.pyx":714
jpayne@68 21263 * return self.get_tid(contig) != -1
jpayne@68 21264 *
jpayne@68 21265 * def get_tid(self, contig): # <<<<<<<<<<<<<<
jpayne@68 21266 * """
jpayne@68 21267 * return the numerical :term:`tid` corresponding to
jpayne@68 21268 */
jpayne@68 21269 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_get_tid, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 714, __pyx_L1_error)
jpayne@68 21270
jpayne@68 21271 /* "pysam/libchtslib.pyx":723
jpayne@68 21272 * raise NotImplementedError()
jpayne@68 21273 *
jpayne@68 21274 * def get_reference_name(self, tid): # <<<<<<<<<<<<<<
jpayne@68 21275 * """
jpayne@68 21276 * return :term:`contig` name corresponding to numerical :term:`tid`
jpayne@68 21277 */
jpayne@68 21278 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libchtslib_pyx, __pyx_n_s_get_reference_name, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 723, __pyx_L1_error)
jpayne@68 21279
jpayne@68 21280 /* "(tree fragment)":1
jpayne@68 21281 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
jpayne@68 21282 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 21283 * def __setstate_cython__(self, __pyx_state):
jpayne@68 21284 */
jpayne@68 21285 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(1, 1, __pyx_L1_error)
jpayne@68 21286
jpayne@68 21287 /* "(tree fragment)":3
jpayne@68 21288 * def __reduce_cython__(self):
jpayne@68 21289 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 21290 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
jpayne@68 21291 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 21292 */
jpayne@68 21293 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(1, 3, __pyx_L1_error)
jpayne@68 21294 __Pyx_RefNannyFinishContext();
jpayne@68 21295 return 0;
jpayne@68 21296 __pyx_L1_error:;
jpayne@68 21297 __Pyx_RefNannyFinishContext();
jpayne@68 21298 return -1;
jpayne@68 21299 }
jpayne@68 21300 /* #### Code section: init_constants ### */
jpayne@68 21301
jpayne@68 21302 static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
jpayne@68 21303 if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
jpayne@68 21304 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21305 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21306 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21307 return 0;
jpayne@68 21308 __pyx_L1_error:;
jpayne@68 21309 return -1;
jpayne@68 21310 }
jpayne@68 21311 /* #### Code section: init_globals ### */
jpayne@68 21312
jpayne@68 21313 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
jpayne@68 21314 return 0;
jpayne@68 21315 }
jpayne@68 21316 /* #### Code section: init_module ### */
jpayne@68 21317
jpayne@68 21318 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
jpayne@68 21319 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
jpayne@68 21320 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
jpayne@68 21321 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
jpayne@68 21322 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
jpayne@68 21323 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
jpayne@68 21324 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
jpayne@68 21325
jpayne@68 21326 static int __Pyx_modinit_global_init_code(void) {
jpayne@68 21327 __Pyx_RefNannyDeclarations
jpayne@68 21328 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
jpayne@68 21329 /*--- Global init code ---*/
jpayne@68 21330 __pyx_v_5pysam_10libchtslib_FORMAT_CATEGORIES = ((PyObject*)Py_None); Py_INCREF(Py_None);
jpayne@68 21331 __pyx_v_5pysam_10libchtslib_FORMATS = ((PyObject*)Py_None); Py_INCREF(Py_None);
jpayne@68 21332 __pyx_v_5pysam_10libchtslib_COMPRESSION = ((PyObject*)Py_None); Py_INCREF(Py_None);
jpayne@68 21333 __Pyx_RefNannyFinishContext();
jpayne@68 21334 return 0;
jpayne@68 21335 }
jpayne@68 21336
jpayne@68 21337 static int __Pyx_modinit_variable_export_code(void) {
jpayne@68 21338 __Pyx_RefNannyDeclarations
jpayne@68 21339 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
jpayne@68 21340 /*--- Variable export code ---*/
jpayne@68 21341 __Pyx_RefNannyFinishContext();
jpayne@68 21342 return 0;
jpayne@68 21343 }
jpayne@68 21344
jpayne@68 21345 static int __Pyx_modinit_function_export_code(void) {
jpayne@68 21346 __Pyx_RefNannyDeclarations
jpayne@68 21347 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
jpayne@68 21348 /*--- Function export code ---*/
jpayne@68 21349 __Pyx_RefNannyFinishContext();
jpayne@68 21350 return 0;
jpayne@68 21351 }
jpayne@68 21352
jpayne@68 21353 static int __Pyx_modinit_type_init_code(void) {
jpayne@68 21354 __Pyx_RefNannyDeclarations
jpayne@68 21355 int __pyx_lineno = 0;
jpayne@68 21356 const char *__pyx_filename = NULL;
jpayne@68 21357 int __pyx_clineno = 0;
jpayne@68 21358 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
jpayne@68 21359 /*--- Type init code ---*/
jpayne@68 21360 __pyx_vtabptr_5pysam_10libchtslib_HTSFile = &__pyx_vtable_5pysam_10libchtslib_HTSFile;
jpayne@68 21361 __pyx_vtable_5pysam_10libchtslib_HTSFile._open_htsfile = (htsFile *(*)(struct __pyx_obj_5pysam_10libchtslib_HTSFile *))__pyx_f_5pysam_10libchtslib_7HTSFile__open_htsfile;
jpayne@68 21362 #if CYTHON_USE_TYPE_SPECS
jpayne@68 21363 __pyx_ptype_5pysam_10libchtslib_HTSFile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_10libchtslib_HTSFile_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_10libchtslib_HTSFile)) __PYX_ERR(0, 321, __pyx_L1_error)
jpayne@68 21364 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_10libchtslib_HTSFile_spec, __pyx_ptype_5pysam_10libchtslib_HTSFile) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
jpayne@68 21365 #else
jpayne@68 21366 __pyx_ptype_5pysam_10libchtslib_HTSFile = &__pyx_type_5pysam_10libchtslib_HTSFile;
jpayne@68 21367 #endif
jpayne@68 21368 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21369 #endif
jpayne@68 21370 #if !CYTHON_USE_TYPE_SPECS
jpayne@68 21371 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_10libchtslib_HTSFile) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
jpayne@68 21372 #endif
jpayne@68 21373 #if PY_MAJOR_VERSION < 3
jpayne@68 21374 __pyx_ptype_5pysam_10libchtslib_HTSFile->tp_print = 0;
jpayne@68 21375 #endif
jpayne@68 21376 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21377 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_10libchtslib_HTSFile->tp_dictoffset && __pyx_ptype_5pysam_10libchtslib_HTSFile->tp_getattro == PyObject_GenericGetAttr)) {
jpayne@68 21378 __pyx_ptype_5pysam_10libchtslib_HTSFile->tp_getattro = __Pyx_PyObject_GenericGetAttr;
jpayne@68 21379 }
jpayne@68 21380 #endif
jpayne@68 21381 if (__Pyx_SetVtable(__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_vtabptr_5pysam_10libchtslib_HTSFile) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
jpayne@68 21382 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21383 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_10libchtslib_HTSFile) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
jpayne@68 21384 #endif
jpayne@68 21385 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HTSFile, (PyObject *) __pyx_ptype_5pysam_10libchtslib_HTSFile) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
jpayne@68 21386 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21387 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_10libchtslib_HTSFile) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
jpayne@68 21388 #endif
jpayne@68 21389 __pyx_vtabptr_5pysam_10libchtslib_HFile = &__pyx_vtable_5pysam_10libchtslib_HFile;
jpayne@68 21390 __pyx_vtable_5pysam_10libchtslib_HFile._open = (PyObject *(*)(struct __pyx_obj_5pysam_10libchtslib_HFile *, PyObject *, PyObject *, struct __pyx_opt_args_5pysam_10libchtslib_5HFile__open *__pyx_optional_args))__pyx_f_5pysam_10libchtslib_5HFile__open;
jpayne@68 21391 #if CYTHON_USE_TYPE_SPECS
jpayne@68 21392 __pyx_ptype_5pysam_10libchtslib_HFile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_10libchtslib_HFile_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_10libchtslib_HFile)) __PYX_ERR(0, 67, __pyx_L1_error)
jpayne@68 21393 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_10libchtslib_HFile_spec, __pyx_ptype_5pysam_10libchtslib_HFile) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
jpayne@68 21394 #else
jpayne@68 21395 __pyx_ptype_5pysam_10libchtslib_HFile = &__pyx_type_5pysam_10libchtslib_HFile;
jpayne@68 21396 #endif
jpayne@68 21397 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21398 #endif
jpayne@68 21399 #if !CYTHON_USE_TYPE_SPECS
jpayne@68 21400 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_10libchtslib_HFile) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
jpayne@68 21401 #endif
jpayne@68 21402 #if PY_MAJOR_VERSION < 3
jpayne@68 21403 __pyx_ptype_5pysam_10libchtslib_HFile->tp_print = 0;
jpayne@68 21404 #endif
jpayne@68 21405 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21406 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_10libchtslib_HFile->tp_dictoffset && __pyx_ptype_5pysam_10libchtslib_HFile->tp_getattro == PyObject_GenericGetAttr)) {
jpayne@68 21407 __pyx_ptype_5pysam_10libchtslib_HFile->tp_getattro = __Pyx_PyObject_GenericGetAttr;
jpayne@68 21408 }
jpayne@68 21409 #endif
jpayne@68 21410 if (__Pyx_SetVtable(__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_vtabptr_5pysam_10libchtslib_HFile) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
jpayne@68 21411 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21412 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_10libchtslib_HFile) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
jpayne@68 21413 #endif
jpayne@68 21414 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HFile, (PyObject *) __pyx_ptype_5pysam_10libchtslib_HFile) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
jpayne@68 21415 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21416 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_10libchtslib_HFile) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
jpayne@68 21417 #endif
jpayne@68 21418 __Pyx_RefNannyFinishContext();
jpayne@68 21419 return 0;
jpayne@68 21420 __pyx_L1_error:;
jpayne@68 21421 __Pyx_RefNannyFinishContext();
jpayne@68 21422 return -1;
jpayne@68 21423 }
jpayne@68 21424
jpayne@68 21425 static int __Pyx_modinit_type_import_code(void) {
jpayne@68 21426 __Pyx_RefNannyDeclarations
jpayne@68 21427 PyObject *__pyx_t_1 = NULL;
jpayne@68 21428 int __pyx_lineno = 0;
jpayne@68 21429 const char *__pyx_filename = NULL;
jpayne@68 21430 int __pyx_clineno = 0;
jpayne@68 21431 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
jpayne@68 21432 /*--- Type import code ---*/
jpayne@68 21433 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 9, __pyx_L1_error)
jpayne@68 21434 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 21435 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
jpayne@68 21436 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
jpayne@68 21437 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
jpayne@68 21438 #elif CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21439 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
jpayne@68 21440 #else
jpayne@68 21441 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
jpayne@68 21442 #endif
jpayne@68 21443 __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(5, 9, __pyx_L1_error)
jpayne@68 21444 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 21445 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 8, __pyx_L1_error)
jpayne@68 21446 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 21447 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(6, 8, __pyx_L1_error)
jpayne@68 21448 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 21449 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 15, __pyx_L1_error)
jpayne@68 21450 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 21451 __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(7, 15, __pyx_L1_error)
jpayne@68 21452 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 21453 __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 69, __pyx_L1_error)
jpayne@68 21454 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 21455 __pyx_ptype_7cpython_5array_array = __Pyx_ImportType_3_0_11(__pyx_t_1, "array", "array", sizeof(arrayobject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(arrayobject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(3, 69, __pyx_L1_error)
jpayne@68 21456 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 21457 __Pyx_RefNannyFinishContext();
jpayne@68 21458 return 0;
jpayne@68 21459 __pyx_L1_error:;
jpayne@68 21460 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 21461 __Pyx_RefNannyFinishContext();
jpayne@68 21462 return -1;
jpayne@68 21463 }
jpayne@68 21464
jpayne@68 21465 static int __Pyx_modinit_variable_import_code(void) {
jpayne@68 21466 __Pyx_RefNannyDeclarations
jpayne@68 21467 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
jpayne@68 21468 /*--- Variable import code ---*/
jpayne@68 21469 __Pyx_RefNannyFinishContext();
jpayne@68 21470 return 0;
jpayne@68 21471 }
jpayne@68 21472
jpayne@68 21473 static int __Pyx_modinit_function_import_code(void) {
jpayne@68 21474 __Pyx_RefNannyDeclarations
jpayne@68 21475 PyObject *__pyx_t_1 = NULL;
jpayne@68 21476 int __pyx_lineno = 0;
jpayne@68 21477 const char *__pyx_filename = NULL;
jpayne@68 21478 int __pyx_clineno = 0;
jpayne@68 21479 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
jpayne@68 21480 /*--- Function import code ---*/
jpayne@68 21481 __pyx_t_1 = PyImport_ImportModule("pysam.libcutils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21482 __Pyx_GOTREF(__pyx_t_1);
jpayne@68 21483 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "libc_whence_from_io", (void (**)(void))&__pyx_f_5pysam_9libcutils_libc_whence_from_io, "int (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21484 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "charptr_to_str", (void (**)(void))&__pyx_f_5pysam_9libcutils_charptr_to_str, "PyObject *(char const *, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21485 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "charptr_to_str_w_len", (void (**)(void))&__pyx_f_5pysam_9libcutils_charptr_to_str_w_len, "PyObject *(char const *, size_t, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21486 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "force_str", (void (**)(void))&__pyx_f_5pysam_9libcutils_force_str, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21487 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "force_bytes", (void (**)(void))&__pyx_f_5pysam_9libcutils_force_bytes, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_bytes *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21488 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "encode_filename", (void (**)(void))&__pyx_f_5pysam_9libcutils_encode_filename, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21489 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "from_string_and_size", (void (**)(void))&__pyx_f_5pysam_9libcutils_from_string_and_size, "PyObject *(char const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21490 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
jpayne@68 21491 __Pyx_RefNannyFinishContext();
jpayne@68 21492 return 0;
jpayne@68 21493 __pyx_L1_error:;
jpayne@68 21494 __Pyx_XDECREF(__pyx_t_1);
jpayne@68 21495 __Pyx_RefNannyFinishContext();
jpayne@68 21496 return -1;
jpayne@68 21497 }
jpayne@68 21498
jpayne@68 21499
jpayne@68 21500 #if PY_MAJOR_VERSION >= 3
jpayne@68 21501 #if CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 21502 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
jpayne@68 21503 static int __pyx_pymod_exec_libchtslib(PyObject* module); /*proto*/
jpayne@68 21504 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
jpayne@68 21505 {Py_mod_create, (void*)__pyx_pymod_create},
jpayne@68 21506 {Py_mod_exec, (void*)__pyx_pymod_exec_libchtslib},
jpayne@68 21507 {0, NULL}
jpayne@68 21508 };
jpayne@68 21509 #endif
jpayne@68 21510
jpayne@68 21511 #ifdef __cplusplus
jpayne@68 21512 namespace {
jpayne@68 21513 struct PyModuleDef __pyx_moduledef =
jpayne@68 21514 #else
jpayne@68 21515 static struct PyModuleDef __pyx_moduledef =
jpayne@68 21516 #endif
jpayne@68 21517 {
jpayne@68 21518 PyModuleDef_HEAD_INIT,
jpayne@68 21519 "libchtslib",
jpayne@68 21520 0, /* m_doc */
jpayne@68 21521 #if CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 21522 0, /* m_size */
jpayne@68 21523 #elif CYTHON_USE_MODULE_STATE
jpayne@68 21524 sizeof(__pyx_mstate), /* m_size */
jpayne@68 21525 #else
jpayne@68 21526 -1, /* m_size */
jpayne@68 21527 #endif
jpayne@68 21528 __pyx_methods /* m_methods */,
jpayne@68 21529 #if CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 21530 __pyx_moduledef_slots, /* m_slots */
jpayne@68 21531 #else
jpayne@68 21532 NULL, /* m_reload */
jpayne@68 21533 #endif
jpayne@68 21534 #if CYTHON_USE_MODULE_STATE
jpayne@68 21535 __pyx_m_traverse, /* m_traverse */
jpayne@68 21536 __pyx_m_clear, /* m_clear */
jpayne@68 21537 NULL /* m_free */
jpayne@68 21538 #else
jpayne@68 21539 NULL, /* m_traverse */
jpayne@68 21540 NULL, /* m_clear */
jpayne@68 21541 NULL /* m_free */
jpayne@68 21542 #endif
jpayne@68 21543 };
jpayne@68 21544 #ifdef __cplusplus
jpayne@68 21545 } /* anonymous namespace */
jpayne@68 21546 #endif
jpayne@68 21547 #endif
jpayne@68 21548
jpayne@68 21549 #ifndef CYTHON_NO_PYINIT_EXPORT
jpayne@68 21550 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
jpayne@68 21551 #elif PY_MAJOR_VERSION < 3
jpayne@68 21552 #ifdef __cplusplus
jpayne@68 21553 #define __Pyx_PyMODINIT_FUNC extern "C" void
jpayne@68 21554 #else
jpayne@68 21555 #define __Pyx_PyMODINIT_FUNC void
jpayne@68 21556 #endif
jpayne@68 21557 #else
jpayne@68 21558 #ifdef __cplusplus
jpayne@68 21559 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
jpayne@68 21560 #else
jpayne@68 21561 #define __Pyx_PyMODINIT_FUNC PyObject *
jpayne@68 21562 #endif
jpayne@68 21563 #endif
jpayne@68 21564
jpayne@68 21565
jpayne@68 21566 #if PY_MAJOR_VERSION < 3
jpayne@68 21567 __Pyx_PyMODINIT_FUNC initlibchtslib(void) CYTHON_SMALL_CODE; /*proto*/
jpayne@68 21568 __Pyx_PyMODINIT_FUNC initlibchtslib(void)
jpayne@68 21569 #else
jpayne@68 21570 __Pyx_PyMODINIT_FUNC PyInit_libchtslib(void) CYTHON_SMALL_CODE; /*proto*/
jpayne@68 21571 __Pyx_PyMODINIT_FUNC PyInit_libchtslib(void)
jpayne@68 21572 #if CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 21573 {
jpayne@68 21574 return PyModuleDef_Init(&__pyx_moduledef);
jpayne@68 21575 }
jpayne@68 21576 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
jpayne@68 21577 #if PY_VERSION_HEX >= 0x030700A1
jpayne@68 21578 static PY_INT64_T main_interpreter_id = -1;
jpayne@68 21579 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
jpayne@68 21580 if (main_interpreter_id == -1) {
jpayne@68 21581 main_interpreter_id = current_id;
jpayne@68 21582 return (unlikely(current_id == -1)) ? -1 : 0;
jpayne@68 21583 } else if (unlikely(main_interpreter_id != current_id))
jpayne@68 21584 #else
jpayne@68 21585 static PyInterpreterState *main_interpreter = NULL;
jpayne@68 21586 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
jpayne@68 21587 if (!main_interpreter) {
jpayne@68 21588 main_interpreter = current_interpreter;
jpayne@68 21589 } else if (unlikely(main_interpreter != current_interpreter))
jpayne@68 21590 #endif
jpayne@68 21591 {
jpayne@68 21592 PyErr_SetString(
jpayne@68 21593 PyExc_ImportError,
jpayne@68 21594 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
jpayne@68 21595 return -1;
jpayne@68 21596 }
jpayne@68 21597 return 0;
jpayne@68 21598 }
jpayne@68 21599 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21600 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
jpayne@68 21601 #else
jpayne@68 21602 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
jpayne@68 21603 #endif
jpayne@68 21604 {
jpayne@68 21605 PyObject *value = PyObject_GetAttrString(spec, from_name);
jpayne@68 21606 int result = 0;
jpayne@68 21607 if (likely(value)) {
jpayne@68 21608 if (allow_none || value != Py_None) {
jpayne@68 21609 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21610 result = PyModule_AddObject(module, to_name, value);
jpayne@68 21611 #else
jpayne@68 21612 result = PyDict_SetItemString(moddict, to_name, value);
jpayne@68 21613 #endif
jpayne@68 21614 }
jpayne@68 21615 Py_DECREF(value);
jpayne@68 21616 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
jpayne@68 21617 PyErr_Clear();
jpayne@68 21618 } else {
jpayne@68 21619 result = -1;
jpayne@68 21620 }
jpayne@68 21621 return result;
jpayne@68 21622 }
jpayne@68 21623 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
jpayne@68 21624 PyObject *module = NULL, *moddict, *modname;
jpayne@68 21625 CYTHON_UNUSED_VAR(def);
jpayne@68 21626 if (__Pyx_check_single_interpreter())
jpayne@68 21627 return NULL;
jpayne@68 21628 if (__pyx_m)
jpayne@68 21629 return __Pyx_NewRef(__pyx_m);
jpayne@68 21630 modname = PyObject_GetAttrString(spec, "name");
jpayne@68 21631 if (unlikely(!modname)) goto bad;
jpayne@68 21632 module = PyModule_NewObject(modname);
jpayne@68 21633 Py_DECREF(modname);
jpayne@68 21634 if (unlikely(!module)) goto bad;
jpayne@68 21635 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 21636 moddict = module;
jpayne@68 21637 #else
jpayne@68 21638 moddict = PyModule_GetDict(module);
jpayne@68 21639 if (unlikely(!moddict)) goto bad;
jpayne@68 21640 #endif
jpayne@68 21641 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
jpayne@68 21642 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
jpayne@68 21643 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
jpayne@68 21644 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
jpayne@68 21645 return module;
jpayne@68 21646 bad:
jpayne@68 21647 Py_XDECREF(module);
jpayne@68 21648 return NULL;
jpayne@68 21649 }
jpayne@68 21650
jpayne@68 21651
jpayne@68 21652 static CYTHON_SMALL_CODE int __pyx_pymod_exec_libchtslib(PyObject *__pyx_pyinit_module)
jpayne@68 21653 #endif
jpayne@68 21654 #endif
jpayne@68 21655 {
jpayne@68 21656 int stringtab_initialized = 0;
jpayne@68 21657 #if CYTHON_USE_MODULE_STATE
jpayne@68 21658 int pystate_addmodule_run = 0;
jpayne@68 21659 #endif
jpayne@68 21660 __Pyx_TraceDeclarations
jpayne@68 21661 PyObject *__pyx_t_1 = NULL;
jpayne@68 21662 PyObject *__pyx_t_2 = NULL;
jpayne@68 21663 PyObject *__pyx_t_3 = NULL;
jpayne@68 21664 int __pyx_t_4;
jpayne@68 21665 PyObject *__pyx_t_5 = NULL;
jpayne@68 21666 PyObject *__pyx_t_6 = NULL;
jpayne@68 21667 int __pyx_lineno = 0;
jpayne@68 21668 const char *__pyx_filename = NULL;
jpayne@68 21669 int __pyx_clineno = 0;
jpayne@68 21670 __Pyx_RefNannyDeclarations
jpayne@68 21671 #if CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 21672 if (__pyx_m) {
jpayne@68 21673 if (__pyx_m == __pyx_pyinit_module) return 0;
jpayne@68 21674 PyErr_SetString(PyExc_RuntimeError, "Module 'libchtslib' has already been imported. Re-initialisation is not supported.");
jpayne@68 21675 return -1;
jpayne@68 21676 }
jpayne@68 21677 #elif PY_MAJOR_VERSION >= 3
jpayne@68 21678 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
jpayne@68 21679 #endif
jpayne@68 21680 /*--- Module creation code ---*/
jpayne@68 21681 #if CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 21682 __pyx_m = __pyx_pyinit_module;
jpayne@68 21683 Py_INCREF(__pyx_m);
jpayne@68 21684 #else
jpayne@68 21685 #if PY_MAJOR_VERSION < 3
jpayne@68 21686 __pyx_m = Py_InitModule4("libchtslib", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
jpayne@68 21687 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21688 #elif CYTHON_USE_MODULE_STATE
jpayne@68 21689 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21690 {
jpayne@68 21691 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
jpayne@68 21692 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "libchtslib" pseudovariable */
jpayne@68 21693 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21694 pystate_addmodule_run = 1;
jpayne@68 21695 }
jpayne@68 21696 #else
jpayne@68 21697 __pyx_m = PyModule_Create(&__pyx_moduledef);
jpayne@68 21698 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21699 #endif
jpayne@68 21700 #endif
jpayne@68 21701 CYTHON_UNUSED_VAR(__pyx_t_1);
jpayne@68 21702 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21703 Py_INCREF(__pyx_d);
jpayne@68 21704 __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21705 __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21706 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21707 #if CYTHON_REFNANNY
jpayne@68 21708 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
jpayne@68 21709 if (!__Pyx_RefNanny) {
jpayne@68 21710 PyErr_Clear();
jpayne@68 21711 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
jpayne@68 21712 if (!__Pyx_RefNanny)
jpayne@68 21713 Py_FatalError("failed to import 'refnanny' module");
jpayne@68 21714 }
jpayne@68 21715 #endif
jpayne@68 21716 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_libchtslib(void)", 0);
jpayne@68 21717 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21718 #ifdef __Pxy_PyFrame_Initialize_Offsets
jpayne@68 21719 __Pxy_PyFrame_Initialize_Offsets();
jpayne@68 21720 #endif
jpayne@68 21721 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21722 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21723 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21724 #ifdef __Pyx_CyFunction_USED
jpayne@68 21725 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21726 #endif
jpayne@68 21727 #ifdef __Pyx_FusedFunction_USED
jpayne@68 21728 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21729 #endif
jpayne@68 21730 #ifdef __Pyx_Coroutine_USED
jpayne@68 21731 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21732 #endif
jpayne@68 21733 #ifdef __Pyx_Generator_USED
jpayne@68 21734 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21735 #endif
jpayne@68 21736 #ifdef __Pyx_AsyncGen_USED
jpayne@68 21737 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21738 #endif
jpayne@68 21739 #ifdef __Pyx_StopAsyncIteration_USED
jpayne@68 21740 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21741 #endif
jpayne@68 21742 /*--- Library function declarations ---*/
jpayne@68 21743 /*--- Threads initialization code ---*/
jpayne@68 21744 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
jpayne@68 21745 PyEval_InitThreads();
jpayne@68 21746 #endif
jpayne@68 21747 /*--- Initialize various global constants etc. ---*/
jpayne@68 21748 if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21749 stringtab_initialized = 1;
jpayne@68 21750 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21751 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
jpayne@68 21752 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21753 #endif
jpayne@68 21754 if (__pyx_module_is_main_pysam__libchtslib) {
jpayne@68 21755 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21756 }
jpayne@68 21757 #if PY_MAJOR_VERSION >= 3
jpayne@68 21758 {
jpayne@68 21759 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21760 if (!PyDict_GetItemString(modules, "pysam.libchtslib")) {
jpayne@68 21761 if (unlikely((PyDict_SetItemString(modules, "pysam.libchtslib", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21762 }
jpayne@68 21763 }
jpayne@68 21764 #endif
jpayne@68 21765 /*--- Builtin init code ---*/
jpayne@68 21766 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21767 /*--- Constants init code ---*/
jpayne@68 21768 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21769 /*--- Global type/function init code ---*/
jpayne@68 21770 (void)__Pyx_modinit_global_init_code();
jpayne@68 21771 (void)__Pyx_modinit_variable_export_code();
jpayne@68 21772 (void)__Pyx_modinit_function_export_code();
jpayne@68 21773 if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21774 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21775 (void)__Pyx_modinit_variable_import_code();
jpayne@68 21776 if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21777 /*--- Execution code ---*/
jpayne@68 21778 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
jpayne@68 21779 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 21780 #endif
jpayne@68 21781 __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_libchtslib(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
jpayne@68 21782
jpayne@68 21783 /* "pysam/libchtslib.pyx":25
jpayne@68 21784 * ########################################################################
jpayne@68 21785 *
jpayne@68 21786 * import os # <<<<<<<<<<<<<<
jpayne@68 21787 * import io
jpayne@68 21788 * import re
jpayne@68 21789 */
jpayne@68 21790 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
jpayne@68 21791 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 21792 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
jpayne@68 21793 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 21794
jpayne@68 21795 /* "pysam/libchtslib.pyx":26
jpayne@68 21796 *
jpayne@68 21797 * import os
jpayne@68 21798 * import io # <<<<<<<<<<<<<<
jpayne@68 21799 * import re
jpayne@68 21800 * from warnings import warn
jpayne@68 21801 */
jpayne@68 21802 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_io, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
jpayne@68 21803 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 21804 if (PyDict_SetItem(__pyx_d, __pyx_n_s_io, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
jpayne@68 21805 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 21806
jpayne@68 21807 /* "pysam/libchtslib.pyx":27
jpayne@68 21808 * import os
jpayne@68 21809 * import io
jpayne@68 21810 * import re # <<<<<<<<<<<<<<
jpayne@68 21811 * from warnings import warn
jpayne@68 21812 *
jpayne@68 21813 */
jpayne@68 21814 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
jpayne@68 21815 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 21816 if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
jpayne@68 21817 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 21818
jpayne@68 21819 /* "pysam/libchtslib.pyx":28
jpayne@68 21820 * import io
jpayne@68 21821 * import re
jpayne@68 21822 * from warnings import warn # <<<<<<<<<<<<<<
jpayne@68 21823 *
jpayne@68 21824 *
jpayne@68 21825 */
jpayne@68 21826 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
jpayne@68 21827 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 21828 __Pyx_INCREF(__pyx_n_s_warn);
jpayne@68 21829 __Pyx_GIVEREF(__pyx_n_s_warn);
jpayne@68 21830 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_warn)) __PYX_ERR(0, 28, __pyx_L1_error);
jpayne@68 21831 __pyx_t_3 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
jpayne@68 21832 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21833 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 21834 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
jpayne@68 21835 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 21836 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
jpayne@68 21837 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 21838 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21839
jpayne@68 21840 /* "pysam/libchtslib.pyx":36
jpayne@68 21841 * ########################################################################
jpayne@68 21842 *
jpayne@68 21843 * __all__ = ['get_verbosity', 'set_verbosity', 'HFile', 'HTSFile'] # <<<<<<<<<<<<<<
jpayne@68 21844 *
jpayne@68 21845 * # maximum genomic coordinace
jpayne@68 21846 */
jpayne@68 21847 __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
jpayne@68 21848 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21849 __Pyx_INCREF(__pyx_n_u_get_verbosity);
jpayne@68 21850 __Pyx_GIVEREF(__pyx_n_u_get_verbosity);
jpayne@68 21851 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_get_verbosity)) __PYX_ERR(0, 36, __pyx_L1_error);
jpayne@68 21852 __Pyx_INCREF(__pyx_n_u_set_verbosity);
jpayne@68 21853 __Pyx_GIVEREF(__pyx_n_u_set_verbosity);
jpayne@68 21854 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_set_verbosity)) __PYX_ERR(0, 36, __pyx_L1_error);
jpayne@68 21855 __Pyx_INCREF(__pyx_n_u_HFile);
jpayne@68 21856 __Pyx_GIVEREF(__pyx_n_u_HFile);
jpayne@68 21857 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_u_HFile)) __PYX_ERR(0, 36, __pyx_L1_error);
jpayne@68 21858 __Pyx_INCREF(__pyx_n_u_HTSFile);
jpayne@68 21859 __Pyx_GIVEREF(__pyx_n_u_HTSFile);
jpayne@68 21860 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_u_HTSFile)) __PYX_ERR(0, 36, __pyx_L1_error);
jpayne@68 21861 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
jpayne@68 21862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21863
jpayne@68 21864 /* "pysam/libchtslib.pyx":39
jpayne@68 21865 *
jpayne@68 21866 * # maximum genomic coordinace
jpayne@68 21867 * cdef int MAX_POS = (1 << 31) - 1 # <<<<<<<<<<<<<<
jpayne@68 21868 *
jpayne@68 21869 * cdef tuple FORMAT_CATEGORIES = ('UNKNOWN', 'ALIGNMENTS', 'VARIANTS', 'INDEX', 'REGIONS')
jpayne@68 21870 */
jpayne@68 21871 __pyx_v_5pysam_10libchtslib_MAX_POS = 0x7fffffff;
jpayne@68 21872
jpayne@68 21873 /* "pysam/libchtslib.pyx":41
jpayne@68 21874 * cdef int MAX_POS = (1 << 31) - 1
jpayne@68 21875 *
jpayne@68 21876 * cdef tuple FORMAT_CATEGORIES = ('UNKNOWN', 'ALIGNMENTS', 'VARIANTS', 'INDEX', 'REGIONS') # <<<<<<<<<<<<<<
jpayne@68 21877 * cdef tuple FORMATS = ('UNKNOWN', 'BINARY_FORMAT', 'TEXT_FORMAT', 'SAM', 'BAM', 'BAI', 'CRAM', 'CRAI',
jpayne@68 21878 * 'VCF', 'BCF', 'CSI', 'GZI', 'TBI', 'BED')
jpayne@68 21879 */
jpayne@68 21880 __Pyx_INCREF(__pyx_tuple__66);
jpayne@68 21881 __Pyx_XGOTREF(__pyx_v_5pysam_10libchtslib_FORMAT_CATEGORIES);
jpayne@68 21882 __Pyx_DECREF_SET(__pyx_v_5pysam_10libchtslib_FORMAT_CATEGORIES, __pyx_tuple__66);
jpayne@68 21883 __Pyx_GIVEREF(__pyx_tuple__66);
jpayne@68 21884
jpayne@68 21885 /* "pysam/libchtslib.pyx":42
jpayne@68 21886 *
jpayne@68 21887 * cdef tuple FORMAT_CATEGORIES = ('UNKNOWN', 'ALIGNMENTS', 'VARIANTS', 'INDEX', 'REGIONS')
jpayne@68 21888 * cdef tuple FORMATS = ('UNKNOWN', 'BINARY_FORMAT', 'TEXT_FORMAT', 'SAM', 'BAM', 'BAI', 'CRAM', 'CRAI', # <<<<<<<<<<<<<<
jpayne@68 21889 * 'VCF', 'BCF', 'CSI', 'GZI', 'TBI', 'BED')
jpayne@68 21890 * cdef tuple COMPRESSION = ('NONE', 'GZIP', 'BGZF', 'CUSTOM')
jpayne@68 21891 */
jpayne@68 21892 __Pyx_INCREF(__pyx_tuple__67);
jpayne@68 21893 __Pyx_XGOTREF(__pyx_v_5pysam_10libchtslib_FORMATS);
jpayne@68 21894 __Pyx_DECREF_SET(__pyx_v_5pysam_10libchtslib_FORMATS, __pyx_tuple__67);
jpayne@68 21895 __Pyx_GIVEREF(__pyx_tuple__67);
jpayne@68 21896
jpayne@68 21897 /* "pysam/libchtslib.pyx":44
jpayne@68 21898 * cdef tuple FORMATS = ('UNKNOWN', 'BINARY_FORMAT', 'TEXT_FORMAT', 'SAM', 'BAM', 'BAI', 'CRAM', 'CRAI',
jpayne@68 21899 * 'VCF', 'BCF', 'CSI', 'GZI', 'TBI', 'BED')
jpayne@68 21900 * cdef tuple COMPRESSION = ('NONE', 'GZIP', 'BGZF', 'CUSTOM') # <<<<<<<<<<<<<<
jpayne@68 21901 *
jpayne@68 21902 *
jpayne@68 21903 */
jpayne@68 21904 __Pyx_INCREF(__pyx_tuple__68);
jpayne@68 21905 __Pyx_XGOTREF(__pyx_v_5pysam_10libchtslib_COMPRESSION);
jpayne@68 21906 __Pyx_DECREF_SET(__pyx_v_5pysam_10libchtslib_COMPRESSION, __pyx_tuple__68);
jpayne@68 21907 __Pyx_GIVEREF(__pyx_tuple__68);
jpayne@68 21908
jpayne@68 21909 /* "pysam/libchtslib.pyx":53
jpayne@68 21910 *
jpayne@68 21911 *
jpayne@68 21912 * cpdef set_verbosity(int verbosity): # <<<<<<<<<<<<<<
jpayne@68 21913 * """Set htslib's hts_verbose global variable to the specified value."""
jpayne@68 21914 * return hts_set_verbosity(verbosity)
jpayne@68 21915 */
jpayne@68 21916 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_1set_verbosity, 0, __pyx_n_s_set_verbosity, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
jpayne@68 21917 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21918 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_verbosity, __pyx_t_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
jpayne@68 21919 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21920
jpayne@68 21921 /* "pysam/libchtslib.pyx":57
jpayne@68 21922 * return hts_set_verbosity(verbosity)
jpayne@68 21923 *
jpayne@68 21924 * cpdef get_verbosity(): # <<<<<<<<<<<<<<
jpayne@68 21925 * """Return the value of htslib's hts_verbose global variable."""
jpayne@68 21926 * return hts_get_verbosity()
jpayne@68 21927 */
jpayne@68 21928 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_3get_verbosity, 0, __pyx_n_s_get_verbosity, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
jpayne@68 21929 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21930 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_verbosity, __pyx_t_3) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
jpayne@68 21931 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21932
jpayne@68 21933 /* "pysam/libchtslib.pyx":98
jpayne@68 21934 * raise IOError(errno, 'failed to open HFile', self.name)
jpayne@68 21935 *
jpayne@68 21936 * def close(self): # <<<<<<<<<<<<<<
jpayne@68 21937 * if self.fp == NULL:
jpayne@68 21938 * return
jpayne@68 21939 */
jpayne@68 21940 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_5close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_close, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
jpayne@68 21941 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21942 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_close, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
jpayne@68 21943 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21944 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 21945
jpayne@68 21946 /* "pysam/libchtslib.pyx":108
jpayne@68 21947 * raise IOError(errno, 'failed to close HFile', self.name)
jpayne@68 21948 *
jpayne@68 21949 * def fileno(self): # <<<<<<<<<<<<<<
jpayne@68 21950 * if self.fp == NULL:
jpayne@68 21951 * raise IOError('operation on closed HFile')
jpayne@68 21952 */
jpayne@68 21953 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_7fileno, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_fileno, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
jpayne@68 21954 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21955 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_fileno, __pyx_t_3) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
jpayne@68 21956 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21957 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 21958
jpayne@68 21959 /* "pysam/libchtslib.pyx":116
jpayne@68 21960 * raise AttributeError('fileno not available')
jpayne@68 21961 *
jpayne@68 21962 * def __enter__(self): # <<<<<<<<<<<<<<
jpayne@68 21963 * return self
jpayne@68 21964 *
jpayne@68 21965 */
jpayne@68 21966 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_9__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile___enter, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error)
jpayne@68 21967 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21968 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_enter, __pyx_t_3) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
jpayne@68 21969 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21970 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 21971
jpayne@68 21972 /* "pysam/libchtslib.pyx":119
jpayne@68 21973 * return self
jpayne@68 21974 *
jpayne@68 21975 * def __exit__(self, type, value, tb): # <<<<<<<<<<<<<<
jpayne@68 21976 * self.close()
jpayne@68 21977 *
jpayne@68 21978 */
jpayne@68 21979 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_11__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile___exit, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
jpayne@68 21980 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21981 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_exit, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
jpayne@68 21982 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21983 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 21984
jpayne@68 21985 /* "pysam/libchtslib.pyx":131
jpayne@68 21986 * return line
jpayne@68 21987 *
jpayne@68 21988 * def flush(self): # <<<<<<<<<<<<<<
jpayne@68 21989 * if self.fp == NULL:
jpayne@68 21990 * raise IOError('operation on closed HFile')
jpayne@68 21991 */
jpayne@68 21992 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_17flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_flush, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
jpayne@68 21993 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 21994 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_flush, __pyx_t_3) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
jpayne@68 21995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 21996 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 21997
jpayne@68 21998 /* "pysam/libchtslib.pyx":137
jpayne@68 21999 * raise IOError(herrno(self.fp), 'failed to flush HFile', self.name)
jpayne@68 22000 *
jpayne@68 22001 * def isatty(self): # <<<<<<<<<<<<<<
jpayne@68 22002 * if self.fp == NULL:
jpayne@68 22003 * raise IOError('operation on closed HFile')
jpayne@68 22004 */
jpayne@68 22005 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_19isatty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_isatty, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
jpayne@68 22006 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22007 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_isatty, __pyx_t_3) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
jpayne@68 22008 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22009 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22010
jpayne@68 22011 /* "pysam/libchtslib.pyx":142
jpayne@68 22012 * return False
jpayne@68 22013 *
jpayne@68 22014 * def readable(self): # <<<<<<<<<<<<<<
jpayne@68 22015 * return self.fp != NULL and 'r' in self.mode
jpayne@68 22016 *
jpayne@68 22017 */
jpayne@68 22018 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_21readable, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_readable, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
jpayne@68 22019 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22020 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_readable, __pyx_t_3) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
jpayne@68 22021 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22022 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22023
jpayne@68 22024 /* "pysam/libchtslib.pyx":145
jpayne@68 22025 * return self.fp != NULL and 'r' in self.mode
jpayne@68 22026 *
jpayne@68 22027 * def read(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<<
jpayne@68 22028 * if self.fp == NULL:
jpayne@68 22029 * raise IOError('operation on closed HFile')
jpayne@68 22030 */
jpayne@68 22031 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_23read, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_read, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
jpayne@68 22032 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22033 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__74);
jpayne@68 22034 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_read, __pyx_t_3) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
jpayne@68 22035 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22036 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22037
jpayne@68 22038 /* "pysam/libchtslib.pyx":180
jpayne@68 22039 * return b''.join(parts)
jpayne@68 22040 *
jpayne@68 22041 * def readall(self): # <<<<<<<<<<<<<<
jpayne@68 22042 * return self.read()
jpayne@68 22043 *
jpayne@68 22044 */
jpayne@68 22045 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_25readall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_readall, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
jpayne@68 22046 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22047 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_readall, __pyx_t_3) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
jpayne@68 22048 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22049 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22050
jpayne@68 22051 /* "pysam/libchtslib.pyx":183
jpayne@68 22052 * return self.read()
jpayne@68 22053 *
jpayne@68 22054 * def readinto(self, buf): # <<<<<<<<<<<<<<
jpayne@68 22055 * if self.fp == NULL:
jpayne@68 22056 * raise IOError('operation on closed HFile')
jpayne@68 22057 */
jpayne@68 22058 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_27readinto, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_readinto, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
jpayne@68 22059 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22060 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_readinto, __pyx_t_3) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
jpayne@68 22061 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22062 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22063
jpayne@68 22064 /* "pysam/libchtslib.pyx":200
jpayne@68 22065 * return ret
jpayne@68 22066 *
jpayne@68 22067 * def readline(self, Py_ssize_t size=-1): # <<<<<<<<<<<<<<
jpayne@68 22068 * if self.fp == NULL:
jpayne@68 22069 * raise IOError('operation on closed HFile')
jpayne@68 22070 */
jpayne@68 22071 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_29readline, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_readline, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
jpayne@68 22072 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22073 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__74);
jpayne@68 22074 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_readline, __pyx_t_3) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
jpayne@68 22075 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22076 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22077
jpayne@68 22078 /* "pysam/libchtslib.pyx":241
jpayne@68 22079 * return b''.join(parts)
jpayne@68 22080 *
jpayne@68 22081 * def readlines(self): # <<<<<<<<<<<<<<
jpayne@68 22082 * return list(self)
jpayne@68 22083 *
jpayne@68 22084 */
jpayne@68 22085 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_31readlines, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_readlines, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
jpayne@68 22086 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22087 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_readlines, __pyx_t_3) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
jpayne@68 22088 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22089 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22090
jpayne@68 22091 /* "pysam/libchtslib.pyx":244
jpayne@68 22092 * return list(self)
jpayne@68 22093 *
jpayne@68 22094 * def seek(self, Py_ssize_t offset, int whence=io.SEEK_SET): # <<<<<<<<<<<<<<
jpayne@68 22095 * if self.fp == NULL:
jpayne@68 22096 * raise IOError('operation on closed HFile')
jpayne@68 22097 */
jpayne@68 22098 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_io); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22099 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22100 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22101 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22103 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22104 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22105 __pyx_k__18 = __pyx_t_4;
jpayne@68 22106 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22107 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22108 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22109 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22110 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22111 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22112 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22113 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22114 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22115 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22116 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22117 __Pyx_GIVEREF(__pyx_t_3);
jpayne@68 22118 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error);
jpayne@68 22119 __pyx_t_3 = 0;
jpayne@68 22120 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_33seek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_seek, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22121 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22122 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
jpayne@68 22123 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22124 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_seek, __pyx_t_3) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
jpayne@68 22125 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22126 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22127
jpayne@68 22128 /* "pysam/libchtslib.pyx":255
jpayne@68 22129 * return off
jpayne@68 22130 *
jpayne@68 22131 * def tell(self): # <<<<<<<<<<<<<<
jpayne@68 22132 * if self.fp == NULL:
jpayne@68 22133 * raise IOError('operation on closed HFile')
jpayne@68 22134 */
jpayne@68 22135 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_35tell, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_tell, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
jpayne@68 22136 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22137 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_tell, __pyx_t_3) < 0) __PYX_ERR(0, 255, __pyx_L1_error)
jpayne@68 22138 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22139 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22140
jpayne@68 22141 /* "pysam/libchtslib.pyx":266
jpayne@68 22142 * return ret
jpayne@68 22143 *
jpayne@68 22144 * def seekable(self): # <<<<<<<<<<<<<<
jpayne@68 22145 * return self.fp != NULL
jpayne@68 22146 *
jpayne@68 22147 */
jpayne@68 22148 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_37seekable, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_seekable, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
jpayne@68 22149 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22150 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_seekable, __pyx_t_3) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
jpayne@68 22151 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22152 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22153
jpayne@68 22154 /* "pysam/libchtslib.pyx":269
jpayne@68 22155 * return self.fp != NULL
jpayne@68 22156 *
jpayne@68 22157 * def truncate(self, size=None): # <<<<<<<<<<<<<<
jpayne@68 22158 * raise NotImplementedError()
jpayne@68 22159 *
jpayne@68 22160 */
jpayne@68 22161 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_39truncate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_truncate, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
jpayne@68 22162 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22163 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__79);
jpayne@68 22164 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_truncate, __pyx_t_3) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
jpayne@68 22165 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22166 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22167
jpayne@68 22168 /* "pysam/libchtslib.pyx":272
jpayne@68 22169 * raise NotImplementedError()
jpayne@68 22170 *
jpayne@68 22171 * def writable(self): # <<<<<<<<<<<<<<
jpayne@68 22172 * return self.fp != NULL and 'w' in self.mode
jpayne@68 22173 *
jpayne@68 22174 */
jpayne@68 22175 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_41writable, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_writable, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
jpayne@68 22176 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22177 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_writable, __pyx_t_3) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
jpayne@68 22178 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22179 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22180
jpayne@68 22181 /* "pysam/libchtslib.pyx":275
jpayne@68 22182 * return self.fp != NULL and 'w' in self.mode
jpayne@68 22183 *
jpayne@68 22184 * def write(self, bytes b): # <<<<<<<<<<<<<<
jpayne@68 22185 * if self.fp == NULL:
jpayne@68 22186 * raise IOError('operation on closed HFile')
jpayne@68 22187 */
jpayne@68 22188 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_43write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_write, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
jpayne@68 22189 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22190 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_write, __pyx_t_3) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
jpayne@68 22191 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22192 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22193
jpayne@68 22194 /* "pysam/libchtslib.pyx":286
jpayne@68 22195 * return got
jpayne@68 22196 *
jpayne@68 22197 * def writelines(self, lines): # <<<<<<<<<<<<<<
jpayne@68 22198 * for line in lines:
jpayne@68 22199 * self.write(line)
jpayne@68 22200 */
jpayne@68 22201 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_45writelines, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile_writelines, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
jpayne@68 22202 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22203 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HFile, __pyx_n_s_writelines, __pyx_t_3) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
jpayne@68 22204 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22205 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HFile);
jpayne@68 22206
jpayne@68 22207 /* "(tree fragment)":1
jpayne@68 22208 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
jpayne@68 22209 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 22210 * def __setstate_cython__(self, __pyx_state):
jpayne@68 22211 */
jpayne@68 22212 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_47__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile___reduce_cython, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
jpayne@68 22213 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22214 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
jpayne@68 22215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22216
jpayne@68 22217 /* "(tree fragment)":3
jpayne@68 22218 * def __reduce_cython__(self):
jpayne@68 22219 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 22220 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
jpayne@68 22221 * raise TypeError, "self.fp cannot be converted to a Python object for pickling"
jpayne@68 22222 */
jpayne@68 22223 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_5HFile_49__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HFile___setstate_cython, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
jpayne@68 22224 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22225 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
jpayne@68 22226 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22227
jpayne@68 22228 /* "pysam/libchtslib.pyx":297
jpayne@68 22229 * ########################################################################
jpayne@68 22230 *
jpayne@68 22231 * class CallableValue(object): # <<<<<<<<<<<<<<
jpayne@68 22232 * def __init__(self, value):
jpayne@68 22233 * self.value = value
jpayne@68 22234 */
jpayne@68 22235 __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_tuple__84); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 22236 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22237 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 22238 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22239 __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_CallableValue, __pyx_n_s_CallableValue, (PyObject *) NULL, __pyx_n_s_pysam_libchtslib, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 22240 __Pyx_GOTREF(__pyx_t_5);
jpayne@68 22241 if (__pyx_t_3 != __pyx_tuple__84) {
jpayne@68 22242 if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__84) < 0))) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 22243 }
jpayne@68 22244
jpayne@68 22245 /* "pysam/libchtslib.pyx":298
jpayne@68 22246 *
jpayne@68 22247 * class CallableValue(object):
jpayne@68 22248 * def __init__(self, value): # <<<<<<<<<<<<<<
jpayne@68 22249 * self.value = value
jpayne@68 22250 * def __call__(self):
jpayne@68 22251 */
jpayne@68 22252 __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_13CallableValue_1__init__, 0, __pyx_n_s_CallableValue___init, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
jpayne@68 22253 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 22254 if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
jpayne@68 22255 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 22256
jpayne@68 22257 /* "pysam/libchtslib.pyx":300
jpayne@68 22258 * def __init__(self, value):
jpayne@68 22259 * self.value = value
jpayne@68 22260 * def __call__(self): # <<<<<<<<<<<<<<
jpayne@68 22261 * return self.value
jpayne@68 22262 * def __bool__(self):
jpayne@68 22263 */
jpayne@68 22264 __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_13CallableValue_3__call__, 0, __pyx_n_s_CallableValue___call, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
jpayne@68 22265 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 22266 if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_call, __pyx_t_6) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
jpayne@68 22267 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 22268
jpayne@68 22269 /* "pysam/libchtslib.pyx":302
jpayne@68 22270 * def __call__(self):
jpayne@68 22271 * return self.value
jpayne@68 22272 * def __bool__(self): # <<<<<<<<<<<<<<
jpayne@68 22273 * return self.value
jpayne@68 22274 * def __nonzero__(self):
jpayne@68 22275 */
jpayne@68 22276 __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_13CallableValue_5__bool__, 0, __pyx_n_s_CallableValue___bool, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
jpayne@68 22277 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 22278 if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_bool, __pyx_t_6) < 0) __PYX_ERR(0, 302, __pyx_L1_error)
jpayne@68 22279 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 22280
jpayne@68 22281 /* "pysam/libchtslib.pyx":304
jpayne@68 22282 * def __bool__(self):
jpayne@68 22283 * return self.value
jpayne@68 22284 * def __nonzero__(self): # <<<<<<<<<<<<<<
jpayne@68 22285 * return self.value
jpayne@68 22286 * def __eq__(self, other):
jpayne@68 22287 */
jpayne@68 22288 __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_13CallableValue_7__nonzero__, 0, __pyx_n_s_CallableValue___nonzero, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
jpayne@68 22289 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 22290 if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_nonzero, __pyx_t_6) < 0) __PYX_ERR(0, 304, __pyx_L1_error)
jpayne@68 22291 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 22292
jpayne@68 22293 /* "pysam/libchtslib.pyx":306
jpayne@68 22294 * def __nonzero__(self):
jpayne@68 22295 * return self.value
jpayne@68 22296 * def __eq__(self, other): # <<<<<<<<<<<<<<
jpayne@68 22297 * return self.value == other
jpayne@68 22298 * def __ne__(self, other):
jpayne@68 22299 */
jpayne@68 22300 __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_13CallableValue_9__eq__, 0, __pyx_n_s_CallableValue___eq, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
jpayne@68 22301 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 22302 if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_eq, __pyx_t_6) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
jpayne@68 22303 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 22304
jpayne@68 22305 /* "pysam/libchtslib.pyx":308
jpayne@68 22306 * def __eq__(self, other):
jpayne@68 22307 * return self.value == other
jpayne@68 22308 * def __ne__(self, other): # <<<<<<<<<<<<<<
jpayne@68 22309 * return self.value != other
jpayne@68 22310 *
jpayne@68 22311 */
jpayne@68 22312 __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_13CallableValue_11__ne__, 0, __pyx_n_s_CallableValue___ne, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
jpayne@68 22313 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 22314 if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ne, __pyx_t_6) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
jpayne@68 22315 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 22316
jpayne@68 22317 /* "pysam/libchtslib.pyx":297
jpayne@68 22318 * ########################################################################
jpayne@68 22319 *
jpayne@68 22320 * class CallableValue(object): # <<<<<<<<<<<<<<
jpayne@68 22321 * def __init__(self, value):
jpayne@68 22322 * self.value = value
jpayne@68 22323 */
jpayne@68 22324 __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_CallableValue, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 22325 __Pyx_GOTREF(__pyx_t_6);
jpayne@68 22326 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CallableValue, __pyx_t_6) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
jpayne@68 22327 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
jpayne@68 22328 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
jpayne@68 22329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22330 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22331
jpayne@68 22332 /* "pysam/libchtslib.pyx":312
jpayne@68 22333 *
jpayne@68 22334 *
jpayne@68 22335 * CTrue = CallableValue(True) # <<<<<<<<<<<<<<
jpayne@68 22336 * CFalse = CallableValue(False)
jpayne@68 22337 *
jpayne@68 22338 */
jpayne@68 22339 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CallableValue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
jpayne@68 22340 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22341 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
jpayne@68 22342 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22343 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22344 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CTrue, __pyx_t_2) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
jpayne@68 22345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22346
jpayne@68 22347 /* "pysam/libchtslib.pyx":313
jpayne@68 22348 *
jpayne@68 22349 * CTrue = CallableValue(True)
jpayne@68 22350 * CFalse = CallableValue(False) # <<<<<<<<<<<<<<
jpayne@68 22351 *
jpayne@68 22352 *
jpayne@68 22353 */
jpayne@68 22354 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallableValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
jpayne@68 22355 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22356 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
jpayne@68 22357 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22358 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22359 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CFalse, __pyx_t_3) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
jpayne@68 22360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22361
jpayne@68 22362 /* "pysam/libchtslib.pyx":331
jpayne@68 22363 * self.duplicate_filehandle = True
jpayne@68 22364 *
jpayne@68 22365 * def close(self): # <<<<<<<<<<<<<<
jpayne@68 22366 * if self.htsfile:
jpayne@68 22367 * hts_close(self.htsfile)
jpayne@68 22368 */
jpayne@68 22369 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_3close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_close, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
jpayne@68 22370 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22371 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_close, __pyx_t_3) < 0) __PYX_ERR(0, 331, __pyx_L1_error)
jpayne@68 22372 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22373 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22374
jpayne@68 22375 /* "pysam/libchtslib.pyx":341
jpayne@68 22376 * self.htsfile = NULL
jpayne@68 22377 *
jpayne@68 22378 * def flush(self): # <<<<<<<<<<<<<<
jpayne@68 22379 * """Flush any buffered data to the underlying output stream."""
jpayne@68 22380 * if self.htsfile:
jpayne@68 22381 */
jpayne@68 22382 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_7flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_flush, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error)
jpayne@68 22383 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22384 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_flush, __pyx_t_3) < 0) __PYX_ERR(0, 341, __pyx_L1_error)
jpayne@68 22385 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22386 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22387
jpayne@68 22388 /* "pysam/libchtslib.pyx":347
jpayne@68 22389 * raise OSError(errno, f'Flushing {type(self).__name__} failed', force_str(self.filename))
jpayne@68 22390 *
jpayne@68 22391 * def check_truncation(self, ignore_truncation=False): # <<<<<<<<<<<<<<
jpayne@68 22392 * """Check if file is truncated."""
jpayne@68 22393 * if not self.htsfile:
jpayne@68 22394 */
jpayne@68 22395 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_9check_truncation, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_check_truncation, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
jpayne@68 22396 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22397 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__88);
jpayne@68 22398 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_check_truncation, __pyx_t_3) < 0) __PYX_ERR(0, 347, __pyx_L1_error)
jpayne@68 22399 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22400 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22401
jpayne@68 22402 /* "pysam/libchtslib.pyx":369
jpayne@68 22403 * raise IOError(msg)
jpayne@68 22404 *
jpayne@68 22405 * def __enter__(self): # <<<<<<<<<<<<<<
jpayne@68 22406 * return self
jpayne@68 22407 *
jpayne@68 22408 */
jpayne@68 22409 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_11__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile___enter, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
jpayne@68 22410 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22411 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_enter, __pyx_t_3) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
jpayne@68 22412 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22413 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22414
jpayne@68 22415 /* "pysam/libchtslib.pyx":372
jpayne@68 22416 * return self
jpayne@68 22417 *
jpayne@68 22418 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<<
jpayne@68 22419 * self.close()
jpayne@68 22420 * return False
jpayne@68 22421 */
jpayne@68 22422 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_13__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile___exit, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
jpayne@68 22423 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22424 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_exit, __pyx_t_3) < 0) __PYX_ERR(0, 372, __pyx_L1_error)
jpayne@68 22425 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22426 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22427
jpayne@68 22428 /* "pysam/libchtslib.pyx":472
jpayne@68 22429 * return self.htsfile != NULL and self.htsfile.format.format == bcf
jpayne@68 22430 *
jpayne@68 22431 * def reset(self): # <<<<<<<<<<<<<<
jpayne@68 22432 * """reset file position to beginning of file just after the header.
jpayne@68 22433 *
jpayne@68 22434 */
jpayne@68 22435 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_15reset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_reset, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error)
jpayne@68 22436 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22437 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_reset, __pyx_t_3) < 0) __PYX_ERR(0, 472, __pyx_L1_error)
jpayne@68 22438 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22439 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22440
jpayne@68 22441 /* "pysam/libchtslib.pyx":483
jpayne@68 22442 * return self.seek(self.start_offset)
jpayne@68 22443 *
jpayne@68 22444 * def seek(self, uint64_t offset, int whence=io.SEEK_SET): # <<<<<<<<<<<<<<
jpayne@68 22445 * """move file pointer to position *offset*, see :meth:`pysam.HTSFile.tell`."""
jpayne@68 22446 * if not self.is_open:
jpayne@68 22447 */
jpayne@68 22448 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_io); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22449 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22450 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22451 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22452 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22453 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22454 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22455 __pyx_k__41 = __pyx_t_4;
jpayne@68 22456 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22457 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22458 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22459 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22460 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22461 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22462 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22463 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22464 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22465 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22466 __Pyx_GOTREF(__pyx_t_2);
jpayne@68 22467 __Pyx_GIVEREF(__pyx_t_3);
jpayne@68 22468 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error);
jpayne@68 22469 __pyx_t_3 = 0;
jpayne@68 22470 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_17seek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_seek, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22471 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22472 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
jpayne@68 22473 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
jpayne@68 22474 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_seek, __pyx_t_3) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
jpayne@68 22475 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22476 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22477
jpayne@68 22478 /* "pysam/libchtslib.pyx":503
jpayne@68 22479 * return ret
jpayne@68 22480 *
jpayne@68 22481 * def tell(self): # <<<<<<<<<<<<<<
jpayne@68 22482 * """return current file position, see :meth:`pysam.HTSFile.seek`."""
jpayne@68 22483 * if not self.is_open:
jpayne@68 22484 */
jpayne@68 22485 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_19tell, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_tell, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
jpayne@68 22486 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22487 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_tell, __pyx_t_3) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
jpayne@68 22488 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22489 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22490
jpayne@68 22491 /* "pysam/libchtslib.pyx":575
jpayne@68 22492 * return htsfile
jpayne@68 22493 *
jpayne@68 22494 * def add_hts_options(self, format_options=None): # <<<<<<<<<<<<<<
jpayne@68 22495 * """Given a list of key=value format option strings, add them to an open htsFile
jpayne@68 22496 * """
jpayne@68 22497 */
jpayne@68 22498 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_21add_hts_options, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_add_hts_options, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
jpayne@68 22499 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22500 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__79);
jpayne@68 22501 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_add_hts_options, __pyx_t_3) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
jpayne@68 22502 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22503 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22504
jpayne@68 22505 /* "pysam/libchtslib.pyx":595
jpayne@68 22506 * hts_opt_free(opts)
jpayne@68 22507 *
jpayne@68 22508 * def parse_region(self, contig=None, start=None, stop=None, # <<<<<<<<<<<<<<
jpayne@68 22509 * region=None, tid=None,
jpayne@68 22510 * reference=None, end=None):
jpayne@68 22511 */
jpayne@68 22512 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_23parse_region, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_parse_region, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
jpayne@68 22513 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22514 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__94);
jpayne@68 22515 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_parse_region, __pyx_t_3) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
jpayne@68 22516 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22517 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22518
jpayne@68 22519 /* "pysam/libchtslib.pyx":700
jpayne@68 22520 * return 1, rtid, rstart, rstop
jpayne@68 22521 *
jpayne@68 22522 * def is_valid_tid(self, tid): # <<<<<<<<<<<<<<
jpayne@68 22523 * """
jpayne@68 22524 * return True if the numerical :term:`tid` is valid; False otherwise.
jpayne@68 22525 */
jpayne@68 22526 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_25is_valid_tid, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_is_valid_tid, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __pyx_L1_error)
jpayne@68 22527 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22528 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_is_valid_tid, __pyx_t_3) < 0) __PYX_ERR(0, 700, __pyx_L1_error)
jpayne@68 22529 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22530 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22531
jpayne@68 22532 /* "pysam/libchtslib.pyx":708
jpayne@68 22533 * raise NotImplementedError()
jpayne@68 22534 *
jpayne@68 22535 * def is_valid_reference_name(self, contig): # <<<<<<<<<<<<<<
jpayne@68 22536 * """
jpayne@68 22537 * return True if the contig name :term:`contig` is valid; False otherwise.
jpayne@68 22538 */
jpayne@68 22539 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_27is_valid_reference_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_is_valid_reference_name, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error)
jpayne@68 22540 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22541 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_is_valid_reference_name, __pyx_t_3) < 0) __PYX_ERR(0, 708, __pyx_L1_error)
jpayne@68 22542 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22543 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22544
jpayne@68 22545 /* "pysam/libchtslib.pyx":714
jpayne@68 22546 * return self.get_tid(contig) != -1
jpayne@68 22547 *
jpayne@68 22548 * def get_tid(self, contig): # <<<<<<<<<<<<<<
jpayne@68 22549 * """
jpayne@68 22550 * return the numerical :term:`tid` corresponding to
jpayne@68 22551 */
jpayne@68 22552 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_29get_tid, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_get_tid, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error)
jpayne@68 22553 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22554 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_get_tid, __pyx_t_3) < 0) __PYX_ERR(0, 714, __pyx_L1_error)
jpayne@68 22555 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22556 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22557
jpayne@68 22558 /* "pysam/libchtslib.pyx":723
jpayne@68 22559 * raise NotImplementedError()
jpayne@68 22560 *
jpayne@68 22561 * def get_reference_name(self, tid): # <<<<<<<<<<<<<<
jpayne@68 22562 * """
jpayne@68 22563 * return :term:`contig` name corresponding to numerical :term:`tid`
jpayne@68 22564 */
jpayne@68 22565 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_31get_reference_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile_get_reference_name, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
jpayne@68 22566 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22567 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile, __pyx_n_s_get_reference_name, __pyx_t_3) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
jpayne@68 22568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22569 PyType_Modified(__pyx_ptype_5pysam_10libchtslib_HTSFile);
jpayne@68 22570
jpayne@68 22571 /* "(tree fragment)":1
jpayne@68 22572 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
jpayne@68 22573 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 22574 * def __setstate_cython__(self, __pyx_state):
jpayne@68 22575 */
jpayne@68 22576 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile___reduce_cython, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
jpayne@68 22577 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22578 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
jpayne@68 22579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22580
jpayne@68 22581 /* "(tree fragment)":3
jpayne@68 22582 * def __reduce_cython__(self):
jpayne@68 22583 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 22584 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
jpayne@68 22585 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
jpayne@68 22586 */
jpayne@68 22587 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_10libchtslib_7HTSFile_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTSFile___setstate_cython, NULL, __pyx_n_s_pysam_libchtslib, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
jpayne@68 22588 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22589 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
jpayne@68 22590 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22591
jpayne@68 22592 /* "pysam/libchtslib.pyx":1
jpayne@68 22593 * # cython: language_level=3 # <<<<<<<<<<<<<<
jpayne@68 22594 * # cython: embedsignature=True
jpayne@68 22595 * # cython: profile=True
jpayne@68 22596 */
jpayne@68 22597 __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 22598 __Pyx_GOTREF(__pyx_t_3);
jpayne@68 22599 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
jpayne@68 22600 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
jpayne@68 22601 __Pyx_TraceReturn(Py_None, 0);
jpayne@68 22602
jpayne@68 22603 /*--- Wrapped vars code ---*/
jpayne@68 22604
jpayne@68 22605 goto __pyx_L0;
jpayne@68 22606 __pyx_L1_error:;
jpayne@68 22607 __Pyx_XDECREF(__pyx_t_2);
jpayne@68 22608 __Pyx_XDECREF(__pyx_t_3);
jpayne@68 22609 __Pyx_XDECREF(__pyx_t_5);
jpayne@68 22610 __Pyx_XDECREF(__pyx_t_6);
jpayne@68 22611 if (__pyx_m) {
jpayne@68 22612 if (__pyx_d && stringtab_initialized) {
jpayne@68 22613 __Pyx_AddTraceback("init pysam.libchtslib", __pyx_clineno, __pyx_lineno, __pyx_filename);
jpayne@68 22614 }
jpayne@68 22615 #if !CYTHON_USE_MODULE_STATE
jpayne@68 22616 Py_CLEAR(__pyx_m);
jpayne@68 22617 #else
jpayne@68 22618 Py_DECREF(__pyx_m);
jpayne@68 22619 if (pystate_addmodule_run) {
jpayne@68 22620 PyObject *tp, *value, *tb;
jpayne@68 22621 PyErr_Fetch(&tp, &value, &tb);
jpayne@68 22622 PyState_RemoveModule(&__pyx_moduledef);
jpayne@68 22623 PyErr_Restore(tp, value, tb);
jpayne@68 22624 }
jpayne@68 22625 #endif
jpayne@68 22626 } else if (!PyErr_Occurred()) {
jpayne@68 22627 PyErr_SetString(PyExc_ImportError, "init pysam.libchtslib");
jpayne@68 22628 }
jpayne@68 22629 __pyx_L0:;
jpayne@68 22630 __Pyx_RefNannyFinishContext();
jpayne@68 22631 #if CYTHON_PEP489_MULTI_PHASE_INIT
jpayne@68 22632 return (__pyx_m != NULL) ? 0 : -1;
jpayne@68 22633 #elif PY_MAJOR_VERSION >= 3
jpayne@68 22634 return __pyx_m;
jpayne@68 22635 #else
jpayne@68 22636 return;
jpayne@68 22637 #endif
jpayne@68 22638 }
jpayne@68 22639 /* #### Code section: cleanup_globals ### */
jpayne@68 22640 /* #### Code section: cleanup_module ### */
jpayne@68 22641 /* #### Code section: main_method ### */
jpayne@68 22642 /* #### Code section: utility_code_pragmas ### */
jpayne@68 22643 #ifdef _MSC_VER
jpayne@68 22644 #pragma warning( push )
jpayne@68 22645 /* Warning 4127: conditional expression is constant
jpayne@68 22646 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
jpayne@68 22647 * compile-time, so this warning is not useful
jpayne@68 22648 */
jpayne@68 22649 #pragma warning( disable : 4127 )
jpayne@68 22650 #endif
jpayne@68 22651
jpayne@68 22652
jpayne@68 22653
jpayne@68 22654 /* #### Code section: utility_code_def ### */
jpayne@68 22655
jpayne@68 22656 /* --- Runtime support code --- */
jpayne@68 22657 /* Refnanny */
jpayne@68 22658 #if CYTHON_REFNANNY
jpayne@68 22659 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
jpayne@68 22660 PyObject *m = NULL, *p = NULL;
jpayne@68 22661 void *r = NULL;
jpayne@68 22662 m = PyImport_ImportModule(modname);
jpayne@68 22663 if (!m) goto end;
jpayne@68 22664 p = PyObject_GetAttrString(m, "RefNannyAPI");
jpayne@68 22665 if (!p) goto end;
jpayne@68 22666 r = PyLong_AsVoidPtr(p);
jpayne@68 22667 end:
jpayne@68 22668 Py_XDECREF(p);
jpayne@68 22669 Py_XDECREF(m);
jpayne@68 22670 return (__Pyx_RefNannyAPIStruct *)r;
jpayne@68 22671 }
jpayne@68 22672 #endif
jpayne@68 22673
jpayne@68 22674 /* PyErrExceptionMatches */
jpayne@68 22675 #if CYTHON_FAST_THREAD_STATE
jpayne@68 22676 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
jpayne@68 22677 Py_ssize_t i, n;
jpayne@68 22678 n = PyTuple_GET_SIZE(tuple);
jpayne@68 22679 #if PY_MAJOR_VERSION >= 3
jpayne@68 22680 for (i=0; i<n; i++) {
jpayne@68 22681 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
jpayne@68 22682 }
jpayne@68 22683 #endif
jpayne@68 22684 for (i=0; i<n; i++) {
jpayne@68 22685 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
jpayne@68 22686 }
jpayne@68 22687 return 0;
jpayne@68 22688 }
jpayne@68 22689 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
jpayne@68 22690 int result;
jpayne@68 22691 PyObject *exc_type;
jpayne@68 22692 #if PY_VERSION_HEX >= 0x030C00A6
jpayne@68 22693 PyObject *current_exception = tstate->current_exception;
jpayne@68 22694 if (unlikely(!current_exception)) return 0;
jpayne@68 22695 exc_type = (PyObject*) Py_TYPE(current_exception);
jpayne@68 22696 if (exc_type == err) return 1;
jpayne@68 22697 #else
jpayne@68 22698 exc_type = tstate->curexc_type;
jpayne@68 22699 if (exc_type == err) return 1;
jpayne@68 22700 if (unlikely(!exc_type)) return 0;
jpayne@68 22701 #endif
jpayne@68 22702 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 22703 Py_INCREF(exc_type);
jpayne@68 22704 #endif
jpayne@68 22705 if (unlikely(PyTuple_Check(err))) {
jpayne@68 22706 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
jpayne@68 22707 } else {
jpayne@68 22708 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
jpayne@68 22709 }
jpayne@68 22710 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 22711 Py_DECREF(exc_type);
jpayne@68 22712 #endif
jpayne@68 22713 return result;
jpayne@68 22714 }
jpayne@68 22715 #endif
jpayne@68 22716
jpayne@68 22717 /* PyErrFetchRestore */
jpayne@68 22718 #if CYTHON_FAST_THREAD_STATE
jpayne@68 22719 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
jpayne@68 22720 #if PY_VERSION_HEX >= 0x030C00A6
jpayne@68 22721 PyObject *tmp_value;
jpayne@68 22722 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
jpayne@68 22723 if (value) {
jpayne@68 22724 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 22725 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
jpayne@68 22726 #endif
jpayne@68 22727 PyException_SetTraceback(value, tb);
jpayne@68 22728 }
jpayne@68 22729 tmp_value = tstate->current_exception;
jpayne@68 22730 tstate->current_exception = value;
jpayne@68 22731 Py_XDECREF(tmp_value);
jpayne@68 22732 Py_XDECREF(type);
jpayne@68 22733 Py_XDECREF(tb);
jpayne@68 22734 #else
jpayne@68 22735 PyObject *tmp_type, *tmp_value, *tmp_tb;
jpayne@68 22736 tmp_type = tstate->curexc_type;
jpayne@68 22737 tmp_value = tstate->curexc_value;
jpayne@68 22738 tmp_tb = tstate->curexc_traceback;
jpayne@68 22739 tstate->curexc_type = type;
jpayne@68 22740 tstate->curexc_value = value;
jpayne@68 22741 tstate->curexc_traceback = tb;
jpayne@68 22742 Py_XDECREF(tmp_type);
jpayne@68 22743 Py_XDECREF(tmp_value);
jpayne@68 22744 Py_XDECREF(tmp_tb);
jpayne@68 22745 #endif
jpayne@68 22746 }
jpayne@68 22747 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
jpayne@68 22748 #if PY_VERSION_HEX >= 0x030C00A6
jpayne@68 22749 PyObject* exc_value;
jpayne@68 22750 exc_value = tstate->current_exception;
jpayne@68 22751 tstate->current_exception = 0;
jpayne@68 22752 *value = exc_value;
jpayne@68 22753 *type = NULL;
jpayne@68 22754 *tb = NULL;
jpayne@68 22755 if (exc_value) {
jpayne@68 22756 *type = (PyObject*) Py_TYPE(exc_value);
jpayne@68 22757 Py_INCREF(*type);
jpayne@68 22758 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 22759 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
jpayne@68 22760 Py_XINCREF(*tb);
jpayne@68 22761 #else
jpayne@68 22762 *tb = PyException_GetTraceback(exc_value);
jpayne@68 22763 #endif
jpayne@68 22764 }
jpayne@68 22765 #else
jpayne@68 22766 *type = tstate->curexc_type;
jpayne@68 22767 *value = tstate->curexc_value;
jpayne@68 22768 *tb = tstate->curexc_traceback;
jpayne@68 22769 tstate->curexc_type = 0;
jpayne@68 22770 tstate->curexc_value = 0;
jpayne@68 22771 tstate->curexc_traceback = 0;
jpayne@68 22772 #endif
jpayne@68 22773 }
jpayne@68 22774 #endif
jpayne@68 22775
jpayne@68 22776 /* PyObjectGetAttrStr */
jpayne@68 22777 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 22778 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
jpayne@68 22779 PyTypeObject* tp = Py_TYPE(obj);
jpayne@68 22780 if (likely(tp->tp_getattro))
jpayne@68 22781 return tp->tp_getattro(obj, attr_name);
jpayne@68 22782 #if PY_MAJOR_VERSION < 3
jpayne@68 22783 if (likely(tp->tp_getattr))
jpayne@68 22784 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
jpayne@68 22785 #endif
jpayne@68 22786 return PyObject_GetAttr(obj, attr_name);
jpayne@68 22787 }
jpayne@68 22788 #endif
jpayne@68 22789
jpayne@68 22790 /* PyObjectGetAttrStrNoError */
jpayne@68 22791 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
jpayne@68 22792 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
jpayne@68 22793 __Pyx_PyThreadState_declare
jpayne@68 22794 __Pyx_PyThreadState_assign
jpayne@68 22795 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
jpayne@68 22796 __Pyx_PyErr_Clear();
jpayne@68 22797 }
jpayne@68 22798 #endif
jpayne@68 22799 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
jpayne@68 22800 PyObject *result;
jpayne@68 22801 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
jpayne@68 22802 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
jpayne@68 22803 return result;
jpayne@68 22804 #else
jpayne@68 22805 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
jpayne@68 22806 PyTypeObject* tp = Py_TYPE(obj);
jpayne@68 22807 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
jpayne@68 22808 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
jpayne@68 22809 }
jpayne@68 22810 #endif
jpayne@68 22811 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
jpayne@68 22812 if (unlikely(!result)) {
jpayne@68 22813 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
jpayne@68 22814 }
jpayne@68 22815 return result;
jpayne@68 22816 #endif
jpayne@68 22817 }
jpayne@68 22818
jpayne@68 22819 /* GetBuiltinName */
jpayne@68 22820 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
jpayne@68 22821 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
jpayne@68 22822 if (unlikely(!result) && !PyErr_Occurred()) {
jpayne@68 22823 PyErr_Format(PyExc_NameError,
jpayne@68 22824 #if PY_MAJOR_VERSION >= 3
jpayne@68 22825 "name '%U' is not defined", name);
jpayne@68 22826 #else
jpayne@68 22827 "name '%.200s' is not defined", PyString_AS_STRING(name));
jpayne@68 22828 #endif
jpayne@68 22829 }
jpayne@68 22830 return result;
jpayne@68 22831 }
jpayne@68 22832
jpayne@68 22833 /* TupleAndListFromArray */
jpayne@68 22834 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 22835 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
jpayne@68 22836 PyObject *v;
jpayne@68 22837 Py_ssize_t i;
jpayne@68 22838 for (i = 0; i < length; i++) {
jpayne@68 22839 v = dest[i] = src[i];
jpayne@68 22840 Py_INCREF(v);
jpayne@68 22841 }
jpayne@68 22842 }
jpayne@68 22843 static CYTHON_INLINE PyObject *
jpayne@68 22844 __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
jpayne@68 22845 {
jpayne@68 22846 PyObject *res;
jpayne@68 22847 if (n <= 0) {
jpayne@68 22848 Py_INCREF(__pyx_empty_tuple);
jpayne@68 22849 return __pyx_empty_tuple;
jpayne@68 22850 }
jpayne@68 22851 res = PyTuple_New(n);
jpayne@68 22852 if (unlikely(res == NULL)) return NULL;
jpayne@68 22853 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
jpayne@68 22854 return res;
jpayne@68 22855 }
jpayne@68 22856 static CYTHON_INLINE PyObject *
jpayne@68 22857 __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
jpayne@68 22858 {
jpayne@68 22859 PyObject *res;
jpayne@68 22860 if (n <= 0) {
jpayne@68 22861 return PyList_New(0);
jpayne@68 22862 }
jpayne@68 22863 res = PyList_New(n);
jpayne@68 22864 if (unlikely(res == NULL)) return NULL;
jpayne@68 22865 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
jpayne@68 22866 return res;
jpayne@68 22867 }
jpayne@68 22868 #endif
jpayne@68 22869
jpayne@68 22870 /* BytesEquals */
jpayne@68 22871 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
jpayne@68 22872 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 22873 return PyObject_RichCompareBool(s1, s2, equals);
jpayne@68 22874 #else
jpayne@68 22875 if (s1 == s2) {
jpayne@68 22876 return (equals == Py_EQ);
jpayne@68 22877 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
jpayne@68 22878 const char *ps1, *ps2;
jpayne@68 22879 Py_ssize_t length = PyBytes_GET_SIZE(s1);
jpayne@68 22880 if (length != PyBytes_GET_SIZE(s2))
jpayne@68 22881 return (equals == Py_NE);
jpayne@68 22882 ps1 = PyBytes_AS_STRING(s1);
jpayne@68 22883 ps2 = PyBytes_AS_STRING(s2);
jpayne@68 22884 if (ps1[0] != ps2[0]) {
jpayne@68 22885 return (equals == Py_NE);
jpayne@68 22886 } else if (length == 1) {
jpayne@68 22887 return (equals == Py_EQ);
jpayne@68 22888 } else {
jpayne@68 22889 int result;
jpayne@68 22890 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
jpayne@68 22891 Py_hash_t hash1, hash2;
jpayne@68 22892 hash1 = ((PyBytesObject*)s1)->ob_shash;
jpayne@68 22893 hash2 = ((PyBytesObject*)s2)->ob_shash;
jpayne@68 22894 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
jpayne@68 22895 return (equals == Py_NE);
jpayne@68 22896 }
jpayne@68 22897 #endif
jpayne@68 22898 result = memcmp(ps1, ps2, (size_t)length);
jpayne@68 22899 return (equals == Py_EQ) ? (result == 0) : (result != 0);
jpayne@68 22900 }
jpayne@68 22901 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
jpayne@68 22902 return (equals == Py_NE);
jpayne@68 22903 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
jpayne@68 22904 return (equals == Py_NE);
jpayne@68 22905 } else {
jpayne@68 22906 int result;
jpayne@68 22907 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
jpayne@68 22908 if (!py_result)
jpayne@68 22909 return -1;
jpayne@68 22910 result = __Pyx_PyObject_IsTrue(py_result);
jpayne@68 22911 Py_DECREF(py_result);
jpayne@68 22912 return result;
jpayne@68 22913 }
jpayne@68 22914 #endif
jpayne@68 22915 }
jpayne@68 22916
jpayne@68 22917 /* UnicodeEquals */
jpayne@68 22918 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
jpayne@68 22919 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 22920 return PyObject_RichCompareBool(s1, s2, equals);
jpayne@68 22921 #else
jpayne@68 22922 #if PY_MAJOR_VERSION < 3
jpayne@68 22923 PyObject* owned_ref = NULL;
jpayne@68 22924 #endif
jpayne@68 22925 int s1_is_unicode, s2_is_unicode;
jpayne@68 22926 if (s1 == s2) {
jpayne@68 22927 goto return_eq;
jpayne@68 22928 }
jpayne@68 22929 s1_is_unicode = PyUnicode_CheckExact(s1);
jpayne@68 22930 s2_is_unicode = PyUnicode_CheckExact(s2);
jpayne@68 22931 #if PY_MAJOR_VERSION < 3
jpayne@68 22932 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
jpayne@68 22933 owned_ref = PyUnicode_FromObject(s2);
jpayne@68 22934 if (unlikely(!owned_ref))
jpayne@68 22935 return -1;
jpayne@68 22936 s2 = owned_ref;
jpayne@68 22937 s2_is_unicode = 1;
jpayne@68 22938 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
jpayne@68 22939 owned_ref = PyUnicode_FromObject(s1);
jpayne@68 22940 if (unlikely(!owned_ref))
jpayne@68 22941 return -1;
jpayne@68 22942 s1 = owned_ref;
jpayne@68 22943 s1_is_unicode = 1;
jpayne@68 22944 } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
jpayne@68 22945 return __Pyx_PyBytes_Equals(s1, s2, equals);
jpayne@68 22946 }
jpayne@68 22947 #endif
jpayne@68 22948 if (s1_is_unicode & s2_is_unicode) {
jpayne@68 22949 Py_ssize_t length;
jpayne@68 22950 int kind;
jpayne@68 22951 void *data1, *data2;
jpayne@68 22952 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
jpayne@68 22953 return -1;
jpayne@68 22954 length = __Pyx_PyUnicode_GET_LENGTH(s1);
jpayne@68 22955 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
jpayne@68 22956 goto return_ne;
jpayne@68 22957 }
jpayne@68 22958 #if CYTHON_USE_UNICODE_INTERNALS
jpayne@68 22959 {
jpayne@68 22960 Py_hash_t hash1, hash2;
jpayne@68 22961 #if CYTHON_PEP393_ENABLED
jpayne@68 22962 hash1 = ((PyASCIIObject*)s1)->hash;
jpayne@68 22963 hash2 = ((PyASCIIObject*)s2)->hash;
jpayne@68 22964 #else
jpayne@68 22965 hash1 = ((PyUnicodeObject*)s1)->hash;
jpayne@68 22966 hash2 = ((PyUnicodeObject*)s2)->hash;
jpayne@68 22967 #endif
jpayne@68 22968 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
jpayne@68 22969 goto return_ne;
jpayne@68 22970 }
jpayne@68 22971 }
jpayne@68 22972 #endif
jpayne@68 22973 kind = __Pyx_PyUnicode_KIND(s1);
jpayne@68 22974 if (kind != __Pyx_PyUnicode_KIND(s2)) {
jpayne@68 22975 goto return_ne;
jpayne@68 22976 }
jpayne@68 22977 data1 = __Pyx_PyUnicode_DATA(s1);
jpayne@68 22978 data2 = __Pyx_PyUnicode_DATA(s2);
jpayne@68 22979 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
jpayne@68 22980 goto return_ne;
jpayne@68 22981 } else if (length == 1) {
jpayne@68 22982 goto return_eq;
jpayne@68 22983 } else {
jpayne@68 22984 int result = memcmp(data1, data2, (size_t)(length * kind));
jpayne@68 22985 #if PY_MAJOR_VERSION < 3
jpayne@68 22986 Py_XDECREF(owned_ref);
jpayne@68 22987 #endif
jpayne@68 22988 return (equals == Py_EQ) ? (result == 0) : (result != 0);
jpayne@68 22989 }
jpayne@68 22990 } else if ((s1 == Py_None) & s2_is_unicode) {
jpayne@68 22991 goto return_ne;
jpayne@68 22992 } else if ((s2 == Py_None) & s1_is_unicode) {
jpayne@68 22993 goto return_ne;
jpayne@68 22994 } else {
jpayne@68 22995 int result;
jpayne@68 22996 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
jpayne@68 22997 #if PY_MAJOR_VERSION < 3
jpayne@68 22998 Py_XDECREF(owned_ref);
jpayne@68 22999 #endif
jpayne@68 23000 if (!py_result)
jpayne@68 23001 return -1;
jpayne@68 23002 result = __Pyx_PyObject_IsTrue(py_result);
jpayne@68 23003 Py_DECREF(py_result);
jpayne@68 23004 return result;
jpayne@68 23005 }
jpayne@68 23006 return_eq:
jpayne@68 23007 #if PY_MAJOR_VERSION < 3
jpayne@68 23008 Py_XDECREF(owned_ref);
jpayne@68 23009 #endif
jpayne@68 23010 return (equals == Py_EQ);
jpayne@68 23011 return_ne:
jpayne@68 23012 #if PY_MAJOR_VERSION < 3
jpayne@68 23013 Py_XDECREF(owned_ref);
jpayne@68 23014 #endif
jpayne@68 23015 return (equals == Py_NE);
jpayne@68 23016 #endif
jpayne@68 23017 }
jpayne@68 23018
jpayne@68 23019 /* fastcall */
jpayne@68 23020 #if CYTHON_METH_FASTCALL
jpayne@68 23021 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
jpayne@68 23022 {
jpayne@68 23023 Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
jpayne@68 23024 for (i = 0; i < n; i++)
jpayne@68 23025 {
jpayne@68 23026 if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
jpayne@68 23027 }
jpayne@68 23028 for (i = 0; i < n; i++)
jpayne@68 23029 {
jpayne@68 23030 int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
jpayne@68 23031 if (unlikely(eq != 0)) {
jpayne@68 23032 if (unlikely(eq < 0)) return NULL;
jpayne@68 23033 return kwvalues[i];
jpayne@68 23034 }
jpayne@68 23035 }
jpayne@68 23036 return NULL;
jpayne@68 23037 }
jpayne@68 23038 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
jpayne@68 23039 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
jpayne@68 23040 Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
jpayne@68 23041 PyObject *dict;
jpayne@68 23042 dict = PyDict_New();
jpayne@68 23043 if (unlikely(!dict))
jpayne@68 23044 return NULL;
jpayne@68 23045 for (i=0; i<nkwargs; i++) {
jpayne@68 23046 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
jpayne@68 23047 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
jpayne@68 23048 goto bad;
jpayne@68 23049 }
jpayne@68 23050 return dict;
jpayne@68 23051 bad:
jpayne@68 23052 Py_DECREF(dict);
jpayne@68 23053 return NULL;
jpayne@68 23054 }
jpayne@68 23055 #endif
jpayne@68 23056 #endif
jpayne@68 23057
jpayne@68 23058 /* Profile */
jpayne@68 23059 #if CYTHON_PROFILE
jpayne@68 23060 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
jpayne@68 23061 PyFrameObject** frame,
jpayne@68 23062 PyThreadState* tstate,
jpayne@68 23063 const char *funcname,
jpayne@68 23064 const char *srcfile,
jpayne@68 23065 int firstlineno) {
jpayne@68 23066 PyObject *type, *value, *traceback;
jpayne@68 23067 int retval;
jpayne@68 23068 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
jpayne@68 23069 if (*code == NULL) {
jpayne@68 23070 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
jpayne@68 23071 if (*code == NULL) return 0;
jpayne@68 23072 }
jpayne@68 23073 *frame = PyFrame_New(
jpayne@68 23074 tstate, /*PyThreadState *tstate*/
jpayne@68 23075 *code, /*PyCodeObject *code*/
jpayne@68 23076 __pyx_d, /*PyObject *globals*/
jpayne@68 23077 0 /*PyObject *locals*/
jpayne@68 23078 );
jpayne@68 23079 if (*frame == NULL) return 0;
jpayne@68 23080 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
jpayne@68 23081 Py_INCREF(Py_None);
jpayne@68 23082 (*frame)->f_trace = Py_None;
jpayne@68 23083 }
jpayne@68 23084 #if PY_VERSION_HEX < 0x030400B1
jpayne@68 23085 } else {
jpayne@68 23086 (*frame)->f_tstate = tstate;
jpayne@68 23087 #endif
jpayne@68 23088 }
jpayne@68 23089 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
jpayne@68 23090 retval = 1;
jpayne@68 23091 __Pyx_EnterTracing(tstate);
jpayne@68 23092 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
jpayne@68 23093 #if CYTHON_TRACE
jpayne@68 23094 if (tstate->c_tracefunc)
jpayne@68 23095 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
jpayne@68 23096 if (retval && tstate->c_profilefunc)
jpayne@68 23097 #endif
jpayne@68 23098 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
jpayne@68 23099 __Pyx_LeaveTracing(tstate);
jpayne@68 23100 if (retval) {
jpayne@68 23101 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
jpayne@68 23102 return __Pyx_IsTracing(tstate, 0, 0) && retval;
jpayne@68 23103 } else {
jpayne@68 23104 Py_XDECREF(type);
jpayne@68 23105 Py_XDECREF(value);
jpayne@68 23106 Py_XDECREF(traceback);
jpayne@68 23107 return -1;
jpayne@68 23108 }
jpayne@68 23109 }
jpayne@68 23110 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
jpayne@68 23111 PyCodeObject *py_code = 0;
jpayne@68 23112 #if PY_MAJOR_VERSION >= 3
jpayne@68 23113 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
jpayne@68 23114 if (likely(py_code)) {
jpayne@68 23115 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
jpayne@68 23116 }
jpayne@68 23117 #else
jpayne@68 23118 PyObject *py_srcfile = 0;
jpayne@68 23119 PyObject *py_funcname = 0;
jpayne@68 23120 py_funcname = PyString_FromString(funcname);
jpayne@68 23121 if (unlikely(!py_funcname)) goto bad;
jpayne@68 23122 py_srcfile = PyString_FromString(srcfile);
jpayne@68 23123 if (unlikely(!py_srcfile)) goto bad;
jpayne@68 23124 py_code = PyCode_New(
jpayne@68 23125 0,
jpayne@68 23126 0,
jpayne@68 23127 0,
jpayne@68 23128 CO_OPTIMIZED | CO_NEWLOCALS,
jpayne@68 23129 __pyx_empty_bytes, /*PyObject *code,*/
jpayne@68 23130 __pyx_empty_tuple, /*PyObject *consts,*/
jpayne@68 23131 __pyx_empty_tuple, /*PyObject *names,*/
jpayne@68 23132 __pyx_empty_tuple, /*PyObject *varnames,*/
jpayne@68 23133 __pyx_empty_tuple, /*PyObject *freevars,*/
jpayne@68 23134 __pyx_empty_tuple, /*PyObject *cellvars,*/
jpayne@68 23135 py_srcfile, /*PyObject *filename,*/
jpayne@68 23136 py_funcname, /*PyObject *name,*/
jpayne@68 23137 firstlineno,
jpayne@68 23138 __pyx_empty_bytes /*PyObject *lnotab*/
jpayne@68 23139 );
jpayne@68 23140 bad:
jpayne@68 23141 Py_XDECREF(py_srcfile);
jpayne@68 23142 Py_XDECREF(py_funcname);
jpayne@68 23143 #endif
jpayne@68 23144 return py_code;
jpayne@68 23145 }
jpayne@68 23146 #endif
jpayne@68 23147
jpayne@68 23148 /* RaiseDoubleKeywords */
jpayne@68 23149 static void __Pyx_RaiseDoubleKeywordsError(
jpayne@68 23150 const char* func_name,
jpayne@68 23151 PyObject* kw_name)
jpayne@68 23152 {
jpayne@68 23153 PyErr_Format(PyExc_TypeError,
jpayne@68 23154 #if PY_MAJOR_VERSION >= 3
jpayne@68 23155 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
jpayne@68 23156 #else
jpayne@68 23157 "%s() got multiple values for keyword argument '%s'", func_name,
jpayne@68 23158 PyString_AsString(kw_name));
jpayne@68 23159 #endif
jpayne@68 23160 }
jpayne@68 23161
jpayne@68 23162 /* ParseKeywords */
jpayne@68 23163 static int __Pyx_ParseOptionalKeywords(
jpayne@68 23164 PyObject *kwds,
jpayne@68 23165 PyObject *const *kwvalues,
jpayne@68 23166 PyObject **argnames[],
jpayne@68 23167 PyObject *kwds2,
jpayne@68 23168 PyObject *values[],
jpayne@68 23169 Py_ssize_t num_pos_args,
jpayne@68 23170 const char* function_name)
jpayne@68 23171 {
jpayne@68 23172 PyObject *key = 0, *value = 0;
jpayne@68 23173 Py_ssize_t pos = 0;
jpayne@68 23174 PyObject*** name;
jpayne@68 23175 PyObject*** first_kw_arg = argnames + num_pos_args;
jpayne@68 23176 int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
jpayne@68 23177 while (1) {
jpayne@68 23178 Py_XDECREF(key); key = NULL;
jpayne@68 23179 Py_XDECREF(value); value = NULL;
jpayne@68 23180 if (kwds_is_tuple) {
jpayne@68 23181 Py_ssize_t size;
jpayne@68 23182 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 23183 size = PyTuple_GET_SIZE(kwds);
jpayne@68 23184 #else
jpayne@68 23185 size = PyTuple_Size(kwds);
jpayne@68 23186 if (size < 0) goto bad;
jpayne@68 23187 #endif
jpayne@68 23188 if (pos >= size) break;
jpayne@68 23189 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 23190 key = __Pyx_PySequence_ITEM(kwds, pos);
jpayne@68 23191 if (!key) goto bad;
jpayne@68 23192 #elif CYTHON_ASSUME_SAFE_MACROS
jpayne@68 23193 key = PyTuple_GET_ITEM(kwds, pos);
jpayne@68 23194 #else
jpayne@68 23195 key = PyTuple_GetItem(kwds, pos);
jpayne@68 23196 if (!key) goto bad;
jpayne@68 23197 #endif
jpayne@68 23198 value = kwvalues[pos];
jpayne@68 23199 pos++;
jpayne@68 23200 }
jpayne@68 23201 else
jpayne@68 23202 {
jpayne@68 23203 if (!PyDict_Next(kwds, &pos, &key, &value)) break;
jpayne@68 23204 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 23205 Py_INCREF(key);
jpayne@68 23206 #endif
jpayne@68 23207 }
jpayne@68 23208 name = first_kw_arg;
jpayne@68 23209 while (*name && (**name != key)) name++;
jpayne@68 23210 if (*name) {
jpayne@68 23211 values[name-argnames] = value;
jpayne@68 23212 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 23213 Py_INCREF(value);
jpayne@68 23214 Py_DECREF(key);
jpayne@68 23215 #endif
jpayne@68 23216 key = NULL;
jpayne@68 23217 value = NULL;
jpayne@68 23218 continue;
jpayne@68 23219 }
jpayne@68 23220 #if !CYTHON_AVOID_BORROWED_REFS
jpayne@68 23221 Py_INCREF(key);
jpayne@68 23222 #endif
jpayne@68 23223 Py_INCREF(value);
jpayne@68 23224 name = first_kw_arg;
jpayne@68 23225 #if PY_MAJOR_VERSION < 3
jpayne@68 23226 if (likely(PyString_Check(key))) {
jpayne@68 23227 while (*name) {
jpayne@68 23228 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
jpayne@68 23229 && _PyString_Eq(**name, key)) {
jpayne@68 23230 values[name-argnames] = value;
jpayne@68 23231 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 23232 value = NULL;
jpayne@68 23233 #endif
jpayne@68 23234 break;
jpayne@68 23235 }
jpayne@68 23236 name++;
jpayne@68 23237 }
jpayne@68 23238 if (*name) continue;
jpayne@68 23239 else {
jpayne@68 23240 PyObject*** argname = argnames;
jpayne@68 23241 while (argname != first_kw_arg) {
jpayne@68 23242 if ((**argname == key) || (
jpayne@68 23243 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
jpayne@68 23244 && _PyString_Eq(**argname, key))) {
jpayne@68 23245 goto arg_passed_twice;
jpayne@68 23246 }
jpayne@68 23247 argname++;
jpayne@68 23248 }
jpayne@68 23249 }
jpayne@68 23250 } else
jpayne@68 23251 #endif
jpayne@68 23252 if (likely(PyUnicode_Check(key))) {
jpayne@68 23253 while (*name) {
jpayne@68 23254 int cmp = (
jpayne@68 23255 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
jpayne@68 23256 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
jpayne@68 23257 #endif
jpayne@68 23258 PyUnicode_Compare(**name, key)
jpayne@68 23259 );
jpayne@68 23260 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
jpayne@68 23261 if (cmp == 0) {
jpayne@68 23262 values[name-argnames] = value;
jpayne@68 23263 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 23264 value = NULL;
jpayne@68 23265 #endif
jpayne@68 23266 break;
jpayne@68 23267 }
jpayne@68 23268 name++;
jpayne@68 23269 }
jpayne@68 23270 if (*name) continue;
jpayne@68 23271 else {
jpayne@68 23272 PyObject*** argname = argnames;
jpayne@68 23273 while (argname != first_kw_arg) {
jpayne@68 23274 int cmp = (**argname == key) ? 0 :
jpayne@68 23275 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
jpayne@68 23276 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
jpayne@68 23277 #endif
jpayne@68 23278 PyUnicode_Compare(**argname, key);
jpayne@68 23279 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
jpayne@68 23280 if (cmp == 0) goto arg_passed_twice;
jpayne@68 23281 argname++;
jpayne@68 23282 }
jpayne@68 23283 }
jpayne@68 23284 } else
jpayne@68 23285 goto invalid_keyword_type;
jpayne@68 23286 if (kwds2) {
jpayne@68 23287 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
jpayne@68 23288 } else {
jpayne@68 23289 goto invalid_keyword;
jpayne@68 23290 }
jpayne@68 23291 }
jpayne@68 23292 Py_XDECREF(key);
jpayne@68 23293 Py_XDECREF(value);
jpayne@68 23294 return 0;
jpayne@68 23295 arg_passed_twice:
jpayne@68 23296 __Pyx_RaiseDoubleKeywordsError(function_name, key);
jpayne@68 23297 goto bad;
jpayne@68 23298 invalid_keyword_type:
jpayne@68 23299 PyErr_Format(PyExc_TypeError,
jpayne@68 23300 "%.200s() keywords must be strings", function_name);
jpayne@68 23301 goto bad;
jpayne@68 23302 invalid_keyword:
jpayne@68 23303 #if PY_MAJOR_VERSION < 3
jpayne@68 23304 PyErr_Format(PyExc_TypeError,
jpayne@68 23305 "%.200s() got an unexpected keyword argument '%.200s'",
jpayne@68 23306 function_name, PyString_AsString(key));
jpayne@68 23307 #else
jpayne@68 23308 PyErr_Format(PyExc_TypeError,
jpayne@68 23309 "%s() got an unexpected keyword argument '%U'",
jpayne@68 23310 function_name, key);
jpayne@68 23311 #endif
jpayne@68 23312 bad:
jpayne@68 23313 Py_XDECREF(key);
jpayne@68 23314 Py_XDECREF(value);
jpayne@68 23315 return -1;
jpayne@68 23316 }
jpayne@68 23317
jpayne@68 23318 /* RaiseArgTupleInvalid */
jpayne@68 23319 static void __Pyx_RaiseArgtupleInvalid(
jpayne@68 23320 const char* func_name,
jpayne@68 23321 int exact,
jpayne@68 23322 Py_ssize_t num_min,
jpayne@68 23323 Py_ssize_t num_max,
jpayne@68 23324 Py_ssize_t num_found)
jpayne@68 23325 {
jpayne@68 23326 Py_ssize_t num_expected;
jpayne@68 23327 const char *more_or_less;
jpayne@68 23328 if (num_found < num_min) {
jpayne@68 23329 num_expected = num_min;
jpayne@68 23330 more_or_less = "at least";
jpayne@68 23331 } else {
jpayne@68 23332 num_expected = num_max;
jpayne@68 23333 more_or_less = "at most";
jpayne@68 23334 }
jpayne@68 23335 if (exact) {
jpayne@68 23336 more_or_less = "exactly";
jpayne@68 23337 }
jpayne@68 23338 PyErr_Format(PyExc_TypeError,
jpayne@68 23339 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
jpayne@68 23340 func_name, more_or_less, num_expected,
jpayne@68 23341 (num_expected == 1) ? "" : "s", num_found);
jpayne@68 23342 }
jpayne@68 23343
jpayne@68 23344 /* PyFunctionFastCall */
jpayne@68 23345 #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
jpayne@68 23346 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
jpayne@68 23347 PyObject *globals) {
jpayne@68 23348 PyFrameObject *f;
jpayne@68 23349 PyThreadState *tstate = __Pyx_PyThreadState_Current;
jpayne@68 23350 PyObject **fastlocals;
jpayne@68 23351 Py_ssize_t i;
jpayne@68 23352 PyObject *result;
jpayne@68 23353 assert(globals != NULL);
jpayne@68 23354 /* XXX Perhaps we should create a specialized
jpayne@68 23355 PyFrame_New() that doesn't take locals, but does
jpayne@68 23356 take builtins without sanity checking them.
jpayne@68 23357 */
jpayne@68 23358 assert(tstate != NULL);
jpayne@68 23359 f = PyFrame_New(tstate, co, globals, NULL);
jpayne@68 23360 if (f == NULL) {
jpayne@68 23361 return NULL;
jpayne@68 23362 }
jpayne@68 23363 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
jpayne@68 23364 for (i = 0; i < na; i++) {
jpayne@68 23365 Py_INCREF(*args);
jpayne@68 23366 fastlocals[i] = *args++;
jpayne@68 23367 }
jpayne@68 23368 result = PyEval_EvalFrameEx(f,0);
jpayne@68 23369 ++tstate->recursion_depth;
jpayne@68 23370 Py_DECREF(f);
jpayne@68 23371 --tstate->recursion_depth;
jpayne@68 23372 return result;
jpayne@68 23373 }
jpayne@68 23374 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
jpayne@68 23375 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
jpayne@68 23376 PyObject *globals = PyFunction_GET_GLOBALS(func);
jpayne@68 23377 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
jpayne@68 23378 PyObject *closure;
jpayne@68 23379 #if PY_MAJOR_VERSION >= 3
jpayne@68 23380 PyObject *kwdefs;
jpayne@68 23381 #endif
jpayne@68 23382 PyObject *kwtuple, **k;
jpayne@68 23383 PyObject **d;
jpayne@68 23384 Py_ssize_t nd;
jpayne@68 23385 Py_ssize_t nk;
jpayne@68 23386 PyObject *result;
jpayne@68 23387 assert(kwargs == NULL || PyDict_Check(kwargs));
jpayne@68 23388 nk = kwargs ? PyDict_Size(kwargs) : 0;
jpayne@68 23389 #if PY_MAJOR_VERSION < 3
jpayne@68 23390 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
jpayne@68 23391 return NULL;
jpayne@68 23392 }
jpayne@68 23393 #else
jpayne@68 23394 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
jpayne@68 23395 return NULL;
jpayne@68 23396 }
jpayne@68 23397 #endif
jpayne@68 23398 if (
jpayne@68 23399 #if PY_MAJOR_VERSION >= 3
jpayne@68 23400 co->co_kwonlyargcount == 0 &&
jpayne@68 23401 #endif
jpayne@68 23402 likely(kwargs == NULL || nk == 0) &&
jpayne@68 23403 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
jpayne@68 23404 if (argdefs == NULL && co->co_argcount == nargs) {
jpayne@68 23405 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
jpayne@68 23406 goto done;
jpayne@68 23407 }
jpayne@68 23408 else if (nargs == 0 && argdefs != NULL
jpayne@68 23409 && co->co_argcount == Py_SIZE(argdefs)) {
jpayne@68 23410 /* function called with no arguments, but all parameters have
jpayne@68 23411 a default value: use default values as arguments .*/
jpayne@68 23412 args = &PyTuple_GET_ITEM(argdefs, 0);
jpayne@68 23413 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
jpayne@68 23414 goto done;
jpayne@68 23415 }
jpayne@68 23416 }
jpayne@68 23417 if (kwargs != NULL) {
jpayne@68 23418 Py_ssize_t pos, i;
jpayne@68 23419 kwtuple = PyTuple_New(2 * nk);
jpayne@68 23420 if (kwtuple == NULL) {
jpayne@68 23421 result = NULL;
jpayne@68 23422 goto done;
jpayne@68 23423 }
jpayne@68 23424 k = &PyTuple_GET_ITEM(kwtuple, 0);
jpayne@68 23425 pos = i = 0;
jpayne@68 23426 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
jpayne@68 23427 Py_INCREF(k[i]);
jpayne@68 23428 Py_INCREF(k[i+1]);
jpayne@68 23429 i += 2;
jpayne@68 23430 }
jpayne@68 23431 nk = i / 2;
jpayne@68 23432 }
jpayne@68 23433 else {
jpayne@68 23434 kwtuple = NULL;
jpayne@68 23435 k = NULL;
jpayne@68 23436 }
jpayne@68 23437 closure = PyFunction_GET_CLOSURE(func);
jpayne@68 23438 #if PY_MAJOR_VERSION >= 3
jpayne@68 23439 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
jpayne@68 23440 #endif
jpayne@68 23441 if (argdefs != NULL) {
jpayne@68 23442 d = &PyTuple_GET_ITEM(argdefs, 0);
jpayne@68 23443 nd = Py_SIZE(argdefs);
jpayne@68 23444 }
jpayne@68 23445 else {
jpayne@68 23446 d = NULL;
jpayne@68 23447 nd = 0;
jpayne@68 23448 }
jpayne@68 23449 #if PY_MAJOR_VERSION >= 3
jpayne@68 23450 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
jpayne@68 23451 args, (int)nargs,
jpayne@68 23452 k, (int)nk,
jpayne@68 23453 d, (int)nd, kwdefs, closure);
jpayne@68 23454 #else
jpayne@68 23455 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
jpayne@68 23456 args, (int)nargs,
jpayne@68 23457 k, (int)nk,
jpayne@68 23458 d, (int)nd, closure);
jpayne@68 23459 #endif
jpayne@68 23460 Py_XDECREF(kwtuple);
jpayne@68 23461 done:
jpayne@68 23462 Py_LeaveRecursiveCall();
jpayne@68 23463 return result;
jpayne@68 23464 }
jpayne@68 23465 #endif
jpayne@68 23466
jpayne@68 23467 /* PyObjectCall */
jpayne@68 23468 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 23469 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
jpayne@68 23470 PyObject *result;
jpayne@68 23471 ternaryfunc call = Py_TYPE(func)->tp_call;
jpayne@68 23472 if (unlikely(!call))
jpayne@68 23473 return PyObject_Call(func, arg, kw);
jpayne@68 23474 #if PY_MAJOR_VERSION < 3
jpayne@68 23475 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
jpayne@68 23476 return NULL;
jpayne@68 23477 #else
jpayne@68 23478 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
jpayne@68 23479 return NULL;
jpayne@68 23480 #endif
jpayne@68 23481 result = (*call)(func, arg, kw);
jpayne@68 23482 Py_LeaveRecursiveCall();
jpayne@68 23483 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
jpayne@68 23484 PyErr_SetString(
jpayne@68 23485 PyExc_SystemError,
jpayne@68 23486 "NULL result without error in PyObject_Call");
jpayne@68 23487 }
jpayne@68 23488 return result;
jpayne@68 23489 }
jpayne@68 23490 #endif
jpayne@68 23491
jpayne@68 23492 /* PyObjectCallMethO */
jpayne@68 23493 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 23494 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
jpayne@68 23495 PyObject *self, *result;
jpayne@68 23496 PyCFunction cfunc;
jpayne@68 23497 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
jpayne@68 23498 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
jpayne@68 23499 #if PY_MAJOR_VERSION < 3
jpayne@68 23500 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
jpayne@68 23501 return NULL;
jpayne@68 23502 #else
jpayne@68 23503 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
jpayne@68 23504 return NULL;
jpayne@68 23505 #endif
jpayne@68 23506 result = cfunc(self, arg);
jpayne@68 23507 Py_LeaveRecursiveCall();
jpayne@68 23508 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
jpayne@68 23509 PyErr_SetString(
jpayne@68 23510 PyExc_SystemError,
jpayne@68 23511 "NULL result without error in PyObject_Call");
jpayne@68 23512 }
jpayne@68 23513 return result;
jpayne@68 23514 }
jpayne@68 23515 #endif
jpayne@68 23516
jpayne@68 23517 /* PyObjectFastCall */
jpayne@68 23518 #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 23519 static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
jpayne@68 23520 PyObject *argstuple;
jpayne@68 23521 PyObject *result = 0;
jpayne@68 23522 size_t i;
jpayne@68 23523 argstuple = PyTuple_New((Py_ssize_t)nargs);
jpayne@68 23524 if (unlikely(!argstuple)) return NULL;
jpayne@68 23525 for (i = 0; i < nargs; i++) {
jpayne@68 23526 Py_INCREF(args[i]);
jpayne@68 23527 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
jpayne@68 23528 }
jpayne@68 23529 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
jpayne@68 23530 bad:
jpayne@68 23531 Py_DECREF(argstuple);
jpayne@68 23532 return result;
jpayne@68 23533 }
jpayne@68 23534 #endif
jpayne@68 23535 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
jpayne@68 23536 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
jpayne@68 23537 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 23538 if (nargs == 0 && kwargs == NULL) {
jpayne@68 23539 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
jpayne@68 23540 return __Pyx_PyObject_CallMethO(func, NULL);
jpayne@68 23541 }
jpayne@68 23542 else if (nargs == 1 && kwargs == NULL) {
jpayne@68 23543 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
jpayne@68 23544 return __Pyx_PyObject_CallMethO(func, args[0]);
jpayne@68 23545 }
jpayne@68 23546 #endif
jpayne@68 23547 #if PY_VERSION_HEX < 0x030800B1
jpayne@68 23548 #if CYTHON_FAST_PYCCALL
jpayne@68 23549 if (PyCFunction_Check(func)) {
jpayne@68 23550 if (kwargs) {
jpayne@68 23551 return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
jpayne@68 23552 } else {
jpayne@68 23553 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
jpayne@68 23554 }
jpayne@68 23555 }
jpayne@68 23556 #if PY_VERSION_HEX >= 0x030700A1
jpayne@68 23557 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
jpayne@68 23558 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
jpayne@68 23559 }
jpayne@68 23560 #endif
jpayne@68 23561 #endif
jpayne@68 23562 #if CYTHON_FAST_PYCALL
jpayne@68 23563 if (PyFunction_Check(func)) {
jpayne@68 23564 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
jpayne@68 23565 }
jpayne@68 23566 #endif
jpayne@68 23567 #endif
jpayne@68 23568 if (kwargs == NULL) {
jpayne@68 23569 #if CYTHON_VECTORCALL
jpayne@68 23570 #if PY_VERSION_HEX < 0x03090000
jpayne@68 23571 vectorcallfunc f = _PyVectorcall_Function(func);
jpayne@68 23572 #else
jpayne@68 23573 vectorcallfunc f = PyVectorcall_Function(func);
jpayne@68 23574 #endif
jpayne@68 23575 if (f) {
jpayne@68 23576 return f(func, args, (size_t)nargs, NULL);
jpayne@68 23577 }
jpayne@68 23578 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
jpayne@68 23579 if (__Pyx_CyFunction_CheckExact(func)) {
jpayne@68 23580 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
jpayne@68 23581 if (f) return f(func, args, (size_t)nargs, NULL);
jpayne@68 23582 }
jpayne@68 23583 #endif
jpayne@68 23584 }
jpayne@68 23585 if (nargs == 0) {
jpayne@68 23586 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
jpayne@68 23587 }
jpayne@68 23588 #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 23589 return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
jpayne@68 23590 #else
jpayne@68 23591 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
jpayne@68 23592 #endif
jpayne@68 23593 }
jpayne@68 23594
jpayne@68 23595 /* WriteUnraisableException */
jpayne@68 23596 static void __Pyx_WriteUnraisable(const char *name, int clineno,
jpayne@68 23597 int lineno, const char *filename,
jpayne@68 23598 int full_traceback, int nogil) {
jpayne@68 23599 PyObject *old_exc, *old_val, *old_tb;
jpayne@68 23600 PyObject *ctx;
jpayne@68 23601 __Pyx_PyThreadState_declare
jpayne@68 23602 #ifdef WITH_THREAD
jpayne@68 23603 PyGILState_STATE state;
jpayne@68 23604 if (nogil)
jpayne@68 23605 state = PyGILState_Ensure();
jpayne@68 23606 else state = (PyGILState_STATE)0;
jpayne@68 23607 #endif
jpayne@68 23608 CYTHON_UNUSED_VAR(clineno);
jpayne@68 23609 CYTHON_UNUSED_VAR(lineno);
jpayne@68 23610 CYTHON_UNUSED_VAR(filename);
jpayne@68 23611 CYTHON_MAYBE_UNUSED_VAR(nogil);
jpayne@68 23612 __Pyx_PyThreadState_assign
jpayne@68 23613 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
jpayne@68 23614 if (full_traceback) {
jpayne@68 23615 Py_XINCREF(old_exc);
jpayne@68 23616 Py_XINCREF(old_val);
jpayne@68 23617 Py_XINCREF(old_tb);
jpayne@68 23618 __Pyx_ErrRestore(old_exc, old_val, old_tb);
jpayne@68 23619 PyErr_PrintEx(0);
jpayne@68 23620 }
jpayne@68 23621 #if PY_MAJOR_VERSION < 3
jpayne@68 23622 ctx = PyString_FromString(name);
jpayne@68 23623 #else
jpayne@68 23624 ctx = PyUnicode_FromString(name);
jpayne@68 23625 #endif
jpayne@68 23626 __Pyx_ErrRestore(old_exc, old_val, old_tb);
jpayne@68 23627 if (!ctx) {
jpayne@68 23628 PyErr_WriteUnraisable(Py_None);
jpayne@68 23629 } else {
jpayne@68 23630 PyErr_WriteUnraisable(ctx);
jpayne@68 23631 Py_DECREF(ctx);
jpayne@68 23632 }
jpayne@68 23633 #ifdef WITH_THREAD
jpayne@68 23634 if (nogil)
jpayne@68 23635 PyGILState_Release(state);
jpayne@68 23636 #endif
jpayne@68 23637 }
jpayne@68 23638
jpayne@68 23639 /* RaiseException */
jpayne@68 23640 #if PY_MAJOR_VERSION < 3
jpayne@68 23641 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
jpayne@68 23642 __Pyx_PyThreadState_declare
jpayne@68 23643 CYTHON_UNUSED_VAR(cause);
jpayne@68 23644 Py_XINCREF(type);
jpayne@68 23645 if (!value || value == Py_None)
jpayne@68 23646 value = NULL;
jpayne@68 23647 else
jpayne@68 23648 Py_INCREF(value);
jpayne@68 23649 if (!tb || tb == Py_None)
jpayne@68 23650 tb = NULL;
jpayne@68 23651 else {
jpayne@68 23652 Py_INCREF(tb);
jpayne@68 23653 if (!PyTraceBack_Check(tb)) {
jpayne@68 23654 PyErr_SetString(PyExc_TypeError,
jpayne@68 23655 "raise: arg 3 must be a traceback or None");
jpayne@68 23656 goto raise_error;
jpayne@68 23657 }
jpayne@68 23658 }
jpayne@68 23659 if (PyType_Check(type)) {
jpayne@68 23660 #if CYTHON_COMPILING_IN_PYPY
jpayne@68 23661 if (!value) {
jpayne@68 23662 Py_INCREF(Py_None);
jpayne@68 23663 value = Py_None;
jpayne@68 23664 }
jpayne@68 23665 #endif
jpayne@68 23666 PyErr_NormalizeException(&type, &value, &tb);
jpayne@68 23667 } else {
jpayne@68 23668 if (value) {
jpayne@68 23669 PyErr_SetString(PyExc_TypeError,
jpayne@68 23670 "instance exception may not have a separate value");
jpayne@68 23671 goto raise_error;
jpayne@68 23672 }
jpayne@68 23673 value = type;
jpayne@68 23674 type = (PyObject*) Py_TYPE(type);
jpayne@68 23675 Py_INCREF(type);
jpayne@68 23676 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
jpayne@68 23677 PyErr_SetString(PyExc_TypeError,
jpayne@68 23678 "raise: exception class must be a subclass of BaseException");
jpayne@68 23679 goto raise_error;
jpayne@68 23680 }
jpayne@68 23681 }
jpayne@68 23682 __Pyx_PyThreadState_assign
jpayne@68 23683 __Pyx_ErrRestore(type, value, tb);
jpayne@68 23684 return;
jpayne@68 23685 raise_error:
jpayne@68 23686 Py_XDECREF(value);
jpayne@68 23687 Py_XDECREF(type);
jpayne@68 23688 Py_XDECREF(tb);
jpayne@68 23689 return;
jpayne@68 23690 }
jpayne@68 23691 #else
jpayne@68 23692 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
jpayne@68 23693 PyObject* owned_instance = NULL;
jpayne@68 23694 if (tb == Py_None) {
jpayne@68 23695 tb = 0;
jpayne@68 23696 } else if (tb && !PyTraceBack_Check(tb)) {
jpayne@68 23697 PyErr_SetString(PyExc_TypeError,
jpayne@68 23698 "raise: arg 3 must be a traceback or None");
jpayne@68 23699 goto bad;
jpayne@68 23700 }
jpayne@68 23701 if (value == Py_None)
jpayne@68 23702 value = 0;
jpayne@68 23703 if (PyExceptionInstance_Check(type)) {
jpayne@68 23704 if (value) {
jpayne@68 23705 PyErr_SetString(PyExc_TypeError,
jpayne@68 23706 "instance exception may not have a separate value");
jpayne@68 23707 goto bad;
jpayne@68 23708 }
jpayne@68 23709 value = type;
jpayne@68 23710 type = (PyObject*) Py_TYPE(value);
jpayne@68 23711 } else if (PyExceptionClass_Check(type)) {
jpayne@68 23712 PyObject *instance_class = NULL;
jpayne@68 23713 if (value && PyExceptionInstance_Check(value)) {
jpayne@68 23714 instance_class = (PyObject*) Py_TYPE(value);
jpayne@68 23715 if (instance_class != type) {
jpayne@68 23716 int is_subclass = PyObject_IsSubclass(instance_class, type);
jpayne@68 23717 if (!is_subclass) {
jpayne@68 23718 instance_class = NULL;
jpayne@68 23719 } else if (unlikely(is_subclass == -1)) {
jpayne@68 23720 goto bad;
jpayne@68 23721 } else {
jpayne@68 23722 type = instance_class;
jpayne@68 23723 }
jpayne@68 23724 }
jpayne@68 23725 }
jpayne@68 23726 if (!instance_class) {
jpayne@68 23727 PyObject *args;
jpayne@68 23728 if (!value)
jpayne@68 23729 args = PyTuple_New(0);
jpayne@68 23730 else if (PyTuple_Check(value)) {
jpayne@68 23731 Py_INCREF(value);
jpayne@68 23732 args = value;
jpayne@68 23733 } else
jpayne@68 23734 args = PyTuple_Pack(1, value);
jpayne@68 23735 if (!args)
jpayne@68 23736 goto bad;
jpayne@68 23737 owned_instance = PyObject_Call(type, args, NULL);
jpayne@68 23738 Py_DECREF(args);
jpayne@68 23739 if (!owned_instance)
jpayne@68 23740 goto bad;
jpayne@68 23741 value = owned_instance;
jpayne@68 23742 if (!PyExceptionInstance_Check(value)) {
jpayne@68 23743 PyErr_Format(PyExc_TypeError,
jpayne@68 23744 "calling %R should have returned an instance of "
jpayne@68 23745 "BaseException, not %R",
jpayne@68 23746 type, Py_TYPE(value));
jpayne@68 23747 goto bad;
jpayne@68 23748 }
jpayne@68 23749 }
jpayne@68 23750 } else {
jpayne@68 23751 PyErr_SetString(PyExc_TypeError,
jpayne@68 23752 "raise: exception class must be a subclass of BaseException");
jpayne@68 23753 goto bad;
jpayne@68 23754 }
jpayne@68 23755 if (cause) {
jpayne@68 23756 PyObject *fixed_cause;
jpayne@68 23757 if (cause == Py_None) {
jpayne@68 23758 fixed_cause = NULL;
jpayne@68 23759 } else if (PyExceptionClass_Check(cause)) {
jpayne@68 23760 fixed_cause = PyObject_CallObject(cause, NULL);
jpayne@68 23761 if (fixed_cause == NULL)
jpayne@68 23762 goto bad;
jpayne@68 23763 } else if (PyExceptionInstance_Check(cause)) {
jpayne@68 23764 fixed_cause = cause;
jpayne@68 23765 Py_INCREF(fixed_cause);
jpayne@68 23766 } else {
jpayne@68 23767 PyErr_SetString(PyExc_TypeError,
jpayne@68 23768 "exception causes must derive from "
jpayne@68 23769 "BaseException");
jpayne@68 23770 goto bad;
jpayne@68 23771 }
jpayne@68 23772 PyException_SetCause(value, fixed_cause);
jpayne@68 23773 }
jpayne@68 23774 PyErr_SetObject(type, value);
jpayne@68 23775 if (tb) {
jpayne@68 23776 #if PY_VERSION_HEX >= 0x030C00A6
jpayne@68 23777 PyException_SetTraceback(value, tb);
jpayne@68 23778 #elif CYTHON_FAST_THREAD_STATE
jpayne@68 23779 PyThreadState *tstate = __Pyx_PyThreadState_Current;
jpayne@68 23780 PyObject* tmp_tb = tstate->curexc_traceback;
jpayne@68 23781 if (tb != tmp_tb) {
jpayne@68 23782 Py_INCREF(tb);
jpayne@68 23783 tstate->curexc_traceback = tb;
jpayne@68 23784 Py_XDECREF(tmp_tb);
jpayne@68 23785 }
jpayne@68 23786 #else
jpayne@68 23787 PyObject *tmp_type, *tmp_value, *tmp_tb;
jpayne@68 23788 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
jpayne@68 23789 Py_INCREF(tb);
jpayne@68 23790 PyErr_Restore(tmp_type, tmp_value, tb);
jpayne@68 23791 Py_XDECREF(tmp_tb);
jpayne@68 23792 #endif
jpayne@68 23793 }
jpayne@68 23794 bad:
jpayne@68 23795 Py_XDECREF(owned_instance);
jpayne@68 23796 return;
jpayne@68 23797 }
jpayne@68 23798 #endif
jpayne@68 23799
jpayne@68 23800 /* KeywordStringCheck */
jpayne@68 23801 static int __Pyx_CheckKeywordStrings(
jpayne@68 23802 PyObject *kw,
jpayne@68 23803 const char* function_name,
jpayne@68 23804 int kw_allowed)
jpayne@68 23805 {
jpayne@68 23806 PyObject* key = 0;
jpayne@68 23807 Py_ssize_t pos = 0;
jpayne@68 23808 #if CYTHON_COMPILING_IN_PYPY
jpayne@68 23809 if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
jpayne@68 23810 goto invalid_keyword;
jpayne@68 23811 return 1;
jpayne@68 23812 #else
jpayne@68 23813 if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
jpayne@68 23814 Py_ssize_t kwsize;
jpayne@68 23815 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 23816 kwsize = PyTuple_GET_SIZE(kw);
jpayne@68 23817 #else
jpayne@68 23818 kwsize = PyTuple_Size(kw);
jpayne@68 23819 if (kwsize < 0) return 0;
jpayne@68 23820 #endif
jpayne@68 23821 if (unlikely(kwsize == 0))
jpayne@68 23822 return 1;
jpayne@68 23823 if (!kw_allowed) {
jpayne@68 23824 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 23825 key = PyTuple_GET_ITEM(kw, 0);
jpayne@68 23826 #else
jpayne@68 23827 key = PyTuple_GetItem(kw, pos);
jpayne@68 23828 if (!key) return 0;
jpayne@68 23829 #endif
jpayne@68 23830 goto invalid_keyword;
jpayne@68 23831 }
jpayne@68 23832 #if PY_VERSION_HEX < 0x03090000
jpayne@68 23833 for (pos = 0; pos < kwsize; pos++) {
jpayne@68 23834 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 23835 key = PyTuple_GET_ITEM(kw, pos);
jpayne@68 23836 #else
jpayne@68 23837 key = PyTuple_GetItem(kw, pos);
jpayne@68 23838 if (!key) return 0;
jpayne@68 23839 #endif
jpayne@68 23840 if (unlikely(!PyUnicode_Check(key)))
jpayne@68 23841 goto invalid_keyword_type;
jpayne@68 23842 }
jpayne@68 23843 #endif
jpayne@68 23844 return 1;
jpayne@68 23845 }
jpayne@68 23846 while (PyDict_Next(kw, &pos, &key, 0)) {
jpayne@68 23847 #if PY_MAJOR_VERSION < 3
jpayne@68 23848 if (unlikely(!PyString_Check(key)))
jpayne@68 23849 #endif
jpayne@68 23850 if (unlikely(!PyUnicode_Check(key)))
jpayne@68 23851 goto invalid_keyword_type;
jpayne@68 23852 }
jpayne@68 23853 if (!kw_allowed && unlikely(key))
jpayne@68 23854 goto invalid_keyword;
jpayne@68 23855 return 1;
jpayne@68 23856 invalid_keyword_type:
jpayne@68 23857 PyErr_Format(PyExc_TypeError,
jpayne@68 23858 "%.200s() keywords must be strings", function_name);
jpayne@68 23859 return 0;
jpayne@68 23860 #endif
jpayne@68 23861 invalid_keyword:
jpayne@68 23862 #if PY_MAJOR_VERSION < 3
jpayne@68 23863 PyErr_Format(PyExc_TypeError,
jpayne@68 23864 "%.200s() got an unexpected keyword argument '%.200s'",
jpayne@68 23865 function_name, PyString_AsString(key));
jpayne@68 23866 #else
jpayne@68 23867 PyErr_Format(PyExc_TypeError,
jpayne@68 23868 "%s() got an unexpected keyword argument '%U'",
jpayne@68 23869 function_name, key);
jpayne@68 23870 #endif
jpayne@68 23871 return 0;
jpayne@68 23872 }
jpayne@68 23873
jpayne@68 23874 /* PyObjectCall2Args */
jpayne@68 23875 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
jpayne@68 23876 PyObject *args[3] = {NULL, arg1, arg2};
jpayne@68 23877 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
jpayne@68 23878 }
jpayne@68 23879
jpayne@68 23880 /* PyObjectCallOneArg */
jpayne@68 23881 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
jpayne@68 23882 PyObject *args[2] = {NULL, arg};
jpayne@68 23883 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
jpayne@68 23884 }
jpayne@68 23885
jpayne@68 23886 /* PyObjectGetMethod */
jpayne@68 23887 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
jpayne@68 23888 PyObject *attr;
jpayne@68 23889 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 23890 __Pyx_TypeName type_name;
jpayne@68 23891 PyTypeObject *tp = Py_TYPE(obj);
jpayne@68 23892 PyObject *descr;
jpayne@68 23893 descrgetfunc f = NULL;
jpayne@68 23894 PyObject **dictptr, *dict;
jpayne@68 23895 int meth_found = 0;
jpayne@68 23896 assert (*method == NULL);
jpayne@68 23897 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
jpayne@68 23898 attr = __Pyx_PyObject_GetAttrStr(obj, name);
jpayne@68 23899 goto try_unpack;
jpayne@68 23900 }
jpayne@68 23901 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
jpayne@68 23902 return 0;
jpayne@68 23903 }
jpayne@68 23904 descr = _PyType_Lookup(tp, name);
jpayne@68 23905 if (likely(descr != NULL)) {
jpayne@68 23906 Py_INCREF(descr);
jpayne@68 23907 #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
jpayne@68 23908 if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
jpayne@68 23909 #elif PY_MAJOR_VERSION >= 3
jpayne@68 23910 #ifdef __Pyx_CyFunction_USED
jpayne@68 23911 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
jpayne@68 23912 #else
jpayne@68 23913 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
jpayne@68 23914 #endif
jpayne@68 23915 #else
jpayne@68 23916 #ifdef __Pyx_CyFunction_USED
jpayne@68 23917 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
jpayne@68 23918 #else
jpayne@68 23919 if (likely(PyFunction_Check(descr)))
jpayne@68 23920 #endif
jpayne@68 23921 #endif
jpayne@68 23922 {
jpayne@68 23923 meth_found = 1;
jpayne@68 23924 } else {
jpayne@68 23925 f = Py_TYPE(descr)->tp_descr_get;
jpayne@68 23926 if (f != NULL && PyDescr_IsData(descr)) {
jpayne@68 23927 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
jpayne@68 23928 Py_DECREF(descr);
jpayne@68 23929 goto try_unpack;
jpayne@68 23930 }
jpayne@68 23931 }
jpayne@68 23932 }
jpayne@68 23933 dictptr = _PyObject_GetDictPtr(obj);
jpayne@68 23934 if (dictptr != NULL && (dict = *dictptr) != NULL) {
jpayne@68 23935 Py_INCREF(dict);
jpayne@68 23936 attr = __Pyx_PyDict_GetItemStr(dict, name);
jpayne@68 23937 if (attr != NULL) {
jpayne@68 23938 Py_INCREF(attr);
jpayne@68 23939 Py_DECREF(dict);
jpayne@68 23940 Py_XDECREF(descr);
jpayne@68 23941 goto try_unpack;
jpayne@68 23942 }
jpayne@68 23943 Py_DECREF(dict);
jpayne@68 23944 }
jpayne@68 23945 if (meth_found) {
jpayne@68 23946 *method = descr;
jpayne@68 23947 return 1;
jpayne@68 23948 }
jpayne@68 23949 if (f != NULL) {
jpayne@68 23950 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
jpayne@68 23951 Py_DECREF(descr);
jpayne@68 23952 goto try_unpack;
jpayne@68 23953 }
jpayne@68 23954 if (likely(descr != NULL)) {
jpayne@68 23955 *method = descr;
jpayne@68 23956 return 0;
jpayne@68 23957 }
jpayne@68 23958 type_name = __Pyx_PyType_GetName(tp);
jpayne@68 23959 PyErr_Format(PyExc_AttributeError,
jpayne@68 23960 #if PY_MAJOR_VERSION >= 3
jpayne@68 23961 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
jpayne@68 23962 type_name, name);
jpayne@68 23963 #else
jpayne@68 23964 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
jpayne@68 23965 type_name, PyString_AS_STRING(name));
jpayne@68 23966 #endif
jpayne@68 23967 __Pyx_DECREF_TypeName(type_name);
jpayne@68 23968 return 0;
jpayne@68 23969 #else
jpayne@68 23970 attr = __Pyx_PyObject_GetAttrStr(obj, name);
jpayne@68 23971 goto try_unpack;
jpayne@68 23972 #endif
jpayne@68 23973 try_unpack:
jpayne@68 23974 #if CYTHON_UNPACK_METHODS
jpayne@68 23975 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
jpayne@68 23976 PyObject *function = PyMethod_GET_FUNCTION(attr);
jpayne@68 23977 Py_INCREF(function);
jpayne@68 23978 Py_DECREF(attr);
jpayne@68 23979 *method = function;
jpayne@68 23980 return 1;
jpayne@68 23981 }
jpayne@68 23982 #endif
jpayne@68 23983 *method = attr;
jpayne@68 23984 return 0;
jpayne@68 23985 }
jpayne@68 23986
jpayne@68 23987 /* PyObjectCallMethod1 */
jpayne@68 23988 #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2)
jpayne@68 23989 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
jpayne@68 23990 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
jpayne@68 23991 Py_DECREF(method);
jpayne@68 23992 return result;
jpayne@68 23993 }
jpayne@68 23994 #endif
jpayne@68 23995 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
jpayne@68 23996 #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2
jpayne@68 23997 PyObject *args[2] = {obj, arg};
jpayne@68 23998 (void) __Pyx_PyObject_GetMethod;
jpayne@68 23999 (void) __Pyx_PyObject_CallOneArg;
jpayne@68 24000 (void) __Pyx_PyObject_Call2Args;
jpayne@68 24001 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
jpayne@68 24002 #else
jpayne@68 24003 PyObject *method = NULL, *result;
jpayne@68 24004 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
jpayne@68 24005 if (likely(is_method)) {
jpayne@68 24006 result = __Pyx_PyObject_Call2Args(method, obj, arg);
jpayne@68 24007 Py_DECREF(method);
jpayne@68 24008 return result;
jpayne@68 24009 }
jpayne@68 24010 if (unlikely(!method)) return NULL;
jpayne@68 24011 return __Pyx__PyObject_CallMethod1(method, arg);
jpayne@68 24012 #endif
jpayne@68 24013 }
jpayne@68 24014
jpayne@68 24015 /* StringJoin */
jpayne@68 24016 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
jpayne@68 24017 (void) __Pyx_PyObject_CallMethod1;
jpayne@68 24018 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3
jpayne@68 24019 return _PyString_Join(sep, values);
jpayne@68 24020 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
jpayne@68 24021 return _PyBytes_Join(sep, values);
jpayne@68 24022 #else
jpayne@68 24023 return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values);
jpayne@68 24024 #endif
jpayne@68 24025 }
jpayne@68 24026
jpayne@68 24027 /* PyObjectCallNoArg */
jpayne@68 24028 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
jpayne@68 24029 PyObject *arg[2] = {NULL, NULL};
jpayne@68 24030 return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
jpayne@68 24031 }
jpayne@68 24032
jpayne@68 24033 /* ArgTypeTest */
jpayne@68 24034 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
jpayne@68 24035 {
jpayne@68 24036 __Pyx_TypeName type_name;
jpayne@68 24037 __Pyx_TypeName obj_type_name;
jpayne@68 24038 if (unlikely(!type)) {
jpayne@68 24039 PyErr_SetString(PyExc_SystemError, "Missing type object");
jpayne@68 24040 return 0;
jpayne@68 24041 }
jpayne@68 24042 else if (exact) {
jpayne@68 24043 #if PY_MAJOR_VERSION == 2
jpayne@68 24044 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
jpayne@68 24045 #endif
jpayne@68 24046 }
jpayne@68 24047 else {
jpayne@68 24048 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
jpayne@68 24049 }
jpayne@68 24050 type_name = __Pyx_PyType_GetName(type);
jpayne@68 24051 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
jpayne@68 24052 PyErr_Format(PyExc_TypeError,
jpayne@68 24053 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
jpayne@68 24054 ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
jpayne@68 24055 __Pyx_DECREF_TypeName(type_name);
jpayne@68 24056 __Pyx_DECREF_TypeName(obj_type_name);
jpayne@68 24057 return 0;
jpayne@68 24058 }
jpayne@68 24059
jpayne@68 24060 /* PyObjectSetAttrStr */
jpayne@68 24061 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 24062 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
jpayne@68 24063 PyTypeObject* tp = Py_TYPE(obj);
jpayne@68 24064 if (likely(tp->tp_setattro))
jpayne@68 24065 return tp->tp_setattro(obj, attr_name, value);
jpayne@68 24066 #if PY_MAJOR_VERSION < 3
jpayne@68 24067 if (likely(tp->tp_setattr))
jpayne@68 24068 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
jpayne@68 24069 #endif
jpayne@68 24070 return PyObject_SetAttr(obj, attr_name, value);
jpayne@68 24071 }
jpayne@68 24072 #endif
jpayne@68 24073
jpayne@68 24074 /* JoinPyUnicode */
jpayne@68 24075 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
jpayne@68 24076 Py_UCS4 max_char) {
jpayne@68 24077 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 24078 PyObject *result_uval;
jpayne@68 24079 int result_ukind, kind_shift;
jpayne@68 24080 Py_ssize_t i, char_pos;
jpayne@68 24081 void *result_udata;
jpayne@68 24082 CYTHON_MAYBE_UNUSED_VAR(max_char);
jpayne@68 24083 #if CYTHON_PEP393_ENABLED
jpayne@68 24084 result_uval = PyUnicode_New(result_ulength, max_char);
jpayne@68 24085 if (unlikely(!result_uval)) return NULL;
jpayne@68 24086 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
jpayne@68 24087 kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
jpayne@68 24088 result_udata = PyUnicode_DATA(result_uval);
jpayne@68 24089 #else
jpayne@68 24090 result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
jpayne@68 24091 if (unlikely(!result_uval)) return NULL;
jpayne@68 24092 result_ukind = sizeof(Py_UNICODE);
jpayne@68 24093 kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
jpayne@68 24094 result_udata = PyUnicode_AS_UNICODE(result_uval);
jpayne@68 24095 #endif
jpayne@68 24096 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
jpayne@68 24097 char_pos = 0;
jpayne@68 24098 for (i=0; i < value_count; i++) {
jpayne@68 24099 int ukind;
jpayne@68 24100 Py_ssize_t ulength;
jpayne@68 24101 void *udata;
jpayne@68 24102 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
jpayne@68 24103 if (unlikely(__Pyx_PyUnicode_READY(uval)))
jpayne@68 24104 goto bad;
jpayne@68 24105 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
jpayne@68 24106 if (unlikely(!ulength))
jpayne@68 24107 continue;
jpayne@68 24108 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
jpayne@68 24109 goto overflow;
jpayne@68 24110 ukind = __Pyx_PyUnicode_KIND(uval);
jpayne@68 24111 udata = __Pyx_PyUnicode_DATA(uval);
jpayne@68 24112 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
jpayne@68 24113 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
jpayne@68 24114 } else {
jpayne@68 24115 #if PY_VERSION_HEX >= 0x030d0000
jpayne@68 24116 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
jpayne@68 24117 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
jpayne@68 24118 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
jpayne@68 24119 #else
jpayne@68 24120 Py_ssize_t j;
jpayne@68 24121 for (j=0; j < ulength; j++) {
jpayne@68 24122 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
jpayne@68 24123 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
jpayne@68 24124 }
jpayne@68 24125 #endif
jpayne@68 24126 }
jpayne@68 24127 char_pos += ulength;
jpayne@68 24128 }
jpayne@68 24129 return result_uval;
jpayne@68 24130 overflow:
jpayne@68 24131 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
jpayne@68 24132 bad:
jpayne@68 24133 Py_DECREF(result_uval);
jpayne@68 24134 return NULL;
jpayne@68 24135 #else
jpayne@68 24136 CYTHON_UNUSED_VAR(max_char);
jpayne@68 24137 CYTHON_UNUSED_VAR(result_ulength);
jpayne@68 24138 CYTHON_UNUSED_VAR(value_count);
jpayne@68 24139 return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
jpayne@68 24140 #endif
jpayne@68 24141 }
jpayne@68 24142
jpayne@68 24143 /* PyDictVersioning */
jpayne@68 24144 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
jpayne@68 24145 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
jpayne@68 24146 PyObject *dict = Py_TYPE(obj)->tp_dict;
jpayne@68 24147 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
jpayne@68 24148 }
jpayne@68 24149 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
jpayne@68 24150 PyObject **dictptr = NULL;
jpayne@68 24151 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
jpayne@68 24152 if (offset) {
jpayne@68 24153 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 24154 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
jpayne@68 24155 #else
jpayne@68 24156 dictptr = _PyObject_GetDictPtr(obj);
jpayne@68 24157 #endif
jpayne@68 24158 }
jpayne@68 24159 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
jpayne@68 24160 }
jpayne@68 24161 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
jpayne@68 24162 PyObject *dict = Py_TYPE(obj)->tp_dict;
jpayne@68 24163 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
jpayne@68 24164 return 0;
jpayne@68 24165 return obj_dict_version == __Pyx_get_object_dict_version(obj);
jpayne@68 24166 }
jpayne@68 24167 #endif
jpayne@68 24168
jpayne@68 24169 /* GetModuleGlobalName */
jpayne@68 24170 #if CYTHON_USE_DICT_VERSIONS
jpayne@68 24171 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
jpayne@68 24172 #else
jpayne@68 24173 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
jpayne@68 24174 #endif
jpayne@68 24175 {
jpayne@68 24176 PyObject *result;
jpayne@68 24177 #if !CYTHON_AVOID_BORROWED_REFS
jpayne@68 24178 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
jpayne@68 24179 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
jpayne@68 24180 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
jpayne@68 24181 if (likely(result)) {
jpayne@68 24182 return __Pyx_NewRef(result);
jpayne@68 24183 } else if (unlikely(PyErr_Occurred())) {
jpayne@68 24184 return NULL;
jpayne@68 24185 }
jpayne@68 24186 #elif CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 24187 if (unlikely(!__pyx_m)) {
jpayne@68 24188 return NULL;
jpayne@68 24189 }
jpayne@68 24190 result = PyObject_GetAttr(__pyx_m, name);
jpayne@68 24191 if (likely(result)) {
jpayne@68 24192 return result;
jpayne@68 24193 }
jpayne@68 24194 #else
jpayne@68 24195 result = PyDict_GetItem(__pyx_d, name);
jpayne@68 24196 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
jpayne@68 24197 if (likely(result)) {
jpayne@68 24198 return __Pyx_NewRef(result);
jpayne@68 24199 }
jpayne@68 24200 #endif
jpayne@68 24201 #else
jpayne@68 24202 result = PyObject_GetItem(__pyx_d, name);
jpayne@68 24203 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
jpayne@68 24204 if (likely(result)) {
jpayne@68 24205 return __Pyx_NewRef(result);
jpayne@68 24206 }
jpayne@68 24207 PyErr_Clear();
jpayne@68 24208 #endif
jpayne@68 24209 return __Pyx_GetBuiltinName(name);
jpayne@68 24210 }
jpayne@68 24211
jpayne@68 24212 /* GetItemInt */
jpayne@68 24213 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
jpayne@68 24214 PyObject *r;
jpayne@68 24215 if (unlikely(!j)) return NULL;
jpayne@68 24216 r = PyObject_GetItem(o, j);
jpayne@68 24217 Py_DECREF(j);
jpayne@68 24218 return r;
jpayne@68 24219 }
jpayne@68 24220 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
jpayne@68 24221 CYTHON_NCP_UNUSED int wraparound,
jpayne@68 24222 CYTHON_NCP_UNUSED int boundscheck) {
jpayne@68 24223 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 24224 Py_ssize_t wrapped_i = i;
jpayne@68 24225 if (wraparound & unlikely(i < 0)) {
jpayne@68 24226 wrapped_i += PyList_GET_SIZE(o);
jpayne@68 24227 }
jpayne@68 24228 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
jpayne@68 24229 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
jpayne@68 24230 Py_INCREF(r);
jpayne@68 24231 return r;
jpayne@68 24232 }
jpayne@68 24233 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
jpayne@68 24234 #else
jpayne@68 24235 return PySequence_GetItem(o, i);
jpayne@68 24236 #endif
jpayne@68 24237 }
jpayne@68 24238 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
jpayne@68 24239 CYTHON_NCP_UNUSED int wraparound,
jpayne@68 24240 CYTHON_NCP_UNUSED int boundscheck) {
jpayne@68 24241 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 24242 Py_ssize_t wrapped_i = i;
jpayne@68 24243 if (wraparound & unlikely(i < 0)) {
jpayne@68 24244 wrapped_i += PyTuple_GET_SIZE(o);
jpayne@68 24245 }
jpayne@68 24246 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
jpayne@68 24247 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
jpayne@68 24248 Py_INCREF(r);
jpayne@68 24249 return r;
jpayne@68 24250 }
jpayne@68 24251 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
jpayne@68 24252 #else
jpayne@68 24253 return PySequence_GetItem(o, i);
jpayne@68 24254 #endif
jpayne@68 24255 }
jpayne@68 24256 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
jpayne@68 24257 CYTHON_NCP_UNUSED int wraparound,
jpayne@68 24258 CYTHON_NCP_UNUSED int boundscheck) {
jpayne@68 24259 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
jpayne@68 24260 if (is_list || PyList_CheckExact(o)) {
jpayne@68 24261 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
jpayne@68 24262 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
jpayne@68 24263 PyObject *r = PyList_GET_ITEM(o, n);
jpayne@68 24264 Py_INCREF(r);
jpayne@68 24265 return r;
jpayne@68 24266 }
jpayne@68 24267 }
jpayne@68 24268 else if (PyTuple_CheckExact(o)) {
jpayne@68 24269 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
jpayne@68 24270 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
jpayne@68 24271 PyObject *r = PyTuple_GET_ITEM(o, n);
jpayne@68 24272 Py_INCREF(r);
jpayne@68 24273 return r;
jpayne@68 24274 }
jpayne@68 24275 } else {
jpayne@68 24276 PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
jpayne@68 24277 PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
jpayne@68 24278 if (mm && mm->mp_subscript) {
jpayne@68 24279 PyObject *r, *key = PyInt_FromSsize_t(i);
jpayne@68 24280 if (unlikely(!key)) return NULL;
jpayne@68 24281 r = mm->mp_subscript(o, key);
jpayne@68 24282 Py_DECREF(key);
jpayne@68 24283 return r;
jpayne@68 24284 }
jpayne@68 24285 if (likely(sm && sm->sq_item)) {
jpayne@68 24286 if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
jpayne@68 24287 Py_ssize_t l = sm->sq_length(o);
jpayne@68 24288 if (likely(l >= 0)) {
jpayne@68 24289 i += l;
jpayne@68 24290 } else {
jpayne@68 24291 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
jpayne@68 24292 return NULL;
jpayne@68 24293 PyErr_Clear();
jpayne@68 24294 }
jpayne@68 24295 }
jpayne@68 24296 return sm->sq_item(o, i);
jpayne@68 24297 }
jpayne@68 24298 }
jpayne@68 24299 #else
jpayne@68 24300 if (is_list || !PyMapping_Check(o)) {
jpayne@68 24301 return PySequence_GetItem(o, i);
jpayne@68 24302 }
jpayne@68 24303 #endif
jpayne@68 24304 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
jpayne@68 24305 }
jpayne@68 24306
jpayne@68 24307 /* ObjectGetItem */
jpayne@68 24308 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 24309 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
jpayne@68 24310 PyObject *runerr = NULL;
jpayne@68 24311 Py_ssize_t key_value;
jpayne@68 24312 key_value = __Pyx_PyIndex_AsSsize_t(index);
jpayne@68 24313 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
jpayne@68 24314 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
jpayne@68 24315 }
jpayne@68 24316 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
jpayne@68 24317 __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
jpayne@68 24318 PyErr_Clear();
jpayne@68 24319 PyErr_Format(PyExc_IndexError,
jpayne@68 24320 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
jpayne@68 24321 __Pyx_DECREF_TypeName(index_type_name);
jpayne@68 24322 }
jpayne@68 24323 return NULL;
jpayne@68 24324 }
jpayne@68 24325 static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
jpayne@68 24326 __Pyx_TypeName obj_type_name;
jpayne@68 24327 if (likely(PyType_Check(obj))) {
jpayne@68 24328 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
jpayne@68 24329 if (!meth) {
jpayne@68 24330 PyErr_Clear();
jpayne@68 24331 } else {
jpayne@68 24332 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
jpayne@68 24333 Py_DECREF(meth);
jpayne@68 24334 return result;
jpayne@68 24335 }
jpayne@68 24336 }
jpayne@68 24337 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
jpayne@68 24338 PyErr_Format(PyExc_TypeError,
jpayne@68 24339 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
jpayne@68 24340 __Pyx_DECREF_TypeName(obj_type_name);
jpayne@68 24341 return NULL;
jpayne@68 24342 }
jpayne@68 24343 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
jpayne@68 24344 PyTypeObject *tp = Py_TYPE(obj);
jpayne@68 24345 PyMappingMethods *mm = tp->tp_as_mapping;
jpayne@68 24346 PySequenceMethods *sm = tp->tp_as_sequence;
jpayne@68 24347 if (likely(mm && mm->mp_subscript)) {
jpayne@68 24348 return mm->mp_subscript(obj, key);
jpayne@68 24349 }
jpayne@68 24350 if (likely(sm && sm->sq_item)) {
jpayne@68 24351 return __Pyx_PyObject_GetIndex(obj, key);
jpayne@68 24352 }
jpayne@68 24353 return __Pyx_PyObject_GetItem_Slow(obj, key);
jpayne@68 24354 }
jpayne@68 24355 #endif
jpayne@68 24356
jpayne@68 24357 /* GetException */
jpayne@68 24358 #if CYTHON_FAST_THREAD_STATE
jpayne@68 24359 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
jpayne@68 24360 #else
jpayne@68 24361 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
jpayne@68 24362 #endif
jpayne@68 24363 {
jpayne@68 24364 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
jpayne@68 24365 #if CYTHON_FAST_THREAD_STATE
jpayne@68 24366 PyObject *tmp_type, *tmp_value, *tmp_tb;
jpayne@68 24367 #if PY_VERSION_HEX >= 0x030C00A6
jpayne@68 24368 local_value = tstate->current_exception;
jpayne@68 24369 tstate->current_exception = 0;
jpayne@68 24370 if (likely(local_value)) {
jpayne@68 24371 local_type = (PyObject*) Py_TYPE(local_value);
jpayne@68 24372 Py_INCREF(local_type);
jpayne@68 24373 local_tb = PyException_GetTraceback(local_value);
jpayne@68 24374 }
jpayne@68 24375 #else
jpayne@68 24376 local_type = tstate->curexc_type;
jpayne@68 24377 local_value = tstate->curexc_value;
jpayne@68 24378 local_tb = tstate->curexc_traceback;
jpayne@68 24379 tstate->curexc_type = 0;
jpayne@68 24380 tstate->curexc_value = 0;
jpayne@68 24381 tstate->curexc_traceback = 0;
jpayne@68 24382 #endif
jpayne@68 24383 #else
jpayne@68 24384 PyErr_Fetch(&local_type, &local_value, &local_tb);
jpayne@68 24385 #endif
jpayne@68 24386 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
jpayne@68 24387 #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
jpayne@68 24388 if (unlikely(tstate->current_exception))
jpayne@68 24389 #elif CYTHON_FAST_THREAD_STATE
jpayne@68 24390 if (unlikely(tstate->curexc_type))
jpayne@68 24391 #else
jpayne@68 24392 if (unlikely(PyErr_Occurred()))
jpayne@68 24393 #endif
jpayne@68 24394 goto bad;
jpayne@68 24395 #if PY_MAJOR_VERSION >= 3
jpayne@68 24396 if (local_tb) {
jpayne@68 24397 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
jpayne@68 24398 goto bad;
jpayne@68 24399 }
jpayne@68 24400 #endif
jpayne@68 24401 Py_XINCREF(local_tb);
jpayne@68 24402 Py_XINCREF(local_type);
jpayne@68 24403 Py_XINCREF(local_value);
jpayne@68 24404 *type = local_type;
jpayne@68 24405 *value = local_value;
jpayne@68 24406 *tb = local_tb;
jpayne@68 24407 #if CYTHON_FAST_THREAD_STATE
jpayne@68 24408 #if CYTHON_USE_EXC_INFO_STACK
jpayne@68 24409 {
jpayne@68 24410 _PyErr_StackItem *exc_info = tstate->exc_info;
jpayne@68 24411 #if PY_VERSION_HEX >= 0x030B00a4
jpayne@68 24412 tmp_value = exc_info->exc_value;
jpayne@68 24413 exc_info->exc_value = local_value;
jpayne@68 24414 tmp_type = NULL;
jpayne@68 24415 tmp_tb = NULL;
jpayne@68 24416 Py_XDECREF(local_type);
jpayne@68 24417 Py_XDECREF(local_tb);
jpayne@68 24418 #else
jpayne@68 24419 tmp_type = exc_info->exc_type;
jpayne@68 24420 tmp_value = exc_info->exc_value;
jpayne@68 24421 tmp_tb = exc_info->exc_traceback;
jpayne@68 24422 exc_info->exc_type = local_type;
jpayne@68 24423 exc_info->exc_value = local_value;
jpayne@68 24424 exc_info->exc_traceback = local_tb;
jpayne@68 24425 #endif
jpayne@68 24426 }
jpayne@68 24427 #else
jpayne@68 24428 tmp_type = tstate->exc_type;
jpayne@68 24429 tmp_value = tstate->exc_value;
jpayne@68 24430 tmp_tb = tstate->exc_traceback;
jpayne@68 24431 tstate->exc_type = local_type;
jpayne@68 24432 tstate->exc_value = local_value;
jpayne@68 24433 tstate->exc_traceback = local_tb;
jpayne@68 24434 #endif
jpayne@68 24435 Py_XDECREF(tmp_type);
jpayne@68 24436 Py_XDECREF(tmp_value);
jpayne@68 24437 Py_XDECREF(tmp_tb);
jpayne@68 24438 #else
jpayne@68 24439 PyErr_SetExcInfo(local_type, local_value, local_tb);
jpayne@68 24440 #endif
jpayne@68 24441 return 0;
jpayne@68 24442 bad:
jpayne@68 24443 *type = 0;
jpayne@68 24444 *value = 0;
jpayne@68 24445 *tb = 0;
jpayne@68 24446 Py_XDECREF(local_type);
jpayne@68 24447 Py_XDECREF(local_value);
jpayne@68 24448 Py_XDECREF(local_tb);
jpayne@68 24449 return -1;
jpayne@68 24450 }
jpayne@68 24451
jpayne@68 24452 /* SwapException */
jpayne@68 24453 #if CYTHON_FAST_THREAD_STATE
jpayne@68 24454 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
jpayne@68 24455 PyObject *tmp_type, *tmp_value, *tmp_tb;
jpayne@68 24456 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
jpayne@68 24457 _PyErr_StackItem *exc_info = tstate->exc_info;
jpayne@68 24458 tmp_value = exc_info->exc_value;
jpayne@68 24459 exc_info->exc_value = *value;
jpayne@68 24460 if (tmp_value == NULL || tmp_value == Py_None) {
jpayne@68 24461 Py_XDECREF(tmp_value);
jpayne@68 24462 tmp_value = NULL;
jpayne@68 24463 tmp_type = NULL;
jpayne@68 24464 tmp_tb = NULL;
jpayne@68 24465 } else {
jpayne@68 24466 tmp_type = (PyObject*) Py_TYPE(tmp_value);
jpayne@68 24467 Py_INCREF(tmp_type);
jpayne@68 24468 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 24469 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
jpayne@68 24470 Py_XINCREF(tmp_tb);
jpayne@68 24471 #else
jpayne@68 24472 tmp_tb = PyException_GetTraceback(tmp_value);
jpayne@68 24473 #endif
jpayne@68 24474 }
jpayne@68 24475 #elif CYTHON_USE_EXC_INFO_STACK
jpayne@68 24476 _PyErr_StackItem *exc_info = tstate->exc_info;
jpayne@68 24477 tmp_type = exc_info->exc_type;
jpayne@68 24478 tmp_value = exc_info->exc_value;
jpayne@68 24479 tmp_tb = exc_info->exc_traceback;
jpayne@68 24480 exc_info->exc_type = *type;
jpayne@68 24481 exc_info->exc_value = *value;
jpayne@68 24482 exc_info->exc_traceback = *tb;
jpayne@68 24483 #else
jpayne@68 24484 tmp_type = tstate->exc_type;
jpayne@68 24485 tmp_value = tstate->exc_value;
jpayne@68 24486 tmp_tb = tstate->exc_traceback;
jpayne@68 24487 tstate->exc_type = *type;
jpayne@68 24488 tstate->exc_value = *value;
jpayne@68 24489 tstate->exc_traceback = *tb;
jpayne@68 24490 #endif
jpayne@68 24491 *type = tmp_type;
jpayne@68 24492 *value = tmp_value;
jpayne@68 24493 *tb = tmp_tb;
jpayne@68 24494 }
jpayne@68 24495 #else
jpayne@68 24496 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
jpayne@68 24497 PyObject *tmp_type, *tmp_value, *tmp_tb;
jpayne@68 24498 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
jpayne@68 24499 PyErr_SetExcInfo(*type, *value, *tb);
jpayne@68 24500 *type = tmp_type;
jpayne@68 24501 *value = tmp_value;
jpayne@68 24502 *tb = tmp_tb;
jpayne@68 24503 }
jpayne@68 24504 #endif
jpayne@68 24505
jpayne@68 24506 /* GetTopmostException */
jpayne@68 24507 #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
jpayne@68 24508 static _PyErr_StackItem *
jpayne@68 24509 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
jpayne@68 24510 {
jpayne@68 24511 _PyErr_StackItem *exc_info = tstate->exc_info;
jpayne@68 24512 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
jpayne@68 24513 exc_info->previous_item != NULL)
jpayne@68 24514 {
jpayne@68 24515 exc_info = exc_info->previous_item;
jpayne@68 24516 }
jpayne@68 24517 return exc_info;
jpayne@68 24518 }
jpayne@68 24519 #endif
jpayne@68 24520
jpayne@68 24521 /* SaveResetException */
jpayne@68 24522 #if CYTHON_FAST_THREAD_STATE
jpayne@68 24523 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
jpayne@68 24524 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
jpayne@68 24525 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
jpayne@68 24526 PyObject *exc_value = exc_info->exc_value;
jpayne@68 24527 if (exc_value == NULL || exc_value == Py_None) {
jpayne@68 24528 *value = NULL;
jpayne@68 24529 *type = NULL;
jpayne@68 24530 *tb = NULL;
jpayne@68 24531 } else {
jpayne@68 24532 *value = exc_value;
jpayne@68 24533 Py_INCREF(*value);
jpayne@68 24534 *type = (PyObject*) Py_TYPE(exc_value);
jpayne@68 24535 Py_INCREF(*type);
jpayne@68 24536 *tb = PyException_GetTraceback(exc_value);
jpayne@68 24537 }
jpayne@68 24538 #elif CYTHON_USE_EXC_INFO_STACK
jpayne@68 24539 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
jpayne@68 24540 *type = exc_info->exc_type;
jpayne@68 24541 *value = exc_info->exc_value;
jpayne@68 24542 *tb = exc_info->exc_traceback;
jpayne@68 24543 Py_XINCREF(*type);
jpayne@68 24544 Py_XINCREF(*value);
jpayne@68 24545 Py_XINCREF(*tb);
jpayne@68 24546 #else
jpayne@68 24547 *type = tstate->exc_type;
jpayne@68 24548 *value = tstate->exc_value;
jpayne@68 24549 *tb = tstate->exc_traceback;
jpayne@68 24550 Py_XINCREF(*type);
jpayne@68 24551 Py_XINCREF(*value);
jpayne@68 24552 Py_XINCREF(*tb);
jpayne@68 24553 #endif
jpayne@68 24554 }
jpayne@68 24555 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
jpayne@68 24556 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
jpayne@68 24557 _PyErr_StackItem *exc_info = tstate->exc_info;
jpayne@68 24558 PyObject *tmp_value = exc_info->exc_value;
jpayne@68 24559 exc_info->exc_value = value;
jpayne@68 24560 Py_XDECREF(tmp_value);
jpayne@68 24561 Py_XDECREF(type);
jpayne@68 24562 Py_XDECREF(tb);
jpayne@68 24563 #else
jpayne@68 24564 PyObject *tmp_type, *tmp_value, *tmp_tb;
jpayne@68 24565 #if CYTHON_USE_EXC_INFO_STACK
jpayne@68 24566 _PyErr_StackItem *exc_info = tstate->exc_info;
jpayne@68 24567 tmp_type = exc_info->exc_type;
jpayne@68 24568 tmp_value = exc_info->exc_value;
jpayne@68 24569 tmp_tb = exc_info->exc_traceback;
jpayne@68 24570 exc_info->exc_type = type;
jpayne@68 24571 exc_info->exc_value = value;
jpayne@68 24572 exc_info->exc_traceback = tb;
jpayne@68 24573 #else
jpayne@68 24574 tmp_type = tstate->exc_type;
jpayne@68 24575 tmp_value = tstate->exc_value;
jpayne@68 24576 tmp_tb = tstate->exc_traceback;
jpayne@68 24577 tstate->exc_type = type;
jpayne@68 24578 tstate->exc_value = value;
jpayne@68 24579 tstate->exc_traceback = tb;
jpayne@68 24580 #endif
jpayne@68 24581 Py_XDECREF(tmp_type);
jpayne@68 24582 Py_XDECREF(tmp_value);
jpayne@68 24583 Py_XDECREF(tmp_tb);
jpayne@68 24584 #endif
jpayne@68 24585 }
jpayne@68 24586 #endif
jpayne@68 24587
jpayne@68 24588 /* PyIntBinop */
jpayne@68 24589 #if !CYTHON_COMPILING_IN_PYPY
jpayne@68 24590 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
jpayne@68 24591 CYTHON_MAYBE_UNUSED_VAR(intval);
jpayne@68 24592 CYTHON_MAYBE_UNUSED_VAR(inplace);
jpayne@68 24593 CYTHON_UNUSED_VAR(zerodivision_check);
jpayne@68 24594 #if PY_MAJOR_VERSION < 3
jpayne@68 24595 if (likely(PyInt_CheckExact(op1))) {
jpayne@68 24596 const long b = intval;
jpayne@68 24597 long x;
jpayne@68 24598 long a = PyInt_AS_LONG(op1);
jpayne@68 24599
jpayne@68 24600 x = (long)((unsigned long)a - (unsigned long)b);
jpayne@68 24601 if (likely((x^a) >= 0 || (x^~b) >= 0))
jpayne@68 24602 return PyInt_FromLong(x);
jpayne@68 24603 return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
jpayne@68 24604 }
jpayne@68 24605 #endif
jpayne@68 24606 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 24607 if (likely(PyLong_CheckExact(op1))) {
jpayne@68 24608 const long b = intval;
jpayne@68 24609 long a, x;
jpayne@68 24610 #ifdef HAVE_LONG_LONG
jpayne@68 24611 const PY_LONG_LONG llb = intval;
jpayne@68 24612 PY_LONG_LONG lla, llx;
jpayne@68 24613 #endif
jpayne@68 24614 if (unlikely(__Pyx_PyLong_IsZero(op1))) {
jpayne@68 24615 return PyLong_FromLong(-intval);
jpayne@68 24616 }
jpayne@68 24617 if (likely(__Pyx_PyLong_IsCompact(op1))) {
jpayne@68 24618 a = __Pyx_PyLong_CompactValue(op1);
jpayne@68 24619 } else {
jpayne@68 24620 const digit* digits = __Pyx_PyLong_Digits(op1);
jpayne@68 24621 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
jpayne@68 24622 switch (size) {
jpayne@68 24623 case -2:
jpayne@68 24624 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
jpayne@68 24625 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
jpayne@68 24626 break;
jpayne@68 24627 #ifdef HAVE_LONG_LONG
jpayne@68 24628 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
jpayne@68 24629 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
jpayne@68 24630 goto long_long;
jpayne@68 24631 #endif
jpayne@68 24632 }
jpayne@68 24633 CYTHON_FALLTHROUGH;
jpayne@68 24634 case 2:
jpayne@68 24635 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
jpayne@68 24636 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
jpayne@68 24637 break;
jpayne@68 24638 #ifdef HAVE_LONG_LONG
jpayne@68 24639 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
jpayne@68 24640 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
jpayne@68 24641 goto long_long;
jpayne@68 24642 #endif
jpayne@68 24643 }
jpayne@68 24644 CYTHON_FALLTHROUGH;
jpayne@68 24645 case -3:
jpayne@68 24646 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
jpayne@68 24647 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
jpayne@68 24648 break;
jpayne@68 24649 #ifdef HAVE_LONG_LONG
jpayne@68 24650 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
jpayne@68 24651 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
jpayne@68 24652 goto long_long;
jpayne@68 24653 #endif
jpayne@68 24654 }
jpayne@68 24655 CYTHON_FALLTHROUGH;
jpayne@68 24656 case 3:
jpayne@68 24657 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
jpayne@68 24658 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
jpayne@68 24659 break;
jpayne@68 24660 #ifdef HAVE_LONG_LONG
jpayne@68 24661 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
jpayne@68 24662 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
jpayne@68 24663 goto long_long;
jpayne@68 24664 #endif
jpayne@68 24665 }
jpayne@68 24666 CYTHON_FALLTHROUGH;
jpayne@68 24667 case -4:
jpayne@68 24668 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
jpayne@68 24669 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
jpayne@68 24670 break;
jpayne@68 24671 #ifdef HAVE_LONG_LONG
jpayne@68 24672 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
jpayne@68 24673 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
jpayne@68 24674 goto long_long;
jpayne@68 24675 #endif
jpayne@68 24676 }
jpayne@68 24677 CYTHON_FALLTHROUGH;
jpayne@68 24678 case 4:
jpayne@68 24679 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
jpayne@68 24680 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
jpayne@68 24681 break;
jpayne@68 24682 #ifdef HAVE_LONG_LONG
jpayne@68 24683 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
jpayne@68 24684 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
jpayne@68 24685 goto long_long;
jpayne@68 24686 #endif
jpayne@68 24687 }
jpayne@68 24688 CYTHON_FALLTHROUGH;
jpayne@68 24689 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
jpayne@68 24690 }
jpayne@68 24691 }
jpayne@68 24692 x = a - b;
jpayne@68 24693 return PyLong_FromLong(x);
jpayne@68 24694 #ifdef HAVE_LONG_LONG
jpayne@68 24695 long_long:
jpayne@68 24696 llx = lla - llb;
jpayne@68 24697 return PyLong_FromLongLong(llx);
jpayne@68 24698 #endif
jpayne@68 24699
jpayne@68 24700
jpayne@68 24701 }
jpayne@68 24702 #endif
jpayne@68 24703 if (PyFloat_CheckExact(op1)) {
jpayne@68 24704 const long b = intval;
jpayne@68 24705 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 24706 double a = __pyx_PyFloat_AsDouble(op1);
jpayne@68 24707 #else
jpayne@68 24708 double a = PyFloat_AS_DOUBLE(op1);
jpayne@68 24709 #endif
jpayne@68 24710 double result;
jpayne@68 24711
jpayne@68 24712 PyFPE_START_PROTECT("subtract", return NULL)
jpayne@68 24713 result = ((double)a) - (double)b;
jpayne@68 24714 PyFPE_END_PROTECT(result)
jpayne@68 24715 return PyFloat_FromDouble(result);
jpayne@68 24716 }
jpayne@68 24717 return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
jpayne@68 24718 }
jpayne@68 24719 #endif
jpayne@68 24720
jpayne@68 24721 /* RaiseTooManyValuesToUnpack */
jpayne@68 24722 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
jpayne@68 24723 PyErr_Format(PyExc_ValueError,
jpayne@68 24724 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
jpayne@68 24725 }
jpayne@68 24726
jpayne@68 24727 /* RaiseNeedMoreValuesToUnpack */
jpayne@68 24728 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
jpayne@68 24729 PyErr_Format(PyExc_ValueError,
jpayne@68 24730 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
jpayne@68 24731 index, (index == 1) ? "" : "s");
jpayne@68 24732 }
jpayne@68 24733
jpayne@68 24734 /* IterFinish */
jpayne@68 24735 static CYTHON_INLINE int __Pyx_IterFinish(void) {
jpayne@68 24736 PyObject* exc_type;
jpayne@68 24737 __Pyx_PyThreadState_declare
jpayne@68 24738 __Pyx_PyThreadState_assign
jpayne@68 24739 exc_type = __Pyx_PyErr_CurrentExceptionType();
jpayne@68 24740 if (unlikely(exc_type)) {
jpayne@68 24741 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
jpayne@68 24742 return -1;
jpayne@68 24743 __Pyx_PyErr_Clear();
jpayne@68 24744 return 0;
jpayne@68 24745 }
jpayne@68 24746 return 0;
jpayne@68 24747 }
jpayne@68 24748
jpayne@68 24749 /* UnpackItemEndCheck */
jpayne@68 24750 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
jpayne@68 24751 if (unlikely(retval)) {
jpayne@68 24752 Py_DECREF(retval);
jpayne@68 24753 __Pyx_RaiseTooManyValuesError(expected);
jpayne@68 24754 return -1;
jpayne@68 24755 }
jpayne@68 24756 return __Pyx_IterFinish();
jpayne@68 24757 }
jpayne@68 24758
jpayne@68 24759 /* PyIntCompare */
jpayne@68 24760 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
jpayne@68 24761 CYTHON_MAYBE_UNUSED_VAR(intval);
jpayne@68 24762 CYTHON_UNUSED_VAR(inplace);
jpayne@68 24763 if (op1 == op2) {
jpayne@68 24764 Py_RETURN_FALSE;
jpayne@68 24765 }
jpayne@68 24766 #if PY_MAJOR_VERSION < 3
jpayne@68 24767 if (likely(PyInt_CheckExact(op1))) {
jpayne@68 24768 const long b = intval;
jpayne@68 24769 long a = PyInt_AS_LONG(op1);
jpayne@68 24770 if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
jpayne@68 24771 }
jpayne@68 24772 #endif
jpayne@68 24773 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 24774 if (likely(PyLong_CheckExact(op1))) {
jpayne@68 24775 int unequal;
jpayne@68 24776 unsigned long uintval;
jpayne@68 24777 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
jpayne@68 24778 const digit* digits = __Pyx_PyLong_Digits(op1);
jpayne@68 24779 if (intval == 0) {
jpayne@68 24780 if (__Pyx_PyLong_IsZero(op1) != 1) Py_RETURN_TRUE; else Py_RETURN_FALSE;
jpayne@68 24781 } else if (intval < 0) {
jpayne@68 24782 if (__Pyx_PyLong_IsNonNeg(op1))
jpayne@68 24783 Py_RETURN_TRUE;
jpayne@68 24784 intval = -intval;
jpayne@68 24785 } else {
jpayne@68 24786 if (__Pyx_PyLong_IsNeg(op1))
jpayne@68 24787 Py_RETURN_TRUE;
jpayne@68 24788 }
jpayne@68 24789 uintval = (unsigned long) intval;
jpayne@68 24790 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
jpayne@68 24791 if (uintval >> (PyLong_SHIFT * 4)) {
jpayne@68 24792 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
jpayne@68 24793 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
jpayne@68 24794 } else
jpayne@68 24795 #endif
jpayne@68 24796 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
jpayne@68 24797 if (uintval >> (PyLong_SHIFT * 3)) {
jpayne@68 24798 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
jpayne@68 24799 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
jpayne@68 24800 } else
jpayne@68 24801 #endif
jpayne@68 24802 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
jpayne@68 24803 if (uintval >> (PyLong_SHIFT * 2)) {
jpayne@68 24804 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
jpayne@68 24805 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
jpayne@68 24806 } else
jpayne@68 24807 #endif
jpayne@68 24808 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
jpayne@68 24809 if (uintval >> (PyLong_SHIFT * 1)) {
jpayne@68 24810 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
jpayne@68 24811 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
jpayne@68 24812 } else
jpayne@68 24813 #endif
jpayne@68 24814 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
jpayne@68 24815 if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
jpayne@68 24816 }
jpayne@68 24817 #endif
jpayne@68 24818 if (PyFloat_CheckExact(op1)) {
jpayne@68 24819 const long b = intval;
jpayne@68 24820 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 24821 double a = __pyx_PyFloat_AsDouble(op1);
jpayne@68 24822 #else
jpayne@68 24823 double a = PyFloat_AS_DOUBLE(op1);
jpayne@68 24824 #endif
jpayne@68 24825 if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
jpayne@68 24826 }
jpayne@68 24827 return (
jpayne@68 24828 PyObject_RichCompare(op1, op2, Py_NE));
jpayne@68 24829 }
jpayne@68 24830
jpayne@68 24831 /* FixUpExtensionType */
jpayne@68 24832 #if CYTHON_USE_TYPE_SPECS
jpayne@68 24833 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
jpayne@68 24834 #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 24835 CYTHON_UNUSED_VAR(spec);
jpayne@68 24836 CYTHON_UNUSED_VAR(type);
jpayne@68 24837 #else
jpayne@68 24838 const PyType_Slot *slot = spec->slots;
jpayne@68 24839 while (slot && slot->slot && slot->slot != Py_tp_members)
jpayne@68 24840 slot++;
jpayne@68 24841 if (slot && slot->slot == Py_tp_members) {
jpayne@68 24842 int changed = 0;
jpayne@68 24843 #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
jpayne@68 24844 const
jpayne@68 24845 #endif
jpayne@68 24846 PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
jpayne@68 24847 while (memb && memb->name) {
jpayne@68 24848 if (memb->name[0] == '_' && memb->name[1] == '_') {
jpayne@68 24849 #if PY_VERSION_HEX < 0x030900b1
jpayne@68 24850 if (strcmp(memb->name, "__weaklistoffset__") == 0) {
jpayne@68 24851 assert(memb->type == T_PYSSIZET);
jpayne@68 24852 assert(memb->flags == READONLY);
jpayne@68 24853 type->tp_weaklistoffset = memb->offset;
jpayne@68 24854 changed = 1;
jpayne@68 24855 }
jpayne@68 24856 else if (strcmp(memb->name, "__dictoffset__") == 0) {
jpayne@68 24857 assert(memb->type == T_PYSSIZET);
jpayne@68 24858 assert(memb->flags == READONLY);
jpayne@68 24859 type->tp_dictoffset = memb->offset;
jpayne@68 24860 changed = 1;
jpayne@68 24861 }
jpayne@68 24862 #if CYTHON_METH_FASTCALL
jpayne@68 24863 else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
jpayne@68 24864 assert(memb->type == T_PYSSIZET);
jpayne@68 24865 assert(memb->flags == READONLY);
jpayne@68 24866 #if PY_VERSION_HEX >= 0x030800b4
jpayne@68 24867 type->tp_vectorcall_offset = memb->offset;
jpayne@68 24868 #else
jpayne@68 24869 type->tp_print = (printfunc) memb->offset;
jpayne@68 24870 #endif
jpayne@68 24871 changed = 1;
jpayne@68 24872 }
jpayne@68 24873 #endif
jpayne@68 24874 #else
jpayne@68 24875 if ((0));
jpayne@68 24876 #endif
jpayne@68 24877 #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
jpayne@68 24878 else if (strcmp(memb->name, "__module__") == 0) {
jpayne@68 24879 PyObject *descr;
jpayne@68 24880 assert(memb->type == T_OBJECT);
jpayne@68 24881 assert(memb->flags == 0 || memb->flags == READONLY);
jpayne@68 24882 descr = PyDescr_NewMember(type, memb);
jpayne@68 24883 if (unlikely(!descr))
jpayne@68 24884 return -1;
jpayne@68 24885 if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
jpayne@68 24886 Py_DECREF(descr);
jpayne@68 24887 return -1;
jpayne@68 24888 }
jpayne@68 24889 Py_DECREF(descr);
jpayne@68 24890 changed = 1;
jpayne@68 24891 }
jpayne@68 24892 #endif
jpayne@68 24893 }
jpayne@68 24894 memb++;
jpayne@68 24895 }
jpayne@68 24896 if (changed)
jpayne@68 24897 PyType_Modified(type);
jpayne@68 24898 }
jpayne@68 24899 #endif
jpayne@68 24900 return 0;
jpayne@68 24901 }
jpayne@68 24902 #endif
jpayne@68 24903
jpayne@68 24904 /* PyObjectCallMethod0 */
jpayne@68 24905 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
jpayne@68 24906 PyObject *method = NULL, *result = NULL;
jpayne@68 24907 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
jpayne@68 24908 if (likely(is_method)) {
jpayne@68 24909 result = __Pyx_PyObject_CallOneArg(method, obj);
jpayne@68 24910 Py_DECREF(method);
jpayne@68 24911 return result;
jpayne@68 24912 }
jpayne@68 24913 if (unlikely(!method)) goto bad;
jpayne@68 24914 result = __Pyx_PyObject_CallNoArg(method);
jpayne@68 24915 Py_DECREF(method);
jpayne@68 24916 bad:
jpayne@68 24917 return result;
jpayne@68 24918 }
jpayne@68 24919
jpayne@68 24920 /* ValidateBasesTuple */
jpayne@68 24921 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
jpayne@68 24922 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
jpayne@68 24923 Py_ssize_t i, n;
jpayne@68 24924 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 24925 n = PyTuple_GET_SIZE(bases);
jpayne@68 24926 #else
jpayne@68 24927 n = PyTuple_Size(bases);
jpayne@68 24928 if (n < 0) return -1;
jpayne@68 24929 #endif
jpayne@68 24930 for (i = 1; i < n; i++)
jpayne@68 24931 {
jpayne@68 24932 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 24933 PyObject *b0 = PySequence_GetItem(bases, i);
jpayne@68 24934 if (!b0) return -1;
jpayne@68 24935 #elif CYTHON_ASSUME_SAFE_MACROS
jpayne@68 24936 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
jpayne@68 24937 #else
jpayne@68 24938 PyObject *b0 = PyTuple_GetItem(bases, i);
jpayne@68 24939 if (!b0) return -1;
jpayne@68 24940 #endif
jpayne@68 24941 PyTypeObject *b;
jpayne@68 24942 #if PY_MAJOR_VERSION < 3
jpayne@68 24943 if (PyClass_Check(b0))
jpayne@68 24944 {
jpayne@68 24945 PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
jpayne@68 24946 PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
jpayne@68 24947 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 24948 Py_DECREF(b0);
jpayne@68 24949 #endif
jpayne@68 24950 return -1;
jpayne@68 24951 }
jpayne@68 24952 #endif
jpayne@68 24953 b = (PyTypeObject*) b0;
jpayne@68 24954 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
jpayne@68 24955 {
jpayne@68 24956 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
jpayne@68 24957 PyErr_Format(PyExc_TypeError,
jpayne@68 24958 "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
jpayne@68 24959 __Pyx_DECREF_TypeName(b_name);
jpayne@68 24960 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 24961 Py_DECREF(b0);
jpayne@68 24962 #endif
jpayne@68 24963 return -1;
jpayne@68 24964 }
jpayne@68 24965 if (dictoffset == 0)
jpayne@68 24966 {
jpayne@68 24967 Py_ssize_t b_dictoffset = 0;
jpayne@68 24968 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
jpayne@68 24969 b_dictoffset = b->tp_dictoffset;
jpayne@68 24970 #else
jpayne@68 24971 PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
jpayne@68 24972 if (!py_b_dictoffset) goto dictoffset_return;
jpayne@68 24973 b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
jpayne@68 24974 Py_DECREF(py_b_dictoffset);
jpayne@68 24975 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
jpayne@68 24976 #endif
jpayne@68 24977 if (b_dictoffset) {
jpayne@68 24978 {
jpayne@68 24979 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
jpayne@68 24980 PyErr_Format(PyExc_TypeError,
jpayne@68 24981 "extension type '%.200s' has no __dict__ slot, "
jpayne@68 24982 "but base type '" __Pyx_FMT_TYPENAME "' has: "
jpayne@68 24983 "either add 'cdef dict __dict__' to the extension type "
jpayne@68 24984 "or add '__slots__ = [...]' to the base type",
jpayne@68 24985 type_name, b_name);
jpayne@68 24986 __Pyx_DECREF_TypeName(b_name);
jpayne@68 24987 }
jpayne@68 24988 #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
jpayne@68 24989 dictoffset_return:
jpayne@68 24990 #endif
jpayne@68 24991 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 24992 Py_DECREF(b0);
jpayne@68 24993 #endif
jpayne@68 24994 return -1;
jpayne@68 24995 }
jpayne@68 24996 }
jpayne@68 24997 #if CYTHON_AVOID_BORROWED_REFS
jpayne@68 24998 Py_DECREF(b0);
jpayne@68 24999 #endif
jpayne@68 25000 }
jpayne@68 25001 return 0;
jpayne@68 25002 }
jpayne@68 25003 #endif
jpayne@68 25004
jpayne@68 25005 /* PyType_Ready */
jpayne@68 25006 static int __Pyx_PyType_Ready(PyTypeObject *t) {
jpayne@68 25007 #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
jpayne@68 25008 (void)__Pyx_PyObject_CallMethod0;
jpayne@68 25009 #if CYTHON_USE_TYPE_SPECS
jpayne@68 25010 (void)__Pyx_validate_bases_tuple;
jpayne@68 25011 #endif
jpayne@68 25012 return PyType_Ready(t);
jpayne@68 25013 #else
jpayne@68 25014 int r;
jpayne@68 25015 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
jpayne@68 25016 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
jpayne@68 25017 return -1;
jpayne@68 25018 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
jpayne@68 25019 {
jpayne@68 25020 int gc_was_enabled;
jpayne@68 25021 #if PY_VERSION_HEX >= 0x030A00b1
jpayne@68 25022 gc_was_enabled = PyGC_Disable();
jpayne@68 25023 (void)__Pyx_PyObject_CallMethod0;
jpayne@68 25024 #else
jpayne@68 25025 PyObject *ret, *py_status;
jpayne@68 25026 PyObject *gc = NULL;
jpayne@68 25027 #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
jpayne@68 25028 gc = PyImport_GetModule(__pyx_kp_u_gc);
jpayne@68 25029 #endif
jpayne@68 25030 if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
jpayne@68 25031 if (unlikely(!gc)) return -1;
jpayne@68 25032 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
jpayne@68 25033 if (unlikely(!py_status)) {
jpayne@68 25034 Py_DECREF(gc);
jpayne@68 25035 return -1;
jpayne@68 25036 }
jpayne@68 25037 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
jpayne@68 25038 Py_DECREF(py_status);
jpayne@68 25039 if (gc_was_enabled > 0) {
jpayne@68 25040 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
jpayne@68 25041 if (unlikely(!ret)) {
jpayne@68 25042 Py_DECREF(gc);
jpayne@68 25043 return -1;
jpayne@68 25044 }
jpayne@68 25045 Py_DECREF(ret);
jpayne@68 25046 } else if (unlikely(gc_was_enabled == -1)) {
jpayne@68 25047 Py_DECREF(gc);
jpayne@68 25048 return -1;
jpayne@68 25049 }
jpayne@68 25050 #endif
jpayne@68 25051 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
jpayne@68 25052 #if PY_VERSION_HEX >= 0x030A0000
jpayne@68 25053 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
jpayne@68 25054 #endif
jpayne@68 25055 #else
jpayne@68 25056 (void)__Pyx_PyObject_CallMethod0;
jpayne@68 25057 #endif
jpayne@68 25058 r = PyType_Ready(t);
jpayne@68 25059 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
jpayne@68 25060 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
jpayne@68 25061 #if PY_VERSION_HEX >= 0x030A00b1
jpayne@68 25062 if (gc_was_enabled)
jpayne@68 25063 PyGC_Enable();
jpayne@68 25064 #else
jpayne@68 25065 if (gc_was_enabled) {
jpayne@68 25066 PyObject *tp, *v, *tb;
jpayne@68 25067 PyErr_Fetch(&tp, &v, &tb);
jpayne@68 25068 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
jpayne@68 25069 if (likely(ret || r == -1)) {
jpayne@68 25070 Py_XDECREF(ret);
jpayne@68 25071 PyErr_Restore(tp, v, tb);
jpayne@68 25072 } else {
jpayne@68 25073 Py_XDECREF(tp);
jpayne@68 25074 Py_XDECREF(v);
jpayne@68 25075 Py_XDECREF(tb);
jpayne@68 25076 r = -1;
jpayne@68 25077 }
jpayne@68 25078 }
jpayne@68 25079 Py_DECREF(gc);
jpayne@68 25080 #endif
jpayne@68 25081 }
jpayne@68 25082 #endif
jpayne@68 25083 return r;
jpayne@68 25084 #endif
jpayne@68 25085 }
jpayne@68 25086
jpayne@68 25087 /* PyObject_GenericGetAttrNoDict */
jpayne@68 25088 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
jpayne@68 25089 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
jpayne@68 25090 __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
jpayne@68 25091 PyErr_Format(PyExc_AttributeError,
jpayne@68 25092 #if PY_MAJOR_VERSION >= 3
jpayne@68 25093 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
jpayne@68 25094 type_name, attr_name);
jpayne@68 25095 #else
jpayne@68 25096 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
jpayne@68 25097 type_name, PyString_AS_STRING(attr_name));
jpayne@68 25098 #endif
jpayne@68 25099 __Pyx_DECREF_TypeName(type_name);
jpayne@68 25100 return NULL;
jpayne@68 25101 }
jpayne@68 25102 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
jpayne@68 25103 PyObject *descr;
jpayne@68 25104 PyTypeObject *tp = Py_TYPE(obj);
jpayne@68 25105 if (unlikely(!PyString_Check(attr_name))) {
jpayne@68 25106 return PyObject_GenericGetAttr(obj, attr_name);
jpayne@68 25107 }
jpayne@68 25108 assert(!tp->tp_dictoffset);
jpayne@68 25109 descr = _PyType_Lookup(tp, attr_name);
jpayne@68 25110 if (unlikely(!descr)) {
jpayne@68 25111 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
jpayne@68 25112 }
jpayne@68 25113 Py_INCREF(descr);
jpayne@68 25114 #if PY_MAJOR_VERSION < 3
jpayne@68 25115 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
jpayne@68 25116 #endif
jpayne@68 25117 {
jpayne@68 25118 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
jpayne@68 25119 if (unlikely(f)) {
jpayne@68 25120 PyObject *res = f(descr, obj, (PyObject *)tp);
jpayne@68 25121 Py_DECREF(descr);
jpayne@68 25122 return res;
jpayne@68 25123 }
jpayne@68 25124 }
jpayne@68 25125 return descr;
jpayne@68 25126 }
jpayne@68 25127 #endif
jpayne@68 25128
jpayne@68 25129 /* PyObject_GenericGetAttr */
jpayne@68 25130 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
jpayne@68 25131 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
jpayne@68 25132 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
jpayne@68 25133 return PyObject_GenericGetAttr(obj, attr_name);
jpayne@68 25134 }
jpayne@68 25135 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
jpayne@68 25136 }
jpayne@68 25137 #endif
jpayne@68 25138
jpayne@68 25139 /* SetVTable */
jpayne@68 25140 static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
jpayne@68 25141 PyObject *ob = PyCapsule_New(vtable, 0, 0);
jpayne@68 25142 if (unlikely(!ob))
jpayne@68 25143 goto bad;
jpayne@68 25144 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25145 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
jpayne@68 25146 #else
jpayne@68 25147 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
jpayne@68 25148 #endif
jpayne@68 25149 goto bad;
jpayne@68 25150 Py_DECREF(ob);
jpayne@68 25151 return 0;
jpayne@68 25152 bad:
jpayne@68 25153 Py_XDECREF(ob);
jpayne@68 25154 return -1;
jpayne@68 25155 }
jpayne@68 25156
jpayne@68 25157 /* GetVTable */
jpayne@68 25158 static void* __Pyx_GetVtable(PyTypeObject *type) {
jpayne@68 25159 void* ptr;
jpayne@68 25160 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25161 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
jpayne@68 25162 #else
jpayne@68 25163 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
jpayne@68 25164 #endif
jpayne@68 25165 if (!ob)
jpayne@68 25166 goto bad;
jpayne@68 25167 ptr = PyCapsule_GetPointer(ob, 0);
jpayne@68 25168 if (!ptr && !PyErr_Occurred())
jpayne@68 25169 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
jpayne@68 25170 Py_DECREF(ob);
jpayne@68 25171 return ptr;
jpayne@68 25172 bad:
jpayne@68 25173 Py_XDECREF(ob);
jpayne@68 25174 return NULL;
jpayne@68 25175 }
jpayne@68 25176
jpayne@68 25177 /* MergeVTables */
jpayne@68 25178 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25179 static int __Pyx_MergeVtables(PyTypeObject *type) {
jpayne@68 25180 int i;
jpayne@68 25181 void** base_vtables;
jpayne@68 25182 __Pyx_TypeName tp_base_name;
jpayne@68 25183 __Pyx_TypeName base_name;
jpayne@68 25184 void* unknown = (void*)-1;
jpayne@68 25185 PyObject* bases = type->tp_bases;
jpayne@68 25186 int base_depth = 0;
jpayne@68 25187 {
jpayne@68 25188 PyTypeObject* base = type->tp_base;
jpayne@68 25189 while (base) {
jpayne@68 25190 base_depth += 1;
jpayne@68 25191 base = base->tp_base;
jpayne@68 25192 }
jpayne@68 25193 }
jpayne@68 25194 base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
jpayne@68 25195 base_vtables[0] = unknown;
jpayne@68 25196 for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
jpayne@68 25197 void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
jpayne@68 25198 if (base_vtable != NULL) {
jpayne@68 25199 int j;
jpayne@68 25200 PyTypeObject* base = type->tp_base;
jpayne@68 25201 for (j = 0; j < base_depth; j++) {
jpayne@68 25202 if (base_vtables[j] == unknown) {
jpayne@68 25203 base_vtables[j] = __Pyx_GetVtable(base);
jpayne@68 25204 base_vtables[j + 1] = unknown;
jpayne@68 25205 }
jpayne@68 25206 if (base_vtables[j] == base_vtable) {
jpayne@68 25207 break;
jpayne@68 25208 } else if (base_vtables[j] == NULL) {
jpayne@68 25209 goto bad;
jpayne@68 25210 }
jpayne@68 25211 base = base->tp_base;
jpayne@68 25212 }
jpayne@68 25213 }
jpayne@68 25214 }
jpayne@68 25215 PyErr_Clear();
jpayne@68 25216 free(base_vtables);
jpayne@68 25217 return 0;
jpayne@68 25218 bad:
jpayne@68 25219 tp_base_name = __Pyx_PyType_GetName(type->tp_base);
jpayne@68 25220 base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
jpayne@68 25221 PyErr_Format(PyExc_TypeError,
jpayne@68 25222 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
jpayne@68 25223 __Pyx_DECREF_TypeName(tp_base_name);
jpayne@68 25224 __Pyx_DECREF_TypeName(base_name);
jpayne@68 25225 free(base_vtables);
jpayne@68 25226 return -1;
jpayne@68 25227 }
jpayne@68 25228 #endif
jpayne@68 25229
jpayne@68 25230 /* SetupReduce */
jpayne@68 25231 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25232 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
jpayne@68 25233 int ret;
jpayne@68 25234 PyObject *name_attr;
jpayne@68 25235 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
jpayne@68 25236 if (likely(name_attr)) {
jpayne@68 25237 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
jpayne@68 25238 } else {
jpayne@68 25239 ret = -1;
jpayne@68 25240 }
jpayne@68 25241 if (unlikely(ret < 0)) {
jpayne@68 25242 PyErr_Clear();
jpayne@68 25243 ret = 0;
jpayne@68 25244 }
jpayne@68 25245 Py_XDECREF(name_attr);
jpayne@68 25246 return ret;
jpayne@68 25247 }
jpayne@68 25248 static int __Pyx_setup_reduce(PyObject* type_obj) {
jpayne@68 25249 int ret = 0;
jpayne@68 25250 PyObject *object_reduce = NULL;
jpayne@68 25251 PyObject *object_getstate = NULL;
jpayne@68 25252 PyObject *object_reduce_ex = NULL;
jpayne@68 25253 PyObject *reduce = NULL;
jpayne@68 25254 PyObject *reduce_ex = NULL;
jpayne@68 25255 PyObject *reduce_cython = NULL;
jpayne@68 25256 PyObject *setstate = NULL;
jpayne@68 25257 PyObject *setstate_cython = NULL;
jpayne@68 25258 PyObject *getstate = NULL;
jpayne@68 25259 #if CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 25260 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
jpayne@68 25261 #else
jpayne@68 25262 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
jpayne@68 25263 if (!getstate && PyErr_Occurred()) {
jpayne@68 25264 goto __PYX_BAD;
jpayne@68 25265 }
jpayne@68 25266 #endif
jpayne@68 25267 if (getstate) {
jpayne@68 25268 #if CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 25269 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
jpayne@68 25270 #else
jpayne@68 25271 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
jpayne@68 25272 if (!object_getstate && PyErr_Occurred()) {
jpayne@68 25273 goto __PYX_BAD;
jpayne@68 25274 }
jpayne@68 25275 #endif
jpayne@68 25276 if (object_getstate != getstate) {
jpayne@68 25277 goto __PYX_GOOD;
jpayne@68 25278 }
jpayne@68 25279 }
jpayne@68 25280 #if CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 25281 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
jpayne@68 25282 #else
jpayne@68 25283 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
jpayne@68 25284 #endif
jpayne@68 25285 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
jpayne@68 25286 if (reduce_ex == object_reduce_ex) {
jpayne@68 25287 #if CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 25288 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
jpayne@68 25289 #else
jpayne@68 25290 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
jpayne@68 25291 #endif
jpayne@68 25292 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
jpayne@68 25293 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
jpayne@68 25294 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
jpayne@68 25295 if (likely(reduce_cython)) {
jpayne@68 25296 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
jpayne@68 25297 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
jpayne@68 25298 } else if (reduce == object_reduce || PyErr_Occurred()) {
jpayne@68 25299 goto __PYX_BAD;
jpayne@68 25300 }
jpayne@68 25301 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
jpayne@68 25302 if (!setstate) PyErr_Clear();
jpayne@68 25303 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
jpayne@68 25304 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
jpayne@68 25305 if (likely(setstate_cython)) {
jpayne@68 25306 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
jpayne@68 25307 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
jpayne@68 25308 } else if (!setstate || PyErr_Occurred()) {
jpayne@68 25309 goto __PYX_BAD;
jpayne@68 25310 }
jpayne@68 25311 }
jpayne@68 25312 PyType_Modified((PyTypeObject*)type_obj);
jpayne@68 25313 }
jpayne@68 25314 }
jpayne@68 25315 goto __PYX_GOOD;
jpayne@68 25316 __PYX_BAD:
jpayne@68 25317 if (!PyErr_Occurred()) {
jpayne@68 25318 __Pyx_TypeName type_obj_name =
jpayne@68 25319 __Pyx_PyType_GetName((PyTypeObject*)type_obj);
jpayne@68 25320 PyErr_Format(PyExc_RuntimeError,
jpayne@68 25321 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
jpayne@68 25322 __Pyx_DECREF_TypeName(type_obj_name);
jpayne@68 25323 }
jpayne@68 25324 ret = -1;
jpayne@68 25325 __PYX_GOOD:
jpayne@68 25326 #if !CYTHON_USE_PYTYPE_LOOKUP
jpayne@68 25327 Py_XDECREF(object_reduce);
jpayne@68 25328 Py_XDECREF(object_reduce_ex);
jpayne@68 25329 Py_XDECREF(object_getstate);
jpayne@68 25330 Py_XDECREF(getstate);
jpayne@68 25331 #endif
jpayne@68 25332 Py_XDECREF(reduce);
jpayne@68 25333 Py_XDECREF(reduce_ex);
jpayne@68 25334 Py_XDECREF(reduce_cython);
jpayne@68 25335 Py_XDECREF(setstate);
jpayne@68 25336 Py_XDECREF(setstate_cython);
jpayne@68 25337 return ret;
jpayne@68 25338 }
jpayne@68 25339 #endif
jpayne@68 25340
jpayne@68 25341 /* TypeImport */
jpayne@68 25342 #ifndef __PYX_HAVE_RT_ImportType_3_0_11
jpayne@68 25343 #define __PYX_HAVE_RT_ImportType_3_0_11
jpayne@68 25344 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
jpayne@68 25345 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
jpayne@68 25346 {
jpayne@68 25347 PyObject *result = 0;
jpayne@68 25348 char warning[200];
jpayne@68 25349 Py_ssize_t basicsize;
jpayne@68 25350 Py_ssize_t itemsize;
jpayne@68 25351 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25352 PyObject *py_basicsize;
jpayne@68 25353 PyObject *py_itemsize;
jpayne@68 25354 #endif
jpayne@68 25355 result = PyObject_GetAttrString(module, class_name);
jpayne@68 25356 if (!result)
jpayne@68 25357 goto bad;
jpayne@68 25358 if (!PyType_Check(result)) {
jpayne@68 25359 PyErr_Format(PyExc_TypeError,
jpayne@68 25360 "%.200s.%.200s is not a type object",
jpayne@68 25361 module_name, class_name);
jpayne@68 25362 goto bad;
jpayne@68 25363 }
jpayne@68 25364 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25365 basicsize = ((PyTypeObject *)result)->tp_basicsize;
jpayne@68 25366 itemsize = ((PyTypeObject *)result)->tp_itemsize;
jpayne@68 25367 #else
jpayne@68 25368 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
jpayne@68 25369 if (!py_basicsize)
jpayne@68 25370 goto bad;
jpayne@68 25371 basicsize = PyLong_AsSsize_t(py_basicsize);
jpayne@68 25372 Py_DECREF(py_basicsize);
jpayne@68 25373 py_basicsize = 0;
jpayne@68 25374 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
jpayne@68 25375 goto bad;
jpayne@68 25376 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
jpayne@68 25377 if (!py_itemsize)
jpayne@68 25378 goto bad;
jpayne@68 25379 itemsize = PyLong_AsSsize_t(py_itemsize);
jpayne@68 25380 Py_DECREF(py_itemsize);
jpayne@68 25381 py_itemsize = 0;
jpayne@68 25382 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
jpayne@68 25383 goto bad;
jpayne@68 25384 #endif
jpayne@68 25385 if (itemsize) {
jpayne@68 25386 if (size % alignment) {
jpayne@68 25387 alignment = size % alignment;
jpayne@68 25388 }
jpayne@68 25389 if (itemsize < (Py_ssize_t)alignment)
jpayne@68 25390 itemsize = (Py_ssize_t)alignment;
jpayne@68 25391 }
jpayne@68 25392 if ((size_t)(basicsize + itemsize) < size) {
jpayne@68 25393 PyErr_Format(PyExc_ValueError,
jpayne@68 25394 "%.200s.%.200s size changed, may indicate binary incompatibility. "
jpayne@68 25395 "Expected %zd from C header, got %zd from PyObject",
jpayne@68 25396 module_name, class_name, size, basicsize+itemsize);
jpayne@68 25397 goto bad;
jpayne@68 25398 }
jpayne@68 25399 if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
jpayne@68 25400 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
jpayne@68 25401 PyErr_Format(PyExc_ValueError,
jpayne@68 25402 "%.200s.%.200s size changed, may indicate binary incompatibility. "
jpayne@68 25403 "Expected %zd from C header, got %zd-%zd from PyObject",
jpayne@68 25404 module_name, class_name, size, basicsize, basicsize+itemsize);
jpayne@68 25405 goto bad;
jpayne@68 25406 }
jpayne@68 25407 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
jpayne@68 25408 PyOS_snprintf(warning, sizeof(warning),
jpayne@68 25409 "%s.%s size changed, may indicate binary incompatibility. "
jpayne@68 25410 "Expected %zd from C header, got %zd from PyObject",
jpayne@68 25411 module_name, class_name, size, basicsize);
jpayne@68 25412 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
jpayne@68 25413 }
jpayne@68 25414 return (PyTypeObject *)result;
jpayne@68 25415 bad:
jpayne@68 25416 Py_XDECREF(result);
jpayne@68 25417 return NULL;
jpayne@68 25418 }
jpayne@68 25419 #endif
jpayne@68 25420
jpayne@68 25421 /* Import */
jpayne@68 25422 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
jpayne@68 25423 PyObject *module = 0;
jpayne@68 25424 PyObject *empty_dict = 0;
jpayne@68 25425 PyObject *empty_list = 0;
jpayne@68 25426 #if PY_MAJOR_VERSION < 3
jpayne@68 25427 PyObject *py_import;
jpayne@68 25428 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
jpayne@68 25429 if (unlikely(!py_import))
jpayne@68 25430 goto bad;
jpayne@68 25431 if (!from_list) {
jpayne@68 25432 empty_list = PyList_New(0);
jpayne@68 25433 if (unlikely(!empty_list))
jpayne@68 25434 goto bad;
jpayne@68 25435 from_list = empty_list;
jpayne@68 25436 }
jpayne@68 25437 #endif
jpayne@68 25438 empty_dict = PyDict_New();
jpayne@68 25439 if (unlikely(!empty_dict))
jpayne@68 25440 goto bad;
jpayne@68 25441 {
jpayne@68 25442 #if PY_MAJOR_VERSION >= 3
jpayne@68 25443 if (level == -1) {
jpayne@68 25444 if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
jpayne@68 25445 module = PyImport_ImportModuleLevelObject(
jpayne@68 25446 name, __pyx_d, empty_dict, from_list, 1);
jpayne@68 25447 if (unlikely(!module)) {
jpayne@68 25448 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
jpayne@68 25449 goto bad;
jpayne@68 25450 PyErr_Clear();
jpayne@68 25451 }
jpayne@68 25452 }
jpayne@68 25453 level = 0;
jpayne@68 25454 }
jpayne@68 25455 #endif
jpayne@68 25456 if (!module) {
jpayne@68 25457 #if PY_MAJOR_VERSION < 3
jpayne@68 25458 PyObject *py_level = PyInt_FromLong(level);
jpayne@68 25459 if (unlikely(!py_level))
jpayne@68 25460 goto bad;
jpayne@68 25461 module = PyObject_CallFunctionObjArgs(py_import,
jpayne@68 25462 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
jpayne@68 25463 Py_DECREF(py_level);
jpayne@68 25464 #else
jpayne@68 25465 module = PyImport_ImportModuleLevelObject(
jpayne@68 25466 name, __pyx_d, empty_dict, from_list, level);
jpayne@68 25467 #endif
jpayne@68 25468 }
jpayne@68 25469 }
jpayne@68 25470 bad:
jpayne@68 25471 Py_XDECREF(empty_dict);
jpayne@68 25472 Py_XDECREF(empty_list);
jpayne@68 25473 #if PY_MAJOR_VERSION < 3
jpayne@68 25474 Py_XDECREF(py_import);
jpayne@68 25475 #endif
jpayne@68 25476 return module;
jpayne@68 25477 }
jpayne@68 25478
jpayne@68 25479 /* ImportDottedModule */
jpayne@68 25480 #if PY_MAJOR_VERSION >= 3
jpayne@68 25481 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
jpayne@68 25482 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
jpayne@68 25483 if (unlikely(PyErr_Occurred())) {
jpayne@68 25484 PyErr_Clear();
jpayne@68 25485 }
jpayne@68 25486 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
jpayne@68 25487 partial_name = name;
jpayne@68 25488 } else {
jpayne@68 25489 slice = PySequence_GetSlice(parts_tuple, 0, count);
jpayne@68 25490 if (unlikely(!slice))
jpayne@68 25491 goto bad;
jpayne@68 25492 sep = PyUnicode_FromStringAndSize(".", 1);
jpayne@68 25493 if (unlikely(!sep))
jpayne@68 25494 goto bad;
jpayne@68 25495 partial_name = PyUnicode_Join(sep, slice);
jpayne@68 25496 }
jpayne@68 25497 PyErr_Format(
jpayne@68 25498 #if PY_MAJOR_VERSION < 3
jpayne@68 25499 PyExc_ImportError,
jpayne@68 25500 "No module named '%s'", PyString_AS_STRING(partial_name));
jpayne@68 25501 #else
jpayne@68 25502 #if PY_VERSION_HEX >= 0x030600B1
jpayne@68 25503 PyExc_ModuleNotFoundError,
jpayne@68 25504 #else
jpayne@68 25505 PyExc_ImportError,
jpayne@68 25506 #endif
jpayne@68 25507 "No module named '%U'", partial_name);
jpayne@68 25508 #endif
jpayne@68 25509 bad:
jpayne@68 25510 Py_XDECREF(sep);
jpayne@68 25511 Py_XDECREF(slice);
jpayne@68 25512 Py_XDECREF(partial_name);
jpayne@68 25513 return NULL;
jpayne@68 25514 }
jpayne@68 25515 #endif
jpayne@68 25516 #if PY_MAJOR_VERSION >= 3
jpayne@68 25517 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
jpayne@68 25518 PyObject *imported_module;
jpayne@68 25519 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
jpayne@68 25520 PyObject *modules = PyImport_GetModuleDict();
jpayne@68 25521 if (unlikely(!modules))
jpayne@68 25522 return NULL;
jpayne@68 25523 imported_module = __Pyx_PyDict_GetItemStr(modules, name);
jpayne@68 25524 Py_XINCREF(imported_module);
jpayne@68 25525 #else
jpayne@68 25526 imported_module = PyImport_GetModule(name);
jpayne@68 25527 #endif
jpayne@68 25528 return imported_module;
jpayne@68 25529 }
jpayne@68 25530 #endif
jpayne@68 25531 #if PY_MAJOR_VERSION >= 3
jpayne@68 25532 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
jpayne@68 25533 Py_ssize_t i, nparts;
jpayne@68 25534 nparts = PyTuple_GET_SIZE(parts_tuple);
jpayne@68 25535 for (i=1; i < nparts && module; i++) {
jpayne@68 25536 PyObject *part, *submodule;
jpayne@68 25537 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 25538 part = PyTuple_GET_ITEM(parts_tuple, i);
jpayne@68 25539 #else
jpayne@68 25540 part = PySequence_ITEM(parts_tuple, i);
jpayne@68 25541 #endif
jpayne@68 25542 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
jpayne@68 25543 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
jpayne@68 25544 Py_DECREF(part);
jpayne@68 25545 #endif
jpayne@68 25546 Py_DECREF(module);
jpayne@68 25547 module = submodule;
jpayne@68 25548 }
jpayne@68 25549 if (unlikely(!module)) {
jpayne@68 25550 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
jpayne@68 25551 }
jpayne@68 25552 return module;
jpayne@68 25553 }
jpayne@68 25554 #endif
jpayne@68 25555 static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
jpayne@68 25556 #if PY_MAJOR_VERSION < 3
jpayne@68 25557 PyObject *module, *from_list, *star = __pyx_n_s__58;
jpayne@68 25558 CYTHON_UNUSED_VAR(parts_tuple);
jpayne@68 25559 from_list = PyList_New(1);
jpayne@68 25560 if (unlikely(!from_list))
jpayne@68 25561 return NULL;
jpayne@68 25562 Py_INCREF(star);
jpayne@68 25563 PyList_SET_ITEM(from_list, 0, star);
jpayne@68 25564 module = __Pyx_Import(name, from_list, 0);
jpayne@68 25565 Py_DECREF(from_list);
jpayne@68 25566 return module;
jpayne@68 25567 #else
jpayne@68 25568 PyObject *imported_module;
jpayne@68 25569 PyObject *module = __Pyx_Import(name, NULL, 0);
jpayne@68 25570 if (!parts_tuple || unlikely(!module))
jpayne@68 25571 return module;
jpayne@68 25572 imported_module = __Pyx__ImportDottedModule_Lookup(name);
jpayne@68 25573 if (likely(imported_module)) {
jpayne@68 25574 Py_DECREF(module);
jpayne@68 25575 return imported_module;
jpayne@68 25576 }
jpayne@68 25577 PyErr_Clear();
jpayne@68 25578 return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
jpayne@68 25579 #endif
jpayne@68 25580 }
jpayne@68 25581 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
jpayne@68 25582 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
jpayne@68 25583 PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
jpayne@68 25584 if (likely(module)) {
jpayne@68 25585 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
jpayne@68 25586 if (likely(spec)) {
jpayne@68 25587 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
jpayne@68 25588 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
jpayne@68 25589 Py_DECREF(spec);
jpayne@68 25590 spec = NULL;
jpayne@68 25591 }
jpayne@68 25592 Py_XDECREF(unsafe);
jpayne@68 25593 }
jpayne@68 25594 if (likely(!spec)) {
jpayne@68 25595 PyErr_Clear();
jpayne@68 25596 return module;
jpayne@68 25597 }
jpayne@68 25598 Py_DECREF(spec);
jpayne@68 25599 Py_DECREF(module);
jpayne@68 25600 } else if (PyErr_Occurred()) {
jpayne@68 25601 PyErr_Clear();
jpayne@68 25602 }
jpayne@68 25603 #endif
jpayne@68 25604 return __Pyx__ImportDottedModule(name, parts_tuple);
jpayne@68 25605 }
jpayne@68 25606
jpayne@68 25607 /* ImportFrom */
jpayne@68 25608 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
jpayne@68 25609 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
jpayne@68 25610 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
jpayne@68 25611 const char* module_name_str = 0;
jpayne@68 25612 PyObject* module_name = 0;
jpayne@68 25613 PyObject* module_dot = 0;
jpayne@68 25614 PyObject* full_name = 0;
jpayne@68 25615 PyErr_Clear();
jpayne@68 25616 module_name_str = PyModule_GetName(module);
jpayne@68 25617 if (unlikely(!module_name_str)) { goto modbad; }
jpayne@68 25618 module_name = PyUnicode_FromString(module_name_str);
jpayne@68 25619 if (unlikely(!module_name)) { goto modbad; }
jpayne@68 25620 module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__59);
jpayne@68 25621 if (unlikely(!module_dot)) { goto modbad; }
jpayne@68 25622 full_name = PyUnicode_Concat(module_dot, name);
jpayne@68 25623 if (unlikely(!full_name)) { goto modbad; }
jpayne@68 25624 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
jpayne@68 25625 {
jpayne@68 25626 PyObject *modules = PyImport_GetModuleDict();
jpayne@68 25627 if (unlikely(!modules))
jpayne@68 25628 goto modbad;
jpayne@68 25629 value = PyObject_GetItem(modules, full_name);
jpayne@68 25630 }
jpayne@68 25631 #else
jpayne@68 25632 value = PyImport_GetModule(full_name);
jpayne@68 25633 #endif
jpayne@68 25634 modbad:
jpayne@68 25635 Py_XDECREF(full_name);
jpayne@68 25636 Py_XDECREF(module_dot);
jpayne@68 25637 Py_XDECREF(module_name);
jpayne@68 25638 }
jpayne@68 25639 if (unlikely(!value)) {
jpayne@68 25640 PyErr_Format(PyExc_ImportError,
jpayne@68 25641 #if PY_MAJOR_VERSION < 3
jpayne@68 25642 "cannot import name %.230s", PyString_AS_STRING(name));
jpayne@68 25643 #else
jpayne@68 25644 "cannot import name %S", name);
jpayne@68 25645 #endif
jpayne@68 25646 }
jpayne@68 25647 return value;
jpayne@68 25648 }
jpayne@68 25649
jpayne@68 25650 /* FetchSharedCythonModule */
jpayne@68 25651 static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
jpayne@68 25652 return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
jpayne@68 25653 }
jpayne@68 25654
jpayne@68 25655 /* FetchCommonType */
jpayne@68 25656 static int __Pyx_VerifyCachedType(PyObject *cached_type,
jpayne@68 25657 const char *name,
jpayne@68 25658 Py_ssize_t basicsize,
jpayne@68 25659 Py_ssize_t expected_basicsize) {
jpayne@68 25660 if (!PyType_Check(cached_type)) {
jpayne@68 25661 PyErr_Format(PyExc_TypeError,
jpayne@68 25662 "Shared Cython type %.200s is not a type object", name);
jpayne@68 25663 return -1;
jpayne@68 25664 }
jpayne@68 25665 if (basicsize != expected_basicsize) {
jpayne@68 25666 PyErr_Format(PyExc_TypeError,
jpayne@68 25667 "Shared Cython type %.200s has the wrong size, try recompiling",
jpayne@68 25668 name);
jpayne@68 25669 return -1;
jpayne@68 25670 }
jpayne@68 25671 return 0;
jpayne@68 25672 }
jpayne@68 25673 #if !CYTHON_USE_TYPE_SPECS
jpayne@68 25674 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
jpayne@68 25675 PyObject* abi_module;
jpayne@68 25676 const char* object_name;
jpayne@68 25677 PyTypeObject *cached_type = NULL;
jpayne@68 25678 abi_module = __Pyx_FetchSharedCythonABIModule();
jpayne@68 25679 if (!abi_module) return NULL;
jpayne@68 25680 object_name = strrchr(type->tp_name, '.');
jpayne@68 25681 object_name = object_name ? object_name+1 : type->tp_name;
jpayne@68 25682 cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
jpayne@68 25683 if (cached_type) {
jpayne@68 25684 if (__Pyx_VerifyCachedType(
jpayne@68 25685 (PyObject *)cached_type,
jpayne@68 25686 object_name,
jpayne@68 25687 cached_type->tp_basicsize,
jpayne@68 25688 type->tp_basicsize) < 0) {
jpayne@68 25689 goto bad;
jpayne@68 25690 }
jpayne@68 25691 goto done;
jpayne@68 25692 }
jpayne@68 25693 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
jpayne@68 25694 PyErr_Clear();
jpayne@68 25695 if (PyType_Ready(type) < 0) goto bad;
jpayne@68 25696 if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
jpayne@68 25697 goto bad;
jpayne@68 25698 Py_INCREF(type);
jpayne@68 25699 cached_type = type;
jpayne@68 25700 done:
jpayne@68 25701 Py_DECREF(abi_module);
jpayne@68 25702 return cached_type;
jpayne@68 25703 bad:
jpayne@68 25704 Py_XDECREF(cached_type);
jpayne@68 25705 cached_type = NULL;
jpayne@68 25706 goto done;
jpayne@68 25707 }
jpayne@68 25708 #else
jpayne@68 25709 static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
jpayne@68 25710 PyObject *abi_module, *cached_type = NULL;
jpayne@68 25711 const char* object_name = strrchr(spec->name, '.');
jpayne@68 25712 object_name = object_name ? object_name+1 : spec->name;
jpayne@68 25713 abi_module = __Pyx_FetchSharedCythonABIModule();
jpayne@68 25714 if (!abi_module) return NULL;
jpayne@68 25715 cached_type = PyObject_GetAttrString(abi_module, object_name);
jpayne@68 25716 if (cached_type) {
jpayne@68 25717 Py_ssize_t basicsize;
jpayne@68 25718 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25719 PyObject *py_basicsize;
jpayne@68 25720 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
jpayne@68 25721 if (unlikely(!py_basicsize)) goto bad;
jpayne@68 25722 basicsize = PyLong_AsSsize_t(py_basicsize);
jpayne@68 25723 Py_DECREF(py_basicsize);
jpayne@68 25724 py_basicsize = 0;
jpayne@68 25725 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
jpayne@68 25726 #else
jpayne@68 25727 basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
jpayne@68 25728 #endif
jpayne@68 25729 if (__Pyx_VerifyCachedType(
jpayne@68 25730 cached_type,
jpayne@68 25731 object_name,
jpayne@68 25732 basicsize,
jpayne@68 25733 spec->basicsize) < 0) {
jpayne@68 25734 goto bad;
jpayne@68 25735 }
jpayne@68 25736 goto done;
jpayne@68 25737 }
jpayne@68 25738 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
jpayne@68 25739 PyErr_Clear();
jpayne@68 25740 CYTHON_UNUSED_VAR(module);
jpayne@68 25741 cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
jpayne@68 25742 if (unlikely(!cached_type)) goto bad;
jpayne@68 25743 if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
jpayne@68 25744 if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
jpayne@68 25745 done:
jpayne@68 25746 Py_DECREF(abi_module);
jpayne@68 25747 assert(cached_type == NULL || PyType_Check(cached_type));
jpayne@68 25748 return (PyTypeObject *) cached_type;
jpayne@68 25749 bad:
jpayne@68 25750 Py_XDECREF(cached_type);
jpayne@68 25751 cached_type = NULL;
jpayne@68 25752 goto done;
jpayne@68 25753 }
jpayne@68 25754 #endif
jpayne@68 25755
jpayne@68 25756 /* PyVectorcallFastCallDict */
jpayne@68 25757 #if CYTHON_METH_FASTCALL
jpayne@68 25758 static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
jpayne@68 25759 {
jpayne@68 25760 PyObject *res = NULL;
jpayne@68 25761 PyObject *kwnames;
jpayne@68 25762 PyObject **newargs;
jpayne@68 25763 PyObject **kwvalues;
jpayne@68 25764 Py_ssize_t i, pos;
jpayne@68 25765 size_t j;
jpayne@68 25766 PyObject *key, *value;
jpayne@68 25767 unsigned long keys_are_strings;
jpayne@68 25768 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
jpayne@68 25769 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
jpayne@68 25770 if (unlikely(newargs == NULL)) {
jpayne@68 25771 PyErr_NoMemory();
jpayne@68 25772 return NULL;
jpayne@68 25773 }
jpayne@68 25774 for (j = 0; j < nargs; j++) newargs[j] = args[j];
jpayne@68 25775 kwnames = PyTuple_New(nkw);
jpayne@68 25776 if (unlikely(kwnames == NULL)) {
jpayne@68 25777 PyMem_Free(newargs);
jpayne@68 25778 return NULL;
jpayne@68 25779 }
jpayne@68 25780 kwvalues = newargs + nargs;
jpayne@68 25781 pos = i = 0;
jpayne@68 25782 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
jpayne@68 25783 while (PyDict_Next(kw, &pos, &key, &value)) {
jpayne@68 25784 keys_are_strings &= Py_TYPE(key)->tp_flags;
jpayne@68 25785 Py_INCREF(key);
jpayne@68 25786 Py_INCREF(value);
jpayne@68 25787 PyTuple_SET_ITEM(kwnames, i, key);
jpayne@68 25788 kwvalues[i] = value;
jpayne@68 25789 i++;
jpayne@68 25790 }
jpayne@68 25791 if (unlikely(!keys_are_strings)) {
jpayne@68 25792 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
jpayne@68 25793 goto cleanup;
jpayne@68 25794 }
jpayne@68 25795 res = vc(func, newargs, nargs, kwnames);
jpayne@68 25796 cleanup:
jpayne@68 25797 Py_DECREF(kwnames);
jpayne@68 25798 for (i = 0; i < nkw; i++)
jpayne@68 25799 Py_DECREF(kwvalues[i]);
jpayne@68 25800 PyMem_Free(newargs);
jpayne@68 25801 return res;
jpayne@68 25802 }
jpayne@68 25803 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
jpayne@68 25804 {
jpayne@68 25805 if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
jpayne@68 25806 return vc(func, args, nargs, NULL);
jpayne@68 25807 }
jpayne@68 25808 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
jpayne@68 25809 }
jpayne@68 25810 #endif
jpayne@68 25811
jpayne@68 25812 /* CythonFunctionShared */
jpayne@68 25813 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25814 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
jpayne@68 25815 if (__Pyx_CyFunction_Check(func)) {
jpayne@68 25816 return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
jpayne@68 25817 } else if (PyCFunction_Check(func)) {
jpayne@68 25818 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
jpayne@68 25819 }
jpayne@68 25820 return 0;
jpayne@68 25821 }
jpayne@68 25822 #else
jpayne@68 25823 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
jpayne@68 25824 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
jpayne@68 25825 }
jpayne@68 25826 #endif
jpayne@68 25827 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
jpayne@68 25828 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25829 __Pyx_Py_XDECREF_SET(
jpayne@68 25830 __Pyx_CyFunction_GetClassObj(f),
jpayne@68 25831 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
jpayne@68 25832 #else
jpayne@68 25833 __Pyx_Py_XDECREF_SET(
jpayne@68 25834 ((PyCMethodObject *) (f))->mm_class,
jpayne@68 25835 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
jpayne@68 25836 #endif
jpayne@68 25837 }
jpayne@68 25838 static PyObject *
jpayne@68 25839 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
jpayne@68 25840 {
jpayne@68 25841 CYTHON_UNUSED_VAR(closure);
jpayne@68 25842 if (unlikely(op->func_doc == NULL)) {
jpayne@68 25843 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25844 op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
jpayne@68 25845 if (unlikely(!op->func_doc)) return NULL;
jpayne@68 25846 #else
jpayne@68 25847 if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
jpayne@68 25848 #if PY_MAJOR_VERSION >= 3
jpayne@68 25849 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
jpayne@68 25850 #else
jpayne@68 25851 op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
jpayne@68 25852 #endif
jpayne@68 25853 if (unlikely(op->func_doc == NULL))
jpayne@68 25854 return NULL;
jpayne@68 25855 } else {
jpayne@68 25856 Py_INCREF(Py_None);
jpayne@68 25857 return Py_None;
jpayne@68 25858 }
jpayne@68 25859 #endif
jpayne@68 25860 }
jpayne@68 25861 Py_INCREF(op->func_doc);
jpayne@68 25862 return op->func_doc;
jpayne@68 25863 }
jpayne@68 25864 static int
jpayne@68 25865 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
jpayne@68 25866 {
jpayne@68 25867 CYTHON_UNUSED_VAR(context);
jpayne@68 25868 if (value == NULL) {
jpayne@68 25869 value = Py_None;
jpayne@68 25870 }
jpayne@68 25871 Py_INCREF(value);
jpayne@68 25872 __Pyx_Py_XDECREF_SET(op->func_doc, value);
jpayne@68 25873 return 0;
jpayne@68 25874 }
jpayne@68 25875 static PyObject *
jpayne@68 25876 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
jpayne@68 25877 {
jpayne@68 25878 CYTHON_UNUSED_VAR(context);
jpayne@68 25879 if (unlikely(op->func_name == NULL)) {
jpayne@68 25880 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 25881 op->func_name = PyObject_GetAttrString(op->func, "__name__");
jpayne@68 25882 #elif PY_MAJOR_VERSION >= 3
jpayne@68 25883 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
jpayne@68 25884 #else
jpayne@68 25885 op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
jpayne@68 25886 #endif
jpayne@68 25887 if (unlikely(op->func_name == NULL))
jpayne@68 25888 return NULL;
jpayne@68 25889 }
jpayne@68 25890 Py_INCREF(op->func_name);
jpayne@68 25891 return op->func_name;
jpayne@68 25892 }
jpayne@68 25893 static int
jpayne@68 25894 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
jpayne@68 25895 {
jpayne@68 25896 CYTHON_UNUSED_VAR(context);
jpayne@68 25897 #if PY_MAJOR_VERSION >= 3
jpayne@68 25898 if (unlikely(value == NULL || !PyUnicode_Check(value)))
jpayne@68 25899 #else
jpayne@68 25900 if (unlikely(value == NULL || !PyString_Check(value)))
jpayne@68 25901 #endif
jpayne@68 25902 {
jpayne@68 25903 PyErr_SetString(PyExc_TypeError,
jpayne@68 25904 "__name__ must be set to a string object");
jpayne@68 25905 return -1;
jpayne@68 25906 }
jpayne@68 25907 Py_INCREF(value);
jpayne@68 25908 __Pyx_Py_XDECREF_SET(op->func_name, value);
jpayne@68 25909 return 0;
jpayne@68 25910 }
jpayne@68 25911 static PyObject *
jpayne@68 25912 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
jpayne@68 25913 {
jpayne@68 25914 CYTHON_UNUSED_VAR(context);
jpayne@68 25915 Py_INCREF(op->func_qualname);
jpayne@68 25916 return op->func_qualname;
jpayne@68 25917 }
jpayne@68 25918 static int
jpayne@68 25919 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
jpayne@68 25920 {
jpayne@68 25921 CYTHON_UNUSED_VAR(context);
jpayne@68 25922 #if PY_MAJOR_VERSION >= 3
jpayne@68 25923 if (unlikely(value == NULL || !PyUnicode_Check(value)))
jpayne@68 25924 #else
jpayne@68 25925 if (unlikely(value == NULL || !PyString_Check(value)))
jpayne@68 25926 #endif
jpayne@68 25927 {
jpayne@68 25928 PyErr_SetString(PyExc_TypeError,
jpayne@68 25929 "__qualname__ must be set to a string object");
jpayne@68 25930 return -1;
jpayne@68 25931 }
jpayne@68 25932 Py_INCREF(value);
jpayne@68 25933 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
jpayne@68 25934 return 0;
jpayne@68 25935 }
jpayne@68 25936 static PyObject *
jpayne@68 25937 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
jpayne@68 25938 {
jpayne@68 25939 CYTHON_UNUSED_VAR(context);
jpayne@68 25940 if (unlikely(op->func_dict == NULL)) {
jpayne@68 25941 op->func_dict = PyDict_New();
jpayne@68 25942 if (unlikely(op->func_dict == NULL))
jpayne@68 25943 return NULL;
jpayne@68 25944 }
jpayne@68 25945 Py_INCREF(op->func_dict);
jpayne@68 25946 return op->func_dict;
jpayne@68 25947 }
jpayne@68 25948 static int
jpayne@68 25949 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
jpayne@68 25950 {
jpayne@68 25951 CYTHON_UNUSED_VAR(context);
jpayne@68 25952 if (unlikely(value == NULL)) {
jpayne@68 25953 PyErr_SetString(PyExc_TypeError,
jpayne@68 25954 "function's dictionary may not be deleted");
jpayne@68 25955 return -1;
jpayne@68 25956 }
jpayne@68 25957 if (unlikely(!PyDict_Check(value))) {
jpayne@68 25958 PyErr_SetString(PyExc_TypeError,
jpayne@68 25959 "setting function's dictionary to a non-dict");
jpayne@68 25960 return -1;
jpayne@68 25961 }
jpayne@68 25962 Py_INCREF(value);
jpayne@68 25963 __Pyx_Py_XDECREF_SET(op->func_dict, value);
jpayne@68 25964 return 0;
jpayne@68 25965 }
jpayne@68 25966 static PyObject *
jpayne@68 25967 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
jpayne@68 25968 {
jpayne@68 25969 CYTHON_UNUSED_VAR(context);
jpayne@68 25970 Py_INCREF(op->func_globals);
jpayne@68 25971 return op->func_globals;
jpayne@68 25972 }
jpayne@68 25973 static PyObject *
jpayne@68 25974 __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
jpayne@68 25975 {
jpayne@68 25976 CYTHON_UNUSED_VAR(op);
jpayne@68 25977 CYTHON_UNUSED_VAR(context);
jpayne@68 25978 Py_INCREF(Py_None);
jpayne@68 25979 return Py_None;
jpayne@68 25980 }
jpayne@68 25981 static PyObject *
jpayne@68 25982 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
jpayne@68 25983 {
jpayne@68 25984 PyObject* result = (op->func_code) ? op->func_code : Py_None;
jpayne@68 25985 CYTHON_UNUSED_VAR(context);
jpayne@68 25986 Py_INCREF(result);
jpayne@68 25987 return result;
jpayne@68 25988 }
jpayne@68 25989 static int
jpayne@68 25990 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
jpayne@68 25991 int result = 0;
jpayne@68 25992 PyObject *res = op->defaults_getter((PyObject *) op);
jpayne@68 25993 if (unlikely(!res))
jpayne@68 25994 return -1;
jpayne@68 25995 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 25996 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
jpayne@68 25997 Py_INCREF(op->defaults_tuple);
jpayne@68 25998 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
jpayne@68 25999 Py_INCREF(op->defaults_kwdict);
jpayne@68 26000 #else
jpayne@68 26001 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
jpayne@68 26002 if (unlikely(!op->defaults_tuple)) result = -1;
jpayne@68 26003 else {
jpayne@68 26004 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
jpayne@68 26005 if (unlikely(!op->defaults_kwdict)) result = -1;
jpayne@68 26006 }
jpayne@68 26007 #endif
jpayne@68 26008 Py_DECREF(res);
jpayne@68 26009 return result;
jpayne@68 26010 }
jpayne@68 26011 static int
jpayne@68 26012 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
jpayne@68 26013 CYTHON_UNUSED_VAR(context);
jpayne@68 26014 if (!value) {
jpayne@68 26015 value = Py_None;
jpayne@68 26016 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
jpayne@68 26017 PyErr_SetString(PyExc_TypeError,
jpayne@68 26018 "__defaults__ must be set to a tuple object");
jpayne@68 26019 return -1;
jpayne@68 26020 }
jpayne@68 26021 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
jpayne@68 26022 "currently affect the values used in function calls", 1);
jpayne@68 26023 Py_INCREF(value);
jpayne@68 26024 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
jpayne@68 26025 return 0;
jpayne@68 26026 }
jpayne@68 26027 static PyObject *
jpayne@68 26028 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
jpayne@68 26029 PyObject* result = op->defaults_tuple;
jpayne@68 26030 CYTHON_UNUSED_VAR(context);
jpayne@68 26031 if (unlikely(!result)) {
jpayne@68 26032 if (op->defaults_getter) {
jpayne@68 26033 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
jpayne@68 26034 result = op->defaults_tuple;
jpayne@68 26035 } else {
jpayne@68 26036 result = Py_None;
jpayne@68 26037 }
jpayne@68 26038 }
jpayne@68 26039 Py_INCREF(result);
jpayne@68 26040 return result;
jpayne@68 26041 }
jpayne@68 26042 static int
jpayne@68 26043 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
jpayne@68 26044 CYTHON_UNUSED_VAR(context);
jpayne@68 26045 if (!value) {
jpayne@68 26046 value = Py_None;
jpayne@68 26047 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
jpayne@68 26048 PyErr_SetString(PyExc_TypeError,
jpayne@68 26049 "__kwdefaults__ must be set to a dict object");
jpayne@68 26050 return -1;
jpayne@68 26051 }
jpayne@68 26052 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
jpayne@68 26053 "currently affect the values used in function calls", 1);
jpayne@68 26054 Py_INCREF(value);
jpayne@68 26055 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
jpayne@68 26056 return 0;
jpayne@68 26057 }
jpayne@68 26058 static PyObject *
jpayne@68 26059 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
jpayne@68 26060 PyObject* result = op->defaults_kwdict;
jpayne@68 26061 CYTHON_UNUSED_VAR(context);
jpayne@68 26062 if (unlikely(!result)) {
jpayne@68 26063 if (op->defaults_getter) {
jpayne@68 26064 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
jpayne@68 26065 result = op->defaults_kwdict;
jpayne@68 26066 } else {
jpayne@68 26067 result = Py_None;
jpayne@68 26068 }
jpayne@68 26069 }
jpayne@68 26070 Py_INCREF(result);
jpayne@68 26071 return result;
jpayne@68 26072 }
jpayne@68 26073 static int
jpayne@68 26074 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
jpayne@68 26075 CYTHON_UNUSED_VAR(context);
jpayne@68 26076 if (!value || value == Py_None) {
jpayne@68 26077 value = NULL;
jpayne@68 26078 } else if (unlikely(!PyDict_Check(value))) {
jpayne@68 26079 PyErr_SetString(PyExc_TypeError,
jpayne@68 26080 "__annotations__ must be set to a dict object");
jpayne@68 26081 return -1;
jpayne@68 26082 }
jpayne@68 26083 Py_XINCREF(value);
jpayne@68 26084 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
jpayne@68 26085 return 0;
jpayne@68 26086 }
jpayne@68 26087 static PyObject *
jpayne@68 26088 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
jpayne@68 26089 PyObject* result = op->func_annotations;
jpayne@68 26090 CYTHON_UNUSED_VAR(context);
jpayne@68 26091 if (unlikely(!result)) {
jpayne@68 26092 result = PyDict_New();
jpayne@68 26093 if (unlikely(!result)) return NULL;
jpayne@68 26094 op->func_annotations = result;
jpayne@68 26095 }
jpayne@68 26096 Py_INCREF(result);
jpayne@68 26097 return result;
jpayne@68 26098 }
jpayne@68 26099 static PyObject *
jpayne@68 26100 __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
jpayne@68 26101 int is_coroutine;
jpayne@68 26102 CYTHON_UNUSED_VAR(context);
jpayne@68 26103 if (op->func_is_coroutine) {
jpayne@68 26104 return __Pyx_NewRef(op->func_is_coroutine);
jpayne@68 26105 }
jpayne@68 26106 is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
jpayne@68 26107 #if PY_VERSION_HEX >= 0x03050000
jpayne@68 26108 if (is_coroutine) {
jpayne@68 26109 PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
jpayne@68 26110 fromlist = PyList_New(1);
jpayne@68 26111 if (unlikely(!fromlist)) return NULL;
jpayne@68 26112 Py_INCREF(marker);
jpayne@68 26113 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 26114 PyList_SET_ITEM(fromlist, 0, marker);
jpayne@68 26115 #else
jpayne@68 26116 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
jpayne@68 26117 Py_DECREF(marker);
jpayne@68 26118 Py_DECREF(fromlist);
jpayne@68 26119 return NULL;
jpayne@68 26120 }
jpayne@68 26121 #endif
jpayne@68 26122 module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
jpayne@68 26123 Py_DECREF(fromlist);
jpayne@68 26124 if (unlikely(!module)) goto ignore;
jpayne@68 26125 op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
jpayne@68 26126 Py_DECREF(module);
jpayne@68 26127 if (likely(op->func_is_coroutine)) {
jpayne@68 26128 return __Pyx_NewRef(op->func_is_coroutine);
jpayne@68 26129 }
jpayne@68 26130 ignore:
jpayne@68 26131 PyErr_Clear();
jpayne@68 26132 }
jpayne@68 26133 #endif
jpayne@68 26134 op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
jpayne@68 26135 return __Pyx_NewRef(op->func_is_coroutine);
jpayne@68 26136 }
jpayne@68 26137 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26138 static PyObject *
jpayne@68 26139 __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
jpayne@68 26140 CYTHON_UNUSED_VAR(context);
jpayne@68 26141 return PyObject_GetAttrString(op->func, "__module__");
jpayne@68 26142 }
jpayne@68 26143 static int
jpayne@68 26144 __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
jpayne@68 26145 CYTHON_UNUSED_VAR(context);
jpayne@68 26146 return PyObject_SetAttrString(op->func, "__module__", value);
jpayne@68 26147 }
jpayne@68 26148 #endif
jpayne@68 26149 static PyGetSetDef __pyx_CyFunction_getsets[] = {
jpayne@68 26150 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
jpayne@68 26151 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
jpayne@68 26152 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
jpayne@68 26153 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
jpayne@68 26154 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
jpayne@68 26155 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
jpayne@68 26156 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
jpayne@68 26157 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
jpayne@68 26158 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
jpayne@68 26159 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
jpayne@68 26160 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
jpayne@68 26161 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
jpayne@68 26162 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
jpayne@68 26163 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
jpayne@68 26164 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
jpayne@68 26165 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
jpayne@68 26166 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
jpayne@68 26167 {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
jpayne@68 26168 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26169 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
jpayne@68 26170 #endif
jpayne@68 26171 {0, 0, 0, 0, 0}
jpayne@68 26172 };
jpayne@68 26173 static PyMemberDef __pyx_CyFunction_members[] = {
jpayne@68 26174 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26175 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
jpayne@68 26176 #endif
jpayne@68 26177 #if CYTHON_USE_TYPE_SPECS
jpayne@68 26178 {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
jpayne@68 26179 #if CYTHON_METH_FASTCALL
jpayne@68 26180 #if CYTHON_BACKPORT_VECTORCALL
jpayne@68 26181 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
jpayne@68 26182 #else
jpayne@68 26183 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26184 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
jpayne@68 26185 #endif
jpayne@68 26186 #endif
jpayne@68 26187 #endif
jpayne@68 26188 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26189 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
jpayne@68 26190 #else
jpayne@68 26191 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
jpayne@68 26192 #endif
jpayne@68 26193 #endif
jpayne@68 26194 {0, 0, 0, 0, 0}
jpayne@68 26195 };
jpayne@68 26196 static PyObject *
jpayne@68 26197 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
jpayne@68 26198 {
jpayne@68 26199 CYTHON_UNUSED_VAR(args);
jpayne@68 26200 #if PY_MAJOR_VERSION >= 3
jpayne@68 26201 Py_INCREF(m->func_qualname);
jpayne@68 26202 return m->func_qualname;
jpayne@68 26203 #else
jpayne@68 26204 return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
jpayne@68 26205 #endif
jpayne@68 26206 }
jpayne@68 26207 static PyMethodDef __pyx_CyFunction_methods[] = {
jpayne@68 26208 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
jpayne@68 26209 {0, 0, 0, 0}
jpayne@68 26210 };
jpayne@68 26211 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26212 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
jpayne@68 26213 #else
jpayne@68 26214 #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
jpayne@68 26215 #endif
jpayne@68 26216 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
jpayne@68 26217 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
jpayne@68 26218 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26219 PyCFunctionObject *cf = (PyCFunctionObject*) op;
jpayne@68 26220 #endif
jpayne@68 26221 if (unlikely(op == NULL))
jpayne@68 26222 return NULL;
jpayne@68 26223 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26224 op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
jpayne@68 26225 if (unlikely(!op->func)) return NULL;
jpayne@68 26226 #endif
jpayne@68 26227 op->flags = flags;
jpayne@68 26228 __Pyx_CyFunction_weakreflist(op) = NULL;
jpayne@68 26229 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26230 cf->m_ml = ml;
jpayne@68 26231 cf->m_self = (PyObject *) op;
jpayne@68 26232 #endif
jpayne@68 26233 Py_XINCREF(closure);
jpayne@68 26234 op->func_closure = closure;
jpayne@68 26235 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26236 Py_XINCREF(module);
jpayne@68 26237 cf->m_module = module;
jpayne@68 26238 #endif
jpayne@68 26239 op->func_dict = NULL;
jpayne@68 26240 op->func_name = NULL;
jpayne@68 26241 Py_INCREF(qualname);
jpayne@68 26242 op->func_qualname = qualname;
jpayne@68 26243 op->func_doc = NULL;
jpayne@68 26244 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26245 op->func_classobj = NULL;
jpayne@68 26246 #else
jpayne@68 26247 ((PyCMethodObject*)op)->mm_class = NULL;
jpayne@68 26248 #endif
jpayne@68 26249 op->func_globals = globals;
jpayne@68 26250 Py_INCREF(op->func_globals);
jpayne@68 26251 Py_XINCREF(code);
jpayne@68 26252 op->func_code = code;
jpayne@68 26253 op->defaults_pyobjects = 0;
jpayne@68 26254 op->defaults_size = 0;
jpayne@68 26255 op->defaults = NULL;
jpayne@68 26256 op->defaults_tuple = NULL;
jpayne@68 26257 op->defaults_kwdict = NULL;
jpayne@68 26258 op->defaults_getter = NULL;
jpayne@68 26259 op->func_annotations = NULL;
jpayne@68 26260 op->func_is_coroutine = NULL;
jpayne@68 26261 #if CYTHON_METH_FASTCALL
jpayne@68 26262 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
jpayne@68 26263 case METH_NOARGS:
jpayne@68 26264 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
jpayne@68 26265 break;
jpayne@68 26266 case METH_O:
jpayne@68 26267 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
jpayne@68 26268 break;
jpayne@68 26269 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
jpayne@68 26270 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
jpayne@68 26271 break;
jpayne@68 26272 case METH_FASTCALL | METH_KEYWORDS:
jpayne@68 26273 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
jpayne@68 26274 break;
jpayne@68 26275 case METH_VARARGS | METH_KEYWORDS:
jpayne@68 26276 __Pyx_CyFunction_func_vectorcall(op) = NULL;
jpayne@68 26277 break;
jpayne@68 26278 default:
jpayne@68 26279 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
jpayne@68 26280 Py_DECREF(op);
jpayne@68 26281 return NULL;
jpayne@68 26282 }
jpayne@68 26283 #endif
jpayne@68 26284 return (PyObject *) op;
jpayne@68 26285 }
jpayne@68 26286 static int
jpayne@68 26287 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
jpayne@68 26288 {
jpayne@68 26289 Py_CLEAR(m->func_closure);
jpayne@68 26290 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26291 Py_CLEAR(m->func);
jpayne@68 26292 #else
jpayne@68 26293 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
jpayne@68 26294 #endif
jpayne@68 26295 Py_CLEAR(m->func_dict);
jpayne@68 26296 Py_CLEAR(m->func_name);
jpayne@68 26297 Py_CLEAR(m->func_qualname);
jpayne@68 26298 Py_CLEAR(m->func_doc);
jpayne@68 26299 Py_CLEAR(m->func_globals);
jpayne@68 26300 Py_CLEAR(m->func_code);
jpayne@68 26301 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26302 #if PY_VERSION_HEX < 0x030900B1
jpayne@68 26303 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
jpayne@68 26304 #else
jpayne@68 26305 {
jpayne@68 26306 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
jpayne@68 26307 ((PyCMethodObject *) (m))->mm_class = NULL;
jpayne@68 26308 Py_XDECREF(cls);
jpayne@68 26309 }
jpayne@68 26310 #endif
jpayne@68 26311 #endif
jpayne@68 26312 Py_CLEAR(m->defaults_tuple);
jpayne@68 26313 Py_CLEAR(m->defaults_kwdict);
jpayne@68 26314 Py_CLEAR(m->func_annotations);
jpayne@68 26315 Py_CLEAR(m->func_is_coroutine);
jpayne@68 26316 if (m->defaults) {
jpayne@68 26317 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
jpayne@68 26318 int i;
jpayne@68 26319 for (i = 0; i < m->defaults_pyobjects; i++)
jpayne@68 26320 Py_XDECREF(pydefaults[i]);
jpayne@68 26321 PyObject_Free(m->defaults);
jpayne@68 26322 m->defaults = NULL;
jpayne@68 26323 }
jpayne@68 26324 return 0;
jpayne@68 26325 }
jpayne@68 26326 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
jpayne@68 26327 {
jpayne@68 26328 if (__Pyx_CyFunction_weakreflist(m) != NULL)
jpayne@68 26329 PyObject_ClearWeakRefs((PyObject *) m);
jpayne@68 26330 __Pyx_CyFunction_clear(m);
jpayne@68 26331 __Pyx_PyHeapTypeObject_GC_Del(m);
jpayne@68 26332 }
jpayne@68 26333 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
jpayne@68 26334 {
jpayne@68 26335 PyObject_GC_UnTrack(m);
jpayne@68 26336 __Pyx__CyFunction_dealloc(m);
jpayne@68 26337 }
jpayne@68 26338 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
jpayne@68 26339 {
jpayne@68 26340 Py_VISIT(m->func_closure);
jpayne@68 26341 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26342 Py_VISIT(m->func);
jpayne@68 26343 #else
jpayne@68 26344 Py_VISIT(((PyCFunctionObject*)m)->m_module);
jpayne@68 26345 #endif
jpayne@68 26346 Py_VISIT(m->func_dict);
jpayne@68 26347 Py_VISIT(m->func_name);
jpayne@68 26348 Py_VISIT(m->func_qualname);
jpayne@68 26349 Py_VISIT(m->func_doc);
jpayne@68 26350 Py_VISIT(m->func_globals);
jpayne@68 26351 Py_VISIT(m->func_code);
jpayne@68 26352 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26353 Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
jpayne@68 26354 #endif
jpayne@68 26355 Py_VISIT(m->defaults_tuple);
jpayne@68 26356 Py_VISIT(m->defaults_kwdict);
jpayne@68 26357 Py_VISIT(m->func_is_coroutine);
jpayne@68 26358 if (m->defaults) {
jpayne@68 26359 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
jpayne@68 26360 int i;
jpayne@68 26361 for (i = 0; i < m->defaults_pyobjects; i++)
jpayne@68 26362 Py_VISIT(pydefaults[i]);
jpayne@68 26363 }
jpayne@68 26364 return 0;
jpayne@68 26365 }
jpayne@68 26366 static PyObject*
jpayne@68 26367 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
jpayne@68 26368 {
jpayne@68 26369 #if PY_MAJOR_VERSION >= 3
jpayne@68 26370 return PyUnicode_FromFormat("<cyfunction %U at %p>",
jpayne@68 26371 op->func_qualname, (void *)op);
jpayne@68 26372 #else
jpayne@68 26373 return PyString_FromFormat("<cyfunction %s at %p>",
jpayne@68 26374 PyString_AsString(op->func_qualname), (void *)op);
jpayne@68 26375 #endif
jpayne@68 26376 }
jpayne@68 26377 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
jpayne@68 26378 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26379 PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
jpayne@68 26380 PyObject *py_name = NULL;
jpayne@68 26381 PyCFunction meth;
jpayne@68 26382 int flags;
jpayne@68 26383 meth = PyCFunction_GetFunction(f);
jpayne@68 26384 if (unlikely(!meth)) return NULL;
jpayne@68 26385 flags = PyCFunction_GetFlags(f);
jpayne@68 26386 if (unlikely(flags < 0)) return NULL;
jpayne@68 26387 #else
jpayne@68 26388 PyCFunctionObject* f = (PyCFunctionObject*)func;
jpayne@68 26389 PyCFunction meth = f->m_ml->ml_meth;
jpayne@68 26390 int flags = f->m_ml->ml_flags;
jpayne@68 26391 #endif
jpayne@68 26392 Py_ssize_t size;
jpayne@68 26393 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
jpayne@68 26394 case METH_VARARGS:
jpayne@68 26395 if (likely(kw == NULL || PyDict_Size(kw) == 0))
jpayne@68 26396 return (*meth)(self, arg);
jpayne@68 26397 break;
jpayne@68 26398 case METH_VARARGS | METH_KEYWORDS:
jpayne@68 26399 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
jpayne@68 26400 case METH_NOARGS:
jpayne@68 26401 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
jpayne@68 26402 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 26403 size = PyTuple_GET_SIZE(arg);
jpayne@68 26404 #else
jpayne@68 26405 size = PyTuple_Size(arg);
jpayne@68 26406 if (unlikely(size < 0)) return NULL;
jpayne@68 26407 #endif
jpayne@68 26408 if (likely(size == 0))
jpayne@68 26409 return (*meth)(self, NULL);
jpayne@68 26410 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26411 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
jpayne@68 26412 if (!py_name) return NULL;
jpayne@68 26413 PyErr_Format(PyExc_TypeError,
jpayne@68 26414 "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
jpayne@68 26415 py_name, size);
jpayne@68 26416 Py_DECREF(py_name);
jpayne@68 26417 #else
jpayne@68 26418 PyErr_Format(PyExc_TypeError,
jpayne@68 26419 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
jpayne@68 26420 f->m_ml->ml_name, size);
jpayne@68 26421 #endif
jpayne@68 26422 return NULL;
jpayne@68 26423 }
jpayne@68 26424 break;
jpayne@68 26425 case METH_O:
jpayne@68 26426 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
jpayne@68 26427 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 26428 size = PyTuple_GET_SIZE(arg);
jpayne@68 26429 #else
jpayne@68 26430 size = PyTuple_Size(arg);
jpayne@68 26431 if (unlikely(size < 0)) return NULL;
jpayne@68 26432 #endif
jpayne@68 26433 if (likely(size == 1)) {
jpayne@68 26434 PyObject *result, *arg0;
jpayne@68 26435 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 26436 arg0 = PyTuple_GET_ITEM(arg, 0);
jpayne@68 26437 #else
jpayne@68 26438 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
jpayne@68 26439 #endif
jpayne@68 26440 result = (*meth)(self, arg0);
jpayne@68 26441 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
jpayne@68 26442 Py_DECREF(arg0);
jpayne@68 26443 #endif
jpayne@68 26444 return result;
jpayne@68 26445 }
jpayne@68 26446 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26447 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
jpayne@68 26448 if (!py_name) return NULL;
jpayne@68 26449 PyErr_Format(PyExc_TypeError,
jpayne@68 26450 "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
jpayne@68 26451 py_name, size);
jpayne@68 26452 Py_DECREF(py_name);
jpayne@68 26453 #else
jpayne@68 26454 PyErr_Format(PyExc_TypeError,
jpayne@68 26455 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
jpayne@68 26456 f->m_ml->ml_name, size);
jpayne@68 26457 #endif
jpayne@68 26458 return NULL;
jpayne@68 26459 }
jpayne@68 26460 break;
jpayne@68 26461 default:
jpayne@68 26462 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
jpayne@68 26463 return NULL;
jpayne@68 26464 }
jpayne@68 26465 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26466 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
jpayne@68 26467 if (!py_name) return NULL;
jpayne@68 26468 PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
jpayne@68 26469 py_name);
jpayne@68 26470 Py_DECREF(py_name);
jpayne@68 26471 #else
jpayne@68 26472 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
jpayne@68 26473 f->m_ml->ml_name);
jpayne@68 26474 #endif
jpayne@68 26475 return NULL;
jpayne@68 26476 }
jpayne@68 26477 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
jpayne@68 26478 PyObject *self, *result;
jpayne@68 26479 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 26480 self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
jpayne@68 26481 if (unlikely(!self) && PyErr_Occurred()) return NULL;
jpayne@68 26482 #else
jpayne@68 26483 self = ((PyCFunctionObject*)func)->m_self;
jpayne@68 26484 #endif
jpayne@68 26485 result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
jpayne@68 26486 return result;
jpayne@68 26487 }
jpayne@68 26488 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
jpayne@68 26489 PyObject *result;
jpayne@68 26490 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
jpayne@68 26491 #if CYTHON_METH_FASTCALL
jpayne@68 26492 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
jpayne@68 26493 if (vc) {
jpayne@68 26494 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 26495 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
jpayne@68 26496 #else
jpayne@68 26497 (void) &__Pyx_PyVectorcall_FastCallDict;
jpayne@68 26498 return PyVectorcall_Call(func, args, kw);
jpayne@68 26499 #endif
jpayne@68 26500 }
jpayne@68 26501 #endif
jpayne@68 26502 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
jpayne@68 26503 Py_ssize_t argc;
jpayne@68 26504 PyObject *new_args;
jpayne@68 26505 PyObject *self;
jpayne@68 26506 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 26507 argc = PyTuple_GET_SIZE(args);
jpayne@68 26508 #else
jpayne@68 26509 argc = PyTuple_Size(args);
jpayne@68 26510 if (unlikely(!argc) < 0) return NULL;
jpayne@68 26511 #endif
jpayne@68 26512 new_args = PyTuple_GetSlice(args, 1, argc);
jpayne@68 26513 if (unlikely(!new_args))
jpayne@68 26514 return NULL;
jpayne@68 26515 self = PyTuple_GetItem(args, 0);
jpayne@68 26516 if (unlikely(!self)) {
jpayne@68 26517 Py_DECREF(new_args);
jpayne@68 26518 #if PY_MAJOR_VERSION > 2
jpayne@68 26519 PyErr_Format(PyExc_TypeError,
jpayne@68 26520 "unbound method %.200S() needs an argument",
jpayne@68 26521 cyfunc->func_qualname);
jpayne@68 26522 #else
jpayne@68 26523 PyErr_SetString(PyExc_TypeError,
jpayne@68 26524 "unbound method needs an argument");
jpayne@68 26525 #endif
jpayne@68 26526 return NULL;
jpayne@68 26527 }
jpayne@68 26528 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
jpayne@68 26529 Py_DECREF(new_args);
jpayne@68 26530 } else {
jpayne@68 26531 result = __Pyx_CyFunction_Call(func, args, kw);
jpayne@68 26532 }
jpayne@68 26533 return result;
jpayne@68 26534 }
jpayne@68 26535 #if CYTHON_METH_FASTCALL
jpayne@68 26536 static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
jpayne@68 26537 {
jpayne@68 26538 int ret = 0;
jpayne@68 26539 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
jpayne@68 26540 if (unlikely(nargs < 1)) {
jpayne@68 26541 PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
jpayne@68 26542 ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
jpayne@68 26543 return -1;
jpayne@68 26544 }
jpayne@68 26545 ret = 1;
jpayne@68 26546 }
jpayne@68 26547 if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
jpayne@68 26548 PyErr_Format(PyExc_TypeError,
jpayne@68 26549 "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
jpayne@68 26550 return -1;
jpayne@68 26551 }
jpayne@68 26552 return ret;
jpayne@68 26553 }
jpayne@68 26554 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
jpayne@68 26555 {
jpayne@68 26556 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
jpayne@68 26557 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
jpayne@68 26558 #if CYTHON_BACKPORT_VECTORCALL
jpayne@68 26559 Py_ssize_t nargs = (Py_ssize_t)nargsf;
jpayne@68 26560 #else
jpayne@68 26561 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
jpayne@68 26562 #endif
jpayne@68 26563 PyObject *self;
jpayne@68 26564 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
jpayne@68 26565 case 1:
jpayne@68 26566 self = args[0];
jpayne@68 26567 args += 1;
jpayne@68 26568 nargs -= 1;
jpayne@68 26569 break;
jpayne@68 26570 case 0:
jpayne@68 26571 self = ((PyCFunctionObject*)cyfunc)->m_self;
jpayne@68 26572 break;
jpayne@68 26573 default:
jpayne@68 26574 return NULL;
jpayne@68 26575 }
jpayne@68 26576 if (unlikely(nargs != 0)) {
jpayne@68 26577 PyErr_Format(PyExc_TypeError,
jpayne@68 26578 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
jpayne@68 26579 def->ml_name, nargs);
jpayne@68 26580 return NULL;
jpayne@68 26581 }
jpayne@68 26582 return def->ml_meth(self, NULL);
jpayne@68 26583 }
jpayne@68 26584 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
jpayne@68 26585 {
jpayne@68 26586 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
jpayne@68 26587 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
jpayne@68 26588 #if CYTHON_BACKPORT_VECTORCALL
jpayne@68 26589 Py_ssize_t nargs = (Py_ssize_t)nargsf;
jpayne@68 26590 #else
jpayne@68 26591 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
jpayne@68 26592 #endif
jpayne@68 26593 PyObject *self;
jpayne@68 26594 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
jpayne@68 26595 case 1:
jpayne@68 26596 self = args[0];
jpayne@68 26597 args += 1;
jpayne@68 26598 nargs -= 1;
jpayne@68 26599 break;
jpayne@68 26600 case 0:
jpayne@68 26601 self = ((PyCFunctionObject*)cyfunc)->m_self;
jpayne@68 26602 break;
jpayne@68 26603 default:
jpayne@68 26604 return NULL;
jpayne@68 26605 }
jpayne@68 26606 if (unlikely(nargs != 1)) {
jpayne@68 26607 PyErr_Format(PyExc_TypeError,
jpayne@68 26608 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
jpayne@68 26609 def->ml_name, nargs);
jpayne@68 26610 return NULL;
jpayne@68 26611 }
jpayne@68 26612 return def->ml_meth(self, args[0]);
jpayne@68 26613 }
jpayne@68 26614 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
jpayne@68 26615 {
jpayne@68 26616 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
jpayne@68 26617 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
jpayne@68 26618 #if CYTHON_BACKPORT_VECTORCALL
jpayne@68 26619 Py_ssize_t nargs = (Py_ssize_t)nargsf;
jpayne@68 26620 #else
jpayne@68 26621 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
jpayne@68 26622 #endif
jpayne@68 26623 PyObject *self;
jpayne@68 26624 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
jpayne@68 26625 case 1:
jpayne@68 26626 self = args[0];
jpayne@68 26627 args += 1;
jpayne@68 26628 nargs -= 1;
jpayne@68 26629 break;
jpayne@68 26630 case 0:
jpayne@68 26631 self = ((PyCFunctionObject*)cyfunc)->m_self;
jpayne@68 26632 break;
jpayne@68 26633 default:
jpayne@68 26634 return NULL;
jpayne@68 26635 }
jpayne@68 26636 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
jpayne@68 26637 }
jpayne@68 26638 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
jpayne@68 26639 {
jpayne@68 26640 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
jpayne@68 26641 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
jpayne@68 26642 PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
jpayne@68 26643 #if CYTHON_BACKPORT_VECTORCALL
jpayne@68 26644 Py_ssize_t nargs = (Py_ssize_t)nargsf;
jpayne@68 26645 #else
jpayne@68 26646 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
jpayne@68 26647 #endif
jpayne@68 26648 PyObject *self;
jpayne@68 26649 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
jpayne@68 26650 case 1:
jpayne@68 26651 self = args[0];
jpayne@68 26652 args += 1;
jpayne@68 26653 nargs -= 1;
jpayne@68 26654 break;
jpayne@68 26655 case 0:
jpayne@68 26656 self = ((PyCFunctionObject*)cyfunc)->m_self;
jpayne@68 26657 break;
jpayne@68 26658 default:
jpayne@68 26659 return NULL;
jpayne@68 26660 }
jpayne@68 26661 return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
jpayne@68 26662 }
jpayne@68 26663 #endif
jpayne@68 26664 #if CYTHON_USE_TYPE_SPECS
jpayne@68 26665 static PyType_Slot __pyx_CyFunctionType_slots[] = {
jpayne@68 26666 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
jpayne@68 26667 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
jpayne@68 26668 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
jpayne@68 26669 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
jpayne@68 26670 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
jpayne@68 26671 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
jpayne@68 26672 {Py_tp_members, (void *)__pyx_CyFunction_members},
jpayne@68 26673 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
jpayne@68 26674 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
jpayne@68 26675 {0, 0},
jpayne@68 26676 };
jpayne@68 26677 static PyType_Spec __pyx_CyFunctionType_spec = {
jpayne@68 26678 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
jpayne@68 26679 sizeof(__pyx_CyFunctionObject),
jpayne@68 26680 0,
jpayne@68 26681 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
jpayne@68 26682 Py_TPFLAGS_METHOD_DESCRIPTOR |
jpayne@68 26683 #endif
jpayne@68 26684 #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
jpayne@68 26685 _Py_TPFLAGS_HAVE_VECTORCALL |
jpayne@68 26686 #endif
jpayne@68 26687 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
jpayne@68 26688 __pyx_CyFunctionType_slots
jpayne@68 26689 };
jpayne@68 26690 #else
jpayne@68 26691 static PyTypeObject __pyx_CyFunctionType_type = {
jpayne@68 26692 PyVarObject_HEAD_INIT(0, 0)
jpayne@68 26693 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
jpayne@68 26694 sizeof(__pyx_CyFunctionObject),
jpayne@68 26695 0,
jpayne@68 26696 (destructor) __Pyx_CyFunction_dealloc,
jpayne@68 26697 #if !CYTHON_METH_FASTCALL
jpayne@68 26698 0,
jpayne@68 26699 #elif CYTHON_BACKPORT_VECTORCALL
jpayne@68 26700 (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
jpayne@68 26701 #else
jpayne@68 26702 offsetof(PyCFunctionObject, vectorcall),
jpayne@68 26703 #endif
jpayne@68 26704 0,
jpayne@68 26705 0,
jpayne@68 26706 #if PY_MAJOR_VERSION < 3
jpayne@68 26707 0,
jpayne@68 26708 #else
jpayne@68 26709 0,
jpayne@68 26710 #endif
jpayne@68 26711 (reprfunc) __Pyx_CyFunction_repr,
jpayne@68 26712 0,
jpayne@68 26713 0,
jpayne@68 26714 0,
jpayne@68 26715 0,
jpayne@68 26716 __Pyx_CyFunction_CallAsMethod,
jpayne@68 26717 0,
jpayne@68 26718 0,
jpayne@68 26719 0,
jpayne@68 26720 0,
jpayne@68 26721 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
jpayne@68 26722 Py_TPFLAGS_METHOD_DESCRIPTOR |
jpayne@68 26723 #endif
jpayne@68 26724 #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
jpayne@68 26725 _Py_TPFLAGS_HAVE_VECTORCALL |
jpayne@68 26726 #endif
jpayne@68 26727 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
jpayne@68 26728 0,
jpayne@68 26729 (traverseproc) __Pyx_CyFunction_traverse,
jpayne@68 26730 (inquiry) __Pyx_CyFunction_clear,
jpayne@68 26731 0,
jpayne@68 26732 #if PY_VERSION_HEX < 0x030500A0
jpayne@68 26733 offsetof(__pyx_CyFunctionObject, func_weakreflist),
jpayne@68 26734 #else
jpayne@68 26735 offsetof(PyCFunctionObject, m_weakreflist),
jpayne@68 26736 #endif
jpayne@68 26737 0,
jpayne@68 26738 0,
jpayne@68 26739 __pyx_CyFunction_methods,
jpayne@68 26740 __pyx_CyFunction_members,
jpayne@68 26741 __pyx_CyFunction_getsets,
jpayne@68 26742 0,
jpayne@68 26743 0,
jpayne@68 26744 __Pyx_PyMethod_New,
jpayne@68 26745 0,
jpayne@68 26746 offsetof(__pyx_CyFunctionObject, func_dict),
jpayne@68 26747 0,
jpayne@68 26748 0,
jpayne@68 26749 0,
jpayne@68 26750 0,
jpayne@68 26751 0,
jpayne@68 26752 0,
jpayne@68 26753 0,
jpayne@68 26754 0,
jpayne@68 26755 0,
jpayne@68 26756 0,
jpayne@68 26757 0,
jpayne@68 26758 0,
jpayne@68 26759 #if PY_VERSION_HEX >= 0x030400a1
jpayne@68 26760 0,
jpayne@68 26761 #endif
jpayne@68 26762 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
jpayne@68 26763 0,
jpayne@68 26764 #endif
jpayne@68 26765 #if __PYX_NEED_TP_PRINT_SLOT
jpayne@68 26766 0,
jpayne@68 26767 #endif
jpayne@68 26768 #if PY_VERSION_HEX >= 0x030C0000
jpayne@68 26769 0,
jpayne@68 26770 #endif
jpayne@68 26771 #if PY_VERSION_HEX >= 0x030d00A4
jpayne@68 26772 0,
jpayne@68 26773 #endif
jpayne@68 26774 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
jpayne@68 26775 0,
jpayne@68 26776 #endif
jpayne@68 26777 };
jpayne@68 26778 #endif
jpayne@68 26779 static int __pyx_CyFunction_init(PyObject *module) {
jpayne@68 26780 #if CYTHON_USE_TYPE_SPECS
jpayne@68 26781 __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
jpayne@68 26782 #else
jpayne@68 26783 CYTHON_UNUSED_VAR(module);
jpayne@68 26784 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
jpayne@68 26785 #endif
jpayne@68 26786 if (unlikely(__pyx_CyFunctionType == NULL)) {
jpayne@68 26787 return -1;
jpayne@68 26788 }
jpayne@68 26789 return 0;
jpayne@68 26790 }
jpayne@68 26791 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
jpayne@68 26792 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
jpayne@68 26793 m->defaults = PyObject_Malloc(size);
jpayne@68 26794 if (unlikely(!m->defaults))
jpayne@68 26795 return PyErr_NoMemory();
jpayne@68 26796 memset(m->defaults, 0, size);
jpayne@68 26797 m->defaults_pyobjects = pyobjects;
jpayne@68 26798 m->defaults_size = size;
jpayne@68 26799 return m->defaults;
jpayne@68 26800 }
jpayne@68 26801 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
jpayne@68 26802 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
jpayne@68 26803 m->defaults_tuple = tuple;
jpayne@68 26804 Py_INCREF(tuple);
jpayne@68 26805 }
jpayne@68 26806 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
jpayne@68 26807 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
jpayne@68 26808 m->defaults_kwdict = dict;
jpayne@68 26809 Py_INCREF(dict);
jpayne@68 26810 }
jpayne@68 26811 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
jpayne@68 26812 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
jpayne@68 26813 m->func_annotations = dict;
jpayne@68 26814 Py_INCREF(dict);
jpayne@68 26815 }
jpayne@68 26816
jpayne@68 26817 /* CythonFunction */
jpayne@68 26818 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
jpayne@68 26819 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
jpayne@68 26820 PyObject *op = __Pyx_CyFunction_Init(
jpayne@68 26821 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
jpayne@68 26822 ml, flags, qualname, closure, module, globals, code
jpayne@68 26823 );
jpayne@68 26824 if (likely(op)) {
jpayne@68 26825 PyObject_GC_Track(op);
jpayne@68 26826 }
jpayne@68 26827 return op;
jpayne@68 26828 }
jpayne@68 26829
jpayne@68 26830 /* Py3UpdateBases */
jpayne@68 26831 static PyObject*
jpayne@68 26832 __Pyx_PEP560_update_bases(PyObject *bases)
jpayne@68 26833 {
jpayne@68 26834 Py_ssize_t i, j, size_bases;
jpayne@68 26835 PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
jpayne@68 26836 size_bases = PyTuple_GET_SIZE(bases);
jpayne@68 26837 for (i = 0; i < size_bases; i++) {
jpayne@68 26838 base = PyTuple_GET_ITEM(bases, i);
jpayne@68 26839 if (PyType_Check(base)) {
jpayne@68 26840 if (new_bases) {
jpayne@68 26841 if (PyList_Append(new_bases, base) < 0) {
jpayne@68 26842 goto error;
jpayne@68 26843 }
jpayne@68 26844 }
jpayne@68 26845 continue;
jpayne@68 26846 }
jpayne@68 26847 meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
jpayne@68 26848 if (!meth && PyErr_Occurred()) {
jpayne@68 26849 goto error;
jpayne@68 26850 }
jpayne@68 26851 if (!meth) {
jpayne@68 26852 if (new_bases) {
jpayne@68 26853 if (PyList_Append(new_bases, base) < 0) {
jpayne@68 26854 goto error;
jpayne@68 26855 }
jpayne@68 26856 }
jpayne@68 26857 continue;
jpayne@68 26858 }
jpayne@68 26859 new_base = __Pyx_PyObject_CallOneArg(meth, bases);
jpayne@68 26860 Py_DECREF(meth);
jpayne@68 26861 if (!new_base) {
jpayne@68 26862 goto error;
jpayne@68 26863 }
jpayne@68 26864 if (!PyTuple_Check(new_base)) {
jpayne@68 26865 PyErr_SetString(PyExc_TypeError,
jpayne@68 26866 "__mro_entries__ must return a tuple");
jpayne@68 26867 Py_DECREF(new_base);
jpayne@68 26868 goto error;
jpayne@68 26869 }
jpayne@68 26870 if (!new_bases) {
jpayne@68 26871 if (!(new_bases = PyList_New(i))) {
jpayne@68 26872 goto error;
jpayne@68 26873 }
jpayne@68 26874 for (j = 0; j < i; j++) {
jpayne@68 26875 base = PyTuple_GET_ITEM(bases, j);
jpayne@68 26876 PyList_SET_ITEM(new_bases, j, base);
jpayne@68 26877 Py_INCREF(base);
jpayne@68 26878 }
jpayne@68 26879 }
jpayne@68 26880 j = PyList_GET_SIZE(new_bases);
jpayne@68 26881 if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
jpayne@68 26882 goto error;
jpayne@68 26883 }
jpayne@68 26884 Py_DECREF(new_base);
jpayne@68 26885 }
jpayne@68 26886 if (!new_bases) {
jpayne@68 26887 Py_INCREF(bases);
jpayne@68 26888 return bases;
jpayne@68 26889 }
jpayne@68 26890 result = PyList_AsTuple(new_bases);
jpayne@68 26891 Py_DECREF(new_bases);
jpayne@68 26892 return result;
jpayne@68 26893 error:
jpayne@68 26894 Py_XDECREF(new_bases);
jpayne@68 26895 return NULL;
jpayne@68 26896 }
jpayne@68 26897
jpayne@68 26898 /* CalculateMetaclass */
jpayne@68 26899 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
jpayne@68 26900 Py_ssize_t i, nbases;
jpayne@68 26901 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 26902 nbases = PyTuple_GET_SIZE(bases);
jpayne@68 26903 #else
jpayne@68 26904 nbases = PyTuple_Size(bases);
jpayne@68 26905 if (nbases < 0) return NULL;
jpayne@68 26906 #endif
jpayne@68 26907 for (i=0; i < nbases; i++) {
jpayne@68 26908 PyTypeObject *tmptype;
jpayne@68 26909 #if CYTHON_ASSUME_SAFE_MACROS
jpayne@68 26910 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
jpayne@68 26911 #else
jpayne@68 26912 PyObject *tmp = PyTuple_GetItem(bases, i);
jpayne@68 26913 if (!tmp) return NULL;
jpayne@68 26914 #endif
jpayne@68 26915 tmptype = Py_TYPE(tmp);
jpayne@68 26916 #if PY_MAJOR_VERSION < 3
jpayne@68 26917 if (tmptype == &PyClass_Type)
jpayne@68 26918 continue;
jpayne@68 26919 #endif
jpayne@68 26920 if (!metaclass) {
jpayne@68 26921 metaclass = tmptype;
jpayne@68 26922 continue;
jpayne@68 26923 }
jpayne@68 26924 if (PyType_IsSubtype(metaclass, tmptype))
jpayne@68 26925 continue;
jpayne@68 26926 if (PyType_IsSubtype(tmptype, metaclass)) {
jpayne@68 26927 metaclass = tmptype;
jpayne@68 26928 continue;
jpayne@68 26929 }
jpayne@68 26930 PyErr_SetString(PyExc_TypeError,
jpayne@68 26931 "metaclass conflict: "
jpayne@68 26932 "the metaclass of a derived class "
jpayne@68 26933 "must be a (non-strict) subclass "
jpayne@68 26934 "of the metaclasses of all its bases");
jpayne@68 26935 return NULL;
jpayne@68 26936 }
jpayne@68 26937 if (!metaclass) {
jpayne@68 26938 #if PY_MAJOR_VERSION < 3
jpayne@68 26939 metaclass = &PyClass_Type;
jpayne@68 26940 #else
jpayne@68 26941 metaclass = &PyType_Type;
jpayne@68 26942 #endif
jpayne@68 26943 }
jpayne@68 26944 Py_INCREF((PyObject*) metaclass);
jpayne@68 26945 return (PyObject*) metaclass;
jpayne@68 26946 }
jpayne@68 26947
jpayne@68 26948 /* PyObjectLookupSpecial */
jpayne@68 26949 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
jpayne@68 26950 static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
jpayne@68 26951 PyObject *res;
jpayne@68 26952 PyTypeObject *tp = Py_TYPE(obj);
jpayne@68 26953 #if PY_MAJOR_VERSION < 3
jpayne@68 26954 if (unlikely(PyInstance_Check(obj)))
jpayne@68 26955 return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
jpayne@68 26956 #endif
jpayne@68 26957 res = _PyType_Lookup(tp, attr_name);
jpayne@68 26958 if (likely(res)) {
jpayne@68 26959 descrgetfunc f = Py_TYPE(res)->tp_descr_get;
jpayne@68 26960 if (!f) {
jpayne@68 26961 Py_INCREF(res);
jpayne@68 26962 } else {
jpayne@68 26963 res = f(res, obj, (PyObject *)tp);
jpayne@68 26964 }
jpayne@68 26965 } else if (with_error) {
jpayne@68 26966 PyErr_SetObject(PyExc_AttributeError, attr_name);
jpayne@68 26967 }
jpayne@68 26968 return res;
jpayne@68 26969 }
jpayne@68 26970 #endif
jpayne@68 26971
jpayne@68 26972 /* Py3ClassCreate */
jpayne@68 26973 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
jpayne@68 26974 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
jpayne@68 26975 PyObject *ns;
jpayne@68 26976 if (metaclass) {
jpayne@68 26977 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
jpayne@68 26978 if (prep) {
jpayne@68 26979 PyObject *pargs[3] = {NULL, name, bases};
jpayne@68 26980 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
jpayne@68 26981 Py_DECREF(prep);
jpayne@68 26982 } else {
jpayne@68 26983 if (unlikely(PyErr_Occurred()))
jpayne@68 26984 return NULL;
jpayne@68 26985 ns = PyDict_New();
jpayne@68 26986 }
jpayne@68 26987 } else {
jpayne@68 26988 ns = PyDict_New();
jpayne@68 26989 }
jpayne@68 26990 if (unlikely(!ns))
jpayne@68 26991 return NULL;
jpayne@68 26992 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
jpayne@68 26993 #if PY_VERSION_HEX >= 0x03030000
jpayne@68 26994 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
jpayne@68 26995 #else
jpayne@68 26996 CYTHON_MAYBE_UNUSED_VAR(qualname);
jpayne@68 26997 #endif
jpayne@68 26998 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
jpayne@68 26999 return ns;
jpayne@68 27000 bad:
jpayne@68 27001 Py_DECREF(ns);
jpayne@68 27002 return NULL;
jpayne@68 27003 }
jpayne@68 27004 #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
jpayne@68 27005 static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
jpayne@68 27006 PyTypeObject *type = (PyTypeObject*) type_obj;
jpayne@68 27007 PyObject *names_to_set, *key, *value, *set_name, *tmp;
jpayne@68 27008 Py_ssize_t i = 0;
jpayne@68 27009 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 27010 names_to_set = PyDict_Copy(type->tp_dict);
jpayne@68 27011 #else
jpayne@68 27012 {
jpayne@68 27013 PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
jpayne@68 27014 names_to_set = NULL;
jpayne@68 27015 if (likely(d)) {
jpayne@68 27016 PyObject *names_to_set = PyDict_New();
jpayne@68 27017 int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
jpayne@68 27018 Py_DECREF(d);
jpayne@68 27019 if (unlikely(ret < 0))
jpayne@68 27020 Py_CLEAR(names_to_set);
jpayne@68 27021 }
jpayne@68 27022 }
jpayne@68 27023 #endif
jpayne@68 27024 if (unlikely(names_to_set == NULL))
jpayne@68 27025 goto bad;
jpayne@68 27026 while (PyDict_Next(names_to_set, &i, &key, &value)) {
jpayne@68 27027 set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
jpayne@68 27028 if (unlikely(set_name != NULL)) {
jpayne@68 27029 tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
jpayne@68 27030 Py_DECREF(set_name);
jpayne@68 27031 if (unlikely(tmp == NULL)) {
jpayne@68 27032 __Pyx_TypeName value_type_name =
jpayne@68 27033 __Pyx_PyType_GetName(Py_TYPE(value));
jpayne@68 27034 __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
jpayne@68 27035 PyErr_Format(PyExc_RuntimeError,
jpayne@68 27036 #if PY_MAJOR_VERSION >= 3
jpayne@68 27037 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
jpayne@68 27038 value_type_name, key, type_name);
jpayne@68 27039 #else
jpayne@68 27040 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
jpayne@68 27041 value_type_name,
jpayne@68 27042 PyString_Check(key) ? PyString_AS_STRING(key) : "?",
jpayne@68 27043 type_name);
jpayne@68 27044 #endif
jpayne@68 27045 goto bad;
jpayne@68 27046 } else {
jpayne@68 27047 Py_DECREF(tmp);
jpayne@68 27048 }
jpayne@68 27049 }
jpayne@68 27050 else if (unlikely(PyErr_Occurred())) {
jpayne@68 27051 goto bad;
jpayne@68 27052 }
jpayne@68 27053 }
jpayne@68 27054 Py_DECREF(names_to_set);
jpayne@68 27055 return 0;
jpayne@68 27056 bad:
jpayne@68 27057 Py_XDECREF(names_to_set);
jpayne@68 27058 return -1;
jpayne@68 27059 }
jpayne@68 27060 static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
jpayne@68 27061 #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
jpayne@68 27062 PyTypeObject *type = (PyTypeObject*) type_obj;
jpayne@68 27063 PyObject *mro = type->tp_mro;
jpayne@68 27064 Py_ssize_t i, nbases;
jpayne@68 27065 if (unlikely(!mro)) goto done;
jpayne@68 27066 (void) &__Pyx_GetBuiltinName;
jpayne@68 27067 Py_INCREF(mro);
jpayne@68 27068 nbases = PyTuple_GET_SIZE(mro);
jpayne@68 27069 assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
jpayne@68 27070 for (i = 1; i < nbases-1; i++) {
jpayne@68 27071 PyObject *base, *dict, *meth;
jpayne@68 27072 base = PyTuple_GET_ITEM(mro, i);
jpayne@68 27073 dict = ((PyTypeObject *)base)->tp_dict;
jpayne@68 27074 meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
jpayne@68 27075 if (unlikely(meth)) {
jpayne@68 27076 descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
jpayne@68 27077 PyObject *res;
jpayne@68 27078 Py_INCREF(meth);
jpayne@68 27079 if (likely(f)) {
jpayne@68 27080 res = f(meth, NULL, type_obj);
jpayne@68 27081 Py_DECREF(meth);
jpayne@68 27082 if (unlikely(!res)) goto bad;
jpayne@68 27083 meth = res;
jpayne@68 27084 }
jpayne@68 27085 res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
jpayne@68 27086 Py_DECREF(meth);
jpayne@68 27087 if (unlikely(!res)) goto bad;
jpayne@68 27088 Py_DECREF(res);
jpayne@68 27089 goto done;
jpayne@68 27090 } else if (unlikely(PyErr_Occurred())) {
jpayne@68 27091 goto bad;
jpayne@68 27092 }
jpayne@68 27093 }
jpayne@68 27094 done:
jpayne@68 27095 Py_XDECREF(mro);
jpayne@68 27096 return type_obj;
jpayne@68 27097 bad:
jpayne@68 27098 Py_XDECREF(mro);
jpayne@68 27099 Py_DECREF(type_obj);
jpayne@68 27100 return NULL;
jpayne@68 27101 #else
jpayne@68 27102 PyObject *super_type, *super, *func, *res;
jpayne@68 27103 #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
jpayne@68 27104 super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
jpayne@68 27105 #else
jpayne@68 27106 super_type = (PyObject*) &PySuper_Type;
jpayne@68 27107 (void) &__Pyx_GetBuiltinName;
jpayne@68 27108 #endif
jpayne@68 27109 super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
jpayne@68 27110 #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
jpayne@68 27111 Py_XDECREF(super_type);
jpayne@68 27112 #endif
jpayne@68 27113 if (unlikely(!super)) {
jpayne@68 27114 Py_CLEAR(type_obj);
jpayne@68 27115 goto done;
jpayne@68 27116 }
jpayne@68 27117 func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
jpayne@68 27118 Py_DECREF(super);
jpayne@68 27119 if (likely(!func)) {
jpayne@68 27120 if (unlikely(PyErr_Occurred()))
jpayne@68 27121 Py_CLEAR(type_obj);
jpayne@68 27122 goto done;
jpayne@68 27123 }
jpayne@68 27124 res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
jpayne@68 27125 Py_DECREF(func);
jpayne@68 27126 if (unlikely(!res))
jpayne@68 27127 Py_CLEAR(type_obj);
jpayne@68 27128 Py_XDECREF(res);
jpayne@68 27129 done:
jpayne@68 27130 return type_obj;
jpayne@68 27131 #endif
jpayne@68 27132 }
jpayne@68 27133 #endif
jpayne@68 27134 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
jpayne@68 27135 PyObject *dict, PyObject *mkw,
jpayne@68 27136 int calculate_metaclass, int allow_py2_metaclass) {
jpayne@68 27137 PyObject *result;
jpayne@68 27138 PyObject *owned_metaclass = NULL;
jpayne@68 27139 PyObject *margs[4] = {NULL, name, bases, dict};
jpayne@68 27140 if (allow_py2_metaclass) {
jpayne@68 27141 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
jpayne@68 27142 if (owned_metaclass) {
jpayne@68 27143 metaclass = owned_metaclass;
jpayne@68 27144 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
jpayne@68 27145 PyErr_Clear();
jpayne@68 27146 } else {
jpayne@68 27147 return NULL;
jpayne@68 27148 }
jpayne@68 27149 }
jpayne@68 27150 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
jpayne@68 27151 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
jpayne@68 27152 Py_XDECREF(owned_metaclass);
jpayne@68 27153 if (unlikely(!metaclass))
jpayne@68 27154 return NULL;
jpayne@68 27155 owned_metaclass = metaclass;
jpayne@68 27156 }
jpayne@68 27157 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
jpayne@68 27158 #if PY_VERSION_HEX < 0x030600A4
jpayne@68 27159 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
jpayne@68 27160 #else
jpayne@68 27161 mkw
jpayne@68 27162 #endif
jpayne@68 27163 );
jpayne@68 27164 Py_XDECREF(owned_metaclass);
jpayne@68 27165 #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
jpayne@68 27166 if (likely(result) && likely(PyType_Check(result))) {
jpayne@68 27167 if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
jpayne@68 27168 Py_CLEAR(result);
jpayne@68 27169 } else {
jpayne@68 27170 result = __Pyx_InitSubclassPEP487(result, mkw);
jpayne@68 27171 }
jpayne@68 27172 }
jpayne@68 27173 #else
jpayne@68 27174 (void) &__Pyx_GetBuiltinName;
jpayne@68 27175 #endif
jpayne@68 27176 return result;
jpayne@68 27177 }
jpayne@68 27178
jpayne@68 27179 /* CLineInTraceback */
jpayne@68 27180 #ifndef CYTHON_CLINE_IN_TRACEBACK
jpayne@68 27181 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
jpayne@68 27182 PyObject *use_cline;
jpayne@68 27183 PyObject *ptype, *pvalue, *ptraceback;
jpayne@68 27184 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 27185 PyObject **cython_runtime_dict;
jpayne@68 27186 #endif
jpayne@68 27187 CYTHON_MAYBE_UNUSED_VAR(tstate);
jpayne@68 27188 if (unlikely(!__pyx_cython_runtime)) {
jpayne@68 27189 return c_line;
jpayne@68 27190 }
jpayne@68 27191 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
jpayne@68 27192 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 27193 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
jpayne@68 27194 if (likely(cython_runtime_dict)) {
jpayne@68 27195 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
jpayne@68 27196 use_cline, *cython_runtime_dict,
jpayne@68 27197 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
jpayne@68 27198 } else
jpayne@68 27199 #endif
jpayne@68 27200 {
jpayne@68 27201 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
jpayne@68 27202 if (use_cline_obj) {
jpayne@68 27203 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
jpayne@68 27204 Py_DECREF(use_cline_obj);
jpayne@68 27205 } else {
jpayne@68 27206 PyErr_Clear();
jpayne@68 27207 use_cline = NULL;
jpayne@68 27208 }
jpayne@68 27209 }
jpayne@68 27210 if (!use_cline) {
jpayne@68 27211 c_line = 0;
jpayne@68 27212 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
jpayne@68 27213 }
jpayne@68 27214 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
jpayne@68 27215 c_line = 0;
jpayne@68 27216 }
jpayne@68 27217 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
jpayne@68 27218 return c_line;
jpayne@68 27219 }
jpayne@68 27220 #endif
jpayne@68 27221
jpayne@68 27222 /* CodeObjectCache */
jpayne@68 27223 #if !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 27224 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
jpayne@68 27225 int start = 0, mid = 0, end = count - 1;
jpayne@68 27226 if (end >= 0 && code_line > entries[end].code_line) {
jpayne@68 27227 return count;
jpayne@68 27228 }
jpayne@68 27229 while (start < end) {
jpayne@68 27230 mid = start + (end - start) / 2;
jpayne@68 27231 if (code_line < entries[mid].code_line) {
jpayne@68 27232 end = mid;
jpayne@68 27233 } else if (code_line > entries[mid].code_line) {
jpayne@68 27234 start = mid + 1;
jpayne@68 27235 } else {
jpayne@68 27236 return mid;
jpayne@68 27237 }
jpayne@68 27238 }
jpayne@68 27239 if (code_line <= entries[mid].code_line) {
jpayne@68 27240 return mid;
jpayne@68 27241 } else {
jpayne@68 27242 return mid + 1;
jpayne@68 27243 }
jpayne@68 27244 }
jpayne@68 27245 static PyCodeObject *__pyx_find_code_object(int code_line) {
jpayne@68 27246 PyCodeObject* code_object;
jpayne@68 27247 int pos;
jpayne@68 27248 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
jpayne@68 27249 return NULL;
jpayne@68 27250 }
jpayne@68 27251 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
jpayne@68 27252 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
jpayne@68 27253 return NULL;
jpayne@68 27254 }
jpayne@68 27255 code_object = __pyx_code_cache.entries[pos].code_object;
jpayne@68 27256 Py_INCREF(code_object);
jpayne@68 27257 return code_object;
jpayne@68 27258 }
jpayne@68 27259 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
jpayne@68 27260 int pos, i;
jpayne@68 27261 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
jpayne@68 27262 if (unlikely(!code_line)) {
jpayne@68 27263 return;
jpayne@68 27264 }
jpayne@68 27265 if (unlikely(!entries)) {
jpayne@68 27266 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
jpayne@68 27267 if (likely(entries)) {
jpayne@68 27268 __pyx_code_cache.entries = entries;
jpayne@68 27269 __pyx_code_cache.max_count = 64;
jpayne@68 27270 __pyx_code_cache.count = 1;
jpayne@68 27271 entries[0].code_line = code_line;
jpayne@68 27272 entries[0].code_object = code_object;
jpayne@68 27273 Py_INCREF(code_object);
jpayne@68 27274 }
jpayne@68 27275 return;
jpayne@68 27276 }
jpayne@68 27277 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
jpayne@68 27278 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
jpayne@68 27279 PyCodeObject* tmp = entries[pos].code_object;
jpayne@68 27280 entries[pos].code_object = code_object;
jpayne@68 27281 Py_DECREF(tmp);
jpayne@68 27282 return;
jpayne@68 27283 }
jpayne@68 27284 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
jpayne@68 27285 int new_max = __pyx_code_cache.max_count + 64;
jpayne@68 27286 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
jpayne@68 27287 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
jpayne@68 27288 if (unlikely(!entries)) {
jpayne@68 27289 return;
jpayne@68 27290 }
jpayne@68 27291 __pyx_code_cache.entries = entries;
jpayne@68 27292 __pyx_code_cache.max_count = new_max;
jpayne@68 27293 }
jpayne@68 27294 for (i=__pyx_code_cache.count; i>pos; i--) {
jpayne@68 27295 entries[i] = entries[i-1];
jpayne@68 27296 }
jpayne@68 27297 entries[pos].code_line = code_line;
jpayne@68 27298 entries[pos].code_object = code_object;
jpayne@68 27299 __pyx_code_cache.count++;
jpayne@68 27300 Py_INCREF(code_object);
jpayne@68 27301 }
jpayne@68 27302 #endif
jpayne@68 27303
jpayne@68 27304 /* AddTraceback */
jpayne@68 27305 #include "compile.h"
jpayne@68 27306 #include "frameobject.h"
jpayne@68 27307 #include "traceback.h"
jpayne@68 27308 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 27309 #ifndef Py_BUILD_CORE
jpayne@68 27310 #define Py_BUILD_CORE 1
jpayne@68 27311 #endif
jpayne@68 27312 #include "internal/pycore_frame.h"
jpayne@68 27313 #endif
jpayne@68 27314 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 27315 static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
jpayne@68 27316 PyObject *firstlineno, PyObject *name) {
jpayne@68 27317 PyObject *replace = NULL;
jpayne@68 27318 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
jpayne@68 27319 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
jpayne@68 27320 replace = PyObject_GetAttrString(code, "replace");
jpayne@68 27321 if (likely(replace)) {
jpayne@68 27322 PyObject *result;
jpayne@68 27323 result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
jpayne@68 27324 Py_DECREF(replace);
jpayne@68 27325 return result;
jpayne@68 27326 }
jpayne@68 27327 PyErr_Clear();
jpayne@68 27328 #if __PYX_LIMITED_VERSION_HEX < 0x030780000
jpayne@68 27329 {
jpayne@68 27330 PyObject *compiled = NULL, *result = NULL;
jpayne@68 27331 if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
jpayne@68 27332 if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
jpayne@68 27333 compiled = Py_CompileString(
jpayne@68 27334 "out = type(code)(\n"
jpayne@68 27335 " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
jpayne@68 27336 " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
jpayne@68 27337 " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
jpayne@68 27338 " code.co_lnotab)\n", "<dummy>", Py_file_input);
jpayne@68 27339 if (!compiled) return NULL;
jpayne@68 27340 result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
jpayne@68 27341 Py_DECREF(compiled);
jpayne@68 27342 if (!result) PyErr_Print();
jpayne@68 27343 Py_DECREF(result);
jpayne@68 27344 result = PyDict_GetItemString(scratch_dict, "out");
jpayne@68 27345 if (result) Py_INCREF(result);
jpayne@68 27346 return result;
jpayne@68 27347 }
jpayne@68 27348 #else
jpayne@68 27349 return NULL;
jpayne@68 27350 #endif
jpayne@68 27351 }
jpayne@68 27352 static void __Pyx_AddTraceback(const char *funcname, int c_line,
jpayne@68 27353 int py_line, const char *filename) {
jpayne@68 27354 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
jpayne@68 27355 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
jpayne@68 27356 PyObject *exc_type, *exc_value, *exc_traceback;
jpayne@68 27357 int success = 0;
jpayne@68 27358 if (c_line) {
jpayne@68 27359 (void) __pyx_cfilenm;
jpayne@68 27360 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
jpayne@68 27361 }
jpayne@68 27362 PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
jpayne@68 27363 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
jpayne@68 27364 if (unlikely(!code_object)) goto bad;
jpayne@68 27365 py_py_line = PyLong_FromLong(py_line);
jpayne@68 27366 if (unlikely(!py_py_line)) goto bad;
jpayne@68 27367 py_funcname = PyUnicode_FromString(funcname);
jpayne@68 27368 if (unlikely(!py_funcname)) goto bad;
jpayne@68 27369 dict = PyDict_New();
jpayne@68 27370 if (unlikely(!dict)) goto bad;
jpayne@68 27371 {
jpayne@68 27372 PyObject *old_code_object = code_object;
jpayne@68 27373 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
jpayne@68 27374 Py_DECREF(old_code_object);
jpayne@68 27375 }
jpayne@68 27376 if (unlikely(!code_object)) goto bad;
jpayne@68 27377 getframe = PySys_GetObject("_getframe");
jpayne@68 27378 if (unlikely(!getframe)) goto bad;
jpayne@68 27379 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
jpayne@68 27380 frame = PyEval_EvalCode(code_object, dict, dict);
jpayne@68 27381 if (unlikely(!frame) || frame == Py_None) goto bad;
jpayne@68 27382 success = 1;
jpayne@68 27383 bad:
jpayne@68 27384 PyErr_Restore(exc_type, exc_value, exc_traceback);
jpayne@68 27385 Py_XDECREF(code_object);
jpayne@68 27386 Py_XDECREF(py_py_line);
jpayne@68 27387 Py_XDECREF(py_funcname);
jpayne@68 27388 Py_XDECREF(dict);
jpayne@68 27389 Py_XDECREF(replace);
jpayne@68 27390 if (success) {
jpayne@68 27391 PyTraceBack_Here(
jpayne@68 27392 (struct _frame*)frame);
jpayne@68 27393 }
jpayne@68 27394 Py_XDECREF(frame);
jpayne@68 27395 }
jpayne@68 27396 #else
jpayne@68 27397 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
jpayne@68 27398 const char *funcname, int c_line,
jpayne@68 27399 int py_line, const char *filename) {
jpayne@68 27400 PyCodeObject *py_code = NULL;
jpayne@68 27401 PyObject *py_funcname = NULL;
jpayne@68 27402 #if PY_MAJOR_VERSION < 3
jpayne@68 27403 PyObject *py_srcfile = NULL;
jpayne@68 27404 py_srcfile = PyString_FromString(filename);
jpayne@68 27405 if (!py_srcfile) goto bad;
jpayne@68 27406 #endif
jpayne@68 27407 if (c_line) {
jpayne@68 27408 #if PY_MAJOR_VERSION < 3
jpayne@68 27409 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
jpayne@68 27410 if (!py_funcname) goto bad;
jpayne@68 27411 #else
jpayne@68 27412 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
jpayne@68 27413 if (!py_funcname) goto bad;
jpayne@68 27414 funcname = PyUnicode_AsUTF8(py_funcname);
jpayne@68 27415 if (!funcname) goto bad;
jpayne@68 27416 #endif
jpayne@68 27417 }
jpayne@68 27418 else {
jpayne@68 27419 #if PY_MAJOR_VERSION < 3
jpayne@68 27420 py_funcname = PyString_FromString(funcname);
jpayne@68 27421 if (!py_funcname) goto bad;
jpayne@68 27422 #endif
jpayne@68 27423 }
jpayne@68 27424 #if PY_MAJOR_VERSION < 3
jpayne@68 27425 py_code = __Pyx_PyCode_New(
jpayne@68 27426 0,
jpayne@68 27427 0,
jpayne@68 27428 0,
jpayne@68 27429 0,
jpayne@68 27430 0,
jpayne@68 27431 0,
jpayne@68 27432 __pyx_empty_bytes, /*PyObject *code,*/
jpayne@68 27433 __pyx_empty_tuple, /*PyObject *consts,*/
jpayne@68 27434 __pyx_empty_tuple, /*PyObject *names,*/
jpayne@68 27435 __pyx_empty_tuple, /*PyObject *varnames,*/
jpayne@68 27436 __pyx_empty_tuple, /*PyObject *freevars,*/
jpayne@68 27437 __pyx_empty_tuple, /*PyObject *cellvars,*/
jpayne@68 27438 py_srcfile, /*PyObject *filename,*/
jpayne@68 27439 py_funcname, /*PyObject *name,*/
jpayne@68 27440 py_line,
jpayne@68 27441 __pyx_empty_bytes /*PyObject *lnotab*/
jpayne@68 27442 );
jpayne@68 27443 Py_DECREF(py_srcfile);
jpayne@68 27444 #else
jpayne@68 27445 py_code = PyCode_NewEmpty(filename, funcname, py_line);
jpayne@68 27446 #endif
jpayne@68 27447 Py_XDECREF(py_funcname);
jpayne@68 27448 return py_code;
jpayne@68 27449 bad:
jpayne@68 27450 Py_XDECREF(py_funcname);
jpayne@68 27451 #if PY_MAJOR_VERSION < 3
jpayne@68 27452 Py_XDECREF(py_srcfile);
jpayne@68 27453 #endif
jpayne@68 27454 return NULL;
jpayne@68 27455 }
jpayne@68 27456 static void __Pyx_AddTraceback(const char *funcname, int c_line,
jpayne@68 27457 int py_line, const char *filename) {
jpayne@68 27458 PyCodeObject *py_code = 0;
jpayne@68 27459 PyFrameObject *py_frame = 0;
jpayne@68 27460 PyThreadState *tstate = __Pyx_PyThreadState_Current;
jpayne@68 27461 PyObject *ptype, *pvalue, *ptraceback;
jpayne@68 27462 if (c_line) {
jpayne@68 27463 c_line = __Pyx_CLineForTraceback(tstate, c_line);
jpayne@68 27464 }
jpayne@68 27465 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
jpayne@68 27466 if (!py_code) {
jpayne@68 27467 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
jpayne@68 27468 py_code = __Pyx_CreateCodeObjectForTraceback(
jpayne@68 27469 funcname, c_line, py_line, filename);
jpayne@68 27470 if (!py_code) {
jpayne@68 27471 /* If the code object creation fails, then we should clear the
jpayne@68 27472 fetched exception references and propagate the new exception */
jpayne@68 27473 Py_XDECREF(ptype);
jpayne@68 27474 Py_XDECREF(pvalue);
jpayne@68 27475 Py_XDECREF(ptraceback);
jpayne@68 27476 goto bad;
jpayne@68 27477 }
jpayne@68 27478 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
jpayne@68 27479 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
jpayne@68 27480 }
jpayne@68 27481 py_frame = PyFrame_New(
jpayne@68 27482 tstate, /*PyThreadState *tstate,*/
jpayne@68 27483 py_code, /*PyCodeObject *code,*/
jpayne@68 27484 __pyx_d, /*PyObject *globals,*/
jpayne@68 27485 0 /*PyObject *locals*/
jpayne@68 27486 );
jpayne@68 27487 if (!py_frame) goto bad;
jpayne@68 27488 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
jpayne@68 27489 PyTraceBack_Here(py_frame);
jpayne@68 27490 bad:
jpayne@68 27491 Py_XDECREF(py_code);
jpayne@68 27492 Py_XDECREF(py_frame);
jpayne@68 27493 }
jpayne@68 27494 #endif
jpayne@68 27495
jpayne@68 27496 /* CIntFromPyVerify */
jpayne@68 27497 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
jpayne@68 27498 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
jpayne@68 27499 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
jpayne@68 27500 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
jpayne@68 27501 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
jpayne@68 27502 {\
jpayne@68 27503 func_type value = func_value;\
jpayne@68 27504 if (sizeof(target_type) < sizeof(func_type)) {\
jpayne@68 27505 if (unlikely(value != (func_type) (target_type) value)) {\
jpayne@68 27506 func_type zero = 0;\
jpayne@68 27507 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
jpayne@68 27508 return (target_type) -1;\
jpayne@68 27509 if (is_unsigned && unlikely(value < zero))\
jpayne@68 27510 goto raise_neg_overflow;\
jpayne@68 27511 else\
jpayne@68 27512 goto raise_overflow;\
jpayne@68 27513 }\
jpayne@68 27514 }\
jpayne@68 27515 return (target_type) value;\
jpayne@68 27516 }
jpayne@68 27517
jpayne@68 27518 /* CIntFromPy */
jpayne@68 27519 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
jpayne@68 27520 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 27521 #pragma GCC diagnostic push
jpayne@68 27522 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 27523 #endif
jpayne@68 27524 const int neg_one = (int) -1, const_zero = (int) 0;
jpayne@68 27525 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 27526 #pragma GCC diagnostic pop
jpayne@68 27527 #endif
jpayne@68 27528 const int is_unsigned = neg_one > const_zero;
jpayne@68 27529 #if PY_MAJOR_VERSION < 3
jpayne@68 27530 if (likely(PyInt_Check(x))) {
jpayne@68 27531 if ((sizeof(int) < sizeof(long))) {
jpayne@68 27532 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
jpayne@68 27533 } else {
jpayne@68 27534 long val = PyInt_AS_LONG(x);
jpayne@68 27535 if (is_unsigned && unlikely(val < 0)) {
jpayne@68 27536 goto raise_neg_overflow;
jpayne@68 27537 }
jpayne@68 27538 return (int) val;
jpayne@68 27539 }
jpayne@68 27540 }
jpayne@68 27541 #endif
jpayne@68 27542 if (unlikely(!PyLong_Check(x))) {
jpayne@68 27543 int val;
jpayne@68 27544 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
jpayne@68 27545 if (!tmp) return (int) -1;
jpayne@68 27546 val = __Pyx_PyInt_As_int(tmp);
jpayne@68 27547 Py_DECREF(tmp);
jpayne@68 27548 return val;
jpayne@68 27549 }
jpayne@68 27550 if (is_unsigned) {
jpayne@68 27551 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 27552 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
jpayne@68 27553 goto raise_neg_overflow;
jpayne@68 27554 } else if (__Pyx_PyLong_IsCompact(x)) {
jpayne@68 27555 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
jpayne@68 27556 } else {
jpayne@68 27557 const digit* digits = __Pyx_PyLong_Digits(x);
jpayne@68 27558 assert(__Pyx_PyLong_DigitCount(x) > 1);
jpayne@68 27559 switch (__Pyx_PyLong_DigitCount(x)) {
jpayne@68 27560 case 2:
jpayne@68 27561 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
jpayne@68 27562 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 27563 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27564 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
jpayne@68 27565 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
jpayne@68 27566 }
jpayne@68 27567 }
jpayne@68 27568 break;
jpayne@68 27569 case 3:
jpayne@68 27570 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
jpayne@68 27571 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 27572 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27573 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
jpayne@68 27574 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
jpayne@68 27575 }
jpayne@68 27576 }
jpayne@68 27577 break;
jpayne@68 27578 case 4:
jpayne@68 27579 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
jpayne@68 27580 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 27581 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27582 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
jpayne@68 27583 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
jpayne@68 27584 }
jpayne@68 27585 }
jpayne@68 27586 break;
jpayne@68 27587 }
jpayne@68 27588 }
jpayne@68 27589 #endif
jpayne@68 27590 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
jpayne@68 27591 if (unlikely(Py_SIZE(x) < 0)) {
jpayne@68 27592 goto raise_neg_overflow;
jpayne@68 27593 }
jpayne@68 27594 #else
jpayne@68 27595 {
jpayne@68 27596 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
jpayne@68 27597 if (unlikely(result < 0))
jpayne@68 27598 return (int) -1;
jpayne@68 27599 if (unlikely(result == 1))
jpayne@68 27600 goto raise_neg_overflow;
jpayne@68 27601 }
jpayne@68 27602 #endif
jpayne@68 27603 if ((sizeof(int) <= sizeof(unsigned long))) {
jpayne@68 27604 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
jpayne@68 27605 #ifdef HAVE_LONG_LONG
jpayne@68 27606 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
jpayne@68 27607 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
jpayne@68 27608 #endif
jpayne@68 27609 }
jpayne@68 27610 } else {
jpayne@68 27611 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 27612 if (__Pyx_PyLong_IsCompact(x)) {
jpayne@68 27613 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
jpayne@68 27614 } else {
jpayne@68 27615 const digit* digits = __Pyx_PyLong_Digits(x);
jpayne@68 27616 assert(__Pyx_PyLong_DigitCount(x) > 1);
jpayne@68 27617 switch (__Pyx_PyLong_SignedDigitCount(x)) {
jpayne@68 27618 case -2:
jpayne@68 27619 if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
jpayne@68 27620 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 27621 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27622 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 27623 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
jpayne@68 27624 }
jpayne@68 27625 }
jpayne@68 27626 break;
jpayne@68 27627 case 2:
jpayne@68 27628 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
jpayne@68 27629 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 27630 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27631 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 27632 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
jpayne@68 27633 }
jpayne@68 27634 }
jpayne@68 27635 break;
jpayne@68 27636 case -3:
jpayne@68 27637 if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 27638 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 27639 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27640 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 27641 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
jpayne@68 27642 }
jpayne@68 27643 }
jpayne@68 27644 break;
jpayne@68 27645 case 3:
jpayne@68 27646 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
jpayne@68 27647 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 27648 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27649 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 27650 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
jpayne@68 27651 }
jpayne@68 27652 }
jpayne@68 27653 break;
jpayne@68 27654 case -4:
jpayne@68 27655 if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 27656 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 27657 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27658 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
jpayne@68 27659 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
jpayne@68 27660 }
jpayne@68 27661 }
jpayne@68 27662 break;
jpayne@68 27663 case 4:
jpayne@68 27664 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
jpayne@68 27665 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 27666 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27667 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
jpayne@68 27668 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
jpayne@68 27669 }
jpayne@68 27670 }
jpayne@68 27671 break;
jpayne@68 27672 }
jpayne@68 27673 }
jpayne@68 27674 #endif
jpayne@68 27675 if ((sizeof(int) <= sizeof(long))) {
jpayne@68 27676 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
jpayne@68 27677 #ifdef HAVE_LONG_LONG
jpayne@68 27678 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
jpayne@68 27679 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
jpayne@68 27680 #endif
jpayne@68 27681 }
jpayne@68 27682 }
jpayne@68 27683 {
jpayne@68 27684 int val;
jpayne@68 27685 int ret = -1;
jpayne@68 27686 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 27687 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
jpayne@68 27688 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
jpayne@68 27689 if (unlikely(bytes_copied == -1)) {
jpayne@68 27690 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
jpayne@68 27691 goto raise_overflow;
jpayne@68 27692 } else {
jpayne@68 27693 ret = 0;
jpayne@68 27694 }
jpayne@68 27695 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
jpayne@68 27696 int one = 1; int is_little = (int)*(unsigned char *)&one;
jpayne@68 27697 unsigned char *bytes = (unsigned char *)&val;
jpayne@68 27698 ret = _PyLong_AsByteArray((PyLongObject *)x,
jpayne@68 27699 bytes, sizeof(val),
jpayne@68 27700 is_little, !is_unsigned);
jpayne@68 27701 #else
jpayne@68 27702 PyObject *v;
jpayne@68 27703 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
jpayne@68 27704 int bits, remaining_bits, is_negative = 0;
jpayne@68 27705 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
jpayne@68 27706 if (likely(PyLong_CheckExact(x))) {
jpayne@68 27707 v = __Pyx_NewRef(x);
jpayne@68 27708 } else {
jpayne@68 27709 v = PyNumber_Long(x);
jpayne@68 27710 if (unlikely(!v)) return (int) -1;
jpayne@68 27711 assert(PyLong_CheckExact(v));
jpayne@68 27712 }
jpayne@68 27713 {
jpayne@68 27714 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
jpayne@68 27715 if (unlikely(result < 0)) {
jpayne@68 27716 Py_DECREF(v);
jpayne@68 27717 return (int) -1;
jpayne@68 27718 }
jpayne@68 27719 is_negative = result == 1;
jpayne@68 27720 }
jpayne@68 27721 if (is_unsigned && unlikely(is_negative)) {
jpayne@68 27722 Py_DECREF(v);
jpayne@68 27723 goto raise_neg_overflow;
jpayne@68 27724 } else if (is_negative) {
jpayne@68 27725 stepval = PyNumber_Invert(v);
jpayne@68 27726 Py_DECREF(v);
jpayne@68 27727 if (unlikely(!stepval))
jpayne@68 27728 return (int) -1;
jpayne@68 27729 } else {
jpayne@68 27730 stepval = v;
jpayne@68 27731 }
jpayne@68 27732 v = NULL;
jpayne@68 27733 val = (int) 0;
jpayne@68 27734 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
jpayne@68 27735 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
jpayne@68 27736 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
jpayne@68 27737 PyObject *tmp, *digit;
jpayne@68 27738 long idigit;
jpayne@68 27739 digit = PyNumber_And(stepval, mask);
jpayne@68 27740 if (unlikely(!digit)) goto done;
jpayne@68 27741 idigit = PyLong_AsLong(digit);
jpayne@68 27742 Py_DECREF(digit);
jpayne@68 27743 if (unlikely(idigit < 0)) goto done;
jpayne@68 27744 val |= ((int) idigit) << bits;
jpayne@68 27745 tmp = PyNumber_Rshift(stepval, shift);
jpayne@68 27746 if (unlikely(!tmp)) goto done;
jpayne@68 27747 Py_DECREF(stepval); stepval = tmp;
jpayne@68 27748 }
jpayne@68 27749 Py_DECREF(shift); shift = NULL;
jpayne@68 27750 Py_DECREF(mask); mask = NULL;
jpayne@68 27751 {
jpayne@68 27752 long idigit = PyLong_AsLong(stepval);
jpayne@68 27753 if (unlikely(idigit < 0)) goto done;
jpayne@68 27754 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
jpayne@68 27755 if (unlikely(idigit >= (1L << remaining_bits)))
jpayne@68 27756 goto raise_overflow;
jpayne@68 27757 val |= ((int) idigit) << bits;
jpayne@68 27758 }
jpayne@68 27759 if (!is_unsigned) {
jpayne@68 27760 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
jpayne@68 27761 goto raise_overflow;
jpayne@68 27762 if (is_negative)
jpayne@68 27763 val = ~val;
jpayne@68 27764 }
jpayne@68 27765 ret = 0;
jpayne@68 27766 done:
jpayne@68 27767 Py_XDECREF(shift);
jpayne@68 27768 Py_XDECREF(mask);
jpayne@68 27769 Py_XDECREF(stepval);
jpayne@68 27770 #endif
jpayne@68 27771 if (unlikely(ret))
jpayne@68 27772 return (int) -1;
jpayne@68 27773 return val;
jpayne@68 27774 }
jpayne@68 27775 raise_overflow:
jpayne@68 27776 PyErr_SetString(PyExc_OverflowError,
jpayne@68 27777 "value too large to convert to int");
jpayne@68 27778 return (int) -1;
jpayne@68 27779 raise_neg_overflow:
jpayne@68 27780 PyErr_SetString(PyExc_OverflowError,
jpayne@68 27781 "can't convert negative value to int");
jpayne@68 27782 return (int) -1;
jpayne@68 27783 }
jpayne@68 27784
jpayne@68 27785 /* CIntToPy */
jpayne@68 27786 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
jpayne@68 27787 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 27788 #pragma GCC diagnostic push
jpayne@68 27789 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 27790 #endif
jpayne@68 27791 const int neg_one = (int) -1, const_zero = (int) 0;
jpayne@68 27792 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 27793 #pragma GCC diagnostic pop
jpayne@68 27794 #endif
jpayne@68 27795 const int is_unsigned = neg_one > const_zero;
jpayne@68 27796 if (is_unsigned) {
jpayne@68 27797 if (sizeof(int) < sizeof(long)) {
jpayne@68 27798 return PyInt_FromLong((long) value);
jpayne@68 27799 } else if (sizeof(int) <= sizeof(unsigned long)) {
jpayne@68 27800 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 27801 #ifdef HAVE_LONG_LONG
jpayne@68 27802 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 27803 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 27804 #endif
jpayne@68 27805 }
jpayne@68 27806 } else {
jpayne@68 27807 if (sizeof(int) <= sizeof(long)) {
jpayne@68 27808 return PyInt_FromLong((long) value);
jpayne@68 27809 #ifdef HAVE_LONG_LONG
jpayne@68 27810 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
jpayne@68 27811 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 27812 #endif
jpayne@68 27813 }
jpayne@68 27814 }
jpayne@68 27815 {
jpayne@68 27816 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 27817 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 27818 if (is_unsigned) {
jpayne@68 27819 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 27820 } else {
jpayne@68 27821 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 27822 }
jpayne@68 27823 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 27824 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 27825 return _PyLong_FromByteArray(bytes, sizeof(int),
jpayne@68 27826 little, !is_unsigned);
jpayne@68 27827 #else
jpayne@68 27828 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 27829 PyObject *from_bytes, *result = NULL;
jpayne@68 27830 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 27831 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 27832 if (!from_bytes) return NULL;
jpayne@68 27833 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
jpayne@68 27834 if (!py_bytes) goto limited_bad;
jpayne@68 27835 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 27836 if (!order_str) goto limited_bad;
jpayne@68 27837 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 27838 if (!arg_tuple) goto limited_bad;
jpayne@68 27839 if (!is_unsigned) {
jpayne@68 27840 kwds = PyDict_New();
jpayne@68 27841 if (!kwds) goto limited_bad;
jpayne@68 27842 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 27843 }
jpayne@68 27844 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 27845 limited_bad:
jpayne@68 27846 Py_XDECREF(kwds);
jpayne@68 27847 Py_XDECREF(arg_tuple);
jpayne@68 27848 Py_XDECREF(order_str);
jpayne@68 27849 Py_XDECREF(py_bytes);
jpayne@68 27850 Py_XDECREF(from_bytes);
jpayne@68 27851 return result;
jpayne@68 27852 #endif
jpayne@68 27853 }
jpayne@68 27854 }
jpayne@68 27855
jpayne@68 27856 /* CIntFromPy */
jpayne@68 27857 static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
jpayne@68 27858 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 27859 #pragma GCC diagnostic push
jpayne@68 27860 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 27861 #endif
jpayne@68 27862 const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
jpayne@68 27863 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 27864 #pragma GCC diagnostic pop
jpayne@68 27865 #endif
jpayne@68 27866 const int is_unsigned = neg_one > const_zero;
jpayne@68 27867 #if PY_MAJOR_VERSION < 3
jpayne@68 27868 if (likely(PyInt_Check(x))) {
jpayne@68 27869 if ((sizeof(uint64_t) < sizeof(long))) {
jpayne@68 27870 __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
jpayne@68 27871 } else {
jpayne@68 27872 long val = PyInt_AS_LONG(x);
jpayne@68 27873 if (is_unsigned && unlikely(val < 0)) {
jpayne@68 27874 goto raise_neg_overflow;
jpayne@68 27875 }
jpayne@68 27876 return (uint64_t) val;
jpayne@68 27877 }
jpayne@68 27878 }
jpayne@68 27879 #endif
jpayne@68 27880 if (unlikely(!PyLong_Check(x))) {
jpayne@68 27881 uint64_t val;
jpayne@68 27882 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
jpayne@68 27883 if (!tmp) return (uint64_t) -1;
jpayne@68 27884 val = __Pyx_PyInt_As_uint64_t(tmp);
jpayne@68 27885 Py_DECREF(tmp);
jpayne@68 27886 return val;
jpayne@68 27887 }
jpayne@68 27888 if (is_unsigned) {
jpayne@68 27889 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 27890 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
jpayne@68 27891 goto raise_neg_overflow;
jpayne@68 27892 } else if (__Pyx_PyLong_IsCompact(x)) {
jpayne@68 27893 __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
jpayne@68 27894 } else {
jpayne@68 27895 const digit* digits = __Pyx_PyLong_Digits(x);
jpayne@68 27896 assert(__Pyx_PyLong_DigitCount(x) > 1);
jpayne@68 27897 switch (__Pyx_PyLong_DigitCount(x)) {
jpayne@68 27898 case 2:
jpayne@68 27899 if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
jpayne@68 27900 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 27901 __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27902 } else if ((8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT)) {
jpayne@68 27903 return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
jpayne@68 27904 }
jpayne@68 27905 }
jpayne@68 27906 break;
jpayne@68 27907 case 3:
jpayne@68 27908 if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
jpayne@68 27909 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 27910 __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27911 } else if ((8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT)) {
jpayne@68 27912 return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
jpayne@68 27913 }
jpayne@68 27914 }
jpayne@68 27915 break;
jpayne@68 27916 case 4:
jpayne@68 27917 if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
jpayne@68 27918 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 27919 __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27920 } else if ((8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT)) {
jpayne@68 27921 return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
jpayne@68 27922 }
jpayne@68 27923 }
jpayne@68 27924 break;
jpayne@68 27925 }
jpayne@68 27926 }
jpayne@68 27927 #endif
jpayne@68 27928 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
jpayne@68 27929 if (unlikely(Py_SIZE(x) < 0)) {
jpayne@68 27930 goto raise_neg_overflow;
jpayne@68 27931 }
jpayne@68 27932 #else
jpayne@68 27933 {
jpayne@68 27934 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
jpayne@68 27935 if (unlikely(result < 0))
jpayne@68 27936 return (uint64_t) -1;
jpayne@68 27937 if (unlikely(result == 1))
jpayne@68 27938 goto raise_neg_overflow;
jpayne@68 27939 }
jpayne@68 27940 #endif
jpayne@68 27941 if ((sizeof(uint64_t) <= sizeof(unsigned long))) {
jpayne@68 27942 __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
jpayne@68 27943 #ifdef HAVE_LONG_LONG
jpayne@68 27944 } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) {
jpayne@68 27945 __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
jpayne@68 27946 #endif
jpayne@68 27947 }
jpayne@68 27948 } else {
jpayne@68 27949 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 27950 if (__Pyx_PyLong_IsCompact(x)) {
jpayne@68 27951 __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
jpayne@68 27952 } else {
jpayne@68 27953 const digit* digits = __Pyx_PyLong_Digits(x);
jpayne@68 27954 assert(__Pyx_PyLong_DigitCount(x) > 1);
jpayne@68 27955 switch (__Pyx_PyLong_SignedDigitCount(x)) {
jpayne@68 27956 case -2:
jpayne@68 27957 if ((8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT)) {
jpayne@68 27958 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 27959 __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27960 } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 27961 return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
jpayne@68 27962 }
jpayne@68 27963 }
jpayne@68 27964 break;
jpayne@68 27965 case 2:
jpayne@68 27966 if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
jpayne@68 27967 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 27968 __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27969 } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 27970 return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
jpayne@68 27971 }
jpayne@68 27972 }
jpayne@68 27973 break;
jpayne@68 27974 case -3:
jpayne@68 27975 if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 27976 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 27977 __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27978 } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 27979 return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
jpayne@68 27980 }
jpayne@68 27981 }
jpayne@68 27982 break;
jpayne@68 27983 case 3:
jpayne@68 27984 if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
jpayne@68 27985 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 27986 __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27987 } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 27988 return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
jpayne@68 27989 }
jpayne@68 27990 }
jpayne@68 27991 break;
jpayne@68 27992 case -4:
jpayne@68 27993 if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 27994 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 27995 __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 27996 } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
jpayne@68 27997 return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
jpayne@68 27998 }
jpayne@68 27999 }
jpayne@68 28000 break;
jpayne@68 28001 case 4:
jpayne@68 28002 if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
jpayne@68 28003 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 28004 __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28005 } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
jpayne@68 28006 return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
jpayne@68 28007 }
jpayne@68 28008 }
jpayne@68 28009 break;
jpayne@68 28010 }
jpayne@68 28011 }
jpayne@68 28012 #endif
jpayne@68 28013 if ((sizeof(uint64_t) <= sizeof(long))) {
jpayne@68 28014 __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
jpayne@68 28015 #ifdef HAVE_LONG_LONG
jpayne@68 28016 } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) {
jpayne@68 28017 __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
jpayne@68 28018 #endif
jpayne@68 28019 }
jpayne@68 28020 }
jpayne@68 28021 {
jpayne@68 28022 uint64_t val;
jpayne@68 28023 int ret = -1;
jpayne@68 28024 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 28025 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
jpayne@68 28026 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
jpayne@68 28027 if (unlikely(bytes_copied == -1)) {
jpayne@68 28028 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
jpayne@68 28029 goto raise_overflow;
jpayne@68 28030 } else {
jpayne@68 28031 ret = 0;
jpayne@68 28032 }
jpayne@68 28033 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
jpayne@68 28034 int one = 1; int is_little = (int)*(unsigned char *)&one;
jpayne@68 28035 unsigned char *bytes = (unsigned char *)&val;
jpayne@68 28036 ret = _PyLong_AsByteArray((PyLongObject *)x,
jpayne@68 28037 bytes, sizeof(val),
jpayne@68 28038 is_little, !is_unsigned);
jpayne@68 28039 #else
jpayne@68 28040 PyObject *v;
jpayne@68 28041 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
jpayne@68 28042 int bits, remaining_bits, is_negative = 0;
jpayne@68 28043 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
jpayne@68 28044 if (likely(PyLong_CheckExact(x))) {
jpayne@68 28045 v = __Pyx_NewRef(x);
jpayne@68 28046 } else {
jpayne@68 28047 v = PyNumber_Long(x);
jpayne@68 28048 if (unlikely(!v)) return (uint64_t) -1;
jpayne@68 28049 assert(PyLong_CheckExact(v));
jpayne@68 28050 }
jpayne@68 28051 {
jpayne@68 28052 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
jpayne@68 28053 if (unlikely(result < 0)) {
jpayne@68 28054 Py_DECREF(v);
jpayne@68 28055 return (uint64_t) -1;
jpayne@68 28056 }
jpayne@68 28057 is_negative = result == 1;
jpayne@68 28058 }
jpayne@68 28059 if (is_unsigned && unlikely(is_negative)) {
jpayne@68 28060 Py_DECREF(v);
jpayne@68 28061 goto raise_neg_overflow;
jpayne@68 28062 } else if (is_negative) {
jpayne@68 28063 stepval = PyNumber_Invert(v);
jpayne@68 28064 Py_DECREF(v);
jpayne@68 28065 if (unlikely(!stepval))
jpayne@68 28066 return (uint64_t) -1;
jpayne@68 28067 } else {
jpayne@68 28068 stepval = v;
jpayne@68 28069 }
jpayne@68 28070 v = NULL;
jpayne@68 28071 val = (uint64_t) 0;
jpayne@68 28072 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
jpayne@68 28073 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
jpayne@68 28074 for (bits = 0; bits < (int) sizeof(uint64_t) * 8 - chunk_size; bits += chunk_size) {
jpayne@68 28075 PyObject *tmp, *digit;
jpayne@68 28076 long idigit;
jpayne@68 28077 digit = PyNumber_And(stepval, mask);
jpayne@68 28078 if (unlikely(!digit)) goto done;
jpayne@68 28079 idigit = PyLong_AsLong(digit);
jpayne@68 28080 Py_DECREF(digit);
jpayne@68 28081 if (unlikely(idigit < 0)) goto done;
jpayne@68 28082 val |= ((uint64_t) idigit) << bits;
jpayne@68 28083 tmp = PyNumber_Rshift(stepval, shift);
jpayne@68 28084 if (unlikely(!tmp)) goto done;
jpayne@68 28085 Py_DECREF(stepval); stepval = tmp;
jpayne@68 28086 }
jpayne@68 28087 Py_DECREF(shift); shift = NULL;
jpayne@68 28088 Py_DECREF(mask); mask = NULL;
jpayne@68 28089 {
jpayne@68 28090 long idigit = PyLong_AsLong(stepval);
jpayne@68 28091 if (unlikely(idigit < 0)) goto done;
jpayne@68 28092 remaining_bits = ((int) sizeof(uint64_t) * 8) - bits - (is_unsigned ? 0 : 1);
jpayne@68 28093 if (unlikely(idigit >= (1L << remaining_bits)))
jpayne@68 28094 goto raise_overflow;
jpayne@68 28095 val |= ((uint64_t) idigit) << bits;
jpayne@68 28096 }
jpayne@68 28097 if (!is_unsigned) {
jpayne@68 28098 if (unlikely(val & (((uint64_t) 1) << (sizeof(uint64_t) * 8 - 1))))
jpayne@68 28099 goto raise_overflow;
jpayne@68 28100 if (is_negative)
jpayne@68 28101 val = ~val;
jpayne@68 28102 }
jpayne@68 28103 ret = 0;
jpayne@68 28104 done:
jpayne@68 28105 Py_XDECREF(shift);
jpayne@68 28106 Py_XDECREF(mask);
jpayne@68 28107 Py_XDECREF(stepval);
jpayne@68 28108 #endif
jpayne@68 28109 if (unlikely(ret))
jpayne@68 28110 return (uint64_t) -1;
jpayne@68 28111 return val;
jpayne@68 28112 }
jpayne@68 28113 raise_overflow:
jpayne@68 28114 PyErr_SetString(PyExc_OverflowError,
jpayne@68 28115 "value too large to convert to uint64_t");
jpayne@68 28116 return (uint64_t) -1;
jpayne@68 28117 raise_neg_overflow:
jpayne@68 28118 PyErr_SetString(PyExc_OverflowError,
jpayne@68 28119 "can't convert negative value to uint64_t");
jpayne@68 28120 return (uint64_t) -1;
jpayne@68 28121 }
jpayne@68 28122
jpayne@68 28123 /* CIntToPy */
jpayne@68 28124 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_off_t(off_t value) {
jpayne@68 28125 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28126 #pragma GCC diagnostic push
jpayne@68 28127 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28128 #endif
jpayne@68 28129 const off_t neg_one = (off_t) -1, const_zero = (off_t) 0;
jpayne@68 28130 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28131 #pragma GCC diagnostic pop
jpayne@68 28132 #endif
jpayne@68 28133 const int is_unsigned = neg_one > const_zero;
jpayne@68 28134 if (is_unsigned) {
jpayne@68 28135 if (sizeof(off_t) < sizeof(long)) {
jpayne@68 28136 return PyInt_FromLong((long) value);
jpayne@68 28137 } else if (sizeof(off_t) <= sizeof(unsigned long)) {
jpayne@68 28138 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 28139 #ifdef HAVE_LONG_LONG
jpayne@68 28140 } else if (sizeof(off_t) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 28141 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 28142 #endif
jpayne@68 28143 }
jpayne@68 28144 } else {
jpayne@68 28145 if (sizeof(off_t) <= sizeof(long)) {
jpayne@68 28146 return PyInt_FromLong((long) value);
jpayne@68 28147 #ifdef HAVE_LONG_LONG
jpayne@68 28148 } else if (sizeof(off_t) <= sizeof(PY_LONG_LONG)) {
jpayne@68 28149 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 28150 #endif
jpayne@68 28151 }
jpayne@68 28152 }
jpayne@68 28153 {
jpayne@68 28154 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 28155 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 28156 if (is_unsigned) {
jpayne@68 28157 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28158 } else {
jpayne@68 28159 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28160 }
jpayne@68 28161 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 28162 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28163 return _PyLong_FromByteArray(bytes, sizeof(off_t),
jpayne@68 28164 little, !is_unsigned);
jpayne@68 28165 #else
jpayne@68 28166 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28167 PyObject *from_bytes, *result = NULL;
jpayne@68 28168 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 28169 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 28170 if (!from_bytes) return NULL;
jpayne@68 28171 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(off_t));
jpayne@68 28172 if (!py_bytes) goto limited_bad;
jpayne@68 28173 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 28174 if (!order_str) goto limited_bad;
jpayne@68 28175 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 28176 if (!arg_tuple) goto limited_bad;
jpayne@68 28177 if (!is_unsigned) {
jpayne@68 28178 kwds = PyDict_New();
jpayne@68 28179 if (!kwds) goto limited_bad;
jpayne@68 28180 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 28181 }
jpayne@68 28182 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 28183 limited_bad:
jpayne@68 28184 Py_XDECREF(kwds);
jpayne@68 28185 Py_XDECREF(arg_tuple);
jpayne@68 28186 Py_XDECREF(order_str);
jpayne@68 28187 Py_XDECREF(py_bytes);
jpayne@68 28188 Py_XDECREF(from_bytes);
jpayne@68 28189 return result;
jpayne@68 28190 #endif
jpayne@68 28191 }
jpayne@68 28192 }
jpayne@68 28193
jpayne@68 28194 /* CIntToPy */
jpayne@68 28195 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__htsFormatCategory(enum htsFormatCategory value) {
jpayne@68 28196 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28197 #pragma GCC diagnostic push
jpayne@68 28198 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28199 #endif
jpayne@68 28200 const enum htsFormatCategory neg_one = (enum htsFormatCategory) -1, const_zero = (enum htsFormatCategory) 0;
jpayne@68 28201 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28202 #pragma GCC diagnostic pop
jpayne@68 28203 #endif
jpayne@68 28204 const int is_unsigned = neg_one > const_zero;
jpayne@68 28205 if (is_unsigned) {
jpayne@68 28206 if (sizeof(enum htsFormatCategory) < sizeof(long)) {
jpayne@68 28207 return PyInt_FromLong((long) value);
jpayne@68 28208 } else if (sizeof(enum htsFormatCategory) <= sizeof(unsigned long)) {
jpayne@68 28209 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 28210 #ifdef HAVE_LONG_LONG
jpayne@68 28211 } else if (sizeof(enum htsFormatCategory) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 28212 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 28213 #endif
jpayne@68 28214 }
jpayne@68 28215 } else {
jpayne@68 28216 if (sizeof(enum htsFormatCategory) <= sizeof(long)) {
jpayne@68 28217 return PyInt_FromLong((long) value);
jpayne@68 28218 #ifdef HAVE_LONG_LONG
jpayne@68 28219 } else if (sizeof(enum htsFormatCategory) <= sizeof(PY_LONG_LONG)) {
jpayne@68 28220 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 28221 #endif
jpayne@68 28222 }
jpayne@68 28223 }
jpayne@68 28224 {
jpayne@68 28225 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 28226 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 28227 if (is_unsigned) {
jpayne@68 28228 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28229 } else {
jpayne@68 28230 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28231 }
jpayne@68 28232 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 28233 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28234 return _PyLong_FromByteArray(bytes, sizeof(enum htsFormatCategory),
jpayne@68 28235 little, !is_unsigned);
jpayne@68 28236 #else
jpayne@68 28237 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28238 PyObject *from_bytes, *result = NULL;
jpayne@68 28239 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 28240 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 28241 if (!from_bytes) return NULL;
jpayne@68 28242 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum htsFormatCategory));
jpayne@68 28243 if (!py_bytes) goto limited_bad;
jpayne@68 28244 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 28245 if (!order_str) goto limited_bad;
jpayne@68 28246 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 28247 if (!arg_tuple) goto limited_bad;
jpayne@68 28248 if (!is_unsigned) {
jpayne@68 28249 kwds = PyDict_New();
jpayne@68 28250 if (!kwds) goto limited_bad;
jpayne@68 28251 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 28252 }
jpayne@68 28253 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 28254 limited_bad:
jpayne@68 28255 Py_XDECREF(kwds);
jpayne@68 28256 Py_XDECREF(arg_tuple);
jpayne@68 28257 Py_XDECREF(order_str);
jpayne@68 28258 Py_XDECREF(py_bytes);
jpayne@68 28259 Py_XDECREF(from_bytes);
jpayne@68 28260 return result;
jpayne@68 28261 #endif
jpayne@68 28262 }
jpayne@68 28263 }
jpayne@68 28264
jpayne@68 28265 /* CIntToPy */
jpayne@68 28266 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__htsExactFormat(enum htsExactFormat value) {
jpayne@68 28267 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28268 #pragma GCC diagnostic push
jpayne@68 28269 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28270 #endif
jpayne@68 28271 const enum htsExactFormat neg_one = (enum htsExactFormat) -1, const_zero = (enum htsExactFormat) 0;
jpayne@68 28272 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28273 #pragma GCC diagnostic pop
jpayne@68 28274 #endif
jpayne@68 28275 const int is_unsigned = neg_one > const_zero;
jpayne@68 28276 if (is_unsigned) {
jpayne@68 28277 if (sizeof(enum htsExactFormat) < sizeof(long)) {
jpayne@68 28278 return PyInt_FromLong((long) value);
jpayne@68 28279 } else if (sizeof(enum htsExactFormat) <= sizeof(unsigned long)) {
jpayne@68 28280 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 28281 #ifdef HAVE_LONG_LONG
jpayne@68 28282 } else if (sizeof(enum htsExactFormat) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 28283 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 28284 #endif
jpayne@68 28285 }
jpayne@68 28286 } else {
jpayne@68 28287 if (sizeof(enum htsExactFormat) <= sizeof(long)) {
jpayne@68 28288 return PyInt_FromLong((long) value);
jpayne@68 28289 #ifdef HAVE_LONG_LONG
jpayne@68 28290 } else if (sizeof(enum htsExactFormat) <= sizeof(PY_LONG_LONG)) {
jpayne@68 28291 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 28292 #endif
jpayne@68 28293 }
jpayne@68 28294 }
jpayne@68 28295 {
jpayne@68 28296 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 28297 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 28298 if (is_unsigned) {
jpayne@68 28299 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28300 } else {
jpayne@68 28301 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28302 }
jpayne@68 28303 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 28304 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28305 return _PyLong_FromByteArray(bytes, sizeof(enum htsExactFormat),
jpayne@68 28306 little, !is_unsigned);
jpayne@68 28307 #else
jpayne@68 28308 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28309 PyObject *from_bytes, *result = NULL;
jpayne@68 28310 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 28311 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 28312 if (!from_bytes) return NULL;
jpayne@68 28313 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum htsExactFormat));
jpayne@68 28314 if (!py_bytes) goto limited_bad;
jpayne@68 28315 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 28316 if (!order_str) goto limited_bad;
jpayne@68 28317 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 28318 if (!arg_tuple) goto limited_bad;
jpayne@68 28319 if (!is_unsigned) {
jpayne@68 28320 kwds = PyDict_New();
jpayne@68 28321 if (!kwds) goto limited_bad;
jpayne@68 28322 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 28323 }
jpayne@68 28324 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 28325 limited_bad:
jpayne@68 28326 Py_XDECREF(kwds);
jpayne@68 28327 Py_XDECREF(arg_tuple);
jpayne@68 28328 Py_XDECREF(order_str);
jpayne@68 28329 Py_XDECREF(py_bytes);
jpayne@68 28330 Py_XDECREF(from_bytes);
jpayne@68 28331 return result;
jpayne@68 28332 #endif
jpayne@68 28333 }
jpayne@68 28334 }
jpayne@68 28335
jpayne@68 28336 /* CIntToPy */
jpayne@68 28337 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value) {
jpayne@68 28338 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28339 #pragma GCC diagnostic push
jpayne@68 28340 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28341 #endif
jpayne@68 28342 const short neg_one = (short) -1, const_zero = (short) 0;
jpayne@68 28343 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28344 #pragma GCC diagnostic pop
jpayne@68 28345 #endif
jpayne@68 28346 const int is_unsigned = neg_one > const_zero;
jpayne@68 28347 if (is_unsigned) {
jpayne@68 28348 if (sizeof(short) < sizeof(long)) {
jpayne@68 28349 return PyInt_FromLong((long) value);
jpayne@68 28350 } else if (sizeof(short) <= sizeof(unsigned long)) {
jpayne@68 28351 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 28352 #ifdef HAVE_LONG_LONG
jpayne@68 28353 } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 28354 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 28355 #endif
jpayne@68 28356 }
jpayne@68 28357 } else {
jpayne@68 28358 if (sizeof(short) <= sizeof(long)) {
jpayne@68 28359 return PyInt_FromLong((long) value);
jpayne@68 28360 #ifdef HAVE_LONG_LONG
jpayne@68 28361 } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
jpayne@68 28362 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 28363 #endif
jpayne@68 28364 }
jpayne@68 28365 }
jpayne@68 28366 {
jpayne@68 28367 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 28368 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 28369 if (is_unsigned) {
jpayne@68 28370 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28371 } else {
jpayne@68 28372 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28373 }
jpayne@68 28374 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 28375 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28376 return _PyLong_FromByteArray(bytes, sizeof(short),
jpayne@68 28377 little, !is_unsigned);
jpayne@68 28378 #else
jpayne@68 28379 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28380 PyObject *from_bytes, *result = NULL;
jpayne@68 28381 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 28382 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 28383 if (!from_bytes) return NULL;
jpayne@68 28384 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(short));
jpayne@68 28385 if (!py_bytes) goto limited_bad;
jpayne@68 28386 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 28387 if (!order_str) goto limited_bad;
jpayne@68 28388 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 28389 if (!arg_tuple) goto limited_bad;
jpayne@68 28390 if (!is_unsigned) {
jpayne@68 28391 kwds = PyDict_New();
jpayne@68 28392 if (!kwds) goto limited_bad;
jpayne@68 28393 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 28394 }
jpayne@68 28395 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 28396 limited_bad:
jpayne@68 28397 Py_XDECREF(kwds);
jpayne@68 28398 Py_XDECREF(arg_tuple);
jpayne@68 28399 Py_XDECREF(order_str);
jpayne@68 28400 Py_XDECREF(py_bytes);
jpayne@68 28401 Py_XDECREF(from_bytes);
jpayne@68 28402 return result;
jpayne@68 28403 #endif
jpayne@68 28404 }
jpayne@68 28405 }
jpayne@68 28406
jpayne@68 28407 /* CIntToPy */
jpayne@68 28408 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__htsCompression(enum htsCompression value) {
jpayne@68 28409 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28410 #pragma GCC diagnostic push
jpayne@68 28411 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28412 #endif
jpayne@68 28413 const enum htsCompression neg_one = (enum htsCompression) -1, const_zero = (enum htsCompression) 0;
jpayne@68 28414 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28415 #pragma GCC diagnostic pop
jpayne@68 28416 #endif
jpayne@68 28417 const int is_unsigned = neg_one > const_zero;
jpayne@68 28418 if (is_unsigned) {
jpayne@68 28419 if (sizeof(enum htsCompression) < sizeof(long)) {
jpayne@68 28420 return PyInt_FromLong((long) value);
jpayne@68 28421 } else if (sizeof(enum htsCompression) <= sizeof(unsigned long)) {
jpayne@68 28422 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 28423 #ifdef HAVE_LONG_LONG
jpayne@68 28424 } else if (sizeof(enum htsCompression) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 28425 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 28426 #endif
jpayne@68 28427 }
jpayne@68 28428 } else {
jpayne@68 28429 if (sizeof(enum htsCompression) <= sizeof(long)) {
jpayne@68 28430 return PyInt_FromLong((long) value);
jpayne@68 28431 #ifdef HAVE_LONG_LONG
jpayne@68 28432 } else if (sizeof(enum htsCompression) <= sizeof(PY_LONG_LONG)) {
jpayne@68 28433 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 28434 #endif
jpayne@68 28435 }
jpayne@68 28436 }
jpayne@68 28437 {
jpayne@68 28438 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 28439 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 28440 if (is_unsigned) {
jpayne@68 28441 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28442 } else {
jpayne@68 28443 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28444 }
jpayne@68 28445 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 28446 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28447 return _PyLong_FromByteArray(bytes, sizeof(enum htsCompression),
jpayne@68 28448 little, !is_unsigned);
jpayne@68 28449 #else
jpayne@68 28450 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28451 PyObject *from_bytes, *result = NULL;
jpayne@68 28452 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 28453 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 28454 if (!from_bytes) return NULL;
jpayne@68 28455 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum htsCompression));
jpayne@68 28456 if (!py_bytes) goto limited_bad;
jpayne@68 28457 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 28458 if (!order_str) goto limited_bad;
jpayne@68 28459 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 28460 if (!arg_tuple) goto limited_bad;
jpayne@68 28461 if (!is_unsigned) {
jpayne@68 28462 kwds = PyDict_New();
jpayne@68 28463 if (!kwds) goto limited_bad;
jpayne@68 28464 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 28465 }
jpayne@68 28466 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 28467 limited_bad:
jpayne@68 28468 Py_XDECREF(kwds);
jpayne@68 28469 Py_XDECREF(arg_tuple);
jpayne@68 28470 Py_XDECREF(order_str);
jpayne@68 28471 Py_XDECREF(py_bytes);
jpayne@68 28472 Py_XDECREF(from_bytes);
jpayne@68 28473 return result;
jpayne@68 28474 #endif
jpayne@68 28475 }
jpayne@68 28476 }
jpayne@68 28477
jpayne@68 28478 /* CIntToPy */
jpayne@68 28479 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
jpayne@68 28480 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28481 #pragma GCC diagnostic push
jpayne@68 28482 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28483 #endif
jpayne@68 28484 const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
jpayne@68 28485 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28486 #pragma GCC diagnostic pop
jpayne@68 28487 #endif
jpayne@68 28488 const int is_unsigned = neg_one > const_zero;
jpayne@68 28489 if (is_unsigned) {
jpayne@68 28490 if (sizeof(int64_t) < sizeof(long)) {
jpayne@68 28491 return PyInt_FromLong((long) value);
jpayne@68 28492 } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
jpayne@68 28493 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 28494 #ifdef HAVE_LONG_LONG
jpayne@68 28495 } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 28496 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 28497 #endif
jpayne@68 28498 }
jpayne@68 28499 } else {
jpayne@68 28500 if (sizeof(int64_t) <= sizeof(long)) {
jpayne@68 28501 return PyInt_FromLong((long) value);
jpayne@68 28502 #ifdef HAVE_LONG_LONG
jpayne@68 28503 } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
jpayne@68 28504 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 28505 #endif
jpayne@68 28506 }
jpayne@68 28507 }
jpayne@68 28508 {
jpayne@68 28509 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 28510 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 28511 if (is_unsigned) {
jpayne@68 28512 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28513 } else {
jpayne@68 28514 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28515 }
jpayne@68 28516 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 28517 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28518 return _PyLong_FromByteArray(bytes, sizeof(int64_t),
jpayne@68 28519 little, !is_unsigned);
jpayne@68 28520 #else
jpayne@68 28521 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28522 PyObject *from_bytes, *result = NULL;
jpayne@68 28523 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 28524 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 28525 if (!from_bytes) return NULL;
jpayne@68 28526 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t));
jpayne@68 28527 if (!py_bytes) goto limited_bad;
jpayne@68 28528 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 28529 if (!order_str) goto limited_bad;
jpayne@68 28530 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 28531 if (!arg_tuple) goto limited_bad;
jpayne@68 28532 if (!is_unsigned) {
jpayne@68 28533 kwds = PyDict_New();
jpayne@68 28534 if (!kwds) goto limited_bad;
jpayne@68 28535 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 28536 }
jpayne@68 28537 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 28538 limited_bad:
jpayne@68 28539 Py_XDECREF(kwds);
jpayne@68 28540 Py_XDECREF(arg_tuple);
jpayne@68 28541 Py_XDECREF(order_str);
jpayne@68 28542 Py_XDECREF(py_bytes);
jpayne@68 28543 Py_XDECREF(from_bytes);
jpayne@68 28544 return result;
jpayne@68 28545 #endif
jpayne@68 28546 }
jpayne@68 28547 }
jpayne@68 28548
jpayne@68 28549 /* CIntFromPy */
jpayne@68 28550 static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
jpayne@68 28551 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28552 #pragma GCC diagnostic push
jpayne@68 28553 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28554 #endif
jpayne@68 28555 const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
jpayne@68 28556 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28557 #pragma GCC diagnostic pop
jpayne@68 28558 #endif
jpayne@68 28559 const int is_unsigned = neg_one > const_zero;
jpayne@68 28560 #if PY_MAJOR_VERSION < 3
jpayne@68 28561 if (likely(PyInt_Check(x))) {
jpayne@68 28562 if ((sizeof(int32_t) < sizeof(long))) {
jpayne@68 28563 __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x))
jpayne@68 28564 } else {
jpayne@68 28565 long val = PyInt_AS_LONG(x);
jpayne@68 28566 if (is_unsigned && unlikely(val < 0)) {
jpayne@68 28567 goto raise_neg_overflow;
jpayne@68 28568 }
jpayne@68 28569 return (int32_t) val;
jpayne@68 28570 }
jpayne@68 28571 }
jpayne@68 28572 #endif
jpayne@68 28573 if (unlikely(!PyLong_Check(x))) {
jpayne@68 28574 int32_t val;
jpayne@68 28575 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
jpayne@68 28576 if (!tmp) return (int32_t) -1;
jpayne@68 28577 val = __Pyx_PyInt_As_int32_t(tmp);
jpayne@68 28578 Py_DECREF(tmp);
jpayne@68 28579 return val;
jpayne@68 28580 }
jpayne@68 28581 if (is_unsigned) {
jpayne@68 28582 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 28583 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
jpayne@68 28584 goto raise_neg_overflow;
jpayne@68 28585 } else if (__Pyx_PyLong_IsCompact(x)) {
jpayne@68 28586 __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
jpayne@68 28587 } else {
jpayne@68 28588 const digit* digits = __Pyx_PyLong_Digits(x);
jpayne@68 28589 assert(__Pyx_PyLong_DigitCount(x) > 1);
jpayne@68 28590 switch (__Pyx_PyLong_DigitCount(x)) {
jpayne@68 28591 case 2:
jpayne@68 28592 if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) {
jpayne@68 28593 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 28594 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28595 } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) {
jpayne@68 28596 return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
jpayne@68 28597 }
jpayne@68 28598 }
jpayne@68 28599 break;
jpayne@68 28600 case 3:
jpayne@68 28601 if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) {
jpayne@68 28602 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 28603 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28604 } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) {
jpayne@68 28605 return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
jpayne@68 28606 }
jpayne@68 28607 }
jpayne@68 28608 break;
jpayne@68 28609 case 4:
jpayne@68 28610 if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) {
jpayne@68 28611 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 28612 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28613 } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) {
jpayne@68 28614 return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
jpayne@68 28615 }
jpayne@68 28616 }
jpayne@68 28617 break;
jpayne@68 28618 }
jpayne@68 28619 }
jpayne@68 28620 #endif
jpayne@68 28621 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
jpayne@68 28622 if (unlikely(Py_SIZE(x) < 0)) {
jpayne@68 28623 goto raise_neg_overflow;
jpayne@68 28624 }
jpayne@68 28625 #else
jpayne@68 28626 {
jpayne@68 28627 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
jpayne@68 28628 if (unlikely(result < 0))
jpayne@68 28629 return (int32_t) -1;
jpayne@68 28630 if (unlikely(result == 1))
jpayne@68 28631 goto raise_neg_overflow;
jpayne@68 28632 }
jpayne@68 28633 #endif
jpayne@68 28634 if ((sizeof(int32_t) <= sizeof(unsigned long))) {
jpayne@68 28635 __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x))
jpayne@68 28636 #ifdef HAVE_LONG_LONG
jpayne@68 28637 } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) {
jpayne@68 28638 __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
jpayne@68 28639 #endif
jpayne@68 28640 }
jpayne@68 28641 } else {
jpayne@68 28642 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 28643 if (__Pyx_PyLong_IsCompact(x)) {
jpayne@68 28644 __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
jpayne@68 28645 } else {
jpayne@68 28646 const digit* digits = __Pyx_PyLong_Digits(x);
jpayne@68 28647 assert(__Pyx_PyLong_DigitCount(x) > 1);
jpayne@68 28648 switch (__Pyx_PyLong_SignedDigitCount(x)) {
jpayne@68 28649 case -2:
jpayne@68 28650 if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) {
jpayne@68 28651 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 28652 __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28653 } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 28654 return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
jpayne@68 28655 }
jpayne@68 28656 }
jpayne@68 28657 break;
jpayne@68 28658 case 2:
jpayne@68 28659 if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) {
jpayne@68 28660 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 28661 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28662 } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 28663 return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
jpayne@68 28664 }
jpayne@68 28665 }
jpayne@68 28666 break;
jpayne@68 28667 case -3:
jpayne@68 28668 if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 28669 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 28670 __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28671 } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 28672 return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
jpayne@68 28673 }
jpayne@68 28674 }
jpayne@68 28675 break;
jpayne@68 28676 case 3:
jpayne@68 28677 if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) {
jpayne@68 28678 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 28679 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28680 } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 28681 return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
jpayne@68 28682 }
jpayne@68 28683 }
jpayne@68 28684 break;
jpayne@68 28685 case -4:
jpayne@68 28686 if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 28687 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 28688 __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28689 } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) {
jpayne@68 28690 return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
jpayne@68 28691 }
jpayne@68 28692 }
jpayne@68 28693 break;
jpayne@68 28694 case 4:
jpayne@68 28695 if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) {
jpayne@68 28696 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 28697 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 28698 } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) {
jpayne@68 28699 return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
jpayne@68 28700 }
jpayne@68 28701 }
jpayne@68 28702 break;
jpayne@68 28703 }
jpayne@68 28704 }
jpayne@68 28705 #endif
jpayne@68 28706 if ((sizeof(int32_t) <= sizeof(long))) {
jpayne@68 28707 __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x))
jpayne@68 28708 #ifdef HAVE_LONG_LONG
jpayne@68 28709 } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) {
jpayne@68 28710 __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
jpayne@68 28711 #endif
jpayne@68 28712 }
jpayne@68 28713 }
jpayne@68 28714 {
jpayne@68 28715 int32_t val;
jpayne@68 28716 int ret = -1;
jpayne@68 28717 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 28718 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
jpayne@68 28719 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
jpayne@68 28720 if (unlikely(bytes_copied == -1)) {
jpayne@68 28721 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
jpayne@68 28722 goto raise_overflow;
jpayne@68 28723 } else {
jpayne@68 28724 ret = 0;
jpayne@68 28725 }
jpayne@68 28726 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
jpayne@68 28727 int one = 1; int is_little = (int)*(unsigned char *)&one;
jpayne@68 28728 unsigned char *bytes = (unsigned char *)&val;
jpayne@68 28729 ret = _PyLong_AsByteArray((PyLongObject *)x,
jpayne@68 28730 bytes, sizeof(val),
jpayne@68 28731 is_little, !is_unsigned);
jpayne@68 28732 #else
jpayne@68 28733 PyObject *v;
jpayne@68 28734 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
jpayne@68 28735 int bits, remaining_bits, is_negative = 0;
jpayne@68 28736 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
jpayne@68 28737 if (likely(PyLong_CheckExact(x))) {
jpayne@68 28738 v = __Pyx_NewRef(x);
jpayne@68 28739 } else {
jpayne@68 28740 v = PyNumber_Long(x);
jpayne@68 28741 if (unlikely(!v)) return (int32_t) -1;
jpayne@68 28742 assert(PyLong_CheckExact(v));
jpayne@68 28743 }
jpayne@68 28744 {
jpayne@68 28745 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
jpayne@68 28746 if (unlikely(result < 0)) {
jpayne@68 28747 Py_DECREF(v);
jpayne@68 28748 return (int32_t) -1;
jpayne@68 28749 }
jpayne@68 28750 is_negative = result == 1;
jpayne@68 28751 }
jpayne@68 28752 if (is_unsigned && unlikely(is_negative)) {
jpayne@68 28753 Py_DECREF(v);
jpayne@68 28754 goto raise_neg_overflow;
jpayne@68 28755 } else if (is_negative) {
jpayne@68 28756 stepval = PyNumber_Invert(v);
jpayne@68 28757 Py_DECREF(v);
jpayne@68 28758 if (unlikely(!stepval))
jpayne@68 28759 return (int32_t) -1;
jpayne@68 28760 } else {
jpayne@68 28761 stepval = v;
jpayne@68 28762 }
jpayne@68 28763 v = NULL;
jpayne@68 28764 val = (int32_t) 0;
jpayne@68 28765 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
jpayne@68 28766 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
jpayne@68 28767 for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) {
jpayne@68 28768 PyObject *tmp, *digit;
jpayne@68 28769 long idigit;
jpayne@68 28770 digit = PyNumber_And(stepval, mask);
jpayne@68 28771 if (unlikely(!digit)) goto done;
jpayne@68 28772 idigit = PyLong_AsLong(digit);
jpayne@68 28773 Py_DECREF(digit);
jpayne@68 28774 if (unlikely(idigit < 0)) goto done;
jpayne@68 28775 val |= ((int32_t) idigit) << bits;
jpayne@68 28776 tmp = PyNumber_Rshift(stepval, shift);
jpayne@68 28777 if (unlikely(!tmp)) goto done;
jpayne@68 28778 Py_DECREF(stepval); stepval = tmp;
jpayne@68 28779 }
jpayne@68 28780 Py_DECREF(shift); shift = NULL;
jpayne@68 28781 Py_DECREF(mask); mask = NULL;
jpayne@68 28782 {
jpayne@68 28783 long idigit = PyLong_AsLong(stepval);
jpayne@68 28784 if (unlikely(idigit < 0)) goto done;
jpayne@68 28785 remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1);
jpayne@68 28786 if (unlikely(idigit >= (1L << remaining_bits)))
jpayne@68 28787 goto raise_overflow;
jpayne@68 28788 val |= ((int32_t) idigit) << bits;
jpayne@68 28789 }
jpayne@68 28790 if (!is_unsigned) {
jpayne@68 28791 if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1))))
jpayne@68 28792 goto raise_overflow;
jpayne@68 28793 if (is_negative)
jpayne@68 28794 val = ~val;
jpayne@68 28795 }
jpayne@68 28796 ret = 0;
jpayne@68 28797 done:
jpayne@68 28798 Py_XDECREF(shift);
jpayne@68 28799 Py_XDECREF(mask);
jpayne@68 28800 Py_XDECREF(stepval);
jpayne@68 28801 #endif
jpayne@68 28802 if (unlikely(ret))
jpayne@68 28803 return (int32_t) -1;
jpayne@68 28804 return val;
jpayne@68 28805 }
jpayne@68 28806 raise_overflow:
jpayne@68 28807 PyErr_SetString(PyExc_OverflowError,
jpayne@68 28808 "value too large to convert to int32_t");
jpayne@68 28809 return (int32_t) -1;
jpayne@68 28810 raise_neg_overflow:
jpayne@68 28811 PyErr_SetString(PyExc_OverflowError,
jpayne@68 28812 "can't convert negative value to int32_t");
jpayne@68 28813 return (int32_t) -1;
jpayne@68 28814 }
jpayne@68 28815
jpayne@68 28816 /* CIntToPy */
jpayne@68 28817 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
jpayne@68 28818 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28819 #pragma GCC diagnostic push
jpayne@68 28820 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28821 #endif
jpayne@68 28822 const long neg_one = (long) -1, const_zero = (long) 0;
jpayne@68 28823 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28824 #pragma GCC diagnostic pop
jpayne@68 28825 #endif
jpayne@68 28826 const int is_unsigned = neg_one > const_zero;
jpayne@68 28827 if (is_unsigned) {
jpayne@68 28828 if (sizeof(long) < sizeof(long)) {
jpayne@68 28829 return PyInt_FromLong((long) value);
jpayne@68 28830 } else if (sizeof(long) <= sizeof(unsigned long)) {
jpayne@68 28831 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 28832 #ifdef HAVE_LONG_LONG
jpayne@68 28833 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 28834 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 28835 #endif
jpayne@68 28836 }
jpayne@68 28837 } else {
jpayne@68 28838 if (sizeof(long) <= sizeof(long)) {
jpayne@68 28839 return PyInt_FromLong((long) value);
jpayne@68 28840 #ifdef HAVE_LONG_LONG
jpayne@68 28841 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
jpayne@68 28842 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 28843 #endif
jpayne@68 28844 }
jpayne@68 28845 }
jpayne@68 28846 {
jpayne@68 28847 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 28848 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 28849 if (is_unsigned) {
jpayne@68 28850 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28851 } else {
jpayne@68 28852 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28853 }
jpayne@68 28854 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 28855 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28856 return _PyLong_FromByteArray(bytes, sizeof(long),
jpayne@68 28857 little, !is_unsigned);
jpayne@68 28858 #else
jpayne@68 28859 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28860 PyObject *from_bytes, *result = NULL;
jpayne@68 28861 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 28862 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 28863 if (!from_bytes) return NULL;
jpayne@68 28864 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
jpayne@68 28865 if (!py_bytes) goto limited_bad;
jpayne@68 28866 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 28867 if (!order_str) goto limited_bad;
jpayne@68 28868 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 28869 if (!arg_tuple) goto limited_bad;
jpayne@68 28870 if (!is_unsigned) {
jpayne@68 28871 kwds = PyDict_New();
jpayne@68 28872 if (!kwds) goto limited_bad;
jpayne@68 28873 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 28874 }
jpayne@68 28875 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 28876 limited_bad:
jpayne@68 28877 Py_XDECREF(kwds);
jpayne@68 28878 Py_XDECREF(arg_tuple);
jpayne@68 28879 Py_XDECREF(order_str);
jpayne@68 28880 Py_XDECREF(py_bytes);
jpayne@68 28881 Py_XDECREF(from_bytes);
jpayne@68 28882 return result;
jpayne@68 28883 #endif
jpayne@68 28884 }
jpayne@68 28885 }
jpayne@68 28886
jpayne@68 28887 /* CIntToPy */
jpayne@68 28888 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
jpayne@68 28889 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28890 #pragma GCC diagnostic push
jpayne@68 28891 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28892 #endif
jpayne@68 28893 const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
jpayne@68 28894 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28895 #pragma GCC diagnostic pop
jpayne@68 28896 #endif
jpayne@68 28897 const int is_unsigned = neg_one > const_zero;
jpayne@68 28898 if (is_unsigned) {
jpayne@68 28899 if (sizeof(int32_t) < sizeof(long)) {
jpayne@68 28900 return PyInt_FromLong((long) value);
jpayne@68 28901 } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
jpayne@68 28902 return PyLong_FromUnsignedLong((unsigned long) value);
jpayne@68 28903 #ifdef HAVE_LONG_LONG
jpayne@68 28904 } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
jpayne@68 28905 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
jpayne@68 28906 #endif
jpayne@68 28907 }
jpayne@68 28908 } else {
jpayne@68 28909 if (sizeof(int32_t) <= sizeof(long)) {
jpayne@68 28910 return PyInt_FromLong((long) value);
jpayne@68 28911 #ifdef HAVE_LONG_LONG
jpayne@68 28912 } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
jpayne@68 28913 return PyLong_FromLongLong((PY_LONG_LONG) value);
jpayne@68 28914 #endif
jpayne@68 28915 }
jpayne@68 28916 }
jpayne@68 28917 {
jpayne@68 28918 unsigned char *bytes = (unsigned char *)&value;
jpayne@68 28919 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
jpayne@68 28920 if (is_unsigned) {
jpayne@68 28921 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28922 } else {
jpayne@68 28923 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
jpayne@68 28924 }
jpayne@68 28925 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
jpayne@68 28926 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28927 return _PyLong_FromByteArray(bytes, sizeof(int32_t),
jpayne@68 28928 little, !is_unsigned);
jpayne@68 28929 #else
jpayne@68 28930 int one = 1; int little = (int)*(unsigned char *)&one;
jpayne@68 28931 PyObject *from_bytes, *result = NULL;
jpayne@68 28932 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
jpayne@68 28933 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
jpayne@68 28934 if (!from_bytes) return NULL;
jpayne@68 28935 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t));
jpayne@68 28936 if (!py_bytes) goto limited_bad;
jpayne@68 28937 order_str = PyUnicode_FromString(little ? "little" : "big");
jpayne@68 28938 if (!order_str) goto limited_bad;
jpayne@68 28939 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
jpayne@68 28940 if (!arg_tuple) goto limited_bad;
jpayne@68 28941 if (!is_unsigned) {
jpayne@68 28942 kwds = PyDict_New();
jpayne@68 28943 if (!kwds) goto limited_bad;
jpayne@68 28944 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
jpayne@68 28945 }
jpayne@68 28946 result = PyObject_Call(from_bytes, arg_tuple, kwds);
jpayne@68 28947 limited_bad:
jpayne@68 28948 Py_XDECREF(kwds);
jpayne@68 28949 Py_XDECREF(arg_tuple);
jpayne@68 28950 Py_XDECREF(order_str);
jpayne@68 28951 Py_XDECREF(py_bytes);
jpayne@68 28952 Py_XDECREF(from_bytes);
jpayne@68 28953 return result;
jpayne@68 28954 #endif
jpayne@68 28955 }
jpayne@68 28956 }
jpayne@68 28957
jpayne@68 28958 /* FormatTypeName */
jpayne@68 28959 #if CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 28960 static __Pyx_TypeName
jpayne@68 28961 __Pyx_PyType_GetName(PyTypeObject* tp)
jpayne@68 28962 {
jpayne@68 28963 PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
jpayne@68 28964 __pyx_n_s_name_2);
jpayne@68 28965 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
jpayne@68 28966 PyErr_Clear();
jpayne@68 28967 Py_XDECREF(name);
jpayne@68 28968 name = __Pyx_NewRef(__pyx_n_s__97);
jpayne@68 28969 }
jpayne@68 28970 return name;
jpayne@68 28971 }
jpayne@68 28972 #endif
jpayne@68 28973
jpayne@68 28974 /* CIntFromPy */
jpayne@68 28975 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
jpayne@68 28976 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28977 #pragma GCC diagnostic push
jpayne@68 28978 #pragma GCC diagnostic ignored "-Wconversion"
jpayne@68 28979 #endif
jpayne@68 28980 const long neg_one = (long) -1, const_zero = (long) 0;
jpayne@68 28981 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
jpayne@68 28982 #pragma GCC diagnostic pop
jpayne@68 28983 #endif
jpayne@68 28984 const int is_unsigned = neg_one > const_zero;
jpayne@68 28985 #if PY_MAJOR_VERSION < 3
jpayne@68 28986 if (likely(PyInt_Check(x))) {
jpayne@68 28987 if ((sizeof(long) < sizeof(long))) {
jpayne@68 28988 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
jpayne@68 28989 } else {
jpayne@68 28990 long val = PyInt_AS_LONG(x);
jpayne@68 28991 if (is_unsigned && unlikely(val < 0)) {
jpayne@68 28992 goto raise_neg_overflow;
jpayne@68 28993 }
jpayne@68 28994 return (long) val;
jpayne@68 28995 }
jpayne@68 28996 }
jpayne@68 28997 #endif
jpayne@68 28998 if (unlikely(!PyLong_Check(x))) {
jpayne@68 28999 long val;
jpayne@68 29000 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
jpayne@68 29001 if (!tmp) return (long) -1;
jpayne@68 29002 val = __Pyx_PyInt_As_long(tmp);
jpayne@68 29003 Py_DECREF(tmp);
jpayne@68 29004 return val;
jpayne@68 29005 }
jpayne@68 29006 if (is_unsigned) {
jpayne@68 29007 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 29008 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
jpayne@68 29009 goto raise_neg_overflow;
jpayne@68 29010 } else if (__Pyx_PyLong_IsCompact(x)) {
jpayne@68 29011 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
jpayne@68 29012 } else {
jpayne@68 29013 const digit* digits = __Pyx_PyLong_Digits(x);
jpayne@68 29014 assert(__Pyx_PyLong_DigitCount(x) > 1);
jpayne@68 29015 switch (__Pyx_PyLong_DigitCount(x)) {
jpayne@68 29016 case 2:
jpayne@68 29017 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
jpayne@68 29018 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 29019 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29020 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
jpayne@68 29021 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
jpayne@68 29022 }
jpayne@68 29023 }
jpayne@68 29024 break;
jpayne@68 29025 case 3:
jpayne@68 29026 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
jpayne@68 29027 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 29028 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29029 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
jpayne@68 29030 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
jpayne@68 29031 }
jpayne@68 29032 }
jpayne@68 29033 break;
jpayne@68 29034 case 4:
jpayne@68 29035 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
jpayne@68 29036 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 29037 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29038 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
jpayne@68 29039 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
jpayne@68 29040 }
jpayne@68 29041 }
jpayne@68 29042 break;
jpayne@68 29043 }
jpayne@68 29044 }
jpayne@68 29045 #endif
jpayne@68 29046 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
jpayne@68 29047 if (unlikely(Py_SIZE(x) < 0)) {
jpayne@68 29048 goto raise_neg_overflow;
jpayne@68 29049 }
jpayne@68 29050 #else
jpayne@68 29051 {
jpayne@68 29052 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
jpayne@68 29053 if (unlikely(result < 0))
jpayne@68 29054 return (long) -1;
jpayne@68 29055 if (unlikely(result == 1))
jpayne@68 29056 goto raise_neg_overflow;
jpayne@68 29057 }
jpayne@68 29058 #endif
jpayne@68 29059 if ((sizeof(long) <= sizeof(unsigned long))) {
jpayne@68 29060 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
jpayne@68 29061 #ifdef HAVE_LONG_LONG
jpayne@68 29062 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
jpayne@68 29063 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
jpayne@68 29064 #endif
jpayne@68 29065 }
jpayne@68 29066 } else {
jpayne@68 29067 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 29068 if (__Pyx_PyLong_IsCompact(x)) {
jpayne@68 29069 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
jpayne@68 29070 } else {
jpayne@68 29071 const digit* digits = __Pyx_PyLong_Digits(x);
jpayne@68 29072 assert(__Pyx_PyLong_DigitCount(x) > 1);
jpayne@68 29073 switch (__Pyx_PyLong_SignedDigitCount(x)) {
jpayne@68 29074 case -2:
jpayne@68 29075 if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
jpayne@68 29076 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 29077 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29078 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 29079 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
jpayne@68 29080 }
jpayne@68 29081 }
jpayne@68 29082 break;
jpayne@68 29083 case 2:
jpayne@68 29084 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
jpayne@68 29085 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
jpayne@68 29086 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29087 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 29088 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
jpayne@68 29089 }
jpayne@68 29090 }
jpayne@68 29091 break;
jpayne@68 29092 case -3:
jpayne@68 29093 if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
jpayne@68 29094 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 29095 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29096 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 29097 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
jpayne@68 29098 }
jpayne@68 29099 }
jpayne@68 29100 break;
jpayne@68 29101 case 3:
jpayne@68 29102 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
jpayne@68 29103 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
jpayne@68 29104 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29105 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 29106 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
jpayne@68 29107 }
jpayne@68 29108 }
jpayne@68 29109 break;
jpayne@68 29110 case -4:
jpayne@68 29111 if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
jpayne@68 29112 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 29113 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29114 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
jpayne@68 29115 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
jpayne@68 29116 }
jpayne@68 29117 }
jpayne@68 29118 break;
jpayne@68 29119 case 4:
jpayne@68 29120 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
jpayne@68 29121 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
jpayne@68 29122 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
jpayne@68 29123 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
jpayne@68 29124 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
jpayne@68 29125 }
jpayne@68 29126 }
jpayne@68 29127 break;
jpayne@68 29128 }
jpayne@68 29129 }
jpayne@68 29130 #endif
jpayne@68 29131 if ((sizeof(long) <= sizeof(long))) {
jpayne@68 29132 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
jpayne@68 29133 #ifdef HAVE_LONG_LONG
jpayne@68 29134 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
jpayne@68 29135 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
jpayne@68 29136 #endif
jpayne@68 29137 }
jpayne@68 29138 }
jpayne@68 29139 {
jpayne@68 29140 long val;
jpayne@68 29141 int ret = -1;
jpayne@68 29142 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
jpayne@68 29143 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
jpayne@68 29144 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
jpayne@68 29145 if (unlikely(bytes_copied == -1)) {
jpayne@68 29146 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
jpayne@68 29147 goto raise_overflow;
jpayne@68 29148 } else {
jpayne@68 29149 ret = 0;
jpayne@68 29150 }
jpayne@68 29151 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
jpayne@68 29152 int one = 1; int is_little = (int)*(unsigned char *)&one;
jpayne@68 29153 unsigned char *bytes = (unsigned char *)&val;
jpayne@68 29154 ret = _PyLong_AsByteArray((PyLongObject *)x,
jpayne@68 29155 bytes, sizeof(val),
jpayne@68 29156 is_little, !is_unsigned);
jpayne@68 29157 #else
jpayne@68 29158 PyObject *v;
jpayne@68 29159 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
jpayne@68 29160 int bits, remaining_bits, is_negative = 0;
jpayne@68 29161 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
jpayne@68 29162 if (likely(PyLong_CheckExact(x))) {
jpayne@68 29163 v = __Pyx_NewRef(x);
jpayne@68 29164 } else {
jpayne@68 29165 v = PyNumber_Long(x);
jpayne@68 29166 if (unlikely(!v)) return (long) -1;
jpayne@68 29167 assert(PyLong_CheckExact(v));
jpayne@68 29168 }
jpayne@68 29169 {
jpayne@68 29170 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
jpayne@68 29171 if (unlikely(result < 0)) {
jpayne@68 29172 Py_DECREF(v);
jpayne@68 29173 return (long) -1;
jpayne@68 29174 }
jpayne@68 29175 is_negative = result == 1;
jpayne@68 29176 }
jpayne@68 29177 if (is_unsigned && unlikely(is_negative)) {
jpayne@68 29178 Py_DECREF(v);
jpayne@68 29179 goto raise_neg_overflow;
jpayne@68 29180 } else if (is_negative) {
jpayne@68 29181 stepval = PyNumber_Invert(v);
jpayne@68 29182 Py_DECREF(v);
jpayne@68 29183 if (unlikely(!stepval))
jpayne@68 29184 return (long) -1;
jpayne@68 29185 } else {
jpayne@68 29186 stepval = v;
jpayne@68 29187 }
jpayne@68 29188 v = NULL;
jpayne@68 29189 val = (long) 0;
jpayne@68 29190 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
jpayne@68 29191 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
jpayne@68 29192 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
jpayne@68 29193 PyObject *tmp, *digit;
jpayne@68 29194 long idigit;
jpayne@68 29195 digit = PyNumber_And(stepval, mask);
jpayne@68 29196 if (unlikely(!digit)) goto done;
jpayne@68 29197 idigit = PyLong_AsLong(digit);
jpayne@68 29198 Py_DECREF(digit);
jpayne@68 29199 if (unlikely(idigit < 0)) goto done;
jpayne@68 29200 val |= ((long) idigit) << bits;
jpayne@68 29201 tmp = PyNumber_Rshift(stepval, shift);
jpayne@68 29202 if (unlikely(!tmp)) goto done;
jpayne@68 29203 Py_DECREF(stepval); stepval = tmp;
jpayne@68 29204 }
jpayne@68 29205 Py_DECREF(shift); shift = NULL;
jpayne@68 29206 Py_DECREF(mask); mask = NULL;
jpayne@68 29207 {
jpayne@68 29208 long idigit = PyLong_AsLong(stepval);
jpayne@68 29209 if (unlikely(idigit < 0)) goto done;
jpayne@68 29210 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
jpayne@68 29211 if (unlikely(idigit >= (1L << remaining_bits)))
jpayne@68 29212 goto raise_overflow;
jpayne@68 29213 val |= ((long) idigit) << bits;
jpayne@68 29214 }
jpayne@68 29215 if (!is_unsigned) {
jpayne@68 29216 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
jpayne@68 29217 goto raise_overflow;
jpayne@68 29218 if (is_negative)
jpayne@68 29219 val = ~val;
jpayne@68 29220 }
jpayne@68 29221 ret = 0;
jpayne@68 29222 done:
jpayne@68 29223 Py_XDECREF(shift);
jpayne@68 29224 Py_XDECREF(mask);
jpayne@68 29225 Py_XDECREF(stepval);
jpayne@68 29226 #endif
jpayne@68 29227 if (unlikely(ret))
jpayne@68 29228 return (long) -1;
jpayne@68 29229 return val;
jpayne@68 29230 }
jpayne@68 29231 raise_overflow:
jpayne@68 29232 PyErr_SetString(PyExc_OverflowError,
jpayne@68 29233 "value too large to convert to long");
jpayne@68 29234 return (long) -1;
jpayne@68 29235 raise_neg_overflow:
jpayne@68 29236 PyErr_SetString(PyExc_OverflowError,
jpayne@68 29237 "can't convert negative value to long");
jpayne@68 29238 return (long) -1;
jpayne@68 29239 }
jpayne@68 29240
jpayne@68 29241 /* FastTypeChecks */
jpayne@68 29242 #if CYTHON_COMPILING_IN_CPYTHON
jpayne@68 29243 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
jpayne@68 29244 while (a) {
jpayne@68 29245 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
jpayne@68 29246 if (a == b)
jpayne@68 29247 return 1;
jpayne@68 29248 }
jpayne@68 29249 return b == &PyBaseObject_Type;
jpayne@68 29250 }
jpayne@68 29251 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
jpayne@68 29252 PyObject *mro;
jpayne@68 29253 if (a == b) return 1;
jpayne@68 29254 mro = a->tp_mro;
jpayne@68 29255 if (likely(mro)) {
jpayne@68 29256 Py_ssize_t i, n;
jpayne@68 29257 n = PyTuple_GET_SIZE(mro);
jpayne@68 29258 for (i = 0; i < n; i++) {
jpayne@68 29259 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
jpayne@68 29260 return 1;
jpayne@68 29261 }
jpayne@68 29262 return 0;
jpayne@68 29263 }
jpayne@68 29264 return __Pyx_InBases(a, b);
jpayne@68 29265 }
jpayne@68 29266 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
jpayne@68 29267 PyObject *mro;
jpayne@68 29268 if (cls == a || cls == b) return 1;
jpayne@68 29269 mro = cls->tp_mro;
jpayne@68 29270 if (likely(mro)) {
jpayne@68 29271 Py_ssize_t i, n;
jpayne@68 29272 n = PyTuple_GET_SIZE(mro);
jpayne@68 29273 for (i = 0; i < n; i++) {
jpayne@68 29274 PyObject *base = PyTuple_GET_ITEM(mro, i);
jpayne@68 29275 if (base == (PyObject *)a || base == (PyObject *)b)
jpayne@68 29276 return 1;
jpayne@68 29277 }
jpayne@68 29278 return 0;
jpayne@68 29279 }
jpayne@68 29280 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
jpayne@68 29281 }
jpayne@68 29282 #if PY_MAJOR_VERSION == 2
jpayne@68 29283 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
jpayne@68 29284 PyObject *exception, *value, *tb;
jpayne@68 29285 int res;
jpayne@68 29286 __Pyx_PyThreadState_declare
jpayne@68 29287 __Pyx_PyThreadState_assign
jpayne@68 29288 __Pyx_ErrFetch(&exception, &value, &tb);
jpayne@68 29289 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
jpayne@68 29290 if (unlikely(res == -1)) {
jpayne@68 29291 PyErr_WriteUnraisable(err);
jpayne@68 29292 res = 0;
jpayne@68 29293 }
jpayne@68 29294 if (!res) {
jpayne@68 29295 res = PyObject_IsSubclass(err, exc_type2);
jpayne@68 29296 if (unlikely(res == -1)) {
jpayne@68 29297 PyErr_WriteUnraisable(err);
jpayne@68 29298 res = 0;
jpayne@68 29299 }
jpayne@68 29300 }
jpayne@68 29301 __Pyx_ErrRestore(exception, value, tb);
jpayne@68 29302 return res;
jpayne@68 29303 }
jpayne@68 29304 #else
jpayne@68 29305 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
jpayne@68 29306 if (exc_type1) {
jpayne@68 29307 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
jpayne@68 29308 } else {
jpayne@68 29309 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
jpayne@68 29310 }
jpayne@68 29311 }
jpayne@68 29312 #endif
jpayne@68 29313 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
jpayne@68 29314 Py_ssize_t i, n;
jpayne@68 29315 assert(PyExceptionClass_Check(exc_type));
jpayne@68 29316 n = PyTuple_GET_SIZE(tuple);
jpayne@68 29317 #if PY_MAJOR_VERSION >= 3
jpayne@68 29318 for (i=0; i<n; i++) {
jpayne@68 29319 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
jpayne@68 29320 }
jpayne@68 29321 #endif
jpayne@68 29322 for (i=0; i<n; i++) {
jpayne@68 29323 PyObject *t = PyTuple_GET_ITEM(tuple, i);
jpayne@68 29324 #if PY_MAJOR_VERSION < 3
jpayne@68 29325 if (likely(exc_type == t)) return 1;
jpayne@68 29326 #endif
jpayne@68 29327 if (likely(PyExceptionClass_Check(t))) {
jpayne@68 29328 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
jpayne@68 29329 } else {
jpayne@68 29330 }
jpayne@68 29331 }
jpayne@68 29332 return 0;
jpayne@68 29333 }
jpayne@68 29334 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
jpayne@68 29335 if (likely(err == exc_type)) return 1;
jpayne@68 29336 if (likely(PyExceptionClass_Check(err))) {
jpayne@68 29337 if (likely(PyExceptionClass_Check(exc_type))) {
jpayne@68 29338 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
jpayne@68 29339 } else if (likely(PyTuple_Check(exc_type))) {
jpayne@68 29340 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
jpayne@68 29341 } else {
jpayne@68 29342 }
jpayne@68 29343 }
jpayne@68 29344 return PyErr_GivenExceptionMatches(err, exc_type);
jpayne@68 29345 }
jpayne@68 29346 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
jpayne@68 29347 assert(PyExceptionClass_Check(exc_type1));
jpayne@68 29348 assert(PyExceptionClass_Check(exc_type2));
jpayne@68 29349 if (likely(err == exc_type1 || err == exc_type2)) return 1;
jpayne@68 29350 if (likely(PyExceptionClass_Check(err))) {
jpayne@68 29351 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
jpayne@68 29352 }
jpayne@68 29353 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
jpayne@68 29354 }
jpayne@68 29355 #endif
jpayne@68 29356
jpayne@68 29357 /* CheckBinaryVersion */
jpayne@68 29358 static unsigned long __Pyx_get_runtime_version(void) {
jpayne@68 29359 #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
jpayne@68 29360 return Py_Version & ~0xFFUL;
jpayne@68 29361 #else
jpayne@68 29362 const char* rt_version = Py_GetVersion();
jpayne@68 29363 unsigned long version = 0;
jpayne@68 29364 unsigned long factor = 0x01000000UL;
jpayne@68 29365 unsigned int digit = 0;
jpayne@68 29366 int i = 0;
jpayne@68 29367 while (factor) {
jpayne@68 29368 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
jpayne@68 29369 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
jpayne@68 29370 ++i;
jpayne@68 29371 }
jpayne@68 29372 version += factor * digit;
jpayne@68 29373 if (rt_version[i] != '.')
jpayne@68 29374 break;
jpayne@68 29375 digit = 0;
jpayne@68 29376 factor >>= 8;
jpayne@68 29377 ++i;
jpayne@68 29378 }
jpayne@68 29379 return version;
jpayne@68 29380 #endif
jpayne@68 29381 }
jpayne@68 29382 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
jpayne@68 29383 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
jpayne@68 29384 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
jpayne@68 29385 return 0;
jpayne@68 29386 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
jpayne@68 29387 return 1;
jpayne@68 29388 {
jpayne@68 29389 char message[200];
jpayne@68 29390 PyOS_snprintf(message, sizeof(message),
jpayne@68 29391 "compile time Python version %d.%d "
jpayne@68 29392 "of module '%.100s' "
jpayne@68 29393 "%s "
jpayne@68 29394 "runtime version %d.%d",
jpayne@68 29395 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
jpayne@68 29396 __Pyx_MODULE_NAME,
jpayne@68 29397 (allow_newer) ? "was newer than" : "does not match",
jpayne@68 29398 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
jpayne@68 29399 );
jpayne@68 29400 return PyErr_WarnEx(NULL, message, 1);
jpayne@68 29401 }
jpayne@68 29402 }
jpayne@68 29403
jpayne@68 29404 /* FunctionImport */
jpayne@68 29405 #ifndef __PYX_HAVE_RT_ImportFunction_3_0_11
jpayne@68 29406 #define __PYX_HAVE_RT_ImportFunction_3_0_11
jpayne@68 29407 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
jpayne@68 29408 PyObject *d = 0;
jpayne@68 29409 PyObject *cobj = 0;
jpayne@68 29410 union {
jpayne@68 29411 void (*fp)(void);
jpayne@68 29412 void *p;
jpayne@68 29413 } tmp;
jpayne@68 29414 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
jpayne@68 29415 if (!d)
jpayne@68 29416 goto bad;
jpayne@68 29417 cobj = PyDict_GetItemString(d, funcname);
jpayne@68 29418 if (!cobj) {
jpayne@68 29419 PyErr_Format(PyExc_ImportError,
jpayne@68 29420 "%.200s does not export expected C function %.200s",
jpayne@68 29421 PyModule_GetName(module), funcname);
jpayne@68 29422 goto bad;
jpayne@68 29423 }
jpayne@68 29424 if (!PyCapsule_IsValid(cobj, sig)) {
jpayne@68 29425 PyErr_Format(PyExc_TypeError,
jpayne@68 29426 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
jpayne@68 29427 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
jpayne@68 29428 goto bad;
jpayne@68 29429 }
jpayne@68 29430 tmp.p = PyCapsule_GetPointer(cobj, sig);
jpayne@68 29431 *f = tmp.fp;
jpayne@68 29432 if (!(*f))
jpayne@68 29433 goto bad;
jpayne@68 29434 Py_DECREF(d);
jpayne@68 29435 return 0;
jpayne@68 29436 bad:
jpayne@68 29437 Py_XDECREF(d);
jpayne@68 29438 return -1;
jpayne@68 29439 }
jpayne@68 29440 #endif
jpayne@68 29441
jpayne@68 29442 /* InitStrings */
jpayne@68 29443 #if PY_MAJOR_VERSION >= 3
jpayne@68 29444 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
jpayne@68 29445 if (t.is_unicode | t.is_str) {
jpayne@68 29446 if (t.intern) {
jpayne@68 29447 *str = PyUnicode_InternFromString(t.s);
jpayne@68 29448 } else if (t.encoding) {
jpayne@68 29449 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
jpayne@68 29450 } else {
jpayne@68 29451 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
jpayne@68 29452 }
jpayne@68 29453 } else {
jpayne@68 29454 *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
jpayne@68 29455 }
jpayne@68 29456 if (!*str)
jpayne@68 29457 return -1;
jpayne@68 29458 if (PyObject_Hash(*str) == -1)
jpayne@68 29459 return -1;
jpayne@68 29460 return 0;
jpayne@68 29461 }
jpayne@68 29462 #endif
jpayne@68 29463 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
jpayne@68 29464 while (t->p) {
jpayne@68 29465 #if PY_MAJOR_VERSION >= 3
jpayne@68 29466 __Pyx_InitString(*t, t->p);
jpayne@68 29467 #else
jpayne@68 29468 if (t->is_unicode) {
jpayne@68 29469 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
jpayne@68 29470 } else if (t->intern) {
jpayne@68 29471 *t->p = PyString_InternFromString(t->s);
jpayne@68 29472 } else {
jpayne@68 29473 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
jpayne@68 29474 }
jpayne@68 29475 if (!*t->p)
jpayne@68 29476 return -1;
jpayne@68 29477 if (PyObject_Hash(*t->p) == -1)
jpayne@68 29478 return -1;
jpayne@68 29479 #endif
jpayne@68 29480 ++t;
jpayne@68 29481 }
jpayne@68 29482 return 0;
jpayne@68 29483 }
jpayne@68 29484
jpayne@68 29485 #include <string.h>
jpayne@68 29486 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
jpayne@68 29487 size_t len = strlen(s);
jpayne@68 29488 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
jpayne@68 29489 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
jpayne@68 29490 return -1;
jpayne@68 29491 }
jpayne@68 29492 return (Py_ssize_t) len;
jpayne@68 29493 }
jpayne@68 29494 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
jpayne@68 29495 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
jpayne@68 29496 if (unlikely(len < 0)) return NULL;
jpayne@68 29497 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
jpayne@68 29498 }
jpayne@68 29499 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
jpayne@68 29500 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
jpayne@68 29501 if (unlikely(len < 0)) return NULL;
jpayne@68 29502 return PyByteArray_FromStringAndSize(c_str, len);
jpayne@68 29503 }
jpayne@68 29504 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
jpayne@68 29505 Py_ssize_t ignore;
jpayne@68 29506 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
jpayne@68 29507 }
jpayne@68 29508 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
jpayne@68 29509 #if !CYTHON_PEP393_ENABLED
jpayne@68 29510 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
jpayne@68 29511 char* defenc_c;
jpayne@68 29512 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
jpayne@68 29513 if (!defenc) return NULL;
jpayne@68 29514 defenc_c = PyBytes_AS_STRING(defenc);
jpayne@68 29515 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
jpayne@68 29516 {
jpayne@68 29517 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
jpayne@68 29518 char* c;
jpayne@68 29519 for (c = defenc_c; c < end; c++) {
jpayne@68 29520 if ((unsigned char) (*c) >= 128) {
jpayne@68 29521 PyUnicode_AsASCIIString(o);
jpayne@68 29522 return NULL;
jpayne@68 29523 }
jpayne@68 29524 }
jpayne@68 29525 }
jpayne@68 29526 #endif
jpayne@68 29527 *length = PyBytes_GET_SIZE(defenc);
jpayne@68 29528 return defenc_c;
jpayne@68 29529 }
jpayne@68 29530 #else
jpayne@68 29531 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
jpayne@68 29532 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
jpayne@68 29533 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
jpayne@68 29534 if (likely(PyUnicode_IS_ASCII(o))) {
jpayne@68 29535 *length = PyUnicode_GET_LENGTH(o);
jpayne@68 29536 return PyUnicode_AsUTF8(o);
jpayne@68 29537 } else {
jpayne@68 29538 PyUnicode_AsASCIIString(o);
jpayne@68 29539 return NULL;
jpayne@68 29540 }
jpayne@68 29541 #else
jpayne@68 29542 return PyUnicode_AsUTF8AndSize(o, length);
jpayne@68 29543 #endif
jpayne@68 29544 }
jpayne@68 29545 #endif
jpayne@68 29546 #endif
jpayne@68 29547 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
jpayne@68 29548 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
jpayne@68 29549 if (
jpayne@68 29550 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
jpayne@68 29551 __Pyx_sys_getdefaultencoding_not_ascii &&
jpayne@68 29552 #endif
jpayne@68 29553 PyUnicode_Check(o)) {
jpayne@68 29554 return __Pyx_PyUnicode_AsStringAndSize(o, length);
jpayne@68 29555 } else
jpayne@68 29556 #endif
jpayne@68 29557 #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
jpayne@68 29558 if (PyByteArray_Check(o)) {
jpayne@68 29559 *length = PyByteArray_GET_SIZE(o);
jpayne@68 29560 return PyByteArray_AS_STRING(o);
jpayne@68 29561 } else
jpayne@68 29562 #endif
jpayne@68 29563 {
jpayne@68 29564 char* result;
jpayne@68 29565 int r = PyBytes_AsStringAndSize(o, &result, length);
jpayne@68 29566 if (unlikely(r < 0)) {
jpayne@68 29567 return NULL;
jpayne@68 29568 } else {
jpayne@68 29569 return result;
jpayne@68 29570 }
jpayne@68 29571 }
jpayne@68 29572 }
jpayne@68 29573 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
jpayne@68 29574 int is_true = x == Py_True;
jpayne@68 29575 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
jpayne@68 29576 else return PyObject_IsTrue(x);
jpayne@68 29577 }
jpayne@68 29578 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
jpayne@68 29579 int retval;
jpayne@68 29580 if (unlikely(!x)) return -1;
jpayne@68 29581 retval = __Pyx_PyObject_IsTrue(x);
jpayne@68 29582 Py_DECREF(x);
jpayne@68 29583 return retval;
jpayne@68 29584 }
jpayne@68 29585 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
jpayne@68 29586 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
jpayne@68 29587 #if PY_MAJOR_VERSION >= 3
jpayne@68 29588 if (PyLong_Check(result)) {
jpayne@68 29589 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
jpayne@68 29590 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
jpayne@68 29591 "The ability to return an instance of a strict subclass of int is deprecated, "
jpayne@68 29592 "and may be removed in a future version of Python.",
jpayne@68 29593 result_type_name)) {
jpayne@68 29594 __Pyx_DECREF_TypeName(result_type_name);
jpayne@68 29595 Py_DECREF(result);
jpayne@68 29596 return NULL;
jpayne@68 29597 }
jpayne@68 29598 __Pyx_DECREF_TypeName(result_type_name);
jpayne@68 29599 return result;
jpayne@68 29600 }
jpayne@68 29601 #endif
jpayne@68 29602 PyErr_Format(PyExc_TypeError,
jpayne@68 29603 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
jpayne@68 29604 type_name, type_name, result_type_name);
jpayne@68 29605 __Pyx_DECREF_TypeName(result_type_name);
jpayne@68 29606 Py_DECREF(result);
jpayne@68 29607 return NULL;
jpayne@68 29608 }
jpayne@68 29609 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
jpayne@68 29610 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 29611 PyNumberMethods *m;
jpayne@68 29612 #endif
jpayne@68 29613 const char *name = NULL;
jpayne@68 29614 PyObject *res = NULL;
jpayne@68 29615 #if PY_MAJOR_VERSION < 3
jpayne@68 29616 if (likely(PyInt_Check(x) || PyLong_Check(x)))
jpayne@68 29617 #else
jpayne@68 29618 if (likely(PyLong_Check(x)))
jpayne@68 29619 #endif
jpayne@68 29620 return __Pyx_NewRef(x);
jpayne@68 29621 #if CYTHON_USE_TYPE_SLOTS
jpayne@68 29622 m = Py_TYPE(x)->tp_as_number;
jpayne@68 29623 #if PY_MAJOR_VERSION < 3
jpayne@68 29624 if (m && m->nb_int) {
jpayne@68 29625 name = "int";
jpayne@68 29626 res = m->nb_int(x);
jpayne@68 29627 }
jpayne@68 29628 else if (m && m->nb_long) {
jpayne@68 29629 name = "long";
jpayne@68 29630 res = m->nb_long(x);
jpayne@68 29631 }
jpayne@68 29632 #else
jpayne@68 29633 if (likely(m && m->nb_int)) {
jpayne@68 29634 name = "int";
jpayne@68 29635 res = m->nb_int(x);
jpayne@68 29636 }
jpayne@68 29637 #endif
jpayne@68 29638 #else
jpayne@68 29639 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
jpayne@68 29640 res = PyNumber_Int(x);
jpayne@68 29641 }
jpayne@68 29642 #endif
jpayne@68 29643 if (likely(res)) {
jpayne@68 29644 #if PY_MAJOR_VERSION < 3
jpayne@68 29645 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
jpayne@68 29646 #else
jpayne@68 29647 if (unlikely(!PyLong_CheckExact(res))) {
jpayne@68 29648 #endif
jpayne@68 29649 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
jpayne@68 29650 }
jpayne@68 29651 }
jpayne@68 29652 else if (!PyErr_Occurred()) {
jpayne@68 29653 PyErr_SetString(PyExc_TypeError,
jpayne@68 29654 "an integer is required");
jpayne@68 29655 }
jpayne@68 29656 return res;
jpayne@68 29657 }
jpayne@68 29658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
jpayne@68 29659 Py_ssize_t ival;
jpayne@68 29660 PyObject *x;
jpayne@68 29661 #if PY_MAJOR_VERSION < 3
jpayne@68 29662 if (likely(PyInt_CheckExact(b))) {
jpayne@68 29663 if (sizeof(Py_ssize_t) >= sizeof(long))
jpayne@68 29664 return PyInt_AS_LONG(b);
jpayne@68 29665 else
jpayne@68 29666 return PyInt_AsSsize_t(b);
jpayne@68 29667 }
jpayne@68 29668 #endif
jpayne@68 29669 if (likely(PyLong_CheckExact(b))) {
jpayne@68 29670 #if CYTHON_USE_PYLONG_INTERNALS
jpayne@68 29671 if (likely(__Pyx_PyLong_IsCompact(b))) {
jpayne@68 29672 return __Pyx_PyLong_CompactValue(b);
jpayne@68 29673 } else {
jpayne@68 29674 const digit* digits = __Pyx_PyLong_Digits(b);
jpayne@68 29675 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
jpayne@68 29676 switch (size) {
jpayne@68 29677 case 2:
jpayne@68 29678 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
jpayne@68 29679 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
jpayne@68 29680 }
jpayne@68 29681 break;
jpayne@68 29682 case -2:
jpayne@68 29683 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
jpayne@68 29684 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
jpayne@68 29685 }
jpayne@68 29686 break;
jpayne@68 29687 case 3:
jpayne@68 29688 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
jpayne@68 29689 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
jpayne@68 29690 }
jpayne@68 29691 break;
jpayne@68 29692 case -3:
jpayne@68 29693 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
jpayne@68 29694 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
jpayne@68 29695 }
jpayne@68 29696 break;
jpayne@68 29697 case 4:
jpayne@68 29698 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
jpayne@68 29699 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
jpayne@68 29700 }
jpayne@68 29701 break;
jpayne@68 29702 case -4:
jpayne@68 29703 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
jpayne@68 29704 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
jpayne@68 29705 }
jpayne@68 29706 break;
jpayne@68 29707 }
jpayne@68 29708 }
jpayne@68 29709 #endif
jpayne@68 29710 return PyLong_AsSsize_t(b);
jpayne@68 29711 }
jpayne@68 29712 x = PyNumber_Index(b);
jpayne@68 29713 if (!x) return -1;
jpayne@68 29714 ival = PyInt_AsSsize_t(x);
jpayne@68 29715 Py_DECREF(x);
jpayne@68 29716 return ival;
jpayne@68 29717 }
jpayne@68 29718 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
jpayne@68 29719 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
jpayne@68 29720 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
jpayne@68 29721 #if PY_MAJOR_VERSION < 3
jpayne@68 29722 } else if (likely(PyInt_CheckExact(o))) {
jpayne@68 29723 return PyInt_AS_LONG(o);
jpayne@68 29724 #endif
jpayne@68 29725 } else {
jpayne@68 29726 Py_ssize_t ival;
jpayne@68 29727 PyObject *x;
jpayne@68 29728 x = PyNumber_Index(o);
jpayne@68 29729 if (!x) return -1;
jpayne@68 29730 ival = PyInt_AsLong(x);
jpayne@68 29731 Py_DECREF(x);
jpayne@68 29732 return ival;
jpayne@68 29733 }
jpayne@68 29734 }
jpayne@68 29735 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
jpayne@68 29736 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
jpayne@68 29737 }
jpayne@68 29738 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
jpayne@68 29739 return PyInt_FromSize_t(ival);
jpayne@68 29740 }
jpayne@68 29741
jpayne@68 29742
jpayne@68 29743 /* #### Code section: utility_code_pragmas_end ### */
jpayne@68 29744 #ifdef _MSC_VER
jpayne@68 29745 #pragma warning( pop )
jpayne@68 29746 #endif
jpayne@68 29747
jpayne@68 29748
jpayne@68 29749
jpayne@68 29750 /* #### Code section: end ### */
jpayne@68 29751 #endif /* Py_PYTHON_H */