diff --git a/nfstream/pcap.c b/nfstream/pcap.c index 80b3fe2..238bc21 100644 --- a/nfstream/pcap.c +++ b/nfstream/pcap.c @@ -465,8 +465,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C @@ -785,26 +785,22 @@ typedef struct { } __Pyx_memviewslice; -/* "nfstream/pcap.pyx":11 +/* "nfstream/pcap.pyx":30 * int PyObject_AsCharBuffer(object obj, char **buffer, Py_ssize_t *buffer_len) - * + * * ctypedef unsigned int u_int # <<<<<<<<<<<<<< * ctypedef unsigned char u_char - * + * */ - -#line 11 "nfstream/pcap.pyx" typedef unsigned int __pyx_t_8nfstream_4pcap_u_int; -/* "nfstream/pcap.pyx":12 - * +/* "nfstream/pcap.pyx":31 + * * ctypedef unsigned int u_int * ctypedef unsigned char u_char # <<<<<<<<<<<<<< - * + * * cdef extern from "pcap.h": */ - -#line 12 "nfstream/pcap.pyx" typedef unsigned char __pyx_t_8nfstream_4pcap_u_char; /*--- Type declarations ---*/ @@ -816,383 +812,189 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "nfstream/pcap.pyx":36 +/* "nfstream/pcap.pyx":55 * char *name - * + * * ctypedef void (*pcap_handler)(u_char *arg, const pcap_pkthdr *hdr, const u_char *pkt) # <<<<<<<<<<<<<< - * + * * cdef extern from "pcap.h": */ - -#line 36 "nfstream/pcap.pyx" typedef void (*__pyx_t_8nfstream_4pcap_pcap_handler)(__pyx_t_8nfstream_4pcap_u_char *, struct pcap_pkthdr const *, __pyx_t_8nfstream_4pcap_u_char const *); -/* "nfstream/pcap.pyx":90 +/* "nfstream/pcap.pyx":109 * char *errbuf) - * + * * cdef class pcap_handler_ctx: # <<<<<<<<<<<<<< * cdef: * double scale */ - -#line 90 "nfstream/pcap.pyx" struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx { - -#line 90 "nfstream/pcap.pyx" PyObject_HEAD - -#line 90 "nfstream/pcap.pyx" double scale; - -#line 90 "nfstream/pcap.pyx" PY_LONG_LONG scale_ns; - -#line 90 "nfstream/pcap.pyx" int timestamp_in_ns; - -#line 90 "nfstream/pcap.pyx" void *callback; - -#line 90 "nfstream/pcap.pyx" void *args; - -#line 90 "nfstream/pcap.pyx" PyObject *exc; - -#line 90 "nfstream/pcap.pyx" }; -#line 90 "nfstream/pcap.pyx" - -/* "nfstream/pcap.pyx":158 - * - * +/* "nfstream/pcap.pyx":177 + * + * * cdef class bpf: # <<<<<<<<<<<<<< * """bpf(filter, dlt=DLT_RAW) -> BPF filter object""" - * + * */ - -#line 158 "nfstream/pcap.pyx" struct __pyx_obj_8nfstream_4pcap_bpf { - -#line 158 "nfstream/pcap.pyx" PyObject_HEAD - -#line 158 "nfstream/pcap.pyx" struct bpf_program fcode; - -#line 158 "nfstream/pcap.pyx" }; -#line 158 "nfstream/pcap.pyx" - -/* "nfstream/pcap.pyx":179 - * - * +/* "nfstream/pcap.pyx":198 + * + * * cdef class pcap: # <<<<<<<<<<<<<< * """pcap(name=None, snaplen=65535, promisc=True, timeout_ms=None, immediate=False, timestamp_in_ns=False) -> packet capture object - * + * */ - -#line 179 "nfstream/pcap.pyx" struct __pyx_obj_8nfstream_4pcap_pcap { - -#line 179 "nfstream/pcap.pyx" PyObject_HEAD - -#line 179 "nfstream/pcap.pyx" pcap_t *__pyx___pcap; - -#line 179 "nfstream/pcap.pyx" char *__pyx___name; - -#line 179 "nfstream/pcap.pyx" char *__pyx___filter; - -#line 179 "nfstream/pcap.pyx" char __pyx___ebuf[0x100]; - -#line 179 "nfstream/pcap.pyx" int __pyx___dloff; - -#line 179 "nfstream/pcap.pyx" double __pyx___precision_scale; - -#line 179 "nfstream/pcap.pyx" PY_LONG_LONG __pyx___precision_scale_ns; - -#line 179 "nfstream/pcap.pyx" int __pyx___timestamp_in_ns; - -#line 179 "nfstream/pcap.pyx" }; -#line 179 "nfstream/pcap.pyx" - /* "View.MemoryView":103 - * + * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< - * + * * cdef: */ - -#line 103 "View.MemoryView" struct __pyx_array_obj { - -#line 103 "View.MemoryView" PyObject_HEAD - -#line 103 "View.MemoryView" struct __pyx_vtabstruct_array *__pyx_vtab; - -#line 103 "View.MemoryView" char *data; - -#line 103 "View.MemoryView" Py_ssize_t len; - -#line 103 "View.MemoryView" char *format; - -#line 103 "View.MemoryView" int ndim; - -#line 103 "View.MemoryView" Py_ssize_t *_shape; - -#line 103 "View.MemoryView" Py_ssize_t *_strides; - -#line 103 "View.MemoryView" Py_ssize_t itemsize; - -#line 103 "View.MemoryView" PyObject *mode; - -#line 103 "View.MemoryView" PyObject *_format; - -#line 103 "View.MemoryView" void (*callback_free_data)(void *); - -#line 103 "View.MemoryView" int free_data; - -#line 103 "View.MemoryView" int dtype_is_object; - -#line 103 "View.MemoryView" }; -#line 103 "View.MemoryView" - /* "View.MemoryView":277 - * + * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< * cdef object name * def __init__(self, name): */ - -#line 277 "View.MemoryView" struct __pyx_MemviewEnum_obj { - -#line 277 "View.MemoryView" PyObject_HEAD - -#line 277 "View.MemoryView" PyObject *name; - -#line 277 "View.MemoryView" }; -#line 277 "View.MemoryView" - /* "View.MemoryView":328 - * + * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< - * + * * cdef object obj */ - -#line 328 "View.MemoryView" struct __pyx_memoryview_obj { - -#line 328 "View.MemoryView" PyObject_HEAD - -#line 328 "View.MemoryView" struct __pyx_vtabstruct_memoryview *__pyx_vtab; - -#line 328 "View.MemoryView" PyObject *obj; - -#line 328 "View.MemoryView" PyObject *_size; - -#line 328 "View.MemoryView" PyObject *_array_interface; - -#line 328 "View.MemoryView" PyThread_type_lock lock; - -#line 328 "View.MemoryView" __pyx_atomic_int acquisition_count[2]; - -#line 328 "View.MemoryView" __pyx_atomic_int *acquisition_count_aligned_p; - -#line 328 "View.MemoryView" Py_buffer view; - -#line 328 "View.MemoryView" int flags; - -#line 328 "View.MemoryView" int dtype_is_object; - -#line 328 "View.MemoryView" __Pyx_TypeInfo *typeinfo; - -#line 328 "View.MemoryView" }; -#line 328 "View.MemoryView" - /* "View.MemoryView":953 - * + * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" - * + * */ - -#line 953 "View.MemoryView" struct __pyx_memoryviewslice_obj { - -#line 953 "View.MemoryView" struct __pyx_memoryview_obj __pyx_base; - -#line 953 "View.MemoryView" __Pyx_memviewslice from_slice; - -#line 953 "View.MemoryView" PyObject *from_object; - -#line 953 "View.MemoryView" PyObject *(*to_object_func)(char *); - -#line 953 "View.MemoryView" int (*to_dtype_func)(char *, PyObject *); - -#line 953 "View.MemoryView" }; -#line 953 "View.MemoryView" - - -#line 953 "View.MemoryView" /* "View.MemoryView":103 - * + * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< - * + * * cdef: */ -#line 103 "View.MemoryView" - - -#line 103 "View.MemoryView" struct __pyx_vtabstruct_array { - -#line 103 "View.MemoryView" PyObject *(*get_memview)(struct __pyx_array_obj *); - -#line 103 "View.MemoryView" }; - -#line 103 "View.MemoryView" static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; -#line 103 "View.MemoryView" - /* "View.MemoryView":328 - * + * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< - * + * * cdef object obj */ -#line 328 "View.MemoryView" - - -#line 328 "View.MemoryView" struct __pyx_vtabstruct_memoryview { - -#line 328 "View.MemoryView" char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); - -#line 328 "View.MemoryView" PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); - -#line 328 "View.MemoryView" PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); - -#line 328 "View.MemoryView" PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); - -#line 328 "View.MemoryView" PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); - -#line 328 "View.MemoryView" PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); - -#line 328 "View.MemoryView" PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); - -#line 328 "View.MemoryView" }; - -#line 328 "View.MemoryView" static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; -#line 328 "View.MemoryView" - /* "View.MemoryView":953 - * + * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" - * + * */ -#line 953 "View.MemoryView" - - -#line 953 "View.MemoryView" struct __pyx_vtabstruct__memoryviewslice { - -#line 953 "View.MemoryView" struct __pyx_vtabstruct_memoryview __pyx_base; - -#line 953 "View.MemoryView" }; - -#line 953 "View.MemoryView" static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; /* --- Runtime support code (head) --- */ @@ -1878,6 +1680,7 @@ static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_pkt[] = "pkt"; static const char __pyx_k_ret[] = "ret"; static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_url[] = "__url__"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_curr[] = "curr"; static const char __pyx_k_devs[] = "devs"; @@ -1895,6 +1698,7 @@ static const char __pyx_k_size[] = "size"; static const char __pyx_k_step[] = "step"; static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_1_2_2[] = "1.2.2"; static const char __pyx_k_ASCII[] = "ASCII"; static const char __pyx_k_UTF_8[] = "UTF-8"; static const char __pyx_k_class[] = "__class__"; @@ -1907,6 +1711,7 @@ static const char __pyx_k_shape[] = "shape"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_append[] = "append"; +static const char __pyx_k_author[] = "__author__"; static const char __pyx_k_dltoff[] = "dltoff"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_filter[] = "filter"; @@ -1927,10 +1732,12 @@ static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_descrip[] = "descrip"; static const char __pyx_k_ex_name[] = "ex_name"; static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_license[] = "__license__"; static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_openbsd[] = "openbsd"; static const char __pyx_k_promisc[] = "promisc"; static const char __pyx_k_snaplen[] = "snaplen"; +static const char __pyx_k_version[] = "__version__"; static const char __pyx_k_DLT_AX25[] = "DLT_AX25"; static const char __pyx_k_DLT_FDDI[] = "DLT_FDDI"; static const char __pyx_k_DLT_LOOP[] = "DLT_LOOP"; @@ -1955,6 +1762,7 @@ static const char __pyx_k_DLT_EN3MB[] = "DLT_EN3MB"; static const char __pyx_k_DLT_PFLOG[] = "DLT_PFLOG"; static const char __pyx_k_PCAP_D_IN[] = "PCAP_D_IN"; static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_copyright[] = "__copyright__"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_immediate[] = "immediate"; static const char __pyx_k_lookupdev[] = "lookupdev"; @@ -1972,6 +1780,7 @@ static const char __pyx_k_bad_filter[] = "bad filter"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_timeout_ms[] = "timeout_ms"; +static const char __pyx_k_BSD_license[] = "BSD license"; static const char __pyx_k_DLT_IEEE802[] = "DLT_IEEE802"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_PickleError[] = "PickleError"; @@ -2007,9 +1816,11 @@ static const char __pyx_k_MemoryView_of_r_object[] = "" static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; static const char __pyx_k_contiguous_and_indirect[] = ""; static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_Copyright_c_2004_Dug_Song[] = "Copyright (c) 2004 Dug Song"; static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; static const char __pyx_k_PCAP_TSTAMP_PRECISION_NANO[] = "PCAP_TSTAMP_PRECISION_NANO"; static const char __pyx_k_init___locals_check_return[] = "__init__..check_return"; +static const char __pyx_k_Dug_Song_dugsong_monkey_org[] = "Dug Song "; static const char __pyx_k_PCAP_TSTAMP_PRECISION_MICRO[] = "PCAP_TSTAMP_PRECISION_MICRO"; static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; @@ -2027,15 +1838,20 @@ static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; static const char __pyx_k_couldn_t_determine_timestamp_pre[] = "couldn't determine timestamp precision"; static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static const char __pyx_k_https_github_com_pynetwork_pypca[] = "https://github.com/pynetwork/pypcap"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_packet_capture_library_This_modu[] = "packet capture library\n\nThis module provides a high level interface to packet capture systems.\nAll packets on the network, even those destined for other hosts, are\naccessible through this mechanism.\n"; static const char __pyx_k_self_args_self_callback_cannot_b[] = "self.args,self.callback cannot be converted to a Python object for pickling"; static const char __pyx_k_self_fcode_cannot_be_converted_t[] = "self.fcode cannot be converted to a Python object for pickling"; static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static PyObject *__pyx_kp_u_1_2_2; static PyObject *__pyx_n_s_ASCII; -static PyObject *__pyx_kp_s_Activateing_packet_capture_faile; +static PyObject *__pyx_kp_u_Activateing_packet_capture_faile; +static PyObject *__pyx_kp_u_BSD_license; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_kp_u_Copyright_c_2004_Dug_Song; static PyObject *__pyx_n_s_DLT_ARCNET; static PyObject *__pyx_n_s_DLT_AX25; static PyObject *__pyx_n_s_DLT_CHAOS; @@ -2052,9 +1868,10 @@ static PyObject *__pyx_n_s_DLT_PPP; static PyObject *__pyx_n_s_DLT_PRONET; static PyObject *__pyx_n_s_DLT_RAW; static PyObject *__pyx_n_s_DLT_SLIP; +static PyObject *__pyx_kp_u_Dug_Song_dugsong_monkey_org; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; -static PyObject *__pyx_n_s_I; +static PyObject *__pyx_n_u_I; static PyObject *__pyx_n_s_IOError; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; static PyObject *__pyx_n_s_IndexError; @@ -2075,21 +1892,22 @@ static PyObject *__pyx_n_s_PCAP_D_OUT; static PyObject *__pyx_n_s_PCAP_TSTAMP_PRECISION_MICRO; static PyObject *__pyx_n_s_PCAP_TSTAMP_PRECISION_NANO; static PyObject *__pyx_n_s_PickleError; -static PyObject *__pyx_kp_s_Set_immediate_mode; -static PyObject *__pyx_kp_s_Set_monitor_mode; -static PyObject *__pyx_kp_s_Set_promiscuous_mode; -static PyObject *__pyx_kp_s_Set_snaplength; -static PyObject *__pyx_kp_s_Set_timeout; +static PyObject *__pyx_kp_u_Set_immediate_mode; +static PyObject *__pyx_kp_u_Set_monitor_mode; +static PyObject *__pyx_kp_u_Set_promiscuous_mode; +static PyObject *__pyx_kp_u_Set_snaplength; +static PyObject *__pyx_kp_u_Set_timeout; static PyObject *__pyx_n_s_StopIteration; static PyObject *__pyx_n_s_TypeError; -static PyObject *__pyx_kp_s_UTF_8; +static PyObject *__pyx_kp_u_UTF_8; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_add_pkts; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_append; -static PyObject *__pyx_kp_s_bad_filter; +static PyObject *__pyx_n_s_author; +static PyObject *__pyx_kp_u_bad_filter; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; @@ -2100,8 +1918,9 @@ static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_cnt; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; -static PyObject *__pyx_kp_s_couldn_t_determine_timestamp_pre; -static PyObject *__pyx_kp_s_couldn_t_enable_immediate_mode; +static PyObject *__pyx_n_s_copyright; +static PyObject *__pyx_kp_u_couldn_t_determine_timestamp_pre; +static PyObject *__pyx_kp_u_couldn_t_enable_immediate_mode; static PyObject *__pyx_n_s_curr; static PyObject *__pyx_n_s_descrip; static PyObject *__pyx_n_s_dev; @@ -2127,12 +1946,14 @@ static PyObject *__pyx_n_s_fortran; static PyObject *__pyx_n_u_fortran; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_kp_u_https_github_com_pynetwork_pypca; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_immediate; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init___locals_check_return; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_license; static PyObject *__pyx_n_s_lookupdev; static PyObject *__pyx_n_s_lookupnet; static PyObject *__pyx_n_s_main; @@ -2148,7 +1969,7 @@ static PyObject *__pyx_n_s_nfstream_pcap; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_nonblock; static PyObject *__pyx_n_s_obj; -static PyObject *__pyx_n_s_openbsd; +static PyObject *__pyx_n_u_openbsd; static PyObject *__pyx_n_s_optimize; static PyObject *__pyx_n_s_p; static PyObject *__pyx_n_s_pack; @@ -2173,7 +1994,7 @@ static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_ret; static PyObject *__pyx_n_s_retval; static PyObject *__pyx_n_s_rfmon; -static PyObject *__pyx_kp_s_s_failed_to_execute; +static PyObject *__pyx_kp_u_s_failed_to_execute; static PyObject *__pyx_kp_s_self___pcap_cannot_be_converted; static PyObject *__pyx_kp_s_self_args_self_callback_cannot_b; static PyObject *__pyx_kp_s_self_fcode_cannot_be_converted_t; @@ -2200,7 +2021,9 @@ static PyObject *__pyx_kp_s_unable_to_allocate_array_data; static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; static PyObject *__pyx_n_s_unpack; static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_url; static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_version; static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_8nfstream_4pcap_3bpf___init__(struct __pyx_obj_8nfstream_4pcap_bpf *__pyx_v_self, char *__pyx_v_filter, PyObject *__pyx_v_dlt); /* proto */ @@ -2366,61 +2189,23 @@ static PyObject *__pyx_codeobj__46; * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* Python wrapper */ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_16pcap_handler_ctx_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_16pcap_handler_ctx_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = -#line 1 "(tree fragment)" -__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx___reduce_cython__(((struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_16pcap_handler_ctx___reduce_cython__(((struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)__pyx_v_self)); -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *__pyx_v_self) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 @@ -2429,20 +2214,10 @@ static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx___reduce_cython__(C * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.args,self.callback cannot be converted to a Python object for pickling") */ - -#line 2 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 2 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 2 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 2 "(tree fragment)" __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 @@ -2451,34 +2226,14 @@ static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx___reduce_cython__(C * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 1 "(tree fragment)" __Pyx_AddTraceback("nfstream.pcap.pcap_handler_ctx.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } /* "(tree fragment)":3 @@ -2488,61 +2243,23 @@ static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx___reduce_cython__(C * raise TypeError("self.args,self.callback cannot be converted to a Python object for pickling") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* Python wrapper */ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_16pcap_handler_ctx_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_16pcap_handler_ctx_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = -#line 3 "(tree fragment)" -__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx_2__setstate_cython__(((struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_8nfstream_4pcap_16pcap_handler_ctx_2__setstate_cython__(((struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 @@ -2550,20 +2267,10 @@ static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx_2__setstate_cython_ * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.args,self.callback cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 4 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 4 "(tree fragment)" __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 @@ -2573,1378 +2280,670 @@ static PyObject *__pyx_pf_8nfstream_4pcap_16pcap_handler_ctx_2__setstate_cython_ * raise TypeError("self.args,self.callback cannot be converted to a Python object for pickling") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __pyx_L1_error:; - -#line 3 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 3 "(tree fragment)" __Pyx_AddTraceback("nfstream.pcap.pcap_handler_ctx.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 3 "(tree fragment)" __pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -/* "nfstream/pcap.pyx":100 - * - * +/* "nfstream/pcap.pyx":119 + * + * * cdef object get_buffer(const u_char *pkt, u_int len): # <<<<<<<<<<<<<< * cdef bytes pkt_view = (pkt)[:len] * return pkt_view */ -#line 100 "nfstream/pcap.pyx" - - -#line 100 "nfstream/pcap.pyx" static PyObject *__pyx_f_8nfstream_4pcap_get_buffer(__pyx_t_8nfstream_4pcap_u_char const *__pyx_v_pkt, __pyx_t_8nfstream_4pcap_u_int __pyx_v_len) { - PyObject *__pyx_v_pkt_view = 0 -#line 100 "nfstream/pcap.pyx" -; - -#line 100 "nfstream/pcap.pyx" + PyObject *__pyx_v_pkt_view = 0; PyObject *__pyx_r = NULL; - -#line 100 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 100 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 100 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("get_buffer", 0); - /* "nfstream/pcap.pyx":101 - * + /* "nfstream/pcap.pyx":120 + * * cdef object get_buffer(const u_char *pkt, u_int len): * cdef bytes pkt_view = (pkt)[:len] # <<<<<<<<<<<<<< * return pkt_view - * + * */ - -#line 101 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_pkt) + 0, __pyx_v_len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error) - -#line 101 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_pkt) + 0, __pyx_v_len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 101 "nfstream/pcap.pyx" __pyx_v_pkt_view = ((PyObject*)__pyx_t_1); - -#line 101 "nfstream/pcap.pyx" __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":102 + /* "nfstream/pcap.pyx":121 * cdef object get_buffer(const u_char *pkt, u_int len): * cdef bytes pkt_view = (pkt)[:len] * return pkt_view # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 102 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 102 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_v_pkt_view); - -#line 102 "nfstream/pcap.pyx" __pyx_r = __pyx_v_pkt_view; - -#line 102 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":100 - * - * + /* "nfstream/pcap.pyx":119 + * + * * cdef object get_buffer(const u_char *pkt, u_int len): # <<<<<<<<<<<<<< * cdef bytes pkt_view = (pkt)[:len] * return pkt_view */ -#line 100 "nfstream/pcap.pyx" - - -#line 100 "nfstream/pcap.pyx" /* function exit code */ - -#line 100 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 100 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 100 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.get_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 100 "nfstream/pcap.pyx" __pyx_r = 0; - -#line 100 "nfstream/pcap.pyx" __pyx_L0:; - -#line 100 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_v_pkt_view); - -#line 100 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 100 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 100 "nfstream/pcap.pyx" return __pyx_r; - -#line 100 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":105 - * - * +/* "nfstream/pcap.pyx":124 + * + * * cdef void __pcap_handler(u_char *arg, const pcap_pkthdr *hdr, const u_char *pkt) with gil: # <<<<<<<<<<<<<< * cdef pcap_handler_ctx ctx = arg * try: */ -#line 105 "nfstream/pcap.pyx" - - -#line 105 "nfstream/pcap.pyx" static void __pyx_f_8nfstream_4pcap___pcap_handler(__pyx_t_8nfstream_4pcap_u_char *__pyx_v_arg, struct pcap_pkthdr const *__pyx_v_hdr, __pyx_t_8nfstream_4pcap_u_char const *__pyx_v_pkt) { - struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *__pyx_v_ctx = 0 -#line 105 "nfstream/pcap.pyx" -; - -#line 105 "nfstream/pcap.pyx" + struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *__pyx_v_ctx = 0; __Pyx_RefNannyDeclarations - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_4 = NULL; - -#line 105 "nfstream/pcap.pyx" int __pyx_t_5; - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_6 = NULL; - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_7 = NULL; - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_8 = NULL; - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_9 = NULL; - -#line 105 "nfstream/pcap.pyx" PyObject *__pyx_t_10 = NULL; - -#line 105 "nfstream/pcap.pyx" #ifdef WITH_THREAD - PyGILState_STATE -#line 105 "nfstream/pcap.pyx" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 105 "nfstream/pcap.pyx" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 105 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__pcap_handler", 0); - /* "nfstream/pcap.pyx":106 - * + /* "nfstream/pcap.pyx":125 + * * cdef void __pcap_handler(u_char *arg, const pcap_pkthdr *hdr, const u_char *pkt) with gil: * cdef pcap_handler_ctx ctx = arg # <<<<<<<<<<<<<< * try: * if ctx.timestamp_in_ns: */ - -#line 106 "nfstream/pcap.pyx" __pyx_t_1 = ((PyObject *)((void *)__pyx_v_arg)); - -#line 106 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_t_1); - -#line 106 "nfstream/pcap.pyx" __pyx_v_ctx = ((struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)__pyx_t_1); - -#line 106 "nfstream/pcap.pyx" __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":107 + /* "nfstream/pcap.pyx":126 * cdef void __pcap_handler(u_char *arg, const pcap_pkthdr *hdr, const u_char *pkt) with gil: * cdef pcap_handler_ctx ctx = arg * try: # <<<<<<<<<<<<<< * if ctx.timestamp_in_ns: * (ctx.callback)( */ - -#line 107 "nfstream/pcap.pyx" { - -#line 107 "nfstream/pcap.pyx" __Pyx_PyThreadState_declare - -#line 107 "nfstream/pcap.pyx" __Pyx_PyThreadState_assign - -#line 107 "nfstream/pcap.pyx" __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); - -#line 107 "nfstream/pcap.pyx" __Pyx_XGOTREF(__pyx_t_2); - -#line 107 "nfstream/pcap.pyx" __Pyx_XGOTREF(__pyx_t_3); - -#line 107 "nfstream/pcap.pyx" __Pyx_XGOTREF(__pyx_t_4); - -#line 107 "nfstream/pcap.pyx" /*try:*/ { - /* "nfstream/pcap.pyx":108 + /* "nfstream/pcap.pyx":127 * cdef pcap_handler_ctx ctx = arg * try: * if ctx.timestamp_in_ns: # <<<<<<<<<<<<<< * (ctx.callback)( * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * ctx.scale_ns), */ - -#line 108 "nfstream/pcap.pyx" __pyx_t_5 = (__pyx_v_ctx->timestamp_in_ns != 0); - -#line 108 "nfstream/pcap.pyx" if (__pyx_t_5) { - /* "nfstream/pcap.pyx":110 + /* "nfstream/pcap.pyx":129 * if ctx.timestamp_in_ns: * (ctx.callback)( * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * ctx.scale_ns), # <<<<<<<<<<<<<< * get_buffer(pkt, hdr.caplen), * *(ctx.args) */ - -#line 110 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(((__pyx_v_hdr->ts.tv_sec * 1000000000LL) + (__pyx_v_hdr->ts.tv_usec * __pyx_v_ctx->scale_ns))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 110, __pyx_L3_error) - -#line 110 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(((__pyx_v_hdr->ts.tv_sec * 1000000000LL) + (__pyx_v_hdr->ts.tv_usec * __pyx_v_ctx->scale_ns))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); - /* "nfstream/pcap.pyx":111 + /* "nfstream/pcap.pyx":130 * (ctx.callback)( * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * ctx.scale_ns), * get_buffer(pkt, hdr.caplen), # <<<<<<<<<<<<<< * *(ctx.args) * ) */ - -#line 111 "nfstream/pcap.pyx" - __pyx_t_6 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr->caplen); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 111, __pyx_L3_error) - -#line 111 "nfstream/pcap.pyx" + __pyx_t_6 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr->caplen); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 130, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); - /* "nfstream/pcap.pyx":109 + /* "nfstream/pcap.pyx":128 * try: * if ctx.timestamp_in_ns: * (ctx.callback)( # <<<<<<<<<<<<<< * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * ctx.scale_ns), * get_buffer(pkt, hdr.caplen), */ - -#line 109 "nfstream/pcap.pyx" - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 109, __pyx_L3_error) - -#line 109 "nfstream/pcap.pyx" + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 128, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); - -#line 109 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_1); - -#line 109 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); - -#line 109 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_6); - -#line 109 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); - -#line 109 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 109 "nfstream/pcap.pyx" __pyx_t_6 = 0; - /* "nfstream/pcap.pyx":112 + /* "nfstream/pcap.pyx":131 * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * ctx.scale_ns), * get_buffer(pkt, hdr.caplen), * *(ctx.args) # <<<<<<<<<<<<<< * ) * else: */ - -#line 112 "nfstream/pcap.pyx" - __pyx_t_6 = PySequence_Tuple(((PyObject *)__pyx_v_ctx->args)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 109, __pyx_L3_error) - -#line 112 "nfstream/pcap.pyx" + __pyx_t_6 = PySequence_Tuple(((PyObject *)__pyx_v_ctx->args)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 128, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); - /* "nfstream/pcap.pyx":109 + /* "nfstream/pcap.pyx":128 * try: * if ctx.timestamp_in_ns: * (ctx.callback)( # <<<<<<<<<<<<<< * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * ctx.scale_ns), * get_buffer(pkt, hdr.caplen), */ - -#line 109 "nfstream/pcap.pyx" - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 109, __pyx_L3_error) - -#line 109 "nfstream/pcap.pyx" + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 128, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); - -#line 109 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 109 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 109 "nfstream/pcap.pyx" - __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx->callback), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 109, __pyx_L3_error) - -#line 109 "nfstream/pcap.pyx" + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx->callback), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 128, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); - -#line 109 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 109 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "nfstream/pcap.pyx":108 + /* "nfstream/pcap.pyx":127 * cdef pcap_handler_ctx ctx = arg * try: * if ctx.timestamp_in_ns: # <<<<<<<<<<<<<< * (ctx.callback)( * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * ctx.scale_ns), */ - -#line 108 "nfstream/pcap.pyx" goto __pyx_L9; - -#line 108 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":115 + /* "nfstream/pcap.pyx":134 * ) * else: * (ctx.callback)( # <<<<<<<<<<<<<< * hdr.ts.tv_sec + (hdr.ts.tv_usec * ctx.scale), * get_buffer(pkt, hdr.caplen), */ - -#line 115 "nfstream/pcap.pyx" /*else*/ { - /* "nfstream/pcap.pyx":116 + /* "nfstream/pcap.pyx":135 * else: * (ctx.callback)( * hdr.ts.tv_sec + (hdr.ts.tv_usec * ctx.scale), # <<<<<<<<<<<<<< * get_buffer(pkt, hdr.caplen), * *(ctx.args) */ - -#line 116 "nfstream/pcap.pyx" - __pyx_t_6 = PyFloat_FromDouble((__pyx_v_hdr->ts.tv_sec + (__pyx_v_hdr->ts.tv_usec * __pyx_v_ctx->scale))); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 116, __pyx_L3_error) - -#line 116 "nfstream/pcap.pyx" + __pyx_t_6 = PyFloat_FromDouble((__pyx_v_hdr->ts.tv_sec + (__pyx_v_hdr->ts.tv_usec * __pyx_v_ctx->scale))); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 135, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); - /* "nfstream/pcap.pyx":117 + /* "nfstream/pcap.pyx":136 * (ctx.callback)( * hdr.ts.tv_sec + (hdr.ts.tv_usec * ctx.scale), * get_buffer(pkt, hdr.caplen), # <<<<<<<<<<<<<< * *(ctx.args) * ) */ - -#line 117 "nfstream/pcap.pyx" - __pyx_t_1 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr->caplen); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L3_error) - -#line 117 "nfstream/pcap.pyx" + __pyx_t_1 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr->caplen); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 136, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); - /* "nfstream/pcap.pyx":115 + /* "nfstream/pcap.pyx":134 * ) * else: * (ctx.callback)( # <<<<<<<<<<<<<< * hdr.ts.tv_sec + (hdr.ts.tv_usec * ctx.scale), * get_buffer(pkt, hdr.caplen), */ - -#line 115 "nfstream/pcap.pyx" - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 115, __pyx_L3_error) - -#line 115 "nfstream/pcap.pyx" + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 134, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); - -#line 115 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_6); - -#line 115 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); - -#line 115 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_1); - -#line 115 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); - -#line 115 "nfstream/pcap.pyx" __pyx_t_6 = 0; - -#line 115 "nfstream/pcap.pyx" __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":118 + /* "nfstream/pcap.pyx":137 * hdr.ts.tv_sec + (hdr.ts.tv_usec * ctx.scale), * get_buffer(pkt, hdr.caplen), * *(ctx.args) # <<<<<<<<<<<<<< * ) * except: */ - -#line 118 "nfstream/pcap.pyx" - __pyx_t_1 = PySequence_Tuple(((PyObject *)__pyx_v_ctx->args)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L3_error) - -#line 118 "nfstream/pcap.pyx" + __pyx_t_1 = PySequence_Tuple(((PyObject *)__pyx_v_ctx->args)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 134, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); - /* "nfstream/pcap.pyx":115 + /* "nfstream/pcap.pyx":134 * ) * else: * (ctx.callback)( # <<<<<<<<<<<<<< * hdr.ts.tv_sec + (hdr.ts.tv_usec * ctx.scale), * get_buffer(pkt, hdr.caplen), */ - -#line 115 "nfstream/pcap.pyx" - __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 115, __pyx_L3_error) - -#line 115 "nfstream/pcap.pyx" + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 134, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); - -#line 115 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 115 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 115 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx->callback), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L3_error) - -#line 115 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx->callback), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 134, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); - -#line 115 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 115 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 115 "nfstream/pcap.pyx" } - -#line 115 "nfstream/pcap.pyx" __pyx_L9:; - /* "nfstream/pcap.pyx":107 + /* "nfstream/pcap.pyx":126 * cdef void __pcap_handler(u_char *arg, const pcap_pkthdr *hdr, const u_char *pkt) with gil: * cdef pcap_handler_ctx ctx = arg * try: # <<<<<<<<<<<<<< * if ctx.timestamp_in_ns: * (ctx.callback)( */ - -#line 107 "nfstream/pcap.pyx" } - -#line 107 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 107 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 107 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 107 "nfstream/pcap.pyx" goto __pyx_L8_try_end; - -#line 107 "nfstream/pcap.pyx" __pyx_L3_error:; - -#line 107 "nfstream/pcap.pyx" __Pyx_PyThreadState_assign - -#line 107 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 107 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 107 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":120 + /* "nfstream/pcap.pyx":139 * *(ctx.args) * ) * except: # <<<<<<<<<<<<<< * ctx.exc = sys.exc_info() - * + * */ - -#line 120 "nfstream/pcap.pyx" /*except:*/ { - -#line 120 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.__pcap_handler", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 120 "nfstream/pcap.pyx" - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 120, __pyx_L5_except_error) - -#line 120 "nfstream/pcap.pyx" + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 139, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); - -#line 120 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_6); - -#line 120 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_7); - /* "nfstream/pcap.pyx":121 + /* "nfstream/pcap.pyx":140 * ) * except: * ctx.exc = sys.exc_info() # <<<<<<<<<<<<<< - * + * * DLT_NULL = 0 */ - -#line 121 "nfstream/pcap.pyx" - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 121, __pyx_L5_except_error) - -#line 121 "nfstream/pcap.pyx" + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 140, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); - -#line 121 "nfstream/pcap.pyx" - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 121, __pyx_L5_except_error) - -#line 121 "nfstream/pcap.pyx" + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 140, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); - -#line 121 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 121 "nfstream/pcap.pyx" __pyx_t_9 = NULL; - -#line 121 "nfstream/pcap.pyx" if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { - -#line 121 "nfstream/pcap.pyx" __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); - -#line 121 "nfstream/pcap.pyx" if (likely(__pyx_t_9)) { - -#line 121 "nfstream/pcap.pyx" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - -#line 121 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_t_9); - -#line 121 "nfstream/pcap.pyx" __Pyx_INCREF(function); - -#line 121 "nfstream/pcap.pyx" __Pyx_DECREF_SET(__pyx_t_10, function); - -#line 121 "nfstream/pcap.pyx" } - -#line 121 "nfstream/pcap.pyx" } - -#line 121 "nfstream/pcap.pyx" if (__pyx_t_9) { - -#line 121 "nfstream/pcap.pyx" - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 121, __pyx_L5_except_error) - -#line 121 "nfstream/pcap.pyx" + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 140, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 121 "nfstream/pcap.pyx" } else { - -#line 121 "nfstream/pcap.pyx" - __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 121, __pyx_L5_except_error) - -#line 121 "nfstream/pcap.pyx" + __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 140, __pyx_L5_except_error) } - -#line 121 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_8); - -#line 121 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - -#line 121 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_8); - -#line 121 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_v_ctx->exc); - -#line 121 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_v_ctx->exc); - -#line 121 "nfstream/pcap.pyx" __pyx_v_ctx->exc = __pyx_t_8; - -#line 121 "nfstream/pcap.pyx" __pyx_t_8 = 0; - -#line 121 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 121 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 121 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 121 "nfstream/pcap.pyx" goto __pyx_L4_exception_handled; - -#line 121 "nfstream/pcap.pyx" } - -#line 121 "nfstream/pcap.pyx" __pyx_L5_except_error:; - /* "nfstream/pcap.pyx":107 + /* "nfstream/pcap.pyx":126 * cdef void __pcap_handler(u_char *arg, const pcap_pkthdr *hdr, const u_char *pkt) with gil: * cdef pcap_handler_ctx ctx = arg * try: # <<<<<<<<<<<<<< * if ctx.timestamp_in_ns: * (ctx.callback)( */ - -#line 107 "nfstream/pcap.pyx" __Pyx_PyThreadState_assign - -#line 107 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_2); - -#line 107 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_3); - -#line 107 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_4); - -#line 107 "nfstream/pcap.pyx" __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - -#line 107 "nfstream/pcap.pyx" goto __pyx_L1_error; - -#line 107 "nfstream/pcap.pyx" __pyx_L4_exception_handled:; - -#line 107 "nfstream/pcap.pyx" __Pyx_PyThreadState_assign - -#line 107 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_2); - -#line 107 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_3); - -#line 107 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_4); - -#line 107 "nfstream/pcap.pyx" __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - -#line 107 "nfstream/pcap.pyx" __pyx_L8_try_end:; - -#line 107 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":105 - * - * + /* "nfstream/pcap.pyx":124 + * + * * cdef void __pcap_handler(u_char *arg, const pcap_pkthdr *hdr, const u_char *pkt) with gil: # <<<<<<<<<<<<<< * cdef pcap_handler_ctx ctx = arg * try: */ -#line 105 "nfstream/pcap.pyx" - - -#line 105 "nfstream/pcap.pyx" /* function exit code */ - -#line 105 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 105 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 105 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 105 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_6); - -#line 105 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_7); - -#line 105 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_8); - -#line 105 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_9); - -#line 105 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_10); - -#line 105 "nfstream/pcap.pyx" __Pyx_WriteUnraisable("nfstream.pcap.__pcap_handler", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); - -#line 105 "nfstream/pcap.pyx" __pyx_L0:; - -#line 105 "nfstream/pcap.pyx" __Pyx_XDECREF((PyObject *)__pyx_v_ctx); - -#line 105 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 105 "nfstream/pcap.pyx" #ifdef WITH_THREAD - -#line 105 "nfstream/pcap.pyx" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 105 "nfstream/pcap.pyx" #endif - -#line 105 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":163 +/* "nfstream/pcap.pyx":182 * cdef bpf_program fcode - * + * * def __init__(self, char *filter, dlt=DLT_RAW): # <<<<<<<<<<<<<< * if pcap_ex_compile_nopcap(65535, dlt, &self.fcode, filter, 1, 0) < 0: * raise IOError, 'bad filter' */ -#line 163 "nfstream/pcap.pyx" - - -#line 163 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 163 "nfstream/pcap.pyx" static int __pyx_pw_8nfstream_4pcap_3bpf_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 163 "nfstream/pcap.pyx" static int __pyx_pw_8nfstream_4pcap_3bpf_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - char *__pyx_v_filter -#line 163 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_dlt = 0 -#line 163 "nfstream/pcap.pyx" -; - -#line 163 "nfstream/pcap.pyx" + char *__pyx_v_filter; + PyObject *__pyx_v_dlt = 0; int __pyx_r; - -#line 163 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 163 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - -#line 163 "nfstream/pcap.pyx" { - -#line 163 "nfstream/pcap.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filter,&__pyx_n_s_dlt,0}; - -#line 163 "nfstream/pcap.pyx" PyObject* values[2] = {0,0}; - -#line 163 "nfstream/pcap.pyx" values[1] = __pyx_k__3; - -#line 163 "nfstream/pcap.pyx" if (unlikely(__pyx_kwds)) { - -#line 163 "nfstream/pcap.pyx" Py_ssize_t kw_args; - -#line 163 "nfstream/pcap.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 163 "nfstream/pcap.pyx" switch (pos_args) { - case 2: -#line 163 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 163 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 163 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 163 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 163 "nfstream/pcap.pyx" case 0: break; - default: -#line 163 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 163 "nfstream/pcap.pyx" + default: goto __pyx_L5_argtuple_error; } - -#line 163 "nfstream/pcap.pyx" kw_args = PyDict_Size(__pyx_kwds); - -#line 163 "nfstream/pcap.pyx" switch (pos_args) { - -#line 163 "nfstream/pcap.pyx" case 0: - -#line 163 "nfstream/pcap.pyx" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter)) != 0)) kw_args--; - else -#line 163 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 163 "nfstream/pcap.pyx" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 163 "nfstream/pcap.pyx" case 1: - -#line 163 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 163 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dlt); - -#line 163 "nfstream/pcap.pyx" if (value) { values[1] = value; kw_args--; } - -#line 163 "nfstream/pcap.pyx" } - -#line 163 "nfstream/pcap.pyx" } - -#line 163 "nfstream/pcap.pyx" if (unlikely(kw_args > 0)) { - -#line 163 "nfstream/pcap.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 163, __pyx_L3_error) - -#line 163 "nfstream/pcap.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 182, __pyx_L3_error) } - -#line 163 "nfstream/pcap.pyx" } else { - -#line 163 "nfstream/pcap.pyx" switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: -#line 163 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 163 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 163 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 163 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; - default: -#line 163 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 163 "nfstream/pcap.pyx" + default: goto __pyx_L5_argtuple_error; } - -#line 163 "nfstream/pcap.pyx" } - -#line 163 "nfstream/pcap.pyx" - __pyx_v_filter = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_filter) && PyErr_Occurred())) __PYX_ERR(1, 163, __pyx_L3_error) - -#line 163 "nfstream/pcap.pyx" + __pyx_v_filter = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_filter) && PyErr_Occurred())) __PYX_ERR(1, 182, __pyx_L3_error) __pyx_v_dlt = values[1]; - -#line 163 "nfstream/pcap.pyx" } - -#line 163 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 163 "nfstream/pcap.pyx" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); -#line 163 "nfstream/pcap.pyx" -__PYX_ERR(1, 163, __pyx_L3_error) - -#line 163 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 182, __pyx_L3_error) __pyx_L3_error:; - -#line 163 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.bpf.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 163 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 163 "nfstream/pcap.pyx" return -1; - -#line 163 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 163 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_3bpf___init__(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self), __pyx_v_filter, __pyx_v_dlt); + __pyx_r = __pyx_pf_8nfstream_4pcap_3bpf___init__(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self), __pyx_v_filter, __pyx_v_dlt); -#line 163 "nfstream/pcap.pyx" - - -#line 163 "nfstream/pcap.pyx" /* function exit code */ - -#line 163 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 163 "nfstream/pcap.pyx" return __pyx_r; - -#line 163 "nfstream/pcap.pyx" } -#line 163 "nfstream/pcap.pyx" - - -#line 163 "nfstream/pcap.pyx" static int __pyx_pf_8nfstream_4pcap_3bpf___init__(struct __pyx_obj_8nfstream_4pcap_bpf *__pyx_v_self, char *__pyx_v_filter, PyObject *__pyx_v_dlt) { - -#line 163 "nfstream/pcap.pyx" int __pyx_r; - -#line 163 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 163 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 163 "nfstream/pcap.pyx" int __pyx_t_2; - -#line 163 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__init__", 0); - /* "nfstream/pcap.pyx":164 - * + /* "nfstream/pcap.pyx":183 + * * def __init__(self, char *filter, dlt=DLT_RAW): * if pcap_ex_compile_nopcap(65535, dlt, &self.fcode, filter, 1, 0) < 0: # <<<<<<<<<<<<<< * raise IOError, 'bad filter' - * + * */ - -#line 164 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_dlt); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 164, __pyx_L1_error) - -#line 164 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_dlt); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 183, __pyx_L1_error) __pyx_t_2 = ((pcap_ex_compile_nopcap(0xFFFF, __pyx_t_1, (&__pyx_v_self->fcode), __pyx_v_filter, 1, 0) < 0) != 0); - -#line 164 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":165 + /* "nfstream/pcap.pyx":184 * def __init__(self, char *filter, dlt=DLT_RAW): * if pcap_ex_compile_nopcap(65535, dlt, &self.fcode, filter, 1, 0) < 0: * raise IOError, 'bad filter' # <<<<<<<<<<<<<< - * + * * def filter(self, buf): */ + __Pyx_Raise(__pyx_builtin_IOError, __pyx_kp_u_bad_filter, 0, 0); + __PYX_ERR(1, 184, __pyx_L1_error) -#line 165 "nfstream/pcap.pyx" - __Pyx_Raise(__pyx_builtin_IOError, __pyx_kp_s_bad_filter, 0, 0); - -#line 165 "nfstream/pcap.pyx" - __PYX_ERR(1, 165, __pyx_L1_error) - - /* "nfstream/pcap.pyx":164 - * + /* "nfstream/pcap.pyx":183 + * * def __init__(self, char *filter, dlt=DLT_RAW): * if pcap_ex_compile_nopcap(65535, dlt, &self.fcode, filter, 1, 0) < 0: # <<<<<<<<<<<<<< * raise IOError, 'bad filter' - * + * */ - -#line 164 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":163 + /* "nfstream/pcap.pyx":182 * cdef bpf_program fcode - * + * * def __init__(self, char *filter, dlt=DLT_RAW): # <<<<<<<<<<<<<< * if pcap_ex_compile_nopcap(65535, dlt, &self.fcode, filter, 1, 0) < 0: * raise IOError, 'bad filter' */ -#line 163 "nfstream/pcap.pyx" - - -#line 163 "nfstream/pcap.pyx" /* function exit code */ - -#line 163 "nfstream/pcap.pyx" __pyx_r = 0; - -#line 163 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 163 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 163 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.bpf.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 163 "nfstream/pcap.pyx" __pyx_r = -1; - -#line 163 "nfstream/pcap.pyx" __pyx_L0:; - -#line 163 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 163 "nfstream/pcap.pyx" return __pyx_r; - -#line 163 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":167 +/* "nfstream/pcap.pyx":186 * raise IOError, 'bad filter' - * + * * def filter(self, buf): # <<<<<<<<<<<<<< * """Return boolean match for buf against our filter.""" * cdef u_char *p */ -#line 167 "nfstream/pcap.pyx" - - -#line 167 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 167 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_3bpf_3filter(PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /*proto*/ - -#line 167 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_3bpf_2filter[] = "Return boolean match for buf against our filter."; - -#line 167 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_3bpf_3filter(PyObject *__pyx_v_self, PyObject *__pyx_v_buf) { - -#line 167 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 167 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 167 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("filter (wrapper)", 0); - __pyx_r = -#line 167 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_3bpf_2filter(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); + __pyx_r = __pyx_pf_8nfstream_4pcap_3bpf_2filter(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); -#line 167 "nfstream/pcap.pyx" - - -#line 167 "nfstream/pcap.pyx" /* function exit code */ - -#line 167 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 167 "nfstream/pcap.pyx" return __pyx_r; - -#line 167 "nfstream/pcap.pyx" } -#line 167 "nfstream/pcap.pyx" - - -#line 167 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_3bpf_2filter(struct __pyx_obj_8nfstream_4pcap_bpf *__pyx_v_self, PyObject *__pyx_v_buf) { - __pyx_t_8nfstream_4pcap_u_char *__pyx_v_p -#line 167 "nfstream/pcap.pyx" -; - Py_ssize_t __pyx_v_n -#line 167 "nfstream/pcap.pyx" -; - -#line 167 "nfstream/pcap.pyx" + __pyx_t_8nfstream_4pcap_u_char *__pyx_v_p; + Py_ssize_t __pyx_v_n; PyObject *__pyx_r = NULL; - -#line 167 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 167 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 167 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 167 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("filter", 0); - /* "nfstream/pcap.pyx":171 + /* "nfstream/pcap.pyx":190 * cdef u_char *p * cdef Py_ssize_t n * if PyObject_AsCharBuffer(buf, &p, &n) < 0: # <<<<<<<<<<<<<< * raise TypeError * return bpf_filter(self.fcode.bf_insns, p, n, n) != 0 */ - -#line 171 "nfstream/pcap.pyx" __pyx_t_1 = ((PyObject_AsCharBuffer(__pyx_v_buf, ((char const **)(&__pyx_v_p)), (&__pyx_v_n)) < 0) != 0); - -#line 171 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":172 + /* "nfstream/pcap.pyx":191 * cdef Py_ssize_t n * if PyObject_AsCharBuffer(buf, &p, &n) < 0: * raise TypeError # <<<<<<<<<<<<<< * return bpf_filter(self.fcode.bf_insns, p, n, n) != 0 - * + * */ - -#line 172 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + __PYX_ERR(1, 191, __pyx_L1_error) -#line 172 "nfstream/pcap.pyx" - __PYX_ERR(1, 172, __pyx_L1_error) - - /* "nfstream/pcap.pyx":171 + /* "nfstream/pcap.pyx":190 * cdef u_char *p * cdef Py_ssize_t n * if PyObject_AsCharBuffer(buf, &p, &n) < 0: # <<<<<<<<<<<<<< * raise TypeError * return bpf_filter(self.fcode.bf_insns, p, n, n) != 0 */ - -#line 171 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":173 + /* "nfstream/pcap.pyx":192 * if PyObject_AsCharBuffer(buf, &p, &n) < 0: * raise TypeError * return bpf_filter(self.fcode.bf_insns, p, n, n) != 0 # <<<<<<<<<<<<<< - * + * * def __dealloc__(self): */ - -#line 173 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 173 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyBool_FromLong((bpf_filter(__pyx_v_self->fcode.bf_insns, __pyx_v_p, ((__pyx_t_8nfstream_4pcap_u_int)__pyx_v_n), ((__pyx_t_8nfstream_4pcap_u_int)__pyx_v_n)) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error) - -#line 173 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyBool_FromLong((bpf_filter(__pyx_v_self->fcode.bf_insns, __pyx_v_p, ((__pyx_t_8nfstream_4pcap_u_int)__pyx_v_n), ((__pyx_t_8nfstream_4pcap_u_int)__pyx_v_n)) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 173 "nfstream/pcap.pyx" __pyx_r = __pyx_t_2; - -#line 173 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 173 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":167 + /* "nfstream/pcap.pyx":186 * raise IOError, 'bad filter' - * + * * def filter(self, buf): # <<<<<<<<<<<<<< * """Return boolean match for buf against our filter.""" * cdef u_char *p */ -#line 167 "nfstream/pcap.pyx" - - -#line 167 "nfstream/pcap.pyx" /* function exit code */ - -#line 167 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 167 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 167 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.bpf.filter", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 167 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 167 "nfstream/pcap.pyx" __pyx_L0:; - -#line 167 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 167 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 167 "nfstream/pcap.pyx" return __pyx_r; - -#line 167 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":175 +/* "nfstream/pcap.pyx":194 * return bpf_filter(self.fcode.bf_insns, p, n, n) != 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * pcap_freecode(&self.fcode) - * + * */ -#line 175 "nfstream/pcap.pyx" - - -#line 175 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 175 "nfstream/pcap.pyx" static void __pyx_pw_8nfstream_4pcap_3bpf_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ - -#line 175 "nfstream/pcap.pyx" static void __pyx_pw_8nfstream_4pcap_3bpf_5__dealloc__(PyObject *__pyx_v_self) { - -#line 175 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 175 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - -#line 175 "nfstream/pcap.pyx" __pyx_pf_8nfstream_4pcap_3bpf_4__dealloc__(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self)); -#line 175 "nfstream/pcap.pyx" - - -#line 175 "nfstream/pcap.pyx" /* function exit code */ - -#line 175 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 175 "nfstream/pcap.pyx" } -#line 175 "nfstream/pcap.pyx" - - -#line 175 "nfstream/pcap.pyx" static void __pyx_pf_8nfstream_4pcap_3bpf_4__dealloc__(struct __pyx_obj_8nfstream_4pcap_bpf *__pyx_v_self) { - -#line 175 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 175 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "nfstream/pcap.pyx":176 - * + /* "nfstream/pcap.pyx":195 + * * def __dealloc__(self): * pcap_freecode(&self.fcode) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 176 "nfstream/pcap.pyx" pcap_freecode((&__pyx_v_self->fcode)); - /* "nfstream/pcap.pyx":175 + /* "nfstream/pcap.pyx":194 * return bpf_filter(self.fcode.bf_insns, p, n, n) != 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * pcap_freecode(&self.fcode) - * + * */ -#line 175 "nfstream/pcap.pyx" - - -#line 175 "nfstream/pcap.pyx" /* function exit code */ - -#line 175 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 175 "nfstream/pcap.pyx" } /* "(tree fragment)":1 @@ -3953,61 +2952,23 @@ static void __pyx_pf_8nfstream_4pcap_3bpf_4__dealloc__(struct __pyx_obj_8nfstrea * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* Python wrapper */ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_3bpf_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_3bpf_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = -#line 1 "(tree fragment)" -__pyx_pf_8nfstream_4pcap_3bpf_6__reduce_cython__(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_3bpf_6__reduce_cython__(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self)); -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" static PyObject *__pyx_pf_8nfstream_4pcap_3bpf_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_bpf *__pyx_v_self) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 @@ -4016,20 +2977,10 @@ static PyObject *__pyx_pf_8nfstream_4pcap_3bpf_6__reduce_cython__(CYTHON_UNUSED * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.fcode cannot be converted to a Python object for pickling") */ - -#line 2 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 2 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 2 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 2 "(tree fragment)" __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 @@ -4038,34 +2989,14 @@ static PyObject *__pyx_pf_8nfstream_4pcap_3bpf_6__reduce_cython__(CYTHON_UNUSED * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 1 "(tree fragment)" __Pyx_AddTraceback("nfstream.pcap.bpf.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } /* "(tree fragment)":3 @@ -4075,61 +3006,23 @@ static PyObject *__pyx_pf_8nfstream_4pcap_3bpf_6__reduce_cython__(CYTHON_UNUSED * raise TypeError("self.fcode cannot be converted to a Python object for pickling") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* Python wrapper */ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_3bpf_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_3bpf_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = -#line 3 "(tree fragment)" -__pyx_pf_8nfstream_4pcap_3bpf_8__setstate_cython__(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_8nfstream_4pcap_3bpf_8__setstate_cython__(((struct __pyx_obj_8nfstream_4pcap_bpf *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" static PyObject *__pyx_pf_8nfstream_4pcap_3bpf_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_bpf *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 @@ -4137,20 +3030,10 @@ static PyObject *__pyx_pf_8nfstream_4pcap_3bpf_8__setstate_cython__(CYTHON_UNUSE * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.fcode cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 4 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 4 "(tree fragment)" __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 @@ -4160,471 +3043,183 @@ static PyObject *__pyx_pf_8nfstream_4pcap_3bpf_8__setstate_cython__(CYTHON_UNUSE * raise TypeError("self.fcode cannot be converted to a Python object for pickling") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __pyx_L1_error:; - -#line 3 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 3 "(tree fragment)" __Pyx_AddTraceback("nfstream.pcap.bpf.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 3 "(tree fragment)" __pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -/* "nfstream/pcap.pyx":204 +/* "nfstream/pcap.pyx":223 * cdef bint __timestamp_in_ns - * + * * def __init__(self, name=None, snaplen=65535, promisc=True, # <<<<<<<<<<<<<< * timeout_ms=0, immediate=False, rfmon=False, * timestamp_in_ns=False): */ -#line 204 "nfstream/pcap.pyx" - - -#line 204 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 204 "nfstream/pcap.pyx" static int __pyx_pw_8nfstream_4pcap_4pcap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 204 "nfstream/pcap.pyx" static int __pyx_pw_8nfstream_4pcap_4pcap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_name = 0 -#line 204 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_snaplen = 0 -#line 204 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_promisc = 0 -#line 204 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_timeout_ms = 0 -#line 204 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_immediate = 0 -#line 204 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_rfmon = 0 -#line 204 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_timestamp_in_ns = 0 -#line 204 "nfstream/pcap.pyx" -; - -#line 204 "nfstream/pcap.pyx" + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_snaplen = 0; + PyObject *__pyx_v_promisc = 0; + PyObject *__pyx_v_timeout_ms = 0; + PyObject *__pyx_v_immediate = 0; + PyObject *__pyx_v_rfmon = 0; + PyObject *__pyx_v_timestamp_in_ns = 0; int __pyx_r; - -#line 204 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 204 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - -#line 204 "nfstream/pcap.pyx" { - -#line 204 "nfstream/pcap.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_snaplen,&__pyx_n_s_promisc,&__pyx_n_s_timeout_ms,&__pyx_n_s_immediate,&__pyx_n_s_rfmon,&__pyx_n_s_timestamp_in_ns,0}; - -#line 204 "nfstream/pcap.pyx" PyObject* values[7] = {0,0,0,0,0,0,0}; - -#line 204 "nfstream/pcap.pyx" values[0] = ((PyObject *)Py_None); - -#line 204 "nfstream/pcap.pyx" values[1] = ((PyObject *)__pyx_int_65535); - -#line 204 "nfstream/pcap.pyx" values[2] = ((PyObject *)Py_True); - -#line 204 "nfstream/pcap.pyx" values[3] = ((PyObject *)__pyx_int_0); - /* "nfstream/pcap.pyx":205 - * + /* "nfstream/pcap.pyx":224 + * * def __init__(self, name=None, snaplen=65535, promisc=True, * timeout_ms=0, immediate=False, rfmon=False, # <<<<<<<<<<<<<< * timestamp_in_ns=False): * global dltoff */ - -#line 205 "nfstream/pcap.pyx" values[4] = ((PyObject *)Py_False); - -#line 205 "nfstream/pcap.pyx" values[5] = ((PyObject *)Py_False); - /* "nfstream/pcap.pyx":206 + /* "nfstream/pcap.pyx":225 * def __init__(self, name=None, snaplen=65535, promisc=True, * timeout_ms=0, immediate=False, rfmon=False, * timestamp_in_ns=False): # <<<<<<<<<<<<<< * global dltoff * cdef char *p */ - -#line 206 "nfstream/pcap.pyx" values[6] = ((PyObject *)Py_False); - -#line 206 "nfstream/pcap.pyx" if (unlikely(__pyx_kwds)) { - -#line 206 "nfstream/pcap.pyx" Py_ssize_t kw_args; - -#line 206 "nfstream/pcap.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 206 "nfstream/pcap.pyx" switch (pos_args) { - case 7: -#line 206 "nfstream/pcap.pyx" -values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - -#line 206 "nfstream/pcap.pyx" + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; - case 6: -#line 206 "nfstream/pcap.pyx" -values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - -#line 206 "nfstream/pcap.pyx" + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: -#line 206 "nfstream/pcap.pyx" -values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - -#line 206 "nfstream/pcap.pyx" + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: -#line 206 "nfstream/pcap.pyx" -values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - -#line 206 "nfstream/pcap.pyx" + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: -#line 206 "nfstream/pcap.pyx" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 206 "nfstream/pcap.pyx" + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: -#line 206 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 206 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 206 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 206 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 206 "nfstream/pcap.pyx" case 0: break; - default: -#line 206 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 206 "nfstream/pcap.pyx" + default: goto __pyx_L5_argtuple_error; } - -#line 206 "nfstream/pcap.pyx" kw_args = PyDict_Size(__pyx_kwds); - -#line 206 "nfstream/pcap.pyx" switch (pos_args) { - -#line 206 "nfstream/pcap.pyx" case 0: - -#line 206 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 206 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name); - -#line 206 "nfstream/pcap.pyx" if (value) { values[0] = value; kw_args--; } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" CYTHON_FALLTHROUGH; - -#line 206 "nfstream/pcap.pyx" case 1: - -#line 206 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 206 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_snaplen); - -#line 206 "nfstream/pcap.pyx" if (value) { values[1] = value; kw_args--; } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" CYTHON_FALLTHROUGH; - -#line 206 "nfstream/pcap.pyx" case 2: - -#line 206 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 206 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_promisc); - -#line 206 "nfstream/pcap.pyx" if (value) { values[2] = value; kw_args--; } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" CYTHON_FALLTHROUGH; - -#line 206 "nfstream/pcap.pyx" case 3: - -#line 206 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 206 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout_ms); - -#line 206 "nfstream/pcap.pyx" if (value) { values[3] = value; kw_args--; } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" CYTHON_FALLTHROUGH; - -#line 206 "nfstream/pcap.pyx" case 4: - -#line 206 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 206 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_immediate); - -#line 206 "nfstream/pcap.pyx" if (value) { values[4] = value; kw_args--; } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" CYTHON_FALLTHROUGH; - -#line 206 "nfstream/pcap.pyx" case 5: - -#line 206 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 206 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rfmon); - -#line 206 "nfstream/pcap.pyx" if (value) { values[5] = value; kw_args--; } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" CYTHON_FALLTHROUGH; - -#line 206 "nfstream/pcap.pyx" case 6: - -#line 206 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 206 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timestamp_in_ns); - -#line 206 "nfstream/pcap.pyx" if (value) { values[6] = value; kw_args--; } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" if (unlikely(kw_args > 0)) { - -#line 206 "nfstream/pcap.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 204, __pyx_L3_error) - -#line 206 "nfstream/pcap.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 223, __pyx_L3_error) } - -#line 206 "nfstream/pcap.pyx" } else { - -#line 206 "nfstream/pcap.pyx" switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: -#line 206 "nfstream/pcap.pyx" -values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - -#line 206 "nfstream/pcap.pyx" + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; - case 6: -#line 206 "nfstream/pcap.pyx" -values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - -#line 206 "nfstream/pcap.pyx" + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: -#line 206 "nfstream/pcap.pyx" -values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - -#line 206 "nfstream/pcap.pyx" + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: -#line 206 "nfstream/pcap.pyx" -values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - -#line 206 "nfstream/pcap.pyx" + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: -#line 206 "nfstream/pcap.pyx" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 206 "nfstream/pcap.pyx" + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: -#line 206 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 206 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 206 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 206 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - case 0: -#line 206 "nfstream/pcap.pyx" -break; - default: -#line 206 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 206 "nfstream/pcap.pyx" + case 0: break; + default: goto __pyx_L5_argtuple_error; } - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" __pyx_v_name = values[0]; - -#line 206 "nfstream/pcap.pyx" __pyx_v_snaplen = values[1]; - -#line 206 "nfstream/pcap.pyx" __pyx_v_promisc = values[2]; - -#line 206 "nfstream/pcap.pyx" __pyx_v_timeout_ms = values[3]; - -#line 206 "nfstream/pcap.pyx" __pyx_v_immediate = values[4]; - -#line 206 "nfstream/pcap.pyx" __pyx_v_rfmon = values[5]; - -#line 206 "nfstream/pcap.pyx" __pyx_v_timestamp_in_ns = values[6]; - -#line 206 "nfstream/pcap.pyx" } - -#line 206 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 206 "nfstream/pcap.pyx" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); -#line 206 "nfstream/pcap.pyx" -__PYX_ERR(1, 204, __pyx_L3_error) - -#line 206 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 223, __pyx_L3_error) __pyx_L3_error:; - -#line 206 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 206 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 206 "nfstream/pcap.pyx" return -1; - -#line 206 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 206 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap___init__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_name, __pyx_v_snaplen, __pyx_v_promisc, __pyx_v_timeout_ms, __pyx_v_immediate, __pyx_v_rfmon, __pyx_v_timestamp_in_ns); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap___init__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_name, __pyx_v_snaplen, __pyx_v_promisc, __pyx_v_timeout_ms, __pyx_v_immediate, __pyx_v_rfmon, __pyx_v_timestamp_in_ns); - /* "nfstream/pcap.pyx":204 + /* "nfstream/pcap.pyx":223 * cdef bint __timestamp_in_ns - * + * * def __init__(self, name=None, snaplen=65535, promisc=True, # <<<<<<<<<<<<<< * timeout_ms=0, immediate=False, rfmon=False, * timestamp_in_ns=False): */ -#line 204 "nfstream/pcap.pyx" - - -#line 204 "nfstream/pcap.pyx" /* function exit code */ - -#line 204 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 204 "nfstream/pcap.pyx" return __pyx_r; - -#line 204 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":223 +/* "nfstream/pcap.pyx":242 * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) * passing = True * def check_return(ret, descrip): # <<<<<<<<<<<<<< @@ -4632,268 +3227,110 @@ __pyx_pf_8nfstream_4pcap_4pcap___init__(((struct __pyx_obj_8nfstream_4pcap_pcap * raise OSError, "%s failed to execute" % descrip */ -#line 223 "nfstream/pcap.pyx" - - -#line 223 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 223 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_8__init___1check_return(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_8nfstream_4pcap_4pcap_8__init___1check_return = -#line 223 "nfstream/pcap.pyx" -{"check_return", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_8__init___1check_return, METH_VARARGS|METH_KEYWORDS, 0}; - -#line 223 "nfstream/pcap.pyx" +static PyMethodDef __pyx_mdef_8nfstream_4pcap_4pcap_8__init___1check_return = {"check_return", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_8__init___1check_return, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_8__init___1check_return(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_ret = 0 -#line 223 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_descrip = 0 -#line 223 "nfstream/pcap.pyx" -; - -#line 223 "nfstream/pcap.pyx" + PyObject *__pyx_v_ret = 0; + PyObject *__pyx_v_descrip = 0; PyObject *__pyx_r = 0; - -#line 223 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 223 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("check_return (wrapper)", 0); - -#line 223 "nfstream/pcap.pyx" { - -#line 223 "nfstream/pcap.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ret,&__pyx_n_s_descrip,0}; - -#line 223 "nfstream/pcap.pyx" PyObject* values[2] = {0,0}; - -#line 223 "nfstream/pcap.pyx" if (unlikely(__pyx_kwds)) { - -#line 223 "nfstream/pcap.pyx" Py_ssize_t kw_args; - -#line 223 "nfstream/pcap.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 223 "nfstream/pcap.pyx" switch (pos_args) { - case 2: -#line 223 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 223 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 223 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 223 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 223 "nfstream/pcap.pyx" case 0: break; - default: -#line 223 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 223 "nfstream/pcap.pyx" + default: goto __pyx_L5_argtuple_error; } - -#line 223 "nfstream/pcap.pyx" kw_args = PyDict_Size(__pyx_kwds); - -#line 223 "nfstream/pcap.pyx" switch (pos_args) { - -#line 223 "nfstream/pcap.pyx" case 0: - -#line 223 "nfstream/pcap.pyx" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ret)) != 0)) kw_args--; - else -#line 223 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 223 "nfstream/pcap.pyx" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 223 "nfstream/pcap.pyx" case 1: - -#line 223 "nfstream/pcap.pyx" if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_descrip)) != 0)) kw_args--; - -#line 223 "nfstream/pcap.pyx" else { - __Pyx_RaiseArgtupleInvalid("check_return", 1, 2, 2, 1); -#line 223 "nfstream/pcap.pyx" -__PYX_ERR(1, 223, __pyx_L3_error) - -#line 223 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("check_return", 1, 2, 2, 1); __PYX_ERR(1, 242, __pyx_L3_error) } - -#line 223 "nfstream/pcap.pyx" } - -#line 223 "nfstream/pcap.pyx" if (unlikely(kw_args > 0)) { - -#line 223 "nfstream/pcap.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check_return") < 0)) __PYX_ERR(1, 223, __pyx_L3_error) - -#line 223 "nfstream/pcap.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check_return") < 0)) __PYX_ERR(1, 242, __pyx_L3_error) } - -#line 223 "nfstream/pcap.pyx" } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - -#line 223 "nfstream/pcap.pyx" goto __pyx_L5_argtuple_error; - -#line 223 "nfstream/pcap.pyx" } else { - -#line 223 "nfstream/pcap.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 223 "nfstream/pcap.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 223 "nfstream/pcap.pyx" } - -#line 223 "nfstream/pcap.pyx" __pyx_v_ret = values[0]; - -#line 223 "nfstream/pcap.pyx" __pyx_v_descrip = values[1]; - -#line 223 "nfstream/pcap.pyx" } - -#line 223 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 223 "nfstream/pcap.pyx" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("check_return", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); -#line 223 "nfstream/pcap.pyx" -__PYX_ERR(1, 223, __pyx_L3_error) - -#line 223 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("check_return", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 242, __pyx_L3_error) __pyx_L3_error:; - -#line 223 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.__init__.check_return", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 223 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 223 "nfstream/pcap.pyx" return NULL; - -#line 223 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 223 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_self, __pyx_v_ret, __pyx_v_descrip); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_self, __pyx_v_ret, __pyx_v_descrip); -#line 223 "nfstream/pcap.pyx" - - -#line 223 "nfstream/pcap.pyx" /* function exit code */ - -#line 223 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 223 "nfstream/pcap.pyx" return __pyx_r; - -#line 223 "nfstream/pcap.pyx" } -#line 223 "nfstream/pcap.pyx" - - -#line 223 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ret, PyObject *__pyx_v_descrip) { - -#line 223 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 223 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 223 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 223 "nfstream/pcap.pyx" int __pyx_t_2; - -#line 223 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("check_return", 0); - /* "nfstream/pcap.pyx":224 + /* "nfstream/pcap.pyx":243 * passing = True * def check_return(ret, descrip): * if ret != 0: # <<<<<<<<<<<<<< * raise OSError, "%s failed to execute" % descrip * check_return(pcap_set_snaplen(self.__pcap, snaplen), */ - -#line 224 "nfstream/pcap.pyx" - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ret, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error) - -#line 224 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 224, __pyx_L1_error) - -#line 224 "nfstream/pcap.pyx" + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ret, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 224 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":225 + /* "nfstream/pcap.pyx":244 * def check_return(ret, descrip): * if ret != 0: * raise OSError, "%s failed to execute" % descrip # <<<<<<<<<<<<<< * check_return(pcap_set_snaplen(self.__pcap, snaplen), * "Set snaplength") */ - -#line 225 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_failed_to_execute, __pyx_v_descrip); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error) - -#line 225 "nfstream/pcap.pyx" + __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_failed_to_execute, __pyx_v_descrip); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 225 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_1, 0, 0); - -#line 225 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 244, __pyx_L1_error) -#line 225 "nfstream/pcap.pyx" - __PYX_ERR(1, 225, __pyx_L1_error) - - /* "nfstream/pcap.pyx":224 + /* "nfstream/pcap.pyx":243 * passing = True * def check_return(ret, descrip): * if ret != 0: # <<<<<<<<<<<<<< * raise OSError, "%s failed to execute" % descrip * check_return(pcap_set_snaplen(self.__pcap, snaplen), */ - -#line 224 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":223 + /* "nfstream/pcap.pyx":242 * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) * passing = True * def check_return(ret, descrip): # <<<<<<<<<<<<<< @@ -4901,7248 +3338,3608 @@ static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(CYTHON_UN * raise OSError, "%s failed to execute" % descrip */ -#line 223 "nfstream/pcap.pyx" - - -#line 223 "nfstream/pcap.pyx" /* function exit code */ - -#line 223 "nfstream/pcap.pyx" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 223 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 223 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 223 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 223 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.__init__.check_return", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 223 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 223 "nfstream/pcap.pyx" __pyx_L0:; - -#line 223 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 223 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 223 "nfstream/pcap.pyx" return __pyx_r; - -#line 223 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":204 +/* "nfstream/pcap.pyx":223 * cdef bint __timestamp_in_ns - * + * * def __init__(self, name=None, snaplen=65535, promisc=True, # <<<<<<<<<<<<<< * timeout_ms=0, immediate=False, rfmon=False, * timestamp_in_ns=False): */ -#line 204 "nfstream/pcap.pyx" - - -#line 204 "nfstream/pcap.pyx" static int __pyx_pf_8nfstream_4pcap_4pcap___init__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_snaplen, PyObject *__pyx_v_promisc, PyObject *__pyx_v_timeout_ms, PyObject *__pyx_v_immediate, PyObject *__pyx_v_rfmon, PyObject *__pyx_v_timestamp_in_ns) { - char *__pyx_v_p -#line 204 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_py_byte_name = NULL -#line 204 "nfstream/pcap.pyx" -; - CYTHON_UNUSED int __pyx_v_passing -#line 204 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_check_return = 0 -#line 204 "nfstream/pcap.pyx" -; - int __pyx_v_precision -#line 204 "nfstream/pcap.pyx" -; - -#line 204 "nfstream/pcap.pyx" + char *__pyx_v_p; + PyObject *__pyx_v_py_byte_name = NULL; + CYTHON_UNUSED int __pyx_v_passing; + PyObject *__pyx_v_check_return = 0; + int __pyx_v_precision; int __pyx_r; - -#line 204 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 204 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 204 "nfstream/pcap.pyx" int __pyx_t_2; - -#line 204 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 204 "nfstream/pcap.pyx" PyObject *__pyx_t_4 = NULL; - -#line 204 "nfstream/pcap.pyx" char *__pyx_t_5; - -#line 204 "nfstream/pcap.pyx" unsigned int __pyx_t_6; - -#line 204 "nfstream/pcap.pyx" int __pyx_t_7; - -#line 204 "nfstream/pcap.pyx" PyObject *__pyx_t_8 = NULL; - -#line 204 "nfstream/pcap.pyx" PyObject *__pyx_t_9 = NULL; - -#line 204 "nfstream/pcap.pyx" PyObject *__pyx_t_10 = NULL; - -#line 204 "nfstream/pcap.pyx" PyObject *__pyx_t_11 = NULL; - -#line 204 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__init__", 0); - /* "nfstream/pcap.pyx":210 + /* "nfstream/pcap.pyx":229 * cdef char *p - * + * * if not name: # <<<<<<<<<<<<<< * p = pcap_ex_lookupdev(self.__ebuf) * if p == NULL: */ - -#line 210 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 210, __pyx_L1_error) - -#line 210 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 229, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); - -#line 210 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":211 - * + /* "nfstream/pcap.pyx":230 + * * if not name: * p = pcap_ex_lookupdev(self.__ebuf) # <<<<<<<<<<<<<< * if p == NULL: * raise OSError, self.__ebuf */ - -#line 211 "nfstream/pcap.pyx" __pyx_v_p = pcap_ex_lookupdev(__pyx_v_self->__pyx___ebuf); - /* "nfstream/pcap.pyx":212 + /* "nfstream/pcap.pyx":231 * if not name: * p = pcap_ex_lookupdev(self.__ebuf) * if p == NULL: # <<<<<<<<<<<<<< * raise OSError, self.__ebuf * else: */ - -#line 212 "nfstream/pcap.pyx" __pyx_t_2 = ((__pyx_v_p == NULL) != 0); - -#line 212 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":213 + /* "nfstream/pcap.pyx":232 * p = pcap_ex_lookupdev(self.__ebuf) * if p == NULL: * raise OSError, self.__ebuf # <<<<<<<<<<<<<< * else: * py_byte_name = name.encode('UTF-8') */ - -#line 213 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_self->__pyx___ebuf); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 213, __pyx_L1_error) - -#line 213 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_self->__pyx___ebuf); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 213 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_3, 0, 0); - -#line 213 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 232, __pyx_L1_error) -#line 213 "nfstream/pcap.pyx" - __PYX_ERR(1, 213, __pyx_L1_error) - - /* "nfstream/pcap.pyx":212 + /* "nfstream/pcap.pyx":231 * if not name: * p = pcap_ex_lookupdev(self.__ebuf) * if p == NULL: # <<<<<<<<<<<<<< * raise OSError, self.__ebuf * else: */ - -#line 212 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":210 + /* "nfstream/pcap.pyx":229 * cdef char *p - * + * * if not name: # <<<<<<<<<<<<<< * p = pcap_ex_lookupdev(self.__ebuf) * if p == NULL: */ - -#line 210 "nfstream/pcap.pyx" goto __pyx_L3; - -#line 210 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":215 + /* "nfstream/pcap.pyx":234 * raise OSError, self.__ebuf * else: * py_byte_name = name.encode('UTF-8') # <<<<<<<<<<<<<< * p = py_byte_name - * + * */ - -#line 215 "nfstream/pcap.pyx" /*else*/ { - -#line 215 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 215, __pyx_L1_error) - -#line 215 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 215 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 215, __pyx_L1_error) - -#line 215 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 215 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 215 "nfstream/pcap.pyx" __pyx_v_py_byte_name = __pyx_t_4; - -#line 215 "nfstream/pcap.pyx" __pyx_t_4 = 0; - /* "nfstream/pcap.pyx":216 + /* "nfstream/pcap.pyx":235 * else: * py_byte_name = name.encode('UTF-8') * p = py_byte_name # <<<<<<<<<<<<<< - * + * * self.__pcap = pcap_ex_open_offline_with_tstamp_precision( */ - -#line 216 "nfstream/pcap.pyx" - __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_py_byte_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 216, __pyx_L1_error) - -#line 216 "nfstream/pcap.pyx" + __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_py_byte_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 235, __pyx_L1_error) __pyx_v_p = __pyx_t_5; - -#line 216 "nfstream/pcap.pyx" } - -#line 216 "nfstream/pcap.pyx" __pyx_L3:; - /* "nfstream/pcap.pyx":219 - * + /* "nfstream/pcap.pyx":238 + * * self.__pcap = pcap_ex_open_offline_with_tstamp_precision( * p, PCAP_TSTAMP_PRECISION_NANO, self.__ebuf) # <<<<<<<<<<<<<< * if not self.__pcap: * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) */ - -#line 219 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PCAP_TSTAMP_PRECISION_NANO); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 219, __pyx_L1_error) - -#line 219 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PCAP_TSTAMP_PRECISION_NANO); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 219 "nfstream/pcap.pyx" - __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 219, __pyx_L1_error) - -#line 219 "nfstream/pcap.pyx" + __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "nfstream/pcap.pyx":218 + /* "nfstream/pcap.pyx":237 * p = py_byte_name - * + * * self.__pcap = pcap_ex_open_offline_with_tstamp_precision( # <<<<<<<<<<<<<< * p, PCAP_TSTAMP_PRECISION_NANO, self.__ebuf) * if not self.__pcap: */ - -#line 218 "nfstream/pcap.pyx" __pyx_v_self->__pyx___pcap = pcap_ex_open_offline_with_tstamp_precision(__pyx_v_p, __pyx_t_6, __pyx_v_self->__pyx___ebuf); - /* "nfstream/pcap.pyx":220 + /* "nfstream/pcap.pyx":239 * self.__pcap = pcap_ex_open_offline_with_tstamp_precision( * p, PCAP_TSTAMP_PRECISION_NANO, self.__ebuf) * if not self.__pcap: # <<<<<<<<<<<<<< * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) * passing = True */ - -#line 220 "nfstream/pcap.pyx" __pyx_t_2 = ((!(__pyx_v_self->__pyx___pcap != 0)) != 0); - -#line 220 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":221 + /* "nfstream/pcap.pyx":240 * p, PCAP_TSTAMP_PRECISION_NANO, self.__ebuf) * if not self.__pcap: * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) # <<<<<<<<<<<<<< * passing = True * def check_return(ret, descrip): */ - -#line 221 "nfstream/pcap.pyx" __pyx_v_self->__pyx___pcap = pcap_create(pcap_ex_name(__pyx_v_p), __pyx_v_self->__pyx___ebuf); - /* "nfstream/pcap.pyx":222 + /* "nfstream/pcap.pyx":241 * if not self.__pcap: * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) * passing = True # <<<<<<<<<<<<<< * def check_return(ret, descrip): * if ret != 0: */ - -#line 222 "nfstream/pcap.pyx" __pyx_v_passing = 1; - /* "nfstream/pcap.pyx":223 + /* "nfstream/pcap.pyx":242 * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) * passing = True * def check_return(ret, descrip): # <<<<<<<<<<<<<< * if ret != 0: * raise OSError, "%s failed to execute" % descrip */ - -#line 223 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_4pcap_8__init___1check_return, 0, __pyx_n_s_init___locals_check_return, NULL, __pyx_n_s_nfstream_pcap, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 223, __pyx_L1_error) - -#line 223 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_4pcap_8__init___1check_return, 0, __pyx_n_s_init___locals_check_return, NULL, __pyx_n_s_nfstream_pcap, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 223 "nfstream/pcap.pyx" __pyx_v_check_return = __pyx_t_4; - -#line 223 "nfstream/pcap.pyx" __pyx_t_4 = 0; - /* "nfstream/pcap.pyx":226 + /* "nfstream/pcap.pyx":245 * if ret != 0: * raise OSError, "%s failed to execute" % descrip * check_return(pcap_set_snaplen(self.__pcap, snaplen), # <<<<<<<<<<<<<< * "Set snaplength") * check_return(pcap_set_promisc(self.__pcap, promisc), */ - -#line 226 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_snaplen); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 226, __pyx_L1_error) - -#line 226 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_From_int(pcap_set_snaplen(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 226, __pyx_L1_error) - -#line 226 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_snaplen); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(pcap_set_snaplen(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 226 "nfstream/pcap.pyx" - __pyx_t_3 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_4, __pyx_kp_s_Set_snaplength); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error) - -#line 226 "nfstream/pcap.pyx" + __pyx_t_3 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_4, __pyx_kp_u_Set_snaplength); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 226 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 226 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "nfstream/pcap.pyx":228 + /* "nfstream/pcap.pyx":247 * check_return(pcap_set_snaplen(self.__pcap, snaplen), * "Set snaplength") * check_return(pcap_set_promisc(self.__pcap, promisc), # <<<<<<<<<<<<<< * "Set promiscuous mode") * check_return(pcap_set_timeout(self.__pcap, timeout_ms), */ - -#line 228 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_promisc); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 228, __pyx_L1_error) - -#line 228 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyInt_From_int(pcap_set_promisc(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error) - -#line 228 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_promisc); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(pcap_set_promisc(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 228 "nfstream/pcap.pyx" - __pyx_t_4 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_3, __pyx_kp_s_Set_promiscuous_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 228, __pyx_L1_error) - -#line 228 "nfstream/pcap.pyx" + __pyx_t_4 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_3, __pyx_kp_u_Set_promiscuous_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 228 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 228 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "nfstream/pcap.pyx":230 + /* "nfstream/pcap.pyx":249 * check_return(pcap_set_promisc(self.__pcap, promisc), * "Set promiscuous mode") * check_return(pcap_set_timeout(self.__pcap, timeout_ms), # <<<<<<<<<<<<<< * "Set timeout") * check_return(pcap_set_immediate_mode(self.__pcap, immediate), */ - -#line 230 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_timeout_ms); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 230, __pyx_L1_error) - -#line 230 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_From_int(pcap_set_timeout(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 230, __pyx_L1_error) - -#line 230 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_timeout_ms); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 249, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(pcap_set_timeout(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 230 "nfstream/pcap.pyx" - __pyx_t_3 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_4, __pyx_kp_s_Set_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 230, __pyx_L1_error) - -#line 230 "nfstream/pcap.pyx" + __pyx_t_3 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_4, __pyx_kp_u_Set_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 230 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 230 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "nfstream/pcap.pyx":232 + /* "nfstream/pcap.pyx":251 * check_return(pcap_set_timeout(self.__pcap, timeout_ms), * "Set timeout") * check_return(pcap_set_immediate_mode(self.__pcap, immediate), # <<<<<<<<<<<<<< * "Set immediate mode") * check_return(pcap_set_rfmon(self.__pcap, rfmon), */ - -#line 232 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_immediate); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 232, __pyx_L1_error) - -#line 232 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyInt_From_int(pcap_set_immediate_mode(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 232, __pyx_L1_error) - -#line 232 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_immediate); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 251, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(pcap_set_immediate_mode(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 232 "nfstream/pcap.pyx" - __pyx_t_4 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_3, __pyx_kp_s_Set_immediate_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 232, __pyx_L1_error) - -#line 232 "nfstream/pcap.pyx" + __pyx_t_4 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_3, __pyx_kp_u_Set_immediate_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 232 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 232 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "nfstream/pcap.pyx":234 + /* "nfstream/pcap.pyx":253 * check_return(pcap_set_immediate_mode(self.__pcap, immediate), * "Set immediate mode") * check_return(pcap_set_rfmon(self.__pcap, rfmon), # <<<<<<<<<<<<<< * "Set monitor mode") * # Ask for nano-second precision, but don't fail if not available. */ - -#line 234 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_rfmon); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 234, __pyx_L1_error) - -#line 234 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_From_int(pcap_set_rfmon(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 234, __pyx_L1_error) - -#line 234 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_rfmon); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 253, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(pcap_set_rfmon(__pyx_v_self->__pyx___pcap, __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 234 "nfstream/pcap.pyx" - __pyx_t_3 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_4, __pyx_kp_s_Set_monitor_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 234, __pyx_L1_error) - -#line 234 "nfstream/pcap.pyx" + __pyx_t_3 = __pyx_pf_8nfstream_4pcap_4pcap_8__init___check_return(__pyx_v_check_return, __pyx_t_4, __pyx_kp_u_Set_monitor_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 234 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 234 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "nfstream/pcap.pyx":237 + /* "nfstream/pcap.pyx":256 * "Set monitor mode") * # Ask for nano-second precision, but don't fail if not available. * pcap_ex_set_tstamp_precision(self.__pcap, PCAP_TSTAMP_PRECISION_NANO) # <<<<<<<<<<<<<< * if pcap_activate(self.__pcap) != 0: * raise OSError, ("Activateing packet capture failed. " */ - -#line 237 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PCAP_TSTAMP_PRECISION_NANO); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 237, __pyx_L1_error) - -#line 237 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PCAP_TSTAMP_PRECISION_NANO); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 237 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 237, __pyx_L1_error) - -#line 237 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 237 "nfstream/pcap.pyx" pcap_ex_set_tstamp_precision(__pyx_v_self->__pyx___pcap, __pyx_t_7); - /* "nfstream/pcap.pyx":238 + /* "nfstream/pcap.pyx":257 * # Ask for nano-second precision, but don't fail if not available. * pcap_ex_set_tstamp_precision(self.__pcap, PCAP_TSTAMP_PRECISION_NANO) * if pcap_activate(self.__pcap) != 0: # <<<<<<<<<<<<<< * raise OSError, ("Activateing packet capture failed. " * "Error returned by packet capture library " */ - -#line 238 "nfstream/pcap.pyx" __pyx_t_2 = ((pcap_activate(__pyx_v_self->__pyx___pcap) != 0) != 0); - -#line 238 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":241 + /* "nfstream/pcap.pyx":260 * raise OSError, ("Activateing packet capture failed. " * "Error returned by packet capture library " * "was %s" % pcap_geterr(self.__pcap)) # <<<<<<<<<<<<<< - * + * * if not self.__pcap: */ - -#line 241 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error) - -#line 241 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 241 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Activateing_packet_capture_faile, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 241, __pyx_L1_error) - -#line 241 "nfstream/pcap.pyx" + __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_Activateing_packet_capture_faile, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 241 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 241 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_4, 0, 0); - -#line 241 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 258, __pyx_L1_error) -#line 241 "nfstream/pcap.pyx" - __PYX_ERR(1, 239, __pyx_L1_error) - - /* "nfstream/pcap.pyx":238 + /* "nfstream/pcap.pyx":257 * # Ask for nano-second precision, but don't fail if not available. * pcap_ex_set_tstamp_precision(self.__pcap, PCAP_TSTAMP_PRECISION_NANO) * if pcap_activate(self.__pcap) != 0: # <<<<<<<<<<<<<< * raise OSError, ("Activateing packet capture failed. " * "Error returned by packet capture library " */ - -#line 238 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":220 + /* "nfstream/pcap.pyx":239 * self.__pcap = pcap_ex_open_offline_with_tstamp_precision( * p, PCAP_TSTAMP_PRECISION_NANO, self.__ebuf) * if not self.__pcap: # <<<<<<<<<<<<<< * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) * passing = True */ - -#line 220 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":243 + /* "nfstream/pcap.pyx":262 * "was %s" % pcap_geterr(self.__pcap)) - * + * * if not self.__pcap: # <<<<<<<<<<<<<< * raise OSError, self.__ebuf - * + * */ - -#line 243 "nfstream/pcap.pyx" __pyx_t_2 = ((!(__pyx_v_self->__pyx___pcap != 0)) != 0); - -#line 243 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":244 - * + /* "nfstream/pcap.pyx":263 + * * if not self.__pcap: * raise OSError, self.__ebuf # <<<<<<<<<<<<<< - * + * * self.__name = strdup(p) */ - -#line 244 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_self->__pyx___ebuf); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 244, __pyx_L1_error) - -#line 244 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_self->__pyx___ebuf); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 244 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_4, 0, 0); - -#line 244 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 263, __pyx_L1_error) -#line 244 "nfstream/pcap.pyx" - __PYX_ERR(1, 244, __pyx_L1_error) - - /* "nfstream/pcap.pyx":243 + /* "nfstream/pcap.pyx":262 * "was %s" % pcap_geterr(self.__pcap)) - * + * * if not self.__pcap: # <<<<<<<<<<<<<< * raise OSError, self.__ebuf - * + * */ - -#line 243 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":246 + /* "nfstream/pcap.pyx":265 * raise OSError, self.__ebuf - * + * * self.__name = strdup(p) # <<<<<<<<<<<<<< * self.__filter = strdup("") * self.__timestamp_in_ns = timestamp_in_ns */ - -#line 246 "nfstream/pcap.pyx" __pyx_v_self->__pyx___name = strdup(__pyx_v_p); - /* "nfstream/pcap.pyx":247 - * + /* "nfstream/pcap.pyx":266 + * * self.__name = strdup(p) * self.__filter = strdup("") # <<<<<<<<<<<<<< * self.__timestamp_in_ns = timestamp_in_ns * precision = pcap_ex_get_tstamp_precision(self.__pcap) */ - -#line 247 "nfstream/pcap.pyx" __pyx_v_self->__pyx___filter = strdup(((char const *)"")); - /* "nfstream/pcap.pyx":248 + /* "nfstream/pcap.pyx":267 * self.__name = strdup(p) * self.__filter = strdup("") * self.__timestamp_in_ns = timestamp_in_ns # <<<<<<<<<<<<<< * precision = pcap_ex_get_tstamp_precision(self.__pcap) * if precision == PCAP_TSTAMP_PRECISION_MICRO: */ - -#line 248 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_timestamp_in_ns); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 248, __pyx_L1_error) - -#line 248 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_timestamp_in_ns); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 267, __pyx_L1_error) __pyx_v_self->__pyx___timestamp_in_ns = __pyx_t_2; - /* "nfstream/pcap.pyx":249 + /* "nfstream/pcap.pyx":268 * self.__filter = strdup("") * self.__timestamp_in_ns = timestamp_in_ns * precision = pcap_ex_get_tstamp_precision(self.__pcap) # <<<<<<<<<<<<<< * if precision == PCAP_TSTAMP_PRECISION_MICRO: * self.__precision_scale = 1e-6 */ - -#line 249 "nfstream/pcap.pyx" __pyx_v_precision = pcap_ex_get_tstamp_precision(__pyx_v_self->__pyx___pcap); - /* "nfstream/pcap.pyx":250 + /* "nfstream/pcap.pyx":269 * self.__timestamp_in_ns = timestamp_in_ns * precision = pcap_ex_get_tstamp_precision(self.__pcap) * if precision == PCAP_TSTAMP_PRECISION_MICRO: # <<<<<<<<<<<<<< * self.__precision_scale = 1e-6 * self.__precision_scale_ns = 1000 */ - -#line 250 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_precision); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error) - -#line 250 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_precision); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 250 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PCAP_TSTAMP_PRECISION_MICRO); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error) - -#line 250 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PCAP_TSTAMP_PRECISION_MICRO); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 250 "nfstream/pcap.pyx" - __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 250, __pyx_L1_error) - -#line 250 "nfstream/pcap.pyx" + __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 250 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 250 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 250, __pyx_L1_error) - -#line 250 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 250 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":251 + /* "nfstream/pcap.pyx":270 * precision = pcap_ex_get_tstamp_precision(self.__pcap) * if precision == PCAP_TSTAMP_PRECISION_MICRO: * self.__precision_scale = 1e-6 # <<<<<<<<<<<<<< * self.__precision_scale_ns = 1000 * elif precision == PCAP_TSTAMP_PRECISION_NANO: */ - -#line 251 "nfstream/pcap.pyx" __pyx_v_self->__pyx___precision_scale = 1e-6; - /* "nfstream/pcap.pyx":252 + /* "nfstream/pcap.pyx":271 * if precision == PCAP_TSTAMP_PRECISION_MICRO: * self.__precision_scale = 1e-6 * self.__precision_scale_ns = 1000 # <<<<<<<<<<<<<< * elif precision == PCAP_TSTAMP_PRECISION_NANO: * self.__precision_scale = 1e-9 */ - -#line 252 "nfstream/pcap.pyx" __pyx_v_self->__pyx___precision_scale_ns = 0x3E8; - /* "nfstream/pcap.pyx":250 + /* "nfstream/pcap.pyx":269 * self.__timestamp_in_ns = timestamp_in_ns * precision = pcap_ex_get_tstamp_precision(self.__pcap) * if precision == PCAP_TSTAMP_PRECISION_MICRO: # <<<<<<<<<<<<<< * self.__precision_scale = 1e-6 * self.__precision_scale_ns = 1000 */ - -#line 250 "nfstream/pcap.pyx" goto __pyx_L8; - -#line 250 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":253 + /* "nfstream/pcap.pyx":272 * self.__precision_scale = 1e-6 * self.__precision_scale_ns = 1000 * elif precision == PCAP_TSTAMP_PRECISION_NANO: # <<<<<<<<<<<<<< * self.__precision_scale = 1e-9 * self.__precision_scale_ns = 1 */ - -#line 253 "nfstream/pcap.pyx" - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_precision); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 253, __pyx_L1_error) - -#line 253 "nfstream/pcap.pyx" + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_precision); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - -#line 253 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PCAP_TSTAMP_PRECISION_NANO); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error) - -#line 253 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PCAP_TSTAMP_PRECISION_NANO); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 253 "nfstream/pcap.pyx" - __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 253, __pyx_L1_error) - -#line 253 "nfstream/pcap.pyx" + __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 253 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 253 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 253, __pyx_L1_error) - -#line 253 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 253 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":254 + /* "nfstream/pcap.pyx":273 * self.__precision_scale_ns = 1000 * elif precision == PCAP_TSTAMP_PRECISION_NANO: * self.__precision_scale = 1e-9 # <<<<<<<<<<<<<< * self.__precision_scale_ns = 1 * else: */ - -#line 254 "nfstream/pcap.pyx" __pyx_v_self->__pyx___precision_scale = 1e-9; - /* "nfstream/pcap.pyx":255 + /* "nfstream/pcap.pyx":274 * elif precision == PCAP_TSTAMP_PRECISION_NANO: * self.__precision_scale = 1e-9 * self.__precision_scale_ns = 1 # <<<<<<<<<<<<<< * else: * raise OSError, "couldn't determine timestamp precision" */ - -#line 255 "nfstream/pcap.pyx" __pyx_v_self->__pyx___precision_scale_ns = 1; - /* "nfstream/pcap.pyx":253 + /* "nfstream/pcap.pyx":272 * self.__precision_scale = 1e-6 * self.__precision_scale_ns = 1000 * elif precision == PCAP_TSTAMP_PRECISION_NANO: # <<<<<<<<<<<<<< * self.__precision_scale = 1e-9 * self.__precision_scale_ns = 1 */ - -#line 253 "nfstream/pcap.pyx" goto __pyx_L8; - -#line 253 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":257 + /* "nfstream/pcap.pyx":276 * self.__precision_scale_ns = 1 * else: * raise OSError, "couldn't determine timestamp precision" # <<<<<<<<<<<<<< * try: * self.__dloff = dltoff[pcap_datalink(self.__pcap)] */ - -#line 257 "nfstream/pcap.pyx" /*else*/ { - -#line 257 "nfstream/pcap.pyx" - __Pyx_Raise(__pyx_builtin_OSError, __pyx_kp_s_couldn_t_determine_timestamp_pre, 0, 0); - -#line 257 "nfstream/pcap.pyx" - __PYX_ERR(1, 257, __pyx_L1_error) - -#line 257 "nfstream/pcap.pyx" + __Pyx_Raise(__pyx_builtin_OSError, __pyx_kp_u_couldn_t_determine_timestamp_pre, 0, 0); + __PYX_ERR(1, 276, __pyx_L1_error) } - -#line 257 "nfstream/pcap.pyx" __pyx_L8:; - /* "nfstream/pcap.pyx":258 + /* "nfstream/pcap.pyx":277 * else: * raise OSError, "couldn't determine timestamp precision" * try: # <<<<<<<<<<<<<< * self.__dloff = dltoff[pcap_datalink(self.__pcap)] * except KeyError: */ - -#line 258 "nfstream/pcap.pyx" { - -#line 258 "nfstream/pcap.pyx" __Pyx_PyThreadState_declare - -#line 258 "nfstream/pcap.pyx" __Pyx_PyThreadState_assign - -#line 258 "nfstream/pcap.pyx" __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); - -#line 258 "nfstream/pcap.pyx" __Pyx_XGOTREF(__pyx_t_9); - -#line 258 "nfstream/pcap.pyx" __Pyx_XGOTREF(__pyx_t_10); - -#line 258 "nfstream/pcap.pyx" __Pyx_XGOTREF(__pyx_t_11); - -#line 258 "nfstream/pcap.pyx" /*try:*/ { - /* "nfstream/pcap.pyx":259 + /* "nfstream/pcap.pyx":278 * raise OSError, "couldn't determine timestamp precision" * try: * self.__dloff = dltoff[pcap_datalink(self.__pcap)] # <<<<<<<<<<<<<< * except KeyError: * pass */ - -#line 259 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_dltoff); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 259, __pyx_L9_error) - -#line 259 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_dltoff); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 278, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); - -#line 259 "nfstream/pcap.pyx" __pyx_t_7 = pcap_datalink(__pyx_v_self->__pyx___pcap); - -#line 259 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_7, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L9_error) - -#line 259 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_7, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); - -#line 259 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 259 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 259, __pyx_L9_error) - -#line 259 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 278, __pyx_L9_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 259 "nfstream/pcap.pyx" __pyx_v_self->__pyx___dloff = __pyx_t_7; - /* "nfstream/pcap.pyx":258 + /* "nfstream/pcap.pyx":277 * else: * raise OSError, "couldn't determine timestamp precision" * try: # <<<<<<<<<<<<<< * self.__dloff = dltoff[pcap_datalink(self.__pcap)] * except KeyError: */ - -#line 258 "nfstream/pcap.pyx" } - -#line 258 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 258 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - -#line 258 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - -#line 258 "nfstream/pcap.pyx" goto __pyx_L14_try_end; - -#line 258 "nfstream/pcap.pyx" __pyx_L9_error:; - -#line 258 "nfstream/pcap.pyx" __Pyx_PyThreadState_assign - -#line 258 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 258 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 258 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "nfstream/pcap.pyx":260 + /* "nfstream/pcap.pyx":279 * try: * self.__dloff = dltoff[pcap_datalink(self.__pcap)] * except KeyError: # <<<<<<<<<<<<<< * pass * if immediate and pcap_ex_immediate(self.__pcap) < 0: */ - -#line 260 "nfstream/pcap.pyx" __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); - -#line 260 "nfstream/pcap.pyx" if (__pyx_t_7) { - -#line 260 "nfstream/pcap.pyx" __Pyx_ErrRestore(0,0,0); - -#line 260 "nfstream/pcap.pyx" goto __pyx_L10_exception_handled; - -#line 260 "nfstream/pcap.pyx" } - -#line 260 "nfstream/pcap.pyx" goto __pyx_L11_except_error; - -#line 260 "nfstream/pcap.pyx" __pyx_L11_except_error:; - /* "nfstream/pcap.pyx":258 + /* "nfstream/pcap.pyx":277 * else: * raise OSError, "couldn't determine timestamp precision" * try: # <<<<<<<<<<<<<< * self.__dloff = dltoff[pcap_datalink(self.__pcap)] * except KeyError: */ - -#line 258 "nfstream/pcap.pyx" __Pyx_PyThreadState_assign - -#line 258 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_9); - -#line 258 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_10); - -#line 258 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_11); - -#line 258 "nfstream/pcap.pyx" __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); - -#line 258 "nfstream/pcap.pyx" goto __pyx_L1_error; - -#line 258 "nfstream/pcap.pyx" __pyx_L10_exception_handled:; - -#line 258 "nfstream/pcap.pyx" __Pyx_PyThreadState_assign - -#line 258 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_9); - -#line 258 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_10); - -#line 258 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_t_11); - -#line 258 "nfstream/pcap.pyx" __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); - -#line 258 "nfstream/pcap.pyx" __pyx_L14_try_end:; - -#line 258 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":262 + /* "nfstream/pcap.pyx":281 * except KeyError: * pass * if immediate and pcap_ex_immediate(self.__pcap) < 0: # <<<<<<<<<<<<<< * raise OSError, "couldn't enable immediate mode" - * + * */ - -#line 262 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_immediate); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 262, __pyx_L1_error) - -#line 262 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_immediate); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 281, __pyx_L1_error) if (__pyx_t_1) { - -#line 262 "nfstream/pcap.pyx" } else { - -#line 262 "nfstream/pcap.pyx" __pyx_t_2 = __pyx_t_1; - -#line 262 "nfstream/pcap.pyx" goto __pyx_L16_bool_binop_done; - -#line 262 "nfstream/pcap.pyx" } - -#line 262 "nfstream/pcap.pyx" __pyx_t_1 = ((pcap_ex_immediate(__pyx_v_self->__pyx___pcap) < 0) != 0); - -#line 262 "nfstream/pcap.pyx" __pyx_t_2 = __pyx_t_1; - -#line 262 "nfstream/pcap.pyx" __pyx_L16_bool_binop_done:; - -#line 262 "nfstream/pcap.pyx" if (__pyx_t_2) { - /* "nfstream/pcap.pyx":263 + /* "nfstream/pcap.pyx":282 * pass * if immediate and pcap_ex_immediate(self.__pcap) < 0: * raise OSError, "couldn't enable immediate mode" # <<<<<<<<<<<<<< - * + * * property name: */ + __Pyx_Raise(__pyx_builtin_OSError, __pyx_kp_u_couldn_t_enable_immediate_mode, 0, 0); + __PYX_ERR(1, 282, __pyx_L1_error) -#line 263 "nfstream/pcap.pyx" - __Pyx_Raise(__pyx_builtin_OSError, __pyx_kp_s_couldn_t_enable_immediate_mode, 0, 0); - -#line 263 "nfstream/pcap.pyx" - __PYX_ERR(1, 263, __pyx_L1_error) - - /* "nfstream/pcap.pyx":262 + /* "nfstream/pcap.pyx":281 * except KeyError: * pass * if immediate and pcap_ex_immediate(self.__pcap) < 0: # <<<<<<<<<<<<<< * raise OSError, "couldn't enable immediate mode" - * + * */ - -#line 262 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":204 + /* "nfstream/pcap.pyx":223 * cdef bint __timestamp_in_ns - * + * * def __init__(self, name=None, snaplen=65535, promisc=True, # <<<<<<<<<<<<<< * timeout_ms=0, immediate=False, rfmon=False, * timestamp_in_ns=False): */ -#line 204 "nfstream/pcap.pyx" - - -#line 204 "nfstream/pcap.pyx" /* function exit code */ - -#line 204 "nfstream/pcap.pyx" __pyx_r = 0; - -#line 204 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 204 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 204 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); - -#line 204 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); - -#line 204 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_8); - -#line 204 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 204 "nfstream/pcap.pyx" __pyx_r = -1; - -#line 204 "nfstream/pcap.pyx" __pyx_L0:; - -#line 204 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_v_py_byte_name); - -#line 204 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_v_check_return); - -#line 204 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 204 "nfstream/pcap.pyx" return __pyx_r; - -#line 204 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":267 +/* "nfstream/pcap.pyx":286 * property name: * """Network interface or dumpfile name.""" * def __get__(self): # <<<<<<<<<<<<<< * return str(self.__name.decode('UTF-8')) - * + * */ -#line 267 "nfstream/pcap.pyx" - - -#line 267 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 267 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 267 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_4name_1__get__(PyObject *__pyx_v_self) { - -#line 267 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 267 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 267 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 267 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_4name___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_4name___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 267 "nfstream/pcap.pyx" - - -#line 267 "nfstream/pcap.pyx" /* function exit code */ - -#line 267 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 267 "nfstream/pcap.pyx" return __pyx_r; - -#line 267 "nfstream/pcap.pyx" } -#line 267 "nfstream/pcap.pyx" - - -#line 267 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_4name___get__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 267 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 267 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 267 "nfstream/pcap.pyx" char *__pyx_t_1; - -#line 267 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 267 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 267 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__", 0); - /* "nfstream/pcap.pyx":268 + /* "nfstream/pcap.pyx":287 * """Network interface or dumpfile name.""" * def __get__(self): * return str(self.__name.decode('UTF-8')) # <<<<<<<<<<<<<< - * + * * property snaplen: */ - -#line 268 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 268 "nfstream/pcap.pyx" __pyx_t_1 = __pyx_v_self->__pyx___name; - -#line 268 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 268, __pyx_L1_error) - -#line 268 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 268 "nfstream/pcap.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 268, __pyx_L1_error) - -#line 268 "nfstream/pcap.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 268 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_t_2); - -#line 268 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_2); - -#line 268 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - -#line 268 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 268 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 268, __pyx_L1_error) - -#line 268 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 268 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 268 "nfstream/pcap.pyx" __pyx_r = __pyx_t_2; - -#line 268 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 268 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":267 + /* "nfstream/pcap.pyx":286 * property name: * """Network interface or dumpfile name.""" * def __get__(self): # <<<<<<<<<<<<<< * return str(self.__name.decode('UTF-8')) - * + * */ -#line 267 "nfstream/pcap.pyx" - - -#line 267 "nfstream/pcap.pyx" /* function exit code */ - -#line 267 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 267 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 267 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); - -#line 267 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 267 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 267 "nfstream/pcap.pyx" __pyx_L0:; - -#line 267 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 267 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 267 "nfstream/pcap.pyx" return __pyx_r; - -#line 267 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":272 +/* "nfstream/pcap.pyx":291 * property snaplen: * """Maximum number of bytes to capture for each packet.""" * def __get__(self): # <<<<<<<<<<<<<< * return pcap_snapshot(self.__pcap) - * + * */ -#line 272 "nfstream/pcap.pyx" - - -#line 272 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 272 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_7snaplen_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 272 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_7snaplen_1__get__(PyObject *__pyx_v_self) { - -#line 272 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 272 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 272 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 272 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_7snaplen___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_7snaplen___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 272 "nfstream/pcap.pyx" - - -#line 272 "nfstream/pcap.pyx" /* function exit code */ - -#line 272 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 272 "nfstream/pcap.pyx" return __pyx_r; - -#line 272 "nfstream/pcap.pyx" } -#line 272 "nfstream/pcap.pyx" - - -#line 272 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_7snaplen___get__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 272 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 272 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 272 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 272 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__", 0); - /* "nfstream/pcap.pyx":273 + /* "nfstream/pcap.pyx":292 * """Maximum number of bytes to capture for each packet.""" * def __get__(self): * return pcap_snapshot(self.__pcap) # <<<<<<<<<<<<<< - * + * * property dloff: */ - -#line 273 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 273 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_From_int(pcap_snapshot(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error) - -#line 273 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_From_int(pcap_snapshot(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 273 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 273 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 273 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":272 + /* "nfstream/pcap.pyx":291 * property snaplen: * """Maximum number of bytes to capture for each packet.""" * def __get__(self): # <<<<<<<<<<<<<< * return pcap_snapshot(self.__pcap) - * + * */ -#line 272 "nfstream/pcap.pyx" - - -#line 272 "nfstream/pcap.pyx" /* function exit code */ - -#line 272 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 272 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 272 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.snaplen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 272 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 272 "nfstream/pcap.pyx" __pyx_L0:; - -#line 272 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 272 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 272 "nfstream/pcap.pyx" return __pyx_r; - -#line 272 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":277 +/* "nfstream/pcap.pyx":296 * property dloff: * """Datalink offset (length of layer-2 frame header).""" * def __get__(self): # <<<<<<<<<<<<<< * return self.__dloff - * + * */ -#line 277 "nfstream/pcap.pyx" - - -#line 277 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 277 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_5dloff_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 277 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_5dloff_1__get__(PyObject *__pyx_v_self) { - -#line 277 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 277 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 277 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 277 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_5dloff___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_5dloff___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 277 "nfstream/pcap.pyx" - - -#line 277 "nfstream/pcap.pyx" /* function exit code */ - -#line 277 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 277 "nfstream/pcap.pyx" return __pyx_r; - -#line 277 "nfstream/pcap.pyx" } -#line 277 "nfstream/pcap.pyx" - - -#line 277 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_5dloff___get__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 277 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 277 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 277 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 277 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__", 0); - /* "nfstream/pcap.pyx":278 + /* "nfstream/pcap.pyx":297 * """Datalink offset (length of layer-2 frame header).""" * def __get__(self): * return self.__dloff # <<<<<<<<<<<<<< - * + * * property filter: */ - -#line 278 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 278 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___dloff); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 278, __pyx_L1_error) - -#line 278 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___dloff); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 278 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 278 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 278 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":277 + /* "nfstream/pcap.pyx":296 * property dloff: * """Datalink offset (length of layer-2 frame header).""" * def __get__(self): # <<<<<<<<<<<<<< * return self.__dloff - * + * */ -#line 277 "nfstream/pcap.pyx" - - -#line 277 "nfstream/pcap.pyx" /* function exit code */ - -#line 277 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 277 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 277 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.dloff.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 277 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 277 "nfstream/pcap.pyx" __pyx_L0:; - -#line 277 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 277 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 277 "nfstream/pcap.pyx" return __pyx_r; - -#line 277 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":282 +/* "nfstream/pcap.pyx":301 * property filter: * """Current packet capture filter.""" * def __get__(self): # <<<<<<<<<<<<<< * return str(self.__filter.decode('UTF-8')) - * + * */ -#line 282 "nfstream/pcap.pyx" - - -#line 282 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 282 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_6filter_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 282 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_6filter_1__get__(PyObject *__pyx_v_self) { - -#line 282 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 282 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 282 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 282 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_6filter___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_6filter___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 282 "nfstream/pcap.pyx" - - -#line 282 "nfstream/pcap.pyx" /* function exit code */ - -#line 282 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 282 "nfstream/pcap.pyx" return __pyx_r; - -#line 282 "nfstream/pcap.pyx" } -#line 282 "nfstream/pcap.pyx" - - -#line 282 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_6filter___get__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 282 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 282 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 282 "nfstream/pcap.pyx" char *__pyx_t_1; - -#line 282 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 282 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 282 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__", 0); - /* "nfstream/pcap.pyx":283 + /* "nfstream/pcap.pyx":302 * """Current packet capture filter.""" * def __get__(self): * return str(self.__filter.decode('UTF-8')) # <<<<<<<<<<<<<< - * + * * property fd: */ - -#line 283 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 283 "nfstream/pcap.pyx" __pyx_t_1 = __pyx_v_self->__pyx___filter; - -#line 283 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error) - -#line 283 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 283 "nfstream/pcap.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 283, __pyx_L1_error) - -#line 283 "nfstream/pcap.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 283 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_t_2); - -#line 283 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_2); - -#line 283 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - -#line 283 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 283 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error) - -#line 283 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 283 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 283 "nfstream/pcap.pyx" __pyx_r = __pyx_t_2; - -#line 283 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 283 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":282 + /* "nfstream/pcap.pyx":301 * property filter: * """Current packet capture filter.""" * def __get__(self): # <<<<<<<<<<<<<< * return str(self.__filter.decode('UTF-8')) - * + * */ -#line 282 "nfstream/pcap.pyx" - - -#line 282 "nfstream/pcap.pyx" /* function exit code */ - -#line 282 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 282 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 282 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); - -#line 282 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.filter.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 282 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 282 "nfstream/pcap.pyx" __pyx_L0:; - -#line 282 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 282 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 282 "nfstream/pcap.pyx" return __pyx_r; - -#line 282 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":287 +/* "nfstream/pcap.pyx":306 * property fd: * """File descriptor (or Win32 HANDLE) for capture handle.""" * def __get__(self): # <<<<<<<<<<<<<< * return pcap_ex_fileno(self.__pcap) - * + * */ -#line 287 "nfstream/pcap.pyx" - - -#line 287 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 287 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 287 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_2fd_1__get__(PyObject *__pyx_v_self) { - -#line 287 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 287 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 287 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 287 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_2fd___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_2fd___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 287 "nfstream/pcap.pyx" - - -#line 287 "nfstream/pcap.pyx" /* function exit code */ - -#line 287 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 287 "nfstream/pcap.pyx" return __pyx_r; - -#line 287 "nfstream/pcap.pyx" } -#line 287 "nfstream/pcap.pyx" - - -#line 287 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_2fd___get__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 287 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 287 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 287 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 287 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__", 0); - /* "nfstream/pcap.pyx":288 + /* "nfstream/pcap.pyx":307 * """File descriptor (or Win32 HANDLE) for capture handle.""" * def __get__(self): * return pcap_ex_fileno(self.__pcap) # <<<<<<<<<<<<<< - * + * * property precision: */ - -#line 288 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 288 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_From_int(pcap_ex_fileno(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error) - -#line 288 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_From_int(pcap_ex_fileno(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 288 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 288 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 288 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":287 + /* "nfstream/pcap.pyx":306 * property fd: * """File descriptor (or Win32 HANDLE) for capture handle.""" * def __get__(self): # <<<<<<<<<<<<<< * return pcap_ex_fileno(self.__pcap) - * + * */ -#line 287 "nfstream/pcap.pyx" - - -#line 287 "nfstream/pcap.pyx" /* function exit code */ - -#line 287 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 287 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 287 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 287 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 287 "nfstream/pcap.pyx" __pyx_L0:; - -#line 287 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 287 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 287 "nfstream/pcap.pyx" return __pyx_r; - -#line 287 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":292 +/* "nfstream/pcap.pyx":311 * property precision: * """Precision of timestamps""" * def __get__(self): # <<<<<<<<<<<<<< * return pcap_ex_get_tstamp_precision(self.__pcap) - * + * */ -#line 292 "nfstream/pcap.pyx" - - -#line 292 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 292 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_9precision_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 292 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_9precision_1__get__(PyObject *__pyx_v_self) { - -#line 292 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 292 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 292 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 292 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_9precision___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_9precision___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 292 "nfstream/pcap.pyx" - - -#line 292 "nfstream/pcap.pyx" /* function exit code */ - -#line 292 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 292 "nfstream/pcap.pyx" return __pyx_r; - -#line 292 "nfstream/pcap.pyx" } -#line 292 "nfstream/pcap.pyx" - - -#line 292 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_9precision___get__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 292 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 292 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 292 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 292 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__", 0); - /* "nfstream/pcap.pyx":293 + /* "nfstream/pcap.pyx":312 * """Precision of timestamps""" * def __get__(self): * return pcap_ex_get_tstamp_precision(self.__pcap) # <<<<<<<<<<<<<< - * + * * property timestamp_in_ns: */ - -#line 293 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 293 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_From_int(pcap_ex_get_tstamp_precision(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 293, __pyx_L1_error) - -#line 293 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_From_int(pcap_ex_get_tstamp_precision(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 293 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 293 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 293 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":292 + /* "nfstream/pcap.pyx":311 * property precision: * """Precision of timestamps""" * def __get__(self): # <<<<<<<<<<<<<< * return pcap_ex_get_tstamp_precision(self.__pcap) - * + * */ -#line 292 "nfstream/pcap.pyx" - - -#line 292 "nfstream/pcap.pyx" /* function exit code */ - -#line 292 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 292 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 292 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.precision.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 292 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 292 "nfstream/pcap.pyx" __pyx_L0:; - -#line 292 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 292 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 292 "nfstream/pcap.pyx" return __pyx_r; - -#line 292 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":297 +/* "nfstream/pcap.pyx":316 * property timestamp_in_ns: * """Whether timestamps are returned in nanosecond units""" * def __get__(self): # <<<<<<<<<<<<<< * return self.__timestamp_in_ns - * + * */ -#line 297 "nfstream/pcap.pyx" - - -#line 297 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 297 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_15timestamp_in_ns_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 297 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_15timestamp_in_ns_1__get__(PyObject *__pyx_v_self) { - -#line 297 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 297 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 297 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 297 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_15timestamp_in_ns___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_15timestamp_in_ns___get__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 297 "nfstream/pcap.pyx" - - -#line 297 "nfstream/pcap.pyx" /* function exit code */ - -#line 297 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 297 "nfstream/pcap.pyx" return __pyx_r; - -#line 297 "nfstream/pcap.pyx" } -#line 297 "nfstream/pcap.pyx" - - -#line 297 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_15timestamp_in_ns___get__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 297 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 297 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 297 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 297 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__get__", 0); - /* "nfstream/pcap.pyx":298 + /* "nfstream/pcap.pyx":317 * """Whether timestamps are returned in nanosecond units""" * def __get__(self): * return self.__timestamp_in_ns # <<<<<<<<<<<<<< - * + * * def fileno(self): */ - -#line 298 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 298 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___timestamp_in_ns); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 298, __pyx_L1_error) - -#line 298 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___timestamp_in_ns); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 298 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 298 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 298 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":297 + /* "nfstream/pcap.pyx":316 * property timestamp_in_ns: * """Whether timestamps are returned in nanosecond units""" * def __get__(self): # <<<<<<<<<<<<<< * return self.__timestamp_in_ns - * + * */ -#line 297 "nfstream/pcap.pyx" - - -#line 297 "nfstream/pcap.pyx" /* function exit code */ - -#line 297 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 297 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 297 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.timestamp_in_ns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 297 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 297 "nfstream/pcap.pyx" __pyx_L0:; - -#line 297 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 297 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 297 "nfstream/pcap.pyx" return __pyx_r; - -#line 297 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":300 +/* "nfstream/pcap.pyx":319 * return self.__timestamp_in_ns - * + * * def fileno(self): # <<<<<<<<<<<<<< * """Return file descriptor (or Win32 HANDLE) for capture handle.""" * return pcap_ex_fileno(self.__pcap) */ -#line 300 "nfstream/pcap.pyx" - - -#line 300 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 300 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_3fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 300 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_2fileno[] = "Return file descriptor (or Win32 HANDLE) for capture handle."; - -#line 300 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_3fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 300 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 300 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 300 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("fileno (wrapper)", 0); - __pyx_r = -#line 300 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_2fileno(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_2fileno(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 300 "nfstream/pcap.pyx" - - -#line 300 "nfstream/pcap.pyx" /* function exit code */ - -#line 300 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 300 "nfstream/pcap.pyx" return __pyx_r; - -#line 300 "nfstream/pcap.pyx" } -#line 300 "nfstream/pcap.pyx" - - -#line 300 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_2fileno(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 300 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 300 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 300 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 300 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("fileno", 0); - /* "nfstream/pcap.pyx":302 + /* "nfstream/pcap.pyx":321 * def fileno(self): * """Return file descriptor (or Win32 HANDLE) for capture handle.""" * return pcap_ex_fileno(self.__pcap) # <<<<<<<<<<<<<< - * + * * def close(self): */ - -#line 302 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 302 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_From_int(pcap_ex_fileno(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 302, __pyx_L1_error) - -#line 302 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_From_int(pcap_ex_fileno(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 302 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 302 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 302 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":300 + /* "nfstream/pcap.pyx":319 * return self.__timestamp_in_ns - * + * * def fileno(self): # <<<<<<<<<<<<<< * """Return file descriptor (or Win32 HANDLE) for capture handle.""" * return pcap_ex_fileno(self.__pcap) */ -#line 300 "nfstream/pcap.pyx" - - -#line 300 "nfstream/pcap.pyx" /* function exit code */ - -#line 300 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 300 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 300 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 300 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 300 "nfstream/pcap.pyx" __pyx_L0:; - -#line 300 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 300 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 300 "nfstream/pcap.pyx" return __pyx_r; - -#line 300 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":304 +/* "nfstream/pcap.pyx":323 * return pcap_ex_fileno(self.__pcap) - * + * * def close(self): # <<<<<<<<<<<<<< * """Explicitly close the underlying pcap handle""" * pcap_close(self.__pcap) */ -#line 304 "nfstream/pcap.pyx" - - -#line 304 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 304 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 304 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_4close[] = "Explicitly close the underlying pcap handle"; - -#line 304 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 304 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 304 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 304 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("close (wrapper)", 0); - __pyx_r = -#line 304 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_4close(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_4close(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 304 "nfstream/pcap.pyx" - - -#line 304 "nfstream/pcap.pyx" /* function exit code */ - -#line 304 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 304 "nfstream/pcap.pyx" return __pyx_r; - -#line 304 "nfstream/pcap.pyx" } -#line 304 "nfstream/pcap.pyx" - - -#line 304 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_4close(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 304 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 304 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 304 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("close", 0); - /* "nfstream/pcap.pyx":306 + /* "nfstream/pcap.pyx":325 * def close(self): * """Explicitly close the underlying pcap handle""" * pcap_close(self.__pcap) # <<<<<<<<<<<<<< * self.__pcap = NULL - * + * */ - -#line 306 "nfstream/pcap.pyx" pcap_close(__pyx_v_self->__pyx___pcap); - /* "nfstream/pcap.pyx":307 + /* "nfstream/pcap.pyx":326 * """Explicitly close the underlying pcap handle""" * pcap_close(self.__pcap) * self.__pcap = NULL # <<<<<<<<<<<<<< - * + * * def setfilter(self, value, optimize=1): */ - -#line 307 "nfstream/pcap.pyx" __pyx_v_self->__pyx___pcap = NULL; - /* "nfstream/pcap.pyx":304 + /* "nfstream/pcap.pyx":323 * return pcap_ex_fileno(self.__pcap) - * + * * def close(self): # <<<<<<<<<<<<<< * """Explicitly close the underlying pcap handle""" * pcap_close(self.__pcap) */ -#line 304 "nfstream/pcap.pyx" - - -#line 304 "nfstream/pcap.pyx" /* function exit code */ - -#line 304 "nfstream/pcap.pyx" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 304 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 304 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 304 "nfstream/pcap.pyx" return __pyx_r; - -#line 304 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":309 +/* "nfstream/pcap.pyx":328 * self.__pcap = NULL - * + * * def setfilter(self, value, optimize=1): # <<<<<<<<<<<<<< * """Set BPF-format packet capture filter.""" * cdef bpf_program fcode */ -#line 309 "nfstream/pcap.pyx" - - -#line 309 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 309 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_7setfilter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 309 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_6setfilter[] = "Set BPF-format packet capture filter."; - -#line 309 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_7setfilter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_value = 0 -#line 309 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_optimize = 0 -#line 309 "nfstream/pcap.pyx" -; - -#line 309 "nfstream/pcap.pyx" + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_optimize = 0; PyObject *__pyx_r = 0; - -#line 309 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 309 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("setfilter (wrapper)", 0); - -#line 309 "nfstream/pcap.pyx" { - -#line 309 "nfstream/pcap.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_optimize,0}; - -#line 309 "nfstream/pcap.pyx" PyObject* values[2] = {0,0}; - -#line 309 "nfstream/pcap.pyx" values[1] = ((PyObject *)__pyx_int_1); - -#line 309 "nfstream/pcap.pyx" if (unlikely(__pyx_kwds)) { - -#line 309 "nfstream/pcap.pyx" Py_ssize_t kw_args; - -#line 309 "nfstream/pcap.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 309 "nfstream/pcap.pyx" switch (pos_args) { - case 2: -#line 309 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 309 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 309 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 309 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 309 "nfstream/pcap.pyx" case 0: break; - default: -#line 309 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 309 "nfstream/pcap.pyx" + default: goto __pyx_L5_argtuple_error; } - -#line 309 "nfstream/pcap.pyx" kw_args = PyDict_Size(__pyx_kwds); - -#line 309 "nfstream/pcap.pyx" switch (pos_args) { - -#line 309 "nfstream/pcap.pyx" case 0: - -#line 309 "nfstream/pcap.pyx" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; - else -#line 309 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 309 "nfstream/pcap.pyx" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 309 "nfstream/pcap.pyx" case 1: - -#line 309 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 309 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_optimize); - -#line 309 "nfstream/pcap.pyx" if (value) { values[1] = value; kw_args--; } - -#line 309 "nfstream/pcap.pyx" } - -#line 309 "nfstream/pcap.pyx" } - -#line 309 "nfstream/pcap.pyx" if (unlikely(kw_args > 0)) { - -#line 309 "nfstream/pcap.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setfilter") < 0)) __PYX_ERR(1, 309, __pyx_L3_error) - -#line 309 "nfstream/pcap.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setfilter") < 0)) __PYX_ERR(1, 328, __pyx_L3_error) } - -#line 309 "nfstream/pcap.pyx" } else { - -#line 309 "nfstream/pcap.pyx" switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: -#line 309 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 309 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 309 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 309 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; - default: -#line 309 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 309 "nfstream/pcap.pyx" + default: goto __pyx_L5_argtuple_error; } - -#line 309 "nfstream/pcap.pyx" } - -#line 309 "nfstream/pcap.pyx" __pyx_v_value = values[0]; - -#line 309 "nfstream/pcap.pyx" __pyx_v_optimize = values[1]; - -#line 309 "nfstream/pcap.pyx" } - -#line 309 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 309 "nfstream/pcap.pyx" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setfilter", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); -#line 309 "nfstream/pcap.pyx" -__PYX_ERR(1, 309, __pyx_L3_error) - -#line 309 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("setfilter", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 328, __pyx_L3_error) __pyx_L3_error:; - -#line 309 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.setfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 309 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 309 "nfstream/pcap.pyx" return NULL; - -#line 309 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 309 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_6setfilter(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_value, __pyx_v_optimize); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_6setfilter(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_value, __pyx_v_optimize); -#line 309 "nfstream/pcap.pyx" - - -#line 309 "nfstream/pcap.pyx" /* function exit code */ - -#line 309 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 309 "nfstream/pcap.pyx" return __pyx_r; - -#line 309 "nfstream/pcap.pyx" } -#line 309 "nfstream/pcap.pyx" - - -#line 309 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_6setfilter(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_optimize) { - struct bpf_program __pyx_v_fcode -#line 309 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_py_byte_value = NULL -#line 309 "nfstream/pcap.pyx" -; - -#line 309 "nfstream/pcap.pyx" + struct bpf_program __pyx_v_fcode; + PyObject *__pyx_v_py_byte_value = NULL; PyObject *__pyx_r = NULL; - -#line 309 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 309 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 309 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 309 "nfstream/pcap.pyx" char const *__pyx_t_3; - -#line 309 "nfstream/pcap.pyx" int __pyx_t_4; - -#line 309 "nfstream/pcap.pyx" int __pyx_t_5; - -#line 309 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("setfilter", 0); - /* "nfstream/pcap.pyx":312 + /* "nfstream/pcap.pyx":331 * """Set BPF-format packet capture filter.""" * cdef bpf_program fcode * free(self.__filter) # <<<<<<<<<<<<<< * py_byte_value = value.encode('UTF-8') * self.__filter = strdup(py_byte_value) */ - -#line 312 "nfstream/pcap.pyx" free(__pyx_v_self->__pyx___filter); - /* "nfstream/pcap.pyx":313 + /* "nfstream/pcap.pyx":332 * cdef bpf_program fcode * free(self.__filter) * py_byte_value = value.encode('UTF-8') # <<<<<<<<<<<<<< * self.__filter = strdup(py_byte_value) * if pcap_compile(self.__pcap, &fcode, self.__filter, optimize, 0) < 0: */ - -#line 313 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 313, __pyx_L1_error) - -#line 313 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 313 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 313, __pyx_L1_error) - -#line 313 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 313 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 313 "nfstream/pcap.pyx" __pyx_v_py_byte_value = __pyx_t_2; - -#line 313 "nfstream/pcap.pyx" __pyx_t_2 = 0; - /* "nfstream/pcap.pyx":314 + /* "nfstream/pcap.pyx":333 * free(self.__filter) * py_byte_value = value.encode('UTF-8') * self.__filter = strdup(py_byte_value) # <<<<<<<<<<<<<< * if pcap_compile(self.__pcap, &fcode, self.__filter, optimize, 0) < 0: * raise OSError, pcap_geterr(self.__pcap) */ - -#line 314 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_py_byte_value); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 314, __pyx_L1_error) - -#line 314 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_py_byte_value); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 333, __pyx_L1_error) __pyx_v_self->__pyx___filter = strdup(__pyx_t_3); - /* "nfstream/pcap.pyx":315 + /* "nfstream/pcap.pyx":334 * py_byte_value = value.encode('UTF-8') * self.__filter = strdup(py_byte_value) * if pcap_compile(self.__pcap, &fcode, self.__filter, optimize, 0) < 0: # <<<<<<<<<<<<<< * raise OSError, pcap_geterr(self.__pcap) * if pcap_setfilter(self.__pcap, &fcode) < 0: */ - -#line 315 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_optimize); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 315, __pyx_L1_error) - -#line 315 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_optimize); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 334, __pyx_L1_error) __pyx_t_5 = ((pcap_compile(__pyx_v_self->__pyx___pcap, (&__pyx_v_fcode), __pyx_v_self->__pyx___filter, __pyx_t_4, 0) < 0) != 0); - -#line 315 "nfstream/pcap.pyx" if (__pyx_t_5) { - /* "nfstream/pcap.pyx":316 + /* "nfstream/pcap.pyx":335 * self.__filter = strdup(py_byte_value) * if pcap_compile(self.__pcap, &fcode, self.__filter, optimize, 0) < 0: * raise OSError, pcap_geterr(self.__pcap) # <<<<<<<<<<<<<< * if pcap_setfilter(self.__pcap, &fcode) < 0: * raise OSError, pcap_geterr(self.__pcap) */ - -#line 316 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 316, __pyx_L1_error) - -#line 316 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 316 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_2, 0, 0); - -#line 316 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 335, __pyx_L1_error) -#line 316 "nfstream/pcap.pyx" - __PYX_ERR(1, 316, __pyx_L1_error) - - /* "nfstream/pcap.pyx":315 + /* "nfstream/pcap.pyx":334 * py_byte_value = value.encode('UTF-8') * self.__filter = strdup(py_byte_value) * if pcap_compile(self.__pcap, &fcode, self.__filter, optimize, 0) < 0: # <<<<<<<<<<<<<< * raise OSError, pcap_geterr(self.__pcap) * if pcap_setfilter(self.__pcap, &fcode) < 0: */ - -#line 315 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":317 + /* "nfstream/pcap.pyx":336 * if pcap_compile(self.__pcap, &fcode, self.__filter, optimize, 0) < 0: * raise OSError, pcap_geterr(self.__pcap) * if pcap_setfilter(self.__pcap, &fcode) < 0: # <<<<<<<<<<<<<< * raise OSError, pcap_geterr(self.__pcap) * pcap_freecode(&fcode) */ - -#line 317 "nfstream/pcap.pyx" __pyx_t_5 = ((pcap_setfilter(__pyx_v_self->__pyx___pcap, (&__pyx_v_fcode)) < 0) != 0); - -#line 317 "nfstream/pcap.pyx" if (__pyx_t_5) { - /* "nfstream/pcap.pyx":318 + /* "nfstream/pcap.pyx":337 * raise OSError, pcap_geterr(self.__pcap) * if pcap_setfilter(self.__pcap, &fcode) < 0: * raise OSError, pcap_geterr(self.__pcap) # <<<<<<<<<<<<<< * pcap_freecode(&fcode) - * + * */ - -#line 318 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 318, __pyx_L1_error) - -#line 318 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 318 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_2, 0, 0); - -#line 318 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 337, __pyx_L1_error) -#line 318 "nfstream/pcap.pyx" - __PYX_ERR(1, 318, __pyx_L1_error) - - /* "nfstream/pcap.pyx":317 + /* "nfstream/pcap.pyx":336 * if pcap_compile(self.__pcap, &fcode, self.__filter, optimize, 0) < 0: * raise OSError, pcap_geterr(self.__pcap) * if pcap_setfilter(self.__pcap, &fcode) < 0: # <<<<<<<<<<<<<< * raise OSError, pcap_geterr(self.__pcap) * pcap_freecode(&fcode) */ - -#line 317 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":319 + /* "nfstream/pcap.pyx":338 * if pcap_setfilter(self.__pcap, &fcode) < 0: * raise OSError, pcap_geterr(self.__pcap) * pcap_freecode(&fcode) # <<<<<<<<<<<<<< - * + * * def setdirection(self, direction): */ - -#line 319 "nfstream/pcap.pyx" pcap_freecode((&__pyx_v_fcode)); - /* "nfstream/pcap.pyx":309 + /* "nfstream/pcap.pyx":328 * self.__pcap = NULL - * + * * def setfilter(self, value, optimize=1): # <<<<<<<<<<<<<< * """Set BPF-format packet capture filter.""" * cdef bpf_program fcode */ -#line 309 "nfstream/pcap.pyx" - - -#line 309 "nfstream/pcap.pyx" /* function exit code */ - -#line 309 "nfstream/pcap.pyx" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 309 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 309 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 309 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 309 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 309 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.setfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 309 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 309 "nfstream/pcap.pyx" __pyx_L0:; - -#line 309 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_v_py_byte_value); - -#line 309 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 309 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 309 "nfstream/pcap.pyx" return __pyx_r; - -#line 309 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":321 +/* "nfstream/pcap.pyx":340 * pcap_freecode(&fcode) - * + * * def setdirection(self, direction): # <<<<<<<<<<<<<< * """Set capture direction.""" * return pcap_ex_setdirection(self.__pcap, direction) == 0 */ -#line 321 "nfstream/pcap.pyx" - - -#line 321 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 321 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_9setdirection(PyObject *__pyx_v_self, PyObject *__pyx_v_direction); /*proto*/ - -#line 321 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_8setdirection[] = "Set capture direction."; - -#line 321 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_9setdirection(PyObject *__pyx_v_self, PyObject *__pyx_v_direction) { - -#line 321 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 321 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 321 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("setdirection (wrapper)", 0); - __pyx_r = -#line 321 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_8setdirection(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), ((PyObject *)__pyx_v_direction)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_8setdirection(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), ((PyObject *)__pyx_v_direction)); -#line 321 "nfstream/pcap.pyx" - - -#line 321 "nfstream/pcap.pyx" /* function exit code */ - -#line 321 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 321 "nfstream/pcap.pyx" return __pyx_r; - -#line 321 "nfstream/pcap.pyx" } -#line 321 "nfstream/pcap.pyx" - - -#line 321 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_8setdirection(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, PyObject *__pyx_v_direction) { - -#line 321 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 321 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 321 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 321 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 321 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("setdirection", 0); - /* "nfstream/pcap.pyx":323 + /* "nfstream/pcap.pyx":342 * def setdirection(self, direction): * """Set capture direction.""" * return pcap_ex_setdirection(self.__pcap, direction) == 0 # <<<<<<<<<<<<<< - * + * * def setnonblock(self, nonblock=True): */ - -#line 323 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 323 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_direction); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 323, __pyx_L1_error) - -#line 323 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyBool_FromLong((pcap_ex_setdirection(__pyx_v_self->__pyx___pcap, __pyx_t_1) == 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 323, __pyx_L1_error) - -#line 323 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_direction); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 342, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((pcap_ex_setdirection(__pyx_v_self->__pyx___pcap, __pyx_t_1) == 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 323 "nfstream/pcap.pyx" __pyx_r = __pyx_t_2; - -#line 323 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 323 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":321 + /* "nfstream/pcap.pyx":340 * pcap_freecode(&fcode) - * + * * def setdirection(self, direction): # <<<<<<<<<<<<<< * """Set capture direction.""" * return pcap_ex_setdirection(self.__pcap, direction) == 0 */ -#line 321 "nfstream/pcap.pyx" - - -#line 321 "nfstream/pcap.pyx" /* function exit code */ - -#line 321 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 321 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 321 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.setdirection", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 321 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 321 "nfstream/pcap.pyx" __pyx_L0:; - -#line 321 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 321 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 321 "nfstream/pcap.pyx" return __pyx_r; - -#line 321 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":325 +/* "nfstream/pcap.pyx":344 * return pcap_ex_setdirection(self.__pcap, direction) == 0 - * + * * def setnonblock(self, nonblock=True): # <<<<<<<<<<<<<< * """Set non-blocking capture mode.""" * pcap_ex_setnonblock(self.__pcap, nonblock, self.__ebuf) */ -#line 325 "nfstream/pcap.pyx" - - -#line 325 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 325 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_11setnonblock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 325 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_10setnonblock[] = "Set non-blocking capture mode."; - -#line 325 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_11setnonblock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_nonblock = 0 -#line 325 "nfstream/pcap.pyx" -; - -#line 325 "nfstream/pcap.pyx" + PyObject *__pyx_v_nonblock = 0; PyObject *__pyx_r = 0; - -#line 325 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 325 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("setnonblock (wrapper)", 0); - -#line 325 "nfstream/pcap.pyx" { - -#line 325 "nfstream/pcap.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nonblock,0}; - -#line 325 "nfstream/pcap.pyx" PyObject* values[1] = {0}; - -#line 325 "nfstream/pcap.pyx" values[0] = ((PyObject *)Py_True); - -#line 325 "nfstream/pcap.pyx" if (unlikely(__pyx_kwds)) { - -#line 325 "nfstream/pcap.pyx" Py_ssize_t kw_args; - -#line 325 "nfstream/pcap.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 325 "nfstream/pcap.pyx" switch (pos_args) { - case 1: -#line 325 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 325 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 325 "nfstream/pcap.pyx" case 0: break; - default: -#line 325 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 325 "nfstream/pcap.pyx" + default: goto __pyx_L5_argtuple_error; } - -#line 325 "nfstream/pcap.pyx" kw_args = PyDict_Size(__pyx_kwds); - -#line 325 "nfstream/pcap.pyx" switch (pos_args) { - -#line 325 "nfstream/pcap.pyx" case 0: - -#line 325 "nfstream/pcap.pyx" if (kw_args > 0) { - -#line 325 "nfstream/pcap.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nonblock); - -#line 325 "nfstream/pcap.pyx" if (value) { values[0] = value; kw_args--; } - -#line 325 "nfstream/pcap.pyx" } - -#line 325 "nfstream/pcap.pyx" } - -#line 325 "nfstream/pcap.pyx" if (unlikely(kw_args > 0)) { - -#line 325 "nfstream/pcap.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setnonblock") < 0)) __PYX_ERR(1, 325, __pyx_L3_error) - -#line 325 "nfstream/pcap.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setnonblock") < 0)) __PYX_ERR(1, 344, __pyx_L3_error) } - -#line 325 "nfstream/pcap.pyx" } else { - -#line 325 "nfstream/pcap.pyx" switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: -#line 325 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 325 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - case 0: -#line 325 "nfstream/pcap.pyx" -break; - default: -#line 325 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 325 "nfstream/pcap.pyx" + case 0: break; + default: goto __pyx_L5_argtuple_error; } - -#line 325 "nfstream/pcap.pyx" } - -#line 325 "nfstream/pcap.pyx" __pyx_v_nonblock = values[0]; - -#line 325 "nfstream/pcap.pyx" } - -#line 325 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 325 "nfstream/pcap.pyx" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setnonblock", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); -#line 325 "nfstream/pcap.pyx" -__PYX_ERR(1, 325, __pyx_L3_error) - -#line 325 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("setnonblock", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error) __pyx_L3_error:; - -#line 325 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.setnonblock", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 325 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 325 "nfstream/pcap.pyx" return NULL; - -#line 325 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 325 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_10setnonblock(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_nonblock); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_10setnonblock(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_nonblock); -#line 325 "nfstream/pcap.pyx" - - -#line 325 "nfstream/pcap.pyx" /* function exit code */ - -#line 325 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 325 "nfstream/pcap.pyx" return __pyx_r; - -#line 325 "nfstream/pcap.pyx" } -#line 325 "nfstream/pcap.pyx" - - -#line 325 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_10setnonblock(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, PyObject *__pyx_v_nonblock) { - -#line 325 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 325 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 325 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 325 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("setnonblock", 0); - /* "nfstream/pcap.pyx":327 + /* "nfstream/pcap.pyx":346 * def setnonblock(self, nonblock=True): * """Set non-blocking capture mode.""" * pcap_ex_setnonblock(self.__pcap, nonblock, self.__ebuf) # <<<<<<<<<<<<<< - * + * * def getnonblock(self): */ - -#line 327 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nonblock); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 327, __pyx_L1_error) - -#line 327 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nonblock); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L1_error) pcap_ex_setnonblock(__pyx_v_self->__pyx___pcap, __pyx_t_1, __pyx_v_self->__pyx___ebuf); - /* "nfstream/pcap.pyx":325 + /* "nfstream/pcap.pyx":344 * return pcap_ex_setdirection(self.__pcap, direction) == 0 - * + * * def setnonblock(self, nonblock=True): # <<<<<<<<<<<<<< * """Set non-blocking capture mode.""" * pcap_ex_setnonblock(self.__pcap, nonblock, self.__ebuf) */ -#line 325 "nfstream/pcap.pyx" - - -#line 325 "nfstream/pcap.pyx" /* function exit code */ - -#line 325 "nfstream/pcap.pyx" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 325 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 325 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 325 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.setnonblock", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 325 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 325 "nfstream/pcap.pyx" __pyx_L0:; - -#line 325 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 325 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 325 "nfstream/pcap.pyx" return __pyx_r; - -#line 325 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":329 +/* "nfstream/pcap.pyx":348 * pcap_ex_setnonblock(self.__pcap, nonblock, self.__ebuf) - * + * * def getnonblock(self): # <<<<<<<<<<<<<< * """Return non-blocking capture mode as boolean.""" * ret = pcap_ex_getnonblock(self.__pcap, self.__ebuf) */ -#line 329 "nfstream/pcap.pyx" - - -#line 329 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 329 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_13getnonblock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 329 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_12getnonblock[] = "Return non-blocking capture mode as boolean."; - -#line 329 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_13getnonblock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 329 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 329 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 329 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("getnonblock (wrapper)", 0); - __pyx_r = -#line 329 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_12getnonblock(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_12getnonblock(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 329 "nfstream/pcap.pyx" - - -#line 329 "nfstream/pcap.pyx" /* function exit code */ - -#line 329 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 329 "nfstream/pcap.pyx" return __pyx_r; - -#line 329 "nfstream/pcap.pyx" } -#line 329 "nfstream/pcap.pyx" - - -#line 329 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_12getnonblock(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - int __pyx_v_ret -#line 329 "nfstream/pcap.pyx" -; - -#line 329 "nfstream/pcap.pyx" + int __pyx_v_ret; PyObject *__pyx_r = NULL; - -#line 329 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 329 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 329 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 329 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("getnonblock", 0); - /* "nfstream/pcap.pyx":331 + /* "nfstream/pcap.pyx":350 * def getnonblock(self): * """Return non-blocking capture mode as boolean.""" * ret = pcap_ex_getnonblock(self.__pcap, self.__ebuf) # <<<<<<<<<<<<<< * if ret < 0: * raise OSError, self.__ebuf */ - -#line 331 "nfstream/pcap.pyx" __pyx_v_ret = pcap_ex_getnonblock(__pyx_v_self->__pyx___pcap, __pyx_v_self->__pyx___ebuf); - /* "nfstream/pcap.pyx":332 + /* "nfstream/pcap.pyx":351 * """Return non-blocking capture mode as boolean.""" * ret = pcap_ex_getnonblock(self.__pcap, self.__ebuf) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError, self.__ebuf * return ret != 0 */ - -#line 332 "nfstream/pcap.pyx" __pyx_t_1 = ((__pyx_v_ret < 0) != 0); - -#line 332 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":333 + /* "nfstream/pcap.pyx":352 * ret = pcap_ex_getnonblock(self.__pcap, self.__ebuf) * if ret < 0: * raise OSError, self.__ebuf # <<<<<<<<<<<<<< * return ret != 0 - * + * */ - -#line 333 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_self->__pyx___ebuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 333, __pyx_L1_error) - -#line 333 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_self->__pyx___ebuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 333 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_2, 0, 0); - -#line 333 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 352, __pyx_L1_error) -#line 333 "nfstream/pcap.pyx" - __PYX_ERR(1, 333, __pyx_L1_error) - - /* "nfstream/pcap.pyx":332 + /* "nfstream/pcap.pyx":351 * """Return non-blocking capture mode as boolean.""" * ret = pcap_ex_getnonblock(self.__pcap, self.__ebuf) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError, self.__ebuf * return ret != 0 */ - -#line 332 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":334 + /* "nfstream/pcap.pyx":353 * if ret < 0: * raise OSError, self.__ebuf * return ret != 0 # <<<<<<<<<<<<<< - * + * * def datalink(self): */ - -#line 334 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 334 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_ret != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 334, __pyx_L1_error) - -#line 334 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_ret != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 334 "nfstream/pcap.pyx" __pyx_r = __pyx_t_2; - -#line 334 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 334 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":329 + /* "nfstream/pcap.pyx":348 * pcap_ex_setnonblock(self.__pcap, nonblock, self.__ebuf) - * + * * def getnonblock(self): # <<<<<<<<<<<<<< * """Return non-blocking capture mode as boolean.""" * ret = pcap_ex_getnonblock(self.__pcap, self.__ebuf) */ -#line 329 "nfstream/pcap.pyx" - - -#line 329 "nfstream/pcap.pyx" /* function exit code */ - -#line 329 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 329 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 329 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.getnonblock", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 329 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 329 "nfstream/pcap.pyx" __pyx_L0:; - -#line 329 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 329 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 329 "nfstream/pcap.pyx" return __pyx_r; - -#line 329 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":336 +/* "nfstream/pcap.pyx":355 * return ret != 0 - * + * * def datalink(self): # <<<<<<<<<<<<<< * """Return datalink type (DLT_* values).""" * return pcap_datalink(self.__pcap) */ -#line 336 "nfstream/pcap.pyx" - - -#line 336 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 336 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_15datalink(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 336 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_14datalink[] = "Return datalink type (DLT_* values)."; - -#line 336 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_15datalink(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 336 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 336 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 336 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("datalink (wrapper)", 0); - __pyx_r = -#line 336 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_14datalink(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_14datalink(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 336 "nfstream/pcap.pyx" - - -#line 336 "nfstream/pcap.pyx" /* function exit code */ - -#line 336 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 336 "nfstream/pcap.pyx" return __pyx_r; - -#line 336 "nfstream/pcap.pyx" } -#line 336 "nfstream/pcap.pyx" - - -#line 336 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_14datalink(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 336 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 336 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 336 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 336 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("datalink", 0); - /* "nfstream/pcap.pyx":338 + /* "nfstream/pcap.pyx":357 * def datalink(self): * """Return datalink type (DLT_* values).""" * return pcap_datalink(self.__pcap) # <<<<<<<<<<<<<< - * + * * def __add_pkts(self, ts, pkt, pkts): */ - -#line 338 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 338 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyInt_From_int(pcap_datalink(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error) - -#line 338 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyInt_From_int(pcap_datalink(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 338 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 338 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 338 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":336 + /* "nfstream/pcap.pyx":355 * return ret != 0 - * + * * def datalink(self): # <<<<<<<<<<<<<< * """Return datalink type (DLT_* values).""" * return pcap_datalink(self.__pcap) */ -#line 336 "nfstream/pcap.pyx" - - -#line 336 "nfstream/pcap.pyx" /* function exit code */ - -#line 336 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 336 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 336 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.datalink", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 336 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 336 "nfstream/pcap.pyx" __pyx_L0:; - -#line 336 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 336 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 336 "nfstream/pcap.pyx" return __pyx_r; - -#line 336 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":340 +/* "nfstream/pcap.pyx":359 * return pcap_datalink(self.__pcap) - * + * * def __add_pkts(self, ts, pkt, pkts): # <<<<<<<<<<<<<< * pkts.append((ts, pkt)) - * + * */ -#line 340 "nfstream/pcap.pyx" - - -#line 340 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 340 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_17__add_pkts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 340 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_17__add_pkts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_ts = 0 -#line 340 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_pkt = 0 -#line 340 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_pkts = 0 -#line 340 "nfstream/pcap.pyx" -; - -#line 340 "nfstream/pcap.pyx" + PyObject *__pyx_v_ts = 0; + PyObject *__pyx_v_pkt = 0; + PyObject *__pyx_v_pkts = 0; PyObject *__pyx_r = 0; - -#line 340 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 340 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__add_pkts (wrapper)", 0); - -#line 340 "nfstream/pcap.pyx" { - -#line 340 "nfstream/pcap.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_pkt,&__pyx_n_s_pkts,0}; - -#line 340 "nfstream/pcap.pyx" PyObject* values[3] = {0,0,0}; - -#line 340 "nfstream/pcap.pyx" if (unlikely(__pyx_kwds)) { - -#line 340 "nfstream/pcap.pyx" Py_ssize_t kw_args; - -#line 340 "nfstream/pcap.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 340 "nfstream/pcap.pyx" switch (pos_args) { - case 3: -#line 340 "nfstream/pcap.pyx" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 340 "nfstream/pcap.pyx" + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: -#line 340 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 340 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 340 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 340 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 340 "nfstream/pcap.pyx" case 0: break; - default: -#line 340 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 340 "nfstream/pcap.pyx" + default: goto __pyx_L5_argtuple_error; } - -#line 340 "nfstream/pcap.pyx" kw_args = PyDict_Size(__pyx_kwds); - -#line 340 "nfstream/pcap.pyx" switch (pos_args) { - -#line 340 "nfstream/pcap.pyx" case 0: - -#line 340 "nfstream/pcap.pyx" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; - else -#line 340 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 340 "nfstream/pcap.pyx" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 340 "nfstream/pcap.pyx" case 1: - -#line 340 "nfstream/pcap.pyx" if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pkt)) != 0)) kw_args--; - -#line 340 "nfstream/pcap.pyx" else { - __Pyx_RaiseArgtupleInvalid("__add_pkts", 1, 3, 3, 1); -#line 340 "nfstream/pcap.pyx" -__PYX_ERR(1, 340, __pyx_L3_error) - -#line 340 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("__add_pkts", 1, 3, 3, 1); __PYX_ERR(1, 359, __pyx_L3_error) } - -#line 340 "nfstream/pcap.pyx" CYTHON_FALLTHROUGH; - -#line 340 "nfstream/pcap.pyx" case 2: - -#line 340 "nfstream/pcap.pyx" if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pkts)) != 0)) kw_args--; - -#line 340 "nfstream/pcap.pyx" else { - __Pyx_RaiseArgtupleInvalid("__add_pkts", 1, 3, 3, 2); -#line 340 "nfstream/pcap.pyx" -__PYX_ERR(1, 340, __pyx_L3_error) - -#line 340 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("__add_pkts", 1, 3, 3, 2); __PYX_ERR(1, 359, __pyx_L3_error) } - -#line 340 "nfstream/pcap.pyx" } - -#line 340 "nfstream/pcap.pyx" if (unlikely(kw_args > 0)) { - -#line 340 "nfstream/pcap.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add_pkts") < 0)) __PYX_ERR(1, 340, __pyx_L3_error) - -#line 340 "nfstream/pcap.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add_pkts") < 0)) __PYX_ERR(1, 359, __pyx_L3_error) } - -#line 340 "nfstream/pcap.pyx" } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - -#line 340 "nfstream/pcap.pyx" goto __pyx_L5_argtuple_error; - -#line 340 "nfstream/pcap.pyx" } else { - -#line 340 "nfstream/pcap.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 340 "nfstream/pcap.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 340 "nfstream/pcap.pyx" values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 340 "nfstream/pcap.pyx" } - -#line 340 "nfstream/pcap.pyx" __pyx_v_ts = values[0]; - -#line 340 "nfstream/pcap.pyx" __pyx_v_pkt = values[1]; - -#line 340 "nfstream/pcap.pyx" __pyx_v_pkts = values[2]; - -#line 340 "nfstream/pcap.pyx" } - -#line 340 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 340 "nfstream/pcap.pyx" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__add_pkts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); -#line 340 "nfstream/pcap.pyx" -__PYX_ERR(1, 340, __pyx_L3_error) - -#line 340 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("__add_pkts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 359, __pyx_L3_error) __pyx_L3_error:; - -#line 340 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.__add_pkts", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 340 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 340 "nfstream/pcap.pyx" return NULL; - -#line 340 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 340 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_16__add_pkts(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_ts, __pyx_v_pkt, __pyx_v_pkts); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_16__add_pkts(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_ts, __pyx_v_pkt, __pyx_v_pkts); -#line 340 "nfstream/pcap.pyx" - - -#line 340 "nfstream/pcap.pyx" /* function exit code */ - -#line 340 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 340 "nfstream/pcap.pyx" return __pyx_r; - -#line 340 "nfstream/pcap.pyx" } -#line 340 "nfstream/pcap.pyx" - - -#line 340 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_16__add_pkts(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_pkt, PyObject *__pyx_v_pkts) { - -#line 340 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 340 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 340 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 340 "nfstream/pcap.pyx" int __pyx_t_2; - -#line 340 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__add_pkts", 0); - /* "nfstream/pcap.pyx":341 - * + /* "nfstream/pcap.pyx":360 + * * def __add_pkts(self, ts, pkt, pkts): * pkts.append((ts, pkt)) # <<<<<<<<<<<<<< - * + * * def readpkts(self): */ - -#line 341 "nfstream/pcap.pyx" - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 341, __pyx_L1_error) - -#line 341 "nfstream/pcap.pyx" + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 341 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_v_ts); - -#line 341 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_v_ts); - -#line 341 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ts); - -#line 341 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_v_pkt); - -#line 341 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_v_pkt); - -#line 341 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_pkt); - -#line 341 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_pkts, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 341, __pyx_L1_error) - -#line 341 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_pkts, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":340 + /* "nfstream/pcap.pyx":359 * return pcap_datalink(self.__pcap) - * + * * def __add_pkts(self, ts, pkt, pkts): # <<<<<<<<<<<<<< * pkts.append((ts, pkt)) - * + * */ -#line 340 "nfstream/pcap.pyx" - - -#line 340 "nfstream/pcap.pyx" /* function exit code */ - -#line 340 "nfstream/pcap.pyx" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 340 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 340 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 340 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 340 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.__add_pkts", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 340 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 340 "nfstream/pcap.pyx" __pyx_L0:; - -#line 340 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 340 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 340 "nfstream/pcap.pyx" return __pyx_r; - -#line 340 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":343 +/* "nfstream/pcap.pyx":362 * pkts.append((ts, pkt)) - * + * * def readpkts(self): # <<<<<<<<<<<<<< * """Return a list of (timestamp, packet) tuples received in one buffer.""" * pkts = [] */ -#line 343 "nfstream/pcap.pyx" - - -#line 343 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 343 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_19readpkts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 343 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_18readpkts[] = "Return a list of (timestamp, packet) tuples received in one buffer."; - -#line 343 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_19readpkts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 343 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 343 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 343 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("readpkts (wrapper)", 0); - __pyx_r = -#line 343 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_18readpkts(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_18readpkts(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 343 "nfstream/pcap.pyx" - - -#line 343 "nfstream/pcap.pyx" /* function exit code */ - -#line 343 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 343 "nfstream/pcap.pyx" return __pyx_r; - -#line 343 "nfstream/pcap.pyx" } -#line 343 "nfstream/pcap.pyx" - - -#line 343 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_18readpkts(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - PyObject *__pyx_v_pkts = NULL -#line 343 "nfstream/pcap.pyx" -; - -#line 343 "nfstream/pcap.pyx" + PyObject *__pyx_v_pkts = NULL; PyObject *__pyx_r = NULL; - -#line 343 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 343 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 343 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 343 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 343 "nfstream/pcap.pyx" PyObject *__pyx_t_4 = NULL; - -#line 343 "nfstream/pcap.pyx" int __pyx_t_5; - -#line 343 "nfstream/pcap.pyx" PyObject *__pyx_t_6 = NULL; - -#line 343 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("readpkts", 0); - /* "nfstream/pcap.pyx":345 + /* "nfstream/pcap.pyx":364 * def readpkts(self): * """Return a list of (timestamp, packet) tuples received in one buffer.""" * pkts = [] # <<<<<<<<<<<<<< * self.dispatch(-1, self.__add_pkts, pkts) * return pkts */ - -#line 345 "nfstream/pcap.pyx" - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 345, __pyx_L1_error) - -#line 345 "nfstream/pcap.pyx" + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 345 "nfstream/pcap.pyx" __pyx_v_pkts = ((PyObject*)__pyx_t_1); - -#line 345 "nfstream/pcap.pyx" __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":346 + /* "nfstream/pcap.pyx":365 * """Return a list of (timestamp, packet) tuples received in one buffer.""" * pkts = [] * self.dispatch(-1, self.__add_pkts, pkts) # <<<<<<<<<<<<<< * return pkts - * + * */ - -#line 346 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 346, __pyx_L1_error) - -#line 346 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 346 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_pkts); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 346, __pyx_L1_error) - -#line 346 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_pkts); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 346 "nfstream/pcap.pyx" __pyx_t_4 = NULL; - -#line 346 "nfstream/pcap.pyx" __pyx_t_5 = 0; - -#line 346 "nfstream/pcap.pyx" if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - -#line 346 "nfstream/pcap.pyx" __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - -#line 346 "nfstream/pcap.pyx" if (likely(__pyx_t_4)) { - -#line 346 "nfstream/pcap.pyx" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - -#line 346 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_t_4); - -#line 346 "nfstream/pcap.pyx" __Pyx_INCREF(function); - -#line 346 "nfstream/pcap.pyx" __Pyx_DECREF_SET(__pyx_t_2, function); - -#line 346 "nfstream/pcap.pyx" __pyx_t_5 = 1; - -#line 346 "nfstream/pcap.pyx" } - -#line 346 "nfstream/pcap.pyx" } - -#line 346 "nfstream/pcap.pyx" #if CYTHON_FAST_PYCALL - -#line 346 "nfstream/pcap.pyx" if (PyFunction_Check(__pyx_t_2)) { - -#line 346 "nfstream/pcap.pyx" PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_int_neg_1, __pyx_t_3, __pyx_v_pkts}; - -#line 346 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 346, __pyx_L1_error) - -#line 346 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 365, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 346 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_1); - -#line 346 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 346 "nfstream/pcap.pyx" } else - -#line 346 "nfstream/pcap.pyx" #endif - -#line 346 "nfstream/pcap.pyx" #if CYTHON_FAST_PYCCALL - -#line 346 "nfstream/pcap.pyx" if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - -#line 346 "nfstream/pcap.pyx" PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_int_neg_1, __pyx_t_3, __pyx_v_pkts}; - -#line 346 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 346, __pyx_L1_error) - -#line 346 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 365, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 346 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_1); - -#line 346 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 346 "nfstream/pcap.pyx" } else - -#line 346 "nfstream/pcap.pyx" #endif - -#line 346 "nfstream/pcap.pyx" { - -#line 346 "nfstream/pcap.pyx" - __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 346, __pyx_L1_error) - -#line 346 "nfstream/pcap.pyx" + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - -#line 346 "nfstream/pcap.pyx" if (__pyx_t_4) { - -#line 346 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - -#line 346 "nfstream/pcap.pyx" } - -#line 346 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_int_neg_1); - -#line 346 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_int_neg_1); - -#line 346 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_int_neg_1); - -#line 346 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_3); - -#line 346 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); - -#line 346 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_v_pkts); - -#line 346 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_v_pkts); - -#line 346 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_pkts); - -#line 346 "nfstream/pcap.pyx" __pyx_t_3 = 0; - -#line 346 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 346, __pyx_L1_error) - -#line 346 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 346 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 346 "nfstream/pcap.pyx" } - -#line 346 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 346 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":347 + /* "nfstream/pcap.pyx":366 * pkts = [] * self.dispatch(-1, self.__add_pkts, pkts) * return pkts # <<<<<<<<<<<<<< - * + * * def dispatch(self, cnt, callback, *args): */ - -#line 347 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 347 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_v_pkts); - -#line 347 "nfstream/pcap.pyx" __pyx_r = __pyx_v_pkts; - -#line 347 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":343 + /* "nfstream/pcap.pyx":362 * pkts.append((ts, pkt)) - * + * * def readpkts(self): # <<<<<<<<<<<<<< * """Return a list of (timestamp, packet) tuples received in one buffer.""" * pkts = [] */ -#line 343 "nfstream/pcap.pyx" - - -#line 343 "nfstream/pcap.pyx" /* function exit code */ - -#line 343 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 343 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 343 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 343 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); - -#line 343 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); - -#line 343 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_6); - -#line 343 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.readpkts", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 343 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 343 "nfstream/pcap.pyx" __pyx_L0:; - -#line 343 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_v_pkts); - -#line 343 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 343 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 343 "nfstream/pcap.pyx" return __pyx_r; - -#line 343 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":349 +/* "nfstream/pcap.pyx":368 * return pkts - * + * * def dispatch(self, cnt, callback, *args): # <<<<<<<<<<<<<< * """Collect and process packets with a user callback, * return the number of packets processed, or 0 for a savefile. */ -#line 349 "nfstream/pcap.pyx" - - -#line 349 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 349 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_21dispatch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 349 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_20dispatch[] = "Collect and process packets with a user callback,\n return the number of packets processed, or 0 for a savefile.\n\n Arguments:\n\n cnt -- number of packets to process;\n or 0 to process all packets until an error occurs,\n EOF is reached, or the read times out;\n or -1 to process all packets received in one buffer\n callback -- function with (timestamp, pkt, *args) prototype\n *args -- optional arguments passed to callback on execution\n "; - -#line 349 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_21dispatch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_cnt = 0 -#line 349 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_callback = 0 -#line 349 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_args = 0 -#line 349 "nfstream/pcap.pyx" -; - -#line 349 "nfstream/pcap.pyx" + PyObject *__pyx_v_cnt = 0; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; - -#line 349 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 349 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("dispatch (wrapper)", 0); - -#line 349 "nfstream/pcap.pyx" if (PyTuple_GET_SIZE(__pyx_args) > 2) { - -#line 349 "nfstream/pcap.pyx" __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); - -#line 349 "nfstream/pcap.pyx" if (unlikely(!__pyx_v_args)) { - -#line 349 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 349 "nfstream/pcap.pyx" return NULL; - -#line 349 "nfstream/pcap.pyx" } - -#line 349 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_v_args); - -#line 349 "nfstream/pcap.pyx" } else { - __pyx_v_args = __pyx_empty_tuple; -#line 349 "nfstream/pcap.pyx" -__Pyx_INCREF(__pyx_empty_tuple); - -#line 349 "nfstream/pcap.pyx" + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } - -#line 349 "nfstream/pcap.pyx" { - -#line 349 "nfstream/pcap.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cnt,&__pyx_n_s_callback,0}; - -#line 349 "nfstream/pcap.pyx" PyObject* values[2] = {0,0}; - -#line 349 "nfstream/pcap.pyx" if (unlikely(__pyx_kwds)) { - -#line 349 "nfstream/pcap.pyx" Py_ssize_t kw_args; - -#line 349 "nfstream/pcap.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 349 "nfstream/pcap.pyx" switch (pos_args) { - -#line 349 "nfstream/pcap.pyx" default: - case 2: -#line 349 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 349 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 349 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 349 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 349 "nfstream/pcap.pyx" case 0: break; - -#line 349 "nfstream/pcap.pyx" } - -#line 349 "nfstream/pcap.pyx" kw_args = PyDict_Size(__pyx_kwds); - -#line 349 "nfstream/pcap.pyx" switch (pos_args) { - -#line 349 "nfstream/pcap.pyx" case 0: - -#line 349 "nfstream/pcap.pyx" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cnt)) != 0)) kw_args--; - else -#line 349 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 349 "nfstream/pcap.pyx" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 349 "nfstream/pcap.pyx" case 1: - -#line 349 "nfstream/pcap.pyx" if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; - -#line 349 "nfstream/pcap.pyx" else { - __Pyx_RaiseArgtupleInvalid("dispatch", 0, 2, 2, 1); -#line 349 "nfstream/pcap.pyx" -__PYX_ERR(1, 349, __pyx_L3_error) - -#line 349 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("dispatch", 0, 2, 2, 1); __PYX_ERR(1, 368, __pyx_L3_error) } - -#line 349 "nfstream/pcap.pyx" } - -#line 349 "nfstream/pcap.pyx" if (unlikely(kw_args > 0)) { - -#line 349 "nfstream/pcap.pyx" const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; - -#line 349 "nfstream/pcap.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "dispatch") < 0)) __PYX_ERR(1, 349, __pyx_L3_error) - -#line 349 "nfstream/pcap.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "dispatch") < 0)) __PYX_ERR(1, 368, __pyx_L3_error) } - -#line 349 "nfstream/pcap.pyx" } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { - -#line 349 "nfstream/pcap.pyx" goto __pyx_L5_argtuple_error; - -#line 349 "nfstream/pcap.pyx" } else { - -#line 349 "nfstream/pcap.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 349 "nfstream/pcap.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 349 "nfstream/pcap.pyx" } - -#line 349 "nfstream/pcap.pyx" __pyx_v_cnt = values[0]; - -#line 349 "nfstream/pcap.pyx" __pyx_v_callback = values[1]; - -#line 349 "nfstream/pcap.pyx" } - -#line 349 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 349 "nfstream/pcap.pyx" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("dispatch", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); -#line 349 "nfstream/pcap.pyx" -__PYX_ERR(1, 349, __pyx_L3_error) - -#line 349 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("dispatch", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 368, __pyx_L3_error) __pyx_L3_error:; - -#line 349 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; - -#line 349 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 349 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 349 "nfstream/pcap.pyx" return NULL; - -#line 349 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 349 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_20dispatch(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_cnt, __pyx_v_callback, __pyx_v_args); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_20dispatch(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_cnt, __pyx_v_callback, __pyx_v_args); -#line 349 "nfstream/pcap.pyx" - - -#line 349 "nfstream/pcap.pyx" /* function exit code */ - -#line 349 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_v_args); - -#line 349 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 349 "nfstream/pcap.pyx" return __pyx_r; - -#line 349 "nfstream/pcap.pyx" } -#line 349 "nfstream/pcap.pyx" - - -#line 349 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_20dispatch(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, PyObject *__pyx_v_cnt, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { - struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *__pyx_v_ctx = 0 -#line 349 "nfstream/pcap.pyx" -; - int __pyx_v_n -#line 349 "nfstream/pcap.pyx" -; - -#line 349 "nfstream/pcap.pyx" + struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *__pyx_v_ctx = 0; + int __pyx_v_n; PyObject *__pyx_r = NULL; - -#line 349 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 349 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 349 "nfstream/pcap.pyx" double __pyx_t_2; - -#line 349 "nfstream/pcap.pyx" PY_LONG_LONG __pyx_t_3; - -#line 349 "nfstream/pcap.pyx" int __pyx_t_4; - -#line 349 "nfstream/pcap.pyx" int __pyx_t_5; - -#line 349 "nfstream/pcap.pyx" PyObject *__pyx_t_6 = NULL; - -#line 349 "nfstream/pcap.pyx" PyObject *__pyx_t_7 = NULL; - -#line 349 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("dispatch", 0); - /* "nfstream/pcap.pyx":362 + /* "nfstream/pcap.pyx":381 * *args -- optional arguments passed to callback on execution * """ * cdef pcap_handler_ctx ctx = pcap_handler_ctx() # <<<<<<<<<<<<<< * cdef int n - * + * */ - -#line 362 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8nfstream_4pcap_pcap_handler_ctx), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 362, __pyx_L1_error) - -#line 362 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8nfstream_4pcap_pcap_handler_ctx), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 362 "nfstream/pcap.pyx" __pyx_v_ctx = ((struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)__pyx_t_1); - -#line 362 "nfstream/pcap.pyx" __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":365 + /* "nfstream/pcap.pyx":384 * cdef int n - * + * * ctx.scale = self.__precision_scale # <<<<<<<<<<<<<< * ctx.scale_ns = self.__precision_scale_ns * ctx.timestamp_in_ns = self.__timestamp_in_ns */ - -#line 365 "nfstream/pcap.pyx" __pyx_t_2 = __pyx_v_self->__pyx___precision_scale; - -#line 365 "nfstream/pcap.pyx" __pyx_v_ctx->scale = __pyx_t_2; - /* "nfstream/pcap.pyx":366 - * + /* "nfstream/pcap.pyx":385 + * * ctx.scale = self.__precision_scale * ctx.scale_ns = self.__precision_scale_ns # <<<<<<<<<<<<<< * ctx.timestamp_in_ns = self.__timestamp_in_ns * ctx.callback = callback */ - -#line 366 "nfstream/pcap.pyx" __pyx_t_3 = __pyx_v_self->__pyx___precision_scale_ns; - -#line 366 "nfstream/pcap.pyx" __pyx_v_ctx->scale_ns = __pyx_t_3; - /* "nfstream/pcap.pyx":367 + /* "nfstream/pcap.pyx":386 * ctx.scale = self.__precision_scale * ctx.scale_ns = self.__precision_scale_ns * ctx.timestamp_in_ns = self.__timestamp_in_ns # <<<<<<<<<<<<<< * ctx.callback = callback * ctx.args = args */ - -#line 367 "nfstream/pcap.pyx" __pyx_t_4 = __pyx_v_self->__pyx___timestamp_in_ns; - -#line 367 "nfstream/pcap.pyx" __pyx_v_ctx->timestamp_in_ns = __pyx_t_4; - /* "nfstream/pcap.pyx":368 + /* "nfstream/pcap.pyx":387 * ctx.scale_ns = self.__precision_scale_ns * ctx.timestamp_in_ns = self.__timestamp_in_ns * ctx.callback = callback # <<<<<<<<<<<<<< * ctx.args = args * n = pcap_dispatch(self.__pcap, cnt, __pcap_handler, ctx) */ - -#line 368 "nfstream/pcap.pyx" __pyx_v_ctx->callback = ((void *)__pyx_v_callback); - /* "nfstream/pcap.pyx":369 + /* "nfstream/pcap.pyx":388 * ctx.timestamp_in_ns = self.__timestamp_in_ns * ctx.callback = callback * ctx.args = args # <<<<<<<<<<<<<< * n = pcap_dispatch(self.__pcap, cnt, __pcap_handler, ctx) * if ctx.exc: */ - -#line 369 "nfstream/pcap.pyx" __pyx_v_ctx->args = ((void *)__pyx_v_args); - /* "nfstream/pcap.pyx":370 + /* "nfstream/pcap.pyx":389 * ctx.callback = callback * ctx.args = args * n = pcap_dispatch(self.__pcap, cnt, __pcap_handler, ctx) # <<<<<<<<<<<<<< * if ctx.exc: * raise ctx.exc[0], ctx.exc[1], ctx.exc[2] */ - -#line 370 "nfstream/pcap.pyx" - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_cnt); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 370, __pyx_L1_error) - -#line 370 "nfstream/pcap.pyx" + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_cnt); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 389, __pyx_L1_error) __pyx_v_n = pcap_dispatch(__pyx_v_self->__pyx___pcap, __pyx_t_5, __pyx_f_8nfstream_4pcap___pcap_handler, ((__pyx_t_8nfstream_4pcap_u_char *)((void *)__pyx_v_ctx))); - /* "nfstream/pcap.pyx":371 + /* "nfstream/pcap.pyx":390 * ctx.args = args * n = pcap_dispatch(self.__pcap, cnt, __pcap_handler, ctx) * if ctx.exc: # <<<<<<<<<<<<<< * raise ctx.exc[0], ctx.exc[1], ctx.exc[2] * return n */ - -#line 371 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ctx->exc); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 371, __pyx_L1_error) - -#line 371 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ctx->exc); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 390, __pyx_L1_error) if (__pyx_t_4) { - /* "nfstream/pcap.pyx":372 + /* "nfstream/pcap.pyx":391 * n = pcap_dispatch(self.__pcap, cnt, __pcap_handler, ctx) * if ctx.exc: * raise ctx.exc[0], ctx.exc[1], ctx.exc[2] # <<<<<<<<<<<<<< * return n - * + * */ - -#line 372 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ctx->exc, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 372, __pyx_L1_error) - -#line 372 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ctx->exc, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 372 "nfstream/pcap.pyx" - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_ctx->exc, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 372, __pyx_L1_error) - -#line 372 "nfstream/pcap.pyx" + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_ctx->exc, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - -#line 372 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ctx->exc, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 372, __pyx_L1_error) - -#line 372 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ctx->exc, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - -#line 372 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_t_1, __pyx_t_6, __pyx_t_7, 0); - -#line 372 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 372 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 372 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(1, 391, __pyx_L1_error) -#line 372 "nfstream/pcap.pyx" - __PYX_ERR(1, 372, __pyx_L1_error) - - /* "nfstream/pcap.pyx":371 + /* "nfstream/pcap.pyx":390 * ctx.args = args * n = pcap_dispatch(self.__pcap, cnt, __pcap_handler, ctx) * if ctx.exc: # <<<<<<<<<<<<<< * raise ctx.exc[0], ctx.exc[1], ctx.exc[2] * return n */ - -#line 371 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":373 + /* "nfstream/pcap.pyx":392 * if ctx.exc: * raise ctx.exc[0], ctx.exc[1], ctx.exc[2] * return n # <<<<<<<<<<<<<< - * + * * def loop(self, cnt, callback, *args): */ - -#line 373 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 373 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 373, __pyx_L1_error) - -#line 373 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - -#line 373 "nfstream/pcap.pyx" __pyx_r = __pyx_t_7; - -#line 373 "nfstream/pcap.pyx" __pyx_t_7 = 0; - -#line 373 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":349 + /* "nfstream/pcap.pyx":368 * return pkts - * + * * def dispatch(self, cnt, callback, *args): # <<<<<<<<<<<<<< * """Collect and process packets with a user callback, * return the number of packets processed, or 0 for a savefile. */ -#line 349 "nfstream/pcap.pyx" - - -#line 349 "nfstream/pcap.pyx" /* function exit code */ - -#line 349 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 349 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 349 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_6); - -#line 349 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_7); - -#line 349 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 349 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 349 "nfstream/pcap.pyx" __pyx_L0:; - -#line 349 "nfstream/pcap.pyx" __Pyx_XDECREF((PyObject *)__pyx_v_ctx); - -#line 349 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 349 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 349 "nfstream/pcap.pyx" return __pyx_r; - -#line 349 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":375 +/* "nfstream/pcap.pyx":394 * return n - * + * * def loop(self, cnt, callback, *args): # <<<<<<<<<<<<<< * """Processing packets with a user callback during a loop. * The loop can be exited when cnt value is reached */ -#line 375 "nfstream/pcap.pyx" - - -#line 375 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 375 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_23loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 375 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_22loop[] = "Processing packets with a user callback during a loop.\n The loop can be exited when cnt value is reached\n or with an exception, including KeyboardInterrupt.\n\n Arguments:\n\n cnt -- number of packets to process;\n 0 or -1 to process all packets until an error occurs,\n EOF is reached;\n callback -- function with (timestamp, pkt, *args) prototype\n *args -- optional arguments passed to callback on execution\n "; - -#line 375 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_23loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_cnt = 0 -#line 375 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_callback = 0 -#line 375 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_args = 0 -#line 375 "nfstream/pcap.pyx" -; - -#line 375 "nfstream/pcap.pyx" + PyObject *__pyx_v_cnt = 0; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; - -#line 375 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 375 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("loop (wrapper)", 0); - -#line 375 "nfstream/pcap.pyx" if (PyTuple_GET_SIZE(__pyx_args) > 2) { - -#line 375 "nfstream/pcap.pyx" __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); - -#line 375 "nfstream/pcap.pyx" if (unlikely(!__pyx_v_args)) { - -#line 375 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 375 "nfstream/pcap.pyx" return NULL; - -#line 375 "nfstream/pcap.pyx" } - -#line 375 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_v_args); - -#line 375 "nfstream/pcap.pyx" } else { - __pyx_v_args = __pyx_empty_tuple; -#line 375 "nfstream/pcap.pyx" -__Pyx_INCREF(__pyx_empty_tuple); - -#line 375 "nfstream/pcap.pyx" + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } - -#line 375 "nfstream/pcap.pyx" { - -#line 375 "nfstream/pcap.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cnt,&__pyx_n_s_callback,0}; - -#line 375 "nfstream/pcap.pyx" PyObject* values[2] = {0,0}; - -#line 375 "nfstream/pcap.pyx" if (unlikely(__pyx_kwds)) { - -#line 375 "nfstream/pcap.pyx" Py_ssize_t kw_args; - -#line 375 "nfstream/pcap.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 375 "nfstream/pcap.pyx" switch (pos_args) { - -#line 375 "nfstream/pcap.pyx" default: - case 2: -#line 375 "nfstream/pcap.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 375 "nfstream/pcap.pyx" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 375 "nfstream/pcap.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 375 "nfstream/pcap.pyx" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 375 "nfstream/pcap.pyx" case 0: break; - -#line 375 "nfstream/pcap.pyx" } - -#line 375 "nfstream/pcap.pyx" kw_args = PyDict_Size(__pyx_kwds); - -#line 375 "nfstream/pcap.pyx" switch (pos_args) { - -#line 375 "nfstream/pcap.pyx" case 0: - -#line 375 "nfstream/pcap.pyx" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cnt)) != 0)) kw_args--; - else -#line 375 "nfstream/pcap.pyx" -goto __pyx_L5_argtuple_error; - -#line 375 "nfstream/pcap.pyx" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 375 "nfstream/pcap.pyx" case 1: - -#line 375 "nfstream/pcap.pyx" if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; - -#line 375 "nfstream/pcap.pyx" else { - __Pyx_RaiseArgtupleInvalid("loop", 0, 2, 2, 1); -#line 375 "nfstream/pcap.pyx" -__PYX_ERR(1, 375, __pyx_L3_error) - -#line 375 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("loop", 0, 2, 2, 1); __PYX_ERR(1, 394, __pyx_L3_error) } - -#line 375 "nfstream/pcap.pyx" } - -#line 375 "nfstream/pcap.pyx" if (unlikely(kw_args > 0)) { - -#line 375 "nfstream/pcap.pyx" const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; - -#line 375 "nfstream/pcap.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "loop") < 0)) __PYX_ERR(1, 375, __pyx_L3_error) - -#line 375 "nfstream/pcap.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "loop") < 0)) __PYX_ERR(1, 394, __pyx_L3_error) } - -#line 375 "nfstream/pcap.pyx" } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { - -#line 375 "nfstream/pcap.pyx" goto __pyx_L5_argtuple_error; - -#line 375 "nfstream/pcap.pyx" } else { - -#line 375 "nfstream/pcap.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 375 "nfstream/pcap.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 375 "nfstream/pcap.pyx" } - -#line 375 "nfstream/pcap.pyx" __pyx_v_cnt = values[0]; - -#line 375 "nfstream/pcap.pyx" __pyx_v_callback = values[1]; - -#line 375 "nfstream/pcap.pyx" } - -#line 375 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 375 "nfstream/pcap.pyx" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("loop", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); -#line 375 "nfstream/pcap.pyx" -__PYX_ERR(1, 375, __pyx_L3_error) - -#line 375 "nfstream/pcap.pyx" + __Pyx_RaiseArgtupleInvalid("loop", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 394, __pyx_L3_error) __pyx_L3_error:; - -#line 375 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; - -#line 375 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.loop", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 375 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 375 "nfstream/pcap.pyx" return NULL; - -#line 375 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 375 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_22loop(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_cnt, __pyx_v_callback, __pyx_v_args); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_22loop(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), __pyx_v_cnt, __pyx_v_callback, __pyx_v_args); -#line 375 "nfstream/pcap.pyx" - - -#line 375 "nfstream/pcap.pyx" /* function exit code */ - -#line 375 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_v_args); - -#line 375 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 375 "nfstream/pcap.pyx" return __pyx_r; - -#line 375 "nfstream/pcap.pyx" } -#line 375 "nfstream/pcap.pyx" - - -#line 375 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_22loop(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, PyObject *__pyx_v_cnt, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { - struct pcap_pkthdr __pyx_v_hdr -#line 375 "nfstream/pcap.pyx" -; - __pyx_t_8nfstream_4pcap_u_char *__pyx_v_pkt -#line 375 "nfstream/pcap.pyx" -; - int __pyx_v_n -#line 375 "nfstream/pcap.pyx" -; - int __pyx_v_i -#line 375 "nfstream/pcap.pyx" -; - double __pyx_v_scale -#line 375 "nfstream/pcap.pyx" -; - PY_LONG_LONG __pyx_v_scale_ns -#line 375 "nfstream/pcap.pyx" -; - int __pyx_v_timestamp_in_ns -#line 375 "nfstream/pcap.pyx" -; - -#line 375 "nfstream/pcap.pyx" + struct pcap_pkthdr __pyx_v_hdr; + __pyx_t_8nfstream_4pcap_u_char *__pyx_v_pkt; + int __pyx_v_n; + int __pyx_v_i; + double __pyx_v_scale; + PY_LONG_LONG __pyx_v_scale_ns; + int __pyx_v_timestamp_in_ns; PyObject *__pyx_r = NULL; - -#line 375 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 375 "nfstream/pcap.pyx" double __pyx_t_1; - -#line 375 "nfstream/pcap.pyx" PY_LONG_LONG __pyx_t_2; - -#line 375 "nfstream/pcap.pyx" int __pyx_t_3; - -#line 375 "nfstream/pcap.pyx" PyObject *__pyx_t_4 = NULL; - -#line 375 "nfstream/pcap.pyx" PyObject *__pyx_t_5 = NULL; - -#line 375 "nfstream/pcap.pyx" PyObject *__pyx_t_6 = NULL; - -#line 375 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("loop", 0); - /* "nfstream/pcap.pyx":391 + /* "nfstream/pcap.pyx":410 * cdef u_char *pkt * cdef int n * cdef int i = 1 # <<<<<<<<<<<<<< * cdef double scale = self.__precision_scale * cdef long long scale_ns = self.__precision_scale_ns */ - -#line 391 "nfstream/pcap.pyx" __pyx_v_i = 1; - /* "nfstream/pcap.pyx":392 + /* "nfstream/pcap.pyx":411 * cdef int n * cdef int i = 1 * cdef double scale = self.__precision_scale # <<<<<<<<<<<<<< * cdef long long scale_ns = self.__precision_scale_ns * cdef bint timestamp_in_ns = self.__timestamp_in_ns */ - -#line 392 "nfstream/pcap.pyx" __pyx_t_1 = __pyx_v_self->__pyx___precision_scale; - -#line 392 "nfstream/pcap.pyx" __pyx_v_scale = __pyx_t_1; - /* "nfstream/pcap.pyx":393 + /* "nfstream/pcap.pyx":412 * cdef int i = 1 * cdef double scale = self.__precision_scale * cdef long long scale_ns = self.__precision_scale_ns # <<<<<<<<<<<<<< * cdef bint timestamp_in_ns = self.__timestamp_in_ns * pcap_ex_setup(self.__pcap) */ - -#line 393 "nfstream/pcap.pyx" __pyx_t_2 = __pyx_v_self->__pyx___precision_scale_ns; - -#line 393 "nfstream/pcap.pyx" __pyx_v_scale_ns = __pyx_t_2; - /* "nfstream/pcap.pyx":394 + /* "nfstream/pcap.pyx":413 * cdef double scale = self.__precision_scale * cdef long long scale_ns = self.__precision_scale_ns * cdef bint timestamp_in_ns = self.__timestamp_in_ns # <<<<<<<<<<<<<< * pcap_ex_setup(self.__pcap) * while 1: */ - -#line 394 "nfstream/pcap.pyx" __pyx_t_3 = __pyx_v_self->__pyx___timestamp_in_ns; - -#line 394 "nfstream/pcap.pyx" __pyx_v_timestamp_in_ns = __pyx_t_3; - /* "nfstream/pcap.pyx":395 + /* "nfstream/pcap.pyx":414 * cdef long long scale_ns = self.__precision_scale_ns * cdef bint timestamp_in_ns = self.__timestamp_in_ns * pcap_ex_setup(self.__pcap) # <<<<<<<<<<<<<< * while 1: * with nogil: */ - -#line 395 "nfstream/pcap.pyx" pcap_ex_setup(__pyx_v_self->__pyx___pcap); - /* "nfstream/pcap.pyx":396 + /* "nfstream/pcap.pyx":415 * cdef bint timestamp_in_ns = self.__timestamp_in_ns * pcap_ex_setup(self.__pcap) * while 1: # <<<<<<<<<<<<<< * with nogil: * n = pcap_ex_next(self.__pcap, &hdr, &pkt) */ - -#line 396 "nfstream/pcap.pyx" while (1) { - /* "nfstream/pcap.pyx":397 + /* "nfstream/pcap.pyx":416 * pcap_ex_setup(self.__pcap) * while 1: * with nogil: # <<<<<<<<<<<<<< * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: */ - -#line 397 "nfstream/pcap.pyx" { - -#line 397 "nfstream/pcap.pyx" #ifdef WITH_THREAD - -#line 397 "nfstream/pcap.pyx" PyThreadState *_save; - -#line 397 "nfstream/pcap.pyx" Py_UNBLOCK_THREADS - -#line 397 "nfstream/pcap.pyx" __Pyx_FastGIL_Remember(); - -#line 397 "nfstream/pcap.pyx" #endif - -#line 397 "nfstream/pcap.pyx" /*try:*/ { - /* "nfstream/pcap.pyx":398 + /* "nfstream/pcap.pyx":417 * while 1: * with nogil: * n = pcap_ex_next(self.__pcap, &hdr, &pkt) # <<<<<<<<<<<<<< * if n == 1: * if timestamp_in_ns: */ - -#line 398 "nfstream/pcap.pyx" __pyx_v_n = pcap_ex_next(__pyx_v_self->__pyx___pcap, (&__pyx_v_hdr), (&__pyx_v_pkt)); - -#line 398 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":397 + /* "nfstream/pcap.pyx":416 * pcap_ex_setup(self.__pcap) * while 1: * with nogil: # <<<<<<<<<<<<<< * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: */ - -#line 397 "nfstream/pcap.pyx" /*finally:*/ { - -#line 397 "nfstream/pcap.pyx" /*normal exit:*/{ - -#line 397 "nfstream/pcap.pyx" #ifdef WITH_THREAD - -#line 397 "nfstream/pcap.pyx" __Pyx_FastGIL_Forget(); - -#line 397 "nfstream/pcap.pyx" Py_BLOCK_THREADS - -#line 397 "nfstream/pcap.pyx" #endif - -#line 397 "nfstream/pcap.pyx" goto __pyx_L9; - -#line 397 "nfstream/pcap.pyx" } - -#line 397 "nfstream/pcap.pyx" __pyx_L9:; - -#line 397 "nfstream/pcap.pyx" } - -#line 397 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":399 + /* "nfstream/pcap.pyx":418 * with nogil: * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: # <<<<<<<<<<<<<< * if timestamp_in_ns: * callback( */ - -#line 399 "nfstream/pcap.pyx" switch (__pyx_v_n) { - -#line 399 "nfstream/pcap.pyx" case 1: - /* "nfstream/pcap.pyx":400 + /* "nfstream/pcap.pyx":419 * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: * if timestamp_in_ns: # <<<<<<<<<<<<<< * callback( * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns), */ - -#line 400 "nfstream/pcap.pyx" __pyx_t_3 = (__pyx_v_timestamp_in_ns != 0); - -#line 400 "nfstream/pcap.pyx" if (__pyx_t_3) { - /* "nfstream/pcap.pyx":402 + /* "nfstream/pcap.pyx":421 * if timestamp_in_ns: * callback( * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns), # <<<<<<<<<<<<<< * get_buffer(pkt, hdr.caplen), * *args */ - -#line 402 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(((__pyx_v_hdr.ts.tv_sec * 1000000000LL) + (__pyx_v_hdr.ts.tv_usec * __pyx_v_scale_ns))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 402, __pyx_L1_error) - -#line 402 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(((__pyx_v_hdr.ts.tv_sec * 1000000000LL) + (__pyx_v_hdr.ts.tv_usec * __pyx_v_scale_ns))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "nfstream/pcap.pyx":403 + /* "nfstream/pcap.pyx":422 * callback( * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns), * get_buffer(pkt, hdr.caplen), # <<<<<<<<<<<<<< * *args * ) */ - -#line 403 "nfstream/pcap.pyx" - __pyx_t_5 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr.caplen); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 403, __pyx_L1_error) - -#line 403 "nfstream/pcap.pyx" + __pyx_t_5 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr.caplen); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "nfstream/pcap.pyx":401 + /* "nfstream/pcap.pyx":420 * if n == 1: * if timestamp_in_ns: * callback( # <<<<<<<<<<<<<< * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns), * get_buffer(pkt, hdr.caplen), */ - -#line 401 "nfstream/pcap.pyx" - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 401, __pyx_L1_error) - -#line 401 "nfstream/pcap.pyx" + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - -#line 401 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_4); - -#line 401 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); - -#line 401 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_5); - -#line 401 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - -#line 401 "nfstream/pcap.pyx" __pyx_t_4 = 0; - -#line 401 "nfstream/pcap.pyx" __pyx_t_5 = 0; - /* "nfstream/pcap.pyx":405 + /* "nfstream/pcap.pyx":424 * get_buffer(pkt, hdr.caplen), * *args * ) # <<<<<<<<<<<<<< * else: * callback( */ - -#line 405 "nfstream/pcap.pyx" - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error) - -#line 405 "nfstream/pcap.pyx" + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - -#line 405 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "nfstream/pcap.pyx":401 + /* "nfstream/pcap.pyx":420 * if n == 1: * if timestamp_in_ns: * callback( # <<<<<<<<<<<<<< * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns), * get_buffer(pkt, hdr.caplen), */ - -#line 401 "nfstream/pcap.pyx" - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_callback, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 401, __pyx_L1_error) - -#line 401 "nfstream/pcap.pyx" + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_callback, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - -#line 401 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 401 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "nfstream/pcap.pyx":400 + /* "nfstream/pcap.pyx":419 * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: * if timestamp_in_ns: # <<<<<<<<<<<<<< * callback( * (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns), */ - -#line 400 "nfstream/pcap.pyx" goto __pyx_L10; - -#line 400 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":407 + /* "nfstream/pcap.pyx":426 * ) * else: * callback( # <<<<<<<<<<<<<< * hdr.ts.tv_sec + (hdr.ts.tv_usec * scale), * get_buffer(pkt, hdr.caplen), */ - -#line 407 "nfstream/pcap.pyx" /*else*/ { - /* "nfstream/pcap.pyx":408 + /* "nfstream/pcap.pyx":427 * else: * callback( * hdr.ts.tv_sec + (hdr.ts.tv_usec * scale), # <<<<<<<<<<<<<< * get_buffer(pkt, hdr.caplen), * *args */ - -#line 408 "nfstream/pcap.pyx" - __pyx_t_6 = PyFloat_FromDouble((__pyx_v_hdr.ts.tv_sec + (__pyx_v_hdr.ts.tv_usec * __pyx_v_scale))); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 408, __pyx_L1_error) - -#line 408 "nfstream/pcap.pyx" + __pyx_t_6 = PyFloat_FromDouble((__pyx_v_hdr.ts.tv_sec + (__pyx_v_hdr.ts.tv_usec * __pyx_v_scale))); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "nfstream/pcap.pyx":409 + /* "nfstream/pcap.pyx":428 * callback( * hdr.ts.tv_sec + (hdr.ts.tv_usec * scale), * get_buffer(pkt, hdr.caplen), # <<<<<<<<<<<<<< * *args * ) */ - -#line 409 "nfstream/pcap.pyx" - __pyx_t_5 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr.caplen); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error) - -#line 409 "nfstream/pcap.pyx" + __pyx_t_5 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr.caplen); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "nfstream/pcap.pyx":407 + /* "nfstream/pcap.pyx":426 * ) * else: * callback( # <<<<<<<<<<<<<< * hdr.ts.tv_sec + (hdr.ts.tv_usec * scale), * get_buffer(pkt, hdr.caplen), */ - -#line 407 "nfstream/pcap.pyx" - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error) - -#line 407 "nfstream/pcap.pyx" + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 407 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_6); - -#line 407 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); - -#line 407 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_5); - -#line 407 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); - -#line 407 "nfstream/pcap.pyx" __pyx_t_6 = 0; - -#line 407 "nfstream/pcap.pyx" __pyx_t_5 = 0; - /* "nfstream/pcap.pyx":411 + /* "nfstream/pcap.pyx":430 * get_buffer(pkt, hdr.caplen), * *args * ) # <<<<<<<<<<<<<< * elif n == 0: * continue */ - -#line 411 "nfstream/pcap.pyx" - __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error) - -#line 411 "nfstream/pcap.pyx" + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - -#line 411 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "nfstream/pcap.pyx":407 + /* "nfstream/pcap.pyx":426 * ) * else: * callback( # <<<<<<<<<<<<<< * hdr.ts.tv_sec + (hdr.ts.tv_usec * scale), * get_buffer(pkt, hdr.caplen), */ - -#line 407 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_callback, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error) - -#line 407 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_callback, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 407 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 407 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 407 "nfstream/pcap.pyx" } - -#line 407 "nfstream/pcap.pyx" __pyx_L10:; - /* "nfstream/pcap.pyx":399 + /* "nfstream/pcap.pyx":418 * with nogil: * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: # <<<<<<<<<<<<<< * if timestamp_in_ns: * callback( */ - -#line 399 "nfstream/pcap.pyx" break; - /* "nfstream/pcap.pyx":412 + /* "nfstream/pcap.pyx":431 * *args * ) * elif n == 0: # <<<<<<<<<<<<<< * continue * elif n == -1: */ - -#line 412 "nfstream/pcap.pyx" case 0: - /* "nfstream/pcap.pyx":413 + /* "nfstream/pcap.pyx":432 * ) * elif n == 0: * continue # <<<<<<<<<<<<<< * elif n == -1: * raise KeyboardInterrupt */ - -#line 413 "nfstream/pcap.pyx" goto __pyx_L3_continue; - /* "nfstream/pcap.pyx":412 + /* "nfstream/pcap.pyx":431 * *args * ) * elif n == 0: # <<<<<<<<<<<<<< * continue * elif n == -1: */ - -#line 412 "nfstream/pcap.pyx" break; - /* "nfstream/pcap.pyx":414 + /* "nfstream/pcap.pyx":433 * elif n == 0: * continue * elif n == -1: # <<<<<<<<<<<<<< * raise KeyboardInterrupt * elif n == -2: */ - -#line 414 "nfstream/pcap.pyx" case -1L: - /* "nfstream/pcap.pyx":415 + /* "nfstream/pcap.pyx":434 * continue * elif n == -1: * raise KeyboardInterrupt # <<<<<<<<<<<<<< * elif n == -2: * break */ - -#line 415 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_KeyboardInterrupt, 0, 0, 0); + __PYX_ERR(1, 434, __pyx_L1_error) -#line 415 "nfstream/pcap.pyx" - __PYX_ERR(1, 415, __pyx_L1_error) - - /* "nfstream/pcap.pyx":414 + /* "nfstream/pcap.pyx":433 * elif n == 0: * continue * elif n == -1: # <<<<<<<<<<<<<< * raise KeyboardInterrupt * elif n == -2: */ - -#line 414 "nfstream/pcap.pyx" break; - /* "nfstream/pcap.pyx":416 + /* "nfstream/pcap.pyx":435 * elif n == -1: * raise KeyboardInterrupt * elif n == -2: # <<<<<<<<<<<<<< * break * if i == cnt: */ - -#line 416 "nfstream/pcap.pyx" case -2L: - /* "nfstream/pcap.pyx":417 + /* "nfstream/pcap.pyx":436 * raise KeyboardInterrupt * elif n == -2: * break # <<<<<<<<<<<<<< * if i == cnt: * break */ - -#line 417 "nfstream/pcap.pyx" goto __pyx_L4_break; - /* "nfstream/pcap.pyx":416 + /* "nfstream/pcap.pyx":435 * elif n == -1: * raise KeyboardInterrupt * elif n == -2: # <<<<<<<<<<<<<< * break * if i == cnt: */ - -#line 416 "nfstream/pcap.pyx" break; - -#line 416 "nfstream/pcap.pyx" default: break; - -#line 416 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":418 + /* "nfstream/pcap.pyx":437 * elif n == -2: * break * if i == cnt: # <<<<<<<<<<<<<< * break * i = i + 1 */ - -#line 418 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 418, __pyx_L1_error) - -#line 418 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 418 "nfstream/pcap.pyx" - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cnt, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 418, __pyx_L1_error) - -#line 418 "nfstream/pcap.pyx" + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cnt, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 437, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 418 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 418, __pyx_L1_error) - -#line 418 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 437, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 418 "nfstream/pcap.pyx" if (__pyx_t_3) { - /* "nfstream/pcap.pyx":419 + /* "nfstream/pcap.pyx":438 * break * if i == cnt: * break # <<<<<<<<<<<<<< * i = i + 1 - * + * */ - -#line 419 "nfstream/pcap.pyx" goto __pyx_L4_break; - /* "nfstream/pcap.pyx":418 + /* "nfstream/pcap.pyx":437 * elif n == -2: * break * if i == cnt: # <<<<<<<<<<<<<< * break * i = i + 1 */ - -#line 418 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":420 + /* "nfstream/pcap.pyx":439 * if i == cnt: * break * i = i + 1 # <<<<<<<<<<<<<< - * + * * def sendpacket(self, buf): */ - -#line 420 "nfstream/pcap.pyx" __pyx_v_i = (__pyx_v_i + 1); - -#line 420 "nfstream/pcap.pyx" __pyx_L3_continue:; - -#line 420 "nfstream/pcap.pyx" } - -#line 420 "nfstream/pcap.pyx" __pyx_L4_break:; - /* "nfstream/pcap.pyx":375 + /* "nfstream/pcap.pyx":394 * return n - * + * * def loop(self, cnt, callback, *args): # <<<<<<<<<<<<<< * """Processing packets with a user callback during a loop. * The loop can be exited when cnt value is reached */ -#line 375 "nfstream/pcap.pyx" - - -#line 375 "nfstream/pcap.pyx" /* function exit code */ - -#line 375 "nfstream/pcap.pyx" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 375 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 375 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 375 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); - -#line 375 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_5); - -#line 375 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_6); - -#line 375 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.loop", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 375 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 375 "nfstream/pcap.pyx" __pyx_L0:; - -#line 375 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 375 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 375 "nfstream/pcap.pyx" return __pyx_r; - -#line 375 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":422 +/* "nfstream/pcap.pyx":441 * i = i + 1 - * + * * def sendpacket(self, buf): # <<<<<<<<<<<<<< * """Send a raw network packet on the interface.""" * ret = pcap_sendpacket(self.__pcap, buf, len(buf)) */ -#line 422 "nfstream/pcap.pyx" - - -#line 422 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 422 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_25sendpacket(PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /*proto*/ - -#line 422 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_24sendpacket[] = "Send a raw network packet on the interface."; - -#line 422 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_25sendpacket(PyObject *__pyx_v_self, PyObject *__pyx_v_buf) { - -#line 422 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 422 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 422 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("sendpacket (wrapper)", 0); - __pyx_r = -#line 422 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_24sendpacket(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_24sendpacket(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); -#line 422 "nfstream/pcap.pyx" - - -#line 422 "nfstream/pcap.pyx" /* function exit code */ - -#line 422 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 422 "nfstream/pcap.pyx" return __pyx_r; - -#line 422 "nfstream/pcap.pyx" } -#line 422 "nfstream/pcap.pyx" - - -#line 422 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_24sendpacket(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, PyObject *__pyx_v_buf) { - int __pyx_v_ret -#line 422 "nfstream/pcap.pyx" -; - -#line 422 "nfstream/pcap.pyx" + int __pyx_v_ret; PyObject *__pyx_r = NULL; - -#line 422 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 422 "nfstream/pcap.pyx" __pyx_t_8nfstream_4pcap_u_char const *__pyx_t_1; - -#line 422 "nfstream/pcap.pyx" Py_ssize_t __pyx_t_2; - -#line 422 "nfstream/pcap.pyx" int __pyx_t_3; - -#line 422 "nfstream/pcap.pyx" PyObject *__pyx_t_4 = NULL; - -#line 422 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("sendpacket", 0); - /* "nfstream/pcap.pyx":424 + /* "nfstream/pcap.pyx":443 * def sendpacket(self, buf): * """Send a raw network packet on the interface.""" * ret = pcap_sendpacket(self.__pcap, buf, len(buf)) # <<<<<<<<<<<<<< * if ret == -1: * raise OSError, pcap_geterr(self.__pcap) */ - -#line 424 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyObject_AsUString(__pyx_v_buf); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 424, __pyx_L1_error) - -#line 424 "nfstream/pcap.pyx" - __pyx_t_2 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 424, __pyx_L1_error) - -#line 424 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyObject_AsUString(__pyx_v_buf); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 443, __pyx_L1_error) __pyx_v_ret = pcap_sendpacket(__pyx_v_self->__pyx___pcap, __pyx_t_1, ((int)__pyx_t_2)); - /* "nfstream/pcap.pyx":425 + /* "nfstream/pcap.pyx":444 * """Send a raw network packet on the interface.""" * ret = pcap_sendpacket(self.__pcap, buf, len(buf)) * if ret == -1: # <<<<<<<<<<<<<< * raise OSError, pcap_geterr(self.__pcap) * return len(buf) */ - -#line 425 "nfstream/pcap.pyx" __pyx_t_3 = ((__pyx_v_ret == -1L) != 0); - -#line 425 "nfstream/pcap.pyx" if (__pyx_t_3) { - /* "nfstream/pcap.pyx":426 + /* "nfstream/pcap.pyx":445 * ret = pcap_sendpacket(self.__pcap, buf, len(buf)) * if ret == -1: * raise OSError, pcap_geterr(self.__pcap) # <<<<<<<<<<<<<< * return len(buf) - * + * */ - -#line 426 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 426, __pyx_L1_error) - -#line 426 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 426 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_4, 0, 0); - -#line 426 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 445, __pyx_L1_error) -#line 426 "nfstream/pcap.pyx" - __PYX_ERR(1, 426, __pyx_L1_error) - - /* "nfstream/pcap.pyx":425 + /* "nfstream/pcap.pyx":444 * """Send a raw network packet on the interface.""" * ret = pcap_sendpacket(self.__pcap, buf, len(buf)) * if ret == -1: # <<<<<<<<<<<<<< * raise OSError, pcap_geterr(self.__pcap) * return len(buf) */ - -#line 425 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":427 + /* "nfstream/pcap.pyx":446 * if ret == -1: * raise OSError, pcap_geterr(self.__pcap) * return len(buf) # <<<<<<<<<<<<<< - * + * * def geterr(self): */ - -#line 427 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 427 "nfstream/pcap.pyx" - __pyx_t_2 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 427, __pyx_L1_error) - -#line 427 "nfstream/pcap.pyx" - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error) - -#line 427 "nfstream/pcap.pyx" + __pyx_t_2 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 446, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 427 "nfstream/pcap.pyx" __pyx_r = __pyx_t_4; - -#line 427 "nfstream/pcap.pyx" __pyx_t_4 = 0; - -#line 427 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":422 + /* "nfstream/pcap.pyx":441 * i = i + 1 - * + * * def sendpacket(self, buf): # <<<<<<<<<<<<<< * """Send a raw network packet on the interface.""" * ret = pcap_sendpacket(self.__pcap, buf, len(buf)) */ -#line 422 "nfstream/pcap.pyx" - - -#line 422 "nfstream/pcap.pyx" /* function exit code */ - -#line 422 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 422 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); - -#line 422 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.sendpacket", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 422 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 422 "nfstream/pcap.pyx" __pyx_L0:; - -#line 422 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 422 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 422 "nfstream/pcap.pyx" return __pyx_r; - -#line 422 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":429 +/* "nfstream/pcap.pyx":448 * return len(buf) - * + * * def geterr(self): # <<<<<<<<<<<<<< * """Return the last error message associated with this handle.""" * return pcap_geterr(self.__pcap) */ -#line 429 "nfstream/pcap.pyx" - - -#line 429 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 429 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_27geterr(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 429 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_26geterr[] = "Return the last error message associated with this handle."; - -#line 429 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_27geterr(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 429 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 429 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 429 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("geterr (wrapper)", 0); - __pyx_r = -#line 429 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_26geterr(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_26geterr(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 429 "nfstream/pcap.pyx" - - -#line 429 "nfstream/pcap.pyx" /* function exit code */ - -#line 429 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 429 "nfstream/pcap.pyx" return __pyx_r; - -#line 429 "nfstream/pcap.pyx" } -#line 429 "nfstream/pcap.pyx" - - -#line 429 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_26geterr(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 429 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 429 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 429 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 429 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("geterr", 0); - /* "nfstream/pcap.pyx":431 + /* "nfstream/pcap.pyx":450 * def geterr(self): * """Return the last error message associated with this handle.""" * return pcap_geterr(self.__pcap) # <<<<<<<<<<<<<< - * + * * def stats(self): */ - -#line 431 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 431 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error) - -#line 431 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 431 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 431 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 431 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":429 + /* "nfstream/pcap.pyx":448 * return len(buf) - * + * * def geterr(self): # <<<<<<<<<<<<<< * """Return the last error message associated with this handle.""" * return pcap_geterr(self.__pcap) */ -#line 429 "nfstream/pcap.pyx" - - -#line 429 "nfstream/pcap.pyx" /* function exit code */ - -#line 429 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 429 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 429 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.geterr", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 429 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 429 "nfstream/pcap.pyx" __pyx_L0:; - -#line 429 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 429 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 429 "nfstream/pcap.pyx" return __pyx_r; - -#line 429 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":433 +/* "nfstream/pcap.pyx":452 * return pcap_geterr(self.__pcap) - * + * * def stats(self): # <<<<<<<<<<<<<< * """Return a 3-tuple of the total number of packets received, * dropped, and dropped by the interface.""" */ -#line 433 "nfstream/pcap.pyx" - - -#line 433 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 433 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_29stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 433 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4pcap_28stats[] = "Return a 3-tuple of the total number of packets received,\n dropped, and dropped by the interface."; - -#line 433 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_29stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 433 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 433 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 433 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("stats (wrapper)", 0); - __pyx_r = -#line 433 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_28stats(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_28stats(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 433 "nfstream/pcap.pyx" - - -#line 433 "nfstream/pcap.pyx" /* function exit code */ - -#line 433 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 433 "nfstream/pcap.pyx" return __pyx_r; - -#line 433 "nfstream/pcap.pyx" } -#line 433 "nfstream/pcap.pyx" - - -#line 433 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_28stats(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - struct pcap_stat __pyx_v_pstat -#line 433 "nfstream/pcap.pyx" -; - -#line 433 "nfstream/pcap.pyx" + struct pcap_stat __pyx_v_pstat; PyObject *__pyx_r = NULL; - -#line 433 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 433 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 433 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 433 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 433 "nfstream/pcap.pyx" PyObject *__pyx_t_4 = NULL; - -#line 433 "nfstream/pcap.pyx" PyObject *__pyx_t_5 = NULL; - -#line 433 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("stats", 0); - /* "nfstream/pcap.pyx":437 + /* "nfstream/pcap.pyx":456 * dropped, and dropped by the interface.""" * cdef pcap_stat pstat * if pcap_stats(self.__pcap, &pstat) < 0: # <<<<<<<<<<<<<< * raise OSError, pcap_geterr(self.__pcap) * return (pstat.ps_recv, pstat.ps_drop, pstat.ps_ifdrop) */ - -#line 437 "nfstream/pcap.pyx" __pyx_t_1 = ((pcap_stats(__pyx_v_self->__pyx___pcap, (&__pyx_v_pstat)) < 0) != 0); - -#line 437 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":438 + /* "nfstream/pcap.pyx":457 * cdef pcap_stat pstat * if pcap_stats(self.__pcap, &pstat) < 0: * raise OSError, pcap_geterr(self.__pcap) # <<<<<<<<<<<<<< * return (pstat.ps_recv, pstat.ps_drop, pstat.ps_ifdrop) - * + * */ - -#line 438 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 438, __pyx_L1_error) - -#line 438 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyBytes_FromString(pcap_geterr(__pyx_v_self->__pyx___pcap)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 438 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_2, 0, 0); - -#line 438 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 457, __pyx_L1_error) -#line 438 "nfstream/pcap.pyx" - __PYX_ERR(1, 438, __pyx_L1_error) - - /* "nfstream/pcap.pyx":437 + /* "nfstream/pcap.pyx":456 * dropped, and dropped by the interface.""" * cdef pcap_stat pstat * if pcap_stats(self.__pcap, &pstat) < 0: # <<<<<<<<<<<<<< * raise OSError, pcap_geterr(self.__pcap) * return (pstat.ps_recv, pstat.ps_drop, pstat.ps_ifdrop) */ - -#line 437 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":439 + /* "nfstream/pcap.pyx":458 * if pcap_stats(self.__pcap, &pstat) < 0: * raise OSError, pcap_geterr(self.__pcap) * return (pstat.ps_recv, pstat.ps_drop, pstat.ps_ifdrop) # <<<<<<<<<<<<<< - * + * * def __iter__(self): */ - -#line 439 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 439 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_pstat.ps_recv); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 439, __pyx_L1_error) - -#line 439 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_pstat.ps_recv); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 439 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_pstat.ps_drop); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 439, __pyx_L1_error) - -#line 439 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_pstat.ps_drop); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 439 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_pstat.ps_ifdrop); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 439, __pyx_L1_error) - -#line 439 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_pstat.ps_ifdrop); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 439 "nfstream/pcap.pyx" - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error) - -#line 439 "nfstream/pcap.pyx" + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - -#line 439 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_2); - -#line 439 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - -#line 439 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_3); - -#line 439 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - -#line 439 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_4); - -#line 439 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); - -#line 439 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 439 "nfstream/pcap.pyx" __pyx_t_3 = 0; - -#line 439 "nfstream/pcap.pyx" __pyx_t_4 = 0; - -#line 439 "nfstream/pcap.pyx" __pyx_r = __pyx_t_5; - -#line 439 "nfstream/pcap.pyx" __pyx_t_5 = 0; - -#line 439 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":433 + /* "nfstream/pcap.pyx":452 * return pcap_geterr(self.__pcap) - * + * * def stats(self): # <<<<<<<<<<<<<< * """Return a 3-tuple of the total number of packets received, * dropped, and dropped by the interface.""" */ -#line 433 "nfstream/pcap.pyx" - - -#line 433 "nfstream/pcap.pyx" /* function exit code */ - -#line 433 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 433 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 433 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); - -#line 433 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); - -#line 433 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_5); - -#line 433 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.stats", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 433 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 433 "nfstream/pcap.pyx" __pyx_L0:; - -#line 433 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 433 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 433 "nfstream/pcap.pyx" return __pyx_r; - -#line 433 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":441 +/* "nfstream/pcap.pyx":460 * return (pstat.ps_recv, pstat.ps_drop, pstat.ps_ifdrop) - * + * * def __iter__(self): # <<<<<<<<<<<<<< * pcap_ex_setup(self.__pcap) * return self */ -#line 441 "nfstream/pcap.pyx" - - -#line 441 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 441 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_31__iter__(PyObject *__pyx_v_self); /*proto*/ - -#line 441 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_31__iter__(PyObject *__pyx_v_self) { - -#line 441 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 441 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 441 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = -#line 441 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_30__iter__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_30__iter__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 441 "nfstream/pcap.pyx" - - -#line 441 "nfstream/pcap.pyx" /* function exit code */ - -#line 441 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 441 "nfstream/pcap.pyx" return __pyx_r; - -#line 441 "nfstream/pcap.pyx" } -#line 441 "nfstream/pcap.pyx" - - -#line 441 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_30__iter__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 441 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 441 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 441 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__iter__", 0); - /* "nfstream/pcap.pyx":442 - * + /* "nfstream/pcap.pyx":461 + * * def __iter__(self): * pcap_ex_setup(self.__pcap) # <<<<<<<<<<<<<< * return self - * + * */ - -#line 442 "nfstream/pcap.pyx" pcap_ex_setup(__pyx_v_self->__pyx___pcap); - /* "nfstream/pcap.pyx":443 + /* "nfstream/pcap.pyx":462 * def __iter__(self): * pcap_ex_setup(self.__pcap) * return self # <<<<<<<<<<<<<< - * + * * def __next__(self): */ - -#line 443 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 443 "nfstream/pcap.pyx" __Pyx_INCREF(((PyObject *)__pyx_v_self)); - -#line 443 "nfstream/pcap.pyx" __pyx_r = ((PyObject *)__pyx_v_self); - -#line 443 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":441 + /* "nfstream/pcap.pyx":460 * return (pstat.ps_recv, pstat.ps_drop, pstat.ps_ifdrop) - * + * * def __iter__(self): # <<<<<<<<<<<<<< * pcap_ex_setup(self.__pcap) * return self */ -#line 441 "nfstream/pcap.pyx" - - -#line 441 "nfstream/pcap.pyx" /* function exit code */ - -#line 441 "nfstream/pcap.pyx" __pyx_L0:; - -#line 441 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 441 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 441 "nfstream/pcap.pyx" return __pyx_r; - -#line 441 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":445 +/* "nfstream/pcap.pyx":464 * return self - * + * * def __next__(self): # <<<<<<<<<<<<<< * cdef pcap_pkthdr hdr * cdef u_char *pkt */ -#line 445 "nfstream/pcap.pyx" - - -#line 445 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 445 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_33__next__(PyObject *__pyx_v_self); /*proto*/ - -#line 445 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_33__next__(PyObject *__pyx_v_self) { - -#line 445 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 445 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 445 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); - __pyx_r = -#line 445 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4pcap_32__next__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_32__next__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 445 "nfstream/pcap.pyx" - - -#line 445 "nfstream/pcap.pyx" /* function exit code */ - -#line 445 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 445 "nfstream/pcap.pyx" return __pyx_r; - -#line 445 "nfstream/pcap.pyx" } -#line 445 "nfstream/pcap.pyx" - - -#line 445 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_32__next__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - struct pcap_pkthdr __pyx_v_hdr -#line 445 "nfstream/pcap.pyx" -; - __pyx_t_8nfstream_4pcap_u_char *__pyx_v_pkt -#line 445 "nfstream/pcap.pyx" -; - int __pyx_v_n -#line 445 "nfstream/pcap.pyx" -; - double __pyx_v_scale -#line 445 "nfstream/pcap.pyx" -; - PY_LONG_LONG __pyx_v_scale_ns -#line 445 "nfstream/pcap.pyx" -; - int __pyx_v_timestamp_in_ns -#line 445 "nfstream/pcap.pyx" -; - double __pyx_v_timestamp -#line 445 "nfstream/pcap.pyx" -; - PY_LONG_LONG __pyx_v_timestamp_ns -#line 445 "nfstream/pcap.pyx" -; - -#line 445 "nfstream/pcap.pyx" + struct pcap_pkthdr __pyx_v_hdr; + __pyx_t_8nfstream_4pcap_u_char *__pyx_v_pkt; + int __pyx_v_n; + double __pyx_v_scale; + PY_LONG_LONG __pyx_v_scale_ns; + int __pyx_v_timestamp_in_ns; + double __pyx_v_timestamp; + PY_LONG_LONG __pyx_v_timestamp_ns; PyObject *__pyx_r = NULL; - -#line 445 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 445 "nfstream/pcap.pyx" double __pyx_t_1; - -#line 445 "nfstream/pcap.pyx" PY_LONG_LONG __pyx_t_2; - -#line 445 "nfstream/pcap.pyx" int __pyx_t_3; - -#line 445 "nfstream/pcap.pyx" PyObject *__pyx_t_4 = NULL; - -#line 445 "nfstream/pcap.pyx" PyObject *__pyx_t_5 = NULL; - -#line 445 "nfstream/pcap.pyx" PyObject *__pyx_t_6 = NULL; - -#line 445 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__next__", 0); - /* "nfstream/pcap.pyx":449 + /* "nfstream/pcap.pyx":468 * cdef u_char *pkt * cdef int n * cdef double scale = self.__precision_scale # <<<<<<<<<<<<<< * cdef long long scale_ns = self.__precision_scale_ns * cdef bint timestamp_in_ns = self.__timestamp_in_ns */ - -#line 449 "nfstream/pcap.pyx" __pyx_t_1 = __pyx_v_self->__pyx___precision_scale; - -#line 449 "nfstream/pcap.pyx" __pyx_v_scale = __pyx_t_1; - /* "nfstream/pcap.pyx":450 + /* "nfstream/pcap.pyx":469 * cdef int n * cdef double scale = self.__precision_scale * cdef long long scale_ns = self.__precision_scale_ns # <<<<<<<<<<<<<< * cdef bint timestamp_in_ns = self.__timestamp_in_ns * cdef double timestamp */ - -#line 450 "nfstream/pcap.pyx" __pyx_t_2 = __pyx_v_self->__pyx___precision_scale_ns; - -#line 450 "nfstream/pcap.pyx" __pyx_v_scale_ns = __pyx_t_2; - /* "nfstream/pcap.pyx":451 + /* "nfstream/pcap.pyx":470 * cdef double scale = self.__precision_scale * cdef long long scale_ns = self.__precision_scale_ns * cdef bint timestamp_in_ns = self.__timestamp_in_ns # <<<<<<<<<<<<<< * cdef double timestamp * cdef long long timestamp_ns */ - -#line 451 "nfstream/pcap.pyx" __pyx_t_3 = __pyx_v_self->__pyx___timestamp_in_ns; - -#line 451 "nfstream/pcap.pyx" __pyx_v_timestamp_in_ns = __pyx_t_3; - /* "nfstream/pcap.pyx":454 + /* "nfstream/pcap.pyx":473 * cdef double timestamp * cdef long long timestamp_ns * while 1: # <<<<<<<<<<<<<< * with nogil: * n = pcap_ex_next(self.__pcap, &hdr, &pkt) */ - -#line 454 "nfstream/pcap.pyx" while (1) { - /* "nfstream/pcap.pyx":455 + /* "nfstream/pcap.pyx":474 * cdef long long timestamp_ns * while 1: * with nogil: # <<<<<<<<<<<<<< * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: */ - -#line 455 "nfstream/pcap.pyx" { - -#line 455 "nfstream/pcap.pyx" #ifdef WITH_THREAD - -#line 455 "nfstream/pcap.pyx" PyThreadState *_save; - -#line 455 "nfstream/pcap.pyx" Py_UNBLOCK_THREADS - -#line 455 "nfstream/pcap.pyx" __Pyx_FastGIL_Remember(); - -#line 455 "nfstream/pcap.pyx" #endif - -#line 455 "nfstream/pcap.pyx" /*try:*/ { - /* "nfstream/pcap.pyx":456 + /* "nfstream/pcap.pyx":475 * while 1: * with nogil: * n = pcap_ex_next(self.__pcap, &hdr, &pkt) # <<<<<<<<<<<<<< * if n == 1: * if timestamp_in_ns: */ - -#line 456 "nfstream/pcap.pyx" __pyx_v_n = pcap_ex_next(__pyx_v_self->__pyx___pcap, (&__pyx_v_hdr), (&__pyx_v_pkt)); - -#line 456 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":455 + /* "nfstream/pcap.pyx":474 * cdef long long timestamp_ns * while 1: * with nogil: # <<<<<<<<<<<<<< * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: */ - -#line 455 "nfstream/pcap.pyx" /*finally:*/ { - -#line 455 "nfstream/pcap.pyx" /*normal exit:*/{ - -#line 455 "nfstream/pcap.pyx" #ifdef WITH_THREAD - -#line 455 "nfstream/pcap.pyx" __Pyx_FastGIL_Forget(); - -#line 455 "nfstream/pcap.pyx" Py_BLOCK_THREADS - -#line 455 "nfstream/pcap.pyx" #endif - -#line 455 "nfstream/pcap.pyx" goto __pyx_L9; - -#line 455 "nfstream/pcap.pyx" } - -#line 455 "nfstream/pcap.pyx" __pyx_L9:; - -#line 455 "nfstream/pcap.pyx" } - -#line 455 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":457 + /* "nfstream/pcap.pyx":476 * with nogil: * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: # <<<<<<<<<<<<<< * if timestamp_in_ns: * timestamp_ns = (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns) */ - -#line 457 "nfstream/pcap.pyx" switch (__pyx_v_n) { - -#line 457 "nfstream/pcap.pyx" case 1: - /* "nfstream/pcap.pyx":458 + /* "nfstream/pcap.pyx":477 * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: * if timestamp_in_ns: # <<<<<<<<<<<<<< * timestamp_ns = (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns) * return (timestamp_ns, get_buffer(pkt, hdr.caplen)) */ - -#line 458 "nfstream/pcap.pyx" __pyx_t_3 = (__pyx_v_timestamp_in_ns != 0); - -#line 458 "nfstream/pcap.pyx" if (__pyx_t_3) { - /* "nfstream/pcap.pyx":459 + /* "nfstream/pcap.pyx":478 * if n == 1: * if timestamp_in_ns: * timestamp_ns = (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns) # <<<<<<<<<<<<<< * return (timestamp_ns, get_buffer(pkt, hdr.caplen)) * else: */ - -#line 459 "nfstream/pcap.pyx" __pyx_v_timestamp_ns = ((__pyx_v_hdr.ts.tv_sec * 1000000000LL) + (__pyx_v_hdr.ts.tv_usec * __pyx_v_scale_ns)); - /* "nfstream/pcap.pyx":460 + /* "nfstream/pcap.pyx":479 * if timestamp_in_ns: * timestamp_ns = (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns) * return (timestamp_ns, get_buffer(pkt, hdr.caplen)) # <<<<<<<<<<<<<< * else: * timestamp = hdr.ts.tv_sec + (hdr.ts.tv_usec * scale) */ - -#line 460 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 460 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_timestamp_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 460, __pyx_L1_error) - -#line 460 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_timestamp_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 460 "nfstream/pcap.pyx" - __pyx_t_5 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr.caplen); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 460, __pyx_L1_error) - -#line 460 "nfstream/pcap.pyx" + __pyx_t_5 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr.caplen); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - -#line 460 "nfstream/pcap.pyx" - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 460, __pyx_L1_error) - -#line 460 "nfstream/pcap.pyx" + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - -#line 460 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_4); - -#line 460 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); - -#line 460 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_5); - -#line 460 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - -#line 460 "nfstream/pcap.pyx" __pyx_t_4 = 0; - -#line 460 "nfstream/pcap.pyx" __pyx_t_5 = 0; - -#line 460 "nfstream/pcap.pyx" __pyx_r = __pyx_t_6; - -#line 460 "nfstream/pcap.pyx" __pyx_t_6 = 0; - -#line 460 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":458 + /* "nfstream/pcap.pyx":477 * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: * if timestamp_in_ns: # <<<<<<<<<<<<<< * timestamp_ns = (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns) * return (timestamp_ns, get_buffer(pkt, hdr.caplen)) */ - -#line 458 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":462 + /* "nfstream/pcap.pyx":481 * return (timestamp_ns, get_buffer(pkt, hdr.caplen)) * else: * timestamp = hdr.ts.tv_sec + (hdr.ts.tv_usec * scale) # <<<<<<<<<<<<<< * return (timestamp, get_buffer(pkt, hdr.caplen)) * elif n == 0: */ - -#line 462 "nfstream/pcap.pyx" /*else*/ { - -#line 462 "nfstream/pcap.pyx" __pyx_v_timestamp = (__pyx_v_hdr.ts.tv_sec + (__pyx_v_hdr.ts.tv_usec * __pyx_v_scale)); - /* "nfstream/pcap.pyx":463 + /* "nfstream/pcap.pyx":482 * else: * timestamp = hdr.ts.tv_sec + (hdr.ts.tv_usec * scale) * return (timestamp, get_buffer(pkt, hdr.caplen)) # <<<<<<<<<<<<<< * elif n == 0: * continue */ - -#line 463 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 463 "nfstream/pcap.pyx" - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_timestamp); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 463, __pyx_L1_error) - -#line 463 "nfstream/pcap.pyx" + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_timestamp); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - -#line 463 "nfstream/pcap.pyx" - __pyx_t_5 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr.caplen); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 463, __pyx_L1_error) - -#line 463 "nfstream/pcap.pyx" + __pyx_t_5 = __pyx_f_8nfstream_4pcap_get_buffer(__pyx_v_pkt, __pyx_v_hdr.caplen); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - -#line 463 "nfstream/pcap.pyx" - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 463, __pyx_L1_error) - -#line 463 "nfstream/pcap.pyx" + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 463 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_6); - -#line 463 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); - -#line 463 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_5); - -#line 463 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); - -#line 463 "nfstream/pcap.pyx" __pyx_t_6 = 0; - -#line 463 "nfstream/pcap.pyx" __pyx_t_5 = 0; - -#line 463 "nfstream/pcap.pyx" __pyx_r = __pyx_t_4; - -#line 463 "nfstream/pcap.pyx" __pyx_t_4 = 0; - -#line 463 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 463 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":457 + /* "nfstream/pcap.pyx":476 * with nogil: * n = pcap_ex_next(self.__pcap, &hdr, &pkt) * if n == 1: # <<<<<<<<<<<<<< * if timestamp_in_ns: * timestamp_ns = (hdr.ts.tv_sec * 1000000000LL) + (hdr.ts.tv_usec * scale_ns) */ - -#line 457 "nfstream/pcap.pyx" break; - /* "nfstream/pcap.pyx":464 + /* "nfstream/pcap.pyx":483 * timestamp = hdr.ts.tv_sec + (hdr.ts.tv_usec * scale) * return (timestamp, get_buffer(pkt, hdr.caplen)) * elif n == 0: # <<<<<<<<<<<<<< * continue * elif n == -1: */ - -#line 464 "nfstream/pcap.pyx" case 0: - /* "nfstream/pcap.pyx":465 + /* "nfstream/pcap.pyx":484 * return (timestamp, get_buffer(pkt, hdr.caplen)) * elif n == 0: * continue # <<<<<<<<<<<<<< * elif n == -1: * raise KeyboardInterrupt */ - -#line 465 "nfstream/pcap.pyx" goto __pyx_L3_continue; - /* "nfstream/pcap.pyx":464 + /* "nfstream/pcap.pyx":483 * timestamp = hdr.ts.tv_sec + (hdr.ts.tv_usec * scale) * return (timestamp, get_buffer(pkt, hdr.caplen)) * elif n == 0: # <<<<<<<<<<<<<< * continue * elif n == -1: */ - -#line 464 "nfstream/pcap.pyx" break; - /* "nfstream/pcap.pyx":466 + /* "nfstream/pcap.pyx":485 * elif n == 0: * continue * elif n == -1: # <<<<<<<<<<<<<< * raise KeyboardInterrupt * elif n == -2: */ - -#line 466 "nfstream/pcap.pyx" case -1L: - /* "nfstream/pcap.pyx":467 + /* "nfstream/pcap.pyx":486 * continue * elif n == -1: * raise KeyboardInterrupt # <<<<<<<<<<<<<< * elif n == -2: * raise StopIteration */ - -#line 467 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_KeyboardInterrupt, 0, 0, 0); + __PYX_ERR(1, 486, __pyx_L1_error) -#line 467 "nfstream/pcap.pyx" - __PYX_ERR(1, 467, __pyx_L1_error) - - /* "nfstream/pcap.pyx":466 + /* "nfstream/pcap.pyx":485 * elif n == 0: * continue * elif n == -1: # <<<<<<<<<<<<<< * raise KeyboardInterrupt * elif n == -2: */ - -#line 466 "nfstream/pcap.pyx" break; - /* "nfstream/pcap.pyx":468 + /* "nfstream/pcap.pyx":487 * elif n == -1: * raise KeyboardInterrupt * elif n == -2: # <<<<<<<<<<<<<< * raise StopIteration - * + * */ - -#line 468 "nfstream/pcap.pyx" case -2L: - /* "nfstream/pcap.pyx":469 + /* "nfstream/pcap.pyx":488 * raise KeyboardInterrupt * elif n == -2: * raise StopIteration # <<<<<<<<<<<<<< - * + * * def __dealloc__(self): */ - -#line 469 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); + __PYX_ERR(1, 488, __pyx_L1_error) -#line 469 "nfstream/pcap.pyx" - __PYX_ERR(1, 469, __pyx_L1_error) - - /* "nfstream/pcap.pyx":468 + /* "nfstream/pcap.pyx":487 * elif n == -1: * raise KeyboardInterrupt * elif n == -2: # <<<<<<<<<<<<<< * raise StopIteration - * + * */ - -#line 468 "nfstream/pcap.pyx" break; - -#line 468 "nfstream/pcap.pyx" default: break; - -#line 468 "nfstream/pcap.pyx" } - -#line 468 "nfstream/pcap.pyx" __pyx_L3_continue:; - -#line 468 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":445 + /* "nfstream/pcap.pyx":464 * return self - * + * * def __next__(self): # <<<<<<<<<<<<<< * cdef pcap_pkthdr hdr * cdef u_char *pkt */ -#line 445 "nfstream/pcap.pyx" - - -#line 445 "nfstream/pcap.pyx" /* function exit code */ - -#line 445 "nfstream/pcap.pyx" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 445 "nfstream/pcap.pyx" goto __pyx_L0; - -#line 445 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 445 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); - -#line 445 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_5); - -#line 445 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_6); - -#line 445 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.pcap.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 445 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 445 "nfstream/pcap.pyx" __pyx_L0:; - -#line 445 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 445 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 445 "nfstream/pcap.pyx" return __pyx_r; - -#line 445 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":471 +/* "nfstream/pcap.pyx":490 * raise StopIteration - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.__name: * free(self.__name) */ -#line 471 "nfstream/pcap.pyx" - - -#line 471 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 471 "nfstream/pcap.pyx" static void __pyx_pw_8nfstream_4pcap_4pcap_35__dealloc__(PyObject *__pyx_v_self); /*proto*/ - -#line 471 "nfstream/pcap.pyx" static void __pyx_pw_8nfstream_4pcap_4pcap_35__dealloc__(PyObject *__pyx_v_self) { - -#line 471 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 471 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - -#line 471 "nfstream/pcap.pyx" __pyx_pf_8nfstream_4pcap_4pcap_34__dealloc__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 471 "nfstream/pcap.pyx" - - -#line 471 "nfstream/pcap.pyx" /* function exit code */ - -#line 471 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 471 "nfstream/pcap.pyx" } -#line 471 "nfstream/pcap.pyx" - - -#line 471 "nfstream/pcap.pyx" static void __pyx_pf_8nfstream_4pcap_4pcap_34__dealloc__(struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 471 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 471 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 471 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "nfstream/pcap.pyx":472 - * + /* "nfstream/pcap.pyx":491 + * * def __dealloc__(self): * if self.__name: # <<<<<<<<<<<<<< * free(self.__name) * if self.__filter: */ - -#line 472 "nfstream/pcap.pyx" __pyx_t_1 = (__pyx_v_self->__pyx___name != 0); - -#line 472 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":473 + /* "nfstream/pcap.pyx":492 * def __dealloc__(self): * if self.__name: * free(self.__name) # <<<<<<<<<<<<<< * if self.__filter: * free(self.__filter) */ - -#line 473 "nfstream/pcap.pyx" free(__pyx_v_self->__pyx___name); - /* "nfstream/pcap.pyx":472 - * + /* "nfstream/pcap.pyx":491 + * * def __dealloc__(self): * if self.__name: # <<<<<<<<<<<<<< * free(self.__name) * if self.__filter: */ - -#line 472 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":474 + /* "nfstream/pcap.pyx":493 * if self.__name: * free(self.__name) * if self.__filter: # <<<<<<<<<<<<<< * free(self.__filter) * if self.__pcap: */ - -#line 474 "nfstream/pcap.pyx" __pyx_t_1 = (__pyx_v_self->__pyx___filter != 0); - -#line 474 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":475 + /* "nfstream/pcap.pyx":494 * free(self.__name) * if self.__filter: * free(self.__filter) # <<<<<<<<<<<<<< * if self.__pcap: * pcap_close(self.__pcap) */ - -#line 475 "nfstream/pcap.pyx" free(__pyx_v_self->__pyx___filter); - /* "nfstream/pcap.pyx":474 + /* "nfstream/pcap.pyx":493 * if self.__name: * free(self.__name) * if self.__filter: # <<<<<<<<<<<<<< * free(self.__filter) * if self.__pcap: */ - -#line 474 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":476 + /* "nfstream/pcap.pyx":495 * if self.__filter: * free(self.__filter) * if self.__pcap: # <<<<<<<<<<<<<< * pcap_close(self.__pcap) - * + * */ - -#line 476 "nfstream/pcap.pyx" __pyx_t_1 = (__pyx_v_self->__pyx___pcap != 0); - -#line 476 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":477 + /* "nfstream/pcap.pyx":496 * free(self.__filter) * if self.__pcap: * pcap_close(self.__pcap) # <<<<<<<<<<<<<< - * + * * def ex_name(char *foo): */ - -#line 477 "nfstream/pcap.pyx" pcap_close(__pyx_v_self->__pyx___pcap); - /* "nfstream/pcap.pyx":476 + /* "nfstream/pcap.pyx":495 * if self.__filter: * free(self.__filter) * if self.__pcap: # <<<<<<<<<<<<<< * pcap_close(self.__pcap) - * + * */ - -#line 476 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":471 + /* "nfstream/pcap.pyx":490 * raise StopIteration - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.__name: * free(self.__name) */ -#line 471 "nfstream/pcap.pyx" - - -#line 471 "nfstream/pcap.pyx" /* function exit code */ - -#line 471 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 471 "nfstream/pcap.pyx" } /* "(tree fragment)":1 @@ -12151,61 +6948,23 @@ static void __pyx_pf_8nfstream_4pcap_4pcap_34__dealloc__(struct __pyx_obj_8nfstr * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* Python wrapper */ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_37__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_37__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = -#line 1 "(tree fragment)" -__pyx_pf_8nfstream_4pcap_4pcap_36__reduce_cython__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_36__reduce_cython__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self)); -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_36__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 @@ -12214,20 +6973,10 @@ static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_36__reduce_cython__(CYTHON_UNUSE * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.__pcap cannot be converted to a Python object for pickling") */ - -#line 2 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 2 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 2 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 2 "(tree fragment)" __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 @@ -12236,34 +6985,14 @@ static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_36__reduce_cython__(CYTHON_UNUSE * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 1 "(tree fragment)" __Pyx_AddTraceback("nfstream.pcap.pcap.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } /* "(tree fragment)":3 @@ -12273,61 +7002,23 @@ static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_36__reduce_cython__(CYTHON_UNUSE * raise TypeError("self.__pcap cannot be converted to a Python object for pickling") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* Python wrapper */ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_39__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw_8nfstream_4pcap_4pcap_39__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = -#line 3 "(tree fragment)" -__pyx_pf_8nfstream_4pcap_4pcap_38__setstate_cython__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_8nfstream_4pcap_4pcap_38__setstate_cython__(((struct __pyx_obj_8nfstream_4pcap_pcap *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_38__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8nfstream_4pcap_pcap *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 @@ -12335,20 +7026,10 @@ static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_38__setstate_cython__(CYTHON_UNU * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.__pcap cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 4 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 4 "(tree fragment)" __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 @@ -12358,2138 +7039,980 @@ static PyObject *__pyx_pf_8nfstream_4pcap_4pcap_38__setstate_cython__(CYTHON_UNU * raise TypeError("self.__pcap cannot be converted to a Python object for pickling") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __pyx_L1_error:; - -#line 3 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 3 "(tree fragment)" __Pyx_AddTraceback("nfstream.pcap.pcap.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 3 "(tree fragment)" __pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -/* "nfstream/pcap.pyx":479 +/* "nfstream/pcap.pyx":498 * pcap_close(self.__pcap) - * + * * def ex_name(char *foo): # <<<<<<<<<<<<<< * return pcap_ex_name(foo) - * + * */ -#line 479 "nfstream/pcap.pyx" - - -#line 479 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 479 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_1ex_name(PyObject *__pyx_self, PyObject *__pyx_arg_foo); /*proto*/ -static PyMethodDef __pyx_mdef_8nfstream_4pcap_1ex_name = -#line 479 "nfstream/pcap.pyx" -{"ex_name", (PyCFunction)__pyx_pw_8nfstream_4pcap_1ex_name, METH_O, 0}; - -#line 479 "nfstream/pcap.pyx" +static PyMethodDef __pyx_mdef_8nfstream_4pcap_1ex_name = {"ex_name", (PyCFunction)__pyx_pw_8nfstream_4pcap_1ex_name, METH_O, 0}; static PyObject *__pyx_pw_8nfstream_4pcap_1ex_name(PyObject *__pyx_self, PyObject *__pyx_arg_foo) { - char *__pyx_v_foo -#line 479 "nfstream/pcap.pyx" -; - -#line 479 "nfstream/pcap.pyx" + char *__pyx_v_foo; PyObject *__pyx_r = 0; - -#line 479 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 479 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("ex_name (wrapper)", 0); - -#line 479 "nfstream/pcap.pyx" assert(__pyx_arg_foo); { - -#line 479 "nfstream/pcap.pyx" - __pyx_v_foo = __Pyx_PyObject_AsWritableString(__pyx_arg_foo); if (unlikely((!__pyx_v_foo) && PyErr_Occurred())) __PYX_ERR(1, 479, __pyx_L3_error) - -#line 479 "nfstream/pcap.pyx" + __pyx_v_foo = __Pyx_PyObject_AsWritableString(__pyx_arg_foo); if (unlikely((!__pyx_v_foo) && PyErr_Occurred())) __PYX_ERR(1, 498, __pyx_L3_error) } - -#line 479 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 479 "nfstream/pcap.pyx" __pyx_L3_error:; - -#line 479 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.ex_name", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 479 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 479 "nfstream/pcap.pyx" return NULL; - -#line 479 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 479 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_ex_name(__pyx_self, ((char *)__pyx_v_foo)); + __pyx_r = __pyx_pf_8nfstream_4pcap_ex_name(__pyx_self, ((char *)__pyx_v_foo)); -#line 479 "nfstream/pcap.pyx" - - -#line 479 "nfstream/pcap.pyx" /* function exit code */ - -#line 479 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 479 "nfstream/pcap.pyx" return __pyx_r; - -#line 479 "nfstream/pcap.pyx" } -#line 479 "nfstream/pcap.pyx" - - -#line 479 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_ex_name(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_foo) { - -#line 479 "nfstream/pcap.pyx" PyObject *__pyx_r = NULL; - -#line 479 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 479 "nfstream/pcap.pyx" PyObject *__pyx_t_1 = NULL; - -#line 479 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("ex_name", 0); - /* "nfstream/pcap.pyx":480 - * + /* "nfstream/pcap.pyx":499 + * * def ex_name(char *foo): * return pcap_ex_name(foo) # <<<<<<<<<<<<<< - * + * * def lookupdev(): */ - -#line 480 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 480 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyBytes_FromString(pcap_ex_name(__pyx_v_foo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error) - -#line 480 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyBytes_FromString(pcap_ex_name(__pyx_v_foo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 480 "nfstream/pcap.pyx" __pyx_r = __pyx_t_1; - -#line 480 "nfstream/pcap.pyx" __pyx_t_1 = 0; - -#line 480 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":479 + /* "nfstream/pcap.pyx":498 * pcap_close(self.__pcap) - * + * * def ex_name(char *foo): # <<<<<<<<<<<<<< * return pcap_ex_name(foo) - * + * */ -#line 479 "nfstream/pcap.pyx" - - -#line 479 "nfstream/pcap.pyx" /* function exit code */ - -#line 479 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 479 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_1); - -#line 479 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.ex_name", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 479 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 479 "nfstream/pcap.pyx" __pyx_L0:; - -#line 479 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 479 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 479 "nfstream/pcap.pyx" return __pyx_r; - -#line 479 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":482 +/* "nfstream/pcap.pyx":501 * return pcap_ex_name(foo) - * + * * def lookupdev(): # <<<<<<<<<<<<<< * """Return the name of a network device suitable for sniffing.""" * cdef char *p */ -#line 482 "nfstream/pcap.pyx" - - -#line 482 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 482 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_3lookupdev(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 482 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_2lookupdev[] = "Return the name of a network device suitable for sniffing."; -static PyMethodDef __pyx_mdef_8nfstream_4pcap_3lookupdev = -#line 482 "nfstream/pcap.pyx" -{"lookupdev", (PyCFunction)__pyx_pw_8nfstream_4pcap_3lookupdev, METH_NOARGS, __pyx_doc_8nfstream_4pcap_2lookupdev}; - -#line 482 "nfstream/pcap.pyx" +static PyMethodDef __pyx_mdef_8nfstream_4pcap_3lookupdev = {"lookupdev", (PyCFunction)__pyx_pw_8nfstream_4pcap_3lookupdev, METH_NOARGS, __pyx_doc_8nfstream_4pcap_2lookupdev}; static PyObject *__pyx_pw_8nfstream_4pcap_3lookupdev(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - -#line 482 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 482 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 482 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("lookupdev (wrapper)", 0); - __pyx_r = -#line 482 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_2lookupdev(__pyx_self); + __pyx_r = __pyx_pf_8nfstream_4pcap_2lookupdev(__pyx_self); -#line 482 "nfstream/pcap.pyx" - - -#line 482 "nfstream/pcap.pyx" /* function exit code */ - -#line 482 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 482 "nfstream/pcap.pyx" return __pyx_r; - -#line 482 "nfstream/pcap.pyx" } -#line 482 "nfstream/pcap.pyx" - - -#line 482 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_2lookupdev(CYTHON_UNUSED PyObject *__pyx_self) { - char *__pyx_v_p -#line 482 "nfstream/pcap.pyx" -; - char __pyx_v_ebuf[0x100] -#line 482 "nfstream/pcap.pyx" -; - -#line 482 "nfstream/pcap.pyx" + char *__pyx_v_p; + char __pyx_v_ebuf[0x100]; PyObject *__pyx_r = NULL; - -#line 482 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 482 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 482 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 482 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 482 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("lookupdev", 0); - /* "nfstream/pcap.pyx":486 + /* "nfstream/pcap.pyx":505 * cdef char *p * cdef char ebuf[256] * p = pcap_ex_lookupdev(ebuf) # <<<<<<<<<<<<<< * if p == NULL: * raise OSError, ebuf */ - -#line 486 "nfstream/pcap.pyx" __pyx_v_p = pcap_ex_lookupdev(__pyx_v_ebuf); - /* "nfstream/pcap.pyx":487 + /* "nfstream/pcap.pyx":506 * cdef char ebuf[256] * p = pcap_ex_lookupdev(ebuf) * if p == NULL: # <<<<<<<<<<<<<< * raise OSError, ebuf * return str(p.decode('UTF-8')) */ - -#line 487 "nfstream/pcap.pyx" __pyx_t_1 = ((__pyx_v_p == NULL) != 0); - -#line 487 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":488 + /* "nfstream/pcap.pyx":507 * p = pcap_ex_lookupdev(ebuf) * if p == NULL: * raise OSError, ebuf # <<<<<<<<<<<<<< * return str(p.decode('UTF-8')) - * + * */ - -#line 488 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_ebuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 488, __pyx_L1_error) - -#line 488 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_ebuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 488 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_builtin_OSError, __pyx_t_2, 0, 0); - -#line 488 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 507, __pyx_L1_error) -#line 488 "nfstream/pcap.pyx" - __PYX_ERR(1, 488, __pyx_L1_error) - - /* "nfstream/pcap.pyx":487 + /* "nfstream/pcap.pyx":506 * cdef char ebuf[256] * p = pcap_ex_lookupdev(ebuf) * if p == NULL: # <<<<<<<<<<<<<< * raise OSError, ebuf * return str(p.decode('UTF-8')) */ - -#line 487 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":489 + /* "nfstream/pcap.pyx":508 * if p == NULL: * raise OSError, ebuf * return str(p.decode('UTF-8')) # <<<<<<<<<<<<<< - * + * * def findalldevs(): */ - -#line 489 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 489 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_p, 0, strlen(__pyx_v_p), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 489, __pyx_L1_error) - -#line 489 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_p, 0, strlen(__pyx_v_p), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 489 "nfstream/pcap.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 489, __pyx_L1_error) - -#line 489 "nfstream/pcap.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 489 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_2); - -#line 489 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - -#line 489 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 489 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 489, __pyx_L1_error) - -#line 489 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 489 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 489 "nfstream/pcap.pyx" __pyx_r = __pyx_t_2; - -#line 489 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 489 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":482 + /* "nfstream/pcap.pyx":501 * return pcap_ex_name(foo) - * + * * def lookupdev(): # <<<<<<<<<<<<<< * """Return the name of a network device suitable for sniffing.""" * cdef char *p */ -#line 482 "nfstream/pcap.pyx" - - -#line 482 "nfstream/pcap.pyx" /* function exit code */ - -#line 482 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 482 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 482 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); - -#line 482 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.lookupdev", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 482 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 482 "nfstream/pcap.pyx" __pyx_L0:; - -#line 482 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 482 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 482 "nfstream/pcap.pyx" return __pyx_r; - -#line 482 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":491 +/* "nfstream/pcap.pyx":510 * return str(p.decode('UTF-8')) - * + * * def findalldevs(): # <<<<<<<<<<<<<< * """Return a list of capture devices.""" * cdef pcap_if_t *devs */ -#line 491 "nfstream/pcap.pyx" - - -#line 491 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 491 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_5findalldevs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 491 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_4findalldevs[] = "Return a list of capture devices."; -static PyMethodDef __pyx_mdef_8nfstream_4pcap_5findalldevs = -#line 491 "nfstream/pcap.pyx" -{"findalldevs", (PyCFunction)__pyx_pw_8nfstream_4pcap_5findalldevs, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4findalldevs}; - -#line 491 "nfstream/pcap.pyx" +static PyMethodDef __pyx_mdef_8nfstream_4pcap_5findalldevs = {"findalldevs", (PyCFunction)__pyx_pw_8nfstream_4pcap_5findalldevs, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4findalldevs}; static PyObject *__pyx_pw_8nfstream_4pcap_5findalldevs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - -#line 491 "nfstream/pcap.pyx" PyObject *__pyx_r = 0; - -#line 491 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 491 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("findalldevs (wrapper)", 0); - __pyx_r = -#line 491 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_4findalldevs(__pyx_self); + __pyx_r = __pyx_pf_8nfstream_4pcap_4findalldevs(__pyx_self); -#line 491 "nfstream/pcap.pyx" - - -#line 491 "nfstream/pcap.pyx" /* function exit code */ - -#line 491 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 491 "nfstream/pcap.pyx" return __pyx_r; - -#line 491 "nfstream/pcap.pyx" } -#line 491 "nfstream/pcap.pyx" - - -#line 491 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_4findalldevs(CYTHON_UNUSED PyObject *__pyx_self) { - pcap_if_t *__pyx_v_devs -#line 491 "nfstream/pcap.pyx" -; - pcap_if_t *__pyx_v_curr -#line 491 "nfstream/pcap.pyx" -; - char __pyx_v_ebuf[0x100] -#line 491 "nfstream/pcap.pyx" -; - int __pyx_v_status -#line 491 "nfstream/pcap.pyx" -; - PyObject *__pyx_v_retval = NULL -#line 491 "nfstream/pcap.pyx" -; - -#line 491 "nfstream/pcap.pyx" + pcap_if_t *__pyx_v_devs; + pcap_if_t *__pyx_v_curr; + char __pyx_v_ebuf[0x100]; + int __pyx_v_status; + PyObject *__pyx_v_retval = NULL; PyObject *__pyx_r = NULL; - -#line 491 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 491 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 491 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 491 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 491 "nfstream/pcap.pyx" char *__pyx_t_4; - -#line 491 "nfstream/pcap.pyx" int __pyx_t_5; - -#line 491 "nfstream/pcap.pyx" pcap_if_t *__pyx_t_6; - -#line 491 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("findalldevs", 0); - /* "nfstream/pcap.pyx":497 + /* "nfstream/pcap.pyx":516 * cdef char ebuf[256] - * + * * status = pcap_findalldevs(&devs, ebuf) # <<<<<<<<<<<<<< * if status: * raise OSError(ebuf) */ - -#line 497 "nfstream/pcap.pyx" __pyx_v_status = pcap_findalldevs((&__pyx_v_devs), __pyx_v_ebuf); - /* "nfstream/pcap.pyx":498 - * + /* "nfstream/pcap.pyx":517 + * * status = pcap_findalldevs(&devs, ebuf) * if status: # <<<<<<<<<<<<<< * raise OSError(ebuf) * retval = [] */ - -#line 498 "nfstream/pcap.pyx" __pyx_t_1 = (__pyx_v_status != 0); - -#line 498 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":499 + /* "nfstream/pcap.pyx":518 * status = pcap_findalldevs(&devs, ebuf) * if status: * raise OSError(ebuf) # <<<<<<<<<<<<<< * retval = [] * if not devs: */ - -#line 499 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_ebuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 499, __pyx_L1_error) - -#line 499 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_ebuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 499 "nfstream/pcap.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 499, __pyx_L1_error) - -#line 499 "nfstream/pcap.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 499 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_2); - -#line 499 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - -#line 499 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 499 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 499, __pyx_L1_error) - -#line 499 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 499 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 499 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_t_2, 0, 0, 0); - -#line 499 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 518, __pyx_L1_error) -#line 499 "nfstream/pcap.pyx" - __PYX_ERR(1, 499, __pyx_L1_error) - - /* "nfstream/pcap.pyx":498 - * + /* "nfstream/pcap.pyx":517 + * * status = pcap_findalldevs(&devs, ebuf) * if status: # <<<<<<<<<<<<<< * raise OSError(ebuf) * retval = [] */ - -#line 498 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":500 + /* "nfstream/pcap.pyx":519 * if status: * raise OSError(ebuf) * retval = [] # <<<<<<<<<<<<<< * if not devs: * return retval */ - -#line 500 "nfstream/pcap.pyx" - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 500, __pyx_L1_error) - -#line 500 "nfstream/pcap.pyx" + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 500 "nfstream/pcap.pyx" __pyx_v_retval = ((PyObject*)__pyx_t_2); - -#line 500 "nfstream/pcap.pyx" __pyx_t_2 = 0; - /* "nfstream/pcap.pyx":501 + /* "nfstream/pcap.pyx":520 * raise OSError(ebuf) * retval = [] * if not devs: # <<<<<<<<<<<<<< * return retval * curr = devs */ - -#line 501 "nfstream/pcap.pyx" __pyx_t_1 = ((!(__pyx_v_devs != 0)) != 0); - -#line 501 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":502 + /* "nfstream/pcap.pyx":521 * retval = [] * if not devs: * return retval # <<<<<<<<<<<<<< * curr = devs * while 1: */ - -#line 502 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 502 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_v_retval); - -#line 502 "nfstream/pcap.pyx" __pyx_r = __pyx_v_retval; - -#line 502 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":501 + /* "nfstream/pcap.pyx":520 * raise OSError(ebuf) * retval = [] * if not devs: # <<<<<<<<<<<<<< * return retval * curr = devs */ - -#line 501 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":503 + /* "nfstream/pcap.pyx":522 * if not devs: * return retval * curr = devs # <<<<<<<<<<<<<< * while 1: * retval.append(str(curr.name.decode('UTF-8'))) */ - -#line 503 "nfstream/pcap.pyx" __pyx_v_curr = __pyx_v_devs; - /* "nfstream/pcap.pyx":504 + /* "nfstream/pcap.pyx":523 * return retval * curr = devs * while 1: # <<<<<<<<<<<<<< * retval.append(str(curr.name.decode('UTF-8'))) * if not curr.next: */ - -#line 504 "nfstream/pcap.pyx" while (1) { - /* "nfstream/pcap.pyx":505 + /* "nfstream/pcap.pyx":524 * curr = devs * while 1: * retval.append(str(curr.name.decode('UTF-8'))) # <<<<<<<<<<<<<< * if not curr.next: * break */ - -#line 505 "nfstream/pcap.pyx" __pyx_t_4 = __pyx_v_curr->name; - -#line 505 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 505, __pyx_L1_error) - -#line 505 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 505 "nfstream/pcap.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 505, __pyx_L1_error) - -#line 505 "nfstream/pcap.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 505 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_t_2); - -#line 505 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_2); - -#line 505 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - -#line 505 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 505 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 505, __pyx_L1_error) - -#line 505 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 505 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 505 "nfstream/pcap.pyx" - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_retval, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 505, __pyx_L1_error) - -#line 505 "nfstream/pcap.pyx" + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_retval, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 524, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "nfstream/pcap.pyx":506 + /* "nfstream/pcap.pyx":525 * while 1: * retval.append(str(curr.name.decode('UTF-8'))) * if not curr.next: # <<<<<<<<<<<<<< * break * curr = curr.next */ - -#line 506 "nfstream/pcap.pyx" __pyx_t_1 = ((!(__pyx_v_curr->next != 0)) != 0); - -#line 506 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":507 + /* "nfstream/pcap.pyx":526 * retval.append(str(curr.name.decode('UTF-8'))) * if not curr.next: * break # <<<<<<<<<<<<<< * curr = curr.next * pcap_freealldevs(devs) */ - -#line 507 "nfstream/pcap.pyx" goto __pyx_L6_break; - /* "nfstream/pcap.pyx":506 + /* "nfstream/pcap.pyx":525 * while 1: * retval.append(str(curr.name.decode('UTF-8'))) * if not curr.next: # <<<<<<<<<<<<<< * break * curr = curr.next */ - -#line 506 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":508 + /* "nfstream/pcap.pyx":527 * if not curr.next: * break * curr = curr.next # <<<<<<<<<<<<<< * pcap_freealldevs(devs) * return retval */ - -#line 508 "nfstream/pcap.pyx" __pyx_t_6 = __pyx_v_curr->next; - -#line 508 "nfstream/pcap.pyx" __pyx_v_curr = __pyx_t_6; - -#line 508 "nfstream/pcap.pyx" } - -#line 508 "nfstream/pcap.pyx" __pyx_L6_break:; - /* "nfstream/pcap.pyx":509 + /* "nfstream/pcap.pyx":528 * break * curr = curr.next * pcap_freealldevs(devs) # <<<<<<<<<<<<<< * return retval - * + * */ - -#line 509 "nfstream/pcap.pyx" pcap_freealldevs(__pyx_v_devs); - /* "nfstream/pcap.pyx":510 + /* "nfstream/pcap.pyx":529 * curr = curr.next * pcap_freealldevs(devs) * return retval # <<<<<<<<<<<<<< - * + * * def lookupnet(char *dev): */ - -#line 510 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 510 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_v_retval); - -#line 510 "nfstream/pcap.pyx" __pyx_r = __pyx_v_retval; - -#line 510 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":491 + /* "nfstream/pcap.pyx":510 * return str(p.decode('UTF-8')) - * + * * def findalldevs(): # <<<<<<<<<<<<<< * """Return a list of capture devices.""" * cdef pcap_if_t *devs */ -#line 491 "nfstream/pcap.pyx" - - -#line 491 "nfstream/pcap.pyx" /* function exit code */ - -#line 491 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 491 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 491 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); - -#line 491 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.findalldevs", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 491 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 491 "nfstream/pcap.pyx" __pyx_L0:; - -#line 491 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_v_retval); - -#line 491 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 491 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 491 "nfstream/pcap.pyx" return __pyx_r; - -#line 491 "nfstream/pcap.pyx" } -/* "nfstream/pcap.pyx":512 +/* "nfstream/pcap.pyx":531 * return retval - * + * * def lookupnet(char *dev): # <<<<<<<<<<<<<< * """ * Return the address and the netmask of a given device */ -#line 512 "nfstream/pcap.pyx" - - -#line 512 "nfstream/pcap.pyx" /* Python wrapper */ - -#line 512 "nfstream/pcap.pyx" static PyObject *__pyx_pw_8nfstream_4pcap_7lookupnet(PyObject *__pyx_self, PyObject *__pyx_arg_dev); /*proto*/ - -#line 512 "nfstream/pcap.pyx" static char __pyx_doc_8nfstream_4pcap_6lookupnet[] = "\n Return the address and the netmask of a given device\n as network-byteorder integers.\n "; -static PyMethodDef __pyx_mdef_8nfstream_4pcap_7lookupnet = -#line 512 "nfstream/pcap.pyx" -{"lookupnet", (PyCFunction)__pyx_pw_8nfstream_4pcap_7lookupnet, METH_O, __pyx_doc_8nfstream_4pcap_6lookupnet}; - -#line 512 "nfstream/pcap.pyx" +static PyMethodDef __pyx_mdef_8nfstream_4pcap_7lookupnet = {"lookupnet", (PyCFunction)__pyx_pw_8nfstream_4pcap_7lookupnet, METH_O, __pyx_doc_8nfstream_4pcap_6lookupnet}; static PyObject *__pyx_pw_8nfstream_4pcap_7lookupnet(PyObject *__pyx_self, PyObject *__pyx_arg_dev) { - char *__pyx_v_dev -#line 512 "nfstream/pcap.pyx" -; - -#line 512 "nfstream/pcap.pyx" + char *__pyx_v_dev; PyObject *__pyx_r = 0; - -#line 512 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 512 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("lookupnet (wrapper)", 0); - -#line 512 "nfstream/pcap.pyx" assert(__pyx_arg_dev); { - -#line 512 "nfstream/pcap.pyx" - __pyx_v_dev = __Pyx_PyObject_AsWritableString(__pyx_arg_dev); if (unlikely((!__pyx_v_dev) && PyErr_Occurred())) __PYX_ERR(1, 512, __pyx_L3_error) - -#line 512 "nfstream/pcap.pyx" + __pyx_v_dev = __Pyx_PyObject_AsWritableString(__pyx_arg_dev); if (unlikely((!__pyx_v_dev) && PyErr_Occurred())) __PYX_ERR(1, 531, __pyx_L3_error) } - -#line 512 "nfstream/pcap.pyx" goto __pyx_L4_argument_unpacking_done; - -#line 512 "nfstream/pcap.pyx" __pyx_L3_error:; - -#line 512 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.lookupnet", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 512 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 512 "nfstream/pcap.pyx" return NULL; - -#line 512 "nfstream/pcap.pyx" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 512 "nfstream/pcap.pyx" -__pyx_pf_8nfstream_4pcap_6lookupnet(__pyx_self, ((char *)__pyx_v_dev)); + __pyx_r = __pyx_pf_8nfstream_4pcap_6lookupnet(__pyx_self, ((char *)__pyx_v_dev)); -#line 512 "nfstream/pcap.pyx" - - -#line 512 "nfstream/pcap.pyx" /* function exit code */ - -#line 512 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 512 "nfstream/pcap.pyx" return __pyx_r; - -#line 512 "nfstream/pcap.pyx" } -#line 512 "nfstream/pcap.pyx" - - -#line 512 "nfstream/pcap.pyx" static PyObject *__pyx_pf_8nfstream_4pcap_6lookupnet(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_dev) { - unsigned int __pyx_v_netp -#line 512 "nfstream/pcap.pyx" -; - unsigned int __pyx_v_maskp -#line 512 "nfstream/pcap.pyx" -; - char __pyx_v_ebuf[0x100] -#line 512 "nfstream/pcap.pyx" -; - int __pyx_v_status -#line 512 "nfstream/pcap.pyx" -; - -#line 512 "nfstream/pcap.pyx" + unsigned int __pyx_v_netp; + unsigned int __pyx_v_maskp; + char __pyx_v_ebuf[0x100]; + int __pyx_v_status; PyObject *__pyx_r = NULL; - -#line 512 "nfstream/pcap.pyx" __Pyx_RefNannyDeclarations - -#line 512 "nfstream/pcap.pyx" int __pyx_t_1; - -#line 512 "nfstream/pcap.pyx" PyObject *__pyx_t_2 = NULL; - -#line 512 "nfstream/pcap.pyx" PyObject *__pyx_t_3 = NULL; - -#line 512 "nfstream/pcap.pyx" PyObject *__pyx_t_4 = NULL; - -#line 512 "nfstream/pcap.pyx" PyObject *__pyx_t_5 = NULL; - -#line 512 "nfstream/pcap.pyx" int __pyx_t_6; - -#line 512 "nfstream/pcap.pyx" PyObject *__pyx_t_7 = NULL; - -#line 512 "nfstream/pcap.pyx" PyObject *__pyx_t_8 = NULL; - -#line 512 "nfstream/pcap.pyx" __Pyx_RefNannySetupContext("lookupnet", 0); - /* "nfstream/pcap.pyx":521 + /* "nfstream/pcap.pyx":540 * cdef char ebuf[256] - * + * * status = pcap_lookupnet(dev, &netp, &maskp, ebuf) # <<<<<<<<<<<<<< * if status: * raise OSError(ebuf) */ - -#line 521 "nfstream/pcap.pyx" __pyx_v_status = pcap_lookupnet(__pyx_v_dev, (&__pyx_v_netp), (&__pyx_v_maskp), __pyx_v_ebuf); - /* "nfstream/pcap.pyx":522 - * + /* "nfstream/pcap.pyx":541 + * * status = pcap_lookupnet(dev, &netp, &maskp, ebuf) * if status: # <<<<<<<<<<<<<< * raise OSError(ebuf) * return struct.pack('I', netp), struct.pack('I', maskp) */ - -#line 522 "nfstream/pcap.pyx" __pyx_t_1 = (__pyx_v_status != 0); - -#line 522 "nfstream/pcap.pyx" if (__pyx_t_1) { - /* "nfstream/pcap.pyx":523 + /* "nfstream/pcap.pyx":542 * status = pcap_lookupnet(dev, &netp, &maskp, ebuf) * if status: * raise OSError(ebuf) # <<<<<<<<<<<<<< * return struct.pack('I', netp), struct.pack('I', maskp) */ - -#line 523 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_ebuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 523, __pyx_L1_error) - -#line 523 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_ebuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 523 "nfstream/pcap.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 523, __pyx_L1_error) - -#line 523 "nfstream/pcap.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 523 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_2); - -#line 523 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - -#line 523 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 523 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 523, __pyx_L1_error) - -#line 523 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 523 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 523 "nfstream/pcap.pyx" __Pyx_Raise(__pyx_t_2, 0, 0, 0); - -#line 523 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 542, __pyx_L1_error) -#line 523 "nfstream/pcap.pyx" - __PYX_ERR(1, 523, __pyx_L1_error) - - /* "nfstream/pcap.pyx":522 - * + /* "nfstream/pcap.pyx":541 + * * status = pcap_lookupnet(dev, &netp, &maskp, ebuf) * if status: # <<<<<<<<<<<<<< * raise OSError(ebuf) * return struct.pack('I', netp), struct.pack('I', maskp) */ - -#line 522 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":524 + /* "nfstream/pcap.pyx":543 * if status: * raise OSError(ebuf) * return struct.pack('I', netp), struct.pack('I', maskp) # <<<<<<<<<<<<<< */ - -#line 524 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_r); - -#line 524 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 524 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pack); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pack); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_netp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_netp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 524 "nfstream/pcap.pyx" __pyx_t_5 = NULL; - -#line 524 "nfstream/pcap.pyx" __pyx_t_6 = 0; - -#line 524 "nfstream/pcap.pyx" if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - -#line 524 "nfstream/pcap.pyx" __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - -#line 524 "nfstream/pcap.pyx" if (likely(__pyx_t_5)) { - -#line 524 "nfstream/pcap.pyx" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - -#line 524 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_t_5); - -#line 524 "nfstream/pcap.pyx" __Pyx_INCREF(function); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF_SET(__pyx_t_4, function); - -#line 524 "nfstream/pcap.pyx" __pyx_t_6 = 1; - -#line 524 "nfstream/pcap.pyx" } - -#line 524 "nfstream/pcap.pyx" } - -#line 524 "nfstream/pcap.pyx" #if CYTHON_FAST_PYCALL - -#line 524 "nfstream/pcap.pyx" if (PyFunction_Check(__pyx_t_4)) { - -#line 524 "nfstream/pcap.pyx" - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_s_I, __pyx_t_3}; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_I, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 524 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_2); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 524 "nfstream/pcap.pyx" } else - -#line 524 "nfstream/pcap.pyx" #endif - -#line 524 "nfstream/pcap.pyx" #if CYTHON_FAST_PYCCALL - -#line 524 "nfstream/pcap.pyx" if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - -#line 524 "nfstream/pcap.pyx" - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_s_I, __pyx_t_3}; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_I, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 524 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_2); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 524 "nfstream/pcap.pyx" } else - -#line 524 "nfstream/pcap.pyx" #endif - -#line 524 "nfstream/pcap.pyx" { - -#line 524 "nfstream/pcap.pyx" - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - -#line 524 "nfstream/pcap.pyx" if (__pyx_t_5) { - -#line 524 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - -#line 524 "nfstream/pcap.pyx" } - -#line 524 "nfstream/pcap.pyx" - __Pyx_INCREF(__pyx_n_s_I); - -#line 524 "nfstream/pcap.pyx" - __Pyx_GIVEREF(__pyx_n_s_I); - -#line 524 "nfstream/pcap.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_s_I); - -#line 524 "nfstream/pcap.pyx" + __Pyx_INCREF(__pyx_n_u_I); + __Pyx_GIVEREF(__pyx_n_u_I); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_u_I); __Pyx_GIVEREF(__pyx_t_3); - -#line 524 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); - -#line 524 "nfstream/pcap.pyx" __pyx_t_3 = 0; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 524 "nfstream/pcap.pyx" } - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - -#line 524 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_7 = __Pyx_PyInt_From_unsigned_int(__pyx_v_maskp); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_7 = __Pyx_PyInt_From_unsigned_int(__pyx_v_maskp); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - -#line 524 "nfstream/pcap.pyx" __pyx_t_5 = NULL; - -#line 524 "nfstream/pcap.pyx" __pyx_t_6 = 0; - -#line 524 "nfstream/pcap.pyx" if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - -#line 524 "nfstream/pcap.pyx" __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - -#line 524 "nfstream/pcap.pyx" if (likely(__pyx_t_5)) { - -#line 524 "nfstream/pcap.pyx" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - -#line 524 "nfstream/pcap.pyx" __Pyx_INCREF(__pyx_t_5); - -#line 524 "nfstream/pcap.pyx" __Pyx_INCREF(function); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF_SET(__pyx_t_3, function); - -#line 524 "nfstream/pcap.pyx" __pyx_t_6 = 1; - -#line 524 "nfstream/pcap.pyx" } - -#line 524 "nfstream/pcap.pyx" } - -#line 524 "nfstream/pcap.pyx" #if CYTHON_FAST_PYCALL - -#line 524 "nfstream/pcap.pyx" if (PyFunction_Check(__pyx_t_3)) { - -#line 524 "nfstream/pcap.pyx" - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_s_I, __pyx_t_7}; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_I, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 524 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_4); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 524 "nfstream/pcap.pyx" } else - -#line 524 "nfstream/pcap.pyx" #endif - -#line 524 "nfstream/pcap.pyx" #if CYTHON_FAST_PYCCALL - -#line 524 "nfstream/pcap.pyx" if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - -#line 524 "nfstream/pcap.pyx" - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_s_I, __pyx_t_7}; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_I, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 524 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_4); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 524 "nfstream/pcap.pyx" } else - -#line 524 "nfstream/pcap.pyx" #endif - -#line 524 "nfstream/pcap.pyx" { - -#line 524 "nfstream/pcap.pyx" - __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - -#line 524 "nfstream/pcap.pyx" if (__pyx_t_5) { - -#line 524 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - -#line 524 "nfstream/pcap.pyx" } - -#line 524 "nfstream/pcap.pyx" - __Pyx_INCREF(__pyx_n_s_I); - -#line 524 "nfstream/pcap.pyx" - __Pyx_GIVEREF(__pyx_n_s_I); - -#line 524 "nfstream/pcap.pyx" - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_n_s_I); - -#line 524 "nfstream/pcap.pyx" + __Pyx_INCREF(__pyx_n_u_I); + __Pyx_GIVEREF(__pyx_n_u_I); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_n_u_I); __Pyx_GIVEREF(__pyx_t_7); - -#line 524 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_7); - -#line 524 "nfstream/pcap.pyx" __pyx_t_7 = 0; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 524 "nfstream/pcap.pyx" } - -#line 524 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 524 "nfstream/pcap.pyx" - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 524, __pyx_L1_error) - -#line 524 "nfstream/pcap.pyx" + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 524 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_2); - -#line 524 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - -#line 524 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_4); - -#line 524 "nfstream/pcap.pyx" PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); - -#line 524 "nfstream/pcap.pyx" __pyx_t_2 = 0; - -#line 524 "nfstream/pcap.pyx" __pyx_t_4 = 0; - -#line 524 "nfstream/pcap.pyx" __pyx_r = __pyx_t_3; - -#line 524 "nfstream/pcap.pyx" __pyx_t_3 = 0; - -#line 524 "nfstream/pcap.pyx" goto __pyx_L0; - /* "nfstream/pcap.pyx":512 + /* "nfstream/pcap.pyx":531 * return retval - * + * * def lookupnet(char *dev): # <<<<<<<<<<<<<< * """ * Return the address and the netmask of a given device */ -#line 512 "nfstream/pcap.pyx" - - -#line 512 "nfstream/pcap.pyx" /* function exit code */ - -#line 512 "nfstream/pcap.pyx" __pyx_L1_error:; - -#line 512 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_2); - -#line 512 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_3); - -#line 512 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_4); - -#line 512 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_5); - -#line 512 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_7); - -#line 512 "nfstream/pcap.pyx" __Pyx_XDECREF(__pyx_t_8); - -#line 512 "nfstream/pcap.pyx" __Pyx_AddTraceback("nfstream.pcap.lookupnet", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 512 "nfstream/pcap.pyx" __pyx_r = NULL; - -#line 512 "nfstream/pcap.pyx" __pyx_L0:; - -#line 512 "nfstream/pcap.pyx" __Pyx_XGIVEREF(__pyx_r); - -#line 512 "nfstream/pcap.pyx" __Pyx_RefNannyFinishContext(); - -#line 512 "nfstream/pcap.pyx" return __pyx_r; - -#line 512 "nfstream/pcap.pyx" } /* "View.MemoryView":120 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ -#line 120 "View.MemoryView" - - -#line 120 "View.MemoryView" /* Python wrapper */ - -#line 120 "View.MemoryView" static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 120 "View.MemoryView" static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_shape = 0 -#line 120 "View.MemoryView" -; - Py_ssize_t __pyx_v_itemsize -#line 120 "View.MemoryView" -; - PyObject *__pyx_v_format = 0 -#line 120 "View.MemoryView" -; - PyObject *__pyx_v_mode = 0 -#line 120 "View.MemoryView" -; - int __pyx_v_allocate_buffer -#line 120 "View.MemoryView" -; - -#line 120 "View.MemoryView" + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; int __pyx_r; - -#line 120 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 120 "View.MemoryView" __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - -#line 120 "View.MemoryView" { - -#line 120 "View.MemoryView" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; - -#line 120 "View.MemoryView" PyObject* values[5] = {0,0,0,0,0}; - -#line 120 "View.MemoryView" values[3] = ((PyObject *)__pyx_n_s_c); - -#line 120 "View.MemoryView" if (unlikely(__pyx_kwds)) { - -#line 120 "View.MemoryView" Py_ssize_t kw_args; - -#line 120 "View.MemoryView" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 120 "View.MemoryView" switch (pos_args) { - case 5: -#line 120 "View.MemoryView" -values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - -#line 120 "View.MemoryView" + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: -#line 120 "View.MemoryView" -values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - -#line 120 "View.MemoryView" + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: -#line 120 "View.MemoryView" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 120 "View.MemoryView" + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: -#line 120 "View.MemoryView" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 120 "View.MemoryView" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 120 "View.MemoryView" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 120 "View.MemoryView" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 120 "View.MemoryView" case 0: break; - default: -#line 120 "View.MemoryView" -goto __pyx_L5_argtuple_error; - -#line 120 "View.MemoryView" + default: goto __pyx_L5_argtuple_error; } - -#line 120 "View.MemoryView" kw_args = PyDict_Size(__pyx_kwds); - -#line 120 "View.MemoryView" switch (pos_args) { - -#line 120 "View.MemoryView" case 0: - -#line 120 "View.MemoryView" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; - else -#line 120 "View.MemoryView" -goto __pyx_L5_argtuple_error; - -#line 120 "View.MemoryView" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 120 "View.MemoryView" case 1: - -#line 120 "View.MemoryView" if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; - -#line 120 "View.MemoryView" else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); -#line 120 "View.MemoryView" -__PYX_ERR(0, 120, __pyx_L3_error) - -#line 120 "View.MemoryView" + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 120, __pyx_L3_error) } - -#line 120 "View.MemoryView" CYTHON_FALLTHROUGH; - -#line 120 "View.MemoryView" case 2: - -#line 120 "View.MemoryView" if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; - -#line 120 "View.MemoryView" else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); -#line 120 "View.MemoryView" -__PYX_ERR(0, 120, __pyx_L3_error) - -#line 120 "View.MemoryView" + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 120, __pyx_L3_error) } - -#line 120 "View.MemoryView" CYTHON_FALLTHROUGH; - -#line 120 "View.MemoryView" case 3: - -#line 120 "View.MemoryView" if (kw_args > 0) { - -#line 120 "View.MemoryView" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); - -#line 120 "View.MemoryView" if (value) { values[3] = value; kw_args--; } - -#line 120 "View.MemoryView" } - -#line 120 "View.MemoryView" CYTHON_FALLTHROUGH; - -#line 120 "View.MemoryView" case 4: - -#line 120 "View.MemoryView" if (kw_args > 0) { - -#line 120 "View.MemoryView" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); - -#line 120 "View.MemoryView" if (value) { values[4] = value; kw_args--; } - -#line 120 "View.MemoryView" } - -#line 120 "View.MemoryView" } - -#line 120 "View.MemoryView" if (unlikely(kw_args > 0)) { - -#line 120 "View.MemoryView" if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 120, __pyx_L3_error) - -#line 120 "View.MemoryView" } - -#line 120 "View.MemoryView" } else { - -#line 120 "View.MemoryView" switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: -#line 120 "View.MemoryView" -values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - -#line 120 "View.MemoryView" + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: -#line 120 "View.MemoryView" -values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - -#line 120 "View.MemoryView" + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: -#line 120 "View.MemoryView" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 120 "View.MemoryView" + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 120 "View.MemoryView" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 120 "View.MemoryView" break; - default: -#line 120 "View.MemoryView" -goto __pyx_L5_argtuple_error; - -#line 120 "View.MemoryView" + default: goto __pyx_L5_argtuple_error; } - -#line 120 "View.MemoryView" } - -#line 120 "View.MemoryView" __pyx_v_shape = ((PyObject*)values[0]); - -#line 120 "View.MemoryView" __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L3_error) - -#line 120 "View.MemoryView" __pyx_v_format = values[2]; - -#line 120 "View.MemoryView" __pyx_v_mode = values[3]; - -#line 120 "View.MemoryView" if (values[4]) { - -#line 120 "View.MemoryView" __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) - -#line 120 "View.MemoryView" } else { /* "View.MemoryView":121 - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< - * + * * cdef int idx */ - -#line 121 "View.MemoryView" __pyx_v_allocate_buffer = ((int)1); - -#line 121 "View.MemoryView" } - -#line 121 "View.MemoryView" } - -#line 121 "View.MemoryView" goto __pyx_L4_argument_unpacking_done; - -#line 121 "View.MemoryView" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); -#line 121 "View.MemoryView" -__PYX_ERR(0, 120, __pyx_L3_error) - -#line 121 "View.MemoryView" + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 120, __pyx_L3_error) __pyx_L3_error:; - -#line 121 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 121 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 121 "View.MemoryView" return -1; - -#line 121 "View.MemoryView" __pyx_L4_argument_unpacking_done:; - -#line 121 "View.MemoryView" if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(0, 120, __pyx_L1_error) - -#line 121 "View.MemoryView" if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - -#line 121 "View.MemoryView" PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(0, 120, __pyx_L1_error) - -#line 121 "View.MemoryView" } - __pyx_r = -#line 121 "View.MemoryView" -__pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); /* "View.MemoryView":120 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ -#line 120 "View.MemoryView" - - -#line 120 "View.MemoryView" /* function exit code */ - -#line 120 "View.MemoryView" goto __pyx_L0; - -#line 120 "View.MemoryView" __pyx_L1_error:; - -#line 120 "View.MemoryView" __pyx_r = -1; - -#line 120 "View.MemoryView" __pyx_L0:; - -#line 120 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 120 "View.MemoryView" return __pyx_r; - -#line 120 "View.MemoryView" } -#line 120 "View.MemoryView" - - -#line 120 "View.MemoryView" static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { - int __pyx_v_idx -#line 120 "View.MemoryView" -; - Py_ssize_t __pyx_v_i -#line 120 "View.MemoryView" -; - Py_ssize_t __pyx_v_dim -#line 120 "View.MemoryView" -; - PyObject **__pyx_v_p -#line 120 "View.MemoryView" -; - char __pyx_v_order -#line 120 "View.MemoryView" -; - -#line 120 "View.MemoryView" + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; int __pyx_r; - -#line 120 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 120 "View.MemoryView" Py_ssize_t __pyx_t_1; - -#line 120 "View.MemoryView" int __pyx_t_2; - -#line 120 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 120 "View.MemoryView" int __pyx_t_4; - -#line 120 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 120 "View.MemoryView" char *__pyx_t_6; - -#line 120 "View.MemoryView" int __pyx_t_7; - -#line 120 "View.MemoryView" Py_ssize_t __pyx_t_8; - -#line 120 "View.MemoryView" PyObject *__pyx_t_9 = NULL; - -#line 120 "View.MemoryView" PyObject *__pyx_t_10 = NULL; - -#line 120 "View.MemoryView" __Pyx_RefNannySetupContext("__cinit__", 0); - -#line 120 "View.MemoryView" __Pyx_INCREF(__pyx_v_format); /* "View.MemoryView":127 * cdef PyObject **p - * + * * self.ndim = len(shape) # <<<<<<<<<<<<<< * self.itemsize = itemsize - * + * */ - -#line 127 "View.MemoryView" if (unlikely(__pyx_v_shape == Py_None)) { - -#line 127 "View.MemoryView" PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - -#line 127 "View.MemoryView" __PYX_ERR(0, 127, __pyx_L1_error) - -#line 127 "View.MemoryView" } - -#line 127 "View.MemoryView" __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 127, __pyx_L1_error) - -#line 127 "View.MemoryView" __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":128 - * + * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< - * + * * if not self.ndim: */ - -#line 128 "View.MemoryView" __pyx_v_self->itemsize = __pyx_v_itemsize; /* "View.MemoryView":130 * self.itemsize = itemsize - * + * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") - * + * */ - -#line 130 "View.MemoryView" __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); - -#line 130 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":131 - * + * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< - * + * * if itemsize <= 0: */ - -#line 131 "View.MemoryView" __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) - -#line 131 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 131 "View.MemoryView" __Pyx_Raise(__pyx_t_3, 0, 0, 0); - -#line 131 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 131 "View.MemoryView" __PYX_ERR(0, 131, __pyx_L1_error) /* "View.MemoryView":130 * self.itemsize = itemsize - * + * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") - * + * */ - -#line 130 "View.MemoryView" } /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") - * + * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") - * + * */ - -#line 133 "View.MemoryView" __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); - -#line 133 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":134 - * + * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * + * * if not isinstance(format, bytes): */ - -#line 134 "View.MemoryView" __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) - -#line 134 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 134 "View.MemoryView" __Pyx_Raise(__pyx_t_3, 0, 0, 0); - -#line 134 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 134 "View.MemoryView" __PYX_ERR(0, 134, __pyx_L1_error) /* "View.MemoryView":133 * raise ValueError("Empty shape tuple for cython.array") - * + * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") - * + * */ - -#line 133 "View.MemoryView" } /* "View.MemoryView":136 * raise ValueError("itemsize <= 0 for cython.array") - * + * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string */ - -#line 136 "View.MemoryView" - __pyx_t_2 = PyBytes_Check(__pyx_v_format); - -#line 136 "View.MemoryView" + __pyx_t_2 = PyBytes_Check(__pyx_v_format); __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); - -#line 136 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":137 - * + * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string * self.format = self._format */ - -#line 137 "View.MemoryView" __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) - -#line 137 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 137 "View.MemoryView" __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) - -#line 137 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 137 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 137 "View.MemoryView" __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); - -#line 137 "View.MemoryView" __pyx_t_5 = 0; /* "View.MemoryView":136 * raise ValueError("itemsize <= 0 for cython.array") - * + * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string */ - -#line 136 "View.MemoryView" } /* "View.MemoryView":138 @@ -14497,182 +8020,108 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< * self.format = self._format - * + * */ - -#line 138 "View.MemoryView" if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(0, 138, __pyx_L1_error) - -#line 138 "View.MemoryView" __pyx_t_5 = __pyx_v_format; - -#line 138 "View.MemoryView" __Pyx_INCREF(__pyx_t_5); - -#line 138 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_5); - -#line 138 "View.MemoryView" __Pyx_GOTREF(__pyx_v_self->_format); - -#line 138 "View.MemoryView" __Pyx_DECREF(__pyx_v_self->_format); - -#line 138 "View.MemoryView" __pyx_v_self->_format = ((PyObject*)__pyx_t_5); - -#line 138 "View.MemoryView" __pyx_t_5 = 0; /* "View.MemoryView":139 * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 139 "View.MemoryView" __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) - -#line 139 "View.MemoryView" __pyx_v_self->format = __pyx_t_6; /* "View.MemoryView":142 - * - * + * + * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< * self._strides = self._shape + self.ndim - * + * */ - -#line 142 "View.MemoryView" __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); /* "View.MemoryView":143 - * + * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< - * + * * if not self._shape: */ - -#line 143 "View.MemoryView" __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); /* "View.MemoryView":145 * self._strides = self._shape + self.ndim - * + * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") - * + * */ - -#line 145 "View.MemoryView" __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); - -#line 145 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":146 - * + * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 146 "View.MemoryView" __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) - -#line 146 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 146 "View.MemoryView" __Pyx_Raise(__pyx_t_5, 0, 0, 0); - -#line 146 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 146 "View.MemoryView" __PYX_ERR(0, 146, __pyx_L1_error) /* "View.MemoryView":145 * self._strides = self._shape + self.ndim - * + * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") - * + * */ - -#line 145 "View.MemoryView" } /* "View.MemoryView":149 - * - * + * + * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) */ - -#line 149 "View.MemoryView" __pyx_t_7 = 0; - -#line 149 "View.MemoryView" __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; - -#line 149 "View.MemoryView" for (;;) { - -#line 149 "View.MemoryView" if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - -#line 149 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 149 "View.MemoryView" __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) - -#line 149 "View.MemoryView" #else - -#line 149 "View.MemoryView" __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) - -#line 149 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 149 "View.MemoryView" #endif - -#line 149 "View.MemoryView" __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error) - -#line 149 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 149 "View.MemoryView" __pyx_v_dim = __pyx_t_8; - -#line 149 "View.MemoryView" __pyx_v_idx = __pyx_t_7; - -#line 149 "View.MemoryView" __pyx_t_7 = (__pyx_t_7 + 1); /* "View.MemoryView":150 - * + * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim */ - -#line 150 "View.MemoryView" __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); - -#line 150 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":151 @@ -14680,135 +8129,71 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< * self._shape[idx] = dim - * + * */ - -#line 151 "View.MemoryView" __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) - -#line 151 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 151 "View.MemoryView" __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L1_error) - -#line 151 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 151 "View.MemoryView" __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 151, __pyx_L1_error) - -#line 151 "View.MemoryView" __Pyx_GOTREF(__pyx_t_10); - -#line 151 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 151 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); - -#line 151 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_9); - -#line 151 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); - -#line 151 "View.MemoryView" __pyx_t_3 = 0; - -#line 151 "View.MemoryView" __pyx_t_9 = 0; - -#line 151 "View.MemoryView" __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L1_error) - -#line 151 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 151 "View.MemoryView" __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - -#line 151 "View.MemoryView" __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 151, __pyx_L1_error) - -#line 151 "View.MemoryView" __Pyx_GOTREF(__pyx_t_10); - -#line 151 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_9); - -#line 151 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); - -#line 151 "View.MemoryView" __pyx_t_9 = 0; - -#line 151 "View.MemoryView" __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L1_error) - -#line 151 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 151 "View.MemoryView" __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - -#line 151 "View.MemoryView" __Pyx_Raise(__pyx_t_9, 0, 0, 0); - -#line 151 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 151 "View.MemoryView" __PYX_ERR(0, 151, __pyx_L1_error) /* "View.MemoryView":150 - * + * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim */ - -#line 150 "View.MemoryView" } /* "View.MemoryView":152 * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim # <<<<<<<<<<<<<< - * + * * cdef char order */ - -#line 152 "View.MemoryView" (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; /* "View.MemoryView":149 - * - * + * + * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) */ - -#line 149 "View.MemoryView" } - -#line 149 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "View.MemoryView":155 - * + * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ - -#line 155 "View.MemoryView" __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 155, __pyx_L1_error) - -#line 155 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":156 @@ -14818,8 +8203,6 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.mode = u'fortran' * elif mode == 'c': */ - -#line 156 "View.MemoryView" __pyx_v_order = 'F'; /* "View.MemoryView":157 @@ -14829,34 +8212,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * elif mode == 'c': * order = b'C' */ - -#line 157 "View.MemoryView" __Pyx_INCREF(__pyx_n_u_fortran); - -#line 157 "View.MemoryView" __Pyx_GIVEREF(__pyx_n_u_fortran); - -#line 157 "View.MemoryView" __Pyx_GOTREF(__pyx_v_self->mode); - -#line 157 "View.MemoryView" __Pyx_DECREF(__pyx_v_self->mode); - -#line 157 "View.MemoryView" __pyx_v_self->mode = __pyx_n_u_fortran; /* "View.MemoryView":155 - * + * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ - -#line 155 "View.MemoryView" goto __pyx_L10; - -#line 155 "View.MemoryView" } /* "View.MemoryView":158 @@ -14866,11 +8235,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * order = b'C' * self.mode = u'c' */ - -#line 158 "View.MemoryView" __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 158, __pyx_L1_error) - -#line 158 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":159 @@ -14880,8 +8245,6 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.mode = u'c' * else: */ - -#line 159 "View.MemoryView" __pyx_v_order = 'C'; /* "View.MemoryView":160 @@ -14891,20 +8254,10 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * else: * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) */ - -#line 160 "View.MemoryView" __Pyx_INCREF(__pyx_n_u_c); - -#line 160 "View.MemoryView" __Pyx_GIVEREF(__pyx_n_u_c); - -#line 160 "View.MemoryView" __Pyx_GOTREF(__pyx_v_self->mode); - -#line 160 "View.MemoryView" __Pyx_DECREF(__pyx_v_self->mode); - -#line 160 "View.MemoryView" __pyx_v_self->mode = __pyx_n_u_c; /* "View.MemoryView":158 @@ -14914,207 +8267,131 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * order = b'C' * self.mode = u'c' */ - -#line 158 "View.MemoryView" goto __pyx_L10; - -#line 158 "View.MemoryView" } /* "View.MemoryView":162 * self.mode = u'c' * else: * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< - * + * * self.len = fill_contig_strides_array(self._shape, self._strides, */ - -#line 162 "View.MemoryView" /*else*/ { - -#line 162 "View.MemoryView" __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) - -#line 162 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 162 "View.MemoryView" __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 162, __pyx_L1_error) - -#line 162 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 162 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_5); - -#line 162 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); - -#line 162 "View.MemoryView" __pyx_t_5 = 0; - -#line 162 "View.MemoryView" __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) - -#line 162 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 162 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 162 "View.MemoryView" __Pyx_Raise(__pyx_t_5, 0, 0, 0); - -#line 162 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 162 "View.MemoryView" __PYX_ERR(0, 162, __pyx_L1_error) - -#line 162 "View.MemoryView" } - -#line 162 "View.MemoryView" __pyx_L10:; /* "View.MemoryView":164 * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) - * + * * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< * itemsize, self.ndim, order) - * + * */ - -#line 164 "View.MemoryView" __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); /* "View.MemoryView":167 * itemsize, self.ndim, order) - * + * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< * self.dtype_is_object = format == b'O' * if allocate_buffer: */ - -#line 167 "View.MemoryView" __pyx_v_self->free_data = __pyx_v_allocate_buffer; /* "View.MemoryView":168 - * + * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * if allocate_buffer: - * + * */ - -#line 168 "View.MemoryView" __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error) - -#line 168 "View.MemoryView" __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error) - -#line 168 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 168 "View.MemoryView" __pyx_v_self->dtype_is_object = __pyx_t_4; /* "View.MemoryView":169 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 169 "View.MemoryView" __pyx_t_4 = (__pyx_v_allocate_buffer != 0); - -#line 169 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":172 - * - * + * + * * self.data = malloc(self.len) # <<<<<<<<<<<<<< * if not self.data: * raise MemoryError("unable to allocate array data.") */ - -#line 172 "View.MemoryView" __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); /* "View.MemoryView":173 - * + * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") - * + * */ - -#line 173 "View.MemoryView" __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); - -#line 173 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":174 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * + * * if self.dtype_is_object: */ - -#line 174 "View.MemoryView" __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error) - -#line 174 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 174 "View.MemoryView" __Pyx_Raise(__pyx_t_5, 0, 0, 0); - -#line 174 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 174 "View.MemoryView" __PYX_ERR(0, 174, __pyx_L1_error) /* "View.MemoryView":173 - * + * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") - * + * */ - -#line 173 "View.MemoryView" } /* "View.MemoryView":176 * raise MemoryError("unable to allocate array data.") - * + * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): */ - -#line 176 "View.MemoryView" __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); - -#line 176 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":177 - * + * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< * for i in range(self.len / itemsize): * p[i] = Py_None */ - -#line 177 "View.MemoryView" __pyx_v_p = ((PyObject **)__pyx_v_self->data); /* "View.MemoryView":178 @@ -15124,38 +8401,16 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * p[i] = Py_None * Py_INCREF(Py_None) */ - -#line 178 "View.MemoryView" if (unlikely(__pyx_v_itemsize == 0)) { - -#line 178 "View.MemoryView" PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - -#line 178 "View.MemoryView" __PYX_ERR(0, 178, __pyx_L1_error) - -#line 178 "View.MemoryView" } - -#line 178 "View.MemoryView" else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { - -#line 178 "View.MemoryView" PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - -#line 178 "View.MemoryView" __PYX_ERR(0, 178, __pyx_L1_error) - -#line 178 "View.MemoryView" } - -#line 178 "View.MemoryView" __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); - -#line 178 "View.MemoryView" for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { - -#line 178 "View.MemoryView" __pyx_v_i = __pyx_t_8; /* "View.MemoryView":179 @@ -15163,200 +8418,98 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * for i in range(self.len / itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ - -#line 179 "View.MemoryView" (__pyx_v_p[__pyx_v_i]) = Py_None; /* "View.MemoryView":180 * for i in range(self.len / itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ - -#line 180 "View.MemoryView" Py_INCREF(Py_None); - -#line 180 "View.MemoryView" } /* "View.MemoryView":176 * raise MemoryError("unable to allocate array data.") - * + * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): */ - -#line 176 "View.MemoryView" } /* "View.MemoryView":169 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 169 "View.MemoryView" } /* "View.MemoryView":120 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ -#line 120 "View.MemoryView" - - -#line 120 "View.MemoryView" /* function exit code */ - -#line 120 "View.MemoryView" __pyx_r = 0; - -#line 120 "View.MemoryView" goto __pyx_L0; - -#line 120 "View.MemoryView" __pyx_L1_error:; - -#line 120 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 120 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 120 "View.MemoryView" __Pyx_XDECREF(__pyx_t_9); - -#line 120 "View.MemoryView" __Pyx_XDECREF(__pyx_t_10); - -#line 120 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 120 "View.MemoryView" __pyx_r = -1; - -#line 120 "View.MemoryView" __pyx_L0:; - -#line 120 "View.MemoryView" __Pyx_XDECREF(__pyx_v_format); - -#line 120 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 120 "View.MemoryView" return __pyx_r; - -#line 120 "View.MemoryView" } /* "View.MemoryView":183 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 * if self.mode == u"c": */ -#line 183 "View.MemoryView" - - -#line 183 "View.MemoryView" /* Python wrapper */ - -#line 183 "View.MemoryView" static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ - -#line 183 "View.MemoryView" static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - -#line 183 "View.MemoryView" int __pyx_r; - -#line 183 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 183 "View.MemoryView" __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = -#line 183 "View.MemoryView" -__pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); -#line 183 "View.MemoryView" - - -#line 183 "View.MemoryView" /* function exit code */ - -#line 183 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 183 "View.MemoryView" return __pyx_r; - -#line 183 "View.MemoryView" } -#line 183 "View.MemoryView" - - -#line 183 "View.MemoryView" static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_bufmode -#line 183 "View.MemoryView" -; - -#line 183 "View.MemoryView" + int __pyx_v_bufmode; int __pyx_r; - -#line 183 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 183 "View.MemoryView" int __pyx_t_1; - -#line 183 "View.MemoryView" int __pyx_t_2; - -#line 183 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 183 "View.MemoryView" char *__pyx_t_4; - -#line 183 "View.MemoryView" Py_ssize_t __pyx_t_5; - -#line 183 "View.MemoryView" int __pyx_t_6; - -#line 183 "View.MemoryView" Py_ssize_t *__pyx_t_7; - -#line 183 "View.MemoryView" __Pyx_RefNannySetupContext("__getbuffer__", 0); - -#line 183 "View.MemoryView" if (__pyx_v_info != NULL) { - -#line 183 "View.MemoryView" __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - -#line 183 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_info->obj); - -#line 183 "View.MemoryView" } /* "View.MemoryView":184 @@ -15366,8 +8519,6 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS */ - -#line 184 "View.MemoryView" __pyx_v_bufmode = -1; /* "View.MemoryView":185 @@ -15377,14 +8528,8 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ - -#line 185 "View.MemoryView" __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 185, __pyx_L1_error) - -#line 185 "View.MemoryView" __pyx_t_2 = (__pyx_t_1 != 0); - -#line 185 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":186 @@ -15394,8 +8539,6 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS */ - -#line 186 "View.MemoryView" __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); /* "View.MemoryView":185 @@ -15405,11 +8548,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ - -#line 185 "View.MemoryView" goto __pyx_L3; - -#line 185 "View.MemoryView" } /* "View.MemoryView":187 @@ -15419,14 +8558,8 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ - -#line 187 "View.MemoryView" __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error) - -#line 187 "View.MemoryView" __pyx_t_1 = (__pyx_t_2 != 0); - -#line 187 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":188 @@ -15436,8 +8569,6 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") */ - -#line 188 "View.MemoryView" __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); /* "View.MemoryView":187 @@ -15447,11 +8578,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ - -#line 187 "View.MemoryView" } - -#line 187 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":189 @@ -15461,11 +8588,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data */ - -#line 189 "View.MemoryView" __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); - -#line 189 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":190 @@ -15475,20 +8598,10 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.buf = self.data * info.len = self.len */ - -#line 190 "View.MemoryView" __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) - -#line 190 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 190 "View.MemoryView" __Pyx_Raise(__pyx_t_3, 0, 0, 0); - -#line 190 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 190 "View.MemoryView" __PYX_ERR(0, 190, __pyx_L1_error) /* "View.MemoryView":189 @@ -15498,8 +8611,6 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data */ - -#line 189 "View.MemoryView" } /* "View.MemoryView":191 @@ -15509,11 +8620,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.len = self.len * info.ndim = self.ndim */ - -#line 191 "View.MemoryView" __pyx_t_4 = __pyx_v_self->data; - -#line 191 "View.MemoryView" __pyx_v_info->buf = __pyx_t_4; /* "View.MemoryView":192 @@ -15523,11 +8630,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.ndim = self.ndim * info.shape = self._shape */ - -#line 192 "View.MemoryView" __pyx_t_5 = __pyx_v_self->len; - -#line 192 "View.MemoryView" __pyx_v_info->len = __pyx_t_5; /* "View.MemoryView":193 @@ -15537,11 +8640,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.shape = self._shape * info.strides = self._strides */ - -#line 193 "View.MemoryView" __pyx_t_6 = __pyx_v_self->ndim; - -#line 193 "View.MemoryView" __pyx_v_info->ndim = __pyx_t_6; /* "View.MemoryView":194 @@ -15551,11 +8650,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.strides = self._strides * info.suboffsets = NULL */ - -#line 194 "View.MemoryView" __pyx_t_7 = __pyx_v_self->_shape; - -#line 194 "View.MemoryView" __pyx_v_info->shape = __pyx_t_7; /* "View.MemoryView":195 @@ -15565,11 +8660,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.suboffsets = NULL * info.itemsize = self.itemsize */ - -#line 195 "View.MemoryView" __pyx_t_7 = __pyx_v_self->_strides; - -#line 195 "View.MemoryView" __pyx_v_info->strides = __pyx_t_7; /* "View.MemoryView":196 @@ -15579,8 +8670,6 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.itemsize = self.itemsize * info.readonly = 0 */ - -#line 196 "View.MemoryView" __pyx_v_info->suboffsets = NULL; /* "View.MemoryView":197 @@ -15588,253 +8677,137 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< * info.readonly = 0 - * + * */ - -#line 197 "View.MemoryView" __pyx_t_5 = __pyx_v_self->itemsize; - -#line 197 "View.MemoryView" __pyx_v_info->itemsize = __pyx_t_5; /* "View.MemoryView":198 * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ - -#line 198 "View.MemoryView" __pyx_v_info->readonly = 0; /* "View.MemoryView":200 * info.readonly = 0 - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: */ - -#line 200 "View.MemoryView" __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - -#line 200 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":201 - * + * * if flags & PyBUF_FORMAT: * info.format = self.format # <<<<<<<<<<<<<< * else: * info.format = NULL */ - -#line 201 "View.MemoryView" __pyx_t_4 = __pyx_v_self->format; - -#line 201 "View.MemoryView" __pyx_v_info->format = __pyx_t_4; /* "View.MemoryView":200 * info.readonly = 0 - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: */ - -#line 200 "View.MemoryView" goto __pyx_L5; - -#line 200 "View.MemoryView" } /* "View.MemoryView":203 * info.format = self.format * else: * info.format = NULL # <<<<<<<<<<<<<< - * + * * info.obj = self */ - -#line 203 "View.MemoryView" /*else*/ { - -#line 203 "View.MemoryView" __pyx_v_info->format = NULL; - -#line 203 "View.MemoryView" } - -#line 203 "View.MemoryView" __pyx_L5:; /* "View.MemoryView":205 * info.format = NULL - * + * * info.obj = self # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") */ - -#line 205 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_self)); - -#line 205 "View.MemoryView" __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - -#line 205 "View.MemoryView" __Pyx_GOTREF(__pyx_v_info->obj); - -#line 205 "View.MemoryView" __Pyx_DECREF(__pyx_v_info->obj); - -#line 205 "View.MemoryView" __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":183 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 * if self.mode == u"c": */ -#line 183 "View.MemoryView" - - -#line 183 "View.MemoryView" /* function exit code */ - -#line 183 "View.MemoryView" __pyx_r = 0; - -#line 183 "View.MemoryView" goto __pyx_L0; - -#line 183 "View.MemoryView" __pyx_L1_error:; - -#line 183 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 183 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 183 "View.MemoryView" __pyx_r = -1; - -#line 183 "View.MemoryView" if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - -#line 183 "View.MemoryView" __Pyx_GOTREF(__pyx_v_info->obj); - -#line 183 "View.MemoryView" __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - -#line 183 "View.MemoryView" } - -#line 183 "View.MemoryView" goto __pyx_L2; - -#line 183 "View.MemoryView" __pyx_L0:; - -#line 183 "View.MemoryView" if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - -#line 183 "View.MemoryView" __Pyx_GOTREF(Py_None); - -#line 183 "View.MemoryView" __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - -#line 183 "View.MemoryView" } - -#line 183 "View.MemoryView" __pyx_L2:; - -#line 183 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 183 "View.MemoryView" return __pyx_r; - -#line 183 "View.MemoryView" } /* "View.MemoryView":209 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") - * + * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) */ -#line 209 "View.MemoryView" - - -#line 209 "View.MemoryView" /* Python wrapper */ - -#line 209 "View.MemoryView" static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ - -#line 209 "View.MemoryView" static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { - -#line 209 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 209 "View.MemoryView" __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - -#line 209 "View.MemoryView" __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); -#line 209 "View.MemoryView" - - -#line 209 "View.MemoryView" /* function exit code */ - -#line 209 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 209 "View.MemoryView" } -#line 209 "View.MemoryView" - - -#line 209 "View.MemoryView" static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { - -#line 209 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 209 "View.MemoryView" int __pyx_t_1; - -#line 209 "View.MemoryView" __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":210 - * + * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) * elif self.free_data: */ - -#line 210 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); - -#line 210 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":211 @@ -15844,22 +8817,16 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * elif self.free_data: * if self.dtype_is_object: */ - -#line 211 "View.MemoryView" __pyx_v_self->callback_free_data(__pyx_v_self->data); /* "View.MemoryView":210 - * + * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) * elif self.free_data: */ - -#line 210 "View.MemoryView" goto __pyx_L3; - -#line 210 "View.MemoryView" } /* "View.MemoryView":212 @@ -15869,11 +8836,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, */ - -#line 212 "View.MemoryView" __pyx_t_1 = (__pyx_v_self->free_data != 0); - -#line 212 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":213 @@ -15883,11 +8846,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * refcount_objects_in_slice(self.data, self._shape, * self._strides, self.ndim, False) */ - -#line 213 "View.MemoryView" __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); - -#line 213 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":214 @@ -15897,8 +8856,6 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * self._strides, self.ndim, False) * free(self.data) */ - -#line 214 "View.MemoryView" __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); /* "View.MemoryView":213 @@ -15908,8 +8865,6 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * refcount_objects_in_slice(self.data, self._shape, * self._strides, self.ndim, False) */ - -#line 213 "View.MemoryView" } /* "View.MemoryView":216 @@ -15917,10 +8872,8 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * self._strides, self.ndim, False) * free(self.data) # <<<<<<<<<<<<<< * PyObject_Free(self._shape) - * + * */ - -#line 216 "View.MemoryView" free(__pyx_v_self->data); /* "View.MemoryView":212 @@ -15930,209 +8883,105 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, */ - -#line 212 "View.MemoryView" } - -#line 212 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":217 * self._strides, self.ndim, False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< - * + * * @property */ - -#line 217 "View.MemoryView" PyObject_Free(__pyx_v_self->_shape); /* "View.MemoryView":209 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") - * + * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) */ -#line 209 "View.MemoryView" - - -#line 209 "View.MemoryView" /* function exit code */ - -#line 209 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 209 "View.MemoryView" } /* "View.MemoryView":220 - * + * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() - * + * */ -#line 220 "View.MemoryView" - - -#line 220 "View.MemoryView" /* Python wrapper */ - -#line 220 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 220 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { - -#line 220 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 220 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 220 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 220 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); -#line 220 "View.MemoryView" - - -#line 220 "View.MemoryView" /* function exit code */ - -#line 220 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 220 "View.MemoryView" return __pyx_r; - -#line 220 "View.MemoryView" } -#line 220 "View.MemoryView" - - -#line 220 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { - -#line 220 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 220 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 220 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 220 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":221 * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< - * + * * @cname('get_memview') */ - -#line 221 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 221 "View.MemoryView" __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) - -#line 221 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 221 "View.MemoryView" __pyx_r = __pyx_t_1; - -#line 221 "View.MemoryView" __pyx_t_1 = 0; - -#line 221 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":220 - * + * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() - * + * */ -#line 220 "View.MemoryView" - - -#line 220 "View.MemoryView" /* function exit code */ - -#line 220 "View.MemoryView" __pyx_L1_error:; - -#line 220 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 220 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 220 "View.MemoryView" __pyx_r = NULL; - -#line 220 "View.MemoryView" __pyx_L0:; - -#line 220 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 220 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 220 "View.MemoryView" return __pyx_r; - -#line 220 "View.MemoryView" } /* "View.MemoryView":224 - * + * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) */ -#line 224 "View.MemoryView" - - -#line 224 "View.MemoryView" static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { - int __pyx_v_flags -#line 224 "View.MemoryView" -; - -#line 224 "View.MemoryView" + int __pyx_v_flags; PyObject *__pyx_r = NULL; - -#line 224 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 224 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 224 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 224 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 224 "View.MemoryView" __Pyx_RefNannySetupContext("get_memview", 0); /* "View.MemoryView":225 @@ -16140,656 +8989,298 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< * return memoryview(self, flags, self.dtype_is_object) - * + * */ - -#line 225 "View.MemoryView" __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); /* "View.MemoryView":226 * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< - * + * * def __len__(self): */ - -#line 226 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 226 "View.MemoryView" __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) - -#line 226 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 226 "View.MemoryView" __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) - -#line 226 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 226 "View.MemoryView" __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error) - -#line 226 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 226 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_self)); - -#line 226 "View.MemoryView" __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - -#line 226 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); - -#line 226 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 226 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - -#line 226 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_2); - -#line 226 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); - -#line 226 "View.MemoryView" __pyx_t_1 = 0; - -#line 226 "View.MemoryView" __pyx_t_2 = 0; - -#line 226 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) - -#line 226 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 226 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 226 "View.MemoryView" __pyx_r = __pyx_t_2; - -#line 226 "View.MemoryView" __pyx_t_2 = 0; - -#line 226 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":224 - * + * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) */ -#line 224 "View.MemoryView" - - -#line 224 "View.MemoryView" /* function exit code */ - -#line 224 "View.MemoryView" __pyx_L1_error:; - -#line 224 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 224 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 224 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 224 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 224 "View.MemoryView" __pyx_r = 0; - -#line 224 "View.MemoryView" __pyx_L0:; - -#line 224 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 224 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 224 "View.MemoryView" return __pyx_r; - -#line 224 "View.MemoryView" } /* "View.MemoryView":228 * return memoryview(self, flags, self.dtype_is_object) - * + * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] - * + * */ -#line 228 "View.MemoryView" - - -#line 228 "View.MemoryView" /* Python wrapper */ - -#line 228 "View.MemoryView" static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ - -#line 228 "View.MemoryView" static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { - -#line 228 "View.MemoryView" Py_ssize_t __pyx_r; - -#line 228 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 228 "View.MemoryView" __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = -#line 228 "View.MemoryView" -__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); -#line 228 "View.MemoryView" - - -#line 228 "View.MemoryView" /* function exit code */ - -#line 228 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 228 "View.MemoryView" return __pyx_r; - -#line 228 "View.MemoryView" } -#line 228 "View.MemoryView" - - -#line 228 "View.MemoryView" static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { - -#line 228 "View.MemoryView" Py_ssize_t __pyx_r; - -#line 228 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 228 "View.MemoryView" __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":229 - * + * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< - * + * * def __getattr__(self, attr): */ - -#line 229 "View.MemoryView" __pyx_r = (__pyx_v_self->_shape[0]); - -#line 229 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":228 * return memoryview(self, flags, self.dtype_is_object) - * + * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] - * + * */ -#line 228 "View.MemoryView" - - -#line 228 "View.MemoryView" /* function exit code */ - -#line 228 "View.MemoryView" __pyx_L0:; - -#line 228 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 228 "View.MemoryView" return __pyx_r; - -#line 228 "View.MemoryView" } /* "View.MemoryView":231 * return self._shape[0] - * + * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) - * + * */ -#line 231 "View.MemoryView" - - -#line 231 "View.MemoryView" /* Python wrapper */ - -#line 231 "View.MemoryView" static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ - -#line 231 "View.MemoryView" static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { - -#line 231 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 231 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 231 "View.MemoryView" __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); - __pyx_r = -#line 231 "View.MemoryView" -__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); -#line 231 "View.MemoryView" - - -#line 231 "View.MemoryView" /* function exit code */ - -#line 231 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 231 "View.MemoryView" return __pyx_r; - -#line 231 "View.MemoryView" } -#line 231 "View.MemoryView" - - -#line 231 "View.MemoryView" static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { - -#line 231 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 231 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 231 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 231 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 231 "View.MemoryView" __Pyx_RefNannySetupContext("__getattr__", 0); /* "View.MemoryView":232 - * + * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< - * + * * def __getitem__(self, item): */ - -#line 232 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 232 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - -#line 232 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 232 "View.MemoryView" __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) - -#line 232 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 232 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 232 "View.MemoryView" __pyx_r = __pyx_t_2; - -#line 232 "View.MemoryView" __pyx_t_2 = 0; - -#line 232 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":231 * return self._shape[0] - * + * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) - * + * */ -#line 231 "View.MemoryView" - - -#line 231 "View.MemoryView" /* function exit code */ - -#line 231 "View.MemoryView" __pyx_L1_error:; - -#line 231 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 231 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 231 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 231 "View.MemoryView" __pyx_r = NULL; - -#line 231 "View.MemoryView" __pyx_L0:; - -#line 231 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 231 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 231 "View.MemoryView" return __pyx_r; - -#line 231 "View.MemoryView" } /* "View.MemoryView":234 * return getattr(self.memview, attr) - * + * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] - * + * */ -#line 234 "View.MemoryView" - - -#line 234 "View.MemoryView" /* Python wrapper */ - -#line 234 "View.MemoryView" static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ - -#line 234 "View.MemoryView" static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { - -#line 234 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 234 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 234 "View.MemoryView" __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - __pyx_r = -#line 234 "View.MemoryView" -__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); -#line 234 "View.MemoryView" - - -#line 234 "View.MemoryView" /* function exit code */ - -#line 234 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 234 "View.MemoryView" return __pyx_r; - -#line 234 "View.MemoryView" } -#line 234 "View.MemoryView" - - -#line 234 "View.MemoryView" static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { - -#line 234 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 234 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 234 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 234 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 234 "View.MemoryView" __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":235 - * + * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< - * + * * def __setitem__(self, item, value): */ - -#line 235 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 235 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) - -#line 235 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 235 "View.MemoryView" __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) - -#line 235 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 235 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 235 "View.MemoryView" __pyx_r = __pyx_t_2; - -#line 235 "View.MemoryView" __pyx_t_2 = 0; - -#line 235 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":234 * return getattr(self.memview, attr) - * + * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] - * + * */ -#line 234 "View.MemoryView" - - -#line 234 "View.MemoryView" /* function exit code */ - -#line 234 "View.MemoryView" __pyx_L1_error:; - -#line 234 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 234 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 234 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 234 "View.MemoryView" __pyx_r = NULL; - -#line 234 "View.MemoryView" __pyx_L0:; - -#line 234 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 234 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 234 "View.MemoryView" return __pyx_r; - -#line 234 "View.MemoryView" } /* "View.MemoryView":237 * return self.memview[item] - * + * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value - * + * */ -#line 237 "View.MemoryView" - - -#line 237 "View.MemoryView" /* Python wrapper */ - -#line 237 "View.MemoryView" static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ - -#line 237 "View.MemoryView" static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { - -#line 237 "View.MemoryView" int __pyx_r; - -#line 237 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 237 "View.MemoryView" __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - __pyx_r = -#line 237 "View.MemoryView" -__pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); -#line 237 "View.MemoryView" - - -#line 237 "View.MemoryView" /* function exit code */ - -#line 237 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 237 "View.MemoryView" return __pyx_r; - -#line 237 "View.MemoryView" } -#line 237 "View.MemoryView" - - -#line 237 "View.MemoryView" static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { - -#line 237 "View.MemoryView" int __pyx_r; - -#line 237 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 237 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 237 "View.MemoryView" __Pyx_RefNannySetupContext("__setitem__", 0); /* "View.MemoryView":238 - * + * * def __setitem__(self, item, value): * self.memview[item] = value # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 238 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) - -#line 238 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 238 "View.MemoryView" if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(0, 238, __pyx_L1_error) - -#line 238 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":237 * return self.memview[item] - * + * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value - * + * */ -#line 237 "View.MemoryView" - - -#line 237 "View.MemoryView" /* function exit code */ - -#line 237 "View.MemoryView" __pyx_r = 0; - -#line 237 "View.MemoryView" goto __pyx_L0; - -#line 237 "View.MemoryView" __pyx_L1_error:; - -#line 237 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 237 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 237 "View.MemoryView" __pyx_r = -1; - -#line 237 "View.MemoryView" __pyx_L0:; - -#line 237 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 237 "View.MemoryView" return __pyx_r; - -#line 237 "View.MemoryView" } /* "(tree fragment)":1 @@ -16798,61 +9289,23 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* Python wrapper */ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = -#line 1 "(tree fragment)" -__pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 @@ -16861,20 +9314,10 @@ static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __p * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - -#line 2 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 2 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 2 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 2 "(tree fragment)" __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 @@ -16883,34 +9326,14 @@ static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __p * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 1 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } /* "(tree fragment)":3 @@ -16920,61 +9343,23 @@ static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __p * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* Python wrapper */ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = -#line 3 "(tree fragment)" -__pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 @@ -16982,20 +9367,10 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 4 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 4 "(tree fragment)" __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 @@ -17005,186 +9380,86 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __pyx_L1_error:; - -#line 3 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 3 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 3 "(tree fragment)" __pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } /* "View.MemoryView":242 - * + * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): * cdef array result */ -#line 242 "View.MemoryView" - - -#line 242 "View.MemoryView" static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { - struct __pyx_array_obj *__pyx_v_result = 0 -#line 242 "View.MemoryView" -; - -#line 242 "View.MemoryView" + struct __pyx_array_obj *__pyx_v_result = 0; struct __pyx_array_obj *__pyx_r = NULL; - -#line 242 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 242 "View.MemoryView" int __pyx_t_1; - -#line 242 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 242 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 242 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 242 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 242 "View.MemoryView" __Pyx_RefNannySetupContext("array_cwrapper", 0); /* "View.MemoryView":246 * cdef array result - * + * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: */ - -#line 246 "View.MemoryView" __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); - -#line 246 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":247 - * + * * if buf == NULL: * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), */ - -#line 247 "View.MemoryView" __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) - -#line 247 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 247 "View.MemoryView" __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) - -#line 247 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 247 "View.MemoryView" __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) - -#line 247 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 247 "View.MemoryView" __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) - -#line 247 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 247 "View.MemoryView" __Pyx_INCREF(__pyx_v_shape); - -#line 247 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_shape); - -#line 247 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); - -#line 247 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_2); - -#line 247 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - -#line 247 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 247 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); - -#line 247 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_4); - -#line 247 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); - -#line 247 "View.MemoryView" __pyx_t_2 = 0; - -#line 247 "View.MemoryView" __pyx_t_3 = 0; - -#line 247 "View.MemoryView" __pyx_t_4 = 0; - -#line 247 "View.MemoryView" __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) - -#line 247 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 247 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 247 "View.MemoryView" __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); - -#line 247 "View.MemoryView" __pyx_t_4 = 0; /* "View.MemoryView":246 * cdef array result - * + * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: */ - -#line 246 "View.MemoryView" goto __pyx_L3; - -#line 246 "View.MemoryView" } /* "View.MemoryView":249 @@ -17194,68 +9469,26 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * allocate_buffer=False) * result.data = buf */ - -#line 249 "View.MemoryView" /*else*/ { - -#line 249 "View.MemoryView" __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) - -#line 249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 249 "View.MemoryView" __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error) - -#line 249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 249 "View.MemoryView" __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) - -#line 249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 249 "View.MemoryView" __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) - -#line 249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 249 "View.MemoryView" __Pyx_INCREF(__pyx_v_shape); - -#line 249 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_shape); - -#line 249 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); - -#line 249 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_4); - -#line 249 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); - -#line 249 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_5); - -#line 249 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); - -#line 249 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 249 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); - -#line 249 "View.MemoryView" __pyx_t_4 = 0; - -#line 249 "View.MemoryView" __pyx_t_5 = 0; - -#line 249 "View.MemoryView" __pyx_t_3 = 0; /* "View.MemoryView":250 @@ -17263,16 +9496,10 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf - * + * */ - -#line 250 "View.MemoryView" __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) - -#line 250 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 250 "View.MemoryView" if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 250, __pyx_L1_error) /* "View.MemoryView":249 @@ -17282,113 +9509,57 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * allocate_buffer=False) * result.data = buf */ - -#line 249 "View.MemoryView" __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error) - -#line 249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 249 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 249 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 249 "View.MemoryView" __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); - -#line 249 "View.MemoryView" __pyx_t_5 = 0; /* "View.MemoryView":251 * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< - * + * * return result */ - -#line 251 "View.MemoryView" __pyx_v_result->data = __pyx_v_buf; - -#line 251 "View.MemoryView" } - -#line 251 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":253 * result.data = buf - * + * * return result # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 253 "View.MemoryView" __Pyx_XDECREF(((PyObject *)__pyx_r)); - -#line 253 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_result)); - -#line 253 "View.MemoryView" __pyx_r = __pyx_v_result; - -#line 253 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":242 - * + * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): * cdef array result */ -#line 242 "View.MemoryView" - - -#line 242 "View.MemoryView" /* function exit code */ - -#line 242 "View.MemoryView" __pyx_L1_error:; - -#line 242 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 242 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 242 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); - -#line 242 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 242 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 242 "View.MemoryView" __pyx_r = 0; - -#line 242 "View.MemoryView" __pyx_L0:; - -#line 242 "View.MemoryView" __Pyx_XDECREF((PyObject *)__pyx_v_result); - -#line 242 "View.MemoryView" __Pyx_XGIVEREF((PyObject *)__pyx_r); - -#line 242 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 242 "View.MemoryView" return __pyx_r; - -#line 242 "View.MemoryView" } /* "View.MemoryView":279 @@ -17399,169 +9570,59 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * def __repr__(self): */ -#line 279 "View.MemoryView" - - -#line 279 "View.MemoryView" /* Python wrapper */ - -#line 279 "View.MemoryView" static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 279 "View.MemoryView" static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_name = 0 -#line 279 "View.MemoryView" -; - -#line 279 "View.MemoryView" + PyObject *__pyx_v_name = 0; int __pyx_r; - -#line 279 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 279 "View.MemoryView" __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - -#line 279 "View.MemoryView" { - -#line 279 "View.MemoryView" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; - -#line 279 "View.MemoryView" PyObject* values[1] = {0}; - -#line 279 "View.MemoryView" if (unlikely(__pyx_kwds)) { - -#line 279 "View.MemoryView" Py_ssize_t kw_args; - -#line 279 "View.MemoryView" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 279 "View.MemoryView" switch (pos_args) { - case 1: -#line 279 "View.MemoryView" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 279 "View.MemoryView" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 279 "View.MemoryView" case 0: break; - default: -#line 279 "View.MemoryView" -goto __pyx_L5_argtuple_error; - -#line 279 "View.MemoryView" + default: goto __pyx_L5_argtuple_error; } - -#line 279 "View.MemoryView" kw_args = PyDict_Size(__pyx_kwds); - -#line 279 "View.MemoryView" switch (pos_args) { - -#line 279 "View.MemoryView" case 0: - -#line 279 "View.MemoryView" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; - else -#line 279 "View.MemoryView" -goto __pyx_L5_argtuple_error; - -#line 279 "View.MemoryView" + else goto __pyx_L5_argtuple_error; } - -#line 279 "View.MemoryView" if (unlikely(kw_args > 0)) { - -#line 279 "View.MemoryView" if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 279, __pyx_L3_error) - -#line 279 "View.MemoryView" } - -#line 279 "View.MemoryView" } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - -#line 279 "View.MemoryView" goto __pyx_L5_argtuple_error; - -#line 279 "View.MemoryView" } else { - -#line 279 "View.MemoryView" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 279 "View.MemoryView" } - -#line 279 "View.MemoryView" __pyx_v_name = values[0]; - -#line 279 "View.MemoryView" } - -#line 279 "View.MemoryView" goto __pyx_L4_argument_unpacking_done; - -#line 279 "View.MemoryView" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); -#line 279 "View.MemoryView" -__PYX_ERR(0, 279, __pyx_L3_error) - -#line 279 "View.MemoryView" + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 279, __pyx_L3_error) __pyx_L3_error:; - -#line 279 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 279 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 279 "View.MemoryView" return -1; - -#line 279 "View.MemoryView" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 279 "View.MemoryView" -__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); -#line 279 "View.MemoryView" - - -#line 279 "View.MemoryView" /* function exit code */ - -#line 279 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 279 "View.MemoryView" return __pyx_r; - -#line 279 "View.MemoryView" } -#line 279 "View.MemoryView" - - -#line 279 "View.MemoryView" static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { - -#line 279 "View.MemoryView" int __pyx_r; - -#line 279 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 279 "View.MemoryView" __Pyx_RefNannySetupContext("__init__", 0); /* "View.MemoryView":280 @@ -17571,20 +9632,10 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc * def __repr__(self): * return self.name */ - -#line 280 "View.MemoryView" __Pyx_INCREF(__pyx_v_name); - -#line 280 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_name); - -#line 280 "View.MemoryView" __Pyx_GOTREF(__pyx_v_self->name); - -#line 280 "View.MemoryView" __Pyx_DECREF(__pyx_v_self->name); - -#line 280 "View.MemoryView" __pyx_v_self->name = __pyx_v_name; /* "View.MemoryView":279 @@ -17595,22 +9646,10 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc * def __repr__(self): */ -#line 279 "View.MemoryView" - - -#line 279 "View.MemoryView" /* function exit code */ - -#line 279 "View.MemoryView" __pyx_r = 0; - -#line 279 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 279 "View.MemoryView" return __pyx_r; - -#line 279 "View.MemoryView" } /* "View.MemoryView":281 @@ -17618,81 +9657,37 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name - * + * */ -#line 281 "View.MemoryView" - - -#line 281 "View.MemoryView" /* Python wrapper */ - -#line 281 "View.MemoryView" static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ - -#line 281 "View.MemoryView" static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { - -#line 281 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 281 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 281 "View.MemoryView" __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = -#line 281 "View.MemoryView" -__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); -#line 281 "View.MemoryView" - - -#line 281 "View.MemoryView" /* function exit code */ - -#line 281 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 281 "View.MemoryView" return __pyx_r; - -#line 281 "View.MemoryView" } -#line 281 "View.MemoryView" - - -#line 281 "View.MemoryView" static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { - -#line 281 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 281 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 281 "View.MemoryView" __Pyx_RefNannySetupContext("__repr__", 0); /* "View.MemoryView":282 * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< - * + * * cdef generic = Enum("") */ - -#line 282 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 282 "View.MemoryView" __Pyx_INCREF(__pyx_v_self->name); - -#line 282 "View.MemoryView" __pyx_r = __pyx_v_self->name; - -#line 282 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":281 @@ -17700,28 +9695,14 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name - * + * */ -#line 281 "View.MemoryView" - - -#line 281 "View.MemoryView" /* function exit code */ - -#line 281 "View.MemoryView" __pyx_L0:; - -#line 281 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 281 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 281 "View.MemoryView" return __pyx_r; - -#line 281 "View.MemoryView" } /* "(tree fragment)":1 @@ -17730,82 +9711,30 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ * state = (self.name,) */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* Python wrapper */ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = -#line 1 "(tree fragment)" -__pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { - int __pyx_v_use_setstate -#line 1 "(tree fragment)" -; - PyObject *__pyx_v_state = NULL -#line 1 "(tree fragment)" -; - PyObject *__pyx_v__dict = NULL -#line 1 "(tree fragment)" -; - -#line 1 "(tree fragment)" + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; PyObject *__pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 1 "(tree fragment)" int __pyx_t_2; - -#line 1 "(tree fragment)" int __pyx_t_3; - -#line 1 "(tree fragment)" PyObject *__pyx_t_4 = NULL; - -#line 1 "(tree fragment)" PyObject *__pyx_t_5 = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":3 @@ -17815,26 +9744,12 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ - -#line 3 "(tree fragment)" __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) - -#line 3 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 3 "(tree fragment)" __Pyx_INCREF(__pyx_v_self->name); - -#line 3 "(tree fragment)" __Pyx_GIVEREF(__pyx_v_self->name); - -#line 3 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); - -#line 3 "(tree fragment)" __pyx_v_state = ((PyObject*)__pyx_t_1); - -#line 3 "(tree fragment)" __pyx_t_1 = 0; /* "(tree fragment)":4 @@ -17844,17 +9759,9 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * if _dict is not None: * state += (_dict,) */ - -#line 4 "(tree fragment)" __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 4 "(tree fragment)" __pyx_v__dict = __pyx_t_1; - -#line 4 "(tree fragment)" __pyx_t_1 = 0; /* "(tree fragment)":5 @@ -17864,14 +9771,8 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * state += (_dict,) * use_setstate = True */ - -#line 5 "(tree fragment)" __pyx_t_2 = (__pyx_v__dict != Py_None); - -#line 5 "(tree fragment)" __pyx_t_3 = (__pyx_t_2 != 0); - -#line 5 "(tree fragment)" if (__pyx_t_3) { /* "(tree fragment)":6 @@ -17881,35 +9782,15 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * use_setstate = True * else: */ - -#line 6 "(tree fragment)" __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) - -#line 6 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 6 "(tree fragment)" __Pyx_INCREF(__pyx_v__dict); - -#line 6 "(tree fragment)" __Pyx_GIVEREF(__pyx_v__dict); - -#line 6 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); - -#line 6 "(tree fragment)" __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) - -#line 6 "(tree fragment)" __Pyx_GOTREF(__pyx_t_4); - -#line 6 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 6 "(tree fragment)" __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); - -#line 6 "(tree fragment)" __pyx_t_4 = 0; /* "(tree fragment)":7 @@ -17919,8 +9800,6 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * else: * use_setstate = self.name is not None */ - -#line 7 "(tree fragment)" __pyx_v_use_setstate = 1; /* "(tree fragment)":5 @@ -17930,11 +9809,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * state += (_dict,) * use_setstate = True */ - -#line 5 "(tree fragment)" goto __pyx_L3; - -#line 5 "(tree fragment)" } /* "(tree fragment)":9 @@ -17944,20 +9819,10 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * if use_setstate: * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state */ - -#line 9 "(tree fragment)" /*else*/ { - -#line 9 "(tree fragment)" __pyx_t_3 = (__pyx_v_self->name != Py_None); - -#line 9 "(tree fragment)" __pyx_v_use_setstate = __pyx_t_3; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" __pyx_L3:; /* "(tree fragment)":10 @@ -17967,11 +9832,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state * else: */ - -#line 10 "(tree fragment)" __pyx_t_3 = (__pyx_v_use_setstate != 0); - -#line 10 "(tree fragment)" if (__pyx_t_3) { /* "(tree fragment)":11 @@ -17981,89 +9842,33 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * else: * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) */ - -#line 11 "(tree fragment)" __Pyx_XDECREF(__pyx_r); - -#line 11 "(tree fragment)" __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) - -#line 11 "(tree fragment)" __Pyx_GOTREF(__pyx_t_4); - -#line 11 "(tree fragment)" __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) - -#line 11 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 11 "(tree fragment)" __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - -#line 11 "(tree fragment)" __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - -#line 11 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - -#line 11 "(tree fragment)" __Pyx_INCREF(__pyx_int_184977713); - -#line 11 "(tree fragment)" __Pyx_GIVEREF(__pyx_int_184977713); - -#line 11 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); - -#line 11 "(tree fragment)" __Pyx_INCREF(Py_None); - -#line 11 "(tree fragment)" __Pyx_GIVEREF(Py_None); - -#line 11 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); - -#line 11 "(tree fragment)" __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 11, __pyx_L1_error) - -#line 11 "(tree fragment)" __Pyx_GOTREF(__pyx_t_5); - -#line 11 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_4); - -#line 11 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - -#line 11 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_1); - -#line 11 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); - -#line 11 "(tree fragment)" __Pyx_INCREF(__pyx_v_state); - -#line 11 "(tree fragment)" __Pyx_GIVEREF(__pyx_v_state); - -#line 11 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - -#line 11 "(tree fragment)" __pyx_t_4 = 0; - -#line 11 "(tree fragment)" __pyx_t_1 = 0; - -#line 11 "(tree fragment)" __pyx_r = __pyx_t_5; - -#line 11 "(tree fragment)" __pyx_t_5 = 0; - -#line 11 "(tree fragment)" goto __pyx_L0; /* "(tree fragment)":10 @@ -18073,8 +9878,6 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state * else: */ - -#line 10 "(tree fragment)" } /* "(tree fragment)":13 @@ -18084,86 +9887,32 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ - -#line 13 "(tree fragment)" /*else*/ { - -#line 13 "(tree fragment)" __Pyx_XDECREF(__pyx_r); - -#line 13 "(tree fragment)" __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error) - -#line 13 "(tree fragment)" __Pyx_GOTREF(__pyx_t_5); - -#line 13 "(tree fragment)" __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) - -#line 13 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 13 "(tree fragment)" __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - -#line 13 "(tree fragment)" __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - -#line 13 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - -#line 13 "(tree fragment)" __Pyx_INCREF(__pyx_int_184977713); - -#line 13 "(tree fragment)" __Pyx_GIVEREF(__pyx_int_184977713); - -#line 13 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); - -#line 13 "(tree fragment)" __Pyx_INCREF(__pyx_v_state); - -#line 13 "(tree fragment)" __Pyx_GIVEREF(__pyx_v_state); - -#line 13 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); - -#line 13 "(tree fragment)" __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error) - -#line 13 "(tree fragment)" __Pyx_GOTREF(__pyx_t_4); - -#line 13 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_5); - -#line 13 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); - -#line 13 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_1); - -#line 13 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); - -#line 13 "(tree fragment)" __pyx_t_5 = 0; - -#line 13 "(tree fragment)" __pyx_t_1 = 0; - -#line 13 "(tree fragment)" __pyx_r = __pyx_t_4; - -#line 13 "(tree fragment)" __pyx_t_4 = 0; - -#line 13 "(tree fragment)" goto __pyx_L0; - -#line 13 "(tree fragment)" } /* "(tree fragment)":1 @@ -18172,49 +9921,19 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * state = (self.name,) */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_4); - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_5); - -#line 1 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __pyx_r = NULL; - -#line 1 "(tree fragment)" __pyx_L0:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_v_state); - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_v__dict); - -#line 1 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } /* "(tree fragment)":14 @@ -18224,61 +9943,23 @@ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_Memvi * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ -#line 14 "(tree fragment)" - - -#line 14 "(tree fragment)" /* Python wrapper */ - -#line 14 "(tree fragment)" static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ - -#line 14 "(tree fragment)" static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - -#line 14 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 14 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 14 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = -#line 14 "(tree fragment)" -__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); -#line 14 "(tree fragment)" - - -#line 14 "(tree fragment)" /* function exit code */ - -#line 14 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 14 "(tree fragment)" return __pyx_r; - -#line 14 "(tree fragment)" } -#line 14 "(tree fragment)" - - -#line 14 "(tree fragment)" static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - -#line 14 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 14 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 14 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 14 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":15 @@ -18286,17 +9967,9 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - -#line 15 "(tree fragment)" if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 15, __pyx_L1_error) - -#line 15 "(tree fragment)" __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) - -#line 15 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 15 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":14 @@ -18306,69 +9979,31 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ -#line 14 "(tree fragment)" - - -#line 14 "(tree fragment)" /* function exit code */ - -#line 14 "(tree fragment)" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 14 "(tree fragment)" goto __pyx_L0; - -#line 14 "(tree fragment)" __pyx_L1_error:; - -#line 14 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 14 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 14 "(tree fragment)" __pyx_r = NULL; - -#line 14 "(tree fragment)" __pyx_L0:; - -#line 14 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 14 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 14 "(tree fragment)" return __pyx_r; - -#line 14 "(tree fragment)" } /* "View.MemoryView":296 - * + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory */ -#line 296 "View.MemoryView" - - -#line 296 "View.MemoryView" static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { - Py_intptr_t __pyx_v_aligned_p -#line 296 "View.MemoryView" -; - size_t __pyx_v_offset -#line 296 "View.MemoryView" -; - -#line 296 "View.MemoryView" + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; void *__pyx_r; - -#line 296 "View.MemoryView" int __pyx_t_1; /* "View.MemoryView":298 @@ -18376,389 +10011,177 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< * cdef size_t offset - * + * */ - -#line 298 "View.MemoryView" __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); /* "View.MemoryView":302 - * + * * with cython.cdivision(True): * offset = aligned_p % alignment # <<<<<<<<<<<<<< - * + * * if offset > 0: */ - -#line 302 "View.MemoryView" __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); /* "View.MemoryView":304 * offset = aligned_p % alignment - * + * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset - * + * */ - -#line 304 "View.MemoryView" __pyx_t_1 = ((__pyx_v_offset > 0) != 0); - -#line 304 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":305 - * + * * if offset > 0: * aligned_p += alignment - offset # <<<<<<<<<<<<<< - * + * * return aligned_p */ - -#line 305 "View.MemoryView" __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); /* "View.MemoryView":304 * offset = aligned_p % alignment - * + * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset - * + * */ - -#line 304 "View.MemoryView" } /* "View.MemoryView":307 * aligned_p += alignment - offset - * + * * return aligned_p # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 307 "View.MemoryView" __pyx_r = ((void *)__pyx_v_aligned_p); - -#line 307 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":296 - * + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory */ -#line 296 "View.MemoryView" - - -#line 296 "View.MemoryView" /* function exit code */ - -#line 296 "View.MemoryView" __pyx_L0:; - -#line 296 "View.MemoryView" return __pyx_r; - -#line 296 "View.MemoryView" } /* "View.MemoryView":343 * cdef __Pyx_TypeInfo *typeinfo - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags */ -#line 343 "View.MemoryView" - - -#line 343 "View.MemoryView" /* Python wrapper */ - -#line 343 "View.MemoryView" static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ - -#line 343 "View.MemoryView" static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_obj = 0 -#line 343 "View.MemoryView" -; - int __pyx_v_flags -#line 343 "View.MemoryView" -; - int __pyx_v_dtype_is_object -#line 343 "View.MemoryView" -; - -#line 343 "View.MemoryView" + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; int __pyx_r; - -#line 343 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 343 "View.MemoryView" __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - -#line 343 "View.MemoryView" { - -#line 343 "View.MemoryView" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; - -#line 343 "View.MemoryView" PyObject* values[3] = {0,0,0}; - -#line 343 "View.MemoryView" if (unlikely(__pyx_kwds)) { - -#line 343 "View.MemoryView" Py_ssize_t kw_args; - -#line 343 "View.MemoryView" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 343 "View.MemoryView" switch (pos_args) { - case 3: -#line 343 "View.MemoryView" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 343 "View.MemoryView" + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: -#line 343 "View.MemoryView" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 343 "View.MemoryView" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 343 "View.MemoryView" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 343 "View.MemoryView" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 343 "View.MemoryView" case 0: break; - default: -#line 343 "View.MemoryView" -goto __pyx_L5_argtuple_error; - -#line 343 "View.MemoryView" + default: goto __pyx_L5_argtuple_error; } - -#line 343 "View.MemoryView" kw_args = PyDict_Size(__pyx_kwds); - -#line 343 "View.MemoryView" switch (pos_args) { - -#line 343 "View.MemoryView" case 0: - -#line 343 "View.MemoryView" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; - else -#line 343 "View.MemoryView" -goto __pyx_L5_argtuple_error; - -#line 343 "View.MemoryView" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 343 "View.MemoryView" case 1: - -#line 343 "View.MemoryView" if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; - -#line 343 "View.MemoryView" else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); -#line 343 "View.MemoryView" -__PYX_ERR(0, 343, __pyx_L3_error) - -#line 343 "View.MemoryView" + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 343, __pyx_L3_error) } - -#line 343 "View.MemoryView" CYTHON_FALLTHROUGH; - -#line 343 "View.MemoryView" case 2: - -#line 343 "View.MemoryView" if (kw_args > 0) { - -#line 343 "View.MemoryView" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); - -#line 343 "View.MemoryView" if (value) { values[2] = value; kw_args--; } - -#line 343 "View.MemoryView" } - -#line 343 "View.MemoryView" } - -#line 343 "View.MemoryView" if (unlikely(kw_args > 0)) { - -#line 343 "View.MemoryView" if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 343, __pyx_L3_error) - -#line 343 "View.MemoryView" } - -#line 343 "View.MemoryView" } else { - -#line 343 "View.MemoryView" switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: -#line 343 "View.MemoryView" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 343 "View.MemoryView" + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: -#line 343 "View.MemoryView" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 343 "View.MemoryView" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 343 "View.MemoryView" break; - default: -#line 343 "View.MemoryView" -goto __pyx_L5_argtuple_error; - -#line 343 "View.MemoryView" + default: goto __pyx_L5_argtuple_error; } - -#line 343 "View.MemoryView" } - -#line 343 "View.MemoryView" __pyx_v_obj = values[0]; - -#line 343 "View.MemoryView" __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error) - -#line 343 "View.MemoryView" if (values[2]) { - -#line 343 "View.MemoryView" __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error) - -#line 343 "View.MemoryView" } else { - -#line 343 "View.MemoryView" __pyx_v_dtype_is_object = ((int)0); - -#line 343 "View.MemoryView" } - -#line 343 "View.MemoryView" } - -#line 343 "View.MemoryView" goto __pyx_L4_argument_unpacking_done; - -#line 343 "View.MemoryView" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); -#line 343 "View.MemoryView" -__PYX_ERR(0, 343, __pyx_L3_error) - -#line 343 "View.MemoryView" + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error) __pyx_L3_error:; - -#line 343 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 343 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 343 "View.MemoryView" return -1; - -#line 343 "View.MemoryView" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 343 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); -#line 343 "View.MemoryView" - - -#line 343 "View.MemoryView" /* function exit code */ - -#line 343 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 343 "View.MemoryView" return __pyx_r; - -#line 343 "View.MemoryView" } -#line 343 "View.MemoryView" - - -#line 343 "View.MemoryView" static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { - -#line 343 "View.MemoryView" int __pyx_r; - -#line 343 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 343 "View.MemoryView" int __pyx_t_1; - -#line 343 "View.MemoryView" int __pyx_t_2; - -#line 343 "View.MemoryView" int __pyx_t_3; - -#line 343 "View.MemoryView" int __pyx_t_4; - -#line 343 "View.MemoryView" __Pyx_RefNannySetupContext("__cinit__", 0); /* "View.MemoryView":344 - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< * self.flags = flags * if type(self) is memoryview or obj is not None: */ - -#line 344 "View.MemoryView" __Pyx_INCREF(__pyx_v_obj); - -#line 344 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_obj); - -#line 344 "View.MemoryView" __Pyx_GOTREF(__pyx_v_self->obj); - -#line 344 "View.MemoryView" __Pyx_DECREF(__pyx_v_self->obj); - -#line 344 "View.MemoryView" __pyx_v_self->obj = __pyx_v_obj; /* "View.MemoryView":345 @@ -18768,8 +10191,6 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) */ - -#line 345 "View.MemoryView" __pyx_v_self->flags = __pyx_v_flags; /* "View.MemoryView":346 @@ -18779,41 +10200,17 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: */ - -#line 346 "View.MemoryView" __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); - -#line 346 "View.MemoryView" __pyx_t_3 = (__pyx_t_2 != 0); - -#line 346 "View.MemoryView" if (!__pyx_t_3) { - -#line 346 "View.MemoryView" } else { - -#line 346 "View.MemoryView" __pyx_t_1 = __pyx_t_3; - -#line 346 "View.MemoryView" goto __pyx_L4_bool_binop_done; - -#line 346 "View.MemoryView" } - -#line 346 "View.MemoryView" __pyx_t_3 = (__pyx_v_obj != Py_None); - -#line 346 "View.MemoryView" __pyx_t_2 = (__pyx_t_3 != 0); - -#line 346 "View.MemoryView" __pyx_t_1 = __pyx_t_2; - -#line 346 "View.MemoryView" __pyx_L4_bool_binop_done:; - -#line 346 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":347 @@ -18823,8 +10220,6 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None */ - -#line 347 "View.MemoryView" __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 347, __pyx_L1_error) /* "View.MemoryView":348 @@ -18834,11 +10229,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) */ - -#line 348 "View.MemoryView" __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); - -#line 348 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":349 @@ -18846,21 +10237,17 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ - -#line 349 "View.MemoryView" ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; /* "View.MemoryView":350 * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * global __pyx_memoryview_thread_locks_used */ - -#line 350 "View.MemoryView" Py_INCREF(Py_None); /* "View.MemoryView":348 @@ -18870,8 +10257,6 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) */ - -#line 348 "View.MemoryView" } /* "View.MemoryView":346 @@ -18881,22 +10266,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: */ - -#line 346 "View.MemoryView" } /* "View.MemoryView":353 - * + * * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 */ - -#line 353 "View.MemoryView" __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); - -#line 353 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":354 @@ -18906,8 +10285,6 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: */ - -#line 354 "View.MemoryView" __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); /* "View.MemoryView":355 @@ -18917,19 +10294,15 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.lock is NULL: * self.lock = PyThread_allocate_lock() */ - -#line 355 "View.MemoryView" __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); /* "View.MemoryView":353 - * + * * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 */ - -#line 353 "View.MemoryView" } /* "View.MemoryView":356 @@ -18939,11 +10312,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: */ - -#line 356 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - -#line 356 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":357 @@ -18953,8 +10322,6 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.lock is NULL: * raise MemoryError */ - -#line 357 "View.MemoryView" __pyx_v_self->lock = PyThread_allocate_lock(); /* "View.MemoryView":358 @@ -18962,24 +10329,18 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError - * + * */ - -#line 358 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - -#line 358 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":359 * self.lock = PyThread_allocate_lock() * if self.lock is NULL: * raise MemoryError # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ - -#line 359 "View.MemoryView" PyErr_NoMemory(); __PYX_ERR(0, 359, __pyx_L1_error) /* "View.MemoryView":358 @@ -18987,10 +10348,8 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError - * + * */ - -#line 358 "View.MemoryView" } /* "View.MemoryView":356 @@ -19000,270 +10359,152 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: */ - -#line 356 "View.MemoryView" } /* "View.MemoryView":361 * raise MemoryError - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ - -#line 361 "View.MemoryView" __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - -#line 361 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":362 - * + * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< * else: * self.dtype_is_object = dtype_is_object */ - -#line 362 "View.MemoryView" __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); - -#line 362 "View.MemoryView" if (__pyx_t_2) { - -#line 362 "View.MemoryView" } else { - -#line 362 "View.MemoryView" __pyx_t_1 = __pyx_t_2; - -#line 362 "View.MemoryView" goto __pyx_L11_bool_binop_done; - -#line 362 "View.MemoryView" } - -#line 362 "View.MemoryView" __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); - -#line 362 "View.MemoryView" __pyx_t_1 = __pyx_t_2; - -#line 362 "View.MemoryView" __pyx_L11_bool_binop_done:; - -#line 362 "View.MemoryView" __pyx_v_self->dtype_is_object = __pyx_t_1; /* "View.MemoryView":361 * raise MemoryError - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ - -#line 361 "View.MemoryView" goto __pyx_L10; - -#line 361 "View.MemoryView" } /* "View.MemoryView":364 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< - * + * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( */ - -#line 364 "View.MemoryView" /*else*/ { - -#line 364 "View.MemoryView" __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; - -#line 364 "View.MemoryView" } - -#line 364 "View.MemoryView" __pyx_L10:; /* "View.MemoryView":366 * self.dtype_is_object = dtype_is_object - * + * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL */ - -#line 366 "View.MemoryView" __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); /* "View.MemoryView":368 * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL # <<<<<<<<<<<<<< - * + * * def __dealloc__(memoryview self): */ - -#line 368 "View.MemoryView" __pyx_v_self->typeinfo = NULL; /* "View.MemoryView":343 * cdef __Pyx_TypeInfo *typeinfo - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags */ -#line 343 "View.MemoryView" - - -#line 343 "View.MemoryView" /* function exit code */ - -#line 343 "View.MemoryView" __pyx_r = 0; - -#line 343 "View.MemoryView" goto __pyx_L0; - -#line 343 "View.MemoryView" __pyx_L1_error:; - -#line 343 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 343 "View.MemoryView" __pyx_r = -1; - -#line 343 "View.MemoryView" __pyx_L0:; - -#line 343 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 343 "View.MemoryView" return __pyx_r; - -#line 343 "View.MemoryView" } /* "View.MemoryView":370 * self.typeinfo = NULL - * + * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) */ -#line 370 "View.MemoryView" - - -#line 370 "View.MemoryView" /* Python wrapper */ - -#line 370 "View.MemoryView" static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ - -#line 370 "View.MemoryView" static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { - -#line 370 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 370 "View.MemoryView" __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - -#line 370 "View.MemoryView" __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 370 "View.MemoryView" - - -#line 370 "View.MemoryView" /* function exit code */ - -#line 370 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 370 "View.MemoryView" } -#line 370 "View.MemoryView" - - -#line 370 "View.MemoryView" static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { - int __pyx_v_i -#line 370 "View.MemoryView" -; - -#line 370 "View.MemoryView" + int __pyx_v_i; __Pyx_RefNannyDeclarations - -#line 370 "View.MemoryView" int __pyx_t_1; - -#line 370 "View.MemoryView" int __pyx_t_2; - -#line 370 "View.MemoryView" int __pyx_t_3; - -#line 370 "View.MemoryView" int __pyx_t_4; - -#line 370 "View.MemoryView" PyThread_type_lock __pyx_t_5; - -#line 370 "View.MemoryView" PyThread_type_lock __pyx_t_6; - -#line 370 "View.MemoryView" __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":371 - * + * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) - * + * */ - -#line 371 "View.MemoryView" __pyx_t_1 = (__pyx_v_self->obj != Py_None); - -#line 371 "View.MemoryView" __pyx_t_2 = (__pyx_t_1 != 0); - -#line 371 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":372 * def __dealloc__(memoryview self): * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< - * + * * cdef int i */ - -#line 372 "View.MemoryView" __Pyx_ReleaseBuffer((&__pyx_v_self->view)); /* "View.MemoryView":371 - * + * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) - * + * */ - -#line 371 "View.MemoryView" } /* "View.MemoryView":376 @@ -19273,11 +10514,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: */ - -#line 376 "View.MemoryView" __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); - -#line 376 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":377 @@ -19287,14 +10524,8 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 */ - -#line 377 "View.MemoryView" __pyx_t_3 = __pyx_memoryview_thread_locks_used; - -#line 377 "View.MemoryView" for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - -#line 377 "View.MemoryView" __pyx_v_i = __pyx_t_4; /* "View.MemoryView":378 @@ -19304,11 +10535,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: */ - -#line 378 "View.MemoryView" __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); - -#line 378 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":379 @@ -19318,8 +10545,6 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( */ - -#line 379 "View.MemoryView" __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); /* "View.MemoryView":380 @@ -19329,11 +10554,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ - -#line 380 "View.MemoryView" __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); - -#line 380 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":382 @@ -19343,11 +10564,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * break * else: */ - -#line 382 "View.MemoryView" __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - -#line 382 "View.MemoryView" __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]); /* "View.MemoryView":381 @@ -19357,11 +10574,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break */ - -#line 381 "View.MemoryView" (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5; - -#line 381 "View.MemoryView" (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6; /* "View.MemoryView":380 @@ -19371,8 +10584,6 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ - -#line 380 "View.MemoryView" } /* "View.MemoryView":383 @@ -19382,8 +10593,6 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * else: * PyThread_free_lock(self.lock) */ - -#line 383 "View.MemoryView" goto __pyx_L6_break; /* "View.MemoryView":378 @@ -19393,31 +10602,19 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: */ - -#line 378 "View.MemoryView" } - -#line 378 "View.MemoryView" } - -#line 378 "View.MemoryView" /*else*/ { /* "View.MemoryView":385 * break * else: * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: */ - -#line 385 "View.MemoryView" PyThread_free_lock(__pyx_v_self->lock); - -#line 385 "View.MemoryView" } - -#line 385 "View.MemoryView" __pyx_L6_break:; /* "View.MemoryView":376 @@ -19427,579 +10624,271 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: */ - -#line 376 "View.MemoryView" } /* "View.MemoryView":370 * self.typeinfo = NULL - * + * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) */ -#line 370 "View.MemoryView" - - -#line 370 "View.MemoryView" /* function exit code */ - -#line 370 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 370 "View.MemoryView" } /* "View.MemoryView":387 * PyThread_free_lock(self.lock) - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf */ -#line 387 "View.MemoryView" - - -#line 387 "View.MemoryView" static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { - Py_ssize_t __pyx_v_dim -#line 387 "View.MemoryView" -; - char *__pyx_v_itemp -#line 387 "View.MemoryView" -; - PyObject *__pyx_v_idx = NULL -#line 387 "View.MemoryView" -; - -#line 387 "View.MemoryView" + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; char *__pyx_r; - -#line 387 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 387 "View.MemoryView" Py_ssize_t __pyx_t_1; - -#line 387 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 387 "View.MemoryView" Py_ssize_t __pyx_t_3; - -#line 387 "View.MemoryView" PyObject *(*__pyx_t_4)(PyObject *); - -#line 387 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 387 "View.MemoryView" Py_ssize_t __pyx_t_6; - -#line 387 "View.MemoryView" char *__pyx_t_7; - -#line 387 "View.MemoryView" __Pyx_RefNannySetupContext("get_item_pointer", 0); /* "View.MemoryView":389 * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< - * + * * for dim, idx in enumerate(index): */ - -#line 389 "View.MemoryView" __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); /* "View.MemoryView":391 * cdef char *itemp = self.view.buf - * + * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * */ - -#line 391 "View.MemoryView" __pyx_t_1 = 0; - -#line 391 "View.MemoryView" if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { - -#line 391 "View.MemoryView" __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - -#line 391 "View.MemoryView" __pyx_t_4 = NULL; - -#line 391 "View.MemoryView" } else { - __pyx_t_3 = -1; -#line 391 "View.MemoryView" -__pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) - -#line 391 "View.MemoryView" + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 391 "View.MemoryView" __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) - -#line 391 "View.MemoryView" } - -#line 391 "View.MemoryView" for (;;) { - -#line 391 "View.MemoryView" if (likely(!__pyx_t_4)) { - -#line 391 "View.MemoryView" if (likely(PyList_CheckExact(__pyx_t_2))) { - -#line 391 "View.MemoryView" if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - -#line 391 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 391 "View.MemoryView" __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, 391, __pyx_L1_error) - -#line 391 "View.MemoryView" #else - -#line 391 "View.MemoryView" __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) - -#line 391 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 391 "View.MemoryView" #endif - -#line 391 "View.MemoryView" } else { - -#line 391 "View.MemoryView" if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - -#line 391 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 391 "View.MemoryView" __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, 391, __pyx_L1_error) - -#line 391 "View.MemoryView" #else - -#line 391 "View.MemoryView" __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) - -#line 391 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 391 "View.MemoryView" #endif - -#line 391 "View.MemoryView" } - } else -#line 391 "View.MemoryView" -{ - -#line 391 "View.MemoryView" + } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); - -#line 391 "View.MemoryView" if (unlikely(!__pyx_t_5)) { - -#line 391 "View.MemoryView" PyObject* exc_type = PyErr_Occurred(); - -#line 391 "View.MemoryView" if (exc_type) { - -#line 391 "View.MemoryView" if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - -#line 391 "View.MemoryView" else __PYX_ERR(0, 391, __pyx_L1_error) - -#line 391 "View.MemoryView" } - -#line 391 "View.MemoryView" break; - -#line 391 "View.MemoryView" } - -#line 391 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 391 "View.MemoryView" } - -#line 391 "View.MemoryView" __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); - -#line 391 "View.MemoryView" __pyx_t_5 = 0; - -#line 391 "View.MemoryView" __pyx_v_dim = __pyx_t_1; - -#line 391 "View.MemoryView" __pyx_t_1 = (__pyx_t_1 + 1); /* "View.MemoryView":392 - * + * * for dim, idx in enumerate(index): * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< - * + * * return itemp */ - -#line 392 "View.MemoryView" __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) - -#line 392 "View.MemoryView" __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(0, 392, __pyx_L1_error) - -#line 392 "View.MemoryView" __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":391 * cdef char *itemp = self.view.buf - * + * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * */ - -#line 391 "View.MemoryView" } - -#line 391 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":394 * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * * return itemp # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 394 "View.MemoryView" __pyx_r = __pyx_v_itemp; - -#line 394 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":387 * PyThread_free_lock(self.lock) - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf */ -#line 387 "View.MemoryView" - - -#line 387 "View.MemoryView" /* function exit code */ - -#line 387 "View.MemoryView" __pyx_L1_error:; - -#line 387 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 387 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 387 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 387 "View.MemoryView" __pyx_r = NULL; - -#line 387 "View.MemoryView" __pyx_L0:; - -#line 387 "View.MemoryView" __Pyx_XDECREF(__pyx_v_idx); - -#line 387 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 387 "View.MemoryView" return __pyx_r; - -#line 387 "View.MemoryView" } /* "View.MemoryView":397 - * - * + * + * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self */ -#line 397 "View.MemoryView" - - -#line 397 "View.MemoryView" /* Python wrapper */ - -#line 397 "View.MemoryView" static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ - -#line 397 "View.MemoryView" static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { - -#line 397 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 397 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 397 "View.MemoryView" __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - __pyx_r = -#line 397 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); -#line 397 "View.MemoryView" - - -#line 397 "View.MemoryView" /* function exit code */ - -#line 397 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 397 "View.MemoryView" return __pyx_r; - -#line 397 "View.MemoryView" } -#line 397 "View.MemoryView" - - -#line 397 "View.MemoryView" static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { - PyObject *__pyx_v_have_slices = NULL -#line 397 "View.MemoryView" -; - PyObject *__pyx_v_indices = NULL -#line 397 "View.MemoryView" -; - char *__pyx_v_itemp -#line 397 "View.MemoryView" -; - -#line 397 "View.MemoryView" + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; PyObject *__pyx_r = NULL; - -#line 397 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 397 "View.MemoryView" int __pyx_t_1; - -#line 397 "View.MemoryView" int __pyx_t_2; - -#line 397 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 397 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 397 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 397 "View.MemoryView" char *__pyx_t_6; - -#line 397 "View.MemoryView" __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":398 - * + * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self - * + * */ - -#line 398 "View.MemoryView" __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); - -#line 398 "View.MemoryView" __pyx_t_2 = (__pyx_t_1 != 0); - -#line 398 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":399 * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< - * + * * have_slices, indices = _unellipsify(index, self.view.ndim) */ - -#line 399 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 399 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_self)); - -#line 399 "View.MemoryView" __pyx_r = ((PyObject *)__pyx_v_self); - -#line 399 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":398 - * + * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self - * + * */ - -#line 398 "View.MemoryView" } /* "View.MemoryView":401 * return self - * + * * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< - * + * * cdef char *itemp */ - -#line 401 "View.MemoryView" __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) - -#line 401 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 401 "View.MemoryView" if (likely(__pyx_t_3 != Py_None)) { - -#line 401 "View.MemoryView" PyObject* sequence = __pyx_t_3; - -#line 401 "View.MemoryView" #if !CYTHON_COMPILING_IN_PYPY - -#line 401 "View.MemoryView" Py_ssize_t size = Py_SIZE(sequence); - -#line 401 "View.MemoryView" #else - -#line 401 "View.MemoryView" Py_ssize_t size = PySequence_Size(sequence); - -#line 401 "View.MemoryView" #endif - -#line 401 "View.MemoryView" if (unlikely(size != 2)) { - -#line 401 "View.MemoryView" if (size > 2) __Pyx_RaiseTooManyValuesError(2); - -#line 401 "View.MemoryView" else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - -#line 401 "View.MemoryView" __PYX_ERR(0, 401, __pyx_L1_error) - -#line 401 "View.MemoryView" } - -#line 401 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 401 "View.MemoryView" - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - -#line 401 "View.MemoryView" - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); - -#line 401 "View.MemoryView" + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); - -#line 401 "View.MemoryView" __Pyx_INCREF(__pyx_t_5); - -#line 401 "View.MemoryView" #else - -#line 401 "View.MemoryView" __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) - -#line 401 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 401 "View.MemoryView" __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L1_error) - -#line 401 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 401 "View.MemoryView" #endif - -#line 401 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 401 "View.MemoryView" } else { - -#line 401 "View.MemoryView" __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 401, __pyx_L1_error) - -#line 401 "View.MemoryView" } - -#line 401 "View.MemoryView" __pyx_v_have_slices = __pyx_t_4; - -#line 401 "View.MemoryView" __pyx_t_4 = 0; - -#line 401 "View.MemoryView" __pyx_v_indices = __pyx_t_5; - -#line 401 "View.MemoryView" __pyx_t_5 = 0; /* "View.MemoryView":404 - * + * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ - -#line 404 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 404, __pyx_L1_error) - -#line 404 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":405 @@ -20009,34 +10898,20 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * else: * itemp = self.get_item_pointer(indices) */ - -#line 405 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 405 "View.MemoryView" __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) - -#line 405 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 405 "View.MemoryView" __pyx_r = __pyx_t_3; - -#line 405 "View.MemoryView" __pyx_t_3 = 0; - -#line 405 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":404 - * + * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ - -#line 404 "View.MemoryView" } /* "View.MemoryView":407 @@ -20044,322 +10919,144 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< * return self.convert_item_to_object(itemp) - * + * */ - -#line 407 "View.MemoryView" /*else*/ { - -#line 407 "View.MemoryView" __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(0, 407, __pyx_L1_error) - -#line 407 "View.MemoryView" __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":408 * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< - * + * * def __setitem__(memoryview self, object index, object value): */ - -#line 408 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 408 "View.MemoryView" __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) - -#line 408 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 408 "View.MemoryView" __pyx_r = __pyx_t_3; - -#line 408 "View.MemoryView" __pyx_t_3 = 0; - -#line 408 "View.MemoryView" goto __pyx_L0; - -#line 408 "View.MemoryView" } /* "View.MemoryView":397 - * - * + * + * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self */ -#line 397 "View.MemoryView" - - -#line 397 "View.MemoryView" /* function exit code */ - -#line 397 "View.MemoryView" __pyx_L1_error:; - -#line 397 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 397 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); - -#line 397 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 397 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 397 "View.MemoryView" __pyx_r = NULL; - -#line 397 "View.MemoryView" __pyx_L0:; - -#line 397 "View.MemoryView" __Pyx_XDECREF(__pyx_v_have_slices); - -#line 397 "View.MemoryView" __Pyx_XDECREF(__pyx_v_indices); - -#line 397 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 397 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 397 "View.MemoryView" return __pyx_r; - -#line 397 "View.MemoryView" } /* "View.MemoryView":410 * return self.convert_item_to_object(itemp) - * + * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * have_slices, index = _unellipsify(index, self.view.ndim) - * + * */ -#line 410 "View.MemoryView" - - -#line 410 "View.MemoryView" /* Python wrapper */ - -#line 410 "View.MemoryView" static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ - -#line 410 "View.MemoryView" static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { - -#line 410 "View.MemoryView" int __pyx_r; - -#line 410 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 410 "View.MemoryView" __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - __pyx_r = -#line 410 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); -#line 410 "View.MemoryView" - - -#line 410 "View.MemoryView" /* function exit code */ - -#line 410 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 410 "View.MemoryView" return __pyx_r; - -#line 410 "View.MemoryView" } -#line 410 "View.MemoryView" - - -#line 410 "View.MemoryView" static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { - PyObject *__pyx_v_have_slices = NULL -#line 410 "View.MemoryView" -; - PyObject *__pyx_v_obj = NULL -#line 410 "View.MemoryView" -; - -#line 410 "View.MemoryView" + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; int __pyx_r; - -#line 410 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 410 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 410 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 410 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 410 "View.MemoryView" int __pyx_t_4; - -#line 410 "View.MemoryView" __Pyx_RefNannySetupContext("__setitem__", 0); - -#line 410 "View.MemoryView" __Pyx_INCREF(__pyx_v_index); /* "View.MemoryView":411 - * + * * def __setitem__(memoryview self, object index, object value): * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< - * + * * if have_slices: */ - -#line 411 "View.MemoryView" __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) - -#line 411 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 411 "View.MemoryView" if (likely(__pyx_t_1 != Py_None)) { - -#line 411 "View.MemoryView" PyObject* sequence = __pyx_t_1; - -#line 411 "View.MemoryView" #if !CYTHON_COMPILING_IN_PYPY - -#line 411 "View.MemoryView" Py_ssize_t size = Py_SIZE(sequence); - -#line 411 "View.MemoryView" #else - -#line 411 "View.MemoryView" Py_ssize_t size = PySequence_Size(sequence); - -#line 411 "View.MemoryView" #endif - -#line 411 "View.MemoryView" if (unlikely(size != 2)) { - -#line 411 "View.MemoryView" if (size > 2) __Pyx_RaiseTooManyValuesError(2); - -#line 411 "View.MemoryView" else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - -#line 411 "View.MemoryView" __PYX_ERR(0, 411, __pyx_L1_error) - -#line 411 "View.MemoryView" } - -#line 411 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 411 "View.MemoryView" - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - -#line 411 "View.MemoryView" - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - -#line 411 "View.MemoryView" + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); - -#line 411 "View.MemoryView" __Pyx_INCREF(__pyx_t_3); - -#line 411 "View.MemoryView" #else - -#line 411 "View.MemoryView" __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) - -#line 411 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 411 "View.MemoryView" __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) - -#line 411 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 411 "View.MemoryView" #endif - -#line 411 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 411 "View.MemoryView" } else { - -#line 411 "View.MemoryView" __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 411, __pyx_L1_error) - -#line 411 "View.MemoryView" } - -#line 411 "View.MemoryView" __pyx_v_have_slices = __pyx_t_2; - -#line 411 "View.MemoryView" __pyx_t_2 = 0; - -#line 411 "View.MemoryView" __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); - -#line 411 "View.MemoryView" __pyx_t_3 = 0; /* "View.MemoryView":413 * have_slices, index = _unellipsify(index, self.view.ndim) - * + * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ - -#line 413 "View.MemoryView" __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 413, __pyx_L1_error) - -#line 413 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":414 - * + * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: * self.setitem_slice_assignment(self[index], obj) */ - -#line 414 "View.MemoryView" __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) - -#line 414 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 414 "View.MemoryView" __pyx_v_obj = __pyx_t_1; - -#line 414 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":415 @@ -20369,11 +11066,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_slice_assignment(self[index], obj) * else: */ - -#line 415 "View.MemoryView" __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 415, __pyx_L1_error) - -#line 415 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":416 @@ -20383,23 +11076,11 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * else: * self.setitem_slice_assign_scalar(self[index], value) */ - -#line 416 "View.MemoryView" __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) - -#line 416 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 416 "View.MemoryView" __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) - -#line 416 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 416 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 416 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":415 @@ -20409,11 +11090,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_slice_assignment(self[index], obj) * else: */ - -#line 415 "View.MemoryView" goto __pyx_L4; - -#line 415 "View.MemoryView" } /* "View.MemoryView":418 @@ -20423,204 +11100,98 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * else: * self.setitem_indexed(index, value) */ - -#line 418 "View.MemoryView" /*else*/ { - -#line 418 "View.MemoryView" __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) - -#line 418 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 418 "View.MemoryView" if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 418, __pyx_L1_error) - -#line 418 "View.MemoryView" __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) - -#line 418 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 418 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 418 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 418 "View.MemoryView" } - -#line 418 "View.MemoryView" __pyx_L4:; /* "View.MemoryView":413 * have_slices, index = _unellipsify(index, self.view.ndim) - * + * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ - -#line 413 "View.MemoryView" goto __pyx_L3; - -#line 413 "View.MemoryView" } /* "View.MemoryView":420 * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< - * + * * cdef is_slice(self, obj): */ - -#line 420 "View.MemoryView" /*else*/ { - -#line 420 "View.MemoryView" __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) - -#line 420 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 420 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 420 "View.MemoryView" } - -#line 420 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":410 * return self.convert_item_to_object(itemp) - * + * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * have_slices, index = _unellipsify(index, self.view.ndim) - * + * */ -#line 410 "View.MemoryView" - - -#line 410 "View.MemoryView" /* function exit code */ - -#line 410 "View.MemoryView" __pyx_r = 0; - -#line 410 "View.MemoryView" goto __pyx_L0; - -#line 410 "View.MemoryView" __pyx_L1_error:; - -#line 410 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 410 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 410 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 410 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 410 "View.MemoryView" __pyx_r = -1; - -#line 410 "View.MemoryView" __pyx_L0:; - -#line 410 "View.MemoryView" __Pyx_XDECREF(__pyx_v_have_slices); - -#line 410 "View.MemoryView" __Pyx_XDECREF(__pyx_v_obj); - -#line 410 "View.MemoryView" __Pyx_XDECREF(__pyx_v_index); - -#line 410 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 410 "View.MemoryView" return __pyx_r; - -#line 410 "View.MemoryView" } /* "View.MemoryView":422 * self.setitem_indexed(index, value) - * + * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: */ -#line 422 "View.MemoryView" - - -#line 422 "View.MemoryView" static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { - -#line 422 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 422 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 422 "View.MemoryView" int __pyx_t_1; - -#line 422 "View.MemoryView" int __pyx_t_2; - -#line 422 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 422 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 422 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 422 "View.MemoryView" PyObject *__pyx_t_6 = NULL; - -#line 422 "View.MemoryView" PyObject *__pyx_t_7 = NULL; - -#line 422 "View.MemoryView" PyObject *__pyx_t_8 = NULL; - -#line 422 "View.MemoryView" int __pyx_t_9; - -#line 422 "View.MemoryView" __Pyx_RefNannySetupContext("is_slice", 0); - -#line 422 "View.MemoryView" __Pyx_INCREF(__pyx_v_obj); /* "View.MemoryView":423 - * + * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, */ - -#line 423 "View.MemoryView" - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); - -#line 423 "View.MemoryView" + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); - -#line 423 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":424 @@ -20630,29 +11201,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ - -#line 424 "View.MemoryView" { - -#line 424 "View.MemoryView" __Pyx_PyThreadState_declare - -#line 424 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 424 "View.MemoryView" __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); - -#line 424 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_3); - -#line 424 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_4); - -#line 424 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_5); - -#line 424 "View.MemoryView" /*try:*/ { /* "View.MemoryView":425 @@ -20662,11 +11217,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: */ - -#line 425 "View.MemoryView" __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L4_error) - -#line 425 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":426 @@ -20676,11 +11227,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * except TypeError: * return None */ - -#line 426 "View.MemoryView" __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L4_error) - -#line 426 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":425 @@ -20690,53 +11237,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: */ - -#line 425 "View.MemoryView" __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 425, __pyx_L4_error) - -#line 425 "View.MemoryView" __Pyx_GOTREF(__pyx_t_8); - -#line 425 "View.MemoryView" __Pyx_INCREF(__pyx_v_obj); - -#line 425 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_obj); - -#line 425 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); - -#line 425 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_6); - -#line 425 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); - -#line 425 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_7); - -#line 425 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); - -#line 425 "View.MemoryView" __pyx_t_6 = 0; - -#line 425 "View.MemoryView" __pyx_t_7 = 0; - -#line 425 "View.MemoryView" __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L4_error) - -#line 425 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 425 "View.MemoryView" __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 425 "View.MemoryView" __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); - -#line 425 "View.MemoryView" __pyx_t_7 = 0; /* "View.MemoryView":424 @@ -20746,35 +11261,15 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ - -#line 424 "View.MemoryView" } - -#line 424 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 424 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 424 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 424 "View.MemoryView" goto __pyx_L9_try_end; - -#line 424 "View.MemoryView" __pyx_L4_error:; - -#line 424 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 424 "View.MemoryView" __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 424 "View.MemoryView" __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 424 "View.MemoryView" __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":427 @@ -20782,66 +11277,32 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< * return None - * + * */ - -#line 427 "View.MemoryView" __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); - -#line 427 "View.MemoryView" if (__pyx_t_9) { - -#line 427 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 427 "View.MemoryView" if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 427, __pyx_L6_except_error) - -#line 427 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 427 "View.MemoryView" __Pyx_GOTREF(__pyx_t_8); - -#line 427 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":428 * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< - * + * * return obj */ - -#line 428 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 428 "View.MemoryView" __Pyx_INCREF(Py_None); - -#line 428 "View.MemoryView" __pyx_r = Py_None; - -#line 428 "View.MemoryView" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 428 "View.MemoryView" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 428 "View.MemoryView" __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 428 "View.MemoryView" goto __pyx_L7_except_return; - -#line 428 "View.MemoryView" } - -#line 428 "View.MemoryView" goto __pyx_L6_except_error; - -#line 428 "View.MemoryView" __pyx_L6_except_error:; /* "View.MemoryView":424 @@ -20851,355 +11312,175 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ - -#line 424 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 424 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_3); - -#line 424 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_4); - -#line 424 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_5); - -#line 424 "View.MemoryView" __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - -#line 424 "View.MemoryView" goto __pyx_L1_error; - -#line 424 "View.MemoryView" __pyx_L7_except_return:; - -#line 424 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 424 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_3); - -#line 424 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_4); - -#line 424 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_5); - -#line 424 "View.MemoryView" __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); - -#line 424 "View.MemoryView" goto __pyx_L0; - -#line 424 "View.MemoryView" __pyx_L9_try_end:; - -#line 424 "View.MemoryView" } /* "View.MemoryView":423 - * + * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, */ - -#line 423 "View.MemoryView" } /* "View.MemoryView":430 * return None - * + * * return obj # <<<<<<<<<<<<<< - * + * * cdef setitem_slice_assignment(self, dst, src): */ - -#line 430 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 430 "View.MemoryView" __Pyx_INCREF(__pyx_v_obj); - -#line 430 "View.MemoryView" __pyx_r = __pyx_v_obj; - -#line 430 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":422 * self.setitem_indexed(index, value) - * + * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: */ -#line 422 "View.MemoryView" - - -#line 422 "View.MemoryView" /* function exit code */ - -#line 422 "View.MemoryView" __pyx_L1_error:; - -#line 422 "View.MemoryView" __Pyx_XDECREF(__pyx_t_6); - -#line 422 "View.MemoryView" __Pyx_XDECREF(__pyx_t_7); - -#line 422 "View.MemoryView" __Pyx_XDECREF(__pyx_t_8); - -#line 422 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 422 "View.MemoryView" __pyx_r = 0; - -#line 422 "View.MemoryView" __pyx_L0:; - -#line 422 "View.MemoryView" __Pyx_XDECREF(__pyx_v_obj); - -#line 422 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 422 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 422 "View.MemoryView" return __pyx_r; - -#line 422 "View.MemoryView" } /* "View.MemoryView":432 * return obj - * + * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice */ -#line 432 "View.MemoryView" - - -#line 432 "View.MemoryView" static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { - __Pyx_memviewslice __pyx_v_dst_slice -#line 432 "View.MemoryView" -; - __Pyx_memviewslice __pyx_v_src_slice -#line 432 "View.MemoryView" -; - -#line 432 "View.MemoryView" + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; PyObject *__pyx_r = NULL; - -#line 432 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 432 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 432 "View.MemoryView" int __pyx_t_2; - -#line 432 "View.MemoryView" int __pyx_t_3; - -#line 432 "View.MemoryView" int __pyx_t_4; - -#line 432 "View.MemoryView" __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); /* "View.MemoryView":436 * cdef __Pyx_memviewslice src_slice - * + * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - -#line 436 "View.MemoryView" if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(0, 436, __pyx_L1_error) /* "View.MemoryView":437 - * + * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< * src.ndim, dst.ndim, self.dtype_is_object) - * + * */ - -#line 437 "View.MemoryView" if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(0, 437, __pyx_L1_error) /* "View.MemoryView":438 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): */ - -#line 438 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) - -#line 438 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 438 "View.MemoryView" __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) - -#line 438 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 438 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) - -#line 438 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 438 "View.MemoryView" __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) - -#line 438 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":436 * cdef __Pyx_memviewslice src_slice - * + * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - -#line 436 "View.MemoryView" __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 436, __pyx_L1_error) /* "View.MemoryView":432 * return obj - * + * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice */ -#line 432 "View.MemoryView" - - -#line 432 "View.MemoryView" /* function exit code */ - -#line 432 "View.MemoryView" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 432 "View.MemoryView" goto __pyx_L0; - -#line 432 "View.MemoryView" __pyx_L1_error:; - -#line 432 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 432 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 432 "View.MemoryView" __pyx_r = 0; - -#line 432 "View.MemoryView" __pyx_L0:; - -#line 432 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 432 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 432 "View.MemoryView" return __pyx_r; - -#line 432 "View.MemoryView" } /* "View.MemoryView":440 * src.ndim, dst.ndim, self.dtype_is_object) - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL */ -#line 440 "View.MemoryView" - - -#line 440 "View.MemoryView" static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { - int __pyx_v_array[0x80] -#line 440 "View.MemoryView" -; - void *__pyx_v_tmp -#line 440 "View.MemoryView" -; - void *__pyx_v_item -#line 440 "View.MemoryView" -; - __Pyx_memviewslice *__pyx_v_dst_slice -#line 440 "View.MemoryView" -; - __Pyx_memviewslice __pyx_v_tmp_slice -#line 440 "View.MemoryView" -; - -#line 440 "View.MemoryView" + int __pyx_v_array[0x80]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; PyObject *__pyx_r = NULL; - -#line 440 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 440 "View.MemoryView" int __pyx_t_1; - -#line 440 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 440 "View.MemoryView" int __pyx_t_3; - -#line 440 "View.MemoryView" int __pyx_t_4; - -#line 440 "View.MemoryView" char const *__pyx_t_5; - -#line 440 "View.MemoryView" PyObject *__pyx_t_6 = NULL; - -#line 440 "View.MemoryView" PyObject *__pyx_t_7 = NULL; - -#line 440 "View.MemoryView" PyObject *__pyx_t_8 = NULL; - -#line 440 "View.MemoryView" PyObject *__pyx_t_9 = NULL; - -#line 440 "View.MemoryView" PyObject *__pyx_t_10 = NULL; - -#line 440 "View.MemoryView" PyObject *__pyx_t_11 = NULL; - -#line 440 "View.MemoryView" __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); /* "View.MemoryView":442 @@ -21207,46 +11488,36 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< * cdef void *item - * + * */ - -#line 442 "View.MemoryView" __pyx_v_tmp = NULL; /* "View.MemoryView":447 * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< - * + * * if self.view.itemsize > sizeof(array): */ - -#line 447 "View.MemoryView" __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); /* "View.MemoryView":449 * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * + * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: */ - -#line 449 "View.MemoryView" __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); - -#line 449 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":450 - * + * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< * if tmp == NULL: * raise MemoryError */ - -#line 450 "View.MemoryView" __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); /* "View.MemoryView":451 @@ -21256,11 +11527,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * raise MemoryError * item = tmp */ - -#line 451 "View.MemoryView" __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); - -#line 451 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":452 @@ -21270,8 +11537,6 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * item = tmp * else: */ - -#line 452 "View.MemoryView" PyErr_NoMemory(); __PYX_ERR(0, 452, __pyx_L1_error) /* "View.MemoryView":451 @@ -21281,8 +11546,6 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * raise MemoryError * item = tmp */ - -#line 451 "View.MemoryView" } /* "View.MemoryView":453 @@ -21292,67 +11555,47 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * else: * item = array */ - -#line 453 "View.MemoryView" __pyx_v_item = __pyx_v_tmp; /* "View.MemoryView":449 * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * + * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: */ - -#line 449 "View.MemoryView" goto __pyx_L3; - -#line 449 "View.MemoryView" } /* "View.MemoryView":455 * item = tmp * else: * item = array # <<<<<<<<<<<<<< - * + * * try: */ - -#line 455 "View.MemoryView" /*else*/ { - -#line 455 "View.MemoryView" __pyx_v_item = ((void *)__pyx_v_array); - -#line 455 "View.MemoryView" } - -#line 455 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":457 * item = array - * + * * try: # <<<<<<<<<<<<<< * if self.dtype_is_object: * ( item)[0] = value */ - -#line 457 "View.MemoryView" /*try:*/ { /* "View.MemoryView":458 - * + * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value * else: */ - -#line 458 "View.MemoryView" __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); - -#line 458 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":459 @@ -21362,90 +11605,60 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * else: * self.assign_item_from_object( item, value) */ - -#line 459 "View.MemoryView" (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); /* "View.MemoryView":458 - * + * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value * else: */ - -#line 458 "View.MemoryView" goto __pyx_L8; - -#line 458 "View.MemoryView" } /* "View.MemoryView":461 * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 461 "View.MemoryView" /*else*/ { - -#line 461 "View.MemoryView" __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L6_error) - -#line 461 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 461 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 461 "View.MemoryView" } - -#line 461 "View.MemoryView" __pyx_L8:; /* "View.MemoryView":465 - * - * + * + * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, */ - -#line 465 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); - -#line 465 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":466 - * + * * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, * item, self.dtype_is_object) */ - -#line 466 "View.MemoryView" __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L6_error) - -#line 466 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 466 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":465 - * - * + * + * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, */ - -#line 465 "View.MemoryView" } /* "View.MemoryView":467 @@ -21455,361 +11668,161 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * item, self.dtype_is_object) * finally: */ - -#line 467 "View.MemoryView" __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); - -#line 467 "View.MemoryView" } /* "View.MemoryView":470 * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< - * + * * cdef setitem_indexed(self, index, value): */ - -#line 470 "View.MemoryView" /*finally:*/ { - -#line 470 "View.MemoryView" /*normal exit:*/{ - -#line 470 "View.MemoryView" PyMem_Free(__pyx_v_tmp); - -#line 470 "View.MemoryView" goto __pyx_L7; - -#line 470 "View.MemoryView" } - -#line 470 "View.MemoryView" /*exception exit:*/{ - -#line 470 "View.MemoryView" __Pyx_PyThreadState_declare - -#line 470 "View.MemoryView" __pyx_L6_error:; - -#line 470 "View.MemoryView" __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - -#line 470 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 470 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 470 "View.MemoryView" if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); - -#line 470 "View.MemoryView" 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); - -#line 470 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_6); - -#line 470 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_7); - -#line 470 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_8); - -#line 470 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_9); - -#line 470 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_10); - -#line 470 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_11); - -#line 470 "View.MemoryView" __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; - -#line 470 "View.MemoryView" { - -#line 470 "View.MemoryView" PyMem_Free(__pyx_v_tmp); - -#line 470 "View.MemoryView" } - -#line 470 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 470 "View.MemoryView" if (PY_MAJOR_VERSION >= 3) { - -#line 470 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_9); - -#line 470 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_10); - -#line 470 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_11); - -#line 470 "View.MemoryView" __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); - -#line 470 "View.MemoryView" } - -#line 470 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_6); - -#line 470 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_7); - -#line 470 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_8); - -#line 470 "View.MemoryView" __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); - -#line 470 "View.MemoryView" __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - -#line 470 "View.MemoryView" __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; - -#line 470 "View.MemoryView" goto __pyx_L1_error; - -#line 470 "View.MemoryView" } - -#line 470 "View.MemoryView" __pyx_L7:; - -#line 470 "View.MemoryView" } /* "View.MemoryView":440 * src.ndim, dst.ndim, self.dtype_is_object) - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL */ -#line 440 "View.MemoryView" - - -#line 440 "View.MemoryView" /* function exit code */ - -#line 440 "View.MemoryView" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 440 "View.MemoryView" goto __pyx_L0; - -#line 440 "View.MemoryView" __pyx_L1_error:; - -#line 440 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 440 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 440 "View.MemoryView" __pyx_r = 0; - -#line 440 "View.MemoryView" __pyx_L0:; - -#line 440 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 440 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 440 "View.MemoryView" return __pyx_r; - -#line 440 "View.MemoryView" } /* "View.MemoryView":472 * PyMem_Free(tmp) - * + * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) */ -#line 472 "View.MemoryView" - - -#line 472 "View.MemoryView" static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { - char *__pyx_v_itemp -#line 472 "View.MemoryView" -; - -#line 472 "View.MemoryView" + char *__pyx_v_itemp; PyObject *__pyx_r = NULL; - -#line 472 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 472 "View.MemoryView" char *__pyx_t_1; - -#line 472 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 472 "View.MemoryView" __Pyx_RefNannySetupContext("setitem_indexed", 0); /* "View.MemoryView":473 - * + * * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< * self.assign_item_from_object(itemp, value) - * + * */ - -#line 473 "View.MemoryView" __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 473, __pyx_L1_error) - -#line 473 "View.MemoryView" __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":474 * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< - * + * * cdef convert_item_to_object(self, char *itemp): */ - -#line 474 "View.MemoryView" __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error) - -#line 474 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 474 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":472 * PyMem_Free(tmp) - * + * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) */ -#line 472 "View.MemoryView" - - -#line 472 "View.MemoryView" /* function exit code */ - -#line 472 "View.MemoryView" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 472 "View.MemoryView" goto __pyx_L0; - -#line 472 "View.MemoryView" __pyx_L1_error:; - -#line 472 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 472 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 472 "View.MemoryView" __pyx_r = 0; - -#line 472 "View.MemoryView" __pyx_L0:; - -#line 472 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 472 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 472 "View.MemoryView" return __pyx_r; - -#line 472 "View.MemoryView" } /* "View.MemoryView":476 * self.assign_item_from_object(itemp, value) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ -#line 476 "View.MemoryView" - - -#line 476 "View.MemoryView" static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { - PyObject *__pyx_v_struct = NULL -#line 476 "View.MemoryView" -; - PyObject *__pyx_v_bytesitem = 0 -#line 476 "View.MemoryView" -; - PyObject *__pyx_v_result = NULL -#line 476 "View.MemoryView" -; - -#line 476 "View.MemoryView" + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; - -#line 476 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 476 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 476 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 476 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 476 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 476 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 476 "View.MemoryView" PyObject *__pyx_t_6 = NULL; - -#line 476 "View.MemoryView" PyObject *__pyx_t_7 = NULL; - -#line 476 "View.MemoryView" int __pyx_t_8; - -#line 476 "View.MemoryView" PyObject *__pyx_t_9 = NULL; - -#line 476 "View.MemoryView" size_t __pyx_t_10; - -#line 476 "View.MemoryView" int __pyx_t_11; - -#line 476 "View.MemoryView" __Pyx_RefNannySetupContext("convert_item_to_object", 0); /* "View.MemoryView":479 @@ -21817,71 +11830,39 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem - * + * */ - -#line 479 "View.MemoryView" __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) - -#line 479 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 479 "View.MemoryView" __pyx_v_struct = __pyx_t_1; - -#line 479 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":482 * cdef bytes bytesitem - * + * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) */ - -#line 482 "View.MemoryView" __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) - -#line 482 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 482 "View.MemoryView" __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); - -#line 482 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":483 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ - -#line 483 "View.MemoryView" { - -#line 483 "View.MemoryView" __Pyx_PyThreadState_declare - -#line 483 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 483 "View.MemoryView" __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); - -#line 483 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_2); - -#line 483 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_3); - -#line 483 "View.MemoryView" __Pyx_XGOTREF(__pyx_t_4); - -#line 483 "View.MemoryView" /*try:*/ { /* "View.MemoryView":484 @@ -21891,175 +11872,67 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * except struct.error: * raise ValueError("Unable to convert item to object") */ - -#line 484 "View.MemoryView" __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L3_error) - -#line 484 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 484 "View.MemoryView" __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 484, __pyx_L3_error) - -#line 484 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 484 "View.MemoryView" __pyx_t_7 = NULL; - -#line 484 "View.MemoryView" __pyx_t_8 = 0; - -#line 484 "View.MemoryView" if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { - -#line 484 "View.MemoryView" __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - -#line 484 "View.MemoryView" if (likely(__pyx_t_7)) { - -#line 484 "View.MemoryView" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - -#line 484 "View.MemoryView" __Pyx_INCREF(__pyx_t_7); - -#line 484 "View.MemoryView" __Pyx_INCREF(function); - -#line 484 "View.MemoryView" __Pyx_DECREF_SET(__pyx_t_5, function); - -#line 484 "View.MemoryView" __pyx_t_8 = 1; - -#line 484 "View.MemoryView" } - -#line 484 "View.MemoryView" } - -#line 484 "View.MemoryView" #if CYTHON_FAST_PYCALL - -#line 484 "View.MemoryView" if (PyFunction_Check(__pyx_t_5)) { - -#line 484 "View.MemoryView" PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - -#line 484 "View.MemoryView" __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L3_error) - -#line 484 "View.MemoryView" __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 484 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 484 "View.MemoryView" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 484 "View.MemoryView" } else - -#line 484 "View.MemoryView" #endif - -#line 484 "View.MemoryView" #if CYTHON_FAST_PYCCALL - -#line 484 "View.MemoryView" if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - -#line 484 "View.MemoryView" PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - -#line 484 "View.MemoryView" __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L3_error) - -#line 484 "View.MemoryView" __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 484 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 484 "View.MemoryView" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 484 "View.MemoryView" } else - -#line 484 "View.MemoryView" #endif - -#line 484 "View.MemoryView" { - -#line 484 "View.MemoryView" __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L3_error) - -#line 484 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 484 "View.MemoryView" if (__pyx_t_7) { - -#line 484 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; - -#line 484 "View.MemoryView" } - -#line 484 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_6); - -#line 484 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); - -#line 484 "View.MemoryView" __Pyx_INCREF(__pyx_v_bytesitem); - -#line 484 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_bytesitem); - -#line 484 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); - -#line 484 "View.MemoryView" __pyx_t_6 = 0; - -#line 484 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L3_error) - -#line 484 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 484 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 484 "View.MemoryView" } - -#line 484 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 484 "View.MemoryView" __pyx_v_result = __pyx_t_1; - -#line 484 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":483 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ - -#line 483 "View.MemoryView" } /* "View.MemoryView":488 @@ -22069,17 +11942,9 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * return result[0] * return result */ - -#line 488 "View.MemoryView" /*else:*/ { - -#line 488 "View.MemoryView" - __pyx_t_10 = strlen(__pyx_v_self->view.format); - -#line 488 "View.MemoryView" + __pyx_t_10 = strlen(__pyx_v_self->view.format); __pyx_t_11 = ((__pyx_t_10 == 1) != 0); - -#line 488 "View.MemoryView" if (__pyx_t_11) { /* "View.MemoryView":489 @@ -22087,25 +11952,13 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< * return result - * + * */ - -#line 489 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 489 "View.MemoryView" __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L5_except_error) - -#line 489 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 489 "View.MemoryView" __pyx_r = __pyx_t_1; - -#line 489 "View.MemoryView" __pyx_t_1 = 0; - -#line 489 "View.MemoryView" goto __pyx_L6_except_return; /* "View.MemoryView":488 @@ -22115,52 +11968,26 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * return result[0] * return result */ - -#line 488 "View.MemoryView" } /* "View.MemoryView":490 * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< - * + * * cdef assign_item_from_object(self, char *itemp, object value): */ - -#line 490 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 490 "View.MemoryView" __Pyx_INCREF(__pyx_v_result); - -#line 490 "View.MemoryView" __pyx_r = __pyx_v_result; - -#line 490 "View.MemoryView" goto __pyx_L6_except_return; - -#line 490 "View.MemoryView" } - -#line 490 "View.MemoryView" __pyx_L3_error:; - -#line 490 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 490 "View.MemoryView" __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 490 "View.MemoryView" __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 490 "View.MemoryView" __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 490 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 490 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":485 @@ -22170,35 +11997,15 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * raise ValueError("Unable to convert item to object") * else: */ - -#line 485 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L5_except_error) - -#line 485 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 485 "View.MemoryView" __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1); - -#line 485 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 485 "View.MemoryView" if (__pyx_t_8) { - -#line 485 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 485 "View.MemoryView" if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(0, 485, __pyx_L5_except_error) - -#line 485 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 485 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 485 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); /* "View.MemoryView":486 @@ -22208,218 +12015,92 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: * if len(self.view.format) == 1: */ - -#line 486 "View.MemoryView" __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L5_except_error) - -#line 486 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 486 "View.MemoryView" __Pyx_Raise(__pyx_t_6, 0, 0, 0); - -#line 486 "View.MemoryView" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 486 "View.MemoryView" __PYX_ERR(0, 486, __pyx_L5_except_error) - -#line 486 "View.MemoryView" } - -#line 486 "View.MemoryView" goto __pyx_L5_except_error; - -#line 486 "View.MemoryView" __pyx_L5_except_error:; /* "View.MemoryView":483 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ - -#line 483 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 483 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_2); - -#line 483 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_3); - -#line 483 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_4); - -#line 483 "View.MemoryView" __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - -#line 483 "View.MemoryView" goto __pyx_L1_error; - -#line 483 "View.MemoryView" __pyx_L6_except_return:; - -#line 483 "View.MemoryView" __Pyx_PyThreadState_assign - -#line 483 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_2); - -#line 483 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_3); - -#line 483 "View.MemoryView" __Pyx_XGIVEREF(__pyx_t_4); - -#line 483 "View.MemoryView" __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); - -#line 483 "View.MemoryView" goto __pyx_L0; - -#line 483 "View.MemoryView" } /* "View.MemoryView":476 * self.assign_item_from_object(itemp, value) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ -#line 476 "View.MemoryView" - - -#line 476 "View.MemoryView" /* function exit code */ - -#line 476 "View.MemoryView" __pyx_L1_error:; - -#line 476 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 476 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 476 "View.MemoryView" __Pyx_XDECREF(__pyx_t_6); - -#line 476 "View.MemoryView" __Pyx_XDECREF(__pyx_t_7); - -#line 476 "View.MemoryView" __Pyx_XDECREF(__pyx_t_9); - -#line 476 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 476 "View.MemoryView" __pyx_r = 0; - -#line 476 "View.MemoryView" __pyx_L0:; - -#line 476 "View.MemoryView" __Pyx_XDECREF(__pyx_v_struct); - -#line 476 "View.MemoryView" __Pyx_XDECREF(__pyx_v_bytesitem); - -#line 476 "View.MemoryView" __Pyx_XDECREF(__pyx_v_result); - -#line 476 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 476 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 476 "View.MemoryView" return __pyx_r; - -#line 476 "View.MemoryView" } /* "View.MemoryView":492 * return result - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ -#line 492 "View.MemoryView" - - -#line 492 "View.MemoryView" static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { - PyObject *__pyx_v_struct = NULL -#line 492 "View.MemoryView" -; - char __pyx_v_c -#line 492 "View.MemoryView" -; - PyObject *__pyx_v_bytesvalue = 0 -#line 492 "View.MemoryView" -; - Py_ssize_t __pyx_v_i -#line 492 "View.MemoryView" -; - -#line 492 "View.MemoryView" + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; PyObject *__pyx_r = NULL; - -#line 492 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 492 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 492 "View.MemoryView" int __pyx_t_2; - -#line 492 "View.MemoryView" int __pyx_t_3; - -#line 492 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 492 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 492 "View.MemoryView" PyObject *__pyx_t_6 = NULL; - -#line 492 "View.MemoryView" int __pyx_t_7; - -#line 492 "View.MemoryView" PyObject *__pyx_t_8 = NULL; - -#line 492 "View.MemoryView" Py_ssize_t __pyx_t_9; - -#line 492 "View.MemoryView" PyObject *__pyx_t_10 = NULL; - -#line 492 "View.MemoryView" char *__pyx_t_11; - -#line 492 "View.MemoryView" char *__pyx_t_12; - -#line 492 "View.MemoryView" char *__pyx_t_13; - -#line 492 "View.MemoryView" char *__pyx_t_14; - -#line 492 "View.MemoryView" __Pyx_RefNannySetupContext("assign_item_from_object", 0); /* "View.MemoryView":495 @@ -22429,544 +12110,238 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie * cdef char c * cdef bytes bytesvalue */ - -#line 495 "View.MemoryView" __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) - -#line 495 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 495 "View.MemoryView" __pyx_v_struct = __pyx_t_1; - -#line 495 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":500 * cdef Py_ssize_t i - * + * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ - -#line 500 "View.MemoryView" - __pyx_t_2 = PyTuple_Check(__pyx_v_value); - -#line 500 "View.MemoryView" + __pyx_t_2 = PyTuple_Check(__pyx_v_value); __pyx_t_3 = (__pyx_t_2 != 0); - -#line 500 "View.MemoryView" if (__pyx_t_3) { /* "View.MemoryView":501 - * + * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: * bytesvalue = struct.pack(self.view.format, value) */ - -#line 501 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) - -#line 501 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 501 "View.MemoryView" __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) - -#line 501 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 501 "View.MemoryView" __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error) - -#line 501 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 501 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_4); - -#line 501 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - -#line 501 "View.MemoryView" __pyx_t_4 = 0; - -#line 501 "View.MemoryView" __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) - -#line 501 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 501 "View.MemoryView" __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) - -#line 501 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 501 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 501 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 501 "View.MemoryView" __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) - -#line 501 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 501 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 501 "View.MemoryView" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 501 "View.MemoryView" if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 501, __pyx_L1_error) - -#line 501 "View.MemoryView" __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); - -#line 501 "View.MemoryView" __pyx_t_4 = 0; /* "View.MemoryView":500 * cdef Py_ssize_t i - * + * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ - -#line 500 "View.MemoryView" goto __pyx_L3; - -#line 500 "View.MemoryView" } /* "View.MemoryView":503 * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< - * + * * for i, c in enumerate(bytesvalue): */ - -#line 503 "View.MemoryView" /*else*/ { - -#line 503 "View.MemoryView" __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) - -#line 503 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 503 "View.MemoryView" __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) - -#line 503 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 503 "View.MemoryView" __pyx_t_5 = NULL; - -#line 503 "View.MemoryView" __pyx_t_7 = 0; - -#line 503 "View.MemoryView" if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { - -#line 503 "View.MemoryView" __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - -#line 503 "View.MemoryView" if (likely(__pyx_t_5)) { - -#line 503 "View.MemoryView" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - -#line 503 "View.MemoryView" __Pyx_INCREF(__pyx_t_5); - -#line 503 "View.MemoryView" __Pyx_INCREF(function); - -#line 503 "View.MemoryView" __Pyx_DECREF_SET(__pyx_t_6, function); - -#line 503 "View.MemoryView" __pyx_t_7 = 1; - -#line 503 "View.MemoryView" } - -#line 503 "View.MemoryView" } - -#line 503 "View.MemoryView" #if CYTHON_FAST_PYCALL - -#line 503 "View.MemoryView" if (PyFunction_Check(__pyx_t_6)) { - -#line 503 "View.MemoryView" PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - -#line 503 "View.MemoryView" __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) - -#line 503 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 503 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 503 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 503 "View.MemoryView" } else - -#line 503 "View.MemoryView" #endif - -#line 503 "View.MemoryView" #if CYTHON_FAST_PYCCALL - -#line 503 "View.MemoryView" if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { - -#line 503 "View.MemoryView" PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - -#line 503 "View.MemoryView" __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) - -#line 503 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 503 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 503 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 503 "View.MemoryView" } else - -#line 503 "View.MemoryView" #endif - -#line 503 "View.MemoryView" { - -#line 503 "View.MemoryView" __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __pyx_L1_error) - -#line 503 "View.MemoryView" __Pyx_GOTREF(__pyx_t_8); - -#line 503 "View.MemoryView" if (__pyx_t_5) { - -#line 503 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - -#line 503 "View.MemoryView" } - -#line 503 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 503 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); - -#line 503 "View.MemoryView" __Pyx_INCREF(__pyx_v_value); - -#line 503 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_value); - -#line 503 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); - -#line 503 "View.MemoryView" __pyx_t_1 = 0; - -#line 503 "View.MemoryView" __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) - -#line 503 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 503 "View.MemoryView" __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 503 "View.MemoryView" } - -#line 503 "View.MemoryView" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 503 "View.MemoryView" if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 503, __pyx_L1_error) - -#line 503 "View.MemoryView" __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); - -#line 503 "View.MemoryView" __pyx_t_4 = 0; - -#line 503 "View.MemoryView" } - -#line 503 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":505 * bytesvalue = struct.pack(self.view.format, value) - * + * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c - * + * */ - -#line 505 "View.MemoryView" __pyx_t_9 = 0; - -#line 505 "View.MemoryView" if (unlikely(__pyx_v_bytesvalue == Py_None)) { - -#line 505 "View.MemoryView" PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - -#line 505 "View.MemoryView" __PYX_ERR(0, 505, __pyx_L1_error) - -#line 505 "View.MemoryView" } - -#line 505 "View.MemoryView" __Pyx_INCREF(__pyx_v_bytesvalue); - -#line 505 "View.MemoryView" __pyx_t_10 = __pyx_v_bytesvalue; - -#line 505 "View.MemoryView" __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); - -#line 505 "View.MemoryView" __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); - -#line 505 "View.MemoryView" for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { - -#line 505 "View.MemoryView" __pyx_t_11 = __pyx_t_14; - -#line 505 "View.MemoryView" __pyx_v_c = (__pyx_t_11[0]); /* "View.MemoryView":506 - * + * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ - -#line 506 "View.MemoryView" __pyx_v_i = __pyx_t_9; /* "View.MemoryView":505 * bytesvalue = struct.pack(self.view.format, value) - * + * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c - * + * */ - -#line 505 "View.MemoryView" __pyx_t_9 = (__pyx_t_9 + 1); /* "View.MemoryView":506 - * + * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ - -#line 506 "View.MemoryView" (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; - -#line 506 "View.MemoryView" } - -#line 506 "View.MemoryView" __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "View.MemoryView":492 * return result - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ -#line 492 "View.MemoryView" - - -#line 492 "View.MemoryView" /* function exit code */ - -#line 492 "View.MemoryView" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 492 "View.MemoryView" goto __pyx_L0; - -#line 492 "View.MemoryView" __pyx_L1_error:; - -#line 492 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 492 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); - -#line 492 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 492 "View.MemoryView" __Pyx_XDECREF(__pyx_t_6); - -#line 492 "View.MemoryView" __Pyx_XDECREF(__pyx_t_8); - -#line 492 "View.MemoryView" __Pyx_XDECREF(__pyx_t_10); - -#line 492 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 492 "View.MemoryView" __pyx_r = 0; - -#line 492 "View.MemoryView" __pyx_L0:; - -#line 492 "View.MemoryView" __Pyx_XDECREF(__pyx_v_struct); - -#line 492 "View.MemoryView" __Pyx_XDECREF(__pyx_v_bytesvalue); - -#line 492 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 492 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 492 "View.MemoryView" return __pyx_r; - -#line 492 "View.MemoryView" } /* "View.MemoryView":509 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_STRIDES: * info.shape = self.view.shape */ -#line 509 "View.MemoryView" - - -#line 509 "View.MemoryView" /* Python wrapper */ - -#line 509 "View.MemoryView" static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ - -#line 509 "View.MemoryView" static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - -#line 509 "View.MemoryView" int __pyx_r; - -#line 509 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 509 "View.MemoryView" __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = -#line 509 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); -#line 509 "View.MemoryView" - - -#line 509 "View.MemoryView" /* function exit code */ - -#line 509 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 509 "View.MemoryView" return __pyx_r; - -#line 509 "View.MemoryView" } -#line 509 "View.MemoryView" - - -#line 509 "View.MemoryView" static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - -#line 509 "View.MemoryView" int __pyx_r; - -#line 509 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 509 "View.MemoryView" int __pyx_t_1; - -#line 509 "View.MemoryView" Py_ssize_t *__pyx_t_2; - -#line 509 "View.MemoryView" char *__pyx_t_3; - -#line 509 "View.MemoryView" void *__pyx_t_4; - -#line 509 "View.MemoryView" int __pyx_t_5; - -#line 509 "View.MemoryView" Py_ssize_t __pyx_t_6; - -#line 509 "View.MemoryView" __Pyx_RefNannySetupContext("__getbuffer__", 0); - -#line 509 "View.MemoryView" if (__pyx_v_info != NULL) { - -#line 509 "View.MemoryView" __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - -#line 509 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_info->obj); - -#line 509 "View.MemoryView" } /* "View.MemoryView":510 @@ -22976,11 +12351,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.shape = self.view.shape * else: */ - -#line 510 "View.MemoryView" __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); - -#line 510 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":511 @@ -22990,11 +12361,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * else: * info.shape = NULL */ - -#line 511 "View.MemoryView" __pyx_t_2 = __pyx_v_self->view.shape; - -#line 511 "View.MemoryView" __pyx_v_info->shape = __pyx_t_2; /* "View.MemoryView":510 @@ -23004,245 +12371,165 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.shape = self.view.shape * else: */ - -#line 510 "View.MemoryView" goto __pyx_L3; - -#line 510 "View.MemoryView" } /* "View.MemoryView":513 * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_STRIDES: */ - -#line 513 "View.MemoryView" /*else*/ { - -#line 513 "View.MemoryView" __pyx_v_info->shape = NULL; - -#line 513 "View.MemoryView" } - -#line 513 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":515 * info.shape = NULL - * + * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: */ - -#line 515 "View.MemoryView" __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); - -#line 515 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":516 - * + * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< * else: * info.strides = NULL */ - -#line 516 "View.MemoryView" __pyx_t_2 = __pyx_v_self->view.strides; - -#line 516 "View.MemoryView" __pyx_v_info->strides = __pyx_t_2; /* "View.MemoryView":515 * info.shape = NULL - * + * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: */ - -#line 515 "View.MemoryView" goto __pyx_L4; - -#line 515 "View.MemoryView" } /* "View.MemoryView":518 * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_INDIRECT: */ - -#line 518 "View.MemoryView" /*else*/ { - -#line 518 "View.MemoryView" __pyx_v_info->strides = NULL; - -#line 518 "View.MemoryView" } - -#line 518 "View.MemoryView" __pyx_L4:; /* "View.MemoryView":520 * info.strides = NULL - * + * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: */ - -#line 520 "View.MemoryView" __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); - -#line 520 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":521 - * + * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< * else: * info.suboffsets = NULL */ - -#line 521 "View.MemoryView" __pyx_t_2 = __pyx_v_self->view.suboffsets; - -#line 521 "View.MemoryView" __pyx_v_info->suboffsets = __pyx_t_2; /* "View.MemoryView":520 * info.strides = NULL - * + * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: */ - -#line 520 "View.MemoryView" goto __pyx_L5; - -#line 520 "View.MemoryView" } /* "View.MemoryView":523 * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ - -#line 523 "View.MemoryView" /*else*/ { - -#line 523 "View.MemoryView" __pyx_v_info->suboffsets = NULL; - -#line 523 "View.MemoryView" } - -#line 523 "View.MemoryView" __pyx_L5:; /* "View.MemoryView":525 * info.suboffsets = NULL - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: */ - -#line 525 "View.MemoryView" __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); - -#line 525 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":526 - * + * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< * else: * info.format = NULL */ - -#line 526 "View.MemoryView" __pyx_t_3 = __pyx_v_self->view.format; - -#line 526 "View.MemoryView" __pyx_v_info->format = __pyx_t_3; /* "View.MemoryView":525 * info.suboffsets = NULL - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: */ - -#line 525 "View.MemoryView" goto __pyx_L6; - -#line 525 "View.MemoryView" } /* "View.MemoryView":528 * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< - * + * * info.buf = self.view.buf */ - -#line 528 "View.MemoryView" /*else*/ { - -#line 528 "View.MemoryView" __pyx_v_info->format = NULL; - -#line 528 "View.MemoryView" } - -#line 528 "View.MemoryView" __pyx_L6:; /* "View.MemoryView":530 * info.format = NULL - * + * * info.buf = self.view.buf # <<<<<<<<<<<<<< * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize */ - -#line 530 "View.MemoryView" __pyx_t_4 = __pyx_v_self->view.buf; - -#line 530 "View.MemoryView" __pyx_v_info->buf = __pyx_t_4; /* "View.MemoryView":531 - * + * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< * info.itemsize = self.view.itemsize * info.len = self.view.len */ - -#line 531 "View.MemoryView" __pyx_t_5 = __pyx_v_self->view.ndim; - -#line 531 "View.MemoryView" __pyx_v_info->ndim = __pyx_t_5; /* "View.MemoryView":532 @@ -23252,11 +12539,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.len = self.view.len * info.readonly = 0 */ - -#line 532 "View.MemoryView" __pyx_t_6 = __pyx_v_self->view.itemsize; - -#line 532 "View.MemoryView" __pyx_v_info->itemsize = __pyx_t_6; /* "View.MemoryView":533 @@ -23266,11 +12549,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.readonly = 0 * info.obj = self */ - -#line 533 "View.MemoryView" __pyx_t_6 = __pyx_v_self->view.len; - -#line 533 "View.MemoryView" __pyx_v_info->len = __pyx_t_6; /* "View.MemoryView":534 @@ -23278,142 +12557,68 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.len = self.view.len * info.readonly = 0 # <<<<<<<<<<<<<< * info.obj = self - * + * */ - -#line 534 "View.MemoryView" __pyx_v_info->readonly = 0; /* "View.MemoryView":535 * info.len = self.view.len * info.readonly = 0 * info.obj = self # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ - -#line 535 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_self)); - -#line 535 "View.MemoryView" __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - -#line 535 "View.MemoryView" __Pyx_GOTREF(__pyx_v_info->obj); - -#line 535 "View.MemoryView" __Pyx_DECREF(__pyx_v_info->obj); - -#line 535 "View.MemoryView" __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":509 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_STRIDES: * info.shape = self.view.shape */ -#line 509 "View.MemoryView" - - -#line 509 "View.MemoryView" /* function exit code */ - -#line 509 "View.MemoryView" __pyx_r = 0; - -#line 509 "View.MemoryView" if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - -#line 509 "View.MemoryView" __Pyx_GOTREF(Py_None); - -#line 509 "View.MemoryView" __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - -#line 509 "View.MemoryView" } - -#line 509 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 509 "View.MemoryView" return __pyx_r; - -#line 509 "View.MemoryView" } /* "View.MemoryView":541 - * + * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) */ -#line 541 "View.MemoryView" - - -#line 541 "View.MemoryView" /* Python wrapper */ - -#line 541 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 541 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { - -#line 541 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 541 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 541 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 541 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 541 "View.MemoryView" - - -#line 541 "View.MemoryView" /* function exit code */ - -#line 541 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 541 "View.MemoryView" return __pyx_r; - -#line 541 "View.MemoryView" } -#line 541 "View.MemoryView" - - -#line 541 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - struct __pyx_memoryviewslice_obj *__pyx_v_result = 0 -#line 541 "View.MemoryView" -; - -#line 541 "View.MemoryView" + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; PyObject *__pyx_r = NULL; - -#line 541 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 541 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 541 "View.MemoryView" int __pyx_t_2; - -#line 541 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":542 @@ -23423,20 +12628,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ * transpose_memslice(&result.from_slice) * return result */ - -#line 542 "View.MemoryView" __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) - -#line 542 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 542 "View.MemoryView" if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(0, 542, __pyx_L1_error) - -#line 542 "View.MemoryView" __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); - -#line 542 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":543 @@ -23444,691 +12639,315 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< * return result - * + * */ - -#line 543 "View.MemoryView" __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(0, 543, __pyx_L1_error) /* "View.MemoryView":544 * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< - * + * * @property */ - -#line 544 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 544 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_result)); - -#line 544 "View.MemoryView" __pyx_r = ((PyObject *)__pyx_v_result); - -#line 544 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":541 - * + * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) */ -#line 541 "View.MemoryView" - - -#line 541 "View.MemoryView" /* function exit code */ - -#line 541 "View.MemoryView" __pyx_L1_error:; - -#line 541 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 541 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 541 "View.MemoryView" __pyx_r = NULL; - -#line 541 "View.MemoryView" __pyx_L0:; - -#line 541 "View.MemoryView" __Pyx_XDECREF((PyObject *)__pyx_v_result); - -#line 541 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 541 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 541 "View.MemoryView" return __pyx_r; - -#line 541 "View.MemoryView" } /* "View.MemoryView":547 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj - * + * */ -#line 547 "View.MemoryView" - - -#line 547 "View.MemoryView" /* Python wrapper */ - -#line 547 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 547 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { - -#line 547 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 547 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 547 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 547 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 547 "View.MemoryView" - - -#line 547 "View.MemoryView" /* function exit code */ - -#line 547 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 547 "View.MemoryView" return __pyx_r; - -#line 547 "View.MemoryView" } -#line 547 "View.MemoryView" - - -#line 547 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - -#line 547 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 547 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 547 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":548 * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< - * + * * @property */ - -#line 548 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 548 "View.MemoryView" __Pyx_INCREF(__pyx_v_self->obj); - -#line 548 "View.MemoryView" __pyx_r = __pyx_v_self->obj; - -#line 548 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":547 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj - * + * */ -#line 547 "View.MemoryView" - - -#line 547 "View.MemoryView" /* function exit code */ - -#line 547 "View.MemoryView" __pyx_L0:; - -#line 547 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 547 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 547 "View.MemoryView" return __pyx_r; - -#line 547 "View.MemoryView" } /* "View.MemoryView":551 - * + * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * + * */ -#line 551 "View.MemoryView" - - -#line 551 "View.MemoryView" /* Python wrapper */ - -#line 551 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 551 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { - -#line 551 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 551 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 551 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 551 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 551 "View.MemoryView" - - -#line 551 "View.MemoryView" /* function exit code */ - -#line 551 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 551 "View.MemoryView" return __pyx_r; - -#line 551 "View.MemoryView" } -#line 551 "View.MemoryView" - - -#line 551 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - Py_ssize_t __pyx_v_length -#line 551 "View.MemoryView" -; - -#line 551 "View.MemoryView" + Py_ssize_t __pyx_v_length; PyObject *__pyx_r = NULL; - -#line 551 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 551 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 551 "View.MemoryView" Py_ssize_t *__pyx_t_2; - -#line 551 "View.MemoryView" Py_ssize_t *__pyx_t_3; - -#line 551 "View.MemoryView" Py_ssize_t *__pyx_t_4; - -#line 551 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 551 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":552 * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ - -#line 552 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 552 "View.MemoryView" __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) - -#line 552 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 552 "View.MemoryView" __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); - -#line 552 "View.MemoryView" for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { - -#line 552 "View.MemoryView" __pyx_t_2 = __pyx_t_4; - -#line 552 "View.MemoryView" __pyx_v_length = (__pyx_t_2[0]); - -#line 552 "View.MemoryView" __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L1_error) - -#line 552 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 552 "View.MemoryView" if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 552, __pyx_L1_error) - -#line 552 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 552 "View.MemoryView" } - -#line 552 "View.MemoryView" __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L1_error) - -#line 552 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 552 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 552 "View.MemoryView" __pyx_r = __pyx_t_5; - -#line 552 "View.MemoryView" __pyx_t_5 = 0; - -#line 552 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":551 - * + * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * + * */ -#line 551 "View.MemoryView" - - -#line 551 "View.MemoryView" /* function exit code */ - -#line 551 "View.MemoryView" __pyx_L1_error:; - -#line 551 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 551 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 551 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 551 "View.MemoryView" __pyx_r = NULL; - -#line 551 "View.MemoryView" __pyx_L0:; - -#line 551 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 551 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 551 "View.MemoryView" return __pyx_r; - -#line 551 "View.MemoryView" } /* "View.MemoryView":555 - * + * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: - * + * */ -#line 555 "View.MemoryView" - - -#line 555 "View.MemoryView" /* Python wrapper */ - -#line 555 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 555 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { - -#line 555 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 555 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 555 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 555 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 555 "View.MemoryView" - - -#line 555 "View.MemoryView" /* function exit code */ - -#line 555 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 555 "View.MemoryView" return __pyx_r; - -#line 555 "View.MemoryView" } -#line 555 "View.MemoryView" - - -#line 555 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - Py_ssize_t __pyx_v_stride -#line 555 "View.MemoryView" -; - -#line 555 "View.MemoryView" + Py_ssize_t __pyx_v_stride; PyObject *__pyx_r = NULL; - -#line 555 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 555 "View.MemoryView" int __pyx_t_1; - -#line 555 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 555 "View.MemoryView" Py_ssize_t *__pyx_t_3; - -#line 555 "View.MemoryView" Py_ssize_t *__pyx_t_4; - -#line 555 "View.MemoryView" Py_ssize_t *__pyx_t_5; - -#line 555 "View.MemoryView" PyObject *__pyx_t_6 = NULL; - -#line 555 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":556 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * + * * raise ValueError("Buffer view does not expose strides") */ - -#line 556 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); - -#line 556 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":558 * if self.view.strides == NULL: - * + * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - -#line 558 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) - -#line 558 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 558 "View.MemoryView" __Pyx_Raise(__pyx_t_2, 0, 0, 0); - -#line 558 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 558 "View.MemoryView" __PYX_ERR(0, 558, __pyx_L1_error) /* "View.MemoryView":556 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * + * * raise ValueError("Buffer view does not expose strides") */ - -#line 556 "View.MemoryView" } /* "View.MemoryView":560 * raise ValueError("Buffer view does not expose strides") - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ - -#line 560 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 560 "View.MemoryView" __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) - -#line 560 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 560 "View.MemoryView" __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); - -#line 560 "View.MemoryView" for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { - -#line 560 "View.MemoryView" __pyx_t_3 = __pyx_t_5; - -#line 560 "View.MemoryView" __pyx_v_stride = (__pyx_t_3[0]); - -#line 560 "View.MemoryView" __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) - -#line 560 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 560 "View.MemoryView" if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 560, __pyx_L1_error) - -#line 560 "View.MemoryView" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 560 "View.MemoryView" } - -#line 560 "View.MemoryView" __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) - -#line 560 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 560 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 560 "View.MemoryView" __pyx_r = __pyx_t_6; - -#line 560 "View.MemoryView" __pyx_t_6 = 0; - -#line 560 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":555 - * + * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: - * + * */ -#line 555 "View.MemoryView" - - -#line 555 "View.MemoryView" /* function exit code */ - -#line 555 "View.MemoryView" __pyx_L1_error:; - -#line 555 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 555 "View.MemoryView" __Pyx_XDECREF(__pyx_t_6); - -#line 555 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 555 "View.MemoryView" __pyx_r = NULL; - -#line 555 "View.MemoryView" __pyx_L0:; - -#line 555 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 555 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 555 "View.MemoryView" return __pyx_r; - -#line 555 "View.MemoryView" } /* "View.MemoryView":563 - * + * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim */ -#line 563 "View.MemoryView" - - -#line 563 "View.MemoryView" /* Python wrapper */ - -#line 563 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 563 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { - -#line 563 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 563 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 563 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 563 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 563 "View.MemoryView" - - -#line 563 "View.MemoryView" /* function exit code */ - -#line 563 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 563 "View.MemoryView" return __pyx_r; - -#line 563 "View.MemoryView" } -#line 563 "View.MemoryView" - - -#line 563 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - Py_ssize_t __pyx_v_suboffset -#line 563 "View.MemoryView" -; - -#line 563 "View.MemoryView" + Py_ssize_t __pyx_v_suboffset; PyObject *__pyx_r = NULL; - -#line 563 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 563 "View.MemoryView" int __pyx_t_1; - -#line 563 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 563 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 563 "View.MemoryView" Py_ssize_t *__pyx_t_4; - -#line 563 "View.MemoryView" Py_ssize_t *__pyx_t_5; - -#line 563 "View.MemoryView" Py_ssize_t *__pyx_t_6; - -#line 563 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":564 @@ -24136,48 +12955,26 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim - * + * */ - -#line 564 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); - -#line 564 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":565 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< - * + * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - -#line 565 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 565 "View.MemoryView" __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) - -#line 565 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 565 "View.MemoryView" __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__22, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) - -#line 565 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 565 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 565 "View.MemoryView" __pyx_r = __pyx_t_3; - -#line 565 "View.MemoryView" __pyx_t_3 = 0; - -#line 565 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":564 @@ -24185,628 +12982,278 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim - * + * */ - -#line 564 "View.MemoryView" } /* "View.MemoryView":567 * return (-1,) * self.view.ndim - * + * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ - -#line 567 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 567 "View.MemoryView" __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) - -#line 567 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 567 "View.MemoryView" __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); - -#line 567 "View.MemoryView" for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { - -#line 567 "View.MemoryView" __pyx_t_4 = __pyx_t_6; - -#line 567 "View.MemoryView" __pyx_v_suboffset = (__pyx_t_4[0]); - -#line 567 "View.MemoryView" __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) - -#line 567 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 567 "View.MemoryView" if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 567, __pyx_L1_error) - -#line 567 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 567 "View.MemoryView" } - -#line 567 "View.MemoryView" __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) - -#line 567 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 567 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 567 "View.MemoryView" __pyx_r = __pyx_t_2; - -#line 567 "View.MemoryView" __pyx_t_2 = 0; - -#line 567 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":563 - * + * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim */ -#line 563 "View.MemoryView" - - -#line 563 "View.MemoryView" /* function exit code */ - -#line 563 "View.MemoryView" __pyx_L1_error:; - -#line 563 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 563 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 563 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 563 "View.MemoryView" __pyx_r = NULL; - -#line 563 "View.MemoryView" __pyx_L0:; - -#line 563 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 563 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 563 "View.MemoryView" return __pyx_r; - -#line 563 "View.MemoryView" } /* "View.MemoryView":570 - * + * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim - * + * */ -#line 570 "View.MemoryView" - - -#line 570 "View.MemoryView" /* Python wrapper */ - -#line 570 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 570 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { - -#line 570 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 570 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 570 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 570 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 570 "View.MemoryView" - - -#line 570 "View.MemoryView" /* function exit code */ - -#line 570 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 570 "View.MemoryView" return __pyx_r; - -#line 570 "View.MemoryView" } -#line 570 "View.MemoryView" - - -#line 570 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - -#line 570 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 570 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 570 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 570 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":571 * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< - * + * * @property */ - -#line 571 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 571 "View.MemoryView" __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) - -#line 571 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 571 "View.MemoryView" __pyx_r = __pyx_t_1; - -#line 571 "View.MemoryView" __pyx_t_1 = 0; - -#line 571 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":570 - * + * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim - * + * */ -#line 570 "View.MemoryView" - - -#line 570 "View.MemoryView" /* function exit code */ - -#line 570 "View.MemoryView" __pyx_L1_error:; - -#line 570 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 570 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 570 "View.MemoryView" __pyx_r = NULL; - -#line 570 "View.MemoryView" __pyx_L0:; - -#line 570 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 570 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 570 "View.MemoryView" return __pyx_r; - -#line 570 "View.MemoryView" } /* "View.MemoryView":574 - * + * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize - * + * */ -#line 574 "View.MemoryView" - - -#line 574 "View.MemoryView" /* Python wrapper */ - -#line 574 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 574 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { - -#line 574 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 574 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 574 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 574 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 574 "View.MemoryView" - - -#line 574 "View.MemoryView" /* function exit code */ - -#line 574 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 574 "View.MemoryView" return __pyx_r; - -#line 574 "View.MemoryView" } -#line 574 "View.MemoryView" - - -#line 574 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - -#line 574 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 574 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 574 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 574 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":575 * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< - * + * * @property */ - -#line 575 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 575 "View.MemoryView" __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) - -#line 575 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 575 "View.MemoryView" __pyx_r = __pyx_t_1; - -#line 575 "View.MemoryView" __pyx_t_1 = 0; - -#line 575 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":574 - * + * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize - * + * */ -#line 574 "View.MemoryView" - - -#line 574 "View.MemoryView" /* function exit code */ - -#line 574 "View.MemoryView" __pyx_L1_error:; - -#line 574 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 574 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 574 "View.MemoryView" __pyx_r = NULL; - -#line 574 "View.MemoryView" __pyx_L0:; - -#line 574 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 574 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 574 "View.MemoryView" return __pyx_r; - -#line 574 "View.MemoryView" } /* "View.MemoryView":578 - * + * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize - * + * */ -#line 578 "View.MemoryView" - - -#line 578 "View.MemoryView" /* Python wrapper */ - -#line 578 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 578 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { - -#line 578 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 578 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 578 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 578 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 578 "View.MemoryView" - - -#line 578 "View.MemoryView" /* function exit code */ - -#line 578 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 578 "View.MemoryView" return __pyx_r; - -#line 578 "View.MemoryView" } -#line 578 "View.MemoryView" - - -#line 578 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - -#line 578 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 578 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 578 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 578 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 578 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 578 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":579 * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< - * + * * @property */ - -#line 579 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 579 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) - -#line 579 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 579 "View.MemoryView" __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) - -#line 579 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 579 "View.MemoryView" __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) - -#line 579 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 579 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 579 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 579 "View.MemoryView" __pyx_r = __pyx_t_3; - -#line 579 "View.MemoryView" __pyx_t_3 = 0; - -#line 579 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":578 - * + * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize - * + * */ -#line 578 "View.MemoryView" - - -#line 578 "View.MemoryView" /* function exit code */ - -#line 578 "View.MemoryView" __pyx_L1_error:; - -#line 578 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 578 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 578 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 578 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 578 "View.MemoryView" __pyx_r = NULL; - -#line 578 "View.MemoryView" __pyx_L0:; - -#line 578 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 578 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 578 "View.MemoryView" return __pyx_r; - -#line 578 "View.MemoryView" } /* "View.MemoryView":582 - * + * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: * result = 1 */ -#line 582 "View.MemoryView" - - -#line 582 "View.MemoryView" /* Python wrapper */ - -#line 582 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 582 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { - -#line 582 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 582 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 582 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 582 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 582 "View.MemoryView" - - -#line 582 "View.MemoryView" /* function exit code */ - -#line 582 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 582 "View.MemoryView" return __pyx_r; - -#line 582 "View.MemoryView" } -#line 582 "View.MemoryView" - - -#line 582 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { - PyObject *__pyx_v_result = NULL -#line 582 "View.MemoryView" -; - PyObject *__pyx_v_length = NULL -#line 582 "View.MemoryView" -; - -#line 582 "View.MemoryView" + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; PyObject *__pyx_r = NULL; - -#line 582 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 582 "View.MemoryView" int __pyx_t_1; - -#line 582 "View.MemoryView" int __pyx_t_2; - -#line 582 "View.MemoryView" Py_ssize_t *__pyx_t_3; - -#line 582 "View.MemoryView" Py_ssize_t *__pyx_t_4; - -#line 582 "View.MemoryView" Py_ssize_t *__pyx_t_5; - -#line 582 "View.MemoryView" PyObject *__pyx_t_6 = NULL; - -#line 582 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":583 @@ -24814,105 +13261,61 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 - * + * */ - -#line 583 "View.MemoryView" __pyx_t_1 = (__pyx_v_self->_size == Py_None); - -#line 583 "View.MemoryView" __pyx_t_2 = (__pyx_t_1 != 0); - -#line 583 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":584 * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< - * + * * for length in self.view.shape[:self.view.ndim]: */ - -#line 584 "View.MemoryView" __Pyx_INCREF(__pyx_int_1); - -#line 584 "View.MemoryView" __pyx_v_result = __pyx_int_1; /* "View.MemoryView":586 * result = 1 - * + * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< * result *= length - * + * */ - -#line 586 "View.MemoryView" __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); - -#line 586 "View.MemoryView" for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { - -#line 586 "View.MemoryView" __pyx_t_3 = __pyx_t_5; - -#line 586 "View.MemoryView" __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L1_error) - -#line 586 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 586 "View.MemoryView" __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); - -#line 586 "View.MemoryView" __pyx_t_6 = 0; /* "View.MemoryView":587 - * + * * for length in self.view.shape[:self.view.ndim]: * result *= length # <<<<<<<<<<<<<< - * + * * self._size = result */ - -#line 587 "View.MemoryView" __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 587, __pyx_L1_error) - -#line 587 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 587 "View.MemoryView" __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); - -#line 587 "View.MemoryView" __pyx_t_6 = 0; - -#line 587 "View.MemoryView" } /* "View.MemoryView":589 * result *= length - * + * * self._size = result # <<<<<<<<<<<<<< - * + * * return self._size */ - -#line 589 "View.MemoryView" __Pyx_INCREF(__pyx_v_result); - -#line 589 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_result); - -#line 589 "View.MemoryView" __Pyx_GOTREF(__pyx_v_self->_size); - -#line 589 "View.MemoryView" __Pyx_DECREF(__pyx_v_self->_size); - -#line 589 "View.MemoryView" __pyx_v_self->_size = __pyx_v_result; /* "View.MemoryView":583 @@ -24920,707 +13323,331 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 - * + * */ - -#line 583 "View.MemoryView" } /* "View.MemoryView":591 * self._size = result - * + * * return self._size # <<<<<<<<<<<<<< - * + * * def __len__(self): */ - -#line 591 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 591 "View.MemoryView" __Pyx_INCREF(__pyx_v_self->_size); - -#line 591 "View.MemoryView" __pyx_r = __pyx_v_self->_size; - -#line 591 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":582 - * + * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: * result = 1 */ -#line 582 "View.MemoryView" - - -#line 582 "View.MemoryView" /* function exit code */ - -#line 582 "View.MemoryView" __pyx_L1_error:; - -#line 582 "View.MemoryView" __Pyx_XDECREF(__pyx_t_6); - -#line 582 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 582 "View.MemoryView" __pyx_r = NULL; - -#line 582 "View.MemoryView" __pyx_L0:; - -#line 582 "View.MemoryView" __Pyx_XDECREF(__pyx_v_result); - -#line 582 "View.MemoryView" __Pyx_XDECREF(__pyx_v_length); - -#line 582 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 582 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 582 "View.MemoryView" return __pyx_r; - -#line 582 "View.MemoryView" } /* "View.MemoryView":593 * return self._size - * + * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] */ -#line 593 "View.MemoryView" - - -#line 593 "View.MemoryView" /* Python wrapper */ - -#line 593 "View.MemoryView" static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ - -#line 593 "View.MemoryView" static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { - -#line 593 "View.MemoryView" Py_ssize_t __pyx_r; - -#line 593 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 593 "View.MemoryView" __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = -#line 593 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 593 "View.MemoryView" - - -#line 593 "View.MemoryView" /* function exit code */ - -#line 593 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 593 "View.MemoryView" return __pyx_r; - -#line 593 "View.MemoryView" } -#line 593 "View.MemoryView" - - -#line 593 "View.MemoryView" static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { - -#line 593 "View.MemoryView" Py_ssize_t __pyx_r; - -#line 593 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 593 "View.MemoryView" int __pyx_t_1; - -#line 593 "View.MemoryView" __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":594 - * + * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] - * + * */ - -#line 594 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); - -#line 594 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":595 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< - * + * * return 0 */ - -#line 595 "View.MemoryView" __pyx_r = (__pyx_v_self->view.shape[0]); - -#line 595 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":594 - * + * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] - * + * */ - -#line 594 "View.MemoryView" } /* "View.MemoryView":597 * return self.view.shape[0] - * + * * return 0 # <<<<<<<<<<<<<< - * + * * def __repr__(self): */ - -#line 597 "View.MemoryView" __pyx_r = 0; - -#line 597 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":593 * return self._size - * + * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] */ -#line 593 "View.MemoryView" - - -#line 593 "View.MemoryView" /* function exit code */ - -#line 593 "View.MemoryView" __pyx_L0:; - -#line 593 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 593 "View.MemoryView" return __pyx_r; - -#line 593 "View.MemoryView" } /* "View.MemoryView":599 * return 0 - * + * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) */ -#line 599 "View.MemoryView" - - -#line 599 "View.MemoryView" /* Python wrapper */ - -#line 599 "View.MemoryView" static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ - -#line 599 "View.MemoryView" static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { - -#line 599 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 599 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 599 "View.MemoryView" __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = -#line 599 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 599 "View.MemoryView" - - -#line 599 "View.MemoryView" /* function exit code */ - -#line 599 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 599 "View.MemoryView" return __pyx_r; - -#line 599 "View.MemoryView" } -#line 599 "View.MemoryView" - - -#line 599 "View.MemoryView" static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { - -#line 599 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 599 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 599 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 599 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 599 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 599 "View.MemoryView" __Pyx_RefNannySetupContext("__repr__", 0); /* "View.MemoryView":600 - * + * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) - * + * */ - -#line 600 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 600 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) - -#line 600 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 600 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) - -#line 600 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 600 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 600 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) - -#line 600 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 600 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":601 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< - * + * * def __str__(self): */ - -#line 601 "View.MemoryView" __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error) - -#line 601 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 601 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_self)); - -#line 601 "View.MemoryView" __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - -#line 601 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - -#line 601 "View.MemoryView" __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) - -#line 601 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 601 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":600 - * + * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) - * + * */ - -#line 600 "View.MemoryView" __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) - -#line 600 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 600 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 600 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - -#line 600 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 600 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - -#line 600 "View.MemoryView" __pyx_t_1 = 0; - -#line 600 "View.MemoryView" __pyx_t_3 = 0; - -#line 600 "View.MemoryView" __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) - -#line 600 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 600 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 600 "View.MemoryView" __pyx_r = __pyx_t_3; - -#line 600 "View.MemoryView" __pyx_t_3 = 0; - -#line 600 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":599 * return 0 - * + * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) */ -#line 599 "View.MemoryView" - - -#line 599 "View.MemoryView" /* function exit code */ - -#line 599 "View.MemoryView" __pyx_L1_error:; - -#line 599 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 599 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 599 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 599 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 599 "View.MemoryView" __pyx_r = NULL; - -#line 599 "View.MemoryView" __pyx_L0:; - -#line 599 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 599 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 599 "View.MemoryView" return __pyx_r; - -#line 599 "View.MemoryView" } /* "View.MemoryView":603 * id(self)) - * + * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) - * + * */ -#line 603 "View.MemoryView" - - -#line 603 "View.MemoryView" /* Python wrapper */ - -#line 603 "View.MemoryView" static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ - -#line 603 "View.MemoryView" static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { - -#line 603 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 603 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 603 "View.MemoryView" __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = -#line 603 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 603 "View.MemoryView" - - -#line 603 "View.MemoryView" /* function exit code */ - -#line 603 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 603 "View.MemoryView" return __pyx_r; - -#line 603 "View.MemoryView" } -#line 603 "View.MemoryView" - - -#line 603 "View.MemoryView" static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { - -#line 603 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 603 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 603 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 603 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 603 "View.MemoryView" __Pyx_RefNannySetupContext("__str__", 0); /* "View.MemoryView":604 - * + * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 604 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 604 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) - -#line 604 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 604 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) - -#line 604 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 604 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 604 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) - -#line 604 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 604 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 604 "View.MemoryView" __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) - -#line 604 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 604 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 604 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - -#line 604 "View.MemoryView" __pyx_t_1 = 0; - -#line 604 "View.MemoryView" __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) - -#line 604 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 604 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 604 "View.MemoryView" __pyx_r = __pyx_t_1; - -#line 604 "View.MemoryView" __pyx_t_1 = 0; - -#line 604 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":603 * id(self)) - * + * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) - * + * */ -#line 603 "View.MemoryView" - - -#line 603 "View.MemoryView" /* function exit code */ - -#line 603 "View.MemoryView" __pyx_L1_error:; - -#line 603 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 603 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 603 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 603 "View.MemoryView" __pyx_r = NULL; - -#line 603 "View.MemoryView" __pyx_L0:; - -#line 603 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 603 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 603 "View.MemoryView" return __pyx_r; - -#line 603 "View.MemoryView" } /* "View.MemoryView":607 - * - * + * + * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ -#line 607 "View.MemoryView" - - -#line 607 "View.MemoryView" /* Python wrapper */ - -#line 607 "View.MemoryView" static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 607 "View.MemoryView" static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 607 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 607 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 607 "View.MemoryView" __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); - __pyx_r = -#line 607 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 607 "View.MemoryView" - - -#line 607 "View.MemoryView" /* function exit code */ - -#line 607 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 607 "View.MemoryView" return __pyx_r; - -#line 607 "View.MemoryView" } -#line 607 "View.MemoryView" - - -#line 607 "View.MemoryView" static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { - __Pyx_memviewslice *__pyx_v_mslice -#line 607 "View.MemoryView" -; - __Pyx_memviewslice __pyx_v_tmp -#line 607 "View.MemoryView" -; - -#line 607 "View.MemoryView" + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; PyObject *__pyx_r = NULL; - -#line 607 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 607 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 607 "View.MemoryView" __Pyx_RefNannySetupContext("is_c_contig", 0); /* "View.MemoryView":610 @@ -25628,148 +13655,70 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * */ - -#line 610 "View.MemoryView" __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); /* "View.MemoryView":611 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< - * + * * def is_f_contig(self): */ - -#line 611 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 611 "View.MemoryView" __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) - -#line 611 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 611 "View.MemoryView" __pyx_r = __pyx_t_1; - -#line 611 "View.MemoryView" __pyx_t_1 = 0; - -#line 611 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":607 - * - * + * + * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ -#line 607 "View.MemoryView" - - -#line 607 "View.MemoryView" /* function exit code */ - -#line 607 "View.MemoryView" __pyx_L1_error:; - -#line 607 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 607 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 607 "View.MemoryView" __pyx_r = NULL; - -#line 607 "View.MemoryView" __pyx_L0:; - -#line 607 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 607 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 607 "View.MemoryView" return __pyx_r; - -#line 607 "View.MemoryView" } /* "View.MemoryView":613 * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ -#line 613 "View.MemoryView" - - -#line 613 "View.MemoryView" /* Python wrapper */ - -#line 613 "View.MemoryView" static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 613 "View.MemoryView" static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 613 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 613 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 613 "View.MemoryView" __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); - __pyx_r = -#line 613 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 613 "View.MemoryView" - - -#line 613 "View.MemoryView" /* function exit code */ - -#line 613 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 613 "View.MemoryView" return __pyx_r; - -#line 613 "View.MemoryView" } -#line 613 "View.MemoryView" - - -#line 613 "View.MemoryView" static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { - __Pyx_memviewslice *__pyx_v_mslice -#line 613 "View.MemoryView" -; - __Pyx_memviewslice __pyx_v_tmp -#line 613 "View.MemoryView" -; - -#line 613 "View.MemoryView" + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; PyObject *__pyx_r = NULL; - -#line 613 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 613 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 613 "View.MemoryView" __Pyx_RefNannySetupContext("is_f_contig", 0); /* "View.MemoryView":616 @@ -25777,434 +13726,224 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * */ - -#line 616 "View.MemoryView" __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); /* "View.MemoryView":617 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< - * + * * def copy(self): */ - -#line 617 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 617 "View.MemoryView" __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) - -#line 617 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 617 "View.MemoryView" __pyx_r = __pyx_t_1; - -#line 617 "View.MemoryView" __pyx_t_1 = 0; - -#line 617 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":613 * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ -#line 613 "View.MemoryView" - - -#line 613 "View.MemoryView" /* function exit code */ - -#line 613 "View.MemoryView" __pyx_L1_error:; - -#line 613 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 613 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 613 "View.MemoryView" __pyx_r = NULL; - -#line 613 "View.MemoryView" __pyx_L0:; - -#line 613 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 613 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 613 "View.MemoryView" return __pyx_r; - -#line 613 "View.MemoryView" } /* "View.MemoryView":619 * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ -#line 619 "View.MemoryView" - - -#line 619 "View.MemoryView" /* Python wrapper */ - -#line 619 "View.MemoryView" static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 619 "View.MemoryView" static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 619 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 619 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 619 "View.MemoryView" __Pyx_RefNannySetupContext("copy (wrapper)", 0); - __pyx_r = -#line 619 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 619 "View.MemoryView" - - -#line 619 "View.MemoryView" /* function exit code */ - -#line 619 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 619 "View.MemoryView" return __pyx_r; - -#line 619 "View.MemoryView" } -#line 619 "View.MemoryView" - - -#line 619 "View.MemoryView" static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { - __Pyx_memviewslice __pyx_v_mslice -#line 619 "View.MemoryView" -; - int __pyx_v_flags -#line 619 "View.MemoryView" -; - -#line 619 "View.MemoryView" + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; PyObject *__pyx_r = NULL; - -#line 619 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 619 "View.MemoryView" __Pyx_memviewslice __pyx_t_1; - -#line 619 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 619 "View.MemoryView" __Pyx_RefNannySetupContext("copy", 0); /* "View.MemoryView":621 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< - * + * * slice_copy(self, &mslice) */ - -#line 621 "View.MemoryView" __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); /* "View.MemoryView":623 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS - * + * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, * self.view.itemsize, */ - -#line 623 "View.MemoryView" __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); /* "View.MemoryView":624 - * + * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_C_CONTIGUOUS, */ - -#line 624 "View.MemoryView" __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L1_error) - -#line 624 "View.MemoryView" __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":629 * self.dtype_is_object) - * + * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< - * + * * def copy_fortran(self): */ - -#line 629 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 629 "View.MemoryView" __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) - -#line 629 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 629 "View.MemoryView" __pyx_r = __pyx_t_2; - -#line 629 "View.MemoryView" __pyx_t_2 = 0; - -#line 629 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":619 * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ -#line 619 "View.MemoryView" - - -#line 619 "View.MemoryView" /* function exit code */ - -#line 619 "View.MemoryView" __pyx_L1_error:; - -#line 619 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 619 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 619 "View.MemoryView" __pyx_r = NULL; - -#line 619 "View.MemoryView" __pyx_L0:; - -#line 619 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 619 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 619 "View.MemoryView" return __pyx_r; - -#line 619 "View.MemoryView" } /* "View.MemoryView":631 * return memoryview_copy_from_slice(self, &mslice) - * + * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ -#line 631 "View.MemoryView" - - -#line 631 "View.MemoryView" /* Python wrapper */ - -#line 631 "View.MemoryView" static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 631 "View.MemoryView" static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 631 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 631 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 631 "View.MemoryView" __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); - __pyx_r = -#line 631 "View.MemoryView" -__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 631 "View.MemoryView" - - -#line 631 "View.MemoryView" /* function exit code */ - -#line 631 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 631 "View.MemoryView" return __pyx_r; - -#line 631 "View.MemoryView" } -#line 631 "View.MemoryView" - - -#line 631 "View.MemoryView" static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { - __Pyx_memviewslice __pyx_v_src -#line 631 "View.MemoryView" -; - __Pyx_memviewslice __pyx_v_dst -#line 631 "View.MemoryView" -; - int __pyx_v_flags -#line 631 "View.MemoryView" -; - -#line 631 "View.MemoryView" + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; PyObject *__pyx_r = NULL; - -#line 631 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 631 "View.MemoryView" __Pyx_memviewslice __pyx_t_1; - -#line 631 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 631 "View.MemoryView" __Pyx_RefNannySetupContext("copy_fortran", 0); /* "View.MemoryView":633 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< - * + * * slice_copy(self, &src) */ - -#line 633 "View.MemoryView" __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); /* "View.MemoryView":635 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS - * + * * slice_copy(self, &src) # <<<<<<<<<<<<<< * dst = slice_copy_contig(&src, "fortran", self.view.ndim, * self.view.itemsize, */ - -#line 635 "View.MemoryView" __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); /* "View.MemoryView":636 - * + * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_F_CONTIGUOUS, */ - -#line 636 "View.MemoryView" __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L1_error) - -#line 636 "View.MemoryView" __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":641 * self.dtype_is_object) - * + * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 641 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 641 "View.MemoryView" __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) - -#line 641 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 641 "View.MemoryView" __pyx_r = __pyx_t_2; - -#line 641 "View.MemoryView" __pyx_t_2 = 0; - -#line 641 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":631 * return memoryview_copy_from_slice(self, &mslice) - * + * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ -#line 631 "View.MemoryView" - - -#line 631 "View.MemoryView" /* function exit code */ - -#line 631 "View.MemoryView" __pyx_L1_error:; - -#line 631 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 631 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 631 "View.MemoryView" __pyx_r = NULL; - -#line 631 "View.MemoryView" __pyx_L0:; - -#line 631 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 631 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 631 "View.MemoryView" return __pyx_r; - -#line 631 "View.MemoryView" } /* "(tree fragment)":1 @@ -26213,61 +13952,23 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* Python wrapper */ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = -#line 1 "(tree fragment)" -__pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 @@ -26276,20 +13977,10 @@ static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struc * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - -#line 2 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 2 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 2 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 2 "(tree fragment)" __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 @@ -26298,34 +13989,14 @@ static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struc * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 1 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } /* "(tree fragment)":3 @@ -26335,61 +14006,23 @@ static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struc * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* Python wrapper */ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = -#line 3 "(tree fragment)" -__pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 @@ -26397,20 +14030,10 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 4 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 4 "(tree fragment)" __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 @@ -26420,69 +14043,31 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __pyx_L1_error:; - -#line 3 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 3 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 3 "(tree fragment)" __pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } /* "View.MemoryView":645 - * + * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo */ -#line 645 "View.MemoryView" - - -#line 645 "View.MemoryView" static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { - struct __pyx_memoryview_obj *__pyx_v_result = 0 -#line 645 "View.MemoryView" -; - -#line 645 "View.MemoryView" + struct __pyx_memoryview_obj *__pyx_v_result = 0; PyObject *__pyx_r = NULL; - -#line 645 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 645 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 645 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 645 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 645 "View.MemoryView" __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); /* "View.MemoryView":646 @@ -26492,65 +14077,25 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in * result.typeinfo = typeinfo * return result */ - -#line 646 "View.MemoryView" __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) - -#line 646 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 646 "View.MemoryView" __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) - -#line 646 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 646 "View.MemoryView" __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) - -#line 646 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 646 "View.MemoryView" __Pyx_INCREF(__pyx_v_o); - -#line 646 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_o); - -#line 646 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); - -#line 646 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 646 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - -#line 646 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_2); - -#line 646 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); - -#line 646 "View.MemoryView" __pyx_t_1 = 0; - -#line 646 "View.MemoryView" __pyx_t_2 = 0; - -#line 646 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) - -#line 646 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 646 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 646 "View.MemoryView" __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); - -#line 646 "View.MemoryView" __pyx_t_2 = 0; /* "View.MemoryView":647 @@ -26558,226 +14103,112 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< * return result - * + * */ - -#line 647 "View.MemoryView" __pyx_v_result->typeinfo = __pyx_v_typeinfo; /* "View.MemoryView":648 * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_check') */ - -#line 648 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 648 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_result)); - -#line 648 "View.MemoryView" __pyx_r = ((PyObject *)__pyx_v_result); - -#line 648 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":645 - * + * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo */ -#line 645 "View.MemoryView" - - -#line 645 "View.MemoryView" /* function exit code */ - -#line 645 "View.MemoryView" __pyx_L1_error:; - -#line 645 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 645 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 645 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 645 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 645 "View.MemoryView" __pyx_r = 0; - -#line 645 "View.MemoryView" __pyx_L0:; - -#line 645 "View.MemoryView" __Pyx_XDECREF((PyObject *)__pyx_v_result); - -#line 645 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 645 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 645 "View.MemoryView" return __pyx_r; - -#line 645 "View.MemoryView" } /* "View.MemoryView":651 - * + * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) - * + * */ -#line 651 "View.MemoryView" - - -#line 651 "View.MemoryView" static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { - -#line 651 "View.MemoryView" int __pyx_r; - -#line 651 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 651 "View.MemoryView" int __pyx_t_1; - -#line 651 "View.MemoryView" __Pyx_RefNannySetupContext("memoryview_check", 0); /* "View.MemoryView":652 * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): * return isinstance(o, memoryview) # <<<<<<<<<<<<<< - * + * * cdef tuple _unellipsify(object index, int ndim): */ - -#line 652 "View.MemoryView" - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); - -#line 652 "View.MemoryView" + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); __pyx_r = __pyx_t_1; - -#line 652 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":651 - * + * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) - * + * */ -#line 651 "View.MemoryView" - - -#line 651 "View.MemoryView" /* function exit code */ - -#line 651 "View.MemoryView" __pyx_L0:; - -#line 651 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 651 "View.MemoryView" return __pyx_r; - -#line 651 "View.MemoryView" } /* "View.MemoryView":654 * return isinstance(o, memoryview) - * + * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with */ -#line 654 "View.MemoryView" - - -#line 654 "View.MemoryView" static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { - PyObject *__pyx_v_tup = NULL -#line 654 "View.MemoryView" -; - PyObject *__pyx_v_result = NULL -#line 654 "View.MemoryView" -; - int __pyx_v_have_slices -#line 654 "View.MemoryView" -; - int __pyx_v_seen_ellipsis -#line 654 "View.MemoryView" -; - CYTHON_UNUSED PyObject *__pyx_v_idx = NULL -#line 654 "View.MemoryView" -; - PyObject *__pyx_v_item = NULL -#line 654 "View.MemoryView" -; - Py_ssize_t __pyx_v_nslices -#line 654 "View.MemoryView" -; - -#line 654 "View.MemoryView" + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; PyObject *__pyx_r = NULL; - -#line 654 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 654 "View.MemoryView" int __pyx_t_1; - -#line 654 "View.MemoryView" int __pyx_t_2; - -#line 654 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 654 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 654 "View.MemoryView" Py_ssize_t __pyx_t_5; - -#line 654 "View.MemoryView" PyObject *(*__pyx_t_6)(PyObject *); - -#line 654 "View.MemoryView" PyObject *__pyx_t_7 = NULL; - -#line 654 "View.MemoryView" Py_ssize_t __pyx_t_8; - -#line 654 "View.MemoryView" int __pyx_t_9; - -#line 654 "View.MemoryView" int __pyx_t_10; - -#line 654 "View.MemoryView" PyObject *__pyx_t_11 = NULL; - -#line 654 "View.MemoryView" __Pyx_RefNannySetupContext("_unellipsify", 0); /* "View.MemoryView":659 @@ -26787,14 +14218,8 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * tup = (index,) * else: */ - -#line 659 "View.MemoryView" - __pyx_t_1 = PyTuple_Check(__pyx_v_index); - -#line 659 "View.MemoryView" + __pyx_t_1 = PyTuple_Check(__pyx_v_index); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); - -#line 659 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":660 @@ -26804,26 +14229,12 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: * tup = index */ - -#line 660 "View.MemoryView" __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) - -#line 660 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 660 "View.MemoryView" __Pyx_INCREF(__pyx_v_index); - -#line 660 "View.MemoryView" __Pyx_GIVEREF(__pyx_v_index); - -#line 660 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); - -#line 660 "View.MemoryView" __pyx_v_tup = __pyx_t_3; - -#line 660 "View.MemoryView" __pyx_t_3 = 0; /* "View.MemoryView":659 @@ -26833,65 +14244,41 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * tup = (index,) * else: */ - -#line 659 "View.MemoryView" goto __pyx_L3; - -#line 659 "View.MemoryView" } /* "View.MemoryView":662 * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< - * + * * result = [] */ - -#line 662 "View.MemoryView" /*else*/ { - -#line 662 "View.MemoryView" __Pyx_INCREF(__pyx_v_index); - -#line 662 "View.MemoryView" __pyx_v_tup = __pyx_v_index; - -#line 662 "View.MemoryView" } - -#line 662 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":664 * tup = index - * + * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False */ - -#line 664 "View.MemoryView" __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) - -#line 664 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 664 "View.MemoryView" __pyx_v_result = ((PyObject*)__pyx_t_3); - -#line 664 "View.MemoryView" __pyx_t_3 = 0; /* "View.MemoryView":665 - * + * * result = [] * have_slices = False # <<<<<<<<<<<<<< * seen_ellipsis = False * for idx, item in enumerate(tup): */ - -#line 665 "View.MemoryView" __pyx_v_have_slices = 0; /* "View.MemoryView":666 @@ -26901,8 +14288,6 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * for idx, item in enumerate(tup): * if item is Ellipsis: */ - -#line 666 "View.MemoryView" __pyx_v_seen_ellipsis = 0; /* "View.MemoryView":667 @@ -26912,155 +14297,55 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * if item is Ellipsis: * if not seen_ellipsis: */ - -#line 667 "View.MemoryView" __Pyx_INCREF(__pyx_int_0); - -#line 667 "View.MemoryView" __pyx_t_3 = __pyx_int_0; - -#line 667 "View.MemoryView" if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { - -#line 667 "View.MemoryView" __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; - -#line 667 "View.MemoryView" __pyx_t_6 = NULL; - -#line 667 "View.MemoryView" } else { - __pyx_t_5 = -1; -#line 667 "View.MemoryView" -__pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error) - -#line 667 "View.MemoryView" + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - -#line 667 "View.MemoryView" __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error) - -#line 667 "View.MemoryView" } - -#line 667 "View.MemoryView" for (;;) { - -#line 667 "View.MemoryView" if (likely(!__pyx_t_6)) { - -#line 667 "View.MemoryView" if (likely(PyList_CheckExact(__pyx_t_4))) { - -#line 667 "View.MemoryView" if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; - -#line 667 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 667 "View.MemoryView" __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 667, __pyx_L1_error) - -#line 667 "View.MemoryView" #else - -#line 667 "View.MemoryView" __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error) - -#line 667 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 667 "View.MemoryView" #endif - -#line 667 "View.MemoryView" } else { - -#line 667 "View.MemoryView" if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - -#line 667 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 667 "View.MemoryView" __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 667, __pyx_L1_error) - -#line 667 "View.MemoryView" #else - -#line 667 "View.MemoryView" __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error) - -#line 667 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 667 "View.MemoryView" #endif - -#line 667 "View.MemoryView" } - } else -#line 667 "View.MemoryView" -{ - -#line 667 "View.MemoryView" + } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); - -#line 667 "View.MemoryView" if (unlikely(!__pyx_t_7)) { - -#line 667 "View.MemoryView" PyObject* exc_type = PyErr_Occurred(); - -#line 667 "View.MemoryView" if (exc_type) { - -#line 667 "View.MemoryView" if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - -#line 667 "View.MemoryView" else __PYX_ERR(0, 667, __pyx_L1_error) - -#line 667 "View.MemoryView" } - -#line 667 "View.MemoryView" break; - -#line 667 "View.MemoryView" } - -#line 667 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 667 "View.MemoryView" } - -#line 667 "View.MemoryView" __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); - -#line 667 "View.MemoryView" __pyx_t_7 = 0; - -#line 667 "View.MemoryView" __Pyx_INCREF(__pyx_t_3); - -#line 667 "View.MemoryView" __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); - -#line 667 "View.MemoryView" __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error) - -#line 667 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 667 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); - -#line 667 "View.MemoryView" __pyx_t_3 = __pyx_t_7; - -#line 667 "View.MemoryView" __pyx_t_7 = 0; /* "View.MemoryView":668 @@ -27070,14 +14355,8 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) */ - -#line 668 "View.MemoryView" __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); - -#line 668 "View.MemoryView" __pyx_t_1 = (__pyx_t_2 != 0); - -#line 668 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":669 @@ -27087,11 +14366,7 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True */ - -#line 669 "View.MemoryView" __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); - -#line 669 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":670 @@ -27101,41 +14376,17 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * seen_ellipsis = True * else: */ - -#line 670 "View.MemoryView" __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 670, __pyx_L1_error) - -#line 670 "View.MemoryView" __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 670, __pyx_L1_error) - -#line 670 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 670 "View.MemoryView" { Py_ssize_t __pyx_temp; - -#line 670 "View.MemoryView" for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - -#line 670 "View.MemoryView" __Pyx_INCREF(__pyx_slice__25); - -#line 670 "View.MemoryView" __Pyx_GIVEREF(__pyx_slice__25); - -#line 670 "View.MemoryView" PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__25); - -#line 670 "View.MemoryView" } - -#line 670 "View.MemoryView" } - -#line 670 "View.MemoryView" __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 670, __pyx_L1_error) - -#line 670 "View.MemoryView" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":671 @@ -27145,8 +14396,6 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * else: * result.append(slice(None)) */ - -#line 671 "View.MemoryView" __pyx_v_seen_ellipsis = 1; /* "View.MemoryView":669 @@ -27156,11 +14405,7 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True */ - -#line 669 "View.MemoryView" goto __pyx_L7; - -#line 669 "View.MemoryView" } /* "View.MemoryView":673 @@ -27170,17 +14415,9 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * have_slices = True * else: */ - -#line 673 "View.MemoryView" /*else*/ { - -#line 673 "View.MemoryView" __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__26); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 673, __pyx_L1_error) - -#line 673 "View.MemoryView" } - -#line 673 "View.MemoryView" __pyx_L7:; /* "View.MemoryView":674 @@ -27190,8 +14427,6 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): */ - -#line 674 "View.MemoryView" __pyx_v_have_slices = 1; /* "View.MemoryView":668 @@ -27201,11 +14436,7 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) */ - -#line 668 "View.MemoryView" goto __pyx_L6; - -#line 668 "View.MemoryView" } /* "View.MemoryView":676 @@ -27213,90 +14444,40 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * */ - -#line 676 "View.MemoryView" /*else*/ { - -#line 676 "View.MemoryView" - __pyx_t_2 = PySlice_Check(__pyx_v_item); - -#line 676 "View.MemoryView" + __pyx_t_2 = PySlice_Check(__pyx_v_item); __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); - -#line 676 "View.MemoryView" if (__pyx_t_10) { - -#line 676 "View.MemoryView" } else { - -#line 676 "View.MemoryView" __pyx_t_1 = __pyx_t_10; - -#line 676 "View.MemoryView" goto __pyx_L9_bool_binop_done; - -#line 676 "View.MemoryView" } - -#line 676 "View.MemoryView" __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); - -#line 676 "View.MemoryView" __pyx_t_1 = __pyx_t_10; - -#line 676 "View.MemoryView" __pyx_L9_bool_binop_done:; - -#line 676 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":677 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< - * + * * have_slices = have_slices or isinstance(item, slice) */ - -#line 677 "View.MemoryView" __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __pyx_L1_error) - -#line 677 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 677 "View.MemoryView" __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 677, __pyx_L1_error) - -#line 677 "View.MemoryView" __Pyx_GOTREF(__pyx_t_11); - -#line 677 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_7); - -#line 677 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); - -#line 677 "View.MemoryView" __pyx_t_7 = 0; - -#line 677 "View.MemoryView" __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __pyx_L1_error) - -#line 677 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 677 "View.MemoryView" __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - -#line 677 "View.MemoryView" __Pyx_Raise(__pyx_t_7, 0, 0, 0); - -#line 677 "View.MemoryView" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 677 "View.MemoryView" __PYX_ERR(0, 677, __pyx_L1_error) /* "View.MemoryView":676 @@ -27304,68 +14485,38 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * */ - -#line 676 "View.MemoryView" } /* "View.MemoryView":679 * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< * result.append(item) - * + * */ - -#line 679 "View.MemoryView" __pyx_t_10 = (__pyx_v_have_slices != 0); - -#line 679 "View.MemoryView" if (!__pyx_t_10) { - -#line 679 "View.MemoryView" } else { - -#line 679 "View.MemoryView" __pyx_t_1 = __pyx_t_10; - -#line 679 "View.MemoryView" goto __pyx_L11_bool_binop_done; - -#line 679 "View.MemoryView" } - -#line 679 "View.MemoryView" - __pyx_t_10 = PySlice_Check(__pyx_v_item); - -#line 679 "View.MemoryView" + __pyx_t_10 = PySlice_Check(__pyx_v_item); __pyx_t_2 = (__pyx_t_10 != 0); - -#line 679 "View.MemoryView" __pyx_t_1 = __pyx_t_2; - -#line 679 "View.MemoryView" __pyx_L11_bool_binop_done:; - -#line 679 "View.MemoryView" __pyx_v_have_slices = __pyx_t_1; /* "View.MemoryView":680 - * + * * have_slices = have_slices or isinstance(item, slice) * result.append(item) # <<<<<<<<<<<<<< - * + * * nslices = ndim - len(result) */ - -#line 680 "View.MemoryView" __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 680, __pyx_L1_error) - -#line 680 "View.MemoryView" } - -#line 680 "View.MemoryView" __pyx_L6:; /* "View.MemoryView":667 @@ -27375,306 +14526,148 @@ __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0 * if item is Ellipsis: * if not seen_ellipsis: */ - -#line 667 "View.MemoryView" } - -#line 667 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 667 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":682 * result.append(item) - * + * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) */ - -#line 682 "View.MemoryView" __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 682, __pyx_L1_error) - -#line 682 "View.MemoryView" __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":683 - * + * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) - * + * */ - -#line 683 "View.MemoryView" __pyx_t_1 = (__pyx_v_nslices != 0); - -#line 683 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":684 * nslices = ndim - len(result) * if nslices: * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< - * + * * return have_slices or nslices, tuple(result) */ - -#line 684 "View.MemoryView" __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error) - -#line 684 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 684 "View.MemoryView" { Py_ssize_t __pyx_temp; - -#line 684 "View.MemoryView" for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - -#line 684 "View.MemoryView" __Pyx_INCREF(__pyx_slice__27); - -#line 684 "View.MemoryView" __Pyx_GIVEREF(__pyx_slice__27); - -#line 684 "View.MemoryView" PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__27); - -#line 684 "View.MemoryView" } - -#line 684 "View.MemoryView" } - -#line 684 "View.MemoryView" __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 684, __pyx_L1_error) - -#line 684 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":683 - * + * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) - * + * */ - -#line 683 "View.MemoryView" } /* "View.MemoryView":686 * result.extend([slice(None)] * nslices) - * + * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): */ - -#line 686 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 686 "View.MemoryView" if (!__pyx_v_have_slices) { - -#line 686 "View.MemoryView" } else { - -#line 686 "View.MemoryView" __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) - -#line 686 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 686 "View.MemoryView" __pyx_t_3 = __pyx_t_4; - -#line 686 "View.MemoryView" __pyx_t_4 = 0; - -#line 686 "View.MemoryView" goto __pyx_L14_bool_binop_done; - -#line 686 "View.MemoryView" } - -#line 686 "View.MemoryView" __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) - -#line 686 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 686 "View.MemoryView" __pyx_t_3 = __pyx_t_4; - -#line 686 "View.MemoryView" __pyx_t_4 = 0; - -#line 686 "View.MemoryView" __pyx_L14_bool_binop_done:; - -#line 686 "View.MemoryView" __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) - -#line 686 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 686 "View.MemoryView" __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __pyx_L1_error) - -#line 686 "View.MemoryView" __Pyx_GOTREF(__pyx_t_7); - -#line 686 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 686 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - -#line 686 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_4); - -#line 686 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); - -#line 686 "View.MemoryView" __pyx_t_3 = 0; - -#line 686 "View.MemoryView" __pyx_t_4 = 0; - -#line 686 "View.MemoryView" __pyx_r = ((PyObject*)__pyx_t_7); - -#line 686 "View.MemoryView" __pyx_t_7 = 0; - -#line 686 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":654 * return isinstance(o, memoryview) - * + * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with */ -#line 654 "View.MemoryView" - - -#line 654 "View.MemoryView" /* function exit code */ - -#line 654 "View.MemoryView" __pyx_L1_error:; - -#line 654 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 654 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); - -#line 654 "View.MemoryView" __Pyx_XDECREF(__pyx_t_7); - -#line 654 "View.MemoryView" __Pyx_XDECREF(__pyx_t_11); - -#line 654 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 654 "View.MemoryView" __pyx_r = 0; - -#line 654 "View.MemoryView" __pyx_L0:; - -#line 654 "View.MemoryView" __Pyx_XDECREF(__pyx_v_tup); - -#line 654 "View.MemoryView" __Pyx_XDECREF(__pyx_v_result); - -#line 654 "View.MemoryView" __Pyx_XDECREF(__pyx_v_idx); - -#line 654 "View.MemoryView" __Pyx_XDECREF(__pyx_v_item); - -#line 654 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 654 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 654 "View.MemoryView" return __pyx_r; - -#line 654 "View.MemoryView" } /* "View.MemoryView":688 * return have_slices or nslices, tuple(result) - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: */ -#line 688 "View.MemoryView" - - -#line 688 "View.MemoryView" static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { - Py_ssize_t __pyx_v_suboffset -#line 688 "View.MemoryView" -; - -#line 688 "View.MemoryView" + Py_ssize_t __pyx_v_suboffset; PyObject *__pyx_r = NULL; - -#line 688 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 688 "View.MemoryView" Py_ssize_t *__pyx_t_1; - -#line 688 "View.MemoryView" Py_ssize_t *__pyx_t_2; - -#line 688 "View.MemoryView" Py_ssize_t *__pyx_t_3; - -#line 688 "View.MemoryView" int __pyx_t_4; - -#line 688 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 688 "View.MemoryView" __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); /* "View.MemoryView":689 - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") */ - -#line 689 "View.MemoryView" __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); - -#line 689 "View.MemoryView" for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { - -#line 689 "View.MemoryView" __pyx_t_1 = __pyx_t_3; - -#line 689 "View.MemoryView" __pyx_v_suboffset = (__pyx_t_1[0]); /* "View.MemoryView":690 @@ -27682,36 +14675,22 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") - * + * */ - -#line 690 "View.MemoryView" __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); - -#line 690 "View.MemoryView" if (__pyx_t_4) { /* "View.MemoryView":691 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 691 "View.MemoryView" __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error) - -#line 691 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 691 "View.MemoryView" __Pyx_Raise(__pyx_t_5, 0, 0, 0); - -#line 691 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 691 "View.MemoryView" __PYX_ERR(0, 691, __pyx_L1_error) /* "View.MemoryView":690 @@ -27719,167 +14698,71 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") - * + * */ - -#line 690 "View.MemoryView" } - -#line 690 "View.MemoryView" } /* "View.MemoryView":688 * return have_slices or nslices, tuple(result) - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: */ -#line 688 "View.MemoryView" - - -#line 688 "View.MemoryView" /* function exit code */ - -#line 688 "View.MemoryView" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 688 "View.MemoryView" goto __pyx_L0; - -#line 688 "View.MemoryView" __pyx_L1_error:; - -#line 688 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 688 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 688 "View.MemoryView" __pyx_r = 0; - -#line 688 "View.MemoryView" __pyx_L0:; - -#line 688 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 688 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 688 "View.MemoryView" return __pyx_r; - -#line 688 "View.MemoryView" } /* "View.MemoryView":698 - * + * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim * cdef bint negative_step */ -#line 698 "View.MemoryView" - - -#line 698 "View.MemoryView" static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { - int __pyx_v_new_ndim -#line 698 "View.MemoryView" -; - int __pyx_v_suboffset_dim -#line 698 "View.MemoryView" -; - int __pyx_v_dim -#line 698 "View.MemoryView" -; - __Pyx_memviewslice __pyx_v_src -#line 698 "View.MemoryView" -; - __Pyx_memviewslice __pyx_v_dst -#line 698 "View.MemoryView" -; - __Pyx_memviewslice *__pyx_v_p_src -#line 698 "View.MemoryView" -; - struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0 -#line 698 "View.MemoryView" -; - __Pyx_memviewslice *__pyx_v_p_dst -#line 698 "View.MemoryView" -; - int *__pyx_v_p_suboffset_dim -#line 698 "View.MemoryView" -; - Py_ssize_t __pyx_v_start -#line 698 "View.MemoryView" -; - Py_ssize_t __pyx_v_stop -#line 698 "View.MemoryView" -; - Py_ssize_t __pyx_v_step -#line 698 "View.MemoryView" -; - int __pyx_v_have_start -#line 698 "View.MemoryView" -; - int __pyx_v_have_stop -#line 698 "View.MemoryView" -; - int __pyx_v_have_step -#line 698 "View.MemoryView" -; - PyObject *__pyx_v_index = NULL -#line 698 "View.MemoryView" -; - -#line 698 "View.MemoryView" + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; struct __pyx_memoryview_obj *__pyx_r = NULL; - -#line 698 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 698 "View.MemoryView" int __pyx_t_1; - -#line 698 "View.MemoryView" int __pyx_t_2; - -#line 698 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 698 "View.MemoryView" struct __pyx_memoryview_obj *__pyx_t_4; - -#line 698 "View.MemoryView" char *__pyx_t_5; - -#line 698 "View.MemoryView" int __pyx_t_6; - -#line 698 "View.MemoryView" Py_ssize_t __pyx_t_7; - -#line 698 "View.MemoryView" PyObject *(*__pyx_t_8)(PyObject *); - -#line 698 "View.MemoryView" PyObject *__pyx_t_9 = NULL; - -#line 698 "View.MemoryView" Py_ssize_t __pyx_t_10; - -#line 698 "View.MemoryView" int __pyx_t_11; - -#line 698 "View.MemoryView" Py_ssize_t __pyx_t_12; - -#line 698 "View.MemoryView" __Pyx_RefNannySetupContext("memview_slice", 0); /* "View.MemoryView":699 @@ -27889,94 +14772,56 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * cdef bint negative_step * cdef __Pyx_memviewslice src, dst */ - -#line 699 "View.MemoryView" __pyx_v_new_ndim = 0; - -#line 699 "View.MemoryView" __pyx_v_suboffset_dim = -1; /* "View.MemoryView":706 - * - * + * + * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< - * + * * cdef _memoryviewslice memviewsliceobj */ - -#line 706 "View.MemoryView" memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); /* "View.MemoryView":710 * cdef _memoryviewslice memviewsliceobj - * + * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< - * + * * if isinstance(memview, _memoryviewslice): */ - -#line 710 "View.MemoryView" #ifndef CYTHON_WITHOUT_ASSERTIONS - -#line 710 "View.MemoryView" if (unlikely(!Py_OptimizeFlag)) { - -#line 710 "View.MemoryView" if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { - -#line 710 "View.MemoryView" PyErr_SetNone(PyExc_AssertionError); - -#line 710 "View.MemoryView" __PYX_ERR(0, 710, __pyx_L1_error) - -#line 710 "View.MemoryView" } - -#line 710 "View.MemoryView" } - -#line 710 "View.MemoryView" #endif /* "View.MemoryView":712 * assert memview.view.ndim > 0 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice */ - -#line 712 "View.MemoryView" - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - -#line 712 "View.MemoryView" + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); __pyx_t_2 = (__pyx_t_1 != 0); - -#line 712 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":713 - * + * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice * else: */ - -#line 713 "View.MemoryView" if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 713, __pyx_L1_error) - -#line 713 "View.MemoryView" __pyx_t_3 = ((PyObject *)__pyx_v_memview); - -#line 713 "View.MemoryView" __Pyx_INCREF(__pyx_t_3); - -#line 713 "View.MemoryView" __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); - -#line 713 "View.MemoryView" __pyx_t_3 = 0; /* "View.MemoryView":714 @@ -27986,22 +14831,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * slice_copy(memview, &src) */ - -#line 714 "View.MemoryView" __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); /* "View.MemoryView":712 * assert memview.view.ndim > 0 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice */ - -#line 712 "View.MemoryView" goto __pyx_L3; - -#line 712 "View.MemoryView" } /* "View.MemoryView":716 @@ -28009,234 +14848,120 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< * p_src = &src - * + * */ - -#line 716 "View.MemoryView" /*else*/ { - -#line 716 "View.MemoryView" __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); /* "View.MemoryView":717 * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 717 "View.MemoryView" __pyx_v_p_src = (&__pyx_v_src); - -#line 717 "View.MemoryView" } - -#line 717 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":723 - * - * + * + * * dst.memview = p_src.memview # <<<<<<<<<<<<<< * dst.data = p_src.data - * + * */ - -#line 723 "View.MemoryView" __pyx_t_4 = __pyx_v_p_src->memview; - -#line 723 "View.MemoryView" __pyx_v_dst.memview = __pyx_t_4; /* "View.MemoryView":724 - * + * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 724 "View.MemoryView" __pyx_t_5 = __pyx_v_p_src->data; - -#line 724 "View.MemoryView" __pyx_v_dst.data = __pyx_t_5; /* "View.MemoryView":729 - * - * + * + * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< * cdef int *p_suboffset_dim = &suboffset_dim * cdef Py_ssize_t start, stop, step */ - -#line 729 "View.MemoryView" __pyx_v_p_dst = (&__pyx_v_dst); /* "View.MemoryView":730 - * + * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< * cdef Py_ssize_t start, stop, step * cdef bint have_start, have_stop, have_step */ - -#line 730 "View.MemoryView" __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); /* "View.MemoryView":734 * cdef bint have_start, have_stop, have_step - * + * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( */ - -#line 734 "View.MemoryView" __pyx_t_6 = 0; - -#line 734 "View.MemoryView" if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { - -#line 734 "View.MemoryView" __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; - -#line 734 "View.MemoryView" __pyx_t_8 = NULL; - -#line 734 "View.MemoryView" } else { - __pyx_t_7 = -1; -#line 734 "View.MemoryView" -__pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 734, __pyx_L1_error) - -#line 734 "View.MemoryView" + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - -#line 734 "View.MemoryView" __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 734, __pyx_L1_error) - -#line 734 "View.MemoryView" } - -#line 734 "View.MemoryView" for (;;) { - -#line 734 "View.MemoryView" if (likely(!__pyx_t_8)) { - -#line 734 "View.MemoryView" if (likely(PyList_CheckExact(__pyx_t_3))) { - -#line 734 "View.MemoryView" if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; - -#line 734 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 734 "View.MemoryView" __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 734, __pyx_L1_error) - -#line 734 "View.MemoryView" #else - -#line 734 "View.MemoryView" __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 734, __pyx_L1_error) - -#line 734 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 734 "View.MemoryView" #endif - -#line 734 "View.MemoryView" } else { - -#line 734 "View.MemoryView" if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - -#line 734 "View.MemoryView" #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - -#line 734 "View.MemoryView" __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 734, __pyx_L1_error) - -#line 734 "View.MemoryView" #else - -#line 734 "View.MemoryView" __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 734, __pyx_L1_error) - -#line 734 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 734 "View.MemoryView" #endif - -#line 734 "View.MemoryView" } - } else -#line 734 "View.MemoryView" -{ - -#line 734 "View.MemoryView" + } else { __pyx_t_9 = __pyx_t_8(__pyx_t_3); - -#line 734 "View.MemoryView" if (unlikely(!__pyx_t_9)) { - -#line 734 "View.MemoryView" PyObject* exc_type = PyErr_Occurred(); - -#line 734 "View.MemoryView" if (exc_type) { - -#line 734 "View.MemoryView" if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - -#line 734 "View.MemoryView" else __PYX_ERR(0, 734, __pyx_L1_error) - -#line 734 "View.MemoryView" } - -#line 734 "View.MemoryView" break; - -#line 734 "View.MemoryView" } - -#line 734 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 734 "View.MemoryView" } - -#line 734 "View.MemoryView" __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); - -#line 734 "View.MemoryView" __pyx_t_9 = 0; - -#line 734 "View.MemoryView" __pyx_v_dim = __pyx_t_6; - -#line 734 "View.MemoryView" __pyx_t_6 = (__pyx_t_6 + 1); /* "View.MemoryView":735 - * + * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], */ - -#line 735 "View.MemoryView" __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); - -#line 735 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":739 @@ -28246,8 +14971,6 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * 0, 0, 0, # have_{start,stop,step} * False) */ - -#line 739 "View.MemoryView" __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L1_error) /* "View.MemoryView":736 @@ -28257,22 +14980,16 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - -#line 736 "View.MemoryView" __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 736, __pyx_L1_error) /* "View.MemoryView":735 - * + * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], */ - -#line 735 "View.MemoryView" goto __pyx_L6; - -#line 735 "View.MemoryView" } /* "View.MemoryView":742 @@ -28282,14 +14999,8 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 */ - -#line 742 "View.MemoryView" __pyx_t_2 = (__pyx_v_index == Py_None); - -#line 742 "View.MemoryView" __pyx_t_1 = (__pyx_t_2 != 0); - -#line 742 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":743 @@ -28299,8 +15010,6 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 */ - -#line 743 "View.MemoryView" (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; /* "View.MemoryView":744 @@ -28310,8 +15019,6 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 */ - -#line 744 "View.MemoryView" (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; /* "View.MemoryView":745 @@ -28321,8 +15028,6 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * new_ndim += 1 * else: */ - -#line 745 "View.MemoryView" (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; /* "View.MemoryView":746 @@ -28332,8 +15037,6 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * else: * start = index.start or 0 */ - -#line 746 "View.MemoryView" __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); /* "View.MemoryView":742 @@ -28343,11 +15046,7 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 */ - -#line 742 "View.MemoryView" goto __pyx_L6; - -#line 742 "View.MemoryView" } /* "View.MemoryView":748 @@ -28357,50 +15056,20 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * stop = index.stop or 0 * step = index.step or 0 */ - -#line 748 "View.MemoryView" /*else*/ { - -#line 748 "View.MemoryView" __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 748, __pyx_L1_error) - -#line 748 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 748 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 748, __pyx_L1_error) - -#line 748 "View.MemoryView" if (!__pyx_t_1) { - -#line 748 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 748 "View.MemoryView" } else { - -#line 748 "View.MemoryView" __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L1_error) - -#line 748 "View.MemoryView" __pyx_t_10 = __pyx_t_12; - -#line 748 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 748 "View.MemoryView" goto __pyx_L7_bool_binop_done; - -#line 748 "View.MemoryView" } - -#line 748 "View.MemoryView" __pyx_t_10 = 0; - -#line 748 "View.MemoryView" __pyx_L7_bool_binop_done:; - -#line 748 "View.MemoryView" __pyx_v_start = __pyx_t_10; /* "View.MemoryView":749 @@ -28408,238 +15077,132 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * start = index.start or 0 * stop = index.stop or 0 # <<<<<<<<<<<<<< * step = index.step or 0 - * + * */ - -#line 749 "View.MemoryView" __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 749, __pyx_L1_error) - -#line 749 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 749 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 749, __pyx_L1_error) - -#line 749 "View.MemoryView" if (!__pyx_t_1) { - -#line 749 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 749 "View.MemoryView" } else { - -#line 749 "View.MemoryView" __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 749, __pyx_L1_error) - -#line 749 "View.MemoryView" __pyx_t_10 = __pyx_t_12; - -#line 749 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 749 "View.MemoryView" goto __pyx_L9_bool_binop_done; - -#line 749 "View.MemoryView" } - -#line 749 "View.MemoryView" __pyx_t_10 = 0; - -#line 749 "View.MemoryView" __pyx_L9_bool_binop_done:; - -#line 749 "View.MemoryView" __pyx_v_stop = __pyx_t_10; /* "View.MemoryView":750 * start = index.start or 0 * stop = index.stop or 0 * step = index.step or 0 # <<<<<<<<<<<<<< - * + * * have_start = index.start is not None */ - -#line 750 "View.MemoryView" __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 750, __pyx_L1_error) - -#line 750 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 750 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 750, __pyx_L1_error) - -#line 750 "View.MemoryView" if (!__pyx_t_1) { - -#line 750 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 750 "View.MemoryView" } else { - -#line 750 "View.MemoryView" __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L1_error) - -#line 750 "View.MemoryView" __pyx_t_10 = __pyx_t_12; - -#line 750 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 750 "View.MemoryView" goto __pyx_L11_bool_binop_done; - -#line 750 "View.MemoryView" } - -#line 750 "View.MemoryView" __pyx_t_10 = 0; - -#line 750 "View.MemoryView" __pyx_L11_bool_binop_done:; - -#line 750 "View.MemoryView" __pyx_v_step = __pyx_t_10; /* "View.MemoryView":752 * step = index.step or 0 - * + * * have_start = index.start is not None # <<<<<<<<<<<<<< * have_stop = index.stop is not None * have_step = index.step is not None */ - -#line 752 "View.MemoryView" __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 752, __pyx_L1_error) - -#line 752 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 752 "View.MemoryView" __pyx_t_1 = (__pyx_t_9 != Py_None); - -#line 752 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 752 "View.MemoryView" __pyx_v_have_start = __pyx_t_1; /* "View.MemoryView":753 - * + * * have_start = index.start is not None * have_stop = index.stop is not None # <<<<<<<<<<<<<< * have_step = index.step is not None - * + * */ - -#line 753 "View.MemoryView" __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 753, __pyx_L1_error) - -#line 753 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 753 "View.MemoryView" __pyx_t_1 = (__pyx_t_9 != Py_None); - -#line 753 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 753 "View.MemoryView" __pyx_v_have_stop = __pyx_t_1; /* "View.MemoryView":754 * have_start = index.start is not None * have_stop = index.stop is not None * have_step = index.step is not None # <<<<<<<<<<<<<< - * + * * slice_memviewslice( */ - -#line 754 "View.MemoryView" __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 754, __pyx_L1_error) - -#line 754 "View.MemoryView" __Pyx_GOTREF(__pyx_t_9); - -#line 754 "View.MemoryView" __pyx_t_1 = (__pyx_t_9 != Py_None); - -#line 754 "View.MemoryView" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 754 "View.MemoryView" __pyx_v_have_step = __pyx_t_1; /* "View.MemoryView":756 * have_step = index.step is not None - * + * * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - -#line 756 "View.MemoryView" __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 756, __pyx_L1_error) /* "View.MemoryView":762 * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< - * + * * if isinstance(memview, _memoryviewslice): */ - -#line 762 "View.MemoryView" __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); - -#line 762 "View.MemoryView" } - -#line 762 "View.MemoryView" __pyx_L6:; /* "View.MemoryView":734 * cdef bint have_start, have_stop, have_step - * + * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( */ - -#line 734 "View.MemoryView" } - -#line 734 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":764 * new_ndim += 1 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, */ - -#line 764 "View.MemoryView" - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - -#line 764 "View.MemoryView" + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); __pyx_t_2 = (__pyx_t_1 != 0); - -#line 764 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":765 - * + * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ - -#line 765 "View.MemoryView" __Pyx_XDECREF(((PyObject *)__pyx_r)); /* "View.MemoryView":766 @@ -28649,8 +15212,6 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - -#line 766 "View.MemoryView" if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 766, __pyx_L1_error) } /* "View.MemoryView":767 @@ -28660,45 +15221,29 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * memview.dtype_is_object) * else: */ - -#line 767 "View.MemoryView" if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 767, __pyx_L1_error) } /* "View.MemoryView":765 - * + * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ - -#line 765 "View.MemoryView" __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error) - -#line 765 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 765 "View.MemoryView" if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 765, __pyx_L1_error) - -#line 765 "View.MemoryView" __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); - -#line 765 "View.MemoryView" __pyx_t_3 = 0; - -#line 765 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":764 * new_ndim += 1 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, */ - -#line 764 "View.MemoryView" } /* "View.MemoryView":770 @@ -28706,27 +15251,19 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) - * + * */ - -#line 770 "View.MemoryView" /*else*/ { - -#line 770 "View.MemoryView" __Pyx_XDECREF(((PyObject *)__pyx_r)); /* "View.MemoryView":771 * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, * memview.dtype_is_object) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 771 "View.MemoryView" __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error) - -#line 771 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":770 @@ -28734,154 +15271,88 @@ __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_E * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) - * + * */ - -#line 770 "View.MemoryView" if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 770, __pyx_L1_error) - -#line 770 "View.MemoryView" __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); - -#line 770 "View.MemoryView" __pyx_t_3 = 0; - -#line 770 "View.MemoryView" goto __pyx_L0; - -#line 770 "View.MemoryView" } /* "View.MemoryView":698 - * + * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim * cdef bint negative_step */ -#line 698 "View.MemoryView" - - -#line 698 "View.MemoryView" /* function exit code */ - -#line 698 "View.MemoryView" __pyx_L1_error:; - -#line 698 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 698 "View.MemoryView" __Pyx_XDECREF(__pyx_t_9); - -#line 698 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 698 "View.MemoryView" __pyx_r = 0; - -#line 698 "View.MemoryView" __pyx_L0:; - -#line 698 "View.MemoryView" __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); - -#line 698 "View.MemoryView" __Pyx_XDECREF(__pyx_v_index); - -#line 698 "View.MemoryView" __Pyx_XGIVEREF((PyObject *)__pyx_r); - -#line 698 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 698 "View.MemoryView" return __pyx_r; - -#line 698 "View.MemoryView" } /* "View.MemoryView":795 - * + * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ -#line 795 "View.MemoryView" - - -#line 795 "View.MemoryView" static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { - Py_ssize_t __pyx_v_new_shape -#line 795 "View.MemoryView" -; - int __pyx_v_negative_step -#line 795 "View.MemoryView" -; - -#line 795 "View.MemoryView" + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; int __pyx_r; - -#line 795 "View.MemoryView" int __pyx_t_1; - -#line 795 "View.MemoryView" int __pyx_t_2; - -#line 795 "View.MemoryView" int __pyx_t_3; /* "View.MemoryView":815 * cdef bint negative_step - * + * * if not is_slice: # <<<<<<<<<<<<<< - * + * * if start < 0: */ - -#line 815 "View.MemoryView" __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); - -#line 815 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":817 * if not is_slice: - * + * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: */ - -#line 817 "View.MemoryView" __pyx_t_1 = ((__pyx_v_start < 0) != 0); - -#line 817 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":818 - * + * * if start < 0: * start += shape # <<<<<<<<<<<<<< * if not 0 <= start < shape: * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) */ - -#line 818 "View.MemoryView" __pyx_v_start = (__pyx_v_start + __pyx_v_shape); /* "View.MemoryView":817 * if not is_slice: - * + * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: */ - -#line 817 "View.MemoryView" } /* "View.MemoryView":819 @@ -28891,23 +15362,11 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) * else: */ - -#line 819 "View.MemoryView" __pyx_t_1 = (0 <= __pyx_v_start); - -#line 819 "View.MemoryView" if (__pyx_t_1) { - -#line 819 "View.MemoryView" __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); - -#line 819 "View.MemoryView" } - -#line 819 "View.MemoryView" __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); - -#line 819 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":820 @@ -28915,10 +15374,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * if not 0 <= start < shape: * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< * else: - * + * */ - -#line 820 "View.MemoryView" __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 820, __pyx_L1_error) /* "View.MemoryView":819 @@ -28928,151 +15385,91 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) * else: */ - -#line 819 "View.MemoryView" } /* "View.MemoryView":815 * cdef bint negative_step - * + * * if not is_slice: # <<<<<<<<<<<<<< - * + * * if start < 0: */ - -#line 815 "View.MemoryView" goto __pyx_L3; - -#line 815 "View.MemoryView" } /* "View.MemoryView":823 * else: - * + * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< - * + * * if have_step and step == 0: */ - -#line 823 "View.MemoryView" /*else*/ { - -#line 823 "View.MemoryView" __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); - -#line 823 "View.MemoryView" if (__pyx_t_1) { - -#line 823 "View.MemoryView" } else { - -#line 823 "View.MemoryView" __pyx_t_2 = __pyx_t_1; - -#line 823 "View.MemoryView" goto __pyx_L6_bool_binop_done; - -#line 823 "View.MemoryView" } - -#line 823 "View.MemoryView" __pyx_t_1 = ((__pyx_v_step < 0) != 0); - -#line 823 "View.MemoryView" __pyx_t_2 = __pyx_t_1; - -#line 823 "View.MemoryView" __pyx_L6_bool_binop_done:; - -#line 823 "View.MemoryView" __pyx_v_negative_step = __pyx_t_2; /* "View.MemoryView":825 * negative_step = have_step != 0 and step < 0 - * + * * if have_step and step == 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) - * + * */ - -#line 825 "View.MemoryView" __pyx_t_1 = (__pyx_v_have_step != 0); - -#line 825 "View.MemoryView" if (__pyx_t_1) { - -#line 825 "View.MemoryView" } else { - -#line 825 "View.MemoryView" __pyx_t_2 = __pyx_t_1; - -#line 825 "View.MemoryView" goto __pyx_L9_bool_binop_done; - -#line 825 "View.MemoryView" } - -#line 825 "View.MemoryView" __pyx_t_1 = ((__pyx_v_step == 0) != 0); - -#line 825 "View.MemoryView" __pyx_t_2 = __pyx_t_1; - -#line 825 "View.MemoryView" __pyx_L9_bool_binop_done:; - -#line 825 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":826 - * + * * if have_step and step == 0: * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 826 "View.MemoryView" __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 826, __pyx_L1_error) /* "View.MemoryView":825 * negative_step = have_step != 0 and step < 0 - * + * * if have_step and step == 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) - * + * */ - -#line 825 "View.MemoryView" } /* "View.MemoryView":829 - * - * + * + * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape */ - -#line 829 "View.MemoryView" __pyx_t_2 = (__pyx_v_have_start != 0); - -#line 829 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":830 - * + * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape * if start < 0: */ - -#line 830 "View.MemoryView" __pyx_t_2 = ((__pyx_v_start < 0) != 0); - -#line 830 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":831 @@ -29082,8 +15479,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * if start < 0: * start = 0 */ - -#line 831 "View.MemoryView" __pyx_v_start = (__pyx_v_start + __pyx_v_shape); /* "View.MemoryView":832 @@ -29093,11 +15488,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = 0 * elif start >= shape: */ - -#line 832 "View.MemoryView" __pyx_t_2 = ((__pyx_v_start < 0) != 0); - -#line 832 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":833 @@ -29107,8 +15498,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * elif start >= shape: * if negative_step: */ - -#line 833 "View.MemoryView" __pyx_v_start = 0; /* "View.MemoryView":832 @@ -29118,22 +15507,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = 0 * elif start >= shape: */ - -#line 832 "View.MemoryView" } /* "View.MemoryView":830 - * + * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape * if start < 0: */ - -#line 830 "View.MemoryView" goto __pyx_L12; - -#line 830 "View.MemoryView" } /* "View.MemoryView":834 @@ -29143,11 +15526,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * if negative_step: * start = shape - 1 */ - -#line 834 "View.MemoryView" __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); - -#line 834 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":835 @@ -29157,11 +15536,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = shape - 1 * else: */ - -#line 835 "View.MemoryView" __pyx_t_2 = (__pyx_v_negative_step != 0); - -#line 835 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":836 @@ -29171,8 +15546,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * else: * start = shape */ - -#line 836 "View.MemoryView" __pyx_v_start = (__pyx_v_shape - 1); /* "View.MemoryView":835 @@ -29182,11 +15555,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = shape - 1 * else: */ - -#line 835 "View.MemoryView" goto __pyx_L14; - -#line 835 "View.MemoryView" } /* "View.MemoryView":838 @@ -29196,17 +15565,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * else: * if negative_step: */ - -#line 838 "View.MemoryView" /*else*/ { - -#line 838 "View.MemoryView" __pyx_v_start = __pyx_v_shape; - -#line 838 "View.MemoryView" } - -#line 838 "View.MemoryView" __pyx_L14:; /* "View.MemoryView":834 @@ -29216,25 +15577,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * if negative_step: * start = shape - 1 */ - -#line 834 "View.MemoryView" } - -#line 834 "View.MemoryView" __pyx_L12:; /* "View.MemoryView":829 - * - * + * + * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape */ - -#line 829 "View.MemoryView" goto __pyx_L11; - -#line 829 "View.MemoryView" } /* "View.MemoryView":840 @@ -29244,14 +15597,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = shape - 1 * else: */ - -#line 840 "View.MemoryView" /*else*/ { - -#line 840 "View.MemoryView" __pyx_t_2 = (__pyx_v_negative_step != 0); - -#line 840 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":841 @@ -29261,8 +15608,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * else: * start = 0 */ - -#line 841 "View.MemoryView" __pyx_v_start = (__pyx_v_shape - 1); /* "View.MemoryView":840 @@ -29272,65 +15617,41 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = shape - 1 * else: */ - -#line 840 "View.MemoryView" goto __pyx_L15; - -#line 840 "View.MemoryView" } /* "View.MemoryView":843 * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< - * + * * if have_stop: */ - -#line 843 "View.MemoryView" /*else*/ { - -#line 843 "View.MemoryView" __pyx_v_start = 0; - -#line 843 "View.MemoryView" } - -#line 843 "View.MemoryView" __pyx_L15:; - -#line 843 "View.MemoryView" } - -#line 843 "View.MemoryView" __pyx_L11:; /* "View.MemoryView":845 * start = 0 - * + * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape */ - -#line 845 "View.MemoryView" __pyx_t_2 = (__pyx_v_have_stop != 0); - -#line 845 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":846 - * + * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape * if stop < 0: */ - -#line 846 "View.MemoryView" __pyx_t_2 = ((__pyx_v_stop < 0) != 0); - -#line 846 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":847 @@ -29340,8 +15661,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * if stop < 0: * stop = 0 */ - -#line 847 "View.MemoryView" __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); /* "View.MemoryView":848 @@ -29351,11 +15670,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = 0 * elif stop > shape: */ - -#line 848 "View.MemoryView" __pyx_t_2 = ((__pyx_v_stop < 0) != 0); - -#line 848 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":849 @@ -29365,8 +15680,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * elif stop > shape: * stop = shape */ - -#line 849 "View.MemoryView" __pyx_v_stop = 0; /* "View.MemoryView":848 @@ -29376,22 +15689,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = 0 * elif stop > shape: */ - -#line 848 "View.MemoryView" } /* "View.MemoryView":846 - * + * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape * if stop < 0: */ - -#line 846 "View.MemoryView" goto __pyx_L17; - -#line 846 "View.MemoryView" } /* "View.MemoryView":850 @@ -29401,11 +15708,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = shape * else: */ - -#line 850 "View.MemoryView" __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); - -#line 850 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":851 @@ -29415,8 +15718,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * else: * if negative_step: */ - -#line 851 "View.MemoryView" __pyx_v_stop = __pyx_v_shape; /* "View.MemoryView":850 @@ -29426,25 +15727,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = shape * else: */ - -#line 850 "View.MemoryView" } - -#line 850 "View.MemoryView" __pyx_L17:; /* "View.MemoryView":845 * start = 0 - * + * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape */ - -#line 845 "View.MemoryView" goto __pyx_L16; - -#line 845 "View.MemoryView" } /* "View.MemoryView":853 @@ -29454,14 +15747,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = -1 * else: */ - -#line 853 "View.MemoryView" /*else*/ { - -#line 853 "View.MemoryView" __pyx_t_2 = (__pyx_v_negative_step != 0); - -#line 853 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":854 @@ -29471,8 +15758,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * else: * stop = shape */ - -#line 854 "View.MemoryView" __pyx_v_stop = -1L; /* "View.MemoryView":853 @@ -29482,285 +15767,205 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = -1 * else: */ - -#line 853 "View.MemoryView" goto __pyx_L19; - -#line 853 "View.MemoryView" } /* "View.MemoryView":856 * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< - * + * * if not have_step: */ - -#line 856 "View.MemoryView" /*else*/ { - -#line 856 "View.MemoryView" __pyx_v_stop = __pyx_v_shape; - -#line 856 "View.MemoryView" } - -#line 856 "View.MemoryView" __pyx_L19:; - -#line 856 "View.MemoryView" } - -#line 856 "View.MemoryView" __pyx_L16:; /* "View.MemoryView":858 * stop = shape - * + * * if not have_step: # <<<<<<<<<<<<<< * step = 1 - * + * */ - -#line 858 "View.MemoryView" __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); - -#line 858 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":859 - * + * * if not have_step: * step = 1 # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 859 "View.MemoryView" __pyx_v_step = 1; /* "View.MemoryView":858 * stop = shape - * + * * if not have_step: # <<<<<<<<<<<<<< * step = 1 - * + * */ - -#line 858 "View.MemoryView" } /* "View.MemoryView":863 - * + * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< - * + * * if (stop - start) - step * new_shape: */ - -#line 863 "View.MemoryView" __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); /* "View.MemoryView":865 * new_shape = (stop - start) // step - * + * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 - * + * */ - -#line 865 "View.MemoryView" __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); - -#line 865 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":866 - * + * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< - * + * * if new_shape < 0: */ - -#line 866 "View.MemoryView" __pyx_v_new_shape = (__pyx_v_new_shape + 1); /* "View.MemoryView":865 * new_shape = (stop - start) // step - * + * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 - * + * */ - -#line 865 "View.MemoryView" } /* "View.MemoryView":868 * new_shape += 1 - * + * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 - * + * */ - -#line 868 "View.MemoryView" __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); - -#line 868 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":869 - * + * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 869 "View.MemoryView" __pyx_v_new_shape = 0; /* "View.MemoryView":868 * new_shape += 1 - * + * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 - * + * */ - -#line 868 "View.MemoryView" } /* "View.MemoryView":872 - * - * + * + * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset */ - -#line 872 "View.MemoryView" (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); /* "View.MemoryView":873 - * + * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< * dst.suboffsets[new_ndim] = suboffset - * + * */ - -#line 873 "View.MemoryView" (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; /* "View.MemoryView":874 * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 874 "View.MemoryView" (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; - -#line 874 "View.MemoryView" } - -#line 874 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":877 - * - * + * + * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: */ - -#line 877 "View.MemoryView" __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); - -#line 877 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":878 - * + * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< * else: * dst.suboffsets[suboffset_dim[0]] += start * stride */ - -#line 878 "View.MemoryView" __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); /* "View.MemoryView":877 - * - * + * + * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: */ - -#line 877 "View.MemoryView" goto __pyx_L23; - -#line 877 "View.MemoryView" } /* "View.MemoryView":880 * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< - * + * * if suboffset >= 0: */ - -#line 880 "View.MemoryView" /*else*/ { - -#line 880 "View.MemoryView" __pyx_t_3 = (__pyx_v_suboffset_dim[0]); - -#line 880 "View.MemoryView" (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); - -#line 880 "View.MemoryView" } - -#line 880 "View.MemoryView" __pyx_L23:; /* "View.MemoryView":882 * dst.suboffsets[suboffset_dim[0]] += start * stride - * + * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: */ - -#line 882 "View.MemoryView" __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); - -#line 882 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":883 - * + * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset */ - -#line 883 "View.MemoryView" __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); - -#line 883 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":884 @@ -29770,11 +15975,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * dst.data = ( dst.data)[0] + suboffset * else: */ - -#line 884 "View.MemoryView" __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); - -#line 884 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":885 @@ -29784,8 +15985,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " */ - -#line 885 "View.MemoryView" __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); /* "View.MemoryView":884 @@ -29795,11 +15994,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * dst.data = ( dst.data)[0] + suboffset * else: */ - -#line 884 "View.MemoryView" goto __pyx_L26; - -#line 884 "View.MemoryView" } /* "View.MemoryView":887 @@ -29809,8 +16004,6 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * "must be indexed and not sliced", dim) * else: */ - -#line 887 "View.MemoryView" /*else*/ { /* "View.MemoryView":888 @@ -29820,179 +16013,95 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * else: * suboffset_dim[0] = new_ndim */ - -#line 888 "View.MemoryView" __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 887, __pyx_L1_error) - -#line 888 "View.MemoryView" } - -#line 888 "View.MemoryView" __pyx_L26:; /* "View.MemoryView":883 - * + * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset */ - -#line 883 "View.MemoryView" goto __pyx_L25; - -#line 883 "View.MemoryView" } /* "View.MemoryView":890 * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< - * + * * return 0 */ - -#line 890 "View.MemoryView" /*else*/ { - -#line 890 "View.MemoryView" (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; - -#line 890 "View.MemoryView" } - -#line 890 "View.MemoryView" __pyx_L25:; /* "View.MemoryView":882 * dst.suboffsets[suboffset_dim[0]] += start * stride - * + * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: */ - -#line 882 "View.MemoryView" } /* "View.MemoryView":892 * suboffset_dim[0] = new_ndim - * + * * return 0 # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 892 "View.MemoryView" __pyx_r = 0; - -#line 892 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":795 - * + * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ -#line 795 "View.MemoryView" - - -#line 795 "View.MemoryView" /* function exit code */ - -#line 795 "View.MemoryView" __pyx_L1_error:; - -#line 795 "View.MemoryView" { - -#line 795 "View.MemoryView" #ifdef WITH_THREAD - PyGILState_STATE -#line 795 "View.MemoryView" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 795 "View.MemoryView" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 795 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 795 "View.MemoryView" #ifdef WITH_THREAD - -#line 795 "View.MemoryView" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 795 "View.MemoryView" #endif - -#line 795 "View.MemoryView" } - -#line 795 "View.MemoryView" __pyx_r = -1; - -#line 795 "View.MemoryView" __pyx_L0:; - -#line 795 "View.MemoryView" return __pyx_r; - -#line 795 "View.MemoryView" } /* "View.MemoryView":898 - * + * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 */ -#line 898 "View.MemoryView" - - -#line 898 "View.MemoryView" static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { - Py_ssize_t __pyx_v_shape -#line 898 "View.MemoryView" -; - Py_ssize_t __pyx_v_stride -#line 898 "View.MemoryView" -; - Py_ssize_t __pyx_v_suboffset -#line 898 "View.MemoryView" -; - Py_ssize_t __pyx_v_itemsize -#line 898 "View.MemoryView" -; - char *__pyx_v_resultp -#line 898 "View.MemoryView" -; - -#line 898 "View.MemoryView" + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; char *__pyx_r; - -#line 898 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 898 "View.MemoryView" Py_ssize_t __pyx_t_1; - -#line 898 "View.MemoryView" int __pyx_t_2; - -#line 898 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 898 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 898 "View.MemoryView" __Pyx_RefNannySetupContext("pybuffer_index", 0); /* "View.MemoryView":900 @@ -30002,8 +16111,6 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * cdef Py_ssize_t itemsize = view.itemsize * cdef char *resultp */ - -#line 900 "View.MemoryView" __pyx_v_suboffset = -1L; /* "View.MemoryView":901 @@ -30011,62 +16118,36 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< * cdef char *resultp - * + * */ - -#line 901 "View.MemoryView" __pyx_t_1 = __pyx_v_view->itemsize; - -#line 901 "View.MemoryView" __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":904 * cdef char *resultp - * + * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize */ - -#line 904 "View.MemoryView" __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); - -#line 904 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":905 - * + * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< * stride = itemsize * else: */ - -#line 905 "View.MemoryView" if (unlikely(__pyx_v_itemsize == 0)) { - -#line 905 "View.MemoryView" PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - -#line 905 "View.MemoryView" __PYX_ERR(0, 905, __pyx_L1_error) - -#line 905 "View.MemoryView" } - -#line 905 "View.MemoryView" else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { - -#line 905 "View.MemoryView" PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - -#line 905 "View.MemoryView" __PYX_ERR(0, 905, __pyx_L1_error) - -#line 905 "View.MemoryView" } - -#line 905 "View.MemoryView" __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); /* "View.MemoryView":906 @@ -30076,22 +16157,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * else: * shape = view.shape[dim] */ - -#line 906 "View.MemoryView" __pyx_v_stride = __pyx_v_itemsize; /* "View.MemoryView":904 * cdef char *resultp - * + * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize */ - -#line 904 "View.MemoryView" goto __pyx_L3; - -#line 904 "View.MemoryView" } /* "View.MemoryView":908 @@ -30101,11 +16176,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: */ - -#line 908 "View.MemoryView" /*else*/ { - -#line 908 "View.MemoryView" __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); /* "View.MemoryView":909 @@ -30115,8 +16186,6 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] */ - -#line 909 "View.MemoryView" __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); /* "View.MemoryView":910 @@ -30124,24 +16193,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] - * + * */ - -#line 910 "View.MemoryView" __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); - -#line 910 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":911 * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< - * + * * if index < 0: */ - -#line 911 "View.MemoryView" __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); /* "View.MemoryView":910 @@ -30149,41 +16212,29 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] - * + * */ - -#line 910 "View.MemoryView" } - -#line 910 "View.MemoryView" } - -#line 910 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":913 * suboffset = view.suboffsets[dim] - * + * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: */ - -#line 913 "View.MemoryView" __pyx_t_2 = ((__pyx_v_index < 0) != 0); - -#line 913 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":914 - * + * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< * if index < 0: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) */ - -#line 914 "View.MemoryView" __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); /* "View.MemoryView":915 @@ -30191,69 +16242,33 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ - -#line 915 "View.MemoryView" __pyx_t_2 = ((__pyx_v_index < 0) != 0); - -#line 915 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":916 * index += view.shape[dim] * if index < 0: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< - * + * * if index >= shape: */ - -#line 916 "View.MemoryView" __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error) - -#line 916 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 916 "View.MemoryView" __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error) - -#line 916 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 916 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 916 "View.MemoryView" __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error) - -#line 916 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 916 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_4); - -#line 916 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - -#line 916 "View.MemoryView" __pyx_t_4 = 0; - -#line 916 "View.MemoryView" __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error) - -#line 916 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 916 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 916 "View.MemoryView" __Pyx_Raise(__pyx_t_4, 0, 0, 0); - -#line 916 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 916 "View.MemoryView" __PYX_ERR(0, 916, __pyx_L1_error) /* "View.MemoryView":915 @@ -30261,319 +16276,191 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ - -#line 915 "View.MemoryView" } /* "View.MemoryView":913 * suboffset = view.suboffsets[dim] - * + * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: */ - -#line 913 "View.MemoryView" } /* "View.MemoryView":918 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ - -#line 918 "View.MemoryView" __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); - -#line 918 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":919 - * + * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< - * + * * resultp = bufp + index * stride */ - -#line 919 "View.MemoryView" __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error) - -#line 919 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 919 "View.MemoryView" __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error) - -#line 919 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 919 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 919 "View.MemoryView" __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error) - -#line 919 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 919 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 919 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - -#line 919 "View.MemoryView" __pyx_t_3 = 0; - -#line 919 "View.MemoryView" __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error) - -#line 919 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 919 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 919 "View.MemoryView" __Pyx_Raise(__pyx_t_3, 0, 0, 0); - -#line 919 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 919 "View.MemoryView" __PYX_ERR(0, 919, __pyx_L1_error) /* "View.MemoryView":918 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ - -#line 918 "View.MemoryView" } /* "View.MemoryView":921 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * resultp = bufp + index * stride # <<<<<<<<<<<<<< * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset */ - -#line 921 "View.MemoryView" __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); /* "View.MemoryView":922 - * + * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset - * + * */ - -#line 922 "View.MemoryView" __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); - -#line 922 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":923 * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< - * + * * return resultp */ - -#line 923 "View.MemoryView" __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); /* "View.MemoryView":922 - * + * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset - * + * */ - -#line 922 "View.MemoryView" } /* "View.MemoryView":925 * resultp = ( resultp)[0] + suboffset - * + * * return resultp # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 925 "View.MemoryView" __pyx_r = __pyx_v_resultp; - -#line 925 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":898 - * + * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 */ -#line 898 "View.MemoryView" - - -#line 898 "View.MemoryView" /* function exit code */ - -#line 898 "View.MemoryView" __pyx_L1_error:; - -#line 898 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 898 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); - -#line 898 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 898 "View.MemoryView" __pyx_r = NULL; - -#line 898 "View.MemoryView" __pyx_L0:; - -#line 898 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 898 "View.MemoryView" return __pyx_r; - -#line 898 "View.MemoryView" } /* "View.MemoryView":931 - * + * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim - * + * */ -#line 931 "View.MemoryView" - - -#line 931 "View.MemoryView" static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { - int __pyx_v_ndim -#line 931 "View.MemoryView" -; - Py_ssize_t *__pyx_v_shape -#line 931 "View.MemoryView" -; - Py_ssize_t *__pyx_v_strides -#line 931 "View.MemoryView" -; - int __pyx_v_i -#line 931 "View.MemoryView" -; - int __pyx_v_j -#line 931 "View.MemoryView" -; - -#line 931 "View.MemoryView" + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; int __pyx_r; - -#line 931 "View.MemoryView" int __pyx_t_1; - -#line 931 "View.MemoryView" Py_ssize_t *__pyx_t_2; - -#line 931 "View.MemoryView" long __pyx_t_3; - -#line 931 "View.MemoryView" Py_ssize_t __pyx_t_4; - -#line 931 "View.MemoryView" Py_ssize_t __pyx_t_5; - -#line 931 "View.MemoryView" int __pyx_t_6; - -#line 931 "View.MemoryView" int __pyx_t_7; - -#line 931 "View.MemoryView" int __pyx_t_8; /* "View.MemoryView":932 * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< - * + * * cdef Py_ssize_t *shape = memslice.shape */ - -#line 932 "View.MemoryView" __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; - -#line 932 "View.MemoryView" __pyx_v_ndim = __pyx_t_1; /* "View.MemoryView":934 * cdef int ndim = memslice.memview.view.ndim - * + * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< * cdef Py_ssize_t *strides = memslice.strides - * + * */ - -#line 934 "View.MemoryView" __pyx_t_2 = __pyx_v_memslice->shape; - -#line 934 "View.MemoryView" __pyx_v_shape = __pyx_t_2; /* "View.MemoryView":935 - * + * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 935 "View.MemoryView" __pyx_t_2 = __pyx_v_memslice->strides; - -#line 935 "View.MemoryView" __pyx_v_strides = __pyx_t_2; /* "View.MemoryView":939 - * + * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] */ - -#line 939 "View.MemoryView" __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); - -#line 939 "View.MemoryView" for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { - -#line 939 "View.MemoryView" __pyx_v_i = __pyx_t_1; /* "View.MemoryView":940 @@ -30583,8 +16470,6 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] */ - -#line 940 "View.MemoryView" __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); /* "View.MemoryView":941 @@ -30592,299 +16477,163 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< * shape[i], shape[j] = shape[j], shape[i] - * + * */ - -#line 941 "View.MemoryView" __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); - -#line 941 "View.MemoryView" __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); - -#line 941 "View.MemoryView" (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; - -#line 941 "View.MemoryView" (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; /* "View.MemoryView":942 * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: */ - -#line 942 "View.MemoryView" __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); - -#line 942 "View.MemoryView" __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); - -#line 942 "View.MemoryView" (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; - -#line 942 "View.MemoryView" (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; /* "View.MemoryView":944 * shape[i], shape[j] = shape[j], shape[i] - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * */ - -#line 944 "View.MemoryView" __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); - -#line 944 "View.MemoryView" if (!__pyx_t_7) { - -#line 944 "View.MemoryView" } else { - -#line 944 "View.MemoryView" __pyx_t_6 = __pyx_t_7; - -#line 944 "View.MemoryView" goto __pyx_L6_bool_binop_done; - -#line 944 "View.MemoryView" } - -#line 944 "View.MemoryView" __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); - -#line 944 "View.MemoryView" __pyx_t_6 = __pyx_t_7; - -#line 944 "View.MemoryView" __pyx_L6_bool_binop_done:; - -#line 944 "View.MemoryView" if (__pyx_t_6) { /* "View.MemoryView":945 - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< - * + * * return 1 */ - -#line 945 "View.MemoryView" __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 945, __pyx_L1_error) /* "View.MemoryView":944 * shape[i], shape[j] = shape[j], shape[i] - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * */ - -#line 944 "View.MemoryView" } - -#line 944 "View.MemoryView" } /* "View.MemoryView":947 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * * return 1 # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 947 "View.MemoryView" __pyx_r = 1; - -#line 947 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":931 - * + * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim - * + * */ -#line 931 "View.MemoryView" - - -#line 931 "View.MemoryView" /* function exit code */ - -#line 931 "View.MemoryView" __pyx_L1_error:; - -#line 931 "View.MemoryView" { - -#line 931 "View.MemoryView" #ifdef WITH_THREAD - PyGILState_STATE -#line 931 "View.MemoryView" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 931 "View.MemoryView" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 931 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 931 "View.MemoryView" #ifdef WITH_THREAD - -#line 931 "View.MemoryView" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 931 "View.MemoryView" #endif - -#line 931 "View.MemoryView" } - -#line 931 "View.MemoryView" __pyx_r = 0; - -#line 931 "View.MemoryView" __pyx_L0:; - -#line 931 "View.MemoryView" return __pyx_r; - -#line 931 "View.MemoryView" } /* "View.MemoryView":964 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * */ -#line 964 "View.MemoryView" - - -#line 964 "View.MemoryView" /* Python wrapper */ - -#line 964 "View.MemoryView" static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ - -#line 964 "View.MemoryView" static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { - -#line 964 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 964 "View.MemoryView" __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - -#line 964 "View.MemoryView" __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); -#line 964 "View.MemoryView" - - -#line 964 "View.MemoryView" /* function exit code */ - -#line 964 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 964 "View.MemoryView" } -#line 964 "View.MemoryView" - - -#line 964 "View.MemoryView" static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { - -#line 964 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 964 "View.MemoryView" __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":965 - * + * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< - * + * * cdef convert_item_to_object(self, char *itemp): */ - -#line 965 "View.MemoryView" __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); /* "View.MemoryView":964 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * */ -#line 964 "View.MemoryView" - - -#line 964 "View.MemoryView" /* function exit code */ - -#line 964 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 964 "View.MemoryView" } /* "View.MemoryView":967 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) */ -#line 967 "View.MemoryView" - - -#line 967 "View.MemoryView" static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { - -#line 967 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 967 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 967 "View.MemoryView" int __pyx_t_1; - -#line 967 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 967 "View.MemoryView" __Pyx_RefNannySetupContext("convert_item_to_object", 0); /* "View.MemoryView":968 - * + * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) * else: */ - -#line 968 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); - -#line 968 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":969 @@ -30894,153 +16643,81 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor * else: * return memoryview.convert_item_to_object(self, itemp) */ - -#line 969 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 969 "View.MemoryView" __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error) - -#line 969 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 969 "View.MemoryView" __pyx_r = __pyx_t_2; - -#line 969 "View.MemoryView" __pyx_t_2 = 0; - -#line 969 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":968 - * + * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) * else: */ - -#line 968 "View.MemoryView" } /* "View.MemoryView":971 * return self.to_object_func(itemp) * else: * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< - * + * * cdef assign_item_from_object(self, char *itemp, object value): */ - -#line 971 "View.MemoryView" /*else*/ { - -#line 971 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 971 "View.MemoryView" __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __pyx_L1_error) - -#line 971 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 971 "View.MemoryView" __pyx_r = __pyx_t_2; - -#line 971 "View.MemoryView" __pyx_t_2 = 0; - -#line 971 "View.MemoryView" goto __pyx_L0; - -#line 971 "View.MemoryView" } /* "View.MemoryView":967 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) */ -#line 967 "View.MemoryView" - - -#line 967 "View.MemoryView" /* function exit code */ - -#line 967 "View.MemoryView" __pyx_L1_error:; - -#line 967 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 967 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 967 "View.MemoryView" __pyx_r = 0; - -#line 967 "View.MemoryView" __pyx_L0:; - -#line 967 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 967 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 967 "View.MemoryView" return __pyx_r; - -#line 967 "View.MemoryView" } /* "View.MemoryView":973 * return memoryview.convert_item_to_object(self, itemp) - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) */ -#line 973 "View.MemoryView" - - -#line 973 "View.MemoryView" static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { - -#line 973 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 973 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 973 "View.MemoryView" int __pyx_t_1; - -#line 973 "View.MemoryView" int __pyx_t_2; - -#line 973 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 973 "View.MemoryView" __Pyx_RefNannySetupContext("assign_item_from_object", 0); /* "View.MemoryView":974 - * + * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) * else: */ - -#line 974 "View.MemoryView" __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); - -#line 974 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":975 @@ -31050,206 +16727,104 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo * else: * memoryview.assign_item_from_object(self, itemp, value) */ - -#line 975 "View.MemoryView" __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(0, 975, __pyx_L1_error) /* "View.MemoryView":974 - * + * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) * else: */ - -#line 974 "View.MemoryView" goto __pyx_L3; - -#line 974 "View.MemoryView" } /* "View.MemoryView":977 * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< - * + * * @property */ - -#line 977 "View.MemoryView" /*else*/ { - -#line 977 "View.MemoryView" __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) - -#line 977 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 977 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 977 "View.MemoryView" } - -#line 977 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":973 * return memoryview.convert_item_to_object(self, itemp) - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) */ -#line 973 "View.MemoryView" - - -#line 973 "View.MemoryView" /* function exit code */ - -#line 973 "View.MemoryView" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 973 "View.MemoryView" goto __pyx_L0; - -#line 973 "View.MemoryView" __pyx_L1_error:; - -#line 973 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 973 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 973 "View.MemoryView" __pyx_r = 0; - -#line 973 "View.MemoryView" __pyx_L0:; - -#line 973 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 973 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 973 "View.MemoryView" return __pyx_r; - -#line 973 "View.MemoryView" } /* "View.MemoryView":980 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object - * + * */ -#line 980 "View.MemoryView" - - -#line 980 "View.MemoryView" /* Python wrapper */ - -#line 980 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ - -#line 980 "View.MemoryView" static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { - -#line 980 "View.MemoryView" PyObject *__pyx_r = 0; - -#line 980 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 980 "View.MemoryView" __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = -#line 980 "View.MemoryView" -__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); -#line 980 "View.MemoryView" - - -#line 980 "View.MemoryView" /* function exit code */ - -#line 980 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 980 "View.MemoryView" return __pyx_r; - -#line 980 "View.MemoryView" } -#line 980 "View.MemoryView" - - -#line 980 "View.MemoryView" static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { - -#line 980 "View.MemoryView" PyObject *__pyx_r = NULL; - -#line 980 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 980 "View.MemoryView" __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":981 * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ - -#line 981 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 981 "View.MemoryView" __Pyx_INCREF(__pyx_v_self->from_object); - -#line 981 "View.MemoryView" __pyx_r = __pyx_v_self->from_object; - -#line 981 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":980 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object - * + * */ -#line 980 "View.MemoryView" - - -#line 980 "View.MemoryView" /* function exit code */ - -#line 980 "View.MemoryView" __pyx_L0:; - -#line 980 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 980 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 980 "View.MemoryView" return __pyx_r; - -#line 980 "View.MemoryView" } /* "(tree fragment)":1 @@ -31258,61 +16833,23 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* Python wrapper */ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = -#line 1 "(tree fragment)" -__pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { - -#line 1 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 @@ -31321,20 +16858,10 @@ static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - -#line 2 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 2 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 2 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 2 "(tree fragment)" __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 @@ -31343,34 +16870,14 @@ static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED * def __setstate_cython__(self, __pyx_state): */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 1 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } /* "(tree fragment)":3 @@ -31380,61 +16887,23 @@ static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* Python wrapper */ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ - -#line 3 "(tree fragment)" static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = 0; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = -#line 3 "(tree fragment)" -__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - -#line 3 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 3 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 3 "(tree fragment)" __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 @@ -31442,20 +16911,10 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 4 "(tree fragment)" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 4 "(tree fragment)" __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 @@ -31465,290 +16924,158 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -#line 3 "(tree fragment)" - - -#line 3 "(tree fragment)" /* function exit code */ - -#line 3 "(tree fragment)" __pyx_L1_error:; - -#line 3 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 3 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 3 "(tree fragment)" __pyx_r = NULL; - -#line 3 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 3 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 3 "(tree fragment)" return __pyx_r; - -#line 3 "(tree fragment)" } /* "View.MemoryView":987 - * + * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, * object (*to_object_func)(char *), */ -#line 987 "View.MemoryView" - - -#line 987 "View.MemoryView" static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { - struct __pyx_memoryviewslice_obj *__pyx_v_result = 0 -#line 987 "View.MemoryView" -; - Py_ssize_t __pyx_v_suboffset -#line 987 "View.MemoryView" -; - PyObject *__pyx_v_length = NULL -#line 987 "View.MemoryView" -; - -#line 987 "View.MemoryView" + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_v_length = NULL; PyObject *__pyx_r = NULL; - -#line 987 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 987 "View.MemoryView" int __pyx_t_1; - -#line 987 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 987 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 987 "View.MemoryView" __Pyx_TypeInfo *__pyx_t_4; - -#line 987 "View.MemoryView" Py_buffer __pyx_t_5; - -#line 987 "View.MemoryView" Py_ssize_t *__pyx_t_6; - -#line 987 "View.MemoryView" Py_ssize_t *__pyx_t_7; - -#line 987 "View.MemoryView" Py_ssize_t *__pyx_t_8; - -#line 987 "View.MemoryView" Py_ssize_t __pyx_t_9; - -#line 987 "View.MemoryView" __Pyx_RefNannySetupContext("memoryview_fromslice", 0); /* "View.MemoryView":995 * cdef _memoryviewslice result - * + * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None - * + * */ - -#line 995 "View.MemoryView" __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); - -#line 995 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":996 - * + * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 996 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 996 "View.MemoryView" __Pyx_INCREF(Py_None); - -#line 996 "View.MemoryView" __pyx_r = Py_None; - -#line 996 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":995 * cdef _memoryviewslice result - * + * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None - * + * */ - -#line 995 "View.MemoryView" } /* "View.MemoryView":1001 - * - * + * + * * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< - * + * * result.from_slice = memviewslice */ - -#line 1001 "View.MemoryView" __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) - -#line 1001 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1001 "View.MemoryView" __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error) - -#line 1001 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 1001 "View.MemoryView" __Pyx_INCREF(Py_None); - -#line 1001 "View.MemoryView" __Pyx_GIVEREF(Py_None); - -#line 1001 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); - -#line 1001 "View.MemoryView" __Pyx_INCREF(__pyx_int_0); - -#line 1001 "View.MemoryView" __Pyx_GIVEREF(__pyx_int_0); - -#line 1001 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); - -#line 1001 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_2); - -#line 1001 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); - -#line 1001 "View.MemoryView" __pyx_t_2 = 0; - -#line 1001 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) - -#line 1001 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1001 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 1001 "View.MemoryView" __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); - -#line 1001 "View.MemoryView" __pyx_t_2 = 0; /* "View.MemoryView":1003 * result = _memoryviewslice(None, 0, dtype_is_object) - * + * * result.from_slice = memviewslice # <<<<<<<<<<<<<< * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + * */ - -#line 1003 "View.MemoryView" __pyx_v_result->from_slice = __pyx_v_memviewslice; /* "View.MemoryView":1004 - * + * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< - * + * * result.from_object = ( memviewslice.memview).base */ - -#line 1004 "View.MemoryView" __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); /* "View.MemoryView":1006 * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + * * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< * result.typeinfo = memviewslice.memview.typeinfo - * + * */ - -#line 1006 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) - -#line 1006 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1006 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_2); - -#line 1006 "View.MemoryView" __Pyx_GOTREF(__pyx_v_result->from_object); - -#line 1006 "View.MemoryView" __Pyx_DECREF(__pyx_v_result->from_object); - -#line 1006 "View.MemoryView" __pyx_v_result->from_object = __pyx_t_2; - -#line 1006 "View.MemoryView" __pyx_t_2 = 0; /* "View.MemoryView":1007 - * + * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< - * + * * result.view = memviewslice.memview.view */ - -#line 1007 "View.MemoryView" __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; - -#line 1007 "View.MemoryView" __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; /* "View.MemoryView":1009 * result.typeinfo = memviewslice.memview.typeinfo - * + * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< * result.view.buf = memviewslice.data * result.view.ndim = ndim */ - -#line 1009 "View.MemoryView" __pyx_t_5 = __pyx_v_memviewslice.memview->view; - -#line 1009 "View.MemoryView" __pyx_v_result->__pyx_base.view = __pyx_t_5; /* "View.MemoryView":1010 - * + * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None */ - -#line 1010 "View.MemoryView" __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); /* "View.MemoryView":1011 @@ -31758,8 +17085,6 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) */ - -#line 1011 "View.MemoryView" __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; /* "View.MemoryView":1012 @@ -31767,85 +17092,65 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ - -#line 1012 "View.MemoryView" ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; /* "View.MemoryView":1013 * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * result.flags = PyBUF_RECORDS */ - -#line 1013 "View.MemoryView" Py_INCREF(Py_None); /* "View.MemoryView":1015 * Py_INCREF(Py_None) - * + * * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< - * + * * result.view.shape = result.from_slice.shape */ - -#line 1015 "View.MemoryView" __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; /* "View.MemoryView":1017 * result.flags = PyBUF_RECORDS - * + * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< * result.view.strides = result.from_slice.strides - * + * */ - -#line 1017 "View.MemoryView" __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); /* "View.MemoryView":1018 - * + * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1018 "View.MemoryView" __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); /* "View.MemoryView":1021 - * - * + * + * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: */ - -#line 1021 "View.MemoryView" __pyx_v_result->__pyx_base.view.suboffsets = NULL; /* "View.MemoryView":1022 - * + * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets */ - -#line 1022 "View.MemoryView" __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); - -#line 1022 "View.MemoryView" for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { - -#line 1022 "View.MemoryView" __pyx_t_6 = __pyx_t_8; - -#line 1022 "View.MemoryView" __pyx_v_suboffset = (__pyx_t_6[0]); /* "View.MemoryView":1023 @@ -31855,11 +17160,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.suboffsets = result.from_slice.suboffsets * break */ - -#line 1023 "View.MemoryView" __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); - -#line 1023 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":1024 @@ -31867,21 +17168,17 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< * break - * + * */ - -#line 1024 "View.MemoryView" __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); /* "View.MemoryView":1025 * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< - * + * * result.view.len = result.view.itemsize */ - -#line 1025 "View.MemoryView" goto __pyx_L5_break; /* "View.MemoryView":1023 @@ -31891,219 +17188,119 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.suboffsets = result.from_slice.suboffsets * break */ - -#line 1023 "View.MemoryView" } - -#line 1023 "View.MemoryView" } - -#line 1023 "View.MemoryView" __pyx_L5_break:; /* "View.MemoryView":1027 * break - * + * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< * for length in result.view.shape[:ndim]: * result.view.len *= length */ - -#line 1027 "View.MemoryView" __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; - -#line 1027 "View.MemoryView" __pyx_v_result->__pyx_base.view.len = __pyx_t_9; /* "View.MemoryView":1028 - * + * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< * result.view.len *= length - * + * */ - -#line 1028 "View.MemoryView" __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); - -#line 1028 "View.MemoryView" for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { - -#line 1028 "View.MemoryView" __pyx_t_6 = __pyx_t_8; - -#line 1028 "View.MemoryView" __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error) - -#line 1028 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1028 "View.MemoryView" __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); - -#line 1028 "View.MemoryView" __pyx_t_2 = 0; /* "View.MemoryView":1029 * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< - * + * * result.to_object_func = to_object_func */ - -#line 1029 "View.MemoryView" __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error) - -#line 1029 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1029 "View.MemoryView" __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error) - -#line 1029 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 1029 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 1029 "View.MemoryView" __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L1_error) - -#line 1029 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 1029 "View.MemoryView" __pyx_v_result->__pyx_base.view.len = __pyx_t_9; - -#line 1029 "View.MemoryView" } /* "View.MemoryView":1031 * result.view.len *= length - * + * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< * result.to_dtype_func = to_dtype_func - * + * */ - -#line 1031 "View.MemoryView" __pyx_v_result->to_object_func = __pyx_v_to_object_func; /* "View.MemoryView":1032 - * + * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< - * + * * return result */ - -#line 1032 "View.MemoryView" __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; /* "View.MemoryView":1034 * result.to_dtype_func = to_dtype_func - * + * * return result # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') */ - -#line 1034 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 1034 "View.MemoryView" __Pyx_INCREF(((PyObject *)__pyx_v_result)); - -#line 1034 "View.MemoryView" __pyx_r = ((PyObject *)__pyx_v_result); - -#line 1034 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":987 - * + * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, * object (*to_object_func)(char *), */ -#line 987 "View.MemoryView" - - -#line 987 "View.MemoryView" /* function exit code */ - -#line 987 "View.MemoryView" __pyx_L1_error:; - -#line 987 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 987 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 987 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 987 "View.MemoryView" __pyx_r = 0; - -#line 987 "View.MemoryView" __pyx_L0:; - -#line 987 "View.MemoryView" __Pyx_XDECREF((PyObject *)__pyx_v_result); - -#line 987 "View.MemoryView" __Pyx_XDECREF(__pyx_v_length); - -#line 987 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 987 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 987 "View.MemoryView" return __pyx_r; - -#line 987 "View.MemoryView" } /* "View.MemoryView":1037 - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice): * cdef _memoryviewslice obj */ -#line 1037 "View.MemoryView" - - -#line 1037 "View.MemoryView" static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { - struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0 -#line 1037 "View.MemoryView" -; - -#line 1037 "View.MemoryView" + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; __Pyx_memviewslice *__pyx_r; - -#line 1037 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 1037 "View.MemoryView" int __pyx_t_1; - -#line 1037 "View.MemoryView" int __pyx_t_2; - -#line 1037 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 1037 "View.MemoryView" __Pyx_RefNannySetupContext("get_slice_from_memview", 0); /* "View.MemoryView":1040 @@ -32113,14 +17310,8 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * obj = memview * return &obj.from_slice */ - -#line 1040 "View.MemoryView" - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - -#line 1040 "View.MemoryView" + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); __pyx_t_2 = (__pyx_t_1 != 0); - -#line 1040 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1041 @@ -32130,20 +17321,10 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * return &obj.from_slice * else: */ - -#line 1041 "View.MemoryView" if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 1041, __pyx_L1_error) - -#line 1041 "View.MemoryView" __pyx_t_3 = ((PyObject *)__pyx_v_memview); - -#line 1041 "View.MemoryView" __Pyx_INCREF(__pyx_t_3); - -#line 1041 "View.MemoryView" __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); - -#line 1041 "View.MemoryView" __pyx_t_3 = 0; /* "View.MemoryView":1042 @@ -32153,11 +17334,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * else: * slice_copy(memview, mslice) */ - -#line 1042 "View.MemoryView" __pyx_r = (&__pyx_v_obj->from_slice); - -#line 1042 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1040 @@ -32167,8 +17344,6 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * obj = memview * return &obj.from_slice */ - -#line 1040 "View.MemoryView" } /* "View.MemoryView":1044 @@ -32176,207 +17351,127 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< * return mslice - * + * */ - -#line 1044 "View.MemoryView" /*else*/ { - -#line 1044 "View.MemoryView" __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); /* "View.MemoryView":1045 * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_slice_copy') */ - -#line 1045 "View.MemoryView" __pyx_r = __pyx_v_mslice; - -#line 1045 "View.MemoryView" goto __pyx_L0; - -#line 1045 "View.MemoryView" } /* "View.MemoryView":1037 - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice): * cdef _memoryviewslice obj */ -#line 1037 "View.MemoryView" - - -#line 1037 "View.MemoryView" /* function exit code */ - -#line 1037 "View.MemoryView" __pyx_L1_error:; - -#line 1037 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 1037 "View.MemoryView" __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); - -#line 1037 "View.MemoryView" __pyx_r = 0; - -#line 1037 "View.MemoryView" __pyx_L0:; - -#line 1037 "View.MemoryView" __Pyx_XDECREF((PyObject *)__pyx_v_obj); - -#line 1037 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1037 "View.MemoryView" return __pyx_r; - -#line 1037 "View.MemoryView" } /* "View.MemoryView":1048 - * + * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim * cdef (Py_ssize_t*) shape, strides, suboffsets */ -#line 1048 "View.MemoryView" - - -#line 1048 "View.MemoryView" static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { - int __pyx_v_dim -#line 1048 "View.MemoryView" -; - Py_ssize_t *__pyx_v_shape -#line 1048 "View.MemoryView" -; - Py_ssize_t *__pyx_v_strides -#line 1048 "View.MemoryView" -; - Py_ssize_t *__pyx_v_suboffsets -#line 1048 "View.MemoryView" -; - -#line 1048 "View.MemoryView" + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; __Pyx_RefNannyDeclarations - -#line 1048 "View.MemoryView" Py_ssize_t *__pyx_t_1; - -#line 1048 "View.MemoryView" int __pyx_t_2; - -#line 1048 "View.MemoryView" int __pyx_t_3; - -#line 1048 "View.MemoryView" Py_ssize_t __pyx_t_4; - -#line 1048 "View.MemoryView" __Pyx_RefNannySetupContext("slice_copy", 0); /* "View.MemoryView":1052 * cdef (Py_ssize_t*) shape, strides, suboffsets - * + * * shape = memview.view.shape # <<<<<<<<<<<<<< * strides = memview.view.strides * suboffsets = memview.view.suboffsets */ - -#line 1052 "View.MemoryView" __pyx_t_1 = __pyx_v_memview->view.shape; - -#line 1052 "View.MemoryView" __pyx_v_shape = __pyx_t_1; /* "View.MemoryView":1053 - * + * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< * suboffsets = memview.view.suboffsets - * + * */ - -#line 1053 "View.MemoryView" __pyx_t_1 = __pyx_v_memview->view.strides; - -#line 1053 "View.MemoryView" __pyx_v_strides = __pyx_t_1; /* "View.MemoryView":1054 * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< - * + * * dst.memview = <__pyx_memoryview *> memview */ - -#line 1054 "View.MemoryView" __pyx_t_1 = __pyx_v_memview->view.suboffsets; - -#line 1054 "View.MemoryView" __pyx_v_suboffsets = __pyx_t_1; /* "View.MemoryView":1056 * suboffsets = memview.view.suboffsets - * + * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< * dst.data = memview.view.buf - * + * */ - -#line 1056 "View.MemoryView" __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); /* "View.MemoryView":1057 - * + * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< - * + * * for dim in range(memview.view.ndim): */ - -#line 1057 "View.MemoryView" __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); /* "View.MemoryView":1059 * dst.data = memview.view.buf - * + * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] */ - -#line 1059 "View.MemoryView" __pyx_t_2 = __pyx_v_memview->view.ndim; - -#line 1059 "View.MemoryView" for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - -#line 1059 "View.MemoryView" __pyx_v_dim = __pyx_t_3; /* "View.MemoryView":1060 - * + * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 */ - -#line 1060 "View.MemoryView" (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); /* "View.MemoryView":1061 @@ -32384,88 +17479,50 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 - * + * */ - -#line 1061 "View.MemoryView" (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); /* "View.MemoryView":1062 * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_object') */ - -#line 1062 "View.MemoryView" if ((__pyx_v_suboffsets != 0)) { - -#line 1062 "View.MemoryView" __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]); - -#line 1062 "View.MemoryView" } else { - -#line 1062 "View.MemoryView" __pyx_t_4 = -1L; - -#line 1062 "View.MemoryView" } - -#line 1062 "View.MemoryView" (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4; - -#line 1062 "View.MemoryView" } /* "View.MemoryView":1048 - * + * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim * cdef (Py_ssize_t*) shape, strides, suboffsets */ -#line 1048 "View.MemoryView" - - -#line 1048 "View.MemoryView" /* function exit code */ - -#line 1048 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1048 "View.MemoryView" } /* "View.MemoryView":1065 - * + * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice */ -#line 1065 "View.MemoryView" - - -#line 1065 "View.MemoryView" static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { - __Pyx_memviewslice __pyx_v_memviewslice -#line 1065 "View.MemoryView" -; - -#line 1065 "View.MemoryView" + __Pyx_memviewslice __pyx_v_memviewslice; PyObject *__pyx_r = NULL; - -#line 1065 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 1065 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 1065 "View.MemoryView" __Pyx_RefNannySetupContext("memoryview_copy", 0); /* "View.MemoryView":1068 @@ -32473,152 +17530,82 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< * return memoryview_copy_from_slice(memview, &memviewslice) - * + * */ - -#line 1068 "View.MemoryView" __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); /* "View.MemoryView":1069 * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_object_from_slice') */ - -#line 1069 "View.MemoryView" __Pyx_XDECREF(__pyx_r); - -#line 1069 "View.MemoryView" __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __pyx_L1_error) - -#line 1069 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 1069 "View.MemoryView" __pyx_r = __pyx_t_1; - -#line 1069 "View.MemoryView" __pyx_t_1 = 0; - -#line 1069 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1065 - * + * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice */ -#line 1065 "View.MemoryView" - - -#line 1065 "View.MemoryView" /* function exit code */ - -#line 1065 "View.MemoryView" __pyx_L1_error:; - -#line 1065 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 1065 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1065 "View.MemoryView" __pyx_r = 0; - -#line 1065 "View.MemoryView" __pyx_L0:; - -#line 1065 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 1065 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1065 "View.MemoryView" return __pyx_r; - -#line 1065 "View.MemoryView" } /* "View.MemoryView":1072 - * + * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ * Create a new memoryview object from a given memoryview object and slice. */ -#line 1072 "View.MemoryView" - - -#line 1072 "View.MemoryView" static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { - PyObject *(*__pyx_v_to_object_func)(char *) -#line 1072 "View.MemoryView" -; - int (*__pyx_v_to_dtype_func)(char *, PyObject *) -#line 1072 "View.MemoryView" -; - -#line 1072 "View.MemoryView" + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); PyObject *__pyx_r = NULL; - -#line 1072 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 1072 "View.MemoryView" int __pyx_t_1; - -#line 1072 "View.MemoryView" int __pyx_t_2; - -#line 1072 "View.MemoryView" PyObject *(*__pyx_t_3)(char *); - -#line 1072 "View.MemoryView" int (*__pyx_t_4)(char *, PyObject *); - -#line 1072 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 1072 "View.MemoryView" __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); /* "View.MemoryView":1079 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func */ - -#line 1079 "View.MemoryView" - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); - -#line 1079 "View.MemoryView" + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); __pyx_t_2 = (__pyx_t_1 != 0); - -#line 1079 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1080 - * + * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: */ - -#line 1080 "View.MemoryView" __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; - -#line 1080 "View.MemoryView" __pyx_v_to_object_func = __pyx_t_3; /* "View.MemoryView":1081 @@ -32628,25 +17615,17 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * else: * to_object_func = NULL */ - -#line 1081 "View.MemoryView" __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; - -#line 1081 "View.MemoryView" __pyx_v_to_dtype_func = __pyx_t_4; /* "View.MemoryView":1079 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func */ - -#line 1079 "View.MemoryView" goto __pyx_L3; - -#line 1079 "View.MemoryView" } /* "View.MemoryView":1083 @@ -32654,139 +17633,83 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * else: * to_object_func = NULL # <<<<<<<<<<<<<< * to_dtype_func = NULL - * + * */ - -#line 1083 "View.MemoryView" /*else*/ { - -#line 1083 "View.MemoryView" __pyx_v_to_object_func = NULL; /* "View.MemoryView":1084 * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< - * + * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, */ - -#line 1084 "View.MemoryView" __pyx_v_to_dtype_func = NULL; - -#line 1084 "View.MemoryView" } - -#line 1084 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":1086 * to_dtype_func = NULL - * + * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< * to_object_func, to_dtype_func, * memview.dtype_is_object) */ - -#line 1086 "View.MemoryView" __Pyx_XDECREF(__pyx_r); /* "View.MemoryView":1088 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, * to_object_func, to_dtype_func, * memview.dtype_is_object) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1088 "View.MemoryView" __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L1_error) - -#line 1088 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 1088 "View.MemoryView" __pyx_r = __pyx_t_5; - -#line 1088 "View.MemoryView" __pyx_t_5 = 0; - -#line 1088 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1072 - * + * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ * Create a new memoryview object from a given memoryview object and slice. */ -#line 1072 "View.MemoryView" - - -#line 1072 "View.MemoryView" /* function exit code */ - -#line 1072 "View.MemoryView" __pyx_L1_error:; - -#line 1072 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 1072 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1072 "View.MemoryView" __pyx_r = 0; - -#line 1072 "View.MemoryView" __pyx_L0:; - -#line 1072 "View.MemoryView" __Pyx_XGIVEREF(__pyx_r); - -#line 1072 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1072 "View.MemoryView" return __pyx_r; - -#line 1072 "View.MemoryView" } /* "View.MemoryView":1094 - * - * + * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg */ -#line 1094 "View.MemoryView" - - -#line 1094 "View.MemoryView" static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { - -#line 1094 "View.MemoryView" Py_ssize_t __pyx_r; - -#line 1094 "View.MemoryView" int __pyx_t_1; /* "View.MemoryView":1095 - * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg * else: */ - -#line 1095 "View.MemoryView" __pyx_t_1 = ((__pyx_v_arg < 0) != 0); - -#line 1095 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":1096 @@ -32796,100 +17719,58 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { * else: * return arg */ - -#line 1096 "View.MemoryView" __pyx_r = (-__pyx_v_arg); - -#line 1096 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1095 - * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg * else: */ - -#line 1095 "View.MemoryView" } /* "View.MemoryView":1098 * return -arg * else: * return arg # <<<<<<<<<<<<<< - * + * * @cname('__pyx_get_best_slice_order') */ - -#line 1098 "View.MemoryView" /*else*/ { - -#line 1098 "View.MemoryView" __pyx_r = __pyx_v_arg; - -#line 1098 "View.MemoryView" goto __pyx_L0; - -#line 1098 "View.MemoryView" } /* "View.MemoryView":1094 - * - * + * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg */ -#line 1094 "View.MemoryView" - - -#line 1094 "View.MemoryView" /* function exit code */ - -#line 1094 "View.MemoryView" __pyx_L0:; - -#line 1094 "View.MemoryView" return __pyx_r; - -#line 1094 "View.MemoryView" } /* "View.MemoryView":1101 - * + * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ * Figure out the best memory access order for a given slice. */ -#line 1101 "View.MemoryView" - - -#line 1101 "View.MemoryView" static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { - int __pyx_v_i -#line 1101 "View.MemoryView" -; - Py_ssize_t __pyx_v_c_stride -#line 1101 "View.MemoryView" -; - Py_ssize_t __pyx_v_f_stride -#line 1101 "View.MemoryView" -; - -#line 1101 "View.MemoryView" + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; char __pyx_r; - -#line 1101 "View.MemoryView" int __pyx_t_1; - -#line 1101 "View.MemoryView" int __pyx_t_2; - -#line 1101 "View.MemoryView" int __pyx_t_3; /* "View.MemoryView":1106 @@ -32897,49 +17778,37 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< * cdef Py_ssize_t f_stride = 0 - * + * */ - -#line 1106 "View.MemoryView" __pyx_v_c_stride = 0; /* "View.MemoryView":1107 * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< - * + * * for i in range(ndim - 1, -1, -1): */ - -#line 1107 "View.MemoryView" __pyx_v_f_stride = 0; /* "View.MemoryView":1109 * cdef Py_ssize_t f_stride = 0 - * + * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] */ - -#line 1109 "View.MemoryView" for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { - -#line 1109 "View.MemoryView" __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1110 - * + * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] * break */ - -#line 1110 "View.MemoryView" __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); - -#line 1110 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1111 @@ -32947,69 +17816,49 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break - * + * */ - -#line 1111 "View.MemoryView" __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1112 * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ - -#line 1112 "View.MemoryView" goto __pyx_L4_break; /* "View.MemoryView":1110 - * + * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] * break */ - -#line 1110 "View.MemoryView" } - -#line 1110 "View.MemoryView" } - -#line 1110 "View.MemoryView" __pyx_L4_break:; /* "View.MemoryView":1114 * break - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] */ - -#line 1114 "View.MemoryView" __pyx_t_1 = __pyx_v_ndim; - -#line 1114 "View.MemoryView" for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { - -#line 1114 "View.MemoryView" __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1115 - * + * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] * break */ - -#line 1115 "View.MemoryView" __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); - -#line 1115 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1116 @@ -33017,175 +17866,111 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break - * + * */ - -#line 1116 "View.MemoryView" __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1117 * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): */ - -#line 1117 "View.MemoryView" goto __pyx_L7_break; /* "View.MemoryView":1115 - * + * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] * break */ - -#line 1115 "View.MemoryView" } - -#line 1115 "View.MemoryView" } - -#line 1115 "View.MemoryView" __pyx_L7_break:; /* "View.MemoryView":1119 * break - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: */ - -#line 1119 "View.MemoryView" __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); - -#line 1119 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1120 - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< * else: * return 'F' */ - -#line 1120 "View.MemoryView" __pyx_r = 'C'; - -#line 1120 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1119 * break - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: */ - -#line 1119 "View.MemoryView" } /* "View.MemoryView":1122 * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< - * + * * @cython.cdivision(True) */ - -#line 1122 "View.MemoryView" /*else*/ { - -#line 1122 "View.MemoryView" __pyx_r = 'F'; - -#line 1122 "View.MemoryView" goto __pyx_L0; - -#line 1122 "View.MemoryView" } /* "View.MemoryView":1101 - * + * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ * Figure out the best memory access order for a given slice. */ -#line 1101 "View.MemoryView" - - -#line 1101 "View.MemoryView" /* function exit code */ - -#line 1101 "View.MemoryView" __pyx_L0:; - -#line 1101 "View.MemoryView" return __pyx_r; - -#line 1101 "View.MemoryView" } /* "View.MemoryView":1125 - * + * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, */ -#line 1125 "View.MemoryView" - - -#line 1125 "View.MemoryView" static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { - CYTHON_UNUSED Py_ssize_t __pyx_v_i -#line 1125 "View.MemoryView" -; - CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent -#line 1125 "View.MemoryView" -; - Py_ssize_t __pyx_v_dst_extent -#line 1125 "View.MemoryView" -; - Py_ssize_t __pyx_v_src_stride -#line 1125 "View.MemoryView" -; - Py_ssize_t __pyx_v_dst_stride -#line 1125 "View.MemoryView" -; - -#line 1125 "View.MemoryView" + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; int __pyx_t_1; - -#line 1125 "View.MemoryView" int __pyx_t_2; - -#line 1125 "View.MemoryView" int __pyx_t_3; - -#line 1125 "View.MemoryView" Py_ssize_t __pyx_t_4; - -#line 1125 "View.MemoryView" Py_ssize_t __pyx_t_5; /* "View.MemoryView":1132 - * + * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] */ - -#line 1132 "View.MemoryView" __pyx_v_src_extent = (__pyx_v_src_shape[0]); /* "View.MemoryView":1133 @@ -33195,8 +17980,6 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] */ - -#line 1133 "View.MemoryView" __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); /* "View.MemoryView":1134 @@ -33204,79 +17987,47 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * */ - -#line 1134 "View.MemoryView" __pyx_v_src_stride = (__pyx_v_src_strides[0]); /* "View.MemoryView":1135 * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< - * + * * if ndim == 1: */ - -#line 1135 "View.MemoryView" __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); /* "View.MemoryView":1137 * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): */ - -#line 1137 "View.MemoryView" __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); - -#line 1137 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":1138 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ - -#line 1138 "View.MemoryView" __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); - -#line 1138 "View.MemoryView" if (__pyx_t_2) { - -#line 1138 "View.MemoryView" } else { - -#line 1138 "View.MemoryView" __pyx_t_1 = __pyx_t_2; - -#line 1138 "View.MemoryView" goto __pyx_L5_bool_binop_done; - -#line 1138 "View.MemoryView" } - -#line 1138 "View.MemoryView" __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); - -#line 1138 "View.MemoryView" if (__pyx_t_2) { - -#line 1138 "View.MemoryView" } else { - -#line 1138 "View.MemoryView" __pyx_t_1 = __pyx_t_2; - -#line 1138 "View.MemoryView" goto __pyx_L5_bool_binop_done; - -#line 1138 "View.MemoryView" } /* "View.MemoryView":1139 @@ -33286,37 +18037,21 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * memcpy(dst_data, src_data, itemsize * dst_extent) * else: */ - -#line 1139 "View.MemoryView" __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); - -#line 1139 "View.MemoryView" if (__pyx_t_2) { - -#line 1139 "View.MemoryView" __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); - -#line 1139 "View.MemoryView" } - -#line 1139 "View.MemoryView" __pyx_t_3 = (__pyx_t_2 != 0); - -#line 1139 "View.MemoryView" __pyx_t_1 = __pyx_t_3; - -#line 1139 "View.MemoryView" __pyx_L5_bool_binop_done:; /* "View.MemoryView":1138 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ - -#line 1138 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":1140 @@ -33326,22 +18061,16 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * else: * for i in range(dst_extent): */ - -#line 1140 "View.MemoryView" memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); /* "View.MemoryView":1138 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ - -#line 1138 "View.MemoryView" goto __pyx_L4; - -#line 1138 "View.MemoryView" } /* "View.MemoryView":1142 @@ -33351,17 +18080,9 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * memcpy(dst_data, src_data, itemsize) * src_data += src_stride */ - -#line 1142 "View.MemoryView" /*else*/ { - -#line 1142 "View.MemoryView" __pyx_t_4 = __pyx_v_dst_extent; - -#line 1142 "View.MemoryView" for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - -#line 1142 "View.MemoryView" __pyx_v_i = __pyx_t_5; /* "View.MemoryView":1143 @@ -33371,8 +18092,6 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * src_data += src_stride * dst_data += dst_stride */ - -#line 1143 "View.MemoryView" memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); /* "View.MemoryView":1144 @@ -33382,8 +18101,6 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * dst_data += dst_stride * else: */ - -#line 1144 "View.MemoryView" __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); /* "View.MemoryView":1145 @@ -33393,31 +18110,19 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * else: * for i in range(dst_extent): */ - -#line 1145 "View.MemoryView" __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); - -#line 1145 "View.MemoryView" } - -#line 1145 "View.MemoryView" } - -#line 1145 "View.MemoryView" __pyx_L4:; /* "View.MemoryView":1137 * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): */ - -#line 1137 "View.MemoryView" goto __pyx_L3; - -#line 1137 "View.MemoryView" } /* "View.MemoryView":1147 @@ -33427,17 +18132,9 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * _copy_strided_to_strided(src_data, src_strides + 1, * dst_data, dst_strides + 1, */ - -#line 1147 "View.MemoryView" /*else*/ { - -#line 1147 "View.MemoryView" __pyx_t_4 = __pyx_v_dst_extent; - -#line 1147 "View.MemoryView" for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - -#line 1147 "View.MemoryView" __pyx_v_i = __pyx_t_5; /* "View.MemoryView":1148 @@ -33447,8 +18144,6 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * dst_data, dst_strides + 1, * src_shape + 1, dst_shape + 1, */ - -#line 1148 "View.MemoryView" _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); /* "View.MemoryView":1152 @@ -33456,61 +18151,41 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< * dst_data += dst_stride - * + * */ - -#line 1152 "View.MemoryView" __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); /* "View.MemoryView":1153 * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, */ - -#line 1153 "View.MemoryView" __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); - -#line 1153 "View.MemoryView" } - -#line 1153 "View.MemoryView" } - -#line 1153 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":1125 - * + * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, */ -#line 1125 "View.MemoryView" - - -#line 1125 "View.MemoryView" /* function exit code */ - -#line 1125 "View.MemoryView" } /* "View.MemoryView":1155 * dst_data += dst_stride - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: */ -#line 1155 "View.MemoryView" - - -#line 1155 "View.MemoryView" static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { /* "View.MemoryView":1158 @@ -33518,201 +18193,125 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< * src.shape, dst.shape, ndim, itemsize) - * + * */ - -#line 1158 "View.MemoryView" _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1155 * dst_data += dst_stride - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: */ -#line 1155 "View.MemoryView" - - -#line 1155 "View.MemoryView" /* function exit code */ - -#line 1155 "View.MemoryView" } /* "View.MemoryView":1162 - * + * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" * cdef int i */ -#line 1162 "View.MemoryView" - - -#line 1162 "View.MemoryView" static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { - int __pyx_v_i -#line 1162 "View.MemoryView" -; - Py_ssize_t __pyx_v_size -#line 1162 "View.MemoryView" -; - -#line 1162 "View.MemoryView" + int __pyx_v_i; + Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_r; - -#line 1162 "View.MemoryView" Py_ssize_t __pyx_t_1; - -#line 1162 "View.MemoryView" int __pyx_t_2; - -#line 1162 "View.MemoryView" int __pyx_t_3; /* "View.MemoryView":1165 * "Return the size of the memory occupied by the slice in number of bytes" * cdef int i * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ - -#line 1165 "View.MemoryView" __pyx_t_1 = __pyx_v_src->memview->view.itemsize; - -#line 1165 "View.MemoryView" __pyx_v_size = __pyx_t_1; /* "View.MemoryView":1167 * cdef Py_ssize_t size = src.memview.view.itemsize - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * size *= src.shape[i] - * + * */ - -#line 1167 "View.MemoryView" __pyx_t_2 = __pyx_v_ndim; - -#line 1167 "View.MemoryView" for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - -#line 1167 "View.MemoryView" __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1168 - * + * * for i in range(ndim): * size *= src.shape[i] # <<<<<<<<<<<<<< - * + * * return size */ - -#line 1168 "View.MemoryView" __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); - -#line 1168 "View.MemoryView" } /* "View.MemoryView":1170 * size *= src.shape[i] - * + * * return size # <<<<<<<<<<<<<< - * + * * @cname('__pyx_fill_contig_strides_array') */ - -#line 1170 "View.MemoryView" __pyx_r = __pyx_v_size; - -#line 1170 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1162 - * + * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" * cdef int i */ -#line 1162 "View.MemoryView" - - -#line 1162 "View.MemoryView" /* function exit code */ - -#line 1162 "View.MemoryView" __pyx_L0:; - -#line 1162 "View.MemoryView" return __pyx_r; - -#line 1162 "View.MemoryView" } /* "View.MemoryView":1173 - * + * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, * int ndim, char order) nogil: */ -#line 1173 "View.MemoryView" - - -#line 1173 "View.MemoryView" static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { - int __pyx_v_idx -#line 1173 "View.MemoryView" -; - -#line 1173 "View.MemoryView" + int __pyx_v_idx; Py_ssize_t __pyx_r; - -#line 1173 "View.MemoryView" int __pyx_t_1; - -#line 1173 "View.MemoryView" int __pyx_t_2; - -#line 1173 "View.MemoryView" int __pyx_t_3; /* "View.MemoryView":1182 * cdef int idx - * + * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride */ - -#line 1182 "View.MemoryView" __pyx_t_1 = ((__pyx_v_order == 'F') != 0); - -#line 1182 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":1183 - * + * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< * strides[idx] = stride * stride = stride * shape[idx] */ - -#line 1183 "View.MemoryView" __pyx_t_2 = __pyx_v_ndim; - -#line 1183 "View.MemoryView" for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - -#line 1183 "View.MemoryView" __pyx_v_idx = __pyx_t_3; /* "View.MemoryView":1184 @@ -33722,8 +18321,6 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * stride = stride * shape[idx] * else: */ - -#line 1184 "View.MemoryView" (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; /* "View.MemoryView":1185 @@ -33733,25 +18330,17 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * else: * for idx in range(ndim - 1, -1, -1): */ - -#line 1185 "View.MemoryView" __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); - -#line 1185 "View.MemoryView" } /* "View.MemoryView":1182 * cdef int idx - * + * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride */ - -#line 1182 "View.MemoryView" goto __pyx_L3; - -#line 1182 "View.MemoryView" } /* "View.MemoryView":1187 @@ -33761,14 +18350,8 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * strides[idx] = stride * stride = stride * shape[idx] */ - -#line 1187 "View.MemoryView" /*else*/ { - -#line 1187 "View.MemoryView" for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) { - -#line 1187 "View.MemoryView" __pyx_v_idx = __pyx_t_2; /* "View.MemoryView":1188 @@ -33776,208 +18359,138 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< * stride = stride * shape[idx] - * + * */ - -#line 1188 "View.MemoryView" (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; /* "View.MemoryView":1189 * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride = stride * shape[idx] # <<<<<<<<<<<<<< - * + * * return stride */ - -#line 1189 "View.MemoryView" __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); - -#line 1189 "View.MemoryView" } - -#line 1189 "View.MemoryView" } - -#line 1189 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":1191 * stride = stride * shape[idx] - * + * * return stride # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_data_to_temp') */ - -#line 1191 "View.MemoryView" __pyx_r = __pyx_v_stride; - -#line 1191 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1173 - * + * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, * int ndim, char order) nogil: */ -#line 1173 "View.MemoryView" - - -#line 1173 "View.MemoryView" /* function exit code */ - -#line 1173 "View.MemoryView" __pyx_L0:; - -#line 1173 "View.MemoryView" return __pyx_r; - -#line 1173 "View.MemoryView" } /* "View.MemoryView":1194 - * + * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, * char order, */ -#line 1194 "View.MemoryView" - - -#line 1194 "View.MemoryView" static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { - int __pyx_v_i -#line 1194 "View.MemoryView" -; - void *__pyx_v_result -#line 1194 "View.MemoryView" -; - size_t __pyx_v_itemsize -#line 1194 "View.MemoryView" -; - size_t __pyx_v_size -#line 1194 "View.MemoryView" -; - -#line 1194 "View.MemoryView" + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; void *__pyx_r; - -#line 1194 "View.MemoryView" Py_ssize_t __pyx_t_1; - -#line 1194 "View.MemoryView" int __pyx_t_2; - -#line 1194 "View.MemoryView" int __pyx_t_3; - -#line 1194 "View.MemoryView" struct __pyx_memoryview_obj *__pyx_t_4; - -#line 1194 "View.MemoryView" int __pyx_t_5; /* "View.MemoryView":1205 * cdef void *result - * + * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< * cdef size_t size = slice_get_size(src, ndim) - * + * */ - -#line 1205 "View.MemoryView" __pyx_t_1 = __pyx_v_src->memview->view.itemsize; - -#line 1205 "View.MemoryView" __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1206 - * + * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< - * + * * result = malloc(size) */ - -#line 1206 "View.MemoryView" __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); /* "View.MemoryView":1208 * cdef size_t size = slice_get_size(src, ndim) - * + * * result = malloc(size) # <<<<<<<<<<<<<< * if not result: * _err(MemoryError, NULL) */ - -#line 1208 "View.MemoryView" __pyx_v_result = malloc(__pyx_v_size); /* "View.MemoryView":1209 - * + * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) - * + * */ - -#line 1209 "View.MemoryView" __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); - -#line 1209 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1210 * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1210 "View.MemoryView" __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1210, __pyx_L1_error) /* "View.MemoryView":1209 - * + * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) - * + * */ - -#line 1209 "View.MemoryView" } /* "View.MemoryView":1213 - * - * + * + * * tmpslice.data = result # <<<<<<<<<<<<<< * tmpslice.memview = src.memview * for i in range(ndim): */ - -#line 1213 "View.MemoryView" __pyx_v_tmpslice->data = ((char *)__pyx_v_result); /* "View.MemoryView":1214 - * + * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] */ - -#line 1214 "View.MemoryView" __pyx_t_4 = __pyx_v_src->memview; - -#line 1214 "View.MemoryView" __pyx_v_tmpslice->memview = __pyx_t_4; /* "View.MemoryView":1215 @@ -33987,14 +18500,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 */ - -#line 1215 "View.MemoryView" __pyx_t_3 = __pyx_v_ndim; - -#line 1215 "View.MemoryView" for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { - -#line 1215 "View.MemoryView" __pyx_v_i = __pyx_t_5; /* "View.MemoryView":1216 @@ -34002,323 +18509,187 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< * tmpslice.suboffsets[i] = -1 - * + * */ - -#line 1216 "View.MemoryView" (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); /* "View.MemoryView":1217 * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< - * + * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, */ - -#line 1217 "View.MemoryView" (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; - -#line 1217 "View.MemoryView" } /* "View.MemoryView":1219 * tmpslice.suboffsets[i] = -1 - * + * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< * ndim, order) - * + * */ - -#line 1219 "View.MemoryView" __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); /* "View.MemoryView":1223 - * - * + * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 */ - -#line 1223 "View.MemoryView" __pyx_t_3 = __pyx_v_ndim; - -#line 1223 "View.MemoryView" for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { - -#line 1223 "View.MemoryView" __pyx_v_i = __pyx_t_5; /* "View.MemoryView":1224 - * + * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 - * + * */ - -#line 1224 "View.MemoryView" __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); - -#line 1224 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1225 * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< - * + * * if slice_is_contig(src[0], order, ndim): */ - -#line 1225 "View.MemoryView" (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; /* "View.MemoryView":1224 - * + * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 - * + * */ - -#line 1224 "View.MemoryView" } - -#line 1224 "View.MemoryView" } /* "View.MemoryView":1227 * tmpslice.strides[i] = 0 - * + * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: */ - -#line 1227 "View.MemoryView" __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); - -#line 1227 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1228 - * + * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) */ - -#line 1228 "View.MemoryView" memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); /* "View.MemoryView":1227 * tmpslice.strides[i] = 0 - * + * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: */ - -#line 1227 "View.MemoryView" goto __pyx_L9; - -#line 1227 "View.MemoryView" } /* "View.MemoryView":1230 * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< - * + * * return result */ - -#line 1230 "View.MemoryView" /*else*/ { - -#line 1230 "View.MemoryView" copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); - -#line 1230 "View.MemoryView" } - -#line 1230 "View.MemoryView" __pyx_L9:; /* "View.MemoryView":1232 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) - * + * * return result # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1232 "View.MemoryView" __pyx_r = __pyx_v_result; - -#line 1232 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1194 - * + * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, * char order, */ -#line 1194 "View.MemoryView" - - -#line 1194 "View.MemoryView" /* function exit code */ - -#line 1194 "View.MemoryView" __pyx_L1_error:; - -#line 1194 "View.MemoryView" { - -#line 1194 "View.MemoryView" #ifdef WITH_THREAD - PyGILState_STATE -#line 1194 "View.MemoryView" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 1194 "View.MemoryView" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 1194 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1194 "View.MemoryView" #ifdef WITH_THREAD - -#line 1194 "View.MemoryView" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 1194 "View.MemoryView" #endif - -#line 1194 "View.MemoryView" } - -#line 1194 "View.MemoryView" __pyx_r = NULL; - -#line 1194 "View.MemoryView" __pyx_L0:; - -#line 1194 "View.MemoryView" return __pyx_r; - -#line 1194 "View.MemoryView" } /* "View.MemoryView":1237 - * + * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % */ -#line 1237 "View.MemoryView" - - -#line 1237 "View.MemoryView" static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { - -#line 1237 "View.MemoryView" int __pyx_r; - -#line 1237 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 1237 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 1237 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 1237 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 1237 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 1237 "View.MemoryView" #ifdef WITH_THREAD - PyGILState_STATE -#line 1237 "View.MemoryView" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 1237 "View.MemoryView" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 1237 "View.MemoryView" __Pyx_RefNannySetupContext("_err_extents", 0); /* "View.MemoryView":1240 * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % * (i, extent1, extent2)) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_err_dim') */ - -#line 1240 "View.MemoryView" __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error) - -#line 1240 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 1240 "View.MemoryView" __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error) - -#line 1240 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1240 "View.MemoryView" __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error) - -#line 1240 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 1240 "View.MemoryView" __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L1_error) - -#line 1240 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 1240 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 1240 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - -#line 1240 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_2); - -#line 1240 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - -#line 1240 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 1240 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); - -#line 1240 "View.MemoryView" __pyx_t_1 = 0; - -#line 1240 "View.MemoryView" __pyx_t_2 = 0; - -#line 1240 "View.MemoryView" __pyx_t_3 = 0; /* "View.MemoryView":1239 @@ -34326,446 +18697,180 @@ __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< * (i, extent1, extent2)) - * + * */ - -#line 1239 "View.MemoryView" __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error) - -#line 1239 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 1239 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 1239 "View.MemoryView" __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1239, __pyx_L1_error) - -#line 1239 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 1239 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 1239 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - -#line 1239 "View.MemoryView" __pyx_t_3 = 0; - -#line 1239 "View.MemoryView" __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error) - -#line 1239 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 1239 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 1239 "View.MemoryView" __Pyx_Raise(__pyx_t_3, 0, 0, 0); - -#line 1239 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 1239 "View.MemoryView" __PYX_ERR(0, 1239, __pyx_L1_error) /* "View.MemoryView":1237 - * + * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % */ -#line 1237 "View.MemoryView" - - -#line 1237 "View.MemoryView" /* function exit code */ - -#line 1237 "View.MemoryView" __pyx_L1_error:; - -#line 1237 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 1237 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 1237 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 1237 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); - -#line 1237 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1237 "View.MemoryView" __pyx_r = -1; - -#line 1237 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1237 "View.MemoryView" #ifdef WITH_THREAD - -#line 1237 "View.MemoryView" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 1237 "View.MemoryView" #endif - -#line 1237 "View.MemoryView" return __pyx_r; - -#line 1237 "View.MemoryView" } /* "View.MemoryView":1243 - * + * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) - * + * */ -#line 1243 "View.MemoryView" - - -#line 1243 "View.MemoryView" static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { - -#line 1243 "View.MemoryView" int __pyx_r; - -#line 1243 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 1243 "View.MemoryView" PyObject *__pyx_t_1 = NULL; - -#line 1243 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 1243 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 1243 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 1243 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 1243 "View.MemoryView" #ifdef WITH_THREAD - PyGILState_STATE -#line 1243 "View.MemoryView" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 1243 "View.MemoryView" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 1243 "View.MemoryView" __Pyx_RefNannySetupContext("_err_dim", 0); - -#line 1243 "View.MemoryView" __Pyx_INCREF(__pyx_v_error); /* "View.MemoryView":1244 * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_err') */ - -#line 1244 "View.MemoryView" __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error) - -#line 1244 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1244 "View.MemoryView" __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L1_error) - -#line 1244 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 1244 "View.MemoryView" __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1244, __pyx_L1_error) - -#line 1244 "View.MemoryView" __Pyx_GOTREF(__pyx_t_4); - -#line 1244 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 1244 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 1244 "View.MemoryView" __Pyx_INCREF(__pyx_v_error); - __pyx_t_3 = __pyx_v_error; -#line 1244 "View.MemoryView" -__pyx_t_2 = NULL; - -#line 1244 "View.MemoryView" + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - -#line 1244 "View.MemoryView" __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - -#line 1244 "View.MemoryView" if (likely(__pyx_t_2)) { - -#line 1244 "View.MemoryView" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - -#line 1244 "View.MemoryView" __Pyx_INCREF(__pyx_t_2); - -#line 1244 "View.MemoryView" __Pyx_INCREF(function); - -#line 1244 "View.MemoryView" __Pyx_DECREF_SET(__pyx_t_3, function); - -#line 1244 "View.MemoryView" } - -#line 1244 "View.MemoryView" } - -#line 1244 "View.MemoryView" if (!__pyx_t_2) { - -#line 1244 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) - -#line 1244 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 1244 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 1244 "View.MemoryView" } else { - -#line 1244 "View.MemoryView" #if CYTHON_FAST_PYCALL - -#line 1244 "View.MemoryView" if (PyFunction_Check(__pyx_t_3)) { - -#line 1244 "View.MemoryView" PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - -#line 1244 "View.MemoryView" __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) - -#line 1244 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 1244 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 1244 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 1244 "View.MemoryView" } else - -#line 1244 "View.MemoryView" #endif - -#line 1244 "View.MemoryView" #if CYTHON_FAST_PYCCALL - -#line 1244 "View.MemoryView" if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - -#line 1244 "View.MemoryView" PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; - -#line 1244 "View.MemoryView" __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) - -#line 1244 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 1244 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 1244 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 1244 "View.MemoryView" } else - -#line 1244 "View.MemoryView" #endif - -#line 1244 "View.MemoryView" { - -#line 1244 "View.MemoryView" __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1244, __pyx_L1_error) - -#line 1244 "View.MemoryView" __Pyx_GOTREF(__pyx_t_5); - -#line 1244 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; - -#line 1244 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_4); - -#line 1244 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); - -#line 1244 "View.MemoryView" __pyx_t_4 = 0; - -#line 1244 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) - -#line 1244 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 1244 "View.MemoryView" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 1244 "View.MemoryView" } - -#line 1244 "View.MemoryView" } - -#line 1244 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 1244 "View.MemoryView" __Pyx_Raise(__pyx_t_1, 0, 0, 0); - -#line 1244 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 1244 "View.MemoryView" __PYX_ERR(0, 1244, __pyx_L1_error) /* "View.MemoryView":1243 - * + * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) - * + * */ -#line 1243 "View.MemoryView" - - -#line 1243 "View.MemoryView" /* function exit code */ - -#line 1243 "View.MemoryView" __pyx_L1_error:; - -#line 1243 "View.MemoryView" __Pyx_XDECREF(__pyx_t_1); - -#line 1243 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 1243 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 1243 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); - -#line 1243 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 1243 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1243 "View.MemoryView" __pyx_r = -1; - -#line 1243 "View.MemoryView" __Pyx_XDECREF(__pyx_v_error); - -#line 1243 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1243 "View.MemoryView" #ifdef WITH_THREAD - -#line 1243 "View.MemoryView" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 1243 "View.MemoryView" #endif - -#line 1243 "View.MemoryView" return __pyx_r; - -#line 1243 "View.MemoryView" } /* "View.MemoryView":1247 - * + * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: * raise error(msg.decode('ascii')) */ -#line 1247 "View.MemoryView" - - -#line 1247 "View.MemoryView" static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { - -#line 1247 "View.MemoryView" int __pyx_r; - -#line 1247 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 1247 "View.MemoryView" int __pyx_t_1; - -#line 1247 "View.MemoryView" PyObject *__pyx_t_2 = NULL; - -#line 1247 "View.MemoryView" PyObject *__pyx_t_3 = NULL; - -#line 1247 "View.MemoryView" PyObject *__pyx_t_4 = NULL; - -#line 1247 "View.MemoryView" PyObject *__pyx_t_5 = NULL; - -#line 1247 "View.MemoryView" PyObject *__pyx_t_6 = NULL; - -#line 1247 "View.MemoryView" #ifdef WITH_THREAD - PyGILState_STATE -#line 1247 "View.MemoryView" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 1247 "View.MemoryView" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 1247 "View.MemoryView" __Pyx_RefNannySetupContext("_err", 0); - -#line 1247 "View.MemoryView" __Pyx_INCREF(__pyx_v_error); /* "View.MemoryView":1248 @@ -34775,11 +18880,7 @@ __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); * raise error(msg.decode('ascii')) * else: */ - -#line 1248 "View.MemoryView" __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); - -#line 1248 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":1249 @@ -34789,161 +18890,57 @@ __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); * else: * raise error */ - -#line 1249 "View.MemoryView" __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1249, __pyx_L1_error) - -#line 1249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_3); - -#line 1249 "View.MemoryView" __Pyx_INCREF(__pyx_v_error); - __pyx_t_4 = __pyx_v_error; -#line 1249 "View.MemoryView" -__pyx_t_5 = NULL; - -#line 1249 "View.MemoryView" + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - -#line 1249 "View.MemoryView" __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - -#line 1249 "View.MemoryView" if (likely(__pyx_t_5)) { - -#line 1249 "View.MemoryView" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - -#line 1249 "View.MemoryView" __Pyx_INCREF(__pyx_t_5); - -#line 1249 "View.MemoryView" __Pyx_INCREF(function); - -#line 1249 "View.MemoryView" __Pyx_DECREF_SET(__pyx_t_4, function); - -#line 1249 "View.MemoryView" } - -#line 1249 "View.MemoryView" } - -#line 1249 "View.MemoryView" if (!__pyx_t_5) { - -#line 1249 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error) - -#line 1249 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 1249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1249 "View.MemoryView" } else { - -#line 1249 "View.MemoryView" #if CYTHON_FAST_PYCALL - -#line 1249 "View.MemoryView" if (PyFunction_Check(__pyx_t_4)) { - -#line 1249 "View.MemoryView" PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - -#line 1249 "View.MemoryView" __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error) - -#line 1249 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 1249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1249 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 1249 "View.MemoryView" } else - -#line 1249 "View.MemoryView" #endif - -#line 1249 "View.MemoryView" #if CYTHON_FAST_PYCCALL - -#line 1249 "View.MemoryView" if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - -#line 1249 "View.MemoryView" PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; - -#line 1249 "View.MemoryView" __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error) - -#line 1249 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 1249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1249 "View.MemoryView" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 1249 "View.MemoryView" } else - -#line 1249 "View.MemoryView" #endif - -#line 1249 "View.MemoryView" { - -#line 1249 "View.MemoryView" __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1249, __pyx_L1_error) - -#line 1249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_6); - -#line 1249 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - -#line 1249 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_3); - -#line 1249 "View.MemoryView" PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); - -#line 1249 "View.MemoryView" __pyx_t_3 = 0; - -#line 1249 "View.MemoryView" __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error) - -#line 1249 "View.MemoryView" __Pyx_GOTREF(__pyx_t_2); - -#line 1249 "View.MemoryView" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 1249 "View.MemoryView" } - -#line 1249 "View.MemoryView" } - -#line 1249 "View.MemoryView" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 1249 "View.MemoryView" __Pyx_Raise(__pyx_t_2, 0, 0, 0); - -#line 1249 "View.MemoryView" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 1249 "View.MemoryView" __PYX_ERR(0, 1249, __pyx_L1_error) /* "View.MemoryView":1248 @@ -34953,149 +18950,69 @@ __pyx_t_5 = NULL; * raise error(msg.decode('ascii')) * else: */ - -#line 1248 "View.MemoryView" } /* "View.MemoryView":1251 * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_contents') */ - -#line 1251 "View.MemoryView" /*else*/ { - -#line 1251 "View.MemoryView" __Pyx_Raise(__pyx_v_error, 0, 0, 0); - -#line 1251 "View.MemoryView" __PYX_ERR(0, 1251, __pyx_L1_error) - -#line 1251 "View.MemoryView" } /* "View.MemoryView":1247 - * + * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: * raise error(msg.decode('ascii')) */ -#line 1247 "View.MemoryView" - - -#line 1247 "View.MemoryView" /* function exit code */ - -#line 1247 "View.MemoryView" __pyx_L1_error:; - -#line 1247 "View.MemoryView" __Pyx_XDECREF(__pyx_t_2); - -#line 1247 "View.MemoryView" __Pyx_XDECREF(__pyx_t_3); - -#line 1247 "View.MemoryView" __Pyx_XDECREF(__pyx_t_4); - -#line 1247 "View.MemoryView" __Pyx_XDECREF(__pyx_t_5); - -#line 1247 "View.MemoryView" __Pyx_XDECREF(__pyx_t_6); - -#line 1247 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1247 "View.MemoryView" __pyx_r = -1; - -#line 1247 "View.MemoryView" __Pyx_XDECREF(__pyx_v_error); - -#line 1247 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1247 "View.MemoryView" #ifdef WITH_THREAD - -#line 1247 "View.MemoryView" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 1247 "View.MemoryView" #endif - -#line 1247 "View.MemoryView" return __pyx_r; - -#line 1247 "View.MemoryView" } /* "View.MemoryView":1254 - * + * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, * int src_ndim, int dst_ndim, */ -#line 1254 "View.MemoryView" - - -#line 1254 "View.MemoryView" static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { - void *__pyx_v_tmpdata -#line 1254 "View.MemoryView" -; - size_t __pyx_v_itemsize -#line 1254 "View.MemoryView" -; - int __pyx_v_i -#line 1254 "View.MemoryView" -; - char __pyx_v_order -#line 1254 "View.MemoryView" -; - int __pyx_v_broadcasting -#line 1254 "View.MemoryView" -; - int __pyx_v_direct_copy -#line 1254 "View.MemoryView" -; - __Pyx_memviewslice __pyx_v_tmp -#line 1254 "View.MemoryView" -; - int __pyx_v_ndim -#line 1254 "View.MemoryView" -; - -#line 1254 "View.MemoryView" + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; int __pyx_r; - -#line 1254 "View.MemoryView" Py_ssize_t __pyx_t_1; - -#line 1254 "View.MemoryView" int __pyx_t_2; - -#line 1254 "View.MemoryView" int __pyx_t_3; - -#line 1254 "View.MemoryView" int __pyx_t_4; - -#line 1254 "View.MemoryView" int __pyx_t_5; - -#line 1254 "View.MemoryView" void *__pyx_t_6; - -#line 1254 "View.MemoryView" int __pyx_t_7; /* "View.MemoryView":1262 @@ -35105,8 +19022,6 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * cdef size_t itemsize = src.memview.view.itemsize * cdef int i */ - -#line 1262 "View.MemoryView" __pyx_v_tmpdata = NULL; /* "View.MemoryView":1263 @@ -35116,11 +19031,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * cdef int i * cdef char order = get_best_order(&src, src_ndim) */ - -#line 1263 "View.MemoryView" __pyx_t_1 = __pyx_v_src.memview->view.itemsize; - -#line 1263 "View.MemoryView" __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1265 @@ -35130,8 +19041,6 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * cdef bint broadcasting = False * cdef bint direct_copy = False */ - -#line 1265 "View.MemoryView" __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); /* "View.MemoryView":1266 @@ -35141,8 +19050,6 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * cdef bint direct_copy = False * cdef __Pyx_memviewslice tmp */ - -#line 1266 "View.MemoryView" __pyx_v_broadcasting = 0; /* "View.MemoryView":1267 @@ -35150,49 +19057,37 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice tmp - * + * */ - -#line 1267 "View.MemoryView" __pyx_v_direct_copy = 0; /* "View.MemoryView":1270 * cdef __Pyx_memviewslice tmp - * + * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: */ - -#line 1270 "View.MemoryView" __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); - -#line 1270 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1271 - * + * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) */ - -#line 1271 "View.MemoryView" __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); /* "View.MemoryView":1270 * cdef __Pyx_memviewslice tmp - * + * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: */ - -#line 1270 "View.MemoryView" goto __pyx_L3; - -#line 1270 "View.MemoryView" } /* "View.MemoryView":1272 @@ -35200,24 +19095,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * */ - -#line 1272 "View.MemoryView" __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); - -#line 1272 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1273 * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< - * + * * cdef int ndim = max(src_ndim, dst_ndim) */ - -#line 1273 "View.MemoryView" __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); /* "View.MemoryView":1272 @@ -35225,76 +19114,46 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * */ - -#line 1272 "View.MemoryView" } - -#line 1272 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":1275 * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ - -#line 1275 "View.MemoryView" __pyx_t_3 = __pyx_v_dst_ndim; - -#line 1275 "View.MemoryView" __pyx_t_4 = __pyx_v_src_ndim; - -#line 1275 "View.MemoryView" if (((__pyx_t_3 > __pyx_t_4) != 0)) { - -#line 1275 "View.MemoryView" __pyx_t_5 = __pyx_t_3; - -#line 1275 "View.MemoryView" } else { - -#line 1275 "View.MemoryView" __pyx_t_5 = __pyx_t_4; - -#line 1275 "View.MemoryView" } - -#line 1275 "View.MemoryView" __pyx_v_ndim = __pyx_t_5; /* "View.MemoryView":1277 * cdef int ndim = max(src_ndim, dst_ndim) - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: */ - -#line 1277 "View.MemoryView" __pyx_t_5 = __pyx_v_ndim; - -#line 1277 "View.MemoryView" for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { - -#line 1277 "View.MemoryView" __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1278 - * + * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: * broadcasting = True */ - -#line 1278 "View.MemoryView" __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); - -#line 1278 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1279 @@ -35304,11 +19163,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcasting = True * src.strides[i] = 0 */ - -#line 1279 "View.MemoryView" __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); - -#line 1279 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1280 @@ -35318,8 +19173,6 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * src.strides[i] = 0 * else: */ - -#line 1280 "View.MemoryView" __pyx_v_broadcasting = 1; /* "View.MemoryView":1281 @@ -35329,8 +19182,6 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * else: * _err_extents(i, dst.shape[i], src.shape[i]) */ - -#line 1281 "View.MemoryView" (__pyx_v_src.strides[__pyx_v_i]) = 0; /* "View.MemoryView":1279 @@ -35340,220 +19191,162 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcasting = True * src.strides[i] = 0 */ - -#line 1279 "View.MemoryView" goto __pyx_L7; - -#line 1279 "View.MemoryView" } /* "View.MemoryView":1283 * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< - * + * * if src.suboffsets[i] >= 0: */ - -#line 1283 "View.MemoryView" /*else*/ { - -#line 1283 "View.MemoryView" __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1283, __pyx_L1_error) - -#line 1283 "View.MemoryView" } - -#line 1283 "View.MemoryView" __pyx_L7:; /* "View.MemoryView":1278 - * + * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: * broadcasting = True */ - -#line 1278 "View.MemoryView" } /* "View.MemoryView":1285 * _err_extents(i, dst.shape[i], src.shape[i]) - * + * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * */ - -#line 1285 "View.MemoryView" __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); - -#line 1285 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1286 - * + * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< - * + * * if slices_overlap(&src, &dst, ndim, itemsize): */ - -#line 1286 "View.MemoryView" __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1286, __pyx_L1_error) /* "View.MemoryView":1285 * _err_extents(i, dst.shape[i], src.shape[i]) - * + * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * */ - -#line 1285 "View.MemoryView" } - -#line 1285 "View.MemoryView" } /* "View.MemoryView":1288 * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * + * * if not slice_is_contig(src, order, ndim): */ - -#line 1288 "View.MemoryView" __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); - -#line 1288 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1290 * if slices_overlap(&src, &dst, ndim, itemsize): - * + * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) - * + * */ - -#line 1290 "View.MemoryView" __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); - -#line 1290 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1291 - * + * * if not slice_is_contig(src, order, ndim): * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) */ - -#line 1291 "View.MemoryView" __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); /* "View.MemoryView":1290 * if slices_overlap(&src, &dst, ndim, itemsize): - * + * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) - * + * */ - -#line 1290 "View.MemoryView" } /* "View.MemoryView":1293 * order = get_best_order(&dst, ndim) - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp - * + * */ - -#line 1293 "View.MemoryView" __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(0, 1293, __pyx_L1_error) - -#line 1293 "View.MemoryView" __pyx_v_tmpdata = __pyx_t_6; /* "View.MemoryView":1294 - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< - * + * * if not broadcasting: */ - -#line 1294 "View.MemoryView" __pyx_v_src = __pyx_v_tmp; /* "View.MemoryView":1288 * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * + * * if not slice_is_contig(src, order, ndim): */ - -#line 1288 "View.MemoryView" } /* "View.MemoryView":1296 * src = tmp - * + * * if not broadcasting: # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1296 "View.MemoryView" __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); - -#line 1296 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1299 - * - * + * + * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): */ - -#line 1299 "View.MemoryView" __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); - -#line 1299 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1300 - * + * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) */ - -#line 1300 "View.MemoryView" __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); /* "View.MemoryView":1299 - * - * + * + * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): */ - -#line 1299 "View.MemoryView" goto __pyx_L12; - -#line 1299 "View.MemoryView" } /* "View.MemoryView":1301 @@ -35561,24 +19354,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * */ - -#line 1301 "View.MemoryView" __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); - -#line 1301 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1302 * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< - * + * * if direct_copy: */ - -#line 1302 "View.MemoryView" __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); /* "View.MemoryView":1301 @@ -35586,49 +19373,37 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * */ - -#line 1301 "View.MemoryView" } - -#line 1301 "View.MemoryView" __pyx_L12:; /* "View.MemoryView":1304 * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * * if direct_copy: # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - -#line 1304 "View.MemoryView" __pyx_t_2 = (__pyx_v_direct_copy != 0); - -#line 1304 "View.MemoryView" if (__pyx_t_2) { /* "View.MemoryView":1306 * if direct_copy: - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) */ - -#line 1306 "View.MemoryView" __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1307 - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) */ - -#line 1307 "View.MemoryView" memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); /* "View.MemoryView":1308 @@ -35638,8 +19413,6 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * free(tmpdata) * return 0 */ - -#line 1308 "View.MemoryView" __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1309 @@ -35647,281 +19420,189 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< * return 0 - * + * */ - -#line 1309 "View.MemoryView" free(__pyx_v_tmpdata); /* "View.MemoryView":1310 * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< - * + * * if order == 'F' == get_best_order(&dst, ndim): */ - -#line 1310 "View.MemoryView" __pyx_r = 0; - -#line 1310 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1304 * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * * if direct_copy: # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - -#line 1304 "View.MemoryView" } /* "View.MemoryView":1296 * src = tmp - * + * * if not broadcasting: # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1296 "View.MemoryView" } /* "View.MemoryView":1312 * return 0 - * + * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1312 "View.MemoryView" __pyx_t_2 = (__pyx_v_order == 'F'); - -#line 1312 "View.MemoryView" if (__pyx_t_2) { - -#line 1312 "View.MemoryView" __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); - -#line 1312 "View.MemoryView" } - -#line 1312 "View.MemoryView" __pyx_t_7 = (__pyx_t_2 != 0); - -#line 1312 "View.MemoryView" if (__pyx_t_7) { /* "View.MemoryView":1315 - * - * + * + * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) - * + * */ - -#line 1315 "View.MemoryView" __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(0, 1315, __pyx_L1_error) /* "View.MemoryView":1316 - * + * * transpose_memslice(&src) * transpose_memslice(&dst) # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - -#line 1316 "View.MemoryView" __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(0, 1316, __pyx_L1_error) /* "View.MemoryView":1312 * return 0 - * + * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1312 "View.MemoryView" } /* "View.MemoryView":1318 * transpose_memslice(&dst) - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) */ - -#line 1318 "View.MemoryView" __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1319 - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, True) - * + * */ - -#line 1319 "View.MemoryView" copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1320 * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * + * * free(tmpdata) */ - -#line 1320 "View.MemoryView" __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1322 * refcount_copying(&dst, dtype_is_object, ndim, True) - * + * * free(tmpdata) # <<<<<<<<<<<<<< * return 0 - * + * */ - -#line 1322 "View.MemoryView" free(__pyx_v_tmpdata); /* "View.MemoryView":1323 - * + * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_broadcast_leading') */ - -#line 1323 "View.MemoryView" __pyx_r = 0; - -#line 1323 "View.MemoryView" goto __pyx_L0; /* "View.MemoryView":1254 - * + * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, * int src_ndim, int dst_ndim, */ -#line 1254 "View.MemoryView" - - -#line 1254 "View.MemoryView" /* function exit code */ - -#line 1254 "View.MemoryView" __pyx_L1_error:; - -#line 1254 "View.MemoryView" { - -#line 1254 "View.MemoryView" #ifdef WITH_THREAD - PyGILState_STATE -#line 1254 "View.MemoryView" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 1254 "View.MemoryView" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 1254 "View.MemoryView" __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1254 "View.MemoryView" #ifdef WITH_THREAD - -#line 1254 "View.MemoryView" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 1254 "View.MemoryView" #endif - -#line 1254 "View.MemoryView" } - -#line 1254 "View.MemoryView" __pyx_r = -1; - -#line 1254 "View.MemoryView" __pyx_L0:; - -#line 1254 "View.MemoryView" return __pyx_r; - -#line 1254 "View.MemoryView" } /* "View.MemoryView":1326 - * + * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, * int ndim_other) nogil: */ -#line 1326 "View.MemoryView" - - -#line 1326 "View.MemoryView" static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { - int __pyx_v_i -#line 1326 "View.MemoryView" -; - int __pyx_v_offset -#line 1326 "View.MemoryView" -; - -#line 1326 "View.MemoryView" + int __pyx_v_i; + int __pyx_v_offset; int __pyx_t_1; - -#line 1326 "View.MemoryView" int __pyx_t_2; /* "View.MemoryView":1330 * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< - * + * * for i in range(ndim - 1, -1, -1): */ - -#line 1330 "View.MemoryView" __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); /* "View.MemoryView":1332 * cdef int offset = ndim_other - ndim - * + * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] */ - -#line 1332 "View.MemoryView" for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { - -#line 1332 "View.MemoryView" __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1333 - * + * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] */ - -#line 1333 "View.MemoryView" (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); /* "View.MemoryView":1334 @@ -35929,52 +19610,38 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * + * */ - -#line 1334 "View.MemoryView" (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1335 * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< - * + * * for i in range(offset): */ - -#line 1335 "View.MemoryView" (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); - -#line 1335 "View.MemoryView" } /* "View.MemoryView":1337 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * + * * for i in range(offset): # <<<<<<<<<<<<<< * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] */ - -#line 1337 "View.MemoryView" __pyx_t_1 = __pyx_v_offset; - -#line 1337 "View.MemoryView" for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - -#line 1337 "View.MemoryView" __pyx_v_i = __pyx_t_2; /* "View.MemoryView":1338 - * + * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 */ - -#line 1338 "View.MemoryView" (__pyx_v_mslice->shape[__pyx_v_i]) = 1; /* "View.MemoryView":1339 @@ -35982,243 +19649,155 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< * mslice.suboffsets[i] = -1 - * + * */ - -#line 1339 "View.MemoryView" (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); /* "View.MemoryView":1340 * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1340 "View.MemoryView" (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; - -#line 1340 "View.MemoryView" } /* "View.MemoryView":1326 - * + * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, * int ndim_other) nogil: */ -#line 1326 "View.MemoryView" - - -#line 1326 "View.MemoryView" /* function exit code */ - -#line 1326 "View.MemoryView" } /* "View.MemoryView":1348 - * + * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: - * + * */ -#line 1348 "View.MemoryView" - - -#line 1348 "View.MemoryView" static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { - -#line 1348 "View.MemoryView" int __pyx_t_1; /* "View.MemoryView":1352 - * - * + * + * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) */ - -#line 1352 "View.MemoryView" __pyx_t_1 = (__pyx_v_dtype_is_object != 0); - -#line 1352 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":1353 - * + * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< * dst.strides, ndim, inc) - * + * */ - -#line 1353 "View.MemoryView" __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1352 - * - * + * + * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) */ - -#line 1352 "View.MemoryView" } /* "View.MemoryView":1348 - * + * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: - * + * */ -#line 1348 "View.MemoryView" - - -#line 1348 "View.MemoryView" /* function exit code */ - -#line 1348 "View.MemoryView" } /* "View.MemoryView":1357 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * bint inc) with gil: */ -#line 1357 "View.MemoryView" - - -#line 1357 "View.MemoryView" static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { - -#line 1357 "View.MemoryView" __Pyx_RefNannyDeclarations - -#line 1357 "View.MemoryView" #ifdef WITH_THREAD - PyGILState_STATE -#line 1357 "View.MemoryView" -__pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - -#line 1357 "View.MemoryView" + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - -#line 1357 "View.MemoryView" __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); /* "View.MemoryView":1360 * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') */ - -#line 1360 "View.MemoryView" __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1357 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * bint inc) with gil: */ -#line 1357 "View.MemoryView" - - -#line 1357 "View.MemoryView" /* function exit code */ - -#line 1357 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1357 "View.MemoryView" #ifdef WITH_THREAD - -#line 1357 "View.MemoryView" __Pyx_PyGILState_Release(__pyx_gilstate_save); - -#line 1357 "View.MemoryView" #endif - -#line 1357 "View.MemoryView" } /* "View.MemoryView":1363 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): * cdef Py_ssize_t i */ -#line 1363 "View.MemoryView" - - -#line 1363 "View.MemoryView" static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { - CYTHON_UNUSED Py_ssize_t __pyx_v_i -#line 1363 "View.MemoryView" -; - -#line 1363 "View.MemoryView" + CYTHON_UNUSED Py_ssize_t __pyx_v_i; __Pyx_RefNannyDeclarations - -#line 1363 "View.MemoryView" Py_ssize_t __pyx_t_1; - -#line 1363 "View.MemoryView" Py_ssize_t __pyx_t_2; - -#line 1363 "View.MemoryView" int __pyx_t_3; - -#line 1363 "View.MemoryView" __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); /* "View.MemoryView":1367 * cdef Py_ssize_t i - * + * * for i in range(shape[0]): # <<<<<<<<<<<<<< * if ndim == 1: * if inc: */ - -#line 1367 "View.MemoryView" __pyx_t_1 = (__pyx_v_shape[0]); - -#line 1367 "View.MemoryView" for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - -#line 1367 "View.MemoryView" __pyx_v_i = __pyx_t_2; /* "View.MemoryView":1368 - * + * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: * Py_INCREF(( data)[0]) */ - -#line 1368 "View.MemoryView" __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); - -#line 1368 "View.MemoryView" if (__pyx_t_3) { /* "View.MemoryView":1369 @@ -36228,11 +19807,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * Py_INCREF(( data)[0]) * else: */ - -#line 1369 "View.MemoryView" __pyx_t_3 = (__pyx_v_inc != 0); - -#line 1369 "View.MemoryView" if (__pyx_t_3) { /* "View.MemoryView":1370 @@ -36242,8 +19817,6 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * else: * Py_DECREF(( data)[0]) */ - -#line 1370 "View.MemoryView" Py_INCREF((((PyObject **)__pyx_v_data)[0])); /* "View.MemoryView":1369 @@ -36253,11 +19826,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * Py_INCREF(( data)[0]) * else: */ - -#line 1369 "View.MemoryView" goto __pyx_L6; - -#line 1369 "View.MemoryView" } /* "View.MemoryView":1372 @@ -36267,31 +19836,19 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, */ - -#line 1372 "View.MemoryView" /*else*/ { - -#line 1372 "View.MemoryView" Py_DECREF((((PyObject **)__pyx_v_data)[0])); - -#line 1372 "View.MemoryView" } - -#line 1372 "View.MemoryView" __pyx_L6:; /* "View.MemoryView":1368 - * + * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: * Py_INCREF(( data)[0]) */ - -#line 1368 "View.MemoryView" goto __pyx_L5; - -#line 1368 "View.MemoryView" } /* "View.MemoryView":1374 @@ -36299,75 +19856,51 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< * ndim - 1, inc) - * + * */ - -#line 1374 "View.MemoryView" /*else*/ { /* "View.MemoryView":1375 * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, * ndim - 1, inc) # <<<<<<<<<<<<<< - * + * * data += strides[0] */ - -#line 1375 "View.MemoryView" __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); - -#line 1375 "View.MemoryView" } - -#line 1375 "View.MemoryView" __pyx_L5:; /* "View.MemoryView":1377 * ndim - 1, inc) - * + * * data += strides[0] # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1377 "View.MemoryView" __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); - -#line 1377 "View.MemoryView" } /* "View.MemoryView":1363 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): * cdef Py_ssize_t i */ -#line 1363 "View.MemoryView" - - -#line 1363 "View.MemoryView" /* function exit code */ - -#line 1363 "View.MemoryView" __Pyx_RefNannyFinishContext(); - -#line 1363 "View.MemoryView" } /* "View.MemoryView":1383 - * + * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, * bint dtype_is_object) nogil: */ -#line 1383 "View.MemoryView" - - -#line 1383 "View.MemoryView" static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { /* "View.MemoryView":1386 @@ -36377,8 +19910,6 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) */ - -#line 1386 "View.MemoryView" __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1387 @@ -36388,68 +19919,42 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) */ - -#line 1387 "View.MemoryView" __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); /* "View.MemoryView":1389 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1389 "View.MemoryView" __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1383 - * + * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, * bint dtype_is_object) nogil: */ -#line 1383 "View.MemoryView" - - -#line 1383 "View.MemoryView" /* function exit code */ - -#line 1383 "View.MemoryView" } /* "View.MemoryView":1393 - * + * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * size_t itemsize, void *item) nogil: */ -#line 1393 "View.MemoryView" - - -#line 1393 "View.MemoryView" static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { - CYTHON_UNUSED Py_ssize_t __pyx_v_i -#line 1393 "View.MemoryView" -; - Py_ssize_t __pyx_v_stride -#line 1393 "View.MemoryView" -; - Py_ssize_t __pyx_v_extent -#line 1393 "View.MemoryView" -; - -#line 1393 "View.MemoryView" + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; int __pyx_t_1; - -#line 1393 "View.MemoryView" Py_ssize_t __pyx_t_2; - -#line 1393 "View.MemoryView" Py_ssize_t __pyx_t_3; /* "View.MemoryView":1397 @@ -36457,52 +19962,38 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t extent = shape[0] - * + * */ - -#line 1397 "View.MemoryView" __pyx_v_stride = (__pyx_v_strides[0]); /* "View.MemoryView":1398 * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< - * + * * if ndim == 1: */ - -#line 1398 "View.MemoryView" __pyx_v_extent = (__pyx_v_shape[0]); /* "View.MemoryView":1400 * cdef Py_ssize_t extent = shape[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) */ - -#line 1400 "View.MemoryView" __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); - -#line 1400 "View.MemoryView" if (__pyx_t_1) { /* "View.MemoryView":1401 - * + * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< * memcpy(data, item, itemsize) * data += stride */ - -#line 1401 "View.MemoryView" __pyx_t_2 = __pyx_v_extent; - -#line 1401 "View.MemoryView" for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - -#line 1401 "View.MemoryView" __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1402 @@ -36512,8 +20003,6 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * data += stride * else: */ - -#line 1402 "View.MemoryView" memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); /* "View.MemoryView":1403 @@ -36523,25 +20012,17 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * else: * for i in range(extent): */ - -#line 1403 "View.MemoryView" __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - -#line 1403 "View.MemoryView" } /* "View.MemoryView":1400 * cdef Py_ssize_t extent = shape[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) */ - -#line 1400 "View.MemoryView" goto __pyx_L3; - -#line 1400 "View.MemoryView" } /* "View.MemoryView":1405 @@ -36551,17 +20032,9 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) */ - -#line 1405 "View.MemoryView" /*else*/ { - -#line 1405 "View.MemoryView" __pyx_t_2 = __pyx_v_extent; - -#line 1405 "View.MemoryView" for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - -#line 1405 "View.MemoryView" __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1406 @@ -36571,45 +20044,29 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * ndim - 1, itemsize, item) * data += stride */ - -#line 1406 "View.MemoryView" __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); /* "View.MemoryView":1408 * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 1408 "View.MemoryView" __pyx_v_data = (__pyx_v_data + __pyx_v_stride); - -#line 1408 "View.MemoryView" } - -#line 1408 "View.MemoryView" } - -#line 1408 "View.MemoryView" __pyx_L3:; /* "View.MemoryView":1393 - * + * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * size_t itemsize, void *item) nogil: */ -#line 1393 "View.MemoryView" - - -#line 1393 "View.MemoryView" /* function exit code */ - -#line 1393 "View.MemoryView" } /* "(tree fragment)":1 @@ -36618,265 +20075,91 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * from pickle import PickleError as __pyx_PickleError */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* Python wrapper */ - -#line 1 "(tree fragment)" static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = -#line 1 "(tree fragment)" -{"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; - -#line 1 "(tree fragment)" +static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0 -#line 1 "(tree fragment)" -; - long __pyx_v___pyx_checksum -#line 1 "(tree fragment)" -; - PyObject *__pyx_v___pyx_state = 0 -#line 1 "(tree fragment)" -; - -#line 1 "(tree fragment)" + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; PyObject *__pyx_r = 0; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); - -#line 1 "(tree fragment)" { - -#line 1 "(tree fragment)" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - -#line 1 "(tree fragment)" PyObject* values[3] = {0,0,0}; - -#line 1 "(tree fragment)" if (unlikely(__pyx_kwds)) { - -#line 1 "(tree fragment)" Py_ssize_t kw_args; - -#line 1 "(tree fragment)" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - -#line 1 "(tree fragment)" switch (pos_args) { - case 3: -#line 1 "(tree fragment)" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 1 "(tree fragment)" + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: -#line 1 "(tree fragment)" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 1 "(tree fragment)" + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: -#line 1 "(tree fragment)" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 1 "(tree fragment)" + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; - -#line 1 "(tree fragment)" case 0: break; - default: -#line 1 "(tree fragment)" -goto __pyx_L5_argtuple_error; - -#line 1 "(tree fragment)" + default: goto __pyx_L5_argtuple_error; } - -#line 1 "(tree fragment)" kw_args = PyDict_Size(__pyx_kwds); - -#line 1 "(tree fragment)" switch (pos_args) { - -#line 1 "(tree fragment)" case 0: - -#line 1 "(tree fragment)" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else -#line 1 "(tree fragment)" -goto __pyx_L5_argtuple_error; - -#line 1 "(tree fragment)" + else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; - -#line 1 "(tree fragment)" case 1: - -#line 1 "(tree fragment)" if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - -#line 1 "(tree fragment)" else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); -#line 1 "(tree fragment)" -__PYX_ERR(0, 1, __pyx_L3_error) - -#line 1 "(tree fragment)" + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error) } - -#line 1 "(tree fragment)" CYTHON_FALLTHROUGH; - -#line 1 "(tree fragment)" case 2: - -#line 1 "(tree fragment)" if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - -#line 1 "(tree fragment)" else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); -#line 1 "(tree fragment)" -__PYX_ERR(0, 1, __pyx_L3_error) - -#line 1 "(tree fragment)" + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error) } - -#line 1 "(tree fragment)" } - -#line 1 "(tree fragment)" if (unlikely(kw_args > 0)) { - -#line 1 "(tree fragment)" if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(0, 1, __pyx_L3_error) - -#line 1 "(tree fragment)" } - -#line 1 "(tree fragment)" } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - -#line 1 "(tree fragment)" goto __pyx_L5_argtuple_error; - -#line 1 "(tree fragment)" } else { - -#line 1 "(tree fragment)" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 1 "(tree fragment)" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 1 "(tree fragment)" values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 1 "(tree fragment)" } - -#line 1 "(tree fragment)" __pyx_v___pyx_type = values[0]; - -#line 1 "(tree fragment)" __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) - -#line 1 "(tree fragment)" __pyx_v___pyx_state = values[2]; - -#line 1 "(tree fragment)" } - -#line 1 "(tree fragment)" goto __pyx_L4_argument_unpacking_done; - -#line 1 "(tree fragment)" __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); -#line 1 "(tree fragment)" -__PYX_ERR(0, 1, __pyx_L3_error) - -#line 1 "(tree fragment)" + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error) __pyx_L3_error:; - -#line 1 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return NULL; - -#line 1 "(tree fragment)" __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 1 "(tree fragment)" -__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = NULL -#line 1 "(tree fragment)" -; - PyObject *__pyx_v___pyx_result = NULL -#line 1 "(tree fragment)" -; - -#line 1 "(tree fragment)" + PyObject *__pyx_v___pyx_PickleError = NULL; + PyObject *__pyx_v___pyx_result = NULL; PyObject *__pyx_r = NULL; - -#line 1 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 1 "(tree fragment)" int __pyx_t_1; - -#line 1 "(tree fragment)" PyObject *__pyx_t_2 = NULL; - -#line 1 "(tree fragment)" PyObject *__pyx_t_3 = NULL; - -#line 1 "(tree fragment)" PyObject *__pyx_t_4 = NULL; - -#line 1 "(tree fragment)" PyObject *__pyx_t_5 = NULL; - -#line 1 "(tree fragment)" PyObject *__pyx_t_6 = NULL; - -#line 1 "(tree fragment)" int __pyx_t_7; - -#line 1 "(tree fragment)" __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); /* "(tree fragment)":2 @@ -36885,11 +20168,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) */ - -#line 2 "(tree fragment)" __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); - -#line 2 "(tree fragment)" if (__pyx_t_1) { /* "(tree fragment)":3 @@ -36899,47 +20178,19 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) */ - -#line 3 "(tree fragment)" __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - -#line 3 "(tree fragment)" __Pyx_GOTREF(__pyx_t_2); - -#line 3 "(tree fragment)" __Pyx_INCREF(__pyx_n_s_PickleError); - -#line 3 "(tree fragment)" __Pyx_GIVEREF(__pyx_n_s_PickleError); - -#line 3 "(tree fragment)" PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - -#line 3 "(tree fragment)" __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) - -#line 3 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 3 "(tree fragment)" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 3 "(tree fragment)" __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - -#line 3 "(tree fragment)" __Pyx_GOTREF(__pyx_t_2); - -#line 3 "(tree fragment)" __Pyx_INCREF(__pyx_t_2); - -#line 3 "(tree fragment)" __pyx_v___pyx_PickleError = __pyx_t_2; - -#line 3 "(tree fragment)" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 3 "(tree fragment)" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":4 @@ -36949,170 +20200,60 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: */ - -#line 4 "(tree fragment)" __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_2); - -#line 4 "(tree fragment)" __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_4); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 4 "(tree fragment)" __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; -#line 4 "(tree fragment)" -__pyx_t_5 = NULL; - -#line 4 "(tree fragment)" + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - -#line 4 "(tree fragment)" __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - -#line 4 "(tree fragment)" if (likely(__pyx_t_5)) { - -#line 4 "(tree fragment)" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - -#line 4 "(tree fragment)" __Pyx_INCREF(__pyx_t_5); - -#line 4 "(tree fragment)" __Pyx_INCREF(function); - -#line 4 "(tree fragment)" __Pyx_DECREF_SET(__pyx_t_2, function); - -#line 4 "(tree fragment)" } - -#line 4 "(tree fragment)" } - -#line 4 "(tree fragment)" if (!__pyx_t_5) { - -#line 4 "(tree fragment)" __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 4 "(tree fragment)" } else { - -#line 4 "(tree fragment)" #if CYTHON_FAST_PYCALL - -#line 4 "(tree fragment)" if (PyFunction_Check(__pyx_t_2)) { - -#line 4 "(tree fragment)" PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - -#line 4 "(tree fragment)" __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 4 "(tree fragment)" } else - -#line 4 "(tree fragment)" #endif - -#line 4 "(tree fragment)" #if CYTHON_FAST_PYCCALL - -#line 4 "(tree fragment)" if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - -#line 4 "(tree fragment)" PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; - -#line 4 "(tree fragment)" __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 4 "(tree fragment)" } else - -#line 4 "(tree fragment)" #endif - -#line 4 "(tree fragment)" { - -#line 4 "(tree fragment)" __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_6); - -#line 4 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - -#line 4 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_4); - -#line 4 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); - -#line 4 "(tree fragment)" __pyx_t_4 = 0; - -#line 4 "(tree fragment)" __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 4 "(tree fragment)" } - -#line 4 "(tree fragment)" } - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 4 "(tree fragment)" __Pyx_Raise(__pyx_t_3, 0, 0, 0); - -#line 4 "(tree fragment)" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 4 "(tree fragment)" __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":2 @@ -37121,8 +20262,6 @@ __pyx_t_5 = NULL; * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) */ - -#line 2 "(tree fragment)" } /* "(tree fragment)":5 @@ -37132,146 +20271,52 @@ __pyx_t_5 = NULL; * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) */ - -#line 5 "(tree fragment)" __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - -#line 5 "(tree fragment)" __Pyx_GOTREF(__pyx_t_2); - -#line 5 "(tree fragment)" __pyx_t_6 = NULL; - -#line 5 "(tree fragment)" if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - -#line 5 "(tree fragment)" __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - -#line 5 "(tree fragment)" if (likely(__pyx_t_6)) { - -#line 5 "(tree fragment)" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - -#line 5 "(tree fragment)" __Pyx_INCREF(__pyx_t_6); - -#line 5 "(tree fragment)" __Pyx_INCREF(function); - -#line 5 "(tree fragment)" __Pyx_DECREF_SET(__pyx_t_2, function); - -#line 5 "(tree fragment)" } - -#line 5 "(tree fragment)" } - -#line 5 "(tree fragment)" if (!__pyx_t_6) { - -#line 5 "(tree fragment)" __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - -#line 5 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 5 "(tree fragment)" } else { - -#line 5 "(tree fragment)" #if CYTHON_FAST_PYCALL - -#line 5 "(tree fragment)" if (PyFunction_Check(__pyx_t_2)) { - -#line 5 "(tree fragment)" PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; - -#line 5 "(tree fragment)" __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - -#line 5 "(tree fragment)" __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 5 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 5 "(tree fragment)" } else - -#line 5 "(tree fragment)" #endif - -#line 5 "(tree fragment)" #if CYTHON_FAST_PYCCALL - -#line 5 "(tree fragment)" if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - -#line 5 "(tree fragment)" PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; - -#line 5 "(tree fragment)" __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - -#line 5 "(tree fragment)" __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 5 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 5 "(tree fragment)" } else - -#line 5 "(tree fragment)" #endif - -#line 5 "(tree fragment)" { - -#line 5 "(tree fragment)" __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error) - -#line 5 "(tree fragment)" __Pyx_GOTREF(__pyx_t_4); - -#line 5 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; - -#line 5 "(tree fragment)" __Pyx_INCREF(__pyx_v___pyx_type); - -#line 5 "(tree fragment)" __Pyx_GIVEREF(__pyx_v___pyx_type); - -#line 5 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); - -#line 5 "(tree fragment)" __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - -#line 5 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 5 "(tree fragment)" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 5 "(tree fragment)" } - -#line 5 "(tree fragment)" } - -#line 5 "(tree fragment)" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 5 "(tree fragment)" __pyx_v___pyx_result = __pyx_t_3; - -#line 5 "(tree fragment)" __pyx_t_3 = 0; /* "(tree fragment)":6 @@ -37281,14 +20326,8 @@ __pyx_t_5 = NULL; * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ - -#line 6 "(tree fragment)" __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - -#line 6 "(tree fragment)" __pyx_t_7 = (__pyx_t_1 != 0); - -#line 6 "(tree fragment)" if (__pyx_t_7) { /* "(tree fragment)":7 @@ -37298,17 +20337,9 @@ __pyx_t_5 = NULL; * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): */ - -#line 7 "(tree fragment)" if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 7, __pyx_L1_error) - -#line 7 "(tree fragment)" __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - -#line 7 "(tree fragment)" __Pyx_GOTREF(__pyx_t_3); - -#line 7 "(tree fragment)" __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 @@ -37318,8 +20349,6 @@ __pyx_t_5 = NULL; * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ - -#line 6 "(tree fragment)" } /* "(tree fragment)":8 @@ -37329,17 +20358,9 @@ __pyx_t_5 = NULL; * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] */ - -#line 8 "(tree fragment)" __Pyx_XDECREF(__pyx_r); - -#line 8 "(tree fragment)" __Pyx_INCREF(__pyx_v___pyx_result); - -#line 8 "(tree fragment)" __pyx_r = __pyx_v___pyx_result; - -#line 8 "(tree fragment)" goto __pyx_L0; /* "(tree fragment)":1 @@ -37348,55 +20369,21 @@ __pyx_t_5 = NULL; * from pickle import PickleError as __pyx_PickleError */ -#line 1 "(tree fragment)" - - -#line 1 "(tree fragment)" /* function exit code */ - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_2); - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_3); - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_4); - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_5); - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_t_6); - -#line 1 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 1 "(tree fragment)" __pyx_r = NULL; - -#line 1 "(tree fragment)" __pyx_L0:; - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_v___pyx_PickleError); - -#line 1 "(tree fragment)" __Pyx_XDECREF(__pyx_v___pyx_result); - -#line 1 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return __pyx_r; - -#line 1 "(tree fragment)" } /* "(tree fragment)":9 @@ -37407,46 +20394,18 @@ __pyx_t_5 = NULL; * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { - -#line 9 "(tree fragment)" PyObject *__pyx_r = NULL; - -#line 9 "(tree fragment)" __Pyx_RefNannyDeclarations - -#line 9 "(tree fragment)" PyObject *__pyx_t_1 = NULL; - -#line 9 "(tree fragment)" int __pyx_t_2; - -#line 9 "(tree fragment)" Py_ssize_t __pyx_t_3; - -#line 9 "(tree fragment)" int __pyx_t_4; - -#line 9 "(tree fragment)" int __pyx_t_5; - -#line 9 "(tree fragment)" PyObject *__pyx_t_6 = NULL; - -#line 9 "(tree fragment)" PyObject *__pyx_t_7 = NULL; - -#line 9 "(tree fragment)" PyObject *__pyx_t_8 = NULL; - -#line 9 "(tree fragment)" PyObject *__pyx_t_9 = NULL; - -#line 9 "(tree fragment)" __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); /* "(tree fragment)":10 @@ -37456,38 +20415,16 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) */ - -#line 10 "(tree fragment)" if (unlikely(__pyx_v___pyx_state == Py_None)) { - -#line 10 "(tree fragment)" PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - -#line 10 "(tree fragment)" __PYX_ERR(0, 10, __pyx_L1_error) - -#line 10 "(tree fragment)" } - -#line 10 "(tree fragment)" __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) - -#line 10 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 10 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_1); - -#line 10 "(tree fragment)" __Pyx_GOTREF(__pyx_v___pyx_result->name); - -#line 10 "(tree fragment)" __Pyx_DECREF(__pyx_v___pyx_result->name); - -#line 10 "(tree fragment)" __pyx_v___pyx_result->name = __pyx_t_1; - -#line 10 "(tree fragment)" __pyx_t_1 = 0; /* "(tree fragment)":11 @@ -37496,53 +20433,21 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ - -#line 11 "(tree fragment)" if (unlikely(__pyx_v___pyx_state == Py_None)) { - -#line 11 "(tree fragment)" PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - -#line 11 "(tree fragment)" __PYX_ERR(0, 11, __pyx_L1_error) - -#line 11 "(tree fragment)" } - -#line 11 "(tree fragment)" __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 11, __pyx_L1_error) - -#line 11 "(tree fragment)" __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - -#line 11 "(tree fragment)" if (__pyx_t_4) { - -#line 11 "(tree fragment)" } else { - -#line 11 "(tree fragment)" __pyx_t_2 = __pyx_t_4; - -#line 11 "(tree fragment)" goto __pyx_L4_bool_binop_done; - -#line 11 "(tree fragment)" } - -#line 11 "(tree fragment)" __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 11, __pyx_L1_error) - -#line 11 "(tree fragment)" __pyx_t_5 = (__pyx_t_4 != 0); - -#line 11 "(tree fragment)" __pyx_t_2 = __pyx_t_5; - -#line 11 "(tree fragment)" __pyx_L4_bool_binop_done:; - -#line 11 "(tree fragment)" if (__pyx_t_2) { /* "(tree fragment)":12 @@ -37550,179 +20455,63 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< */ - -#line 12 "(tree fragment)" __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" __Pyx_GOTREF(__pyx_t_6); - -#line 12 "(tree fragment)" __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" __Pyx_GOTREF(__pyx_t_7); - -#line 12 "(tree fragment)" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 12 "(tree fragment)" if (unlikely(__pyx_v___pyx_state == Py_None)) { - -#line 12 "(tree fragment)" PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - -#line 12 "(tree fragment)" __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" } - -#line 12 "(tree fragment)" __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" __Pyx_GOTREF(__pyx_t_6); - -#line 12 "(tree fragment)" __pyx_t_8 = NULL; - -#line 12 "(tree fragment)" if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { - -#line 12 "(tree fragment)" __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - -#line 12 "(tree fragment)" if (likely(__pyx_t_8)) { - -#line 12 "(tree fragment)" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - -#line 12 "(tree fragment)" __Pyx_INCREF(__pyx_t_8); - -#line 12 "(tree fragment)" __Pyx_INCREF(function); - -#line 12 "(tree fragment)" __Pyx_DECREF_SET(__pyx_t_7, function); - -#line 12 "(tree fragment)" } - -#line 12 "(tree fragment)" } - -#line 12 "(tree fragment)" if (!__pyx_t_8) { - -#line 12 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 12 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 12 "(tree fragment)" } else { - -#line 12 "(tree fragment)" #if CYTHON_FAST_PYCALL - -#line 12 "(tree fragment)" if (PyFunction_Check(__pyx_t_7)) { - -#line 12 "(tree fragment)" PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; - -#line 12 "(tree fragment)" __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 12 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 12 "(tree fragment)" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 12 "(tree fragment)" } else - -#line 12 "(tree fragment)" #endif - -#line 12 "(tree fragment)" #if CYTHON_FAST_PYCCALL - -#line 12 "(tree fragment)" if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { - -#line 12 "(tree fragment)" PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; - -#line 12 "(tree fragment)" __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - -#line 12 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 12 "(tree fragment)" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - -#line 12 "(tree fragment)" } else - -#line 12 "(tree fragment)" #endif - -#line 12 "(tree fragment)" { - -#line 12 "(tree fragment)" __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" __Pyx_GOTREF(__pyx_t_9); - -#line 12 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; - -#line 12 "(tree fragment)" __Pyx_GIVEREF(__pyx_t_6); - -#line 12 "(tree fragment)" PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); - -#line 12 "(tree fragment)" __pyx_t_6 = 0; - -#line 12 "(tree fragment)" __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) - -#line 12 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 12 "(tree fragment)" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - -#line 12 "(tree fragment)" } - -#line 12 "(tree fragment)" } - -#line 12 "(tree fragment)" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 12 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":11 @@ -37731,8 +20520,6 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ - -#line 11 "(tree fragment)" } /* "(tree fragment)":9 @@ -37743,3183 +20530,1072 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" /* function exit code */ - -#line 9 "(tree fragment)" __pyx_r = Py_None; __Pyx_INCREF(Py_None); - -#line 9 "(tree fragment)" goto __pyx_L0; - -#line 9 "(tree fragment)" __pyx_L1_error:; - -#line 9 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 9 "(tree fragment)" __Pyx_XDECREF(__pyx_t_6); - -#line 9 "(tree fragment)" __Pyx_XDECREF(__pyx_t_7); - -#line 9 "(tree fragment)" __Pyx_XDECREF(__pyx_t_8); - -#line 9 "(tree fragment)" __Pyx_XDECREF(__pyx_t_9); - -#line 9 "(tree fragment)" __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 9 "(tree fragment)" __pyx_r = 0; - -#line 9 "(tree fragment)" __pyx_L0:; - -#line 9 "(tree fragment)" __Pyx_XGIVEREF(__pyx_r); - -#line 9 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 9 "(tree fragment)" return __pyx_r; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_tp_new_8nfstream_4pcap_pcap_handler_ctx(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - -#line 9 "(tree fragment)" struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *p; - -#line 9 "(tree fragment)" PyObject *o; - -#line 9 "(tree fragment)" if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - -#line 9 "(tree fragment)" o = (*t->tp_alloc)(t, 0); - -#line 9 "(tree fragment)" } else { - -#line 9 "(tree fragment)" o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (unlikely(!o)) return 0; - -#line 9 "(tree fragment)" p = ((struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)o); - -#line 9 "(tree fragment)" p->exc = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" return o; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static void __pyx_tp_dealloc_8nfstream_4pcap_pcap_handler_ctx(PyObject *o) { - -#line 9 "(tree fragment)" struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *p = (struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)o; - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - -#line 9 "(tree fragment)" if (PyObject_CallFinalizerFromDealloc(o)) return; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" PyObject_GC_UnTrack(o); - -#line 9 "(tree fragment)" Py_CLEAR(p->exc); - -#line 9 "(tree fragment)" (*Py_TYPE(o)->tp_free)(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_tp_traverse_8nfstream_4pcap_pcap_handler_ctx(PyObject *o, visitproc v, void *a) { - -#line 9 "(tree fragment)" int e; - -#line 9 "(tree fragment)" struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *p = (struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)o; - -#line 9 "(tree fragment)" if (p->exc) { - -#line 9 "(tree fragment)" e = (*v)(p->exc, a); if (e) return e; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" return 0; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_tp_clear_8nfstream_4pcap_pcap_handler_ctx(PyObject *o) { - -#line 9 "(tree fragment)" PyObject* tmp; - -#line 9 "(tree fragment)" struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *p = (struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx *)o; - -#line 9 "(tree fragment)" tmp = ((PyObject*)p->exc); - -#line 9 "(tree fragment)" p->exc = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" Py_XDECREF(tmp); - -#line 9 "(tree fragment)" return 0; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMethodDef __pyx_methods_8nfstream_4pcap_pcap_handler_ctx[] = { - -#line 9 "(tree fragment)" {"__reduce_cython__", (PyCFunction)__pyx_pw_8nfstream_4pcap_16pcap_handler_ctx_1__reduce_cython__, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"__setstate_cython__", (PyCFunction)__pyx_pw_8nfstream_4pcap_16pcap_handler_ctx_3__setstate_cython__, METH_O, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyTypeObject __pyx_type_8nfstream_4pcap_pcap_handler_ctx = { - -#line 9 "(tree fragment)" PyVarObject_HEAD_INIT(0, 0) - -#line 9 "(tree fragment)" "nfstream.pcap.pcap_handler_ctx", /*tp_name*/ - -#line 9 "(tree fragment)" sizeof(struct __pyx_obj_8nfstream_4pcap_pcap_handler_ctx), /*tp_basicsize*/ - -#line 9 "(tree fragment)" 0, /*tp_itemsize*/ - -#line 9 "(tree fragment)" __pyx_tp_dealloc_8nfstream_4pcap_pcap_handler_ctx, /*tp_dealloc*/ - -#line 9 "(tree fragment)" 0, /*tp_print*/ - -#line 9 "(tree fragment)" 0, /*tp_getattr*/ - -#line 9 "(tree fragment)" 0, /*tp_setattr*/ - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*tp_compare*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION >= 3 - -#line 9 "(tree fragment)" 0, /*tp_as_async*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" 0, /*tp_repr*/ - -#line 9 "(tree fragment)" 0, /*tp_as_number*/ - -#line 9 "(tree fragment)" 0, /*tp_as_sequence*/ - -#line 9 "(tree fragment)" 0, /*tp_as_mapping*/ - -#line 9 "(tree fragment)" 0, /*tp_hash*/ - -#line 9 "(tree fragment)" 0, /*tp_call*/ - -#line 9 "(tree fragment)" 0, /*tp_str*/ - -#line 9 "(tree fragment)" 0, /*tp_getattro*/ - -#line 9 "(tree fragment)" 0, /*tp_setattro*/ - -#line 9 "(tree fragment)" 0, /*tp_as_buffer*/ - -#line 9 "(tree fragment)" Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - -#line 9 "(tree fragment)" 0, /*tp_doc*/ - -#line 9 "(tree fragment)" __pyx_tp_traverse_8nfstream_4pcap_pcap_handler_ctx, /*tp_traverse*/ - -#line 9 "(tree fragment)" __pyx_tp_clear_8nfstream_4pcap_pcap_handler_ctx, /*tp_clear*/ - -#line 9 "(tree fragment)" 0, /*tp_richcompare*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklistoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_iter*/ - -#line 9 "(tree fragment)" 0, /*tp_iternext*/ - -#line 9 "(tree fragment)" __pyx_methods_8nfstream_4pcap_pcap_handler_ctx, /*tp_methods*/ - -#line 9 "(tree fragment)" 0, /*tp_members*/ - -#line 9 "(tree fragment)" 0, /*tp_getset*/ - -#line 9 "(tree fragment)" 0, /*tp_base*/ - -#line 9 "(tree fragment)" 0, /*tp_dict*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_get*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_set*/ - -#line 9 "(tree fragment)" 0, /*tp_dictoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_init*/ - -#line 9 "(tree fragment)" 0, /*tp_alloc*/ - -#line 9 "(tree fragment)" __pyx_tp_new_8nfstream_4pcap_pcap_handler_ctx, /*tp_new*/ - -#line 9 "(tree fragment)" 0, /*tp_free*/ - -#line 9 "(tree fragment)" 0, /*tp_is_gc*/ - -#line 9 "(tree fragment)" 0, /*tp_bases*/ - -#line 9 "(tree fragment)" 0, /*tp_mro*/ - -#line 9 "(tree fragment)" 0, /*tp_cache*/ - -#line 9 "(tree fragment)" 0, /*tp_subclasses*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklist*/ - -#line 9 "(tree fragment)" 0, /*tp_del*/ - -#line 9 "(tree fragment)" 0, /*tp_version_tag*/ - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" 0, /*tp_finalize*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_tp_new_8nfstream_4pcap_bpf(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - -#line 9 "(tree fragment)" PyObject *o; - -#line 9 "(tree fragment)" if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - -#line 9 "(tree fragment)" o = (*t->tp_alloc)(t, 0); - -#line 9 "(tree fragment)" } else { - -#line 9 "(tree fragment)" o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (unlikely(!o)) return 0; - -#line 9 "(tree fragment)" return o; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static void __pyx_tp_dealloc_8nfstream_4pcap_bpf(PyObject *o) { - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - -#line 9 "(tree fragment)" if (PyObject_CallFinalizerFromDealloc(o)) return; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" { - -#line 9 "(tree fragment)" PyObject *etype, *eval, *etb; - -#line 9 "(tree fragment)" PyErr_Fetch(&etype, &eval, &etb); - -#line 9 "(tree fragment)" ++Py_REFCNT(o); - -#line 9 "(tree fragment)" __pyx_pw_8nfstream_4pcap_3bpf_5__dealloc__(o); - -#line 9 "(tree fragment)" --Py_REFCNT(o); - -#line 9 "(tree fragment)" PyErr_Restore(etype, eval, etb); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" (*Py_TYPE(o)->tp_free)(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMethodDef __pyx_methods_8nfstream_4pcap_bpf[] = { - -#line 9 "(tree fragment)" {"filter", (PyCFunction)__pyx_pw_8nfstream_4pcap_3bpf_3filter, METH_O, __pyx_doc_8nfstream_4pcap_3bpf_2filter}, - -#line 9 "(tree fragment)" {"__reduce_cython__", (PyCFunction)__pyx_pw_8nfstream_4pcap_3bpf_7__reduce_cython__, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"__setstate_cython__", (PyCFunction)__pyx_pw_8nfstream_4pcap_3bpf_9__setstate_cython__, METH_O, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyTypeObject __pyx_type_8nfstream_4pcap_bpf = { - -#line 9 "(tree fragment)" PyVarObject_HEAD_INIT(0, 0) - -#line 9 "(tree fragment)" "nfstream.pcap.bpf", /*tp_name*/ - -#line 9 "(tree fragment)" sizeof(struct __pyx_obj_8nfstream_4pcap_bpf), /*tp_basicsize*/ - -#line 9 "(tree fragment)" 0, /*tp_itemsize*/ - -#line 9 "(tree fragment)" __pyx_tp_dealloc_8nfstream_4pcap_bpf, /*tp_dealloc*/ - -#line 9 "(tree fragment)" 0, /*tp_print*/ - -#line 9 "(tree fragment)" 0, /*tp_getattr*/ - -#line 9 "(tree fragment)" 0, /*tp_setattr*/ - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*tp_compare*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION >= 3 - -#line 9 "(tree fragment)" 0, /*tp_as_async*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" 0, /*tp_repr*/ - -#line 9 "(tree fragment)" 0, /*tp_as_number*/ - -#line 9 "(tree fragment)" 0, /*tp_as_sequence*/ - -#line 9 "(tree fragment)" 0, /*tp_as_mapping*/ - -#line 9 "(tree fragment)" 0, /*tp_hash*/ - -#line 9 "(tree fragment)" 0, /*tp_call*/ - -#line 9 "(tree fragment)" 0, /*tp_str*/ - -#line 9 "(tree fragment)" 0, /*tp_getattro*/ - -#line 9 "(tree fragment)" 0, /*tp_setattro*/ - -#line 9 "(tree fragment)" 0, /*tp_as_buffer*/ - -#line 9 "(tree fragment)" Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - -#line 9 "(tree fragment)" "bpf(filter, dlt=DLT_RAW) -> BPF filter object", /*tp_doc*/ - -#line 9 "(tree fragment)" 0, /*tp_traverse*/ - -#line 9 "(tree fragment)" 0, /*tp_clear*/ - -#line 9 "(tree fragment)" 0, /*tp_richcompare*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklistoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_iter*/ - -#line 9 "(tree fragment)" 0, /*tp_iternext*/ - -#line 9 "(tree fragment)" __pyx_methods_8nfstream_4pcap_bpf, /*tp_methods*/ - -#line 9 "(tree fragment)" 0, /*tp_members*/ - -#line 9 "(tree fragment)" 0, /*tp_getset*/ - -#line 9 "(tree fragment)" 0, /*tp_base*/ - -#line 9 "(tree fragment)" 0, /*tp_dict*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_get*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_set*/ - -#line 9 "(tree fragment)" 0, /*tp_dictoffset*/ - -#line 9 "(tree fragment)" __pyx_pw_8nfstream_4pcap_3bpf_1__init__, /*tp_init*/ - -#line 9 "(tree fragment)" 0, /*tp_alloc*/ - -#line 9 "(tree fragment)" __pyx_tp_new_8nfstream_4pcap_bpf, /*tp_new*/ - -#line 9 "(tree fragment)" 0, /*tp_free*/ - -#line 9 "(tree fragment)" 0, /*tp_is_gc*/ - -#line 9 "(tree fragment)" 0, /*tp_bases*/ - -#line 9 "(tree fragment)" 0, /*tp_mro*/ - -#line 9 "(tree fragment)" 0, /*tp_cache*/ - -#line 9 "(tree fragment)" 0, /*tp_subclasses*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklist*/ - -#line 9 "(tree fragment)" 0, /*tp_del*/ - -#line 9 "(tree fragment)" 0, /*tp_version_tag*/ - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" 0, /*tp_finalize*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_tp_new_8nfstream_4pcap_pcap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - -#line 9 "(tree fragment)" PyObject *o; - -#line 9 "(tree fragment)" if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - -#line 9 "(tree fragment)" o = (*t->tp_alloc)(t, 0); - -#line 9 "(tree fragment)" } else { - -#line 9 "(tree fragment)" o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (unlikely(!o)) return 0; - -#line 9 "(tree fragment)" return o; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static void __pyx_tp_dealloc_8nfstream_4pcap_pcap(PyObject *o) { - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - -#line 9 "(tree fragment)" if (PyObject_CallFinalizerFromDealloc(o)) return; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" { - -#line 9 "(tree fragment)" PyObject *etype, *eval, *etb; - -#line 9 "(tree fragment)" PyErr_Fetch(&etype, &eval, &etb); - -#line 9 "(tree fragment)" ++Py_REFCNT(o); - -#line 9 "(tree fragment)" __pyx_pw_8nfstream_4pcap_4pcap_35__dealloc__(o); - -#line 9 "(tree fragment)" --Py_REFCNT(o); - -#line 9 "(tree fragment)" PyErr_Restore(etype, eval, etb); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" (*Py_TYPE(o)->tp_free)(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop_8nfstream_4pcap_4pcap_name(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_8nfstream_4pcap_4pcap_4name_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop_8nfstream_4pcap_4pcap_snaplen(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_8nfstream_4pcap_4pcap_7snaplen_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop_8nfstream_4pcap_4pcap_dloff(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_8nfstream_4pcap_4pcap_5dloff_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop_8nfstream_4pcap_4pcap_filter(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_8nfstream_4pcap_4pcap_6filter_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop_8nfstream_4pcap_4pcap_fd(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_8nfstream_4pcap_4pcap_2fd_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop_8nfstream_4pcap_4pcap_precision(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_8nfstream_4pcap_4pcap_9precision_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop_8nfstream_4pcap_4pcap_timestamp_in_ns(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_8nfstream_4pcap_4pcap_15timestamp_in_ns_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMethodDef __pyx_methods_8nfstream_4pcap_pcap[] = { - -#line 9 "(tree fragment)" {"fileno", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_3fileno, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4pcap_2fileno}, - -#line 9 "(tree fragment)" {"close", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_5close, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4pcap_4close}, - -#line 9 "(tree fragment)" {"setfilter", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_7setfilter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8nfstream_4pcap_4pcap_6setfilter}, - -#line 9 "(tree fragment)" {"setdirection", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_9setdirection, METH_O, __pyx_doc_8nfstream_4pcap_4pcap_8setdirection}, - -#line 9 "(tree fragment)" {"setnonblock", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_11setnonblock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8nfstream_4pcap_4pcap_10setnonblock}, - -#line 9 "(tree fragment)" {"getnonblock", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_13getnonblock, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4pcap_12getnonblock}, - -#line 9 "(tree fragment)" {"datalink", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_15datalink, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4pcap_14datalink}, - -#line 9 "(tree fragment)" {"__add_pkts", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_17__add_pkts, METH_VARARGS|METH_KEYWORDS, 0}, - -#line 9 "(tree fragment)" {"readpkts", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_19readpkts, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4pcap_18readpkts}, - -#line 9 "(tree fragment)" {"dispatch", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_21dispatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8nfstream_4pcap_4pcap_20dispatch}, - -#line 9 "(tree fragment)" {"loop", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_23loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8nfstream_4pcap_4pcap_22loop}, - -#line 9 "(tree fragment)" {"sendpacket", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_25sendpacket, METH_O, __pyx_doc_8nfstream_4pcap_4pcap_24sendpacket}, - -#line 9 "(tree fragment)" {"geterr", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_27geterr, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4pcap_26geterr}, - -#line 9 "(tree fragment)" {"stats", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_29stats, METH_NOARGS, __pyx_doc_8nfstream_4pcap_4pcap_28stats}, - -#line 9 "(tree fragment)" {"__next__", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_33__next__, METH_NOARGS|METH_COEXIST, 0}, - -#line 9 "(tree fragment)" {"__reduce_cython__", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_37__reduce_cython__, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"__setstate_cython__", (PyCFunction)__pyx_pw_8nfstream_4pcap_4pcap_39__setstate_cython__, METH_O, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static struct PyGetSetDef __pyx_getsets_8nfstream_4pcap_pcap[] = { - -#line 9 "(tree fragment)" {(char *)"name", __pyx_getprop_8nfstream_4pcap_4pcap_name, 0, (char *)"Network interface or dumpfile name.", 0}, - -#line 9 "(tree fragment)" {(char *)"snaplen", __pyx_getprop_8nfstream_4pcap_4pcap_snaplen, 0, (char *)"Maximum number of bytes to capture for each packet.", 0}, - -#line 9 "(tree fragment)" {(char *)"dloff", __pyx_getprop_8nfstream_4pcap_4pcap_dloff, 0, (char *)"Datalink offset (length of layer-2 frame header).", 0}, - -#line 9 "(tree fragment)" {(char *)"filter", __pyx_getprop_8nfstream_4pcap_4pcap_filter, 0, (char *)"Current packet capture filter.", 0}, - -#line 9 "(tree fragment)" {(char *)"fd", __pyx_getprop_8nfstream_4pcap_4pcap_fd, 0, (char *)"File descriptor (or Win32 HANDLE) for capture handle.", 0}, - -#line 9 "(tree fragment)" {(char *)"precision", __pyx_getprop_8nfstream_4pcap_4pcap_precision, 0, (char *)"Precision of timestamps", 0}, - -#line 9 "(tree fragment)" {(char *)"timestamp_in_ns", __pyx_getprop_8nfstream_4pcap_4pcap_timestamp_in_ns, 0, (char *)"Whether timestamps are returned in nanosecond units", 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyTypeObject __pyx_type_8nfstream_4pcap_pcap = { - -#line 9 "(tree fragment)" PyVarObject_HEAD_INIT(0, 0) - -#line 9 "(tree fragment)" "nfstream.pcap.pcap", /*tp_name*/ - -#line 9 "(tree fragment)" sizeof(struct __pyx_obj_8nfstream_4pcap_pcap), /*tp_basicsize*/ - -#line 9 "(tree fragment)" 0, /*tp_itemsize*/ - -#line 9 "(tree fragment)" __pyx_tp_dealloc_8nfstream_4pcap_pcap, /*tp_dealloc*/ - -#line 9 "(tree fragment)" 0, /*tp_print*/ - -#line 9 "(tree fragment)" 0, /*tp_getattr*/ - -#line 9 "(tree fragment)" 0, /*tp_setattr*/ - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*tp_compare*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION >= 3 - -#line 9 "(tree fragment)" 0, /*tp_as_async*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" 0, /*tp_repr*/ - -#line 9 "(tree fragment)" 0, /*tp_as_number*/ - -#line 9 "(tree fragment)" 0, /*tp_as_sequence*/ - -#line 9 "(tree fragment)" 0, /*tp_as_mapping*/ - -#line 9 "(tree fragment)" 0, /*tp_hash*/ - -#line 9 "(tree fragment)" 0, /*tp_call*/ - -#line 9 "(tree fragment)" 0, /*tp_str*/ - -#line 9 "(tree fragment)" 0, /*tp_getattro*/ - -#line 9 "(tree fragment)" 0, /*tp_setattro*/ - -#line 9 "(tree fragment)" 0, /*tp_as_buffer*/ - -#line 9 "(tree fragment)" Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - -#line 9 "(tree fragment)" "pcap(name=None, snaplen=65535, promisc=True, timeout_ms=None, immediate=False, timestamp_in_ns=False) -> packet capture object\n\n Open a handle to a packet capture descriptor.\n\n Keyword arguments:\n name -- name of a network interface or dumpfile to open,\n or None to open the first available up interface\n snaplen -- maximum number of bytes to capture for each packet\n promisc -- boolean to specify promiscuous mode sniffing\n timeout_ms -- requests for the next packet will return None if the timeout\n (in milliseconds) is reached and no packets were received\n (Default: no timeout)\n immediate -- disable buffering, if possible\n timestamp_in_ns -- report timestamps in integer nanoseconds\n ", /*tp_doc*/ - -#line 9 "(tree fragment)" 0, /*tp_traverse*/ - -#line 9 "(tree fragment)" 0, /*tp_clear*/ - -#line 9 "(tree fragment)" 0, /*tp_richcompare*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklistoffset*/ - -#line 9 "(tree fragment)" __pyx_pw_8nfstream_4pcap_4pcap_31__iter__, /*tp_iter*/ - -#line 9 "(tree fragment)" __pyx_pw_8nfstream_4pcap_4pcap_33__next__, /*tp_iternext*/ - -#line 9 "(tree fragment)" __pyx_methods_8nfstream_4pcap_pcap, /*tp_methods*/ - -#line 9 "(tree fragment)" 0, /*tp_members*/ - -#line 9 "(tree fragment)" __pyx_getsets_8nfstream_4pcap_pcap, /*tp_getset*/ - -#line 9 "(tree fragment)" 0, /*tp_base*/ - -#line 9 "(tree fragment)" 0, /*tp_dict*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_get*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_set*/ - -#line 9 "(tree fragment)" 0, /*tp_dictoffset*/ - -#line 9 "(tree fragment)" __pyx_pw_8nfstream_4pcap_4pcap_1__init__, /*tp_init*/ - -#line 9 "(tree fragment)" 0, /*tp_alloc*/ - -#line 9 "(tree fragment)" __pyx_tp_new_8nfstream_4pcap_pcap, /*tp_new*/ - -#line 9 "(tree fragment)" 0, /*tp_free*/ - -#line 9 "(tree fragment)" 0, /*tp_is_gc*/ - -#line 9 "(tree fragment)" 0, /*tp_bases*/ - -#line 9 "(tree fragment)" 0, /*tp_mro*/ - -#line 9 "(tree fragment)" 0, /*tp_cache*/ - -#line 9 "(tree fragment)" 0, /*tp_subclasses*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklist*/ - -#line 9 "(tree fragment)" 0, /*tp_del*/ - -#line 9 "(tree fragment)" 0, /*tp_version_tag*/ - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" 0, /*tp_finalize*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" }; - -#line 9 "(tree fragment)" static struct __pyx_vtabstruct_array __pyx_vtable_array; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { - -#line 9 "(tree fragment)" struct __pyx_array_obj *p; - -#line 9 "(tree fragment)" PyObject *o; - -#line 9 "(tree fragment)" if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - -#line 9 "(tree fragment)" o = (*t->tp_alloc)(t, 0); - -#line 9 "(tree fragment)" } else { - -#line 9 "(tree fragment)" o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (unlikely(!o)) return 0; - -#line 9 "(tree fragment)" p = ((struct __pyx_array_obj *)o); - -#line 9 "(tree fragment)" p->__pyx_vtab = __pyx_vtabptr_array; - -#line 9 "(tree fragment)" p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); - -#line 9 "(tree fragment)" p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); - -#line 9 "(tree fragment)" if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; - -#line 9 "(tree fragment)" return o; - -#line 9 "(tree fragment)" bad: - -#line 9 "(tree fragment)" Py_DECREF(o); o = 0; - -#line 9 "(tree fragment)" return NULL; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static void __pyx_tp_dealloc_array(PyObject *o) { - -#line 9 "(tree fragment)" struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - -#line 9 "(tree fragment)" if (PyObject_CallFinalizerFromDealloc(o)) return; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" { - -#line 9 "(tree fragment)" PyObject *etype, *eval, *etb; - -#line 9 "(tree fragment)" PyErr_Fetch(&etype, &eval, &etb); - -#line 9 "(tree fragment)" ++Py_REFCNT(o); - -#line 9 "(tree fragment)" __pyx_array___dealloc__(o); - -#line 9 "(tree fragment)" --Py_REFCNT(o); - -#line 9 "(tree fragment)" PyErr_Restore(etype, eval, etb); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" Py_CLEAR(p->mode); - -#line 9 "(tree fragment)" Py_CLEAR(p->_format); - -#line 9 "(tree fragment)" (*Py_TYPE(o)->tp_free)(o); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { - -#line 9 "(tree fragment)" PyObject *r; - -#line 9 "(tree fragment)" PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - -#line 9 "(tree fragment)" r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - -#line 9 "(tree fragment)" Py_DECREF(x); - -#line 9 "(tree fragment)" return r; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { - -#line 9 "(tree fragment)" if (v) { - -#line 9 "(tree fragment)" return __pyx_array___setitem__(o, i, v); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" else { - -#line 9 "(tree fragment)" PyErr_Format(PyExc_NotImplementedError, - -#line 9 "(tree fragment)" "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); - -#line 9 "(tree fragment)" return -1; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { - -#line 9 "(tree fragment)" PyObject *v = PyObject_GenericGetAttr(o, n); - -#line 9 "(tree fragment)" if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { - -#line 9 "(tree fragment)" PyErr_Clear(); - -#line 9 "(tree fragment)" v = __pyx_array___getattr__(o, n); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" return v; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMethodDef __pyx_methods_array[] = { - -#line 9 "(tree fragment)" {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, - -#line 9 "(tree fragment)" {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static struct PyGetSetDef __pyx_getsets_array[] = { - -#line 9 "(tree fragment)" {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PySequenceMethods __pyx_tp_as_sequence_array = { - -#line 9 "(tree fragment)" __pyx_array___len__, /*sq_length*/ - -#line 9 "(tree fragment)" 0, /*sq_concat*/ - -#line 9 "(tree fragment)" 0, /*sq_repeat*/ - -#line 9 "(tree fragment)" __pyx_sq_item_array, /*sq_item*/ - -#line 9 "(tree fragment)" 0, /*sq_slice*/ - -#line 9 "(tree fragment)" 0, /*sq_ass_item*/ - -#line 9 "(tree fragment)" 0, /*sq_ass_slice*/ - -#line 9 "(tree fragment)" 0, /*sq_contains*/ - -#line 9 "(tree fragment)" 0, /*sq_inplace_concat*/ - -#line 9 "(tree fragment)" 0, /*sq_inplace_repeat*/ - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMappingMethods __pyx_tp_as_mapping_array = { - -#line 9 "(tree fragment)" __pyx_array___len__, /*mp_length*/ - -#line 9 "(tree fragment)" __pyx_array___getitem__, /*mp_subscript*/ - -#line 9 "(tree fragment)" __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyBufferProcs __pyx_tp_as_buffer_array = { - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*bf_getreadbuffer*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*bf_getwritebuffer*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*bf_getsegcount*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*bf_getcharbuffer*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" __pyx_array_getbuffer, /*bf_getbuffer*/ - -#line 9 "(tree fragment)" 0, /*bf_releasebuffer*/ - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyTypeObject __pyx_type___pyx_array = { - -#line 9 "(tree fragment)" PyVarObject_HEAD_INIT(0, 0) - -#line 9 "(tree fragment)" "nfstream.pcap.array", /*tp_name*/ - -#line 9 "(tree fragment)" sizeof(struct __pyx_array_obj), /*tp_basicsize*/ - -#line 9 "(tree fragment)" 0, /*tp_itemsize*/ - -#line 9 "(tree fragment)" __pyx_tp_dealloc_array, /*tp_dealloc*/ - -#line 9 "(tree fragment)" 0, /*tp_print*/ - -#line 9 "(tree fragment)" 0, /*tp_getattr*/ - -#line 9 "(tree fragment)" 0, /*tp_setattr*/ - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*tp_compare*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION >= 3 - -#line 9 "(tree fragment)" 0, /*tp_as_async*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" 0, /*tp_repr*/ - -#line 9 "(tree fragment)" 0, /*tp_as_number*/ - -#line 9 "(tree fragment)" &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ - -#line 9 "(tree fragment)" &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ - -#line 9 "(tree fragment)" 0, /*tp_hash*/ - -#line 9 "(tree fragment)" 0, /*tp_call*/ - -#line 9 "(tree fragment)" 0, /*tp_str*/ - -#line 9 "(tree fragment)" __pyx_tp_getattro_array, /*tp_getattro*/ - -#line 9 "(tree fragment)" 0, /*tp_setattro*/ - -#line 9 "(tree fragment)" &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ - -#line 9 "(tree fragment)" Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - -#line 9 "(tree fragment)" 0, /*tp_doc*/ - -#line 9 "(tree fragment)" 0, /*tp_traverse*/ - -#line 9 "(tree fragment)" 0, /*tp_clear*/ - -#line 9 "(tree fragment)" 0, /*tp_richcompare*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklistoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_iter*/ - -#line 9 "(tree fragment)" 0, /*tp_iternext*/ - -#line 9 "(tree fragment)" __pyx_methods_array, /*tp_methods*/ - -#line 9 "(tree fragment)" 0, /*tp_members*/ - -#line 9 "(tree fragment)" __pyx_getsets_array, /*tp_getset*/ - -#line 9 "(tree fragment)" 0, /*tp_base*/ - -#line 9 "(tree fragment)" 0, /*tp_dict*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_get*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_set*/ - -#line 9 "(tree fragment)" 0, /*tp_dictoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_init*/ - -#line 9 "(tree fragment)" 0, /*tp_alloc*/ - -#line 9 "(tree fragment)" __pyx_tp_new_array, /*tp_new*/ - -#line 9 "(tree fragment)" 0, /*tp_free*/ - -#line 9 "(tree fragment)" 0, /*tp_is_gc*/ - -#line 9 "(tree fragment)" 0, /*tp_bases*/ - -#line 9 "(tree fragment)" 0, /*tp_mro*/ - -#line 9 "(tree fragment)" 0, /*tp_cache*/ - -#line 9 "(tree fragment)" 0, /*tp_subclasses*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklist*/ - -#line 9 "(tree fragment)" 0, /*tp_del*/ - -#line 9 "(tree fragment)" 0, /*tp_version_tag*/ - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" 0, /*tp_finalize*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - -#line 9 "(tree fragment)" struct __pyx_MemviewEnum_obj *p; - -#line 9 "(tree fragment)" PyObject *o; - -#line 9 "(tree fragment)" if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - -#line 9 "(tree fragment)" o = (*t->tp_alloc)(t, 0); - -#line 9 "(tree fragment)" } else { - -#line 9 "(tree fragment)" o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (unlikely(!o)) return 0; - -#line 9 "(tree fragment)" p = ((struct __pyx_MemviewEnum_obj *)o); - -#line 9 "(tree fragment)" p->name = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" return o; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static void __pyx_tp_dealloc_Enum(PyObject *o) { - -#line 9 "(tree fragment)" struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - -#line 9 "(tree fragment)" if (PyObject_CallFinalizerFromDealloc(o)) return; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" PyObject_GC_UnTrack(o); - -#line 9 "(tree fragment)" Py_CLEAR(p->name); - -#line 9 "(tree fragment)" (*Py_TYPE(o)->tp_free)(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { - -#line 9 "(tree fragment)" int e; - -#line 9 "(tree fragment)" struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; - -#line 9 "(tree fragment)" if (p->name) { - -#line 9 "(tree fragment)" e = (*v)(p->name, a); if (e) return e; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" return 0; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_tp_clear_Enum(PyObject *o) { - -#line 9 "(tree fragment)" PyObject* tmp; - -#line 9 "(tree fragment)" struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; - -#line 9 "(tree fragment)" tmp = ((PyObject*)p->name); - -#line 9 "(tree fragment)" p->name = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" Py_XDECREF(tmp); - -#line 9 "(tree fragment)" return 0; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMethodDef __pyx_methods_Enum[] = { - -#line 9 "(tree fragment)" {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyTypeObject __pyx_type___pyx_MemviewEnum = { - -#line 9 "(tree fragment)" PyVarObject_HEAD_INIT(0, 0) - -#line 9 "(tree fragment)" "nfstream.pcap.Enum", /*tp_name*/ - -#line 9 "(tree fragment)" sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ - -#line 9 "(tree fragment)" 0, /*tp_itemsize*/ - -#line 9 "(tree fragment)" __pyx_tp_dealloc_Enum, /*tp_dealloc*/ - -#line 9 "(tree fragment)" 0, /*tp_print*/ - -#line 9 "(tree fragment)" 0, /*tp_getattr*/ - -#line 9 "(tree fragment)" 0, /*tp_setattr*/ - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*tp_compare*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION >= 3 - -#line 9 "(tree fragment)" 0, /*tp_as_async*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" __pyx_MemviewEnum___repr__, /*tp_repr*/ - -#line 9 "(tree fragment)" 0, /*tp_as_number*/ - -#line 9 "(tree fragment)" 0, /*tp_as_sequence*/ - -#line 9 "(tree fragment)" 0, /*tp_as_mapping*/ - -#line 9 "(tree fragment)" 0, /*tp_hash*/ - -#line 9 "(tree fragment)" 0, /*tp_call*/ - -#line 9 "(tree fragment)" 0, /*tp_str*/ - -#line 9 "(tree fragment)" 0, /*tp_getattro*/ - -#line 9 "(tree fragment)" 0, /*tp_setattro*/ - -#line 9 "(tree fragment)" 0, /*tp_as_buffer*/ - -#line 9 "(tree fragment)" Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - -#line 9 "(tree fragment)" 0, /*tp_doc*/ - -#line 9 "(tree fragment)" __pyx_tp_traverse_Enum, /*tp_traverse*/ - -#line 9 "(tree fragment)" __pyx_tp_clear_Enum, /*tp_clear*/ - -#line 9 "(tree fragment)" 0, /*tp_richcompare*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklistoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_iter*/ - -#line 9 "(tree fragment)" 0, /*tp_iternext*/ - -#line 9 "(tree fragment)" __pyx_methods_Enum, /*tp_methods*/ - -#line 9 "(tree fragment)" 0, /*tp_members*/ - -#line 9 "(tree fragment)" 0, /*tp_getset*/ - -#line 9 "(tree fragment)" 0, /*tp_base*/ - -#line 9 "(tree fragment)" 0, /*tp_dict*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_get*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_set*/ - -#line 9 "(tree fragment)" 0, /*tp_dictoffset*/ - -#line 9 "(tree fragment)" __pyx_MemviewEnum___init__, /*tp_init*/ - -#line 9 "(tree fragment)" 0, /*tp_alloc*/ - -#line 9 "(tree fragment)" __pyx_tp_new_Enum, /*tp_new*/ - -#line 9 "(tree fragment)" 0, /*tp_free*/ - -#line 9 "(tree fragment)" 0, /*tp_is_gc*/ - -#line 9 "(tree fragment)" 0, /*tp_bases*/ - -#line 9 "(tree fragment)" 0, /*tp_mro*/ - -#line 9 "(tree fragment)" 0, /*tp_cache*/ - -#line 9 "(tree fragment)" 0, /*tp_subclasses*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklist*/ - -#line 9 "(tree fragment)" 0, /*tp_del*/ - -#line 9 "(tree fragment)" 0, /*tp_version_tag*/ - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" 0, /*tp_finalize*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" }; - -#line 9 "(tree fragment)" static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { - -#line 9 "(tree fragment)" struct __pyx_memoryview_obj *p; - -#line 9 "(tree fragment)" PyObject *o; - -#line 9 "(tree fragment)" if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - -#line 9 "(tree fragment)" o = (*t->tp_alloc)(t, 0); - -#line 9 "(tree fragment)" } else { - -#line 9 "(tree fragment)" o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (unlikely(!o)) return 0; - -#line 9 "(tree fragment)" p = ((struct __pyx_memoryview_obj *)o); - -#line 9 "(tree fragment)" p->__pyx_vtab = __pyx_vtabptr_memoryview; - -#line 9 "(tree fragment)" p->obj = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" p->_size = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" p->_array_interface = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" p->view.obj = NULL; - -#line 9 "(tree fragment)" if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; - -#line 9 "(tree fragment)" return o; - -#line 9 "(tree fragment)" bad: - -#line 9 "(tree fragment)" Py_DECREF(o); o = 0; - -#line 9 "(tree fragment)" return NULL; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static void __pyx_tp_dealloc_memoryview(PyObject *o) { - -#line 9 "(tree fragment)" struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - -#line 9 "(tree fragment)" if (PyObject_CallFinalizerFromDealloc(o)) return; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" PyObject_GC_UnTrack(o); - -#line 9 "(tree fragment)" { - -#line 9 "(tree fragment)" PyObject *etype, *eval, *etb; - -#line 9 "(tree fragment)" PyErr_Fetch(&etype, &eval, &etb); - -#line 9 "(tree fragment)" ++Py_REFCNT(o); - -#line 9 "(tree fragment)" __pyx_memoryview___dealloc__(o); - -#line 9 "(tree fragment)" --Py_REFCNT(o); - -#line 9 "(tree fragment)" PyErr_Restore(etype, eval, etb); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" Py_CLEAR(p->obj); - -#line 9 "(tree fragment)" Py_CLEAR(p->_size); - -#line 9 "(tree fragment)" Py_CLEAR(p->_array_interface); - -#line 9 "(tree fragment)" (*Py_TYPE(o)->tp_free)(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { - -#line 9 "(tree fragment)" int e; - -#line 9 "(tree fragment)" struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; - -#line 9 "(tree fragment)" if (p->obj) { - -#line 9 "(tree fragment)" e = (*v)(p->obj, a); if (e) return e; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (p->_size) { - -#line 9 "(tree fragment)" e = (*v)(p->_size, a); if (e) return e; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (p->_array_interface) { - -#line 9 "(tree fragment)" e = (*v)(p->_array_interface, a); if (e) return e; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" if (p->view.obj) { - -#line 9 "(tree fragment)" e = (*v)(p->view.obj, a); if (e) return e; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" return 0; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_tp_clear_memoryview(PyObject *o) { - -#line 9 "(tree fragment)" PyObject* tmp; - -#line 9 "(tree fragment)" struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; - -#line 9 "(tree fragment)" tmp = ((PyObject*)p->obj); - -#line 9 "(tree fragment)" p->obj = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" Py_XDECREF(tmp); - -#line 9 "(tree fragment)" tmp = ((PyObject*)p->_size); - -#line 9 "(tree fragment)" p->_size = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" Py_XDECREF(tmp); - -#line 9 "(tree fragment)" tmp = ((PyObject*)p->_array_interface); - -#line 9 "(tree fragment)" p->_array_interface = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" Py_XDECREF(tmp); - -#line 9 "(tree fragment)" Py_CLEAR(p->view.obj); - -#line 9 "(tree fragment)" return 0; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { - -#line 9 "(tree fragment)" PyObject *r; - -#line 9 "(tree fragment)" PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - -#line 9 "(tree fragment)" r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - -#line 9 "(tree fragment)" Py_DECREF(x); - -#line 9 "(tree fragment)" return r; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { - -#line 9 "(tree fragment)" if (v) { - -#line 9 "(tree fragment)" return __pyx_memoryview___setitem__(o, i, v); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" else { - -#line 9 "(tree fragment)" PyErr_Format(PyExc_NotImplementedError, - -#line 9 "(tree fragment)" "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); - -#line 9 "(tree fragment)" return -1; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMethodDef __pyx_methods_memoryview[] = { - -#line 9 "(tree fragment)" {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static struct PyGetSetDef __pyx_getsets_memoryview[] = { - -#line 9 "(tree fragment)" {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PySequenceMethods __pyx_tp_as_sequence_memoryview = { - -#line 9 "(tree fragment)" __pyx_memoryview___len__, /*sq_length*/ - -#line 9 "(tree fragment)" 0, /*sq_concat*/ - -#line 9 "(tree fragment)" 0, /*sq_repeat*/ - -#line 9 "(tree fragment)" __pyx_sq_item_memoryview, /*sq_item*/ - -#line 9 "(tree fragment)" 0, /*sq_slice*/ - -#line 9 "(tree fragment)" 0, /*sq_ass_item*/ - -#line 9 "(tree fragment)" 0, /*sq_ass_slice*/ - -#line 9 "(tree fragment)" 0, /*sq_contains*/ - -#line 9 "(tree fragment)" 0, /*sq_inplace_concat*/ - -#line 9 "(tree fragment)" 0, /*sq_inplace_repeat*/ - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMappingMethods __pyx_tp_as_mapping_memoryview = { - -#line 9 "(tree fragment)" __pyx_memoryview___len__, /*mp_length*/ - -#line 9 "(tree fragment)" __pyx_memoryview___getitem__, /*mp_subscript*/ - -#line 9 "(tree fragment)" __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyBufferProcs __pyx_tp_as_buffer_memoryview = { - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*bf_getreadbuffer*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*bf_getwritebuffer*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*bf_getsegcount*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*bf_getcharbuffer*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" __pyx_memoryview_getbuffer, /*bf_getbuffer*/ - -#line 9 "(tree fragment)" 0, /*bf_releasebuffer*/ - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyTypeObject __pyx_type___pyx_memoryview = { - -#line 9 "(tree fragment)" PyVarObject_HEAD_INIT(0, 0) - -#line 9 "(tree fragment)" "nfstream.pcap.memoryview", /*tp_name*/ - -#line 9 "(tree fragment)" sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ - -#line 9 "(tree fragment)" 0, /*tp_itemsize*/ - -#line 9 "(tree fragment)" __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ - -#line 9 "(tree fragment)" 0, /*tp_print*/ - -#line 9 "(tree fragment)" 0, /*tp_getattr*/ - -#line 9 "(tree fragment)" 0, /*tp_setattr*/ - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*tp_compare*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION >= 3 - -#line 9 "(tree fragment)" 0, /*tp_as_async*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" __pyx_memoryview___repr__, /*tp_repr*/ - -#line 9 "(tree fragment)" 0, /*tp_as_number*/ - -#line 9 "(tree fragment)" &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ - -#line 9 "(tree fragment)" &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ - -#line 9 "(tree fragment)" 0, /*tp_hash*/ - -#line 9 "(tree fragment)" 0, /*tp_call*/ - -#line 9 "(tree fragment)" __pyx_memoryview___str__, /*tp_str*/ - -#line 9 "(tree fragment)" 0, /*tp_getattro*/ - -#line 9 "(tree fragment)" 0, /*tp_setattro*/ - -#line 9 "(tree fragment)" &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ - -#line 9 "(tree fragment)" Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - -#line 9 "(tree fragment)" 0, /*tp_doc*/ - -#line 9 "(tree fragment)" __pyx_tp_traverse_memoryview, /*tp_traverse*/ - -#line 9 "(tree fragment)" __pyx_tp_clear_memoryview, /*tp_clear*/ - -#line 9 "(tree fragment)" 0, /*tp_richcompare*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklistoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_iter*/ - -#line 9 "(tree fragment)" 0, /*tp_iternext*/ - -#line 9 "(tree fragment)" __pyx_methods_memoryview, /*tp_methods*/ - -#line 9 "(tree fragment)" 0, /*tp_members*/ - -#line 9 "(tree fragment)" __pyx_getsets_memoryview, /*tp_getset*/ - -#line 9 "(tree fragment)" 0, /*tp_base*/ - -#line 9 "(tree fragment)" 0, /*tp_dict*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_get*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_set*/ - -#line 9 "(tree fragment)" 0, /*tp_dictoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_init*/ - -#line 9 "(tree fragment)" 0, /*tp_alloc*/ - -#line 9 "(tree fragment)" __pyx_tp_new_memoryview, /*tp_new*/ - -#line 9 "(tree fragment)" 0, /*tp_free*/ - -#line 9 "(tree fragment)" 0, /*tp_is_gc*/ - -#line 9 "(tree fragment)" 0, /*tp_bases*/ - -#line 9 "(tree fragment)" 0, /*tp_mro*/ - -#line 9 "(tree fragment)" 0, /*tp_cache*/ - -#line 9 "(tree fragment)" 0, /*tp_subclasses*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklist*/ - -#line 9 "(tree fragment)" 0, /*tp_del*/ - -#line 9 "(tree fragment)" 0, /*tp_version_tag*/ - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" 0, /*tp_finalize*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" }; - -#line 9 "(tree fragment)" static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { - -#line 9 "(tree fragment)" struct __pyx_memoryviewslice_obj *p; - -#line 9 "(tree fragment)" PyObject *o = __pyx_tp_new_memoryview(t, a, k); - -#line 9 "(tree fragment)" if (unlikely(!o)) return 0; - -#line 9 "(tree fragment)" p = ((struct __pyx_memoryviewslice_obj *)o); - -#line 9 "(tree fragment)" p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; - -#line 9 "(tree fragment)" p->from_object = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" p->from_slice.memview = NULL; - -#line 9 "(tree fragment)" return o; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { - -#line 9 "(tree fragment)" struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - -#line 9 "(tree fragment)" if (PyObject_CallFinalizerFromDealloc(o)) return; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" PyObject_GC_UnTrack(o); - -#line 9 "(tree fragment)" { - -#line 9 "(tree fragment)" PyObject *etype, *eval, *etb; - -#line 9 "(tree fragment)" PyErr_Fetch(&etype, &eval, &etb); - -#line 9 "(tree fragment)" ++Py_REFCNT(o); - -#line 9 "(tree fragment)" __pyx_memoryviewslice___dealloc__(o); - -#line 9 "(tree fragment)" --Py_REFCNT(o); - -#line 9 "(tree fragment)" PyErr_Restore(etype, eval, etb); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" Py_CLEAR(p->from_object); - -#line 9 "(tree fragment)" PyObject_GC_Track(o); - -#line 9 "(tree fragment)" __pyx_tp_dealloc_memoryview(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { - -#line 9 "(tree fragment)" int e; - -#line 9 "(tree fragment)" struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; - -#line 9 "(tree fragment)" e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; - -#line 9 "(tree fragment)" if (p->from_object) { - -#line 9 "(tree fragment)" e = (*v)(p->from_object, a); if (e) return e; - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" return 0; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static int __pyx_tp_clear__memoryviewslice(PyObject *o) { - -#line 9 "(tree fragment)" PyObject* tmp; - -#line 9 "(tree fragment)" struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; - -#line 9 "(tree fragment)" __pyx_tp_clear_memoryview(o); - -#line 9 "(tree fragment)" tmp = ((PyObject*)p->from_object); - -#line 9 "(tree fragment)" p->from_object = Py_None; Py_INCREF(Py_None); - -#line 9 "(tree fragment)" Py_XDECREF(tmp); - -#line 9 "(tree fragment)" __PYX_XDEC_MEMVIEW(&p->from_slice, 1); - -#line 9 "(tree fragment)" return 0; - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { - -#line 9 "(tree fragment)" return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); - -#line 9 "(tree fragment)" } -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMethodDef __pyx_methods__memoryviewslice[] = { - -#line 9 "(tree fragment)" {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, - -#line 9 "(tree fragment)" {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { - -#line 9 "(tree fragment)" {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, - -#line 9 "(tree fragment)" {0, 0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyTypeObject __pyx_type___pyx_memoryviewslice = { - -#line 9 "(tree fragment)" PyVarObject_HEAD_INIT(0, 0) - -#line 9 "(tree fragment)" "nfstream.pcap._memoryviewslice", /*tp_name*/ - -#line 9 "(tree fragment)" sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ - -#line 9 "(tree fragment)" 0, /*tp_itemsize*/ - -#line 9 "(tree fragment)" __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ - -#line 9 "(tree fragment)" 0, /*tp_print*/ - -#line 9 "(tree fragment)" 0, /*tp_getattr*/ - -#line 9 "(tree fragment)" 0, /*tp_setattr*/ - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" 0, /*tp_compare*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION >= 3 - -#line 9 "(tree fragment)" 0, /*tp_as_async*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" #if CYTHON_COMPILING_IN_PYPY - -#line 9 "(tree fragment)" __pyx_memoryview___repr__, /*tp_repr*/ - -#line 9 "(tree fragment)" #else - -#line 9 "(tree fragment)" 0, /*tp_repr*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" 0, /*tp_as_number*/ - -#line 9 "(tree fragment)" 0, /*tp_as_sequence*/ - -#line 9 "(tree fragment)" 0, /*tp_as_mapping*/ - -#line 9 "(tree fragment)" 0, /*tp_hash*/ - -#line 9 "(tree fragment)" 0, /*tp_call*/ - -#line 9 "(tree fragment)" #if CYTHON_COMPILING_IN_PYPY - -#line 9 "(tree fragment)" __pyx_memoryview___str__, /*tp_str*/ - -#line 9 "(tree fragment)" #else - -#line 9 "(tree fragment)" 0, /*tp_str*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" 0, /*tp_getattro*/ - -#line 9 "(tree fragment)" 0, /*tp_setattro*/ - -#line 9 "(tree fragment)" 0, /*tp_as_buffer*/ - -#line 9 "(tree fragment)" Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - -#line 9 "(tree fragment)" "Internal class for passing memoryview slices to Python", /*tp_doc*/ - -#line 9 "(tree fragment)" __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ - -#line 9 "(tree fragment)" __pyx_tp_clear__memoryviewslice, /*tp_clear*/ - -#line 9 "(tree fragment)" 0, /*tp_richcompare*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklistoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_iter*/ - -#line 9 "(tree fragment)" 0, /*tp_iternext*/ - -#line 9 "(tree fragment)" __pyx_methods__memoryviewslice, /*tp_methods*/ - -#line 9 "(tree fragment)" 0, /*tp_members*/ - -#line 9 "(tree fragment)" __pyx_getsets__memoryviewslice, /*tp_getset*/ - -#line 9 "(tree fragment)" 0, /*tp_base*/ - -#line 9 "(tree fragment)" 0, /*tp_dict*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_get*/ - -#line 9 "(tree fragment)" 0, /*tp_descr_set*/ - -#line 9 "(tree fragment)" 0, /*tp_dictoffset*/ - -#line 9 "(tree fragment)" 0, /*tp_init*/ - -#line 9 "(tree fragment)" 0, /*tp_alloc*/ - -#line 9 "(tree fragment)" __pyx_tp_new__memoryviewslice, /*tp_new*/ - -#line 9 "(tree fragment)" 0, /*tp_free*/ - -#line 9 "(tree fragment)" 0, /*tp_is_gc*/ - -#line 9 "(tree fragment)" 0, /*tp_bases*/ - -#line 9 "(tree fragment)" 0, /*tp_mro*/ - -#line 9 "(tree fragment)" 0, /*tp_cache*/ - -#line 9 "(tree fragment)" 0, /*tp_subclasses*/ - -#line 9 "(tree fragment)" 0, /*tp_weaklist*/ - -#line 9 "(tree fragment)" 0, /*tp_del*/ - -#line 9 "(tree fragment)" 0, /*tp_version_tag*/ - -#line 9 "(tree fragment)" #if PY_VERSION_HEX >= 0x030400a1 - -#line 9 "(tree fragment)" 0, /*tp_finalize*/ - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" static PyMethodDef __pyx_methods[] = { - -#line 9 "(tree fragment)" {0, 0, 0, 0} - -#line 9 "(tree fragment)" }; -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION >= 3 - -#line 9 "(tree fragment)" static struct PyModuleDef __pyx_moduledef = { - -#line 9 "(tree fragment)" #if PY_VERSION_HEX < 0x03020000 - -#line 9 "(tree fragment)" { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - -#line 9 "(tree fragment)" #else - -#line 9 "(tree fragment)" PyModuleDef_HEAD_INIT, - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" "pcap", - -#line 9 "(tree fragment)" - 0, /* m_doc */ - -#line 9 "(tree fragment)" + __pyx_k_packet_capture_library_This_modu, /* m_doc */ -1, /* m_size */ - -#line 9 "(tree fragment)" __pyx_methods /* m_methods */, - -#line 9 "(tree fragment)" NULL, /* m_reload */ - -#line 9 "(tree fragment)" NULL, /* m_traverse */ - -#line 9 "(tree fragment)" NULL, /* m_clear */ - -#line 9 "(tree fragment)" NULL /* m_free */ - -#line 9 "(tree fragment)" }; - -#line 9 "(tree fragment)" #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_1_2_2, __pyx_k_1_2_2, sizeof(__pyx_k_1_2_2), 0, 1, 0, 0}, {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, - {&__pyx_kp_s_Activateing_packet_capture_faile, __pyx_k_Activateing_packet_capture_faile, sizeof(__pyx_k_Activateing_packet_capture_faile), 0, 0, 1, 0}, + {&__pyx_kp_u_Activateing_packet_capture_faile, __pyx_k_Activateing_packet_capture_faile, sizeof(__pyx_k_Activateing_packet_capture_faile), 0, 1, 0, 0}, + {&__pyx_kp_u_BSD_license, __pyx_k_BSD_license, sizeof(__pyx_k_BSD_license), 0, 1, 0, 0}, {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_kp_u_Copyright_c_2004_Dug_Song, __pyx_k_Copyright_c_2004_Dug_Song, sizeof(__pyx_k_Copyright_c_2004_Dug_Song), 0, 1, 0, 0}, {&__pyx_n_s_DLT_ARCNET, __pyx_k_DLT_ARCNET, sizeof(__pyx_k_DLT_ARCNET), 0, 0, 1, 1}, {&__pyx_n_s_DLT_AX25, __pyx_k_DLT_AX25, sizeof(__pyx_k_DLT_AX25), 0, 0, 1, 1}, {&__pyx_n_s_DLT_CHAOS, __pyx_k_DLT_CHAOS, sizeof(__pyx_k_DLT_CHAOS), 0, 0, 1, 1}, @@ -40936,9 +21612,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_DLT_PRONET, __pyx_k_DLT_PRONET, sizeof(__pyx_k_DLT_PRONET), 0, 0, 1, 1}, {&__pyx_n_s_DLT_RAW, __pyx_k_DLT_RAW, sizeof(__pyx_k_DLT_RAW), 0, 0, 1, 1}, {&__pyx_n_s_DLT_SLIP, __pyx_k_DLT_SLIP, sizeof(__pyx_k_DLT_SLIP), 0, 0, 1, 1}, + {&__pyx_kp_u_Dug_Song_dugsong_monkey_org, __pyx_k_Dug_Song_dugsong_monkey_org, sizeof(__pyx_k_Dug_Song_dugsong_monkey_org), 0, 1, 0, 0}, {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, - {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1}, + {&__pyx_n_u_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 1, 0, 1}, {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, @@ -40959,21 +21636,22 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_PCAP_TSTAMP_PRECISION_MICRO, __pyx_k_PCAP_TSTAMP_PRECISION_MICRO, sizeof(__pyx_k_PCAP_TSTAMP_PRECISION_MICRO), 0, 0, 1, 1}, {&__pyx_n_s_PCAP_TSTAMP_PRECISION_NANO, __pyx_k_PCAP_TSTAMP_PRECISION_NANO, sizeof(__pyx_k_PCAP_TSTAMP_PRECISION_NANO), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, - {&__pyx_kp_s_Set_immediate_mode, __pyx_k_Set_immediate_mode, sizeof(__pyx_k_Set_immediate_mode), 0, 0, 1, 0}, - {&__pyx_kp_s_Set_monitor_mode, __pyx_k_Set_monitor_mode, sizeof(__pyx_k_Set_monitor_mode), 0, 0, 1, 0}, - {&__pyx_kp_s_Set_promiscuous_mode, __pyx_k_Set_promiscuous_mode, sizeof(__pyx_k_Set_promiscuous_mode), 0, 0, 1, 0}, - {&__pyx_kp_s_Set_snaplength, __pyx_k_Set_snaplength, sizeof(__pyx_k_Set_snaplength), 0, 0, 1, 0}, - {&__pyx_kp_s_Set_timeout, __pyx_k_Set_timeout, sizeof(__pyx_k_Set_timeout), 0, 0, 1, 0}, + {&__pyx_kp_u_Set_immediate_mode, __pyx_k_Set_immediate_mode, sizeof(__pyx_k_Set_immediate_mode), 0, 1, 0, 0}, + {&__pyx_kp_u_Set_monitor_mode, __pyx_k_Set_monitor_mode, sizeof(__pyx_k_Set_monitor_mode), 0, 1, 0, 0}, + {&__pyx_kp_u_Set_promiscuous_mode, __pyx_k_Set_promiscuous_mode, sizeof(__pyx_k_Set_promiscuous_mode), 0, 1, 0, 0}, + {&__pyx_kp_u_Set_snaplength, __pyx_k_Set_snaplength, sizeof(__pyx_k_Set_snaplength), 0, 1, 0, 0}, + {&__pyx_kp_u_Set_timeout, __pyx_k_Set_timeout, sizeof(__pyx_k_Set_timeout), 0, 1, 0, 0}, {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0}, + {&__pyx_kp_u_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 1, 0, 0}, {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, {&__pyx_n_s_add_pkts, __pyx_k_add_pkts, sizeof(__pyx_k_add_pkts), 0, 0, 1, 1}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_kp_s_bad_filter, __pyx_k_bad_filter, sizeof(__pyx_k_bad_filter), 0, 0, 1, 0}, + {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, + {&__pyx_kp_u_bad_filter, __pyx_k_bad_filter, sizeof(__pyx_k_bad_filter), 0, 1, 0, 0}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, @@ -40984,8 +21662,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_cnt, __pyx_k_cnt, sizeof(__pyx_k_cnt), 0, 0, 1, 1}, {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, - {&__pyx_kp_s_couldn_t_determine_timestamp_pre, __pyx_k_couldn_t_determine_timestamp_pre, sizeof(__pyx_k_couldn_t_determine_timestamp_pre), 0, 0, 1, 0}, - {&__pyx_kp_s_couldn_t_enable_immediate_mode, __pyx_k_couldn_t_enable_immediate_mode, sizeof(__pyx_k_couldn_t_enable_immediate_mode), 0, 0, 1, 0}, + {&__pyx_n_s_copyright, __pyx_k_copyright, sizeof(__pyx_k_copyright), 0, 0, 1, 1}, + {&__pyx_kp_u_couldn_t_determine_timestamp_pre, __pyx_k_couldn_t_determine_timestamp_pre, sizeof(__pyx_k_couldn_t_determine_timestamp_pre), 0, 1, 0, 0}, + {&__pyx_kp_u_couldn_t_enable_immediate_mode, __pyx_k_couldn_t_enable_immediate_mode, sizeof(__pyx_k_couldn_t_enable_immediate_mode), 0, 1, 0, 0}, {&__pyx_n_s_curr, __pyx_k_curr, sizeof(__pyx_k_curr), 0, 0, 1, 1}, {&__pyx_n_s_descrip, __pyx_k_descrip, sizeof(__pyx_k_descrip), 0, 0, 1, 1}, {&__pyx_n_s_dev, __pyx_k_dev, sizeof(__pyx_k_dev), 0, 0, 1, 1}, @@ -41011,12 +21690,14 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_kp_u_https_github_com_pynetwork_pypca, __pyx_k_https_github_com_pynetwork_pypca, sizeof(__pyx_k_https_github_com_pynetwork_pypca), 0, 1, 0, 0}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_immediate, __pyx_k_immediate, sizeof(__pyx_k_immediate), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init___locals_check_return, __pyx_k_init___locals_check_return, sizeof(__pyx_k_init___locals_check_return), 0, 0, 1, 1}, {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1}, {&__pyx_n_s_lookupdev, __pyx_k_lookupdev, sizeof(__pyx_k_lookupdev), 0, 0, 1, 1}, {&__pyx_n_s_lookupnet, __pyx_k_lookupnet, sizeof(__pyx_k_lookupnet), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, @@ -41032,7 +21713,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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}, {&__pyx_n_s_nonblock, __pyx_k_nonblock, sizeof(__pyx_k_nonblock), 0, 0, 1, 1}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, - {&__pyx_n_s_openbsd, __pyx_k_openbsd, sizeof(__pyx_k_openbsd), 0, 0, 1, 1}, + {&__pyx_n_u_openbsd, __pyx_k_openbsd, sizeof(__pyx_k_openbsd), 0, 1, 0, 1}, {&__pyx_n_s_optimize, __pyx_k_optimize, sizeof(__pyx_k_optimize), 0, 0, 1, 1}, {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, @@ -41057,7 +21738,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, {&__pyx_n_s_retval, __pyx_k_retval, sizeof(__pyx_k_retval), 0, 0, 1, 1}, {&__pyx_n_s_rfmon, __pyx_k_rfmon, sizeof(__pyx_k_rfmon), 0, 0, 1, 1}, - {&__pyx_kp_s_s_failed_to_execute, __pyx_k_s_failed_to_execute, sizeof(__pyx_k_s_failed_to_execute), 0, 0, 1, 0}, + {&__pyx_kp_u_s_failed_to_execute, __pyx_k_s_failed_to_execute, sizeof(__pyx_k_s_failed_to_execute), 0, 1, 0, 0}, {&__pyx_kp_s_self___pcap_cannot_be_converted, __pyx_k_self___pcap_cannot_be_converted, sizeof(__pyx_k_self___pcap_cannot_be_converted), 0, 0, 1, 0}, {&__pyx_kp_s_self_args_self_callback_cannot_b, __pyx_k_self_args_self_callback_cannot_b, sizeof(__pyx_k_self_args_self_callback_cannot_b), 0, 0, 1, 0}, {&__pyx_kp_s_self_fcode_cannot_be_converted_t, __pyx_k_self_fcode_cannot_be_converted_t, sizeof(__pyx_k_self_fcode_cannot_be_converted_t), 0, 0, 1, 0}, @@ -41084,16 +21765,18 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) - __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(1, 165, __pyx_L1_error) - __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(1, 213, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 260, __pyx_L1_error) - __pyx_builtin_KeyboardInterrupt = __Pyx_GetBuiltinName(__pyx_n_s_KeyboardInterrupt); if (!__pyx_builtin_KeyboardInterrupt) __PYX_ERR(1, 415, __pyx_L1_error) - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(1, 469, __pyx_L1_error) + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(1, 184, __pyx_L1_error) + __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(1, 232, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 279, __pyx_L1_error) + __pyx_builtin_KeyboardInterrupt = __Pyx_GetBuiltinName(__pyx_n_s_KeyboardInterrupt); if (!__pyx_builtin_KeyboardInterrupt) __PYX_ERR(1, 434, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(1, 488, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 146, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 149, __pyx_L1_error) @@ -41116,14 +21799,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.args,self.callback cannot be converted to a Python object for pickling") */ - -#line 2 "(tree fragment)" __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_args_self_callback_cannot_b); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple_); - -#line 2 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple_); /* "(tree fragment)":4 @@ -41131,14 +21808,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.args,self.callback cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_args_self_callback_cannot_b); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__2); - -#line 4 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__2); /* "(tree fragment)":2 @@ -41147,14 +21818,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.fcode cannot be converted to a Python object for pickling") */ - -#line 2 "(tree fragment)" __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_fcode_cannot_be_converted_t); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__4); - -#line 2 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__4); /* "(tree fragment)":4 @@ -41162,68 +21827,42 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.fcode cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_fcode_cannot_be_converted_t); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__5); - -#line 4 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__5); - /* "nfstream/pcap.pyx":215 + /* "nfstream/pcap.pyx":234 * raise OSError, self.__ebuf * else: * py_byte_name = name.encode('UTF-8') # <<<<<<<<<<<<<< * p = py_byte_name - * + * */ - -#line 215 "nfstream/pcap.pyx" - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 215, __pyx_L1_error) - -#line 215 "nfstream/pcap.pyx" + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_UTF_8); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); - -#line 215 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_tuple__6); - /* "nfstream/pcap.pyx":223 + /* "nfstream/pcap.pyx":242 * self.__pcap = pcap_create(pcap_ex_name(p), self.__ebuf) * passing = True * def check_return(ret, descrip): # <<<<<<<<<<<<<< * if ret != 0: * raise OSError, "%s failed to execute" % descrip */ - -#line 223 "nfstream/pcap.pyx" - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_ret, __pyx_n_s_descrip); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 223, __pyx_L1_error) - -#line 223 "nfstream/pcap.pyx" + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_ret, __pyx_n_s_descrip); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); - -#line 223 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_check_return, 242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 242, __pyx_L1_error) -#line 223 "nfstream/pcap.pyx" - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_check_return, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 223, __pyx_L1_error) - - /* "nfstream/pcap.pyx":313 + /* "nfstream/pcap.pyx":332 * cdef bpf_program fcode * free(self.__filter) * py_byte_value = value.encode('UTF-8') # <<<<<<<<<<<<<< * self.__filter = strdup(py_byte_value) * if pcap_compile(self.__pcap, &fcode, self.__filter, optimize, 0) < 0: */ - -#line 313 "nfstream/pcap.pyx" - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 313, __pyx_L1_error) - -#line 313 "nfstream/pcap.pyx" + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_UTF_8); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); - -#line 313 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_tuple__9); /* "(tree fragment)":2 @@ -41232,14 +21871,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.__pcap cannot be converted to a Python object for pickling") */ - -#line 2 "(tree fragment)" __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self___pcap_cannot_be_converted); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__10); - -#line 2 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__10); /* "(tree fragment)":4 @@ -41247,99 +21880,63 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.__pcap cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self___pcap_cannot_be_converted); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__11); - -#line 4 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__11); /* "View.MemoryView":131 - * + * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< - * + * * if itemsize <= 0: */ - -#line 131 "View.MemoryView" __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 131, __pyx_L1_error) - -#line 131 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__12); - -#line 131 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__12); /* "View.MemoryView":134 - * + * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * + * * if not isinstance(format, bytes): */ - -#line 134 "View.MemoryView" __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 134, __pyx_L1_error) - -#line 134 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__13); - -#line 134 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__13); /* "View.MemoryView":137 - * + * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string * self.format = self._format */ - -#line 137 "View.MemoryView" __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 137, __pyx_L1_error) - -#line 137 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__14); - -#line 137 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__14); /* "View.MemoryView":146 - * + * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 146 "View.MemoryView" __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 146, __pyx_L1_error) - -#line 146 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__15); - -#line 146 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__15); /* "View.MemoryView":174 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * + * * if self.dtype_is_object: */ - -#line 174 "View.MemoryView" __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 174, __pyx_L1_error) - -#line 174 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__16); - -#line 174 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__16); /* "View.MemoryView":190 @@ -41349,14 +21946,8 @@ static int __Pyx_InitCachedConstants(void) { * info.buf = self.data * info.len = self.len */ - -#line 190 "View.MemoryView" __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 190, __pyx_L1_error) - -#line 190 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__17); - -#line 190 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__17); /* "(tree fragment)":2 @@ -41365,14 +21956,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - -#line 2 "(tree fragment)" __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__18); - -#line 2 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__18); /* "(tree fragment)":4 @@ -41380,14 +21965,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__19); - -#line 4 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":486 @@ -41397,57 +21976,33 @@ static int __Pyx_InitCachedConstants(void) { * else: * if len(self.view.format) == 1: */ - -#line 486 "View.MemoryView" __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 486, __pyx_L1_error) - -#line 486 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__20); - -#line 486 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__20); /* "View.MemoryView":558 * if self.view.strides == NULL: - * + * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - -#line 558 "View.MemoryView" __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 558, __pyx_L1_error) - -#line 558 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__21); - -#line 558 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__21); /* "View.MemoryView":565 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< - * + * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - -#line 565 "View.MemoryView" __pyx_tuple__22 = PyTuple_New(1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 565, __pyx_L1_error) - -#line 565 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__22); - -#line 565 "View.MemoryView" __Pyx_INCREF(__pyx_int_neg_1); - -#line 565 "View.MemoryView" __Pyx_GIVEREF(__pyx_int_neg_1); - -#line 565 "View.MemoryView" PyTuple_SET_ITEM(__pyx_tuple__22, 0, __pyx_int_neg_1); - -#line 565 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__22); /* "(tree fragment)":2 @@ -41456,14 +22011,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - -#line 2 "(tree fragment)" __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__23); - -#line 2 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__23); /* "(tree fragment)":4 @@ -41471,14 +22020,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__24); - -#line 4 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__24); /* "View.MemoryView":670 @@ -41488,14 +22031,8 @@ static int __Pyx_InitCachedConstants(void) { * seen_ellipsis = True * else: */ - -#line 670 "View.MemoryView" __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 670, __pyx_L1_error) - -#line 670 "View.MemoryView" __Pyx_GOTREF(__pyx_slice__25); - -#line 670 "View.MemoryView" __Pyx_GIVEREF(__pyx_slice__25); /* "View.MemoryView":673 @@ -41505,48 +22042,30 @@ static int __Pyx_InitCachedConstants(void) { * have_slices = True * else: */ - -#line 673 "View.MemoryView" __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(0, 673, __pyx_L1_error) - -#line 673 "View.MemoryView" __Pyx_GOTREF(__pyx_slice__26); - -#line 673 "View.MemoryView" __Pyx_GIVEREF(__pyx_slice__26); /* "View.MemoryView":684 * nslices = ndim - len(result) * if nslices: * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< - * + * * return have_slices or nslices, tuple(result) */ - -#line 684 "View.MemoryView" __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(0, 684, __pyx_L1_error) - -#line 684 "View.MemoryView" __Pyx_GOTREF(__pyx_slice__27); - -#line 684 "View.MemoryView" __Pyx_GIVEREF(__pyx_slice__27); /* "View.MemoryView":691 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 691 "View.MemoryView" __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 691, __pyx_L1_error) - -#line 691 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__28); - -#line 691 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__28); /* "(tree fragment)":2 @@ -41555,14 +22074,8 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - -#line 2 "(tree fragment)" __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2, __pyx_L1_error) - -#line 2 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__29); - -#line 2 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__29); /* "(tree fragment)":4 @@ -41570,196 +22083,122 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - -#line 4 "(tree fragment)" __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 4, __pyx_L1_error) - -#line 4 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__30); - -#line 4 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__30); - /* "nfstream/pcap.pyx":139 + /* "nfstream/pcap.pyx":158 * DLT_PFLOG = 117 * DLT_PFSYNC = 18 * if sys.platform.find('openbsd') != -1: # <<<<<<<<<<<<<< * DLT_LOOP = 12 * DLT_RAW = 14 */ - -#line 139 "nfstream/pcap.pyx" - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_openbsd); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 139, __pyx_L1_error) - -#line 139 "nfstream/pcap.pyx" + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_u_openbsd); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); - -#line 139 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_tuple__31); - /* "nfstream/pcap.pyx":479 + /* "nfstream/pcap.pyx":498 * pcap_close(self.__pcap) - * + * * def ex_name(char *foo): # <<<<<<<<<<<<<< * return pcap_ex_name(foo) - * + * */ - -#line 479 "nfstream/pcap.pyx" - __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_foo, __pyx_n_s_foo); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 479, __pyx_L1_error) - -#line 479 "nfstream/pcap.pyx" + __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_foo, __pyx_n_s_foo); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); - -#line 479 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_ex_name, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 498, __pyx_L1_error) -#line 479 "nfstream/pcap.pyx" - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_ex_name, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 479, __pyx_L1_error) - - /* "nfstream/pcap.pyx":482 + /* "nfstream/pcap.pyx":501 * return pcap_ex_name(foo) - * + * * def lookupdev(): # <<<<<<<<<<<<<< * """Return the name of a network device suitable for sniffing.""" * cdef char *p */ - -#line 482 "nfstream/pcap.pyx" - __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_ebuf); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 482, __pyx_L1_error) - -#line 482 "nfstream/pcap.pyx" + __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_ebuf); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); - -#line 482 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_lookupdev, 501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 501, __pyx_L1_error) -#line 482 "nfstream/pcap.pyx" - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_lookupdev, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 482, __pyx_L1_error) - - /* "nfstream/pcap.pyx":491 + /* "nfstream/pcap.pyx":510 * return str(p.decode('UTF-8')) - * + * * def findalldevs(): # <<<<<<<<<<<<<< * """Return a list of capture devices.""" * cdef pcap_if_t *devs */ - -#line 491 "nfstream/pcap.pyx" - __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_devs, __pyx_n_s_curr, __pyx_n_s_ebuf, __pyx_n_s_status, __pyx_n_s_retval); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 491, __pyx_L1_error) - -#line 491 "nfstream/pcap.pyx" + __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_devs, __pyx_n_s_curr, __pyx_n_s_ebuf, __pyx_n_s_status, __pyx_n_s_retval); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); - -#line 491 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_findalldevs, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 510, __pyx_L1_error) -#line 491 "nfstream/pcap.pyx" - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_findalldevs, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 491, __pyx_L1_error) - - /* "nfstream/pcap.pyx":512 + /* "nfstream/pcap.pyx":531 * return retval - * + * * def lookupnet(char *dev): # <<<<<<<<<<<<<< * """ * Return the address and the netmask of a given device */ - -#line 512 "nfstream/pcap.pyx" - __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_dev, __pyx_n_s_dev, __pyx_n_s_netp, __pyx_n_s_maskp, __pyx_n_s_ebuf, __pyx_n_s_status); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 512, __pyx_L1_error) - -#line 512 "nfstream/pcap.pyx" + __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_dev, __pyx_n_s_dev, __pyx_n_s_netp, __pyx_n_s_maskp, __pyx_n_s_ebuf, __pyx_n_s_status); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); - -#line 512 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_tuple__38); - -#line 512 "nfstream/pcap.pyx" - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_lookupnet, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 512, __pyx_L1_error) + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pcap_pyx, __pyx_n_s_lookupnet, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 531, __pyx_L1_error) /* "View.MemoryView":284 * return self.name - * + * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - -#line 284 "View.MemoryView" __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 284, __pyx_L1_error) - -#line 284 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__40); - -#line 284 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__40); /* "View.MemoryView":285 - * + * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") - * + * */ - -#line 285 "View.MemoryView" __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 285, __pyx_L1_error) - -#line 285 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__41); - -#line 285 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__41); /* "View.MemoryView":286 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 286 "View.MemoryView" __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 286, __pyx_L1_error) - -#line 286 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__42); - -#line 286 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__42); /* "View.MemoryView":289 - * - * + * + * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") - * + * */ - -#line 289 "View.MemoryView" __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 289, __pyx_L1_error) - -#line 289 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__43); - -#line 289 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__43); /* "View.MemoryView":290 - * + * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 290 "View.MemoryView" __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 290, __pyx_L1_error) - -#line 290 "View.MemoryView" __Pyx_GOTREF(__pyx_tuple__44); - -#line 290 "View.MemoryView" __Pyx_GIVEREF(__pyx_tuple__44); /* "(tree fragment)":1 @@ -41767,35 +22206,15 @@ static int __Pyx_InitCachedConstants(void) { * if __pyx_checksum != 0xb068931: * from pickle import PickleError as __pyx_PickleError */ - -#line 1 "(tree fragment)" __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1, __pyx_L1_error) - -#line 1 "(tree fragment)" __Pyx_GOTREF(__pyx_tuple__45); - -#line 1 "(tree fragment)" __Pyx_GIVEREF(__pyx_tuple__45); - -#line 1 "(tree fragment)" __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1, __pyx_L1_error) - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return 0; - -#line 1 "(tree fragment)" __pyx_L1_error:; - -#line 1 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 1 "(tree fragment)" return -1; - -#line 1 "(tree fragment)" } static int __Pyx_InitGlobals(void) { @@ -41830,11 +22249,11 @@ static int __Pyx_InitGlobals(void) { } #if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initpcap(void); /*proto*/ -PyMODINIT_FUNC initpcap(void) +PyMODINIT_FUNC initppcap(void); /*proto*/ +PyMODINIT_FUNC initppcap(void) #else -PyMODINIT_FUNC PyInit_pcap(void); /*proto*/ -PyMODINIT_FUNC PyInit_pcap(void) +PyMODINIT_FUNC PyInit_ppcap(void); /*proto*/ +PyMODINIT_FUNC PyInit_ppcap(void) #endif { PyObject *__pyx_t_1 = NULL; @@ -41851,7 +22270,7 @@ PyMODINIT_FUNC PyInit_pcap(void) Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_pcap(void)", 0); + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_ppcap(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) @@ -41880,7 +22299,7 @@ PyMODINIT_FUNC PyInit_pcap(void) #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("pcap", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + __pyx_m = Py_InitModule4("pcap", __pyx_methods, __pyx_k_packet_capture_library_This_modu, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -41922,20 +22341,20 @@ PyMODINIT_FUNC PyInit_pcap(void) /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_8nfstream_4pcap_pcap_handler_ctx) < 0) __PYX_ERR(1, 90, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_8nfstream_4pcap_pcap_handler_ctx) < 0) __PYX_ERR(1, 109, __pyx_L1_error) __pyx_type_8nfstream_4pcap_pcap_handler_ctx.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "pcap_handler_ctx", (PyObject *)&__pyx_type_8nfstream_4pcap_pcap_handler_ctx) < 0) __PYX_ERR(1, 90, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8nfstream_4pcap_pcap_handler_ctx) < 0) __PYX_ERR(1, 90, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "pcap_handler_ctx", (PyObject *)&__pyx_type_8nfstream_4pcap_pcap_handler_ctx) < 0) __PYX_ERR(1, 109, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8nfstream_4pcap_pcap_handler_ctx) < 0) __PYX_ERR(1, 109, __pyx_L1_error) __pyx_ptype_8nfstream_4pcap_pcap_handler_ctx = &__pyx_type_8nfstream_4pcap_pcap_handler_ctx; - if (PyType_Ready(&__pyx_type_8nfstream_4pcap_bpf) < 0) __PYX_ERR(1, 158, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_8nfstream_4pcap_bpf) < 0) __PYX_ERR(1, 177, __pyx_L1_error) __pyx_type_8nfstream_4pcap_bpf.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "bpf", (PyObject *)&__pyx_type_8nfstream_4pcap_bpf) < 0) __PYX_ERR(1, 158, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8nfstream_4pcap_bpf) < 0) __PYX_ERR(1, 158, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "bpf", (PyObject *)&__pyx_type_8nfstream_4pcap_bpf) < 0) __PYX_ERR(1, 177, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8nfstream_4pcap_bpf) < 0) __PYX_ERR(1, 177, __pyx_L1_error) __pyx_ptype_8nfstream_4pcap_bpf = &__pyx_type_8nfstream_4pcap_bpf; - if (PyType_Ready(&__pyx_type_8nfstream_4pcap_pcap) < 0) __PYX_ERR(1, 179, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_8nfstream_4pcap_pcap) < 0) __PYX_ERR(1, 198, __pyx_L1_error) __pyx_type_8nfstream_4pcap_pcap.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "pcap", (PyObject *)&__pyx_type_8nfstream_4pcap_pcap) < 0) __PYX_ERR(1, 179, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8nfstream_4pcap_pcap) < 0) __PYX_ERR(1, 179, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "pcap", (PyObject *)&__pyx_type_8nfstream_4pcap_pcap) < 0) __PYX_ERR(1, 198, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8nfstream_4pcap_pcap) < 0) __PYX_ERR(1, 198, __pyx_L1_error) __pyx_ptype_8nfstream_4pcap_pcap = &__pyx_type_8nfstream_4pcap_pcap; __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; @@ -41979,838 +22398,556 @@ PyMODINIT_FUNC PyInit_pcap(void) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif - /* "nfstream/pcap.pyx":1 + /* "nfstream/pcap.pyx":14 + * """ + * + * __author__ = 'Dug Song ' # <<<<<<<<<<<<<< + * __copyright__ = 'Copyright (c) 2004 Dug Song' + * __license__ = 'BSD license' + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_u_Dug_Song_dugsong_monkey_org) < 0) __PYX_ERR(1, 14, __pyx_L1_error) + + /* "nfstream/pcap.pyx":15 + * + * __author__ = 'Dug Song ' + * __copyright__ = 'Copyright (c) 2004 Dug Song' # <<<<<<<<<<<<<< + * __license__ = 'BSD license' + * __url__ = 'https://github.com/pynetwork/pypcap' + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_u_Copyright_c_2004_Dug_Song) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + + /* "nfstream/pcap.pyx":16 + * __author__ = 'Dug Song ' + * __copyright__ = 'Copyright (c) 2004 Dug Song' + * __license__ = 'BSD license' # <<<<<<<<<<<<<< + * __url__ = 'https://github.com/pynetwork/pypcap' + * __version__ = '1.2.2' + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_u_BSD_license) < 0) __PYX_ERR(1, 16, __pyx_L1_error) + + /* "nfstream/pcap.pyx":17 + * __copyright__ = 'Copyright (c) 2004 Dug Song' + * __license__ = 'BSD license' + * __url__ = 'https://github.com/pynetwork/pypcap' # <<<<<<<<<<<<<< + * __version__ = '1.2.2' + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_url, __pyx_kp_u_https_github_com_pynetwork_pypca) < 0) __PYX_ERR(1, 17, __pyx_L1_error) + + /* "nfstream/pcap.pyx":18 + * __license__ = 'BSD license' + * __url__ = 'https://github.com/pynetwork/pypcap' + * __version__ = '1.2.2' # <<<<<<<<<<<<<< + * + * import sys + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_1_2_2) < 0) __PYX_ERR(1, 18, __pyx_L1_error) + + /* "nfstream/pcap.pyx":20 + * __version__ = '1.2.2' + * * import sys # <<<<<<<<<<<<<< * import struct - * + * */ - -#line 1 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - -#line 1 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 1 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - -#line 1 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":2 + /* "nfstream/pcap.pyx":21 + * * import sys * import struct # <<<<<<<<<<<<<< - * + * * from cython cimport view */ - -#line 2 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) - -#line 2 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 2 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) __PYX_ERR(1, 2, __pyx_L1_error) - -#line 2 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":123 + /* "nfstream/pcap.pyx":142 * ctx.exc = sys.exc_info() - * + * * DLT_NULL = 0 # <<<<<<<<<<<<<< * DLT_EN10MB = 1 * DLT_EN3MB = 2 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_NULL, __pyx_int_0) < 0) __PYX_ERR(1, 142, __pyx_L1_error) -#line 123 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_NULL, __pyx_int_0) < 0) __PYX_ERR(1, 123, __pyx_L1_error) - - /* "nfstream/pcap.pyx":124 - * + /* "nfstream/pcap.pyx":143 + * * DLT_NULL = 0 * DLT_EN10MB = 1 # <<<<<<<<<<<<<< * DLT_EN3MB = 2 * DLT_AX25 = 3 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_EN10MB, __pyx_int_1) < 0) __PYX_ERR(1, 143, __pyx_L1_error) -#line 124 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_EN10MB, __pyx_int_1) < 0) __PYX_ERR(1, 124, __pyx_L1_error) - - /* "nfstream/pcap.pyx":125 + /* "nfstream/pcap.pyx":144 * DLT_NULL = 0 * DLT_EN10MB = 1 * DLT_EN3MB = 2 # <<<<<<<<<<<<<< * DLT_AX25 = 3 * DLT_PRONET = 4 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_EN3MB, __pyx_int_2) < 0) __PYX_ERR(1, 144, __pyx_L1_error) -#line 125 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_EN3MB, __pyx_int_2) < 0) __PYX_ERR(1, 125, __pyx_L1_error) - - /* "nfstream/pcap.pyx":126 + /* "nfstream/pcap.pyx":145 * DLT_EN10MB = 1 * DLT_EN3MB = 2 * DLT_AX25 = 3 # <<<<<<<<<<<<<< * DLT_PRONET = 4 * DLT_CHAOS = 5 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_AX25, __pyx_int_3) < 0) __PYX_ERR(1, 145, __pyx_L1_error) -#line 126 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_AX25, __pyx_int_3) < 0) __PYX_ERR(1, 126, __pyx_L1_error) - - /* "nfstream/pcap.pyx":127 + /* "nfstream/pcap.pyx":146 * DLT_EN3MB = 2 * DLT_AX25 = 3 * DLT_PRONET = 4 # <<<<<<<<<<<<<< * DLT_CHAOS = 5 * DLT_IEEE802 = 6 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_PRONET, __pyx_int_4) < 0) __PYX_ERR(1, 146, __pyx_L1_error) -#line 127 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_PRONET, __pyx_int_4) < 0) __PYX_ERR(1, 127, __pyx_L1_error) - - /* "nfstream/pcap.pyx":128 + /* "nfstream/pcap.pyx":147 * DLT_AX25 = 3 * DLT_PRONET = 4 * DLT_CHAOS = 5 # <<<<<<<<<<<<<< * DLT_IEEE802 = 6 * DLT_ARCNET = 7 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_CHAOS, __pyx_int_5) < 0) __PYX_ERR(1, 147, __pyx_L1_error) -#line 128 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_CHAOS, __pyx_int_5) < 0) __PYX_ERR(1, 128, __pyx_L1_error) - - /* "nfstream/pcap.pyx":129 + /* "nfstream/pcap.pyx":148 * DLT_PRONET = 4 * DLT_CHAOS = 5 * DLT_IEEE802 = 6 # <<<<<<<<<<<<<< * DLT_ARCNET = 7 * DLT_SLIP = 8 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_IEEE802, __pyx_int_6) < 0) __PYX_ERR(1, 148, __pyx_L1_error) -#line 129 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_IEEE802, __pyx_int_6) < 0) __PYX_ERR(1, 129, __pyx_L1_error) - - /* "nfstream/pcap.pyx":130 + /* "nfstream/pcap.pyx":149 * DLT_CHAOS = 5 * DLT_IEEE802 = 6 * DLT_ARCNET = 7 # <<<<<<<<<<<<<< * DLT_SLIP = 8 * DLT_PPP = 9 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_ARCNET, __pyx_int_7) < 0) __PYX_ERR(1, 149, __pyx_L1_error) -#line 130 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_ARCNET, __pyx_int_7) < 0) __PYX_ERR(1, 130, __pyx_L1_error) - - /* "nfstream/pcap.pyx":131 + /* "nfstream/pcap.pyx":150 * DLT_IEEE802 = 6 * DLT_ARCNET = 7 * DLT_SLIP = 8 # <<<<<<<<<<<<<< * DLT_PPP = 9 * DLT_FDDI = 10 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_SLIP, __pyx_int_8) < 0) __PYX_ERR(1, 150, __pyx_L1_error) -#line 131 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_SLIP, __pyx_int_8) < 0) __PYX_ERR(1, 131, __pyx_L1_error) - - /* "nfstream/pcap.pyx":132 + /* "nfstream/pcap.pyx":151 * DLT_ARCNET = 7 * DLT_SLIP = 8 * DLT_PPP = 9 # <<<<<<<<<<<<<< * DLT_FDDI = 10 * # XXX - Linux */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_PPP, __pyx_int_9) < 0) __PYX_ERR(1, 151, __pyx_L1_error) -#line 132 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_PPP, __pyx_int_9) < 0) __PYX_ERR(1, 132, __pyx_L1_error) - - /* "nfstream/pcap.pyx":133 + /* "nfstream/pcap.pyx":152 * DLT_SLIP = 8 * DLT_PPP = 9 * DLT_FDDI = 10 # <<<<<<<<<<<<<< * # XXX - Linux * DLT_LINUX_SLL = 113 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_FDDI, __pyx_int_10) < 0) __PYX_ERR(1, 152, __pyx_L1_error) -#line 133 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_FDDI, __pyx_int_10) < 0) __PYX_ERR(1, 133, __pyx_L1_error) - - /* "nfstream/pcap.pyx":135 + /* "nfstream/pcap.pyx":154 * DLT_FDDI = 10 * # XXX - Linux * DLT_LINUX_SLL = 113 # <<<<<<<<<<<<<< * # XXX - OpenBSD * DLT_PFLOG = 117 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_LINUX_SLL, __pyx_int_113) < 0) __PYX_ERR(1, 154, __pyx_L1_error) -#line 135 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_LINUX_SLL, __pyx_int_113) < 0) __PYX_ERR(1, 135, __pyx_L1_error) - - /* "nfstream/pcap.pyx":137 + /* "nfstream/pcap.pyx":156 * DLT_LINUX_SLL = 113 * # XXX - OpenBSD * DLT_PFLOG = 117 # <<<<<<<<<<<<<< * DLT_PFSYNC = 18 * if sys.platform.find('openbsd') != -1: */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_PFLOG, __pyx_int_117) < 0) __PYX_ERR(1, 156, __pyx_L1_error) -#line 137 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_PFLOG, __pyx_int_117) < 0) __PYX_ERR(1, 137, __pyx_L1_error) - - /* "nfstream/pcap.pyx":138 + /* "nfstream/pcap.pyx":157 * # XXX - OpenBSD * DLT_PFLOG = 117 * DLT_PFSYNC = 18 # <<<<<<<<<<<<<< * if sys.platform.find('openbsd') != -1: * DLT_LOOP = 12 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_PFSYNC, __pyx_int_18) < 0) __PYX_ERR(1, 157, __pyx_L1_error) -#line 138 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_PFSYNC, __pyx_int_18) < 0) __PYX_ERR(1, 138, __pyx_L1_error) - - /* "nfstream/pcap.pyx":139 + /* "nfstream/pcap.pyx":158 * DLT_PFLOG = 117 * DLT_PFSYNC = 18 * if sys.platform.find('openbsd') != -1: # <<<<<<<<<<<<<< * DLT_LOOP = 12 * DLT_RAW = 14 */ - -#line 139 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 139, __pyx_L1_error) - -#line 139 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 139 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error) - -#line 139 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 139 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 139 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 139, __pyx_L1_error) - -#line 139 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 139 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 139 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error) - -#line 139 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 139 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 139 "nfstream/pcap.pyx" - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 139, __pyx_L1_error) - -#line 139 "nfstream/pcap.pyx" + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 139 "nfstream/pcap.pyx" - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 139, __pyx_L1_error) - -#line 139 "nfstream/pcap.pyx" + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 139 "nfstream/pcap.pyx" if (__pyx_t_3) { - /* "nfstream/pcap.pyx":140 + /* "nfstream/pcap.pyx":159 * DLT_PFSYNC = 18 * if sys.platform.find('openbsd') != -1: * DLT_LOOP = 12 # <<<<<<<<<<<<<< * DLT_RAW = 14 * else: */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_LOOP, __pyx_int_12) < 0) __PYX_ERR(1, 159, __pyx_L1_error) -#line 140 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_LOOP, __pyx_int_12) < 0) __PYX_ERR(1, 140, __pyx_L1_error) - - /* "nfstream/pcap.pyx":141 + /* "nfstream/pcap.pyx":160 * if sys.platform.find('openbsd') != -1: * DLT_LOOP = 12 * DLT_RAW = 14 # <<<<<<<<<<<<<< * else: * DLT_LOOP = 108 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_RAW, __pyx_int_14) < 0) __PYX_ERR(1, 160, __pyx_L1_error) -#line 141 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_RAW, __pyx_int_14) < 0) __PYX_ERR(1, 141, __pyx_L1_error) - - /* "nfstream/pcap.pyx":139 + /* "nfstream/pcap.pyx":158 * DLT_PFLOG = 117 * DLT_PFSYNC = 18 * if sys.platform.find('openbsd') != -1: # <<<<<<<<<<<<<< * DLT_LOOP = 12 * DLT_RAW = 14 */ - -#line 139 "nfstream/pcap.pyx" goto __pyx_L2; - -#line 139 "nfstream/pcap.pyx" } - /* "nfstream/pcap.pyx":143 + /* "nfstream/pcap.pyx":162 * DLT_RAW = 14 * else: * DLT_LOOP = 108 # <<<<<<<<<<<<<< * DLT_RAW = 12 - * + * */ - -#line 143 "nfstream/pcap.pyx" /*else*/ { + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_LOOP, __pyx_int_108) < 0) __PYX_ERR(1, 162, __pyx_L1_error) -#line 143 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_LOOP, __pyx_int_108) < 0) __PYX_ERR(1, 143, __pyx_L1_error) - - /* "nfstream/pcap.pyx":144 + /* "nfstream/pcap.pyx":163 * else: * DLT_LOOP = 108 * DLT_RAW = 12 # <<<<<<<<<<<<<< - * + * * PCAP_D_INOUT = 0 */ - -#line 144 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_RAW, __pyx_int_12) < 0) __PYX_ERR(1, 144, __pyx_L1_error) - -#line 144 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DLT_RAW, __pyx_int_12) < 0) __PYX_ERR(1, 163, __pyx_L1_error) } - -#line 144 "nfstream/pcap.pyx" __pyx_L2:; - /* "nfstream/pcap.pyx":146 + /* "nfstream/pcap.pyx":165 * DLT_RAW = 12 - * + * * PCAP_D_INOUT = 0 # <<<<<<<<<<<<<< * PCAP_D_IN = 1 * PCAP_D_OUT = 2 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_D_INOUT, __pyx_int_0) < 0) __PYX_ERR(1, 165, __pyx_L1_error) -#line 146 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_D_INOUT, __pyx_int_0) < 0) __PYX_ERR(1, 146, __pyx_L1_error) - - /* "nfstream/pcap.pyx":147 - * + /* "nfstream/pcap.pyx":166 + * * PCAP_D_INOUT = 0 * PCAP_D_IN = 1 # <<<<<<<<<<<<<< * PCAP_D_OUT = 2 - * + * */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_D_IN, __pyx_int_1) < 0) __PYX_ERR(1, 166, __pyx_L1_error) -#line 147 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_D_IN, __pyx_int_1) < 0) __PYX_ERR(1, 147, __pyx_L1_error) - - /* "nfstream/pcap.pyx":148 + /* "nfstream/pcap.pyx":167 * PCAP_D_INOUT = 0 * PCAP_D_IN = 1 * PCAP_D_OUT = 2 # <<<<<<<<<<<<<< - * + * * PCAP_TSTAMP_PRECISION_MICRO = 0 */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_D_OUT, __pyx_int_2) < 0) __PYX_ERR(1, 167, __pyx_L1_error) -#line 148 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_D_OUT, __pyx_int_2) < 0) __PYX_ERR(1, 148, __pyx_L1_error) - - /* "nfstream/pcap.pyx":150 + /* "nfstream/pcap.pyx":169 * PCAP_D_OUT = 2 - * + * * PCAP_TSTAMP_PRECISION_MICRO = 0 # <<<<<<<<<<<<<< * PCAP_TSTAMP_PRECISION_NANO = 1 - * + * */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_TSTAMP_PRECISION_MICRO, __pyx_int_0) < 0) __PYX_ERR(1, 169, __pyx_L1_error) -#line 150 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_TSTAMP_PRECISION_MICRO, __pyx_int_0) < 0) __PYX_ERR(1, 150, __pyx_L1_error) - - /* "nfstream/pcap.pyx":151 - * + /* "nfstream/pcap.pyx":170 + * * PCAP_TSTAMP_PRECISION_MICRO = 0 * PCAP_TSTAMP_PRECISION_NANO = 1 # <<<<<<<<<<<<<< - * + * * dltoff = { DLT_NULL:4, DLT_EN10MB:14, DLT_IEEE802:22, DLT_ARCNET:6, */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_TSTAMP_PRECISION_NANO, __pyx_int_1) < 0) __PYX_ERR(1, 170, __pyx_L1_error) -#line 151 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCAP_TSTAMP_PRECISION_NANO, __pyx_int_1) < 0) __PYX_ERR(1, 151, __pyx_L1_error) - - /* "nfstream/pcap.pyx":153 + /* "nfstream/pcap.pyx":172 * PCAP_TSTAMP_PRECISION_NANO = 1 - * + * * dltoff = { DLT_NULL:4, DLT_EN10MB:14, DLT_IEEE802:22, DLT_ARCNET:6, # <<<<<<<<<<<<<< * DLT_SLIP:16, DLT_PPP:4, DLT_FDDI:21, DLT_PFLOG:48, DLT_PFSYNC:4, * DLT_LOOP:4, DLT_RAW:0, DLT_LINUX_SLL:16 } */ - -#line 153 "nfstream/pcap.pyx" - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 153 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 153 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_4) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_4) < 0) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_EN10MB); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_14) < 0) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_IEEE802); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_22) < 0) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_ARCNET); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_6) < 0) __PYX_ERR(1, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 153 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_EN10MB); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 153 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_14) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 153 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_IEEE802); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 153 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_22) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 153 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_ARCNET); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 153 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_6) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 153 "nfstream/pcap.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "nfstream/pcap.pyx":154 - * + /* "nfstream/pcap.pyx":173 + * * dltoff = { DLT_NULL:4, DLT_EN10MB:14, DLT_IEEE802:22, DLT_ARCNET:6, * DLT_SLIP:16, DLT_PPP:4, DLT_FDDI:21, DLT_PFLOG:48, DLT_PFSYNC:4, # <<<<<<<<<<<<<< * DLT_LOOP:4, DLT_RAW:0, DLT_LINUX_SLL:16 } - * + * */ - -#line 154 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_SLIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 154, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_SLIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 154 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_16) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_16) < 0) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_PPP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_4) < 0) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_FDDI); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_21) < 0) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_PFLOG); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_48) < 0) __PYX_ERR(1, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_PFSYNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_4) < 0) __PYX_ERR(1, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 154 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_PPP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 154, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 154 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_4) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 154 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_FDDI); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 154, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 154 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_21) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 154 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_PFLOG); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 154, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 154 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_48) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 154 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_PFSYNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 154, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 154 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_4) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 154 "nfstream/pcap.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "nfstream/pcap.pyx":155 + /* "nfstream/pcap.pyx":174 * dltoff = { DLT_NULL:4, DLT_EN10MB:14, DLT_IEEE802:22, DLT_ARCNET:6, * DLT_SLIP:16, DLT_PPP:4, DLT_FDDI:21, DLT_PFLOG:48, DLT_PFSYNC:4, * DLT_LOOP:4, DLT_RAW:0, DLT_LINUX_SLL:16 } # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 155 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_LOOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 155, __pyx_L1_error) - -#line 155 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_LOOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 155 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_4) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 155 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_4) < 0) __PYX_ERR(1, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 155 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_RAW); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 155, __pyx_L1_error) - -#line 155 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_RAW); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 155 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_0) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 155 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_0) < 0) __PYX_ERR(1, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 155 "nfstream/pcap.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_LINUX_SLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 155, __pyx_L1_error) - -#line 155 "nfstream/pcap.pyx" + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_LINUX_SLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - -#line 155 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_16) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 155 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_16) < 0) __PYX_ERR(1, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 155 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dltoff, __pyx_t_1) < 0) __PYX_ERR(1, 153, __pyx_L1_error) - -#line 155 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dltoff, __pyx_t_1) < 0) __PYX_ERR(1, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":163 + /* "nfstream/pcap.pyx":182 * cdef bpf_program fcode - * + * * def __init__(self, char *filter, dlt=DLT_RAW): # <<<<<<<<<<<<<< * if pcap_ex_compile_nopcap(65535, dlt, &self.fcode, filter, 1, 0) < 0: * raise IOError, 'bad filter' */ - -#line 163 "nfstream/pcap.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_RAW); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 163, __pyx_L1_error) - -#line 163 "nfstream/pcap.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DLT_RAW); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 163 "nfstream/pcap.pyx" __pyx_k__3 = __pyx_t_1; - -#line 163 "nfstream/pcap.pyx" __Pyx_GIVEREF(__pyx_t_1); - -#line 163 "nfstream/pcap.pyx" __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":479 + /* "nfstream/pcap.pyx":498 * pcap_close(self.__pcap) - * + * * def ex_name(char *foo): # <<<<<<<<<<<<<< * return pcap_ex_name(foo) - * + * */ - -#line 479 "nfstream/pcap.pyx" - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_1ex_name, NULL, __pyx_n_s_nfstream_pcap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 479, __pyx_L1_error) - -#line 479 "nfstream/pcap.pyx" + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_1ex_name, NULL, __pyx_n_s_nfstream_pcap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 479 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ex_name, __pyx_t_1) < 0) __PYX_ERR(1, 479, __pyx_L1_error) - -#line 479 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ex_name, __pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":482 + /* "nfstream/pcap.pyx":501 * return pcap_ex_name(foo) - * + * * def lookupdev(): # <<<<<<<<<<<<<< * """Return the name of a network device suitable for sniffing.""" * cdef char *p */ - -#line 482 "nfstream/pcap.pyx" - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_3lookupdev, NULL, __pyx_n_s_nfstream_pcap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L1_error) - -#line 482 "nfstream/pcap.pyx" + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_3lookupdev, NULL, __pyx_n_s_nfstream_pcap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 482 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookupdev, __pyx_t_1) < 0) __PYX_ERR(1, 482, __pyx_L1_error) - -#line 482 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookupdev, __pyx_t_1) < 0) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":491 + /* "nfstream/pcap.pyx":510 * return str(p.decode('UTF-8')) - * + * * def findalldevs(): # <<<<<<<<<<<<<< * """Return a list of capture devices.""" * cdef pcap_if_t *devs */ - -#line 491 "nfstream/pcap.pyx" - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_5findalldevs, NULL, __pyx_n_s_nfstream_pcap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error) - -#line 491 "nfstream/pcap.pyx" + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_5findalldevs, NULL, __pyx_n_s_nfstream_pcap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 491 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_findalldevs, __pyx_t_1) < 0) __PYX_ERR(1, 491, __pyx_L1_error) - -#line 491 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_findalldevs, __pyx_t_1) < 0) __PYX_ERR(1, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "nfstream/pcap.pyx":512 + /* "nfstream/pcap.pyx":531 * return retval - * + * * def lookupnet(char *dev): # <<<<<<<<<<<<<< * """ * Return the address and the netmask of a given device */ - -#line 512 "nfstream/pcap.pyx" - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_7lookupnet, NULL, __pyx_n_s_nfstream_pcap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error) - -#line 512 "nfstream/pcap.pyx" + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8nfstream_4pcap_7lookupnet, NULL, __pyx_n_s_nfstream_pcap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - -#line 512 "nfstream/pcap.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookupnet, __pyx_t_1) < 0) __PYX_ERR(1, 512, __pyx_L1_error) - -#line 512 "nfstream/pcap.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookupnet, __pyx_t_1) < 0) __PYX_ERR(1, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "nfstream/pcap.pyx":1 - * import sys # <<<<<<<<<<<<<< - * import struct - * + * # cython: language_level=3 # <<<<<<<<<<<<<< + * # + * # pcap.pyx */ - -#line 1 "nfstream/pcap.pyx" __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - -#line 1 "nfstream/pcap.pyx" __Pyx_GOTREF(__pyx_t_1); - -#line 1 "nfstream/pcap.pyx" if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - -#line 1 "nfstream/pcap.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":207 * info.obj = self - * + * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * + * * def __dealloc__(array self): */ - -#line 207 "View.MemoryView" __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) - -#line 207 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 207 "View.MemoryView" if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 207, __pyx_L1_error) - -#line 207 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 207 "View.MemoryView" PyType_Modified(__pyx_array_type); /* "View.MemoryView":284 * return self.name - * + * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - -#line 284 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) - -#line 284 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 284 "View.MemoryView" __Pyx_XGOTREF(generic); - -#line 284 "View.MemoryView" __Pyx_DECREF_SET(generic, __pyx_t_1); - -#line 284 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 284 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":285 - * + * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") - * + * */ - -#line 285 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) - -#line 285 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 285 "View.MemoryView" __Pyx_XGOTREF(strided); - -#line 285 "View.MemoryView" __Pyx_DECREF_SET(strided, __pyx_t_1); - -#line 285 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 285 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":286 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 286 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) - -#line 286 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 286 "View.MemoryView" __Pyx_XGOTREF(indirect); - -#line 286 "View.MemoryView" __Pyx_DECREF_SET(indirect, __pyx_t_1); - -#line 286 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 286 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":289 - * - * + * + * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") - * + * */ - -#line 289 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) - -#line 289 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 289 "View.MemoryView" __Pyx_XGOTREF(contiguous); - -#line 289 "View.MemoryView" __Pyx_DECREF_SET(contiguous, __pyx_t_1); - -#line 289 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 289 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":290 - * + * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 290 "View.MemoryView" __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) - -#line 290 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 290 "View.MemoryView" __Pyx_XGOTREF(indirect_contiguous); - -#line 290 "View.MemoryView" __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); - -#line 290 "View.MemoryView" __Pyx_GIVEREF(__pyx_t_1); - -#line 290 "View.MemoryView" __pyx_t_1 = 0; /* "View.MemoryView":314 - * + * * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ * PyThread_allocate_lock(), */ - -#line 314 "View.MemoryView" __pyx_memoryview_thread_locks_used = 0; /* "View.MemoryView":315 @@ -42820,78 +22957,40 @@ PyMODINIT_FUNC PyInit_pcap(void) * PyThread_allocate_lock(), * PyThread_allocate_lock(), */ - -#line 315 "View.MemoryView" __pyx_t_4[0] = PyThread_allocate_lock(); - -#line 315 "View.MemoryView" __pyx_t_4[1] = PyThread_allocate_lock(); - -#line 315 "View.MemoryView" __pyx_t_4[2] = PyThread_allocate_lock(); - -#line 315 "View.MemoryView" __pyx_t_4[3] = PyThread_allocate_lock(); - -#line 315 "View.MemoryView" __pyx_t_4[4] = PyThread_allocate_lock(); - -#line 315 "View.MemoryView" __pyx_t_4[5] = PyThread_allocate_lock(); - -#line 315 "View.MemoryView" __pyx_t_4[6] = PyThread_allocate_lock(); - -#line 315 "View.MemoryView" __pyx_t_4[7] = PyThread_allocate_lock(); - -#line 315 "View.MemoryView" memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); /* "View.MemoryView":537 * info.obj = self - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 537 "View.MemoryView" __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) - -#line 537 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 537 "View.MemoryView" if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 537, __pyx_L1_error) - -#line 537 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 537 "View.MemoryView" PyType_Modified(__pyx_memoryview_type); /* "View.MemoryView":983 * return self.from_object - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * + * + * */ - -#line 983 "View.MemoryView" __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) - -#line 983 "View.MemoryView" __Pyx_GOTREF(__pyx_t_1); - -#line 983 "View.MemoryView" if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 983, __pyx_L1_error) - -#line 983 "View.MemoryView" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 983 "View.MemoryView" PyType_Modified(__pyx_memoryviewslice_type); /* "(tree fragment)":1 @@ -42899,17 +22998,9 @@ PyMODINIT_FUNC PyInit_pcap(void) * if __pyx_checksum != 0xb068931: * from pickle import PickleError as __pyx_PickleError */ - -#line 1 "(tree fragment)" __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - -#line 1 "(tree fragment)" __Pyx_GOTREF(__pyx_t_1); - -#line 1 "(tree fragment)" if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - -#line 1 "(tree fragment)" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":9 @@ -42920,77 +23011,29 @@ PyMODINIT_FUNC PyInit_pcap(void) * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" /*--- Wrapped vars code ---*/ -#line 9 "(tree fragment)" - - -#line 9 "(tree fragment)" goto __pyx_L0; - -#line 9 "(tree fragment)" __pyx_L1_error:; - -#line 9 "(tree fragment)" __Pyx_XDECREF(__pyx_t_1); - -#line 9 "(tree fragment)" __Pyx_XDECREF(__pyx_t_2); - -#line 9 "(tree fragment)" if (__pyx_m) { - -#line 9 "(tree fragment)" if (__pyx_d) { - -#line 9 "(tree fragment)" __Pyx_AddTraceback("init nfstream.pcap", 0, __pyx_lineno, __pyx_filename); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" Py_DECREF(__pyx_m); __pyx_m = 0; - -#line 9 "(tree fragment)" } else if (!PyErr_Occurred()) { - -#line 9 "(tree fragment)" PyErr_SetString(PyExc_ImportError, "init nfstream.pcap"); - -#line 9 "(tree fragment)" } - -#line 9 "(tree fragment)" __pyx_L0:; - -#line 9 "(tree fragment)" __Pyx_RefNannyFinishContext(); - -#line 9 "(tree fragment)" #if PY_MAJOR_VERSION < 3 - -#line 9 "(tree fragment)" return; - -#line 9 "(tree fragment)" #else - -#line 9 "(tree fragment)" return __pyx_m; - -#line 9 "(tree fragment)" #endif - -#line 9 "(tree fragment)" } -#line 1 "cython_utility" - /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY @@ -44990,8 +25033,8 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED llx = lla + llb; return PyLong_FromLongLong(llx); #endif - - + + } #endif if (PyFloat_CheckExact(op1)) {