hexsha
stringlengths
40
40
size
int64
22
2.4M
ext
stringclasses
5 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
260
max_stars_repo_name
stringlengths
5
109
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
260
max_issues_repo_name
stringlengths
5
109
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
260
max_forks_repo_name
stringlengths
5
109
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
22
2.4M
avg_line_length
float64
5
169k
max_line_length
int64
5
786k
alphanum_fraction
float64
0.06
0.95
matches
listlengths
1
11
d93ab75c097adc849e3eb61a05ef0a8e8f5feb86
5,003
h
C
include/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.h
Cozdemir/spitfire
0d1713f5f7bd7d5803895a1cc48a97bf27bef9e1
[ "Apache-2.0" ]
null
null
null
include/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.h
Cozdemir/spitfire
0d1713f5f7bd7d5803895a1cc48a97bf27bef9e1
[ "Apache-2.0" ]
null
null
null
include/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.h
Cozdemir/spitfire
0d1713f5f7bd7d5803895a1cc48a97bf27bef9e1
[ "Apache-2.0" ]
null
null
null
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NGInlineLayoutAlgorithm_h #define NGInlineLayoutAlgorithm_h #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" #include "third_party/blink/renderer/platform/fonts/font_baseline.h" #include "third_party/blink/renderer/platform/wtf/vector.h" namespace blink { class NGConstraintSpace; class NGExclusionSpace; class NGInlineBreakToken; class NGInlineChildLayoutContext; class NGInlineNode; class NGInlineItem; class NGInlineLayoutStateStack; class NGLineInfo; struct NGInlineBoxState; struct NGInlineItemResult; // A class for laying out an inline formatting context, i.e. a block with inline // children. // // This class determines the position of NGInlineItem and build line boxes. // // Uses NGLineBreaker to find NGInlineItems to form a line. class CORE_EXPORT NGInlineLayoutAlgorithm final : public NGLayoutAlgorithm<NGInlineNode, NGLineBoxFragmentBuilder, NGInlineBreakToken> { public: NGInlineLayoutAlgorithm(NGInlineNode, const NGConstraintSpace&, const NGInlineBreakToken*, NGInlineChildLayoutContext* context); ~NGInlineLayoutAlgorithm() override; void CreateLine(const NGLineLayoutOpportunity&, NGLineInfo*, NGExclusionSpace*); scoped_refptr<const NGLayoutResult> Layout() override; private: unsigned PositionLeadingFloats(NGExclusionSpace*, NGPositionedFloatVector*); NGPositionedFloat PositionFloat(LayoutUnit origin_block_bfc_offset, LayoutObject* floating_object, NGExclusionSpace*) const; bool IsHorizontalWritingMode() const { return is_horizontal_writing_mode_; } void PrepareBoxStates(const NGLineInfo&, const NGInlineBreakToken*); void RebuildBoxStates(const NGLineInfo&, const NGInlineBreakToken*, NGInlineLayoutStateStack*) const; #if DCHECK_IS_ON() void CheckBoxStates(const NGLineInfo&, const NGInlineBreakToken*) const; #endif NGInlineBoxState* HandleOpenTag(const NGInlineItem&, const NGInlineItemResult&, NGInlineLayoutStateStack*) const; NGInlineBoxState* HandleCloseTag(const NGInlineItem&, const NGInlineItemResult&, NGInlineBoxState*); void BidiReorder(); void PlaceControlItem(const NGInlineItem&, const NGLineInfo&, NGInlineItemResult*, NGInlineBoxState*); void PlaceGeneratedContent(scoped_refptr<const NGPhysicalTextFragment>, UBiDiLevel, NGInlineBoxState*); NGInlineBoxState* PlaceAtomicInline(const NGInlineItem&, const NGLineInfo&, NGInlineItemResult*); void PlaceLayoutResult(NGInlineItemResult*, NGInlineBoxState*, LayoutUnit inline_offset = LayoutUnit()); void PlaceOutOfFlowObjects(const NGLineInfo&, const NGLineHeightMetrics&); void PlaceFloatingObjects(const NGLineInfo&, const NGLineHeightMetrics&, const NGLineLayoutOpportunity&, NGExclusionSpace*); void PlaceListMarker(const NGInlineItem&, NGInlineItemResult*, const NGLineInfo&); LayoutUnit ApplyTextAlign(NGLineInfo*); bool ApplyJustify(LayoutUnit space, NGLineInfo*); LayoutUnit ComputeContentSize(const NGLineInfo&, const NGExclusionSpace&, LayoutUnit line_height); NGLineBoxFragmentBuilder::ChildList line_box_; NGInlineLayoutStateStack* box_states_; NGInlineChildLayoutContext* context_; FontBaseline baseline_type_ = FontBaseline::kAlphabeticBaseline; unsigned is_horizontal_writing_mode_ : 1; unsigned quirks_mode_ : 1; #if DCHECK_IS_ON() // True if |box_states_| is taken from |context_|, to check the |box_states_| // is the same as when it is rebuilt. bool is_box_states_from_context_ = false; #endif }; } // namespace blink #endif // NGInlineLayoutAlgorithm_h
39.393701
90
0.674795
[ "vector" ]
d93af24ea1e9c88b0430ae627a95faed2617e2c2
2,243
c
C
gempak/source/cgemlib/cvg/cvgplaced.c
oxelson/gempak
e7c477814d7084c87d3313c94e192d13d8341fa1
[ "BSD-3-Clause" ]
42
2015-06-03T15:26:21.000Z
2022-02-28T22:36:03.000Z
gempak/source/cgemlib/cvg/cvgplaced.c
oxelson/gempak
e7c477814d7084c87d3313c94e192d13d8341fa1
[ "BSD-3-Clause" ]
60
2015-05-11T21:36:08.000Z
2022-03-29T16:22:42.000Z
gempak/source/cgemlib/cvg/cvgplaced.c
oxelson/gempak
e7c477814d7084c87d3313c94e192d13d8341fa1
[ "BSD-3-Clause" ]
27
2016-06-06T21:55:14.000Z
2022-03-18T18:23:28.000Z
#include "cvgcmn.h" Boolean cvg_placed(int elpos, VG_DBStruct *el) /***************************************************************************** * cvg_placed * * Use the file offset and contents of the VG element and check if the * object is placed, or anything that its a reference to is placed * * Input parameters: * elpos int File offset for the VG element * *el VG_DBStruct VG element to check * * Output parameters: * None * * Return value: * Boolean FALSE if anything is not placed, * TRUE if everything is placed ** * Log: * S.Danz/AWC 3/06 Created ****************************************************************************/ { int result, placed, iret, unplaced_found; Handle id, ref; Placement place; /*---------------------------------------------------------------------*/ result = 0; if (cvg_metadata && cvg_placements) { id = cvg_el2hndl(elpos, el, &iret); /* * First see if we are in CAP and if we have been placed */ cap_psgetpl(cvg_placements, id, &place, &iret); if (place) { cap_plgetplaced(place, &placed, &iret); if (placed) { result = 1; } } /* * Then see if we are a reference, and if we are, if our * objects are placed */ if (!result) { unplaced_found = 0; cap_psiterinit(cvg_placements, &iret); cap_psiternext(cvg_placements, &place, &iret); while (place) { cap_plgetref(place, &ref, &iret); if (ref == id) { cap_plgetplaced(place, &placed, &iret); if (placed) { result = 1; } else { unplaced_found = 1; } } cap_psiternext(cvg_placements, &place, &iret); } /* * If we find anything non placed, then the result should be 0 */ if (unplaced_found) { result = 0; } } } return result; }
29.12987
78
0.432457
[ "object" ]
d93deadd05ddeee976ff19936bf610c44cd276f0
878
h
C
Bachelorarbeit/HelpFunctions.h
julievrnt/Photon-Path-Simulation-in-Volumetric-Data-Sets
1b7fa6eebac50da9028ac40b6f85cf801a93bc8f
[ "MIT" ]
null
null
null
Bachelorarbeit/HelpFunctions.h
julievrnt/Photon-Path-Simulation-in-Volumetric-Data-Sets
1b7fa6eebac50da9028ac40b6f85cf801a93bc8f
[ "MIT" ]
null
null
null
Bachelorarbeit/HelpFunctions.h
julievrnt/Photon-Path-Simulation-in-Volumetric-Data-Sets
1b7fa6eebac50da9028ac40b6f85cf801a93bc8f
[ "MIT" ]
null
null
null
#pragma once #ifndef HELPFUNCTIONS_H #define HELPFUNCTIONS_H #include <ctime> #include <cstdlib> #include <Eigen/Dense> #include <sstream> #include <vector> #include <string> #include <iostream> #include <math.h> #include <random> #include <chrono> using namespace std; void toString(vector<float>& a); float hgFunction(float teta); float hgInverseFunction(float xi); float rayleighFunction(float teta); float rayleighInverseFunction(float xi); float rayleighCoefficient(float n, float d, float lambda); Eigen::Vector3f randomPoint(float z_max); bool operator<=(Eigen::Vector3f a, Eigen::Vector3f b); bool operator>=(Eigen::Vector3f a, Eigen::Vector3f b); int getIndex(vector<float>& a, float k); Eigen::Matrix3f rotateX(float angle); Eigen::Matrix3f rotateY(float angle); Eigen::Matrix3f rotateZ(float angle); #endif
19.954545
59
0.719818
[ "vector" ]
d94097bc8c6c1688f9d2b3238dcdb7858c2e6ad9
13,256
h
C
aws-cpp-sdk-sagemaker/include/aws/sagemaker/model/DescribeContextResult.h
perfectrecall/aws-sdk-cpp
fb8cbebf2fd62720b65aeff841ad2950e73d8ebd
[ "Apache-2.0" ]
1
2022-02-12T08:09:30.000Z
2022-02-12T08:09:30.000Z
aws-cpp-sdk-sagemaker/include/aws/sagemaker/model/DescribeContextResult.h
perfectrecall/aws-sdk-cpp
fb8cbebf2fd62720b65aeff841ad2950e73d8ebd
[ "Apache-2.0" ]
1
2022-01-03T23:59:37.000Z
2022-01-03T23:59:37.000Z
aws-cpp-sdk-sagemaker/include/aws/sagemaker/model/DescribeContextResult.h
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-12-30T04:25:33.000Z
2021-12-30T04:25:33.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/sagemaker/SageMaker_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/sagemaker/model/ContextSource.h> #include <aws/core/utils/memory/stl/AWSMap.h> #include <aws/core/utils/DateTime.h> #include <aws/sagemaker/model/UserContext.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace SageMaker { namespace Model { class AWS_SAGEMAKER_API DescribeContextResult { public: DescribeContextResult(); DescribeContextResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DescribeContextResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The name of the context.</p> */ inline const Aws::String& GetContextName() const{ return m_contextName; } /** * <p>The name of the context.</p> */ inline void SetContextName(const Aws::String& value) { m_contextName = value; } /** * <p>The name of the context.</p> */ inline void SetContextName(Aws::String&& value) { m_contextName = std::move(value); } /** * <p>The name of the context.</p> */ inline void SetContextName(const char* value) { m_contextName.assign(value); } /** * <p>The name of the context.</p> */ inline DescribeContextResult& WithContextName(const Aws::String& value) { SetContextName(value); return *this;} /** * <p>The name of the context.</p> */ inline DescribeContextResult& WithContextName(Aws::String&& value) { SetContextName(std::move(value)); return *this;} /** * <p>The name of the context.</p> */ inline DescribeContextResult& WithContextName(const char* value) { SetContextName(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the context.</p> */ inline const Aws::String& GetContextArn() const{ return m_contextArn; } /** * <p>The Amazon Resource Name (ARN) of the context.</p> */ inline void SetContextArn(const Aws::String& value) { m_contextArn = value; } /** * <p>The Amazon Resource Name (ARN) of the context.</p> */ inline void SetContextArn(Aws::String&& value) { m_contextArn = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the context.</p> */ inline void SetContextArn(const char* value) { m_contextArn.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the context.</p> */ inline DescribeContextResult& WithContextArn(const Aws::String& value) { SetContextArn(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the context.</p> */ inline DescribeContextResult& WithContextArn(Aws::String&& value) { SetContextArn(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the context.</p> */ inline DescribeContextResult& WithContextArn(const char* value) { SetContextArn(value); return *this;} /** * <p>The source of the context.</p> */ inline const ContextSource& GetSource() const{ return m_source; } /** * <p>The source of the context.</p> */ inline void SetSource(const ContextSource& value) { m_source = value; } /** * <p>The source of the context.</p> */ inline void SetSource(ContextSource&& value) { m_source = std::move(value); } /** * <p>The source of the context.</p> */ inline DescribeContextResult& WithSource(const ContextSource& value) { SetSource(value); return *this;} /** * <p>The source of the context.</p> */ inline DescribeContextResult& WithSource(ContextSource&& value) { SetSource(std::move(value)); return *this;} /** * <p>The type of the context.</p> */ inline const Aws::String& GetContextType() const{ return m_contextType; } /** * <p>The type of the context.</p> */ inline void SetContextType(const Aws::String& value) { m_contextType = value; } /** * <p>The type of the context.</p> */ inline void SetContextType(Aws::String&& value) { m_contextType = std::move(value); } /** * <p>The type of the context.</p> */ inline void SetContextType(const char* value) { m_contextType.assign(value); } /** * <p>The type of the context.</p> */ inline DescribeContextResult& WithContextType(const Aws::String& value) { SetContextType(value); return *this;} /** * <p>The type of the context.</p> */ inline DescribeContextResult& WithContextType(Aws::String&& value) { SetContextType(std::move(value)); return *this;} /** * <p>The type of the context.</p> */ inline DescribeContextResult& WithContextType(const char* value) { SetContextType(value); return *this;} /** * <p>The description of the context.</p> */ inline const Aws::String& GetDescription() const{ return m_description; } /** * <p>The description of the context.</p> */ inline void SetDescription(const Aws::String& value) { m_description = value; } /** * <p>The description of the context.</p> */ inline void SetDescription(Aws::String&& value) { m_description = std::move(value); } /** * <p>The description of the context.</p> */ inline void SetDescription(const char* value) { m_description.assign(value); } /** * <p>The description of the context.</p> */ inline DescribeContextResult& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** * <p>The description of the context.</p> */ inline DescribeContextResult& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** * <p>The description of the context.</p> */ inline DescribeContextResult& WithDescription(const char* value) { SetDescription(value); return *this;} /** * <p>A list of the context's properties.</p> */ inline const Aws::Map<Aws::String, Aws::String>& GetProperties() const{ return m_properties; } /** * <p>A list of the context's properties.</p> */ inline void SetProperties(const Aws::Map<Aws::String, Aws::String>& value) { m_properties = value; } /** * <p>A list of the context's properties.</p> */ inline void SetProperties(Aws::Map<Aws::String, Aws::String>&& value) { m_properties = std::move(value); } /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& WithProperties(const Aws::Map<Aws::String, Aws::String>& value) { SetProperties(value); return *this;} /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& WithProperties(Aws::Map<Aws::String, Aws::String>&& value) { SetProperties(std::move(value)); return *this;} /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& AddProperties(const Aws::String& key, const Aws::String& value) { m_properties.emplace(key, value); return *this; } /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& AddProperties(Aws::String&& key, const Aws::String& value) { m_properties.emplace(std::move(key), value); return *this; } /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& AddProperties(const Aws::String& key, Aws::String&& value) { m_properties.emplace(key, std::move(value)); return *this; } /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& AddProperties(Aws::String&& key, Aws::String&& value) { m_properties.emplace(std::move(key), std::move(value)); return *this; } /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& AddProperties(const char* key, Aws::String&& value) { m_properties.emplace(key, std::move(value)); return *this; } /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& AddProperties(Aws::String&& key, const char* value) { m_properties.emplace(std::move(key), value); return *this; } /** * <p>A list of the context's properties.</p> */ inline DescribeContextResult& AddProperties(const char* key, const char* value) { m_properties.emplace(key, value); return *this; } /** * <p>When the context was created.</p> */ inline const Aws::Utils::DateTime& GetCreationTime() const{ return m_creationTime; } /** * <p>When the context was created.</p> */ inline void SetCreationTime(const Aws::Utils::DateTime& value) { m_creationTime = value; } /** * <p>When the context was created.</p> */ inline void SetCreationTime(Aws::Utils::DateTime&& value) { m_creationTime = std::move(value); } /** * <p>When the context was created.</p> */ inline DescribeContextResult& WithCreationTime(const Aws::Utils::DateTime& value) { SetCreationTime(value); return *this;} /** * <p>When the context was created.</p> */ inline DescribeContextResult& WithCreationTime(Aws::Utils::DateTime&& value) { SetCreationTime(std::move(value)); return *this;} inline const UserContext& GetCreatedBy() const{ return m_createdBy; } inline void SetCreatedBy(const UserContext& value) { m_createdBy = value; } inline void SetCreatedBy(UserContext&& value) { m_createdBy = std::move(value); } inline DescribeContextResult& WithCreatedBy(const UserContext& value) { SetCreatedBy(value); return *this;} inline DescribeContextResult& WithCreatedBy(UserContext&& value) { SetCreatedBy(std::move(value)); return *this;} /** * <p>When the context was last modified.</p> */ inline const Aws::Utils::DateTime& GetLastModifiedTime() const{ return m_lastModifiedTime; } /** * <p>When the context was last modified.</p> */ inline void SetLastModifiedTime(const Aws::Utils::DateTime& value) { m_lastModifiedTime = value; } /** * <p>When the context was last modified.</p> */ inline void SetLastModifiedTime(Aws::Utils::DateTime&& value) { m_lastModifiedTime = std::move(value); } /** * <p>When the context was last modified.</p> */ inline DescribeContextResult& WithLastModifiedTime(const Aws::Utils::DateTime& value) { SetLastModifiedTime(value); return *this;} /** * <p>When the context was last modified.</p> */ inline DescribeContextResult& WithLastModifiedTime(Aws::Utils::DateTime&& value) { SetLastModifiedTime(std::move(value)); return *this;} inline const UserContext& GetLastModifiedBy() const{ return m_lastModifiedBy; } inline void SetLastModifiedBy(const UserContext& value) { m_lastModifiedBy = value; } inline void SetLastModifiedBy(UserContext&& value) { m_lastModifiedBy = std::move(value); } inline DescribeContextResult& WithLastModifiedBy(const UserContext& value) { SetLastModifiedBy(value); return *this;} inline DescribeContextResult& WithLastModifiedBy(UserContext&& value) { SetLastModifiedBy(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the lineage group.</p> */ inline const Aws::String& GetLineageGroupArn() const{ return m_lineageGroupArn; } /** * <p>The Amazon Resource Name (ARN) of the lineage group.</p> */ inline void SetLineageGroupArn(const Aws::String& value) { m_lineageGroupArn = value; } /** * <p>The Amazon Resource Name (ARN) of the lineage group.</p> */ inline void SetLineageGroupArn(Aws::String&& value) { m_lineageGroupArn = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the lineage group.</p> */ inline void SetLineageGroupArn(const char* value) { m_lineageGroupArn.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the lineage group.</p> */ inline DescribeContextResult& WithLineageGroupArn(const Aws::String& value) { SetLineageGroupArn(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the lineage group.</p> */ inline DescribeContextResult& WithLineageGroupArn(Aws::String&& value) { SetLineageGroupArn(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the lineage group.</p> */ inline DescribeContextResult& WithLineageGroupArn(const char* value) { SetLineageGroupArn(value); return *this;} private: Aws::String m_contextName; Aws::String m_contextArn; ContextSource m_source; Aws::String m_contextType; Aws::String m_description; Aws::Map<Aws::String, Aws::String> m_properties; Aws::Utils::DateTime m_creationTime; UserContext m_createdBy; Aws::Utils::DateTime m_lastModifiedTime; UserContext m_lastModifiedBy; Aws::String m_lineageGroupArn; }; } // namespace Model } // namespace SageMaker } // namespace Aws
31.788969
161
0.650875
[ "model" ]
d9448218a874feb23406c8aa870122a6e2699db6
1,000
h
C
src/daemon_stereo.h
dzyswy/ptz-utils
3b1052dc804f8168ec5a1c2206af35ae00df95d8
[ "MIT" ]
null
null
null
src/daemon_stereo.h
dzyswy/ptz-utils
3b1052dc804f8168ec5a1c2206af35ae00df95d8
[ "MIT" ]
null
null
null
src/daemon_stereo.h
dzyswy/ptz-utils
3b1052dc804f8168ec5a1c2206af35ae00df95d8
[ "MIT" ]
null
null
null
#include <iostream> #include <thread> #include <mutex> #include <condition_variable> #include "stereo_sensor.h" class daemon_stereo { public: daemon_stereo(); int connect_device(const char *ip, int stream_port, int cmd_port, int stream_mode); int disconnect_device(); int set_detect_mode(int value); int get_frame(vector<unsigned char> &image, int timeout = -5); int get_detect_boxes(vector<struct http_output_detect_box> &detect_boxes, int timeout = -5); int get_point_space_status(int x, int y, struct point_space_status &status); int get_connect_state(); int get_reconnect_count(); void stream_process(); protected: stereo_sensor *sensor_; string ip_; int stream_port_; int cmd_port_; int stream_mode_; int reconnect_count_; int detect_mode_; vector<unsigned char> frame_buffer_; vector<struct http_output_detect_box> detect_boxes_; int going; std::mutex mux_; std::condition_variable cond_; std::thread *stream_thread_; };
13.69863
93
0.742
[ "vector" ]
d94941126578677b0fc798a4bc43174e6bc8e3a4
53,060
c
C
php5/php_event.c
remicollet/event
f204ed782d94327535feb6de835a247d4b7958d6
[ "PHP-3.01" ]
null
null
null
php5/php_event.c
remicollet/event
f204ed782d94327535feb6de835a247d4b7958d6
[ "PHP-3.01" ]
null
null
null
php5/php_event.c
remicollet/event
f204ed782d94327535feb6de835a247d4b7958d6
[ "PHP-3.01" ]
null
null
null
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2020 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Ruslan Osmanov <osmanov@php.net> | +----------------------------------------------------------------------+ */ #include "src/common.h" #include "src/util.h" #include "src/priv.h" #include "classes/http.h" #include "zend_exceptions.h" #if 0 ZEND_DECLARE_MODULE_GLOBALS(event) static PHP_GINIT_FUNCTION(event); #endif extern const zend_property_info event_listener_property_entry_info[]; extern const php_event_property_entry_t event_listener_property_entries[]; zend_class_entry *php_event_ce; zend_class_entry *php_event_base_ce; zend_class_entry *php_event_config_ce; zend_class_entry *php_event_bevent_ce; zend_class_entry *php_event_buffer_ce; zend_class_entry *php_event_util_ce; #ifdef HAVE_EVENT_OPENSSL_LIB zend_class_entry *php_event_ssl_context_ce; #endif #ifdef HAVE_EVENT_EXTRA_LIB zend_class_entry *php_event_dns_base_ce; zend_class_entry *php_event_listener_ce; zend_class_entry *php_event_http_conn_ce; zend_class_entry *php_event_http_ce; zend_class_entry *php_event_http_req_ce; #endif static zend_class_entry *spl_ce_RuntimeException; zend_class_entry *php_event_exception_ce; static HashTable classes; static HashTable event_properties; static HashTable event_bevent_properties; static HashTable event_buffer_properties; static HashTable event_listener_properties; #ifdef HAVE_EVENT_OPENSSL_LIB static HashTable event_ssl_context_properties; int php_event_ssl_data_index; #endif static zend_object_handlers object_handlers; static const zend_module_dep event_deps[] = { #ifdef PHP_EVENT_SOCKETS_SUPPORT ZEND_MOD_REQUIRED("sockets") #endif {NULL, NULL, NULL} }; /* {{{ event_module_entry */ zend_module_entry event_module_entry = { #if ZEND_MODULE_API_NO >= 20050922 STANDARD_MODULE_HEADER_EX, NULL, event_deps, #elif ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, #endif "event", NULL, /*event_functions*/ PHP_MINIT(event), PHP_MSHUTDOWN(event), NULL, NULL, PHP_MINFO(event), #if ZEND_MODULE_API_NO >= 20010901 PHP_EVENT_VERSION, #endif #if 0 PHP_MODULE_GLOBALS(event), PHP_GINIT(event), NULL, NULL, STANDARD_MODULE_PROPERTIES_EX, #endif STANDARD_MODULE_PROPERTIES }; /* }}} */ #ifdef COMPILE_DL_EVENT ZEND_GET_MODULE(event) #endif zend_class_entry *php_event_get_exception(void)/*{{{*/ { return php_event_exception_ce; }/*}}}*/ zend_class_entry *php_event_get_exception_base(int root TSRMLS_DC)/*{{{*/ { #if can_handle_soft_dependency_on_SPL && defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1)) if (!root) { if (!spl_ce_RuntimeException) { zend_class_entry **pce; if (zend_hash_find(CG(class_table), "runtimeexception", sizeof("RuntimeException"), (void **) &pce) == SUCCESS) { spl_ce_RuntimeException = *pce; return *pce; } } else { return spl_ce_RuntimeException; } } #endif #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 2) return zend_exception_get_default(); #else return zend_exception_get_default(TSRMLS_C); #endif }/*}}}*/ /* {{{ Private functions */ static void event_http_conn_object_dtor(void *object, zend_object_handle handle TSRMLS_DC)/*{{{*/ { php_event_http_conn_t *evcon = (php_event_http_conn_t *) object; PHP_EVENT_ASSERT(evcon); if (evcon->self) { zval_ptr_dtor(&evcon->self); evcon->self = NULL; } if (evcon->data_closecb) { zval_ptr_dtor(&evcon->data_closecb); evcon->data_closecb = NULL; } if (evcon->base) { zval_ptr_dtor(&evcon->base); evcon->base = NULL; } if (evcon->dns_base) { zval_ptr_dtor(&evcon->dns_base); evcon->dns_base = NULL; } zend_objects_destroy_object(object, handle TSRMLS_CC); }/*}}}*/ static void event_bevent_object_dtor(void *object, zend_object_handle handle TSRMLS_DC)/*{{{*/ { php_event_bevent_t *b = (php_event_bevent_t *) object; if (b) { if (b->data) { zval_ptr_dtor(&b->data); b->data = NULL; } PHP_EVENT_FREE_FCALL_INFO(b->fci_read, b->fcc_read); PHP_EVENT_FREE_FCALL_INFO(b->fci_write, b->fcc_write); PHP_EVENT_FREE_FCALL_INFO(b->fci_event, b->fcc_event); /* XXX */ if (b->self) { zval_ptr_dtor(&b->self); b->self = NULL; } if (b->base) { zval_ptr_dtor(&b->base); b->base = NULL; } if (b->input) { zval_ptr_dtor(&b->input); b->input = NULL; } if (b->output) { zval_ptr_dtor(&b->output); b->output= NULL; } } zend_objects_destroy_object(object, handle TSRMLS_CC); }/*}}}*/ /* {{{ event_generic_object_free_storage */ static zend_always_inline void event_generic_object_free_storage(void *ptr TSRMLS_DC) { php_event_abstract_object_t *obj; PHP_EVENT_ASSERT(ptr); obj = (php_event_abstract_object_t *) ptr; zend_object_std_dtor(&obj->zo TSRMLS_CC); efree(ptr); } /* }}} */ /* {{{ event_object_free_storage */ static void event_object_free_storage(void *ptr TSRMLS_DC) { php_event_t *e = (php_event_t *) ptr; PHP_EVENT_ASSERT(e); if (e->event) { /* No need in * event_del(e->event); * since event_free makes event non-pending internally */ event_free(e->event); e->event = NULL; } if (e->stream_id >= 0) { /* stdin fd == 0 */ zend_list_delete(e->stream_id); e->stream_id = -1; } if (e->data) { zval_ptr_dtor(&e->data); e->data = NULL; } PHP_EVENT_FREE_FCALL_INFO(e->fci, e->fcc); event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ /* {{{ event_base_object_free_storage */ static void event_base_object_free_storage(void *ptr TSRMLS_DC) { php_event_base_t *b = (php_event_base_t *) ptr; PHP_EVENT_ASSERT(b); if (!b->internal && b->base) { event_base_loopexit(b->base, NULL); event_base_free(b->base); b->base = NULL; } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ /* {{{ event_config_object_free_storage*/ static void event_config_object_free_storage(void *ptr TSRMLS_DC) { php_event_config_t *cfg = (php_event_config_t *) ptr; PHP_EVENT_ASSERT(cfg); if (cfg->ptr) { event_config_free(cfg->ptr); } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ /* {{{ event_bevent_object_free_storage */ static void event_bevent_object_free_storage(void *ptr TSRMLS_DC) { php_event_bevent_t *b = (php_event_bevent_t *) ptr; if (b) { #if 0 if (b->data) { zval_ptr_dtor(&b->data); b->data = NULL; } /* XXX */ if (b->self) { zval_ptr_dtor(&b->self); b->self = NULL; } if (b->base) { zval_ptr_dtor(&b->base); b->base = NULL; } if (b->input) { zval_ptr_dtor(&b->input); b->input = NULL; } if (b->output) { zval_ptr_dtor(&b->output); b->output= NULL; } #endif if (b->bevent) { bufferevent_free(b->bevent); b->bevent = NULL; } } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ /* {{{ event_buffer_object_free_storage */ static void event_buffer_object_free_storage(void *ptr TSRMLS_DC) { php_event_buffer_t *b = (php_event_buffer_t *) ptr; PHP_EVENT_ASSERT(b); /* If we got the buffer in, say, a read callback the buffer * is destroyed when the callback is done as any normal variable. * Zend MM calls destructor which eventually calls this function. * We'll definitely crash, if we call evbuffer_free() on an internal * bufferevent buffer. */ if (!b->internal && b->buf) { evbuffer_free(b->buf); } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ #ifdef HAVE_EVENT_EXTRA_LIB /* {{{ event_dns_base_object_free_storage */ static void event_dns_base_object_free_storage(void *ptr TSRMLS_DC) { php_event_dns_base_t *dnsb = (php_event_dns_base_t *) ptr; PHP_EVENT_ASSERT(dnsb); if (dnsb->dns_base) { /* Setting fail_requests to 1 makes all in-flight requests get * their callbacks invoked with a canceled error code before it * frees the base*/ evdns_base_free(dnsb->dns_base, 1); } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ /* {{{ event_listener_object_free_storage */ static void event_listener_object_free_storage(void *ptr TSRMLS_DC) { php_event_listener_t *l = (php_event_listener_t *) ptr; PHP_EVENT_ASSERT(l); if (l->data) { zval_ptr_dtor(&l->data); l->data = NULL; } if (l->self) { zval_ptr_dtor(&l->self); l->self = NULL; } PHP_EVENT_FREE_FCALL_INFO(l->fci, l->fcc); PHP_EVENT_FREE_FCALL_INFO(l->fci_err, l->fcc_err); if (l->listener) { evconnlistener_free(l->listener); l->listener = NULL; } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ /* {{{ event_http_conn_object_free_storage */ static void event_http_conn_object_free_storage(void *ptr TSRMLS_DC) { php_event_http_conn_t *evcon = (php_event_http_conn_t *) ptr; PHP_EVENT_ASSERT(evcon); PHP_EVENT_FREE_FCALL_INFO(evcon->fci_closecb, evcon->fcc_closecb); #if 0 if (Z_REFCOUNT_P(evcon->self) > 1) { zval_ptr_dtor(&evcon->self); evcon->self = NULL; } if (evcon->data_closecb) { zval_ptr_dtor(&evcon->data_closecb); evcon->data_closecb = NULL; } if (evcon->base) { zval_ptr_dtor(&evcon->base); evcon->base = NULL; } if (evcon->dns_base) { zval_ptr_dtor(&evcon->dns_base); evcon->dns_base = NULL; } #endif if (!evcon->internal && evcon->conn) { evhttp_connection_free(evcon->conn); evcon->conn = NULL; } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ /* {{{ event_http_object_free_storage */ static void event_http_object_free_storage(void *ptr TSRMLS_DC) { php_event_http_t *http = (php_event_http_t *) ptr; php_event_http_cb_t *cb, *cb_next; PHP_EVENT_ASSERT(http); PHP_EVENT_FREE_FCALL_INFO(http->fci, http->fcc); /* Free attached callbacks */ /*PHP_EVENT_ASSERT(http->cb_head);*/ cb = http->cb_head; while (cb) { cb_next = cb->next; _php_event_free_http_cb(cb); cb = cb_next; } if (http->data) { zval_ptr_dtor(&http->data); http->data = NULL; } if (http->base) { zval_ptr_dtor(&http->base); http->base = NULL; } if (http->ptr) { evhttp_free(http->ptr); http->ptr = NULL; } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ /* {{{ event_http_req_object_free_storage */ static void event_http_req_object_free_storage(void *ptr TSRMLS_DC) { php_event_http_req_t *http_req = (php_event_http_req_t *) ptr; PHP_EVENT_ASSERT(http_req); PHP_EVENT_FREE_FCALL_INFO(http_req->fci, http_req->fcc); if (http_req->self) { zval_ptr_dtor(&http_req->self); http_req->self = NULL; } if (http_req->data) { zval_ptr_dtor(&http_req->data); http_req->data = NULL; } #if 0 /* Libevent cleans up http_req->ptr despite the ownership of the pointer (evhttp_request_own()). So we'll get SEGFAULT here if we call evhttp_request_free(). */ if (!http_req->internal && http_req->ptr) { evhttp_request_free(http_req->ptr); http_req->ptr = NULL; } #endif event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ #endif /* HAVE_EVENT_EXTRA_LIB */ #ifdef HAVE_EVENT_OPENSSL_LIB /* {{{ event_ssl_context_object_free_storage */ static void event_ssl_context_object_free_storage(void *ptr TSRMLS_DC) { php_event_ssl_context_t *ectx = (php_event_ssl_context_t *) ptr; if (ectx->ctx) { SSL_CTX_free(ectx->ctx); ectx->ctx = NULL; } if (ectx->ht) { zend_hash_destroy(ectx->ht); FREE_HASHTABLE(ectx->ht); ectx->ht = NULL; } event_generic_object_free_storage(ptr TSRMLS_CC); } /* }}} */ #endif /* {{{ register_object */ static zend_always_inline zend_object_value register_object(zend_class_entry *ce, void *obj, zend_objects_store_dtor_t func_dtor, zend_objects_free_object_storage_t func_free_storage TSRMLS_DC) { zend_object_value retval; retval.handle = zend_objects_store_put(obj, func_dtor, func_free_storage, NULL TSRMLS_CC); retval.handlers = &object_handlers; return retval; } /* }}} */ /* {{{ object_new * Allocates new object with it's properties. * size is a size of struct implementing php_event_abstract_object_t */ static void *object_new(zend_class_entry *ce, size_t size TSRMLS_DC) { php_event_abstract_object_t *obj; zend_class_entry *ce_parent = ce; obj = ecalloc(1, size); while (ce_parent->type != ZEND_INTERNAL_CLASS && ce_parent->parent != NULL) { ce_parent = ce_parent->parent; } zend_hash_find(&classes, ce_parent->name, ce_parent->name_length + 1, (void **) &obj->prop_handler); zend_object_std_init(&obj->zo, ce TSRMLS_CC); object_properties_init(&obj->zo, ce); return (void *) obj; } /* }}} */ /* {{{ event_object_create * Event object ctor */ static zend_object_value event_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_base_object_create * EventBase object ctor */ static zend_object_value event_base_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_base_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_base_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_config_object_create * EventConfig object ctor */ static zend_object_value event_config_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_config_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_config_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_bevent_object_create * EventBufferEvent object ctor */ static zend_object_value event_bevent_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_bevent_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) event_bevent_object_dtor, event_bevent_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_buffer_object_create * EventBuffer object ctor */ static zend_object_value event_buffer_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_buffer_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_buffer_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_util_object_create * EventUtil object ctor */ static zend_object_value event_util_object_create(zend_class_entry *ce TSRMLS_DC) { #if 0 php_event_abstract_object_t *obj; /* EventUtil is a singleton. This function must never be called */ PHP_EVENT_ASSERT(0); obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_abstract_object_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_generic_object_free_storage TSRMLS_CC); #endif zend_object *object; zend_object_value value; value = zend_objects_new(&object, ce TSRMLS_CC); value.handlers = zend_get_std_object_handlers(); object_properties_init(object, ce); return value; } /* }}} */ #ifdef HAVE_EVENT_OPENSSL_LIB /* {{{ event_ssl_context_object_create * EventSslContext object ctor */ static zend_object_value event_ssl_context_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_ssl_context_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_ssl_context_object_free_storage TSRMLS_CC); } /* }}} */ #endif #if HAVE_EVENT_EXTRA_LIB /* {{{ event_dns_base_object_create * EventDnsBase object ctor */ static zend_object_value event_dns_base_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_dns_base_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_dns_base_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_listener_object_create * EventListener object ctor */ static zend_object_value event_listener_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_listener_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_listener_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_http_conn_object_create * EventHttpConnection object ctor */ static zend_object_value event_http_conn_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_http_conn_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) event_http_conn_object_dtor, event_http_conn_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_http_object_create * EventHttp object ctor */ static zend_object_value event_http_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_http_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_http_object_free_storage TSRMLS_CC); } /* }}} */ /* {{{ event_http_req_object_create * EventHttpRequest object ctor */ static zend_object_value event_http_req_object_create(zend_class_entry *ce TSRMLS_DC) { php_event_abstract_object_t *obj = (php_event_abstract_object_t *) object_new(ce, sizeof(php_event_http_req_t) TSRMLS_CC); return register_object(ce, (void *) obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, event_http_req_object_free_storage TSRMLS_CC); } /* }}} */ #endif /* HAVE_EVENT_EXTRA_LIB */ /* {{{ fatal_error_cb * Is called when Libevent detects a non-recoverable internal error. */ static void fatal_error_cb(int err) { TSRMLS_FETCH(); php_error_docref(NULL TSRMLS_CC, E_ERROR, "libevent detected a non-recoverable internal error, code: %d", err); } /* }}} */ #if LIBEVENT_VERSION_NUMBER < 0x02001900 # define PHP_EVENT_LOG_CONST(name) _ ## name #else # define PHP_EVENT_LOG_CONST(name) name #endif /* {{{ log_cb * Overrides libevent's default error logging(it logs to stderr) */ static void log_cb(int severity, const char *msg) { int error_type; /* TSRMLS_FETCH consumes a fair amount of resources. But a ready-to-use * program shouldn't get any error logs. Nevertheless, we have no other way * to fetch TSRMLS. */ TSRMLS_FETCH(); switch (severity) { case PHP_EVENT_LOG_CONST(EVENT_LOG_DEBUG): error_type = E_STRICT; case PHP_EVENT_LOG_CONST(EVENT_LOG_MSG): error_type = E_NOTICE; case PHP_EVENT_LOG_CONST(EVENT_LOG_WARN): error_type = E_WARNING; case PHP_EVENT_LOG_CONST(EVENT_LOG_ERR): error_type = E_ERROR; default: error_type = E_NOTICE; } php_error_docref(NULL TSRMLS_CC, error_type, "%s", msg); } /* }}} */ /* {{{ read_property_default */ static int read_property_default(php_event_abstract_object_t *obj, zval **retval TSRMLS_DC) { *retval = NULL; php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot read property"); return FAILURE; } /* }}} */ /* {{{ write_property_default */ static int write_property_default(php_event_abstract_object_t *obj, zval *newval TSRMLS_DC) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot write property"); return FAILURE; } /* }}} */ /* {{{ add_property */ static void add_property(HashTable *h, const char *name, size_t name_len, php_event_prop_read_t read_func, php_event_prop_write_t write_func, php_event_prop_get_prop_ptr_ptr_t get_ptr_ptr_func TSRMLS_DC) { php_event_prop_handler_t p; p.name = (char *) name; p.name_len = name_len; p.read_func = (read_func) ? read_func : read_property_default; p.write_func = (write_func) ? write_func: write_property_default; p.get_ptr_ptr_func = get_ptr_ptr_func; zend_hash_add(h, name, name_len + 1, &p, sizeof(php_event_prop_handler_t), NULL); } /* }}} */ /* {{{ read_property */ static zval *read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) { zval tmp_member; zval *retval; php_event_abstract_object_t *obj; php_event_prop_handler_t *hnd; int ret; ret = FAILURE; obj = (php_event_abstract_object_t *) zend_objects_get_address(object TSRMLS_CC); if (member->type != IS_STRING) { tmp_member = *member; zval_copy_ctor(&tmp_member); convert_to_string(&tmp_member); member = &tmp_member; } if (obj->prop_handler != NULL) { ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); } if (ret == SUCCESS) { ret = hnd->read_func(obj, &retval TSRMLS_CC); if (ret == SUCCESS) { /* ensure we're creating a temporary variable */ Z_SET_REFCOUNT_P(retval, 0); } else { retval = EG(uninitialized_zval_ptr); } } else { zend_object_handlers * std_hnd = zend_get_std_object_handlers(); retval = std_hnd->read_property(object, member, type, key TSRMLS_CC); } if (member == &tmp_member) { zval_dtor(member); } return(retval); } /* }}} */ /* {{{ write_property */ static void write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) { zval tmp_member; php_event_abstract_object_t *obj; php_event_prop_handler_t *hnd; int ret; if (member->type != IS_STRING) { tmp_member = *member; zval_copy_ctor(&tmp_member); convert_to_string(&tmp_member); member = &tmp_member; } ret = FAILURE; obj = (php_event_abstract_object_t *) zend_objects_get_address(object TSRMLS_CC); if (obj->prop_handler != NULL) { ret = zend_hash_find((HashTable *) obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); } if (ret == SUCCESS) { hnd->write_func(obj, value TSRMLS_CC); } else { zend_object_handlers * std_hnd = zend_get_std_object_handlers(); std_hnd->write_property(object, member, value, key TSRMLS_CC); } if (member == &tmp_member) { zval_dtor(member); } } /* }}} */ /* {{{ object_has_property */ static int object_has_property(zval *object, zval *member, int has_set_exists, const zend_literal *key TSRMLS_DC) { php_event_abstract_object_t *obj; int ret = 0; php_event_prop_handler_t p; obj = (php_event_abstract_object_t *) zend_objects_get_address(object TSRMLS_CC); if (obj->prop_handler) { if (zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member) + 1, (void **) &p) == SUCCESS) { switch (has_set_exists) { case 2: ret = 1; break; case 1: { zval *value = read_property(object, member, BP_VAR_IS, key TSRMLS_CC); if (value != EG(uninitialized_zval_ptr)) { convert_to_boolean(value); ret = Z_BVAL_P(value)? 1:0; /* refcount is 0 */ Z_ADDREF_P(value); zval_ptr_dtor(&value); } break; } case 0:{ zval *value = read_property(object, member, BP_VAR_IS, key TSRMLS_CC); if (value != EG(uninitialized_zval_ptr)) { ret = Z_TYPE_P(value) != IS_NULL? 1:0; /* refcount is 0 */ Z_ADDREF_P(value); zval_ptr_dtor(&value); } break; } default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for has_set_exists"); } } else { zend_object_handlers *std_hnd = zend_get_std_object_handlers(); ret = std_hnd->has_property(object, member, has_set_exists, key TSRMLS_CC); } } return ret; } /* }}} */ #if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3 /* {{{ object_get_debug_info */ static HashTable *object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) { php_event_abstract_object_t *obj; HashTable *retval; HashTable *props; HashPosition pos; php_event_prop_handler_t *entry; obj = (php_event_abstract_object_t *) zend_objects_get_address(object TSRMLS_CC); props = obj->prop_handler; ALLOC_HASHTABLE(retval); if (!props) { ZEND_INIT_SYMTABLE_EX(retval, 1, 0); return retval; } ZEND_INIT_SYMTABLE_EX(retval, zend_hash_num_elements(props) + 1, 0); zend_hash_internal_pointer_reset_ex(props, &pos); while (zend_hash_get_current_data_ex(props, (void **) &entry, &pos) == SUCCESS) { zval member; zval *value; INIT_ZVAL(member); ZVAL_STRINGL(&member, entry->name, entry->name_len, 0); value = read_property(object, &member, BP_VAR_IS, 0 TSRMLS_CC); if (value != EG(uninitialized_zval_ptr)) { Z_ADDREF_P(value); zend_hash_add(retval, entry->name, entry->name_len + 1, &value, sizeof(zval *) , NULL); } zend_hash_move_forward_ex(props, &pos); } *is_temp = 1; return retval; } /* }}} */ #endif /* {{{ get_property_ptr_ptr */ #if PHP_VERSION_ID >= 50500 static zval **get_property_ptr_ptr(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) #else static zval **get_property_ptr_ptr(zval *object, zval *member, const zend_literal *key TSRMLS_DC) #endif { php_event_abstract_object_t *obj; zval tmp_member; zval **retval = NULL; php_event_prop_handler_t *hnd; int ret = FAILURE; if (member->type != IS_STRING) { tmp_member = *member; zval_copy_ctor(&tmp_member); convert_to_string(&tmp_member); member = &tmp_member; } obj = (php_event_abstract_object_t *) zend_objects_get_address(object TSRMLS_CC); if (obj->prop_handler != NULL) { ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member) + 1, (void **) &hnd); } if (ret == FAILURE) { #if PHP_VERSION_ID >= 50500 retval = zend_get_std_object_handlers()->get_property_ptr_ptr(object, member, type, key TSRMLS_CC); #else retval = zend_get_std_object_handlers()->get_property_ptr_ptr(object, member, key TSRMLS_CC); #endif } else if (hnd->get_ptr_ptr_func) { retval = hnd->get_ptr_ptr_func(obj TSRMLS_CC); } if (member == &tmp_member) { zval_dtor(member); } return retval; } /* }}} */ #if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4 /* {{{ get_properties Returns all object properties. */ static HashTable *get_properties(zval *object TSRMLS_DC) { php_event_abstract_object_t *obj; php_event_prop_handler_t *hnd; HashTable *props; zval *val; char *key; uint key_len; HashPosition pos; ulong num_key; obj = (php_event_abstract_object_t *) zend_objects_get_address(object TSRMLS_CC); /* Don't get obj->zo.properties; directly! * Otherwise serialization functions will cause SEGFAULTs */ props = zend_std_get_properties(object TSRMLS_CC); if (obj->prop_handler) { zend_hash_internal_pointer_reset_ex(obj->prop_handler, &pos); while (zend_hash_get_current_data_ex(obj->prop_handler, (void **) &hnd, &pos) == SUCCESS) { zend_hash_get_current_key_ex(obj->prop_handler, &key, &key_len, &num_key, 0, &pos); if (!hnd->read_func || hnd->read_func(obj, &val TSRMLS_CC) != SUCCESS) { val = EG(uninitialized_zval_ptr); Z_ADDREF_P(val); } zend_hash_update(props, key, key_len, (void *) &val, sizeof(zval *), NULL); zend_hash_move_forward_ex(obj->prop_handler, &pos); } } return obj->zo.properties; } /* }}} */ #endif static HashTable *get_gc(zval *object, zval ***table, int *n TSRMLS_DC) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } #define PHP_EVENT_ADD_CLASS_PROPERTIES(a, b) \ { \ int i = 0; \ while (b[i].name != NULL) { \ add_property((a), (b)[i].name, (b)[i].name_length, \ (php_event_prop_read_t)(b)[i].read_func, \ (php_event_prop_write_t)(b)[i].write_func, \ (php_event_prop_get_prop_ptr_ptr_t)(b)[i].get_ptr_ptr_func TSRMLS_CC); \ i++; \ } \ } #define PHP_EVENT_DECL_CLASS_PROPERTIES(a, b) \ { \ int i = 0; \ while (b[i].name != NULL) { \ zend_declare_property_null((a), (b)[i].name, (b)[i].name_length, \ ZEND_ACC_PUBLIC TSRMLS_CC); \ i++; \ } \ } /* {{{ register_classes */ static zend_always_inline void register_classes(TSRMLS_D) { zend_class_entry *ce; zend_class_entry ce_exception; PHP_EVENT_REGISTER_CLASS("Event", event_object_create, php_event_ce, php_event_ce_functions); ce = php_event_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; zend_hash_init(&event_properties, 2, NULL, NULL, 1); PHP_EVENT_ADD_CLASS_PROPERTIES(&event_properties, event_property_entries); PHP_EVENT_DECL_CLASS_PROPERTIES(ce, event_property_entry_info); zend_hash_add(&classes, ce->name, ce->name_length + 1, &event_properties, sizeof(event_properties), NULL); PHP_EVENT_REGISTER_CLASS("EventBase", event_base_object_create, php_event_base_ce, php_event_base_ce_functions); ce = php_event_base_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; PHP_EVENT_REGISTER_CLASS("EventConfig", event_config_object_create, php_event_config_ce, php_event_config_ce_functions); ce = php_event_config_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; PHP_EVENT_REGISTER_CLASS("EventBufferEvent", event_bevent_object_create, php_event_bevent_ce, php_event_bevent_ce_functions); ce = php_event_bevent_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; zend_hash_init(&event_bevent_properties, 4, NULL, NULL, 1); PHP_EVENT_ADD_CLASS_PROPERTIES(&event_bevent_properties, event_bevent_property_entries); PHP_EVENT_DECL_CLASS_PROPERTIES(ce, event_bevent_property_entry_info); zend_hash_add(&classes, ce->name, ce->name_length + 1, &event_bevent_properties, sizeof(event_bevent_properties), NULL); PHP_EVENT_REGISTER_CLASS("EventBuffer", event_buffer_object_create, php_event_buffer_ce, php_event_buffer_ce_functions); ce = php_event_buffer_ce; /*ce->ce_flags |= ZEND_ACC_FINAL_CLASS;*/ zend_hash_init(&event_buffer_properties, 2, NULL, NULL, 1); PHP_EVENT_ADD_CLASS_PROPERTIES(&event_buffer_properties, event_buffer_property_entries); PHP_EVENT_DECL_CLASS_PROPERTIES(ce, event_buffer_property_entry_info); zend_hash_add(&classes, ce->name, ce->name_length + 1, &event_buffer_properties, sizeof(event_buffer_properties), NULL); #if HAVE_EVENT_EXTRA_LIB PHP_EVENT_REGISTER_CLASS("EventDnsBase", event_dns_base_object_create, php_event_dns_base_ce, php_event_dns_base_ce_functions); ce = php_event_dns_base_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; PHP_EVENT_REGISTER_CLASS("EventListener", event_listener_object_create, php_event_listener_ce, php_event_listener_ce_functions); ce = php_event_listener_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; zend_hash_init(&event_listener_properties, 1, NULL, NULL, 1); PHP_EVENT_ADD_CLASS_PROPERTIES(&event_listener_properties, event_listener_property_entries); PHP_EVENT_DECL_CLASS_PROPERTIES(ce, event_listener_property_entry_info); zend_hash_add(&classes, ce->name, ce->name_length + 1, &event_listener_properties, sizeof(event_listener_properties), NULL); PHP_EVENT_REGISTER_CLASS("EventHttpConnection", event_http_conn_object_create, php_event_http_conn_ce, php_event_http_conn_ce_functions); ce = php_event_http_conn_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; PHP_EVENT_REGISTER_CLASS("EventHttp", event_http_object_create, php_event_http_ce, php_event_http_ce_functions); ce = php_event_http_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; PHP_EVENT_REGISTER_CLASS("EventHttpRequest", event_http_req_object_create, php_event_http_req_ce, php_event_http_req_ce_functions); ce = php_event_http_req_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; #endif /* HAVE_EVENT_EXTRA_LIB */ PHP_EVENT_REGISTER_CLASS("EventUtil", event_util_object_create, php_event_util_ce, php_event_util_ce_functions); ce = php_event_util_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; #ifdef HAVE_EVENT_OPENSSL_LIB PHP_EVENT_REGISTER_CLASS("EventSslContext", event_ssl_context_object_create, php_event_ssl_context_ce, php_event_ssl_context_ce_functions); ce = php_event_ssl_context_ce; ce->ce_flags |= ZEND_ACC_FINAL_CLASS; zend_hash_init(&event_ssl_context_properties, 0, NULL, NULL, 1); PHP_EVENT_ADD_CLASS_PROPERTIES(&event_ssl_context_properties, event_ssl_context_property_entries); PHP_EVENT_DECL_CLASS_PROPERTIES(ce, event_ssl_context_property_entry_info); zend_hash_add(&classes, ce->name, ce->name_length + 1, &event_ssl_context_properties, sizeof(event_ssl_context_properties), NULL); #endif /* HAVE_EVENT_OPENSSL_LIB */ #ifdef PHP_EVENT_NS INIT_NS_CLASS_ENTRY(ce_exception, PHP_EVENT_NS, "EventException", NULL); #else INIT_CLASS_ENTRY(ce_exception, "EventException", NULL); #endif php_event_exception_ce = zend_register_internal_class_ex(&ce_exception, php_event_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC); zend_declare_property_null(php_event_exception_ce, "errorInfo", sizeof("errorInfo") - 1, ZEND_ACC_PUBLIC TSRMLS_CC); } /* }}} */ /* Private functions }}} */ #define REGISTER_EVENT_CLASS_CONST_LONG(pce, const_name, value) \ zend_declare_class_constant_long((pce), #const_name, \ sizeof(#const_name) - 1, (long) value TSRMLS_CC) #define REGISTER_EVENT_CLASS_CONST_STRING(pce, const_name, value) \ zend_declare_class_constant_stringl((pce), #const_name, \ sizeof(#const_name) - 1, value, sizeof(value) - 1 TSRMLS_CC) /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(event) { zend_object_handlers *std_hnd = zend_get_std_object_handlers(); memcpy(&object_handlers, std_hnd, sizeof(zend_object_handlers)); object_handlers.clone_obj = NULL; object_handlers.read_property = read_property; object_handlers.write_property = write_property; object_handlers.get_property_ptr_ptr = get_property_ptr_ptr; object_handlers.has_property = object_has_property; #if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3 object_handlers.get_debug_info = object_get_debug_info; #endif #if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4 object_handlers.get_properties = get_properties; #endif object_handlers.get_gc = get_gc; spl_ce_RuntimeException = NULL; #ifdef PHP_EVENT_NS REGISTER_STRING_CONSTANT("EVENT_NS", PHP_EVENT_NS, CONST_CS | CONST_PERSISTENT); #else REGISTER_STRING_CONSTANT("EVENT_NS", "", CONST_CS | CONST_PERSISTENT); #endif zend_hash_init(&classes, 8, NULL, NULL, 1); register_classes(TSRMLS_C); /* Loop flags */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_base_ce, LOOP_ONCE, EVLOOP_ONCE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_base_ce, LOOP_NONBLOCK, EVLOOP_NONBLOCK); /* Run-time flags of event base usually passed to event_config_set_flag */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_base_ce, NOLOCK, EVENT_BASE_FLAG_NOLOCK); #if LIBEVENT_VERSION_NUMBER >= 0x02000301 REGISTER_EVENT_CLASS_CONST_LONG(php_event_base_ce, STARTUP_IOCP, EVENT_BASE_FLAG_STARTUP_IOCP); #endif #if LIBEVENT_VERSION_NUMBER >= 0x02000901 REGISTER_EVENT_CLASS_CONST_LONG(php_event_base_ce, NO_CACHE_TIME, EVENT_BASE_FLAG_NO_CACHE_TIME); #endif #if LIBEVENT_VERSION_NUMBER >= 0x02000301 REGISTER_EVENT_CLASS_CONST_LONG(php_event_base_ce, EPOLL_USE_CHANGELIST, EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST); REGISTER_EVENT_CLASS_CONST_LONG(php_event_base_ce, IGNORE_ENV, EVENT_BASE_FLAG_IGNORE_ENV); #endif #if LIBEVENT_VERSION_NUMBER >= 0x02010201 REGISTER_EVENT_CLASS_CONST_LONG(php_event_base_ce, PRECISE_TIMER, EVENT_BASE_FLAG_PRECISE_TIMER); #endif /* Event flags */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_ce, ET, EV_ET); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ce, PERSIST, EV_PERSIST); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ce, READ, EV_READ); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ce, WRITE, EV_WRITE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ce, SIGNAL, EV_SIGNAL); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ce, TIMEOUT, EV_TIMEOUT); /* XXX define on the fly by calling event_base_get_features() first */ /* Features of event_base usually passed to event_config_require_features */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_config_ce, FEATURE_ET, EV_FEATURE_ET); REGISTER_EVENT_CLASS_CONST_LONG(php_event_config_ce, FEATURE_O1, EV_FEATURE_O1); REGISTER_EVENT_CLASS_CONST_LONG(php_event_config_ce, FEATURE_FDS, EV_FEATURE_FDS); /* Buffer event flags */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, READING, BEV_EVENT_READING); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, WRITING, BEV_EVENT_WRITING); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, EOF, BEV_EVENT_EOF); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, ERROR, BEV_EVENT_ERROR); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, TIMEOUT, BEV_EVENT_TIMEOUT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, CONNECTED, BEV_EVENT_CONNECTED); /* Option flags for bufferevents */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, OPT_CLOSE_ON_FREE, BEV_OPT_CLOSE_ON_FREE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, OPT_THREADSAFE, BEV_OPT_THREADSAFE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, OPT_DEFER_CALLBACKS, BEV_OPT_DEFER_CALLBACKS); #if LIBEVENT_VERSION_NUMBER >= 0x02000500 REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, OPT_UNLOCK_CALLBACKS, BEV_OPT_UNLOCK_CALLBACKS); #endif #ifdef HAVE_EVENT_OPENSSL_LIB REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, SSL_OPEN, BUFFEREVENT_SSL_OPEN); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, SSL_CONNECTING, BUFFEREVENT_SSL_CONNECTING); REGISTER_EVENT_CLASS_CONST_LONG(php_event_bevent_ce, SSL_ACCEPTING, BUFFEREVENT_SSL_ACCEPTING); #endif /* Address families */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, AF_INET, AF_INET); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, AF_INET6, AF_INET6); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, AF_UNIX, AF_UNIX); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, AF_UNSPEC, AF_UNSPEC); /* Socket options */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_DEBUG, SO_DEBUG); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_REUSEADDR, SO_REUSEADDR); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_KEEPALIVE, SO_KEEPALIVE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_DONTROUTE, SO_DONTROUTE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_LINGER, SO_LINGER); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_BROADCAST, SO_BROADCAST); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_OOBINLINE, SO_OOBINLINE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_SNDBUF, SO_SNDBUF); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_RCVBUF, SO_RCVBUF); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_SNDLOWAT, SO_SNDLOWAT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_RCVLOWAT, SO_RCVLOWAT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_SNDTIMEO, SO_SNDTIMEO); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_RCVTIMEO, SO_RCVTIMEO); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_TYPE, SO_TYPE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SO_ERROR, SO_ERROR); #ifdef TCP_NODELAY REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, TCP_NODELAY, TCP_NODELAY); #endif /* Socket protocol levels */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SOL_SOCKET, SOL_SOCKET); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SOL_TCP, IPPROTO_TCP); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SOL_UDP, IPPROTO_UDP); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, IPPROTO_IP, IPPROTO_IP); REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, SOCK_RAW, SOCK_RAW); #if HAVE_IPV6 REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, IPPROTO_IPV6, IPPROTO_IPV6); #endif #ifdef HAVE_EVENT_EXTRA_LIB /* DNS options */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_dns_base_ce, OPTION_SEARCH, DNS_OPTION_SEARCH); REGISTER_EVENT_CLASS_CONST_LONG(php_event_dns_base_ce, OPTION_NAMESERVERS, DNS_OPTION_NAMESERVERS); REGISTER_EVENT_CLASS_CONST_LONG(php_event_dns_base_ce, OPTION_MISC, DNS_OPTION_MISC); REGISTER_EVENT_CLASS_CONST_LONG(php_event_dns_base_ce, OPTION_HOSTSFILE, DNS_OPTION_HOSTSFILE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_dns_base_ce, OPTIONS_ALL, DNS_OPTIONS_ALL); REGISTER_EVENT_CLASS_CONST_LONG(php_event_listener_ce, OPT_LEAVE_SOCKETS_BLOCKING, LEV_OPT_LEAVE_SOCKETS_BLOCKING); REGISTER_EVENT_CLASS_CONST_LONG(php_event_listener_ce, OPT_CLOSE_ON_FREE, LEV_OPT_CLOSE_ON_FREE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_listener_ce, OPT_CLOSE_ON_EXEC, LEV_OPT_CLOSE_ON_EXEC); REGISTER_EVENT_CLASS_CONST_LONG(php_event_listener_ce, OPT_REUSEABLE, LEV_OPT_REUSEABLE); # if LIBEVENT_VERSION_NUMBER >= 0x02010100 REGISTER_EVENT_CLASS_CONST_LONG(php_event_listener_ce, OPT_DISABLED, LEV_OPT_DISABLED); # endif # if LIBEVENT_VERSION_NUMBER >= 0x02000800 REGISTER_EVENT_CLASS_CONST_LONG(php_event_listener_ce, OPT_THREADSAFE, LEV_OPT_THREADSAFE); #endif # if LIBEVENT_VERSION_NUMBER >= 0x02010100 REGISTER_EVENT_CLASS_CONST_LONG(php_event_listener_ce, OPT_DEFERRED_ACCEPT, LEV_OPT_DEFERRED_ACCEPT); # endif /* EventHttpRequest command types */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_GET, EVHTTP_REQ_GET); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_POST, EVHTTP_REQ_POST); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_HEAD, EVHTTP_REQ_HEAD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_PUT, EVHTTP_REQ_PUT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_DELETE, EVHTTP_REQ_DELETE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_OPTIONS, EVHTTP_REQ_OPTIONS); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_TRACE, EVHTTP_REQ_TRACE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_CONNECT, EVHTTP_REQ_CONNECT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, CMD_PATCH, EVHTTP_REQ_PATCH); /* EventHttpRequest header types */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, INPUT_HEADER, PHP_EVENT_REQ_HEADER_INPUT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_http_req_ce, OUTPUT_HEADER, PHP_EVENT_REQ_HEADER_OUTPUT); #endif /* HAVE_EVENT_EXTRA_LIB */ REGISTER_EVENT_CLASS_CONST_LONG(php_event_util_ce, LIBEVENT_VERSION_NUMBER, LIBEVENT_VERSION_NUMBER); REGISTER_EVENT_CLASS_CONST_LONG(php_event_buffer_ce, EOL_ANY, EVBUFFER_EOL_ANY); REGISTER_EVENT_CLASS_CONST_LONG(php_event_buffer_ce, EOL_CRLF, EVBUFFER_EOL_CRLF); REGISTER_EVENT_CLASS_CONST_LONG(php_event_buffer_ce, EOL_CRLF_STRICT, EVBUFFER_EOL_CRLF_STRICT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_buffer_ce, EOL_LF, EVBUFFER_EOL_LF); #if LIBEVENT_VERSION_NUMBER >= 0x02010100 REGISTER_EVENT_CLASS_CONST_LONG(php_event_buffer_ce, EOL_NUL, EVBUFFER_EOL_NUL); #endif REGISTER_EVENT_CLASS_CONST_LONG(php_event_buffer_ce, PTR_SET, EVBUFFER_PTR_SET); REGISTER_EVENT_CLASS_CONST_LONG(php_event_buffer_ce, PTR_ADD, EVBUFFER_PTR_ADD); #ifdef HAVE_EVENT_OPENSSL_LIB # ifdef HAVE_SSL2 REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, SSLv2_CLIENT_METHOD, PHP_EVENT_SSLv2_CLIENT_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, SSLv23_CLIENT_METHOD, PHP_EVENT_SSLv23_CLIENT_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, SSLv2_SERVER_METHOD, PHP_EVENT_SSLv2_SERVER_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, SSLv23_SERVER_METHOD, PHP_EVENT_SSLv23_SERVER_METHOD); # endif # ifdef HAVE_SSL3 REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, SSLv3_CLIENT_METHOD, PHP_EVENT_SSLv3_CLIENT_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, SSLv3_SERVER_METHOD, PHP_EVENT_SSLv3_SERVER_METHOD); # endif REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLS_CLIENT_METHOD, PHP_EVENT_TLS_CLIENT_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLS_SERVER_METHOD, PHP_EVENT_TLS_SERVER_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLSv11_CLIENT_METHOD, PHP_EVENT_TLSv11_CLIENT_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLSv11_SERVER_METHOD, PHP_EVENT_TLSv11_SERVER_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLSv12_CLIENT_METHOD, PHP_EVENT_TLSv12_CLIENT_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLSv12_SERVER_METHOD, PHP_EVENT_TLSv12_SERVER_METHOD); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_LOCAL_CERT, PHP_EVENT_OPT_LOCAL_CERT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_LOCAL_PK, PHP_EVENT_OPT_LOCAL_PK); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_PASSPHRASE, PHP_EVENT_OPT_PASSPHRASE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_CA_FILE, PHP_EVENT_OPT_CA_FILE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_CA_PATH, PHP_EVENT_OPT_CA_PATH); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_ALLOW_SELF_SIGNED, PHP_EVENT_OPT_ALLOW_SELF_SIGNED); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_VERIFY_PEER, PHP_EVENT_OPT_VERIFY_PEER); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_VERIFY_DEPTH, PHP_EVENT_OPT_VERIFY_DEPTH); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_CIPHERS, PHP_EVENT_OPT_CIPHERS); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_NO_SSLv2, PHP_EVENT_OPT_NO_SSLv2); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_NO_SSLv3, PHP_EVENT_OPT_NO_SSLv3); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_NO_TLSv1, PHP_EVENT_OPT_NO_TLSv1); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_NO_TLSv1_1, PHP_EVENT_OPT_NO_TLSv1_1); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_NO_TLSv1_2, PHP_EVENT_OPT_NO_TLSv1_2); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_CIPHER_SERVER_PREFERENCE, PHP_EVENT_OPT_CIPHER_SERVER_PREFERENCE); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_REQUIRE_CLIENT_CERT, PHP_EVENT_OPT_REQUIRE_CLIENT_CERT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPT_VERIFY_CLIENT_ONCE, PHP_EVENT_OPT_VERIFY_CLIENT_ONCE); REGISTER_EVENT_CLASS_CONST_STRING(php_event_ssl_context_ce, OPENSSL_VERSION_TEXT, OPENSSL_VERSION_TEXT); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_NUMBER); #ifdef LIBRESSL_VERSION_NUMBER REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, LIBRESSL_VERSION_NUMBER, LIBRESSL_VERSION_NUMBER); #endif #ifdef LIBRESSL_VERSION_TEXT REGISTER_EVENT_CLASS_CONST_STRING(php_event_ssl_context_ce, LIBRESSL_VERSION_TEXT, LIBRESSL_VERSION_TEXT); #endif /* Constants for EventSslContext::setMinProtoVersion */ #if OPENSSL_VERSION_NUMBER >= 0x10100000L REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, SSL3_VERSION, SSL3_VERSION); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLS1_VERSION, TLS1_VERSION); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLS1_1_VERSION, TLS1_1_VERSION); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, TLS1_2_VERSION, TLS1_2_VERSION); REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, DTLS1_VERSION, DTLS1_VERSION); # ifdef DTLS1_2_VERSION /* May be missing in libressl*/ REGISTER_EVENT_CLASS_CONST_LONG(php_event_ssl_context_ce, DTLS1_2_VERSION, DTLS1_2_VERSION); # endif #endif /* Initialize openssl library */ SSL_library_init(); OpenSSL_add_all_ciphers(); OpenSSL_add_all_digests(); OpenSSL_add_all_algorithms(); SSL_load_error_strings(); /* Create new index which will be used to retreive custom data of the OpenSSL callbacks */ php_event_ssl_data_index = SSL_get_ex_new_index(0, "PHP EventSslContext index", NULL, NULL, NULL); #endif /* HAVE_EVENT_OPENSSL_LIB */ #ifdef PHP_EVENT_DEBUG event_enable_debug_mode(); #endif #ifdef HAVE_EVENT_PTHREADS_LIB # ifdef WIN32 evthread_use_windows_threads(); # else if (evthread_use_pthreads()) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "evthread_use_pthreads failed, submit a bug"); } # endif #endif /* Handle libevent's error logging more gracefully than it's default * logging to stderr, or calling abort()/exit() */ event_set_fatal_callback(fatal_error_cb); event_set_log_callback(log_cb); return SUCCESS; } /* }}} */ /* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(event) { #ifdef HAVE_EVENT_OPENSSL_LIB /* Removes memory allocated when loading digest and cipher names * in the OpenSSL_add_all_ family of functions */ EVP_cleanup(); #endif #if LIBEVENT_VERSION_NUMBER >= 0x02010000 /* libevent_global_shutdown is available since libevent 2.1.0-alpha. * * Make sure that libevent has released all internal library-global data * structures. Don't call any of libevent functions below! */ libevent_global_shutdown(); #endif zend_hash_destroy(&event_properties); zend_hash_destroy(&event_bevent_properties); zend_hash_destroy(&event_buffer_properties); zend_hash_destroy(&event_listener_properties); #ifdef HAVE_EVENT_OPENSSL_LIB zend_hash_destroy(&event_ssl_context_properties); #endif zend_hash_destroy(&classes); return SUCCESS; } /* }}} */ /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(event) { php_info_print_table_start(); php_info_print_table_header(2, "Event support", "enabled"); #ifdef PHP_EVENT_SOCKETS_SUPPORT php_info_print_table_header(2, "Sockets support", "enabled"); #else php_info_print_table_header(2, "Sockets support", "disabled"); #endif #ifdef PHP_EVENT_DEBUG php_info_print_table_row(2, "Debug support", "enabled"); #else php_info_print_table_row(2, "Debug support", "disabled"); #endif #ifdef HAVE_EVENT_EXTRA_LIB php_info_print_table_row(2, "Extra functionality support including HTTP, DNS, and RPC", "enabled"); #else php_info_print_table_row(2, "Extra functionality support including HTTP, DNS, and RPC", "disabled"); #endif #ifdef HAVE_EVENT_OPENSSL_LIB php_info_print_table_row(2, "OpenSSL support", "enabled"); #else php_info_print_table_row(2, "OpenSSL support", "disabled"); #endif #ifdef HAVE_EVENT_PTHREADS_LIB php_info_print_table_row(2, "Thread safety support", "enabled"); #else php_info_print_table_row(2, "Thread safety support", "disabled"); #endif php_info_print_table_row(2, "Extension version", PHP_EVENT_VERSION); php_info_print_table_row(2, "libevent2 headers version", LIBEVENT_VERSION); php_info_print_table_end(); } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 sts=4 fdm=marker * vim<600: noet sw=4 ts=4 sts=4 */
33.904153
205
0.745873
[ "object" ]
d949a1f3e2377bc33dcefad5962a17a10c441092
2,072
h
C
include/socks5.h
EvanMcBroom/microsocks11
56eeeb84daa64a69220e8295e693a104ab84be4c
[ "MIT" ]
22
2020-10-21T04:49:54.000Z
2022-02-10T16:01:54.000Z
include/socks5.h
EvanMcBroom/microsocks11
56eeeb84daa64a69220e8295e693a104ab84be4c
[ "MIT" ]
1
2021-04-15T21:28:40.000Z
2021-04-15T21:28:40.000Z
include/socks5.h
EvanMcBroom/microsocks11
56eeeb84daa64a69220e8295e693a104ab84be4c
[ "MIT" ]
5
2020-11-21T12:10:52.000Z
2021-12-06T00:16:19.000Z
// Copyright (C) 2020 Evan McBroom #pragma once #include <future> #include <mutex> #include <server.h> #include <vector> enum class AuthMethod { NO_AUTH = 0, USERNAME = 2, INVALID = 0xFF }; struct Buffer { public: Buffer(Socket socket_) : socket_(socket_) {}; unsigned char data[1024] = { 0 }; int recieved = 0; void recieve(); private: Socket socket_; }; class Socks5Server { public: struct Client : Server::Client { enum class State { CONNECTED, NEED_AUTH, /* skipped if NO_AUTH method supported */ AUTHED, }; State state; }; Socks5Server() { bindAddress.v4.sin_family = AF_UNSPEC; } void setAuthentication(const char* username, const char* password, bool maintainAuthentication = false) { username = username; password = password; maintainAuthentication = maintainAuthentication; } void setBindAddress(const char* address) { resolveSockAddress(address, 0, &bindAddress); } void setVerbose(bool verbose) { verbose = verbose; } bool start(const char* host, unsigned short port, std::unique_ptr<std::promise<int>> error = nullptr); void stop() { stopListening = true; } private: const char* username = nullptr; const char* password = nullptr; bool maintainAuthentication = false; std::mutex authenticatedClientsMutex; std::vector<Socks5Server::Client> authenticatedClients; sockAddress bindAddress; bool verbose = false; bool stopListening = false; inline void addAuthAddress(Socks5Server::Client& client) { const std::lock_guard<std::mutex> lock(authenticatedClientsMutex); authenticatedClients.emplace_back(client); }; AuthMethod checkAuthMethod(Buffer& buffer, Socks5Server::Client& client); ErrorCode connectClient(Buffer& buffer, Socks5Server::Client& client); ErrorCode checkCredentials(Buffer& buffer); void* proxyRequest(Socks5Server::Client client); }; namespace { void copy(int fd1, int fd2); int isAuthenticated(sockAddress& client, sockAddress& authedip); void sendResponseCode(int socket, int version, int authMethod); void sendError(int socket, ErrorCode errorCode); }
23.022222
106
0.7389
[ "vector" ]
d94f3ad74b1cc3c1f877eece435ec386e7d1fe8b
1,342
h
C
Engine/renderer/reflection_probe.h
Yavuz1234567890/Rogy-Engine-
ccabed511be0a7d719d0e8793b91a11fe08024ea
[ "MIT" ]
1
2021-01-07T03:10:21.000Z
2021-01-07T03:10:21.000Z
Engine/renderer/reflection_probe.h
LigthWood/Rogy-Engine-
9690d05a7cc99fffa492eef5303568ae227682b8
[ "MIT" ]
null
null
null
Engine/renderer/reflection_probe.h
LigthWood/Rogy-Engine-
9690d05a7cc99fffa492eef5303568ae227682b8
[ "MIT" ]
null
null
null
#ifndef LIGHTING_REFLECTION_PROBE_H #define LIGHTING_REFLECTION_PROBE_H #include "glm\glm.hpp" #include "../mesh/bounding_box.h" #include "pbr_capture.h" #include "../scene/RComponent.h" class ReflectionProbe : public Component { BASE_COMPONENT() // Probe ID int probe_id; // Cubemap capture PBRCapture capture; // Local Bounding box - get the corrected b_box with GetBBox - BBox box; // Probe position glm::vec3 Position = glm::vec3(0.0f); // Intensity float Intensity = 1.0f; // Capture Resolution float Resolution = 64.0f; // Project the reflections (corrected cubemap) bool BoxProjection = false; bool Active = true; bool removed = false; bool static_only = true; // Is the reflection probe baked? bool baked = false; void BakeReflections() { baked = false; } BBox GetBBox() { correct_box = box; correct_box.BoxMax += Position; correct_box.BoxMin += Position; return correct_box; } // Serialization template <class Archive> void SerializeSave(Archive & ar) { ar(box.BoxMin.x); ar(box.BoxMin.y); ar(box.BoxMin.z); ar(box.BoxMax.x); ar(box.BoxMax.y); ar(box.BoxMax.z); ar(box.radius); ar(Intensity); ar(static_only); ar(BoxProjection); ar(Resolution); ar(Intensity); } private: BBox correct_box; }; #endif // LIGHTING_REFLECTION_PROBE_H
17.428571
63
0.690015
[ "mesh" ]
d94fcaee0a2baf60961b51bf2d7736080e1ccb3d
2,578
h
C
Source/Drivers/PSLink/LinkProtoLib/XnLink24zYuv422Parser.h
liweimcc/OpenNI-Vive
bb8834d88b9869469760d2def19683226665ff10
[ "Apache-2.0" ]
7
2019-12-08T02:37:21.000Z
2022-02-12T02:38:52.000Z
Source/Drivers/PSLink/LinkProtoLib/XnLink24zYuv422Parser.h
liweimcc/OpenNI-Vive
bb8834d88b9869469760d2def19683226665ff10
[ "Apache-2.0" ]
2
2018-04-16T10:51:56.000Z
2018-04-24T06:35:09.000Z
Source/Drivers/PSLink/LinkProtoLib/XnLink24zYuv422Parser.h
liweimcc/OpenNI-Vive
bb8834d88b9869469760d2def19683226665ff10
[ "Apache-2.0" ]
4
2016-05-26T13:12:37.000Z
2019-12-10T11:53:05.000Z
/***************************************************************************** * * * OpenNI 2.x Alpha * * Copyright (C) 2012 PrimeSense Ltd. * * * * This file is part of OpenNI. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * * * *****************************************************************************/ #ifndef XNLINK24ZYUV422PARSER_H #define XNLINK24ZYUV422PARSER_H #include "XnLinkMsgParser.h" namespace xn { class Link24zYuv422Parser : public LinkMsgParser { public: Link24zYuv422Parser(XnUInt32 xRes, XnUInt32 yRes, XnBool transformToRGB); virtual ~Link24zYuv422Parser(); virtual XnStatus Init(); protected: virtual XnStatus ParsePacketImpl( XnLinkFragmentation fragmentation, const XnUInt8* pSrc, const XnUInt8* pSrcEnd, XnUInt8*& pDst, const XnUInt8* pDstEnd); private: XnStatus Uncompress24z( const XnUInt8* pInput, XnSizeT nInputSize, XnUInt8* pOutput, XnSizeT* pnOutputSize, XnUInt32 nLineSize, XnSizeT* pnActualRead, XnBool bLastPart); XnUInt8* m_dataFromPrevPacket; XnSizeT m_dataFromPrevPacketBytes; XnUInt32 m_lineWidthBytes; XnUInt32 m_rgbFrameSize; XnUInt32 m_expectedFrameSize; XnBool m_transformToRGB; XnUInt8* m_tempYuvImage; // hold Yuv Image, when transform is required XnUInt32 m_tempYuvImageBytes; }; } #endif // XNLINK24ZYUV422PARSER_H
39.661538
78
0.494569
[ "transform" ]
d95338d17fdba1f37de98e120b3c7113555086b3
4,698
h
C
media/blink/renderer_media_player_interface.h
zipated/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
media/blink/renderer_media_player_interface.h
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
media/blink/renderer_media_player_interface.h
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ #define MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ // This file contains interfaces modeled after classes in // content/renderer/media/android for the purposes of letting clases in // this directory implement and/or interact with those classes. // It's a stop-gap used to support cast on android until a better solution // is implemented: crbug/575276 #include <string> #include "base/time/time.h" #include "media/blink/webmediaplayer_delegate.h" #include "ui/gfx/geometry/rect_f.h" #include "url/gurl.h" namespace blink { enum class WebRemotePlaybackAvailability; } // Dictates which type of media playback is being initialized. enum MediaPlayerHostMsg_Initialize_Type { MEDIA_PLAYER_TYPE_URL, MEDIA_PLAYER_TYPE_REMOTE_ONLY, MEDIA_PLAYER_TYPE_LAST = MEDIA_PLAYER_TYPE_REMOTE_ONLY }; namespace media { class RendererMediaPlayerInterface { public: virtual void OnMediaMetadataChanged(base::TimeDelta duration, int width, int height, bool success) = 0; virtual void OnPlaybackComplete() = 0; virtual void OnBufferingUpdate(int percentage) = 0; virtual void OnSeekRequest(base::TimeDelta time_to_seek) = 0; virtual void OnSeekComplete(base::TimeDelta current_time) = 0; virtual void OnMediaError(int error_type) = 0; virtual void OnVideoSizeChanged(int width, int height) = 0; // Called to update the current time. virtual void OnTimeUpdate(base::TimeDelta current_timestamp, base::TimeTicks current_time_ticks) = 0; virtual void OnPlayerReleased() = 0; // Functions called when media player status changes. virtual void OnConnectedToRemoteDevice( const std::string& remote_playback_message) = 0; virtual void OnDisconnectedFromRemoteDevice() = 0; virtual void OnRemotePlaybackStarted() = 0; virtual void OnCancelledRemotePlaybackRequest() = 0; virtual void OnDidExitFullscreen() = 0; virtual void OnMediaPlayerPlay() = 0; virtual void OnMediaPlayerPause() = 0; virtual void OnRemoteRouteAvailabilityChanged( blink::WebRemotePlaybackAvailability availability) = 0; // This function is called by the RendererMediaPlayerManager to pause the // video and release the media player and surface texture when we switch tabs. // However, the actual GlTexture is not released to keep the video screenshot. virtual void SuspendAndReleaseResources() = 0; }; class RendererMediaPlayerManagerInterface { public: // Initializes a MediaPlayerAndroid object in browser process. virtual void Initialize(MediaPlayerHostMsg_Initialize_Type type, int player_id, const GURL& url, const GURL& site_for_cookies, const GURL& frame_url, bool allow_credentials, int delegate_id) = 0; // Starts the player. virtual void Start(int player_id) = 0; // Pauses the player. // is_media_related_action should be true if this pause is coming from an // an action that explicitly pauses the video (user pressing pause, JS, etc.) // Otherwise it should be false if Pause is being called due to other reasons // (cleanup, freeing resources, etc.) virtual void Pause(int player_id, bool is_media_related_action) = 0; // Performs seek on the player. virtual void Seek(int player_id, base::TimeDelta time) = 0; // Sets the player volume. virtual void SetVolume(int player_id, double volume) = 0; // Sets the poster image. virtual void SetPoster(int player_id, const GURL& poster) = 0; // Releases resources for the player after being suspended. virtual void SuspendAndReleaseResources(int player_id) = 0; // Destroys the player in the browser process virtual void DestroyPlayer(int player_id) = 0; // Requests remote playback if possible virtual void RequestRemotePlayback(int player_id) = 0; // Requests control of remote playback virtual void RequestRemotePlaybackControl(int player_id) = 0; // Requests stopping remote playback virtual void RequestRemotePlaybackStop(int player_id) = 0; // Registers and unregisters a RendererMediaPlayerInterface object. virtual int RegisterMediaPlayer(RendererMediaPlayerInterface* player) = 0; virtual void UnregisterMediaPlayer(int player_id) = 0; }; } // namespace media #endif // MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_
38.195122
80
0.727544
[ "geometry", "object" ]
d95354094b4220aa1fb0244091242661007676df
4,103
h
C
chromeos/components/drivefs/fake_drivefs.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chromeos/components/drivefs/fake_drivefs.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chromeos/components/drivefs/fake_drivefs.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROMEOS_COMPONENTS_DRIVEFS_FAKE_DRIVEFS_H_ #define CHROMEOS_COMPONENTS_DRIVEFS_FAKE_DRIVEFS_H_ #include <map> #include <memory> #include <string> #include <vector> #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chromeos/components/drivefs/drivefs_bootstrap.h" #include "chromeos/components/drivefs/drivefs_host.h" #include "chromeos/components/drivefs/mojom/drivefs.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" namespace drivefs { class FakeDriveFsBootstrapListener : public DriveFsBootstrapListener { public: explicit FakeDriveFsBootstrapListener( mojo::PendingRemote<drivefs::mojom::DriveFsBootstrap> bootstrap); ~FakeDriveFsBootstrapListener() override; private: void SendInvitationOverPipe(base::ScopedFD) override; mojo::PendingRemote<mojom::DriveFsBootstrap> bootstrap() override; mojo::PendingRemote<drivefs::mojom::DriveFsBootstrap> bootstrap_; DISALLOW_COPY_AND_ASSIGN(FakeDriveFsBootstrapListener); }; class FakeDriveFs : public drivefs::mojom::DriveFs, public drivefs::mojom::DriveFsBootstrap { public: explicit FakeDriveFs(const base::FilePath& mount_path); ~FakeDriveFs() override; void RegisterMountingForAccountId( base::RepeatingCallback<std::string()> account_id_getter); std::unique_ptr<drivefs::DriveFsBootstrapListener> CreateMojoListener(); void SetMetadata(const base::FilePath& path, const std::string& mime_type, const std::string& original_name, bool pinned, bool shared, const mojom::Capabilities& capabilities, const mojom::FolderFeature& folder_feature); const base::FilePath& mount_path() { return mount_path_; } private: struct FileMetadata; class SearchQuery; // drivefs::mojom::DriveFsBootstrap: void Init( drivefs::mojom::DriveFsConfigurationPtr config, mojo::PendingReceiver<drivefs::mojom::DriveFs> receiver, mojo::PendingRemote<drivefs::mojom::DriveFsDelegate> delegate) override; // drivefs::mojom::DriveFs: void GetMetadata(const base::FilePath& path, GetMetadataCallback callback) override; void SetPinned(const base::FilePath& path, bool pinned, SetPinnedCallback callback) override; void UpdateNetworkState(bool pause_syncing, bool is_offline) override; void ResetCache(ResetCacheCallback callback) override; void GetThumbnail(const base::FilePath& path, bool crop_to_square, GetThumbnailCallback callback) override; void CopyFile(const base::FilePath& source, const base::FilePath& target, CopyFileCallback callback) override; void StartSearchQuery( mojo::PendingReceiver<drivefs::mojom::SearchQuery> receiver, drivefs::mojom::QueryParametersPtr query_params) override; void FetchAllChangeLogs() override; void FetchChangeLog( std::vector<mojom::FetchChangeLogOptionsPtr> options) override; void SendNativeMessageRequest( const std::string& request, SendNativeMessageRequestCallback callback) override; const base::FilePath mount_path_; std::map<base::FilePath, FileMetadata> metadata_; mojo::Receiver<drivefs::mojom::DriveFs> receiver_{this}; mojo::Remote<drivefs::mojom::DriveFsDelegate> delegate_; mojo::Receiver<drivefs::mojom::DriveFsBootstrap> bootstrap_receiver_{this}; mojo::PendingReceiver<drivefs::mojom::DriveFsDelegate> pending_delegate_receiver_; base::WeakPtrFactory<FakeDriveFs> weak_factory_{this}; DISALLOW_COPY_AND_ASSIGN(FakeDriveFs); }; } // namespace drivefs #endif // CHROMEOS_COMPONENTS_DRIVEFS_FAKE_DRIVEFS_H_
33.357724
78
0.735316
[ "vector" ]
79ff25c081a5deecb5bd09003f82a5b5c2fc76be
396
h
C
include/spatials/EnemyShip.h
losinggeneration/starwarrior
31b6b531f67166467c424c710186c02701ac8ccc
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
include/spatials/EnemyShip.h
losinggeneration/starwarrior
31b6b531f67166467c424c710186c02701ac8ccc
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
include/spatials/EnemyShip.h
losinggeneration/starwarrior
31b6b531f67166467c424c710186c02701ac8ccc
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
#ifndef STARWARRIOR_ENEMYSHIP_H #define STARWARRIOR_ENEMYSHIP_H #include "SDL.h" #include "spatials/Spatial.h" namespace StarWarrior { class Transform; class EnemyShip : public Spatial { public: EnemyShip(hecate::World *world, hecate::Entity *owner); virtual ~EnemyShip(); void initialize(); void render(SDL_Surface *s); private: Transform *transform; SDL_Surface *ship; }; } #endif
15.230769
56
0.752525
[ "render", "transform" ]
03007dd04c703c325998538b4d84ca02cb894f0e
3,257
h
C
libQGLViewer-2.2.6-1/examples/contribs/dvonn/drawer.h
szmurlor/fiver
083251420eb934d860c99dcf1eb07ae5b8ba7e8c
[ "Apache-2.0" ]
null
null
null
libQGLViewer-2.2.6-1/examples/contribs/dvonn/drawer.h
szmurlor/fiver
083251420eb934d860c99dcf1eb07ae5b8ba7e8c
[ "Apache-2.0" ]
null
null
null
libQGLViewer-2.2.6-1/examples/contribs/dvonn/drawer.h
szmurlor/fiver
083251420eb934d860c99dcf1eb07ae5b8ba7e8c
[ "Apache-2.0" ]
null
null
null
/**************************************************************************** Copyright (C) 2002-2006 Gilles Debunne (Gilles.Debunne@imag.fr) This file is part of the QGLViewer library. Version 2.2.6-1, released on July 4, 2007. http://artis.imag.fr/Members/Gilles.Debunne/QGLViewer libQGLViewer is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. libQGLViewer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with libQGLViewer; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ #ifndef DVONNDRAWER_H #define DVONNDRAWER_H #include "game.h" #include <QGLViewer/vec.h> #include <qstring.h> #include <qgl.h> #include <map> class QGLViewer; namespace dvonn { //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Interface of Drawer //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ class Drawer { public: Drawer(); virtual ~Drawer(); void init(); void toggleTexture(bool); void drawPieces(const Board::ConstStackHandle&) const; void draw(const Board::ConstStackHandle&) const; void drawStatus(const Board::ConstStackHandle&,QGLViewer* v) const; void drawComplement(bool showLabels) const; void drawWhitePiecePools(const Board&,bool lastTransparent) const; void drawBlackPiecePools(const Board&,bool lastTransparent) const; void drawTransparentPiece(Color p,const Board::ConstStackHandle& c, float a=0.5f) const; // Here we use a trick: we want to define the function for // Stack::const_iterator only but we cannot forward declare it and we // do not want to include dvonnBoard.h. So we declare a template and in // the .cpp, we force the instantiation for Case::piece_const_iterator. // Rq: no invocation with other type O will link! template <class O> void drawTransparentPieces(O first,O last,const Board::Coord& c, float h=0.0f,float a=0.5f) const; void highlight(const Board::ConstStackHandle&) const; void highlightPieces(const Board::ConstStackHandle&) const; void drawMove(const Board& b,const Game::Move m,float t) const; float estimateDrawMoveLength(const Board& b,const Game::Move m) const; qglviewer::Vec boardCenter() const; qglviewer::Vec boardUpVector() const; float boardRadius() const; qglviewer::Vec defaultEyePosition() const; private: void startTexture(const QString& t) const; void startTexture(const QString& t,GLuint) const; void startTexture() const; void endTexture() const; std::map<QString,GLuint> textures_; std::vector<GLuint> hLabels_; std::vector<GLuint> vLabels_; bool showTextures_; }; } #endif // DVONNDRAWER_H
35.791209
78
0.661038
[ "vector" ]
03053f961104c2884502c973d372d19cddf57b97
1,155
h
C
src/physics/physics.h
alexa-infra/negine
d9060a7c83a41c95c361c470b56c2ddab3ba04de
[ "MIT" ]
4
2016-11-11T20:35:34.000Z
2018-12-24T18:30:16.000Z
src/physics/physics.h
alexa-infra/negine
d9060a7c83a41c95c361c470b56c2ddab3ba04de
[ "MIT" ]
null
null
null
src/physics/physics.h
alexa-infra/negine
d9060a7c83a41c95c361c470b56c2ddab3ba04de
[ "MIT" ]
null
null
null
#pragma once #include "base/types.h" #include "math/vec3.h" class btBroadphaseInterface; class btDefaultCollisionConfiguration; class btCollisionDispatcher; class btConstraintSolver; class btDynamicsWorld; class btCollisionShape; class btRigidBody; namespace base { namespace game { class Transform; } } namespace base { namespace phys { class Physics { friend class Body; public: Physics(); ~Physics(); NEGINE_API void simulate(f32 dt); private: btBroadphaseInterface* broadphase_; btDefaultCollisionConfiguration* collisionConfiguration_; btCollisionDispatcher* collisionDispatcher_; btConstraintSolver* solver_; btDynamicsWorld* world_; }; class MotionState; class Body { public: enum Shape { Sphere, Plane }; NEGINE_API Body(Physics& phys, Shape shape, f32 mass, const math::vec3f& pos); NEGINE_API ~Body(); NEGINE_API void setTransform(game::Transform* t); private: Physics& physics_; MotionState* motionState_; btRigidBody* rigidBody_; btCollisionShape* collisionShape_; game::Transform* transfrom_; }; } }
20.263158
83
0.705628
[ "shape", "transform" ]
030c2e027b90ca6c97c09f11b791f200e7cdda34
5,547
c
C
vic/drivers/classic/src/vic_classic_timing.c
lingyunan0510/VIC
dbc00a813b5df5a88027d1dc57a7805e9a464436
[ "MIT" ]
1
2022-01-18T01:23:47.000Z
2022-01-18T01:23:47.000Z
vic/drivers/classic/src/vic_classic_timing.c
yusheng-wang/VIC
8f6cc0661bdc67c4f6caabdd4dcd0b8782517435
[ "MIT" ]
null
null
null
vic/drivers/classic/src/vic_classic_timing.c
yusheng-wang/VIC
8f6cc0661bdc67c4f6caabdd4dcd0b8782517435
[ "MIT" ]
null
null
null
/****************************************************************************** * @section DESCRIPTION * * Write vic timing table for classic driver *****************************************************************************/ #include <vic_driver_classic.h> /****************************************************************************** * @brief VIC timing file *****************************************************************************/ void write_vic_timing_table(timer_struct *timers) { extern FILE *LOG_DEST; extern filenames_struct filenames; extern global_param_struct global_param; char machine[MAXSTRING]; char user[MAXSTRING]; time_t curr_date_time; struct tm *timeinfo; uid_t uid; struct passwd *pw; double ndays; double nyears; // datestr curr_date_time = time(NULL); if (curr_date_time == -1) { log_err("Failed to get the current time!"); } timeinfo = localtime(&curr_date_time); // hostname if (gethostname(machine, MAXSTRING) != 0) { strcpy(machine, "unknown"); } // username uid = geteuid(); pw = getpwuid(uid); if (pw) { strcpy(user, pw->pw_name); } else { strcpy(user, "unknown"); } // calculate run length ndays = global_param.dt * global_param.nrecs / SEC_PER_DAY; nyears = ndays / DAYS_PER_YEAR; fprintf(LOG_DEST, "\n"); fprintf(LOG_DEST, "------------------------------" " VIC TIMING PROFILE " "------------------------------\n\n"); fprintf(LOG_DEST, " Date : %s", asctime(timeinfo)); fprintf(LOG_DEST, " Compiler : %s (%s)\n", COMPILER, COMPILER_VERSION); fprintf(LOG_DEST, " Machine : %s\n", machine); fprintf(LOG_DEST, " VIC User : %s\n", user); fprintf(LOG_DEST, " VIC Version : %s\n", GIT_VERSION); fprintf(LOG_DEST, " VIC GIT Version : %s\n", VERSION); fprintf(LOG_DEST, " VIC_DRIVER : %s\n", VIC_DRIVER); fprintf(LOG_DEST, "\n"); fprintf(LOG_DEST, " Global Param File : %s\n", filenames.global); fprintf(LOG_DEST, " Start Date : %04hu-%02hu-%02hu-%05u\n", global_param.startyear, global_param.startmonth, global_param.startday, global_param.startsec); fprintf(LOG_DEST, " Stop Date : %04hu-%02hu-%02hu\n", global_param.endyear, global_param.endmonth, global_param.endday); fprintf(LOG_DEST, " Nrecs : %zu\n", global_param.nrecs); fprintf(LOG_DEST, " Model Timestep (seconds) : %g\n", global_param.dt); fprintf(LOG_DEST, " Snow Timestep (seconds) : %g\n", global_param.snow_dt); fprintf(LOG_DEST, " Runoff Timestep (seconds) : %g\n", global_param.runoff_dt); fprintf(LOG_DEST, " Atmos Timestep (seconds) : %g\n", global_param.atmos_dt); fprintf(LOG_DEST, "\n"); fprintf(LOG_DEST, "\n"); fprintf(LOG_DEST, " Overall Metrics\n"); fprintf(LOG_DEST, " ---------------\n"); fprintf(LOG_DEST, " Model Cost : %g pe-hrs/simulated_year\n", timers[TIMER_VIC_ALL].delta_wall / SEC_PER_HOUR / nyears); fprintf(LOG_DEST, " Model Throughput : %g simulated_years/day\n", nyears / (timers[TIMER_VIC_ALL].delta_wall / SEC_PER_DAY)); fprintf(LOG_DEST, "\n"); fprintf(LOG_DEST, " Timing Table:\n"); fprintf(LOG_DEST, "|------------|----------------------|----------------------|----------------------|----------------------|\n"); fprintf(LOG_DEST, "| Timer | Wall Time (secs) | CPU Time (secs) | Wall Time (secs/day) | CPU Time (secs/day) |\n"); fprintf(LOG_DEST, "|------------|----------------------|----------------------|----------------------|----------------------|\n"); fprintf(LOG_DEST, "| Init Time | %20g | %20g | %20g | %20g |\n", timers[TIMER_VIC_INIT].delta_wall, timers[TIMER_VIC_INIT].delta_cpu, timers[TIMER_VIC_INIT].delta_wall / ndays, timers[TIMER_VIC_INIT].delta_cpu / ndays); fprintf(LOG_DEST, "| Run Time | %20g | %20g | %20g | %20g |\n", timers[TIMER_VIC_RUN].delta_wall, timers[TIMER_VIC_RUN].delta_cpu, timers[TIMER_VIC_RUN].delta_wall / ndays, timers[TIMER_VIC_RUN].delta_cpu / ndays); fprintf(LOG_DEST, "| Final Time | %20g | %20g | %20g | %20g |\n", timers[TIMER_VIC_FINAL].delta_wall, timers[TIMER_VIC_FINAL].delta_cpu, timers[TIMER_VIC_FINAL].delta_wall / ndays, timers[TIMER_VIC_FINAL].delta_cpu / ndays); fprintf(LOG_DEST, "| Total Time | %20g | %20g | %20g | %20g |\n", timers[TIMER_VIC_ALL].delta_wall, timers[TIMER_VIC_ALL].delta_cpu, timers[TIMER_VIC_ALL].delta_wall / ndays, timers[TIMER_VIC_ALL].delta_cpu / ndays); fprintf(LOG_DEST, "|------------|----------------------|----------------------|----------------------|----------------------|\n"); fprintf(LOG_DEST, "\n"); fprintf(LOG_DEST, "\n------------------------------" " END VIC TIMING PROFILE " "------------------------------\n\n"); }
43.335938
124
0.479178
[ "model" ]
030cd3b4451bb96b31f181df31e5b20042e1e4e9
28,156
h
C
lib/lf/uscalfe/test/fe_testutils.h
isschoch/lehrfempp
5083248a4b78227a0a331e384de3e6f546a54dcc
[ "MIT" ]
null
null
null
lib/lf/uscalfe/test/fe_testutils.h
isschoch/lehrfempp
5083248a4b78227a0a331e384de3e6f546a54dcc
[ "MIT" ]
null
null
null
lib/lf/uscalfe/test/fe_testutils.h
isschoch/lehrfempp
5083248a4b78227a0a331e384de3e6f546a54dcc
[ "MIT" ]
null
null
null
#ifndef LF_FETEST_H #define LF_FETEST_H /*************************************************************************** * LehrFEM++ - A simple C++ finite element libray for teaching * Developed from 2018 at the Seminar of Applied Mathematics of ETH Zurich, * lead developers Dr. R. Casagrande and Prof. R. Hiptmair ***************************************************************************/ /** * @file * @brief Functions for testing finite element facilities * @author Ralf Hiptmair * @date November 2018 * @copyright MIT License */ #include <lf/mesh/utils/utils.h> #include <lf/refinement/mesh_hierarchy.h> #include <lf/uscalfe/uscalfe.h> namespace lf::uscalfe::test { /** @brief Incremental assembly of global finite element Galerkin matrix * * @tparam SCALAR a scalar type * @tparam TMPMATRIX matrix type suitable for assembly * @tparam DIFF_COEFF a functor providing point evaluation for the diffusion * tensor * @tparam REACTION_COEFF a functor for point evaluation of the reaction * coefficient * @param fe_space a Lagrangian finite element space of uniform polynomial * degree * @param alpha diffusion coefficient * @param gamma reaction coefficient * @param A a mutable reference to the Galerkin matrix. This argument is used to * return the matrix. The new entries will be added to any previous set * entries. * * ### Template parameter type requirements * - TMPMATRIX is a rudimentary matrix type and must * + provide a constructor taking two matrix dimension arguments * + have a method `AddtoEntry(i,j,value_to_add)` for adding to a matrix entry * A model type is lf::assemble::COOMatrix. * - DIFF_COEFF must comply with `std::function<T(Eigen::Vector2d)>`, where `T` * is either a SCALAR compatible type of a matrix type like * `Eigen::Matrix<SCALAR,...>`. * - REACTION_COEFF must behave like `std::function<SCALAR(Eigen::Vector2d)>`. * * This function can be used to assemble the global finite element Galerkin * matrix for a second-order elliptic boundary value problem. Essential * conditions are **not** taken into account. * * @note the matrix A passed as the last argument is _updated_ by the function. */ template <typename SCALAR, typename TMPMATRIX, typename DIFF_COEFF, typename REACTION_COEFF> void SecOrdBVPLagrFEFullInteriorGalMat( std::shared_ptr<UniformScalarFESpace<SCALAR>> fe_space, DIFF_COEFF alpha, REACTION_COEFF gamma, TMPMATRIX &A) { using scalar_t = typename TMPMATRIX::Scalar; // The underlying finite element mesh const lf::mesh::Mesh &mesh{*fe_space->Mesh()}; // The local-to-global index map for the finite element space const lf::assemble::DofHandler &dofh{fe_space->LocGlobMap()}; // Object taking care of local computations. No selection of a subset // of cells is specified. ReactionDiffusionElementMatrixProvider<scalar_t, decltype(alpha), decltype(gamma)> elmat_builder(fe_space, alpha, gamma); // Invoke assembly on cells AssembleMatrixLocally(0, dofh, dofh, elmat_builder, A); } /** @brief Incremental assembly of parts of a finite element Galerkin matrix * due to boundary contributions * * @tparam SCALAR a scalar type * @tparam TMPMATRIX matrix type suitable for assembly * @tparam COEFF a functor providing the impedance function * @tparam EDGESELECTOR predicate for selection of edges * * @param fe_space a Lagrangian finite element space of uniform polynomial * degree * @param eta impedance coefficient * @param edge_selector object with an evaluation operator returning true * for all edges on the impedance boundary part. * @param A a mutable reference to the Galerkin matrix. This argument is used to * return the matrix. The new entries will be added to any previous set * entries. * * ### Template parameter type requirements * - TMPMATRIX is a rudimentary matrix type and must * + provide a constructor taking two matrix dimension arguments * + have a method `AddtoEntry(i,j,value_to_add)` for adding to a matrix entry * A model type is lf::assemble::COOMatrix. * - COEFF must behave like `std::function<SCALAR(Eigen::Vector2d)>`. * - EDGESELECTOR needs an evaluation operator * `std::function<bool(const Entity &)>` * * This function can be used to assemble the contribution from an impedance * boundary part to the Galerkin matrix for a second order elliptic boundary * value problem. */ template <typename SCALAR, typename TMPMATRIX, typename COEFF, typename EDGESELECTOR> void SecOrdBVPLagrFEBoundaryGalMat( std::shared_ptr<UniformScalarFESpace<SCALAR>> fe_space, COEFF eta, EDGESELECTOR edge_sel, TMPMATRIX &A) { using scalar_t = typename TMPMATRIX::Scalar; // The underlying finite element mesh const lf::mesh::Mesh &mesh{*fe_space->Mesh()}; // The local-to-global index map for the finite element space const lf::assemble::DofHandler &dofh{fe_space->LocGlobMap()}; // Object taking care of local computations. MassEdgeMatrixProvider<scalar_t, decltype(eta), decltype(edge_sel)> edgemat_builder(fe_space, eta, edge_sel); // Invoke assembly on edges by specifying co-dimension = 1 AssembleMatrixLocally(1, dofh, dofh, edgemat_builder, A); } /** * @brief Incremental assembly of the right-hand side vector for a second-order * elliptic boundary value problem based on Lagrangian Finite Elements * * @tparam SCALAR a scalar type * @tparam VECTOR a generic vector type with component access through [] * @tparam FUNCTOR object with an evaluation operator of signature * std::function<SCALAR(const Eigen::VectorXd &)>, which supplies * the source function * @param fe_space underlying finite element space providing index mappings and * mesh * @param f functor object for source function * @param phi mutable reference to a vector with scalar entries * * This function relies on the the class \ref ScalarLoadElementVectorProvider * for local computations and the function \ref * lf::assemble::AssembleVectorLocally() for assembly. * * @note the functions performs an update of the vector */ template <typename SCALAR, typename VECTOR, typename FUNCTOR> void LagrFEVolumeRightHandSideVector( std::shared_ptr<UniformScalarFESpace<SCALAR>> fe_space, FUNCTOR f, VECTOR &phi) { using scalar_t = typename VECTOR::value_type; // The underlying finite element mesh const lf::mesh::Mesh &mesh{*fe_space->Mesh()}; // The local-to-global index map for the finite element space const lf::assemble::DofHandler &dofh{fe_space->LocGlobMap()}; // Object taking care of local computations. No selection of a subset // of cells is specified. ScalarLoadElementVectorProvider<scalar_t, FUNCTOR> elvec_builder(fe_space, f); // Invoke assembly on cells (codim == 0) AssembleVectorLocally(0, dofh, elvec_builder, phi); } /** * @brief Incremental assembly of the boundary contributions to the right-hand * side vector for a second-order elliptic boundary value problem based on * Lagrangian Finite Elements * * @tparam SCALAR a scalar type * @tparam VECTOR a generic vector type with component access through [] * @tparam FUNCTOR object with an evaluation operator of signature * std::function<SCALAR(const Eigen::VectorXd &)>, which supplies * data on a set of active edges. * @tparam EDGESELECTOR predicate for selection of edges * * @param fe_space underlying finite element space providing index mappings and * mesh * @param data functor object for boundary data * @param edge_selector object with an evaluation operator returning true * for all edges on the impedance boundary part. * @param phi mutable reference to a vector with scalar entries * * This function relies on the the class \ref ScalarLoadEdgeMatrixProvider * for local computations and the function \ref * lf::assemble::AssembleVectorLocally() for assembly. * * @note the functions performs an update of the vector */ template <typename SCALAR, typename VECTOR, typename FUNCTOR, typename EDGESELECTOR> void LagrFEBoundaryRightHandSideVector( std::shared_ptr<UniformScalarFESpace<SCALAR>> fe_space, FUNCTOR data, EDGESELECTOR edge_sel, VECTOR &phi) { using scalar_t = typename VECTOR::value_type; // The underlying finite element mesh const lf::mesh::Mesh &mesh{*fe_space->Mesh()}; // The local-to-global index map for the finite element space const lf::assemble::DofHandler &dofh{fe_space->LocGlobMap()}; // Object taking care of local computations. A predicate selects the edges to // be processed ScalarLoadEdgeVectorProvider<scalar_t, FUNCTOR, EDGESELECTOR> elvec_builder( fe_space, data, edge_sel); // Invoke assembly on edges (codim == 1), update vector AssembleVectorLocally(1, dofh, elvec_builder, phi); } /** * @brief record interpolation errors in L2 norm and H1 norm on a sequence of * 2D hybrid meshes * * @tparam FFUNC functor type providing the scalar-valued function to be * interpolated * @tparam GRADFUNC functor type for objects returning the gradient * * @param mesh_ptrs array of pointers to hybrid 2D meshes * @param f object encoding the function * @param grad_f gradient of f * @param rfs_tria_p pointer to description of local FE space on triangles * @param rfs_quad_p pointer to description of local FE space on quadrilaterals * * ### type requirement * * - FFUNC must provide an evaluation operator taking a single Eigen::VectorXd * argument and returning a scalar * - GRADFUNC must have an evaluation operator taking a single Eigen::VectorXd * argument and returning a vector. */ template <typename FFUNC, typename GRADFUNC> std::vector<std::pair<double, double>> InterpolationErrors( std::vector<std::shared_ptr<const mesh::Mesh>> mesh_ptrs, FFUNC f, GRADFUNC grad_f, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p) { // Vector of error norms std::vector<std::pair<double, double>> err_norms{}; // Loop over all meshes for (auto mesh_p : mesh_ptrs) { // Build finite element space and set up local-to-global index map auto fe_space_p = std::make_shared<UniformScalarFESpace<double>>( mesh_p, rfs_tria_p, rfs_quad_p); const lf::assemble::DofHandler &dofh{fe_space_p->LocGlobMap()}; // Perform (nodal) projection of the passed function onto the finite element // space and obtain basis expansion coefficient vector auto coeff_vec{NodalProjection(*fe_space_p, f)}; // Compute norms of interpolation error by means of numerical quadrature // whose order is controlled by the polynomials degree of the FE space auto mf_fe = MeshFunctionFE<double, double>(fe_space_p, coeff_vec); auto mf_grad_fe = MeshFunctionGradFE<double, double>(fe_space_p, coeff_vec); double L2err = std::sqrt(IntegrateMeshFunction(*mesh_p, squaredNorm(f - mf_fe), 2)); double H1serr = std::sqrt( IntegrateMeshFunction(*mesh_p, squaredNorm(grad_f - mf_grad_fe), 2)); err_norms.emplace_back(L2err, H1serr); } return err_norms; } template <typename FFUNC, typename GRADFUNC> inline std::vector<std::pair<double, double>> InterpolationErrors( refinement::MeshHierarchy &multi_mesh, FFUNC f, GRADFUNC grad_f, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p) { return InterpolationErrors(multi_mesh.getMeshes(), f, grad_f, rfs_tria_p, rfs_quad_p); } /** * @brief Track energy of FE-interpolated scalarr-valued function * on a sequence of meshes * * @tparam SCALAR scalar type for the computations * @tparam FFUNC functor type providing the scalar-valued function to be * interpolated ("reference function") * @tparam DIFF_COEFF functor type for diffusion coefficient * @tparam REAC_COEFF functor type for reaction coefficient * * @param mesh_ptrs array of pointers to hybrid 2D meshes * @param f object encoding the reference function * @param alpha object providing the diffusion coefficient * @param gamma object supplying the reaction coeffcient * @param rfs_tria_p pointer to description of local FE space on triangles * @param rfs_quad_p pointer to description of local FE space on quadrilaterals * @return vector of approximate energies on all meshes * * Given a scalar valued function, we compute its finite element projection * every mesh of the provided sequence. On every mesh we assemble the * finite element Galerkin matrix for the diffusion coefficient `alpha` * and the reaction coefficient `gamma`, and use it to compute the * energy norms of the interpolant. * * This function can be used for debugging of finite element implementations * by comparing the energy norms of the interpolant with the exact energy * of the passed function. * * ### type requirements * * - FFUNC must provide an evaluation operator taking a single Eigen::VectorXd * argument and returning a scalar * - DIFF_COEFF must comply with `std::function<T(Eigen::Vector2d)>`, where `T` * is either a SCALAR compatible type of a matrix type like * `Eigen::Matrix<SCALAR,...>`. * - REAC_COEFF must behave like `std::function<SCALAR(Eigen::Vector2d)>`. * */ template <typename SCALAR, typename FFUNC, typename DIFF_COEFF, typename REAC_COEFF> std::vector<SCALAR> EnergiesOfInterpolants( std::vector<std::shared_ptr<const mesh::Mesh>> mesh_ptrs, FFUNC f, DIFF_COEFF alpha, REAC_COEFF gamma, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p) { static_assert(mesh::utils::isMeshFunction<DIFF_COEFF>); static_assert(mesh::utils::isMeshFunction<REAC_COEFF>); static_assert(mesh::utils::isMeshFunction<FFUNC>); // Vector for returning the energies std::vector<SCALAR> energies{}; // Loop over all meshes for (auto mesh_p : mesh_ptrs) { auto fe_space = std::make_shared<UniformScalarFESpace<double>>( mesh_p, rfs_tria_p, rfs_quad_p); // Build finite element space and set up local-to-global index map const assemble::DofHandler &dofh{fe_space->LocGlobMap()}; // I: Perform (nodal) projection of the passed function onto the finite // element space and obtain basis expansion coefficient vector auto coeff_vec{NodalProjection(*fe_space, f, base::PredicateTrue{})}; // II: Assemble finite element Galerkin matrix // Dimension of finite element space` const lf::assemble::size_type N_dofs(dofh.NumDofs()); // Matrix in triplet format holding Galerkin matrix, zero initially. assemble::COOMatrix<double> A(N_dofs, N_dofs); // Actual assembly SecOrdBVPLagrFEFullInteriorGalMat(fe_space, alpha, gamma, A); // Computation of energy norm of interpolant double energy = coeff_vec.dot(A.MatVecMult(1.0, coeff_vec)); energies.push_back(energy); } return energies; } template <typename SCALAR, typename FFUNC, typename DIFF_COEFF, typename REAC_COEFF> std::vector<SCALAR> EnergiesOfInterpolants( refinement::MeshHierarchy &multi_mesh, FFUNC f, DIFF_COEFF alpha, REAC_COEFF gamma, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p) { return EnergiesOfInterpolants<SCALAR>(multi_mesh.getMeshes(), f, alpha, gamma, rfs_tria_p, rfs_quad_p); } /** * @brief Evaluate the contribution of boundary terms to the energy * for finite element interpolants of a given function. * * @tparam SCALAR scalar type for the computations * @tparam FFUNC functor type providing the scalar-valued function to be * interpolated ("reference function") * @tparam IMP_COEFF functor type for coefficient in impedance boundary condition * @tparam EDGESELECTOR predicate for the selection of active edges * * @param mesh_ptrs array of pointers to hybrid 2D meshes * @param f object encoding the reference function * @param eta object providing the impedance coefficient * @param rfs_tria_p pointer to description of local FE space on triangles * @param rfs_quad_p pointer to description of local FE space on quadrilaterals * @param rfs_edge_p pointer to description of local FE space on segments * @param edge_sel selector predicate object for relevant edges on the boundary * @return vector of approximate energies on all meshes * * Given a scalar valued function, we compute its finite element projection on * every mesh of the provided sequence. On every mesh we assemble the * finite element Galerkin matrix corresponding to the bilinear form * @f[ (u,v) \mapsto \int\limits_{\Gamma} \eta(\mathbf{x})u\,v\,\mathrm{dS}(\mathbf{x}) * @f] * where @f$\Gamma@f$ is the union of all edges of a mesh selected by the * predicate `edge_sel`. * * This function can be used for debugging of finite element implementations * by comparing the energy norms of the interpolant with the exact "boundary energy * contribution" of the passed function. * * ### type requirements * * - FFUNC must provide an evaluation operator taking a single Eigen::VectorXd * argument and returning a scalar * - IMP_COEFF must behave like `std::function<SCALAR(Eigen::Vector2d)>`. * - EDGESELECTOR needs an evaluation operator * `std::function<bool(const Entity &)>` */ template <typename SCALAR, typename FFUNC, typename IMP_COEFF, typename EDGESELECTOR> std::vector<SCALAR> BoundaryEnergiesOfInterpolants( std::vector<std::shared_ptr<const mesh::Mesh>> mesh_ptrs, FFUNC f, IMP_COEFF eta, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_edge_p, EDGESELECTOR edge_sel) { // Vector for returning the energies std::vector<SCALAR> energies{}; // Loop over all meshes for (auto mesh_p : mesh_ptrs) { // Build finite element space and set up local-to-global index map auto fe_space = std::make_shared<UniformScalarFESpace<double>>( mesh_p, rfs_tria_p, rfs_quad_p, rfs_edge_p); const lf::assemble::DofHandler &dofh{fe_space->LocGlobMap()}; // I: Collect flags for edges on the boundary auto bd_flags{lf::mesh::utils::flagEntitiesOnBoundary(fe_space->Mesh(), 1)}; auto bd_edge_sel = [&bd_flags, &edge_sel](const lf::mesh::Entity &edge) -> bool { return (bd_flags(edge) && edge_sel(edge)); }; // II: Perform (nodal) projection of the passed function onto the finite // element space and obtain basis expansion coefficient vector auto coeff_vec{NodalProjection(*fe_space, f, base::PredicateTrue{})}; // III: Assemble finite element Galerkin matrix // Dimension of finite element space` const lf::assemble::size_type N_dofs(dofh.NumDofs()); // Matrix in triplet format holding Galerkin matrix, zero initially. lf::assemble::COOMatrix<double> A(N_dofs, N_dofs); // Actual assembly SecOrdBVPLagrFEBoundaryGalMat(fe_space, eta, bd_edge_sel, A); // Computation of energy norm of interpolant double energy = coeff_vec.dot(A.MatVecMult(1.0, coeff_vec)); energies.push_back(energy); } return energies; } template <typename SCALAR, typename FFUNC, typename IMP_COEFF, typename EDGESELECTOR> std::vector<SCALAR> BoundaryEnergiesOfInterpolants( refinement::MeshHierarchy &multi_mesh, FFUNC f, IMP_COEFF eta, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_edge_p, EDGESELECTOR edge_sel) { return BoundaryEnergiesOfInterpolants<SCALAR>(multi_mesh.getMeshes(), f, eta, rfs_tria_p, rfs_quad_p, rfs_edge_p, edge_sel); } /** * @brief Evaluates a right hand side functional for the finite element * interpolant of a given function * * @tparam SCALAR scalar type for the computations * @tparam FFUNC functor type providing the scalar-valued function to be * interpolated ("reference function") * @tparam SOURCE_FUNC functor type for describing source function * * @param mesh_ptrs array of pointers to hybrid 2D meshes * @param v object encoding the reference function * @param f object providing the source function @g$f\in L^2(\Omega)@f$ * @param rfs_tria_p pointer to description of local FE space on triangles * @param rfs_quad_p pointer to description of local FE space on quadrilaterals * @return vector of approximate functional values on all meshes * * Given a scalar valued function, we compute its finite element projection * every mesh of the provided sequence. On every mesh we assemble the * finite element load vector and multiply it with the coefficient * vector of the finite element interpolant. This yields the value * of the right hand side functional. * * This function can be used for debugging of finite element implementations * by comparing the functional values for the interpolant with the exact value * for the passed function. * * ### type requirements * * - FFUNC must provide an evaluation operator taking a single Eigen::VectorXd * argument and returning a scalar * - SOURCE_FUNC must behave like `std::function<SCALAR(Eigen::Vector2d)>`. * */ template <typename SCALAR, typename FFUNC, typename SOURCE_FUNC> std::vector<SCALAR> RHSFunctionalForInterpolants( std::vector<std::shared_ptr<const mesh::Mesh>> mesh_ptrs, FFUNC v, SOURCE_FUNC f, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p) { // Vector for returning the energies std::vector<SCALAR> ell_vals{}; // Loop over all meshes for (auto mesh_p : mesh_ptrs) { // Build finite element space and set up local-to-global index map auto fe_space = std::make_shared<UniformScalarFESpace<SCALAR>>( mesh_p, rfs_tria_p, rfs_quad_p); const lf::assemble::DofHandler &dofh{fe_space->LocGlobMap()}; // I: Perform (nodal) projection of the passed function onto the finite // element space and obtain basis expansion coefficient vector auto coeff_vec{NodalProjection(*fe_space, v, base::PredicateTrue{})}; // II: Assemble finite element right-hand-side vector // Dimension of finite element space` const lf::assemble::size_type N_dofs(dofh.NumDofs()); Eigen::VectorXd phi = Eigen::VectorXd::Zero(N_dofs); // Actual assembly LagrFEVolumeRightHandSideVector(fe_space, f, phi); // Evaluation of right-hand-side functional for interpolant double ell_val = coeff_vec.dot(phi); ell_vals.push_back(ell_val); } return ell_vals; } template <typename SCALAR, typename FFUNC, typename SOURCE_FUNC> std::vector<SCALAR> RHSFunctionalForInterpolants( refinement::MeshHierarchy &multi_mesh, FFUNC v, SOURCE_FUNC f, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p) { return RHSFunctionalForInterpolants<SCALAR>(multi_mesh.getMeshes(), v, f, rfs_tria_p, rfs_quad_p); } /** * @brief Evaluates boundary contributions to a right-hand-side functional for * the finite element interpolant of a given function * * @tparam SCALAR scalar type for the computations * @tparam FFUNC functor type providing the scalar-valued function to be * interpolated ("reference function") * @tparam SOURCE_FUNC functor type for describing boundary source function * @tparam EDGESELECTOR predicate for the selection of active edges * * @param mesh_ptrs array of pointers to hybrid 2D meshes * @param v object encoding the reference function * @param f object providing the boundary source function @g$f\in * L^2(\partial\Omega)@f$ * @param rfs_tria_p pointer to description of local FE space on triangles * @param rfs_quad_p pointer to description of local FE space on quadrilaterals * @param rfs_edge_p pointer to description of local FE space on segments * @param edge_sel selector for relevant edges on the boundary * @return vector of approximate functional values on all meshes * * Given a scalar valued function, we compute its finite element projection * every mesh of the provided sequence. On every mesh we assemble the * boundary part of the finite element load vector and multiply it with the * coefficient vector of the finite element interpolant. This yields the value * of the boundary part of the right-hand-side functional. * * This function can be used for debugging of finite element implementations * in the case of inhomogeneous Neumann problems by comparing the functional * values for the interpolant with the exact value for the passed function. * * ### type requirements * * - FFUNC must provide an evaluation operator taking a single Eigen::VectorXd * argument and returning a scalar * - SOURCE_FUNC must behave like `std::function<SCALAR(Eigen::Vector2d)>`. * */ template <typename SCALAR, typename FFUNC, typename SOURCE_FUNC, typename EDGESELECTOR> std::vector<SCALAR> RHSBoundaryFunctionalForInterpolants( std::vector<std::shared_ptr<const mesh::Mesh>> mesh_ptrs, FFUNC v, SOURCE_FUNC f, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_edge_p, EDGESELECTOR edge_sel) { // Vector for returning the energies std::vector<SCALAR> ell_vals{}; // Loop over all meshes for (auto mesh_p : mesh_ptrs) { // Build finite element space and set up local-to-global index map auto fe_space = std::make_shared<UniformScalarFESpace<SCALAR>>( mesh_p, rfs_tria_p, rfs_quad_p, rfs_edge_p); const lf::assemble::DofHandler &dofh{fe_space->LocGlobMap()}; // I: Collect flags for edges on the boundary auto bd_flags{lf::mesh::utils::flagEntitiesOnBoundary(fe_space->Mesh(), 1)}; auto bd_edge_sel = [&bd_flags, &edge_sel](const lf::mesh::Entity &edge) -> bool { return (bd_flags(edge) && edge_sel(edge)); }; // II: Perform (nodal) projection of the passed function onto the finite // element space and obtain basis expansion coefficient vector auto coeff_vec{NodalProjection(*fe_space, v, base::PredicateTrue{})}; // II: Assemble finite element right-hand-side vector // Dimension of finite element space` const lf::assemble::size_type N_dofs(dofh.NumDofs()); Eigen::VectorXd phi = Eigen::VectorXd::Zero(N_dofs); // Actual assembly LagrFEBoundaryRightHandSideVector(fe_space, f, bd_edge_sel, phi); // Evaluation of right-hand-side functional for interpolant double ell_val = coeff_vec.dot(phi); ell_vals.push_back(ell_val); } return ell_vals; } template <typename SCALAR, typename FFUNC, typename SOURCE_FUNC, typename EDGESELECTOR> std::vector<SCALAR> RHSBoundaryFunctionalForInterpolants( refinement::MeshHierarchy &multi_mesh, FFUNC v, SOURCE_FUNC f, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_tria_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_quad_p, std::shared_ptr<const ScalarReferenceFiniteElement<double>> rfs_edge_p, EDGESELECTOR edge_sel) { return RHSBoundaryFunctionalForInterpolants<SCALAR>(multi_mesh.getMeshes(), v, f, rfs_tria_p, rfs_quad_p, rfs_edge_p, edge_sel); } } // namespace lf::uscalfe::test #endif
45.194222
80
0.731283
[ "mesh", "object", "vector", "model" ]
031c0f257a456b2782ac3b69a7173abdaacc376f
772
h
C
trax/IsobandLimits.h
fmidev/smartmet-library-trax
c817f87de83c5644ca3cec22d3d48441015ed5af
[ "MIT" ]
null
null
null
trax/IsobandLimits.h
fmidev/smartmet-library-trax
c817f87de83c5644ca3cec22d3d48441015ed5af
[ "MIT" ]
null
null
null
trax/IsobandLimits.h
fmidev/smartmet-library-trax
c817f87de83c5644ca3cec22d3d48441015ed5af
[ "MIT" ]
null
null
null
#pragma once #include "Range.h" #include <string> #include <vector> namespace Trax { class IsobandLimits { public: void add(float lo, float hi); void add(const std::vector<Range> &limits); bool empty() const { return m_limits.empty(); } std::size_t size() const { return m_limits.size(); } void sort(bool closed_range); bool valid() const; std::string dump() const; const Range &operator[](std::size_t i) const { return m_limits[i]; } const Range &at(std::size_t i) const { return m_limits.at(i); } std::size_t original_position(std::size_t i) const { return m_positions[i]; } private: std::vector<Range> m_limits; std::vector<std::size_t> m_positions; // original positions of the ranges }; // class IsobandLimits } // namespace Trax
23.393939
79
0.689119
[ "vector" ]
031da033dbfbe18724735885b21d6bb0a1a6fb43
439
h
C
data-mining/cluster-analysis/assignment/clustering-data/c++/src/clustering/kernel_k_means.h
4979/courses
dd9efa0a6b60cead833f36a6bfa518dd4fece17f
[ "Apache-2.0" ]
null
null
null
data-mining/cluster-analysis/assignment/clustering-data/c++/src/clustering/kernel_k_means.h
4979/courses
dd9efa0a6b60cead833f36a6bfa518dd4fece17f
[ "Apache-2.0" ]
null
null
null
data-mining/cluster-analysis/assignment/clustering-data/c++/src/clustering/kernel_k_means.h
4979/courses
dd9efa0a6b60cead833f36a6bfa518dd4fece17f
[ "Apache-2.0" ]
null
null
null
#ifndef __KERNEL_KMEANS_H__ #define __KERNEL_KMEANS_H__ #include "../utils/utils.h" namespace KernelKMeans { using Utils::squaredDistance; vector< vector<double> > kernel(const vector< vector<double> > &data, double sigma) { // TODO transform the data points to kernel space // here we are going to implement RBF kernel, K(x_i, x_j) = e^{\frac{-|x_i - x_j|^2}{2 \sigma^2}} return data; } }; #endif
23.105263
105
0.660592
[ "vector", "transform" ]
031f9589493d3168bb0a0064ce6cebff6d6d88c1
11,292
c
C
lib/shader.c
sishui/nova-ejoy2d
6ca3df5160f857c2f8d996a7b3acfcc1bc343e22
[ "MIT" ]
1,296
2015-01-03T10:17:54.000Z
2022-03-10T06:56:02.000Z
lib/shader.c
sishui/nova-ejoy2d
6ca3df5160f857c2f8d996a7b3acfcc1bc343e22
[ "MIT" ]
23
2015-02-07T04:05:08.000Z
2022-01-24T06:07:23.000Z
lib/shader.c
sishui/nova-ejoy2d
6ca3df5160f857c2f8d996a7b3acfcc1bc343e22
[ "MIT" ]
474
2015-01-05T09:36:45.000Z
2022-03-30T16:52:44.000Z
#include "shader.h" #include "material.h" #include "fault.h" #include "array.h" #include "renderbuffer.h" #include "texture.h" #include "matrix.h" #include "spritepack.h" #include "screen.h" #include "label.h" #include "render.h" #include "blendmode.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <stdbool.h> #define MAX_PROGRAM 16 #define BUFFER_OFFSET(f) ((intptr_t)&(((struct vertex *)NULL)->f)) #define MAX_UNIFORM 16 #define MAX_TEXTURE_CHANNEL 8 struct uniform { int loc; int offset; enum UNIFORM_FORMAT type; }; struct program { RID prog; struct material * material; int texture_number; int uniform_number; struct uniform uniform[MAX_UNIFORM]; bool reset_uniform; bool uniform_change[MAX_UNIFORM]; float uniform_value[MAX_UNIFORM * 16]; }; struct render_state { struct render * R; int current_program; struct program program[MAX_PROGRAM]; RID tex[MAX_TEXTURE_CHANNEL]; int blendchange; int drawcall; RID vertex_buffer; RID index_buffer; RID layout; struct render_buffer vb; }; static struct render_state *RS = NULL; void lsprite_initrender(struct render *r); void shader_init() { if (RS) return; struct render_state * rs = (struct render_state *) malloc(sizeof(*rs)); memset(rs, 0 , sizeof(*rs)); struct render_init_args RA; // todo: config these args RA.max_buffer = 128; RA.max_layout = 4; RA.max_target = 128; RA.max_texture = 256; RA.max_shader = MAX_PROGRAM; int rsz = render_size(&RA); rs->R = (struct render *)malloc(rsz); rs->R = render_init(&RA, rs->R, rsz); texture_initrender(rs->R); screen_initrender(rs->R); label_initrender(rs->R); lsprite_initrender(rs->R); renderbuffer_initrender(rs->R); rs->current_program = -1; rs->blendchange = 0; render_setblend(rs->R, BLEND_ONE, BLEND_ONE_MINUS_SRC_ALPHA); uint16_t idxs[6 * MAX_COMMBINE]; int i; for (i=0;i<MAX_COMMBINE;i++) { idxs[i*6] = i*4; idxs[i*6+1] = i*4+1; idxs[i*6+2] = i*4+2; idxs[i*6+3] = i*4; idxs[i*6+4] = i*4+2; idxs[i*6+5] = i*4+3; } rs->index_buffer = render_buffer_create(rs->R, INDEXBUFFER, idxs, 6 * MAX_COMMBINE, sizeof(uint16_t)); rs->vertex_buffer = render_buffer_create(rs->R, VERTEXBUFFER, NULL, 4 * MAX_COMMBINE, sizeof(struct vertex)); struct vertex_attrib va[4] = { { "position", 0, 2, sizeof(float), BUFFER_OFFSET(vp.vx) }, { "texcoord", 0, 2, sizeof(uint16_t), BUFFER_OFFSET(vp.tx) }, { "color", 0, 4, sizeof(uint8_t), BUFFER_OFFSET(rgba) }, { "additive", 0, 4, sizeof(uint8_t), BUFFER_OFFSET(add) }, }; rs->layout = render_register_vertexlayout(rs->R, sizeof(va)/sizeof(va[0]), va); render_set(rs->R, VERTEXLAYOUT, rs->layout, 0); render_set(rs->R, INDEXBUFFER, rs->index_buffer, 0); render_set(rs->R, VERTEXBUFFER, rs->vertex_buffer, 0); RS = rs; } void shader_reset() { struct render_state *rs = RS; render_state_reset(rs->R); render_setblend(rs->R, BLEND_ONE, BLEND_ONE_MINUS_SRC_ALPHA); if (RS->current_program != -1) { render_shader_bind(rs->R, RS->program[RS->current_program].prog); } render_set(rs->R, VERTEXLAYOUT, rs->layout, 0); render_set(rs->R, TEXTURE, RS->tex[0], 0); render_set(rs->R, INDEXBUFFER, RS->index_buffer,0); render_set(rs->R, VERTEXBUFFER, RS->vertex_buffer,0); } static void program_init(struct program * p, const char *FS, const char *VS, int texture, const char ** texture_uniform_name) { struct render *R = RS->R; memset(p, 0, sizeof(*p)); struct shader_init_args args; args.vs = VS; args.fs = FS; args.texture = texture; args.texture_uniform = texture_uniform_name; p->prog = render_shader_create(R, &args); render_shader_bind(R, p->prog); render_shader_bind(R, 0); } void shader_load(int prog, const char *fs, const char *vs, int texture, const char ** texture_uniform_name) { struct render_state *rs = RS; assert(prog >=0 && prog < MAX_PROGRAM); struct program * p = &rs->program[prog]; if (p->prog) { render_release(RS->R, SHADER, p->prog); p->prog = 0; } program_init(p, fs, vs, texture, texture_uniform_name); p->texture_number = texture; RS->current_program = -1; } void shader_unload() { if (RS == NULL) { return; } struct render *R = RS->R; texture_initrender(NULL); screen_initrender(NULL); label_initrender(NULL); lsprite_initrender(NULL); renderbuffer_initrender(NULL); render_exit(R); free(R); free(RS); RS = NULL; } void reset_drawcall_count() { if (RS) { RS->drawcall = 0; } } int drawcall_count() { if (RS) { return RS->drawcall; } else { return 0; } } static void renderbuffer_commit(struct render_buffer * rb) { struct render *R = RS->R; render_draw(R, DRAW_TRIANGLE, 0, 6 * rb->object); } static void rs_commit() { struct render_buffer * rb = &(RS->vb); if (rb->object == 0) return; RS->drawcall++; struct render *R = RS->R; render_buffer_update(R, RS->vertex_buffer, rb->vb, 4 * rb->object); renderbuffer_commit(rb); rb->object = 0; } void shader_drawbuffer(struct render_buffer * rb, float tx, float ty, float scale) { rs_commit(); RID glid = texture_glid(rb->texid); if (glid == 0) return; shader_texture(glid, 0); render_set(RS->R, VERTEXBUFFER, rb->vbid, 0); float sx = scale; float sy = scale; screen_trans(&sx, &sy); screen_trans(&tx, &ty); float v[4] = { sx, sy, tx, ty }; // we should call shader_adduniform to add "st" uniform first shader_setuniform(PROGRAM_RENDERBUFFER, 0, UNIFORM_FLOAT4, v); shader_program(PROGRAM_RENDERBUFFER, NULL); RS->drawcall++; renderbuffer_commit(rb); render_set(RS->R, VERTEXBUFFER, RS->vertex_buffer, 0); } void shader_texture(int id, int channel) { assert(channel < MAX_TEXTURE_CHANNEL); if (RS->tex[channel] != id) { rs_commit(); RS->tex[channel] = id; render_set(RS->R, TEXTURE, id, channel); } } static void apply_uniform(struct program *p) { struct render *R = RS->R; int i; for (i=0;i<p->uniform_number;i++) { if (p->uniform_change[i]) { struct uniform * u = &p->uniform[i]; if (u->loc >=0) render_shader_setuniform(R, u->loc, u->type, p->uniform_value + u->offset); } } p->reset_uniform = false; } void shader_program(int n, struct material *m) { struct program *p = &RS->program[n]; if (RS->current_program != n || p->reset_uniform || m) { rs_commit(); } if (RS->current_program != n) { RS->current_program = n; render_shader_bind(RS->R, p->prog); p->material = NULL; apply_uniform(p); } else if (p->reset_uniform) { apply_uniform(p); } if (m) { material_apply(n, m); } } void shader_draw(const struct vertex_pack vb[4], uint32_t color, uint32_t additive) { if (renderbuffer_add(&RS->vb, vb, color, additive)) { rs_commit(); } } static void draw_quad(const struct vertex_pack *vbp, uint32_t color, uint32_t additive, int max, int index) { struct vertex_pack vb[4]; int i; vb[0] = vbp[0]; // first point for (i=1;i<4;i++) { int j = i + index; int n = (j <= max) ? j : max; vb[i] = vbp[n]; } shader_draw(vb, color, additive); } void shader_drawpolygon(int n, const struct vertex_pack *vb, uint32_t color, uint32_t additive) { int i = 0; --n; do { draw_quad(vb, color, additive, n, i); i+=2; } while (i<n-1); } void shader_flush() { rs_commit(); } void shader_defaultblend() { if (RS->blendchange) { rs_commit(); RS->blendchange = 0; render_setblend(RS->R, BLEND_ONE, BLEND_ONE_MINUS_SRC_ALPHA); } } void shader_blend(int m1, int m2) { if (m1 != BLEND_GL_ONE || m2 != BLEND_GL_ONE_MINUS_SRC_ALPHA) { rs_commit(); RS->blendchange = 1; enum BLEND_FORMAT src = blend_mode(m1); enum BLEND_FORMAT dst = blend_mode(m2); render_setblend(RS->R, src, dst); } } void shader_clear(unsigned long argb) { render_clear(RS->R, MASKC, argb); } int shader_version() { return render_version(RS->R); } void shader_scissortest(int enable) { render_enablescissor(RS->R, enable); } int shader_uniformsize(enum UNIFORM_FORMAT t) { int n = 0; switch(t) { case UNIFORM_INVALID: n = 0; break; case UNIFORM_FLOAT1: n = 1; break; case UNIFORM_FLOAT2: n = 2; break; case UNIFORM_FLOAT3: n = 3; break; case UNIFORM_FLOAT4: n = 4; break; case UNIFORM_FLOAT33: n = 9; break; case UNIFORM_FLOAT44: n = 16; break; } return n; } void shader_setuniform(int prog, int index, enum UNIFORM_FORMAT t, float *v) { rs_commit(); struct program * p = &RS->program[prog]; assert(index >= 0 && index < p->uniform_number); struct uniform *u = &p->uniform[index]; assert(t == u->type); int n = shader_uniformsize(t); memcpy(p->uniform_value + u->offset, v, n * sizeof(float)); p->reset_uniform = true; p->uniform_change[index] = true; } int shader_adduniform(int prog, const char * name, enum UNIFORM_FORMAT t) { // reset current_program assert(prog >=0 && prog < MAX_PROGRAM); shader_program(prog, NULL); struct program * p = &RS->program[prog]; assert(p->uniform_number < MAX_UNIFORM); int loc = render_shader_locuniform(RS->R, name); int index = p->uniform_number++; struct uniform * u = &p->uniform[index]; u->loc = loc; u->type = t; if (index == 0) { u->offset = 0; } else { struct uniform * lu = &p->uniform[index-1]; u->offset = lu->offset + shader_uniformsize(lu->type); } if (loc < 0) return -1; return index; } // material system struct material { struct program *p; int texture[MAX_TEXTURE_CHANNEL]; bool uniform_enable[MAX_UNIFORM]; float uniform[1]; bool reset; }; int material_size(int prog) { if (prog < 0 || prog >= MAX_PROGRAM) return 0; struct program *p = &RS->program[prog]; if (p->uniform_number == 0 && p->texture_number == 0) { return 0; } struct uniform * lu = &p->uniform[p->uniform_number-1]; int total = lu->offset + shader_uniformsize(lu->type); return sizeof(struct material) + (total-1) * sizeof(float); } struct material * material_init(void *self, int size, int prog) { int rsz = material_size(prog); struct program *p = &RS->program[prog]; assert(size >= rsz); memset(self, 0, rsz); struct material * m = (struct material *)self; m->p = p; m->reset = false; int i; for (i=0;i<MAX_TEXTURE_CHANNEL;i++) { m->texture[i] = -1; } return m; } int material_setuniform(struct material *m, int index, int n, const float *v) { struct program * p = m->p; assert(index >= 0 && index < p->uniform_number); struct uniform * u = &p->uniform[index]; if (shader_uniformsize(u->type) != n) { return 1; } memcpy(m->uniform + u->offset, v, n * sizeof(float)); m->uniform_enable[index] = true; m->reset = true; return 0; } void material_apply(int prog, struct material *m) { struct program * p = m->p; if (p != &RS->program[prog]) return; if (p->material == m && !m->reset) { return; } m->reset = false; p->material = m; p->reset_uniform = true; int i; for (i=0;i<p->uniform_number;i++) { if (m->uniform_enable[i]) { struct uniform * u = &p->uniform[i]; if (u->loc >=0) { render_shader_setuniform(RS->R, u->loc, u->type, m->uniform + u->offset); } } } for (i=0;i<p->texture_number;i++) { int tex = m->texture[i]; if (tex >= 0) { RID glid = texture_glid(tex); if (glid) { shader_texture(glid, i); } } } } int material_settexture(struct material *m, int channel, int texture) { if (channel >= MAX_TEXTURE_CHANNEL) { return 1; } m->texture[channel] = texture; m->reset = true; return 0; }
22.054688
115
0.668881
[ "render", "object" ]
031ff442a6a4348d5d548b8ddcbb5caf302f8983
2,175
h
C
external/kernel-headers/original/asm-mips/fpregdef.h
ghsecuritylab/android_platform_sony_nicki
526381be7808e5202d7865aa10303cb5d249388a
[ "Apache-2.0" ]
null
null
null
external/kernel-headers/original/asm-mips/fpregdef.h
ghsecuritylab/android_platform_sony_nicki
526381be7808e5202d7865aa10303cb5d249388a
[ "Apache-2.0" ]
null
null
null
external/kernel-headers/original/asm-mips/fpregdef.h
ghsecuritylab/android_platform_sony_nicki
526381be7808e5202d7865aa10303cb5d249388a
[ "Apache-2.0" ]
1
2020-03-08T00:59:27.000Z
2020-03-08T00:59:27.000Z
/* * Definitions for the FPU register names * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1995, 1999 Ralf Baechle * Copyright (C) 1985 MIPS Computer Systems, Inc. * Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc. */ #ifndef _ASM_FPREGDEF_H #define _ASM_FPREGDEF_H #include <asm/sgidefs.h> #if _MIPS_SIM == _MIPS_SIM_ABI32 /* * These definitions only cover the R3000-ish 16/32 register model. * But we're trying to be R3000 friendly anyway ... */ #define fv0 $f0 /* return value */ #define fv0f $f1 #define fv1 $f2 #define fv1f $f3 #define fa0 $f12 /* argument registers */ #define fa0f $f13 #define fa1 $f14 #define fa1f $f15 #define ft0 $f4 /* caller saved */ #define ft0f $f5 #define ft1 $f6 #define ft1f $f7 #define ft2 $f8 #define ft2f $f9 #define ft3 $f10 #define ft3f $f11 #define ft4 $f16 #define ft4f $f17 #define ft5 $f18 #define ft5f $f19 #define fs0 $f20 /* callee saved */ #define fs0f $f21 #define fs1 $f22 #define fs1f $f23 #define fs2 $f24 #define fs2f $f25 #define fs3 $f26 #define fs3f $f27 #define fs4 $f28 #define fs4f $f29 #define fs5 $f30 #define fs5f $f31 #define fcr31 $31 /* FPU status register */ #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ #if ((_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32)) #define fv0 $f0 /* return value */ #define fv1 $f2 #define fa0 $f12 /* argument registers */ #define fa1 $f13 #define fa2 $f14 #define fa3 $f15 #define fa4 $f16 #define fa5 $f17 #define fa6 $f18 #define fa7 $f19 #define ft0 $f4 /* caller saved */ #define ft1 $f5 #define ft2 $f6 #define ft3 $f7 #define ft4 $f8 #define ft5 $f9 #define ft6 $f10 #define ft7 $f11 #define ft8 $f20 #define ft9 $f21 #define ft10 $f22 #define ft11 $f23 #define ft12 $f1 #define ft13 $f3 #define fs0 $f24 /* callee saved */ #define fs1 $f25 #define fs2 $f26 #define fs3 $f27 #define fs4 $f28 #define fs5 $f29 #define fs6 $f30 #define fs7 $f31 #define fcr31 $31 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */ #endif /* _ASM_FPREGDEF_H */
21.75
77
0.693333
[ "model" ]
032488408095692f8a1f0fbddf6536f3adbdabe4
20,974
h
C
Search.h
RaulRomani/Advanced-Pathfinding
716422dae3e7d5ec7cd94ee738a6fe17787df91e
[ "MIT" ]
2
2021-03-18T03:16:10.000Z
2021-03-28T15:07:11.000Z
Search.h
RaulRomani/Advanced-Pathfinding
716422dae3e7d5ec7cd94ee738a6fe17787df91e
[ "MIT" ]
null
null
null
Search.h
RaulRomani/Advanced-Pathfinding
716422dae3e7d5ec7cd94ee738a6fe17787df91e
[ "MIT" ]
1
2020-11-20T08:46:57.000Z
2020-11-20T08:46:57.000Z
#ifndef H_SEARCH #define H_SEARCH #include <bits/stdc++.h> #include "MapGraph.h" #include "Location.h" template<typename No, typename Ed> struct EntryGreaterCompare { bool operator()(const pair<No, Ed>& l, const pair<No, Ed>& r) const { return l.second > r.second; } }; class Search{ private: typedef CGraph<Location, double>::E E; typedef CGraph<Location, double>::N N; typedef CGraph<Location, double>::Edge Edge; typedef EntryGreaterCompare<N, E> EntryCmp; typedef EntryGreaterCompare<int, E> EntryOCmp; typedef pair<N, E> Entry; typedef pair<int, E> EntryO; public: list<N>* reconstructPath(N start,N middle, N goal, map<N, N, LocationCompare> parentMap, map<N, N, LocationCompare> rparentMap) { list<N>* path = new list<N>(); N curr = middle; while (curr != start) { // cout<<curr<<" "; path->push_front(curr); curr = parentMap.at(curr); } path->push_front(start); // cout<<start<<" "; curr = rparentMap.at(middle); while (curr != goal) { // cout<<curr<<" "; path->push_back(curr); curr = rparentMap.at(curr); } path->push_back(goal); // cout<<goal<<" "; return path; } list<N>* reconstructPath(N start, N goal, map<N, N, LocationCompare> parentMap) { list<N>* path = new list<N>(); N curr = goal; while (curr != start) { path->push_front(curr); curr = parentMap.at(curr); } path->push_front(start); return path; } list<N>* reconstructPathReverse(N start, N goal, map<N, N, LocationCompare> parentMap) { list<N>* path = new list<N>(); N curr = goal; while (curr != start) { path->push_back(curr); curr = parentMap.at(curr); } path->push_back(start); return path; } list<N>* reconstructPathReverse(CGraph<Location, E>& graph, int idStart, int idGoal, vector<int> parentMap) { list<N>* path = new list<N>(); N loc; int curr = idGoal; while (curr != idStart) { loc = graph.getNodeFromId(curr); path->push_front(loc); curr = parentMap[curr]; } loc = graph.getNodeFromId(idStart); path->push_front(loc); return path; } list<N>* reconstructPath(CGraph<Location, E>& graph, int idStart, int idGoal, vector<int> parentMap) { list<N>* path = new list<N>(); N loc; int curr = idGoal; while (curr != idStart) { loc = graph.getNodeFromId(curr); path->push_front(loc); curr = parentMap[curr]; } loc = graph.getNodeFromId(idStart); path->push_front(loc); return path; } list<N>* reconstructPath(CGraph<Location, E>& graph, int idStart,int idMiddle, int idGoal, vector<int> parentMap, vector<int> rparentMap) { list<N>* path = new list<N>(); N loc; int curr = idMiddle; while (curr != idStart) { loc = graph.getNodeFromId(curr); path->push_front(loc); curr = parentMap[curr]; } loc = graph.getNodeFromId(idStart); path->push_front(loc); curr = rparentMap[idMiddle]; while (curr != idGoal) { loc = graph.getNodeFromId(curr); path->push_back(loc); curr = rparentMap[curr]; } loc = graph.getNodeFromId(idGoal); path->push_back(loc); return path; } E distFromPath(list<N>* path){ E dist=0.0; auto end = path->end(); --end; for(auto i=path->begin(); i != end; ++i){ dist += (*i).dist(*(++i)); i--; } return dist; } //Dijkstra return shortest dist E dijkstraDist(CGraph<Location, E>& graph,N start, N goal) { // if (start == null || goal == null) { // System.out.println("Start or goal node is null! No path exists."); // return null; // } map<N, N, LocationCompare> parentMap; // find the goal with dijkstra bool found = dijkstraSearch(graph,start, goal, parentMap); if (!found) { cout << "No path exists" << endl; return 0.0; } list<N>* path = reconstructPath(start, goal, parentMap); return distFromPath(path); } list<N>* dijkstra(CGraph<Location, E>& graph,N start, N goal) { // if (start == null || goal == null) { // System.out.println("Start or goal node is null! No path exists."); // return null; // } map<N, N, LocationCompare> parentMap; // find the goal with dijkstra bool found = dijkstraSearch(graph,start, goal, parentMap); if (!found) { cout << "No path exists" << endl; return NULL; } // reconstruct the path return reconstructPath(start, goal, parentMap); } bool dijkstraSearch(CGraph<Location, double>& graph, N start, N goal, map<Location, Location, LocationCompare>& parentMap) { // In order to add visited vertices set<N, LocationCompare> visited; // to keep track of the shortest path between src and dist[v] map<N, E, LocationCompare> dist; for (N node : graph.getVertices()) dist.insert(make_pair(node, INF)); // Mark the start node dist[start] = 0.0; priority_queue <Entry, vector<Entry>, EntryCmp> pQueue; priority_queue <Entry, vector<Entry>, EntryCmp> rpQueue; // Mark the start node as visited and enqueue it Entry entry; entry.first = start; entry.second = 0.0; //Warning: Assuming E is double pQueue.push(entry); bool found = false; Entry curr; int nroNodesVisited = 0; while (!pQueue.empty()) { // Dequeue a vertex from queue curr = pQueue.top(); pQueue.pop(); nroNodesVisited++;nroNodesVisited++; cout << "\nDijkstra visiting[NODE] at location " << curr.first << endl; cout << "Min Dist: " << curr.second << endl; if (visited.find(curr.first) == visited.end()) { visited.insert(curr.first); if (curr.first.isEquals(goal)) { found = true; break; } // Get all adjacent vertices (neighbors) of the dequeued vertex curr try { list<Edge*> neighbors = graph.getOutGoingEdges(curr.first); cout<<"Neighbors: " << neighbors.size()<<endl; for (Edge* neighbor : neighbors) { //USAR ALIAS N& next = neighbor->nodes[1]->data; // nodes[1] == dest //MODIFICATION FOR BIRECTIONAL(UNDIRECTED) GRAPH if (visited.find(next) == visited.end()) { double greedyScore = dist.at(curr.first) + neighbor->length; /* *A ***/ double nextToGoal = Location(next.getX(),next.getY()).dist(goal); double heuristic = greedyScore+ nextToGoal; /* END *A ***/ cout<<"Vertex: " << next<<endl; if (dist.at(next) > greedyScore) { // || dist(Next) == INF cout<<"Dist before: " << to_string(dist.at(next))<<endl; cout<<"Dist after: " << to_string(greedyScore)<<endl; dist[next] = greedyScore; /* *A ***/ // pQueue.push(make_pair(next, heuristic)); /* END *A ***/ /* Dijkstra ***/ pQueue.push(make_pair(next, greedyScore)); /* END Dijkstra ***/ parentMap[next] = curr.first; } } } } catch (exception& e) { cout << "Out of range exception: " << e.what() << '\n'; } } } cout << "# nodes visited: " << nroNodesVisited << endl; return found; } list<N>* biDijkstraO(CGraph<Location, E>& graph, N start, N goal) { // if (start == null || goal == null) { // cout<<"Start or goal node is null! No path exists."; // return NULL; // } vector<int> parentMap(graph.nNodes); vector<int> rparentMap(graph.nNodes); int idMiddle; // find the goal with dijkstra bool found = biDijkstraSearchO(graph, start,idMiddle, goal, parentMap,rparentMap); if (!found) { cout << "No path exists" << endl; return NULL; } int idStart = graph.getIdFromNode(start); int idGoal = graph.getIdFromNode(goal); if (idMiddle == idStart){ cout<<"middle = start"<<endl; return reconstructPathReverse(graph,idGoal,idStart,rparentMap); }else if (idMiddle == idGoal){ cout<<"middle = goal"<<endl; return reconstructPath(graph, idStart,idGoal,parentMap); } // // reconstruct the path return reconstructPath(graph,idStart,idMiddle, idGoal, parentMap, rparentMap); } bool biDijkstraSearchO(CGraph<Location, double>& graph, N start, int& idMiddle, N goal, vector<int>& parentMap, vector<int>& rparentMap) { int idStart = graph.getIdFromNode(start); int idGoal = graph.getIdFromNode(goal); // In order to add visited vertices bitset<16> visited; bitset<16> rVisited; // to keep track of the shortest path between src and dist[v] vector<E> dist(graph.nNodes), rdist(graph.nNodes); for (int i=0; i<graph.nNodes; ++i) { dist[i] = INF; rdist[i] = INF; } // Mark the start node dist[idStart] = 0.0; // Mark the goal node rdist[idGoal] = 0.0; priority_queue <EntryO, vector<EntryO>, EntryOCmp> pQueue; priority_queue <EntryO, vector<EntryO>, EntryOCmp> rpQueue; // Mark the start node as visited and enqueue it EntryO entry; entry.first = idStart; entry.second = 0.0; //Warning: Assuming E is double pQueue.push(entry); // Mark the end node as visited and enqueue it entry.first = idGoal; entry.second = 0.0; rpQueue.push(entry); bool found = false; EntryO curr, rcurr; int nroNodesVisited = 0; while (!pQueue.empty()&& !rpQueue.empty()) { // Dequeue a vertex from queue curr = pQueue.top(); pQueue.pop(); rcurr = rpQueue.top(); rpQueue.pop(); cout << "curr: " << curr.first << endl; cout << "rcurr: " << rcurr.first << endl; nroNodesVisited++; if (curr.first == rcurr.first) { found = true; idMiddle = curr.first; cout<<"curr == rcurr"<<endl; break; } else if (curr.first==idGoal) { found = true; cout<<"curr == goal"<<endl; idMiddle = idGoal; break; } else if (rcurr.first == idStart) { found = true; cout<<"curr == start"<<endl; idMiddle = idStart; break; } cout << "\nDijkstra visiting[NODE] at location " << curr.first << endl; cout << "Min Dist: " << curr.second << endl; if (visited[curr.first] == 0) { // si no ha sido visitado visited[curr.first] = 1; cout << "from start to goal" << endl; // Get all adjacent vertices (neighbors) of the dequeued vertex curr try { list<Edge*> neighbors = graph.getOutGoingEdges(curr.first); cout << "Neighbors: " << neighbors.size() << endl; for (Edge* neighbor : neighbors) { N next = neighbor->nodes[1]->data; // nodes[1] == dest int idNext = graph.getIdFromNode(next); double greedyScore = dist[curr.first] + neighbor->length; /* *A ***/ double nextToGoal = Location(next.getX(), next.getY()).dist(goal); double heuristic = greedyScore + nextToGoal; /* END *A ***/ cout << "Vertex: " << next << endl; if (greedyScore < dist[idNext] ) { // || dist(Next) == INF cout << "Dist before: " << to_string(dist[idNext]) << endl; cout << "Dist after: " << to_string(greedyScore) << endl; cout << "Heuristic: " << to_string(heuristic) << endl; dist[idNext] = greedyScore; /* *A ***/ pQueue.push(make_pair(idNext, heuristic)); /* END *A ***/ /* Dijkstra ***/ // pQueue.push(make_pair(next, greedyScore)); /* END Dijkstra ***/ parentMap[idNext] = curr.first; } } } catch (exception& e) { cout << "Out of range exception: " << e.what() << '\n'; } } nroNodesVisited++; curr = pQueue.top(); if (curr.first == rcurr.first) { cout << "found: " << curr.first << " = " << rcurr.first << endl; idMiddle = curr.first; found = true; break; } cout << "\nReverse Dijkstra visiting[NODE] at location " << rcurr.first << endl; cout << "Min Dist: " << rcurr.second << endl; if (rVisited[rcurr.first] == 0) { rVisited[rcurr.first] = 1; // Get all adjacent vertices (neighbors) of the dequeued vertex rcurr try { list<Edge*> neighbors = graph.getOutGoingEdges(rcurr.first); cout << "Neighbors: " << neighbors.size() << endl; for (Edge* neighbor : neighbors) { N next = neighbor->nodes[1]->data; // nodes[1] == dest int idNext = graph.getIdFromNode(next); double greedyScore = rdist.at(rcurr.first) + neighbor->length; /* *A ***/ double nextToGoal = Location(next.getX(), next.getY()).dist(start); double heuristic = greedyScore + nextToGoal; /* END *A ***/ cout << "Vertex: " << next << endl; if (greedyScore < rdist[idNext]) { // || dist(Next) == INF cout << "Dist before: " << to_string(rdist[idNext]) << endl; cout << "Dist after: " << to_string(greedyScore) << endl; cout << "Heuristic: " << to_string(heuristic) << endl; rdist[idNext] = greedyScore; /* *A ***/ rpQueue.push(make_pair(idNext, heuristic)); /* END *A ***/ /* Dijkstra ***/ // rpQueue.push(make_pair(next, greedyScore)); /* END Dijkstra ***/ rparentMap[idNext] = rcurr.first; } } } catch (exception& e) { cout << "Out of range exception: " << e.what() << '\n'; } } cout << endl << "---------------------------------------------------" << endl; } cout << "# nodes visited: " << nroNodesVisited << endl; return found; } list<N>* biBFS(CGraph<Location, E>& graph, N start, N goal) { // if (start == null || goal == null) { // cout<<"Start or goal node is null! No path exists."; // return NULL; // } vector<int> parentMap(graph.nNodes); vector<int> rparentMap(graph.nNodes); int idMiddle; // find the goal with dijkstra bool found = biBFSSearch(graph, start,idMiddle, goal, parentMap,rparentMap); if (!found) { cout << "No path exists" << endl; return NULL; } int idStart = graph.getIdFromNode(start); int idGoal = graph.getIdFromNode(goal); if (idMiddle == idStart){ cout<<"middle = start"<<endl; return reconstructPathReverse(graph,idGoal,idStart,rparentMap); }else if (idMiddle == idGoal){ cout<<"middle = goal"<<endl; return reconstructPath(graph, idStart,idGoal,parentMap); } // // reconstruct the path return reconstructPath(graph,idStart,idMiddle, idGoal, parentMap, rparentMap); } bool biBFSSearch(CGraph<Location, double>& graph, N start, int& idMiddle, N goal, vector<int>& parentMap, vector<int>& rparentMap) { int idStart = graph.getIdFromNode(start); int idGoal = graph.getIdFromNode(goal); // In order to add visited vertices bitset<16> visited; bitset<16> rVisited; priority_queue <EntryO, vector<EntryO>, EntryOCmp> pQueue; priority_queue <EntryO, vector<EntryO>, EntryOCmp> rpQueue; // Mark the start node as visited and enqueue it EntryO entry; entry.first = idStart; entry.second = 0.0; //Warning: Assuming E is double pQueue.push(entry); // Mark the end node as visited and enqueue it entry.first = idGoal; entry.second = 0.0; rpQueue.push(entry); bool found = false; EntryO curr, rcurr; int nroNodesVisited = 0; while (!pQueue.empty()&& !rpQueue.empty()) { // Dequeue a vertex from queue curr = pQueue.top(); pQueue.pop(); rcurr = rpQueue.top(); rpQueue.pop(); cout << "curr: " << curr.first << endl; cout << "rcurr: " << rcurr.first << endl; nroNodesVisited++; if (curr.first == rcurr.first) { found = true; idMiddle = curr.first; cout<<"curr == rcurr"<<endl; break; } else if (curr.first==idGoal) { found = true; cout<<"curr == goal"<<endl; idMiddle = idGoal; break; } else if (rcurr.first == idStart) { found = true; cout<<"curr == start"<<endl; idMiddle = idStart; break; } cout << "\nDijkstra visiting[NODE] at location " << curr.first << endl; cout << "Min Dist: " << curr.second << endl; if (visited[curr.first] == 0) { // si no ha sido visitado visited[curr.first] = 1; cout << "from start to goal" << endl; // Get all adjacent vertices (neighbors) of the dequeued vertex curr try { list<Edge*> neighbors = graph.getOutGoingEdges(curr.first); cout << "Neighbors: " << neighbors.size() << endl; for (Edge* neighbor : neighbors) { N next = neighbor->nodes[1]->data; // nodes[1] == dest int idNext = graph.getIdFromNode(next); // double greedyScore = dist[curr.first] + neighbor->length; /* *A ***/ double nextToGoal = Location(next.getX(), next.getY()).dist(goal); double heuristic = nextToGoal; /* END *A ***/ cout << "Vertex: " << next << endl; if (!visited[idNext]) { cout << "Heuristic: " << to_string(heuristic) << endl; /* *A ***/ pQueue.push(make_pair(idNext, heuristic)); /* END *A ***/ /* Dijkstra ***/ // pQueue.push(make_pair(next, greedyScore)); /* END Dijkstra ***/ parentMap[idNext] = curr.first; } } } catch (exception& e) { cout << "Out of range exception: " << e.what() << '\n'; } } nroNodesVisited++; curr = pQueue.top(); if (curr.first == rcurr.first) { cout << "found in middle: " << curr.first << " = " << rcurr.first << endl; idMiddle = curr.first; found = true; break; } cout << "\nReverse Dijkstra visiting[NODE] at location " << rcurr.first << endl; cout << "Min Dist: " << rcurr.second << endl; if (rVisited[rcurr.first] == 0) { rVisited[rcurr.first] = 1; // Get all adjacent vertices (neighbors) of the dequeued vertex rcurr try { list<Edge*> neighbors = graph.getOutGoingEdges(rcurr.first); cout << "Neighbors: " << neighbors.size() << endl; for (Edge* neighbor : neighbors) { N next = neighbor->nodes[1]->data; // nodes[1] == dest int idNext = graph.getIdFromNode(next); /* *A ***/ double nextToGoal = Location(next.getX(), next.getY()).dist(start); double heuristic = nextToGoal; /* END *A ***/ cout << "Vertex: " << next << endl; if (!rVisited[idNext]) { cout << "Heuristic: " << to_string(heuristic) << endl; /* *A ***/ rpQueue.push(make_pair(idNext, heuristic)); /* END *A ***/ /* Dijkstra ***/ // rpQueue.push(make_pair(next, greedyScore)); /* END Dijkstra ***/ rparentMap[idNext] = rcurr.first; } } } catch (exception& e) { cout << "Out of range exception: " << e.what() << '\n'; } } cout << endl << "---------------------------------------------------" << endl; } cout << "# nodes visited: " << nroNodesVisited << endl; return found; } }; #endif
31.351271
127
0.523744
[ "vector" ]
032bc44de63558462466f409c75b80d9a5e08b3f
43,317
c
C
pandas/src/period_helper.c
certik/pandas
758ca05e2eb04532b5d78331ba87c291038e2c61
[ "PSF-2.0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
2
2015-09-03T17:39:02.000Z
2017-12-31T15:39:02.000Z
pandas/src/period_helper.c
certik/pandas
758ca05e2eb04532b5d78331ba87c291038e2c61
[ "PSF-2.0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
pandas/src/period_helper.c
certik/pandas
758ca05e2eb04532b5d78331ba87c291038e2c61
[ "PSF-2.0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
2
2016-02-26T05:47:12.000Z
2020-01-08T18:05:00.000Z
#include "period_helper.h" /* * Borrowed and derived code from scikits.timeseries that we will expose via * Cython to pandas. This primarily concerns period representation and * frequency conversion routines. */ /* see end of file for stuff pandas uses (search for 'pandas') */ /* ------------------------------------------------------------------ * Code derived from scikits.timeseries * ------------------------------------------------------------------*/ static int mod_compat(int x, int m) { int result = x % m; if (result < 0) return result + m; return result; } static int floordiv(int x, int divisor) { if (x < 0) { if (mod_compat(x, divisor)) { return x / divisor - 1; } else return x / divisor; } else { return x / divisor; } } static asfreq_info NULL_AF_INFO; /* Table with day offsets for each month (0-based, without and with leap) */ static int month_offset[2][13] = { { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; /* Table of number of days in a month (0-based, without and with leap) */ static int days_in_month[2][12] = { { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; /* Return 1/0 iff year points to a leap year in calendar. */ static int dInfoCalc_Leapyear(npy_int64 year, int calendar) { if (calendar == GREGORIAN_CALENDAR) { return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)); } else { return (year % 4 == 0); } } /* Return the day of the week for the given absolute date. */ static int dInfoCalc_DayOfWeek(npy_int64 absdate) { int day_of_week; if (absdate >= 1) { day_of_week = (absdate - 1) % 7; } else { day_of_week = 6 - ((-absdate) % 7); } return day_of_week; } static int monthToQuarter(int month) { return ((month-1)/3)+1; } /* Return the year offset, that is the absolute date of the day 31.12.(year-1) in the given calendar. Note: For the Julian calendar we shift the absdate (which is measured using the Gregorian Epoch) value by two days because the Epoch (0001-01-01) in the Julian calendar lies 2 days before the Epoch in the Gregorian calendar. */ static int dInfoCalc_YearOffset(npy_int64 year, int calendar) { year--; if (calendar == GREGORIAN_CALENDAR) { if (year >= 0 || -1/4 == -1) return year*365 + year/4 - year/100 + year/400; else return year*365 + (year-3)/4 - (year-99)/100 + (year-399)/400; } else if (calendar == JULIAN_CALENDAR) { if (year >= 0 || -1/4 == -1) return year*365 + year/4 - 2; else return year*365 + (year-3)/4 - 2; } Py_Error(PyExc_ValueError, "unknown calendar"); onError: return INT_ERR_CODE; } /* Set the instance's value using the given date and time. calendar may be set * to the flags: GREGORIAN_CALENDAR, JULIAN_CALENDAR to indicate the calendar * to be used. */ static int dInfoCalc_SetFromDateAndTime(struct date_info *dinfo, int year, int month, int day, int hour, int minute, double second, int calendar) { /* Calculate the absolute date */ { int leap; npy_int64 absdate; int yearoffset; /* Range check */ Py_AssertWithArg(year > -(INT_MAX / 366) && year < (INT_MAX / 366), PyExc_ValueError, "year out of range: %i", year); /* Is it a leap year ? */ leap = dInfoCalc_Leapyear(year, calendar); /* Negative month values indicate months relative to the years end */ if (month < 0) month += 13; Py_AssertWithArg(month >= 1 && month <= 12, PyExc_ValueError, "month out of range (1-12): %i", month); /* Negative values indicate days relative to the months end */ if (day < 0) day += days_in_month[leap][month - 1] + 1; Py_AssertWithArg(day >= 1 && day <= days_in_month[leap][month - 1], PyExc_ValueError, "day out of range: %i", day); yearoffset = dInfoCalc_YearOffset(year, calendar); if (PyErr_Occurred()) goto onError; absdate = day + month_offset[leap][month - 1] + yearoffset; dinfo->absdate = absdate; dinfo->year = year; dinfo->month = month; dinfo->quarter = ((month-1)/3)+1; dinfo->day = day; dinfo->day_of_week = dInfoCalc_DayOfWeek(absdate); dinfo->day_of_year = (short)(absdate - yearoffset); dinfo->calendar = calendar; } /* Calculate the absolute time */ { Py_AssertWithArg(hour >= 0 && hour <= 23, PyExc_ValueError, "hour out of range (0-23): %i", hour); Py_AssertWithArg(minute >= 0 && minute <= 59, PyExc_ValueError, "minute out of range (0-59): %i", minute); Py_AssertWithArg(second >= (double)0.0 && (second < (double)60.0 || (hour == 23 && minute == 59 && second < (double)61.0)), PyExc_ValueError, "second out of range (0.0 - <60.0; <61.0 for 23:59): %f", second); dinfo->abstime = (double)(hour*3600 + minute*60) + second; dinfo->hour = hour; dinfo->minute = minute; dinfo->second = second; } return 0; onError: return INT_ERR_CODE; } /* Sets the date part of the date_info struct using the indicated calendar. XXX This could also be done using some integer arithmetics rather than with this iterative approach... */ static int dInfoCalc_SetFromAbsDate(register struct date_info *dinfo, npy_int64 absdate, int calendar) { register npy_int64 year; npy_int64 yearoffset; int leap,dayoffset; int *monthoffset; /* Approximate year */ if (calendar == GREGORIAN_CALENDAR) { year = (npy_int64)(((double)absdate) / 365.2425); } else if (calendar == JULIAN_CALENDAR) { year = (npy_int64)(((double)absdate) / 365.25); } else { Py_Error(PyExc_ValueError, "unknown calendar"); } if (absdate > 0) year++; /* Apply corrections to reach the correct year */ while (1) { /* Calculate the year offset */ yearoffset = dInfoCalc_YearOffset(year, calendar); if (PyErr_Occurred()) goto onError; /* Backward correction: absdate must be greater than the yearoffset */ if (yearoffset >= absdate) { year--; continue; } dayoffset = absdate - yearoffset; leap = dInfoCalc_Leapyear(year,calendar); /* Forward correction: non leap years only have 365 days */ if (dayoffset > 365 && !leap) { year++; continue; } break; } dinfo->year = year; dinfo->calendar = calendar; /* Now iterate to find the month */ monthoffset = month_offset[leap]; { register int month; for (month = 1; month < 13; month++) { if (monthoffset[month] >= dayoffset) break; } dinfo->month = month; dinfo->quarter = monthToQuarter(month); dinfo->day = dayoffset - month_offset[leap][month-1]; } dinfo->day_of_week = dInfoCalc_DayOfWeek(absdate); dinfo->day_of_year = dayoffset; dinfo->absdate = absdate; return 0; onError: return INT_ERR_CODE; } /////////////////////////////////////////////// // frequency specifc conversion routines // each function must take an integer fromDate and // a char relation ('S' or 'E' for 'START' or 'END') /////////////////////////////////////////////////////////////////////// // helpers for frequency conversion routines // static int daytime_conversion_factors[][2] = { { FR_DAY, 1 }, { FR_HR, 24 }, { FR_MIN, 60 }, { FR_SEC, 60 }, { FR_MS, 1000 }, { FR_US, 1000 }, { FR_NS, 1000 }, { 0, 0 } }; static npy_int64** daytime_conversion_factor_matrix = NULL; PANDAS_INLINE static int max_value(int a, int b) { return a > b ? a : b; } PANDAS_INLINE static int min_value(int a, int b) { return a < b ? a : b; } PANDAS_INLINE static int get_freq_group(int freq) { return (freq/1000)*1000; } PANDAS_INLINE static int get_freq_group_index(int freq) { return freq/1000; } static int calc_conversion_factors_matrix_size() { int matrix_size = 0; int index; for (index=0;; index++) { int period_value = get_freq_group_index(daytime_conversion_factors[index][0]); if (period_value == 0) { break; } matrix_size = max_value(matrix_size, period_value); } return matrix_size + 1; } static void alloc_conversion_factors_matrix(int matrix_size) { int row_index; int column_index; daytime_conversion_factor_matrix = malloc(matrix_size * sizeof(**daytime_conversion_factor_matrix)); for (row_index = 0; row_index < matrix_size; row_index++) { daytime_conversion_factor_matrix[row_index] = malloc(matrix_size * sizeof(**daytime_conversion_factor_matrix)); for (column_index = 0; column_index < matrix_size; column_index++) { daytime_conversion_factor_matrix[row_index][column_index] = 0; } } } static npy_int64 calculate_conversion_factor(int start_value, int end_value) { npy_int64 conversion_factor = 0; int index; for (index=0;; index++) { int freq_group = daytime_conversion_factors[index][0]; if (freq_group == 0) { conversion_factor = 0; break; } if (freq_group == start_value) { conversion_factor = 1; } else { conversion_factor *= daytime_conversion_factors[index][1]; } if (freq_group == end_value) { break; } } return conversion_factor; } static void populate_conversion_factors_matrix() { int row_index_index; int row_value, row_index; int column_index_index; int column_value, column_index; for (row_index_index = 0;; row_index_index++) { row_value = daytime_conversion_factors[row_index_index][0]; if (row_value == 0) { break; } row_index = get_freq_group_index(row_value); for (column_index_index = row_index_index;; column_index_index++) { column_value = daytime_conversion_factors[column_index_index][0]; if (column_value == 0) { break; } column_index = get_freq_group_index(column_value); daytime_conversion_factor_matrix[row_index][column_index] = calculate_conversion_factor(row_value, column_value); } } } void initialize_daytime_conversion_factor_matrix() { if (daytime_conversion_factor_matrix == NULL) { int matrix_size = calc_conversion_factors_matrix_size(); alloc_conversion_factors_matrix(matrix_size); populate_conversion_factors_matrix(); } } PANDAS_INLINE npy_int64 get_daytime_conversion_factor(int from_index, int to_index) { return daytime_conversion_factor_matrix[min_value(from_index, to_index)][max_value(from_index, to_index)]; } PANDAS_INLINE npy_int64 upsample_daytime(npy_int64 ordinal, asfreq_info *af_info, int atEnd) { if (atEnd) { return (ordinal + 1) * af_info->intraday_conversion_factor - 1; } else { return ordinal * af_info->intraday_conversion_factor; } } PANDAS_INLINE npy_int64 downsample_daytime(npy_int64 ordinal, asfreq_info *af_info, int atEnd) { return ordinal / (af_info->intraday_conversion_factor); } PANDAS_INLINE static npy_int64 transform_via_day(npy_int64 ordinal, char relation, asfreq_info *af_info, freq_conv_func first_func, freq_conv_func second_func) { //printf("transform_via_day(%ld, %ld, %d)\n", ordinal, af_info->intraday_conversion_factor, af_info->intraday_conversion_upsample); npy_int64 result; result = (*first_func)(ordinal, relation, af_info); result = (*second_func)(result, relation, af_info); return result; } static npy_int64 DtoB_weekday(npy_int64 absdate) { return (((absdate) / 7) * 5) + (absdate) % 7 - BDAY_OFFSET; } static npy_int64 DtoB_WeekendToMonday(npy_int64 absdate, int day_of_week) { if (day_of_week > 4) { //change to Monday after weekend absdate += (7 - day_of_week); } return DtoB_weekday(absdate); } static npy_int64 DtoB_WeekendToFriday(npy_int64 absdate, int day_of_week) { if (day_of_week > 4) { //change to friday before weekend absdate -= (day_of_week - 4); } return DtoB_weekday(absdate); } static npy_int64 absdate_from_ymd(int y, int m, int d) { struct date_info tempDate; if (dInfoCalc_SetFromDateAndTime(&tempDate, y, m, d, 0, 0, 0, GREGORIAN_CALENDAR)) { return INT_ERR_CODE; } return tempDate.absdate; } //************ FROM DAILY *************** static npy_int64 asfreq_DTtoA(npy_int64 ordinal, char relation, asfreq_info *af_info) { struct date_info dinfo; ordinal = downsample_daytime(ordinal, af_info, 0); if (dInfoCalc_SetFromAbsDate(&dinfo, ordinal + ORD_OFFSET, GREGORIAN_CALENDAR)) return INT_ERR_CODE; if (dinfo.month > af_info->to_a_year_end) { return (npy_int64)(dinfo.year + 1 - BASE_YEAR); } else { return (npy_int64)(dinfo.year - BASE_YEAR); } } static npy_int64 DtoQ_yq(npy_int64 ordinal, asfreq_info *af_info, int *year, int *quarter) { struct date_info dinfo; if (dInfoCalc_SetFromAbsDate(&dinfo, ordinal + ORD_OFFSET, GREGORIAN_CALENDAR)) return INT_ERR_CODE; if (af_info->to_q_year_end != 12) { dinfo.month -= af_info->to_q_year_end; if (dinfo.month <= 0) { dinfo.month += 12; } else { dinfo.year += 1; } dinfo.quarter = monthToQuarter(dinfo.month); } *year = dinfo.year; *quarter = dinfo.quarter; return 0; } static npy_int64 asfreq_DTtoQ(npy_int64 ordinal, char relation, asfreq_info *af_info) { int year, quarter; ordinal = downsample_daytime(ordinal, af_info, 0); if (DtoQ_yq(ordinal, af_info, &year, &quarter) == INT_ERR_CODE) { return INT_ERR_CODE; } return (npy_int64)((year - BASE_YEAR) * 4 + quarter - 1); } static npy_int64 asfreq_DTtoM(npy_int64 ordinal, char relation, asfreq_info *af_info) { struct date_info dinfo; ordinal = downsample_daytime(ordinal, af_info, 0); if (dInfoCalc_SetFromAbsDate(&dinfo, ordinal + ORD_OFFSET, GREGORIAN_CALENDAR)) return INT_ERR_CODE; return (npy_int64)((dinfo.year - BASE_YEAR) * 12 + dinfo.month - 1); } static npy_int64 asfreq_DTtoW(npy_int64 ordinal, char relation, asfreq_info *af_info) { ordinal = downsample_daytime(ordinal, af_info, 0); return (ordinal + ORD_OFFSET - (1 + af_info->to_week_end))/7 + 1 - WEEK_OFFSET; } static npy_int64 asfreq_DTtoB(npy_int64 ordinal, char relation, asfreq_info *af_info) { struct date_info dinfo; ordinal = downsample_daytime(ordinal, af_info, 0); if (dInfoCalc_SetFromAbsDate(&dinfo, ordinal + ORD_OFFSET, GREGORIAN_CALENDAR)) return INT_ERR_CODE; if (relation == 'S') { return DtoB_WeekendToFriday(dinfo.absdate, dinfo.day_of_week); } else { return DtoB_WeekendToMonday(dinfo.absdate, dinfo.day_of_week); } } // all intra day calculations are now done within one function static npy_int64 asfreq_DownsampleWithinDay(npy_int64 ordinal, char relation, asfreq_info *af_info) { return downsample_daytime(ordinal, af_info, relation == 'E'); } static npy_int64 asfreq_UpsampleWithinDay(npy_int64 ordinal, char relation, asfreq_info *af_info) { return upsample_daytime(ordinal, af_info, relation == 'E'); } //************ FROM BUSINESS *************** static npy_int64 asfreq_BtoDT(npy_int64 ordinal, char relation, asfreq_info *af_info) { ordinal += BDAY_OFFSET; ordinal = (((ordinal - 1) / 5) * 7 + mod_compat(ordinal - 1, 5) + 1 - ORD_OFFSET); return upsample_daytime(ordinal, af_info, relation != 'S'); } static npy_int64 asfreq_BtoA(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_BtoDT, asfreq_DTtoA); } static npy_int64 asfreq_BtoQ(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_BtoDT, asfreq_DTtoQ); } static npy_int64 asfreq_BtoM(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_BtoDT, asfreq_DTtoM); } static npy_int64 asfreq_BtoW(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_BtoDT, asfreq_DTtoW); } //************ FROM WEEKLY *************** static npy_int64 asfreq_WtoDT(npy_int64 ordinal, char relation, asfreq_info *af_info) { ordinal += WEEK_OFFSET; if (relation != 'S') { ordinal += 1; } ordinal = ordinal * 7 - 6 + af_info->from_week_end - ORD_OFFSET; if (relation != 'S') { ordinal -= 1; } return upsample_daytime(ordinal, af_info, relation != 'S'); } static npy_int64 asfreq_WtoA(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_WtoDT, asfreq_DTtoA); } static npy_int64 asfreq_WtoQ(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_WtoDT, asfreq_DTtoQ); } static npy_int64 asfreq_WtoM(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_WtoDT, asfreq_DTtoM); } static npy_int64 asfreq_WtoW(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_WtoDT, asfreq_DTtoW); } static npy_int64 asfreq_WtoB(npy_int64 ordinal, char relation, asfreq_info *af_info) { struct date_info dinfo; if (dInfoCalc_SetFromAbsDate(&dinfo, asfreq_WtoDT(ordinal, relation, af_info) + ORD_OFFSET, GREGORIAN_CALENDAR)) return INT_ERR_CODE; if (relation == 'S') { return DtoB_WeekendToMonday(dinfo.absdate, dinfo.day_of_week); } else { return DtoB_WeekendToFriday(dinfo.absdate, dinfo.day_of_week); } } //************ FROM MONTHLY *************** static void MtoD_ym(npy_int64 ordinal, int *y, int *m) { *y = floordiv(ordinal, 12) + BASE_YEAR; *m = mod_compat(ordinal, 12) + 1; } static npy_int64 asfreq_MtoDT(npy_int64 ordinal, char relation, asfreq_info* af_info) { npy_int64 absdate; int y, m; if (relation == 'E') { ordinal += 1; } MtoD_ym(ordinal, &y, &m); if ((absdate = absdate_from_ymd(y, m, 1)) == INT_ERR_CODE) return INT_ERR_CODE; ordinal = absdate - ORD_OFFSET; if (relation == 'E') { ordinal -= 1; } return upsample_daytime(ordinal, af_info, relation != 'S'); } static npy_int64 asfreq_MtoA(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_MtoDT, asfreq_DTtoA); } static npy_int64 asfreq_MtoQ(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_MtoDT, asfreq_DTtoQ); } static npy_int64 asfreq_MtoW(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_MtoDT, asfreq_DTtoW); } static npy_int64 asfreq_MtoB(npy_int64 ordinal, char relation, asfreq_info *af_info) { struct date_info dinfo; if (dInfoCalc_SetFromAbsDate(&dinfo, asfreq_MtoDT(ordinal, relation, af_info) + ORD_OFFSET, GREGORIAN_CALENDAR)) return INT_ERR_CODE; if (relation == 'S') { return DtoB_WeekendToMonday(dinfo.absdate, dinfo.day_of_week); } else { return DtoB_WeekendToFriday(dinfo.absdate, dinfo.day_of_week); } } //************ FROM QUARTERLY *************** static void QtoD_ym(npy_int64 ordinal, int *y, int *m, asfreq_info *af_info) { *y = floordiv(ordinal, 4) + BASE_YEAR; *m = mod_compat(ordinal, 4) * 3 + 1; if (af_info->from_q_year_end != 12) { *m += af_info->from_q_year_end; if (*m > 12) { *m -= 12; } else { *y -= 1; } } } static npy_int64 asfreq_QtoDT(npy_int64 ordinal, char relation, asfreq_info *af_info) { npy_int64 absdate; int y, m; if (relation == 'E') { ordinal += 1; } QtoD_ym(ordinal, &y, &m, af_info); if ((absdate = absdate_from_ymd(y, m, 1)) == INT_ERR_CODE) return INT_ERR_CODE; if (relation == 'E') { absdate -= 1; } return upsample_daytime(absdate - ORD_OFFSET, af_info, relation != 'S'); } static npy_int64 asfreq_QtoQ(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_QtoDT, asfreq_DTtoQ); } static npy_int64 asfreq_QtoA(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_QtoDT, asfreq_DTtoA); } static npy_int64 asfreq_QtoM(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_QtoDT, asfreq_DTtoM); } static npy_int64 asfreq_QtoW(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_QtoDT, asfreq_DTtoW); } static npy_int64 asfreq_QtoB(npy_int64 ordinal, char relation, asfreq_info *af_info) { struct date_info dinfo; if (dInfoCalc_SetFromAbsDate(&dinfo, asfreq_QtoDT(ordinal, relation, af_info) + ORD_OFFSET, GREGORIAN_CALENDAR)) return INT_ERR_CODE; if (relation == 'S') { return DtoB_WeekendToMonday(dinfo.absdate, dinfo.day_of_week); } else { return DtoB_WeekendToFriday(dinfo.absdate, dinfo.day_of_week); } } //************ FROM ANNUAL *************** static npy_int64 asfreq_AtoDT(npy_int64 year, char relation, asfreq_info *af_info) { npy_int64 absdate; int month = (af_info->from_a_year_end) % 12; // start from 1970 year += BASE_YEAR; month += 1; if (af_info->from_a_year_end != 12) { year -= 1; } if (relation == 'E') { year += 1; } absdate = absdate_from_ymd(year, month, 1); if (absdate == INT_ERR_CODE) { return INT_ERR_CODE; } if (relation == 'E') { absdate -= 1; } return upsample_daytime(absdate - ORD_OFFSET, af_info, relation != 'S'); } static npy_int64 asfreq_AtoA(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_AtoDT, asfreq_DTtoA); } static npy_int64 asfreq_AtoQ(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_AtoDT, asfreq_DTtoQ); } static npy_int64 asfreq_AtoM(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_AtoDT, asfreq_DTtoM); } static npy_int64 asfreq_AtoW(npy_int64 ordinal, char relation, asfreq_info *af_info) { return transform_via_day(ordinal, relation, af_info, asfreq_AtoDT, asfreq_DTtoW); } static npy_int64 asfreq_AtoB(npy_int64 ordinal, char relation, asfreq_info *af_info) { struct date_info dinfo; if (dInfoCalc_SetFromAbsDate(&dinfo, asfreq_AtoDT(ordinal, relation, af_info) + ORD_OFFSET, GREGORIAN_CALENDAR)) return INT_ERR_CODE; if (relation == 'S') { return DtoB_WeekendToMonday(dinfo.absdate, dinfo.day_of_week); } else { return DtoB_WeekendToFriday(dinfo.absdate, dinfo.day_of_week); } } static npy_int64 nofunc(npy_int64 ordinal, char relation, asfreq_info *af_info) { return INT_ERR_CODE; } static npy_int64 no_op(npy_int64 ordinal, char relation, asfreq_info *af_info) { return ordinal; } // end of frequency specific conversion routines static int calc_a_year_end(int freq, int group) { int result = (freq - group) % 12; if (result == 0) {return 12;} else {return result;} } static int calc_week_end(int freq, int group) { return freq - group; } void get_asfreq_info(int fromFreq, int toFreq, asfreq_info *af_info) { int fromGroup = get_freq_group(fromFreq); int toGroup = get_freq_group(toFreq); af_info->intraday_conversion_factor = get_daytime_conversion_factor( get_freq_group_index(max_value(fromGroup, FR_DAY)), get_freq_group_index(max_value(toGroup, FR_DAY)) ); //printf("get_asfreq_info(%d, %d) %ld, %d\n", fromFreq, toFreq, af_info->intraday_conversion_factor, af_info->intraday_conversion_upsample); switch(fromGroup) { case FR_WK: af_info->from_week_end = calc_week_end(fromFreq, fromGroup); break; case FR_ANN: af_info->from_a_year_end = calc_a_year_end(fromFreq, fromGroup); break; case FR_QTR: af_info->from_q_year_end = calc_a_year_end(fromFreq, fromGroup); break; } switch(toGroup) { case FR_WK: af_info->to_week_end = calc_week_end(toFreq, toGroup); break; case FR_ANN: af_info->to_a_year_end = calc_a_year_end(toFreq, toGroup); break; case FR_QTR: af_info->to_q_year_end = calc_a_year_end(toFreq, toGroup); break; } } freq_conv_func get_asfreq_func(int fromFreq, int toFreq) { int fromGroup = get_freq_group(fromFreq); int toGroup = get_freq_group(toFreq); if (fromGroup == FR_UND) { fromGroup = FR_DAY; } switch(fromGroup) { case FR_ANN: switch(toGroup) { case FR_ANN: return &asfreq_AtoA; case FR_QTR: return &asfreq_AtoQ; case FR_MTH: return &asfreq_AtoM; case FR_WK: return &asfreq_AtoW; case FR_BUS: return &asfreq_AtoB; case FR_DAY: case FR_HR: case FR_MIN: case FR_SEC: case FR_MS: case FR_US: case FR_NS: return &asfreq_AtoDT; default: return &nofunc; } case FR_QTR: switch(toGroup) { case FR_ANN: return &asfreq_QtoA; case FR_QTR: return &asfreq_QtoQ; case FR_MTH: return &asfreq_QtoM; case FR_WK: return &asfreq_QtoW; case FR_BUS: return &asfreq_QtoB; case FR_DAY: case FR_HR: case FR_MIN: case FR_SEC: case FR_MS: case FR_US: case FR_NS: return &asfreq_QtoDT; default: return &nofunc; } case FR_MTH: switch(toGroup) { case FR_ANN: return &asfreq_MtoA; case FR_QTR: return &asfreq_MtoQ; case FR_MTH: return &no_op; case FR_WK: return &asfreq_MtoW; case FR_BUS: return &asfreq_MtoB; case FR_DAY: case FR_HR: case FR_MIN: case FR_SEC: case FR_MS: case FR_US: case FR_NS: return &asfreq_MtoDT; default: return &nofunc; } case FR_WK: switch(toGroup) { case FR_ANN: return &asfreq_WtoA; case FR_QTR: return &asfreq_WtoQ; case FR_MTH: return &asfreq_WtoM; case FR_WK: return &asfreq_WtoW; case FR_BUS: return &asfreq_WtoB; case FR_DAY: case FR_HR: case FR_MIN: case FR_SEC: case FR_MS: case FR_US: case FR_NS: return &asfreq_WtoDT; default: return &nofunc; } case FR_BUS: switch(toGroup) { case FR_ANN: return &asfreq_BtoA; case FR_QTR: return &asfreq_BtoQ; case FR_MTH: return &asfreq_BtoM; case FR_WK: return &asfreq_BtoW; case FR_BUS: return &no_op; case FR_DAY: case FR_HR: case FR_MIN: case FR_SEC: case FR_MS: case FR_US: case FR_NS: return &asfreq_BtoDT; default: return &nofunc; } case FR_DAY: case FR_HR: case FR_MIN: case FR_SEC: case FR_MS: case FR_US: case FR_NS: switch(toGroup) { case FR_ANN: return &asfreq_DTtoA; case FR_QTR: return &asfreq_DTtoQ; case FR_MTH: return &asfreq_DTtoM; case FR_WK: return &asfreq_DTtoW; case FR_BUS: return &asfreq_DTtoB; case FR_DAY: case FR_HR: case FR_MIN: case FR_SEC: case FR_MS: case FR_US: case FR_NS: if (fromGroup > toGroup) { return &asfreq_DownsampleWithinDay; } else { return &asfreq_UpsampleWithinDay; } default: return &nofunc; } default: return &nofunc; } } double get_abs_time(int freq, npy_int64 date_ordinal, npy_int64 ordinal) { //printf("get_abs_time %d %lld %lld\n", freq, date_ordinal, ordinal); int freq_index, day_index, base_index; npy_int64 per_day, start_ord; double unit, result; if (freq <= FR_DAY) { return 0; } freq_index = get_freq_group_index(freq); day_index = get_freq_group_index(FR_DAY); base_index = get_freq_group_index(FR_SEC); //printf(" indices: day %d, freq %d, base %d\n", day_index, freq_index, base_index); per_day = get_daytime_conversion_factor(day_index, freq_index); unit = get_daytime_conversion_factor(freq_index, base_index); //printf(" per_day: %lld, unit: %f\n", per_day, unit); if (base_index < freq_index) { unit = 1 / unit; //printf(" corrected unit: %f\n", unit); } start_ord = date_ordinal * per_day; //printf("start_ord: %lld\n", start_ord); result = (double) ( unit * (ordinal - start_ord)); //printf(" result: %f\n", result); return result; } /* Sets the time part of the DateTime object. */ static int dInfoCalc_SetFromAbsTime(struct date_info *dinfo, double abstime) { int inttime; int hour,minute; double second; inttime = (int)abstime; hour = inttime / 3600; minute = (inttime % 3600) / 60; second = abstime - (double)(hour*3600 + minute*60); dinfo->hour = hour; dinfo->minute = minute; dinfo->second = second; dinfo->abstime = abstime; return 0; } /* Set the instance's value using the given date and time. calendar may be set to the flags: GREGORIAN_CALENDAR, JULIAN_CALENDAR to indicate the calendar to be used. */ static int dInfoCalc_SetFromAbsDateTime(struct date_info *dinfo, npy_int64 absdate, double abstime, int calendar) { /* Bounds check */ Py_AssertWithArg(abstime >= 0.0 && abstime <= SECONDS_PER_DAY, PyExc_ValueError, "abstime out of range (0.0 - 86400.0): %f", abstime); /* Calculate the date */ if (dInfoCalc_SetFromAbsDate(dinfo, absdate, calendar)) goto onError; /* Calculate the time */ if (dInfoCalc_SetFromAbsTime(dinfo, abstime)) goto onError; return 0; onError: return INT_ERR_CODE; } /* ------------------------------------------------------------------ * New pandas API-helper code, to expose to cython * ------------------------------------------------------------------*/ npy_int64 asfreq(npy_int64 period_ordinal, int freq1, int freq2, char relation) { npy_int64 val; freq_conv_func func; asfreq_info finfo; func = get_asfreq_func(freq1, freq2); get_asfreq_info(freq1, freq2, &finfo); //printf("\n%x %d %d %ld %ld\n", func, freq1, freq2, finfo.intraday_conversion_factor, -finfo.intraday_conversion_factor); val = (*func)(period_ordinal, relation, &finfo); if (val == INT_ERR_CODE) { //Py_Error(PyExc_ValueError, "Unable to convert to desired frequency."); goto onError; } return val; onError: return INT_ERR_CODE; } /* generate an ordinal in period space */ npy_int64 get_period_ordinal(int year, int month, int day, int hour, int minute, int second, int microseconds, int picoseconds, int freq) { npy_int64 absdays, delta, seconds; npy_int64 weeks, days; npy_int64 ordinal, day_adj; int freq_group, fmonth, mdiff; freq_group = get_freq_group(freq); if (freq == FR_SEC || freq == FR_MS || freq == FR_US || freq == FR_NS) { absdays = absdate_from_ymd(year, month, day); delta = (absdays - ORD_OFFSET); seconds = (npy_int64)(delta * 86400 + hour * 3600 + minute * 60 + second); switch(freq) { case FR_MS: return seconds * 1000 + microseconds / 1000; case FR_US: return seconds * 1000000 + microseconds; case FR_NS: return seconds * 1000000000 + microseconds * 1000 + picoseconds / 1000; } return seconds; } if (freq == FR_MIN) { absdays = absdate_from_ymd(year, month, day); delta = (absdays - ORD_OFFSET); return (npy_int64)(delta*1440 + hour*60 + minute); } if (freq == FR_HR) { if ((absdays = absdate_from_ymd(year, month, day)) == INT_ERR_CODE) { goto onError; } delta = (absdays - ORD_OFFSET); return (npy_int64)(delta*24 + hour); } if (freq == FR_DAY) { return (npy_int64) (absdate_from_ymd(year, month, day) - ORD_OFFSET); } if (freq == FR_UND) { return (npy_int64) (absdate_from_ymd(year, month, day) - ORD_OFFSET); } if (freq == FR_BUS) { if((days = absdate_from_ymd(year, month, day)) == INT_ERR_CODE) { goto onError; } // calculate the current week assuming sunday as last day of a week weeks = (days - BASE_WEEK_TO_DAY_OFFSET) / DAYS_PER_WEEK; // calculate the current weekday (in range 1 .. 7) delta = (days - BASE_WEEK_TO_DAY_OFFSET) % DAYS_PER_WEEK + 1; // return the number of business days in full weeks plus the business days in the last - possible partial - week return (npy_int64)(weeks * BUSINESS_DAYS_PER_WEEK) + (delta <= BUSINESS_DAYS_PER_WEEK ? delta : BUSINESS_DAYS_PER_WEEK + 1) - BDAY_OFFSET; } if (freq_group == FR_WK) { if((ordinal = (npy_int64)absdate_from_ymd(year, month, day)) == INT_ERR_CODE) { goto onError; } day_adj = freq - FR_WK; return (ordinal - (1 + day_adj)) / 7 + 1 - WEEK_OFFSET; } if (freq == FR_MTH) { return (year - BASE_YEAR) * 12 + month - 1; } if (freq_group == FR_QTR) { fmonth = freq - FR_QTR; if (fmonth == 0) fmonth = 12; mdiff = month - fmonth; if (mdiff < 0) mdiff += 12; if (month >= fmonth) mdiff += 12; return (year - BASE_YEAR) * 4 + (mdiff - 1) / 3; } if (freq_group == FR_ANN) { fmonth = freq - FR_ANN; if (fmonth == 0) fmonth = 12; if (month <= fmonth) { return year - BASE_YEAR; } else { return year - BASE_YEAR + 1; } } Py_Error(PyExc_RuntimeError, "Unable to generate frequency ordinal"); onError: return INT_ERR_CODE; } /* Returns the proleptic Gregorian ordinal of the date, as an integer. This corresponds to the number of days since Jan., 1st, 1AD. When the instance has a frequency less than daily, the proleptic date is calculated for the last day of the period. */ npy_int64 get_python_ordinal(npy_int64 period_ordinal, int freq) { asfreq_info af_info; freq_conv_func toDaily = NULL; if (freq == FR_DAY) return period_ordinal + ORD_OFFSET; toDaily = get_asfreq_func(freq, FR_DAY); get_asfreq_info(freq, FR_DAY, &af_info); return toDaily(period_ordinal, 'E', &af_info) + ORD_OFFSET; } char *str_replace(const char *s, const char *old, const char *new) { char *ret; int i, count = 0; size_t newlen = strlen(new); size_t oldlen = strlen(old); for (i = 0; s[i] != '\0'; i++) { if (strstr(&s[i], old) == &s[i]) { count++; i += oldlen - 1; } } ret = PyArray_malloc(i + 1 + count * (newlen - oldlen)); if (ret == NULL) {return (char *)PyErr_NoMemory();} i = 0; while (*s) { if (strstr(s, old) == s) { strcpy(&ret[i], new); i += newlen; s += oldlen; } else { ret[i++] = *s++; } } ret[i] = '\0'; return ret; } // function to generate a nice string representation of the period // object, originally from DateObject_strftime char* c_strftime(struct date_info *tmp, char *fmt) { struct tm c_date; char* result; struct date_info dinfo = *tmp; int result_len = strlen(fmt) + 50; c_date.tm_sec = (int)dinfo.second; c_date.tm_min = dinfo.minute; c_date.tm_hour = dinfo.hour; c_date.tm_mday = dinfo.day; c_date.tm_mon = dinfo.month - 1; c_date.tm_year = dinfo.year - 1900; c_date.tm_wday = (dinfo.day_of_week + 1) % 7; c_date.tm_yday = dinfo.day_of_year - 1; c_date.tm_isdst = -1; result = malloc(result_len * sizeof(char)); strftime(result, result_len, fmt, &c_date); return result; } int get_yq(npy_int64 ordinal, int freq, int *quarter, int *year) { asfreq_info af_info; int qtr_freq; npy_int64 daily_ord; npy_int64 (*toDaily)(npy_int64, char, asfreq_info*) = NULL; toDaily = get_asfreq_func(freq, FR_DAY); get_asfreq_info(freq, FR_DAY, &af_info); daily_ord = toDaily(ordinal, 'E', &af_info); if (get_freq_group(freq) == FR_QTR) { qtr_freq = freq; } else { qtr_freq = FR_QTR; } get_asfreq_info(FR_DAY, qtr_freq, &af_info); if(DtoQ_yq(daily_ord, &af_info, year, quarter) == INT_ERR_CODE) return -1; return 0; } static int _quarter_year(npy_int64 ordinal, int freq, int *year, int *quarter) { asfreq_info af_info; int qtr_freq; ordinal = get_python_ordinal(ordinal, freq) - ORD_OFFSET; if (get_freq_group(freq) == FR_QTR) qtr_freq = freq; else qtr_freq = FR_QTR; get_asfreq_info(FR_DAY, qtr_freq, &af_info); if (DtoQ_yq(ordinal, &af_info, year, quarter) == INT_ERR_CODE) return INT_ERR_CODE; if ((qtr_freq % 1000) > 12) *year -= 1; return 0; } static int _ISOWeek(struct date_info *dinfo) { int week; /* Estimate */ week = (dinfo->day_of_year-1) - dinfo->day_of_week + 3; if (week >= 0) week = week / 7 + 1; /* Verify */ if (week < 0) { /* The day lies in last week of the previous year */ if ((week > -2) || (week == -2 && dInfoCalc_Leapyear(dinfo->year-1, dinfo->calendar))) week = 53; else week = 52; } else if (week == 53) { /* Check if the week belongs to year or year+1 */ if (31-dinfo->day + dinfo->day_of_week < 3) { week = 1; } } return week; } int get_date_info(npy_int64 ordinal, int freq, struct date_info *dinfo) { npy_int64 absdate = get_python_ordinal(ordinal, freq); double abstime = get_abs_time(freq, absdate - ORD_OFFSET, ordinal); while (abstime < 0) { abstime += 86400; absdate -= 1; } while (abstime >= 86400) { abstime -= 86400; absdate += 1; } if(dInfoCalc_SetFromAbsDateTime(dinfo, absdate, abstime, GREGORIAN_CALENDAR)) return INT_ERR_CODE; return 0; } int pyear(npy_int64 ordinal, int freq) { struct date_info dinfo; get_date_info(ordinal, freq, &dinfo); return dinfo.year; } int pqyear(npy_int64 ordinal, int freq) { int year, quarter; if( _quarter_year(ordinal, freq, &year, &quarter) == INT_ERR_CODE) return INT_ERR_CODE; return year; } int pquarter(npy_int64 ordinal, int freq) { int year, quarter; if(_quarter_year(ordinal, freq, &year, &quarter) == INT_ERR_CODE) return INT_ERR_CODE; return quarter; } int pmonth(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return dinfo.month; } int pday(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return dinfo.day; } int pweekday(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return dinfo.day_of_week; } int pday_of_week(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return dinfo.day_of_week; } int pday_of_year(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return dinfo.day_of_year; } int pweek(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return _ISOWeek(&dinfo); } int phour(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return dinfo.hour; } int pminute(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return dinfo.minute; } int psecond(npy_int64 ordinal, int freq) { struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; return (int)dinfo.second; } int pdays_in_month(npy_int64 ordinal, int freq) { int days; struct date_info dinfo; if(get_date_info(ordinal, freq, &dinfo) == INT_ERR_CODE) return INT_ERR_CODE; days = days_in_month[dInfoCalc_Leapyear(dinfo.year, dinfo.calendar)][dinfo.month-1]; return days; }
29.832645
161
0.614793
[ "object" ]
032befbce320374caa7a33a10076490c2433950e
65
h
C
lab2/task1/VectorProcessor.h
alexey-malov/ips-oop2015
fd47a03213b9387eef5f1664725557b41a2ffd1b
[ "MIT" ]
null
null
null
lab2/task1/VectorProcessor.h
alexey-malov/ips-oop2015
fd47a03213b9387eef5f1664725557b41a2ffd1b
[ "MIT" ]
9
2016-02-17T09:08:02.000Z
2016-05-19T12:02:59.000Z
lab2/Lab2Task1Var2/task1/VectorProcessor.h
AlexanderChibirev/OOP
e30adebbf961d9573a2d14981e5d8b92466207fd
[ "MIT" ]
null
null
null
#pragma once void ProcessVector(std::vector<double> & numbers);
21.666667
50
0.753846
[ "vector" ]
03369aa150bcba75fce98afd97fc51a209033d6b
2,842
h
C
kernel/PX_Partical.h
OceanEyeFF/PainterEngine
ffa416a80545f2e6236fbfb847cf37bfdae3f1c2
[ "BSD-3-Clause" ]
null
null
null
kernel/PX_Partical.h
OceanEyeFF/PainterEngine
ffa416a80545f2e6236fbfb847cf37bfdae3f1c2
[ "BSD-3-Clause" ]
null
null
null
kernel/PX_Partical.h
OceanEyeFF/PainterEngine
ffa416a80545f2e6236fbfb847cf37bfdae3f1c2
[ "BSD-3-Clause" ]
null
null
null
#ifndef PX_PARTICAL_H #define PX_PARTICAL_H #include "PX_Script_VM.h" #define PX_PARTICAL_ATOM_TIME 8 //8ms for partical atom #define PX_PARTICAL_ONETIME_GENMAX 65535 #define PX_PARTICAL_TRANSFORM_CACHE (8*1024*1024+16)//8M for transform typedef struct { px_float size; px_float rotation; px_float mass; px_float alpha; px_dword aliveTime; px_dword elpasedTime; px_point position; px_point velocity; px_float hdrR,hdrG,hdrB; float roatationSpeed; float sizeIncrement; float alphaIncrement; px_void *User; }PX_Partical_Atom; struct _PX_Partical_Launcher; typedef PX_Partical_Atom (* PX_ParticalLauncher_CreateAtom)(struct _PX_Partical_Launcher *launcher,px_int index); typedef px_void (* PX_ParticalLauncher_UpdateAtom)(struct _PX_Partical_Launcher *launcher,PX_Partical_Atom *pAtom); typedef struct _PX_Partical_Launcher { px_point launcherPosition; px_point launcherVelocity; px_dword generateDuration; px_dword elpased; px_uint maxCount; px_int launchCount; px_uint genIndex; px_point force; px_float resistanceK; px_void *user; px_point velocity; px_point direction; px_uint CreateParticalFuncIndex; px_uint UpdateParitcalFuncIndex; px_float lefttopX,leftTopY,rightBottomX,rightBottomY; PX_ParticalLauncher_CreateAtom Create_func; PX_ParticalLauncher_UpdateAtom Update_func; px_memorypool *mp; px_texture *texture; PX_Partical_Atom *ParticalPool; PX_ScriptVM_Instance *VM_Instance; }PX_Partical_Launcher; typedef struct { px_texture *tex; px_void *user; px_int generateDuration; px_int maxCount; px_point force; px_float resistanceK; px_int launchCount; PX_ParticalLauncher_CreateAtom Create_func; PX_ParticalLauncher_UpdateAtom Update_func; }PX_ParticalLauncher_InitializeInfo; px_bool PX_ParticalLauncherCreateEx(PX_Partical_Launcher *launcher,px_memorypool *mp,PX_ParticalLauncher_InitializeInfo Info); px_bool PX_ParticalLauncherCreate(PX_Partical_Launcher *launcher,px_memorypool *mp,px_texture *tex,PX_ScriptVM_Instance *pIns,px_char *Initfunc,px_char *_createfunc,px_char *_updatefunc); px_void PX_ParticalLauncherSetLauncherPosition(PX_Partical_Launcher *launcher,px_point position); px_bool PX_ParticalLauncherSetCreateFuncIndex(PX_Partical_Launcher *launcher,px_char *func_Name); px_bool PX_ParticalLauncherSetUpdateFuncIndex(PX_Partical_Launcher *launcher,px_char *func_Name); px_void PX_ParticalLauncherSetDirection(PX_Partical_Launcher *launcher,px_point direction); px_bool PX_ParticalLauncherUpdate(PX_Partical_Launcher *launcher,px_dword elpased); px_void PX_ParticalLauncherRender(px_surface *surface,PX_Partical_Launcher *launcher,px_point position); px_void PX_ParticalLauncherFree(PX_Partical_Launcher *launcher); #endif
34.658537
189
0.809993
[ "transform" ]
033876a857886ea2dbfb4c283895d9409cd9167c
2,868
h
C
src/Physics/Physics.h
DavidAzouz29/AIEYear2Engine
de0e27d2db420f4890b00088684f4f56883488fb
[ "MIT" ]
null
null
null
src/Physics/Physics.h
DavidAzouz29/AIEYear2Engine
de0e27d2db420f4890b00088684f4f56883488fb
[ "MIT" ]
null
null
null
src/Physics/Physics.h
DavidAzouz29/AIEYear2Engine
de0e27d2db420f4890b00088684f4f56883488fb
[ "MIT" ]
null
null
null
#ifndef SOUND_PROGRAMMING_H_ #define SOUND_PROGRAMMING_H_ //#include "TestApplication.h" #include "Camera\Camera.h" //#include "Render.h" #include "PhysXComponent.h" #include "Renderable.h" #include <memory> #include <PxPhysicsAPI.h> #include <PxScene.h> using namespace physx; //class Camera; class ControllerHitReport; class FBXFile; struct GLFWwindow; //class PhysXComponent; class Physics// : public TestApplication { public: Physics() : m_pRenderable(std::make_shared<Renderable>()), //m_camera(a_camState), isRBD(false), //TODO: causes framerate to tank m_pPhysXComponent(std::make_unique<PhysXComponent>()), m_fTimer(0) {} bool Create(); //virtual bool Startup(); virtual void Shutdown(); virtual bool Update(GLfloat a_deltaTime, const Camera& a_camera); virtual void Draw(const Camera& a_camState); virtual void RenderUI(); //Render and Clear //Add Widget moved to PhysXComponent void SetupPhysX(); PxScene* CreateDefaultScene(); void SetupIntroductionToPhysX(); void SetupRBDTutorial(); bool UpdatePlayerController(float a_deltaTime); void renderGizmos(PxScene* physics_scene); void AttachedRigidBodyConvex(float density, PxMaterial* g_PhysicsMaterial, bool isDynamic); void TerrainCollision(unsigned int _rows, unsigned int _cols, int* _samples, int _heightScalePX, int _size);// , PxMaterial* g_PhysicsMaterial); const Renderable* GetRenderable() const { return m_pRenderable.get(); } //static PxMaterial* GetPxMat() { return m_pPhysics_material; } //Renderer* m_renderer; //Camera& m_camera; bool isRBD; //enable the ball firing tutorial //unsigned int main_shader; private: std::shared_ptr<Renderable> m_pRenderable; PxFoundation* m_pPhysics_foundation; PxPhysics* m_pPhysics; PxScene* m_pPhysics_scene; PxDefaultErrorCallback m_default_error_callback; PxDefaultAllocator m_default_allocator; PxSimulationFilterShader m_default_filter_shader; PxMaterial* m_pPhysics_material; PxMaterial* m_pBox_material; PxCooking* m_pPhysics_cooker; PxControllerManager* m_pController_manager; PxController* m_pPlayerController; //ControllerHitReport* m_pMyHitReport; std::shared_ptr<ControllerHitReport> m_pMyHitReport; float m_pCharacterYvelocity; float m_pCharacterRotation; float m_pPlayerGravity; PxRigidDynamic* m_pPlayerModel; PxArticulation* m_pRagdollArticulation; std::unique_ptr<PhysXComponent> m_pPhysXComponent; GLFWwindow* m_pWindow; float m_fTimer; float m_characterYvelocity; float m_characterRotation; float m_playerGravity; //TODO: set all these values somewhere PxExtendedVec3 m_v3PhysicsWorldTransform; //glm::mat4 m_worldTransform; // named differently to identify the physics version PxRigidDynamic* _pXactor; PxRigidStatic* _pXactorS; FBXFile* _FBXModel; int numberIndex; int* indexes; }; #endif //CAM_PROJ_H_
26.072727
145
0.779289
[ "render" ]
03396198c4ccbb18085fbc9e19ba32ac286caa7d
3,851
h
C
PepXMLParser/PepXMLParser3.h
mhoopmann/KojakSpectrumViewer
35fe56b3686dfdbe36e4bd5aab6f8d7ee04d6491
[ "Apache-2.0" ]
4
2017-06-08T21:28:24.000Z
2021-02-25T13:22:00.000Z
PepXMLParser/PepXMLParser3.h
mhoopmann/KojakSpectrumViewer
35fe56b3686dfdbe36e4bd5aab6f8d7ee04d6491
[ "Apache-2.0" ]
null
null
null
PepXMLParser/PepXMLParser3.h
mhoopmann/KojakSpectrumViewer
35fe56b3686dfdbe36e4bd5aab6f8d7ee04d6491
[ "Apache-2.0" ]
1
2020-10-04T18:10:01.000Z
2020-10-04T18:10:01.000Z
#ifndef _PEPXMLPARSER3_H #define _PEPXMLPARSER3_H #include "expat.h" #include "PepXMLStructs.h" #include "CPepXMLSpectrum.h" #include <iostream> #include <cmath> #include <cstdio> #include <cstdlib> #include <string.h> #define XMLCLASS #ifndef XML_STATIC #define XML_STATIC // to statically link the expat libraries #endif using namespace std; class PepXMLParser3 { public: PepXMLParser3(); ~PepXMLParser3(); CPepXMLSpectrum& operator[ ](const size_t& i); void characters(const XML_Char *s, int len); void endElement(const XML_Char *el); void startElement(const XML_Char *el, const XML_Char **attr); //Assuming functions are usually index-centric (i.e. will be given a peptide array index) string getFile (int pepIndex); int getFileCount (); void getFileFromList (int index, char* str); PepXMLXL getLinker (size_t index, char rank=1); bool getLinkSites (size_t index, char& a, char& b, char rank=1); char getLinkType (size_t index, char rank=1); string getParameter (char* name); //NULL to get next instance of parameter string getPeptide (size_t index, bool mod=false, char rank=1, bool link=false); PepXMLPepMod getPeptideMod (size_t pepIndex, size_t modIndex, char rank=1, bool link=false); size_t getPeptideModCount (size_t index, char rank=1, bool link=false); //PepXMLMod getPeptideModFromList (int modIndex); double getProbability (double err); string getProtein (size_t index, size_t protIndex, char rank=1, bool link=false); string getProteinFromList (int protIndex); char getScoreIndex (string label); string getScoreLabel (char scoreIndex); bool hasIProphet (); bool hasPepProphet (); bool readFile (const char* fileName); size_t size (); void sortModPep (); void sortScanNum (); // ----------------------------------------------------------------------- // SAXHandler helper functions // ----------------------------------------------------------------------- inline const char* getAttrValue(const char* name, const XML_Char **attr) { for (int i = 0; attr[i]; i += 2) { if (isAttr(name, attr[i])) return attr[i + 1]; } return ""; } inline bool isAttr(const char *n1, const XML_Char *n2) { return (strcmp(n1, n2) == 0); } inline bool isElement(const char *n1, const XML_Char *n2) { return (strcmp(n1, n2) == 0); } protected: bool bIProphet; //Indicates data has been iPropheted bool bPepProphet; //Indicates data has been PeptidePropheted bool b15N; CPepXMLSpectrum spec; XML_Parser parser; CPepXMLPeptide peptide; CPepXMLPSM psm; int currentFileID; double aaMass[128]; double aaMassn15[128]; size_t paramIndex; string lastParam; string s15NPrefix; //Internal, global lists vector<PepXMLError> vError; vector<string> vFiles; //vector<PepXMLMod> vMods; vector<PepXMLParameter> vParams; vector<string> vProteins; vector<string> vScores; vector<CPepXMLSpectrum> vSpectra; vector<PepXMLXL> vXL; //bool addMod (char aa, double mass, double massDiff=0); double calcMonoMass (char *seq, bool water=true); //char findMod (char aa, double mass); size_t findProtein (string& s); char findScore (string& s); char findXL (string& s, double mass); static int compareModPep (const void *p1, const void *p2); static int compareScanNum (const void *p1, const void *p2); }; #endif
33.486957
104
0.598026
[ "vector" ]
0340743fee02931ccad3aa0bba39b707bc2cd77d
1,702
h
C
lib/graph/centroid_decomp_sim.h
sogapalag/problems
0ea7d65448e1177f8b3f81124a82d187980d659c
[ "MIT" ]
1
2020-04-04T14:56:12.000Z
2020-04-04T14:56:12.000Z
lib/graph/centroid_decomp_sim.h
sogapalag/problems
0ea7d65448e1177f8b3f81124a82d187980d659c
[ "MIT" ]
null
null
null
lib/graph/centroid_decomp_sim.h
sogapalag/problems
0ea7d65448e1177f8b3f81124a82d187980d659c
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; // SNIPPETS_START graph_centroid_decomp_sim // for tree use struct Graph { int n, m; vector<vector<int>> g; bool is_digraph; Graph(int _n) : n(_n), m(0) { assert(n >= 1); g.resize(n); set_di(false); } Graph(int _n, int _m, bool _di=false) : n(_n), m(0) { assert(n >= 1); assert(1ll*n*(n-1)/2 >= m); g.resize(n); set_di(_di); input(_m); } inline void add(int u, int v) { assert(0 <= u && u < n); assert(0 <= v && v < n); assert(u != v); g[u].emplace_back(v); if (!is_digraph) g[v].emplace_back(u); m++; } void input(int _m) { int u, v; for (int i = 0; i < _m; i++) { cin >> u >> v; u--; v--; // input 1-based add(u, v); } } void set_di(bool _di) { pa = vector<int>(n, -1); sz = vector<int> (n, 1); trk = vector<bool> (n, false); is_digraph = _di; } vector<int> pa; vector<int> sz; vector<bool> trk; void dfs(int u) { trk[u] = true; for (int v: g[u]) if(!trk[v]){ pa[v] = u; dfs(v); sz[u] += sz[v]; } } vector<int> centroids(){ dfs(0); vector<int> cds; for (int u = 0; u < n; u++) { bool yes = true; for (int v: g[u]) { if (v!=pa[u]) yes &= sz[v] <= n/2; } yes &= n-sz[u] <= n/2; if (yes) cds.emplace_back(u); } assert(cds.size() <= 2); return cds; } }; // SNIPPETS_END
22.693333
57
0.408931
[ "vector" ]
0348c5857d4f49c253925b43736769ef3e2d805c
594
h
C
include/azule/graphics/TileMapComponent.h
ASxa86/azule
9bf89dfc5a80f296b02edd3ac608d9a90e4ea26b
[ "MIT" ]
1
2018-10-19T18:00:19.000Z
2018-10-19T18:00:19.000Z
include/azule/graphics/TileMapComponent.h
ASxa86/azule
9bf89dfc5a80f296b02edd3ac608d9a90e4ea26b
[ "MIT" ]
7
2019-06-13T00:48:55.000Z
2020-05-05T00:18:42.000Z
include/azule/graphics/TileMapComponent.h
ASxa86/AGE
9bf89dfc5a80f296b02edd3ac608d9a90e4ea26b
[ "MIT" ]
null
null
null
#pragma once #include <azule/entity/Component.h> #include <azule/export.hxx> #include <azule/terrain/TileMap.h> #include <SFML/Graphics/Drawable.hpp> #include <SFML/Graphics/Texture.hpp> #include <SFML/Graphics/VertexArray.hpp> namespace azule { class AZULE_EXPORT TileMapComponent : public azule::Component, public sf::Drawable { public: TileMapComponent(); ~TileMapComponent(); void loadTileMap(const azule::TileMap& x); private: void draw(sf::RenderTarget& target, sf::RenderStates states) const override; std::vector<std::pair<sf::Texture, sf::VertexArray>> layers; }; }
23.76
83
0.747475
[ "vector" ]
03490df1b23c11dab849e783937341d96eec848a
3,927
h
C
src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/PeakWidthEstimator.h
mrurik/OpenMS
3bf48247423dc28a7df7b12b72fbc7751965c321
[ "Zlib", "Apache-2.0" ]
1
2018-03-06T14:12:09.000Z
2018-03-06T14:12:09.000Z
src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/PeakWidthEstimator.h
mrurik/OpenMS
3bf48247423dc28a7df7b12b72fbc7751965c321
[ "Zlib", "Apache-2.0" ]
null
null
null
src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/PeakWidthEstimator.h
mrurik/OpenMS
3bf48247423dc28a7df7b12b72fbc7751965c321
[ "Zlib", "Apache-2.0" ]
null
null
null
// -------------------------------------------------------------------------- // OpenMS -- Open-Source Mass Spectrometry // -------------------------------------------------------------------------- // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen, // ETH Zurich, and Freie Universitaet Berlin 2002-2016. // // This software is released under a three-clause BSD license: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of any author or any participating institution // may be used to endorse or promote products derived from this software // without specific prior written permission. // For a full list of authors, refer to the file AUTHORS. // -------------------------------------------------------------------------- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // -------------------------------------------------------------------------- // $Maintainer: Lars Nilse $ // $Authors: Lars Nilse $ // -------------------------------------------------------------------------- #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_PEAKWIDTHESTIMATOR_H #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_PEAKWIDTHESTIMATOR_H #include <OpenMS/MATH/MISC/BSpline2d.h> #include <OpenMS/KERNEL/MSExperiment.h> #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/PeakPickerHiRes.h> namespace OpenMS { /** * @brief Rough estimation of the peak width at m/z * * Based on the peaks of the dataset (peak position & width) and the peak * boundaries as reported by the PeakPickerHiRes, the typical peak width is * estimated for arbitrary m/z using a spline interpolation. * */ class OPENMS_DLLAPI PeakWidthEstimator { public: /** * @brief constructor * * @param exp_picked m/z positions of picked peaks * @param boundaries corresponding peak widths * * @throw Exception::UnableToFit if the B-spline initialisation fails. */ PeakWidthEstimator(const MSExperiment<Peak1D> & exp_picked, const std::vector<std::vector<PeakPickerHiRes::PeakBoundary> > & boundaries); /** * @brief returns the estimated peak width at m/z * * @note If the mz value is outside the interpolation range, the peak width * value of the maximal/minimal value is used. * * @throw Exception::InvalidValue if the peak width estimation returns a negative value. */ double getPeakWidth(double mz); /** * @brief destructor */ virtual ~PeakWidthEstimator(); private: /// hide default constructor PeakWidthEstimator(); /** * @brief B-spline for peak width interpolation */ BSpline2d* bspline_; /** * @brief m/z range of peak width interpolation */ double mz_min_; double mz_max_; }; } #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_PEAKWIDTHESTIMATOR_H
38.5
141
0.651388
[ "vector" ]
034a8e07b26f55da23265edf1a9ab4255247fb4c
2,763
h
C
SeqAn-1.1/seqan/file.h
dkj/bowtie
d1f4eb8f9a3f7c8dcfbaadfee4f67c9805e038d6
[ "Artistic-1.0" ]
29
2016-09-27T15:33:27.000Z
2021-07-14T03:26:53.000Z
SeqAn-1.1/seqan/file.h
dkj/bowtie
d1f4eb8f9a3f7c8dcfbaadfee4f67c9805e038d6
[ "Artistic-1.0" ]
15
2015-11-22T13:12:03.000Z
2022-01-19T02:18:25.000Z
SeqAn-1.1/seqan/file.h
dkj/bowtie
d1f4eb8f9a3f7c8dcfbaadfee4f67c9805e038d6
[ "Artistic-1.0" ]
9
2015-03-30T14:37:26.000Z
2019-06-20T19:06:07.000Z
/*========================================================================== SeqAn - The Library for Sequence Analysis http://www.seqan.de ============================================================================ Copyright (C) 2007 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. ============================================================================ $Id: file.h,v 1.4 2009/03/13 14:51:00 langmead Exp $ ==========================================================================*/ #ifndef SEQAN_HEADER_FILE_H #define SEQAN_HEADER_FILE_H //____________________________________________________________________________ // prerequisites #include <iostream> #include <climits> #include <cstdio> #include <list> #include <vector> #include <map> #include <cmath> #include <seqan/sequence.h> //____________________________________________________________________________ #include <seqan/file/file_forwards.h> #ifdef SEQAN_SWITCH_USE_FORWARDS #include <seqan/file/file_generated_forwards.h> #endif #include <seqan/file/cstream.h> #include <seqan/file/stream.h> #include <seqan/file/chunk_collector.h> #include <seqan/file/meta.h> //____________________________________________________________________________ // file formats #include <seqan/file/file_format.h> #include <seqan/file/stream_algorithms.h> //file formats for sequences #include <seqan/file/file_format_raw.h> #include <seqan/file/file_format_fasta.h> //#include <seqan/file/file_format_embl.h> //#include <seqan/file/file_format_genbank.h> //file formats for alignments #include <seqan/file/file_format_fasta_align.h> //others #include <seqan/file/file_format_cgviz.h> //____________________________________________________________________________ //#include <seqan/file/file_format_guess.h> //____________________________________________________________________________ // files #include <seqan/file/file_base.h> #include <seqan/file/file_array.h> //#include <seqan/system.h> // async file (default file type of File<>) /*#include <seqan/system/file_sync.h> #include <seqan/system/system_event.h> #include <seqan/system/file_async.h> */ //____________________________________________________________________________ // external string #endif //#ifndef SEQAN_HEADER_...
30.7
78
0.69743
[ "vector" ]
034d387edb0f9c4087340a2de9e70d6dd00f7f1a
1,979
h
C
src/chrono_fsi/ChFsiInterface.h
andrewseidl/chrono
ec3d1689fa4d1ca40ef6d9ffdd2f509c0dc2cecd
[ "BSD-3-Clause" ]
null
null
null
src/chrono_fsi/ChFsiInterface.h
andrewseidl/chrono
ec3d1689fa4d1ca40ef6d9ffdd2f509c0dc2cecd
[ "BSD-3-Clause" ]
null
null
null
src/chrono_fsi/ChFsiInterface.h
andrewseidl/chrono
ec3d1689fa4d1ca40ef6d9ffdd2f509c0dc2cecd
[ "BSD-3-Clause" ]
null
null
null
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Author: Arman Pazouki // ============================================================================= // // Base class for processing the interface between chrono and fsi modules // ============================================================================= #ifndef CH_FSIINTERFACE_H_ #define CH_FSIINTERFACE_H_ #include "chrono/physics/ChSystem.h" #include "chrono_fsi/ChApiFsi.h" #include "chrono_fsi/ChFsiDataManager.cuh" #include "chrono_fsi/ChFsiGeneral.cuh" namespace chrono { namespace fsi { class CH_FSI_API ChFsiInterface : public ChFsiGeneral { public: ChFsiInterface( FsiBodiesDataH *other_fsiBodiesH, chrono::ChSystem *other_mphysicalSystem, std::vector<std::shared_ptr<chrono::ChBody>> *other_fsiBodeisPtr, thrust::device_vector<Real3> *other_rigid_FSI_ForcesD, thrust::device_vector<Real3> *other_rigid_FSI_TorquesD); ~ChFsiInterface(); // TODO virtual void Add_Rigid_ForceTorques_To_ChSystem(); virtual void Copy_External_To_ChSystem(); virtual void Copy_ChSystem_to_External(); virtual void Copy_fsiBodies_ChSystem_to_FluidSystem(FsiBodiesDataD *fsiBodiesD); virtual void ResizeChronoBodiesData(); private: FsiBodiesDataH *fsiBodiesH; ChronoBodiesDataH *chronoRigidBackup; chrono::ChSystem *mphysicalSystem; std::vector<std::shared_ptr<chrono::ChBody>> *fsiBodeisPtr; thrust::device_vector<Real3> *rigid_FSI_ForcesD; thrust::device_vector<Real3> *rigid_FSI_TorquesD; }; } // end namespace fsi } // end namespace chrono #endif
35.981818
80
0.648813
[ "vector" ]
036c017fce7af948d4c4e5a9215971802b026337
5,445
h
C
Source/ArticyRuntime/Public/ArticyRef.h
ArticySoftware/ArticyUnrealImporter
e70c6b5dd060c93e9ad0fb5c730801c9eca63479
[ "MIT" ]
71
2017-09-12T14:58:41.000Z
2022-03-31T23:42:53.000Z
Source/ArticyRuntime/Public/ArticyRef.h
ArticySoftware/ArticyUnrealImporter
e70c6b5dd060c93e9ad0fb5c730801c9eca63479
[ "MIT" ]
38
2017-09-19T04:56:57.000Z
2022-01-25T17:55:38.000Z
Source/ArticyRuntime/Public/ArticyRef.h
ArticySoftware/ArticyUnrealImporter
e70c6b5dd060c93e9ad0fb5c730801c9eca63479
[ "MIT" ]
25
2017-09-22T10:40:03.000Z
2021-08-25T12:39:22.000Z
// // Copyright (c) articy Software GmbH & Co. KG. All rights reserved. // #pragma once #include "ArticyBaseTypes.h" #include "ArticyObject.h" #include "ArticyRef.generated.h" /** * */ USTRUCT(BlueprintType) struct ARTICYRUNTIME_API FArticyRef { GENERATED_BODY() public: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Setup") bool bReferenceBaseObject = true; /** The currently assigned clone ID. Use */ UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (EditCondition="!bReferenceBaseObject"), Category="Setup") mutable int32 CloneId; void SetId(FArticyId NewId); void SetReference(UArticyObject* Object); const FArticyId& GetId() const; /** Get a (single-instance) copy of the referenced asset. */ template<typename T = UArticyObject> T* GetObject(const UObject* WorldContext) const; uint32 GetEffectiveCloneId() const { return bReferenceBaseObject ? 0ul : *reinterpret_cast<uint32*>(&CloneId); } enum EStringInitResult { NoneSet, IdSet, RefSet, AllSet }; // reference: color.h // used in details customization EStringInitResult InitFromString(const FString& SourceString) { Id.High = Id.Low = 0; const bool IdSet = FParse::Value(*SourceString, TEXT("Low="), Id.Low) && FParse::Value(*SourceString, TEXT("High="), Id.High); const bool RefSet = FParse::Bool(*SourceString, TEXT("bReferenceBaseObject="), bReferenceBaseObject) && FParse::Value(*SourceString, TEXT("CloneId="), CloneId); return IdSet && RefSet ? EStringInitResult::AllSet : IdSet ? EStringInitResult::IdSet : RefSet ? EStringInitResult::RefSet : EStringInitResult::NoneSet; } /** TODO * The ToString function is used to update Refs in the property system. * When determining if a ref is the same as another ref in a TMap in BP, the ExportItem function is used and strings are compared * The ExportItem function delivers Strings like below, but without spaces. Therefore it is possible to insert 2x the same ArticyRef. * However, when we remove the spaces, typical BP Map problems start existing. * If CharacterA Base = true exists, you can't add another CharacterA (because Base would be initialized to true) * Keep it like it is for now, as compiling will remove the duplicates. * * Future fixes: When Base is set to true, just set CloneId to 0 (data loss) * Or use another ToString function that only works with effective data, not literal data! * Same goes for FArticyId! */ FString ToString() const { return FString::Printf(TEXT("(bReferenceBaseObject=%s, CloneId=%d, Id=(Low=%d, High=%d))"), bReferenceBaseObject ? TEXT("True") : TEXT("False"), CloneId, Id.Low, Id.High); } /** Is used in hash operations, and in that case we want to know about effective data rather than literal data, * so a 'hidden' CloneID (bReferenceBaseObject = true) does not influence the comparison */ bool operator==(const FArticyRef& Other) const { return MatchesEffective(Other); } /** Used to compare raw data; CloneID might have different values between two ArticyRefs that have bReferenceBaseObject = true. */ bool MatchesRaw(const FArticyRef& Other) const { return Other.Id.Low == Id.Low && Other.Id.High == Id.High && Other.bReferenceBaseObject == bReferenceBaseObject && Other.CloneId == CloneId; } /** Used to compare effective data; will act as if CloneID was 0 when bReferenceBaseObject = true.*/ bool MatchesEffective(const FArticyRef& Other) const { return Other.Id.Low == Id.Low && Other.Id.High == Id.High && Other.bReferenceBaseObject == bReferenceBaseObject && Other.GetEffectiveCloneId() == GetEffectiveCloneId(); } bool operator!=(const FArticyRef& Other) const { return !this->operator==(Other); } friend uint32 GetTypeHash(const FArticyRef& Ref) { return HashCombine(GetTypeHash(Ref.GetId()), Ref.GetEffectiveCloneId()); } private: /** The actual reference: we keep track of the Reference's Id. * Set to EditAnywhere here to allow for a hack in manipulating properties * Set to disabled in the ArticyRefCustomization so that the user can't edit it directly */ UPROPERTY(EditAnywhere, Category="Setup") mutable FArticyId Id = 0; /** The single-instance object copy of this ArticyRef. */ mutable TWeakObjectPtr<UArticyObject> CachedObject = nullptr; mutable FArticyId CachedId = 0; mutable int32 CachedCloneId = 0; UArticyObject* GetObjectInternal(const UObject* WorldContext) const; private: ////the SerializeOrNot method is our friend! //template<class CPPSTRUCT> //friend typename TEnableIf<TStructOpsTypeTraits<CPPSTRUCT>::WithSerializer, bool>::Type SerializeOrNot(FArchive& Ar, CPPSTRUCT *Data); //bool Serialize(FArchive& Ar); ////the PostSerializeOrNot method is our friend as well! //template<class CPPSTRUCT> //friend typename TEnableIf<TStructOpsTypeTraits<CPPSTRUCT>::WithPostSerialize>::Type PostSerializeOrNot(const FArchive& Ar, CPPSTRUCT *Data); //void PostSerialize(const FArchive& Ar); }; template<typename T> T* FArticyRef::GetObject(const UObject* WorldContext) const { if (!CachedObject.IsValid() || CachedId != Id || CloneId != CachedCloneId) { CachedId = Id; CachedCloneId = CloneId; CachedObject = GetObjectInternal(WorldContext); } return Cast<T>(CachedObject.Get()); } //template<> //struct TStructOpsTypeTraits<FArticyRef> : public TStructOpsTypeTraitsBase2<FArticyRef> //{ // enum // { // WithSerializer = true, // WithPostSerialize = true // }; //};
33
173
0.735537
[ "object" ]
037162a488e70692ccf0f6251936ebc1c1b14a4f
834
h
C
src/lightMesh.h
EgeCiklabakkal/Raytracer
39ba3009198feb88e53a46849111282149ba4308
[ "MIT" ]
6
2019-10-13T17:38:57.000Z
2021-04-01T08:36:35.000Z
src/lightMesh.h
EgeCiklabakkal/Raytracer
39ba3009198feb88e53a46849111282149ba4308
[ "MIT" ]
null
null
null
src/lightMesh.h
EgeCiklabakkal/Raytracer
39ba3009198feb88e53a46849111282149ba4308
[ "MIT" ]
null
null
null
#ifndef _LIGHTMESH_H_ #define _LIGHTMESH_H_ #include "light.h" #include "instance.h" #include "material.h" #include "rtmath.h" #include "simpleCDF.h" class LightMesh : public Light, public ObjectInstance { public: SimpleCDF cdf; Vec3 radiance; LightMesh(const glm::mat4& trans, Shape* _prim, const Material& _material, const std::vector<Shape*>& meshTriangles, const Vec3& _radiance, bool _transformed=false); virtual ~LightMesh() {} virtual bool sampleLight(const Scene* scene, const Ray& r, const HitRecord& record, SampleLight& sampledLight, bool nonluminous) const; bool hit(const Ray& r, float tmin, float tmax, float time, HitRecord& record, bool cullFace, bool nonluminous) const; bool shadowHit(const Ray& r, float tmin, float tmax, float time, bool cullFace, bool nonluminous) const; }; #endif
26.903226
84
0.742206
[ "shape", "vector" ]
037f828ce7710b6ff69e00c872ce595a53bbc80e
4,450
h
C
cvs/objects/util/base/include/timer.h
cmcormack/gcam-core
ccbe826dbfeb9ed85472977aac6d36dbbf763a23
[ "ECL-2.0" ]
1
2021-04-28T04:10:11.000Z
2021-04-28T04:10:11.000Z
cvs/objects/util/base/include/timer.h
cmcormack/gcam-core
ccbe826dbfeb9ed85472977aac6d36dbbf763a23
[ "ECL-2.0" ]
2
2019-05-30T21:13:21.000Z
2019-08-14T13:21:13.000Z
cvs/objects/util/base/include/timer.h
cmcormack/gcam-core
ccbe826dbfeb9ed85472977aac6d36dbbf763a23
[ "ECL-2.0" ]
2
2021-07-26T05:56:09.000Z
2022-02-24T10:29:30.000Z
#ifndef _TIMER_H_ #define _TIMER_H_ #if defined(_MSC_VER) #pragma once #endif /* * LEGAL NOTICE * This computer software was prepared by Battelle Memorial Institute, * hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830 * with the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE * CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY * LIABILITY FOR THE USE OF THIS SOFTWARE. This notice including this * sentence must appear on any copies of this computer software. * * EXPORT CONTROL * User agrees that the Software will not be shipped, transferred or * exported into any country or used in any manner prohibited by the * United States Export Administration Act or any other applicable * export laws, restrictions or regulations (collectively the "Export Laws"). * Export of the Software may require some form of license or other * authority from the U.S. Government, and failure to obtain such * export control license may result in criminal liability under * U.S. laws. In addition, if the Software is identified as export controlled * items under the Export Laws, User represents and warrants that User * is not a citizen, or otherwise located within, an embargoed nation * (including without limitation Iran, Syria, Sudan, Cuba, and North Korea) * and that User is not otherwise prohibited * under the Export Laws from receiving the Software. * * Copyright 2011 Battelle Memorial Institute. All Rights Reserved. * Distributed as open-source under the terms of the Educational Community * License version 2.0 (ECL 2.0). http://www.opensource.org/licenses/ecl2.php * * For further details, see: http://www.globalchange.umd.edu/models/gcam/ * */ /*! * \file timer.h * \ingroup Objects * \brief Header file for the Timer class. * \author Josh Lurz */ #include <iosfwd> #include <string> #include <boost/date_time/posix_time/posix_time_types.hpp> #include <boost/core/noncopyable.hpp> #if GCAM_PARALLEL_ENABLED #include <tbb/spin_mutex.h> #endif /*! * \ingroup Objects * \brief A very basic class which times and prints events. * \author Josh Lurz */ class Timer : private boost::noncopyable { public: Timer(); void start(); void stop(); double getTotalTimeDifference() const; void print( std::ostream& aOut, const std::string& aTitle = "Time: " ) const; private: //! Time the timer started boost::posix_time::ptime mStartTime; //! State flag int mRunning; #if GCAM_PARALLEL_ENABLED tbb::spin_mutex mMutex; #endif //! The total time measured by this timer between all starts and stops. double mTotalTime; }; /*! * \brief A central timer repository which will keep track of named timers. * \details Registered timers will exist for the duration of the model and can be * started and stopped multiple times while keeping a running total of * the total time spent. This can be very useful for debugging or profiling * therefore it provides two interfaces. One where timers are named by * predefined enumerations where performance is critical and another they * are named by string which is more convenient. * \author Pralit Patel and Robert Link */ class TimerRegistry { public: //! Enumeration which describes predefined timers, to be used when performance //! is critical. enum PredefinedTimers { FULLSCENARIO, BISECT, SOLVER, JACOBIAN, EVAL_PART, EVAL_FULL, JAC_PRE, JAC_PRE_JAC, EDFUN_MISC, EDFUN_PRE, EDFUN_POST, EDFUN_AN_RESET, WRITE_DATA, END }; static TimerRegistry& getInstance(); Timer& getTimer( const std::string& aTimerName ); Timer& getTimer( const PredefinedTimers aTimerName ); void printAllTimers( std::ostream& aOut ) const; private: //! Private constructor to prevent multiple registries TimerRegistry(); //! Private undefined copy constructor to prevent copying TimerRegistry( const TimerRegistry& aTimerRegistry ); //! Private undefined assignment operator to prevent copying TimerRegistry& operator=( const TimerRegistry& aTimerRegistry ); //! A vector sized for the predefined timers for fast lookup. std::vector<Timer> mPredefinedTimers; //! A map for named timers. std::map<std::string, Timer> mNamedTimers; }; #endif // _TIMER_H_
32.246377
85
0.713258
[ "vector", "model" ]
037fb576a4841952e54a9576e2b7787c0c3f5e03
118,471
c
C
release/src-rt-6.x.4708/router/mysql/storage/innobase/row/row0mysql.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
278
2015-11-03T03:01:20.000Z
2022-01-20T18:21:05.000Z
release/src-rt-6.x.4708/router/mysql/storage/innobase/row/row0mysql.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
374
2015-11-03T12:37:22.000Z
2021-12-17T14:18:08.000Z
release/src-rt-6.x.4708/router/mysql/storage/innobase/row/row0mysql.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
96
2015-11-22T07:47:26.000Z
2022-01-20T19:52:19.000Z
/****************************************************** Interface between Innobase row operations and MySQL. Contains also create table and other data dictionary operations. (c) 2000 Innobase Oy Created 9/17/2000 Heikki Tuuri *******************************************************/ #include "row0mysql.h" #ifdef UNIV_NONINL #include "row0mysql.ic" #endif #include "row0ins.h" #include "row0sel.h" #include "row0upd.h" #include "row0row.h" #include "que0que.h" #include "pars0pars.h" #include "dict0dict.h" #include "dict0crea.h" #include "dict0load.h" #include "dict0boot.h" #include "trx0roll.h" #include "trx0purge.h" #include "lock0lock.h" #include "rem0cmp.h" #include "log0log.h" #include "btr0sea.h" #include "fil0fil.h" #include "ibuf0ibuf.h" #include "m_string.h" #include "my_sys.h" #include "ha_prototypes.h" /* A dummy variable used to fool the compiler */ ibool row_mysql_identically_false = FALSE; /* Provide optional 4.x backwards compatibility for 5.0 and above */ ibool row_rollback_on_timeout = FALSE; /* List of tables we should drop in background. ALTER TABLE in MySQL requires that the table handler can drop the table in background when there are no queries to it any more. Protected by the kernel mutex. */ typedef struct row_mysql_drop_struct row_mysql_drop_t; struct row_mysql_drop_struct{ char* table_name; UT_LIST_NODE_T(row_mysql_drop_t) row_mysql_drop_list; }; UT_LIST_BASE_NODE_T(row_mysql_drop_t) row_mysql_drop_list; ibool row_mysql_drop_list_inited = FALSE; /* Magic table names for invoking various monitor threads */ static const char S_innodb_monitor[] = "innodb_monitor"; static const char S_innodb_lock_monitor[] = "innodb_lock_monitor"; static const char S_innodb_tablespace_monitor[] = "innodb_tablespace_monitor"; static const char S_innodb_table_monitor[] = "innodb_table_monitor"; static const char S_innodb_mem_validate[] = "innodb_mem_validate"; /* Evaluates to true if str1 equals str2_onstack, used for comparing the above strings. */ #define STR_EQ(str1, str1_len, str2_onstack) \ ((str1_len) == sizeof(str2_onstack) \ && memcmp(str1, str2_onstack, sizeof(str2_onstack)) == 0) /*********************************************************************** Determine if the given name is a name reserved for MySQL system tables. */ static ibool row_mysql_is_system_table( /*======================*/ /* out: TRUE if name is a MySQL system table name */ const char* name) { if (strncmp(name, "mysql/", 6) != 0) { return(FALSE); } return(0 == strcmp(name + 6, "host") || 0 == strcmp(name + 6, "user") || 0 == strcmp(name + 6, "db")); } /*********************************************************************** Delays an INSERT, DELETE or UPDATE operation if the purge is lagging. */ static void row_mysql_delay_if_needed(void) /*===========================*/ { if (srv_dml_needed_delay) { os_thread_sleep(srv_dml_needed_delay); } } /*********************************************************************** Frees the blob heap in prebuilt when no longer needed. */ void row_mysql_prebuilt_free_blob_heap( /*==============================*/ row_prebuilt_t* prebuilt) /* in: prebuilt struct of a ha_innobase:: table handle */ { mem_heap_free(prebuilt->blob_heap); prebuilt->blob_heap = NULL; } /*********************************************************************** Stores a >= 5.0.3 format true VARCHAR length to dest, in the MySQL row format. */ byte* row_mysql_store_true_var_len( /*=========================*/ /* out: pointer to the data, we skip the 1 or 2 bytes at the start that are used to store the len */ byte* dest, /* in: where to store */ ulint len, /* in: length, must fit in two bytes */ ulint lenlen) /* in: storage length of len: either 1 or 2 bytes */ { if (lenlen == 2) { ut_a(len < 256 * 256); mach_write_to_2_little_endian(dest, len); return(dest + 2); } ut_a(lenlen == 1); ut_a(len < 256); mach_write_to_1(dest, len); return(dest + 1); } /*********************************************************************** Reads a >= 5.0.3 format true VARCHAR length, in the MySQL row format, and returns a pointer to the data. */ byte* row_mysql_read_true_varchar( /*========================*/ /* out: pointer to the data, we skip the 1 or 2 bytes at the start that are used to store the len */ ulint* len, /* out: variable-length field length */ byte* field, /* in: field in the MySQL format */ ulint lenlen) /* in: storage length of len: either 1 or 2 bytes */ { if (lenlen == 2) { *len = mach_read_from_2_little_endian(field); return(field + 2); } ut_a(lenlen == 1); *len = mach_read_from_1(field); return(field + 1); } /*********************************************************************** Stores a reference to a BLOB in the MySQL format. */ void row_mysql_store_blob_ref( /*=====================*/ byte* dest, /* in: where to store */ ulint col_len, /* in: dest buffer size: determines into how many bytes the BLOB length is stored, the space for the length may vary from 1 to 4 bytes */ byte* data, /* in: BLOB data; if the value to store is SQL NULL this should be NULL pointer */ ulint len) /* in: BLOB length; if the value to store is SQL NULL this should be 0; remember also to set the NULL bit in the MySQL record header! */ { /* MySQL might assume the field is set to zero except the length and the pointer fields */ memset(dest, '\0', col_len); /* In dest there are 1 - 4 bytes reserved for the BLOB length, and after that 8 bytes reserved for the pointer to the data. In 32-bit architectures we only use the first 4 bytes of the pointer slot. */ ut_a(col_len - 8 > 1 || len < 256); ut_a(col_len - 8 > 2 || len < 256 * 256); ut_a(col_len - 8 > 3 || len < 256 * 256 * 256); mach_write_to_n_little_endian(dest, col_len - 8, len); ut_memcpy(dest + col_len - 8, &data, sizeof(byte*)); } /*********************************************************************** Reads a reference to a BLOB in the MySQL format. */ byte* row_mysql_read_blob_ref( /*====================*/ /* out: pointer to BLOB data */ ulint* len, /* out: BLOB length */ byte* ref, /* in: BLOB reference in the MySQL format */ ulint col_len) /* in: BLOB reference length (not BLOB length) */ { byte* data; *len = mach_read_from_n_little_endian(ref, col_len - 8); ut_memcpy(&data, ref + col_len - 8, sizeof(byte*)); return(data); } /****************************************************************** Stores a non-SQL-NULL field given in the MySQL format in the InnoDB format. The counterpart of this function is row_sel_field_store_in_mysql_format() in row0sel.c. */ byte* row_mysql_store_col_in_innobase_format( /*===================================*/ /* out: up to which byte we used buf in the conversion */ dfield_t* dfield, /* in/out: dfield where dtype information must be already set when this function is called! */ byte* buf, /* in/out: buffer for a converted integer value; this must be at least col_len long then! */ ibool row_format_col, /* TRUE if the mysql_data is from a MySQL row, FALSE if from a MySQL key value; in MySQL, a true VARCHAR storage format differs in a row and in a key value: in a key value the length is always stored in 2 bytes! */ byte* mysql_data, /* in: MySQL column value, not SQL NULL; NOTE that dfield may also get a pointer to mysql_data, therefore do not discard this as long as dfield is used! */ ulint col_len, /* in: MySQL column length; NOTE that this is the storage length of the column in the MySQL format row, not necessarily the length of the actual payload data; if the column is a true VARCHAR then this is irrelevant */ ulint comp) /* in: nonzero=compact format */ { byte* ptr = mysql_data; dtype_t* dtype; ulint type; ulint lenlen; dtype = dfield_get_type(dfield); type = dtype->mtype; if (type == DATA_INT) { /* Store integer data in Innobase in a big-endian format, sign bit negated if the data is a signed integer. In MySQL, integers are stored in a little-endian format. */ ptr = buf + col_len; for (;;) { ptr--; *ptr = *mysql_data; if (ptr == buf) { break; } mysql_data++; } if (!(dtype->prtype & DATA_UNSIGNED)) { *ptr = (byte) (*ptr ^ 128); } buf += col_len; } else if ((type == DATA_VARCHAR || type == DATA_VARMYSQL || type == DATA_BINARY)) { if (dtype_get_mysql_type(dtype) == DATA_MYSQL_TRUE_VARCHAR) { /* The length of the actual data is stored to 1 or 2 bytes at the start of the field */ if (row_format_col) { if (dtype->prtype & DATA_LONG_TRUE_VARCHAR) { lenlen = 2; } else { lenlen = 1; } } else { /* In a MySQL key value, lenlen is always 2 */ lenlen = 2; } ptr = row_mysql_read_true_varchar(&col_len, mysql_data, lenlen); } else { /* Remove trailing spaces from old style VARCHAR columns. */ /* Handle UCS2 strings differently. */ ulint mbminlen = dtype_get_mbminlen(dtype); ptr = mysql_data; if (mbminlen == 2) { /* space=0x0020 */ /* Trim "half-chars", just in case. */ col_len &= ~1; while (col_len >= 2 && ptr[col_len - 2] == 0x00 && ptr[col_len - 1] == 0x20) { col_len -= 2; } } else { ut_a(mbminlen == 1); /* space=0x20 */ while (col_len > 0 && ptr[col_len - 1] == 0x20) { col_len--; } } } } else if (comp && type == DATA_MYSQL && dtype_get_mbminlen(dtype) == 1 && dtype_get_mbmaxlen(dtype) > 1) { /* In some cases we strip trailing spaces from UTF-8 and other multibyte charsets, from FIXED-length CHAR columns, to save space. UTF-8 would otherwise normally use 3 * the string length bytes to store an ASCII string! */ /* We assume that this CHAR field is encoded in a variable-length character set where spaces have 1:1 correspondence to 0x20 bytes, such as UTF-8. Consider a CHAR(n) field, a field of n characters. It will contain between n * mbminlen and n * mbmaxlen bytes. We will try to truncate it to n bytes by stripping space padding. If the field contains single-byte characters only, it will be truncated to n characters. Consider a CHAR(5) field containing the string ".a " where "." denotes a 3-byte character represented by the bytes "$%&". After our stripping, the string will be stored as "$%&a " (5 bytes). The string ".abc " will be stored as "$%&abc" (6 bytes). The space padding will be restored in row0sel.c, function row_sel_field_store_in_mysql_format(). */ ulint n_chars; ut_a(!(dtype_get_len(dtype) % dtype_get_mbmaxlen(dtype))); n_chars = dtype_get_len(dtype) / dtype_get_mbmaxlen(dtype); /* Strip space padding. */ while (col_len > n_chars && ptr[col_len - 1] == 0x20) { col_len--; } } else if (type == DATA_BLOB && row_format_col) { ptr = row_mysql_read_blob_ref(&col_len, mysql_data, col_len); } dfield_set_data(dfield, ptr, col_len); return(buf); } /****************************************************************** Convert a row in the MySQL format to a row in the Innobase format. Note that the function to convert a MySQL format key value to an InnoDB dtuple is row_sel_convert_mysql_key_to_innobase() in row0sel.c. */ static void row_mysql_convert_row_to_innobase( /*==============================*/ dtuple_t* row, /* in/out: Innobase row where the field type information is already copied there! */ row_prebuilt_t* prebuilt, /* in: prebuilt struct where template must be of type ROW_MYSQL_WHOLE_ROW */ byte* mysql_rec) /* in: row in the MySQL format; NOTE: do not discard as long as row is used, as row may contain pointers to this record! */ { const mysql_row_templ_t*templ; dfield_t* dfield; ulint i; ut_ad(prebuilt->template_type == ROW_MYSQL_WHOLE_ROW); ut_ad(prebuilt->mysql_template); for (i = 0; i < prebuilt->n_template; i++) { templ = prebuilt->mysql_template + i; dfield = dtuple_get_nth_field(row, i); if (templ->mysql_null_bit_mask != 0) { /* Column may be SQL NULL */ if (mysql_rec[templ->mysql_null_byte_offset] & (byte) (templ->mysql_null_bit_mask)) { /* It is SQL NULL */ dfield_set_data(dfield, NULL, UNIV_SQL_NULL); goto next_column; } } row_mysql_store_col_in_innobase_format( dfield, prebuilt->ins_upd_rec_buff + templ->mysql_col_offset, TRUE, /* MySQL row format data */ mysql_rec + templ->mysql_col_offset, templ->mysql_col_len, dict_table_is_comp(prebuilt->table)); next_column: ; } } /******************************************************************** Handles user errors and lock waits detected by the database engine. */ ibool row_mysql_handle_errors( /*====================*/ /* out: TRUE if it was a lock wait and we should continue running the query thread */ ulint* new_err,/* out: possible new error encountered in lock wait, or if no new error, the value of trx->error_state at the entry of this function */ trx_t* trx, /* in: transaction */ que_thr_t* thr, /* in: query thread */ trx_savept_t* savept) /* in: savepoint or NULL */ { #ifndef UNIV_HOTBACKUP ulint err; handle_new_error: err = trx->error_state; ut_a(err != DB_SUCCESS); trx->error_state = DB_SUCCESS; if ((err == DB_DUPLICATE_KEY) || (err == DB_FOREIGN_DUPLICATE_KEY)) { if (savept) { /* Roll back the latest, possibly incomplete insertion or update */ trx_general_rollback_for_mysql(trx, TRUE, savept); } } else if (err == DB_TOO_BIG_RECORD) { if (savept) { /* Roll back the latest, possibly incomplete insertion or update */ trx_general_rollback_for_mysql(trx, TRUE, savept); } /* MySQL will roll back the latest SQL statement */ } else if (err == DB_ROW_IS_REFERENCED || err == DB_NO_REFERENCED_ROW || err == DB_CANNOT_ADD_CONSTRAINT || err == DB_INTERRUPTED || err == DB_TOO_MANY_CONCURRENT_TRXS) { if (savept) { /* Roll back the latest, possibly incomplete insertion or update */ trx_general_rollback_for_mysql(trx, TRUE, savept); } /* MySQL will roll back the latest SQL statement */ } else if (err == DB_LOCK_WAIT) { srv_suspend_mysql_thread(thr); if (trx->error_state != DB_SUCCESS) { que_thr_stop_for_mysql(thr); goto handle_new_error; } *new_err = err; return(TRUE); } else if (err == DB_DEADLOCK || err == DB_LOCK_TABLE_FULL || (err == DB_LOCK_WAIT_TIMEOUT && row_rollback_on_timeout)) { /* Roll back the whole transaction; this resolution was added to version 3.23.43 */ trx_general_rollback_for_mysql(trx, FALSE, NULL); } else if (err == DB_OUT_OF_FILE_SPACE || err == DB_LOCK_WAIT_TIMEOUT) { ut_ad(!(err == DB_LOCK_WAIT_TIMEOUT && row_rollback_on_timeout)); if (savept) { /* Roll back the latest, possibly incomplete insertion or update */ trx_general_rollback_for_mysql(trx, TRUE, savept); } /* MySQL will roll back the latest SQL statement */ } else if (err == DB_MUST_GET_MORE_FILE_SPACE) { fputs("InnoDB: The database cannot continue" " operation because of\n" "InnoDB: lack of space. You must add" " a new data file to\n" "InnoDB: my.cnf and restart the database.\n", stderr); exit(1); } else if (err == DB_CORRUPTION) { fputs("InnoDB: We detected index corruption" " in an InnoDB type table.\n" "InnoDB: You have to dump + drop + reimport" " the table or, in\n" "InnoDB: a case of widespread corruption," " dump all InnoDB\n" "InnoDB: tables and recreate the" " whole InnoDB tablespace.\n" "InnoDB: If the mysqld server crashes" " after the startup or when\n" "InnoDB: you dump the tables, look at\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "forcing-innodb-recovery.html" " for help.\n", stderr); } else if (err == DB_FOREIGN_EXCEED_MAX_CASCADE) { fprintf(stderr, "InnoDB: Cannot delete/update rows with" " cascading foreign key constraints that exceed max" " depth of %lu\n" "Please drop excessive foreign constraints" " and try again\n", (ulong) DICT_FK_MAX_RECURSIVE_LOAD); } else { fprintf(stderr, "InnoDB: unknown error code %lu\n", (ulong) err); ut_error; } if (trx->error_state != DB_SUCCESS) { *new_err = trx->error_state; } else { *new_err = err; } trx->error_state = DB_SUCCESS; return(FALSE); #else /* UNIV_HOTBACKUP */ /* This function depends on MySQL code that is not included in InnoDB Hot Backup builds. Besides, this function should never be called in InnoDB Hot Backup. */ ut_error; return(FALSE); #endif /* UNIV_HOTBACKUP */ } /************************************************************************ Create a prebuilt struct for a MySQL table handle. */ row_prebuilt_t* row_create_prebuilt( /*================*/ /* out, own: a prebuilt struct */ dict_table_t* table) /* in: Innobase table handle */ { row_prebuilt_t* prebuilt; mem_heap_t* heap; dict_index_t* clust_index; dtuple_t* ref; ulint ref_len; ulint i; heap = mem_heap_create(128); prebuilt = mem_heap_alloc(heap, sizeof(row_prebuilt_t)); prebuilt->magic_n = ROW_PREBUILT_ALLOCATED; prebuilt->magic_n2 = ROW_PREBUILT_ALLOCATED; prebuilt->table = table; prebuilt->trx = NULL; prebuilt->sql_stat_start = TRUE; prebuilt->mysql_has_locked = FALSE; prebuilt->index = NULL; prebuilt->used_in_HANDLER = FALSE; prebuilt->n_template = 0; prebuilt->mysql_template = NULL; prebuilt->heap = heap; prebuilt->ins_node = NULL; prebuilt->ins_upd_rec_buff = NULL; prebuilt->default_rec = NULL; prebuilt->upd_node = NULL; prebuilt->ins_graph = NULL; prebuilt->upd_graph = NULL; prebuilt->pcur = btr_pcur_create_for_mysql(); prebuilt->clust_pcur = btr_pcur_create_for_mysql(); prebuilt->select_lock_type = LOCK_NONE; prebuilt->stored_select_lock_type = 99999999; prebuilt->row_read_type = ROW_READ_WITH_LOCKS; prebuilt->sel_graph = NULL; prebuilt->search_tuple = dtuple_create( heap, 2 * dict_table_get_n_cols(table)); clust_index = dict_table_get_first_index(table); /* Make sure that search_tuple is long enough for clustered index */ ut_a(2 * dict_table_get_n_cols(table) >= clust_index->n_fields); ref_len = dict_index_get_n_unique(clust_index); ref = dtuple_create(heap, ref_len); dict_index_copy_types(ref, clust_index, ref_len); prebuilt->clust_ref = ref; for (i = 0; i < MYSQL_FETCH_CACHE_SIZE; i++) { prebuilt->fetch_cache[i] = NULL; } prebuilt->n_fetch_cached = 0; prebuilt->blob_heap = NULL; prebuilt->old_vers_heap = NULL; prebuilt->autoinc_error = 0; prebuilt->autoinc_offset = 0; /* Default to 1, we will set the actual value later in ha_innobase::get_auto_increment(). */ prebuilt->autoinc_increment = 1; prebuilt->autoinc_last_value = 0; return(prebuilt); } /************************************************************************ Free a prebuilt struct for a MySQL table handle. */ void row_prebuilt_free( /*==============*/ row_prebuilt_t* prebuilt) /* in, own: prebuilt struct */ { ulint i; if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED || prebuilt->magic_n2 != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" "InnoDB: table handle. Magic n %lu," " magic n2 %lu, table name", (ulong) prebuilt->magic_n, (ulong) prebuilt->magic_n2); ut_print_name(stderr, NULL, TRUE, prebuilt->table->name); putc('\n', stderr); mem_analyze_corruption(prebuilt); ut_error; } prebuilt->magic_n = ROW_PREBUILT_FREED; prebuilt->magic_n2 = ROW_PREBUILT_FREED; btr_pcur_free_for_mysql(prebuilt->pcur); btr_pcur_free_for_mysql(prebuilt->clust_pcur); if (prebuilt->mysql_template) { mem_free(prebuilt->mysql_template); } if (prebuilt->ins_graph) { que_graph_free_recursive(prebuilt->ins_graph); } if (prebuilt->sel_graph) { que_graph_free_recursive(prebuilt->sel_graph); } if (prebuilt->upd_graph) { que_graph_free_recursive(prebuilt->upd_graph); } if (prebuilt->blob_heap) { mem_heap_free(prebuilt->blob_heap); } if (prebuilt->old_vers_heap) { mem_heap_free(prebuilt->old_vers_heap); } for (i = 0; i < MYSQL_FETCH_CACHE_SIZE; i++) { if (prebuilt->fetch_cache[i] != NULL) { if ((ROW_PREBUILT_FETCH_MAGIC_N != mach_read_from_4( (prebuilt->fetch_cache[i]) - 4)) || (ROW_PREBUILT_FETCH_MAGIC_N != mach_read_from_4( (prebuilt->fetch_cache[i]) + prebuilt->mysql_row_len))) { fputs("InnoDB: Error: trying to free" " a corrupt fetch buffer.\n", stderr); mem_analyze_corruption( prebuilt->fetch_cache[i]); ut_error; } mem_free((prebuilt->fetch_cache[i]) - 4); } } dict_table_decrement_handle_count(prebuilt->table); mem_heap_free(prebuilt->heap); } /************************************************************************* Updates the transaction pointers in query graphs stored in the prebuilt struct. */ void row_update_prebuilt_trx( /*====================*/ /* out: prebuilt dtuple */ row_prebuilt_t* prebuilt, /* in: prebuilt struct in MySQL handle */ trx_t* trx) /* in: transaction handle */ { if (trx->magic_n != TRX_MAGIC_N) { fprintf(stderr, "InnoDB: Error: trying to use a corrupt\n" "InnoDB: trx handle. Magic n %lu\n", (ulong) trx->magic_n); mem_analyze_corruption(trx); ut_error; } if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to use a corrupt\n" "InnoDB: table handle. Magic n %lu, table name", (ulong) prebuilt->magic_n); ut_print_name(stderr, NULL, TRUE, prebuilt->table->name); putc('\n', stderr); mem_analyze_corruption(prebuilt); ut_error; } prebuilt->trx = trx; if (prebuilt->ins_graph) { prebuilt->ins_graph->trx = trx; } if (prebuilt->upd_graph) { prebuilt->upd_graph->trx = trx; } if (prebuilt->sel_graph) { prebuilt->sel_graph->trx = trx; } } /************************************************************************* Gets pointer to a prebuilt dtuple used in insertions. If the insert graph has not yet been built in the prebuilt struct, then this function first builds it. */ static dtuple_t* row_get_prebuilt_insert_row( /*========================*/ /* out: prebuilt dtuple; the column type information is also set in it */ row_prebuilt_t* prebuilt) /* in: prebuilt struct in MySQL handle */ { ins_node_t* node; dtuple_t* row; dict_table_t* table = prebuilt->table; ulint i; ut_ad(prebuilt && table && prebuilt->trx); if (prebuilt->ins_node == NULL) { /* Not called before for this handle: create an insert node and query graph to the prebuilt struct */ node = ins_node_create(INS_DIRECT, table, prebuilt->heap); prebuilt->ins_node = node; if (prebuilt->ins_upd_rec_buff == NULL) { prebuilt->ins_upd_rec_buff = mem_heap_alloc( prebuilt->heap, prebuilt->mysql_row_len); } row = dtuple_create(prebuilt->heap, dict_table_get_n_cols(table)); dict_table_copy_types(row, table); /* We init the value of every field to the SQL NULL to avoid a debug assertion from failing */ for (i = 0; i < dtuple_get_n_fields(row); i++) { dtuple_get_nth_field(row, i)->len = UNIV_SQL_NULL; } ins_node_set_new_row(node, row); prebuilt->ins_graph = que_node_get_parent( pars_complete_graph_for_exec(node, prebuilt->trx, prebuilt->heap)); prebuilt->ins_graph->state = QUE_FORK_ACTIVE; } return(prebuilt->ins_node->row); } /************************************************************************* Updates the table modification counter and calculates new estimates for table and index statistics if necessary. */ UNIV_INLINE void row_update_statistics_if_needed( /*============================*/ dict_table_t* table) /* in: table */ { ulint counter; counter = table->stat_modified_counter; table->stat_modified_counter = counter + 1; /* Calculate new statistics if 1 / 16 of table has been modified since the last time a statistics batch was run, or if stat_modified_counter > 2 000 000 000 (to avoid wrap-around). We calculate statistics at most every 16th round, since we may have a counter table which is very small and updated very often. */ if (counter > 2000000000 || ((ib_longlong)counter > 16 + table->stat_n_rows / 16)) { dict_update_statistics(table); } } /************************************************************************* Unlocks an AUTO_INC type lock possibly reserved by trx. */ void row_unlock_table_autoinc_for_mysql( /*===============================*/ trx_t* trx) /* in: transaction */ { if (!trx->auto_inc_lock) { return; } lock_table_unlock_auto_inc(trx); } /************************************************************************* Sets an AUTO_INC type lock on the table mentioned in prebuilt. The AUTO_INC lock gives exclusive access to the auto-inc counter of the table. The lock is reserved only for the duration of an SQL statement. It is not compatible with another AUTO_INC or exclusive lock on the table. */ int row_lock_table_autoinc_for_mysql( /*=============================*/ /* out: error code or DB_SUCCESS */ row_prebuilt_t* prebuilt) /* in: prebuilt struct in the MySQL table handle */ { trx_t* trx = prebuilt->trx; ins_node_t* node = prebuilt->ins_node; que_thr_t* thr; ulint err; ibool was_lock_wait; ut_ad(trx); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); if (trx->auto_inc_lock) { return(DB_SUCCESS); } trx->op_info = "setting auto-inc lock"; if (node == NULL) { row_get_prebuilt_insert_row(prebuilt); node = prebuilt->ins_node; } /* We use the insert query graph as the dummy graph needed in the lock module call */ thr = que_fork_get_first_thr(prebuilt->ins_graph); que_thr_move_to_run_state_for_mysql(thr, trx); run_again: thr->run_node = node; thr->prev_node = node; /* It may be that the current session has not yet started its transaction, or it has been committed: */ trx_start_if_not_started(trx); err = lock_table(0, prebuilt->table, LOCK_AUTO_INC, thr); trx->error_state = err; if (err != DB_SUCCESS) { que_thr_stop_for_mysql(thr); was_lock_wait = row_mysql_handle_errors(&err, trx, thr, NULL); if (was_lock_wait) { goto run_again; } trx->op_info = ""; return((int) err); } que_thr_stop_for_mysql_no_error(thr, trx); trx->op_info = ""; return((int) err); } /************************************************************************* Sets a table lock on the table mentioned in prebuilt. */ int row_lock_table_for_mysql( /*=====================*/ /* out: error code or DB_SUCCESS */ row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL table handle */ dict_table_t* table, /* in: table to lock, or NULL if prebuilt->table should be locked as prebuilt->select_lock_type */ ulint mode) /* in: lock mode of table (ignored if table==NULL) */ { trx_t* trx = prebuilt->trx; que_thr_t* thr; ulint err; ibool was_lock_wait; ut_ad(trx); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); trx->op_info = "setting table lock"; if (prebuilt->sel_graph == NULL) { /* Build a dummy select query graph */ row_prebuild_sel_graph(prebuilt); } /* We use the select query graph as the dummy graph needed in the lock module call */ thr = que_fork_get_first_thr(prebuilt->sel_graph); que_thr_move_to_run_state_for_mysql(thr, trx); run_again: thr->run_node = thr; thr->prev_node = thr->common.parent; /* It may be that the current session has not yet started its transaction, or it has been committed: */ trx_start_if_not_started(trx); if (table) { err = lock_table(0, table, mode, thr); } else { err = lock_table(0, prebuilt->table, prebuilt->select_lock_type, thr); } trx->error_state = err; if (err != DB_SUCCESS) { que_thr_stop_for_mysql(thr); was_lock_wait = row_mysql_handle_errors(&err, trx, thr, NULL); if (was_lock_wait) { goto run_again; } trx->op_info = ""; return((int) err); } que_thr_stop_for_mysql_no_error(thr, trx); trx->op_info = ""; return((int) err); } /************************************************************************* Does an insert for MySQL. */ int row_insert_for_mysql( /*=================*/ /* out: error code or DB_SUCCESS */ byte* mysql_rec, /* in: row in the MySQL format */ row_prebuilt_t* prebuilt) /* in: prebuilt struct in MySQL handle */ { trx_savept_t savept; que_thr_t* thr; ulint err; ibool was_lock_wait; trx_t* trx = prebuilt->trx; ins_node_t* node = prebuilt->ins_node; ut_ad(trx); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); if (prebuilt->table->ibd_file_missing) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error:\n" "InnoDB: MySQL is trying to use a table handle" " but the .ibd file for\n" "InnoDB: table %s does not exist.\n" "InnoDB: Have you deleted the .ibd file" " from the database directory under\n" "InnoDB: the MySQL datadir, or have you" " used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); } if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" "InnoDB: table handle. Magic n %lu, table name", (ulong) prebuilt->magic_n); ut_print_name(stderr, prebuilt->trx, TRUE, prebuilt->table->name); putc('\n', stderr); mem_analyze_corruption(prebuilt); ut_error; } if (srv_created_new_raw || srv_force_recovery) { fputs("InnoDB: A new raw disk partition was initialized or\n" "InnoDB: innodb_force_recovery is on: we do not allow\n" "InnoDB: database modifications by the user. Shut down\n" "InnoDB: mysqld and edit my.cnf so that" " newraw is replaced\n" "InnoDB: with raw, and innodb_force_... is removed.\n", stderr); return(DB_ERROR); } trx->op_info = "inserting"; row_mysql_delay_if_needed(); trx_start_if_not_started(trx); if (node == NULL) { row_get_prebuilt_insert_row(prebuilt); node = prebuilt->ins_node; } row_mysql_convert_row_to_innobase(node->row, prebuilt, mysql_rec); savept = trx_savept_take(trx); thr = que_fork_get_first_thr(prebuilt->ins_graph); if (prebuilt->sql_stat_start) { node->state = INS_NODE_SET_IX_LOCK; prebuilt->sql_stat_start = FALSE; } else { node->state = INS_NODE_ALLOC_ROW_ID; } que_thr_move_to_run_state_for_mysql(thr, trx); run_again: thr->run_node = node; thr->prev_node = node; row_ins_step(thr); err = trx->error_state; if (err != DB_SUCCESS) { que_thr_stop_for_mysql(thr); /* TODO: what is this? */ thr->lock_state= QUE_THR_LOCK_ROW; was_lock_wait = row_mysql_handle_errors(&err, trx, thr, &savept); thr->lock_state= QUE_THR_LOCK_NOLOCK; if (was_lock_wait) { goto run_again; } trx->op_info = ""; return((int) err); } que_thr_stop_for_mysql_no_error(thr, trx); prebuilt->table->stat_n_rows++; srv_n_rows_inserted++; if (prebuilt->table->stat_n_rows == 0) { /* Avoid wrap-over */ prebuilt->table->stat_n_rows--; } row_update_statistics_if_needed(prebuilt->table); trx->op_info = ""; return((int) err); } /************************************************************************* Builds a dummy query graph used in selects. */ void row_prebuild_sel_graph( /*===================*/ row_prebuilt_t* prebuilt) /* in: prebuilt struct in MySQL handle */ { sel_node_t* node; ut_ad(prebuilt && prebuilt->trx); if (prebuilt->sel_graph == NULL) { node = sel_node_create(prebuilt->heap); prebuilt->sel_graph = que_node_get_parent( pars_complete_graph_for_exec(node, prebuilt->trx, prebuilt->heap)); prebuilt->sel_graph->state = QUE_FORK_ACTIVE; } } /************************************************************************* Creates an query graph node of 'update' type to be used in the MySQL interface. */ upd_node_t* row_create_update_node_for_mysql( /*=============================*/ /* out, own: update node */ dict_table_t* table, /* in: table to update */ mem_heap_t* heap) /* in: mem heap from which allocated */ { upd_node_t* node; node = upd_node_create(heap); node->in_mysql_interface = TRUE; node->is_delete = FALSE; node->searched_update = FALSE; node->select_will_do_update = FALSE; node->select = NULL; node->pcur = btr_pcur_create_for_mysql(); node->table = table; node->update = upd_create(dict_table_get_n_cols(table), heap); node->update_n_fields = dict_table_get_n_cols(table); UT_LIST_INIT(node->columns); node->has_clust_rec_x_lock = TRUE; node->cmpl_info = 0; node->table_sym = NULL; node->col_assign_list = NULL; return(node); } /************************************************************************* Gets pointer to a prebuilt update vector used in updates. If the update graph has not yet been built in the prebuilt struct, then this function first builds it. */ upd_t* row_get_prebuilt_update_vector( /*===========================*/ /* out: prebuilt update vector */ row_prebuilt_t* prebuilt) /* in: prebuilt struct in MySQL handle */ { dict_table_t* table = prebuilt->table; upd_node_t* node; ut_ad(prebuilt && table && prebuilt->trx); if (prebuilt->upd_node == NULL) { /* Not called before for this handle: create an update node and query graph to the prebuilt struct */ node = row_create_update_node_for_mysql(table, prebuilt->heap); prebuilt->upd_node = node; prebuilt->upd_graph = que_node_get_parent( pars_complete_graph_for_exec(node, prebuilt->trx, prebuilt->heap)); prebuilt->upd_graph->state = QUE_FORK_ACTIVE; } return(prebuilt->upd_node->update); } /************************************************************************* Does an update or delete of a row for MySQL. */ int row_update_for_mysql( /*=================*/ /* out: error code or DB_SUCCESS */ byte* mysql_rec, /* in: the row to be updated, in the MySQL format */ row_prebuilt_t* prebuilt) /* in: prebuilt struct in MySQL handle */ { trx_savept_t savept; ulint err; que_thr_t* thr; ibool was_lock_wait; dict_index_t* clust_index; /* ulint ref_len; */ upd_node_t* node; dict_table_t* table = prebuilt->table; trx_t* trx = prebuilt->trx; ut_ad(prebuilt && trx); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); UT_NOT_USED(mysql_rec); if (prebuilt->table->ibd_file_missing) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error:\n" "InnoDB: MySQL is trying to use a table handle" " but the .ibd file for\n" "InnoDB: table %s does not exist.\n" "InnoDB: Have you deleted the .ibd file" " from the database directory under\n" "InnoDB: the MySQL datadir, or have you" " used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); } if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" "InnoDB: table handle. Magic n %lu, table name", (ulong) prebuilt->magic_n); ut_print_name(stderr, prebuilt->trx, TRUE, prebuilt->table->name); putc('\n', stderr); mem_analyze_corruption(prebuilt); ut_error; } if (srv_created_new_raw || srv_force_recovery) { fputs("InnoDB: A new raw disk partition was initialized or\n" "InnoDB: innodb_force_recovery is on: we do not allow\n" "InnoDB: database modifications by the user. Shut down\n" "InnoDB: mysqld and edit my.cnf so that newraw" " is replaced\n" "InnoDB: with raw, and innodb_force_... is removed.\n", stderr); return(DB_ERROR); } DEBUG_SYNC_C("innodb_row_update_for_mysql_begin"); trx->op_info = "updating or deleting"; row_mysql_delay_if_needed(); trx_start_if_not_started(trx); node = prebuilt->upd_node; clust_index = dict_table_get_first_index(table); if (prebuilt->pcur->btr_cur.index == clust_index) { btr_pcur_copy_stored_position(node->pcur, prebuilt->pcur); } else { btr_pcur_copy_stored_position(node->pcur, prebuilt->clust_pcur); } ut_a(node->pcur->rel_pos == BTR_PCUR_ON); /* MySQL seems to call rnd_pos before updating each row it has cached: we can get the correct cursor position from prebuilt->pcur; NOTE that we cannot build the row reference from mysql_rec if the clustered index was automatically generated for the table: MySQL does not know anything about the row id used as the clustered index key */ savept = trx_savept_take(trx); thr = que_fork_get_first_thr(prebuilt->upd_graph); node->state = UPD_NODE_UPDATE_CLUSTERED; ut_ad(!prebuilt->sql_stat_start); que_thr_move_to_run_state_for_mysql(thr, trx); run_again: thr->run_node = node; thr->prev_node = node; thr->fk_cascade_depth = 0; row_upd_step(thr); err = trx->error_state; /* Reset fk_cascade_depth back to 0 */ thr->fk_cascade_depth = 0; if (err != DB_SUCCESS) { que_thr_stop_for_mysql(thr); if (err == DB_RECORD_NOT_FOUND) { trx->error_state = DB_SUCCESS; trx->op_info = ""; return((int) err); } thr->lock_state= QUE_THR_LOCK_ROW; was_lock_wait = row_mysql_handle_errors(&err, trx, thr, &savept); thr->lock_state= QUE_THR_LOCK_NOLOCK; if (was_lock_wait) { goto run_again; } trx->op_info = ""; return((int) err); } que_thr_stop_for_mysql_no_error(thr, trx); if (node->is_delete) { if (prebuilt->table->stat_n_rows > 0) { prebuilt->table->stat_n_rows--; } srv_n_rows_deleted++; } else { srv_n_rows_updated++; } /* We update table statistics only if it is a DELETE or UPDATE that changes indexed columns, UPDATEs that change only non-indexed columns would not affect statistics. */ if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) { row_update_statistics_if_needed(prebuilt->table); } trx->op_info = ""; return((int) err); } /************************************************************************* This can only be used when srv_locks_unsafe_for_binlog is TRUE or this session is using a READ COMMITTED or READ UNCOMMITTED isolation level. Before calling this function row_search_for_mysql() must have initialized prebuilt->new_rec_locks to store the information which new record locks really were set. This function removes a newly set clustered index record lock under prebuilt->pcur or prebuilt->clust_pcur. Thus, this implements a 'mini-rollback' that releases the latest clustered index record lock we set. */ int row_unlock_for_mysql( /*=================*/ /* out: error code or DB_SUCCESS */ row_prebuilt_t* prebuilt, /* in/out: prebuilt struct in MySQL handle */ ibool has_latches_on_recs)/* TRUE if called so that we have the latches on the records under pcur and clust_pcur, and we do not need to reposition the cursors. */ { btr_pcur_t* pcur = prebuilt->pcur; btr_pcur_t* clust_pcur = prebuilt->clust_pcur; trx_t* trx = prebuilt->trx; ut_ad(prebuilt && trx); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); if (UNIV_UNLIKELY (!srv_locks_unsafe_for_binlog && trx->isolation_level > TRX_ISO_READ_COMMITTED)) { fprintf(stderr, "InnoDB: Error: calling row_unlock_for_mysql though\n" "InnoDB: innodb_locks_unsafe_for_binlog is FALSE and\n" "InnoDB: this session is not using" " READ COMMITTED isolation level.\n"); return(DB_SUCCESS); } trx->op_info = "unlock_row"; if (prebuilt->new_rec_locks >= 1) { rec_t* rec; dict_index_t* index; dulint rec_trx_id; mtr_t mtr; mtr_start(&mtr); /* Restore the cursor position and find the record */ if (!has_latches_on_recs) { btr_pcur_restore_position(BTR_SEARCH_LEAF, pcur, &mtr); } rec = btr_pcur_get_rec(pcur); index = btr_pcur_get_btr_cur(pcur)->index; if (prebuilt->new_rec_locks >= 2) { /* Restore the cursor position and find the record in the clustered index. */ if (!has_latches_on_recs) { btr_pcur_restore_position(BTR_SEARCH_LEAF, clust_pcur, &mtr); } rec = btr_pcur_get_rec(clust_pcur); index = btr_pcur_get_btr_cur(clust_pcur)->index; } if (UNIV_UNLIKELY(!(index->type & DICT_CLUSTERED))) { /* This is not a clustered index record. We do not know how to unlock the record. */ goto no_unlock; } /* If the record has been modified by this transaction, do not unlock it. */ if (index->trx_id_offset) { rec_trx_id = trx_read_trx_id(rec + index->trx_id_offset); } else { mem_heap_t* heap = NULL; ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); rec_trx_id = row_get_rec_trx_id(rec, index, offsets); if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } } if (ut_dulint_cmp(rec_trx_id, trx->id) != 0) { /* We did not update the record: unlock it */ rec = btr_pcur_get_rec(pcur); index = btr_pcur_get_btr_cur(pcur)->index; lock_rec_unlock(trx, rec, prebuilt->select_lock_type); if (prebuilt->new_rec_locks >= 2) { rec = btr_pcur_get_rec(clust_pcur); index = btr_pcur_get_btr_cur(clust_pcur)->index; lock_rec_unlock(trx, rec, prebuilt->select_lock_type); } } no_unlock: mtr_commit(&mtr); } trx->op_info = ""; return(DB_SUCCESS); } /************************************************************************** Does a cascaded delete or set null in a foreign key operation. */ ulint row_update_cascade_for_mysql( /*=========================*/ /* out: error code or DB_SUCCESS */ que_thr_t* thr, /* in: query thread */ upd_node_t* node, /* in: update node used in the cascade or set null operation */ dict_table_t* table) /* in: table where we do the operation */ { ulint err; trx_t* trx; trx = thr_get_trx(thr); /* Increment fk_cascade_depth to record the recursive call depth on a single update/delete that affects multiple tables chained together with foreign key relations. */ thr->fk_cascade_depth++; if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) { return (DB_FOREIGN_EXCEED_MAX_CASCADE); } run_again: thr->run_node = node; thr->prev_node = node; row_upd_step(thr); /* The recursive call for cascading update/delete happens in above row_upd_step(), reset the counter once we come out of the recursive call, so it does not accumulate for different row deletes */ thr->fk_cascade_depth = 0; err = trx->error_state; /* Note that the cascade node is a subnode of another InnoDB query graph node. We do a normal lock wait in this node, but all errors are handled by the parent node. */ if (err == DB_LOCK_WAIT) { /* Handle lock wait here */ que_thr_stop_for_mysql(thr); srv_suspend_mysql_thread(thr); /* Note that a lock wait may also end in a lock wait timeout, or this transaction is picked as a victim in selective deadlock resolution */ if (trx->error_state != DB_SUCCESS) { return(trx->error_state); } /* Retry operation after a normal lock wait */ goto run_again; } if (err != DB_SUCCESS) { return(err); } if (node->is_delete) { if (table->stat_n_rows > 0) { table->stat_n_rows--; } srv_n_rows_deleted++; } else { srv_n_rows_updated++; } row_update_statistics_if_needed(table); return(err); } /************************************************************************* Checks if a table is such that we automatically created a clustered index on it (on row id). */ ibool row_table_got_default_clust_index( /*==============================*/ dict_table_t* table) { const dict_index_t* clust_index; clust_index = dict_table_get_first_index(table); return(dict_index_get_nth_col(clust_index, 0)->mtype == DATA_SYS); } /************************************************************************* Calculates the key number used inside MySQL for an Innobase index. We have to take into account if we generated a default clustered index for the table */ ulint row_get_mysql_key_number_for_index( /*===============================*/ dict_index_t* index) { dict_index_t* ind; ulint i; ut_a(index); i = 0; ind = dict_table_get_first_index(index->table); while (index != ind) { ind = dict_table_get_next_index(ind); i++; } if (row_table_got_default_clust_index(index->table)) { ut_a(i > 0); i--; } return(i); } /************************************************************************* Locks the data dictionary in shared mode from modifications, for performing foreign key check, rollback, or other operation invisible to MySQL. */ void row_mysql_freeze_data_dictionary( /*=============================*/ trx_t* trx) /* in: transaction */ { ut_a(trx->dict_operation_lock_mode == 0); rw_lock_s_lock(&dict_operation_lock); trx->dict_operation_lock_mode = RW_S_LATCH; } /************************************************************************* Unlocks the data dictionary shared lock. */ void row_mysql_unfreeze_data_dictionary( /*===============================*/ trx_t* trx) /* in: transaction */ { ut_a(trx->dict_operation_lock_mode == RW_S_LATCH); rw_lock_s_unlock(&dict_operation_lock); trx->dict_operation_lock_mode = 0; } /************************************************************************* Locks the data dictionary exclusively for performing a table create or other data dictionary modification operation. */ void row_mysql_lock_data_dictionary( /*===========================*/ trx_t* trx) /* in: transaction */ { ut_a(trx->dict_operation_lock_mode == 0 || trx->dict_operation_lock_mode == RW_X_LATCH); /* Serialize data dictionary operations with dictionary mutex: no deadlocks or lock waits can occur then in these operations */ rw_lock_x_lock(&dict_operation_lock); trx->dict_operation_lock_mode = RW_X_LATCH; mutex_enter(&(dict_sys->mutex)); } /************************************************************************* Unlocks the data dictionary exclusive lock. */ void row_mysql_unlock_data_dictionary( /*=============================*/ trx_t* trx) /* in: transaction */ { ut_a(trx->dict_operation_lock_mode == RW_X_LATCH); /* Serialize data dictionary operations with dictionary mutex: no deadlocks can occur then in these operations */ mutex_exit(&(dict_sys->mutex)); rw_lock_x_unlock(&dict_operation_lock); trx->dict_operation_lock_mode = 0; } /************************************************************************* Creates a table for MySQL. If the name of the table ends in one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor", "innodb_table_monitor", then this will also start the printing of monitor output by the master thread. If the table name ends in "innodb_mem_validate", InnoDB will try to invoke mem_validate(). */ int row_create_table_for_mysql( /*=======================*/ /* out: error code or DB_SUCCESS */ dict_table_t* table, /* in: table definition */ trx_t* trx) /* in: transaction handle */ { tab_node_t* node; mem_heap_t* heap; que_thr_t* thr; const char* table_name; ulint table_name_len; ulint err; ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); #endif /* UNIV_SYNC_DEBUG */ ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH); if (srv_created_new_raw) { fputs("InnoDB: A new raw disk partition was initialized:\n" "InnoDB: we do not allow database modifications" " by the user.\n" "InnoDB: Shut down mysqld and edit my.cnf so that newraw" " is replaced with raw.\n", stderr); dict_mem_table_free(table); trx_commit_for_mysql(trx); return(DB_ERROR); } trx->op_info = "creating table"; if (row_mysql_is_system_table(table->name)) { fprintf(stderr, "InnoDB: Error: trying to create a MySQL system" " table %s of type InnoDB.\n" "InnoDB: MySQL system tables must be" " of the MyISAM type!\n", table->name); dict_mem_table_free(table); trx_commit_for_mysql(trx); return(DB_ERROR); } trx_start_if_not_started(trx); /* The table name is prefixed with the database name and a '/'. Certain table names starting with 'innodb_' have their special meaning regardless of the database name. Thus, we need to ignore the database name prefix in the comparisons. */ table_name = strchr(table->name, '/'); ut_a(table_name); table_name++; table_name_len = strlen(table_name) + 1; if (STR_EQ(table_name, table_name_len, S_innodb_monitor)) { /* Table equals "innodb_monitor": start monitor prints */ srv_print_innodb_monitor = TRUE; /* The lock timeout monitor thread also takes care of InnoDB monitor prints */ os_event_set(srv_lock_timeout_thread_event); } else if (STR_EQ(table_name, table_name_len, S_innodb_lock_monitor)) { srv_print_innodb_monitor = TRUE; srv_print_innodb_lock_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); } else if (STR_EQ(table_name, table_name_len, S_innodb_tablespace_monitor)) { srv_print_innodb_tablespace_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); } else if (STR_EQ(table_name, table_name_len, S_innodb_table_monitor)) { srv_print_innodb_table_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); } else if (STR_EQ(table_name, table_name_len, S_innodb_mem_validate)) { /* We define here a debugging feature intended for developers */ fputs("Validating InnoDB memory:\n" "to use this feature you must compile InnoDB with\n" "UNIV_MEM_DEBUG defined in univ.i and" " the server must be\n" "quiet because allocation from a mem heap" " is not protected\n" "by any semaphore.\n", stderr); #ifdef UNIV_MEM_DEBUG ut_a(mem_validate()); fputs("Memory validated\n", stderr); #else /* UNIV_MEM_DEBUG */ fputs("Memory NOT validated (recompile with UNIV_MEM_DEBUG)\n", stderr); #endif /* UNIV_MEM_DEBUG */ } heap = mem_heap_create(512); trx->dict_operation = TRUE; node = tab_create_graph_create(table, heap); thr = pars_complete_graph_for_exec(node, trx, heap); ut_a(thr == que_fork_start_command(que_node_get_parent(thr))); que_run_threads(thr); err = trx->error_state; if (err != DB_SUCCESS) { /* We have special error handling here */ trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); if (err == DB_OUT_OF_FILE_SPACE) { ut_print_timestamp(stderr); fputs(" InnoDB: Warning: cannot create table ", stderr); ut_print_name(stderr, trx, TRUE, table->name); fputs(" because tablespace full\n", stderr); if (dict_table_get_low(table->name)) { row_drop_table_for_mysql(table->name, trx, FALSE); } } else if (err == DB_TOO_MANY_CONCURRENT_TRXS) { /* We already have .ibd file here. it should be deleted. */ if (table->space && !fil_delete_tablespace(table->space)) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error: not able to" " delete tablespace %lu of table ", (ulong) table->space); ut_print_name(stderr, trx, TRUE, table->name); fputs("!\n", stderr); } } else if (err == DB_DUPLICATE_KEY) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, TRUE, table->name); fputs(" already exists in InnoDB internal\n" "InnoDB: data dictionary. Have you deleted" " the .frm file\n" "InnoDB: and not used DROP TABLE?" " Have you used DROP DATABASE\n" "InnoDB: for InnoDB tables in" " MySQL version <= 3.23.43?\n" "InnoDB: See the Restrictions section" " of the InnoDB manual.\n" "InnoDB: You can drop the orphaned table" " inside InnoDB by\n" "InnoDB: creating an InnoDB table with" " the same name in another\n" "InnoDB: database and copying the .frm file" " to the current database.\n" "InnoDB: Then MySQL thinks the table exists," " and DROP TABLE will\n" "InnoDB: succeed.\n" "InnoDB: You can look for further help from\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "innodb-troubleshooting.html\n", stderr); } /* We may also get err == DB_ERROR if the .ibd file for the table already exists */ trx->error_state = DB_SUCCESS; dict_mem_table_free(table); } que_graph_free((que_t*) que_node_get_parent(thr)); trx->op_info = ""; return((int) err); } /************************************************************************* Does an index creation operation for MySQL. TODO: currently failure to create an index results in dropping the whole table! This is no problem currently as all indexes must be created at the same time as the table. */ int row_create_index_for_mysql( /*=======================*/ /* out: error number or DB_SUCCESS */ dict_index_t* index, /* in: index definition */ trx_t* trx, /* in: transaction handle */ const ulint* field_lengths) /* in: if not NULL, must contain dict_index_get_n_fields(index) actual field lengths for the index columns, which are then checked for not being too large. */ { ind_node_t* node; mem_heap_t* heap; que_thr_t* thr; ulint err; ulint i, j; ulint len; char* table_name; #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); #endif /* UNIV_SYNC_DEBUG */ ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); trx->op_info = "creating index"; /* Copy the table name because we may want to drop the table later, after the index object is freed (inside que_run_threads()) and thus index->table_name is not available. */ table_name = mem_strdup(index->table_name); trx_start_if_not_started(trx); /* Check that the same column does not appear twice in the index. Starting from 4.0.14, InnoDB should be able to cope with that, but safer not to allow them. */ for (i = 0; i < dict_index_get_n_fields(index); i++) { for (j = 0; j < i; j++) { if (0 == ut_strcmp( dict_index_get_nth_field(index, j)->name, dict_index_get_nth_field(index, i)->name)) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: column ", stderr); ut_print_name(stderr, trx, FALSE, dict_index_get_nth_field( index, i)->name); fputs(" appears twice in ", stderr); dict_index_name_print(stderr, trx, index); fputs("\n" "InnoDB: This is not allowed" " in InnoDB.\n", stderr); err = DB_COL_APPEARS_TWICE_IN_INDEX; goto error_handling; } } /* Check also that prefix_len and actual length < DICT_MAX_INDEX_COL_LEN */ len = dict_index_get_nth_field(index, i)->prefix_len; if (field_lengths) { len = ut_max(len, field_lengths[i]); } if (len >= DICT_MAX_INDEX_COL_LEN) { err = DB_TOO_BIG_RECORD; goto error_handling; } } heap = mem_heap_create(512); trx->dict_operation = TRUE; /* Note that the space id where we store the index is inherited from the table in dict_build_index_def_step() in dict0crea.c. */ node = ind_create_graph_create(index, heap); thr = pars_complete_graph_for_exec(node, trx, heap); ut_a(thr == que_fork_start_command(que_node_get_parent(thr))); que_run_threads(thr); err = trx->error_state; que_graph_free((que_t*) que_node_get_parent(thr)); error_handling: if (err != DB_SUCCESS) { /* We have special error handling here */ trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); row_drop_table_for_mysql(table_name, trx, FALSE); trx->error_state = DB_SUCCESS; } trx->op_info = ""; mem_free(table_name); return((int) err); } /************************************************************************* Scans a table create SQL string and adds to the data dictionary the foreign key constraints declared in the string. This function should be called after the indexes for a table have been created. Each foreign key constraint must be accompanied with indexes in both participating tables. The indexes are allowed to contain more fields than mentioned in the constraint. Check also that foreign key constraints which reference this table are ok. */ int row_table_add_foreign_constraints( /*==============================*/ /* out: error code or DB_SUCCESS */ trx_t* trx, /* in: transaction */ const char* sql_string, /* in: table create statement where foreign keys are declared like: FOREIGN KEY (a, b) REFERENCES table2(c, d), table2 can be written also with the database name before it: test.table2 */ size_t sql_length, /* in: length of sql_string */ const char* name, /* in: table full name in the normalized form database_name/table_name */ ibool reject_fks) /* in: if TRUE, fail with error code DB_CANNOT_ADD_CONSTRAINT if any foreign keys are found. */ { ulint err; ut_ad(mutex_own(&(dict_sys->mutex))); #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); #endif /* UNIV_SYNC_DEBUG */ ut_a(sql_string); trx->op_info = "adding foreign keys"; trx_start_if_not_started(trx); trx->dict_operation = TRUE; err = dict_create_foreign_constraints(trx, sql_string, sql_length, name, reject_fks); if (err == DB_SUCCESS) { /* Check that also referencing constraints are ok */ err = dict_load_foreigns(name, FALSE, TRUE); } if (err != DB_SUCCESS) { /* We have special error handling here */ trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); row_drop_table_for_mysql(name, trx, FALSE); trx->error_state = DB_SUCCESS; } return((int) err); } /************************************************************************* Drops a table for MySQL as a background operation. MySQL relies on Unix in ALTER TABLE to the fact that the table handler does not remove the table before all handles to it has been removed. Furhermore, the MySQL's call to drop table must be non-blocking. Therefore we do the drop table as a background operation, which is taken care of by the master thread in srv0srv.c. */ static int row_drop_table_for_mysql_in_background( /*===================================*/ /* out: error code or DB_SUCCESS */ const char* name) /* in: table name */ { ulint error; trx_t* trx; trx = trx_allocate_for_background(); /* If the original transaction was dropping a table referenced by foreign keys, we must set the following to be able to drop the table: */ trx->check_foreigns = FALSE; /* fputs("InnoDB: Error: Dropping table ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs(" in background drop list\n", stderr); */ /* Try to drop the table in InnoDB */ error = row_drop_table_for_mysql(name, trx, FALSE); /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs with innodb_flush_log_at_trx_commit = 0 */ log_buffer_flush_to_disk(); trx_commit_for_mysql(trx); trx_free_for_background(trx); return((int) error); } /************************************************************************* The master thread in srv0srv.c calls this regularly to drop tables which we must drop in background after queries to them have ended. Such lazy dropping of tables is needed in ALTER TABLE on Unix. */ ulint row_drop_tables_for_mysql_in_background(void) /*=========================================*/ /* out: how many tables dropped + remaining tables in list */ { row_mysql_drop_t* drop; dict_table_t* table; ulint n_tables; ulint n_tables_dropped = 0; loop: mutex_enter(&kernel_mutex); if (!row_mysql_drop_list_inited) { UT_LIST_INIT(row_mysql_drop_list); row_mysql_drop_list_inited = TRUE; } drop = UT_LIST_GET_FIRST(row_mysql_drop_list); n_tables = UT_LIST_GET_LEN(row_mysql_drop_list); mutex_exit(&kernel_mutex); if (drop == NULL) { /* All tables dropped */ return(n_tables + n_tables_dropped); } mutex_enter(&(dict_sys->mutex)); table = dict_table_get_low(drop->table_name); mutex_exit(&(dict_sys->mutex)); if (table == NULL) { /* If for some reason the table has already been dropped through some other mechanism, do not try to drop it */ goto already_dropped; } if (DB_SUCCESS != row_drop_table_for_mysql_in_background( drop->table_name)) { /* If the DROP fails for some table, we return, and let the main thread retry later */ return(n_tables + n_tables_dropped); } n_tables_dropped++; already_dropped: mutex_enter(&kernel_mutex); UT_LIST_REMOVE(row_mysql_drop_list, row_mysql_drop_list, drop); ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Dropped table %s in background drop queue.\n", drop->table_name); mem_free(drop->table_name); mem_free(drop); mutex_exit(&kernel_mutex); goto loop; } /************************************************************************* Get the background drop list length. NOTE: the caller must own the kernel mutex! */ ulint row_get_background_drop_list_len_low(void) /*======================================*/ /* out: how many tables in list */ { ut_ad(mutex_own(&kernel_mutex)); if (!row_mysql_drop_list_inited) { UT_LIST_INIT(row_mysql_drop_list); row_mysql_drop_list_inited = TRUE; } return(UT_LIST_GET_LEN(row_mysql_drop_list)); } /************************************************************************* If a table is not yet in the drop list, adds the table to the list of tables which the master thread drops in background. We need this on Unix because in ALTER TABLE MySQL may call drop table even if the table has running queries on it. Also, if there are running foreign key checks on the table, we drop the table lazily. */ static ibool row_add_table_to_background_drop_list( /*==================================*/ /* out: TRUE if the table was not yet in the drop list, and was added there */ dict_table_t* table) /* in: table */ { row_mysql_drop_t* drop; mutex_enter(&kernel_mutex); if (!row_mysql_drop_list_inited) { UT_LIST_INIT(row_mysql_drop_list); row_mysql_drop_list_inited = TRUE; } /* Look if the table already is in the drop list */ drop = UT_LIST_GET_FIRST(row_mysql_drop_list); while (drop != NULL) { if (strcmp(drop->table_name, table->name) == 0) { /* Already in the list */ mutex_exit(&kernel_mutex); return(FALSE); } drop = UT_LIST_GET_NEXT(row_mysql_drop_list, drop); } drop = mem_alloc(sizeof(row_mysql_drop_t)); drop->table_name = mem_strdup(table->name); UT_LIST_ADD_LAST(row_mysql_drop_list, row_mysql_drop_list, drop); /* fputs("InnoDB: Adding table ", stderr); ut_print_name(stderr, trx, TRUE, drop->table_name); fputs(" to background drop list\n", stderr); */ mutex_exit(&kernel_mutex); return(TRUE); } #ifndef UNIV_HOTBACKUP /************************************************************************* Discards the tablespace of a table which stored in an .ibd file. Discarding means that this function deletes the .ibd file and assigns a new table id for the table. Also the flag table->ibd_file_missing is set TRUE. */ int row_discard_tablespace_for_mysql( /*=============================*/ /* out: error code or DB_SUCCESS */ const char* name, /* in: table name */ trx_t* trx) /* in: transaction handle */ { dict_foreign_t* foreign; dulint new_id; dict_table_t* table; ibool success; ulint err; pars_info_t* info = NULL; /* How do we prevent crashes caused by ongoing operations on the table? Old operations could try to access non-existent pages. 1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock on the table before we can do DISCARD TABLESPACE. Then there are no running queries on the table. 2) Purge and rollback: we assign a new table id for the table. Since purge and rollback look for the table based on the table id, they see the table as 'dropped' and discard their operations. 3) Insert buffer: we remove all entries for the tablespace in the insert buffer tree; as long as the tablespace mem object does not exist, ongoing insert buffer page merges are discarded in buf0rea.c. If we recreate the tablespace mem object with IMPORT TABLESPACE later, then the tablespace will have the same id, but the tablespace_version field in the mem object is different, and ongoing old insert buffer page merges get discarded. 4) Linear readahead and random readahead: we use the same method as in 3) to discard ongoing operations. 5) FOREIGN KEY operations: if table->n_foreign_key_checks_running > 0, we do not allow the discard. We also reserve the data dictionary latch. */ ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); trx->op_info = "discarding tablespace"; trx_start_if_not_started(trx); /* Serialize data dictionary operations with dictionary mutex: no deadlocks can occur then in these operations */ row_mysql_lock_data_dictionary(trx); table = dict_table_get_low(name); if (!table) { err = DB_TABLE_NOT_FOUND; goto funct_exit; } if (table->space == 0) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs("\n" "InnoDB: is in the system tablespace 0" " which cannot be discarded\n", stderr); err = DB_ERROR; goto funct_exit; } if (table->n_foreign_key_checks_running > 0) { ut_print_timestamp(stderr); fputs(" InnoDB: You are trying to DISCARD table ", stderr); ut_print_name(stderr, trx, TRUE, table->name); fputs("\n" "InnoDB: though there is a foreign key check" " running on it.\n" "InnoDB: Cannot discard the table.\n", stderr); err = DB_ERROR; goto funct_exit; } /* Check if the table is referenced by foreign key constraints from some other table (not the table itself) */ foreign = UT_LIST_GET_FIRST(table->referenced_list); while (foreign && foreign->foreign_table == table) { foreign = UT_LIST_GET_NEXT(referenced_list, foreign); } if (foreign && trx->check_foreigns) { FILE* ef = dict_foreign_err_file; /* We only allow discarding a referenced table if FOREIGN_KEY_CHECKS is set to 0 */ err = DB_CANNOT_DROP_CONSTRAINT; mutex_enter(&dict_foreign_err_mutex); rewind(ef); ut_print_timestamp(ef); fputs(" Cannot DISCARD table ", ef); ut_print_name(ef, trx, TRUE, name); fputs("\n" "because it is referenced by ", ef); ut_print_name(ef, trx, TRUE, foreign->foreign_table_name); putc('\n', ef); mutex_exit(&dict_foreign_err_mutex); goto funct_exit; } new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID); /* Remove all locks except the table-level S and X locks. */ lock_remove_all_on_table(table, FALSE); info = pars_info_create(); pars_info_add_str_literal(info, "table_name", name); pars_info_add_dulint_literal(info, "new_id", new_id); err = que_eval_sql(info, "PROCEDURE DISCARD_TABLESPACE_PROC () IS\n" "old_id CHAR;\n" "BEGIN\n" "SELECT ID INTO old_id\n" "FROM SYS_TABLES\n" "WHERE NAME = :table_name\n" "LOCK IN SHARE MODE;\n" "IF (SQL % NOTFOUND) THEN\n" " COMMIT WORK;\n" " RETURN;\n" "END IF;\n" "UPDATE SYS_TABLES SET ID = :new_id\n" " WHERE ID = old_id;\n" "UPDATE SYS_COLUMNS SET TABLE_ID = :new_id\n" " WHERE TABLE_ID = old_id;\n" "UPDATE SYS_INDEXES SET TABLE_ID = :new_id\n" " WHERE TABLE_ID = old_id;\n" "COMMIT WORK;\n" "END;\n" , FALSE, trx); if (err != DB_SUCCESS) { trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); trx->error_state = DB_SUCCESS; } else { dict_table_change_id_in_cache(table, new_id); success = fil_discard_tablespace(table->space); if (!success) { trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); trx->error_state = DB_SUCCESS; err = DB_ERROR; } else { /* Set the flag which tells that now it is legal to IMPORT a tablespace for this table */ table->tablespace_discarded = TRUE; table->ibd_file_missing = TRUE; } } funct_exit: trx_commit_for_mysql(trx); row_mysql_unlock_data_dictionary(trx); trx->op_info = ""; return((int) err); } /********************************************************************* Imports a tablespace. The space id in the .ibd file must match the space id of the table in the data dictionary. */ int row_import_tablespace_for_mysql( /*============================*/ /* out: error code or DB_SUCCESS */ const char* name, /* in: table name */ trx_t* trx) /* in: transaction handle */ { dict_table_t* table; ibool success; dulint current_lsn; ulint err = DB_SUCCESS; ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); trx_start_if_not_started(trx); trx->op_info = "importing tablespace"; current_lsn = log_get_lsn(); /* It is possible, though very improbable, that the lsn's in the tablespace to be imported have risen above the current system lsn, if a lengthy purge, ibuf merge, or rollback was performed on a backup taken with ibbackup. If that is the case, reset page lsn's in the file. We assume that mysqld was shut down after it performed these cleanup operations on the .ibd file, so that it stamped the latest lsn to the FIL_PAGE_FILE_FLUSH_LSN in the first page of the .ibd file. TODO: reset also the trx id's in clustered index records and write a new space id to each data page. That would allow us to import clean .ibd files from another MySQL installation. */ success = fil_reset_too_high_lsns(name, current_lsn); if (!success) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: cannot reset lsn's in table ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs("\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); err = DB_ERROR; row_mysql_lock_data_dictionary(trx); goto funct_exit; } /* Serialize data dictionary operations with dictionary mutex: no deadlocks can occur then in these operations */ row_mysql_lock_data_dictionary(trx); table = dict_table_get_low(name); if (!table) { ut_print_timestamp(stderr); fputs(" InnoDB: table ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs("\n" "InnoDB: does not exist in the InnoDB data dictionary\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); err = DB_TABLE_NOT_FOUND; goto funct_exit; } if (table->space == 0) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs("\n" "InnoDB: is in the system tablespace 0" " which cannot be imported\n", stderr); err = DB_ERROR; goto funct_exit; } if (!table->tablespace_discarded) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: you are trying to" " IMPORT a tablespace\n" "InnoDB: ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs(", though you have not called DISCARD on it yet\n" "InnoDB: during the lifetime of the mysqld process!\n", stderr); err = DB_ERROR; goto funct_exit; } /* Play safe and remove all insert buffer entries, though we should have removed them already when DISCARD TABLESPACE was called */ ibuf_delete_for_discarded_space(table->space); success = fil_open_single_table_tablespace(TRUE, table->space, table->name); if (success) { table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; } else { if (table->ibd_file_missing) { ut_print_timestamp(stderr); fputs(" InnoDB: cannot find or open in the" " database directory the .ibd file of\n" "InnoDB: table ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs("\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); } err = DB_ERROR; } funct_exit: trx_commit_for_mysql(trx); row_mysql_unlock_data_dictionary(trx); trx->op_info = ""; return((int) err); } /************************************************************************* Truncates a table for MySQL. */ int row_truncate_table_for_mysql( /*=========================*/ /* out: error code or DB_SUCCESS */ dict_table_t* table, /* in: table handle */ trx_t* trx) /* in: transaction handle */ { dict_foreign_t* foreign; ulint err; mem_heap_t* heap; byte* buf; dtuple_t* tuple; dfield_t* dfield; dict_index_t* sys_index; btr_pcur_t pcur; mtr_t mtr; dulint new_id; pars_info_t* info = NULL; /* How do we prevent crashes caused by ongoing operations on the table? Old operations could try to access non-existent pages. 1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock on the table before we can do TRUNCATE TABLE. Then there are no running queries on the table. This is guaranteed, because in ha_innobase::store_lock(), we do not weaken the TL_WRITE lock requested by MySQL when executing SQLCOM_TRUNCATE. 2) Purge and rollback: we assign a new table id for the table. Since purge and rollback look for the table based on the table id, they see the table as 'dropped' and discard their operations. 3) Insert buffer: TRUNCATE TABLE is analogous to DROP TABLE, so we do not have to remove insert buffer records, as the insert buffer works at a low level. If a freed page is later reallocated, the allocator will remove the ibuf entries for it. TODO: when we truncate *.ibd files (analogous to DISCARD TABLESPACE), we will have to remove we remove all entries for the table in the insert buffer tree! 4) Linear readahead and random readahead: we use the same method as in 3) to discard ongoing operations. (This will only be relevant for TRUNCATE TABLE by DISCARD TABLESPACE.) 5) FOREIGN KEY operations: if table->n_foreign_key_checks_running > 0, we do not allow the TRUNCATE. We also reserve the data dictionary latch. */ ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_ad(table); if (srv_created_new_raw) { fputs("InnoDB: A new raw disk partition was initialized:\n" "InnoDB: we do not allow database modifications" " by the user.\n" "InnoDB: Shut down mysqld and edit my.cnf so that newraw" " is replaced with raw.\n", stderr); return(DB_ERROR); } trx->op_info = "truncating table"; trx_start_if_not_started(trx); /* Serialize data dictionary operations with dictionary mutex: no deadlocks can occur then in these operations */ ut_a(trx->dict_operation_lock_mode == 0); /* Prevent foreign key checks etc. while we are truncating the table */ row_mysql_lock_data_dictionary(trx); ut_ad(mutex_own(&(dict_sys->mutex))); #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); #endif /* UNIV_SYNC_DEBUG */ /* Check if the table is referenced by foreign key constraints from some other table (not the table itself) */ foreign = UT_LIST_GET_FIRST(table->referenced_list); while (foreign && foreign->foreign_table == table) { foreign = UT_LIST_GET_NEXT(referenced_list, foreign); } if (foreign && trx->check_foreigns) { FILE* ef = dict_foreign_err_file; /* We only allow truncating a referenced table if FOREIGN_KEY_CHECKS is set to 0 */ mutex_enter(&dict_foreign_err_mutex); rewind(ef); ut_print_timestamp(ef); fputs(" Cannot truncate table ", ef); ut_print_name(ef, trx, TRUE, table->name); fputs(" by DROP+CREATE\n" "InnoDB: because it is referenced by ", ef); ut_print_name(ef, trx, TRUE, foreign->foreign_table_name); putc('\n', ef); mutex_exit(&dict_foreign_err_mutex); err = DB_ERROR; goto funct_exit; } /* TODO: could we replace the counter n_foreign_key_checks_running with lock checks on the table? Acquire here an exclusive lock on the table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that they can cope with the table having been truncated here? Foreign key checks take an IS or IX lock on the table. */ if (table->n_foreign_key_checks_running > 0) { ut_print_timestamp(stderr); fputs(" InnoDB: Cannot truncate table ", stderr); ut_print_name(stderr, trx, TRUE, table->name); fputs(" by DROP+CREATE\n" "InnoDB: because there is a foreign key check" " running on it.\n", stderr); err = DB_ERROR; goto funct_exit; } /* Remove all locks except the table-level S and X locks. */ lock_remove_all_on_table(table, FALSE); trx->table_id = table->id; /* Lock all index trees for this table, as we will truncate the table/index and possibly change their metadata. All DML/DDL are blocked by table level lock, with a few exceptions such as queries into information schema about the table, MySQL could try to access index stats for this kind of query, we need to use index locks to sync up */ dict_table_x_lock_indexes(table); /* scan SYS_INDEXES for all indexes of the table */ heap = mem_heap_create(800); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); buf = mem_heap_alloc(heap, 8); mach_write_to_8(buf, table->id); dfield_set_data(dfield, buf, 8); sys_index = dict_table_get_first_index(dict_sys->sys_indexes); dict_index_copy_types(tuple, sys_index, 1); mtr_start(&mtr); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_MODIFY_LEAF, &pcur, &mtr); for (;;) { rec_t* rec; const byte* field; ulint len; ulint root_page_no; if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) { /* The end of SYS_INDEXES has been reached. */ break; } rec = btr_pcur_get_rec(&pcur); field = rec_get_nth_field_old(rec, 0, &len); ut_ad(len == 8); if (memcmp(buf, field, len) != 0) { /* End of indexes for the table (TABLE_ID mismatch). */ break; } if (rec_get_deleted_flag(rec, FALSE)) { /* The index has been dropped. */ goto next_rec; } /* This call may commit and restart mtr and reposition pcur. */ root_page_no = dict_truncate_index_tree(table, &pcur, &mtr); rec = btr_pcur_get_rec(&pcur); if (root_page_no != FIL_NULL) { page_rec_write_index_page_no( rec, DICT_SYS_INDEXES_PAGE_NO_FIELD, root_page_no, &mtr); /* We will need to commit and restart the mini-transaction in order to avoid deadlocks. The dict_truncate_index_tree() call has allocated a page in this mini-transaction, and the rest of this loop could latch another index page. */ mtr_commit(&mtr); mtr_start(&mtr); btr_pcur_restore_position(BTR_MODIFY_LEAF, &pcur, &mtr); } next_rec: btr_pcur_move_to_next_user_rec(&pcur, &mtr); } btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); /* Done with index truncation, release index tree locks, subsequent work relates to table level metadata change */ dict_table_x_unlock_indexes(table); new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID); info = pars_info_create(); pars_info_add_dulint_literal(info, "old_id", table->id); pars_info_add_dulint_literal(info, "new_id", new_id); err = que_eval_sql(info, "PROCEDURE RENUMBER_TABLESPACE_PROC () IS\n" "BEGIN\n" "UPDATE SYS_TABLES SET ID = :new_id\n" " WHERE ID = :old_id;\n" "UPDATE SYS_COLUMNS SET TABLE_ID = :new_id\n" " WHERE TABLE_ID = :old_id;\n" "UPDATE SYS_INDEXES SET TABLE_ID = :new_id\n" " WHERE TABLE_ID = :old_id;\n" "COMMIT WORK;\n" "END;\n" , FALSE, trx); if (err != DB_SUCCESS) { trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); trx->error_state = DB_SUCCESS; ut_print_timestamp(stderr); fputs(" InnoDB: Unable to assign a new identifier to table ", stderr); ut_print_name(stderr, trx, TRUE, table->name); fputs("\n" "InnoDB: after truncating it. Background processes" " may corrupt the table!\n", stderr); err = DB_ERROR; } else { dict_table_change_id_in_cache(table, new_id); } /* MySQL calls ha_innobase::reset_auto_increment() which does the same thing. */ dict_table_autoinc_lock(table); dict_table_autoinc_initialize(table, 1); dict_table_autoinc_unlock(table); dict_update_statistics(table); trx_commit_for_mysql(trx); funct_exit: row_mysql_unlock_data_dictionary(trx); trx->op_info = ""; srv_wake_master_thread(); return((int) err); } #endif /* !UNIV_HOTBACKUP */ /************************************************************************* Drops a table for MySQL. If the name of the dropped table ends in one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor", "innodb_table_monitor", then this will also stop the printing of monitor output by the master thread. */ int row_drop_table_for_mysql( /*=====================*/ /* out: error code or DB_SUCCESS */ const char* name, /* in: table name */ trx_t* trx, /* in: transaction handle */ ibool drop_db)/* in: TRUE=dropping whole database */ { dict_foreign_t* foreign; dict_table_t* table; ulint space_id; ulint err; const char* table_name; ulint namelen; ibool locked_dictionary = FALSE; pars_info_t* info = NULL; ut_a(name != NULL); if (srv_created_new_raw) { fputs("InnoDB: A new raw disk partition was initialized:\n" "InnoDB: we do not allow database modifications" " by the user.\n" "InnoDB: Shut down mysqld and edit my.cnf so that newraw" " is replaced with raw.\n", stderr); return(DB_ERROR); } trx->op_info = "dropping table"; trx_start_if_not_started(trx); /* The table name is prefixed with the database name and a '/'. Certain table names starting with 'innodb_' have their special meaning regardless of the database name. Thus, we need to ignore the database name prefix in the comparisons. */ table_name = strchr(name, '/'); ut_a(table_name); table_name++; namelen = strlen(table_name) + 1; if (namelen == sizeof S_innodb_monitor && !memcmp(table_name, S_innodb_monitor, sizeof S_innodb_monitor)) { /* Table name equals "innodb_monitor": stop monitor prints */ srv_print_innodb_monitor = FALSE; srv_print_innodb_lock_monitor = FALSE; } else if (namelen == sizeof S_innodb_lock_monitor && !memcmp(table_name, S_innodb_lock_monitor, sizeof S_innodb_lock_monitor)) { srv_print_innodb_monitor = FALSE; srv_print_innodb_lock_monitor = FALSE; } else if (namelen == sizeof S_innodb_tablespace_monitor && !memcmp(table_name, S_innodb_tablespace_monitor, sizeof S_innodb_tablespace_monitor)) { srv_print_innodb_tablespace_monitor = FALSE; } else if (namelen == sizeof S_innodb_table_monitor && !memcmp(table_name, S_innodb_table_monitor, sizeof S_innodb_table_monitor)) { srv_print_innodb_table_monitor = FALSE; } /* Serialize data dictionary operations with dictionary mutex: no deadlocks can occur then in these operations */ if (trx->dict_operation_lock_mode != RW_X_LATCH) { /* Prevent foreign key checks etc. while we are dropping the table */ row_mysql_lock_data_dictionary(trx); locked_dictionary = TRUE; } ut_ad(mutex_own(&(dict_sys->mutex))); #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); #endif /* UNIV_SYNC_DEBUG */ table = dict_table_get_low(name); if (!table) { err = DB_TABLE_NOT_FOUND; ut_print_timestamp(stderr); fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs(" does not exist in the InnoDB internal\n" "InnoDB: data dictionary though MySQL is" " trying to drop it.\n" "InnoDB: Have you copied the .frm file" " of the table to the\n" "InnoDB: MySQL database directory" " from another database?\n" "InnoDB: You can look for further help from\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "innodb-troubleshooting.html\n", stderr); goto funct_exit; } /* Check if the table is referenced by foreign key constraints from some other table (not the table itself) */ foreign = UT_LIST_GET_FIRST(table->referenced_list); while (foreign && foreign->foreign_table == table) { check_next_foreign: foreign = UT_LIST_GET_NEXT(referenced_list, foreign); } if (foreign && trx->check_foreigns && !(drop_db && dict_tables_have_same_db( name, foreign->foreign_table_name))) { FILE* ef = dict_foreign_err_file; /* We only allow dropping a referenced table if FOREIGN_KEY_CHECKS is set to 0 */ err = DB_CANNOT_DROP_CONSTRAINT; mutex_enter(&dict_foreign_err_mutex); rewind(ef); ut_print_timestamp(ef); fputs(" Cannot drop table ", ef); ut_print_name(ef, trx, TRUE, name); fputs("\n" "because it is referenced by ", ef); ut_print_name(ef, trx, TRUE, foreign->foreign_table_name); putc('\n', ef); mutex_exit(&dict_foreign_err_mutex); goto funct_exit; } if (foreign && trx->check_foreigns) { goto check_next_foreign; } if (table->n_mysql_handles_opened > 0) { ibool added; added = row_add_table_to_background_drop_list(table); if (added) { ut_print_timestamp(stderr); fputs(" InnoDB: Warning: MySQL is" " trying to drop table ", stderr); ut_print_name(stderr, trx, TRUE, table->name); fputs("\n" "InnoDB: though there are still" " open handles to it.\n" "InnoDB: Adding the table to the" " background drop queue.\n", stderr); /* We return DB_SUCCESS to MySQL though the drop will happen lazily later */ err = DB_SUCCESS; } else { /* The table is already in the background drop list */ err = DB_ERROR; } goto funct_exit; } /* TODO: could we replace the counter n_foreign_key_checks_running with lock checks on the table? Acquire here an exclusive lock on the table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that they can cope with the table having been dropped here? Foreign key checks take an IS or IX lock on the table. */ if (table->n_foreign_key_checks_running > 0) { ibool added; added = row_add_table_to_background_drop_list(table); if (added) { ut_print_timestamp(stderr); fputs(" InnoDB: You are trying to drop table ", stderr); ut_print_name(stderr, trx, TRUE, table->name); fputs("\n" "InnoDB: though there is a" " foreign key check running on it.\n" "InnoDB: Adding the table to" " the background drop queue.\n", stderr); /* We return DB_SUCCESS to MySQL though the drop will happen lazily later */ err = DB_SUCCESS; } else { /* The table is already in the background drop list */ err = DB_ERROR; } goto funct_exit; } /* Remove all locks there are on the table or its records */ lock_remove_all_on_table(table, TRUE); trx->dict_operation = TRUE; trx->table_id = table->id; /* We use the private SQL parser of Innobase to generate the query graphs needed in deleting the dictionary data from system tables in Innobase. Deleting a row from SYS_INDEXES table also frees the file segments of the B-tree associated with the index. */ info = pars_info_create(); pars_info_add_str_literal(info, "table_name", name); err = que_eval_sql(info, "PROCEDURE DROP_TABLE_PROC () IS\n" "sys_foreign_id CHAR;\n" "table_id CHAR;\n" "index_id CHAR;\n" "foreign_id CHAR;\n" "found INT;\n" "BEGIN\n" "SELECT ID INTO table_id\n" "FROM SYS_TABLES\n" "WHERE NAME = :table_name\n" "LOCK IN SHARE MODE;\n" "IF (SQL % NOTFOUND) THEN\n" " COMMIT WORK;\n" " RETURN;\n" "END IF;\n" "found := 1;\n" "SELECT ID INTO sys_foreign_id\n" "FROM SYS_TABLES\n" "WHERE NAME = 'SYS_FOREIGN'\n" "LOCK IN SHARE MODE;\n" "IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" "END IF;\n" "IF (:table_name = 'SYS_FOREIGN') THEN\n" " found := 0;\n" "END IF;\n" "IF (:table_name = 'SYS_FOREIGN_COLS') THEN\n" " found := 0;\n" "END IF;\n" "WHILE found = 1 LOOP\n" " SELECT ID INTO foreign_id\n" " FROM SYS_FOREIGN\n" " WHERE FOR_NAME = :table_name\n" " AND TO_BINARY(FOR_NAME)\n" " = TO_BINARY(:table_name)\n" " LOCK IN SHARE MODE;\n" " IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" " ELSE\n" " DELETE FROM SYS_FOREIGN_COLS\n" " WHERE ID = foreign_id;\n" " DELETE FROM SYS_FOREIGN\n" " WHERE ID = foreign_id;\n" " END IF;\n" "END LOOP;\n" "found := 1;\n" "WHILE found = 1 LOOP\n" " SELECT ID INTO index_id\n" " FROM SYS_INDEXES\n" " WHERE TABLE_ID = table_id\n" " LOCK IN SHARE MODE;\n" " IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" " ELSE\n" " DELETE FROM SYS_FIELDS\n" " WHERE INDEX_ID = index_id;\n" " DELETE FROM SYS_INDEXES\n" " WHERE ID = index_id\n" " AND TABLE_ID = table_id;\n" " END IF;\n" "END LOOP;\n" "DELETE FROM SYS_COLUMNS\n" "WHERE TABLE_ID = table_id;\n" "DELETE FROM SYS_TABLES\n" "WHERE ID = table_id;\n" "COMMIT WORK;\n" "END;\n" , FALSE, trx); switch (err) { ibool is_path; const char* name_or_path; mem_heap_t* heap; case DB_SUCCESS: heap = mem_heap_create(200); /* Clone the name, in case it has been allocated from table->heap, which will be freed by dict_table_remove_from_cache(table) below. */ name = mem_heap_strdup(heap, name); space_id = table->space; if (table->dir_path_of_temp_table != NULL) { is_path = TRUE; name_or_path = mem_heap_strdup( heap, table->dir_path_of_temp_table); } else { is_path = FALSE; name_or_path = name; } dict_table_remove_from_cache(table); if (dict_load_table(name) != NULL) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: not able to remove table ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs(" from the dictionary cache!\n", stderr); err = DB_ERROR; } /* Do not drop possible .ibd tablespace if something went wrong: we do not want to delete valuable data of the user */ if (err == DB_SUCCESS && space_id > 0) { if (!fil_space_for_table_exists_in_mem(space_id, name_or_path, is_path, FALSE, TRUE)) { err = DB_SUCCESS; fprintf(stderr, "InnoDB: We removed now the InnoDB" " internal data dictionary entry\n" "InnoDB: of table "); ut_print_name(stderr, trx, TRUE, name); fprintf(stderr, ".\n"); } else if (!fil_delete_tablespace(space_id)) { fprintf(stderr, "InnoDB: We removed now the InnoDB" " internal data dictionary entry\n" "InnoDB: of table "); ut_print_name(stderr, trx, TRUE, name); fprintf(stderr, ".\n"); ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error: not able to" " delete tablespace %lu of table ", (ulong) space_id); ut_print_name(stderr, trx, TRUE, name); fputs("!\n", stderr); err = DB_ERROR; } } mem_heap_free(heap); break; case DB_TOO_MANY_CONCURRENT_TRXS: /* Cannot even find a free slot for the the undo log. We can directly exit here and return the DB_TOO_MANY_CONCURRENT_TRXS error. */ break; case DB_OUT_OF_FILE_SPACE: err = DB_MUST_GET_MORE_FILE_SPACE; row_mysql_handle_errors(&err, trx, NULL, NULL); /* Fall through to raise error */ default: /* No other possible error returns */ ut_error; } funct_exit: trx_commit_for_mysql(trx); if (locked_dictionary) { row_mysql_unlock_data_dictionary(trx); } trx->op_info = ""; #ifndef UNIV_HOTBACKUP srv_wake_master_thread(); #endif /* !UNIV_HOTBACKUP */ return((int) err); } /*********************************************************************** Drop all foreign keys in a database, see Bug#18942. Called at the end of row_drop_database_for_mysql(). */ static ulint drop_all_foreign_keys_in_db( /*========================*/ /* out: error code or DB_SUCCESS */ const char* name, /* in: database name which ends to '/' */ trx_t* trx) /* in: transaction handle */ { pars_info_t* pinfo; ulint err; ut_a(name[strlen(name) - 1] == '/'); pinfo = pars_info_create(); pars_info_add_str_literal(pinfo, "dbname", name); /* true if for_name is not prefixed with dbname */ #define TABLE_NOT_IN_THIS_DB \ "SUBSTR(for_name, 0, LENGTH(:dbname)) <> :dbname" err = que_eval_sql(pinfo, "PROCEDURE DROP_ALL_FOREIGN_KEYS_PROC () IS\n" "foreign_id CHAR;\n" "for_name CHAR;\n" "found INT;\n" "DECLARE CURSOR cur IS\n" "SELECT ID, FOR_NAME FROM SYS_FOREIGN\n" "WHERE FOR_NAME >= :dbname\n" "LOCK IN SHARE MODE\n" "ORDER BY FOR_NAME;\n" "BEGIN\n" "found := 1;\n" "OPEN cur;\n" "WHILE found = 1 LOOP\n" " FETCH cur INTO foreign_id, for_name;\n" " IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" " ELSIF (" TABLE_NOT_IN_THIS_DB ") THEN\n" " found := 0;\n" " ELSIF (1=1) THEN\n" " DELETE FROM SYS_FOREIGN_COLS\n" " WHERE ID = foreign_id;\n" " DELETE FROM SYS_FOREIGN\n" " WHERE ID = foreign_id;\n" " END IF;\n" "END LOOP;\n" "CLOSE cur;\n" "COMMIT WORK;\n" "END;\n", FALSE, /* do not reserve dict mutex, we are already holding it */ trx); return(err); } /************************************************************************* Drops a database for MySQL. */ int row_drop_database_for_mysql( /*========================*/ /* out: error code or DB_SUCCESS */ const char* name, /* in: database name which ends to '/' */ trx_t* trx) /* in: transaction handle */ { dict_table_t* table; char* table_name; int err = DB_SUCCESS; ulint namelen = strlen(name); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_a(name != NULL); ut_a(name[namelen - 1] == '/'); trx->op_info = "dropping database"; trx_start_if_not_started(trx); loop: row_mysql_lock_data_dictionary(trx); while ((table_name = dict_get_first_table_name_in_db(name))) { ut_a(memcmp(table_name, name, namelen) == 0); table = dict_table_get_low(table_name); ut_a(table); /* Wait until MySQL does not have any queries running on the table */ if (table->n_mysql_handles_opened > 0) { row_mysql_unlock_data_dictionary(trx); ut_print_timestamp(stderr); fputs(" InnoDB: Warning: MySQL is trying to" " drop database ", stderr); ut_print_name(stderr, trx, TRUE, name); fputs("\n" "InnoDB: though there are still" " open handles to table ", stderr); ut_print_name(stderr, trx, TRUE, table_name); fputs(".\n", stderr); os_thread_sleep(1000000); mem_free(table_name); goto loop; } err = row_drop_table_for_mysql(table_name, trx, TRUE); if (err != DB_SUCCESS) { fputs("InnoDB: DROP DATABASE ", stderr); ut_print_name(stderr, trx, TRUE, name); fprintf(stderr, " failed with error %lu for table ", (ulint) err); ut_print_name(stderr, trx, TRUE, table_name); putc('\n', stderr); mem_free(table_name); break; } mem_free(table_name); } if (err == DB_SUCCESS) { /* after dropping all tables try to drop all leftover foreign keys in case orphaned ones exist */ err = (int) drop_all_foreign_keys_in_db(name, trx); if (err != DB_SUCCESS) { fputs("InnoDB: DROP DATABASE ", stderr); ut_print_name(stderr, trx, TRUE, name); fprintf(stderr, " failed with error %d while " "dropping all foreign keys", err); } } trx_commit_for_mysql(trx); row_mysql_unlock_data_dictionary(trx); trx->op_info = ""; return(err); } /************************************************************************* Checks if a table name contains the string "/#sql" which denotes temporary tables in MySQL. */ static ibool row_is_mysql_tmp_table_name( /*========================*/ /* out: TRUE if temporary table */ const char* name) /* in: table name in the form 'database/tablename' */ { return(strstr(name, "/#sql") != NULL); /* return(strstr(name, "/@0023sql") != NULL); */ } /******************************************************************** Delete a single constraint. */ static int row_delete_constraint_low( /*======================*/ /* out: error code or DB_SUCCESS */ const char* id, /* in: constraint id */ trx_t* trx) /* in: transaction handle */ { pars_info_t* info = pars_info_create(); pars_info_add_str_literal(info, "id", id); return((int) que_eval_sql(info, "PROCEDURE DELETE_CONSTRAINT () IS\n" "BEGIN\n" "DELETE FROM SYS_FOREIGN_COLS WHERE ID = :id;\n" "DELETE FROM SYS_FOREIGN WHERE ID = :id;\n" "END;\n" , FALSE, trx)); } /******************************************************************** Delete a single constraint. */ static int row_delete_constraint( /*==================*/ /* out: error code or DB_SUCCESS */ const char* id, /* in: constraint id */ const char* database_name, /* in: database name, with the trailing '/' */ mem_heap_t* heap, /* in: memory heap */ trx_t* trx) /* in: transaction handle */ { ulint err; /* New format constraints have ids <databasename>/<constraintname>. */ err = row_delete_constraint_low( mem_heap_strcat(heap, database_name, id), trx); if ((err == DB_SUCCESS) && !strchr(id, '/')) { /* Old format < 4.0.18 constraints have constraint ids <number>_<number>. We only try deleting them if the constraint name does not contain a '/' character, otherwise deleting a new format constraint named 'foo/bar' from database 'baz' would remove constraint 'bar' from database 'foo', if it existed. */ err = row_delete_constraint_low(id, trx); } return((int) err); } /************************************************************************* Renames a table for MySQL. */ int row_rename_table_for_mysql( /*=======================*/ /* out: error code or DB_SUCCESS */ const char* old_name, /* in: old table name */ const char* new_name, /* in: new table name */ trx_t* trx) /* in: transaction handle */ { dict_table_t* table; ulint err; mem_heap_t* heap = NULL; const char** constraints_to_drop = NULL; ulint n_constraints_to_drop = 0; ibool old_is_tmp, new_is_tmp; pars_info_t* info = NULL; ulint retry = 0; DBUG_ENTER("row_rename_table_for_mysql"); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_a(old_name != NULL); ut_a(new_name != NULL); if (srv_created_new_raw || srv_force_recovery) { fputs("InnoDB: A new raw disk partition was initialized or\n" "InnoDB: innodb_force_recovery is on: we do not allow\n" "InnoDB: database modifications by the user. Shut down\n" "InnoDB: mysqld and edit my.cnf so that newraw" " is replaced\n" "InnoDB: with raw, and innodb_force_... is removed.\n", stderr); trx_commit_for_mysql(trx); DBUG_RETURN(DB_ERROR); } if (row_mysql_is_system_table(new_name)) { fprintf(stderr, "InnoDB: Error: trying to create a MySQL" " system table %s of type InnoDB.\n" "InnoDB: MySQL system tables must be" " of the MyISAM type!\n", new_name); trx_commit_for_mysql(trx); DBUG_RETURN(DB_ERROR); } trx->op_info = "renaming table"; trx_start_if_not_started(trx); old_is_tmp = row_is_mysql_tmp_table_name(old_name); new_is_tmp = row_is_mysql_tmp_table_name(new_name); /* Serialize data dictionary operations with dictionary mutex: no deadlocks can occur then in these operations */ row_mysql_lock_data_dictionary(trx); table = dict_table_get_low(old_name); if (!table) { err = DB_TABLE_NOT_FOUND; ut_print_timestamp(stderr); fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, TRUE, old_name); fputs(" does not exist in the InnoDB internal\n" "InnoDB: data dictionary though MySQL is" " trying to rename the table.\n" "InnoDB: Have you copied the .frm file" " of the table to the\n" "InnoDB: MySQL database directory" " from another database?\n" "InnoDB: You can look for further help from\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "innodb-troubleshooting.html\n", stderr); goto funct_exit; } if (table->ibd_file_missing) { err = DB_TABLE_NOT_FOUND; ut_print_timestamp(stderr); fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, TRUE, old_name); fputs(" does not have an .ibd file" " in the database directory.\n" "InnoDB: You can look for further help from\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "innodb-troubleshooting.html\n", stderr); goto funct_exit; } if (new_is_tmp) { /* MySQL is doing an ALTER TABLE command and it renames the original table to a temporary table name. We want to preserve the original foreign key constraint definitions despite the name change. An exception is those constraints for which the ALTER TABLE contained DROP FOREIGN KEY <foreign key id>.*/ heap = mem_heap_create(100); err = dict_foreign_parse_drop_constraints( heap, trx, table, &n_constraints_to_drop, &constraints_to_drop); if (err != DB_SUCCESS) { goto funct_exit; } } /* Is a foreign key check running on this table? */ for (retry = 0; retry < 100 && table->n_foreign_key_checks_running > 0; ++retry) { row_mysql_unlock_data_dictionary(trx); os_thread_yield(); row_mysql_lock_data_dictionary(trx); } if (table->n_foreign_key_checks_running > 0) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: in ALTER TABLE ", stderr); ut_print_name(stderr, trx, TRUE, old_name); fprintf(stderr, "\n" "InnoDB: a FOREIGN KEY check is running.\n" "InnoDB: Cannot rename table.\n"); err = DB_TABLE_IN_FK_CHECK; goto funct_exit; } /* We use the private SQL parser of Innobase to generate the query graphs needed in deleting the dictionary data from system tables in Innobase. Deleting a row from SYS_INDEXES table also frees the file segments of the B-tree associated with the index. */ info = pars_info_create(); pars_info_add_str_literal(info, "new_table_name", new_name); pars_info_add_str_literal(info, "old_table_name", old_name); err = que_eval_sql(info, "PROCEDURE RENAME_TABLE () IS\n" "BEGIN\n" "UPDATE SYS_TABLES SET NAME = :new_table_name\n" " WHERE NAME = :old_table_name;\n" "END;\n" , FALSE, trx); if (err != DB_SUCCESS) { goto end; } if (!new_is_tmp) { /* Rename all constraints. */ char new_table_name[MAX_TABLE_NAME_LEN] = ""; char old_table_utf8[MAX_TABLE_NAME_LEN] = ""; uint errors = 0; strncpy(old_table_utf8, old_name, MAX_TABLE_NAME_LEN); innobase_convert_to_system_charset( strchr(old_table_utf8, '/') + 1, strchr(old_name, '/') +1, MAX_TABLE_NAME_LEN, &errors); if (errors) { /* Table name could not be converted from charset my_charset_filename to UTF-8. This means that the table name is already in UTF-8 (#mysql#50). */ strncpy(old_table_utf8, old_name, MAX_TABLE_NAME_LEN); } info = pars_info_create(); pars_info_add_str_literal(info, "new_table_name", new_name); pars_info_add_str_literal(info, "old_table_name", old_name); pars_info_add_str_literal(info, "old_table_name_utf8", old_table_utf8); strncpy(new_table_name, new_name, MAX_TABLE_NAME_LEN); innobase_convert_to_system_charset( strchr(new_table_name, '/') + 1, strchr(new_name, '/') +1, MAX_TABLE_NAME_LEN, &errors); if (errors) { /* Table name could not be converted from charset my_charset_filename to UTF-8. This means that the table name is already in UTF-8 (#mysql#50). */ strncpy(new_table_name, new_name, MAX_TABLE_NAME_LEN); } pars_info_add_str_literal(info, "new_table_utf8", new_table_name); err = que_eval_sql( info, "PROCEDURE RENAME_CONSTRAINT_IDS () IS\n" "gen_constr_prefix CHAR;\n" "new_db_name CHAR;\n" "foreign_id CHAR;\n" "new_foreign_id CHAR;\n" "old_db_name_len INT;\n" "old_t_name_len INT;\n" "new_db_name_len INT;\n" "id_len INT;\n" "offset INT;\n" "found INT;\n" "BEGIN\n" "found := 1;\n" "old_db_name_len := INSTR(:old_table_name, '/')-1;\n" "new_db_name_len := INSTR(:new_table_name, '/')-1;\n" "new_db_name := SUBSTR(:new_table_name, 0,\n" " new_db_name_len);\n" "old_t_name_len := LENGTH(:old_table_name);\n" "gen_constr_prefix := CONCAT(:old_table_name_utf8,\n" " '_ibfk_');\n" "WHILE found = 1 LOOP\n" " SELECT ID INTO foreign_id\n" " FROM SYS_FOREIGN\n" " WHERE FOR_NAME = :old_table_name\n" " AND TO_BINARY(FOR_NAME)\n" " = TO_BINARY(:old_table_name)\n" " LOCK IN SHARE MODE;\n" " IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" " ELSE\n" " UPDATE SYS_FOREIGN\n" " SET FOR_NAME = :new_table_name\n" " WHERE ID = foreign_id;\n" " id_len := LENGTH(foreign_id);\n" " IF (INSTR(foreign_id, '/') > 0) THEN\n" " IF (INSTR(foreign_id,\n" " gen_constr_prefix) > 0)\n" " THEN\n" " offset := INSTR(foreign_id, '_ibfk_') - 1;\n" " new_foreign_id :=\n" " CONCAT(:new_table_utf8,\n" " SUBSTR(foreign_id, offset, id_len - offset));\n" " ELSE\n" " new_foreign_id :=\n" " CONCAT(new_db_name,\n" " SUBSTR(foreign_id,\n" " old_db_name_len,\n" " id_len - old_db_name_len));\n" " END IF;\n" " UPDATE SYS_FOREIGN\n" " SET ID = new_foreign_id\n" " WHERE ID = foreign_id;\n" " UPDATE SYS_FOREIGN_COLS\n" " SET ID = new_foreign_id\n" " WHERE ID = foreign_id;\n" " END IF;\n" " END IF;\n" "END LOOP;\n" "UPDATE SYS_FOREIGN SET REF_NAME = :new_table_name\n" "WHERE REF_NAME = :old_table_name\n" " AND TO_BINARY(REF_NAME)\n" " = TO_BINARY(:old_table_name);\n" "END;\n" , FALSE, trx); } else if (n_constraints_to_drop > 0) { /* Drop some constraints of tmp tables. */ ulint db_name_len = dict_get_db_name_len(old_name) + 1; char* db_name = mem_heap_strdupl(heap, old_name, db_name_len); ulint i; for (i = 0; i < n_constraints_to_drop; i++) { err = row_delete_constraint(constraints_to_drop[i], db_name, heap, trx); if (err != DB_SUCCESS) { break; } } } end: if (err != DB_SUCCESS) { if (err == DB_DUPLICATE_KEY) { ut_print_timestamp(stderr); fputs(" InnoDB: Error; possible reasons:\n" "InnoDB: 1) Table rename would cause" " two FOREIGN KEY constraints\n" "InnoDB: to have the same internal name" " in case-insensitive comparison.\n" "InnoDB: 2) table ", stderr); ut_print_name(stderr, trx, TRUE, new_name); fputs(" exists in the InnoDB internal data\n" "InnoDB: dictionary though MySQL is" " trying to rename table ", stderr); ut_print_name(stderr, trx, TRUE, old_name); fputs(" to it.\n" "InnoDB: Have you deleted the .frm file" " and not used DROP TABLE?\n" "InnoDB: You can look for further help from\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "innodb-troubleshooting.html\n" "InnoDB: If table ", stderr); ut_print_name(stderr, trx, TRUE, new_name); fputs(" is a temporary table #sql..., then" " it can be that\n" "InnoDB: there are still queries running" " on the table, and it will be\n" "InnoDB: dropped automatically when" " the queries end.\n" "InnoDB: You can drop the orphaned table" " inside InnoDB by\n" "InnoDB: creating an InnoDB table with" " the same name in another\n" "InnoDB: database and copying the .frm file" " to the current database.\n" "InnoDB: Then MySQL thinks the table exists," " and DROP TABLE will\n" "InnoDB: succeed.\n", stderr); } trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); trx->error_state = DB_SUCCESS; } else { /* The following call will also rename the .ibd data file if the table is stored in a single-table tablespace */ ibool success = dict_table_rename_in_cache(table, new_name, !new_is_tmp); if (!success) { trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); trx->error_state = DB_SUCCESS; ut_print_timestamp(stderr); fputs(" InnoDB: Error in table rename," " cannot rename ", stderr); ut_print_name(stderr, trx, TRUE, old_name); fputs(" to ", stderr); ut_print_name(stderr, trx, TRUE, new_name); putc('\n', stderr); err = DB_ERROR; goto funct_exit; } /* We only want to switch off some of the type checking in an ALTER, not in a RENAME. */ err = dict_load_foreigns( new_name, FALSE, old_is_tmp ? trx->check_foreigns : TRUE); if (err != DB_SUCCESS) { ut_print_timestamp(stderr); if (old_is_tmp) { fputs(" InnoDB: Error: in ALTER TABLE ", stderr); ut_print_name(stderr, trx, TRUE, new_name); fputs("\n" "InnoDB: has or is referenced" " in foreign key constraints\n" "InnoDB: which are not compatible" " with the new table definition.\n", stderr); } else { fputs(" InnoDB: Error: in RENAME TABLE" " table ", stderr); ut_print_name(stderr, trx, TRUE, new_name); fputs("\n" "InnoDB: is referenced in" " foreign key constraints\n" "InnoDB: which are not compatible" " with the new table definition.\n", stderr); } ut_a(dict_table_rename_in_cache(table, old_name, FALSE)); trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, FALSE, NULL); trx->error_state = DB_SUCCESS; } } funct_exit: trx_commit_for_mysql(trx); row_mysql_unlock_data_dictionary(trx); if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } trx->op_info = ""; DBUG_RETURN((int) err); } /************************************************************************* Checks that the index contains entries in an ascending order, unique constraint is not broken, and calculates the number of index entries in the read view of the current transaction. */ static ibool row_scan_and_check_index( /*=====================*/ /* out: TRUE if ok */ row_prebuilt_t* prebuilt, /* in: prebuilt struct in MySQL */ dict_index_t* index, /* in: index */ ulint* n_rows) /* out: number of entries seen in the current consistent read */ { dtuple_t* prev_entry = NULL; ulint matched_fields; ulint matched_bytes; byte* buf; ulint ret; rec_t* rec; ibool is_ok = TRUE; int cmp; ibool contains_null; ulint i; ulint cnt; mem_heap_t* heap = NULL; ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; *n_rows = 0; buf = mem_alloc(UNIV_PAGE_SIZE); heap = mem_heap_create(100); /* Make a dummy template in prebuilt, which we will use in scanning the index entries */ prebuilt->index = index; prebuilt->sql_stat_start = TRUE; prebuilt->template_type = ROW_MYSQL_DUMMY_TEMPLATE; prebuilt->n_template = 0; prebuilt->need_to_access_clustered = FALSE; dtuple_set_n_fields(prebuilt->search_tuple, 0); prebuilt->select_lock_type = LOCK_NONE; cnt = 1000; ret = row_search_for_mysql(buf, PAGE_CUR_G, prebuilt, 0, 0); loop: /* Check thd->killed every 1,000 scanned rows */ if (--cnt == 0) { if (trx_is_interrupted(prebuilt->trx)) { goto func_exit; } cnt = 1000; } if (ret != DB_SUCCESS) { func_exit: mem_free(buf); mem_heap_free(heap); return(is_ok); } *n_rows = *n_rows + 1; /* row_search... returns the index record in buf, record origin offset within buf stored in the first 4 bytes, because we have built a dummy template */ rec = buf + mach_read_from_4(buf); if (prev_entry != NULL) { matched_fields = 0; matched_bytes = 0; offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); cmp = cmp_dtuple_rec_with_match(prev_entry, rec, offsets, &matched_fields, &matched_bytes); contains_null = FALSE; /* In a unique secondary index we allow equal key values if they contain SQL NULLs */ for (i = 0; i < dict_index_get_n_ordering_defined_by_user(index); i++) { if (UNIV_SQL_NULL == dfield_get_len( dtuple_get_nth_field(prev_entry, i))) { contains_null = TRUE; } } if (cmp > 0) { fputs("InnoDB: index records in a wrong order in ", stderr); not_ok: dict_index_name_print(stderr, prebuilt->trx, index); fputs("\n" "InnoDB: prev record ", stderr); dtuple_print(stderr, prev_entry); fputs("\n" "InnoDB: record ", stderr); rec_print_new(stderr, rec, offsets); putc('\n', stderr); is_ok = FALSE; } else if ((index->type & DICT_UNIQUE) && !contains_null && matched_fields >= dict_index_get_n_ordering_defined_by_user( index)) { fputs("InnoDB: duplicate key in ", stderr); goto not_ok; } } mem_heap_empty(heap); offsets = offsets_; prev_entry = row_rec_to_index_entry(ROW_COPY_DATA, index, rec, heap); ret = row_search_for_mysql(buf, PAGE_CUR_G, prebuilt, 0, ROW_SEL_NEXT); goto loop; } /************************************************************************* Checks a table for corruption. */ ulint row_check_table_for_mysql( /*======================*/ /* out: DB_ERROR or DB_SUCCESS */ row_prebuilt_t* prebuilt) /* in: prebuilt struct in MySQL handle */ { dict_table_t* table = prebuilt->table; dict_index_t* index; ulint n_rows; ulint n_rows_in_table = ULINT_UNDEFINED; ulint ret = DB_SUCCESS; ulint old_isolation_level; if (prebuilt->table->ibd_file_missing) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error:\n" "InnoDB: MySQL is trying to use a table handle" " but the .ibd file for\n" "InnoDB: table %s does not exist.\n" "InnoDB: Have you deleted the .ibd file" " from the database directory under\n" "InnoDB: the MySQL datadir, or have you" " used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/" "innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); } prebuilt->trx->op_info = "checking table"; old_isolation_level = prebuilt->trx->isolation_level; /* We must run the index record counts at an isolation level >= READ COMMITTED, because a dirty read can see a wrong number of records in some index; to play safe, we use always REPEATABLE READ here */ prebuilt->trx->isolation_level = TRX_ISO_REPEATABLE_READ; /* Enlarge the fatal lock wait timeout during CHECK TABLE. */ mutex_enter(&kernel_mutex); srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION; mutex_exit(&kernel_mutex); index = dict_table_get_first_index(table); while (index != NULL) { /* fputs("Validating index ", stderr); ut_print_name(stderr, trx, FALSE, index->name); putc('\n', stderr); */ if (!btr_validate_index(index, prebuilt->trx)) { ret = DB_ERROR; } else { if (!row_scan_and_check_index(prebuilt, index, &n_rows)) { ret = DB_ERROR; } if (trx_is_interrupted(prebuilt->trx)) { break; } /* fprintf(stderr, "%lu entries in index %s\n", n_rows, index->name); */ if (index == dict_table_get_first_index(table)) { n_rows_in_table = n_rows; } else if (n_rows != n_rows_in_table) { ret = DB_ERROR; fputs("Error: ", stderr); dict_index_name_print(stderr, prebuilt->trx, index); fprintf(stderr, " contains %lu entries," " should be %lu\n", (ulong) n_rows, (ulong) n_rows_in_table); } } index = dict_table_get_next_index(index); } /* Restore the original isolation level */ prebuilt->trx->isolation_level = old_isolation_level; /* We validate also the whole adaptive hash index for all tables at every CHECK TABLE */ if (!btr_search_validate()) { ret = DB_ERROR; } /* Restore the fatal lock wait timeout after CHECK TABLE. */ mutex_enter(&kernel_mutex); srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION; mutex_exit(&kernel_mutex); prebuilt->trx->op_info = ""; return(ret); } /************************************************************************* Determines if a table is a magic monitor table. */ ibool row_is_magic_monitor_table( /*=======================*/ /* out: TRUE if monitor table */ const char* table_name) /* in: name of the table, in the form database/table_name */ { const char* name; /* table_name without database/ */ ulint len; name = strchr(table_name, '/'); ut_a(name != NULL); name++; len = strlen(name) + 1; if (STR_EQ(name, len, S_innodb_monitor) || STR_EQ(name, len, S_innodb_lock_monitor) || STR_EQ(name, len, S_innodb_tablespace_monitor) || STR_EQ(name, len, S_innodb_table_monitor) || STR_EQ(name, len, S_innodb_mem_validate)) { return(TRUE); } return(FALSE); }
27.404811
79
0.653552
[ "object", "vector" ]
038244c0469ac6fc453dec00a6044b406d9b339e
950,790
c
C
.venv/lib/python3.6/site-packages/gevent/libev/corecext.c
congcongnanianing/swiper
4644a2db7a3baba0700d2303057f5abb45ef772c
[ "MIT" ]
null
null
null
.venv/lib/python3.6/site-packages/gevent/libev/corecext.c
congcongnanianing/swiper
4644a2db7a3baba0700d2303057f5abb45ef772c
[ "MIT" ]
2
2020-02-19T07:19:47.000Z
2020-02-19T14:19:13.000Z
.venv/lib/python3.6/site-packages/gevent/libev/corecext.c
congcongnanianing/swiper
4644a2db7a3baba0700d2303057f5abb45ef772c
[ "MIT" ]
null
null
null
/* Generated by Cython 0.29.2 */ /* BEGIN: Cython Metadata { "distutils": { "define_macros": [ [ "LIBEV_EMBED", "1" ], [ "EV_COMMON", "" ], [ "EV_CLEANUP_ENABLE", "0" ], [ "EV_EMBED_ENABLE", "0" ], [ "EV_PERIODIC_ENABLE", "0" ] ], "depends": [ "deps/libev/ev++.h", "deps/libev/ev.c", "deps/libev/ev.h", "deps/libev/ev_epoll.c", "deps/libev/ev_kqueue.c", "deps/libev/ev_poll.c", "deps/libev/ev_port.c", "deps/libev/ev_select.c", "deps/libev/ev_vars.h", "deps/libev/ev_win32.c", "deps/libev/ev_wrap.h", "deps/libev/event.c", "deps/libev/event.h", "src/gevent/libev/callbacks.c", "src/gevent/libev/callbacks.h", "src/gevent/libev/libev.h", "src/gevent/libev/libev_vfd.h", "src/gevent/libev/stathelper.c" ], "include_dirs": [ "src/gevent/libev", "/private/tmp/gevent/python3.6/gevent/deps/libev" ], "name": "gevent.libev.corecext", "sources": [ "src/gevent/libev/corecext.pyx", "src/gevent/libev/callbacks.c" ] }, "module_name": "gevent.libev.corecext" } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_2" #define CYTHON_HEX_VERSION 0x001D02F0 #define CYTHON_FUTURE_DIVISION 1 #include <stddef.h> #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include <stdint.h> #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_USE_DICT_VERSIONS #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; // PyThread_create_key reports success always } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif // TSS (Thread Specific Storage) API #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #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) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include <math.h> #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__gevent__libev__corecext #define __PYX_HAVE_API__gevent__libev__corecext /* Early includes */ #include "libev_vfd.h" #include "libev.h" #include <string.h> #include <stdio.h> #include <errno.h> #include "callbacks.h" #include "stathelper.c" #include "pythread.h" #ifdef _OPENMP #include <omp.h> #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include <cstdlib> #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/gevent/libev/corecext.pyx", "type.pxd", "bool.pxd", "complex.pxd", }; /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /*--- Type declarations ---*/ struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType; struct PyGeventCallbackObject; struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO; struct PyGeventLoopObject; struct PyGeventWatcherObject; struct PyGeventIOObject; struct PyGeventTimerObject; struct PyGeventSignalObject; struct PyGeventIdleObject; struct PyGeventPrepareObject; struct PyGeventCheckObject; struct PyGeventForkObject; struct PyGeventAsyncObject; struct PyGeventChildObject; struct PyGeventStatObject; struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr; struct __pyx_t_6gevent_5libev_8corecext_start_and_stop; typedef void (*__pyx_t_6gevent_5libev_8corecext_start_stop_func)(struct ev_loop *, void *); struct __pyx_t_6gevent_5libev_8corecext_start_and_stop { __pyx_t_6gevent_5libev_8corecext_start_stop_func start; __pyx_t_6gevent_5libev_8corecext_start_stop_func stop; }; struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType { PyObject_HEAD }; struct PyGeventCallbackObject { PyObject_HEAD PyObject *callback; PyObject *args; struct PyGeventCallbackObject *next; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCallback_Type; struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO { PyObject_HEAD struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtab; struct PyGeventCallbackObject *head; struct PyGeventCallbackObject *tail; }; struct PyGeventLoopObject { PyObject_HEAD struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtab; struct ev_prepare _prepare; struct ev_timer _timer0; struct ev_timer _periodic_signal_checker; PyObject *error_handler; struct ev_loop *_ptr; struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *_callbacks; int starting_timer_may_update_loop_time; int _default; double approx_timer_resolution; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type; struct PyGeventWatcherObject { PyObject_HEAD struct PyGeventLoopObject *loop; PyObject *_callback; PyObject *args; struct ev_watcher *__pyx___watcher; struct __pyx_t_6gevent_5libev_8corecext_start_and_stop *__pyx___ss; unsigned int _flags; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventWatcher_Type; struct PyGeventIOObject { struct PyGeventWatcherObject __pyx_base; struct ev_io _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIO_Type; struct PyGeventTimerObject { struct PyGeventWatcherObject __pyx_base; struct ev_timer _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventTimer_Type; struct PyGeventSignalObject { struct PyGeventWatcherObject __pyx_base; struct ev_signal _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventSignal_Type; struct PyGeventIdleObject { struct PyGeventWatcherObject __pyx_base; struct ev_idle _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIdle_Type; struct PyGeventPrepareObject { struct PyGeventWatcherObject __pyx_base; struct ev_prepare _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventPrepare_Type; struct PyGeventCheckObject { struct PyGeventWatcherObject __pyx_base; struct ev_check _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCheck_Type; struct PyGeventForkObject { struct PyGeventWatcherObject __pyx_base; struct ev_fork _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventFork_Type; struct PyGeventAsyncObject { struct PyGeventWatcherObject __pyx_base; struct ev_async _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventAsync_Type; struct PyGeventChildObject { struct PyGeventWatcherObject __pyx_base; struct ev_child _watcher; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventChild_Type; struct PyGeventStatObject { struct PyGeventWatcherObject __pyx_base; struct ev_stat _watcher; PyObject *path; PyObject *_paths; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventStat_Type; struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr { PyObject_HEAD PyObject *__pyx_v_flag; PyObject *__pyx_v_string; }; struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO { struct PyGeventCallbackObject *(*popleft)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); PyObject *(*append)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *); int (*has_callbacks)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); }; static struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO; static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *); static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type; struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop { PyObject *(*_run_callbacks)(struct PyGeventLoopObject *); PyObject *(*_stop_watchers)(struct PyGeventLoopObject *, struct ev_loop *); PyObject *(*handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); PyObject *(*_default_handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); ev_tstamp (*now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch); void (*update_now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtabptr_6gevent_5libev_8corecext_loop; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION < 3 #define __Pyx_PyBytes_Join _PyString_Join #else #define __Pyx_PyBytes_Join _PyBytes_Join #endif #else static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* IncludeStringH.proto */ #include <string.h> /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* CallableCheck.proto */ #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 #define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) #else #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif /* GetNameInClass.proto */ #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* CoroutineBase.proto */ typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_ExcInfoStruct _PyErr_StackItem #else typedef struct { PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; } __Pyx_ExcInfoStruct; #endif typedef struct { PyObject_HEAD __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; int resume_label; char is_running; } __pyx_CoroutineObject; static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) #else #define __Pyx_Coroutine_SwapException(self) {\ __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ } #define __Pyx_Coroutine_ResetAndClearException(self) {\ __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ } #endif #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) #else #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); /* PatchModuleWithCoroutine.proto */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); /* PatchGeneratorABC.proto */ static int __Pyx_patch_abc(void); /* Generator.proto */ #define __Pyx_Generator_USED static PyTypeObject *__pyx_GeneratorType = 0; #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(void); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self, struct PyGeventCallbackObject *__pyx_v_new_tail); /* proto*/ static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers(struct PyGeventLoopObject *__pyx_v_self, struct ev_loop *__pyx_v_ptr); /* proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ static ev_tstamp __pyx_f_6gevent_5libev_8corecext_4loop_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static void __pyx_f_6gevent_5libev_8corecext_4loop_update_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ /* Module declarations from 'cython' */ /* Module declarations from 'libev' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython.version' */ /* Module declarations from 'cpython.exc' */ /* Module declarations from 'cpython.module' */ /* Module declarations from 'cpython.mem' */ /* Module declarations from 'cpython.tuple' */ /* Module declarations from 'cpython.list' */ /* Module declarations from 'cpython.sequence' */ /* Module declarations from 'cpython.mapping' */ /* Module declarations from 'cpython.iterator' */ /* Module declarations from 'cpython.number' */ /* Module declarations from 'cpython.int' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.bool' */ static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; /* Module declarations from 'cpython.long' */ /* Module declarations from 'cpython.float' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.complex' */ static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; /* Module declarations from 'cpython.string' */ /* Module declarations from 'cpython.unicode' */ /* Module declarations from 'cpython.dict' */ /* Module declarations from 'cpython.instance' */ /* Module declarations from 'cpython.function' */ /* Module declarations from 'cpython.method' */ /* Module declarations from 'cpython.weakref' */ /* Module declarations from 'cpython.getargs' */ /* Module declarations from 'cpython.pythread' */ /* Module declarations from 'cpython.pystate' */ /* Module declarations from 'cpython.cobject' */ /* Module declarations from 'cpython.oldbuffer' */ /* Module declarations from 'cpython.set' */ /* Module declarations from 'cpython.buffer' */ /* Module declarations from 'cpython.bytes' */ /* Module declarations from 'cpython.pycapsule' */ /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'libc.errno' */ /* Module declarations from 'gevent.libev.corecext' */ static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext__EVENTSType = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_callback = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_loop = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_watcher = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_io = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_timer = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_signal = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_idle = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_prepare = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_check = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_fork = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_async_ = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_child = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_stat = 0; static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = 0; static PyObject *__pyx_v_6gevent_5libev_8corecext_integer_types = 0; __PYX_EXTERN_C DL_EXPORT(PyObject) *GEVENT_CORE_EVENTS; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_io_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_timer_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_signal_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_idle_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_prepare_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_check_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_fork_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_async_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_child_ss; static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_stat_ss; __PYX_EXTERN_C DL_EXPORT(PyObject) *_empty_tuple; static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int, int __pyx_skip_dispatch); /*proto*/ static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int, int __pyx_skip_dispatch); /*proto*/ static int __pyx_f_6gevent_5libev_8corecext__check_loop(struct PyGeventLoopObject *); /*proto*/ static void __pyx_f_6gevent_5libev_8corecext__python_incref(struct PyGeventWatcherObject *); /*proto*/ static void __pyx_f_6gevent_5libev_8corecext__python_decref(struct PyGeventWatcherObject *); /*proto*/ static void __pyx_f_6gevent_5libev_8corecext__libev_ref(struct PyGeventWatcherObject *); /*proto*/ static void __pyx_f_6gevent_5libev_8corecext__libev_unref(struct PyGeventWatcherObject *); /*proto*/ static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_f_6gevent_5libev_8corecext_make_ss(void *, void *); /*proto*/ static int __pyx_f_6gevent_5libev_8corecext__watcher_start(struct PyGeventWatcherObject *, PyObject *, PyObject *); /*proto*/ static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *, int __pyx_skip_dispatch); /*proto*/ __PYX_EXTERN_C void gevent_handle_error(struct PyGeventLoopObject *, PyObject *); /*proto*/ __PYX_EXTERN_C PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *); /*proto*/ #define __Pyx_MODULE_NAME "gevent.libev.corecext" extern int __pyx_module_is_main_gevent__libev__corecext; int __pyx_module_is_main_gevent__libev__corecext = 0; /* Implementation of 'gevent.libev.corecext' */ static PyObject *__pyx_builtin___import__; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_hex; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_SystemError; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_TypeError; static const char __pyx_k_[] = ","; static const char __pyx_k_t[] = "t"; static const char __pyx_k_v[] = "v"; static const char __pyx_k__2[] = ", "; static const char __pyx_k__3[] = "|"; static const char __pyx_k__5[] = "<...>"; static const char __pyx_k__6[] = ">"; static const char __pyx_k__7[] = ""; static const char __pyx_k__8[] = ": "; static const char __pyx_k_fd[] = "fd"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_io[] = "io"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_tb[] = "tb"; static const char __pyx_k_all[] = "__all__"; static const char __pyx_k_hex[] = "hex"; static const char __pyx_k_how[] = "how"; static const char __pyx_k_now[] = "now"; static const char __pyx_k_pid[] = "pid"; static const char __pyx_k_ptr[] = "ptr"; static const char __pyx_k_ref[] = "ref"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_FORK[] = "FORK"; static const char __pyx_k_IDLE[] = "IDLE"; static const char __pyx_k_NONE[] = "NONE"; static const char __pyx_k_NSIG[] = "NSIG"; static const char __pyx_k_READ[] = "READ"; static const char __pyx_k_STAT[] = "STAT"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_fork[] = "fork"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_idle[] = "idle"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_loop[] = "loop"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_once[] = "once"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_poll[] = "poll"; static const char __pyx_k_port[] = "port"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_stat[] = "stat"; static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_ASYNC[] = "ASYNC"; static const char __pyx_k_CHECK[] = "CHECK"; static const char __pyx_k_CHILD[] = "CHILD"; static const char __pyx_k_EMBED[] = "EMBED"; static const char __pyx_k_ERROR[] = "ERROR"; static const char __pyx_k_ILoop[] = "ILoop"; static const char __pyx_k_TIMER[] = "TIMER"; static const char __pyx_k_UNDEF[] = "UNDEF"; static const char __pyx_k_WRITE[] = "WRITE"; static const char __pyx_k_after[] = "after"; static const char __pyx_k_async[] = "async_"; static const char __pyx_k_check[] = "check"; static const char __pyx_k_child[] = "child"; static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_epoll[] = "epoll"; static const char __pyx_k_errno[] = "errno"; static const char __pyx_k_flags[] = "_flags"; static const char __pyx_k_level[] = "level"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_noenv[] = "noenv"; static const char __pyx_k_ref_2[] = " ref="; static const char __pyx_k_sigfd[] = "sigfd"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_strip[] = "strip"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_timer[] = "timer"; static const char __pyx_k_trace[] = "trace"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_win32[] = "win32"; static const char __pyx_k_CUSTOM[] = "CUSTOM"; static const char __pyx_k_EVENTS[] = "EVENTS"; static const char __pyx_k_MAXPRI[] = "MAXPRI"; static const char __pyx_k_MINPRI[] = "MINPRI"; static const char __pyx_k_SIGNAL[] = "SIGNAL"; static const char __pyx_k_active[] = "active"; static const char __pyx_k_args_r[] = " args=%r"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_events[] = "_events"; static const char __pyx_k_fileno[] = "fileno"; static const char __pyx_k_format[] = "_format"; static const char __pyx_k_gevent[] = "gevent"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_kqueue[] = "kqueue"; static const char __pyx_k_nowait[] = "nowait"; static const char __pyx_k_repeat[] = "repeat"; static const char __pyx_k_select[] = "select"; static const char __pyx_k_signal[] = "signal"; static const char __pyx_k_signum[] = "signum"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_CLEANUP[] = "CLEANUP"; static const char __pyx_k_IOFDSET[] = "_IOFDSET"; static const char __pyx_k_PREPARE[] = "PREPARE"; static const char __pyx_k_async_2[] = "async"; static const char __pyx_k_backend[] = "backend"; static const char __pyx_k_context[] = "context"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_flags_2[] = "flags"; static const char __pyx_k_genexpr[] = "genexpr"; static const char __pyx_k_message[] = "message"; static const char __pyx_k_pending[] = "pending"; static const char __pyx_k_prepare[] = "prepare"; static const char __pyx_k_revents[] = "revents"; static const char __pyx_k_rstatus[] = "rstatus"; static const char __pyx_k_stopped[] = " stopped"; static const char __pyx_k_watcher[] = "watcher"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_PERIODIC[] = "PERIODIC"; static const char __pyx_k_SIGNALFD[] = "SIGNALFD"; static const char __pyx_k_active_2[] = " active"; static const char __pyx_k_builtins[] = "__builtins__"; static const char __pyx_k_callback[] = "callback"; static const char __pyx_k_events_2[] = "events"; static const char __pyx_k_fileno_2[] = " fileno="; static const char __pyx_k_interval[] = "interval"; static const char __pyx_k_platform[] = "platform"; static const char __pyx_k_priority[] = "priority"; static const char __pyx_k_signalfd[] = "signalfd"; static const char __pyx_k_strerror[] = "strerror"; static const char __pyx_k_FORKCHECK[] = "FORKCHECK"; static const char __pyx_k_NOINOTIFY[] = "NOINOTIFY"; static const char __pyx_k_NOSIGMASK[] = "NOSIGMASK"; static const char __pyx_k_READWRITE[] = "READWRITE"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_activecnt[] = "activecnt"; static const char __pyx_k_default_2[] = " default"; static const char __pyx_k_destroyed[] = "destroyed"; static const char __pyx_k_forkcheck[] = "forkcheck"; static const char __pyx_k_noinotify[] = "noinotify"; static const char __pyx_k_nosigmask[] = "nosigmask"; static const char __pyx_k_pending_2[] = " pending"; static const char __pyx_k_pending_s[] = " pending=%s"; static const char __pyx_k_print_exc[] = "print_exc"; static const char __pyx_k_signalnum[] = "signalnum"; static const char __pyx_k_traceback[] = "traceback"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_basestring[] = "basestring"; static const char __pyx_k_callback_r[] = " callback=%r"; static const char __pyx_k_events_str[] = "events_str"; static const char __pyx_k_pendingcnt[] = "pendingcnt"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_update_now[] = "update_now"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_LIBEV_EMBED[] = "LIBEV_EMBED"; static const char __pyx_k_SystemError[] = "SystemError"; static const char __pyx_k_get_version[] = "get_version"; static const char __pyx_k_libev_d_02d[] = "libev-%d.%02d"; static const char __pyx_k_pass_events[] = "pass_events"; static const char __pyx_k_s_at_0x_x_s[] = "<%s at 0x%x%s"; static const char __pyx_k_BACKEND_POLL[] = "BACKEND_POLL"; static const char __pyx_k_BACKEND_PORT[] = "BACKEND_PORT"; static const char __pyx_k_EV_USE_4HEAP[] = "EV_USE_4HEAP"; static const char __pyx_k_EV_USE_FLOOR[] = "EV_USE_FLOOR"; static const char __pyx_k_handle_error[] = "handle_error"; static const char __pyx_k_signalmodule[] = "signalmodule"; static const char __pyx_k_version_info[] = "version_info"; static const char __pyx_k_BACKEND_EPOLL[] = "BACKEND_EPOLL"; static const char __pyx_k_fd_s_events_s[] = " fd=%s events=%s"; static const char __pyx_k_flags_str2int[] = "_flags_str2int"; static const char __pyx_k_handle_syserr[] = "_handle_syserr"; static const char __pyx_k_origflags_int[] = "origflags_int"; static const char __pyx_k_s_at_0x_x_s_2[] = "<%s at 0x%x %s>"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_BACKEND_KQUEUE[] = "BACKEND_KQUEUE"; static const char __pyx_k_BACKEND_SELECT[] = "BACKEND_SELECT"; static const char __pyx_k_EV_USE_EVENTFD[] = "EV_USE_EVENTFD"; static const char __pyx_k_EV_USE_INOTIFY[] = "EV_USE_INOTIFY"; static const char __pyx_k_format_details[] = "_format_details"; static const char __pyx_k_zope_interface[] = "zope.interface"; static const char __pyx_k_EV_USE_REALTIME[] = "EV_USE_REALTIME"; static const char __pyx_k_EV_USE_SIGNALFD[] = "EV_USE_SIGNALFD"; static const char __pyx_k_SYSERR_CALLBACK[] = "__SYSERR_CALLBACK"; static const char __pyx_k_classImplements[] = "classImplements"; static const char __pyx_k_pid_r_rstatus_r[] = " pid=%r rstatus=%r"; static const char __pyx_k_print_exception[] = "print_exception"; static const char __pyx_k_EV_USE_MONOTONIC[] = "EV_USE_MONOTONIC"; static const char __pyx_k_EV_USE_NANOSLEEP[] = "EV_USE_NANOSLEEP"; static const char __pyx_k_getswitchinterval[] = "getswitchinterval"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_get_header_version[] = "get_header_version"; static const char __pyx_k_gevent__interfaces[] = "gevent._interfaces"; static const char __pyx_k_gevent_core_EVENTS[] = "gevent.core.EVENTS"; static const char __pyx_k_supported_backends[] = "supported_backends"; static const char __pyx_k_embeddable_backends[] = "embeddable_backends"; static const char __pyx_k_EV_USE_CLOCK_SYSCALL[] = "EV_USE_CLOCK_SYSCALL"; static const char __pyx_k_default_handle_error[] = "_default_handle_error"; static const char __pyx_k_ev_loop_new_s_failed[] = "ev_loop_new(%s) failed"; static const char __pyx_k_illegal_event_mask_r[] = "illegal event mask: %r"; static const char __pyx_k_recommended_backends[] = "recommended_backends"; static const char __pyx_k_Unsupported_backend_s[] = "Unsupported backend: %s"; static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; static const char __pyx_k_gevent_libev_corecext[] = "gevent.libev.corecext"; static const char __pyx_k_Expected_callable_not_r[] = "Expected callable, not %r"; static const char __pyx_k_illegal_signal_number_r[] = "illegal signal number: %r"; static const char __pyx_k_ev_default_loop_s_failed[] = "ev_default_loop(%s) failed"; static const char __pyx_k_fd_must_be_non_negative_r[] = "fd must be non-negative: %r"; static const char __pyx_k_operation_on_destroyed_loop[] = "operation on destroyed loop"; static const char __pyx_k_src_gevent_libev_corecext_pyx[] = "src/gevent/libev/corecext.pyx"; static const char __pyx_k_Invalid_value_for_backend_0x_x[] = "Invalid value for backend: 0x%x"; static const char __pyx_k_io_watcher_attribute_events_is[] = "'io' watcher attribute 'events' is read-only while watcher is active"; static const char __pyx_k_Cannot_construct_a_bare_watcher[] = "Cannot construct a bare watcher"; static const char __pyx_k_Expected_callable_or_None_got_r[] = "Expected callable or None, got %r"; static const char __pyx_k_callbacks_r_len_d_head_r_tail_r[] = "<callbacks@%r len=%d head=%r tail=%r>"; static const char __pyx_k_io_watcher_attribute_fd_is_read[] = "'io' watcher attribute 'fd' is read-only while watcher is active"; static const char __pyx_k_repeat_must_be_positive_or_zero[] = "repeat must be positive or zero: %r"; static const char __pyx_k_Cannot_set_priority_of_an_active[] = "Cannot set priority of an active watcher"; static const char __pyx_k_Child_watchers_are_not_supported[] = "Child watchers are not supported on Windows"; static const char __pyx_k_Invalid_backend_or_flag_s_Possib[] = "Invalid backend or flag: %s\nPossible values: %s"; static const char __pyx_k_child_watchers_are_only_availabl[] = "child watchers are only available on the default loop"; static PyObject *__pyx_kp_s_; static PyObject *__pyx_n_s_ASYNC; static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_n_s_BACKEND_EPOLL; static PyObject *__pyx_n_s_BACKEND_KQUEUE; static PyObject *__pyx_n_s_BACKEND_POLL; static PyObject *__pyx_n_s_BACKEND_PORT; static PyObject *__pyx_n_s_BACKEND_SELECT; static PyObject *__pyx_n_s_CHECK; static PyObject *__pyx_n_s_CHILD; static PyObject *__pyx_n_s_CLEANUP; static PyObject *__pyx_n_s_CUSTOM; static PyObject *__pyx_kp_s_Cannot_construct_a_bare_watcher; static PyObject *__pyx_kp_s_Cannot_set_priority_of_an_active; static PyObject *__pyx_kp_s_Child_watchers_are_not_supported; static PyObject *__pyx_n_s_EMBED; static PyObject *__pyx_n_s_ERROR; static PyObject *__pyx_n_s_EVENTS; static PyObject *__pyx_n_s_EV_USE_4HEAP; static PyObject *__pyx_n_s_EV_USE_CLOCK_SYSCALL; static PyObject *__pyx_n_s_EV_USE_EVENTFD; static PyObject *__pyx_n_s_EV_USE_FLOOR; static PyObject *__pyx_n_s_EV_USE_INOTIFY; static PyObject *__pyx_n_s_EV_USE_MONOTONIC; static PyObject *__pyx_n_s_EV_USE_NANOSLEEP; static PyObject *__pyx_n_s_EV_USE_REALTIME; static PyObject *__pyx_n_s_EV_USE_SIGNALFD; static PyObject *__pyx_kp_s_Expected_callable_not_r; static PyObject *__pyx_kp_s_Expected_callable_or_None_got_r; static PyObject *__pyx_n_s_FORK; static PyObject *__pyx_n_s_FORKCHECK; static PyObject *__pyx_n_s_IDLE; static PyObject *__pyx_n_s_ILoop; static PyObject *__pyx_n_s_IOFDSET; static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_kp_s_Invalid_backend_or_flag_s_Possib; static PyObject *__pyx_kp_s_Invalid_value_for_backend_0x_x; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_n_s_LIBEV_EMBED; static PyObject *__pyx_n_s_MAXPRI; static PyObject *__pyx_n_s_MINPRI; static PyObject *__pyx_n_s_NOINOTIFY; static PyObject *__pyx_n_s_NONE; static PyObject *__pyx_n_s_NOSIGMASK; static PyObject *__pyx_n_s_NSIG; static PyObject *__pyx_n_s_PERIODIC; static PyObject *__pyx_n_s_PREPARE; static PyObject *__pyx_n_s_READ; static PyObject *__pyx_n_s_READWRITE; static PyObject *__pyx_n_s_SIGNAL; static PyObject *__pyx_n_s_SIGNALFD; static PyObject *__pyx_n_s_STAT; static PyObject *__pyx_n_s_SYSERR_CALLBACK; static PyObject *__pyx_n_s_SystemError; static PyObject *__pyx_n_s_TIMER; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_UNDEF; static PyObject *__pyx_kp_s_Unsupported_backend_s; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_WRITE; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_kp_s__3; static PyObject *__pyx_kp_s__5; static PyObject *__pyx_kp_s__6; static PyObject *__pyx_kp_s__7; static PyObject *__pyx_kp_s__8; static PyObject *__pyx_n_s_active; static PyObject *__pyx_kp_s_active_2; static PyObject *__pyx_n_s_activecnt; static PyObject *__pyx_n_s_after; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_args; static PyObject *__pyx_kp_s_args_r; static PyObject *__pyx_n_s_async; static PyObject *__pyx_n_s_async_2; static PyObject *__pyx_n_s_backend; static PyObject *__pyx_n_s_basestring; static PyObject *__pyx_n_s_builtins; static PyObject *__pyx_n_s_callback; static PyObject *__pyx_kp_s_callback_r; static PyObject *__pyx_kp_s_callbacks_r_len_d_head_r_tail_r; static PyObject *__pyx_n_s_check; static PyObject *__pyx_n_s_child; static PyObject *__pyx_kp_s_child_watchers_are_only_availabl; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_classImplements; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_context; static PyObject *__pyx_n_s_decode; static PyObject *__pyx_n_s_default; static PyObject *__pyx_kp_s_default_2; static PyObject *__pyx_n_s_default_handle_error; static PyObject *__pyx_n_s_destroyed; static PyObject *__pyx_n_s_embeddable_backends; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_epoll; static PyObject *__pyx_n_s_errno; static PyObject *__pyx_kp_s_ev_default_loop_s_failed; static PyObject *__pyx_kp_s_ev_loop_new_s_failed; static PyObject *__pyx_n_s_events; static PyObject *__pyx_n_s_events_2; static PyObject *__pyx_n_s_events_str; static PyObject *__pyx_n_s_fd; static PyObject *__pyx_kp_s_fd_must_be_non_negative_r; static PyObject *__pyx_kp_s_fd_s_events_s; static PyObject *__pyx_n_s_fileno; static PyObject *__pyx_kp_s_fileno_2; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_flags_2; static PyObject *__pyx_n_s_flags_str2int; static PyObject *__pyx_n_s_fork; static PyObject *__pyx_n_s_forkcheck; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_format_details; static PyObject *__pyx_n_s_func; static PyObject *__pyx_n_s_genexpr; static PyObject *__pyx_n_s_get_header_version; static PyObject *__pyx_n_s_get_version; static PyObject *__pyx_n_s_getfilesystemencoding; static PyObject *__pyx_n_s_getswitchinterval; static PyObject *__pyx_n_s_gevent; static PyObject *__pyx_n_s_gevent__interfaces; static PyObject *__pyx_kp_s_gevent_core_EVENTS; static PyObject *__pyx_n_s_gevent_libev_corecext; static PyObject *__pyx_n_s_handle_error; static PyObject *__pyx_n_s_handle_syserr; static PyObject *__pyx_n_s_hex; static PyObject *__pyx_n_s_how; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_idle; static PyObject *__pyx_kp_s_illegal_event_mask_r; static PyObject *__pyx_kp_s_illegal_signal_number_r; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_interval; static PyObject *__pyx_n_s_io; static PyObject *__pyx_kp_s_io_watcher_attribute_events_is; static PyObject *__pyx_kp_s_io_watcher_attribute_fd_is_read; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_kqueue; static PyObject *__pyx_n_s_level; static PyObject *__pyx_kp_s_libev_d_02d; static PyObject *__pyx_n_s_loop; static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_message; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_noenv; static PyObject *__pyx_n_s_noinotify; static PyObject *__pyx_n_s_nosigmask; static PyObject *__pyx_n_s_now; static PyObject *__pyx_n_s_nowait; static PyObject *__pyx_n_s_once; static PyObject *__pyx_kp_s_operation_on_destroyed_loop; static PyObject *__pyx_n_s_origflags_int; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_pass_events; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_pending; static PyObject *__pyx_kp_s_pending_2; static PyObject *__pyx_kp_s_pending_s; static PyObject *__pyx_n_s_pendingcnt; static PyObject *__pyx_n_s_pid; static PyObject *__pyx_kp_s_pid_r_rstatus_r; static PyObject *__pyx_n_s_platform; static PyObject *__pyx_n_s_poll; static PyObject *__pyx_n_s_port; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_print_exc; static PyObject *__pyx_n_s_print_exception; static PyObject *__pyx_n_s_priority; static PyObject *__pyx_n_s_ptr; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_recommended_backends; static PyObject *__pyx_n_s_ref; static PyObject *__pyx_kp_s_ref_2; static PyObject *__pyx_n_s_repeat; static PyObject *__pyx_kp_s_repeat_must_be_positive_or_zero; static PyObject *__pyx_n_s_revents; static PyObject *__pyx_n_s_rstatus; static PyObject *__pyx_kp_s_s_at_0x_x_s; static PyObject *__pyx_kp_s_s_at_0x_x_s_2; static PyObject *__pyx_n_s_select; static PyObject *__pyx_n_s_send; static PyObject *__pyx_n_s_sigfd; static PyObject *__pyx_n_s_signal; static PyObject *__pyx_n_s_signalfd; static PyObject *__pyx_n_s_signalmodule; static PyObject *__pyx_n_s_signalnum; static PyObject *__pyx_n_s_signum; static PyObject *__pyx_n_s_split; static PyObject *__pyx_kp_s_src_gevent_libev_corecext_pyx; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_stat; static PyObject *__pyx_n_s_stop; static PyObject *__pyx_kp_s_stopped; static PyObject *__pyx_n_s_strerror; static PyObject *__pyx_n_s_strip; static PyObject *__pyx_n_s_supported_backends; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_t; static PyObject *__pyx_n_s_tb; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_throw; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_s_timer; static PyObject *__pyx_n_s_trace; static PyObject *__pyx_n_s_traceback; static PyObject *__pyx_n_s_type; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_update_now; static PyObject *__pyx_n_s_v; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_version_info; static PyObject *__pyx_n_s_watcher; static PyObject *__pyx_n_s_win32; static PyObject *__pyx_n_s_zope_interface; static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, intptr_t __pyx_v_ptr); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_default, CYTHON_UNUSED intptr_t __pyx_v_ptr); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async_(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(struct PyGeventWatcherObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_12close(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(struct PyGeventWatcherObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED vfd_socket_t __pyx_v_fd, CYTHON_UNUSED int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(struct PyGeventIOObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static void __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(struct PyGeventIOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(struct PyGeventTimerObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED double __pyx_v_after, CYTHON_UNUSED double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(struct PyGeventSignalObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(struct PyGeventIdleObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(struct PyGeventPrepareObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(struct PyGeventCheckObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(struct PyGeventForkObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(struct PyGeventAsyncObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__2send(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, CYTHON_UNUSED PyObject *__pyx_v_ref); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_pid, CYTHON_UNUSED int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4_format(struct PyGeventChildObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(struct PyGeventStatObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ static int __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback); /* proto */ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext__EVENTSType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_callback(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_loop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_watcher(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_async_(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_3; static int __pyx_k__9; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__23; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__25; static PyObject *__pyx_codeobj__26; static PyObject *__pyx_codeobj__27; /* Late includes */ static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) { struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 149, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gevent_5libev_8corecext_24generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_gevent_libev_corecext); if (unlikely(!gen)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("gevent.libev.corecext.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 149, __pyx_L1_error) __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 149, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 149, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 149, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_flag); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_flag, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_string); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_string, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_string, (PyObject*)__pyx_cur_scope->__pyx_v_flag))) __PYX_ERR(0, 149, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } PyObject *GEVENT_CORE_EVENTS = 0; PyObject *_empty_tuple = 0; /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(((struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_gevent_core_EVENTS); __pyx_r = __pyx_kp_s_gevent_core_EVENTS; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_1get_version = {"get_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_1get_version, METH_NOARGS, 0}; static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_version (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_get_version(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_version", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(ev_version_major()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(ev_version_minor()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_3get_header_version = {"get_header_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_3get_header_version, METH_NOARGS, 0}; static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_header_version (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2get_header_version(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_header_version", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(EV_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(EV_VERSION_MINOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.get_header_version", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_result = 0; PyObject *__pyx_v_code = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; unsigned int __pyx_t_11; __Pyx_RefNannySetupContext("_flags_to_list", 0); __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 172, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 172, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 172, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_And(__pyx_t_1, __pyx_v_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_value); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Invert(__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_flags = __pyx_t_11; __pyx_t_9 = ((!(__pyx_v_flags != 0)) != 0); if (__pyx_t_9) { goto __pyx_L4_break; } } __pyx_L4_break:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = (__pyx_v_flags != 0); if (__pyx_t_9) { __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_code); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags) { unsigned int __pyx_v_flags; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_flags_to_list (wrapper)", 0); assert(__pyx_arg_flags); { __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(__pyx_self, ((unsigned int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_flags_to_list", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/ static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { unsigned int __pyx_v_result; PyObject *__pyx_v_value = NULL; PyObject *__pyx_v_ex = NULL; unsigned int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_t_17; int __pyx_t_18; char const *__pyx_t_19; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; __Pyx_RefNannySetupContext("_flags_to_int", 0); __Pyx_INCREF(__pyx_v_flags); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { __pyx_r = 0; goto __pyx_L0; } __pyx_t_3 = __pyx_v_6gevent_5libev_8corecext_integer_types; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_flags); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_r = __pyx_t_4; goto __pyx_L0; } __pyx_v_result = 0; { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 197, __pyx_L5_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_v_flags)) || PyTuple_CheckExact(__pyx_v_flags)) { __pyx_t_3 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error) #else __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error) #else __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 199, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 200, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_lower); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_12); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 201, __pyx_L5_error) if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_12); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L5_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_v_result = __pyx_t_4; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_14) { __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_12, &__pyx_t_9) < 0) __PYX_ERR(0, 203, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); __pyx_v_ex = __pyx_t_12; /*try:*/ { __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_keys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_16); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 204, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PySequence_List(__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_8 = ((PyObject*)__pyx_t_16); __pyx_t_16 = 0; __pyx_t_17 = PyList_Sort(__pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L20_error) __pyx_t_16 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_ex); __Pyx_GIVEREF(__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ex); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 204, __pyx_L20_error) } /*finally:*/ { __pyx_L20_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __pyx_t_14 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); } __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22); __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19; goto __pyx_L7_except_error; } } } goto __pyx_L7_except_error; __pyx_L7_except_error:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L10_try_end:; } __pyx_r = __pyx_v_result; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XDECREF(__pyx_v_ex); __Pyx_XDECREF(__pyx_v_flags); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_flags_to_int (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(__pyx_self, ((PyObject *)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations unsigned int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_flags_to_int", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_1 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("_str_hex", 0); __pyx_t_1 = __pyx_v_6gevent_5libev_8corecext_integer_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_flag, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 211, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext._str_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_as_list = 0; PyObject *__pyx_8genexpr1__pyx_v_x = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); __Pyx_RefNannySetupContext("_check_flags", 0); __pyx_v_flags = (__pyx_v_flags & EVBACKEND_MASK); __pyx_t_1 = ((!(__pyx_v_flags != 0)) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_t_1 = ((!((__pyx_v_flags & EVBACKEND_ALL) != 0)) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 220, __pyx_L1_error) } __pyx_t_1 = ((!((__pyx_v_flags & ev_supported_backends()) != 0)) != 0); if (unlikely(__pyx_t_1)) { { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 222, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__str_hex(__pyx_8genexpr1__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 222, __pyx_L8_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0; goto __pyx_L11_exit_scope; __pyx_L8_error:; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0; goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ __pyx_v_as_list = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_as_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_backend_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 223, __pyx_L1_error) } /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_as_list); __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags) { unsigned int __pyx_v_flags; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_check_flags (wrapper)", 0); assert(__pyx_arg_flags); { __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8_check_flags(__pyx_self, ((unsigned int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_check_flags", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int __pyx_v_events, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_result = 0; int __pyx_v_c_flag; PyObject *__pyx_v_flag = NULL; PyObject *__pyx_v_string = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; __Pyx_RefNannySetupContext("_events_to_str", 0); __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 229, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 229, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 229, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 229, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_string, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_v_c_flag = __pyx_t_9; __pyx_t_10 = ((__pyx_v_events & __pyx_v_c_flag) != 0); if (__pyx_t_10) { __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_string); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_v_events = (__pyx_v_events & (~__pyx_v_c_flag)); } __pyx_t_10 = ((!(__pyx_v_events != 0)) != 0); if (__pyx_t_10) { goto __pyx_L4_break; } } __pyx_L4_break:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = (__pyx_v_events != 0); if (__pyx_t_10) { __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_flag); __Pyx_XDECREF(__pyx_v_string); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events) { int __pyx_v_events; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_events_to_str (wrapper)", 0); assert(__pyx_arg_events); { __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_10_events_to_str(__pyx_self, ((int)__pyx_v_events)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_events_to_str", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_13supported_backends = {"supported_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_13supported_backends, METH_NOARGS, 0}; static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("supported_backends (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12supported_backends(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("supported_backends", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_supported_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.supported_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_15recommended_backends = {"recommended_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_15recommended_backends, METH_NOARGS, 0}; static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("recommended_backends (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_14recommended_backends(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("recommended_backends", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_recommended_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.recommended_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends = {"embeddable_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends, METH_NOARGS, 0}; static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("embeddable_backends (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("embeddable_backends", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_embeddable_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.embeddable_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_19time = {"time", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_19time, METH_NOARGS, 0}; static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("time (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_18time(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("time", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(ev_time()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.time", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_f_6gevent_5libev_8corecext__check_loop(struct PyGeventLoopObject *__pyx_v_loop) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_check_loop", 0); __pyx_t_1 = ((!(__pyx_v_loop->_ptr != 0)) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 258, __pyx_L1_error) } __pyx_r = 1; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext._check_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_args = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_args,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 268, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_callback = values[0]; __pyx_v_args = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback___init__(((struct PyGeventCallbackObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_callback); __Pyx_GIVEREF(__pyx_v_callback); __Pyx_GOTREF(__pyx_v_self->callback); __Pyx_DECREF(__pyx_v_self->callback); __pyx_v_self->callback = __pyx_v_callback; if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 270, __pyx_L1_error) __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_2stop(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->callback); __Pyx_DECREF(__pyx_v_self->callback); __pyx_v_self->callback = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = ((PyObject*)Py_None); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__nonzero__", 0); __pyx_t_1 = (__pyx_v_self->args != ((PyObject*)Py_None)); __pyx_r = __pyx_t_1; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_self->callback != Py_None); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.callback.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self) { PyObject *__pyx_v_format = NULL; PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s__5); __pyx_r = __pyx_kp_s__5; goto __pyx_L0; } /*try:*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_format = __pyx_t_2; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 297, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } __pyx_t_1 = (__pyx_v_self->callback != Py_None); __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->callback); __Pyx_GIVEREF(__pyx_v_self->callback); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None)); __pyx_t_1 = (__pyx_t_5 != 0); if (__pyx_t_1) { __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->args); __Pyx_GIVEREF(__pyx_v_self->args); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->args); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } __pyx_t_5 = (__pyx_v_self->callback == Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L11_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->args == ((PyObject*)Py_None)); __pyx_t_5 = (__pyx_t_6 != 0); __pyx_t_1 = __pyx_t_5; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_stopped); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L4_return; } /*finally:*/ { __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { Py_ReprLeave(((PyObject *)__pyx_v_self)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; } __pyx_L4_return: { __pyx_t_15 = __pyx_r; __pyx_r = 0; Py_ReprLeave(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_t_15; __pyx_t_15 = 0; goto __pyx_L0; } } /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext.callback.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_format (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8_format(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_format", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s__7); __pyx_r = __pyx_kp_s__7; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->callback); __pyx_r = __pyx_v_self->callback; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->callback); __Pyx_DECREF(__pyx_v_self->callback); __pyx_v_self->callback = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->callback); __Pyx_DECREF(__pyx_v_self->callback); __pyx_v_self->callback = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->args); __pyx_r = __pyx_v_self->args; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 265, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.callback.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = ((PyObject*)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->head); __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); __pyx_v_self->head = ((struct PyGeventCallbackObject *)Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->tail); __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { struct PyGeventCallbackObject *__pyx_v_head = 0; struct PyGeventCallbackObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("popleft", 0); __pyx_t_1 = ((PyObject *)__pyx_v_self->head); __Pyx_INCREF(__pyx_t_1); __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_head->next); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->head); __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); __pyx_v_self->head = ((struct PyGeventCallbackObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_self->head == __pyx_v_self->tail); __pyx_t_4 = (__pyx_t_3 != 0); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (((PyObject *)__pyx_v_self->head) == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->tail); __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None); } __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_head->next); __Pyx_DECREF(((PyObject *)__pyx_v_head->next)); __pyx_v_head->next = ((struct PyGeventCallbackObject *)Py_None); __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_head)); __pyx_r = __pyx_v_head; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_head); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self, struct PyGeventCallbackObject *__pyx_v_new_tail) { struct PyGeventCallbackObject *__pyx_v_old_tail = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("append", 0); #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_new_tail->next)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 334, __pyx_L1_error) if (unlikely(!((!__pyx_t_1) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 334, __pyx_L1_error) } } #endif __pyx_t_1 = (((PyObject *)__pyx_v_self->tail) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_2 = (((PyObject *)__pyx_v_self->head) == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); __Pyx_GOTREF(__pyx_v_self->head); __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); __pyx_v_self->head = __pyx_v_new_tail; __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_t_3 = ((PyObject *)__pyx_v_self->head); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->tail); __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); __pyx_v_self->tail = ((struct PyGeventCallbackObject *)__pyx_t_3); __pyx_t_3 = 0; } #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None); if (unlikely(!(__pyx_t_1 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 344, __pyx_L1_error) } } #endif __pyx_t_3 = ((PyObject *)__pyx_v_self->tail); __Pyx_INCREF(__pyx_t_3); __pyx_v_old_tail = ((struct PyGeventCallbackObject *)__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); __Pyx_GOTREF(__pyx_v_old_tail->next); __Pyx_DECREF(((PyObject *)__pyx_v_old_tail->next)); __pyx_v_old_tail->next = __pyx_v_new_tail; __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); __Pyx_GOTREF(__pyx_v_self->tail); __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); __pyx_v_self->tail = __pyx_v_new_tail; /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.append", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_old_tail); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__nonzero__", 0); __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None); __pyx_r = __pyx_t_1; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { Py_ssize_t __pyx_v_count; struct PyGeventCallbackObject *__pyx_v_head = NULL; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("__len__", 0); __pyx_v_count = 0; __pyx_t_1 = ((PyObject *)__pyx_v_self->head); __Pyx_INCREF(__pyx_t_1); __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); __pyx_t_1 = 0; while (1) { __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) break; __pyx_v_count = (__pyx_v_count + 1); __pyx_t_1 = ((PyObject *)__pyx_v_head->next); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_r = __pyx_v_count; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_head); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { PyObject *__pyx_v_objects = 0; struct PyGeventCallbackObject *__pyx_v_head = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("__iter__", 0); __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_objects = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_self->head); __Pyx_INCREF(__pyx_t_1); __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); __pyx_t_1 = 0; while (1) { __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) break; __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_objects, ((PyObject *)__pyx_v_head)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 364, __pyx_L1_error) __pyx_t_1 = ((PyObject *)__pyx_v_head->next); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1)); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_objects); __Pyx_XDECREF((PyObject *)__pyx_v_head); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("has_callbacks", 0); __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->head)); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_WriteUnraisable("gevent.libev.corecext.CallbackFIFO.has_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 372, __pyx_L1_error) __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->head)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->head)); PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->head)); __Pyx_INCREF(((PyObject *)__pyx_v_self->tail)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tail)); PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_self->tail)); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_callbacks_r_len_d_head_r_tail_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_default = 0; intptr_t __pyx_v_ptr; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 397, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flags = values[0]; __pyx_v_default = values[1]; if (values[2]) { __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error) } else { __pyx_v_ptr = ((intptr_t)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, intptr_t __pyx_v_ptr) { unsigned int __pyx_v_c_flags; CYTHON_UNUSED PyObject *__pyx_v_old_handler = 0; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; unsigned int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_default); __pyx_v_self->starting_timer_may_update_loop_time = 0; __pyx_v_self->_default = 0; ev_prepare_init((&__pyx_v_self->_prepare), ((void *)gevent_run_callbacks)); ev_timer_init((&__pyx_v_self->_periodic_signal_checker), ((void *)gevent_periodic_signal_check), 0.3, 0.3); ev_timer_init((&__pyx_v_self->_timer0), ((void *)gevent_noop), 0.0, 0.0); __Pyx_INCREF(Py_None); __pyx_v_old_handler = Py_None; __pyx_t_1 = (__pyx_v_ptr != 0); if (__pyx_t_1) { __pyx_v_self->_ptr = ((struct ev_loop *)__pyx_v_ptr); __pyx_v_self->_default = ev_is_default_loop(__pyx_v_self->_ptr); goto __pyx_L3; } /*else*/ { __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_2 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L1_error) __pyx_v_c_flags = __pyx_t_2; __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_c_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_NOENV); __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_FORKCHECK); __pyx_t_1 = (__pyx_v_default == Py_None); __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { __Pyx_INCREF(Py_True); __Pyx_DECREF_SET(__pyx_v_default, Py_True); } __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) if (__pyx_t_4) { __pyx_v_self->_default = 1; __pyx_v_self->_ptr = gevent_ev_default_loop(__pyx_v_c_flags); __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0); if (unlikely(__pyx_t_4)) { __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_default_loop_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 425, __pyx_L1_error) } __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_platform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker)); ev_unref(__pyx_v_self->_ptr); } goto __pyx_L5; } /*else*/ { __pyx_v_self->_ptr = ev_loop_new(__pyx_v_c_flags); __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0); if (unlikely(__pyx_t_4)) { __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_loop_new_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 432, __pyx_L1_error) } } __pyx_L5:; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L10_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = (__pyx_t_5 == Py_None); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (__pyx_t_1 != 0); __pyx_t_4 = __pyx_t_6; __pyx_L10_bool_binop_done:; if (__pyx_t_4) { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_t_5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __pyx_L3:; ev_set_userdata(__pyx_v_self->_ptr, __pyx_v_self->_ptr); ev_prepare_start(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare)); ev_unref(__pyx_v_self->_ptr); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_old_handler); __Pyx_XDECREF(__pyx_v_default); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_default = 0; CYTHON_UNUSED intptr_t __pyx_v_ptr; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 442, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flags = values[0]; __pyx_v_default = values[1]; if (values[2]) { __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) } else { __pyx_v_ptr = ((intptr_t)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 442, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_default, CYTHON_UNUSED intptr_t __pyx_v_ptr) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_callbacks); __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->approx_timer_resolution = 0.00001; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self) { struct PyGeventCallbackObject *__pyx_v_cb = 0; int __pyx_v_count; ev_tstamp __pyx_v_now; ev_tstamp __pyx_v_expiration; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; ev_tstamp __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; __Pyx_RefNannySetupContext("_run_callbacks", 0); __pyx_v_count = 50; __pyx_v_self->starting_timer_may_update_loop_time = 1; __pyx_v_now = ev_now(__pyx_v_self->_ptr); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_expiration = (__pyx_v_now + ((ev_tstamp)__pyx_t_4)); /*try:*/ { ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0)); while (1) { __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (!__pyx_t_6) break; __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(__pyx_v_self->_callbacks)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_cb, ((struct PyGeventCallbackObject *)__pyx_t_1)); __pyx_t_1 = 0; ev_unref(__pyx_v_self->_ptr); gevent_call(__pyx_v_self, __pyx_v_cb); __pyx_v_count = (__pyx_v_count - 1); __pyx_t_5 = ((__pyx_v_count == 0) != 0); if (__pyx_t_5) { } else { __pyx_t_6 = __pyx_t_5; goto __pyx_L9_bool_binop_done; } __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); __pyx_t_7 = (__pyx_t_5 != 0); __pyx_t_6 = __pyx_t_7; __pyx_L9_bool_binop_done:; if (__pyx_t_6) { __pyx_v_count = 50; ev_now_update(__pyx_v_self->_ptr); __pyx_t_6 = ((ev_now(__pyx_v_self->_ptr) >= __pyx_v_expiration) != 0); if (__pyx_t_6) { __pyx_v_now = 0.0; goto __pyx_L7_break; } } } __pyx_L7_break:; __pyx_t_6 = ((__pyx_v_now != 0.0) != 0); if (__pyx_t_6) { ev_now_update(__pyx_v_self->_ptr); } __pyx_t_6 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0)); } } /*finally:*/ { /*normal exit:*/{ __pyx_v_self->starting_timer_may_update_loop_time = 0; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __pyx_v_self->starting_timer_may_update_loop_time = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; } __pyx_L5:; } /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.loop._run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers(struct PyGeventLoopObject *__pyx_v_self, struct ev_loop *__pyx_v_ptr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_stop_watchers", 0); __pyx_t_1 = ((!(__pyx_v_ptr != 0)) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_t_1 = (ev_is_active((&__pyx_v_self->_prepare)) != 0); if (__pyx_t_1) { ev_ref(__pyx_v_ptr); ev_prepare_stop(__pyx_v_ptr, (&__pyx_v_self->_prepare)); } __pyx_t_1 = (ev_is_active((&__pyx_v_self->_periodic_signal_checker)) != 0); if (__pyx_t_1) { ev_ref(__pyx_v_ptr); ev_timer_stop(__pyx_v_ptr, (&__pyx_v_self->_periodic_signal_checker)); } /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self) { struct ev_loop *__pyx_v_ptr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations struct ev_loop *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("destroy", 0); __pyx_t_1 = __pyx_v_self->_ptr; __pyx_v_ptr = __pyx_t_1; __pyx_v_self->_ptr = NULL; __pyx_t_2 = (__pyx_v_ptr != 0); if (__pyx_t_2) { __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } ev_set_userdata(__pyx_v_ptr, NULL); __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } ev_loop_destroy(__pyx_v_ptr); } /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.loop.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self) { struct ev_loop *__pyx_v_ptr; __Pyx_RefNannyDeclarations struct ev_loop *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__dealloc__", 0); __pyx_t_1 = __pyx_v_self->_ptr; __pyx_v_ptr = __pyx_t_1; __pyx_v_self->_ptr = NULL; __pyx_t_2 = ((__pyx_v_ptr != NULL) != 0); if (__pyx_t_2) { __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0); if (__pyx_t_2) { goto __pyx_L0; } __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = ((!(__pyx_v_self->_default != 0)) != 0); if (__pyx_t_2) { ev_loop_destroy(__pyx_v_ptr); ev_set_userdata(__pyx_v_ptr, NULL); } } /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("gevent.libev.corecext.loop.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop.ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher)); __pyx_r = ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop.MAXPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop.MINPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_message = 0; PyObject *__pyx_v_errno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_handle_syserr (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,&__pyx_n_s_errno,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errno)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, 1); __PYX_ERR(0, 539, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_syserr") < 0)) __PYX_ERR(0, 539, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_message = values[0]; __pyx_v_errno = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_message, __pyx_v_errno); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_handle_syserr", 0); __Pyx_INCREF(__pyx_v_message); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = PyNumber_Add(__pyx_v_message, __pyx_kp_s__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_errno) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_errno); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->handle_error(__pyx_v_self, Py_None, __pyx_builtin_SystemError, __pyx_t_1, Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { PyObject *__pyx_v_handle_error = 0; PyObject *__pyx_v_error_handler = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; __Pyx_RefNannySetupContext("handle_error", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); else { PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_context); __Pyx_GIVEREF(__pyx_v_context); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); __Pyx_INCREF(__pyx_v_type); __Pyx_GIVEREF(__pyx_v_type); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); __Pyx_INCREF(__pyx_v_tb); __Pyx_GIVEREF(__pyx_v_tb); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; if (unlikely(type_dict_guard != tp_dict_version)) { tp_dict_version = obj_dict_version = 0; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP } #endif } __pyx_t_1 = __pyx_v_self->error_handler; __Pyx_INCREF(__pyx_t_1); __pyx_v_error_handler = __pyx_t_1; __pyx_t_1 = 0; __pyx_t_7 = (__pyx_v_error_handler != Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_error_handler, __pyx_n_s_handle_error, __pyx_v_error_handler); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_handle_error = __pyx_t_1; __pyx_t_1 = 0; __Pyx_INCREF(__pyx_v_handle_error); __pyx_t_2 = __pyx_v_handle_error; __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_context); __Pyx_GIVEREF(__pyx_v_context); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); __Pyx_INCREF(__pyx_v_type); __Pyx_GIVEREF(__pyx_v_type); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); __Pyx_INCREF(__pyx_v_tb); __Pyx_GIVEREF(__pyx_v_tb); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } /*else*/ { __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_handle_error); __Pyx_XDECREF(__pyx_v_error_handler); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_tb = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle_error (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 1); __PYX_ERR(0, 544, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 2); __PYX_ERR(0, 544, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 3); __PYX_ERR(0, 544, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_error") < 0)) __PYX_ERR(0, 544, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_context = values[0]; __pyx_v_type = values[1]; __pyx_v_value = values[2]; __pyx_v_tb = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("handle_error", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; __Pyx_RefNannySetupContext("_default_handle_error", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); else { PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_context); __Pyx_GIVEREF(__pyx_v_context); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); __Pyx_INCREF(__pyx_v_type); __Pyx_GIVEREF(__pyx_v_type); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); __Pyx_INCREF(__pyx_v_tb); __Pyx_GIVEREF(__pyx_v_tb); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; if (unlikely(type_dict_guard != tp_dict_version)) { tp_dict_version = obj_dict_version = 0; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP } #endif } __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_print_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_type); __Pyx_GIVEREF(__pyx_v_type); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value); __Pyx_INCREF(__pyx_v_tb); __Pyx_GIVEREF(__pyx_v_tb); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_v_self->_ptr != 0); if (__pyx_t_7) { ev_break(__pyx_v_self->_ptr, EVBREAK_ONE); } /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_tb = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_default_handle_error (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 1); __PYX_ERR(0, 554, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 2); __PYX_ERR(0, 554, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 3); __PYX_ERR(0, 554, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_default_handle_error") < 0)) __PYX_ERR(0, 554, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_context = values[0]; __pyx_v_type = values[1]; __pyx_v_value = values[2]; __pyx_v_tb = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 554, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_default_handle_error", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nowait = 0; PyObject *__pyx_v_once = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("run (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nowait,&__pyx_n_s_once,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_False); values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nowait); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_once); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 561, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nowait = values[0]; __pyx_v_once = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("run", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 561, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_14run(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_nowait, __pyx_v_once); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once) { unsigned int __pyx_v_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("run", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error) __pyx_v_flags = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nowait); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 564, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_flags = (__pyx_v_flags | EVRUN_NOWAIT); } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_once); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 566, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_flags = (__pyx_v_flags | EVRUN_ONCE); } { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { ev_run(__pyx_v_self->_ptr, __pyx_v_flags); } /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reinit (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("reinit", 0); __pyx_t_1 = (__pyx_v_self->_ptr != 0); if (__pyx_t_1) { ev_loop_fork(__pyx_v_self->_ptr); } /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ref (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_18ref(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("ref", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 576, __pyx_L1_error) ev_ref(__pyx_v_self->_ptr); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.ref", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unref (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_20unref(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("unref", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 580, __pyx_L1_error) ev_unref(__pyx_v_self->_ptr); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.unref", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_how; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("break_ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_how,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_how); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "break_") < 0)) __PYX_ERR(0, 583, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } if (values[0]) { __pyx_v_how = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_how == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L3_error) } else { __pyx_v_how = __pyx_k__9; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("break_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 583, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_22break_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_how); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("break_", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 584, __pyx_L1_error) ev_break(__pyx_v_self->_ptr, __pyx_v_how); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("verify (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_24verify(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("verify", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error) ev_verify(__pyx_v_self->_ptr); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.verify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static ev_tstamp __pyx_f_6gevent_5libev_8corecext_4loop_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) { ev_tstamp __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; ev_tstamp __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("now", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); else { PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_27now)) { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; if (unlikely(type_dict_guard != tp_dict_version)) { tp_dict_version = obj_dict_version = 0; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP } #endif } __pyx_t_6 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 592, __pyx_L1_error) __pyx_r = ev_now(__pyx_v_self->_ptr); goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("now (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_26now(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations ev_tstamp __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("now", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static void __pyx_f_6gevent_5libev_8corecext_4loop_update_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; __Pyx_RefNannySetupContext("update_now", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); else { PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now)) { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; if (unlikely(type_dict_guard != tp_dict_version)) { tp_dict_version = obj_dict_version = 0; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP } #endif } __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 596, __pyx_L1_error) ev_now_update(__pyx_v_self->_ptr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update_now (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("update_now", 0); __Pyx_XDECREF(__pyx_r); __pyx_f_6gevent_5libev_8corecext_4loop_update_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error) __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.loop.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); if ((__pyx_v_self->_ptr != 0)) { __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_False); __pyx_t_1 = Py_False; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.default.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_iteration(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.iteration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_depth(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_backend(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.backend_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self) { unsigned int __pyx_v_backend; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 627, __pyx_L1_error) __pyx_v_backend = ev_backend(__pyx_v_self->_ptr); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 629, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 629, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 629, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 629, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyObject_RichCompare(__pyx_v_key, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_value); __pyx_r = __pyx_v_value; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("gevent.libev.corecext.loop.backend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_pending_count(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.pendingcnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { vfd_socket_t __pyx_v_fd; int __pyx_v_events; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("io (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_True); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); __PYX_ERR(0, 639, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) __PYX_ERR(0, 639, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error) __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error) __pyx_v_ref = values[2]; __pyx_v_priority = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 639, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_32io(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("io", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_after; double __pyx_v_repeat; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("timer (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_True); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) __PYX_ERR(0, 642, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_after = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) if (values[1]) { __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) } else { __pyx_v_repeat = ((double)0.0); } __pyx_v_ref = values[2]; __pyx_v_priority = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 642, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_34timer(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("timer", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_after); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_timer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_signum; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("signal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signum)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal") < 0)) __PYX_ERR(0, 645, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_signum = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_signum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error) __pyx_v_ref = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("signal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 645, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_36signal(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_signum, __pyx_v_ref, __pyx_v_priority); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("signal", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_signum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_priority); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_signal), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("idle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_True); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idle") < 0)) __PYX_ERR(0, 648, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ref = values[0]; __pyx_v_priority = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("idle", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_38idle(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("idle", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_idle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prepare (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_True); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prepare") < 0)) __PYX_ERR(0, 651, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ref = values[0]; __pyx_v_priority = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("prepare", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 651, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("prepare", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_prepare), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_True); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ref = values[0]; __pyx_v_priority = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("check", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_42check(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("check", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_check), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fork (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_True); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fork") < 0)) __PYX_ERR(0, 657, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ref = values[0]; __pyx_v_priority = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fork", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 657, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_44fork(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("fork", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_fork), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("async_ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_True); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_") < 0)) __PYX_ERR(0, 660, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ref = values[0]; __pyx_v_priority = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("async_", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 660, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_46async_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async_(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("async_", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_pid; int __pyx_v_trace; PyObject *__pyx_v_ref = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("child (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "child") < 0)) __PYX_ERR(0, 666, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_pid = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) if (values[1]) { __pyx_v_trace = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) } else { __pyx_v_trace = ((int)0); } __pyx_v_ref = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("child", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_48child(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("child", 0); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 668, __pyx_L1_error) } __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_ref); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_child), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("install_sigchld (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("install_sigchld", 0); gevent_install_sigchld_handler(); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset_sigchld (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset_sigchld", 0); gevent_reset_sigchld_handler(); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_path = 0; float __pyx_v_interval; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_True); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stat") < 0)) __PYX_ERR(0, 677, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = ((PyObject*)values[0]); if (values[1]) { __pyx_v_interval = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L3_error) } else { __pyx_v_interval = ((float)0.0); } __pyx_v_ref = values[2]; __pyx_v_priority = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stat", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 677, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 677, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_54stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("stat", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_priority); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_stat), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("run_callback (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "run_callback") < 0)) __PYX_ERR(0, 680, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_func = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("run_callback", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 680, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) { struct PyGeventCallbackObject *__pyx_v_cb = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("run_callback", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 681, __pyx_L1_error) __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_cb = ((struct PyGeventCallbackObject *)__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(__pyx_v_self->_callbacks, __pyx_v_cb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ev_ref(__pyx_v_self->_ptr); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_cb)); __pyx_r = ((PyObject *)__pyx_v_cb); goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cb); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_format (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_58_format(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_v_msg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_format", 0); __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_destroyed); __pyx_r = __pyx_n_s_destroyed; goto __pyx_L0; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_msg = __pyx_t_2; __pyx_t_2 = 0; __pyx_t_1 = (__pyx_v_self->_default != 0); if (__pyx_t_1) { __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_default_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pendingcnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_pending_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format_details); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext.loop._format", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_format_details (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_v_msg = 0; PyObject *__pyx_v_fileno = 0; PyObject *__pyx_v_activecnt = 0; CYTHON_UNUSED PyObject *__pyx_v_sigfd = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("_format_details", 0); __Pyx_INCREF(__pyx_kp_s__7); __pyx_v_msg = __pyx_kp_s__7; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_fileno = __pyx_t_1; __pyx_t_1 = 0; __Pyx_INCREF(Py_None); __pyx_v_activecnt = Py_None; { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sigfd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sigfd = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_7) { __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 703, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_sigfd, Py_None); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L8_try_end:; } { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_activecnt, __pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_7) { __Pyx_ErrRestore(0,0,0); goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); goto __pyx_L1_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); __pyx_L16_try_end:; } __pyx_t_8 = (__pyx_v_activecnt != Py_None); __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { __pyx_t_3 = PyObject_Repr(__pyx_v_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Add(__pyx_kp_s_ref_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; } __pyx_t_9 = (__pyx_v_fileno != Py_None); __pyx_t_8 = (__pyx_t_9 != 0); if (__pyx_t_8) { __pyx_t_3 = PyObject_Repr(__pyx_v_fileno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Add(__pyx_kp_s_fileno_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_fileno); __Pyx_XDECREF(__pyx_v_activecnt); __Pyx_XDECREF(__pyx_v_sigfd); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fileno (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self) { int __pyx_v_fd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("fileno", 0); __pyx_t_1 = (__pyx_v_self->_ptr != 0); if (__pyx_t_1) { __pyx_v_fd = gevent_ev_loop_backend_fd(__pyx_v_self->_ptr); __pyx_t_1 = ((__pyx_v_fd >= 0) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } } /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_activecnt(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.activecnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_sig_pending(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.sig_pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; unsigned int __pyx_t_2; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_origflags_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(gevent_ev_loop_origflags(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self) { int __pyx_v_fd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error) __pyx_v_fd = gevent_ev_loop_sigfd(__pyx_v_self->_ptr); __pyx_t_1 = ((__pyx_v_fd >= 0) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 749, __pyx_L1_error) /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.loop.sigfd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->error_handler); __pyx_r = __pyx_v_self->error_handler; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->error_handler); __Pyx_DECREF(__pyx_v_self->error_handler); __pyx_v_self->error_handler = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->error_handler); __Pyx_DECREF(__pyx_v_self->error_handler); __pyx_v_self->error_handler = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_callbacks)); __pyx_r = ((PyObject *)__pyx_v_self->_callbacks); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO))))) __PYX_ERR(0, 386, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_callbacks); __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop._callbacks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_callbacks); __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(((struct PyGeventLoopObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(struct PyGeventLoopObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->approx_timer_resolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.loop.approx_timer_resolution.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static void __pyx_f_6gevent_5libev_8corecext__python_incref(struct PyGeventWatcherObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_python_incref", 0); __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); if (__pyx_t_1) { Py_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); } /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_f_6gevent_5libev_8corecext__python_decref(struct PyGeventWatcherObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_python_decref", 0); __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); if (__pyx_t_1) { Py_DECREF(((PyObject *)__pyx_v_self)); __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); } /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_f_6gevent_5libev_8corecext__libev_ref(struct PyGeventWatcherObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_libev_ref", 0); __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); if (__pyx_t_1) { ev_ref(__pyx_v_self->loop->_ptr); __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); } /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_f_6gevent_5libev_8corecext__libev_unref(struct PyGeventWatcherObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_libev_unref", 0); __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); if (__pyx_t_1) { ev_unref(__pyx_v_self->loop->_ptr); __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); } /* function exit code */ __Pyx_RefNannyFinishContext(); } static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_f_6gevent_5libev_8corecext_make_ss(void *__pyx_v_start, void *__pyx_v_stop) { struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_result; struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_r; __Pyx_RefNannyDeclarations struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_t_1; __Pyx_RefNannySetupContext("make_ss", 0); __pyx_t_1.start = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_start); __pyx_t_1.stop = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_stop); __pyx_v_result = __pyx_t_1; __pyx_r = __pyx_v_result; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_f_6gevent_5libev_8corecext__watcher_start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_watcher_start", 0); __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_callback == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 818, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_2)) { __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_callback); __Pyx_GIVEREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback); __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 819, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_callback); __Pyx_GIVEREF(__pyx_v_callback); __Pyx_GOTREF(__pyx_v_self->_callback); __Pyx_DECREF(__pyx_v_self->_callback); __pyx_v_self->_callback = __pyx_v_callback; __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = __pyx_v_args; __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self); __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self); __pyx_v_self->__pyx___ss->start(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher); __pyx_r = 1; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext._watcher_start", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyGeventLoopObject *__pyx_v_loop = 0; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 872, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_ref = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 872, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 872, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(struct PyGeventWatcherObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; __Pyx_RefNannySetupContext("__init__", 0); __pyx_t_2 = ((!(__pyx_v_self->__pyx___watcher != 0)) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->start != 0)) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->stop != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 874, __pyx_L1_error) } __Pyx_INCREF(((PyObject *)__pyx_v_loop)); __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); __Pyx_GOTREF(__pyx_v_self->loop); __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); __pyx_v_self->loop = __pyx_v_loop; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 876, __pyx_L1_error) if (__pyx_t_1) { __pyx_t_4 = 0; } else { __pyx_t_4 = 4; } __pyx_v_self->_flags = __pyx_t_4; __pyx_t_1 = (__pyx_v_priority != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L1_error) ev_set_priority(__pyx_v_self->__pyx___watcher, __pyx_t_5); } /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); if (((__pyx_v_self->_flags & 4) != 0)) { __Pyx_INCREF(Py_False); __pyx_t_1 = Py_False; } else { __Pyx_INCREF(Py_True); __pyx_t_1 = Py_True; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 887, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { __pyx_r = 0; goto __pyx_L0; } __pyx_t_2 = ((__pyx_v_self->_flags & 2) != 0); if (__pyx_t_2) { ev_ref(__pyx_v_self->loop->_ptr); } __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); goto __pyx_L3; } /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); __pyx_t_2 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } __pyx_t_2 = (ev_is_active(__pyx_v_self->__pyx___watcher) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L8_bool_binop_done:; if (__pyx_t_3) { ev_unref(__pyx_v_self->loop->_ptr); __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); } } __pyx_L3:; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.watcher.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_callback); __pyx_r = __pyx_v_self->_callback; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_2 = (__pyx_v_callback != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 911, __pyx_L1_error) __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_callback); __Pyx_GIVEREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 912, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_callback); __Pyx_GIVEREF(__pyx_v_callback); __Pyx_GOTREF(__pyx_v_self->_callback); __Pyx_DECREF(__pyx_v_self->_callback); __pyx_v_self->_callback = __pyx_v_callback; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.watcher.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority(__pyx_v_self->__pyx___watcher)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { int __pyx_v_priority; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_priority); { __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((int)__pyx_v_priority)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_priority) { struct ev_watcher *__pyx_v_w; int __pyx_r; __Pyx_RefNannyDeclarations struct ev_watcher *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __pyx_v_self->__pyx___watcher; __pyx_v_w = __pyx_t_1; __pyx_t_2 = (ev_is_active(__pyx_v_w) != 0); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 923, __pyx_L1_error) } ev_set_priority(__pyx_v_w, __pyx_v_priority); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); if ((ev_is_active(__pyx_v_self->__pyx___watcher) != 0)) { __Pyx_INCREF(Py_True); __pyx_t_1 = Py_True; } else { __Pyx_INCREF(Py_False); __pyx_t_1 = Py_False; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); if ((ev_is_pending(__pyx_v_self->__pyx___watcher) != 0)) { __Pyx_INCREF(Py_True); __pyx_t_1 = Py_True; } else { __Pyx_INCREF(Py_False); __pyx_t_1 = Py_False; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 934, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_callback = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 934, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_2start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("start", 0); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(__pyx_v_self, __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 935, __pyx_L1_error) /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("stop", 0); __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_f_6gevent_5libev_8corecext__libev_ref(__pyx_v_self); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_callback); __Pyx_DECREF(__pyx_v_self->_callback); __pyx_v_self->_callback = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = ((PyObject*)Py_None); __pyx_v_self->__pyx___ss->stop(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher); __pyx_f_6gevent_5libev_8corecext__python_decref(__pyx_v_self); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.watcher.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_revents; PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("feed (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 2) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 947, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 947, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L3_error) __pyx_v_callback = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 947, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("feed", 0); __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = __pyx_v_args; __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self); ev_feed_event(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher, __pyx_v_revents); __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_v_format = NULL; PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; char const *__pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s__5); __pyx_r = __pyx_kp_s__5; goto __pyx_L0; } /*try:*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_format = __pyx_t_2; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 961, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_active_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 963, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; } __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None)); __pyx_t_1 = (__pyx_t_5 != 0); if (__pyx_t_1) { __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->args); __Pyx_GIVEREF(__pyx_v_self->args); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->args); __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; } __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L4_return; } /*finally:*/ { __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; { Py_ReprLeave(((PyObject *)__pyx_v_self)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); } __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; goto __pyx_L1_error; } __pyx_L4_return: { __pyx_t_14 = __pyx_r; __pyx_r = 0; Py_ReprLeave(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_t_14; __pyx_t_14 = 0; goto __pyx_L0; } } /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext.watcher.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_format (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_format", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s__7); __pyx_r = __pyx_kp_s__7; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_12close(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_12close(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("close", 0); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.watcher.close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_t = 0; CYTHON_UNUSED PyObject *__pyx_v_v = 0; CYTHON_UNUSED PyObject *__pyx_v_tb = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 982, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 982, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 982, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_t = values[0]; __pyx_v_v = values[1]; __pyx_v_tb = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 982, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(struct PyGeventWatcherObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__exit__", 0); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); __pyx_r = ((PyObject *)__pyx_v_self->loop); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 830, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->loop); __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.watcher.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(struct PyGeventWatcherObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->loop); __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->args); __pyx_r = __pyx_v_self->args; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.watcher.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(struct PyGeventWatcherObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = ((PyObject*)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(struct PyGeventWatcherObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.watcher._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_pass_events = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_pass_events,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); if (value) { values[index] = value; kw_args--; } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 992, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_callback = values[0]; __pyx_v_pass_events = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 992, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_start(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_pass_events, __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("start", 0); __Pyx_INCREF(__pyx_v_args); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pass_events); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 993, __pyx_L1_error) if (__pyx_t_1) { __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(GEVENT_CORE_EVENTS); __Pyx_GIVEREF(GEVENT_CORE_EVENTS); PyTuple_SET_ITEM(__pyx_t_2, 0, GEVENT_CORE_EVENTS); __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; } __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 995, __pyx_L1_error) /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED vfd_socket_t __pyx_v_fd; CYTHON_UNUSED int __pyx_v_events; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 997, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 997, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 997, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error) __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error) __pyx_v_ref = values[3]; __pyx_v_priority = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 997, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 997, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED vfd_socket_t __pyx_v_fd, CYTHON_UNUSED int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_v_loop)); __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; vfd_socket_t __pyx_v_fd; int __pyx_v_events; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 1000, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 1000, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1000, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error) __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error) __pyx_v_ref = values[3]; __pyx_v_priority = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1000, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1000, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(struct PyGeventIOObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { int __pyx_v_vfd; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; __Pyx_RefNannySetupContext("__cinit__", 0); __pyx_t_1 = ((__pyx_v_fd < 0) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fd_must_be_non_negative_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 1002, __pyx_L1_error) } __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 1004, __pyx_L1_error) } __pyx_t_4 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1006, __pyx_L1_error) __pyx_v_vfd = __pyx_t_4; ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_events); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_io_ss); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(((struct PyGeventIOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(struct PyGeventIOObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); vfd_free(__pyx_v_self->_watcher.fd); /* function exit code */ __Pyx_RefNannyFinishContext(); } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(((struct PyGeventIOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(vfd_get(__pyx_v_self->_watcher.fd)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) { long __pyx_v_fd; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_fd); { __pyx_v_fd = __Pyx_PyInt_As_long(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((long)__pyx_v_fd)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd) { int __pyx_v_vfd; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 1021, __pyx_L1_error) } __pyx_t_3 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1022, __pyx_L1_error) __pyx_v_vfd = __pyx_t_3; vfd_free(__pyx_v_self->_watcher.fd); ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_self->_watcher.events); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(((struct PyGeventIOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.io.events.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events) { int __pyx_v_events; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_events); { __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_events)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 1033, __pyx_L1_error) } ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_self->_watcher.fd, __pyx_v_events); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(((struct PyGeventIOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_self->_watcher.events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.io.events_str.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_format (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8_format(((struct PyGeventIOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_format", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_events_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fd_s_events_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.io._format", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; double __pyx_v_after; double __pyx_v_repeat; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1049, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); if (values[1]) { __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error) } else { __pyx_v_after = ((double)0.0); } if (values[2]) { __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error) } else { __pyx_v_repeat = ((double)0.0); } __pyx_v_ref = values[3]; __pyx_v_priority = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1049, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1049, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(struct PyGeventTimerObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); __pyx_t_1 = ((__pyx_v_repeat < 0.0) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 1051, __pyx_L1_error) } ev_timer_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_timer), __pyx_v_after, __pyx_v_repeat); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_timer_ss); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED double __pyx_v_after; CYTHON_UNUSED double __pyx_v_repeat; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1056, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); if (values[1]) { __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error) } else { __pyx_v_after = ((double)0.0); } if (values[2]) { __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error) } else { __pyx_v_repeat = ((double)0.0); } __pyx_v_ref = values[3]; __pyx_v_priority = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1056, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED double __pyx_v_after, CYTHON_UNUSED double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_v_loop)); __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_update = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); if (value) { values[index] = value; kw_args--; } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1059, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_callback = values[0]; __pyx_v_update = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1059, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4start(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("start", 0); __Pyx_INCREF(__pyx_v_update); __pyx_t_2 = (__pyx_v_update != Py_None); if ((__pyx_t_2 != 0)) { __Pyx_INCREF(__pyx_v_update); __pyx_t_1 = __pyx_v_update; } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.loop->starting_timer_may_update_loop_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_update, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) if (__pyx_t_2) { ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_base.loop->__pyx_vtab)->update_now(__pyx_v_self->__pyx_base.loop, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1062, __pyx_L1_error) } __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1063, __pyx_L1_error) /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_update); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(((struct PyGeventTimerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.at); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.timer.at.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_update = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("again (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); if (value) { values[index] = value; kw_args--; } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "again") < 0)) __PYX_ERR(0, 1071, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_callback = values[0]; __pyx_v_update = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("again", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1071, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_6again(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("again", 0); __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); __Pyx_GOTREF(__pyx_v_self->__pyx_base.args); __Pyx_DECREF(__pyx_v_self->__pyx_base.args); __pyx_v_self->__pyx_base.args = __pyx_v_args; __pyx_f_6gevent_5libev_8corecext__libev_unref(((struct PyGeventWatcherObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1076, __pyx_L1_error) if (__pyx_t_2) { ev_now_update(__pyx_v_self->__pyx_base.loop->_ptr); } ev_timer_again(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher)); __pyx_f_6gevent_5libev_8corecext__python_incref(((struct PyGeventWatcherObject *)__pyx_v_self)); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; int __pyx_v_signalnum; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_True); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1089, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1089, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L3_error) __pyx_v_ref = values[2]; __pyx_v_priority = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1089, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1089, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(struct PyGeventSignalObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); __pyx_t_2 = ((__pyx_v_signalnum < 1) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_signalmodule); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NSIG); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_illegal_signal_number_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 1091, __pyx_L1_error) } ev_signal_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_signal), __pyx_v_signalnum); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_signal_ss); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED int __pyx_v_signalnum; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_True); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1101, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1101, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1101, __pyx_L3_error) __pyx_v_ref = values[2]; __pyx_v_priority = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1101, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1101, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_v_loop)); __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1112, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_ref = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1112, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.idle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1112, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(struct PyGeventIdleObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); ev_idle_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_idle)); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_idle_ss); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1125, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_ref = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1125, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.prepare.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1125, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(struct PyGeventPrepareObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); ev_prepare_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_prepare)); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_prepare_ss); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1138, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_ref = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1138, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.check.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1138, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(struct PyGeventCheckObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); ev_check_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_check)); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_check_ss); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1151, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_ref = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1151, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.fork.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1151, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(struct PyGeventForkObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); ev_fork_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_fork)); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_fork_ss); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(struct PyGeventAsyncObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); if ((ev_async_pending((&__pyx_v_self->_watcher)) != 0)) { __Pyx_INCREF(Py_True); __pyx_t_1 = Py_True; } else { __Pyx_INCREF(Py_False); __pyx_t_1 = Py_False; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1168, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_ref = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1168, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.async_.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1168, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(struct PyGeventAsyncObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); ev_async_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_async)); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_async_ss); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("send (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__2send(((struct PyGeventAsyncObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__2send(struct PyGeventAsyncObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("send", 0); __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; ev_async_send(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher)); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.async_.send", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyGeventLoopObject *__pyx_v_loop = 0; int __pyx_v_pid; int __pyx_v_trace; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1186, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1186, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error) if (values[2]) { __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error) } else { __pyx_v_trace = ((int)0); } __pyx_v_ref = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1186, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1186, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, CYTHON_UNUSED PyObject *__pyx_v_ref) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 1188, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_loop), __pyx_n_s_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (unlikely(__pyx_t_4)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 1190, __pyx_L1_error) } gevent_install_sigchld_handler(); ev_child_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_child), __pyx_v_pid, __pyx_v_trace); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_child_ss); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED int __pyx_v_pid; CYTHON_UNUSED int __pyx_v_trace; PyObject *__pyx_v_ref = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1196, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1196, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error) if (values[2]) { __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error) } else { __pyx_v_trace = ((int)0); } __pyx_v_ref = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1196, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1196, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_pid, CYTHON_UNUSED int __pyx_v_trace, PyObject *__pyx_v_ref) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_v_loop)); __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, Py_None); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_format (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4_format(((struct PyGeventChildObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4_format(struct PyGeventChildObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_format", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_pid_r_rstatus_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("gevent.libev.corecext.child._format", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(((struct PyGeventChildObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.child.pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(((struct PyGeventChildObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { int __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1212, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __pyx_v_self->_watcher.rpid = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(((struct PyGeventChildObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rstatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { int __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __pyx_v_self->_watcher.rstatus = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; PyObject *__pyx_v_path = 0; float __pyx_v_interval; CYTHON_UNUSED PyObject *__pyx_v_ref = 0; CYTHON_UNUSED PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, 1); __PYX_ERR(0, 1231, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1231, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_path = ((PyObject*)values[1]); if (values[2]) { __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error) } else { __pyx_v_interval = ((float)0.0); } __pyx_v_ref = values[3]; __pyx_v_priority = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1231, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1231, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1231, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(struct PyGeventStatObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { PyObject *__pyx_v_paths = 0; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; char *__pyx_t_8; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); __Pyx_GOTREF(__pyx_v_self->path); __Pyx_DECREF(__pyx_v_self->path); __pyx_v_self->path = __pyx_v_path; __pyx_t_1 = PyUnicode_Check(__pyx_v_path); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1238, __pyx_L1_error) __pyx_v_paths = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_v_paths); __Pyx_GIVEREF(__pyx_v_paths); __Pyx_GOTREF(__pyx_v_self->_paths); __Pyx_DECREF(__pyx_v_self->_paths); __pyx_v_self->_paths = __pyx_v_paths; goto __pyx_L3; } /*else*/ { __pyx_t_3 = __pyx_v_path; __Pyx_INCREF(__pyx_t_3); __pyx_v_paths = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_v_paths); __Pyx_GIVEREF(__pyx_v_paths); __Pyx_GOTREF(__pyx_v_self->_paths); __Pyx_DECREF(__pyx_v_self->_paths); __pyx_v_self->_paths = __pyx_v_paths; } __pyx_L3:; if (unlikely(__pyx_v_paths == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(0, 1243, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_paths); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1243, __pyx_L1_error) ev_stat_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_stat), ((char *)__pyx_t_8), __pyx_v_interval); __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_stat_ss); /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_paths); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyGeventLoopObject *__pyx_v_loop = 0; CYTHON_UNUSED PyObject *__pyx_v_path = 0; CYTHON_UNUSED float __pyx_v_interval; PyObject *__pyx_v_ref = 0; PyObject *__pyx_v_priority = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 1247, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1247, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); __pyx_v_path = ((PyObject*)values[1]); if (values[2]) { __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L3_error) } else { __pyx_v_interval = ((float)0.0); } __pyx_v_ref = values[3]; __pyx_v_priority = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1247, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1247, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1247, __pyx_L1_error) __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_v_loop)); __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); __Pyx_INCREF(__pyx_v_ref); __Pyx_GIVEREF(__pyx_v_ref); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); __Pyx_INCREF(__pyx_v_priority); __Pyx_GIVEREF(__pyx_v_priority); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(((struct PyGeventStatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = ((!(__pyx_v_self->_watcher.attr.st_nlink != 0)) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __Pyx_XDECREF(__pyx_r); __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.attr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.stat.attr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(((struct PyGeventStatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_t_1 = ((!(__pyx_v_self->_watcher.prev.st_nlink != 0)) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __Pyx_XDECREF(__pyx_r); __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.prev)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("gevent.libev.corecext.stat.prev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(((struct PyGeventStatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.stat.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(((struct PyGeventStatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->path); __pyx_r = __pyx_v_self->path; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(((struct PyGeventStatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_paths); __pyx_r = __pyx_v_self->_paths; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *__pyx_v_msg) { PyObject *__pyx_v_print_exc = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_syserr_cb", 0); { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1274, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /*except:*/ { __Pyx_AddTraceback("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 1275, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_traceback); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_s_print_exc, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_print_exc = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_11 = (__pyx_v_print_exc != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { __Pyx_INCREF(__pyx_v_print_exc); __pyx_t_7 = __pyx_v_print_exc; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L4_exception_handled; } __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_WriteUnraisable("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_print_exc); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *__pyx_v_callback, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("set_syserr_cb", 0); __pyx_t_1 = (__pyx_v_callback == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { ev_set_syserr_cb(NULL); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1286, __pyx_L1_error) goto __pyx_L3; } __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1287, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (likely(__pyx_t_1)) { ev_set_syserr_cb(((void *)__pyx_f_6gevent_5libev_8corecext__syserr_cb)); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, __pyx_v_callback) < 0) __PYX_ERR(0, 1289, __pyx_L1_error) goto __pyx_L3; } /*else*/ { __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_callback); __Pyx_GIVEREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 1291, __pyx_L1_error) } __pyx_L3:; /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_syserr_cb (wrapper)", 0); __pyx_r = __pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(__pyx_self, ((PyObject *)__pyx_v_callback)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("set_syserr_cb", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_v_callback, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } void gevent_handle_error(struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_context) { PyObject *__pyx_v_typep; PyObject *__pyx_v_valuep; PyObject *__pyx_v_tracebackp; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_traceback = 0; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("gevent_handle_error", 0); __Pyx_INCREF(Py_None); __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); __pyx_v_traceback = Py_None; PyErr_Fetch((&__pyx_v_typep), (&__pyx_v_valuep), (&__pyx_v_tracebackp)); __pyx_t_1 = ((!(__pyx_v_typep != 0)) != 0); if (__pyx_t_1) { goto __pyx_L0; } __pyx_t_2 = ((PyObject *)__pyx_v_typep); __Pyx_INCREF(__pyx_t_2); __pyx_v_type = __pyx_t_2; __pyx_t_2 = 0; Py_DECREF(__pyx_v_type); __pyx_t_1 = (__pyx_v_valuep != 0); if (__pyx_t_1) { __pyx_t_2 = ((PyObject *)__pyx_v_valuep); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; Py_DECREF(__pyx_v_value); } __pyx_t_1 = (__pyx_v_tracebackp != 0); if (__pyx_t_1) { __pyx_t_2 = ((PyObject *)__pyx_v_tracebackp); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_traceback, __pyx_t_2); __pyx_t_2 = 0; Py_DECREF(__pyx_v_traceback); } __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->handle_error(__pyx_v_loop, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_traceback, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_WriteUnraisable("gevent.libev.corecext.gevent_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_type); __Pyx_XDECREF(__pyx_v_value); __Pyx_XDECREF(__pyx_v_traceback); __Pyx_RefNannyFinishContext(); } PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *__pyx_v_loop) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("gevent_loop_run_callbacks", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->_run_callbacks(__pyx_v_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("gevent.libev.corecext.gevent_loop_run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_6gevent_5libev_8corecext__EVENTSType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_6gevent_5libev_8corecext__EVENTSType(PyObject *o) { #if CYTHON_USE_TP_FINALIZE 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))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext__EVENTSType[] = { {0, 0, 0, 0} }; static PyTypeObject __pyx_type_6gevent_5libev_8corecext__EVENTSType = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext._EVENTSType", /*tp_name*/ sizeof(struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext__EVENTSType, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext__EVENTSType, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext__EVENTSType, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_callback(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct PyGeventCallbackObject *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct PyGeventCallbackObject *)o); p->callback = Py_None; Py_INCREF(Py_None); p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); p->next = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_6gevent_5libev_8corecext_callback(PyObject *o) { struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->callback); Py_CLEAR(p->args); Py_CLEAR(p->next); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_6gevent_5libev_8corecext_callback(PyObject *o, visitproc v, void *a) { int e; struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; if (p->callback) { e = (*v)(p->callback, a); if (e) return e; } if (p->args) { e = (*v)(p->args, a); if (e) return e; } if (p->next) { e = (*v)(((PyObject *)p->next), a); if (e) return e; } return 0; } static int __pyx_tp_clear_6gevent_5libev_8corecext_callback(PyObject *o) { PyObject* tmp; struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; tmp = ((PyObject*)p->callback); p->callback = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->args); p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->next); p->next = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_pending(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_callback(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_8callback_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(o, v); } else { return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(o); } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_args(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_8callback_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(o, v); } else { return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(o); } } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_callback[] = { {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_8callback_3stop, METH_NOARGS, 0}, {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_8callback_9_format, METH_NOARGS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_callback[] = { {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_8callback_pending, 0, (char *)0, 0}, {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_8callback_callback, __pyx_setprop_6gevent_5libev_8corecext_8callback_callback, (char *)0, 0}, {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_8callback_args, __pyx_setprop_6gevent_5libev_8corecext_8callback_args, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_callback = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; DL_EXPORT(PyTypeObject) PyGeventCallback_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.callback", /*tp_name*/ sizeof(struct PyGeventCallbackObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_callback, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__, /*tp_repr*/ &__pyx_tp_as_number_callback, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_callback, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_callback, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_callback, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6gevent_5libev_8corecext_callback, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_callback, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p; PyObject *o; o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o); p->__pyx_vtab = __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO; p->head = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); p->tail = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o) { struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->head); Py_CLEAR(p->tail); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; if (p->head) { e = (*v)(((PyObject *)p->head), a); if (e) return e; } if (p->tail) { e = (*v)(((PyObject *)p->tail), a); if (e) return e; } return 0; } static int __pyx_tp_clear_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o) { PyObject* tmp; struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; tmp = ((PyObject*)p->head); p->head = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->tail); p->tail = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_CallbackFIFO[] = { {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_CallbackFIFO = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_CallbackFIFO = { __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_CallbackFIFO = { __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_6gevent_5libev_8corecext_CallbackFIFO = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.CallbackFIFO", /*tp_name*/ sizeof(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_CallbackFIFO, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__, /*tp_repr*/ &__pyx_tp_as_number_CallbackFIFO, /*tp_as_number*/ &__pyx_tp_as_sequence_CallbackFIFO, /*tp_as_sequence*/ &__pyx_tp_as_mapping_CallbackFIFO, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_CallbackFIFO, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_CallbackFIFO, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_CallbackFIFO, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop __pyx_vtable_6gevent_5libev_8corecext_loop; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_loop(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyGeventLoopObject *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct PyGeventLoopObject *)o); p->__pyx_vtab = __pyx_vtabptr_6gevent_5libev_8corecext_loop; p->error_handler = Py_None; Py_INCREF(Py_None); p->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_6gevent_5libev_8corecext_loop(PyObject *o) { struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->error_handler); Py_CLEAR(p->_callbacks); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_6gevent_5libev_8corecext_loop(PyObject *o, visitproc v, void *a) { int e; struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; if (p->error_handler) { e = (*v)(p->error_handler, a); if (e) return e; } if (p->_callbacks) { e = (*v)(((PyObject *)p->_callbacks), a); if (e) return e; } return 0; } static int __pyx_tp_clear_6gevent_5libev_8corecext_loop(PyObject *o) { PyObject* tmp; struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; tmp = ((PyObject*)p->error_handler); p->error_handler = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_callbacks); p->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_ptr(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_WatcherType(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_MAXPRI(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_MINPRI(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_default(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_iteration(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_depth(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_backend_int(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_backend(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_pendingcnt(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_activecnt(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_sig_pending(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_origflags(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_origflags_int(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_sigfd(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_error_handler(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_4loop_error_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(o, v); } else { return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(o); } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop__callbacks(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_4loop__callbacks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(o, v); } else { return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(o); } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_approx_timer_resolution(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(o); } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_loop[] = { {"destroy", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy, METH_NOARGS, 0}, {"_handle_syserr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr, METH_VARARGS|METH_KEYWORDS, 0}, {"handle_error", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error, METH_VARARGS|METH_KEYWORDS, 0}, {"_default_handle_error", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error, METH_VARARGS|METH_KEYWORDS, 0}, {"run", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_15run, METH_VARARGS|METH_KEYWORDS, 0}, {"reinit", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit, METH_NOARGS, 0}, {"ref", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_19ref, METH_NOARGS, 0}, {"unref", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_21unref, METH_NOARGS, 0}, {"break_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_23break_, METH_VARARGS|METH_KEYWORDS, 0}, {"verify", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_25verify, METH_NOARGS, 0}, {"now", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_27now, METH_NOARGS, 0}, {"update_now", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now, METH_NOARGS, 0}, {"io", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_33io, METH_VARARGS|METH_KEYWORDS, 0}, {"timer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_35timer, METH_VARARGS|METH_KEYWORDS, 0}, {"signal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_37signal, METH_VARARGS|METH_KEYWORDS, 0}, {"idle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_39idle, METH_VARARGS|METH_KEYWORDS, 0}, {"prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare, METH_VARARGS|METH_KEYWORDS, 0}, {"check", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_43check, METH_VARARGS|METH_KEYWORDS, 0}, {"fork", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_45fork, METH_VARARGS|METH_KEYWORDS, 0}, {"async_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_47async_, METH_VARARGS|METH_KEYWORDS, 0}, {"child", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_49child, METH_VARARGS|METH_KEYWORDS, 0}, {"install_sigchld", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld, METH_NOARGS, 0}, {"reset_sigchld", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld, METH_NOARGS, 0}, {"stat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_55stat, METH_VARARGS|METH_KEYWORDS, 0}, {"run_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback, METH_VARARGS|METH_KEYWORDS, 0}, {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_59_format, METH_NOARGS, 0}, {"_format_details", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details, METH_NOARGS, 0}, {"fileno", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno, METH_NOARGS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_loop[] = { {(char *)"ptr", __pyx_getprop_6gevent_5libev_8corecext_4loop_ptr, 0, (char *)0, 0}, {(char *)"WatcherType", __pyx_getprop_6gevent_5libev_8corecext_4loop_WatcherType, 0, (char *)0, 0}, {(char *)"MAXPRI", __pyx_getprop_6gevent_5libev_8corecext_4loop_MAXPRI, 0, (char *)0, 0}, {(char *)"MINPRI", __pyx_getprop_6gevent_5libev_8corecext_4loop_MINPRI, 0, (char *)0, 0}, {(char *)"default", __pyx_getprop_6gevent_5libev_8corecext_4loop_default, 0, (char *)0, 0}, {(char *)"iteration", __pyx_getprop_6gevent_5libev_8corecext_4loop_iteration, 0, (char *)0, 0}, {(char *)"depth", __pyx_getprop_6gevent_5libev_8corecext_4loop_depth, 0, (char *)0, 0}, {(char *)"backend_int", __pyx_getprop_6gevent_5libev_8corecext_4loop_backend_int, 0, (char *)0, 0}, {(char *)"backend", __pyx_getprop_6gevent_5libev_8corecext_4loop_backend, 0, (char *)0, 0}, {(char *)"pendingcnt", __pyx_getprop_6gevent_5libev_8corecext_4loop_pendingcnt, 0, (char *)0, 0}, {(char *)"activecnt", __pyx_getprop_6gevent_5libev_8corecext_4loop_activecnt, 0, (char *)0, 0}, {(char *)"sig_pending", __pyx_getprop_6gevent_5libev_8corecext_4loop_sig_pending, 0, (char *)0, 0}, {(char *)"origflags", __pyx_getprop_6gevent_5libev_8corecext_4loop_origflags, 0, (char *)0, 0}, {(char *)"origflags_int", __pyx_getprop_6gevent_5libev_8corecext_4loop_origflags_int, 0, (char *)0, 0}, {(char *)"sigfd", __pyx_getprop_6gevent_5libev_8corecext_4loop_sigfd, 0, (char *)0, 0}, {(char *)"error_handler", __pyx_getprop_6gevent_5libev_8corecext_4loop_error_handler, __pyx_setprop_6gevent_5libev_8corecext_4loop_error_handler, (char *)0, 0}, {(char *)"_callbacks", __pyx_getprop_6gevent_5libev_8corecext_4loop__callbacks, __pyx_setprop_6gevent_5libev_8corecext_4loop__callbacks, (char *)0, 0}, {(char *)"approx_timer_resolution", __pyx_getprop_6gevent_5libev_8corecext_4loop_approx_timer_resolution, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventLoop_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.loop", /*tp_name*/ sizeof(struct PyGeventLoopObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_loop, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_loop, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_loop, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_loop, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6gevent_5libev_8corecext_loop, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_loop, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_watcher(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct PyGeventWatcherObject *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct PyGeventWatcherObject *)o); p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); p->_callback = Py_None; Py_INCREF(Py_None); p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(PyObject *o) { struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->loop); Py_CLEAR(p->_callback); Py_CLEAR(p->args); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_6gevent_5libev_8corecext_watcher(PyObject *o, visitproc v, void *a) { int e; struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; if (p->loop) { e = (*v)(((PyObject *)p->loop), a); if (e) return e; } if (p->_callback) { e = (*v)(p->_callback, a); if (e) return e; } if (p->args) { e = (*v)(p->args, a); if (e) return e; } return 0; } static int __pyx_tp_clear_6gevent_5libev_8corecext_watcher(PyObject *o) { PyObject* tmp; struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; tmp = ((PyObject*)p->loop); p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_callback); p->_callback = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->args); p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_ref(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_callback(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_priority(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_active(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_pending(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_loop(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(o, v); } else { return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(o); } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_args(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(o, v); } else { return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(o); } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher__flags(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(o); } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_watcher[] = { {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_3start, METH_VARARGS|METH_KEYWORDS, 0}, {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop, METH_NOARGS, 0}, {"feed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed, METH_VARARGS|METH_KEYWORDS, 0}, {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format, METH_NOARGS, 0}, {"close", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_13close, METH_NOARGS, 0}, {"__enter__", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__, METH_NOARGS, 0}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_watcher[] = { {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_7watcher_ref, __pyx_setprop_6gevent_5libev_8corecext_7watcher_ref, (char *)0, 0}, {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_7watcher_callback, __pyx_setprop_6gevent_5libev_8corecext_7watcher_callback, (char *)0, 0}, {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_7watcher_priority, __pyx_setprop_6gevent_5libev_8corecext_7watcher_priority, (char *)0, 0}, {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_7watcher_active, 0, (char *)0, 0}, {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_7watcher_pending, 0, (char *)0, 0}, {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_7watcher_loop, __pyx_setprop_6gevent_5libev_8corecext_7watcher_loop, (char *)0, 0}, {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_7watcher_args, __pyx_setprop_6gevent_5libev_8corecext_7watcher_args, (char *)0, 0}, {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_7watcher__flags, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventWatcher_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.watcher", /*tp_name*/ sizeof(struct PyGeventWatcherObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "Abstract base class for all the watchers", /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_watcher, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6gevent_5libev_8corecext_watcher, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_watcher, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_6gevent_5libev_8corecext_io(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } PyObject_GC_Track(o); __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_fd(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_2io_fd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_events(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_2io_events(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_events_str(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(o); } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_io[] = { {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_2io_1start, METH_VARARGS|METH_KEYWORDS, 0}, {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_2io_9_format, METH_NOARGS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_io[] = { {(char *)"fd", __pyx_getprop_6gevent_5libev_8corecext_2io_fd, __pyx_setprop_6gevent_5libev_8corecext_2io_fd, (char *)0, 0}, {(char *)"events", __pyx_getprop_6gevent_5libev_8corecext_2io_events, __pyx_setprop_6gevent_5libev_8corecext_2io_events, (char *)0, 0}, {(char *)"events_str", __pyx_getprop_6gevent_5libev_8corecext_2io_events_str, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventIO_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.io", /*tp_name*/ sizeof(struct PyGeventIOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_io, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_io, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6gevent_5libev_8corecext_io, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_2io_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_io, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_at(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(o); } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_timer[] = { {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_5timer_5start, METH_VARARGS|METH_KEYWORDS, 0}, {"again", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_5timer_7again, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_timer[] = { {(char *)"at", __pyx_getprop_6gevent_5libev_8corecext_5timer_at, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventTimer_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.timer", /*tp_name*/ sizeof(struct PyGeventTimerObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_timer, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6gevent_5libev_8corecext_timer, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_timer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_signal[] = { {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventSignal_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.signal", /*tp_name*/ sizeof(struct PyGeventSignalObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_signal, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_signal, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_idle[] = { {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventIdle_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.idle", /*tp_name*/ sizeof(struct PyGeventIdleObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_idle, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ #else 0, /*tp_init*/ #endif 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_idle, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_prepare[] = { {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventPrepare_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.prepare", /*tp_name*/ sizeof(struct PyGeventPrepareObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_prepare, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ #else 0, /*tp_init*/ #endif 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_prepare, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_check[] = { {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventCheck_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.check", /*tp_name*/ sizeof(struct PyGeventCheckObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_check, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ #else 0, /*tp_init*/ #endif 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_check, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_fork[] = { {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventFork_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.fork", /*tp_name*/ sizeof(struct PyGeventForkObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_fork, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ #else 0, /*tp_init*/ #endif 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_fork, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_async_(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6async__pending(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(o); } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_async_[] = { {"send", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_6async__3send, METH_NOARGS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_async_[] = { {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_6async__pending, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventAsync_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.async_", /*tp_name*/ sizeof(struct PyGeventAsyncObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_async_, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6gevent_5libev_8corecext_async_, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ #else 0, /*tp_init*/ #endif 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_async_, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_pid(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_rpid(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_5child_rpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_rstatus(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(o); } static int __pyx_setprop_6gevent_5libev_8corecext_5child_rstatus(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_child[] = { {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5child_5_format, METH_NOARGS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_child[] = { {(char *)"pid", __pyx_getprop_6gevent_5libev_8corecext_5child_pid, 0, (char *)0, 0}, {(char *)"rpid", __pyx_getprop_6gevent_5libev_8corecext_5child_rpid, __pyx_setprop_6gevent_5libev_8corecext_5child_rpid, (char *)0, 0}, {(char *)"rstatus", __pyx_getprop_6gevent_5libev_8corecext_5child_rstatus, __pyx_setprop_6gevent_5libev_8corecext_5child_rstatus, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventChild_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.child", /*tp_name*/ sizeof(struct PyGeventChildObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_child, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6gevent_5libev_8corecext_child, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_5child_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_child, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyGeventStatObject *p; PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyGeventStatObject *)o); p->path = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_paths = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_6gevent_5libev_8corecext_stat(PyObject *o) { struct PyGeventStatObject *p = (struct PyGeventStatObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->path); Py_CLEAR(p->_paths); PyObject_GC_Track(o); __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_attr(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_prev(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_interval(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_path(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(o); } static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat__paths(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(o); } static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_stat[] = { {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_stat[] = { {(char *)"attr", __pyx_getprop_6gevent_5libev_8corecext_4stat_attr, 0, (char *)0, 0}, {(char *)"prev", __pyx_getprop_6gevent_5libev_8corecext_4stat_prev, 0, (char *)0, 0}, {(char *)"interval", __pyx_getprop_6gevent_5libev_8corecext_4stat_interval, 0, (char *)0, 0}, {(char *)"path", __pyx_getprop_6gevent_5libev_8corecext_4stat_path, 0, (char *)0, 0}, {(char *)"_paths", __pyx_getprop_6gevent_5libev_8corecext_4stat__paths, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyGeventStat_Type = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.stat", /*tp_name*/ sizeof(struct PyGeventStatObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext_stat, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6gevent_5libev_8corecext_stat, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6gevent_5libev_8corecext_stat, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext_stat, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[8]; static int __pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = 0; static PyObject *__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)))) { o = (PyObject*)__pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[--__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr]; memset(o, 0, sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o) { struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_flag); Py_CLEAR(p->__pyx_v_string); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)))) { __pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; if (p->__pyx_v_flag) { e = (*v)(p->__pyx_v_flag, a); if (e) return e; } if (p->__pyx_v_string) { e = (*v)(p->__pyx_v_string, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = { PyVarObject_HEAD_INIT(0, 0) "gevent.libev.corecext.__pyx_scope_struct__genexpr", /*tp_name*/ sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {"_flags_to_list", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list, METH_O, 0}, {"_flags_to_int", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int, METH_O, 0}, {"_check_flags", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_9_check_flags, METH_O, 0}, {"_events_to_str", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_11_events_to_str, METH_O, 0}, {"set_syserr_cb", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb, METH_O, 0}, {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_corecext(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_corecext}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "corecext", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_ASYNC, __pyx_k_ASYNC, sizeof(__pyx_k_ASYNC), 0, 0, 1, 1}, {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_n_s_BACKEND_EPOLL, __pyx_k_BACKEND_EPOLL, sizeof(__pyx_k_BACKEND_EPOLL), 0, 0, 1, 1}, {&__pyx_n_s_BACKEND_KQUEUE, __pyx_k_BACKEND_KQUEUE, sizeof(__pyx_k_BACKEND_KQUEUE), 0, 0, 1, 1}, {&__pyx_n_s_BACKEND_POLL, __pyx_k_BACKEND_POLL, sizeof(__pyx_k_BACKEND_POLL), 0, 0, 1, 1}, {&__pyx_n_s_BACKEND_PORT, __pyx_k_BACKEND_PORT, sizeof(__pyx_k_BACKEND_PORT), 0, 0, 1, 1}, {&__pyx_n_s_BACKEND_SELECT, __pyx_k_BACKEND_SELECT, sizeof(__pyx_k_BACKEND_SELECT), 0, 0, 1, 1}, {&__pyx_n_s_CHECK, __pyx_k_CHECK, sizeof(__pyx_k_CHECK), 0, 0, 1, 1}, {&__pyx_n_s_CHILD, __pyx_k_CHILD, sizeof(__pyx_k_CHILD), 0, 0, 1, 1}, {&__pyx_n_s_CLEANUP, __pyx_k_CLEANUP, sizeof(__pyx_k_CLEANUP), 0, 0, 1, 1}, {&__pyx_n_s_CUSTOM, __pyx_k_CUSTOM, sizeof(__pyx_k_CUSTOM), 0, 0, 1, 1}, {&__pyx_kp_s_Cannot_construct_a_bare_watcher, __pyx_k_Cannot_construct_a_bare_watcher, sizeof(__pyx_k_Cannot_construct_a_bare_watcher), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_set_priority_of_an_active, __pyx_k_Cannot_set_priority_of_an_active, sizeof(__pyx_k_Cannot_set_priority_of_an_active), 0, 0, 1, 0}, {&__pyx_kp_s_Child_watchers_are_not_supported, __pyx_k_Child_watchers_are_not_supported, sizeof(__pyx_k_Child_watchers_are_not_supported), 0, 0, 1, 0}, {&__pyx_n_s_EMBED, __pyx_k_EMBED, sizeof(__pyx_k_EMBED), 0, 0, 1, 1}, {&__pyx_n_s_ERROR, __pyx_k_ERROR, sizeof(__pyx_k_ERROR), 0, 0, 1, 1}, {&__pyx_n_s_EVENTS, __pyx_k_EVENTS, sizeof(__pyx_k_EVENTS), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_4HEAP, __pyx_k_EV_USE_4HEAP, sizeof(__pyx_k_EV_USE_4HEAP), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_k_EV_USE_CLOCK_SYSCALL, sizeof(__pyx_k_EV_USE_CLOCK_SYSCALL), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_EVENTFD, __pyx_k_EV_USE_EVENTFD, sizeof(__pyx_k_EV_USE_EVENTFD), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_FLOOR, __pyx_k_EV_USE_FLOOR, sizeof(__pyx_k_EV_USE_FLOOR), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_INOTIFY, __pyx_k_EV_USE_INOTIFY, sizeof(__pyx_k_EV_USE_INOTIFY), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_MONOTONIC, __pyx_k_EV_USE_MONOTONIC, sizeof(__pyx_k_EV_USE_MONOTONIC), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_NANOSLEEP, __pyx_k_EV_USE_NANOSLEEP, sizeof(__pyx_k_EV_USE_NANOSLEEP), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_REALTIME, __pyx_k_EV_USE_REALTIME, sizeof(__pyx_k_EV_USE_REALTIME), 0, 0, 1, 1}, {&__pyx_n_s_EV_USE_SIGNALFD, __pyx_k_EV_USE_SIGNALFD, sizeof(__pyx_k_EV_USE_SIGNALFD), 0, 0, 1, 1}, {&__pyx_kp_s_Expected_callable_not_r, __pyx_k_Expected_callable_not_r, sizeof(__pyx_k_Expected_callable_not_r), 0, 0, 1, 0}, {&__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_k_Expected_callable_or_None_got_r, sizeof(__pyx_k_Expected_callable_or_None_got_r), 0, 0, 1, 0}, {&__pyx_n_s_FORK, __pyx_k_FORK, sizeof(__pyx_k_FORK), 0, 0, 1, 1}, {&__pyx_n_s_FORKCHECK, __pyx_k_FORKCHECK, sizeof(__pyx_k_FORKCHECK), 0, 0, 1, 1}, {&__pyx_n_s_IDLE, __pyx_k_IDLE, sizeof(__pyx_k_IDLE), 0, 0, 1, 1}, {&__pyx_n_s_ILoop, __pyx_k_ILoop, sizeof(__pyx_k_ILoop), 0, 0, 1, 1}, {&__pyx_n_s_IOFDSET, __pyx_k_IOFDSET, sizeof(__pyx_k_IOFDSET), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_k_Invalid_backend_or_flag_s_Possib, sizeof(__pyx_k_Invalid_backend_or_flag_s_Possib), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_k_Invalid_value_for_backend_0x_x, sizeof(__pyx_k_Invalid_value_for_backend_0x_x), 0, 0, 1, 0}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_LIBEV_EMBED, __pyx_k_LIBEV_EMBED, sizeof(__pyx_k_LIBEV_EMBED), 0, 0, 1, 1}, {&__pyx_n_s_MAXPRI, __pyx_k_MAXPRI, sizeof(__pyx_k_MAXPRI), 0, 0, 1, 1}, {&__pyx_n_s_MINPRI, __pyx_k_MINPRI, sizeof(__pyx_k_MINPRI), 0, 0, 1, 1}, {&__pyx_n_s_NOINOTIFY, __pyx_k_NOINOTIFY, sizeof(__pyx_k_NOINOTIFY), 0, 0, 1, 1}, {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, {&__pyx_n_s_NOSIGMASK, __pyx_k_NOSIGMASK, sizeof(__pyx_k_NOSIGMASK), 0, 0, 1, 1}, {&__pyx_n_s_NSIG, __pyx_k_NSIG, sizeof(__pyx_k_NSIG), 0, 0, 1, 1}, {&__pyx_n_s_PERIODIC, __pyx_k_PERIODIC, sizeof(__pyx_k_PERIODIC), 0, 0, 1, 1}, {&__pyx_n_s_PREPARE, __pyx_k_PREPARE, sizeof(__pyx_k_PREPARE), 0, 0, 1, 1}, {&__pyx_n_s_READ, __pyx_k_READ, sizeof(__pyx_k_READ), 0, 0, 1, 1}, {&__pyx_n_s_READWRITE, __pyx_k_READWRITE, sizeof(__pyx_k_READWRITE), 0, 0, 1, 1}, {&__pyx_n_s_SIGNAL, __pyx_k_SIGNAL, sizeof(__pyx_k_SIGNAL), 0, 0, 1, 1}, {&__pyx_n_s_SIGNALFD, __pyx_k_SIGNALFD, sizeof(__pyx_k_SIGNALFD), 0, 0, 1, 1}, {&__pyx_n_s_STAT, __pyx_k_STAT, sizeof(__pyx_k_STAT), 0, 0, 1, 1}, {&__pyx_n_s_SYSERR_CALLBACK, __pyx_k_SYSERR_CALLBACK, sizeof(__pyx_k_SYSERR_CALLBACK), 0, 0, 1, 1}, {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1}, {&__pyx_n_s_TIMER, __pyx_k_TIMER, sizeof(__pyx_k_TIMER), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_UNDEF, __pyx_k_UNDEF, sizeof(__pyx_k_UNDEF), 0, 0, 1, 1}, {&__pyx_kp_s_Unsupported_backend_s, __pyx_k_Unsupported_backend_s, sizeof(__pyx_k_Unsupported_backend_s), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_WRITE, __pyx_k_WRITE, sizeof(__pyx_k_WRITE), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, {&__pyx_kp_s_active_2, __pyx_k_active_2, sizeof(__pyx_k_active_2), 0, 0, 1, 0}, {&__pyx_n_s_activecnt, __pyx_k_activecnt, sizeof(__pyx_k_activecnt), 0, 0, 1, 1}, {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_kp_s_args_r, __pyx_k_args_r, sizeof(__pyx_k_args_r), 0, 0, 1, 0}, {&__pyx_n_s_async, __pyx_k_async, sizeof(__pyx_k_async), 0, 0, 1, 1}, {&__pyx_n_s_async_2, __pyx_k_async_2, sizeof(__pyx_k_async_2), 0, 0, 1, 1}, {&__pyx_n_s_backend, __pyx_k_backend, sizeof(__pyx_k_backend), 0, 0, 1, 1}, {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, {&__pyx_kp_s_callback_r, __pyx_k_callback_r, sizeof(__pyx_k_callback_r), 0, 0, 1, 0}, {&__pyx_kp_s_callbacks_r_len_d_head_r_tail_r, __pyx_k_callbacks_r_len_d_head_r_tail_r, sizeof(__pyx_k_callbacks_r_len_d_head_r_tail_r), 0, 0, 1, 0}, {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1}, {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1}, {&__pyx_kp_s_child_watchers_are_only_availabl, __pyx_k_child_watchers_are_only_availabl, sizeof(__pyx_k_child_watchers_are_only_availabl), 0, 0, 1, 0}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_classImplements, __pyx_k_classImplements, sizeof(__pyx_k_classImplements), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_kp_s_default_2, __pyx_k_default_2, sizeof(__pyx_k_default_2), 0, 0, 1, 0}, {&__pyx_n_s_default_handle_error, __pyx_k_default_handle_error, sizeof(__pyx_k_default_handle_error), 0, 0, 1, 1}, {&__pyx_n_s_destroyed, __pyx_k_destroyed, sizeof(__pyx_k_destroyed), 0, 0, 1, 1}, {&__pyx_n_s_embeddable_backends, __pyx_k_embeddable_backends, sizeof(__pyx_k_embeddable_backends), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_epoll, __pyx_k_epoll, sizeof(__pyx_k_epoll), 0, 0, 1, 1}, {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, {&__pyx_kp_s_ev_default_loop_s_failed, __pyx_k_ev_default_loop_s_failed, sizeof(__pyx_k_ev_default_loop_s_failed), 0, 0, 1, 0}, {&__pyx_kp_s_ev_loop_new_s_failed, __pyx_k_ev_loop_new_s_failed, sizeof(__pyx_k_ev_loop_new_s_failed), 0, 0, 1, 0}, {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1}, {&__pyx_n_s_events_2, __pyx_k_events_2, sizeof(__pyx_k_events_2), 0, 0, 1, 1}, {&__pyx_n_s_events_str, __pyx_k_events_str, sizeof(__pyx_k_events_str), 0, 0, 1, 1}, {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, {&__pyx_kp_s_fd_must_be_non_negative_r, __pyx_k_fd_must_be_non_negative_r, sizeof(__pyx_k_fd_must_be_non_negative_r), 0, 0, 1, 0}, {&__pyx_kp_s_fd_s_events_s, __pyx_k_fd_s_events_s, sizeof(__pyx_k_fd_s_events_s), 0, 0, 1, 0}, {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, {&__pyx_kp_s_fileno_2, __pyx_k_fileno_2, sizeof(__pyx_k_fileno_2), 0, 0, 1, 0}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_flags_2, __pyx_k_flags_2, sizeof(__pyx_k_flags_2), 0, 0, 1, 1}, {&__pyx_n_s_flags_str2int, __pyx_k_flags_str2int, sizeof(__pyx_k_flags_str2int), 0, 0, 1, 1}, {&__pyx_n_s_fork, __pyx_k_fork, sizeof(__pyx_k_fork), 0, 0, 1, 1}, {&__pyx_n_s_forkcheck, __pyx_k_forkcheck, sizeof(__pyx_k_forkcheck), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_format_details, __pyx_k_format_details, sizeof(__pyx_k_format_details), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_get_header_version, __pyx_k_get_header_version, sizeof(__pyx_k_get_header_version), 0, 0, 1, 1}, {&__pyx_n_s_get_version, __pyx_k_get_version, sizeof(__pyx_k_get_version), 0, 0, 1, 1}, {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, {&__pyx_n_s_getswitchinterval, __pyx_k_getswitchinterval, sizeof(__pyx_k_getswitchinterval), 0, 0, 1, 1}, {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, {&__pyx_n_s_gevent__interfaces, __pyx_k_gevent__interfaces, sizeof(__pyx_k_gevent__interfaces), 0, 0, 1, 1}, {&__pyx_kp_s_gevent_core_EVENTS, __pyx_k_gevent_core_EVENTS, sizeof(__pyx_k_gevent_core_EVENTS), 0, 0, 1, 0}, {&__pyx_n_s_gevent_libev_corecext, __pyx_k_gevent_libev_corecext, sizeof(__pyx_k_gevent_libev_corecext), 0, 0, 1, 1}, {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, {&__pyx_n_s_handle_syserr, __pyx_k_handle_syserr, sizeof(__pyx_k_handle_syserr), 0, 0, 1, 1}, {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, {&__pyx_n_s_how, __pyx_k_how, sizeof(__pyx_k_how), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_idle, __pyx_k_idle, sizeof(__pyx_k_idle), 0, 0, 1, 1}, {&__pyx_kp_s_illegal_event_mask_r, __pyx_k_illegal_event_mask_r, sizeof(__pyx_k_illegal_event_mask_r), 0, 0, 1, 0}, {&__pyx_kp_s_illegal_signal_number_r, __pyx_k_illegal_signal_number_r, sizeof(__pyx_k_illegal_signal_number_r), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, {&__pyx_kp_s_io_watcher_attribute_events_is, __pyx_k_io_watcher_attribute_events_is, sizeof(__pyx_k_io_watcher_attribute_events_is), 0, 0, 1, 0}, {&__pyx_kp_s_io_watcher_attribute_fd_is_read, __pyx_k_io_watcher_attribute_fd_is_read, sizeof(__pyx_k_io_watcher_attribute_fd_is_read), 0, 0, 1, 0}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_kqueue, __pyx_k_kqueue, sizeof(__pyx_k_kqueue), 0, 0, 1, 1}, {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, {&__pyx_kp_s_libev_d_02d, __pyx_k_libev_d_02d, sizeof(__pyx_k_libev_d_02d), 0, 0, 1, 0}, {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_noenv, __pyx_k_noenv, sizeof(__pyx_k_noenv), 0, 0, 1, 1}, {&__pyx_n_s_noinotify, __pyx_k_noinotify, sizeof(__pyx_k_noinotify), 0, 0, 1, 1}, {&__pyx_n_s_nosigmask, __pyx_k_nosigmask, sizeof(__pyx_k_nosigmask), 0, 0, 1, 1}, {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, {&__pyx_n_s_nowait, __pyx_k_nowait, sizeof(__pyx_k_nowait), 0, 0, 1, 1}, {&__pyx_n_s_once, __pyx_k_once, sizeof(__pyx_k_once), 0, 0, 1, 1}, {&__pyx_kp_s_operation_on_destroyed_loop, __pyx_k_operation_on_destroyed_loop, sizeof(__pyx_k_operation_on_destroyed_loop), 0, 0, 1, 0}, {&__pyx_n_s_origflags_int, __pyx_k_origflags_int, sizeof(__pyx_k_origflags_int), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_pass_events, __pyx_k_pass_events, sizeof(__pyx_k_pass_events), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1}, {&__pyx_kp_s_pending_2, __pyx_k_pending_2, sizeof(__pyx_k_pending_2), 0, 0, 1, 0}, {&__pyx_kp_s_pending_s, __pyx_k_pending_s, sizeof(__pyx_k_pending_s), 0, 0, 1, 0}, {&__pyx_n_s_pendingcnt, __pyx_k_pendingcnt, sizeof(__pyx_k_pendingcnt), 0, 0, 1, 1}, {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, {&__pyx_kp_s_pid_r_rstatus_r, __pyx_k_pid_r_rstatus_r, sizeof(__pyx_k_pid_r_rstatus_r), 0, 0, 1, 0}, {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1}, {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1}, {&__pyx_n_s_print_exception, __pyx_k_print_exception, sizeof(__pyx_k_print_exception), 0, 0, 1, 1}, {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_recommended_backends, __pyx_k_recommended_backends, sizeof(__pyx_k_recommended_backends), 0, 0, 1, 1}, {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, {&__pyx_kp_s_ref_2, __pyx_k_ref_2, sizeof(__pyx_k_ref_2), 0, 0, 1, 0}, {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, {&__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_k_repeat_must_be_positive_or_zero, sizeof(__pyx_k_repeat_must_be_positive_or_zero), 0, 0, 1, 0}, {&__pyx_n_s_revents, __pyx_k_revents, sizeof(__pyx_k_revents), 0, 0, 1, 1}, {&__pyx_n_s_rstatus, __pyx_k_rstatus, sizeof(__pyx_k_rstatus), 0, 0, 1, 1}, {&__pyx_kp_s_s_at_0x_x_s, __pyx_k_s_at_0x_x_s, sizeof(__pyx_k_s_at_0x_x_s), 0, 0, 1, 0}, {&__pyx_kp_s_s_at_0x_x_s_2, __pyx_k_s_at_0x_x_s_2, sizeof(__pyx_k_s_at_0x_x_s_2), 0, 0, 1, 0}, {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, {&__pyx_n_s_sigfd, __pyx_k_sigfd, sizeof(__pyx_k_sigfd), 0, 0, 1, 1}, {&__pyx_n_s_signal, __pyx_k_signal, sizeof(__pyx_k_signal), 0, 0, 1, 1}, {&__pyx_n_s_signalfd, __pyx_k_signalfd, sizeof(__pyx_k_signalfd), 0, 0, 1, 1}, {&__pyx_n_s_signalmodule, __pyx_k_signalmodule, sizeof(__pyx_k_signalmodule), 0, 0, 1, 1}, {&__pyx_n_s_signalnum, __pyx_k_signalnum, sizeof(__pyx_k_signalnum), 0, 0, 1, 1}, {&__pyx_n_s_signum, __pyx_k_signum, sizeof(__pyx_k_signum), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_k_src_gevent_libev_corecext_pyx, sizeof(__pyx_k_src_gevent_libev_corecext_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_kp_s_stopped, __pyx_k_stopped, sizeof(__pyx_k_stopped), 0, 0, 1, 0}, {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_s_supported_backends, __pyx_k_supported_backends, sizeof(__pyx_k_supported_backends), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1}, {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_update_now, __pyx_k_update_now, sizeof(__pyx_k_update_now), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, {&__pyx_n_s_watcher, __pyx_k_watcher, sizeof(__pyx_k_watcher), 0, 0, 1, 1}, {&__pyx_n_s_win32, __pyx_k_win32, sizeof(__pyx_k_win32), 0, 0, 1, 1}, {&__pyx_n_s_zope_interface, __pyx_k_zope_interface, sizeof(__pyx_k_zope_interface), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 753, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 204, __pyx_L1_error) __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 296, __pyx_L1_error) __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(0, 425, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 668, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 819, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Child_watchers_are_not_supported); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_sigfd); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_construct_a_bare_watcher); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_version, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_header_version, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_supported_backends, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_recommended_backends, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 245, __pyx_L1_error) __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_embeddable_backends, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 249, __pyx_L1_error) __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_time, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_6gevent_5libev_8corecext_integer_types = ((PyObject*)Py_None); Py_INCREF(Py_None); GEVENT_CORE_EVENTS = Py_None; Py_INCREF(Py_None); _empty_tuple = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext__EVENTSType) < 0) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_getattro = __Pyx_PyObject_GenericGetAttr; } __pyx_ptype_6gevent_5libev_8corecext__EVENTSType = &__pyx_type_6gevent_5libev_8corecext__EVENTSType; if (PyType_Ready(&PyGeventCallback_Type) < 0) __PYX_ERR(0, 263, __pyx_L1_error) PyGeventCallback_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventCallback_Type.tp_dictoffset && PyGeventCallback_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventCallback_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_callback, (PyObject *)&PyGeventCallback_Type) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_callback = &PyGeventCallback_Type; __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO = &__pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO; __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.popleft = (struct PyGeventCallbackObject *(*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft; __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.append = (PyObject *(*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append; __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.has_callbacks = (int (*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks; if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext_CallbackFIFO) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } if (__Pyx_SetVtable(__pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_dict, __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO = &__pyx_type_6gevent_5libev_8corecext_CallbackFIFO; __pyx_vtabptr_6gevent_5libev_8corecext_loop = &__pyx_vtable_6gevent_5libev_8corecext_loop; __pyx_vtable_6gevent_5libev_8corecext_loop._run_callbacks = (PyObject *(*)(struct PyGeventLoopObject *))__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks; __pyx_vtable_6gevent_5libev_8corecext_loop._stop_watchers = (PyObject *(*)(struct PyGeventLoopObject *, struct ev_loop *))__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers; __pyx_vtable_6gevent_5libev_8corecext_loop.handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_handle_error; __pyx_vtable_6gevent_5libev_8corecext_loop._default_handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error; __pyx_vtable_6gevent_5libev_8corecext_loop.now = (ev_tstamp (*)(struct PyGeventLoopObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_now; __pyx_vtable_6gevent_5libev_8corecext_loop.update_now = (void (*)(struct PyGeventLoopObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_update_now; if (PyType_Ready(&PyGeventLoop_Type) < 0) __PYX_ERR(0, 375, __pyx_L1_error) PyGeventLoop_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventLoop_Type.tp_dictoffset && PyGeventLoop_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventLoop_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyGeventLoop_Type.tp_dict, __pyx_vtabptr_6gevent_5libev_8corecext_loop) < 0) __PYX_ERR(0, 375, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_loop, (PyObject *)&PyGeventLoop_Type) < 0) __PYX_ERR(0, 375, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_loop = &PyGeventLoop_Type; if (PyType_Ready(&PyGeventWatcher_Type) < 0) __PYX_ERR(0, 827, __pyx_L1_error) PyGeventWatcher_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventWatcher_Type.tp_dictoffset && PyGeventWatcher_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventWatcher_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_watcher, (PyObject *)&PyGeventWatcher_Type) < 0) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_watcher = &PyGeventWatcher_Type; PyGeventIO_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventIO_Type) < 0) __PYX_ERR(0, 988, __pyx_L1_error) PyGeventIO_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventIO_Type.tp_dictoffset && PyGeventIO_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventIO_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_io, (PyObject *)&PyGeventIO_Type) < 0) __PYX_ERR(0, 988, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_io = &PyGeventIO_Type; PyGeventTimer_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventTimer_Type) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) PyGeventTimer_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventTimer_Type.tp_dictoffset && PyGeventTimer_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventTimer_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_timer, (PyObject *)&PyGeventTimer_Type) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_timer = &PyGeventTimer_Type; PyGeventSignal_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventSignal_Type) < 0) __PYX_ERR(0, 1085, __pyx_L1_error) PyGeventSignal_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventSignal_Type.tp_dictoffset && PyGeventSignal_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventSignal_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_signal, (PyObject *)&PyGeventSignal_Type) < 0) __PYX_ERR(0, 1085, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_signal = &PyGeventSignal_Type; PyGeventIdle_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventIdle_Type) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) PyGeventIdle_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventIdle_Type.tp_dictoffset && PyGeventIdle_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventIdle_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_idle, (PyObject *)&PyGeventIdle_Type) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_idle = &PyGeventIdle_Type; PyGeventPrepare_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventPrepare_Type) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) PyGeventPrepare_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventPrepare_Type.tp_dictoffset && PyGeventPrepare_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventPrepare_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_prepare, (PyObject *)&PyGeventPrepare_Type) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_prepare = &PyGeventPrepare_Type; PyGeventCheck_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventCheck_Type) < 0) __PYX_ERR(0, 1134, __pyx_L1_error) PyGeventCheck_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventCheck_Type.tp_dictoffset && PyGeventCheck_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventCheck_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_check, (PyObject *)&PyGeventCheck_Type) < 0) __PYX_ERR(0, 1134, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_check = &PyGeventCheck_Type; PyGeventFork_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventFork_Type) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) PyGeventFork_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventFork_Type.tp_dictoffset && PyGeventFork_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventFork_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_fork, (PyObject *)&PyGeventFork_Type) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_fork = &PyGeventFork_Type; PyGeventAsync_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventAsync_Type) < 0) __PYX_ERR(0, 1159, __pyx_L1_error) PyGeventAsync_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventAsync_Type.tp_dictoffset && PyGeventAsync_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventAsync_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_async, (PyObject *)&PyGeventAsync_Type) < 0) __PYX_ERR(0, 1159, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_async_ = &PyGeventAsync_Type; PyGeventChild_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventChild_Type) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) PyGeventChild_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventChild_Type.tp_dictoffset && PyGeventChild_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventChild_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_child, (PyObject *)&PyGeventChild_Type) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_child = &PyGeventChild_Type; PyGeventStat_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; if (PyType_Ready(&PyGeventStat_Type) < 0) __PYX_ERR(0, 1225, __pyx_L1_error) PyGeventStat_Type.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventStat_Type.tp_dictoffset && PyGeventStat_Type.tp_getattro == PyObject_GenericGetAttr)) { PyGeventStat_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_stat, (PyObject *)&PyGeventStat_Type) < 0) __PYX_ERR(0, 1225, __pyx_L1_error) __pyx_ptype_6gevent_5libev_8corecext_stat = &PyGeventStat_Type; if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 149, __pyx_L1_error) __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = &__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(3, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION < 3 #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC void #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #else #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyObject * #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initcorecext(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initcorecext(void) #else __Pyx_PyMODINIT_FUNC PyInit_corecext(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_corecext(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_corecext(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; int __pyx_t_22; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'corecext' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_corecext(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("corecext", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_gevent__libev__corecext) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "gevent.libev.corecext")) { if (unlikely(PyDict_SetItemString(modules, "gevent.libev.corecext", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__19, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_signalmodule, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_getswitchinterval, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_get_version); __Pyx_GIVEREF(__pyx_n_s_get_version); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_version); __Pyx_INCREF(__pyx_n_s_get_header_version); __Pyx_GIVEREF(__pyx_n_s_get_header_version); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_header_version); __Pyx_INCREF(__pyx_n_s_supported_backends); __Pyx_GIVEREF(__pyx_n_s_supported_backends); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_supported_backends); __Pyx_INCREF(__pyx_n_s_recommended_backends); __Pyx_GIVEREF(__pyx_n_s_recommended_backends); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_recommended_backends); __Pyx_INCREF(__pyx_n_s_embeddable_backends); __Pyx_GIVEREF(__pyx_n_s_embeddable_backends); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_embeddable_backends); __Pyx_INCREF(__pyx_n_s_time); __Pyx_GIVEREF(__pyx_n_s_time); PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_time); __Pyx_INCREF(__pyx_n_s_loop); __Pyx_GIVEREF(__pyx_n_s_loop); PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_loop); if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)(&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types); __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L2; } /*else*/ { __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)(&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); __Pyx_INCREF(((PyObject *)(&PyLong_Type))); __Pyx_GIVEREF(((PyObject *)(&PyLong_Type))); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyLong_Type))); __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types); __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L2:; __pyx_t_2 = __Pyx_PyInt_From_int(EV_UNDEF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNDEF, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_READ, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WRITE, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_TIMER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMER, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PERIODIC, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNAL, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHILD, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_STAT, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDLE, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PREPARE, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHECK, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMBED, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORK, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLEANUP, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASYNC, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CUSTOM, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int((EV_READ | EV_WRITE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_READWRITE, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINPRI, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXPRI, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_PORT, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_KQUEUE, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_EPOLL, __pyx_t_2) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_POLL, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_SELECT, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORKCHECK, __pyx_t_2) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOINOTIFY, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNALFD, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSIGMASK, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext__EVENTSType)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(GEVENT_CORE_EVENTS); __Pyx_DECREF_SET(GEVENT_CORE_EVENTS, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENTS, GEVENT_CORE_EVENTS) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_1get_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_version, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_3get_header_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_header_version, __pyx_t_2) < 0) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_port); __Pyx_GIVEREF(__pyx_n_s_port); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_port); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_kqueue); __Pyx_GIVEREF(__pyx_n_s_kqueue); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_kqueue); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_epoll); __Pyx_GIVEREF(__pyx_n_s_epoll); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_epoll); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_poll); __Pyx_GIVEREF(__pyx_n_s_poll); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_poll); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_select); __Pyx_GIVEREF(__pyx_n_s_select); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_select); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOENV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_noenv); __Pyx_GIVEREF(__pyx_n_s_noenv); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_noenv); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_forkcheck); __Pyx_GIVEREF(__pyx_n_s_forkcheck); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_forkcheck); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_noinotify); __Pyx_GIVEREF(__pyx_n_s_noinotify); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_noinotify); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_signalfd); __Pyx_GIVEREF(__pyx_n_s_signalfd); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_signalfd); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __Pyx_INCREF(__pyx_n_s_nosigmask); __Pyx_GIVEREF(__pyx_n_s_nosigmask); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_nosigmask); __pyx_t_2 = 0; __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_12); PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_pf_6gevent_5libev_8corecext_22genexpr(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags_str2int, __pyx_t_12) < 0) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_READ); __Pyx_GIVEREF(__pyx_n_s_READ); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_READ); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_WRITE); __Pyx_GIVEREF(__pyx_n_s_WRITE); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_WRITE); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV__IOFDSET); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_IOFDSET); __Pyx_GIVEREF(__pyx_n_s_IOFDSET); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_IOFDSET); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_PERIODIC); __Pyx_GIVEREF(__pyx_n_s_PERIODIC); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_PERIODIC); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_SIGNAL); __Pyx_GIVEREF(__pyx_n_s_SIGNAL); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_SIGNAL); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_CHILD); __Pyx_GIVEREF(__pyx_n_s_CHILD); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_CHILD); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_STAT); __Pyx_GIVEREF(__pyx_n_s_STAT); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_STAT); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_IDLE); __Pyx_GIVEREF(__pyx_n_s_IDLE); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_IDLE); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_PREPARE); __Pyx_GIVEREF(__pyx_n_s_PREPARE); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_PREPARE); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_CHECK); __Pyx_GIVEREF(__pyx_n_s_CHECK); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CHECK); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_EMBED); __Pyx_GIVEREF(__pyx_n_s_EMBED); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_EMBED); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_FORK); __Pyx_GIVEREF(__pyx_n_s_FORK); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_FORK); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_CLEANUP); __Pyx_GIVEREF(__pyx_n_s_CLEANUP); PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_CLEANUP); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_ASYNC); __Pyx_GIVEREF(__pyx_n_s_ASYNC); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ASYNC); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_CUSTOM); __Pyx_GIVEREF(__pyx_n_s_CUSTOM); PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_CUSTOM); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); __Pyx_INCREF(__pyx_n_s_ERROR); __Pyx_GIVEREF(__pyx_n_s_ERROR); PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ERROR); __pyx_t_12 = 0; __pyx_t_12 = PyList_New(16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_11); PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyList_SET_ITEM(__pyx_t_12, 5, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyList_SET_ITEM(__pyx_t_12, 6, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_12, 7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_12, 8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_12, 9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_13); PyList_SET_ITEM(__pyx_t_12, 10, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_14); PyList_SET_ITEM(__pyx_t_12, 11, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_15); PyList_SET_ITEM(__pyx_t_12, 12, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_16); PyList_SET_ITEM(__pyx_t_12, 13, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_17); PyList_SET_ITEM(__pyx_t_12, 14, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_18); PyList_SET_ITEM(__pyx_t_12, 15, __pyx_t_18); __pyx_t_2 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_events, __pyx_t_12) < 0) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_version_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = PyObject_RichCompare(__pyx_t_12, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__pyx_t_3) { __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&PyBytes_Type))); __Pyx_INCREF(((PyObject *)(&PyString_Type))); __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)(&PyString_Type))); if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_18) < 0) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L3; } /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_builtins); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_basestring); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_12) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_L3:; __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_13supported_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_d, __pyx_n_s_supported_backends, __pyx_t_12) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_15recommended_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_d, __pyx_n_s_recommended_backends, __pyx_t_12) < 0) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_d, __pyx_n_s_embeddable_backends, __pyx_t_12) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_19time, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_12) < 0) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback->tp_dict, __pyx_n_s_close, __pyx_t_12) < 0) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_callback); __pyx_k__9 = EVBREAK_ONE; __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_update_now); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_update, __pyx_t_12) < 0) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop); __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_async); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_async_2, __pyx_t_12) < 0) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop); { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); /*try:*/ { __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_n_s_classImplements); __Pyx_GIVEREF(__pyx_n_s_classImplements); PyList_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_classImplements); __pyx_t_18 = __Pyx_Import(__pyx_n_s_zope_interface, __pyx_t_12, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 752, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_d, __pyx_n_s_classImplements, __pyx_t_12) < 0) __PYX_ERR(0, 752, __pyx_L4_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } /*else:*/ { __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_INCREF(__pyx_n_s_ILoop); __Pyx_GIVEREF(__pyx_n_s_ILoop); PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_ILoop); __pyx_t_12 = __Pyx_Import(__pyx_n_s_gevent__interfaces, __pyx_t_18, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 758, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_12, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ILoop, __pyx_t_18) < 0) __PYX_ERR(0, 758, __pyx_L6_except_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 759, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 759, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_22) { __Pyx_ErrRestore(0,0,0); goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_L9_try_end:; } __pyx_v_6gevent_5libev_8corecext_io_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_io_start), ((void *)ev_io_stop)); __pyx_v_6gevent_5libev_8corecext_timer_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_timer_start), ((void *)ev_timer_stop)); __pyx_v_6gevent_5libev_8corecext_signal_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_signal_start), ((void *)ev_signal_stop)); __pyx_v_6gevent_5libev_8corecext_idle_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_idle_start), ((void *)ev_idle_stop)); __pyx_v_6gevent_5libev_8corecext_prepare_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_prepare_start), ((void *)ev_prepare_stop)); __pyx_v_6gevent_5libev_8corecext_check_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_check_start), ((void *)ev_check_stop)); __pyx_v_6gevent_5libev_8corecext_fork_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_fork_start), ((void *)ev_fork_stop)); __pyx_v_6gevent_5libev_8corecext_async_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_async_start), ((void *)ev_async_stop)); if (PyDict_SetItem(__pyx_d, __pyx_n_s_async_2, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_)) < 0) __PYX_ERR(0, 1178, __pyx_L1_error) __pyx_v_6gevent_5libev_8corecext_child_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_child_start), ((void *)ev_child_stop)); __pyx_v_6gevent_5libev_8corecext_stat_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_stat_start), ((void *)ev_stat_stop)); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) __pyx_t_18 = __Pyx_PyInt_From_int(LIBEV_EMBED); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, __pyx_t_18) < 0) __PYX_ERR(0, 1295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_FLOOR); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_FLOOR, __pyx_t_18) < 0) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_CLOCK_SYSCALL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_t_18) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_REALTIME); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_REALTIME, __pyx_t_18) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_MONOTONIC); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_MONOTONIC, __pyx_t_18) < 0) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_NANOSLEEP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_NANOSLEEP, __pyx_t_18) < 0) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_INOTIFY); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_INOTIFY, __pyx_t_18) < 0) __PYX_ERR(0, 1301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_SIGNALFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_SIGNALFD, __pyx_t_18) < 0) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_EVENTFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_EVENTFD, __pyx_t_18) < 0) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_4HEAP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_4HEAP, __pyx_t_18) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_INCREF(__pyx_empty_tuple); __Pyx_XGOTREF(_empty_tuple); __Pyx_DECREF_SET(_empty_tuple, __pyx_empty_tuple); __Pyx_GIVEREF(__pyx_empty_tuple); __pyx_t_18 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_18) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init gevent.libev.corecext", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init gevent.libev.corecext"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCall2Args */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args, *result = NULL; #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyFunction_FastCall(function, args, 2); } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyCFunction_FastCall(function, args, 2); } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); done: return result; } /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) #endif { if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { PyObject *runerr; Py_ssize_t key_value; PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; if (unlikely(!(m && m->sq_item))) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); return NULL; } key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; if (likely(m && m->mp_subscript)) { return m->mp_subscript(obj, key); } return __Pyx_PyObject_GetIndex(obj, key); } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i<n; i++) { if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; } #endif for (i=0; i<n; i++) { if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1; } return 0; } static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* StringJoin */ #if !CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #ifdef _MSC_VER else state = (PyGILState_STATE)-1; #endif #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* GetAttr3 */ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); return 0; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if ((size_t)basicsize < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetNameInClass */ static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { PyObject *result; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); __Pyx_GetModuleGlobalNameUncached(result, name); return result; } static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { PyObject *result; result = __Pyx_PyObject_GetAttrStr(nmspace, name); if (!result) { result = __Pyx_GetGlobalNameAfterAttributeLookup(name); } return result; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(unsigned int), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(unsigned int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (unsigned int) 0; case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) case 2: if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; case 3: if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; case 4: if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(unsigned int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (unsigned int) 0; case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) case -2: if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 2: if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case -3: if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 3: if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case -4: if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 4: if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; } #endif if (sizeof(unsigned int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else unsigned int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (unsigned int) -1; } } else { unsigned int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned int) -1; val = __Pyx_PyInt_As_unsigned_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned int"); return (unsigned int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned int"); return (unsigned int) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i<n; i++) { if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; } #endif for (i=0; i<n; i++) { PyObject *t = PyTuple_GET_ITEM(tuple, i); #if PY_MAJOR_VERSION < 3 if (likely(exc_type == t)) return 1; #endif if (likely(PyExceptionClass_Check(t))) { if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1; } else { } } return 0; } static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { if (likely(err == exc_type)) return 1; if (likely(PyExceptionClass_Check(err))) { if (likely(PyExceptionClass_Check(exc_type))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); } else if (likely(PyTuple_Check(exc_type))) { return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type); } else { } } return PyErr_GivenExceptionMatches(err, exc_type); } static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { assert(PyExceptionClass_Check(exc_type1)); assert(PyExceptionClass_Check(exc_type2)); if (likely(err == exc_type1 || err == exc_type2)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); } return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); } #endif /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (descr != NULL) { *method = descr; return 0; } PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(name)); #endif return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); } /* CoroutineBase */ #include <structmember.h> #include <frameobject.h> #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; __Pyx_ErrFetch(&et, &ev, &tb); if (!et) { Py_XDECREF(tb); Py_XDECREF(ev); Py_INCREF(Py_None); *pvalue = Py_None; return 0; } if (likely(et == PyExc_StopIteration)) { if (!ev) { Py_INCREF(Py_None); value = Py_None; } #if PY_VERSION_HEX >= 0x030300A0 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); } #endif else if (unlikely(PyTuple_Check(ev))) { if (PyTuple_GET_SIZE(ev) >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); #else value = PySequence_ITEM(ev, 0); #endif } else { Py_INCREF(Py_None); value = Py_None; } Py_DECREF(ev); } else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { value = ev; } if (likely(value)) { Py_XDECREF(tb); Py_DECREF(et); *pvalue = value; return 0; } } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { __Pyx_ErrRestore(et, ev, tb); return -1; } PyErr_NormalizeException(&et, &ev, &tb); if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { __Pyx_ErrRestore(et, ev, tb); return -1; } Py_XDECREF(tb); Py_DECREF(et); #if PY_VERSION_HEX >= 0x030300A0 value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); #else { PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); Py_DECREF(ev); if (likely(args)) { value = PySequence_GetItem(args, 0); Py_DECREF(args); } if (unlikely(!value)) { __Pyx_ErrRestore(NULL, NULL, NULL); Py_INCREF(Py_None); value = Py_None; } } #endif *pvalue = value; return 0; } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { PyObject *t, *v, *tb; t = exc_state->exc_type; v = exc_state->exc_value; tb = exc_state->exc_traceback; exc_state->exc_type = NULL; exc_state->exc_value = NULL; exc_state->exc_traceback = NULL; Py_XDECREF(t); Py_XDECREF(v); Py_XDECREF(tb); } #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) { const char *msg; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { msg = "coroutine already executing"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { msg = "async generator already executing"; #endif } else { msg = "generator already executing"; } PyErr_SetString(PyExc_ValueError, msg); } #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) { const char *msg; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(gen)) { msg = "can't send non-None value to a just-started coroutine"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(gen)) { msg = "can't send non-None value to a just-started async generator"; #endif } else { msg = "can't send non-None value to a just-started generator"; } PyErr_SetString(PyExc_TypeError, msg); } #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) { #ifdef __Pyx_Coroutine_USED if (!closing && __Pyx_Coroutine_Check(gen)) { PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); } else #endif if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { return __Pyx_Coroutine_NotStartedError((PyObject*)self); } } if (unlikely(self->resume_label == -1)) { return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign tstate = __pyx_tstate; #else tstate = __Pyx_PyThreadState_Current; #endif exc_state = &self->gi_exc_state; if (exc_state->exc_type) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON #else if (exc_state->exc_traceback) { PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback; PyFrameObject *f = tb->tb_frame; Py_XINCREF(tstate->frame); assert(f->f_back == NULL); f->f_back = tstate->frame; } #endif } #if CYTHON_USE_EXC_INFO_STACK exc_state->previous_item = tstate->exc_info; tstate->exc_info = exc_state; #else if (exc_state->exc_type) { __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } else { __Pyx_Coroutine_ExceptionClear(exc_state); __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif self->is_running = 1; retval = self->body((PyObject *) self, tstate, value); self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif return retval; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { PyObject *exc_tb = exc_state->exc_traceback; if (likely(exc_tb)) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON #else PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; Py_CLEAR(f->f_back); #endif } } static CYTHON_INLINE PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) { if (unlikely(!retval)) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { PyObject *exc = PyExc_StopIteration; #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) exc = __Pyx_PyExc_StopAsyncIteration; #endif __Pyx_PyErr_SetNone(exc); } } return retval; } static CYTHON_INLINE PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { PyObject *ret; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); ret = __Pyx_Coroutine_SendEx(gen, val, 0); Py_XDECREF(val); return ret; } static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { PyObject *retval; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif { if (value == Py_None) ret = Py_TYPE(yf)->tp_iternext(yf); else ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); } gen->is_running = 0; if (likely(ret)) { return ret; } retval = __Pyx_Coroutine_FinishDelegation(gen); } else { retval = __Pyx_Coroutine_SendEx(gen, value, 0); } return __Pyx_Coroutine_MethodReturn(self, retval); } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { PyObject *retval = NULL; int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); if (!retval) return -1; } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); } else #endif { PyObject *meth; gen->is_running = 1; meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); if (unlikely(!meth)) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_WriteUnraisable(yf); } PyErr_Clear(); } else { retval = PyObject_CallFunction(meth, NULL); Py_DECREF(meth); if (!retval) err = -1; } gen->is_running = 0; } Py_XDECREF(retval); return err; } static PyObject *__Pyx_Generator_Next(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, NULL); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif ret = Py_TYPE(yf)->tp_iternext(yf); gen->is_running = 0; if (likely(ret)) { return ret; } return __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_SendEx(gen, Py_None, 0); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __Pyx_Coroutine_Close(self); } static PyObject *__Pyx_Coroutine_Close(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *retval, *raised_exception; PyObject *yf = gen->yieldfrom; int err = 0; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); __Pyx_Coroutine_Undelegate(gen); Py_DECREF(yf); } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); if (unlikely(retval)) { const char *msg; Py_DECREF(retval); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { msg = "coroutine ignored GeneratorExit"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { #if PY_VERSION_HEX < 0x03060000 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; #else msg = "async generator ignored GeneratorExit"; #endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); return NULL; } raised_exception = PyErr_Occurred(); if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { if (raised_exception) PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { int err = __Pyx_Coroutine_CloseIter(gen, yf); Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); goto throw_here; } gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) #endif #ifdef __Pyx_Coroutine_USED || __Pyx_Coroutine_Check(yf) #endif ) { ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); #ifdef __Pyx_Coroutine_USED } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { gen->is_running = 0; return NULL; } PyErr_Clear(); __Pyx_Coroutine_Undelegate(gen); gen->is_running = 0; goto throw_here; } if (likely(args)) { ret = PyObject_CallObject(meth, args); } else { ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL); } Py_DECREF(meth); } gen->is_running = 0; Py_DECREF(yf); if (!ret) { ret = __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_MethodReturn(self, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { Py_VISIT(exc_state->exc_type); Py_VISIT(exc_state->exc_value); Py_VISIT(exc_state->exc_traceback); return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); } static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); Py_CLEAR(gen->yieldfrom); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); } #endif Py_CLEAR(gen->gi_code); Py_CLEAR(gen->gi_name); Py_CLEAR(gen->gi_qualname); Py_CLEAR(gen->gi_modulename); return 0; } static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE if (PyObject_CallFinalizerFromDealloc(self)) #else Py_TYPE(gen)->tp_del(self); if (self->ob_refcnt > 0) #endif { return; } PyObject_GC_UnTrack(self); } #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { /* We have to handle this case for asynchronous generators right here, because this code has to be between UNTRACK and GC_Del. */ Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); } #endif __Pyx_Coroutine_clear(self); PyObject_GC_Del(gen); } static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; __Pyx_PyThreadState_declare if (gen->resume_label < 0) { return; } #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt == 0); self->ob_refcnt = 1; #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; PyObject *finalizer = agen->ag_finalizer; if (finalizer && !agen->ag_closed) { PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); if (unlikely(!res)) { PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } __Pyx_ErrRestore(error_type, error_value, error_traceback); return; } } #endif if (unlikely(gen->resume_label == 0 && !error_value)) { #ifdef __Pyx_Coroutine_USED #ifdef __Pyx_Generator_USED if (!__Pyx_Generator_CheckExact(self)) #endif { PyObject_GC_UnTrack(self); #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); #else {PyObject *msg; char *cmsg; #if CYTHON_COMPILING_IN_PYPY msg = NULL; cmsg = (char*) "coroutine was never awaited"; #else char *cname; PyObject *qualname; qualname = gen->gi_qualname; cname = PyString_AS_STRING(qualname); msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); if (unlikely(!msg)) { PyErr_Clear(); cmsg = (char*) "coroutine was never awaited"; } else { cmsg = PyString_AS_STRING(msg); } #endif if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) PyErr_WriteUnraisable(self); Py_XDECREF(msg);} #endif PyObject_GC_Track(self); } #endif } else { PyObject *res = __Pyx_Coroutine_Close(self); if (unlikely(!res)) { if (PyErr_Occurred()) PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt > 0); if (--self->ob_refcnt == 0) { return; } { Py_ssize_t refcnt = self->ob_refcnt; _Py_NewReference(self); self->ob_refcnt = refcnt; } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(self->ob_type) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); _Py_DEC_REFTOTAL; #endif #ifdef COUNT_ALLOCS --Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_allocs; #endif #endif } static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) { PyObject *name = self->gi_name; if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = self->gi_name; Py_INCREF(value); self->gi_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) { PyObject *name = self->gi_qualname; if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = self->gi_qualname; Py_INCREF(value); self->gi_qualname = value; Py_XDECREF(tmp); return 0; } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); if (unlikely(!gen)) return NULL; return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); } static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { gen->body = body; gen->closure = closure; Py_XINCREF(closure); gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; gen->gi_exc_state.exc_type = NULL; gen->gi_exc_state.exc_value = NULL; gen->gi_exc_state.exc_traceback = NULL; #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif gen->gi_weakreflist = NULL; Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); gen->gi_name = name; Py_XINCREF(module_name); gen->gi_modulename = module_name; Py_XINCREF(code); gen->gi_code = code; PyObject_GC_Track(gen); return gen; } /* PatchModuleWithCoroutine */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; globals = PyDict_New(); if (unlikely(!globals)) goto ignore; result = PyDict_SetItemString(globals, "_cython_coroutine_type", #ifdef __Pyx_Coroutine_USED (PyObject*)__pyx_CoroutineType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; result = PyDict_SetItemString(globals, "_cython_generator_type", #ifdef __Pyx_Generator_USED (PyObject*)__pyx_GeneratorType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; result_obj = PyRun_String(py_code, Py_file_input, globals, globals); if (unlikely(!result_obj)) goto ignore; Py_DECREF(result_obj); Py_DECREF(globals); return module; ignore: Py_XDECREF(globals); PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else py_code++; #endif return module; } /* PatchGeneratorABC */ #ifndef CYTHON_REGISTER_ABCS #define CYTHON_REGISTER_ABCS 1 #endif #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( module, "" "if _cython_generator_type is not None:\n" " try: Generator = _module.Generator\n" " except AttributeError: pass\n" " else: Generator.register(_cython_generator_type)\n" "if _cython_coroutine_type is not None:\n" " try: Coroutine = _module.Coroutine\n" " except AttributeError: pass\n" " else: Coroutine.register(_cython_coroutine_type)\n" ); return module; } #endif static int __Pyx_patch_abc(void) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static int abc_patched = 0; if (CYTHON_REGISTER_ABCS && !abc_patched) { PyObject *module; module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); if (!module) { PyErr_WriteUnraisable(NULL); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, ((PY_MAJOR_VERSION >= 3) ? "Cython module failed to register with collections.abc module" : "Cython module failed to register with collections module"), 1) < 0)) { return -1; } } else { module = __Pyx_patch_abc_module(module); abc_patched = 1; if (unlikely(!module)) return -1; Py_DECREF(module); } module = PyImport_ImportModule("backports_abc"); if (module) { module = __Pyx_patch_abc_module(module); Py_XDECREF(module); } if (!module) { PyErr_Clear(); } } #else if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); #endif return 0; } /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the generator"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the generator"), 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) "generator", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, 0, offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, (iternextfunc) __Pyx_Generator_Next, __pyx_Generator_methods, __pyx_Generator_memberlist, __pyx_Generator_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_Generator_init(void) { __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); if (unlikely(!__pyx_GeneratorType)) { return -1; } return 0; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */
40.43678
369
0.727488
[ "object" ]
038f5332426f4d04d95ea0ca99fcf644bfb0bef5
2,010
h
C
be/test/exec/pipeline/pipeline_test_base.h
dixingxing0/starrocks
afb3cd7b1ae11860be0ae84e58a183246e571109
[ "Zlib", "PSF-2.0", "Apache-2.0" ]
null
null
null
be/test/exec/pipeline/pipeline_test_base.h
dixingxing0/starrocks
afb3cd7b1ae11860be0ae84e58a183246e571109
[ "Zlib", "PSF-2.0", "Apache-2.0" ]
null
null
null
be/test/exec/pipeline/pipeline_test_base.h
dixingxing0/starrocks
afb3cd7b1ae11860be0ae84e58a183246e571109
[ "Zlib", "PSF-2.0", "Apache-2.0" ]
null
null
null
// This file is licensed under the Elastic License 2.0. Copyright 2021 StarRocks Limited. #include "column/chunk.h" #include "column/vectorized_fwd.h" #include "exec/pipeline/exchange/local_exchange.h" #include "exec/pipeline/exchange/local_exchange_sink_operator.h" #include "exec/pipeline/exchange/local_exchange_source_operator.h" #include "gen_cpp/InternalService_types.h" #include "gtest/gtest.h" #include "runtime/descriptors.h" #include "runtime/exec_env.h" #include "runtime/runtime_state.h" #include "storage/storage_engine.h" namespace starrocks::pipeline { class PipelineTestBase : public ::testing::Test { public: static vectorized::ChunkPtr _create_and_fill_chunk(const std::vector<SlotDescriptor*>& slots, size_t row_num); static vectorized::ChunkPtr _create_and_fill_chunk(size_t row_num); public: virtual void SetUp() final; virtual void TearDown() final; protected: ExecEnv* _exec_env = nullptr; QueryContext* _query_ctx = nullptr; FragmentContext* _fragment_ctx = nullptr; FragmentFuture _fragment_future; RuntimeState* _runtime_state = nullptr; ObjectPool* _obj_pool = nullptr; TExecPlanFragmentParams _request; // Entry of test, subclass should call this method to start test void start_test(); size_t next_operator_id() { return ++_next_operator_id; } size_t next_plan_node_id() { return ++_next_plan_node_id; } uint32_t next_pipeline_id() { return ++_next_pipeline_id; } OpFactories maybe_interpolate_local_exchange(OpFactories& pred_operators); // SubClass can init request in this method virtual void _prepare_request() {} // lambda used to init _pipelines std::function<void()> _pipeline_builder; Pipelines _pipelines; private: // Prepare execution context of pipeline void _prepare(); // execute pipeline void _execute(); size_t _next_operator_id = 0; size_t _next_plan_node_id = 0; uint32_t _next_pipeline_id = 0; }; }; // namespace starrocks::pipeline
31.40625
114
0.751741
[ "vector" ]
03970ac01366ddf8640fcf8d5f2ac84317586726
9,609
c
C
osprey/cygnus/opcodes/ppc-dis.c
sharugupta/OpenUH
daddd76858a53035f5d713f648d13373c22506e8
[ "BSD-2-Clause" ]
null
null
null
osprey/cygnus/opcodes/ppc-dis.c
sharugupta/OpenUH
daddd76858a53035f5d713f648d13373c22506e8
[ "BSD-2-Clause" ]
null
null
null
osprey/cygnus/opcodes/ppc-dis.c
sharugupta/OpenUH
daddd76858a53035f5d713f648d13373c22506e8
[ "BSD-2-Clause" ]
null
null
null
/* * Copyright 2003, 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. */ /* ppc-dis.c -- Disassemble PowerPC instructions Copyright 1994, 1995, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support This file is part of GDB, GAS, and the GNU binutils. GDB, GAS, and the GNU binutils are free software; you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GDB, GAS, and the GNU binutils are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this file; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> #include "sysdep.h" #include "dis-asm.h" #include "opcode/ppc.h" /* This file provides several disassembler functions, all of which use the disassembler interface defined in dis-asm.h. Several functions are provided because this file handles disassembly for the PowerPC in both big and little endian mode and also for the POWER (RS/6000) chip. */ static int print_insn_powerpc (bfd_vma, struct disassemble_info *, int, int); struct dis_private { /* Stash the result of parsing disassembler_options here. */ int dialect; }; /* Determine which set of machines to disassemble for. PPC403/601 or BookE. For convenience, also disassemble instructions supported by the AltiVec vector unit. */ static int powerpc_dialect (struct disassemble_info *info) { int dialect = PPC_OPCODE_PPC; if (BFD_DEFAULT_TARGET_SIZE == 64) dialect |= PPC_OPCODE_64; if (info->disassembler_options && strstr (info->disassembler_options, "booke") != NULL) dialect |= PPC_OPCODE_BOOKE | PPC_OPCODE_BOOKE64; else if ((info->mach == bfd_mach_ppc_e500) || (info->disassembler_options && strstr (info->disassembler_options, "e500") != NULL)) dialect |= (PPC_OPCODE_BOOKE | PPC_OPCODE_SPE | PPC_OPCODE_ISEL | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI); else if (info->disassembler_options && strstr (info->disassembler_options, "efs") != NULL) dialect |= PPC_OPCODE_EFS; else dialect |= (PPC_OPCODE_403 | PPC_OPCODE_601 | PPC_OPCODE_CLASSIC | PPC_OPCODE_COMMON | PPC_OPCODE_ALTIVEC); if (info->disassembler_options && strstr (info->disassembler_options, "power4") != NULL) dialect |= PPC_OPCODE_POWER4; if (info->disassembler_options && strstr (info->disassembler_options, "any") != NULL) dialect |= PPC_OPCODE_ANY; if (info->disassembler_options) { if (strstr (info->disassembler_options, "32") != NULL) dialect &= ~PPC_OPCODE_64; else if (strstr (info->disassembler_options, "64") != NULL) dialect |= PPC_OPCODE_64; } ((struct dis_private *) &info->private_data)->dialect = dialect; return dialect; } /* Print a big endian PowerPC instruction. */ int print_insn_big_powerpc (bfd_vma memaddr, struct disassemble_info *info) { int dialect = ((struct dis_private *) &info->private_data)->dialect; return print_insn_powerpc (memaddr, info, 1, dialect); } /* Print a little endian PowerPC instruction. */ int print_insn_little_powerpc (bfd_vma memaddr, struct disassemble_info *info) { int dialect = ((struct dis_private *) &info->private_data)->dialect; return print_insn_powerpc (memaddr, info, 0, dialect); } /* Print a POWER (RS/6000) instruction. */ int print_insn_rs6000 (bfd_vma memaddr, struct disassemble_info *info) { return print_insn_powerpc (memaddr, info, 1, PPC_OPCODE_POWER); } /* Print a PowerPC or POWER instruction. */ static int print_insn_powerpc (bfd_vma memaddr, struct disassemble_info *info, int bigendian, int dialect) { bfd_byte buffer[4]; int status; unsigned long insn; const struct powerpc_opcode *opcode; const struct powerpc_opcode *opcode_end; unsigned long op; if (dialect == 0) dialect = powerpc_dialect (info); status = (*info->read_memory_func) (memaddr, buffer, 4, info); if (status != 0) { (*info->memory_error_func) (status, memaddr, info); return -1; } if (bigendian) insn = bfd_getb32 (buffer); else insn = bfd_getl32 (buffer); /* Get the major opcode of the instruction. */ op = PPC_OP (insn); /* Find the first match in the opcode table. We could speed this up a bit by doing a binary search on the major opcode. */ opcode_end = powerpc_opcodes + powerpc_num_opcodes; again: for (opcode = powerpc_opcodes; opcode < opcode_end; opcode++) { unsigned long table_op; const unsigned char *opindex; const struct powerpc_operand *operand; int invalid; int need_comma; int need_paren; table_op = PPC_OP (opcode->opcode); if (op < table_op) break; if (op > table_op) continue; if ((insn & opcode->mask) != opcode->opcode || (opcode->flags & dialect) == 0) continue; /* Make two passes over the operands. First see if any of them have extraction functions, and, if they do, make sure the instruction is valid. */ invalid = 0; for (opindex = opcode->operands; *opindex != 0; opindex++) { operand = powerpc_operands + *opindex; if (operand->extract) (*operand->extract) (insn, dialect, &invalid); } if (invalid) continue; /* The instruction is valid. */ if (opcode->operands[0] != 0) (*info->fprintf_func) (info->stream, "%-7s ", opcode->name); else (*info->fprintf_func) (info->stream, "%s", opcode->name); /* Now extract and print the operands. */ need_comma = 0; need_paren = 0; for (opindex = opcode->operands; *opindex != 0; opindex++) { long value; operand = powerpc_operands + *opindex; /* Operands that are marked FAKE are simply ignored. We already made sure that the extract function considered the instruction to be valid. */ if ((operand->flags & PPC_OPERAND_FAKE) != 0) continue; /* Extract the value from the instruction. */ if (operand->extract) value = (*operand->extract) (insn, dialect, &invalid); else { value = (insn >> operand->shift) & ((1 << operand->bits) - 1); if ((operand->flags & PPC_OPERAND_SIGNED) != 0 && (value & (1 << (operand->bits - 1))) != 0) value -= 1 << operand->bits; } /* If the operand is optional, and the value is zero, don't print anything. */ if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0 && (operand->flags & PPC_OPERAND_NEXT) == 0 && value == 0) continue; if (need_comma) { (*info->fprintf_func) (info->stream, ","); need_comma = 0; } /* Print the operand as directed by the flags. */ if ((operand->flags & PPC_OPERAND_GPR) != 0 || ((operand->flags & PPC_OPERAND_GPR_0) != 0 && value != 0)) (*info->fprintf_func) (info->stream, "r%ld", value); else if ((operand->flags & PPC_OPERAND_FPR) != 0) (*info->fprintf_func) (info->stream, "f%ld", value); else if ((operand->flags & PPC_OPERAND_VR) != 0) (*info->fprintf_func) (info->stream, "v%ld", value); else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0) (*info->print_address_func) (memaddr + value, info); else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0) (*info->print_address_func) ((bfd_vma) value & 0xffffffff, info); else if ((operand->flags & PPC_OPERAND_CR) == 0 || (dialect & PPC_OPCODE_PPC) == 0) (*info->fprintf_func) (info->stream, "%ld", value); else { if (operand->bits == 3) (*info->fprintf_func) (info->stream, "cr%d", value); else { static const char *cbnames[4] = { "lt", "gt", "eq", "so" }; int cr; int cc; cr = value >> 2; if (cr != 0) (*info->fprintf_func) (info->stream, "4*cr%d+", cr); cc = value & 3; (*info->fprintf_func) (info->stream, "%s", cbnames[cc]); } } if (need_paren) { (*info->fprintf_func) (info->stream, ")"); need_paren = 0; } if ((operand->flags & PPC_OPERAND_PARENS) == 0) need_comma = 1; else { (*info->fprintf_func) (info->stream, "("); need_paren = 1; } } /* We have found and printed an instruction; return. */ return 4; } if ((dialect & PPC_OPCODE_ANY) != 0) { dialect = ~PPC_OPCODE_ANY; goto again; } /* We could not find a match. */ (*info->fprintf_func) (info->stream, ".long 0x%lx", insn); return 4; } void print_ppc_disassembler_options (FILE *stream) { fprintf (stream, "\n\ The following PPC specific disassembler options are supported for use with\n\ the -M switch:\n"); fprintf (stream, " booke|booke32|booke64 Disassemble the BookE instructions\n"); fprintf (stream, " e500|e500x2 Disassemble the e500 instructions\n"); fprintf (stream, " efs Disassemble the EFS instructions\n"); fprintf (stream, " power4 Disassemble the Power4 instructions\n"); fprintf (stream, " 32 Do not disassemble 64-bit instructions\n"); fprintf (stream, " 64 Allow disassembly of 64-bit instructions\n"); }
30.798077
92
0.652305
[ "vector" ]
039f2651540c45533e1e74c993cc3f117d534ecb
1,902
h
C
include/public/aer/event.h
Foxbud/libaermre
9d61eb01e78e7912ed0c01bd109e260bcae0efc0
[ "Apache-2.0" ]
1
2022-03-07T09:54:08.000Z
2022-03-07T09:54:08.000Z
include/public/aer/event.h
Foxbud/libaermre
9d61eb01e78e7912ed0c01bd109e260bcae0efc0
[ "Apache-2.0" ]
9
2021-01-24T00:01:03.000Z
2021-03-26T17:52:09.000Z
include/public/aer/event.h
Foxbud/libaermre
9d61eb01e78e7912ed0c01bd109e260bcae0efc0
[ "Apache-2.0" ]
null
null
null
/** * @file * * @brief Utilities for querying and manipulating object events. * * @since 1.0.0 * * @copyright 2021 the libaermre authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef AER_EVENT_H #define AER_EVENT_H #include <stdbool.h> #include "aer/instance.h" /* ----- PUBLIC TYPES ----- */ /** * @brief Semi-opaque type for an object event. * * For more information about how to use this object see @ref ObjListeners. * * @since 1.0.0 */ typedef struct AEREvent { /** * @var handle * * @brief Handle the current event. * * This function represents the next event listener attached to the current * object event. * * @param[in] event `next` event context. * @param[in] target Target instance passed to the currently executing * listener. * @param[in] other Other instance passed to the currently executing * listener. * * @return Whether or not the event was handled. * * @since 1.0.0 * * @memberof AEREvent */ bool (*handle)(struct AEREvent* event, AERInstance* target, AERInstance* other); /** * @var next * * @brief Event context for the `handle` event listener. * * @since 1.4.0 * * @memberof AEREvent */ struct AEREvent* next; } AEREvent; #endif /* AER_EVENT_H */
25.36
79
0.63775
[ "object" ]
03a8112ad4fae95d4b519d92718aa5628fff4a7a
3,156
h
C
components/viz/service/display/overlay_processor_mac.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
components/viz/service/display/overlay_processor_mac.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
components/viz/service/display/overlay_processor_mac.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_OVERLAY_PROCESSOR_MAC_H_ #define COMPONENTS_VIZ_SERVICE_DISPLAY_OVERLAY_PROCESSOR_MAC_H_ #include <memory> #include "base/containers/flat_map.h" #include "base/macros.h" #include "build/build_config.h" #include "components/viz/common/quads/render_pass.h" #include "components/viz/service/display/ca_layer_overlay.h" #include "components/viz/service/display/overlay_candidate.h" #include "components/viz/service/display/overlay_processor_interface.h" #include "components/viz/service/viz_service_export.h" namespace cc { class DisplayResourceProvider; } namespace viz { class VIZ_SERVICE_EXPORT OverlayProcessorMac : public OverlayProcessorInterface { public: using CandidateList = CALayerOverlayList; OverlayProcessorMac(bool could_overlay, bool enable_ca_overlay); // For testing. explicit OverlayProcessorMac( std::unique_ptr<CALayerOverlayProcessor> ca_layer_overlay_processor); ~OverlayProcessorMac() override; bool DisableSplittingQuads() const override; bool IsOverlaySupported() const override; gfx::Rect GetAndResetOverlayDamage() override; // Returns true if the platform supports hw overlays and surface occluding // damage rect needs to be computed since it will be used by overlay // processor. bool NeedsSurfaceOccludingDamageRect() const override; // Attempt to replace quads from the specified root render pass with overlays // or CALayers. This must be called every frame. void ProcessForOverlays( DisplayResourceProvider* resource_provider, RenderPassList* render_passes, const SkMatrix44& output_color_matrix, const FilterOperationsMap& render_pass_filters, const FilterOperationsMap& render_pass_backdrop_filters, OutputSurfaceOverlayPlane* output_surface_plane, CandidateList* overlay_candidates, gfx::Rect* damage_rect, std::vector<gfx::Rect>* content_bounds) override; // For Mac, if we successfully generated a candidate list for CALayerOverlay, // we no longer need the |output_surface_plane|. This function takes a pointer // to the base::Optional instance so the instance can be reset. // TODO(weiliangc): Internalize the |output_surface_plane| inside the overlay // processor. void AdjustOutputSurfaceOverlay( base::Optional<OutputSurfaceOverlayPlane>* output_surface_plane) override; private: const bool could_overlay_; const bool enable_ca_overlay_; gfx::Rect ca_overlay_damage_rect_; protected: // Protected for testing. // TODO(weiliangc): Eventually fold the CaLayerOverlayProcessor into this // class. std::unique_ptr<CALayerOverlayProcessor> ca_layer_overlay_processor_; const CALayerOverlayProcessor* GetOverlayProcessor() const { return ca_layer_overlay_processor_.get(); } private: bool output_surface_already_handled_; DISALLOW_COPY_AND_ASSIGN(OverlayProcessorMac); }; } // namespace viz #endif // COMPONENTS_VIZ_SERVICE_DISPLAY_OVERLAY_PROCESSOR_MAC_H_
35.863636
80
0.790875
[ "render", "vector" ]
03ab172ea65e3cfc14b0098b1129a6858415f35b
4,025
h
C
FWCore/Framework/interface/limited/OutputModuleBase.h
PKUfudawei/cmssw
8fbb5ce74398269c8a32956d7c7943766770c093
[ "Apache-2.0" ]
1
2018-08-28T16:51:36.000Z
2018-08-28T16:51:36.000Z
FWCore/Framework/interface/limited/OutputModuleBase.h
PKUfudawei/cmssw
8fbb5ce74398269c8a32956d7c7943766770c093
[ "Apache-2.0" ]
25
2016-06-24T20:55:32.000Z
2022-02-01T19:24:45.000Z
FWCore/Framework/interface/limited/OutputModuleBase.h
PKUfudawei/cmssw
8fbb5ce74398269c8a32956d7c7943766770c093
[ "Apache-2.0" ]
8
2016-03-25T07:17:43.000Z
2021-07-08T17:11:21.000Z
#ifndef FWCore_Framework_limited_OutputModuleBase_h #define FWCore_Framework_limited_OutputModuleBase_h // -*- C++ -*- // // Package: FWCore/Framework // Class : OutputModuleBase // /**\class OutputModuleBase OutputModuleBase.h "FWCore/Framework/interface/limited/OutputModuleBase.h" Description: Base class for all 'limited' OutputModules Usage: <usage> */ // // // system include files // user include files #include "FWCore/Framework/interface/OutputModuleCore.h" #include "FWCore/Concurrency/interface/LimitedTaskQueue.h" // forward declarations namespace edm { namespace limited { class OutputModuleBase : public core::OutputModuleCore { public: template <typename U> friend class edm::maker::ModuleHolderT; template <typename T> friend class ::edm::WorkerT; template <typename T> friend class ::edm::OutputModuleCommunicatorT; typedef OutputModuleBase ModuleType; explicit OutputModuleBase(ParameterSet const& pset); OutputModuleBase(OutputModuleBase const&) = delete; // Disallow copying and moving OutputModuleBase& operator=(OutputModuleBase const&) = delete; // Disallow copying and moving static void fillDescription( ParameterSetDescription& desc, std::vector<std::string> const& iDefaultOutputCommands = ProductSelectorRules::defaultSelectionStrings()); //Output modules always need writeRun and writeLumi to be called bool wantsGlobalRuns() const { return true; } bool wantsGlobalLuminosityBlocks() const { return true; } virtual bool wantsProcessBlocks() const = 0; virtual bool wantsInputProcessBlocks() const = 0; virtual bool wantsStreamRuns() const = 0; virtual bool wantsStreamLuminosityBlocks() const = 0; unsigned int concurrencyLimit() const { return queue_.concurrencyLimit(); } LimitedTaskQueue& queue() { return queue_; } protected: void doPreallocate(PreallocationConfiguration const&); void doBeginJob(); void doBeginStream(StreamID id); void doEndStream(StreamID id); bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*); //For now this is a placeholder /*virtual*/ void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const&, Principal const&) const {} private: LimitedTaskQueue queue_; std::string workerType() const { return "WorkerT<edm::limited::OutputModuleBase>"; } void registerProductsAndCallbacks(OutputModuleBase const*, ProductRegistry const*) {} virtual void preallocStreams(unsigned int) {} virtual void preallocate(PreallocationConfiguration const&) {} virtual void doBeginStream_(StreamID) {} virtual void doEndStream_(StreamID) {} virtual void doStreamBeginRun_(StreamID, RunForOutput const&, EventSetup const&) {} virtual void doStreamEndRun_(StreamID, RunForOutput const&, EventSetup const&) {} virtual void doStreamEndRunSummary_(StreamID, RunForOutput const&, EventSetup const&) {} virtual void doStreamBeginLuminosityBlock_(StreamID, LuminosityBlockForOutput const&, EventSetup const&) {} virtual void doStreamEndLuminosityBlock_(StreamID, LuminosityBlockForOutput const&, EventSetup const&) {} virtual void doStreamEndLuminosityBlockSummary_(StreamID, LuminosityBlockForOutput const&, EventSetup const&) {} virtual void doBeginRunSummary_(RunForOutput const&, EventSetup const&) {} virtual void doEndRunSummary_(RunForOutput const&, EventSetup const&) {} virtual void doBeginLuminosityBlockSummary_(LuminosityBlockForOutput const&, EventSetup const&) {} virtual void doEndLuminosityBlockSummary_(LuminosityBlockForOutput const&, EventSetup const&) {} bool hasAcquire() const { return false; } }; } // namespace limited } // namespace edm #endif
39.460784
118
0.714286
[ "vector" ]
03b1ece0c912a3e9bddbd550652813ad6f12864f
12,128
h
C
ITS/ITSsim/AliITShit.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
52
2016-12-11T13:04:01.000Z
2022-03-11T11:49:35.000Z
ITS/ITSsim/AliITShit.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
1,388
2016-11-01T10:27:36.000Z
2022-03-30T15:26:09.000Z
ITS/ITSsim/AliITShit.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
275
2016-06-21T20:24:05.000Z
2022-03-31T13:06:19.000Z
#ifndef ALIITSHIT_H #define ALIITSHIT_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ //////////////////////////////////////////////////////////////////////// // Version: 0 // Written by Rene Brun, Federico Carminati, and Roberto Barbera // // Version: 1 // Modified and documented by Bjorn S. Nilsen // July 11 1999 // // AliITShit is the hit class for the ITS. Hits are the information // that comes from a Monte Carlo at each step as a particle mass through // sensitive detector elements as particles are transported through a // detector. // // Data members: // // Int_t fTrack // See AliHit for a full description. The track number of the track // that made this hit. // // Float_t fX // See AliHit for a full description. The global x position of the // hit (in the standard units of the Monte Carlo). // // Float_t fY // See AliHit for a full description. The global y position of the // hit (in the standard units of the Monte Carlo). // // Float_t fZ // See AliHit for a full description. The global z position of the // hit (in the standard units of the Monte Carlo). // // Int_t fStatus // The track status flag. This flag indicates the track status // at the time of creating this hit. It is made up of the following 8 // status bits from highest order to lowest order bits // 0 : IsTrackAlive(): IsTrackStop():IsTrackDisappeared(): // IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside() . // See AliMC for a description of these functions. If the function is // true then the bit is set to one, otherwise it is zero. // // Int_t fLayer // The layer number of the detector that contains this hit. See // AliITSgeom and AliITSv? for a description of the geometry. // // Int_t fLadder // The ladder number of the detector that contains this hit. See // AliITSgeom and AliITSv? for a description of the geometry. // // Int_t fDet // The detector number of the detector that contains this hit. See // AliITSgeom and AliITSv? for a description of the geometry. // // Float_t fPx // The x momentum, in global coordinates, of the particle that // "created" the hit at the time and position of the hit. The units // are those determined by the Monte Carlo. // // Float_t fPy // The y momentum, in global coordinates, of the particle that // "created" the hit at the time and position of the hit. The units // are those determined by the Monte Carlo. // // Float_t fPz // The z momentum, in global coordinates, of the particle that // "created" the hit at the time and position of the hit. The units // are those determined by the Monte Carlo. // // Float_t fDestep // The energy lost by the particle during the step ending in this // hit. The units are those determined by the Monte Carlo. // // Float_t fTof // The time of flight associated with the particle ending in this // hit. The time is typically measured from the point of creation of the // original particle (if this particle is a daughter). The units // are those determined by the Monte Carlo. // // //////////////////////////////////////////////////////////////////////// #include <TLorentzVector.h> #include "AliHit.h" class TParticle; using std::istream; using std::ostream; class AliITShit : public AliHit { public: AliITShit();// Default consrtructor // Old Standard Constructor AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits); // New Standard Constructor AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,Float_t tof, TLorentzVector &x,TLorentzVector &x0,TLorentzVector &p); // Copy Constructor AliITShit(const AliITShit &h); // Equals operator AliITShit& operator=(const AliITShit &h); // Default destructor virtual ~AliITShit() {}; // Get Hit information functions. // virtual int GetTrack() const {return fTrack;} // define in AliHit // virtual void SetTrack(int track) const {fTrack=track;) // AliHit virtual void SetModule(Int_t mod){fModule=mod;}; virtual void SetShunt(Int_t shunt); virtual void SetPosition(TLorentzVector &x){fX=x.X();fY=x.Y();fZ=x.Z();} virtual void SetStartPosition(TLorentzVector &x){fx0=x.X();fy0=x.Y(); fz0=x.Z();} virtual void SetTime(Float_t t){fTof = t;} virtual void SetStartTime(Float_t t){ft0 = t;} virtual void SetStatus(Int_t stat){fStatus = stat;} virtual void SetStartStatus(Int_t stat){fStatus0 = stat;} virtual void SetEdep(Float_t de){fDestep = de;} virtual void SetMomentum(TLorentzVector &p){fPx=p.Px();fPy=p.Py(); fPz=p.Pz();} virtual Int_t GetTrackStatus() const {//returns the status code return fStatus;} virtual Int_t GetTrackStatus0() const {//returns the status code return fStatus0;} virtual Int_t GetLayer() const{Int_t a,b,c;// returns the layer number GetDetectorID(a,b,c); return a;} virtual Int_t GetLadder() const{Int_t a,b,c;// returns the ladder number GetDetectorID(a,b,c); return b;} virtual Int_t GetDetector() const{Int_t a,b,c;//returns the detector number GetDetectorID(a,b,c); return c;} // returns the detector ID virtual void GetDetectorID(Int_t &layer,Int_t &ladder,Int_t &det)const; virtual Int_t GetModule(){return fModule;}; virtual Float_t GetIonization() const {return fDestep;}//returns the Destep // virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z)const { // returns the position in the Global frame x=fX;y=fY;z=fZ;return;}; virtual void GetPositionG(Double_t &x,Double_t &y,Double_t &z)const { // returns the position in the Global frame x=fX;y=fY;z=fZ;return;}; virtual Float_t GetTOF() const {// returns the time of flight return fTof;} // Returns particle 3 position at this hit in global coordinates. virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z,Float_t &tof) const {// returns the position in the Global frame and the time of // flight x=fX;y=fY;z=fZ,tof=fTof;return;}; virtual void GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &t) const {// Returns particle 3 position and the time of flight at this // hit in global coordinates. x=fX;y=fY;z=fZ,t=fTof;return;}; virtual Float_t GetXG()const {// Returns particle X position at this hit // in global coordinates. return fX;} virtual Float_t GetYG()const {// Returns particle X position at this hit // in global coordinates. return fY;} virtual Float_t GetZG()const {// Returns particle Z position at this hit // in global coordinates. return fZ;} // Returns particle 3 position at this hit in global coordinates. virtual void GetPositionG0(Float_t &x,Float_t &y,Float_t &z,Float_t &tof) const {// returns the initial position in the Global frame and the // time of flight x=fx0;y=fy0;z=fz0,tof=fTof;return;}; // Returns particle 3 position at this hit in global coordinates. virtual void GetPositionG0(Double_t &x,Double_t &y,Double_t &z, Double_t &tof)const { // returns the initial position in the Global frame and the // time of flight x=fx0;y=fy0;z=fz0,tof=fTof;return;}; virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z){ // Returns particle 3 position at this hit in local coordinates. Float_t tf;GetPositionL(x,y,z,tf);} virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof); virtual void GetPositionL(Double_t &x,Double_t &y,Double_t &z){ // Returns particle 3 position at this hit in local coordinates. Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);x=xf,y=yf;z=zf;} virtual void GetPositionL(Double_t &x,Double_t &y,Double_t &z,Double_t &t){ // Returns particle 3 position and the time of flight at this hit // in local coordinates. Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);x=xf,y=yf;z=zf;t=tf;} // Returns particle 3 initial position and the time of flight at this hit // in local coordinates. virtual void GetPositionL0(Double_t &x,Double_t &y,Double_t &z, Double_t &t); virtual Float_t GetXL(){ // Returns particle X position at this hit in local coordinates. Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return xf;} virtual Float_t GetYL(){ // Returns particle Y position at this hit in local coordinates. Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return yf;} virtual Float_t GetZL(){ // Returns particle Z position at this hit in local coordinates. Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return zf;} // Get Monti Carlo information about hit. virtual void GetMomentumG(Float_t &px,Float_t &py,Float_t &pz)const { // returns the particle momentum in the Global frame px=fPx;py=fPy;pz=fPz;return;}; virtual void GetMomentumG(Double_t &px,Double_t &py,Double_t &pz)const { // returns the particle momentum in the Global frame px=fPx;py=fPy;pz=fPz;return;}; virtual Float_t GetPXG()const {// Returns particle X momentum at this hit // in global coordinates. return fPx;} virtual Float_t GetPYG()const {// Returns particle Y momentum at // this hit in global coordinates. return fPy;} virtual Float_t GetPZG()const {// Returns particle Z momentum at // this hit in global coordinates. return fPz;} // Returns particle Z momentum at this hit in local coordinates. virtual TParticle * GetParticle() const; // Returns ptr to this particle. Bool_t StatusInside() const {// checks if the particle is "inside" if((fStatus&0x0001)==0) return kFALSE;else return kTRUE;} Bool_t StatusEntering() const {// checks if the particle is "entering" if((fStatus&0x0002)==0) return kFALSE;else return kTRUE;} Bool_t StatusExiting() const {// checks if the particle is "exiting" if((fStatus&0x0004)==0) return kFALSE;else return kTRUE;} Bool_t StatusOut() const {// checks if the particle is "out" if((fStatus&0x0008)==0) return kFALSE;else return kTRUE;} Bool_t StatusDisappeared() const {// checks if the part. is "disappeared" if((fStatus&0x00010)==0) return kFALSE;else return kTRUE;} Bool_t StatusStop() const {// checks if the particle is "stopped" if((fStatus&0x00020)==0) return kFALSE;else return kTRUE;} Bool_t StatusAlive() const {// checks if the particle is "alive" if((fStatus&0x00030)==0) return kFALSE;else return kTRUE;} // Prints out the content of this class in ASCII format. void Print(ostream *os) const; // Reads in the content of this class in the format of Print void Read(istream *is); virtual void Print(Option_t *option="") const {TObject::Print(option);} virtual Int_t Read(const char *name) {return TObject::Read(name);} protected: Int_t fStatus; // Track Status Int_t fModule; // Module number Float_t fPx; // PX of particle at the point of the hit Float_t fPy; // PY of particle at the point of the hit Float_t fPz; // PZ of particle at the point of the hit Float_t fDestep; // Energy deposited in the current step Float_t fTof; // Time of flight at the point of the hit Int_t fStatus0;// Track Status of Starting point Float_t fx0; // Starting point of this step Float_t fy0; // Starting point of this step Float_t fz0; // Starting point of this step Float_t ft0; // Starting point of this step ClassDef(AliITShit,3) //Hits object for set:ITS }; // Input and output function for standard C++ input/output. ostream& operator<<(ostream &os,AliITShit &source); istream& operator>>(istream &os,AliITShit &source); #endif
45.939394
79
0.666474
[ "geometry", "object" ]
03b2b1cab2c7ba7e87fd13ce8c15248c3c3b460b
67,924
h
C
BCC55/Include/brokcfg.h
C14427818/CollegeYr1
2b551d70ae3cc14a354c49657d476515466ca66f
[ "MIT" ]
1
2022-01-13T01:03:55.000Z
2022-01-13T01:03:55.000Z
INCLUDE/BROKCFG.H
earthsiege2/borland-cpp-ide
09bcecc811841444338e81b9c9930c0e686f9530
[ "Unlicense", "FSFAP", "Apache-1.1" ]
null
null
null
INCLUDE/BROKCFG.H
earthsiege2/borland-cpp-ide
09bcecc811841444338e81b9c9930c0e686f9530
[ "Unlicense", "FSFAP", "Apache-1.1" ]
null
null
null
#pragma option push -b -a8 -pc -A- /*P_O_Push*/ /* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 3.01.75 */ /* at Wed Apr 22 19:48:30 1998 */ /* Compiler settings for brokcfg.idl: Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext error checks: none */ //@@MIDL_FILE_HEADING( ) #include "rpc.h" #include "rpcndr.h" #ifndef COM_NO_WINDOWS_H #include "windows.h" #include "ole2.h" #endif /*COM_NO_WINDOWS_H*/ #ifndef __brokcfg_h__ #define __brokcfg_h__ #ifdef __cplusplus extern "C"{ #endif /* Forward Declarations */ #ifndef __IBrokConfig_FWD_DEFINED__ #define __IBrokConfig_FWD_DEFINED__ typedef interface IBrokConfig IBrokConfig; #endif /* __IBrokConfig_FWD_DEFINED__ */ #ifndef __IBrokServers_FWD_DEFINED__ #define __IBrokServers_FWD_DEFINED__ typedef interface IBrokServers IBrokServers; #endif /* __IBrokServers_FWD_DEFINED__ */ #ifndef __BrokConfig_FWD_DEFINED__ #define __BrokConfig_FWD_DEFINED__ #ifdef __cplusplus typedef class BrokConfig BrokConfig; #else typedef struct BrokConfig BrokConfig; #endif /* __cplusplus */ #endif /* __BrokConfig_FWD_DEFINED__ */ #ifndef __BrokServers_FWD_DEFINED__ #define __BrokServers_FWD_DEFINED__ #ifdef __cplusplus typedef class BrokServers BrokServers; #else typedef struct BrokServers BrokServers; #endif /* __cplusplus */ #endif /* __BrokServers_FWD_DEFINED__ */ /* header files for imported files */ #include "oaidl.h" #include "ocidl.h" void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); void __RPC_USER MIDL_user_free( void __RPC_FAR * ); /**************************************** * Generated header for interface: __MIDL_itf_brokcfg_0000 * at Wed Apr 22 19:48:30 1998 * using MIDL 3.01.75 ****************************************/ /* [local] */ #define BROK_AUTH_TYPE_ANON ( 0x1 ) #define BROK_AUTH_TYPE_PWDCOOKIE ( 0x2 ) #define BROK_AUTH_TYPE_BASIC ( 0x4 ) #define BROK_AUTH_TYPE_DPA ( 0x8 ) #define IIS_AUTH_TYPE_ALLOW_ANON ( 0x10 ) #define BROK_ALWAYS_WRITE ( 0x20 ) #define BROK_IGNORE_ALLOW_ANON ( 0x40 ) extern RPC_IF_HANDLE __MIDL_itf_brokcfg_0000_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_brokcfg_0000_v0_0_s_ifspec; #ifndef __IBrokConfig_INTERFACE_DEFINED__ #define __IBrokConfig_INTERFACE_DEFINED__ /**************************************** * Generated header for interface: IBrokConfig * at Wed Apr 22 19:48:30 1998 * using MIDL 3.01.75 ****************************************/ /* [unique][helpstring][dual][uuid][object] */ EXTERN_C const IID IID_IBrokConfig; #if defined(__cplusplus) && !defined(CINTERFACE) interface DECLSPEC_UUID("19edab12-c4a4-11d0-bbda-00c04fb615e5") IBrokConfig : public IDispatch { public: virtual /* [hidden] */ HRESULT STDMETHODCALLTYPE LoadDefaults( LONG lVirtServId) = 0; virtual HRESULT STDMETHODCALLTYPE GetConfig( LONG lVirtServId) = 0; virtual HRESULT STDMETHODCALLTYPE SetConfig( void) = 0; virtual HRESULT STDMETHODCALLTYPE CheckAcct( BSTR bszDomain, BSTR bszName, BSTR bszPassword) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lVirtServId( /* [retval][out] */ LONG __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_lVirtServId( /* [in] */ LONG NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bLocal( /* [retval][out] */ BOOL __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bLocal( /* [in] */ BOOL NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszServerName( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszServerName( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lPort( /* [retval][out] */ LONG __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_lPort( /* [in] */ LONG NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bSecure( /* [retval][out] */ BOOL __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bSecure( /* [in] */ BOOL NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lSecurePort( /* [retval][out] */ LONG __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_lSecurePort( /* [in] */ LONG NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lTimeLimit( /* [retval][out] */ LONG __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_lTimeLimit( /* [in] */ LONG NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lSizeLimit( /* [retval][out] */ LONG __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_lSizeLimit( /* [in] */ LONG NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszBaseDN( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszBaseDN( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lCacheTimeout( /* [retval][out] */ LONG __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_lCacheTimeout( /* [in] */ LONG NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszGroupPrefix( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszGroupPrefix( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bCreateGroups( /* [retval][out] */ BOOL __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bCreateGroups( /* [in] */ BOOL NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszDomain( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszDomain( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszDsName( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszDsName( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszDsPwd( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszDsPwd( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszProxyName( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszProxyName( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszProxyPwd( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszProxyPwd( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszProxyDomain( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszProxyDomain( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bUseTrackCookie( /* [retval][out] */ BOOL __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bUseTrackCookie( /* [in] */ BOOL NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lPwdCookieTimeout( /* [retval][out] */ LONG __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_lPwdCookieTimeout( /* [in] */ LONG NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bEnabled( /* [retval][out] */ BOOL __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bEnabled( /* [in] */ BOOL NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszComment( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszComment( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bPwdCookiePersist( /* [retval][out] */ BOOL __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bPwdCookiePersist( /* [in] */ BOOL NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszRealm( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszRealm( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lTokenCacheTimeout( /* [retval][out] */ LONG __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_lTokenCacheTimeout( /* [in] */ LONG NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bszTokenCreatorDll( /* [retval][out] */ BSTR __RPC_FAR *pRetVal) = 0; virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bszTokenCreatorDll( /* [in] */ BSTR NewVal) = 0; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bDirty( /* [retval][out] */ BOOL __RPC_FAR *pRetVal) = 0; }; #else /* C style interface */ typedef struct IBrokConfigVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( IBrokConfig __RPC_FAR * This, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( IBrokConfig __RPC_FAR * This); ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( IBrokConfig __RPC_FAR * This); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( IBrokConfig __RPC_FAR * This, /* [out] */ UINT __RPC_FAR *pctinfo); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( IBrokConfig __RPC_FAR * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( IBrokConfig __RPC_FAR * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, /* [in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( IBrokConfig __RPC_FAR * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, /* [out] */ VARIANT __RPC_FAR *pVarResult, /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, /* [out] */ UINT __RPC_FAR *puArgErr); /* [hidden] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *LoadDefaults )( IBrokConfig __RPC_FAR * This, LONG lVirtServId); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetConfig )( IBrokConfig __RPC_FAR * This, LONG lVirtServId); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetConfig )( IBrokConfig __RPC_FAR * This); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CheckAcct )( IBrokConfig __RPC_FAR * This, BSTR bszDomain, BSTR bszName, BSTR bszPassword); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_lVirtServId )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_lVirtServId )( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bLocal )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bLocal )( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszServerName )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszServerName )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_lPort )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_lPort )( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bSecure )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bSecure )( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_lSecurePort )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_lSecurePort )( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_lTimeLimit )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_lTimeLimit )( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_lSizeLimit )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_lSizeLimit )( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszBaseDN )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszBaseDN )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_lCacheTimeout )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_lCacheTimeout )( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszGroupPrefix )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszGroupPrefix )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bCreateGroups )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bCreateGroups )( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszDomain )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszDomain )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszDsName )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszDsName )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszDsPwd )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszDsPwd )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszProxyName )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszProxyName )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszProxyPwd )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszProxyPwd )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszProxyDomain )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszProxyDomain )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bUseTrackCookie )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bUseTrackCookie )( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_lPwdCookieTimeout )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_lPwdCookieTimeout )( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bEnabled )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bEnabled )( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszComment )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszComment )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bPwdCookiePersist )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bPwdCookiePersist )( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszRealm )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszRealm )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_lTokenCacheTimeout )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_lTokenCacheTimeout )( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bszTokenCreatorDll )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_bszTokenCreatorDll )( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_bDirty )( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); END_INTERFACE } IBrokConfigVtbl; interface IBrokConfig { CONST_VTBL struct IBrokConfigVtbl __RPC_FAR *lpVtbl; }; #ifdef COBJMACROS #define IBrokConfig_QueryInterface(This,riid,ppvObject) \ (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) #define IBrokConfig_AddRef(This) \ (This)->lpVtbl -> AddRef(This) #define IBrokConfig_Release(This) \ (This)->lpVtbl -> Release(This) #define IBrokConfig_GetTypeInfoCount(This,pctinfo) \ (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) #define IBrokConfig_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) #define IBrokConfig_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) #define IBrokConfig_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) #define IBrokConfig_LoadDefaults(This,lVirtServId) \ (This)->lpVtbl -> LoadDefaults(This,lVirtServId) #define IBrokConfig_GetConfig(This,lVirtServId) \ (This)->lpVtbl -> GetConfig(This,lVirtServId) #define IBrokConfig_SetConfig(This) \ (This)->lpVtbl -> SetConfig(This) #define IBrokConfig_CheckAcct(This,bszDomain,bszName,bszPassword) \ (This)->lpVtbl -> CheckAcct(This,bszDomain,bszName,bszPassword) #define IBrokConfig_get_lVirtServId(This,pRetVal) \ (This)->lpVtbl -> get_lVirtServId(This,pRetVal) #define IBrokConfig_put_lVirtServId(This,NewVal) \ (This)->lpVtbl -> put_lVirtServId(This,NewVal) #define IBrokConfig_get_bLocal(This,pRetVal) \ (This)->lpVtbl -> get_bLocal(This,pRetVal) #define IBrokConfig_put_bLocal(This,NewVal) \ (This)->lpVtbl -> put_bLocal(This,NewVal) #define IBrokConfig_get_bszServerName(This,pRetVal) \ (This)->lpVtbl -> get_bszServerName(This,pRetVal) #define IBrokConfig_put_bszServerName(This,NewVal) \ (This)->lpVtbl -> put_bszServerName(This,NewVal) #define IBrokConfig_get_lPort(This,pRetVal) \ (This)->lpVtbl -> get_lPort(This,pRetVal) #define IBrokConfig_put_lPort(This,NewVal) \ (This)->lpVtbl -> put_lPort(This,NewVal) #define IBrokConfig_get_bSecure(This,pRetVal) \ (This)->lpVtbl -> get_bSecure(This,pRetVal) #define IBrokConfig_put_bSecure(This,NewVal) \ (This)->lpVtbl -> put_bSecure(This,NewVal) #define IBrokConfig_get_lSecurePort(This,pRetVal) \ (This)->lpVtbl -> get_lSecurePort(This,pRetVal) #define IBrokConfig_put_lSecurePort(This,NewVal) \ (This)->lpVtbl -> put_lSecurePort(This,NewVal) #define IBrokConfig_get_lTimeLimit(This,pRetVal) \ (This)->lpVtbl -> get_lTimeLimit(This,pRetVal) #define IBrokConfig_put_lTimeLimit(This,NewVal) \ (This)->lpVtbl -> put_lTimeLimit(This,NewVal) #define IBrokConfig_get_lSizeLimit(This,pRetVal) \ (This)->lpVtbl -> get_lSizeLimit(This,pRetVal) #define IBrokConfig_put_lSizeLimit(This,NewVal) \ (This)->lpVtbl -> put_lSizeLimit(This,NewVal) #define IBrokConfig_get_bszBaseDN(This,pRetVal) \ (This)->lpVtbl -> get_bszBaseDN(This,pRetVal) #define IBrokConfig_put_bszBaseDN(This,NewVal) \ (This)->lpVtbl -> put_bszBaseDN(This,NewVal) #define IBrokConfig_get_lCacheTimeout(This,pRetVal) \ (This)->lpVtbl -> get_lCacheTimeout(This,pRetVal) #define IBrokConfig_put_lCacheTimeout(This,NewVal) \ (This)->lpVtbl -> put_lCacheTimeout(This,NewVal) #define IBrokConfig_get_bszGroupPrefix(This,pRetVal) \ (This)->lpVtbl -> get_bszGroupPrefix(This,pRetVal) #define IBrokConfig_put_bszGroupPrefix(This,NewVal) \ (This)->lpVtbl -> put_bszGroupPrefix(This,NewVal) #define IBrokConfig_get_bCreateGroups(This,pRetVal) \ (This)->lpVtbl -> get_bCreateGroups(This,pRetVal) #define IBrokConfig_put_bCreateGroups(This,NewVal) \ (This)->lpVtbl -> put_bCreateGroups(This,NewVal) #define IBrokConfig_get_bszDomain(This,pRetVal) \ (This)->lpVtbl -> get_bszDomain(This,pRetVal) #define IBrokConfig_put_bszDomain(This,NewVal) \ (This)->lpVtbl -> put_bszDomain(This,NewVal) #define IBrokConfig_get_bszDsName(This,pRetVal) \ (This)->lpVtbl -> get_bszDsName(This,pRetVal) #define IBrokConfig_put_bszDsName(This,NewVal) \ (This)->lpVtbl -> put_bszDsName(This,NewVal) #define IBrokConfig_get_bszDsPwd(This,pRetVal) \ (This)->lpVtbl -> get_bszDsPwd(This,pRetVal) #define IBrokConfig_put_bszDsPwd(This,NewVal) \ (This)->lpVtbl -> put_bszDsPwd(This,NewVal) #define IBrokConfig_get_bszProxyName(This,pRetVal) \ (This)->lpVtbl -> get_bszProxyName(This,pRetVal) #define IBrokConfig_put_bszProxyName(This,NewVal) \ (This)->lpVtbl -> put_bszProxyName(This,NewVal) #define IBrokConfig_get_bszProxyPwd(This,pRetVal) \ (This)->lpVtbl -> get_bszProxyPwd(This,pRetVal) #define IBrokConfig_put_bszProxyPwd(This,NewVal) \ (This)->lpVtbl -> put_bszProxyPwd(This,NewVal) #define IBrokConfig_get_bszProxyDomain(This,pRetVal) \ (This)->lpVtbl -> get_bszProxyDomain(This,pRetVal) #define IBrokConfig_put_bszProxyDomain(This,NewVal) \ (This)->lpVtbl -> put_bszProxyDomain(This,NewVal) #define IBrokConfig_get_bUseTrackCookie(This,pRetVal) \ (This)->lpVtbl -> get_bUseTrackCookie(This,pRetVal) #define IBrokConfig_put_bUseTrackCookie(This,NewVal) \ (This)->lpVtbl -> put_bUseTrackCookie(This,NewVal) #define IBrokConfig_get_lPwdCookieTimeout(This,pRetVal) \ (This)->lpVtbl -> get_lPwdCookieTimeout(This,pRetVal) #define IBrokConfig_put_lPwdCookieTimeout(This,NewVal) \ (This)->lpVtbl -> put_lPwdCookieTimeout(This,NewVal) #define IBrokConfig_get_bEnabled(This,pRetVal) \ (This)->lpVtbl -> get_bEnabled(This,pRetVal) #define IBrokConfig_put_bEnabled(This,NewVal) \ (This)->lpVtbl -> put_bEnabled(This,NewVal) #define IBrokConfig_get_bszComment(This,pRetVal) \ (This)->lpVtbl -> get_bszComment(This,pRetVal) #define IBrokConfig_put_bszComment(This,NewVal) \ (This)->lpVtbl -> put_bszComment(This,NewVal) #define IBrokConfig_get_bPwdCookiePersist(This,pRetVal) \ (This)->lpVtbl -> get_bPwdCookiePersist(This,pRetVal) #define IBrokConfig_put_bPwdCookiePersist(This,NewVal) \ (This)->lpVtbl -> put_bPwdCookiePersist(This,NewVal) #define IBrokConfig_get_bszRealm(This,pRetVal) \ (This)->lpVtbl -> get_bszRealm(This,pRetVal) #define IBrokConfig_put_bszRealm(This,NewVal) \ (This)->lpVtbl -> put_bszRealm(This,NewVal) #define IBrokConfig_get_lTokenCacheTimeout(This,pRetVal) \ (This)->lpVtbl -> get_lTokenCacheTimeout(This,pRetVal) #define IBrokConfig_put_lTokenCacheTimeout(This,NewVal) \ (This)->lpVtbl -> put_lTokenCacheTimeout(This,NewVal) #define IBrokConfig_get_bszTokenCreatorDll(This,pRetVal) \ (This)->lpVtbl -> get_bszTokenCreatorDll(This,pRetVal) #define IBrokConfig_put_bszTokenCreatorDll(This,NewVal) \ (This)->lpVtbl -> put_bszTokenCreatorDll(This,NewVal) #define IBrokConfig_get_bDirty(This,pRetVal) \ (This)->lpVtbl -> get_bDirty(This,pRetVal) #endif /* COBJMACROS */ #endif /* C style interface */ /* [hidden] */ HRESULT STDMETHODCALLTYPE IBrokConfig_LoadDefaults_Proxy( IBrokConfig __RPC_FAR * This, LONG lVirtServId); void __RPC_STUB IBrokConfig_LoadDefaults_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokConfig_GetConfig_Proxy( IBrokConfig __RPC_FAR * This, LONG lVirtServId); void __RPC_STUB IBrokConfig_GetConfig_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokConfig_SetConfig_Proxy( IBrokConfig __RPC_FAR * This); void __RPC_STUB IBrokConfig_SetConfig_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokConfig_CheckAcct_Proxy( IBrokConfig __RPC_FAR * This, BSTR bszDomain, BSTR bszName, BSTR bszPassword); void __RPC_STUB IBrokConfig_CheckAcct_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_lVirtServId_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_lVirtServId_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_lVirtServId_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); void __RPC_STUB IBrokConfig_put_lVirtServId_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bLocal_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bLocal_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bLocal_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); void __RPC_STUB IBrokConfig_put_bLocal_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszServerName_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszServerName_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszServerName_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszServerName_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_lPort_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_lPort_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_lPort_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); void __RPC_STUB IBrokConfig_put_lPort_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bSecure_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bSecure_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bSecure_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); void __RPC_STUB IBrokConfig_put_bSecure_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_lSecurePort_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_lSecurePort_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_lSecurePort_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); void __RPC_STUB IBrokConfig_put_lSecurePort_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_lTimeLimit_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_lTimeLimit_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_lTimeLimit_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); void __RPC_STUB IBrokConfig_put_lTimeLimit_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_lSizeLimit_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_lSizeLimit_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_lSizeLimit_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); void __RPC_STUB IBrokConfig_put_lSizeLimit_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszBaseDN_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszBaseDN_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszBaseDN_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszBaseDN_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_lCacheTimeout_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_lCacheTimeout_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_lCacheTimeout_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); void __RPC_STUB IBrokConfig_put_lCacheTimeout_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszGroupPrefix_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszGroupPrefix_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszGroupPrefix_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszGroupPrefix_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bCreateGroups_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bCreateGroups_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bCreateGroups_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); void __RPC_STUB IBrokConfig_put_bCreateGroups_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszDomain_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszDomain_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszDomain_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszDomain_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszDsName_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszDsName_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszDsName_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszDsName_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszDsPwd_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszDsPwd_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszDsPwd_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszDsPwd_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszProxyName_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszProxyName_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszProxyName_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszProxyName_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszProxyPwd_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszProxyPwd_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszProxyPwd_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszProxyPwd_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszProxyDomain_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszProxyDomain_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszProxyDomain_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszProxyDomain_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bUseTrackCookie_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bUseTrackCookie_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bUseTrackCookie_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); void __RPC_STUB IBrokConfig_put_bUseTrackCookie_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_lPwdCookieTimeout_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_lPwdCookieTimeout_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_lPwdCookieTimeout_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); void __RPC_STUB IBrokConfig_put_lPwdCookieTimeout_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bEnabled_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bEnabled_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bEnabled_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); void __RPC_STUB IBrokConfig_put_bEnabled_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszComment_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszComment_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszComment_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszComment_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bPwdCookiePersist_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bPwdCookiePersist_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bPwdCookiePersist_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BOOL NewVal); void __RPC_STUB IBrokConfig_put_bPwdCookiePersist_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszRealm_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszRealm_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszRealm_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszRealm_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_lTokenCacheTimeout_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ LONG __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_lTokenCacheTimeout_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_lTokenCacheTimeout_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ LONG NewVal); void __RPC_STUB IBrokConfig_put_lTokenCacheTimeout_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bszTokenCreatorDll_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BSTR __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bszTokenCreatorDll_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propput] */ HRESULT STDMETHODCALLTYPE IBrokConfig_put_bszTokenCreatorDll_Proxy( IBrokConfig __RPC_FAR * This, /* [in] */ BSTR NewVal); void __RPC_STUB IBrokConfig_put_bszTokenCreatorDll_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); /* [id][propget] */ HRESULT STDMETHODCALLTYPE IBrokConfig_get_bDirty_Proxy( IBrokConfig __RPC_FAR * This, /* [retval][out] */ BOOL __RPC_FAR *pRetVal); void __RPC_STUB IBrokConfig_get_bDirty_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); #endif /* __IBrokConfig_INTERFACE_DEFINED__ */ #ifndef __IBrokServers_INTERFACE_DEFINED__ #define __IBrokServers_INTERFACE_DEFINED__ /**************************************** * Generated header for interface: IBrokServers * at Wed Apr 22 19:48:30 1998 * using MIDL 3.01.75 ****************************************/ /* [unique][helpstring][dual][uuid][object] */ EXTERN_C const IID IID_IBrokServers; #if defined(__cplusplus) && !defined(CINTERFACE) interface DECLSPEC_UUID("099226a0-c4a7-11d0-bbda-00c04fb615e5") IBrokServers : public IDispatch { public: virtual HRESULT STDMETHODCALLTYPE Init( void) = 0; virtual HRESULT STDMETHODCALLTYPE HasWritePrivilege( void) = 0; virtual HRESULT STDMETHODCALLTYPE HasNTAdminPrivilege( void) = 0; virtual HRESULT STDMETHODCALLTYPE CreateServer( /* [out] */ VARIANT __RPC_FAR *plVirtServId) = 0; virtual HRESULT STDMETHODCALLTYPE DeleteServer( LONG lVirtServId) = 0; virtual HRESULT STDMETHODCALLTYPE StartServer( LONG lVirtServId) = 0; virtual HRESULT STDMETHODCALLTYPE StopServer( LONG lVirtServId) = 0; virtual HRESULT STDMETHODCALLTYPE GetServers( /* [out][in] */ VARIANT __RPC_FAR *plVirtServIds, /* [out][in] */ VARIANT __RPC_FAR *pComments) = 0; virtual HRESULT STDMETHODCALLTYPE MapToBroker( BSTR bszServiceName, LONG lVirtServId, LONG lVirtBrokId) = 0; virtual HRESULT STDMETHODCALLTYPE ClearMapping( BSTR bszServiceName, LONG lVirtServId) = 0; virtual HRESULT STDMETHODCALLTYPE MappedTo( BSTR bszServiceName, LONG lVirtServId, /* [out][in] */ VARIANT __RPC_FAR *plVirtBrokId, /* [out][in] */ VARIANT __RPC_FAR *pbszComment) = 0; virtual HRESULT STDMETHODCALLTYPE SetAuthTypes( BSTR bszPath, LONG lTypes) = 0; virtual HRESULT STDMETHODCALLTYPE GetAuthTypes( BSTR bszPath, /* [retval][out] */ LONG __RPC_FAR *plTypes) = 0; virtual HRESULT STDMETHODCALLTYPE GetSecurityMode( BSTR bszServiceName, LONG lVirtServId, /* [retval][out] */ BOOL __RPC_FAR *pbNTSecurity) = 0; }; #else /* C style interface */ typedef struct IBrokServersVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( IBrokServers __RPC_FAR * This, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( IBrokServers __RPC_FAR * This); ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( IBrokServers __RPC_FAR * This); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( IBrokServers __RPC_FAR * This, /* [out] */ UINT __RPC_FAR *pctinfo); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( IBrokServers __RPC_FAR * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( IBrokServers __RPC_FAR * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, /* [in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( IBrokServers __RPC_FAR * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, /* [out] */ VARIANT __RPC_FAR *pVarResult, /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, /* [out] */ UINT __RPC_FAR *puArgErr); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Init )( IBrokServers __RPC_FAR * This); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *HasWritePrivilege )( IBrokServers __RPC_FAR * This); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *HasNTAdminPrivilege )( IBrokServers __RPC_FAR * This); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreateServer )( IBrokServers __RPC_FAR * This, /* [out] */ VARIANT __RPC_FAR *plVirtServId); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *DeleteServer )( IBrokServers __RPC_FAR * This, LONG lVirtServId); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *StartServer )( IBrokServers __RPC_FAR * This, LONG lVirtServId); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *StopServer )( IBrokServers __RPC_FAR * This, LONG lVirtServId); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetServers )( IBrokServers __RPC_FAR * This, /* [out][in] */ VARIANT __RPC_FAR *plVirtServIds, /* [out][in] */ VARIANT __RPC_FAR *pComments); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *MapToBroker )( IBrokServers __RPC_FAR * This, BSTR bszServiceName, LONG lVirtServId, LONG lVirtBrokId); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ClearMapping )( IBrokServers __RPC_FAR * This, BSTR bszServiceName, LONG lVirtServId); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *MappedTo )( IBrokServers __RPC_FAR * This, BSTR bszServiceName, LONG lVirtServId, /* [out][in] */ VARIANT __RPC_FAR *plVirtBrokId, /* [out][in] */ VARIANT __RPC_FAR *pbszComment); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetAuthTypes )( IBrokServers __RPC_FAR * This, BSTR bszPath, LONG lTypes); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetAuthTypes )( IBrokServers __RPC_FAR * This, BSTR bszPath, /* [retval][out] */ LONG __RPC_FAR *plTypes); HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSecurityMode )( IBrokServers __RPC_FAR * This, BSTR bszServiceName, LONG lVirtServId, /* [retval][out] */ BOOL __RPC_FAR *pbNTSecurity); END_INTERFACE } IBrokServersVtbl; interface IBrokServers { CONST_VTBL struct IBrokServersVtbl __RPC_FAR *lpVtbl; }; #ifdef COBJMACROS #define IBrokServers_QueryInterface(This,riid,ppvObject) \ (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) #define IBrokServers_AddRef(This) \ (This)->lpVtbl -> AddRef(This) #define IBrokServers_Release(This) \ (This)->lpVtbl -> Release(This) #define IBrokServers_GetTypeInfoCount(This,pctinfo) \ (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) #define IBrokServers_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) #define IBrokServers_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) #define IBrokServers_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) #define IBrokServers_Init(This) \ (This)->lpVtbl -> Init(This) #define IBrokServers_HasWritePrivilege(This) \ (This)->lpVtbl -> HasWritePrivilege(This) #define IBrokServers_HasNTAdminPrivilege(This) \ (This)->lpVtbl -> HasNTAdminPrivilege(This) #define IBrokServers_CreateServer(This,plVirtServId) \ (This)->lpVtbl -> CreateServer(This,plVirtServId) #define IBrokServers_DeleteServer(This,lVirtServId) \ (This)->lpVtbl -> DeleteServer(This,lVirtServId) #define IBrokServers_StartServer(This,lVirtServId) \ (This)->lpVtbl -> StartServer(This,lVirtServId) #define IBrokServers_StopServer(This,lVirtServId) \ (This)->lpVtbl -> StopServer(This,lVirtServId) #define IBrokServers_GetServers(This,plVirtServIds,pComments) \ (This)->lpVtbl -> GetServers(This,plVirtServIds,pComments) #define IBrokServers_MapToBroker(This,bszServiceName,lVirtServId,lVirtBrokId) \ (This)->lpVtbl -> MapToBroker(This,bszServiceName,lVirtServId,lVirtBrokId) #define IBrokServers_ClearMapping(This,bszServiceName,lVirtServId) \ (This)->lpVtbl -> ClearMapping(This,bszServiceName,lVirtServId) #define IBrokServers_MappedTo(This,bszServiceName,lVirtServId,plVirtBrokId,pbszComment) \ (This)->lpVtbl -> MappedTo(This,bszServiceName,lVirtServId,plVirtBrokId,pbszComment) #define IBrokServers_SetAuthTypes(This,bszPath,lTypes) \ (This)->lpVtbl -> SetAuthTypes(This,bszPath,lTypes) #define IBrokServers_GetAuthTypes(This,bszPath,plTypes) \ (This)->lpVtbl -> GetAuthTypes(This,bszPath,plTypes) #define IBrokServers_GetSecurityMode(This,bszServiceName,lVirtServId,pbNTSecurity) \ (This)->lpVtbl -> GetSecurityMode(This,bszServiceName,lVirtServId,pbNTSecurity) #endif /* COBJMACROS */ #endif /* C style interface */ HRESULT STDMETHODCALLTYPE IBrokServers_Init_Proxy( IBrokServers __RPC_FAR * This); void __RPC_STUB IBrokServers_Init_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_HasWritePrivilege_Proxy( IBrokServers __RPC_FAR * This); void __RPC_STUB IBrokServers_HasWritePrivilege_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_HasNTAdminPrivilege_Proxy( IBrokServers __RPC_FAR * This); void __RPC_STUB IBrokServers_HasNTAdminPrivilege_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_CreateServer_Proxy( IBrokServers __RPC_FAR * This, /* [out] */ VARIANT __RPC_FAR *plVirtServId); void __RPC_STUB IBrokServers_CreateServer_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_DeleteServer_Proxy( IBrokServers __RPC_FAR * This, LONG lVirtServId); void __RPC_STUB IBrokServers_DeleteServer_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_StartServer_Proxy( IBrokServers __RPC_FAR * This, LONG lVirtServId); void __RPC_STUB IBrokServers_StartServer_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_StopServer_Proxy( IBrokServers __RPC_FAR * This, LONG lVirtServId); void __RPC_STUB IBrokServers_StopServer_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_GetServers_Proxy( IBrokServers __RPC_FAR * This, /* [out][in] */ VARIANT __RPC_FAR *plVirtServIds, /* [out][in] */ VARIANT __RPC_FAR *pComments); void __RPC_STUB IBrokServers_GetServers_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_MapToBroker_Proxy( IBrokServers __RPC_FAR * This, BSTR bszServiceName, LONG lVirtServId, LONG lVirtBrokId); void __RPC_STUB IBrokServers_MapToBroker_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_ClearMapping_Proxy( IBrokServers __RPC_FAR * This, BSTR bszServiceName, LONG lVirtServId); void __RPC_STUB IBrokServers_ClearMapping_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_MappedTo_Proxy( IBrokServers __RPC_FAR * This, BSTR bszServiceName, LONG lVirtServId, /* [out][in] */ VARIANT __RPC_FAR *plVirtBrokId, /* [out][in] */ VARIANT __RPC_FAR *pbszComment); void __RPC_STUB IBrokServers_MappedTo_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_SetAuthTypes_Proxy( IBrokServers __RPC_FAR * This, BSTR bszPath, LONG lTypes); void __RPC_STUB IBrokServers_SetAuthTypes_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_GetAuthTypes_Proxy( IBrokServers __RPC_FAR * This, BSTR bszPath, /* [retval][out] */ LONG __RPC_FAR *plTypes); void __RPC_STUB IBrokServers_GetAuthTypes_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); HRESULT STDMETHODCALLTYPE IBrokServers_GetSecurityMode_Proxy( IBrokServers __RPC_FAR * This, BSTR bszServiceName, LONG lVirtServId, /* [retval][out] */ BOOL __RPC_FAR *pbNTSecurity); void __RPC_STUB IBrokServers_GetSecurityMode_Stub( IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase); #endif /* __IBrokServers_INTERFACE_DEFINED__ */ #ifndef __BrokConfigLib_LIBRARY_DEFINED__ #define __BrokConfigLib_LIBRARY_DEFINED__ /**************************************** * Generated header for library: BrokConfigLib * at Wed Apr 22 19:48:30 1998 * using MIDL 3.01.75 ****************************************/ /* [helpstring][version][uuid] */ EXTERN_C const IID LIBID_BrokConfigLib; #ifdef __cplusplus EXTERN_C const CLSID CLSID_BrokConfig; class DECLSPEC_UUID("c78fa6e6-c4ac-11d0-bbda-00c04fb615e5") BrokConfig; #endif #ifdef __cplusplus EXTERN_C const CLSID CLSID_BrokServers; class DECLSPEC_UUID("cd8f114e-c4ac-11d0-bbda-00c04fb615e5") BrokServers; #endif #endif /* __BrokConfigLib_LIBRARY_DEFINED__ */ /**************************************** * Generated header for interface: __MIDL_itf_brokcfg_0137 * at Wed Apr 22 19:48:30 1998 * using MIDL 3.01.75 ****************************************/ /* [local] */ DEFINE_GUID(LIBID_BrokConfigLib, 0xa0341532,0xc4ac,0x11d0,0xbb,0xda,0x00,0xc0,0x4f,0xb6,0x15,0xe5); DEFINE_GUID(IID_IBrokConfig, 0x19edab12,0xc4a4,0x11d0,0xbb,0xda,0x00,0xc0,0x4f,0xb6,0x15,0xe5); DEFINE_GUID(IID_IBrokServers, 0x099226a0,0xc4a7,0x11d0,0xbb,0xda,0x00,0xc0,0x4f,0xb6,0x15,0xe5); DEFINE_GUID(CLSID_BrokConfig, 0xc78fa6e6,0xc4ac,0x11d0,0xbb,0xda,0x00,0xc0,0x4f,0xb6,0x15,0xe5); DEFINE_GUID(CLSID_BrokServers, 0xcd8f114e,0xc4ac,0x11d0,0xbb,0xda,0x00,0xc0,0x4f,0xb6,0x15,0xe5); extern RPC_IF_HANDLE __MIDL_itf_brokcfg_0137_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_brokcfg_0137_v0_0_s_ifspec; /* Additional Prototypes for ALL interfaces */ unsigned long __RPC_USER BSTR_UserSize( unsigned long __RPC_FAR *, unsigned long , BSTR __RPC_FAR * ); unsigned char __RPC_FAR * __RPC_USER BSTR_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * ); unsigned char __RPC_FAR * __RPC_USER BSTR_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * ); void __RPC_USER BSTR_UserFree( unsigned long __RPC_FAR *, BSTR __RPC_FAR * ); unsigned long __RPC_USER VARIANT_UserSize( unsigned long __RPC_FAR *, unsigned long , VARIANT __RPC_FAR * ); unsigned char __RPC_FAR * __RPC_USER VARIANT_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, VARIANT __RPC_FAR * ); unsigned char __RPC_FAR * __RPC_USER VARIANT_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, VARIANT __RPC_FAR * ); void __RPC_USER VARIANT_UserFree( unsigned long __RPC_FAR *, VARIANT __RPC_FAR * ); /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif #pragma option pop /*P_O_Pop*/
34.20141
138
0.64871
[ "object" ]
03bf587396d70aa253583045fa5f8a546516a1f9
1,118
h
C
game/include/BigAlan.h
unbgames/DigAlanDig
0e78ee6ef2d253c2d32db0835b24503a38850057
[ "Zlib" ]
null
null
null
game/include/BigAlan.h
unbgames/DigAlanDig
0e78ee6ef2d253c2d32db0835b24503a38850057
[ "Zlib" ]
null
null
null
game/include/BigAlan.h
unbgames/DigAlanDig
0e78ee6ef2d253c2d32db0835b24503a38850057
[ "Zlib" ]
5
2018-08-28T01:50:25.000Z
2018-09-10T13:03:45.000Z
#ifndef BIGALAN_H #define BIGALAN_H #include "Component.h" #include "Sprite.h" #include "config.h" class BigAlan : public Component { public: enum BAState { TRASH = 0, DECENT, GOOD, STARTER, MAXSTATE }; explicit BigAlan(GameObject &associated) : Component(associated) { sprite = associated.GetComponent<Sprite *>(); state[BAState::STARTER] = {ASSETS_PATH("/img/mooda.png"), 2, 2, -1}; state[BAState::GOOD] = {ASSETS_PATH("/img/mooda.png"), 2, 2, -1}; state[BAState::DECENT] = {ASSETS_PATH("/img/mood2.png"), 1, 1, 1}; state[BAState::TRASH] = {ASSETS_PATH("/img/mood3.png"), 1, 1, 1}; } void Update(float dt); void RhythmUpdate() { associated.box.y += offset; offset = -offset; } void Render(Common::Layer layer) const {} private: Sprite::SpriteState state[BAState::MAXSTATE]; BAState currentState = BAState::STARTER; int offset = 0, oldCombo = 0; Sprite *sprite; }; class SpriteState { public: std::string file; int frameCount; int totalFrameCount; float frameTime; }; #endif // BIGALAN_H
26.619048
76
0.631485
[ "render" ]
03c92071b492ce492b6793425ac49905ab9f35ab
9,466
h
C
fluorender/FluoRender/ClippingView.h
takashi310/VVD_Viewer
9d813ae53682167a22cb9f480917e042c905edbd
[ "MIT" ]
20
2016-06-22T04:14:55.000Z
2022-03-21T15:06:48.000Z
fluorender/FluoRender/ClippingView.h
takashi310/VVD_Viewer
9d813ae53682167a22cb9f480917e042c905edbd
[ "MIT" ]
5
2019-06-06T18:47:10.000Z
2022-03-31T14:05:18.000Z
fluorender/FluoRender/ClippingView.h
JaneliaSciComp/VVDViewer
a31fa6eea98c122c96b2c1b23e70a47daaf9afa7
[ "MIT" ]
5
2017-07-11T22:28:45.000Z
2021-12-03T22:21:08.000Z
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2014 Scientific Computing and Imaging Institute, University of Utah. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "DLLExport.h" #include "DataManager.h" #include <wx/wx.h> #include <wx/panel.h> #include <wx/slider.h> #include <wx/spinbutt.h> #ifndef _CLIPPINGVIEW_H_ #define _CLIPPINGVIEW_H_ //plane modes #define PM_NORMAL 0 #define PM_FRAME 1 #define PM_LOWTRANS 2 #define PM_LOWTRANSBACK 3 #define PM_NORMALBACK 4 class EXPORT_API ClippingView: public wxPanel { enum { ID_LinkChannelsChk = wxID_HIGHEST+1, ID_PlaneModesCombo, ID_RotatePlanesChk, ID_ClipResetBtn, ID_SetZeroBtn, ID_RotResetBtn, //rotation sliders ID_XRotSldr, ID_YRotSldr, ID_ZRotSldr, ID_XRotText, ID_YRotText, ID_ZRotText, ID_XRotSpin, ID_YRotSpin, ID_ZRotSpin, //clipping sliders ID_X1ClipSldr, ID_X2ClipSldr, ID_Y1ClipSldr, ID_Y2ClipSldr, ID_Z1ClipSldr, ID_Z2ClipSldr, ID_X1ClipText, ID_X2ClipText, ID_Y1ClipText, ID_Y2ClipText, ID_Z1ClipText, ID_Z2ClipText, ID_LinkXChk, ID_LinkYChk, ID_LinkZChk, ID_YZClipBtn, ID_XZClipBtn, ID_XYClipBtn, ID_YZDistText, ID_XZDistText, ID_XYDistText, ID_CLTimer, ID_FixRotsChk, ID_HoldPlanesChk }; public: ClippingView(wxWindow* frame, wxWindow* parent, wxWindowID id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=0, const wxString& name="ClippingView"); ~ClippingView(); void SetVolumeData(VolumeData* vd); void SetMeshData(MeshData* md); void SetDataManager(DataManager* mgr); int GetSelType(); VolumeData* GetVolumeData(); MeshData* GetMeshData(); void RefreshVRenderViews(bool interactive=false); void RefreshVRenderViewsOverlay(); void ClearData(); bool GetChannLink() { return m_link_channels ? m_link_channels->GetValue() : false; } void SetChannLink(bool chann) { m_link_channels->SetValue(chann); } bool GetHoldPlanes() { return m_hold_planes; } int GetPlaneMode() { return m_plane_mode; } bool GetXLink() { return m_link_x_chk->GetValue(); } bool GetYLink() { return m_link_y_chk->GetValue(); } bool GetZLink() { return m_link_z_chk->GetValue(); } void SetXLink(bool link) { m_link_x_chk->SetValue(link); m_link_x = link; wxCommandEvent ev; OnLinkXCheck(ev); } void SetYLink(bool link) { m_link_y_chk->SetValue(link); m_link_y = link; wxCommandEvent ev; OnLinkYCheck(ev); } void SetZLink(bool link) { m_link_z_chk->SetValue(link); m_link_z = link; wxCommandEvent ev; OnLinkZCheck(ev); } void SetClippingPlaneRotations(double rotx, double roty, double rotz, bool update_only_ui=false) { m_update_only_ui = update_only_ui; m_x_rot_sldr->SetValue(int(rotx)); m_y_rot_sldr->SetValue(int(roty)); m_z_rot_sldr->SetValue(int(rotz)); m_x_rot_text->SetValue(wxString::Format("%.1f", rotx)); m_y_rot_text->SetValue(wxString::Format("%.1f", roty)); m_z_rot_text->SetValue(wxString::Format("%.1f", rotz)); m_update_only_ui = false; } void SetPlaneMode(int mode) { int elem_num = m_plane_mode_combo->GetStrings().size(); if (mode < 0 || mode >= elem_num) return; m_plane_mode = mode; m_plane_mode_combo->SetSelection(mode); } //move linked clipping planes //dir: 0-lower; 1-higher void MoveLinkedClippingPlanes(int dir); void SaveDefault(); void LoadDefault(); void SetUpdateOnlyUIs(bool val) { m_update_only_ui = val; } bool GetUpdateOnlyUIs() { return m_update_only_ui; } void SetFixRotations(bool val) { m_fix_rots = val; } bool GetFixRotations() { return m_fix_rots; } int GetXdist(); int GetYdist(); int GetZdist(); void SetLinkedX1Param(double p) { m_linked_plane_params[0] = p; } void SetLinkedX2Param(double p) { m_linked_plane_params[1] = p; } void SetLinkedY1Param(double p) { m_linked_plane_params[2] = p; } void SetLinkedY2Param(double p) { m_linked_plane_params[3] = p; } void SetLinkedZ1Param(double p) { m_linked_plane_params[4] = p; } void SetLinkedZ2Param(double p) { m_linked_plane_params[5] = p; } double GetLinkedX1Param() { return m_linked_plane_params[0]; } double GetLinkedX2Param() { return m_linked_plane_params[1]; } double GetLinkedY1Param() { return m_linked_plane_params[2]; } double GetLinkedY2Param() { return m_linked_plane_params[3]; } double GetLinkedZ1Param() { return m_linked_plane_params[4]; } double GetLinkedZ2Param() { return m_linked_plane_params[5]; } void CalcAndSetCombinedClippingPlanes(); void CalcBoundingBoxDemensions(double &w, double &h, double &d); private: wxWindow* m_frame; int m_sel_type; //curent selection type VolumeData* m_vd; //current volume data MeshData* m_md; //current mesh data DataManager* m_mgr; //manage all if clipping planes are synced bool m_draw_clip; bool m_hold_planes; int m_plane_mode; int m_x_sldr_dist; int m_y_sldr_dist; int m_z_sldr_dist; bool m_link_x; bool m_link_y; bool m_link_z; bool m_fix_rots; bool m_update_only_ui; bool m_mouse_in; //1st line wxCheckBox *m_link_channels; wxComboBox *m_plane_mode_combo; wxButton *m_clip_reset_btn; //fix plane rotations wxCheckBox* m_fix_rots_chk; wxCheckBox* m_hold_planes_chk; wxButton *m_set_zero_btn; wxButton *m_rot_reset_btn; //sliders for rotating clipping planes wxSlider *m_x_rot_sldr; wxSlider *m_y_rot_sldr; wxSlider *m_z_rot_sldr; wxTextCtrl *m_x_rot_text; wxTextCtrl *m_y_rot_text; wxTextCtrl *m_z_rot_text; wxSpinButton* m_x_rot_spin; wxSpinButton* m_y_rot_spin; wxSpinButton* m_z_rot_spin; //sliders for clipping planes //x1 wxSlider *m_x1_clip_sldr; wxTextCtrl *m_x1_clip_text; //x2 wxSlider *m_x2_clip_sldr; wxTextCtrl *m_x2_clip_text; //y1 wxSlider *m_y1_clip_sldr; wxTextCtrl *m_y1_clip_text; //y2 wxSlider *m_y2_clip_sldr; wxTextCtrl *m_y2_clip_text; //z1 wxSlider *m_z1_clip_sldr; wxTextCtrl *m_z1_clip_text; //z2 wxSlider *m_z2_clip_sldr; wxTextCtrl *m_z2_clip_text; //keep 1 panel for sizing reasons wxPanel * m_xpanel; //highlighters wxStaticText * m_xBar, * m_yBar, * m_zBar; //linkers wxCheckBox *m_link_x_chk; wxCheckBox *m_link_y_chk; wxCheckBox *m_link_z_chk; //buttons wxButton *m_yz_clip_btn; wxButton *m_xz_clip_btn; wxButton *m_xy_clip_btn; //distance text wxTextCtrl *m_yz_dist_text; wxTextCtrl *m_xz_dist_text; wxTextCtrl *m_xy_dist_text; wxTimer *m_timer; double m_linked_plane_params[6]; private: void GetSettings(); void OnIdle(wxTimerEvent& event); void OnLinkChannelsCheck(wxCommandEvent &event); void OnPlaneModesCombo(wxCommandEvent &event); void OnClipResetBtn(wxCommandEvent &event); void EnableAll(); void DisableAll(); void EnableRotations(); void DisableRotations(); void OnX1ClipChange(wxScrollEvent &event); void OnX2ClipChange(wxScrollEvent &event); void OnY1ClipChange(wxScrollEvent &event); void OnY2ClipChange(wxScrollEvent &event); void OnZ1ClipChange(wxScrollEvent &event); void OnZ2ClipChange(wxScrollEvent &event); void OnX1ClipEdit(wxCommandEvent &event); void OnX2ClipEdit(wxCommandEvent &event); void OnY1ClipEdit(wxCommandEvent &event); void OnY2ClipEdit(wxCommandEvent &event); void OnZ1ClipEdit(wxCommandEvent &event); void OnZ2ClipEdit(wxCommandEvent &event); void OnLinkXCheck(wxCommandEvent &event); void OnLinkYCheck(wxCommandEvent &event); void OnLinkZCheck(wxCommandEvent &event); void OnSetZeroBtn(wxCommandEvent &event); void OnRotResetBtn(wxCommandEvent &event); void OnFixRotsCheck(wxCommandEvent& event); void OnHoldPlanesCheck(wxCommandEvent& event); void OnXRotChange(wxScrollEvent &event); void OnYRotChange(wxScrollEvent &event); void OnZRotChange(wxScrollEvent &event); void OnXRotEdit(wxCommandEvent &event); void OnYRotEdit(wxCommandEvent &event); void OnZRotEdit(wxCommandEvent &event); //spin buttons void OnXRotSpinUp(wxSpinEvent& event); void OnXRotSpinDown(wxSpinEvent& event); void OnYRotSpinUp(wxSpinEvent& event); void OnYRotSpinDown(wxSpinEvent& event); void OnZRotSpinUp(wxSpinEvent& event); void OnZRotSpinDown(wxSpinEvent& event); //mouse void OnSliderRClick(wxCommandEvent& event); //clip buttons void OnYZClipBtn(wxCommandEvent& event); void OnXZClipBtn(wxCommandEvent& event); void OnXYClipBtn(wxCommandEvent& event); //key down void OnSliderKeyDown(wxKeyEvent& event); DECLARE_EVENT_TABLE(); }; #endif//_CLIPPINGVIEW_H_
25.722826
97
0.759349
[ "mesh" ]
03d40f73443ab7fbc200884da530e68f0f40ed3c
15,358
h
C
3rdParty/V8/v5.7.492.77/src/interpreter/bytecode-pipeline.h
sita1999/arangodb
6a4f462fa209010cd064f99e63d85ce1d432c500
[ "Apache-2.0" ]
27
2017-12-14T13:48:25.000Z
2020-12-31T15:46:55.000Z
3rdParty/V8/v5.7.492.77/src/interpreter/bytecode-pipeline.h
lipper/arangodb
66ea1fd4946668192e3f0d1060f0844f324ad7b8
[ "Apache-2.0" ]
null
null
null
3rdParty/V8/v5.7.492.77/src/interpreter/bytecode-pipeline.h
lipper/arangodb
66ea1fd4946668192e3f0d1060f0844f324ad7b8
[ "Apache-2.0" ]
3
2019-01-14T12:12:27.000Z
2019-06-07T09:47:00.000Z
// Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_INTERPRETER_BYTECODE_PIPELINE_H_ #define V8_INTERPRETER_BYTECODE_PIPELINE_H_ #include "src/base/compiler-specific.h" #include "src/globals.h" #include "src/interpreter/bytecode-register-allocator.h" #include "src/interpreter/bytecode-register.h" #include "src/interpreter/bytecodes.h" #include "src/objects.h" #include "src/zone/zone-containers.h" namespace v8 { namespace internal { namespace interpreter { class BytecodeLabel; class BytecodeNode; class BytecodeSourceInfo; // Interface for bytecode pipeline stages. class BytecodePipelineStage { public: virtual ~BytecodePipelineStage() {} // Write bytecode node |node| into pipeline. The node is only valid // for the duration of the call. Callee's should clone it if // deferring Write() to the next stage. virtual void Write(BytecodeNode* node) = 0; // Write jump bytecode node |node| which jumps to |label| into pipeline. // The node and label are only valid for the duration of the call. This call // implicitly ends the current basic block so should always write to the next // stage. virtual void WriteJump(BytecodeNode* node, BytecodeLabel* label) = 0; // Binds |label| to the current bytecode location. This call implicitly // ends the current basic block and so any deferred bytecodes should be // written to the next stage. virtual void BindLabel(BytecodeLabel* label) = 0; // Binds |label| to the location of |target|. This call implicitly // ends the current basic block and so any deferred bytecodes should be // written to the next stage. virtual void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) = 0; // Flush the pipeline and generate a bytecode array. virtual Handle<BytecodeArray> ToBytecodeArray( Isolate* isolate, int register_count, int parameter_count, Handle<FixedArray> handler_table) = 0; }; // Source code position information. class BytecodeSourceInfo final { public: static const int kUninitializedPosition = -1; BytecodeSourceInfo() : position_type_(PositionType::kNone), source_position_(kUninitializedPosition) {} BytecodeSourceInfo(int source_position, bool is_statement) : position_type_(is_statement ? PositionType::kStatement : PositionType::kExpression), source_position_(source_position) { DCHECK_GE(source_position, 0); } // Makes instance into a statement position. void MakeStatementPosition(int source_position) { // Statement positions can be replaced by other statement // positions. For example , "for (x = 0; x < 3; ++x) 7;" has a // statement position associated with 7 but no bytecode associated // with it. Then Next is emitted after the body and has // statement position and overrides the existing one. position_type_ = PositionType::kStatement; source_position_ = source_position; } // Makes instance into an expression position. Instance should not // be a statement position otherwise it could be lost and impair the // debugging experience. void MakeExpressionPosition(int source_position) { DCHECK(!is_statement()); position_type_ = PositionType::kExpression; source_position_ = source_position; } // Forces an instance into an expression position. void ForceExpressionPosition(int source_position) { position_type_ = PositionType::kExpression; source_position_ = source_position; } int source_position() const { DCHECK(is_valid()); return source_position_; } bool is_statement() const { return position_type_ == PositionType::kStatement; } bool is_expression() const { return position_type_ == PositionType::kExpression; } bool is_valid() const { return position_type_ != PositionType::kNone; } void set_invalid() { position_type_ = PositionType::kNone; source_position_ = kUninitializedPosition; } bool operator==(const BytecodeSourceInfo& other) const { return position_type_ == other.position_type_ && source_position_ == other.source_position_; } bool operator!=(const BytecodeSourceInfo& other) const { return position_type_ != other.position_type_ || source_position_ != other.source_position_; } private: enum class PositionType : uint8_t { kNone, kExpression, kStatement }; PositionType position_type_; int source_position_; }; // A container for a generated bytecode, it's operands, and source information. // These must be allocated by a BytecodeNodeAllocator instance. class V8_EXPORT_PRIVATE BytecodeNode final : NON_EXPORTED_BASE(ZoneObject) { public: INLINE(BytecodeNode(Bytecode bytecode, BytecodeSourceInfo source_info = BytecodeSourceInfo())) : bytecode_(bytecode), operand_count_(0), operand_scale_(OperandScale::kSingle), source_info_(source_info) { DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), operand_count()); } INLINE(BytecodeNode(Bytecode bytecode, uint32_t operand0, BytecodeSourceInfo source_info = BytecodeSourceInfo())) : bytecode_(bytecode), operand_count_(1), operand_scale_(OperandScale::kSingle), source_info_(source_info) { DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), operand_count()); SetOperand(0, operand0); } INLINE(BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1, BytecodeSourceInfo source_info = BytecodeSourceInfo())) : bytecode_(bytecode), operand_count_(2), operand_scale_(OperandScale::kSingle), source_info_(source_info) { DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), operand_count()); SetOperand(0, operand0); SetOperand(1, operand1); } INLINE(BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1, uint32_t operand2, BytecodeSourceInfo source_info = BytecodeSourceInfo())) : bytecode_(bytecode), operand_count_(3), operand_scale_(OperandScale::kSingle), source_info_(source_info) { DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), operand_count()); SetOperand(0, operand0); SetOperand(1, operand1); SetOperand(2, operand2); } INLINE(BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1, uint32_t operand2, uint32_t operand3, BytecodeSourceInfo source_info = BytecodeSourceInfo())) : bytecode_(bytecode), operand_count_(4), operand_scale_(OperandScale::kSingle), source_info_(source_info) { DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), operand_count()); SetOperand(0, operand0); SetOperand(1, operand1); SetOperand(2, operand2); SetOperand(3, operand3); } #define DEFINE_BYTECODE_NODE_CREATOR(Name, ...) \ template <typename... Operands> \ INLINE(static BytecodeNode Name(BytecodeSourceInfo source_info, \ Operands... operands)) { \ return Create<Bytecode::k##Name, __VA_ARGS__>(source_info, operands...); \ } BYTECODE_LIST(DEFINE_BYTECODE_NODE_CREATOR) #undef DEFINE_BYTECODE_NODE_CREATOR // Replace the bytecode of this node with |bytecode| and keep the operands. void replace_bytecode(Bytecode bytecode) { DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode_), Bytecodes::NumberOfOperands(bytecode)); bytecode_ = bytecode; } void update_operand0(uint32_t operand0) { SetOperand(0, operand0); } // Print to stream |os|. void Print(std::ostream& os) const; // Transform to a node representing |new_bytecode| which has one // operand more than the current bytecode. void Transform(Bytecode new_bytecode, uint32_t extra_operand) { DCHECK_EQ(Bytecodes::NumberOfOperands(new_bytecode), Bytecodes::NumberOfOperands(bytecode()) + 1); DCHECK(Bytecodes::NumberOfOperands(bytecode()) < 1 || Bytecodes::GetOperandType(new_bytecode, 0) == Bytecodes::GetOperandType(bytecode(), 0)); DCHECK(Bytecodes::NumberOfOperands(bytecode()) < 2 || Bytecodes::GetOperandType(new_bytecode, 1) == Bytecodes::GetOperandType(bytecode(), 1)); DCHECK(Bytecodes::NumberOfOperands(bytecode()) < 3 || Bytecodes::GetOperandType(new_bytecode, 2) == Bytecodes::GetOperandType(bytecode(), 2)); DCHECK(Bytecodes::NumberOfOperands(bytecode()) < 4); bytecode_ = new_bytecode; operand_count_++; SetOperand(operand_count() - 1, extra_operand); } Bytecode bytecode() const { return bytecode_; } uint32_t operand(int i) const { DCHECK_LT(i, operand_count()); return operands_[i]; } const uint32_t* operands() const { return operands_; } int operand_count() const { return operand_count_; } OperandScale operand_scale() const { return operand_scale_; } const BytecodeSourceInfo& source_info() const { return source_info_; } void set_source_info(BytecodeSourceInfo source_info) { source_info_ = source_info; } bool operator==(const BytecodeNode& other) const; bool operator!=(const BytecodeNode& other) const { return !(*this == other); } private: template <Bytecode bytecode, AccumulatorUse accumulator_use, OperandType... operand_types> friend class BytecodeNodeBuilder; INLINE(BytecodeNode(Bytecode bytecode, int operand_count, OperandScale operand_scale, BytecodeSourceInfo source_info, uint32_t operand0 = 0, uint32_t operand1 = 0, uint32_t operand2 = 0, uint32_t operand3 = 0)) : bytecode_(bytecode), operand_count_(operand_count), operand_scale_(operand_scale), source_info_(source_info) { DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), operand_count); operands_[0] = operand0; operands_[1] = operand1; operands_[2] = operand2; operands_[3] = operand3; } template <Bytecode bytecode, AccumulatorUse accum_use> INLINE(static BytecodeNode Create(BytecodeSourceInfo source_info)) { return BytecodeNode(bytecode, 0, OperandScale::kSingle, source_info); } template <Bytecode bytecode, AccumulatorUse accum_use, OperandType operand0_type> INLINE(static BytecodeNode Create(BytecodeSourceInfo source_info, uint32_t operand0)) { DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 0), operand0_type); OperandScale scale = OperandScale::kSingle; scale = std::max(scale, ScaleForOperand<operand0_type>(operand0)); return BytecodeNode(bytecode, 1, scale, source_info, operand0); } template <Bytecode bytecode, AccumulatorUse accum_use, OperandType operand0_type, OperandType operand1_type> INLINE(static BytecodeNode Create(BytecodeSourceInfo source_info, uint32_t operand0, uint32_t operand1)) { DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 0), operand0_type); DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 1), operand1_type); OperandScale scale = OperandScale::kSingle; scale = std::max(scale, ScaleForOperand<operand0_type>(operand0)); scale = std::max(scale, ScaleForOperand<operand1_type>(operand1)); return BytecodeNode(bytecode, 2, scale, source_info, operand0, operand1); } template <Bytecode bytecode, AccumulatorUse accum_use, OperandType operand0_type, OperandType operand1_type, OperandType operand2_type> INLINE(static BytecodeNode Create(BytecodeSourceInfo source_info, uint32_t operand0, uint32_t operand1, uint32_t operand2)) { DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 0), operand0_type); DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 1), operand1_type); DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 2), operand2_type); OperandScale scale = OperandScale::kSingle; scale = std::max(scale, ScaleForOperand<operand0_type>(operand0)); scale = std::max(scale, ScaleForOperand<operand1_type>(operand1)); scale = std::max(scale, ScaleForOperand<operand2_type>(operand2)); return BytecodeNode(bytecode, 3, scale, source_info, operand0, operand1, operand2); } template <Bytecode bytecode, AccumulatorUse accum_use, OperandType operand0_type, OperandType operand1_type, OperandType operand2_type, OperandType operand3_type> INLINE(static BytecodeNode Create(BytecodeSourceInfo source_info, uint32_t operand0, uint32_t operand1, uint32_t operand2, uint32_t operand3)) { DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 0), operand0_type); DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 1), operand1_type); DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 2), operand2_type); DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 3), operand3_type); OperandScale scale = OperandScale::kSingle; scale = std::max(scale, ScaleForOperand<operand0_type>(operand0)); scale = std::max(scale, ScaleForOperand<operand1_type>(operand1)); scale = std::max(scale, ScaleForOperand<operand2_type>(operand2)); scale = std::max(scale, ScaleForOperand<operand3_type>(operand3)); return BytecodeNode(bytecode, 4, scale, source_info, operand0, operand1, operand2, operand3); } template <OperandType operand_type> INLINE(static OperandScale ScaleForOperand(uint32_t operand)) { if (BytecodeOperands::IsScalableUnsignedByte(operand_type)) { return Bytecodes::ScaleForUnsignedOperand(operand); } else if (BytecodeOperands::IsScalableSignedByte(operand_type)) { return Bytecodes::ScaleForSignedOperand(operand); } else { return OperandScale::kSingle; } } INLINE(void UpdateScaleForOperand(int operand_index, uint32_t operand)) { if (Bytecodes::OperandIsScalableSignedByte(bytecode(), operand_index)) { operand_scale_ = std::max(operand_scale_, Bytecodes::ScaleForSignedOperand(operand)); } else if (Bytecodes::OperandIsScalableUnsignedByte(bytecode(), operand_index)) { operand_scale_ = std::max(operand_scale_, Bytecodes::ScaleForUnsignedOperand(operand)); } } INLINE(void SetOperand(int operand_index, uint32_t operand)) { operands_[operand_index] = operand; UpdateScaleForOperand(operand_index, operand); } Bytecode bytecode_; uint32_t operands_[Bytecodes::kMaxOperands]; int operand_count_; OperandScale operand_scale_; BytecodeSourceInfo source_info_; }; V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info); V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, const BytecodeNode& node); } // namespace interpreter } // namespace internal } // namespace v8 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_
40.099217
80
0.698138
[ "transform" ]
03d6c5a0c6af62b7e2ddbcc1897200975a7af3d3
937
h
C
Src/Graph/BasicGraph.h
Vekteur/Algorithms
5c48e916fea2603942b65f2542b6b63d50dd31a2
[ "MIT" ]
3
2019-11-17T18:15:47.000Z
2021-07-07T13:40:25.000Z
Src/Graph/BasicGraph.h
Vekteur/Algorithms
5c48e916fea2603942b65f2542b6b63d50dd31a2
[ "MIT" ]
null
null
null
Src/Graph/BasicGraph.h
Vekteur/Algorithms
5c48e916fea2603942b65f2542b6b63d50dd31a2
[ "MIT" ]
null
null
null
#pragma once #include <vector> #include <stack> #include <queue> #include <algorithm> #include <functional> #include "Graph/Graph.h" template<typename L> std::vector<int> dfsStack(const AdjList<L>& g, int start) { std::vector<int> preOrder; std::vector<int> vis(g.size()); vis[start] = true; std::stack<int> st; st.push(start); while (!st.empty()) { int u = st.top(); st.pop(); preOrder.push_back(u); for (Edge<L> v : g.adj[u]) { if (!vis[v.to]) { vis[v.to] = true; st.push(v.to); } } } return preOrder; } template<typename L> std::vector<int> bfs(const AdjList<L>& g, int start) { std::vector<int> preOrder; std::vector<int> vis(g.size()); vis[start] = true; std::queue<int> q; q.push(start); while (!q.empty()) { int u = q.front(); q.pop(); preOrder.push_back(u); for (Edge<L> v : g.adj[u]) { if (!vis[v.to]) { vis[v.to] = true; q.push(v.to); } } } return preOrder; }
17.679245
59
0.59445
[ "vector" ]
03d84316961a7d8027bb6907a7789fd930da5307
6,041
h
C
tensorflow/core/kernels/linalg_ops_common.h
jylinman/tensorflow
5248d111c3aeaf9f560cd77bff0f183f38e31e0b
[ "Apache-2.0" ]
73
2017-01-05T09:06:08.000Z
2021-11-06T14:00:50.000Z
tensorflow/core/kernels/linalg_ops_common.h
jylinman/tensorflow
5248d111c3aeaf9f560cd77bff0f183f38e31e0b
[ "Apache-2.0" ]
8
2017-04-10T10:36:20.000Z
2021-02-07T01:02:32.000Z
tensorflow/core/kernels/linalg_ops_common.h
jylinman/tensorflow
5248d111c3aeaf9f560cd77bff0f183f38e31e0b
[ "Apache-2.0" ]
151
2016-11-10T09:01:15.000Z
2022-01-18T08:13:49.000Z
/* Copyright 2015 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_KERNELS_LINALG_OPS_COMMON_H_ #define TENSORFLOW_KERNELS_LINALG_OPS_COMMON_H_ // Classes to support linear algebra functionality, similar to the numpy.linalg // module. Supports batch computation on several matrices at once, sharding the // computations across different threads if necessary. #define EIGEN_USE_THREADS #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/kernel_def_builder.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/tensor_shape.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/core/util/work_sharder.h" namespace tensorflow { // Base class for unary linear algebra operators. class UnaryLinearAlgebraOpBase : public OpKernel { public: explicit UnaryLinearAlgebraOpBase(OpKernelConstruction* context) : OpKernel(context) {} ~UnaryLinearAlgebraOpBase() override {} // Return the output shape of each individual matrix operation. Must be // rank 0, 1, or 2. Scalar outputs are rank 0. virtual TensorShape GetOutputMatrixShape( const TensorShape& input_matrix_shape) = 0; // Return the cost per matrix operation. Cost per unit is assumed to be // roughly 1ns, based on comments in core/util/work_sharder.cc. virtual int64 GetCostPerUnit(const TensorShape& input_matrix_shape) = 0; // If SupportsBatchOperation() returns false, this Op will only accept rank 2 // (if the supported input type is a matrix). If it returns true, the Op will // accept inputs of rank >= 3, and repeatedly execute the operation on all // matrices in the innermost two dimensions. virtual bool SupportsBatchOperation() = 0; // Perform the actual computation on an input matrix, and store the results // in the output. This will be called repeatedly for a single call to // Compute(), if multiple matrices exist in the input Tensor. // // This function should only compute the results for a single input matrix. // The 'matrix_index' parameter specifies the index of the matrix to be used // from the input, and the index of the matrix to be written to in the output. // The input matrix is in row major order, and is located at the memory // address // in.flat<Scalar>().data() + // matrix_index * input_matrix_shape.num_elements(). // The output matrix is in row major order, and is located at the memory // address // out->flat<Scalar>().data() + // matrix_index * output_matrix_shape.num_elements(). // The UnaryLinearAlgebraOp<Scalar> class below has functionality which // performs // this mapping and presents an interface based on the Eigen::MatrixBase API. virtual void ComputeMatrix(OpKernelContext* context, int64 matrix_index, const Tensor& in, const TensorShape& input_matrix_shape, Tensor* out, const TensorShape& output_matrix_shape) = 0; void Compute(OpKernelContext* context) override; }; // This base class encapsulates the functionality of mapping the input and // output tensors using Eigen::Map, so that the Eigen::MatrixBase API may be // directly used by derived classes. // SupportsBatchOperationT is a bool template argument which if set to true // will allow the Op to process batches of matrices (rank >= 3); if set to // false the Op will only accept rank 2 inputs. template <typename Scalar, bool SupportsBatchOperationT> class UnaryLinearAlgebraOp : public UnaryLinearAlgebraOpBase { public: explicit UnaryLinearAlgebraOp(OpKernelConstruction* context) : UnaryLinearAlgebraOpBase(context) {} using Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>; using ConstMatrixMap = Eigen::Map<const Matrix>; using MatrixMap = Eigen::Map<Matrix>; // Perform the actual computation on the input matrix, and store the results // in the output. This will be called repeatedly for a single call to // Compute(), if multiple matrices exist in the input Tensor. virtual void ComputeMatrix(OpKernelContext* context, const ConstMatrixMap& input, MatrixMap* output) = 0; bool SupportsBatchOperation() final { return SupportsBatchOperationT; } // A concrete implementation of UnaryLinearAlgebraOpBase::ComputeMatrix(). void ComputeMatrix(OpKernelContext* context, int64 matrix_index, const Tensor& in, const TensorShape& input_matrix_shape, Tensor* out, const TensorShape& output_matrix_shape) final; }; // Declare that UnaryLinearAlgebraOp is explicitly instantiated in // linalg_ops_common.cc for float and double. extern template class UnaryLinearAlgebraOp<float, false>; extern template class UnaryLinearAlgebraOp<float, true>; extern template class UnaryLinearAlgebraOp<double, false>; extern template class UnaryLinearAlgebraOp<double, true>; } // namespace tensorflow #define REGISTER_LINALG_OP(OpName, OpClass, Scalar) \ REGISTER_KERNEL_BUILDER( \ Name(OpName).Device(DEVICE_CPU).TypeConstraint<Scalar>("T"), OpClass) #endif // TENSORFLOW_KERNELS_LINALG_OPS_COMMON_H_
45.765152
80
0.736136
[ "shape" ]
03db1c7ef536153fbc9675ea1c3576345bd39e02
1,997
h
C
include/scenemapper.h
starintheuniverse/funnel-vision
5d2d7aecbf361fc041d84d28f958282800038ceb
[ "MIT" ]
null
null
null
include/scenemapper.h
starintheuniverse/funnel-vision
5d2d7aecbf361fc041d84d28f958282800038ceb
[ "MIT" ]
null
null
null
include/scenemapper.h
starintheuniverse/funnel-vision
5d2d7aecbf361fc041d84d28f958282800038ceb
[ "MIT" ]
null
null
null
/* ============================================================================= * scenemapper.h * Masado Ishii * v0.1 2016-12-26 * v0.2 2017-08-04 - New scene content. * * Description: Initialization of the GL environment; definitions of scene * and animations. * * Attributions: * > Modeled on code by Hank Childs, presumably derivative * of Kitware coders K.Martin, W.Schroeder, and B.Lorensen. * ============================================================================= */ #ifndef _SCENEMAPPER_H #define _SCENEMAPPER_H #include "vtkOpenGLPolyDataMapper.h" // Inherit mapper from this. #include "mesh.h" // For populating the scene. #include "meshobject.h" // /* ------------------------------------------------------------------ * vtk441Mapper class. * * Part of the hook into the VTK harness. Set up GL states. * ------------------------------------------------------------------ */ class vtk441Mapper : public vtkOpenGLPolyDataMapper { protected: GLuint displayList; bool initialized; float animTime; public: vtk441Mapper() : initialized(false), animTime(0.0) {} virtual void AdvanceAnimation(); void RemoveVTKOpenGLStateSideEffects(); void SetupLight(void); }; /* ------------------------------------------------------------------ * vtk441MapperMishii class. * ------------------------------------------------------------------ */ class vtk441MapperMishii : public vtk441Mapper { protected: GLuint shapes; // Display lists. bool initialized; std::list<DisplayListMesh *> meshes; std::list<MeshObject *> meshObjects; MeshObject *animationTarget; public: static vtk441MapperMishii *New(); vtk441MapperMishii() : initialized(false), animationTarget(NULL) {} ~vtk441MapperMishii(); protected: void InitializeScene(); public: virtual void RenderPiece(vtkRenderer *ren, vtkActor *act); virtual void AdvanceAnimation(); }; #endif /* _SCENEMAPPER_H */
25.278481
80
0.543816
[ "mesh" ]
03dd4716d097aee30e94eabfe52a44a132615462
5,753
h
C
blingfirecompile.library/inc/FAWRETokens2Dicts.h
palerdot/BlingFire
7e0fbc719042a4857c824b42d9cb5fbefe48aa3e
[ "MIT" ]
1,251
2019-03-30T00:13:56.000Z
2019-05-06T15:05:24.000Z
blingfirecompile.library/inc/FAWRETokens2Dicts.h
palerdot/BlingFire
7e0fbc719042a4857c824b42d9cb5fbefe48aa3e
[ "MIT" ]
57
2019-05-14T03:13:38.000Z
2022-03-29T14:49:04.000Z
blingfirecompile.library/inc/FAWRETokens2Dicts.h
palerdot/BlingFire
7e0fbc719042a4857c824b42d9cb5fbefe48aa3e
[ "MIT" ]
62
2019-05-07T21:45:39.000Z
2022-01-22T01:14:59.000Z
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ #ifndef _FA_WRETOKENS2DICTS_H_ #define _FA_WRETOKENS2DICTS_H_ #include "FAConfig.h" #include "FAChain2Num_hash.h" #include "FAWRETokenParser.h" #include "FAWREToken.h" #include "FAArray_cont_t.h" #include <iostream> namespace BlingFire { class FAAllocatorA; class FAChain2NumA; class FAMultiMapA; class FATagSet; /// /// Reads WRE tokens and creates Digitizer\TokenNum -> CNF mapping and /// a list of commands for text-digitizer /// /// 1. Stream of commands for building text-digitizer /// 2. FAChain2NumA Map from Digitizer\TokenNum into CNF of TypeNums /// 3. TypeNum depend on digitizer type /// /// Sample text-digitizer commands: /// /// dict\n /// <dictname>\n /// \n ; reads dictionary from the outer resources /// regexp\n /// <regexp>\n /// \n ; compiles dynamic dictionary from the regexp /// wordlist\n /// word_1 /// word_2 /// ... /// word_n /// \n ; compiles dynamic dictionary from the words /// ... /// /// Sample map from Digitizer\TokenNum into CNF of elementary types: /// /// 0x00000008 -> 3 7 -8 -3 ; Txt\Token8 = Ty7 | !Ty8 | !Ty3 /// 0x00000006 -> 5 7 0 -8 0 -3 ; Txt\Token6 = Ty7 & !Ty8 & !Ty3 /// 0x00000005 -> 1 6 ; Txt\Token5 = Ty6 /// 0x01000005 -> 1 6 ; Tag\Token5 = Ty6 /// 0x02000005 -> 1 6 ; Dct\Token5 = Ty6 /// ... /// class FAWRETokens2Dicts { public: FAWRETokens2Dicts (FAAllocatorA * pAlloc); virtual ~FAWRETokens2Dicts (); public: /// sets up POS tagger's tagset (not used by default) void SetTagSet (const FATagSet * pTagSet); /// sets up bits lexicon's tagset (not used by default) void SetTagSet2 (const FATagSet * pTagSet2); /// sets up ordered wre tokens list void SetTokens (const FAChain2NumA * pToken2Num); /// Stream for commands for building text digitizer void SetDictOs (std::ostream * pDictOs); /// storage for token num 2 cnf map /// Token0 = (Ty1 | T2 | !T3) & (Ty4 | T5 | !T6) & T8 & !T9 /// 0 -> 1 2 -3 0 4 5 -6 0 8 0 -9 void SetToken2CNF (FAMultiMapA * pTokenNum2CNF); /// Makes processing void Process (); /// returns object into initial state (called automatically) virtual void Clear (); private: /// makes consequent parsing for tokens from m_pToken2Num map void ParseTokens (); /// makes processing for newly reinitialized m_curr_token void ProcessCurrToken (const int TokenNum); void ProcessCurrWords (const int TokenNum); void ProcessCurrRegexps (const int TokenNum); void ProcessCurrDicts (const int TokenNum); void ProcessCurrTags (const int TokenNum); /// returns all the types to build text-digitzer void PutTxtTypes (); /// puts all words from m_curr_token into m_arr inline void words2arr (); /// puts regexp_i into the m_arr /// Note: regexp '.' and word "." will have the different representation inline void regexp2arr (const int i); /// puts dict_i into the m_arr inline void dict2arr (const int i); /// returns type num by words inline const int arr2typenum (); /// starts a new disjunction associated with the TokenNum inline void StartDisjunct (const int TokenNum); /// adds to the last disjunct associated with the TokenNum inline void AddToDisjunct (const int TokenNum, const int TypeNum, const bool IsNegative); protected: // returns unescaped string const int UnEscape ( const char * pStr, const int StrLen, const char ** ppOutStr ); /// returns next wordlist for text-digitizer virtual void PutTxtWords (const char * pBegin, const int Length); /// returns next regexp for text-digitizer virtual void PutTxtRegexp (const char * pBegin, const int Length); /// returns next dict name for text-digitizer virtual void PutTxtDictName (const char * pBegin, const int Length); /// returns a set of tags for tag digitizer virtual void PutPosTags (const int * pTags, const int Count); /// returns a set of tags for dict digitizer virtual void PutDictTags (const int * pTags, const int Count); /// should be called when all tokens have been processed virtual void PutDone (); private: /// input : WRE tokens const FAChain2NumA * m_pToken2Num; /// output stream : token -> type ops FAMultiMapA * m_pTokenNum2CNF; /// output stream : dictionaries, required by the rules std::ostream * m_pDictOs; /// WRE token parser FAWRETokenParser m_token_parser; /// currently processing WRE token FAWREToken m_curr_token; /// allocator FAAllocatorA * m_pAlloc; /// tmp array FAArray_cont_t < int > m_arr; /// first unused value of TypeNum, 1-based int m_min_type; // keeps unescaped text, if needed FAArray_cont_t < char > m_UnEsc; // needed for text digitizer /// maps already seen words, dictionary names and regexps into type num FAChain2Num_hash m_token2type; /// key types in m_token2type enum { KEY_WORDLIST = 0, KEY_REGEXP = 1, KEY_DICT_NAME = 2 }; // needed for tag test or dict digitizers FAArray_cont_t < int > m_dict_tags; // keeps POS tagger tags FAArray_cont_t < int > m_pos_tags; protected: /// tagsets const FATagSet * m_pTagSet; const FATagSet * m_pTagSet2; }; } #endif
31.60989
77
0.630454
[ "object" ]
03e170b6ef88ba6120c369250045793919bdab30
9,714
h
C
src/bluecadet/core/SettingsManager.h
bluecadet/Cinder-BluecadetViews
d6ff2fecfbfd5399dfd375170083c9230a0e0d6b
[ "MIT" ]
10
2017-10-23T15:27:50.000Z
2021-02-03T03:28:27.000Z
src/bluecadet/core/SettingsManager.h
bluecadet/Cinder-BluecadetViews
d6ff2fecfbfd5399dfd375170083c9230a0e0d6b
[ "MIT" ]
40
2017-10-20T13:56:08.000Z
2021-10-01T15:39:37.000Z
src/bluecadet/core/SettingsManager.h
bluecadet/Cinder-BluecadetViews
d6ff2fecfbfd5399dfd375170083c9230a0e0d6b
[ "MIT" ]
3
2018-07-16T16:34:37.000Z
2020-05-07T02:49:37.000Z
#pragma once #include <set> #include "ValueMapping.h" #include "bluecadet/text/Text.h" #include "cinder/Json.h" #include "cinder/Log.h" #include "cinder/app/App.h" #include "cinder/params/Params.h" namespace bluecadet { namespace core { typedef std::shared_ptr<class SettingsManager> SettingsManagerRef; class SettingsManager { public: typedef std::function<void(const std::string & value)> CommandArgParserFn; typedef ci::signals::Signal<void()> SettingsLoadedSignal; SettingsManager(); virtual ~SettingsManager(); // Overrides the shared instance. Use this method if you'd like to use a sub-class of SettingsManager. static void setInstance(SettingsManagerRef instance) { sInstance = instance; } // Singleton; Instance can be changed by calling setInstance() (e.g. to use subclasses) static SettingsManagerRef get() { if (!sInstance) { sInstance = std::make_shared<SettingsManager>(); } return sInstance; } static ci::fs::path getDefaulJsonPath() { const auto filename = "settings.json"; ci::fs::path path; if (ci::app::getAssetDirectories().empty()) { path = ci::app::getAppPath(); } else { path = ci::app::getAssetDirectories().front(); } path.append(ci::fs::path(filename)); return path; } //================================================== // Setup // Set up the settings manager with the path to an optional settings json. Should be called from prepareSettings() // and before setup(). Callback can be used to override arguments from the json file. virtual void setup(ci::app::App::Settings * appSettings, ci::fs::path jsonPath = getDefaulJsonPath(), bool autoCreateJson = true, std::function<void(SettingsManager * manager)> callback = nullptr); SettingsLoadedSignal & getSignalSettingsLoaded() { return mSignalSettingsLoaded; }; // Loads settings from jsonPath (or mJsonPath if previously defined via setup()). // If autoCreateJson is true, then a new file will be created at jsonPath or mJsonPath. virtual void load(ci::fs::path jsonPath = "", bool autoCreateJson = false); // Saves all mapped settings to jsonPath (or mJsonPath if previously defined via setup()). virtual void save(ci::fs::path jsonPath = ""); // Parses all mapped settings and applies them. This only changes internal values, // but doesn't apply any settings like the current app's window size. virtual void deserialize(ci::JsonTree & json); // Serializes all mapped settings into a JsonTree. virtual ci::JsonTree serialize(); // Adds a callback to parse a command line argument by key. Keys are converted to lowercase and values are always // passed as strings. Multiple parsers for the same key can be added and they are called in the order they were // added in. virtual void addCommandArg(const std::string & key, CommandArgParserFn callback); // Shortcut to add multiple command line args with different keys but the same parser. void addCommandArgs(const std::set<std::string> & keys, CommandArgParserFn callback); // Checks if the field exists in the loaded settings json. inline bool hasJsonValue(const std::string & field) { return mJson.hasChild(field); }; // Get the value of field from within the settings json. Will return an empty default value of // type T if the field was not found. template <typename T> T getJsonValue(const std::string & field); // Returns the app params, creates new params if necessary. inline ci::params::InterfaceGlRef getParams() { if (!mParams) { mParams = createParams(); } return mParams; }; //================================================== // Default Properties // General bool mConsole = true; // Use external console window std::string mAppVersion = "1.0.0"; // Displays app version in the params // Graphics float mFps = 60.0f; bool mFullscreen = true; bool mBorderless = false; bool mVerticalSync = true; // Display int mDisplayIndex = 0; // The index of the display to launch this app on. Reverts to main display if out of bounds. ci::ivec2 mDisplaySize = ci::ivec2(-1); // The size of one display. Defaults to getWindowSize() ci::ivec2 mBezelDims = ci::ivec2(0); // The amount of bezel correction to add in both X and Y int mDisplayColumns = 1; // The number of display columns in a display matrix. Used by ScreenLayout. int mDisplayRows = 1; // The number of display rows in a display matrix. Used by ScreenLayout. // Window ci::ivec2 mWindowSize = ci::ivec2(INT_MIN); // The window size on launch ci::ivec2 mWindowPos = ci::ivec2(INT_MIN); // The window position on launch ci::ColorA mClearColor = ci::ColorA::black(); // The color used when clearing the screen before draw() // Camera ci::vec2 mCameraOffset = ci::ivec2(0); // The offset of the camera on launch float mCameraZoom = 1.0f; // The zoom of the camera at launch // Touches bool mMouseEnabled = true; // Treat mouse events as touch events. bool mNativeTouchEnabled = true; // Native touch coming from the OS bool mSupportMultipleNativeTouchScreens = true; // Native touch with multi-touchscreen support bool mTuioTouchEnabled = false; // TUIO touch events; It's recommended to disable native touch // when TUIO is enabled to prevent duplicate events. // Debugging bool mDebugEnabled = true; // Enable/disable all of the below debug features (except for hotkeys) bool mLogToStdOut = true; // Logs to std::cout and std::cerr if enabled bool mShowTouches = false; // Visualizes all current touch data bool mShowScreenLayout = false; // Visualizes the current screen layout and bezels bool mShowCursor = true; // Show or hide the mouse cursor (toggle with C) bool mShowMinimap = true; // Show or hide the mini-map (toggle with M) bool mShowStats = true; // Show or hide the frame-rate graph/plot (toggle with S) bool mMinimizeParams = false; // Minimizes the params window (toggle with F1) bool mCollapseParams = true; // Collapses all the default parameter groups like "App" bool mZoomToggleHotkeyEnabled = true; // When true, will bind 0 to toggle zoom to 100%/fit bool mDisplayIdHotkeysEnabled = false; // When true, will bind 1-9 to zoom directly to displays 1-9 bool mTouchSimEnabled = false; // When true, will add touch simulator controls to params float mSimulatedTouchesPerSecond = 50.0f; // Used only if mEnableTouchSim is true protected: static SettingsManagerRef sInstance; // Registers a field that will be mapped from the JSON to a property. Call this method from a subclass if you intend // to add custom JSON fields and map them to class members. template <typename T> ValueMapping & mapField(const std::string & fieldName, T * target); // Checks if a field exists in the JSON and copies its value to this class in that value if it does. void mergeField(const std::string & fieldName, const ci::JsonTree & json); // Map JSON field names to class members. Called once at the beginning setup(). virtual void mapFields(); // Adds all default command line args and those created by all mapped fields. virtual void setupCommandArgs(); // Parses command line arguments, which can override json settings virtual void parseCommandArgs(const std::vector<std::string> & args); // Applies parsed settings to ci::app::App::Settings virtual void applyToAppSettings(ci::app::App::Settings * settings); // Helpers to get string from primitive types and strings since we can't call to_string on strings template <typename T> inline std::string toString(T * target) { return std::to_string(*target); } // Creates the params object ci::params::InterfaceGlRef createParams(); // Key-based callbacks that are called when a command line argument with that key is passed in std::map<std::string, std::vector<CommandArgParserFn>> mCommandArgsHandlers; // Base settings json ci::JsonTree mJson; ci::fs::path mJsonPath; // Mappings of JSON fields to variables std::map<std::string, ValueMapping> mFieldMappings; // Ordered list of field mapping names to preserve params sequence std::vector<std::string> mFieldMappingNames; // Default params ci::params::InterfaceGlRef mParams = nullptr; // Signals SettingsLoadedSignal mSignalSettingsLoaded; }; //================================================== // Template and inline implementations template <typename T> ValueMapping & SettingsManager::mapField(const std::string & fieldName, T * property) { mFieldMappingNames.push_back(fieldName); return mFieldMappings.insert({fieldName, ValueMapping(fieldName, property)}).first->second; } template <typename T> T SettingsManager::getJsonValue(const std::string & field) { try { if (!hasJsonValue(field)) { CI_LOG_W("Field '" << field << "' could not be found"); return T(); } return mJson.getValueForKey<T>(field); } catch (cinder::Exception e) { CI_LOG_EXCEPTION("Could not read '" << field << "' from json file", e); return T(); } } template <> std::string inline SettingsManager::toString<std::string>(std::string * target) { return *target; } } // namespace core } // namespace bluecadet
42.792952
119
0.672329
[ "object", "vector" ]
03eccdd99b993ca7f44c2d5e8cd1d1532c9c3ad0
19,302
h
C
src/chrono/timestepper/ChTimestepper.h
yangfengzzz/chrono
6abb679feef0e64ae1863268052624c581f876a8
[ "BSD-3-Clause" ]
null
null
null
src/chrono/timestepper/ChTimestepper.h
yangfengzzz/chrono
6abb679feef0e64ae1863268052624c581f876a8
[ "BSD-3-Clause" ]
null
null
null
src/chrono/timestepper/ChTimestepper.h
yangfengzzz/chrono
6abb679feef0e64ae1863268052624c581f876a8
[ "BSD-3-Clause" ]
null
null
null
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Alessandro Tasora, Radu Serban // ============================================================================= #ifndef CHTIMESTEPPER_H #define CHTIMESTEPPER_H #include "chrono/core/ChApiCE.h" #include "chrono/core/ChMath.h" #include "chrono/serialization/ChArchive.h" #include "chrono/timestepper/ChIntegrable.h" #include "chrono/timestepper/ChState.h" #include <cstdlib> namespace chrono { /// @addtogroup chrono_timestepper /// @{ /// Base class for timesteppers, i.e., time integrators that can advance a system state. /// It operates on systems inherited from ChIntegrable. class ChApi ChTimestepper { public: /// Available methods for time integration (time steppers). enum class Type { EULER_IMPLICIT_LINEARIZED = 0, EULER_IMPLICIT_PROJECTED = 1, EULER_IMPLICIT = 2, TRAPEZOIDAL = 3, TRAPEZOIDAL_LINEARIZED = 4, HHT = 5, HEUN = 6, RUNGEKUTTA45 = 7, EULER_EXPLICIT = 8, LEAPFROG = 9, NEWMARK = 10, CUSTOM = 20 }; /// Constructor ChTimestepper(ChIntegrable *intgr = nullptr) : integrable(intgr), T(0), verbose(false), Qc_do_clamp(false), Qc_clamping(0) {} /// Destructor virtual ~ChTimestepper() {} /// Return type of the integration method. /// Default is CUSTOM. Derived classes should override this function. virtual Type GetType() const { return Type::CUSTOM; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) = 0; /// Access the lagrangian multipliers, if any. virtual ChVectorDynamic<> &get_L() { return L; } /// Set the integrable object. virtual void SetIntegrable(ChIntegrable *intgr) { integrable = intgr; } /// Get the integrable object. ChIntegrable *GetIntegrable() { return integrable; } /// Get the current time. virtual double GetTime() const { return T; } /// Set the current time. virtual void SetTime(double mt) { T = mt; } /// Turn on/off logging of messages. void SetVerbose(bool verb) { verbose = verb; } /// Turn on/off clamping on the Qcterm. void SetQcDoClamp(bool dc) { Qc_do_clamp = dc; } /// Turn on/off clamping on the Qcterm. void SetQcClamping(double cl) { Qc_clamping = cl; } /// Method to allow serialization of transient data to archives. virtual void ArchiveOUT(ChArchiveOut &archive); /// Method to allow de-serialization of transient data from archives. virtual void ArchiveIN(ChArchiveIn &archive); protected: ChIntegrable *integrable; double T; ChVectorDynamic<> L; bool verbose; bool Qc_do_clamp; double Qc_clamping; }; /// Base class for 1st order timesteppers, that is a time integrator for a ChIntegrable. class ChApi ChTimestepperIorder : public ChTimestepper { protected: ChState Y; ChStateDelta dYdt; public: /// Constructor ChTimestepperIorder(ChIntegrable *intgr = nullptr) : ChTimestepper(intgr) { SetIntegrable(intgr); } /// Destructor virtual ~ChTimestepperIorder() {} /// Access the state at current time virtual ChState &get_Y() { return Y; } /// Access the derivative of state at current time virtual ChStateDelta &get_dYdt() { return dYdt; } /// Set the integrable object virtual void SetIntegrable(ChIntegrable *intgr) { ChTimestepper::SetIntegrable(intgr); Y.setZero(1, intgr); dYdt.setZero(1, intgr); } }; /// Base class for 2nd order timesteppers, i.e., a time integrator for a ChIntegrableIIorder. /// A ChIntegrableIIorder is a special subclass of integrable objects that have a state comprised /// of position and velocity y={x,v}, and state derivative dy/dt={v,a}, where a=acceleration. class ChApi ChTimestepperIIorder : public ChTimestepper { protected: ChState X; ChStateDelta V; ChStateDelta A; public: /// Constructor ChTimestepperIIorder(ChIntegrableIIorder *intgr = nullptr) : ChTimestepper(intgr) { SetIntegrable(intgr); } /// Destructor virtual ~ChTimestepperIIorder() {} /// Access the state, position part, at current time virtual ChState &get_X() { return X; } /// Access the state, speed part, at current time virtual ChStateDelta &get_V() { return V; } /// Access the acceleration, at current time virtual ChStateDelta &get_A() { return A; } /// Set the integrable object virtual void SetIntegrable(ChIntegrableIIorder *intgr) { ChTimestepper::SetIntegrable(intgr); X.setZero(1, intgr); V.setZero(1, intgr); A.setZero(1, intgr); } private: using ChTimestepper::SetIntegrable; }; /// Base class for implicit solvers (double inheritance) class ChApi ChImplicitTimestepper {}; /// Base properties for implicit solvers. /// Such integrators require solution of a nonlinear problem, typically solved /// using an iterative process, up to a desired tolerance. At each iteration, /// a linear system must be solved. class ChApi ChImplicitIterativeTimestepper : public ChImplicitTimestepper { protected: int maxiters; ///< maximum number of iterations double reltol; ///< relative tolerance double abstolS; ///< absolute tolerance (states) double abstolL; ///< absolute tolerance (Lagrange multipliers) int numiters; ///< number of iterations int numsetups; ///< number of calls to the solver's Setup function int numsolves; ///< number of calls to the solver's Solve function public: ChImplicitIterativeTimestepper() : maxiters(6), reltol(1e-4), abstolS(1e-10), abstolL(1e-10), numiters(0), numsetups(0), numsolves(0) {} virtual ~ChImplicitIterativeTimestepper() {} /// Set the max number of iterations using the Newton Raphson procedure void SetMaxiters(int iters) { maxiters = iters; } /// Get the max number of iterations using the Newton Raphson procedure double GetMaxiters() { return maxiters; } /// Set the relative tolerance. /// This tolerance is optionally used by derived classes in the Newton-Raphson /// convergence test. void SetRelTolerance(double rel_tol) { reltol = rel_tol; } /// Set the absolute tolerances. /// These tolerances are optionally used by derived classes in the Newton-Raphson /// convergence test. This version sets separate absolute tolerances for states /// and Lagrange multipliers. void SetAbsTolerances(double abs_tolS, double abs_tolL) { abstolS = abs_tolS; abstolL = abs_tolL; } /// Set the absolute tolerances. /// These tolerances are optionally used by derived classes in the Newton-Raphson /// convergence test. This version sets equal absolute tolerances for states and /// Lagrange multipliers. void SetAbsTolerances(double abs_tol) { abstolS = abs_tol; abstolL = abs_tol; } /// Return the number of iterations. int GetNumIterations() const { return numiters; } /// Return the number of calls to the solver's Setup function. int GetNumSetupCalls() const { return numsetups; } /// Return the number of calls to the solver's Solve function. int GetNumSolveCalls() const { return numsolves; } /// Method to allow serialization of transient data to archives. virtual void ArchiveOUT(ChArchiveOut &archive) { // version number archive.VersionWrite(1); // serialize all member data: archive << CHNVP(maxiters); archive << CHNVP(reltol); archive << CHNVP(abstolS); archive << CHNVP(abstolL); } /// Method to allow de-serialization of transient data from archives. virtual void ArchiveIN(ChArchiveIn &archive) { // version number /*int version =*/archive.VersionRead(); // stream in all member data: archive >> CHNVP(maxiters); archive >> CHNVP(reltol); archive >> CHNVP(abstolS); archive >> CHNVP(abstolL); } }; /// Euler explicit timestepper. /// This performs the typical y_new = y+ dy/dt * dt integration with Euler formula. class ChApi ChTimestepperEulerExpl : public ChTimestepperIorder { public: /// Constructors (default empty) ChTimestepperEulerExpl(ChIntegrable *intgr = nullptr) : ChTimestepperIorder(intgr) {} /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ); }; /// Euler explicit timestepper customized for II order. /// (It gives the same results of ChTimestepperEulerExpl, but performs a bit faster because it /// can exploit the special structure of ChIntegrableIIorder) /// This integrator implements the typical Euler scheme: /// x_new = x + v * dt /// v_new = v + a * dt class ChApi ChTimestepperEulerExplIIorder : public ChTimestepperIIorder { protected: ChStateDelta Dv; public: /// Constructors (default empty) ChTimestepperEulerExplIIorder(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr) {} virtual Type GetType() const override { return Type::EULER_EXPLICIT; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Euler semi-implicit timestepper. /// This performs the typical /// v_new = v + a * dt /// x_new = x + v_new * dt /// integration with Euler semi-implicit formula. class ChApi ChTimestepperEulerSemiImplicit : public ChTimestepperIIorder { public: /// Constructors (default empty) ChTimestepperEulerSemiImplicit(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr) {} /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ); }; /// Performs a step of a 4th order explicit Runge-Kutta integration scheme. class ChApi ChTimestepperRungeKuttaExpl : public ChTimestepperIorder { protected: ChState y_new; ChStateDelta Dydt1; ChStateDelta Dydt2; ChStateDelta Dydt3; ChStateDelta Dydt4; public: /// Constructors (default empty) ChTimestepperRungeKuttaExpl(ChIntegrable *intgr = nullptr) : ChTimestepperIorder(intgr) {} virtual Type GetType() const override { return Type::RUNGEKUTTA45; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Performs a step of a Heun explicit integrator. It is like a 2nd Runge Kutta. class ChApi ChTimestepperHeun : public ChTimestepperIorder { protected: ChState y_new; ChStateDelta Dydt1; ChStateDelta Dydt2; public: /// Constructors (default empty) ChTimestepperHeun(ChIntegrable *intgr = nullptr) : ChTimestepperIorder(intgr) {} virtual Type GetType() const override { return Type::HEUN; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Performs a step of a Leapfrog explicit integrator. /// This is a symplectic method, with 2nd order accuracy, at least when F depends on positions only. /// Note: uses last step acceleration: changing or resorting the numbering of DOFs will invalidate it. /// Suggestion: use the ChTimestepperEulerSemiImplicit, it gives the same accuracy with better performance. class ChApi ChTimestepperLeapfrog : public ChTimestepperIIorder { protected: ChStateDelta Aold; public: /// Constructors (default empty) ChTimestepperLeapfrog(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr) {} virtual Type GetType() const override { return Type::LEAPFROG; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Performs a step of Euler implicit for II order systems. class ChApi ChTimestepperEulerImplicit : public ChTimestepperIIorder, public ChImplicitIterativeTimestepper { protected: ChStateDelta Dv; ChVectorDynamic<> Dl; ChState Xnew; ChStateDelta Vnew; ChVectorDynamic<> R; ChVectorDynamic<> Qc; public: /// Constructors (default empty) ChTimestepperEulerImplicit(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr), ChImplicitIterativeTimestepper() {} virtual Type GetType() const override { return Type::EULER_IMPLICIT; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Performs a step of Euler implicit for II order systems using the Anitescu/Stewart/Trinkle /// single-iteration method, that is a bit like an implicit Euler where one performs only the /// first Newton corrector iteration. /// If using an underlying CCP complementarity solver, this is the typical Anitescu stabilized /// timestepper for DVIs. class ChApi ChTimestepperEulerImplicitLinearized : public ChTimestepperIIorder, public ChImplicitTimestepper { protected: ChStateDelta Vold; ChVectorDynamic<> Dl; ChVectorDynamic<> R; ChVectorDynamic<> Qc; public: /// Constructors (default empty) ChTimestepperEulerImplicitLinearized(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr), ChImplicitTimestepper() {} virtual Type GetType() const override { return Type::EULER_IMPLICIT_LINEARIZED; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Performs a step of Euler implicit for II order systems using a semi implicit Euler without /// constraint stabilization, followed by a projection. That is: a speed problem followed by a /// position problem that keeps constraint drifting 'closed' by using a projection. /// If using an underlying CCP complementarity solver, this is the typical Tasora stabilized /// timestepper for DVIs. class ChApi ChTimestepperEulerImplicitProjected : public ChTimestepperIIorder, public ChImplicitTimestepper { protected: ChStateDelta Vold; ChVectorDynamic<> Dl; ChVectorDynamic<> R; ChVectorDynamic<> Qc; public: /// Constructors (default empty) ChTimestepperEulerImplicitProjected(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr), ChImplicitTimestepper() {} virtual Type GetType() const override { return Type::EULER_IMPLICIT_PROJECTED; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Performs a step of trapezoidal implicit for II order systems. /// NOTE this is a modified version of the trapezoidal for DAE: the original derivation would lead /// to a scheme that produces oscillatory reactions in constraints, so this is a modified version /// that is first order in constraint reactions. Use damped HHT or damped Newmark for more advanced options. class ChApi ChTimestepperTrapezoidal : public ChTimestepperIIorder, public ChImplicitIterativeTimestepper { protected: ChStateDelta Dv; ChVectorDynamic<> Dl; ChState Xnew; ChStateDelta Vnew; ChVectorDynamic<> R; ChVectorDynamic<> Rold; ChVectorDynamic<> Qc; public: /// Constructors (default empty) ChTimestepperTrapezoidal(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr), ChImplicitIterativeTimestepper() {} virtual Type GetType() const override { return Type::TRAPEZOIDAL; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Performs a step of trapezoidal implicit linearized for II order systems. class ChApi ChTimestepperTrapezoidalLinearized : public ChTimestepperIIorder, public ChImplicitIterativeTimestepper { protected: ChStateDelta Dv; ChVectorDynamic<> Dl; ChState Xnew; ChStateDelta Vnew; ChVectorDynamic<> R; ChVectorDynamic<> Rold; ChVectorDynamic<> Qc; public: /// Constructors (default empty) ChTimestepperTrapezoidalLinearized(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr), ChImplicitIterativeTimestepper() {} virtual Type GetType() const override { return Type::TRAPEZOIDAL_LINEARIZED; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; }; /// Performs a step of trapezoidal implicit linearized for II order systems. ///*** SIMPLIFIED VERSION -DOES NOT WORK - PREFER ChTimestepperTrapezoidalLinearized class ChApi ChTimestepperTrapezoidalLinearized2 : public ChTimestepperIIorder, public ChImplicitIterativeTimestepper { protected: ChStateDelta Dv; ChState Xnew; ChStateDelta Vnew; ChVectorDynamic<> R; ChVectorDynamic<> Qc; public: /// Constructors (default empty) ChTimestepperTrapezoidalLinearized2(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr), ChImplicitIterativeTimestepper() {} /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ); }; /// Performs a step of Newmark constrained implicit for II order DAE systems. /// See Negrut et al. 2007. class ChApi ChTimestepperNewmark : public ChTimestepperIIorder, public ChImplicitIterativeTimestepper { private: double gamma; double beta; ChStateDelta Da; ChVectorDynamic<> Dl; ChState Xnew; ChStateDelta Vnew; ChStateDelta Anew; ChVectorDynamic<> R; ChVectorDynamic<> Rold; ChVectorDynamic<> Qc; bool modified_Newton; public: /// Constructors (default empty) ChTimestepperNewmark(ChIntegrableIIorder *intgr = nullptr) : ChTimestepperIIorder(intgr), ChImplicitIterativeTimestepper() { SetGammaBeta(0.6, 0.3); // default values with some damping, and that works also with DAE constraints modified_Newton = true; // default use modified Newton with jacobian factorization only at beginning } virtual Type GetType() const override { return Type::NEWMARK; } /// Set the numerical damping parameter gamma and the beta parameter. /// Gamma: in the [1/2, 1] interval. /// For gamma = 1/2, no numerical damping /// For gamma > 1/2, more damping /// Beta: in the [0, 1] interval. /// For beta = 1/4, gamma = 1/2 -> constant acceleration method /// For beta = 1/6, gamma = 1/2 -> linear acceleration method /// Method is second order accurate only for gamma = 1/2 void SetGammaBeta(double mgamma, double mbeta); double GetGamma() { return gamma; } double GetBeta() { return beta; } /// Enable/disable modified Newton. /// If enabled, the Newton matrix is evaluated, assembled, and factorized only once per step. /// If disabled, the Newton matrix is evaluated at every iteration of the nonlinear solver. /// Modified Newton iteration is enabled by default. void SetModifiedNewton(bool val) { modified_Newton = val; } /// Performs an integration timestep virtual void Advance(const double dt ///< timestep to advance ) override; /// Method to allow serialization of transient data to archives. virtual void ArchiveOUT(ChArchiveOut &archive) override; /// Method to allow de-serialization of transient data from archives. virtual void ArchiveIN(ChArchiveIn &archive) override; }; /// @} chrono_timestepper } // end namespace chrono #endif
34.467857
118
0.72091
[ "object" ]
03f2c6b7da16f71da0a6c10527d52728fdba1f99
27,081
h
C
lib/Parser/JSParserImpl.h
yuanyan/hermes
958eb9de106fa650f776815c17feb78961efe710
[ "MIT" ]
null
null
null
lib/Parser/JSParserImpl.h
yuanyan/hermes
958eb9de106fa650f776815c17feb78961efe710
[ "MIT" ]
null
null
null
lib/Parser/JSParserImpl.h
yuanyan/hermes
958eb9de106fa650f776815c17feb78961efe710
[ "MIT" ]
null
null
null
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the LICENSE * file in the root directory of this source tree. */ #ifndef HERMES_PARSER_JSPARSERIMPL_H #define HERMES_PARSER_JSPARSERIMPL_H #include "hermes/AST/Context.h" #include "hermes/AST/ESTree.h" #include "hermes/Parser/JSLexer.h" #include "hermes/Parser/JSParser.h" #include "hermes/Parser/PreParser.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/DataTypes.h" #include <utility> namespace hermes { namespace parser { namespace detail { using llvm::ArrayRef; using llvm::None; using llvm::Optional; /// A convenience class to encapsulate passing multiple boolean parameters /// between parser functions. class Param { unsigned flags_; public: constexpr Param() : flags_(0) {} constexpr explicit Param(unsigned f) : flags_(f) {} constexpr Param operator+(Param b) const { return Param{flags_ | b.flags_}; } constexpr Param operator-(Param b) const { return Param{flags_ & ~(b.flags_)}; } /// \return true if any of the flags in \p p are set in this instance. bool has(Param p) const { return flags_ & p.flags_; } /// \return true if all of the flags in \p p are set in this instance. bool hasAll(Param p) const { return (flags_ & p.flags_) == p.flags_; } /// \return \p p if at least on of its bits is set in this instance, /// otherwise returns an empty param. constexpr Param get(Param p) const { return Param{flags_ & p.flags_}; } template <typename... T> constexpr Param get(Param p, T... tail) const { return Param{get(p).flags_ | get(tail...).flags_}; } }; /// If set, "in" is recognized as a binary operator in RelationalExpression. static constexpr Param ParamIn{1 << 0}; static constexpr Param ParamReturn{1 << 1}; static constexpr Param ParamDefault{1 << 2}; static constexpr Param ParamTagged{1 << 3}; /// An EcmaScript 5.1 parser. /// It is a standard recursive descent LL(1) parser with no tricks. The only /// complication, is the need to communicate information to the lexer whether /// a regexp is allowed or not. /// We go to some effort to avoid the need for more than one token lookahead /// for performance. Some things (like recognizing a label) would have been /// simplified with larger lookahead. class JSParserImpl { public: explicit JSParserImpl( Context &context, std::unique_ptr<llvm::MemoryBuffer> input); explicit JSParserImpl(Context &context, uint32_t bufferId, ParserPass pass); JSParserImpl(Context &context, StringRef input) : JSParserImpl( context, llvm::MemoryBuffer::getMemBuffer(input, "JavaScript")) {} JSParserImpl(Context &context, llvm::MemoryBufferRef input) : JSParserImpl(context, llvm::MemoryBuffer::getMemBuffer(input)) {} Context &getContext() { return context_; } bool isStrictMode() const { return lexer_.isStrictMode(); } void setStrictMode(bool mode) { lexer_.setStrictMode(mode); } Optional<ESTree::ProgramNode *> parse(); void seek(SMLoc startPos) { lexer_.seek(startPos); tok_ = lexer_.advance(); } /// Parse the given buffer id, indexing all functions and storing them in the /// \p Context. Returns true on success, at which point the file can be /// processed on demand in \p LazyParse mode. \p useStaticBuiltinDetected will /// be set to true if 'use static builtin' directive is detected in the /// source. static bool preParseBuffer( Context &context, uint32_t bufferId, bool &useStaticBuiltinDetected); /// Parse the AST of a specified function type at a given starting point. /// This is used for lazy compilation to parse and compile the function on /// the first call. Optional<ESTree::NodePtr> parseLazyFunction( ESTree::NodeKind kind, SMLoc start); /// Return true if the parser detected 'use static builtin' directive from the /// source. bool getUseStaticBuiltin() const { return useStaticBuiltin_; } private: /// Called when the parser detects 'use static builtin' directive from the /// source. void setUseStaticBuiltin() { useStaticBuiltin_ = true; } /// Called during construction to initialize Identifiers used for parsing, /// such as "var". The lexer and parser uses these to avoid passing strings /// around. void initializeIdentifiers(); /// Current compilation context. Context &context_; /// Source error and buffer manager. SourceErrorManager &sm_; /// Source code lexer. JSLexer lexer_; /// Current token. const Token *tok_{}; /// The current parser mode (see \p ParserPass). ParserPass pass_{FullParse}; /// Function offsets. PreParse mode fills it in, LazyParse mode uses it /// to skip spans while parsing. PreParsedBufferInfo *preParsed_{nullptr}; /// Track the parser recursion depth to avoid stack overflow. /// We don't have to track it precisely as long as we increment it once in /// every possible recursion cycle. unsigned recursionDepth_{0}; /// Self-explanatory: the maximum depth of parser recursion. static constexpr unsigned MAX_RECURSION_DEPTH = 1024; /// Set when the parser sees the 'use static builtin' directive in any scope. bool useStaticBuiltin_{false}; /// Set when the parser is inside a generator function. /// This is used when checking if `yield` is a valid Identifier name. bool paramYield_{false}; // Certain known identifiers which we need to use when constructing the // ESTree or when parsing; UniqueString *getIdent_; UniqueString *setIdent_; UniqueString *initIdent_; UniqueString *useStrictIdent_; UniqueString *letIdent_; UniqueString *ofIdent_; UniqueString *useStaticBuiltinIdent_; UniqueString *fromIdent_; UniqueString *asIdent_; UniqueString *implementsIdent_; UniqueString *interfaceIdent_; UniqueString *packageIdent_; UniqueString *privateIdent_; UniqueString *protectedIdent_; UniqueString *publicIdent_; UniqueString *staticIdent_; UniqueString *methodIdent_; UniqueString *constructorIdent_; UniqueString *yieldIdent_; UniqueString *newIdent_; UniqueString *targetIdent_; /// String representation of all tokens. UniqueString *tokenIdent_[NUM_JS_TOKENS]; UniqueString *getTokenIdent(TokenKind kind) const { return tokenIdent_[(unsigned)kind]; } /// Allocate an ESTree node of a certain type with supplied location and /// construction arguments. All nodes are allocated using the supplied /// allocator. template <class Node, class StartLoc, class EndLoc> Node *setLocation(StartLoc start, EndLoc end, Node *node) { node->setStartLoc(getStartLoc(start)); node->setEndLoc(getEndLoc(end)); node->setDebugLoc(getStartLoc(start)); return node; } /// Sets staart, end and debug lcoations of an ast node. template <class Node, class StartLoc, class EndLoc, class DebugLoc> Node *setLocation(StartLoc start, EndLoc end, DebugLoc debugLoc, Node *node) { node->setStartLoc(getStartLoc(start)); node->setEndLoc(getEndLoc(end)); node->setDebugLoc(getStartLoc(debugLoc)); return node; } // A group of overrides to extract the start and end location of various // objects. The purpose is to allow flexibility when passing the location // information to setLocation(). We could pass existing nodes, locations, // tokens, or a combination of them. static SMLoc getStartLoc(const Token *tok) { return tok->getStartLoc(); } static SMLoc getStartLoc(const ESTree::Node *from) { return from->getStartLoc(); } static SMLoc getStartLoc(SMLoc loc) { return loc; } static SMLoc getStartLoc(const SMRange &rng) { return rng.Start; } static SMLoc getEndLoc(const Token *tok) { return tok->getEndLoc(); } static SMLoc getEndLoc(const ESTree::Node *from) { return from->getEndLoc(); } static SMLoc getEndLoc(SMLoc loc) { return loc; } static SMLoc getEndLoc(const SMRange &rng) { return rng.End; } /// Obtain the next token from the lexer and store it in tok_. /// \param grammarContext enable recognizing either "/" and "/=", or a regexp. /// \return the source location of the just consumed (previous) token. SMRange advance( JSLexer::GrammarContext grammarContext = JSLexer::AllowRegExp) { SMRange loc = tok_->getSourceRange(); tok_ = lexer_.advance(grammarContext); return loc; } /// Report an error that one of the specified tokens was expected at the /// location of the current token. /// \param where (optional) If non-null, it is appended to the error message, /// and is intended to explain the context in which these tokens /// were expected (e.g. "after 'if'") /// \param what (optional) If not null, showen as an additional hint about the /// error at the location specified by whatLoc. If whatLoc and the /// current token are on the same line, `what` is not displayed but /// the entire region between the location is emphasized. void errorExpected( ArrayRef<TokenKind> toks, const char *where, const char *what, SMLoc whatLoc); /// Convenience wrapper around errorExpected(). void errorExpected( TokenKind k1, const char *where, const char *what, SMLoc whatLoc) { errorExpected(ArrayRef<TokenKind>(k1), where, what, whatLoc); } /// Convenience wrapper around errorExpected(). void errorExpected( TokenKind k1, TokenKind k2, const char *where, const char *what, SMLoc whatLoc) { TokenKind toks[] = {k1, k2}; errorExpected(ArrayRef<TokenKind>(toks, 2), where, what, whatLoc); }; /// Check whether the current token is the specified one and report an error /// if it isn't. \returns false if it reported an error. /// The extra params \p where, \p what and \p whatLoc are optional and are /// documented in errorExpected(). bool need(TokenKind kind, const char *where, const char *what, SMLoc whatLoc); /// Check whether the current token is the specified one and if it is, consume /// it, otherwise an report an error. \returns false if it reported an error. /// \param grammarContext enable recognizing either "/" and "/=", or a regexp /// when consuming the next token. /// The extra params \p where, \p what and \p whatLoc are optional and are /// documented in errorExpected(). bool eat( TokenKind kind, JSLexer::GrammarContext grammarContext, const char *where, const char *what, SMLoc whatLoc); /// Check whether the current token is the specified one and consume it if so. /// \returns true if the token matched. bool checkAndEat(TokenKind kind); /// Check whether the current token is the specified identifier and consume it /// if so. \returns true if the token matched. bool checkAndEat(UniqueString *ident); /// Check whether the current token is the specified one. \returns true if it /// is. bool check(TokenKind kind) const { return tok_->getKind() == kind; } /// \return true if the current token is the specified identifier. bool check(UniqueString *ident) const { return tok_->getKind() == TokenKind::identifier && tok_->getIdentifier() == ident; } /// Check whether the current token is one of the specified ones. \returns /// true if it is. bool check(TokenKind kind1, TokenKind kind2) const { return tok_->getKind() == kind1 || tok_->getKind() == kind2; } template <typename T> inline bool checkN(T t) const { return check(t); } /// Convenience function to compare against more than 2 token kinds. We still /// use check() for 2 or 1 kinds because it is more typesafe. template <typename Head, typename... Tail> inline bool checkN(Head h, Tail... tail) const { return check(h) || checkN(tail...); } /// Check whether the current token is an assignment operator. bool checkAssign() const; /// Check whether the current token begins a Declaration. bool checkDeclaration() const { return checkN( TokenKind::rw_function, letIdent_, TokenKind::rw_const, TokenKind::rw_class); } /// Check whether the current token begins a template literal. bool checkTemplateLiteral() const { return check(TokenKind::no_substitution_template, TokenKind::template_head); } /// Performs automatic semicolon insertion and optionally reports an error /// if a semicolon is missing and cannot be inserted. /// \param endLoc is the previous end location before the semi. It will be /// updated with the location of the semi, if present. /// \param optional if set to true, an error will not be reported. /// \return false if a semi was not found and it could not be inserted. bool eatSemi(SMLoc &endLoc, bool optional = false); /// Process a directive by updating internal flags appropriately. Currently /// we only care about "use strict". void processDirective(UniqueString *directive); /// Check whether the recursion depth has been exceeded, and if so generate /// and error and return true. bool recursionDepthExceeded(); // Parser functions. All of these correspond more or less directly to grammar // productions, except in cases where the grammar is ambiguous, but even then // the name should be self-explanatory. Optional<ESTree::ProgramNode *> parseProgram(); /// Parse a function declaration, and optionally force an eager parse. /// Otherwise, the function will be skipped in lazy mode and a dummy returned. /// \param param [Yield] Optional<ESTree::FunctionDeclarationNode *> parseFunctionDeclaration( Param param, bool forceEagerly = false); /// Parse a function declaration or expression, and optionally force an eager /// parse. Otherwise, the function will be skipped in lazy mode and a dummy /// returned. /// \param param [Yield, Default] Optional<ESTree::FunctionLikeNode *> parseFunctionHelper( Param param, bool isDeclaration, bool forceEagerly = false); /// \param param [Yield, Return] Optional<ESTree::Node *> parseStatement(Param param); enum class AllowImportExport { No, Yes, }; /// Parse a statement list. /// \param param [Yield] /// \param until stop parsing when this token is enountered /// \param parseDirectives if true, recognize directives in the beginning of /// the block. Specifically, it will recognize "use strict" and enable /// strict mode. /// \return a dummy value for consistency. Optional<bool> parseStatementList( Param param, TokenKind until, bool parseDirectives, AllowImportExport allowImportExport, ESTree::NodeList &stmtList); /// Parse a statement block. /// \param param [Yield, Return] /// \param grammarContext context to be used when consuming the closing brace. /// \param parseDirectives if true, recognize directives in the beginning of /// the block. Specifically, it will recognize "use strict" and enable /// strict mode. Optional<ESTree::BlockStatementNode *> parseBlock( Param param, JSLexer::GrammarContext grammarContext = JSLexer::AllowRegExp, bool parseDirectives = false); /// Parse a function body. This is a wrapper around parseBlock for the /// purposes of lazy parsing. /// \param param [Yield] Optional<ESTree::BlockStatementNode *> parseFunctionBody( Param param, bool eagerly, JSLexer::GrammarContext grammarContext = JSLexer::AllowRegExp, bool parseDirectives = false); /// Parse a declaration. /// \param param [Yield] Optional<ESTree::Node *> parseDeclaration(Param param); /// Check if the provided string is a valid binding identifier. /// Can be used to validate identifiers after we've passed lexing them. /// The caller must report any errors if this function returns false. /// \param param [Yield] /// \param id the string to be validated. /// \param kind the TokenKind provided when the string was lexed. /// \return true if \param id is a valid binding identifier. bool validateBindingIdentifier(Param param, UniqueString *id, TokenKind kind); /// ES 2015 12.1 /// Does not generate an error. It is expected that the caller will do it. /// \param param [Yield] Optional<ESTree::IdentifierNode *> parseBindingIdentifier(Param param); /// Parse a VariableStatement or LexicalDeclaration. /// \param param [In, Yield] /// \param declLoc the location of the let/const for error messages. Optional<ESTree::VariableDeclarationNode *> parseLexicalDeclaration( Param param); /// Parse a VariableStatement or LexicalDeclaration. /// \param param [Yield] /// \param declLoc the location of the let/const for error messages. Optional<ESTree::VariableDeclarationNode *> parseVariableStatement( Param param); /// Parse a list of variable declarations. \returns a dummy value but the /// optionality still encodes the error condition. /// \param param [In, Yield] /// \param declLoc is the location of the `rw_var` token and is used for error /// display. Optional<const char *> parseVariableDeclarationList( Param param, ESTree::NodeList &declList, SMLoc declLoc); /// \param param [In, Yield] /// \param declLoc is the location of the let/var/const token and is used for /// error display. Optional<ESTree::VariableDeclaratorNode *> parseVariableDeclaration( Param param, SMLoc declLoc); /// Ensure that all destructuring declarations in the specified declaration /// node are initialized and report errors if they are not. void ensureDestructuringInitialized( ESTree::VariableDeclarationNode *declNode); Optional<ESTree::Node *> parseBindingPattern(Param param); Optional<ESTree::ArrayPatternNode *> parseArrayBindingPattern(Param param); Optional<ESTree::Node *> parseBindingElement(Param param); Optional<ESTree::Node *> parseBindingRestElement(Param param); /// Parse "'=' Initializer" in a binding pattern. Optional<ESTree::AssignmentPatternNode *> parseBindingInitializer( Param param, ESTree::Node *left); Optional<ESTree::ObjectPatternNode *> parseObjectBindingPattern(Param param); Optional<ESTree::PropertyNode *> parseBindingProperty(Param param); Optional<ESTree::Node *> parseBindingRestProperty(Param param); Optional<ESTree::EmptyStatementNode *> parseEmptyStatement(); /// \param param [Yield, Return] Optional<ESTree::Node *> parseExpressionOrLabelledStatement(Param param); /// \param param [Yield, Return] Optional<ESTree::IfStatementNode *> parseIfStatement(Param param); /// \param param [Yield, Return] Optional<ESTree::WhileStatementNode *> parseWhileStatement(Param param); /// \param param [Yield, Return] Optional<ESTree::DoWhileStatementNode *> parseDoWhileStatement(Param param); /// \param param [Yield, Return] Optional<ESTree::Node *> parseForStatement(Param param); Optional<ESTree::ContinueStatementNode *> parseContinueStatement(); Optional<ESTree::BreakStatementNode *> parseBreakStatement(); Optional<ESTree::ReturnStatementNode *> parseReturnStatement(); /// \param param [Yield, Return] Optional<ESTree::WithStatementNode *> parseWithStatement(Param param); /// \param param [Yield, Return] Optional<ESTree::SwitchStatementNode *> parseSwitchStatement(Param param); /// \param param [Yield] Optional<ESTree::ThrowStatementNode *> parseThrowStatement(Param param); /// \param param [Yield, Return] Optional<ESTree::TryStatementNode *> parseTryStatement(Param param); Optional<ESTree::DebuggerStatementNode *> parseDebuggerStatement(); Optional<ESTree::Node *> parsePrimaryExpression(); Optional<ESTree::ArrayExpressionNode *> parseArrayLiteral(); Optional<ESTree::ObjectExpressionNode *> parseObjectLiteral(); Optional<ESTree::Node *> parseSpreadElement(); Optional<ESTree::Node *> parsePropertyAssignment(bool eagerly); /// Parse a property key which is a string, number or identifier. If it is /// neither, reports an error. Optional<ESTree::Node *> parsePropertyName(); /// Parse a template literal starting at either TemplateHead or /// NoSubstitutionTemplate. /// \param param [Yield, Tagged] Optional<ESTree::Node *> parseTemplateLiteral(Param param); Optional<ESTree::FunctionExpressionNode *> parseFunctionExpression( bool forceEagerly = false); /// Parse MemberExpression except the production starting with "new". Optional<ESTree::Node *> parseMemberExpressionExceptNew(); /// Returns a dummy Optional<> just to indicate success or failure like all /// other functions. Optional<const char *> parseArguments( ESTree::NodeList &argList, SMLoc &endLoc); /// \param objectLoc the location of the object part of the expression and is /// used for error display. Optional<ESTree::Node *> parseMemberSelect( SMLoc objectLoc, ESTree::NodePtr expr); /// \param startLoc the start location of the expression, used for error /// display. Optional<ESTree::Node *> parseCallExpression( SMLoc startLoc, ESTree::NodePtr expr); /// Parse a \c NewExpression or a \c MemberExpression. /// After we have recognized "new", there is an apparent ambiguity in the /// grammar between \c NewExpression and \c MemberExpression: /// /// \code /// NewExpression: /// MemberExpression /// new NewExpression /// /// MemberExpression: /// new MemberExpression Arguments /// \endcode /// /// The difference is that in the first case there are no arguments to the /// constructor. Optional<ESTree::Node *> parseNewExpressionOrMemberExpression(); Optional<ESTree::Node *> parseLeftHandSideExpression(); Optional<ESTree::Node *> parsePostfixExpression(); Optional<ESTree::Node *> parseUnaryExpression(); /// Parse a binary expression using a precedence table, in order to decrease /// recursion depth. Optional<ESTree::Node *> parseBinaryExpression(Param param); Optional<ESTree::Node *> parseConditionalExpression(Param param = ParamIn); Optional<ESTree::YieldExpressionNode *> parseYieldExpression( Param param = ParamIn); Optional<ESTree::ClassDeclarationNode *> parseClassDeclaration(Param param); Optional<ESTree::ClassExpressionNode *> parseClassExpression(); Optional<ESTree::ClassBodyNode *> parseClassTail( SMLoc startLoc, ESTree::NodePtr &superClass); Optional<ESTree::ClassBodyNode *> parseClassBody(SMLoc startLoc); Optional<ESTree::MethodDefinitionNode *> parseMethodDefinition( bool isStatic, bool eagerly = false); /// Reparse the specified node as arrow function parameter list and store the /// parameter list in \p paramList. Print an error and return false on error, /// otherwise return true. bool reparseArrowParameters(ESTree::Node *node, ESTree::NodeList &paramList); Optional<ESTree::Node *> parseArrowFunctionExpression( Param param, ESTree::Node *leftExpr); /// Reparse an ArrayExpression into an ArrayPattern. /// \param inDecl whether this is a declaration context or assignment. Optional<ESTree::Node *> reparseArrayAsignmentPattern( ESTree::ArrayExpressionNode *AEN, bool inDecl); /// Reparse an ObjectExpression into an ObjectPattern. /// \param inDecl whether this is a declaration context or assignment. Optional<ESTree::Node *> reparseObjectAssignmentPattern( ESTree::ObjectExpressionNode *OEN, bool inDecl); /// Reparse an ArrayExpression or ObjectExpression into ArrayPattern or /// ObjectPattern. /// \param inDecl whether this is a declaration context or assignment. Optional<ESTree::Node *> reparseAssignmentPattern( ESTree::Node *node, bool inDecl); Optional<ESTree::Node *> parseAssignmentExpression(Param param = ParamIn); Optional<ESTree::Node *> parseExpression(Param param = ParamIn); /// Parse a FromClause and return the string literal representing the source. Optional<ESTree::StringLiteralNode *> parseFromClause(); Optional<ESTree::Node *> parseImportDeclaration(); bool parseImportClause(ESTree::NodeList &specifiers); Optional<ESTree::Node *> parseNameSpaceImport(); bool parseNamedImports(ESTree::NodeList &specifiers); Optional<ESTree::ImportSpecifierNode *> parseImportSpecifier(SMLoc importLoc); Optional<ESTree::Node *> parseExportDeclaration(); /// \param[out] specifiers the list of parsed specifiers. /// \param[out] endLoc end location after export clause has been parsed. /// \param[out] invalids ranges of potentially invalid exported symbols, /// only if the clause is eventually followed by a FromClause. bool parseExportClause( ESTree::NodeList &specifiers, SMLoc &endLoc, llvm::SmallVectorImpl<SMRange> &invalids); /// \param[out] invalids ranges of potentially invalid exported symbols, /// only if the clause is eventually followed by a FromClause. /// Appended to if an exported name may be invalid. Optional<ESTree::Node *> parseExportSpecifier( SMLoc exportLoc, llvm::SmallVectorImpl<SMRange> &invalids); /// If the current token can be recognised as a directive (ES5.1 14.1), /// process the directive and return the allocated directive statement. /// Note that this function never needs to returns an error. /// \return the allocated directive statement if this is a directive, or /// null if it isn't. ESTree::ExpressionStatementNode *parseDirective(); /// Allocate a binary expression node with the specified children and /// operator. inline ESTree::NodePtr newBinNode(ESTree::NodePtr left, TokenKind opKind, ESTree::NodePtr right) { UniqueString *opIdent = getTokenIdent(opKind); if (opKind == TokenKind::ampamp || opKind == TokenKind::pipepipe) return setLocation( left, right, new (context_) ESTree::LogicalExpressionNode(left, right, opIdent)); else return setLocation( left, right, new (context_) ESTree::BinaryExpressionNode(left, right, opIdent)); } /// RAII to save and restore the current setting of "strict mode". class SaveStrictMode { JSParserImpl *const parser_; const bool oldValue_; public: SaveStrictMode(JSParserImpl *parser) : parser_(parser), oldValue_(parser->isStrictMode()) {} ~SaveStrictMode() { parser_->setStrictMode(oldValue_); } }; /// RAII to track the recursion depth. class TrackRecursion { JSParserImpl *const parser_; public: TrackRecursion(JSParserImpl *parser) : parser_(parser) { ++parser_->recursionDepth_; } ~TrackRecursion() { --parser_->recursionDepth_; } }; }; }; // namespace detail }; // namespace parser }; // namespace hermes #endif // HERMES_PARSER_JSPARSERIMPL_H
36.995902
80
0.709944
[ "object" ]
03f6009c1dcbe930293781e44d30fa35587aa6fd
695
c
C
PP4E-Examples-1.4/Examples/PP4E/Integrate/Embed/Basics/embed-string.c
AngelLiang/PP4E
3a7f63b366e1e4700b4d2524884696999a87ba9d
[ "MIT" ]
null
null
null
PP4E-Examples-1.4/Examples/PP4E/Integrate/Embed/Basics/embed-string.c
AngelLiang/PP4E
3a7f63b366e1e4700b4d2524884696999a87ba9d
[ "MIT" ]
null
null
null
PP4E-Examples-1.4/Examples/PP4E/Integrate/Embed/Basics/embed-string.c
AngelLiang/PP4E
3a7f63b366e1e4700b4d2524884696999a87ba9d
[ "MIT" ]
null
null
null
/* code-strings with results and namespaces */ #include <Python.h> main() { char *cstr; PyObject *pstr, *pmod, *pdict; printf("embed-string\n"); Py_Initialize(); /* get usermod.message */ pmod = PyImport_ImportModule("usermod"); pdict = PyModule_GetDict(pmod); pstr = PyRun_String("message", Py_eval_input, pdict, pdict); /* convert to C */ PyArg_Parse(pstr, "s", &cstr); printf("%s\n", cstr); /* assign usermod.X */ PyObject_SetAttrString(pmod, "X", pstr); /* print usermod.transform(X) */ (void) PyRun_String("print(transform(X))", Py_file_input, pdict, pdict); Py_DECREF(pmod); Py_DECREF(pstr); Py_Finalize(); }
23.965517
76
0.623022
[ "transform" ]
03f732bc67f3c2b72dbffe0d2a317d2230d76b03
51,400
c
C
minilibmol/mol.0.0.6/minimize.c
StructuralBioinformaticsLab/octree_example
c3020100580a616c48db7ccd978e7117368d8c4d
[ "BSD-3-Clause" ]
1
2016-07-15T18:03:28.000Z
2016-07-15T18:03:28.000Z
minilibmol/mol.0.0.6/minimize.c
StructuralBioinformaticsLab/octree_example
c3020100580a616c48db7ccd978e7117368d8c4d
[ "BSD-3-Clause" ]
null
null
null
minilibmol/mol.0.0.6/minimize.c
StructuralBioinformaticsLab/octree_example
c3020100580a616c48db7ccd978e7117368d8c4d
[ "BSD-3-Clause" ]
2
2020-04-11T20:55:38.000Z
2021-01-30T09:49:18.000Z
/* Copyright (c) 2009-2012, Structural Bioinformatics Laboratory, Boston University All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <float.h> #include _MOL_INCLUDE_ #include "minimize.h" //Powell/dirPowell is below void bracket(double* orig, double* dir, double step, int ndim, void* prms, void (*egfun)(int , double* , void* , double*, double* ), double *fb, double *la, double *lb, double *lc) { int mindim=ndim; double* new=_mol_malloc(mindim*sizeof(double) ); double fa,fc,fnew,lnew; double G = 1.618034; double TooSmall=pow(10, -10); int i, j; *la=0; *lb=step; egfun(ndim, orig, prms, &fa, NULL); for (i =0; i<mindim ; i++) new[i] = orig[i]+step*dir[i]; egfun(ndim, new, prms, fb, NULL); if(fa<*fb) { double temp; temp = fa; fa = *fb; *fb = temp; temp =*la; *la=*lb; *lb=temp; } *lc=*lb+G*(*lb-*la); // printf("la %f lb %f lc %f\n", *la, *lb, *lc); for (i =0; i<mindim ; i++) new[i] = orig[i]+*lc*dir[i]; egfun(ndim, new, prms, &fc, NULL); double parabp1, parabp2; while( (fc<=*fb)) { // printf("lb=%f", *lb); parabp1 = (*lb -*la)*(*fb-fc); parabp2 = (*lb -*lc)*(*fb-fa); if( fabs(parabp1-parabp2)>TooSmall) { lnew=*lb+((*lb-*lc)*parabp2-(*lb-*la)*parabp1)/(2*(parabp1-parabp2)); if(((*lb-lnew)*(lnew-*lc))>0) { for(j =0; j<mindim ; j++) new[j] = orig[j] + lnew*(dir[j]); egfun(ndim, new, prms, &fnew, NULL); if(fnew<fc) { *la=*lb; *fb=fnew; *lb=lnew; free(new); return; } else if(fnew>*fb) { *lc=lnew; free(new); return; } lnew=*lc+G*(*lc-*lb); for(j =0; j<mindim ; j++) new[j] = orig[j] + lnew*(dir[j]); egfun(ndim, new, prms, &fnew, NULL); } else { for(j =0; j<mindim ; j++) new[j] = orig[j] + lnew*(dir[j]); egfun(ndim, new, prms, &fnew, NULL); if(fnew<fc) { *lb=*lc; *lc=lnew; lnew=*lc+G*(*lc-*lb); *fb=fc; fc=fnew; for(j =0; j<mindim ; j++) new[j] = orig[j] + lnew*(dir[j]); egfun(ndim, new, prms, &fnew, NULL); } } } else { lnew=*lc+G*(*lc-*lb); for(j =0; j<mindim ; j++) new[j] = orig[j] + lnew*(dir[j]); egfun(ndim, new, prms, &fnew, NULL); } *la=*lb; *lb=*lc; *lc=lnew; fa=*fb; *fb=fc; fc=fnew; } free(new); } void old_brent(double* orig, double* dir, double fb, double la, double lb, double lc, int ndim, void* prms, void (*egfun)(int , double* , void* , double*, double* ), double tol, int maxtimes, double* min, double* fmim) { int j; double* new=_mol_malloc(ndim*sizeof(double) ); double s=pow(10,-10); double CGOLD=0.3819660; int iter; double a,b,d=0.0,etemp,fu,fv,fw,fx,p,q,r,tol1,tol2,u,v,w,x,xm; double e=0.0; a=(la < lc ? la : lc); b=(la > lc ? la : lc); x=w=v=lb; // for(j=0; j<ndim; j++) // new[j]=orig[j]+x*dir[j]; // egfun(ndim, new, prms, &fx, NULL); fw=fv=fx=fb; for (iter=1;iter<=maxtimes;iter++) { xm=0.5*(a+b); tol2=2.0*(tol1=tol*fabs(x)+s); if (fabs(x-xm) <= (tol2-0.5*(b-a))) { for(j=0; j<ndim; j++) min[j]=orig[j]+x*dir[j]; *fmim=fx; free(new); return ; } if (fabs(e) > tol1) { r=(x-w)*(fx-fv); q=(x-v)*(fx-fw); p=(x-v)*q-(x-w)*r; q=2.0*(q-r); if (q > 0.0) p = -p; q=fabs(q); etemp=e; e=d; if (fabs(p) >= fabs(0.5*q*etemp) || p <= q*(a-x) || p >= q*(b-x)) d=CGOLD*(e=(x >= xm ? a-x : b-x)); else { d=p/q; u=x+d; if (u-a < tol2 || b-u < tol2) d=((xm-x) >= 0.0 ? fabs(tol1) : -fabs(tol1)); } } else { d=CGOLD*(e=(x >= xm ? a-x : b-x)); } u=(fabs(d) >= tol1 ? x+d : x+((d) >= 0.0 ? fabs(tol1) : -fabs(tol1))); for(j=0; j<ndim; j++) new[j]=orig[j]+u*dir[j]; egfun(ndim, new, prms, &fu, NULL); if (fu <= fx) { if(u >= x) a=x; else b=x; v=w;w=x;x=u; fv=fw;fw=fx;fx=fu; } else { if (u < x) a=u; else b=u; if (fu <= fw || w == x) { v=w; w=u; fv=fw; fw=fu; } else if (fu <= fv || v == x || v == w) { v=u; fv=fu; } } } printf("Too many iterations in brent\n"); for(j=0; j<ndim; j++) min[j]=orig[j]+x*dir[j]; *fmim=fx; free(new); } void brent(double* orig, double* dir, double fb, double la, double lb, double lc, int ndim, void* prms, void (*egfun)(int , double* , void* , double*, double* ), double tol, unsigned int maxtimes, double* min, double* fmim) { double lbound1,lbound2; unsigned int numIt = 0; int doGolden,i; int numAct=ndim; if( la<lc) { lbound1=la; lbound2=lc; } else { lbound1=lc; lbound2=la; } double lcurmin=lb; double lprevmin=lb; double lprevmin2=lb; double fcurmin=fb; double fprevmin=fb; double fprevmin2=fb; double dMoved=0; double dMoved2=0; double s= pow(10,-10); double lim; double par1,par2,lpartial,lnew,fnew; double GOLD=0.381966; double* new=_mol_malloc(numAct*sizeof(double) ); double denom; double lmidpoint = 0.5*(lbound1+lbound2); double tempdMoved; lim=tol*fabs(lcurmin)+s; while(fabs(lcurmin -lmidpoint)>(2*lim - 0.5*(lbound2-lbound1)) && numIt<maxtimes) { lmidpoint = 0.5*(lbound1+lbound2); lim=tol*fabs(lcurmin)+s; doGolden=1; if(fabs(dMoved2)>lim) { par1=(lcurmin-lprevmin)*(fcurmin-fprevmin2); par2=(lcurmin-lprevmin2)*(fcurmin-fprevmin); lpartial=((lcurmin-lprevmin)*par1-(lcurmin-lprevmin2)*par2); denom=2*(par1-par2); if(denom>0) lpartial*=-1; denom=fabs(denom); tempdMoved=dMoved2; if(fabs(lpartial)<abs(0.5*denom*tempdMoved) && lpartial>denom* (lbound1-lcurmin) && lpartial<denom*(lbound2-lcurmin)) { dMoved=lpartial/denom; lnew=lcurmin+dMoved; if(lnew-lbound1<2*lim||lbound2-lnew<2*lim) { doGolden=0; if(lmidpoint-lcurmin !=0) dMoved=lim*(lmidpoint-lcurmin)/fabs(lmidpoint-lcurmin); else dMoved=lim; } } } if( doGolden != 0) { if(lcurmin>=lmidpoint) dMoved2=lbound1-lcurmin; else dMoved2=lbound2-lcurmin; dMoved=GOLD*dMoved2; } if (fabs(dMoved)>lim) lnew=lcurmin+dMoved; else { if(dMoved != 0) lnew=lcurmin+lim*(dMoved/fabs(dMoved)); else lnew = lcurmin; } for(i=0; i<numAct; i++) new[i] = orig[i] + lnew*dir[i]; egfun(ndim, new, prms, &fnew, NULL); if(fnew<fcurmin) { if (lnew>=lcurmin) lbound1=lcurmin; else lbound2=lcurmin; lprevmin2=lprevmin; fprevmin2=fprevmin; lprevmin=lcurmin; fprevmin=fcurmin; lcurmin=lnew; fcurmin=fnew; } else { if(lnew<lcurmin) lbound1=lnew; else lbound2=lnew; if(fnew<fprevmin || lprevmin == fcurmin) { lprevmin2=lprevmin; fprevmin2=fprevmin; lprevmin=lnew; fprevmin=fnew; } else if(fnew<fprevmin2 || lprevmin2==lcurmin||lprevmin2==lprevmin) { lprevmin2=lnew; fprevmin2=fnew; } } dMoved2=dMoved; dMoved=lcurmin-lprevmin; numIt++; } if(numIt==maxtimes) printf("MAXIMUM ITERATIONS REACHED. RETURNING CURRENT BEST\n"); for(i=0; i<numAct; i++) min[i]=orig[i]+lcurmin*dir[i]; *fmim=fcurmin; free(new); } void dirbrent(double* orig, double* dir, double fb, double la, double lb, double lc, int ndim, void* prms, void (*egfun)(int , double* , void* , double* , double*), double tol, int maxtimes, double* min, double* fmim, double* grad) { double lbound1,lbound2; int numIt=0; int doBisect, i, canUse1, canUse2; int numAct=ndim; if( la<lc) { lbound1=la; lbound2=lc; } else { lbound1=lc; lbound2=la; } double db=0; for(i=0; i<numAct; i++) db+=grad[i]*dir[i]; double lcurmin=lb; double lprevmin=lb; double lprevmin2=lb; double dcurmin= db; double dprevmin= db; double dprevmin2= db; double fcurmin=fb; double fprevmin=fb; double fprevmin2=fb; double distMoved=0; double distMoved2=0; double s= pow(10,-10); double lim; double sec1=0,sec2=0,lnew,fnew,dnew; double* new=_mol_malloc(numAct*sizeof(double) ); double lmidpoint; double tempdistMoved; for(numIt=0; numIt<maxtimes; numIt++ ) { lmidpoint = 0.5*(lbound1+lbound2); lim=tol*fabs(lcurmin)+s; if (fabs(lcurmin -lmidpoint)<=(2*lim - 0.5*(lbound2-lbound1))) { for(i=0; i<numAct; i++) min[i]=orig[i]+lcurmin*dir[i]; *fmim=fcurmin; free(new); return; } doBisect=1; if(fabs(distMoved2)>lim) { canUse1=0; canUse2=0; if (dprevmin != dcurmin) { sec1=(lprevmin-lcurmin)*dcurmin/(dcurmin-dprevmin); canUse1=1; } if (dprevmin2 != dcurmin) { sec2=(lprevmin2-lcurmin)*dcurmin/(dcurmin-dprevmin2); canUse2=1; } tempdistMoved=distMoved2; distMoved2=distMoved; if (canUse1 !=0) { if(((lbound1-lcurmin-sec1) * (lcurmin+sec1-lbound2)<=0)||(dcurmin*sec1>0)) canUse1=0; } if (canUse2 !=0) { if(((lbound1-lcurmin-sec2) * (lcurmin+sec2-lbound2)<=0)||(dcurmin*sec2>0)) canUse2=0; } if(canUse2 + canUse1 != 0) { if(canUse1+canUse2 == 2) { if(fabs(sec1)<fabs(sec2)) distMoved=sec1; else distMoved=sec2; } else if(canUse1 != 0) distMoved=sec1; else if(canUse2 != 0) distMoved=sec2; doBisect=0; if(fabs(distMoved)<= fabs(0.5*tempdistMoved)) { lnew=lcurmin+distMoved; if(((lnew-lbound1)<2*lim)||((lbound2-lnew)<2*lim)) { if(lcurmin<lmidpoint) distMoved=lim; else distMoved=-lim; doBisect=0; } } else doBisect=1; } else doBisect=1; } if( doBisect != 0) { if(dcurmin>0) distMoved2=lbound1-lcurmin; else distMoved2=lbound2-lcurmin; distMoved=0.5*distMoved2; } if (fabs(distMoved)>=lim) { lnew=lcurmin+distMoved; for(i=0; i<numAct; i++) new[i] = orig[i] + lnew*dir[i]; egfun(ndim, new, prms, &fnew, grad); } else { if(distMoved >=0) lnew=lcurmin+lim; else lnew = lcurmin-lim; for(i=0; i<numAct; i++) new[i] = orig[i] + lnew*dir[i]; egfun(ndim, new, prms, &fnew, grad); if (fnew>fcurmin) { for(i=0; i<numAct; i++) min[i]=orig[i]+lcurmin*dir[i]; *fmim=fcurmin; free(new); return; } } dnew=0; for(i=0; i<numAct; i++) dnew+=dir[i]*grad[i]; if((fnew<=fcurmin)) { if (lnew>=lcurmin) lbound1=lcurmin; else lbound2=lcurmin; lprevmin2=lprevmin; fprevmin2=fprevmin; dprevmin2=dprevmin; lprevmin=lcurmin; fprevmin=fcurmin; dprevmin=dcurmin; lcurmin=lnew; fcurmin=fnew; dcurmin=dnew; } else { if(lnew<lcurmin) lbound1=lnew; else lbound2=lnew; if(fnew<=fprevmin || lprevmin ==lcurmin) { lprevmin2=lprevmin; fprevmin2=fprevmin; dprevmin2=dprevmin; lprevmin=lnew; fprevmin=fnew; dprevmin=dnew; } else if(fnew<=fprevmin2 || lprevmin2==lcurmin||lprevmin2==lprevmin) { lprevmin2=lnew; fprevmin2=fnew; dprevmin2=dnew; } } } if(numIt==maxtimes) printf("MAXIMUM ITERATIONS REACHED. RETURNING CURRENT BEST\n"); for(i=0; i<numAct; i++) min[i]=orig[i]+lcurmin*dir[i]; *fmim=fcurmin; free(new); } void powell(double* orig, double* directions, unsigned int maxIt, double tol, int ndim, void* prms, void (*egfun)(int , double* , void* , double* , double*), double* min, double* fmim) { int j, k, //variables that will be used in for loops jmostdec=0,//direction of the biggest decrease withing a single directions set numAct=ndim; unsigned int i; double mostdec=0; double fbrac,fprev, fprev2=0, val; double la=0,lb=0,lc=0; double test; double* pcur=_mol_malloc(numAct*sizeof(double));//point of current minimum double* prev=_mol_malloc(numAct*sizeof(double));//previous minimum double* newdir=_mol_malloc(numAct*sizeof(double));//average direction moved in one iteration for(j=0; j<numAct;j++) { prev[j]=orig[j]; pcur[j]=orig[j]; } egfun(ndim, pcur, prms, &val, NULL); for(i=0; i<maxIt; i++)//loop through once for each direction set(break out if close enough) { fprev=val; mostdec=0; jmostdec=0; for(j=0; j<numAct ;j++)//loop through once for each direction { for(k=0;k<numAct;k++) newdir[k]=directions[numAct*j+k];//get direction fprev2=val; bracket(pcur, newdir, 1, ndim, prms, egfun, &fbrac, &la, &lb, &lc ); brent(pcur, newdir, fbrac, la, lb, lc, ndim, prms, egfun, pow(10,-5), 100, pcur, &val); if(fabs(fprev2-val)>mostdec)//get direction of greatest decrease and greatest decrease { mostdec=fabs(fprev2-val); jmostdec=j; } } if( 2*fabs(fprev-val)<=tol*(fabs(fprev)+fabs(val)))//if you reach the desired tolerance end powell { for(j=0; j<numAct; j++) min[j]=pcur[j]; *fmim=val; free(pcur); free(prev); free(newdir); return; } for(j=0; j<numAct; j++) newdir[j]=2*pcur[j]-prev[j];//get new direction egfun(ndim, newdir, prms, &fprev2, NULL); for(j=0; j<numAct; j++) { newdir[j]=pcur[j]-prev[j]; prev[j]=pcur[j]; } if(fprev2<fprev) { test=2.*(fprev-2.*val+fprev2)*pow((fprev-val-mostdec),2)-mostdec*pow((fprev-fprev2),2); if(test<0) {//if it makes sence to the direction set bracket(pcur, newdir, 1, ndim, prms, egfun, &fbrac, &la, &lb, &lc );//minimize in new direction brent(pcur, newdir, fbrac, la, lb, lc, ndim, prms, egfun, pow(10,-5), 100, pcur, &val); for(k=0; k<numAct; k++) { directions[jmostdec*numAct+k]=directions[(numAct-1)*(numAct)+k]; directions[(numAct-1)*(numAct)+k]= newdir[k]; } } } } printf("warning maximum number of iterations reached. using current best\n"); for(j=0; j<numAct; j++) min[j]=pcur[j]; *fmim=val; free(pcur); free(prev); free(newdir); } void dirMin(double* orig, unsigned int maxIt, double tol, int ndim, void* prms, void (*egfun)(int , double* , void* , double* , double*), double* min, double* fmim) { int numAct = ndim; int i,j; unsigned int it; double* dir=malloc(numAct*sizeof(double)); double* interm=malloc(numAct*sizeof(double)); double* temp=malloc(numAct*sizeof(double)); double* curmin=malloc(numAct*sizeof(double)); double* grad = malloc(numAct*sizeof(double)); double* mvec = malloc(numAct*sizeof(double)); for(i=0; i<numAct; i++) curmin[i]=orig[i]; double val,t1,t2,t3,la,lb,lc,fbrac ; double s = pow(10,-5); double fprev; egfun(ndim, orig, prms, &fprev, grad); double dnorm=0, maxnorm=1.5; for(i=0; i<numAct; i++) { interm[i] =-grad[i] ; temp[i]=interm[i]; dir[i]=interm[i]; } for(it=0; it<maxIt; it++) { dnorm=0; for(i=0; i<numAct; i++) dnorm+= dir[i]*dir[i]; dnorm=sqrt(dnorm); if(dnorm>maxnorm) for(i=0; i<numAct; i++) dir[i]*=maxnorm/dnorm; bracket(curmin, dir, 1, ndim, prms, egfun, &fbrac, &la, &lb, &lc); dirbrent(curmin,dir, fbrac, la, lb, lc, ndim, prms, egfun, pow(10,-10), 100, mvec, &val, grad); if(2*fabs(val-fprev)<= tol*(fabs(fprev)+fabs(val)+s)) { for(j=0; j<numAct; j++) min[j]=mvec[j]; *fmim=val; free(dir); free(mvec); free(interm); free(temp); return; } for(j=0; j<numAct; j++) { curmin[j]=mvec[j]; dir[j]=grad[j]; } fprev =val; t1=0; t2=0; for(j=0; j<numAct; j++) { t1+= pow(interm[j],2); t2+= (dir[j]+interm[j])*dir[j] ; } if(t1 ==0) { for(j=0; j<numAct; j++) min[j]=curmin[j]; *fmim=val; free(dir); free(interm); free(temp); free(mvec); return; } t3=t2/t1; for(j=0; j<numAct; j++) { interm[j] =-dir[j]; temp[j]=interm[j]+t3*temp[j]; dir[j]=temp[j]; } } printf("maximum num of iterations reached displaying current min\n"); for(j=0; j<numAct; j++) min[j]=curmin[j]; *fmim=val; free(dir); free(interm); free(temp); free(mvec); return; } void limin(double* orig, double* dir, unsigned int maxIt, double tol, int ndim, void* prms, void (*egfun)(int , double* , void* , double* , double*), double* min, double* fmim) { double fbrac, la, lb, lc; bracket(orig, dir, 1, ndim, prms, egfun, &fbrac, &la, &lb, &lc); brent(orig, dir, fbrac, la, lb, lc, ndim, prms, egfun, tol, maxIt, min, fmim); } //Powell/dirPowell is above double max3 (double x, double y, double z) { return x < y ? (y < z ? z : y) : (x < z ? z : x); } double max (double x, double y) { return x < y ? y : x; } double min (double x, double y) { return x < y ? x : y; } double sqr (double x) { return x * x; } void linestep (double *stx, double *fx, double *dx, double *sty, double *fy, double *dy, double *stp, double fp, double dp, short *brackt, double stpmin, double stpmax, int *info) { double xsafe = 0.001; short bound; double lsgamma, p, q, r, s, sgnd, stpc, stpf, stpq, theta; info[0] = 0; if ((brackt[0] && (stp[0] <= min (stx[0], sty[0]) || stp[0] >= max (stx[0], sty[0]))) || dx[0] * (stp[0] - stx[0]) >= 0.0 || stpmax < stpmin) return; // Determine if the derivatives have opposite sign. sgnd = dp * (dx[0] / fabs (dx[0])); if (fp > fx[0]) { // First case. A higher function value. // The minimum is bracketed. If the cubic step is closer // to stx than the quadratic step, the cubic step is taken, // else the average of the cubic and quadratic steps is taken. info[0] = 1; bound = 1; theta = 3 * (fx[0] - fp) / (stp[0] - stx[0]) + dx[0] + dp; s = max3 (fabs (theta), fabs (dx[0]), fabs (dp)); lsgamma = s * sqrt (sqr (theta / s) - (dx[0] / s) * (dp / s)); if (stp[0] < stx[0]) lsgamma = -lsgamma; p = (lsgamma - dx[0]) + theta; q = ((lsgamma - dx[0]) + lsgamma) + dp; r = p / q; stpc = stx[0] + r * (stp[0] - stx[0]); stpq = stx[0] + ((dx[0] / ((fx[0] - fp) / (stp[0] - stx[0]) + dx[0])) / 2) * (stp[0] - stx[0]); if (fabs ((stpc - stx[0])) < fabs ((stpq - stx[0]))) { stpf = stpc; } else { stpf = stpc + (stpq - stpc) / 2; } if ( stp[0] > stx[0]) stpf = max (stx[0]+xsafe*(stp[0]-stx[0]),stpf); else stpf = min (stx[0]+xsafe*(stp[0]-stx[0]),stpf); brackt[0] = 1; } else if (sgnd < 0.0) { // Second case. A lower function value and derivatives of // opposite sign. The minimum is bracketed. If the cubic // step is closer to stx than the quadratic (secant) step, // the cubic step is taken, else the quadratic step is taken. info[0] = 2; bound = 0; theta = 3 * (fx[0] - fp) / (stp[0] - stx[0]) + dx[0] + dp; s = max3 (fabs (theta), fabs (dx[0]), fabs (dp)); lsgamma = s * sqrt (sqr (theta / s) - (dx[0] / s) * (dp / s)); if (stp[0] > stx[0]) lsgamma = -lsgamma; p = (lsgamma - dp) + theta; q = ((lsgamma - dp) + lsgamma) + dx[0]; r = p / q; stpc = stp[0] + r * (stx[0] - stp[0]); stpq = stp[0] + (dp / (dp - dx[0])) * (stx[0] - stp[0]); if (fabs (stpc - stp[0]) > fabs (stpq - stp[0])) { stpf = stpc; } else { stpf = stpq; } brackt[0] = 1; } else if (fabs (dp) < fabs (dx[0])) { // Third case. A lower function value, derivatives of the // same sign, and the magnitude of the derivative decreases. // The cubic step is only used if the cubic tends to infinity // in the direction of the step or if the minimum of the cubic // is beyond stp. Otherwise the cubic step is defined to be // either stpmin or stpmax. The quadratic (secant) step is also // computed and if the minimum is bracketed then the the step // closest to stx is taken, else the step farthest away is taken. info[0] = 3; bound = 1; theta = 3 * (fx[0] - fp) / (stp[0] - stx[0]) + dx[0] + dp; s = max3 (fabs (theta), fabs (dx[0]), fabs (dp)); lsgamma = s * sqrt (max (0, sqr (theta / s) - (dx[0] / s) * (dp / s))); if (stp[0] > stx[0]) lsgamma = -lsgamma; p = (lsgamma - dp) + theta; q = (lsgamma + (dx[0] - dp)) + lsgamma; r = p / q; if (r < 0.0 && lsgamma != 0.0) { stpc = stp[0] + r * (stx[0] - stp[0]); } else if (stp[0] > stx[0]) { stpc = stpmax; } else { stpc = stpmin; } stpq = stp[0] + (dp / (dp - dx[0])) * (stx[0] - stp[0]); if (brackt[0]) { if (fabs (stp[0] - stpc) < fabs (stp[0] - stpq)) { stpf = stpc; } else { stpf = stpq; } } else { if (fabs (stp[0] - stpc) > fabs (stp[0] - stpq)) { stpf = stpc; } else { stpf = stpq; } } } else { // Fourth case. A lower function value, derivatives of the // same sign, and the magnitude of the derivative does // not decrease. If the minimum is not bracketed, the step // is either stpmin or stpmax, else the cubic step is taken. info[0] = 4; bound = 0; if (brackt[0]) { theta = 3 * (fp - fy[0]) / (sty[0] - stp[0]) + dy[0] + dp; s = max3 (fabs (theta), fabs (dy[0]), fabs (dp)); lsgamma = s * sqrt (sqr (theta / s) - (dy[0] / s) * (dp / s)); if (stp[0] > sty[0]) lsgamma = -lsgamma; p = (lsgamma - dp) + theta; q = ((lsgamma - dp) + lsgamma) + dy[0]; r = p / q; stpc = stp[0] + r * (sty[0] - stp[0]); stpf = stpc; } else if (stp[0] > stx[0]) { stpf = stpmax; } else { stpf = stpmin; } } // Update the interval of uncertainty. This update does not // depend on the new step or the case analysis above. if (fp > fx[0]) { sty[0] = stp[0]; fy[0] = fp; dy[0] = dp; } else { if (sgnd < 0.0) { sty[0] = stx[0]; fy[0] = fx[0]; dy[0] = dx[0]; } stx[0] = stp[0]; fx[0] = fp; dx[0] = dp; } // Compute the new step and safeguard it. stpf = min (stpmax, stpf); stpf = max (stpmin, stpf); stp[0] = stpf; if (brackt[0] && bound) { if (sty[0] > stx[0]) { stp[0] = min (stx[0] + 0.66 * (sty[0] - stx[0]), stp[0]); } else { stp[0] = max (stx[0] + 0.66 * (sty[0] - stx[0]), stp[0]); } } return; } double gtol = 0.9; int infoc[1], j = 0; double stpmin = 1e-20; double stpmax = 1e20; short brackt[1], stage1 = 0; double dg = 0, dgm = 0, dginit = 0, dgtest = 0, dgx[1], dgxm[1], dgy[1], dgym[1], finit = 0, ftest1 = 0, fm = 0, fx[1], fxm[1], fy[1], fym[1], p5 = 0, p66 = 0, stx[1], sty[1], stmin = 0, stmax = 0, width = 0, width1 = 0, xtrapf = 0; void linesearch (int n, double *x, double f, double *g, double *s, int is0, double *stp, double ftol, double xtol, int maxfev, int *info, int *nfev, double *wa) { /* double stpmin = 1e-20; double stpmax = 1e20; short brackt[1], stage1 = 0; double dg = 0, dgm = 0, dginit = 0, dgtest = 0, dgx[1], dgxm[1], dgy[1], dgym[1], finit = 0, ftest1 = 0, fm = 0, fx[1], fxm[1], fy[1], fym[1], p5 = 0, p66 = 0, stx[1], sty[1], stmin = 0, stmax = 0, width = 0, width1 = 0, xtrapf = 0;*/ p5 = 0.5; p66 = 0.66; xtrapf = 4; if (info[0] != -1) { infoc[0] = 1; if (n <= 0 || stp[0] <= 0 || ftol < 0 || gtol < 0 || xtol < 0 || stpmin < 0 || stpmax < stpmin || maxfev <= 0) return; dginit = 0; for (j = 1; j <= n; j += 1) { dginit = dginit + g[j - 1] * s[is0 + j - 1]; } if (dginit >= 0) { printf ("Bad search direction.\n"); return; } brackt[0] = 0; stage1 = 1; nfev[0] = 0; finit = f; dgtest = ftol * dginit; width = stpmax - stpmin; width1 = width / p5; for (j = 1; j <= n; j += 1) { wa[j - 1] = x[j - 1]; } // function, and derivative at the other endpoint of // the interval of uncertainty. // The variables stp, f, dg contain the values of the step, // function, and derivative at the current step. stx[0] = 0; fx[0] = finit; dgx[0] = dginit; sty[0] = 0; fy[0] = finit; dgy[0] = dginit; } while (1) { if (info[0] != -1) { // Set the minimum and maximum steps to correspond // to the present interval of uncertainty. if (brackt[0]) { stmin = min (stx[0], sty[0]); stmax = max (stx[0], sty[0]); } else { stmin = stx[0]; stmax = stp[0] + xtrapf * (stp[0] - stx[0]); } // Force the step to be within the bounds stpmax and stpmin. stp[0] = max (stp[0], stpmin); stp[0] = min (stp[0], stpmax); // If an unusual termination is to occur then let // stp be the lowest point obtained so far. if ((brackt[0] && (stp[0] <= stmin || stp[0] >= stmax)) || nfev[0] >= maxfev - 1 || infoc[0] == 0 || (brackt[0] && stmax - stmin <= xtol * stmax)) stp[0] = stx[0]; // Evaluate the function and gradient at stp // and compute the directional derivative. // We return to main program to obtain F and G. for (j = 1; j <= n; j += 1) { x[j - 1] = wa[j - 1] + stp[0] * s[is0 + j - 1]; } info[0] = -1; return; } info[0] = 0; nfev[0] = nfev[0] + 1; dg = 0; for (j = 1; j <= n; j += 1) { dg = dg + g[j - 1] * s[is0 + j - 1]; } ftest1 = finit + stp[0] * dgtest; // Test for convergence. if ((brackt[0] && (stp[0] <= stmin || stp[0] >= stmax)) || infoc[0] == 0) info[0] = 6; if (stp[0] == stpmax && f <= ftest1 && dg <= dgtest) info[0] = 5; if (stp[0] == stpmin && (f > ftest1 || dg >= dgtest)) info[0] = 4; if (nfev[0] >= maxfev) info[0] = 3; if (brackt[0] && stmax - stmin <= xtol * stmax) info[0] = 2; if (f <= ftest1 && fabs (dg) <= gtol * (-dginit)) info[0] = 1; // Check for termination. if (info[0] != 0) return; // In the first stage we seek a step for which the modified // function has a nonpositive value and nonnegative derivative. if (stage1 && f <= ftest1 && dg >= min (ftol, gtol) * dginit) stage1 = 0; // A modified function is used to predict the step only if // we have not obtained a step for which the modified // function has a nonpositive function value and nonnegative // derivative, and if a lower function value has been // obtained but the decrease is not sufficient. if (stage1 && f <= fx[0] && f > ftest1) { // Define the modified function and derivative values. fm = f - stp[0] * dgtest; fxm[0] = fx[0] - stx[0] * dgtest; fym[0] = fy[0] - sty[0] * dgtest; dgm = dg - dgtest; dgxm[0] = dgx[0] - dgtest; dgym[0] = dgy[0] - dgtest; // Call cstep to update the interval of uncertainty // and to compute the new step. linestep (stx, fxm, dgxm, sty, fym, dgym, stp, fm, dgm, brackt, stmin, stmax, infoc); // Reset the function and gradient values for f. fx[0] = fxm[0] + stx[0] * dgtest; fy[0] = fym[0] + sty[0] * dgtest; dgx[0] = dgxm[0] + dgtest; dgy[0] = dgym[0] + dgtest; } else { // Call mcstep to update the interval of uncertainty // and to compute the new step. linestep (stx, fx, dgx, sty, fy, dgy, stp, f, dg, brackt, stmin, stmax, infoc); } // Force a sufficient decrease in the size of the // interval of uncertainty. if (brackt[0]) { if (fabs (sty[0] - stx[0]) >= p66 * width1) stp[0] = stx[0] + p5 * (sty[0] - stx[0]); width1 = width; width = fabs (sty[0] - stx[0]); } } } /** Print debugging and status messages for <code>lbfgs</code>. * Depending on the parameter <code>iprint</code>, this can include * number of function evaluations, current function value, etc. * The messages are output to <code>System.err</code>. * * @param iprint Specifies output generated by <code>lbfgs</code>.<p> * <code>iprint[0]</code> specifies the frequency of the output: * <ul> * <li> <code>iprint[0] &lt; 0</code>: no output is generated, * <li> <code>iprint[0] = 0</code>: output only at first and last iteration, * <li> <code>iprint[0] &gt; 0</code>: output every <code>iprint[0]</code> iterations. * </ul><p> * * <code>iprint[1]</code> specifies the type of output generated: * <ul> * <li> <code>iprint[1] = 0</code>: iteration count, number of function * evaluations, function value, norm of the gradient, and steplength, * <li> <code>iprint[1] = 1</code>: same as <code>iprint[1]=0</code>, plus vector of * variables and gradient vector at the initial point, * <li> <code>iprint[1] = 2</code>: same as <code>iprint[1]=1</code>, plus vector of * variables, * <li> <code>iprint[1] = 3</code>: same as <code>iprint[1]=2</code>, plus gradient vector. * </ul> * @param iter Number of iterations so far. * @param nfun Number of function evaluations so far. * @param gnorm Norm of gradient at current solution <code>x</code>. * @param n Number of free parameters. * @param m Number of corrections kept. * @param x Current solution. * @param f Function value at current solution. * @param g Gradient at current solution <code>x</code>. * @param stp Current stepsize. * @param finish Whether this method should print the ``we're done'' message. */ void lb1 (int *iprint, int *iter, int *nfun, double gnorm, int n, int m, double *x, double f, double *g, double *stp, short finish) { int i; if (iter[0] == 0) { printf ("*************************************************\n"); printf (" n = %d number of corrections = %d\n initial values\n", n, m); printf (" f = %.3f gnorm = %.3f\n", f, gnorm); if (iprint[1] >= 1) { printf (" vector x =\n"); for (i = 0; i <= n - 1; i++) printf (" %.3f", x[i]); printf ("\n"); printf (" gradient vector g ="); for (i = 0; i <= n - 1; i++) printf (" %.3f", x[i]); printf ("\n"); } printf ("*************************************************\n"); printf ("\ti\tnfn\tfunc\tgnorm\tsteplength\n"); } else { if ((iprint[0] == 0) && (iter[0] != 1 && !finish)) return; if (iprint[0] != 0) { if ((iter[0] - 1) % iprint[0] == 0 || finish) { if (iprint[1] > 1 && iter[0] > 1) printf ("\ti\tnfn\tfunc\tgnorm\tsteplength\n"); printf ("\t %d\t %d\t %.12f\t %.12f\t%.12f\n", iter[0], nfun[0], f, gnorm, stp[0]); } else { return; } } else { if (iprint[1] > 1 && finish) printf ("\ti\tnfn\tfunc\tgnorm\tsteplength\n"); printf ("\t %d\t %d\t %.12f\t %.12f\t%.12f\n", iter[0], nfun[0], f, gnorm, stp[0]); } if (iprint[1] == 2 || iprint[1] == 3) { if (finish) { printf (" final point x =\n"); } else { printf (" vector x = \n"); } for (i = 0; i <= n - 1; i++) printf ("%.3f ", x[i - 1]); printf ("\n"); if (iprint[1] == 3) { printf (" gradient vector g ="); for (i = 0; i <= n - 1; i++) printf (" %.3f", g[i]); printf ("\n"); } } if (finish) printf (" The minimization terminated without detecting errors. iflag = 0\n"); } return; } double stp1 = 0, ftol = 0, stp[1], ys = 0, yy = 0, sq = 0, yr = 0, beta = 0, xnorm = 0; int point = 0, ispt = 0, iypt = 0, maxfev = 0,info[1], bound = 0, npt = 0, cp = 0, nfev[1], inmc = 0, iycn = 0, iscn = 0; /* worker array w needs to be initialized*/ void lbfgs (int n, int m, double *x, double f, double *g, short diagco, double *diag, int *iprint, double eps, double xtol, double *w, int *iflag, int *iter, int *nfun) { /* double gnorm = 0, stp1 = 0, ftol = 0, stp[1], ys = 0, yy = 0, sq = 0, yr = 0, beta = 0, xnorm = 0; int point = 0, ispt = 0, iypt = 0, maxfev = 0,info[1], bound = 0, npt = 0, cp = 0, i = 0, nfev[1], inmc = 0, iycn = 0, iscn = 0;*/ short finish = 0; short execute_entire_while_loop = 0; int i=0; double gnorm=0; if (iflag[0] == 0) { // Initialize. iter[0] = 0; if (n <= 0 || m <= 0) { iflag[0] = -3; printf ("Improper input parameters (n or m are not positive.). Error %d\n", iflag[0]); return; } if (gtol <= 0.0001) { printf ("LBFGS.lbfgs: gtol is less than or equal to 0.0001. It has been reset to 0.9.\n"); gtol = 0.9; } nfun[0] = 1; point = 0; finish = 0; if (diagco) { for (i = 1; i <= n; i += 1) { if (diag[i - 1] <= 0) { iflag[0] = -2; printf ("The %d-th diagonal element of the inverse hessian approximation is not positive. Error %d\n", i, iflag[0]); return; } } } else { for (i = 1; i <= n; i += 1) { diag[i - 1] = 1; } } ispt = n + 2 * m; iypt = ispt + n * m; for (i = 1; i <= n; i += 1) { w[ispt + i - 1] = -g[i - 1] * diag[i - 1]; } gnorm = sqrt (ddot (n, g, 0, 1, g, 0, 1)); stp1 = 1 / gnorm; ftol = 0.0001; maxfev = 20; if (iprint[1 - 1] >= 0) lb1 (iprint, iter, nfun, gnorm, n, m, x, f, g, stp, finish); execute_entire_while_loop = 1; } while (1) { if (execute_entire_while_loop) { iter[0] = iter[0] + 1; info[0] = 0; bound = iter[0] - 1; if (iter[0] != 1) { if (iter[0] > m) bound = m; ys = ddot (n, w, iypt + npt, 1, w, ispt + npt, 1); if (!diagco) { yy = ddot (n, w, iypt + npt, 1, w, iypt + npt, 1); for (i = 1; i <= n; i += 1) { diag[i - 1] = ys / yy; } } else { iflag[0] = 2; return; } } } if (execute_entire_while_loop || iflag[0] == 2) { if (iter[0] != 1) { if (diagco) { for (i = 1; i <= n; i += 1) { if (diag[i - 1] <= 0) { iflag[0] = -2; printf ("The %d-th diagonal element of the inverse hessian approximation is not positive. Error %d\n", i, iflag[0]); return; } } } cp = point; if (point == 0) cp = m; w[n + cp - 1] = 1 / ys; for (i = 1; i <= n; i += 1) { w[i - 1] = -g[i - 1]; } cp = point; for (i = 1; i <= bound; i += 1) { cp = cp - 1; if (cp == -1) cp = m - 1; sq = ddot (n, w, ispt + cp * n, 1, w, 0, 1); inmc = n + m + cp + 1; iycn = iypt + cp * n; w[inmc - 1] = w[n + cp + 1 - 1] * sq; daxpy (n, -w[inmc - 1], w, iycn, 1, w, 0, 1); } for (i = 1; i <= n; i += 1) { w[i - 1] = diag[i - 1] * w[i - 1]; } for (i = 1; i <= bound; i += 1) { yr = ddot (n, w, iypt + cp * n, 1, w, 0, 1); beta = w[n + cp + 1 - 1] * yr; inmc = n + m + cp + 1; beta = w[inmc - 1] - beta; iscn = ispt + cp * n; daxpy (n, beta, w, iscn, 1, w, 0, 1); cp = cp + 1; if (cp == m) cp = 0; } for (i = 1; i <= n; i += 1) { w[ispt + point * n + i - 1] = w[i - 1]; } } nfev[0] = 0; stp[0] = 1; if (iter[0] == 1) stp[0] = stp1; for (i = 1; i <= n; i += 1) { w[i - 1] = g[i - 1]; } } linesearch (n, x, f, g, w, ispt + point * n, stp, ftol, xtol, maxfev, info, nfev, diag); if (info[0] == -1) { iflag[0] = 1; return; } if (info[0] != 1) { iflag[0] = -1; if (iprint[1 - 1] >= 0){ printf ("Line search failed. See documentation of routine mcsrch. Error return of line search: info = %d Possible causes: function or gradient are incorrect, or incorrect tolerances.\n", info[0]); } return; } nfun[0] = nfun[0] + nfev[0]; npt = point * n; for (i = 1; i <= n; i += 1) { w[ispt + npt + i - 1] = stp[0] * w[ispt + npt + i - 1]; w[iypt + npt + i - 1] = g[i - 1] - w[i - 1]; } point = point + 1; if (point == m) point = 0; gnorm = sqrt (ddot (n, g, 0, 1, g, 0, 1)); xnorm = sqrt (ddot (n, x, 0, 1, x, 0, 1)); xnorm = max (1.0, xnorm); if (gnorm / xnorm <= eps) finish = 1; if (iprint[1 - 1] >= 0) lb1 (iprint, iter, nfun, gnorm, n, m, x, f, g, stp, finish); if (finish) { iflag[0] = 0; return; } execute_entire_while_loop = 1; // from now on, execute whole loop } } /** Compute the sum of a vector times a scalara plus another vector. * Adapted from the subroutine <code>daxpy</code> in <code>lbfgs.f</code>. * There could well be faster ways to carry out this operation; this * code is a straight translation from the Fortran. */ void daxpy (int n, double da, double *dx, int ix0, int incx, double *dy, int iy0, int incy) { int i, ix, iy, m, mp1; if (n <= 0) return; if (da == 0) return; if (!(incx == 1 && incy == 1)) { ix = 1; iy = 1; if (incx < 0) ix = (-n + 1) * incx + 1; if (incy < 0) iy = (-n + 1) * incy + 1; for (i = 1; i <= n; i += 1) { dy[iy0 + iy - 1] = dy[iy0 + iy - 1] + da * dx[ix0 + ix - 1]; ix = ix + incx; iy = iy + incy; } return; } m = n % 4; if (m != 0) { for (i = 1; i <= m; i += 1) { dy[iy0 + i - 1] = dy[iy0 + i - 1] + da * dx[ix0 + i - 1]; } if (n < 4) return; } mp1 = m + 1; for (i = mp1; i <= n; i += 4) { dy[iy0 + i - 1] = dy[iy0 + i - 1] + da * dx[ix0 + i - 1]; dy[iy0 + i + 1 - 1] = dy[iy0 + i + 1 - 1] + da * dx[ix0 + i + 1 - 1]; dy[iy0 + i + 2 - 1] = dy[iy0 + i + 2 - 1] + da * dx[ix0 + i + 2 - 1]; dy[iy0 + i + 3 - 1] = dy[iy0 + i + 3 - 1] + da * dx[ix0 + i + 3 - 1]; } return; } /** Compute the dot product of two vectors. * Adapted from the subroutine <code>ddot</code> in <code>lbfgs.f</code>. * There could well be faster ways to carry out this operation; this * code is a straight translation from the Fortran. */ double ddot (int n, double *dx, int ix0, int incx, double *dy, int iy0, int incy) { double dtemp; int i, ix, iy, m, mp1; dtemp = 0; if (n <= 0) return 0; if (!(incx == 1 && incy == 1)) { ix = 1; iy = 1; if (incx < 0) ix = (-n + 1) * incx + 1; if (incy < 0) iy = (-n + 1) * incy + 1; for (i = 1; i <= n; i += 1) { dtemp = dtemp + dx[ix0 + ix - 1] * dy[iy0 + iy - 1]; ix = ix + incx; iy = iy + incy; } return dtemp; } m = n % 5; if (m != 0) { for (i = 1; i <= m; i += 1) { dtemp = dtemp + dx[ix0 + i - 1] * dy[iy0 + i - 1]; } if (n < 5) return dtemp; } mp1 = m + 1; for (i = mp1; i <= n; i += 5) { dtemp = dtemp + dx[ix0 + i - 1] * dy[iy0 + i - 1] + dx[ix0 + i + 1 -1] * dy[iy0 + i + 1 -1] + dx[ix0 + i + 2 - 1] * dy[iy0 + i + 2 - 1] + dx[ix0 + i + 3 - 1] * dy[iy0 + i + 3 - 1] + dx[ix0 + i + 4 - 1] * dy[iy0 + i + 4 - 1]; } return dtemp; } lbfgs_t * lbfgs_create (int n, int m, double eps) { lbfgs_t *opt = (lbfgs_t *) malloc (sizeof (lbfgs_t)); if (!opt) return 0; opt->w = (double *) malloc (sizeof (double) * (n * (2 * m + 1) + 2 * m)); if (!opt->w) { free (opt); return 0; } opt->diag = (double *) malloc (sizeof (double) * n); if (!opt->diag) { free (opt->w); free (opt); return 0; } opt->n = n; opt->m = m; opt->eps = eps; opt->xtol = DBL_EPSILON; opt->diagco = 0; /* by default we do not provide diagonal matrices */ opt->iflag = 0; opt->iprint[0] = -1; /* by default print nothing */ opt->iprint[1] = 0; opt->niter = 0; opt->nfuns = 0; return opt; } /* free all the memory used by the optimizer */ void lbfgs_destroy (lbfgs_t * opt) { free (opt->diag); free (opt->w); free (opt); } /* x is the n-dimension variable * f is the current value of objective function * g is the n-dimension gradient of f * * return value: * = 0: success * < 0: some error occur, see comment in lbfgs.f for detail * = 1: user must evaluate F and G * = 2: user must provide the diagonal matrix Hk0. */ int lbfgs_run (lbfgs_t * opt, double *x, double f, double *g) { lbfgs (opt->n, opt->m, x, f, g, opt->diagco, opt->diag, opt->iprint, opt->eps, opt->xtol, opt->w, &opt->iflag, &opt->niter, &opt->nfuns); // printf("%d\n",opt->iflag); return opt->iflag; } //LBFGS minimizer main loop void lbfgsMin(double* orig, unsigned int maxIt, double tol, int ndim, void* prms,void (*egfun)(int , double* , void* , double* , double*),double* minv, double* fmim ){ lbfgs_t* opt; int i; unsigned int nsteps; double* grad = (double*) _mol_malloc(ndim*sizeof(double)); opt = lbfgs_create(ndim, 5, tol); opt->iprint[0] = 0; opt->iprint[1] = 0; opt->diagco = 0; nsteps = 0; for(i=0; i<ndim; i++) minv[i]=orig[i]; while (1) { egfun(ndim, minv, prms, fmim, grad); if ((lbfgs_run(opt, minv, (*fmim), grad) <= 0)|| (++nsteps >maxIt)) break; } lbfgs_destroy(opt); free(grad); } /* Minimizes atomgroup with specified parameter set minimization types; 0 = LBFGS, 1- Conjugate gradients, 2 -Powell */ void minimize_ag(mol_min_method min_type, unsigned int maxIt, double tol,struct atomgrp* ag, void* minprms, void (*egfun)(int , double* , void* , double* , double*)){ int ndim = ag->nactives*3; double* xyz =_mol_malloc(ndim*sizeof(double) ); double* minv =_mol_malloc(ndim*sizeof(double) ); ag2array(xyz, ag); double fmim; /*my_en_grad(ndim, xyz, minprms, &fmim, NULL); printf("Start E-value=%f\n" , fmim ); */ if (min_type == MOL_LBFGS) lbfgsMin(xyz,maxIt,tol,ndim,minprms, egfun,minv,&fmim); if (min_type == MOL_CONJUGATE_GRADIENTS) dirMin(xyz,maxIt,tol,ndim,minprms, egfun,minv,&fmim); if (min_type == MOL_POWELL) { double* directions =_mol_malloc(ndim*ndim*sizeof(double) ); int i; for(i=0; i<ndim*ndim;i++) directions[i]=0; for(i=0; i<ndim; i++) directions[i*ndim+i]=1; powell(xyz,directions,maxIt,tol,ndim,minprms, egfun,minv,&fmim); free(directions); } /* my_en_grad(ndim, minv, minprms, &fmim, NULL); printf("fmin=%f\n" , fmim ); */ array2ag(minv, ag); free(minv); free(xyz); }
27.738802
184
0.457412
[ "vector" ]
83bf309a357fda858a730c44cff671dc9f907509
13,176
c
C
dir600b_v2.03/progs.gpl/busybox-1.00/util-linux/fbset.c
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
1
2019-07-21T01:58:19.000Z
2019-07-21T01:58:19.000Z
dir600b_v2.03/progs.gpl/busybox-1.00/util-linux/fbset.c
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
null
null
null
dir600b_v2.03/progs.gpl/busybox-1.00/util-linux/fbset.c
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
2
2020-03-06T22:45:39.000Z
2021-12-23T13:58:14.000Z
/* vi: set sw=4 ts=4: */ /* * Mini fbset implementation for busybox * * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * This is a from-scratch implementation of fbset; but the de facto fbset * implementation was a good reference. fbset (original) is released under * the GPL, and is (c) 1995-1999 by: * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be) */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <ctype.h> #include <string.h> #include <stdint.h> #include <sys/ioctl.h> #include "busybox.h" #define DEFAULTFBDEV FB_0 #define DEFAULTFBMODE "/etc/fb.modes" static const int OPT_CHANGE = (1 << 0); static const int OPT_INFO = (1 << 1); static const int OPT_READMODE = (1 << 2); enum { CMD_FB = 1, CMD_DB = 2, CMD_GEOMETRY = 3, CMD_TIMING = 4, CMD_ACCEL = 5, CMD_HSYNC = 6, CMD_VSYNC = 7, CMD_LACED = 8, CMD_DOUBLE = 9, /* CMD_XCOMPAT = 10, */ CMD_ALL = 11, CMD_INFO = 12, CMD_CHANGE = 13, #ifdef CONFIG_FEATURE_FBSET_FANCY CMD_XRES = 100, CMD_YRES = 101, CMD_VXRES = 102, CMD_VYRES = 103, CMD_DEPTH = 104, CMD_MATCH = 105, CMD_PIXCLOCK = 106, CMD_LEFT = 107, CMD_RIGHT = 108, CMD_UPPER = 109, CMD_LOWER = 110, CMD_HSLEN = 111, CMD_VSLEN = 112, CMD_CSYNC = 113, CMD_GSYNC = 114, CMD_EXTSYNC = 115, CMD_BCAST = 116, CMD_RGBA = 117, CMD_STEP = 118, CMD_MOVE = 119, #endif }; static unsigned int g_options = 0; /* Stuff stolen from the kernel's fb.h */ static const int FBIOGET_VSCREENINFO = 0x4600; static const int FBIOPUT_VSCREENINFO = 0x4601; struct fb_bitfield { uint32_t offset; /* beginning of bitfield */ uint32_t length; /* length of bitfield */ uint32_t msb_right; /* != 0 : Most significant bit is */ /* right */ }; struct fb_var_screeninfo { uint32_t xres; /* visible resolution */ uint32_t yres; uint32_t xres_virtual; /* virtual resolution */ uint32_t yres_virtual; uint32_t xoffset; /* offset from virtual to visible */ uint32_t yoffset; /* resolution */ uint32_t bits_per_pixel; /* guess what */ uint32_t grayscale; /* != 0 Graylevels instead of colors */ struct fb_bitfield red; /* bitfield in fb mem if true color, */ struct fb_bitfield green; /* else only length is significant */ struct fb_bitfield blue; struct fb_bitfield transp; /* transparency */ uint32_t nonstd; /* != 0 Non standard pixel format */ uint32_t activate; /* see FB_ACTIVATE_* */ uint32_t height; /* height of picture in mm */ uint32_t width; /* width of picture in mm */ uint32_t accel_flags; /* acceleration flags (hints) */ /* Timing: All values in pixclocks, except pixclock (of course) */ uint32_t pixclock; /* pixel clock in ps (pico seconds) */ uint32_t left_margin; /* time from sync to picture */ uint32_t right_margin; /* time from picture to sync */ uint32_t upper_margin; /* time from sync to picture */ uint32_t lower_margin; uint32_t hsync_len; /* length of horizontal sync */ uint32_t vsync_len; /* length of vertical sync */ uint32_t sync; /* see FB_SYNC_* */ uint32_t vmode; /* see FB_VMODE_* */ uint32_t reserved[6]; /* Reserved for future compatibility */ }; const static struct cmdoptions_t { const char *name; const unsigned char param_count; const unsigned char code; } g_cmdoptions[] = { { "-fb", 1, CMD_FB}, { "-db", 1, CMD_DB}, { "-a", 0, CMD_ALL}, { "-i", 0, CMD_INFO}, { "-g", 5, CMD_GEOMETRY}, { "-t", 7, CMD_TIMING}, { "-accel", 1, CMD_ACCEL}, { "-hsync", 1, CMD_HSYNC}, { "-vsync", 1, CMD_VSYNC}, { "-laced", 1, CMD_LACED}, { "-double", 1, CMD_DOUBLE}, { "-n", 0, CMD_CHANGE}, { #ifdef CONFIG_FEATURE_FBSET_FANCY "-all", 0, CMD_ALL}, { "-xres", 1, CMD_XRES}, { "-yres", 1, CMD_YRES}, { "-vxres", 1, CMD_VXRES}, { "-vyres", 1, CMD_VYRES}, { "-depth", 1, CMD_DEPTH}, { "-match", 0, CMD_MATCH}, { "-geometry", 5, CMD_GEOMETRY}, { "-pixclock", 1, CMD_PIXCLOCK}, { "-left", 1, CMD_LEFT}, { "-right", 1, CMD_RIGHT}, { "-upper", 1, CMD_UPPER}, { "-lower", 1, CMD_LOWER}, { "-hslen", 1, CMD_HSLEN}, { "-vslen", 1, CMD_VSLEN}, { "-timings", 7, CMD_TIMING}, { "-csync", 1, CMD_CSYNC}, { "-gsync", 1, CMD_GSYNC}, { "-extsync", 1, CMD_EXTSYNC}, { "-bcast", 1, CMD_BCAST}, { "-rgba", 1, CMD_RGBA}, { "-step", 1, CMD_STEP}, { "-move", 1, CMD_MOVE}, { #endif 0, 0, 0} }; #ifdef CONFIG_FEATURE_FBSET_READMODE /* taken from linux/fb.h */ static const int FB_VMODE_INTERLACED = 1; /* interlaced */ static const int FB_VMODE_DOUBLE = 2; /* double scan */ static const int FB_SYNC_HOR_HIGH_ACT = 1; /* horizontal sync high active */ static const int FB_SYNC_VERT_HIGH_ACT = 2; /* vertical sync high active */ static const int FB_SYNC_EXT = 4; /* external sync */ static const int FB_SYNC_COMP_HIGH_ACT = 8; /* composite sync high active */ #endif static int readmode(struct fb_var_screeninfo *base, const char *fn, const char *mode) { #ifdef CONFIG_FEATURE_FBSET_READMODE FILE *f; char buf[256]; char *p = buf; f = bb_xfopen(fn, "r"); while (!feof(f)) { fgets(buf, sizeof(buf), f); if ((p = strstr(buf, "mode ")) || (p = strstr(buf, "mode\t"))) { p += 5; if ((p = strstr(buf, mode))) { p += strlen(mode); if (!isspace(*p) && (*p != 0) && (*p != '"') && (*p != '\r') && (*p != '\n')) continue; /* almost, but not quite */ while (!feof(f)) { fgets(buf, sizeof(buf), f); if ((p = strstr(buf, "geometry "))) { p += 9; sscanf(p, "%d %d %d %d %d", &(base->xres), &(base->yres), &(base->xres_virtual), &(base->yres_virtual), &(base->bits_per_pixel)); } else if ((p = strstr(buf, "timings "))) { p += 8; sscanf(p, "%d %d %d %d %d %d %d", &(base->pixclock), &(base->left_margin), &(base->right_margin), &(base->upper_margin), &(base->lower_margin), &(base->hsync_len), &(base->vsync_len)); } else if ((p = strstr(buf, "laced "))) { p += 6; if (strstr(buf, "false")) { base->vmode &= ~FB_VMODE_INTERLACED; } else { base->vmode |= FB_VMODE_INTERLACED; } } else if ((p = strstr(buf, "double "))) { p += 7; if (strstr(buf, "false")) { base->vmode &= ~FB_VMODE_DOUBLE; } else { base->vmode |= FB_VMODE_DOUBLE; } } else if ((p = strstr(buf, "vsync "))) { p += 6; if (strstr(buf, "low")) { base->sync &= ~FB_SYNC_VERT_HIGH_ACT; } else { base->sync |= FB_SYNC_VERT_HIGH_ACT; } } else if ((p = strstr(buf, "hsync "))) { p += 6; if (strstr(buf, "low")) { base->sync &= ~FB_SYNC_HOR_HIGH_ACT; } else { base->sync |= FB_SYNC_HOR_HIGH_ACT; } } else if ((p = strstr(buf, "csync "))) { p += 6; if (strstr(buf, "low")) { base->sync &= ~FB_SYNC_COMP_HIGH_ACT; } else { base->sync |= FB_SYNC_COMP_HIGH_ACT; } } else if ((p = strstr(buf, "extsync "))) { p += 8; if (strstr(buf, "false")) { base->sync &= ~FB_SYNC_EXT; } else { base->sync |= FB_SYNC_EXT; } } if (strstr(buf, "endmode")) return 1; } } } } #else bb_error_msg( "mode reading not compiled in"); #endif return 0; } static inline void setmode(struct fb_var_screeninfo *base, struct fb_var_screeninfo *set) { if ((int) set->xres > 0) base->xres = set->xres; if ((int) set->yres > 0) base->yres = set->yres; if ((int) set->xres_virtual > 0) base->xres_virtual = set->xres_virtual; if ((int) set->yres_virtual > 0) base->yres_virtual = set->yres_virtual; if ((int) set->bits_per_pixel > 0) base->bits_per_pixel = set->bits_per_pixel; } static inline void showmode(struct fb_var_screeninfo *v) { double drate = 0, hrate = 0, vrate = 0; if (v->pixclock) { drate = 1e12 / v->pixclock; hrate = drate / (v->left_margin + v->xres + v->right_margin + v->hsync_len); vrate = hrate / (v->upper_margin + v->yres + v->lower_margin + v->vsync_len); } printf("\nmode \"%ux%u-%u\"\n" #ifdef CONFIG_FEATURE_FBSET_FANCY "\t# D: %.3f MHz, H: %.3f kHz, V: %.3f Hz\n" #endif "\tgeometry %u %u %u %u %u\n\ttimings %u %u %u %u %u %u %u\n\taccel %s\n\trgba %u/%u,%u/%u,%u/%u,%u/%u\nendmode\n\n", v->xres, v->yres, (int) (vrate + 0.5), #ifdef CONFIG_FEATURE_FBSET_FANCY drate / 1e6, hrate / 1e3, vrate, #endif v->xres, v->yres, v->xres_virtual, v->yres_virtual, v->bits_per_pixel, v->pixclock, v->left_margin, v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, v->vsync_len, (v->accel_flags > 0 ? "true" : "false"), v->red.length, v->red.offset, v->green.length, v->green.offset, v->blue.length, v->blue.offset, v->transp.length, v->transp.offset); } #ifdef STANDALONE int main(int argc, char **argv) #else extern int fbset_main(int argc, char **argv) #endif { struct fb_var_screeninfo var, varset; int fh, i; char *fbdev = DEFAULTFBDEV; char *modefile = DEFAULTFBMODE; char *thisarg, *mode = NULL; memset(&varset, 0xFF, sizeof(varset)); /* parse cmd args.... why do they have to make things so difficult? */ argv++; argc--; for (; argc > 0 && (thisarg = *argv); argc--, argv++) { for (i = 0; g_cmdoptions[i].name; i++) { if (!strcmp(thisarg, g_cmdoptions[i].name)) { if (argc - 1 < g_cmdoptions[i].param_count) bb_show_usage(); switch (g_cmdoptions[i].code) { case CMD_FB: fbdev = argv[1]; break; case CMD_DB: modefile = argv[1]; break; case CMD_GEOMETRY: varset.xres = strtoul(argv[1], 0, 0); varset.yres = strtoul(argv[2], 0, 0); varset.xres_virtual = strtoul(argv[3], 0, 0); varset.yres_virtual = strtoul(argv[4], 0, 0); varset.bits_per_pixel = strtoul(argv[5], 0, 0); break; case CMD_TIMING: varset.pixclock = strtoul(argv[1], 0, 0); varset.left_margin = strtoul(argv[2], 0, 0); varset.right_margin = strtoul(argv[3], 0, 0); varset.upper_margin = strtoul(argv[4], 0, 0); varset.lower_margin = strtoul(argv[5], 0, 0); varset.hsync_len = strtoul(argv[6], 0, 0); varset.vsync_len = strtoul(argv[7], 0, 0); break; case CMD_CHANGE: g_options |= OPT_CHANGE; break; #ifdef CONFIG_FEATURE_FBSET_FANCY case CMD_XRES: varset.xres = strtoul(argv[1], 0, 0); break; case CMD_YRES: varset.yres = strtoul(argv[1], 0, 0); break; case CMD_DEPTH: varset.bits_per_pixel = strtoul(argv[1], 0, 0); break; #endif } argc -= g_cmdoptions[i].param_count; argv += g_cmdoptions[i].param_count; break; } } if (!g_cmdoptions[i].name) { if (argc == 1) { mode = *argv; g_options |= OPT_READMODE; } else { bb_show_usage(); } } } if ((fh = open(fbdev, O_RDONLY)) < 0) bb_perror_msg_and_die("fbset(open)"); if (ioctl(fh, FBIOGET_VSCREENINFO, &var)) bb_perror_msg_and_die("fbset(ioctl)"); if (g_options & OPT_READMODE) { if (!readmode(&var, modefile, mode)) { bb_error_msg("Unknown video mode `%s'", mode); return EXIT_FAILURE; } } setmode(&var, &varset); if (g_options & OPT_CHANGE) if (ioctl(fh, FBIOPUT_VSCREENINFO, &var)) bb_perror_msg_and_die("fbset(ioctl)"); showmode(&var); /* Don't close the file, as exiting will take care of that */ /* close(fh); */ return EXIT_SUCCESS; }
30.785047
118
0.566409
[ "geometry" ]
83bfa347f5e3114e7205bb7b759f4ba45ded47e5
9,740
h
C
msys64/mingw64/x86_64-w64-mingw32/include/ddk/csq.h
Bhuvanesh1208/ruby2.6.1
17642e3f37233f6d0e0523af68d7600a91ece1c7
[ "Ruby" ]
12,718
2018-05-25T02:00:44.000Z
2022-03-31T23:03:51.000Z
msys64/mingw64/x86_64-w64-mingw32/include/ddk/csq.h
Bhuvanesh1208/ruby2.6.1
17642e3f37233f6d0e0523af68d7600a91ece1c7
[ "Ruby" ]
8,483
2018-05-23T16:22:39.000Z
2022-03-31T22:18:16.000Z
msys64/mingw64/x86_64-w64-mingw32/include/ddk/csq.h
Bhuvanesh1208/ruby2.6.1
17642e3f37233f6d0e0523af68d7600a91ece1c7
[ "Ruby" ]
1,400
2018-05-24T22:35:25.000Z
2022-03-31T21:32:48.000Z
/* * Cancel-Safe Queue Library * Created in 2004 by Vizzini (vizzini@plasmic.com) * * THIS SOFTWARE IS NOT COPYRIGHTED * * This source code is offered for use in the public domain. You may * use, modify or distribute it freely. * * This code is distributed in the hope that it will be useful but * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * DISCLAIMED. This includes but is not limited to warranties of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * * This header defines the interface to the ReactOS Cancel-Safe Queue library. * This interface is based on and is similar to the Microsoft Cancel-Safe * Queue interface. * * BACKGROUND * * IRP queuing is a royal pain in the butt, due to the fact that there are * tons of built-in race conditions. IRP handling is difficult in general, * but the cancel logic has been particularly complicated due to some subtle * races, coupled with the fact that the system interfaces have changed over * time. * * Walter Oney (2nd. Ed. of Programming the Windows Driver Model) states a * common opinion among driver developers when he says that it is foolish * to try to roll your own cancel logic. There are only a very few people * who have gotten it right in the past. He suggests, instead, that you * either use his own well-tested code, or use the code in the Microsoft * Cancel-Safe Queue Library. * * We cannot do either, of course, due to copyright issues. I have therefore * created this clone of the Microsoft library in order to concentrate all * of the IRP-queuing bugs in one place. I'm quite sure there are problems * here, so if you are a driver writer, I'd be glad to hear your feedback. * * Apart from that, please try to use these routines, rather than building * your own. If you think you have found a bug, please bring it up with me * or on-list, as this is complicated and non-obvious stuff. Don't just * change this and hope for the best! * * USAGE * * This library follows exactly the same interface as the Microsoft Cancel-Safe * Queue routines (IoCsqXxx()). As such, the authoritative reference is the * current DDK. There is also a DDK sample called "cancel" that has an * example of how to use this code. I have also provided a sample driver * that makes use of this queue. Finally, please do read the header and the * source if you're curious about the inner workings of these routines. */ #pragma once #define _CSQ_H_ #ifdef __cplusplus extern "C" { #endif /* * Prevent including the CSQ definitions twice. They're present in NTDDK * now too, except the *_EX versions. */ #ifndef IO_TYPE_CSQ_IRP_CONTEXT typedef struct _IO_CSQ IO_CSQ, *PIO_CSQ; /* * STRUCTURES * * NOTE: Please do not use these directly. You will make incompatible code * if you do. Always only use the documented IoCsqXxx() interfaces and you * will amass much Good Karma. */ #define IO_TYPE_CSQ_IRP_CONTEXT 1 #define IO_TYPE_CSQ 2 /* * IO_CSQ_IRP_CONTEXT - Context used to track an IRP in the CSQ */ typedef struct _IO_CSQ_IRP_CONTEXT { ULONG Type; PIRP Irp; PIO_CSQ Csq; } IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT; /* * CSQ Callbacks * * The cancel-safe queue is implemented as a set of IoCsqXxx() OS routines * copuled with a set of driver callbacks to handle the basic operations of * the queue. You need to supply one of each of these functions in your own * driver. These routines are also documented in the DDK under CsqXxx(). * That is the authoritative documentation. */ /* * Function to insert an IRP in the queue. No need to worry about locking; * just tack it onto your list or something. * * Sample implementation: * VOID NTAPI CsqInsertIrp(PIO_CSQ Csq, PIRP Irp) { KdPrint(("Inserting IRP 0x%x into CSQ\n", Irp)); InsertTailList(&IrpQueue, &Irp->Tail.Overlay.ListEntry); } * */ typedef VOID (NTAPI IO_CSQ_INSERT_IRP)( IN struct _IO_CSQ *Csq, IN PIRP Irp); typedef IO_CSQ_INSERT_IRP *PIO_CSQ_INSERT_IRP; /* * Function to remove an IRP from the queue. * * Sample: * VOID NTAPI CsqRemoveIrp(PIO_CSQ Csq, PIRP Irp) { KdPrint(("Removing IRP 0x%x from CSQ\n", Irp)); RemoveEntryList(&Irp->Tail.Overlay.ListEntry); } * */ typedef VOID (NTAPI IO_CSQ_REMOVE_IRP)( IN struct _IO_CSQ *Csq, IN PIRP Irp); typedef IO_CSQ_REMOVE_IRP *PIO_CSQ_REMOVE_IRP; /* * Function to look for an IRP in the queue * * Sample: * PIRP NTAPI CsqPeekNextIrp(PIO_CSQ Csq, PIRP Irp, PVOID PeekContext) { KdPrint(("Peeking for next IRP\n")); if(Irp) return CONTAINING_RECORD(&Irp->Tail.Overlay.ListEntry.Flink, IRP, Tail.Overlay.ListEntry); if(IsListEmpty(&IrpQueue)) return NULL; return CONTAINING_RECORD(IrpQueue.Flink, IRP, Tail.Overlay.ListEntry); } * */ typedef PIRP (NTAPI IO_CSQ_PEEK_NEXT_IRP)( IN struct _IO_CSQ *Csq, IN PIRP Irp, IN PVOID PeekContext); typedef IO_CSQ_PEEK_NEXT_IRP *PIO_CSQ_PEEK_NEXT_IRP; /* * Lock the queue. This can be a spinlock, a mutex, or whatever * else floats your boat. * * Sample: * VOID NTAPI CsqAcquireLock(PIO_CSQ Csq, PKIRQL Irql) { KdPrint(("Acquiring spin lock\n")); KeAcquireSpinLock(&IrpQueueLock, Irql); } * */ typedef VOID (NTAPI IO_CSQ_ACQUIRE_LOCK)( IN struct _IO_CSQ *Csq, OUT PKIRQL Irql); typedef IO_CSQ_ACQUIRE_LOCK *PIO_CSQ_ACQUIRE_LOCK; /* * Unlock the queue: * VOID NTAPI CsqReleaseLock(PIO_CSQ Csq, KIRQL Irql) { KdPrint(("Releasing spin lock\n")); KeReleaseSpinLock(&IrpQueueLock, Irql); } * */ typedef VOID (NTAPI IO_CSQ_RELEASE_LOCK)( IN struct _IO_CSQ *Csq, IN KIRQL Irql); typedef IO_CSQ_RELEASE_LOCK *PIO_CSQ_RELEASE_LOCK; /* * Finally, this is called by the queue library when it wants to complete * a canceled IRP. * * Sample: * VOID NTAPI CsqCompleteCancelledIrp(PIO_CSQ Csq, PIRP Irp) { KdPrint(("cancelling irp 0x%x\n", Irp)); Irp->IoStatus.Status = STATUS_CANCELLED; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); } * */ typedef VOID (NTAPI IO_CSQ_COMPLETE_CANCELED_IRP)( IN struct _IO_CSQ *Csq, IN PIRP Irp); typedef IO_CSQ_COMPLETE_CANCELED_IRP *PIO_CSQ_COMPLETE_CANCELED_IRP; /* * IO_CSQ - Queue control structure */ typedef struct _IO_CSQ { ULONG Type; PIO_CSQ_INSERT_IRP CsqInsertIrp; PIO_CSQ_REMOVE_IRP CsqRemoveIrp; PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp; PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock; PIO_CSQ_RELEASE_LOCK CsqReleaseLock; PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp; PVOID ReservePointer; /* must be NULL */ } IO_CSQ, *PIO_CSQ; #endif /* IO_TYPE_CSQ_IRP_CONTEXT */ #ifndef IO_TYPE_CSQ_EX /* See IO_TYPE_CSQ_* above */ #define IO_TYPE_CSQ_EX 3 /* * Function to insert an IRP into the queue with extended context information. * This is useful if you need to be able to de-queue particular IRPs more * easily in some cases. * * Same deal as above; sample implementation: * NTSTATUS NTAPI CsqInsertIrpEx(PIO_CSQ Csq, PIRP Irp, PVOID InsertContext) { CsqInsertIrp(Csq, Irp); return STATUS_PENDING; } * */ typedef NTSTATUS (NTAPI IO_CSQ_INSERT_IRP_EX)( IN struct _IO_CSQ *Csq, IN PIRP Irp, IN PVOID InsertContext); typedef IO_CSQ_INSERT_IRP_EX *PIO_CSQ_INSERT_IRP_EX; #endif /* IO_TYPE_CSQ_EX */ /* * CANCEL-SAFE QUEUE DDIs * * These device driver interfaces are called to make use of the queue. Again, * authoritative documentation for these functions is in the DDK. The csqtest * driver also makes use of some of them. */ /* * Call this in DriverEntry or similar in order to set up the Csq structure. * As long as the Csq struct and the functions you pass in are resident, * there are no IRQL restrictions. */ NTKERNELAPI NTSTATUS NTAPI IoCsqInitialize(PIO_CSQ Csq, PIO_CSQ_INSERT_IRP CsqInsertIrp, PIO_CSQ_REMOVE_IRP CsqRemoveIrp, PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, PIO_CSQ_RELEASE_LOCK CsqReleaseLock, PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); /* * Same as above, except you provide a CsqInsertIrpEx routine instead of * CsqInsertIrp. This eventually allows you to supply extra tracking * information for use with the queue. */ NTKERNELAPI NTSTATUS NTAPI IoCsqInitializeEx(PIO_CSQ Csq, PIO_CSQ_INSERT_IRP_EX CsqInsertIrpEx, PIO_CSQ_REMOVE_IRP CsqRemoveIrp, PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, PIO_CSQ_RELEASE_LOCK CsqReleaseLock, PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); /* * Insert an IRP into the queue */ NTKERNELAPI VOID NTAPI IoCsqInsertIrp(PIO_CSQ Csq, PIRP Irp, PIO_CSQ_IRP_CONTEXT Context); /* * Insert an IRP into the queue, with special context maintained that * makes it easy to find IRPs in the queue */ NTKERNELAPI NTSTATUS NTAPI IoCsqInsertIrpEx(PIO_CSQ Csq, PIRP Irp, PIO_CSQ_IRP_CONTEXT Context, PVOID InsertContext); /* * Remove a particular IRP from the queue */ NTKERNELAPI PIRP NTAPI IoCsqRemoveIrp(PIO_CSQ Csq, PIO_CSQ_IRP_CONTEXT Context); /* * Remove the next IRP from the queue */ NTKERNELAPI PIRP NTAPI IoCsqRemoveNextIrp(PIO_CSQ Csq, PVOID PeekContext); #ifdef __cplusplus } #endif
29.074627
96
0.701129
[ "model" ]
83c01e9ad5e62a2cd2246f260a4d04c13c384e58
4,660
h
C
CVUI/CVUI/cv_viewer.h
LeiYangJustin/CVUI4CellularSolid
6fd13dfaf494d9e3800e95827502c4fd8a4f8210
[ "MIT" ]
null
null
null
CVUI/CVUI/cv_viewer.h
LeiYangJustin/CVUI4CellularSolid
6fd13dfaf494d9e3800e95827502c4fd8a4f8210
[ "MIT" ]
null
null
null
CVUI/CVUI/cv_viewer.h
LeiYangJustin/CVUI4CellularSolid
6fd13dfaf494d9e3800e95827502c4fd8a4f8210
[ "MIT" ]
null
null
null
#ifndef C_VIEWER_H #define C_VIEWER_H #include "../DataColle/types.h" #include "../DataColle/img_data.h" #include <vector> #include <iostream> // INCLUDE OPENCV DIR #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/imgcodecs/imgcodecs.hpp> #include <opencv2/opencv.hpp> // //struct CV_LESS_COMPARE //{ // bool operator() (const cv::Point & p1, const cv::Point & p2) const // { // if (p1.x < p2.x) // return true; // else if (p1.x > p2.x) // return false; // else // { // if (!(p1.y > p2.y)) // return true; // else // return false; // } // } //}; struct COLOR_PALETTE { cv::Scalar color_0 = cv::Scalar(13, 177, 240); cv::Scalar color_1 = cv::Scalar(115, 227, 9); cv::Scalar color_2 = cv::Scalar(255, 0, 193); cv::Scalar color_3 = cv::Scalar(249, 105, 199); cv::Scalar color_4 = cv::Scalar(0, 4, 255); cv::Scalar color_5 = cv::Scalar(184, 44, 44); cv::Scalar color_6 = cv::Scalar(244, 159, 89); cv::Scalar color_7 = cv::Scalar(255, 250, 139); cv::Scalar color_8 = cv::Scalar(56, 107, 48); cv::Scalar color_9 = cv::Scalar(236, 45, 74); cv::Scalar color_default = cv::Scalar(255, 0, 0); cv::Scalar color_blue = cv::Scalar(255, 0, 0); cv::Scalar color_green = cv::Scalar(0, 255, 0); cv::Scalar color_red = cv::Scalar(0, 0, 255); }; struct ViewerContent { ViewerContent() : background_image(cv::Mat(cv::Size(500, 500), CV_8UC3, cv::Scalar(255, 255, 255))) { }; ViewerContent(int w, int h) : background_image(cv::Mat(cv::Size(w, h), CV_8UC3, cv::Scalar(255, 255, 255))) { }; void clearSegmentList() { segment_color_list.clear(); segment_list.clear(); } void clearPolylineList() { polyline_color_list.clear(); polyline_list.clear(); } void clearSinglePtList() { single_pt_color_list.clear(); single_pt_list.clear(); } void clearPtSetList() { ptset_color_list.clear(); ptset_list.clear(); } cv::Mat background_image; std::vector< std::vector<cv::Point> > polyline_list; std::vector< int > polyline_color_list; std::vector< std::pair<cv::Point, cv::Point> > segment_list; std::vector< int > segment_color_list; std::vector< cv::Point > single_pt_list; std::vector< int > single_pt_color_list; std::vector< std::vector<cv::Point> > ptset_list; std::vector< std::vector<int> > ptset_color_list; }; class CViewer { public: CViewer(); CViewer(CImgData img_data){ data_.background_image = img_data.GetBackgroundImage(); } CViewer(int w, int h) :data_(w, h) {}; ~CViewer(); void setImgData(CImgData img_data) { data_.background_image = img_data.GetSrcImg(); } int addPolyLine(std::vector<Point_2> polyline, int colorID = -1) { std::vector<cv::Point> cv_polyline; for (auto pt : polyline) cv_polyline.push_back(cv::Point(pt.x(), pt.y())); data_.polyline_list.push_back(cv_polyline); data_.polyline_color_list.push_back(colorID); return (data_.polyline_list.size() - 1); } int addSegment(std::pair<Point_2, Point_2> segment, int colorID = -2) { cv::Point cvp1(segment.first.x(), segment.first.y()); cv::Point cvp2(segment.second.x(), segment.second.y()); data_.segment_list.push_back(std::make_pair(cvp1, cvp2)); data_.segment_color_list.push_back(colorID); return (data_.segment_list.size() - 1); } int addSegment(Segment_2 segment, int colorID = -2) { cv::Point cvp1(segment.source().x(), segment.source().y()); cv::Point cvp2(segment.target().x(), segment.target().y()); data_.segment_list.push_back(std::make_pair(cvp1, cvp2)); data_.segment_color_list.push_back(colorID); return (data_.segment_list.size() - 1); } int addPoint(Point_2 pt, int colorID = -3) { data_.single_pt_list.push_back(cv::Point(pt.x(), pt.y())); data_.single_pt_color_list.push_back(colorID); return(data_.single_pt_list.size() - 1); } int addPointSet(std::vector<Point_2> pts, std::vector<int> colorIDs) { std::vector<cv::Point> cvpts; for(auto pt : pts) cvpts.push_back(cv::Point(pt.x(), pt.y())); data_.ptset_list.push_back(cvpts); data_.ptset_color_list.push_back(colorIDs); return(data_.ptset_list.size() - 1); } void draw(std::string winName, int elapseTime = 0); void clearData() { data_.clearPolylineList(); data_.clearPtSetList(); data_.clearSegmentList(); data_.clearSinglePtList(); } private: ViewerContent data_; void drawSegment(cv::Mat & img, cv::Point p1, cv::Point p2, int label, int lw); void drawPolyLine(cv::Mat & img, std::vector<cv::Point> plist, int label, int lw, bool is_closed); void drawPointSet(cv::Mat & img, std::vector<cv::Point> plist, std::vector<int> label_list, int lw); }; #endif // !C_VIEWER_H
27.411765
101
0.682618
[ "vector" ]
83c396cd871cc105b97017dcd55abacf797814ca
3,950
h
C
Header/AGFLabeler.h
lsfcin/haft
599416f0f8bb8d6a50762c2a1389e8bd6bc2d192
[ "MIT" ]
null
null
null
Header/AGFLabeler.h
lsfcin/haft
599416f0f8bb8d6a50762c2a1389e8bd6bc2d192
[ "MIT" ]
null
null
null
Header/AGFLabeler.h
lsfcin/haft
599416f0f8bb8d6a50762c2a1389e8bd6bc2d192
[ "MIT" ]
null
null
null
/* * This file is subject to the terms and conditions defined in * file 'LICENSE.txt', which is part of this source code package. */ #pragma once #include <vector> #include <queue> #include <opencv2/opencv.hpp> #include "Util.h" namespace haft { // Air Guitar Framework Labeler class AGFLabeler { public: static AGFLabeler& instance() { static AGFLabeler _instance; return _instance; } std::vector<unsigned int> makeLabel(unsigned int starterID, const cv::Mat& mask) { const unsigned int cols = mask.cols; const unsigned int rows = mask.rows; const unsigned int size = cols * rows; std::vector<unsigned int> label; std::queue<unsigned int> queue; queue.push(starterID); label.push_back(starterID); markedMap[starterID] = 1; unsigned int i; while (!queue.empty()) { i = queue.front(); queue.pop(); bool valid; int neighbour; for (unsigned int direction = 0; direction < 8; ++direction) { valid = false; switch (direction) { case 0: //up neighbour = i - cols; valid = neighbour > 0; break; case 1: //down neighbour = i + cols; valid = neighbour < size; break; case 2: //left neighbour = i - 1; valid = neighbour % cols > 0; break; case 3: //right neighbour = i + 1; valid = neighbour % cols < cols - 1; break; case 4: //upper-left neighbour = i - cols - 1; valid = neighbour > 0 && neighbour % cols > 0; break; case 5: //upper-right neighbour = i - cols + 1; valid = neighbour > 0 && neighbour % cols < cols - 1; break; case 6: //bottom-left neighbour = i + cols - 1; valid = neighbour < size && neighbour % cols > 0; break; case 7: //bottom-right neighbour = i + cols + 1; valid = neighbour < size && neighbour % cols < cols - 1; break; default: break; } if (valid && !markedMap[neighbour] && mask.data[neighbour]) { queue.push(neighbour); label.push_back(neighbour); markedMap[neighbour] = 1; } } } return label; } void label(const cv::Mat& mask) { const unsigned int size = mask.cols * mask.rows; clean(size); for (unsigned int i = 0; i < size; i++) { if (!markedMap[i] && mask.data[i]) { labels.push_back(makeLabel(i, mask)); } } } void clean(const unsigned int& size) { //cleaning last obtained labels for (unsigned int i = 0; i < labels.size(); i++) { labels[i].clear(); } labels.clear(); //cleaning marked map if (markedMap != nullptr) delete markedMap; unsigned int labelCount = -1; markedMap = new unsigned int[size]; memset(markedMap, 0, size * sizeof(unsigned int)); } void removeSmallGroups(cv::Mat& mask, unsigned int minSize) { for (unsigned int i = 0; i < labels.size(); ++i) { if (labels[i].size() <= minSize) removeSpecificGroup(mask, i); } } void pointExtremities(cv::Mat& mask, unsigned int radius = 3) { for (unsigned int i = 0; i < labels.size(); ++i) { UI::showCircle(Util::index2D(labels[i][0], mask.size()), CV_RGB(255, 255, 255), radius, -1, mask); UI::showCircle(Util::index2D(labels[i][labels[i].size() - 1], mask.size()), CV_RGB(255, 255, 255), radius, -1, mask); } } inline void removeSpecificGroup(cv::Mat& mask, unsigned int groupID) { std::vector<unsigned int> label = labels[groupID]; const unsigned int labelSize = label.size(); for (unsigned int i = 0; i < labelSize; ++i) { mask.data[label[i]] = 0; } } private: std::vector<std::vector<unsigned int>> labels; unsigned int* markedMap; AGFLabeler() : markedMap(nullptr) {} AGFLabeler(AGFLabeler const&) = delete; //hiding the copy constructor AGFLabeler& operator=(AGFLabeler const&) = delete; //hiding the assignment operator }; }
22.443182
121
0.595696
[ "vector" ]
83c7b352a0abb22cc0f9eeb7f5ff2cbcdc2b8d25
14,808
h
C
Utilities/hdf5/H5FLprivate.h
utkarshayachit/ParaView
7bbb2aa16fdef9cfbcf4a3786cad905d6770771b
[ "BSD-3-Clause" ]
1
2016-05-09T00:36:44.000Z
2016-05-09T00:36:44.000Z
Utilities/hdf5/H5FLprivate.h
utkarshayachit/ParaView
7bbb2aa16fdef9cfbcf4a3786cad905d6770771b
[ "BSD-3-Clause" ]
null
null
null
Utilities/hdf5/H5FLprivate.h
utkarshayachit/ParaView
7bbb2aa16fdef9cfbcf4a3786cad905d6770771b
[ "BSD-3-Clause" ]
3
2015-05-14T21:18:53.000Z
2022-03-07T02:53:45.000Z
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * * root level of an installed copy of the electronic HDF5 document set and * * is linked from the top-level documents page. It can also be found at * * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- * * Created: H5FLprivate.h * Mar 23 2000 * Quincey Koziol <koziol@ncsa.uiuc.edu> * * Purpose: Private non-prototype header. * * Modifications: * *------------------------------------------------------------------------- */ #ifndef _H5FLprivate_H #define _H5FLprivate_H /* Public headers needed by this file */ #ifdef LATER #include "H5FLpublic.h" /*API prototypes */ #endif /* LATER */ /* Private headers needed by this file */ /* Macros for turning off free lists in the library */ /* #define H5_NO_FREE_LISTS */ #if defined H5_NO_FREE_LISTS || defined H5_USING_PURIFY #define H5_NO_REG_FREE_LISTS #define H5_NO_ARR_FREE_LISTS #define H5_NO_SEQ_FREE_LISTS #define H5_NO_BLK_FREE_LISTS #endif /* H5_NO_FREE_LISTS */ /* * Private datatypes. */ /* Data structure to store each block in free list */ typedef struct H5FL_reg_node_t { struct H5FL_reg_node_t *next; /* Pointer to next block in free list */ } H5FL_reg_node_t; /* Data structure for free list of blocks */ typedef struct H5FL_reg_head_t { unsigned init; /* Whether the free list has been initialized */ unsigned allocated; /* Number of blocks allocated */ unsigned onlist; /* Number of blocks on free list */ size_t list_mem; /* Amount of memory on free list */ const char *name; /* Name of the type */ size_t size; /* Size of the blocks in the list */ H5FL_reg_node_t *list; /* List of free blocks */ } H5FL_reg_head_t; /* * Macros for defining & using free lists for a type */ #define H5FL_REG_NAME(t) H5_##t##_reg_free_list #ifndef H5_NO_REG_FREE_LISTS /* Common macros for H5FL_DEFINE & H5FL_DEFINE_STATIC */ #define H5FL_DEFINE_COMMON(t) H5FL_reg_head_t H5FL_REG_NAME(t)={0,0,0,0,#t,sizeof(t),NULL} /* Declare a free list to manage objects of type 't' */ #define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t) /* Reference a free list for type 't' defined in another file */ #define H5FL_EXTERN(t) extern H5_DLL H5FL_reg_head_t H5FL_REG_NAME(t) /* Declare a static free list to manage objects of type 't' */ #define H5FL_DEFINE_STATIC(t) static H5FL_DEFINE_COMMON(t) /* Allocate an object of type 't' */ #define H5FL_MALLOC(t) H5FL_reg_malloc(&(H5FL_REG_NAME(t))) /* Allocate an object of type 't' and clear it to all zeros */ #define H5FL_CALLOC(t) H5FL_reg_calloc(&(H5FL_REG_NAME(t))) /* Free an object of type 't' */ #define H5FL_FREE(t,obj) H5FL_reg_free(&(H5FL_REG_NAME(t)),obj) /* Re-allocating an object of type 't' is not defined, because these free-lists * only support fixed sized types, like structs, etc.. */ #else /* H5_NO_REG_FREE_LISTS */ #include "H5MMprivate.h" /* Common macro for H5FL_DEFINE & H5FL_DEFINE_STATIC */ #define H5FL_DEFINE_COMMON(t) int H5FL_REG_NAME(t) #define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t) #define H5FL_EXTERN(t) extern H5_DLL int H5FL_REG_NAME(t) #define H5FL_DEFINE_STATIC(t) static H5FL_DEFINE_COMMON(t) #define H5FL_MALLOC(t) H5MM_malloc(sizeof(t)) #define H5FL_CALLOC(t) H5MM_calloc(sizeof(t)) #define H5FL_FREE(t,obj) H5MM_xfree(obj) #endif /* H5_NO_REG_FREE_LISTS */ /* Data structure to store information about each block allocated */ typedef union H5FL_blk_list_t { size_t size; /* Size of the page */ union H5FL_blk_list_t *next; /* Pointer to next block in free list */ double unused1; /* Unused normally, just here for aligment */ haddr_t unused2; /* Unused normally, just here for aligment */ } H5FL_blk_list_t; /* Data structure for priority queue node of block free lists */ typedef struct H5FL_blk_node_t { size_t size; /* Size of the blocks in the list */ H5FL_blk_list_t *list; /* List of free blocks */ struct H5FL_blk_node_t *next; /* Pointer to next free list in queue */ struct H5FL_blk_node_t *prev; /* Pointer to previous free list in queue */ } H5FL_blk_node_t; /* Data structure for priority queue of native block free lists */ typedef struct H5FL_blk_head_t { unsigned init; /* Whether the free list has been initialized */ unsigned allocated; /* Number of blocks allocated */ unsigned onlist; /* Number of blocks on free list */ size_t list_mem; /* Amount of memory in block on free list */ const char *name; /* Name of the type */ H5FL_blk_node_t *head; /* Pointer to first free list in queue */ } H5FL_blk_head_t; /* * Macros for defining & using priority queues */ #define H5FL_BLK_NAME(t) H5_##t##_blk_free_list #ifndef H5_NO_BLK_FREE_LISTS /* Common macro for H5FL_BLK_DEFINE & H5FL_BLK_DEFINE_STATIC */ #define H5FL_BLK_DEFINE_COMMON(t) H5FL_blk_head_t H5FL_BLK_NAME(t)={0,0,0,0,#t"_blk",NULL} /* Declare a free list to manage objects of type 't' */ #define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t) /* Reference a free list for type 't' defined in another file */ #define H5FL_BLK_EXTERN(t) extern H5_DLL H5FL_blk_head_t H5FL_BLK_NAME(t) /* Declare a static free list to manage objects of type 't' */ #define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t) /* Allocate an block of type 't' */ #define H5FL_BLK_MALLOC(t,size) H5FL_blk_malloc(&(H5FL_BLK_NAME(t)),size) /* Allocate an block of type 't' and clear it to zeros */ #define H5FL_BLK_CALLOC(t,size) H5FL_blk_calloc(&(H5FL_BLK_NAME(t)),size) /* Free a block of type 't' */ #define H5FL_BLK_FREE(t,blk) H5FL_blk_free(&(H5FL_BLK_NAME(t)),blk) /* Re-allocate a block of type 't' */ #define H5FL_BLK_REALLOC(t,blk,new_size) H5FL_blk_realloc(&(H5FL_BLK_NAME(t)),blk,new_size) /* Check if there is a free block available to re-use */ #define H5FL_BLK_AVAIL(t,size) H5FL_blk_free_block_avail(&(H5FL_BLK_NAME(t)),size) #else /* H5_NO_BLK_FREE_LISTS */ /* Common macro for H5FL_BLK_DEFINE & H5FL_BLK_DEFINE_STATIC */ #define H5FL_BLK_DEFINE_COMMON(t) int H5FL_BLK_NAME(t) #define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t) #define H5FL_BLK_EXTERN(t) extern H5_DLL int H5FL_BLK_NAME(t) #define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t) #define H5FL_BLK_MALLOC(t,size) H5MM_malloc(size) #define H5FL_BLK_CALLOC(t,size) H5MM_calloc(size) #define H5FL_BLK_FREE(t,blk) H5MM_xfree(blk) #define H5FL_BLK_REALLOC(t,blk,new_size) H5MM_realloc(blk,new_size) #define H5FL_BLK_AVAIL(t,size) (FALSE) #endif /* H5_NO_BLK_FREE_LISTS */ /* Data structure to store each array in free list */ typedef union H5FL_arr_list_t { union H5FL_arr_list_t *next; /* Pointer to next block in free list */ size_t nelem; /* Number of elements in this array */ double unused1; /* Unused normally, just here for aligment */ haddr_t unused2; /* Unused normally, just here for aligment */ } H5FL_arr_list_t; /* Data structure for each size of array element */ typedef struct H5FL_arr_node_t { size_t size; /* Size of the blocks in the list */ unsigned onlist; /* Number of blocks on free list */ H5FL_arr_list_t *list; /* List of free blocks */ } H5FL_arr_node_t; /* Data structure for free list of array blocks */ typedef struct H5FL_arr_head_t { unsigned init; /* Whether the free list has been initialized */ unsigned allocated; /* Number of blocks allocated */ size_t list_mem; /* Amount of memory in block on free list */ const char *name; /* Name of the type */ int maxelem; /* Maximum number of elements in an array */ size_t base_size; /* Size of the "base" object in the list */ size_t elem_size; /* Size of the array elements in the list */ H5FL_arr_node_t *list_arr; /* Array of lists of free blocks */ } H5FL_arr_head_t; /* * Macros for defining & using free lists for an array of a type */ #define H5FL_ARR_NAME(t) H5_##t##_arr_free_list #ifndef H5_NO_ARR_FREE_LISTS /* Common macro for H5FL_BLK_DEFINE & H5FL_BLK_DEFINE_STATIC */ #define H5FL_ARR_DEFINE_COMMON(b,t,m) H5FL_arr_head_t H5FL_ARR_NAME(t)={0,0,0,#t"_arr",m+1,b,sizeof(t),NULL} /* Declare a free list to manage arrays of type 't' */ #define H5FL_ARR_DEFINE(t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(0,t,m) /* Declare a free list to manage base 'b' + arrays of type 't' */ #define H5FL_BARR_DEFINE(b,t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(sizeof(b),t,m) /* Reference a free list for arrays of type 't' defined in another file */ #define H5FL_ARR_EXTERN(t) extern H5_DLL H5FL_arr_head_t H5FL_ARR_NAME(t) /* Declare a static free list to manage arrays of type 't' */ #define H5FL_ARR_DEFINE_STATIC(t,m) static H5FL_ARR_DEFINE_COMMON(0,t,m) /* Declare a static free list to manage base 'b' + arrays of type 't' */ #define H5FL_BARR_DEFINE_STATIC(b,t,m) static H5FL_ARR_DEFINE_COMMON(sizeof(b),t,m) /* Allocate an array of type 't' */ #define H5FL_ARR_MALLOC(t,elem) H5FL_arr_malloc(&(H5FL_ARR_NAME(t)),elem) /* Allocate an array of type 't' and clear it to all zeros */ #define H5FL_ARR_CALLOC(t,elem) H5FL_arr_calloc(&(H5FL_ARR_NAME(t)),elem) /* Free an array of type 't' */ #define H5FL_ARR_FREE(t,obj) H5FL_arr_free(&(H5FL_ARR_NAME(t)),obj) /* Re-allocate an array of type 't' */ #define H5FL_ARR_REALLOC(t,obj,new_elem) H5FL_arr_realloc(&(H5FL_ARR_NAME(t)),obj,new_elem) #else /* H5_NO_ARR_FREE_LISTS */ /* Common macro for H5FL_ARR_DEFINE & H5FL_ARR_DEFINE_STATIC */ #define H5FL_ARR_DEFINE_COMMON(t,m) size_t H5FL_ARR_NAME(t) #define H5FL_ARR_DEFINE(t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) = 0 #define H5FL_BARR_DEFINE(b,t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) = sizeof(b) #define H5FL_ARR_EXTERN(t) extern H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) #define H5FL_ARR_DEFINE_STATIC(t,m) static H5FL_ARR_DEFINE_COMMON(t,m) = 0 #define H5FL_BARR_DEFINE_STATIC(b,t,m) static H5FL_ARR_DEFINE_COMMON(t,m) = sizeof(b) #define H5FL_ARR_MALLOC(t,elem) H5MM_malloc(H5FL_ARR_NAME(t) + ((elem)*sizeof(t))) #define H5FL_ARR_CALLOC(t,elem) H5MM_calloc(H5FL_ARR_NAME(t) + ((elem)*sizeof(t))) #define H5FL_ARR_FREE(t,obj) H5MM_xfree(obj) #define H5FL_ARR_REALLOC(t,obj,new_elem) H5MM_realloc(obj,H5FL_ARR_NAME(t) + ((new_elem)*sizeof(t))) #endif /* H5_NO_ARR_FREE_LISTS */ /* Data structure for free list of sequence blocks */ typedef struct H5FL_seq_head_t { H5FL_blk_head_t queue; /* Priority queue of sequence blocks */ size_t size; /* Size of the sequence elements in the list */ } H5FL_seq_head_t; /* * Macros for defining & using free lists for a sequence of a type * * Sequences are like arrays, except they have no upper limit. * */ #define H5FL_SEQ_NAME(t) H5_##t##_seq_free_list #ifndef H5_NO_SEQ_FREE_LISTS /* Common macro for H5FL_SEQ_DEFINE & H5FL_SEQ_DEFINE_STATIC */ #define H5FL_SEQ_DEFINE_COMMON(t) H5FL_seq_head_t H5FL_SEQ_NAME(t)={{0,0,0,0,#t"_seq",NULL},sizeof(t)} /* Declare a free list to manage sequences of type 't' */ #define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t) /* Reference a free list for sequences of type 't' defined in another file */ #define H5FL_SEQ_EXTERN(t) extern H5_DLL H5FL_seq_head_t H5FL_SEQ_NAME(t) /* Declare a static free list to manage sequences of type 't' */ #define H5FL_SEQ_DEFINE_STATIC(t) static H5FL_SEQ_DEFINE_COMMON(t) /* Allocate a sequence of type 't' */ #define H5FL_SEQ_MALLOC(t,elem) H5FL_seq_malloc(&(H5FL_SEQ_NAME(t)),elem) /* Allocate a sequence of type 't' and clear it to all zeros */ #define H5FL_SEQ_CALLOC(t,elem) H5FL_seq_calloc(&(H5FL_SEQ_NAME(t)),elem) /* Free a sequence of type 't' */ #define H5FL_SEQ_FREE(t,obj) H5FL_seq_free(&(H5FL_SEQ_NAME(t)),obj) /* Re-allocate a sequence of type 't' */ #define H5FL_SEQ_REALLOC(t,obj,new_elem) H5FL_seq_realloc(&(H5FL_SEQ_NAME(t)),obj,new_elem) #else /* H5_NO_SEQ_FREE_LISTS */ /* Common macro for H5FL_BLK_DEFINE & H5FL_BLK_DEFINE_STATIC */ #define H5FL_SEQ_DEFINE_COMMON(t) int H5FL_SEQ_NAME(t) #define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t) #define H5FL_SEQ_EXTERN(t) extern H5_DLL int H5FL_SEQ_NAME(t) #define H5FL_SEQ_DEFINE_STATIC(t) static H5FL_SEQ_DEFINE_COMMON(t) #define H5FL_SEQ_MALLOC(t,elem) H5MM_malloc((elem)*sizeof(t)) #define H5FL_SEQ_CALLOC(t,elem) H5MM_calloc((elem)*sizeof(t)) #define H5FL_SEQ_FREE(t,obj) H5MM_xfree(obj) #define H5FL_SEQ_REALLOC(t,obj,new_elem) H5MM_realloc(obj,(new_elem)*sizeof(t)) #endif /* H5_NO_SEQ_FREE_LISTS */ /* * Library prototypes. */ H5_DLL void * H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size); H5_DLL void * H5FL_blk_calloc(H5FL_blk_head_t *head, size_t size); H5_DLL void * H5FL_blk_free(H5FL_blk_head_t *head, void *block); H5_DLL void * H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size); H5_DLL htri_t H5FL_blk_free_block_avail(H5FL_blk_head_t *head, size_t size); H5_DLL void * H5FL_reg_malloc(H5FL_reg_head_t *head); H5_DLL void * H5FL_reg_calloc(H5FL_reg_head_t *head); H5_DLL void * H5FL_reg_free(H5FL_reg_head_t *head, void *obj); H5_DLL void * H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem); H5_DLL void * H5FL_arr_calloc(H5FL_arr_head_t *head, size_t elem); H5_DLL void * H5FL_arr_free(H5FL_arr_head_t *head, void *obj); H5_DLL void * H5FL_arr_realloc(H5FL_arr_head_t *head, void *obj, size_t new_elem); H5_DLL void * H5FL_seq_malloc(H5FL_seq_head_t *head, size_t elem); H5_DLL void * H5FL_seq_calloc(H5FL_seq_head_t *head, size_t elem); H5_DLL void * H5FL_seq_free(H5FL_seq_head_t *head, void *obj); H5_DLL void * H5FL_seq_realloc(H5FL_seq_head_t *head, void *obj, size_t new_elem); H5_DLL herr_t H5FL_garbage_coll(void); H5_DLL herr_t H5FL_set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); H5_DLL int H5FL_term_interface(void); #endif
44.335329
108
0.709819
[ "object" ]
83cf732b3acc1949f16697600d5af00e82293c3b
1,116
h
C
src/xray/render/core/sorted_vector.h
ixray-team/ixray-2.0
85c3a544175842323fc82f42efd96c66f0fc5abb
[ "Linux-OpenIB" ]
3
2021-10-30T09:36:14.000Z
2022-03-26T17:00:06.000Z
src/xray/render/core/sorted_vector.h
acidicMercury8/ixray-2.0
85c3a544175842323fc82f42efd96c66f0fc5abb
[ "Linux-OpenIB" ]
null
null
null
src/xray/render/core/sorted_vector.h
acidicMercury8/ixray-2.0
85c3a544175842323fc82f42efd96c66f0fc5abb
[ "Linux-OpenIB" ]
1
2022-03-26T17:00:08.000Z
2022-03-26T17:00:08.000Z
//////////////////////////////////////////////////////////////////////////// // Created : 19.04.2010 // Author : Armen Abroyan // Copyright (C) GSC Game World - 2010 //////////////////////////////////////////////////////////////////////////// #ifndef SORTED_VECTOR_H_INCLUDED #define SORTED_VECTOR_H_INCLUDED namespace xray { namespace render_dx10 { template <typename T, typename M> class sorted_vector : protected render::vector<T*> { public: using render::vector::const_iterator; using render::vector::iterator; using render::vector::begin; using render::vector::end; using render::vector::operator []; using render::vector::size; sorted_vector() : render::vector () {} sorted_vector( sorted_vector const & other ) : render::vector( other) {} ~sorted_vector(); T * try_add ( T const& element); T & add ( M const& element); T * find ( M const& value); //bool find ( T const& element) {} private: }; // class sorted_vector } // namespace render } // namespace xray #include "sorted_vector_inline.h" #endif // #ifndef SORTED_VECTOR_H_INCLUDED
26.571429
77
0.582437
[ "render", "vector" ]
83df1370f39b6e9b1b0da19d9434caa0ad039c4b
4,638
h
C
Editor/VEX/XTools/fbxtoogre/Inc/animation.h
devxkh/FrankE
72faca02759b54aaec842831f3c7a051e7cf5335
[ "MIT" ]
11
2017-01-17T15:02:25.000Z
2020-11-27T16:54:42.000Z
Editor/VEX/XTools/fbxtoogre/Inc/animation.h
devxkh/FrankE
72faca02759b54aaec842831f3c7a051e7cf5335
[ "MIT" ]
9
2016-10-23T20:15:38.000Z
2018-02-06T11:23:17.000Z
Editor/VEX/XTools/fbxtoogre/Inc/animation.h
devxkh/FrankE
72faca02759b54aaec842831f3c7a051e7cf5335
[ "MIT" ]
2
2019-08-29T10:23:51.000Z
2020-04-03T06:08:34.000Z
//////////////////////////////////////////////////////////////////////////////// // animation.h // Author : Francesco Giordana // Sponsored by : Anygma N.V. (http://www.nazooka.com) // Start Date : January 13, 2005 // Copyright : (C) 2006 by Francesco Giordana // Email : fra.giordana@tiscali.it //////////////////////////////////////////////////////////////////////////////// // Port to 3D Studio Max - Modified original version // Author : Doug Perkowski - OC3 Entertainment, Inc. // Start Date : December 10th, 2007 //////////////////////////////////////////////////////////////////////////////// // Port to FBX - Modified original version // Author : Doug Perkowski - OC3 Entertainment, Inc. // Start Date : January 8th, 2012 //////////////////////////////////////////////////////////////////////////////// /********************************************************************************* * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * **********************************************************************************/ #ifndef ANIMATION_H #define ANIMATION_H namespace FxOgreFBX { // Track type typedef enum { TT_SKELETON, TT_MORPH, TT_POSE } trackType; // Target typedef enum { T_MESH, T_SUBMESH } target; // Vertex position typedef struct vertexPositiontag { float x,y,z; } vertexPosition; // Vertex pose reference typedef struct vertexPoseReftag { int poseIndex; float poseWeight; } vertexPoseRef; // Vertex animation keyframe typedef struct vertexKeyframetag { float time; std::vector<vertexPosition> positions; std::vector<vertexPoseRef> poserefs; } vertexKeyframe; // Skeleton animation keyframe typedef struct skeletonKeyframeTag { float time; //time of keyframe double tx,ty,tz; //translation //double angle,axis_x,axis_y,axis_z; //rotation double quat_w, quat_x, quat_y, quat_z; float sx,sy,sz; //scale } skeletonKeyframe; // Blend shape data typedef struct vertexOffestTag { long index; float x,y,z; } vertexOffset; typedef struct poseTag { target poseTarget; std::string name; std::vector<vertexOffset> offsets; FbxShape* pShape; FbxAnimCurve* pCurve; } pose; // A class for storing an animation track // each track can be either skeleton, morph or pose animation class Track { public: //constructor Track() { clear(); }; //destructor ~Track() { clear(); } //clear track data void clear() { m_type = TT_SKELETON; m_target = T_MESH; m_index = 0; m_bone = ""; m_vertexKeyframes.clear(); m_skeletonKeyframes.clear(); } //add vertex animation keyframe void addVertexKeyframe(vertexKeyframe& k) { m_vertexKeyframes.push_back(k); } //add skeleton animation keyframe void addSkeletonKeyframe(skeletonKeyframe& k) { m_skeletonKeyframes.push_back(k); } //public members trackType m_type; target m_target; int m_index; std::string m_bone; std::vector<vertexKeyframe> m_vertexKeyframes; std::vector<skeletonKeyframe> m_skeletonKeyframes; }; // A class for storing animation information // an animation is a collection of different tracks class Animation { public: //constructor Animation() { clear(); } //destructor ~Animation() { clear(); }; //clear animation data void clear() { m_name = ""; m_length = 0; m_tracks.clear(); }; //add track void addTrack(Track& t) { m_tracks.push_back(t); } //public memebers std::string m_name; float m_length; std::vector<Track> m_tracks; }; } // end namespace #endif // ANIMATION_H
28.453988
83
0.493963
[ "shape", "vector", "3d" ]
83e372406650eeee4f383389ae65a864aecba53c
14,347
c
C
interface/mmal/openmaxil/mmalomx_util_params_video.c
cgutman/userland
14b90ff9d9f031391a299e6e006965d02bfd1bb1
[ "BSD-3-Clause" ]
1,498
2015-01-01T19:51:26.000Z
2022-03-31T22:38:20.000Z
interface/mmal/openmaxil/mmalomx_util_params_video.c
cgutman/userland
14b90ff9d9f031391a299e6e006965d02bfd1bb1
[ "BSD-3-Clause" ]
527
2015-01-01T16:22:46.000Z
2022-03-31T14:12:13.000Z
interface/mmal/openmaxil/mmalomx_util_params_video.c
cgutman/userland
14b90ff9d9f031391a299e6e006965d02bfd1bb1
[ "BSD-3-Clause" ]
892
2015-01-01T07:52:05.000Z
2022-03-31T19:48:09.000Z
/* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "mmalomx.h" #include "mmalomx_util_params_common.h" #include "mmalomx_logging.h" static void rect_to_omx(OMX_DISPLAYRECTTYPE *dst, const MMAL_RECT_T *src) { dst->x_offset = src->x; dst->y_offset = src->y; dst->width = src->width; dst->height = src->height; } static void rect_to_mmal(MMAL_RECT_T *dst, const OMX_DISPLAYRECTTYPE *src) { dst->x = src->x_offset; dst->y = src->y_offset; dst->width = src->width; dst->height = src->height; } static MMAL_STATUS_T mmalomx_param_mapping_displayregion(MMALOMX_PARAM_MAPPING_DIRECTION dir, MMAL_PARAMETER_HEADER_T *mmal_param, OMX_PTR omx_param) { OMX_CONFIG_DISPLAYREGIONTYPE *omx = (OMX_CONFIG_DISPLAYREGIONTYPE *)omx_param; MMAL_DISPLAYREGION_T *mmal = (MMAL_DISPLAYREGION_T *)mmal_param; if (dir == MMALOMX_PARAM_MAPPING_TO_MMAL) { mmal->set = omx->set; mmal->display_num = omx->num; mmal->fullscreen = omx->fullscreen; mmal->transform = (MMAL_DISPLAYTRANSFORM_T)omx->transform; rect_to_mmal(&mmal->dest_rect, &omx->dest_rect); rect_to_mmal(&mmal->src_rect, &omx->src_rect); mmal->noaspect = omx->noaspect; mmal->mode = (MMAL_DISPLAYMODE_T)omx->mode; mmal->pixel_x = omx->pixel_x; mmal->pixel_y = omx->pixel_y; mmal->layer = omx->layer; mmal->copyprotect_required = omx->copyprotect_required; mmal->alpha = omx->alpha; } else { omx->set = mmal->set; omx->num = mmal->display_num; omx->fullscreen = mmal->fullscreen; omx->transform = (OMX_DISPLAYTRANSFORMTYPE)mmal->transform; rect_to_omx(&omx->dest_rect, &mmal->dest_rect); rect_to_omx(&omx->src_rect, &mmal->src_rect); omx->noaspect = mmal->noaspect; omx->mode = (OMX_DISPLAYMODETYPE)mmal->mode; omx->pixel_x = mmal->pixel_x; omx->pixel_y = mmal->pixel_y; omx->layer = mmal->layer; omx->copyprotect_required = mmal->copyprotect_required; omx->alpha = mmal->alpha; } return MMAL_SUCCESS; } static MMAL_STATUS_T mmalomx_param_list_supported_profiles(MMALOMX_PARAM_MAPPING_DIRECTION dir, const MMALOMX_PARAM_TRANSLATION_T *xlat, unsigned int index, MMAL_PARAMETER_HEADER_T *mmal_param, OMX_PTR omx_param, MMAL_PORT_T *mmal_port) { OMX_VIDEO_PARAM_PROFILELEVELTYPE *omx = (OMX_VIDEO_PARAM_PROFILELEVELTYPE *)omx_param; MMAL_PARAMETER_VIDEO_PROFILE_T *mmal = (MMAL_PARAMETER_VIDEO_PROFILE_T *)mmal_param; MMAL_PARAM_UNUSED(xlat); if (dir == MMALOMX_PARAM_MAPPING_TO_MMAL) { OMX_VIDEO_CODINGTYPE coding = mmalil_encoding_to_omx_video_coding(mmal_port->format->encoding); mmal->profile[index].profile = mmalil_omx_video_profile_to_mmal(omx->eProfile, coding); mmal->profile[index].level = mmalil_omx_video_level_to_mmal(omx->eLevel, coding); } else { omx->eProfile = mmalil_video_profile_to_omx(mmal->profile[index].profile); omx->eLevel = mmalil_video_level_to_omx(mmal->profile[index].level); } return MMAL_SUCCESS; } static MMAL_STATUS_T mmalomx_param_custom_profile(MMALOMX_PARAM_MAPPING_DIRECTION dir, const MMALOMX_PARAM_TRANSLATION_T *xlat, MMAL_PARAMETER_HEADER_T *mmal_param, OMX_PTR omx_param, MMAL_PORT_T *mmal_port) { OMX_VIDEO_PARAM_PROFILELEVELTYPE *omx = (OMX_VIDEO_PARAM_PROFILELEVELTYPE *)omx_param; MMAL_PARAMETER_VIDEO_PROFILE_T *mmal = (MMAL_PARAMETER_VIDEO_PROFILE_T *)mmal_param; MMAL_PARAM_UNUSED(xlat); if (dir == MMALOMX_PARAM_MAPPING_TO_MMAL) { OMX_VIDEO_CODINGTYPE coding = mmalil_encoding_to_omx_video_coding(mmal_port->format->encoding); mmal->profile[0].profile = mmalil_omx_video_profile_to_mmal(omx->eProfile, coding); mmal->profile[0].level = mmalil_omx_video_level_to_mmal(omx->eLevel, coding); } else { omx->eProfile = mmalil_video_profile_to_omx(mmal->profile[0].profile); omx->eLevel = mmalil_video_level_to_omx(mmal->profile[0].level); } return MMAL_SUCCESS; } static MMAL_STATUS_T mmalomx_param_custom_ratecontrol(MMALOMX_PARAM_MAPPING_DIRECTION dir, const MMALOMX_PARAM_TRANSLATION_T *xlat, MMAL_PARAMETER_HEADER_T *mmal_param, OMX_PTR omx_param, MMAL_PORT_T *mmal_port) { OMX_VIDEO_PARAM_BITRATETYPE *omx = (OMX_VIDEO_PARAM_BITRATETYPE *)omx_param; MMAL_PARAMETER_VIDEO_RATECONTROL_T *mmal = (MMAL_PARAMETER_VIDEO_RATECONTROL_T *)mmal_param; MMAL_PARAM_UNUSED(xlat); if (dir == MMALOMX_PARAM_MAPPING_TO_MMAL) { mmal->control = mmalil_omx_video_ratecontrol_to_mmal(omx->eControlRate); /* This does not apply nTargetBitrate but should not be necessary */ } else { omx->eControlRate = mmalil_video_ratecontrol_to_omx(mmal->control); omx->nTargetBitrate = mmal_port->format->bitrate; /* Should not really be necessary */ } return MMAL_SUCCESS; } static const MMALOMX_PARAM_ENUM_TRANSLATE_T mmalomx_param_enum_nalunitformat[] = { {MMAL_VIDEO_NALUNITFORMAT_STARTCODES, OMX_NaluFormatStartCodes}, {MMAL_VIDEO_NALUNITFORMAT_NALUNITPERBUFFER, OMX_NaluFormatOneNaluPerBuffer}, {MMAL_VIDEO_NALUNITFORMAT_ONEBYTEINTERLEAVELENGTH, OMX_NaluFormatOneByteInterleaveLength}, {MMAL_VIDEO_NALUNITFORMAT_TWOBYTEINTERLEAVELENGTH, OMX_NaluFormatTwoByteInterleaveLength}, {MMAL_VIDEO_NALUNITFORMAT_FOURBYTEINTERLEAVELENGTH, OMX_NaluFormatFourByteInterleaveLength}, }; static MMAL_STATUS_T mmalomx_param_mapping_frame_rate(MMALOMX_PARAM_MAPPING_DIRECTION dir, MMAL_PARAMETER_HEADER_T *mmal_param, OMX_PTR omx_param) { OMX_CONFIG_FRAMERATETYPE *omx = (OMX_CONFIG_FRAMERATETYPE *)omx_param; MMAL_PARAMETER_FRAME_RATE_T *mmal = (MMAL_PARAMETER_FRAME_RATE_T *)mmal_param; if (dir == MMALOMX_PARAM_MAPPING_TO_MMAL) { mmal->frame_rate.num = omx->xEncodeFramerate; mmal->frame_rate.den = (1<<16); } else { omx->xEncodeFramerate = 0; if (mmal->frame_rate.den) omx->xEncodeFramerate = (((int64_t)mmal->frame_rate.num)<<16)/mmal->frame_rate.den; } return MMAL_SUCCESS; } const MMALOMX_PARAM_TRANSLATION_T mmalomx_param_xlator_video[] = { MMALOMX_PARAM_STRAIGHT_MAPPING(MMAL_PARAMETER_DISPLAYREGION, MMAL_DISPLAYREGION_T, OMX_IndexConfigDisplayRegion, OMX_CONFIG_DISPLAYREGIONTYPE, mmalomx_param_mapping_displayregion), MMALOMX_PARAM_LIST(MMAL_PARAMETER_SUPPORTED_PROFILES, MMAL_PARAMETER_VIDEO_PROFILE_T, OMX_IndexParamVideoProfileLevelQuerySupported, OMX_VIDEO_PARAM_PROFILELEVELTYPE, nProfileIndex, mmalomx_param_list_supported_profiles), MMALOMX_PARAM_CUSTOM(MMAL_PARAMETER_PROFILE, MMAL_PARAMETER_VIDEO_PROFILE_T, OMX_IndexParamVideoProfileLevelCurrent, OMX_VIDEO_PARAM_PROFILELEVELTYPE, mmalomx_param_custom_profile), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_INTRAPERIOD, MMAL_PARAMETER_UINT32_T, OMX_IndexConfigBrcmVideoIntraPeriod, OMX_PARAM_U32TYPE), MMALOMX_PARAM_CUSTOM(MMAL_PARAMETER_RATECONTROL, MMAL_PARAMETER_VIDEO_RATECONTROL_T, OMX_IndexParamVideoBitrate, OMX_VIDEO_PARAM_BITRATETYPE, mmalomx_param_custom_ratecontrol), MMALOMX_PARAM_ENUM(MMAL_PARAMETER_NALUNITFORMAT, MMAL_PARAMETER_VIDEO_NALUNITFORMAT_T, OMX_IndexParamNalStreamFormatSelect, OMX_NALSTREAMFORMATTYPE, mmalomx_param_enum_nalunitformat), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_MINIMISE_FRAGMENTATION, OMX_IndexConfigMinimiseFragmentation), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_MB_ROWS_PER_SLICE, MMAL_PARAMETER_UINT32_T, OMX_IndexConfigBrcmVideoEncoderMBRowsPerSlice, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_LEVEL_EXTENSION, MMAL_PARAMETER_VIDEO_LEVEL_EXTENSION_T, OMX_IndexConfigEncLevelExtension, OMX_VIDEO_CONFIG_LEVEL_EXTEND), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_INTRA_REFRESH, MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T, OMX_IndexConfigBrcmVideoIntraRefresh, OMX_VIDEO_PARAM_INTRAREFRESHTYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_INTRA_REFRESH, MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T, OMX_IndexParamVideoIntraRefresh, OMX_VIDEO_PARAM_INTRAREFRESHTYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_EEDE_ENABLE, MMAL_PARAMETER_VIDEO_EEDE_ENABLE_T, OMX_IndexParamBrcmEEDEEnable, OMX_VIDEO_EEDE_ENABLE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_EEDE_LOSSRATE, MMAL_PARAMETER_VIDEO_EEDE_LOSSRATE_T, OMX_IndexParamBrcmEEDELossRate, OMX_VIDEO_EEDE_LOSSRATE), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_REQUEST_I_FRAME, OMX_IndexConfigBrcmVideoRequestIFrame), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT, OMX_IndexParamBrcmImmutableInput), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_BIT_RATE, MMAL_PARAMETER_UINT32_T, OMX_IndexConfigVideoBitrate, OMX_VIDEO_CONFIG_BITRATETYPE), MMALOMX_PARAM_STRAIGHT_MAPPING(MMAL_PARAMETER_VIDEO_FRAME_RATE, MMAL_PARAMETER_FRAME_RATE_T, OMX_IndexConfigVideoFramerate, OMX_CONFIG_FRAMERATETYPE, mmalomx_param_mapping_frame_rate), MMALOMX_PARAM_STRAIGHT_MAPPING(MMAL_PARAMETER_FRAME_RATE, MMAL_PARAMETER_FRAME_RATE_T, OMX_IndexConfigVideoFramerate, OMX_CONFIG_FRAMERATETYPE, mmalomx_param_mapping_frame_rate), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_MIN_QUANT, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmVideoEncodeMinQuant, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_MAX_QUANT, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmVideoEncodeMaxQuant, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_RC_MODEL, MMAL_PARAMETER_VIDEO_ENCODE_RC_MODEL_T, OMX_IndexParamRateControlModel, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_EXTRA_BUFFERS, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmExtraBuffers, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ALIGN_HORIZ, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmAlignHoriz, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ALIGN_VERT, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmAlignVert, OMX_PARAM_U32TYPE), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_DROPPABLE_PFRAMES, OMX_IndexParamBrcmDroppablePFrames), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_INITIAL_QUANT, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmVideoInitialQuant, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_QP_P, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmVideoInitialQuant, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_RC_SLICE_DQUANT, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmVideoRCSliceDQuant, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_FRAME_LIMIT_BITS, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmVideoFrameLimitBits, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_PEAK_RATE, MMAL_PARAMETER_UINT32_T, OMX_IndexParamBrcmVideoPeakRate, OMX_PARAM_U32TYPE), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_ENCODE_H264_DISABLE_CABAC, OMX_IndexConfigBrcmVideoH264DisableCABAC), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_ENCODE_H264_LOW_LATENCY, OMX_IndexConfigBrcmVideoH264LowLatency), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_ENCODE_H264_AU_DELIMITERS, OMX_IndexConfigBrcmVideoH264AUDelimiters), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_H264_DEBLOCK_IDC, MMAL_PARAMETER_UINT32_T, OMX_IndexConfigBrcmVideoH264DeblockIDC, OMX_PARAM_U32TYPE), MMALOMX_PARAM_PASSTHROUGH(MMAL_PARAMETER_VIDEO_ENCODE_H264_MB_INTRA_MODE, MMAL_PARAMETER_VIDEO_ENCODER_H264_MB_INTRA_MODES_T, OMX_IndexConfigBrcmVideoH264IntraMBMode, OMX_PARAM_U32TYPE), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_ENCODE_HEADER_ON_OPEN, OMX_IndexParamBrcmHeaderOnOpen), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_ENCODE_PRECODE_FOR_QP, OMX_IndexParamBrcmVideoPrecodeForQP), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO, OMX_IndexParamBrcmVideoTimestampFifo), MMALOMX_PARAM_BOOLEAN_PORTLESS(MMAL_PARAMETER_VIDEO_DECODE_ERROR_CONCEALMENT, OMX_IndexParamBrcmVideoDecodeErrorConcealment), MMALOMX_PARAM_PASSTHROUGH_PORTLESS_DOUBLE_TRANSLATION(MMAL_PARAMETER_VIDEO_DRM_PROTECT_BUFFER, MMAL_PARAMETER_VIDEO_DRM_PROTECT_BUFFER_T, OMX_IndexParamBrcmVideoDrmProtectBuffer, OMX_PARAM_BRCMVIDEODRMPROTECTBUFFERTYPE), MMALOMX_PARAM_PASSTHROUGH_PORTLESS(MMAL_PARAMETER_VIDEO_DECODE_CONFIG_VD3, MMAL_PARAMETER_BYTES_T, OMX_IndexParamBrcmVideoDecodeConfigVD3, OMX_PARAM_BRCMVIDEODECODECONFIGVD3TYPE), MMALOMX_PARAM_BOOLEAN(MMAL_PARAMETER_VIDEO_ENCODE_INLINE_HEADER, OMX_IndexParamBrcmVideoAVCInlineHeaderEnable), MMALOMX_PARAM_TERMINATE() };
51.607914
140
0.810553
[ "transform" ]
83eb6abfb51e8f6ea9d3ac9ea4f96482f14d6187
1,231
h
C
1649-Create Sorted Array through Instructions/cpp_1649/Solution2.h
ooooo-youwillsee/leetcode
07b273f133c8cf755ea40b3ae9df242ce044823c
[ "MIT" ]
12
2020-03-18T14:36:23.000Z
2021-12-19T02:24:33.000Z
1649-Create Sorted Array through Instructions/cpp_1649/Solution2.h
ooooo-youwillsee/leetcode
07b273f133c8cf755ea40b3ae9df242ce044823c
[ "MIT" ]
null
null
null
1649-Create Sorted Array through Instructions/cpp_1649/Solution2.h
ooooo-youwillsee/leetcode
07b273f133c8cf755ea40b3ae9df242ce044823c
[ "MIT" ]
null
null
null
/** * @author ooooo * @date 2021/3/20 18:52 */ #ifndef CPP_1649__SOLUTION2_H_ #define CPP_1649__SOLUTION2_H_ #include <iostream> #include <vector> using namespace std; // 树状数组 class Solution { public: struct BIT { vector<int> data, tree; BIT(vector<int> data) : data(data.size()), tree(data.size() + 1) { for (int i = 0; i < data.size(); ++i) { this->data[i] = data[i]; } for (int i = 0; i < data.size(); ++i) { set(i, data[i]); } } void set(int i, int v) { i++; while (i < tree.size()) { tree[i] += v; i += lowBit(i); } } int query(int i) { i++; int sum = 0; while (i >= 1) { sum += tree[i]; i -= lowBit(i); } return sum; } int lowBit(int x) { return x & -x; } }; static constexpr int MOD = 1e9 + 7; int createSortedArray(vector<int> &instructions) { vector<int> nums(1e5 + 1); BIT tree(nums); long long ans = 0; for (int i = 0; i < instructions.size(); ++i) { int less = tree.query(instructions[i] - 1); int greater = i - nums[instructions[i]] - less; ans = (ans + min(less, greater)) % MOD; nums[instructions[i]]++; tree.set(instructions[i], 1); } return ans; } } #endif //CPP_1649__SOLUTION2_H_
16.863014
68
0.555646
[ "vector" ]
8606528dde28c3bb2663db8c568bad43c554081e
356
h
C
Homework/fp/fp1/utils/tests.h
Alexhuyi/cme213-spring-2021
3cc49d369f1041c0cf4f960cb6efa28c04acdf60
[ "MIT" ]
null
null
null
Homework/fp/fp1/utils/tests.h
Alexhuyi/cme213-spring-2021
3cc49d369f1041c0cf4f960cb6efa28c04acdf60
[ "MIT" ]
null
null
null
Homework/fp/fp1/utils/tests.h
Alexhuyi/cme213-spring-2021
3cc49d369f1041c0cf4f960cb6efa28c04acdf60
[ "MIT" ]
null
null
null
#ifndef TESTS_H_ #define TESTS_H_ #include "neural_network.h" #include "types.h" int checkErrors(const arma::Mat<real>& Seq, const arma::Mat<real>& Par, std::ofstream& ofs, std::vector<real>& errors); int checkNNErrors(NeuralNetwork& seq_nn, NeuralNetwork& par_nn, std::string filename); void BenchmarkGEMM(); #endif
22.25
71
0.676966
[ "vector" ]
8606dffffff21a0d36937003dd7661679e99793b
12,057
h
C
smn/include/obnsmn_comm_mqtt.h
sduerr85/OpenBuildNet
126feb4d17558e7bfe1e2e6f081bbfbf1514496f
[ "MIT" ]
null
null
null
smn/include/obnsmn_comm_mqtt.h
sduerr85/OpenBuildNet
126feb4d17558e7bfe1e2e6f081bbfbf1514496f
[ "MIT" ]
null
null
null
smn/include/obnsmn_comm_mqtt.h
sduerr85/OpenBuildNet
126feb4d17558e7bfe1e2e6f081bbfbf1514496f
[ "MIT" ]
null
null
null
/* -*- mode: C++; indent-tabs-mode: nil; -*- */ /** \file * \brief MQTT communication interface. * * Implement the communication interface with MQTT. * * This file is part of the openBuildNet simulation framework * (OBN-Sim) developed at EPFL. * * \author Truong X. Nghiem (xuan.nghiem@epfl.ch) */ #ifndef OBNSIM_COMM_MQTT_H #define OBNSIM_COMM_MQTT_H #ifndef OBNSIM_COMM_MQTT #error To use this library the program must be compiled with MQTT support. #endif #include <cassert> #include <memory> #include <mutex> #include <condition_variable> #include <atomic> #include <unordered_set> #include <regex> // For checking topic names #include <obnsmn_node.h> #include <obnsmn_report.h> #include <obnsmn_gc.h> #include "MQTTAsync.h" namespace OBNsmn { namespace MQTT { class OBNNodeMQTT; /** \brief The object that manages all MQTT communications (i.e. the MQTT communication thread). Uses the Async communication interface of Paho MQTT library. */ class MQTTClient { private: static const int QOS = 2; // The desired QOS for the main connection (main GC topic) OBNsmn::GCThread::TSendMsgToSysPortFunc m_prev_gc_sendmsg_to_sys_port; MQTTAsync m_client; ///< The MQTT client, used for all communication needs std::atomic_bool m_running{false}; ///< Whether the MQTT client is running std::atomic_int m_msgout_count{0}; ///< Keep track of the current number of out messages // The result variable, mutex and condition variable is used by MQTT callbacks to notify the main execution. bool m_notify_done; int m_notify_result; // Result of the action, typically 0 means success std::mutex m_notify_mutex; std::condition_variable m_notify_var; void notify_done(int result = 0) { std::lock_guard<std::mutex> mylock(m_notify_mutex); m_notify_done = true; m_notify_result = result; m_notify_var.notify_all(); } /** The GC object with which this communication thread is associated. */ GCThread *pGC; /** Name of the incoming MQTT port. */ std::string m_portName; /** Client ID */ std::string m_client_id; /** MQTT server address. */ std::string m_server_address; /** The N2SMN message used for receiving data from GC port. */ OBNSimMsg::N2SMN m_n2smn_msg; /** List of nodes that have announced their availability. */ std::unordered_set<std::string> m_online_nodes; std::string m_online_nodes_topic; bool m_listening_for_arrivals{false}; std::mutex m_online_nodes_mutex; static std::regex online_nodes_topic_regex; friend class OBNNodeMQTT; public: /** Construct the MQTT client object, associated with a given GC. \param _gc Pointer to a valid GC thread, with which this thread is associated. */ MQTTClient(GCThread* _gc): pGC(_gc) { // Set the function to send a message to the system port m_prev_gc_sendmsg_to_sys_port = pGC->getSendMsgToSysPortFunc(); // Save the current function to call it -> form a chain of function calls pGC->setSendMsgToSysPortFunc(std::bind(&MQTTClient::sendMessageToGC, this, std::placeholders::_1)); } //virtual ~MQTTClient() { // Close the client, shutdown thread, close the port stop(); } bool isRunning() const { return m_running; } /** \brief Send an SMN2N message to the system port. */ bool sendMessageToGC(const OBNSimMsg::SMN2N &msg); /** \brief Send an SMN2N message to a given topic. \param retained If this message should be retained on the broker. \return The return code of MQTT's sendMessage(). */ int sendMessage(const OBNSimMsg::SMN2N &msg, const std::string& topic, int retained = 0); /** \brief Send a raw message to a given topic. \param retained If this message should be retained on the broker. \return The return code of MQTT's sendMessage(). */ int sendMessage(char* msg, std::size_t msglen, const std::string& topic, int retained = 0); /** Set the port's name. */ void setPortName(const std::string &t_port) { assert(!t_port.empty()); m_portName = t_port; } /** Set the client ID. */ void setClientID(const std::string& _clientID) { assert(!_clientID.empty()); m_client_id = _clientID; } /** Set the server address */ void setServerAddress(const std::string& addr) { assert(!addr.empty()); m_server_address = addr; } /** \brief Open the port. \return True if successful. */ bool openPort() { return true; } //port.open(portName); } /** \brief Close the port (stop activities). */ void closePort() { } //port.interrupt(); port.close(); } /** \brief Start the MQTT client (thread). Start the client / thread if it is not running already. Only one is allowed to run at any moment. \return True if successful; false otherwise. */ bool start(); /** Stop the MQTT client. */ void stop(); /** Returns number of pending out messages. */ int outMsgCount() const { return m_msgout_count; } /** Start waiting for nodes to announce their arrivals. \param t_workspace The workspace name; either "" (default) or of the form "workspace/" (note the / at the end) */ bool startListeningForArrivals(const std::string& t_workspace); /** Stop waiting for nodes to announce their arrivals. */ void stopListeningForArrivals(); /** Check if a given node has announced its arrival. */ bool checkNodeOnline(const std::string& name); /** Clear the list of online nodes. */ void clearListOfOnlineNodes(); // /** \brief Join the thread to current thread. // // Join the thread (if one is running) to the current thread, which will be blocked until the thread ends. // This is useful for the main thread to wait for the thread to stop. // \return True if successful; false otherwise. // */ // bool joinThread() { // if (!pThread) return false; // // pThread->join(); // // We can now safely destroy _gcthread // delete pThread; // pThread = nullptr; // return true; // } private: ///////////////// // Callbacks ///////////////// /** Called when the connection with the server is lost. */ static void on_connection_lost(void *context, char *cause); /** Called whenever a message is received. */ static int on_message_arrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message); /** Called whenever a sent message has been delivered. */ static void on_message_delivered(void *context, MQTTAsync_token token); /** Called when the connection with the server is established successfully. */ static void onConnect(void* context, MQTTAsync_successData* response); /** Called when a connection attempt failed. */ static void onConnectFailure(void* context, MQTTAsync_failureData* response); /** Called when subscription succeeds. */ static void onSubscribe(void* context, MQTTAsync_successData* response); /** Called when subscription fails. */ static void onSubscribeFailure(void* context, MQTTAsync_failureData* response); /** Called when the re-connection with the server is established successfully. */ static void onReconnect(void* context, MQTTAsync_successData* response); /** Called when a re-connection attempt failed. */ static void onReconnectFailure(void* context, MQTTAsync_failureData* response); /** Called when resubscription fails. */ static void onReSubscribeFailure(void* context, MQTTAsync_failureData* response); /** Connection is permanently lost. Need to stop!!! */ void onPermanentConnectionLost() { // Notify the GC that a critical error has happened pGC->criticalErrorExit(); } /** Called when the disconnection with the server is successful. */ static void onDisconnect(void* context, MQTTAsync_successData* response); }; /** Node implementation using MQTT for communication. */ class OBNNodeMQTT: public OBNNode { public: /** \brief Construct an MQTT node with a given port. Construct a MQTT node with a given name and number of output groups, associated with an MQTTClient object. \param _name The name of the node. \param t_nUpdates The number of computating tasks/update types. \param t_topic The topic of the GC port of this node, typically of the form "workspace_name/node_name/_gc_". \param t_client Pointer to the MQTTClient. The port is only used for sending messages out. */ OBNNodeMQTT(const std::string& _name, int t_nUpdates, const std::string &t_topic, MQTTClient* t_client): OBNNode(_name, t_nUpdates), m_topic(t_topic), m_client(t_client) { assert(t_client); assert(!t_topic.empty()); } virtual ~OBNNodeMQTT() { if (m_buffer) { delete [] m_buffer; } } /** Make sure that the buffer (for sending messages) has at least newsize bytes. */ void allocateBuffer(size_t newsize); /** \brief Asynchronously send a message to a node. */ virtual bool sendMessage(int nodeID, OBNSimMsg::SMN2N &msg) override; /* \brief Synchronously send a message to a node. */ // virtual bool sendMessageSync(int nodeID, OBNSimMsg::SMN2N &msg); private: /** The MQTT topic that this node will send to. */ std::string m_topic; /** \brief MQTTClient object with which this node is associated, for sending messages to node. */ MQTTClient *m_client; // The buffer for sending messages char* m_buffer = nullptr; // Allocated size of the buffer size_t m_buffer_allocsize = 0; }; } } #endif // OBNSIM_COMM_MQTT_H
40.59596
157
0.550386
[ "object" ]
860991c7ed9626faeab9dae439a1ccff0fe06e37
992
h
C
Source/Engine/Source/ING/Math/Float/F4IJK.h
vinoxphucs/ING
cb0123847fb225b65bb5cddb1e4456cd562fd43e
[ "MIT" ]
1
2022-03-01T07:30:58.000Z
2022-03-01T07:30:58.000Z
Source/Engine/Source/ING/Math/Float/F4IJK.h
vinoxphucs/ING
cb0123847fb225b65bb5cddb1e4456cd562fd43e
[ "MIT" ]
null
null
null
Source/Engine/Source/ING/Math/Float/F4IJK.h
vinoxphucs/ING
cb0123847fb225b65bb5cddb1e4456cd562fd43e
[ "MIT" ]
null
null
null
#pragma once /** * Include Entry Point */ #include <ING/EntryPoint/EntryPoint.h> /** * Include Utils */ #include <ING/Utils/Utils.h> using namespace ING::Utils; /** * Include Vector */ #include <ING/Math/Vector/Vector.h> /** * Include Matrix */ #include <ING/Math/Matrix/Matrix.h> namespace ING { namespace Math { struct Matrix2x4; struct Matrix2x3; struct Matrix2x2; struct Matrix3x4; struct Matrix3x3; struct Matrix3x2; struct Matrix4x4; struct Matrix4x3; struct Matrix4x2; struct CVector2; struct CVector4; struct CVector4; struct Vector2; struct Vector3; struct Vector4; struct ING_API F4IJK { /** * Constructors And Destructor */ public: F4IJK (Vector4 v); F4IJK (Vector3 v); F4IJK (Vector2 v); F4IJK (float v); F4IJK (); ~F4IJK (); /** * Properties */ public: float factors[4]; /** * Operators */ public: F4IJK operator*(F4IJK next); }; } }
10.226804
38
0.613911
[ "vector" ]
860a898e06440724663e0114088ccbe643781573
1,425
h
C
RecoTauTag/RecoTau/interface/PFRecoTauTagInfoAlgorithm.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
RecoTauTag/RecoTau/interface/PFRecoTauTagInfoAlgorithm.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
RecoTauTag/RecoTau/interface/PFRecoTauTagInfoAlgorithm.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
#ifndef RecoTauTag_RecoTau_PFRecoTauTagInfoAlgorithm_H #define RecoTauTag_RecoTau_PFRecoTauTagInfoAlgorithm_H #include "DataFormats/TauReco/interface/PFTauTagInfo.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/ParticleFlowReco/interface/PFBlock.h" #include "DataFormats/ParticleFlowReco/interface/PFBlockElement.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "Math/GenVector/VectorUtil.h" class PFRecoTauTagInfoAlgorithm { public: PFRecoTauTagInfoAlgorithm() {} PFRecoTauTagInfoAlgorithm(const edm::ParameterSet&); ~PFRecoTauTagInfoAlgorithm() {} reco::PFTauTagInfo buildPFTauTagInfo(const reco::JetBaseRef&, const std::vector<reco::CandidatePtr>&, const reco::TrackRefVector&, const reco::Vertex&) const; private: double ChargedHadrCand_tkminPt_; int ChargedHadrCand_tkminPixelHitsn_; int ChargedHadrCand_tkminTrackerHitsn_; double ChargedHadrCand_tkmaxipt_; double ChargedHadrCand_tkmaxChi2_; double ChargedHadrCand_tkPVmaxDZ_; // double NeutrHadrCand_HcalclusMinEt_; // double GammaCand_EcalclusMinEt_; double ChargedHadronsAssociationCone_; // double tkminPt_; int tkminPixelHitsn_; int tkminTrackerHitsn_; double tkmaxipt_; double tkmaxChi2_; double tkPVmaxDZ_; // bool UsePVconstraint_; }; #endif
30.978261
78
0.749474
[ "vector" ]
861051619788981a18e9efed91a00c982386dd5f
3,626
h
C
Libraries/Include/og/Math/Random.h
Playermet/open-game-libraries
924ee63147de36faffa50d30c18ff04802c47748
[ "Zlib" ]
4
2015-01-01T11:29:38.000Z
2016-04-28T03:35:44.000Z
Libraries/Include/og/Math/Random.h
ensiform/open-game-libraries
265c0d13198bd1910fe3c253b4ac04d55016b73f
[ "Zlib" ]
null
null
null
Libraries/Include/og/Math/Random.h
ensiform/open-game-libraries
265c0d13198bd1910fe3c253b4ac04d55016b73f
[ "Zlib" ]
null
null
null
/* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) */ #ifndef __OG_RANDOM_H__ #define __OG_RANDOM_H__ namespace og { /* ============================================================================== Random ============================================================================== */ class Random { public: Random() { storedSeed = 0; mti=N+1; }; Random( uLong seed ); void SetSeed( uLong seed = 0 ); void SeedTime( void ); // Sets the seed at ostime of calling function uLong GetSeed( void ) const; //! @todo what about negative ones ? uLong RandomULong( void ); // random uLong in the range [0,0xffffffff] int RandomInt( void ); // random integer in the range [0,0xffffffff] int RandomInt( int min, int max ); // random integer in the range [min, max] bool RandomBool( void ); // random boolean value [false, true] float RandomFloat( void ); // random number in the range [0.0f, 1.0f] float RandomFloat( float min, float max );// random number in the range [0.0f, 1.0f] float SymmetricRandom( void ); // random number in the range [-1.0f, 1.0f] private: // Period parameters static const int N = 624; static const int M = 397; static const uLong MATRIX_A = 0x9908b0dfUL; // constant vector a static const uLong UPPER_MASK = 0x80000000UL; // most significant w-r bits static const uLong LOWER_MASK = 0x7fffffffUL; // least significant r bits uLong mt[N]; // the array for the state vector int mti; // mti==N+1 means mt[N] is not initialized uLong storedSeed; }; } #endif
41.204545
90
0.660232
[ "vector" ]
8613dd6705be589e39ac490379a9d7a52809cfc4
52,263
h
C
gps/gps_hal/inc/hal_mnl_interface_common.h
Huawei-mt6737/device
baec9804cf904c17d2abd45a1ecddde384ec22b7
[ "FTL" ]
2
2018-12-24T09:37:43.000Z
2019-09-22T13:55:54.000Z
gps/gps_hal/inc/hal_mnl_interface_common.h
Huawei-mt6737/device
baec9804cf904c17d2abd45a1ecddde384ec22b7
[ "FTL" ]
null
null
null
gps/gps_hal/inc/hal_mnl_interface_common.h
Huawei-mt6737/device
baec9804cf904c17d2abd45a1ecddde384ec22b7
[ "FTL" ]
8
2017-07-05T17:09:28.000Z
2019-03-04T09:37:45.000Z
#ifndef __HAL_MNL_INTERFACE_COMMON_H__ #define __HAL_MNL_INTERFACE_COMMON_H__ #include <stdint.h> #include <stdbool.h> #include <time.h> #include <sys/socket.h> #ifdef __cplusplus extern "C" { #endif #define HAL_MNL_BUFF_SIZE (16 * 1024) #define HAL_MNL_INTERFACE_VERSION 1 //====================================================== // GPS HAL -> MNLD //====================================================== #define MTK_HAL2MNL "mtk_hal2mnl" typedef enum { HAL2MNL_HAL_REBOOT = 0, HAL2MNL_GPS_INIT = 101, HAL2MNL_GPS_START = 102, HAL2MNL_GPS_STOP = 103, HAL2MNL_GPS_CLEANUP = 104, HAL2MNL_GPS_INJECT_TIME = 105, HAL2MNL_GPS_INJECT_LOCATION = 106, HAL2MNL_GPS_DELETE_AIDING_DATA = 107, HAL2MNL_GPS_SET_POSITION_MODE = 108, HAL2MNL_DATA_CONN_OPEN = 201, HAL2MNL_DATA_CONN_OPEN_WITH_APN_IP_TYPE = 202, HAL2MNL_DATA_CONN_CLOSED = 203, HAL2MNL_DATA_CONN_FAILED = 204, HAL2MNL_SET_SERVER = 301, HAL2MNL_SET_REF_LOCATION = 302, HAL2MNL_SET_ID = 303, HAL2MNL_NI_MESSAGE = 401, HAL2MNL_NI_RESPOND = 402, HAL2MNL_UPDATE_NETWORK_STATE = 501, HAL2MNL_UPDATE_NETWORK_AVAILABILITY = 502, HAL2MNL_GPS_MEASUREMENT = 601, HAL2MNL_GPS_NAVIGATION = 602, } hal2mnl_cmd; typedef int gps_pos_mode; #define GPS_POS_MODE_STANDALONE 0 #define GPS_POS_MODE_MSB 1 typedef int gps_pos_recurrence; #define GPS_POS_RECURRENCE_PERIODIC 0 #define GPS_POS_RECURRENCE_SINGLE 1 typedef int ni_user_response_type; #define NI_USER_RESPONSE_ACCEPT 1 #define NI_USER_RESPONSE_DENY 2 #define NI_USER_RESPONSE_NORESP 3 typedef int cell_type; #define CELL_TYPE_GSM 1 #define CELL_TYPE_UMTS 2 typedef int agps_id_type; #define AGPS_ID_TYPE_NONE 0 #define AGPS_ID_TYPE_IMSI 1 #define AGPS_ID_TYPE_MSISDN 2 typedef int network_type; #define NETWORK_TYPE_MOBILE 0 #define NETWORK_TYPE_WIFI 1 #define NETWORK_TYPE_MOBILE_MMS 2 #define NETWORK_TYPE_MOBILE_SUPL 3 #define NETWORK_TYPE_MOBILE_DUN 4 #define NETWORK_TYPE_MOBILE_HIPRI 5 #define NETWORK_TYPE_WIMAX 6 typedef int apn_ip_type; #define APN_IP_INVALID 0 #define APN_IP_IPV4 1 #define APN_IP_IPV6 2 #define APN_IP_IPV4V6 3 typedef int agps_type; #define AGPS_TYPE_SUPL 1 #define AGPS_TYPE_C2K 2 //====================================================== // MNLD -> GPS HAL //====================================================== #define MTK_MNL2HAL "mtk_mnl2hal" typedef enum { MNL2HAL_MNLD_REBOOT = 1, MNL2HAL_LOCATION = 101, MNL2HAL_GPS_STATUS = 102, MNL2HAL_GPS_SV = 103, MNL2HAL_NMEA = 104, MNL2HAL_GPS_CAPABILITIES = 105, MNL2HAL_GPS_MEASUREMENTS = 106, MNL2HAL_GPS_NAVIGATION = 107, MNL2HAL_GNSS_MEASUREMENTS = 108, MNL2HAL_GNSS_NAVIGATION = 109, MNL2HAL_REQUEST_WAKELOCK = 201, MNL2HAL_RELEASE_WAKELOCK = 202, MNL2HAL_REQUEST_UTC_TIME = 301, MNL2HAL_REQUEST_DATA_CONN = 302, MNL2HAL_RELEASE_DATA_CONN = 303, MNL2HAL_REQUEST_NI_NOTIFY = 304, MNL2HAL_REQUEST_SET_ID = 305, MNL2HAL_REQUEST_REF_LOC = 306, } mnl2hal_cmd; #define GNSS_MAX_SVS 64 #define GPS_MAX_MEASUREMENT 32 #define GNSS_MAX_MEASUREMENT 64 typedef int gps_location_flags; #define GPS_LOCATION_HAS_LAT_LONG 0x0001 #define GPS_LOCATION_HAS_ALT 0x0002 #define GPS_LOCATION_HAS_SPEED 0x0004 #define GPS_LOCATION_HAS_BEARING 0x0008 #define GPS_LOCATION_HAS_ACCURACY 0x0010 typedef int gps_capabilites; #define GPS_CAP_SCHEDULING 0x0000001 #define GPS_CAP_MSB 0x0000002 #define GPS_CAP_MSA 0x0000004 #define GPS_CAP_SINGLE_SHOT 0x0000008 #define GPS_CAP_ON_DEMAND_TIME 0x0000010 #define GPS_CAP_GEOFENCING 0x0000020 #define GPS_CAP_MEASUREMENTS 0x0000040 #define GPS_CAP_NAV_MESSAGES 0x0000080 typedef int request_setid; #define REQUEST_SETID_IMSI (1<<0L) #define REQUEST_SETID_MSISDN (1<<1L) typedef int request_refloc; #define REQUEST_REFLOC_CELLID (1<<0L) #define REQUEST_REFLOC_MAC (1<<1L) // not ready typedef short gps_clock_flags; #define GPS_CLK_HAS_LEAP_SECOND (1<<0) #define GPS_CLK_HAS_TIME_UNCERTAINTY (1<<1) #define GPS_CLK_HAS_FULL_BIAS (1<<2) #define GPS_CLK_HAS_BIAS (1<<3) #define GPS_CLK_HAS_BIAS_UNCERTAINTY (1<<4) #define GPS_CLK_HAS_DRIFT (1<<5) #define GPS_CLK_HAS_DRIFT_UNCERTAINTY (1<<6) typedef char gps_clock_type; #define GPS_CLOCK_TYPE_UNKNOWN 0 #define GPS_CLOCK_TYPE_LOCAL_HW_TIME 1 #define GPS_CLOCK_TYPE_GPS_TIME 2 typedef int gps_measurement_flags; #define GPS_MEASUREMENT_HAS_SNR (1<<0) #define GPS_MEASUREMENT_HAS_ELEVATION (1<<1) #define GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY (1<<2) #define GPS_MEASUREMENT_HAS_AZIMUTH (1<<3) #define GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY (1<<4) #define GPS_MEASUREMENT_HAS_PSEUDORANGE (1<<5) #define GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY (1<<6) #define GPS_MEASUREMENT_HAS_CODE_PHASE (1<<7) #define GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY (1<<8) #define GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9) #define GPS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10) #define GPS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11) #define GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12) #define GPS_MEASUREMENT_HAS_BIT_NUMBER (1<<13) #define GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT (1<<14) #define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT (1<<15) #define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY (1<<16) #define GPS_MEASUREMENT_HAS_USED_IN_FIX (1<<17) typedef short gps_measurement_state; #define GPS_MEASUREMENT_STATE_UNKNOWN 0 #define GPS_MEASUREMENT_STATE_CODE_LOCK (1<<0) #define GPS_MEASUREMENT_STATE_BIT_SYNC (1<<1) #define GPS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2) #define GPS_MEASUREMENT_STATE_TOW_DECODED (1<<3) #define GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4) typedef short gps_accumulated_delta_range_state; #define GPS_ADR_STATE_UNKNOWN 0 #define GPS_ADR_STATE_VALID (1<<0) #define GPS_ADR_STATE_RESET (1<<1) #define GPS_ADR_STATE_CYCLE_SLIP (1<<2) typedef char gps_loss_of_lock; #define GPS_LOSS_OF_LOCK_UNKNOWN 0 #define GPS_LOSS_OF_LOCK_OK 1 #define GPS_LOSS_OF_LOCK_CYCLE_SLIP 2 typedef char gps_multipath_indicator; #define GPS_MULTIPATH_INDICATOR_UNKNOWN 0 #define GPS_MULTIPATH_INDICATOR_DETECTED 1 #define GPS_MULTIPATH_INDICATOR_NOT_USED 2 typedef char gps_nav_msg_type; #define GPS_NAV_MSG_TYPE_UNKNOWN 0 #define GPS_NAV_MSG_TYPE_L1CA 1 #define GPS_NAV_MSG_TYPE_L2CNAV 2 #define GPS_NAV_MSG_TYPE_L5CNAV 3 #define GPS_NAV_MSG_TYPE_CNAV2 4 typedef short nav_msg_status; #define NAV_MSG_STATUS_UNKONW 0 #define NAV_MSG_STATUS_PARITY_PASSED (1<<0) #define NAV_MSG_STATUS_PARITY_REBUILT (1<<1) typedef int gps_status; #define GPS_STATUS_SESSION_BEGIN 1 #define GPS_STATUS_SESSION_END 2 #define GPS_STATUS_SESSION_ENGINE_ON 3 #define GPS_STATUS_SESSION_ENGINE_OFF 4 typedef int agps_notify_type; #define AGPS_NOTIFY_TYPE_NONE 0 #define AGPS_NOTIFY_TYPE_NOTIFY_ONLY 1 #define AGPS_NOTIFY_TYPE_NOTIFY_ALLOW_NO_ANSWER 2 #define AGPS_NOTIFY_TYPE_NOTIFY_DENY_NO_ANSWER 3 #define AGPS_NOTIFY_TYPE_PRIVACY 4 typedef int ni_encoding_type; #define NI_ENCODING_TYPE_NONE 0 #define NI_ENCODING_TYPE_GSM7 1 #define NI_ENCODING_TYPE_UTF8 2 #define NI_ENCODING_TYPE_UCS2 3 typedef struct { gps_location_flags flags; double lat; double lng; double alt; float speed; float bearing; float accuracy; int64_t timestamp; } gps_location; typedef struct { int16_t svid; uint8_t constellation; float c_n0_dbhz; float elevation; float azimuth; uint8_t flags; } gnss_sv; typedef struct { int num_svs; gnss_sv sv_list[GNSS_MAX_SVS]; } gnss_sv_info; typedef struct { int prn; bool used_in_fix; } NmeaGSACash; typedef uint16_t NavigationMessageStatus; #define NAV_MESSAGE_STATUS_UNKNOWN 0 #define NAV_MESSAGE_STATUS_PARITY_PASSED (1<<0) #define NAV_MESSAGE_STATUS_PARITY_REBUILT (1<<1) typedef int16_t GnssNavigationMessageType; #define GNSS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0 /** GPS L1 C/A message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L1CA 0x0101 /** GPS L2-CNAV message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L2CNAV 0x0102 /** GPS L5-CNAV message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L5CNAV 0x0103 /** GPS CNAV-2 message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_CNAV2 0x0104 /** Glonass L1 CA message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_GLO_L1CA 0x0301 /** Beidou D1 message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D1 0x0501 /** Beidou D2 message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D2 0x0502 /** Galileo I/NAV message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_GAL_I 0x0601 /** Galileo F/NAV message contained in the structure. */ #define GNSS_NAVIGATION_MESSAGE_TYPE_GAL_F 0x0602 typedef uint8_t GnssMultipathIndicator; /** The indicator is not available or unknown. */ #define GNSS_MULTIPATH_INDICATOR_UNKNOWN 0 /** The measurement is indicated to be affected by multipath. */ #define GNSS_MULTIPATH_INDICATOR_PRESENT 1 /** The measurement is indicated to be not affected by multipath. */ #define GNSS_MULTIPATH_INDICATOR_NOT_PRESENT 2 typedef uint16_t GnssAccumulatedDeltaRangeState; #define GNSS_ADR_STATE_UNKNOWN 0 #define GNSS_ADR_STATE_VALID (1<<0) #define GNSS_ADR_STATE_RESET (1<<1) #define GNSS_ADR_STATE_CYCLE_SLIP (1<<2) typedef uint32_t GnssMeasurementState; #define GNSS_MEASUREMENT_STATE_UNKNOWN 0 #define GNSS_MEASUREMENT_STATE_CODE_LOCK (1<<0) #define GNSS_MEASUREMENT_STATE_BIT_SYNC (1<<1) #define GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2) #define GNSS_MEASUREMENT_STATE_TOW_DECODED (1<<3) #define GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4) #define GNSS_MEASUREMENT_STATE_SYMBOL_SYNC (1<<5) #define GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC (1<<6) #define GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED (1<<7) #define GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC (1<<8) #define GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC (1<<9) #define GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK (1<<10) #define GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK (1<<11) #define GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC (1<<12) #define GNSS_MEASUREMENT_STATE_SBAS_SYNC (1<<13) typedef uint8_t GnssConstellationType; #define GNSS_CONSTELLATION_UNKNOWN 0 #define GNSS_CONSTELLATION_GPS 1 #define GNSS_CONSTELLATION_SBAS 2 #define GNSS_CONSTELLATION_GLONASS 3 #define GNSS_CONSTELLATION_QZSS 4 #define GNSS_CONSTELLATION_BEIDOU 5 #define GNSS_CONSTELLATION_GALILEO 6 typedef uint32_t GnssMeasurementFlags; /** A valid 'snr' is stored in the data structure. */ #define GNSS_MEASUREMENT_HAS_SNR (1<<0) /** A valid 'carrier frequency' is stored in the data structure. */ #define GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9) /** A valid 'carrier cycles' is stored in the data structure. */ #define GNSS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10) /** A valid 'carrier phase' is stored in the data structure. */ #define GNSS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11) /** A valid 'carrier phase uncertainty' is stored in the data structure. */ #define GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12) typedef uint16_t GnssClockFlags; /** A valid 'leap second' is stored in the data structure. */ #define GNSS_CLOCK_HAS_LEAP_SECOND (1<<0) /** A valid 'time uncertainty' is stored in the data structure. */ #define GNSS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1) /** A valid 'full bias' is stored in the data structure. */ #define GNSS_CLOCK_HAS_FULL_BIAS (1<<2) /** A valid 'bias' is stored in the data structure. */ #define GNSS_CLOCK_HAS_BIAS (1<<3) /** A valid 'bias uncertainty' is stored in the data structure. */ #define GNSS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4) /** A valid 'drift' is stored in the data structure. */ #define GNSS_CLOCK_HAS_DRIFT (1<<5) /** A valid 'drift uncertainty' is stored in the data structure. */ #define GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6) typedef struct { /** A set of flags indicating the validity of the fields in this data structure. */ gps_clock_flags flags; /** * Leap second data. * The sign of the value is defined by the following equation: * utc_time_ns = time_ns + (full_bias_ns + bias_ns) - leap_second * 1,000,000,000 * * If the data is available 'flags' must contain GPS_CLOCK_HAS_LEAP_SECOND. */ short leap_second; /** * Indicates the type of time reported by the 'time_ns' field. */ gps_clock_type type; /** * The GPS receiver internal clock value. This can be either the local hardware clock value * (GPS_CLOCK_TYPE_LOCAL_HW_TIME), or the current GPS time derived inside GPS receiver * (GPS_CLOCK_TYPE_GPS_TIME). The field 'type' defines the time reported. * * For local hardware clock, this value is expected to be monotonically increasing during * the reporting session. The real GPS time can be derived by compensating the 'full bias' * (when it is available) from this value. * * For GPS time, this value is expected to be the best estimation of current GPS time that GPS * receiver can achieve. Set the 'time uncertainty' appropriately when GPS time is specified. * * Sub-nanosecond accuracy can be provided by means of the 'bias' field. * The value contains the 'time uncertainty' in it. */ int64_t time_ns; /** * 1-Sigma uncertainty associated with the clock's time in nanoseconds. * The uncertainty is represented as an absolute (single sided) value. * * This value should be set if GPS_CLOCK_TYPE_GPS_TIME is set. * If the data is available 'flags' must contain GPS_CLOCK_HAS_TIME_UNCERTAINTY. */ double time_uncertainty_ns; /** * The difference between hardware clock ('time' field) inside GPS receiver and the true GPS * time since 0000Z, January 6, 1980, in nanoseconds. * This value is used if and only if GPS_CLOCK_TYPE_LOCAL_HW_TIME is set, and GPS receiver * has solved the clock for GPS time. * The caller is responsible for using the 'bias uncertainty' field for quality check. * * The sign of the value is defined by the following equation: * true time (GPS time) = time_ns + (full_bias_ns + bias_ns) * * This value contains the 'bias uncertainty' in it. * If the data is available 'flags' must contain GPS_CLOCK_HAS_FULL_BIAS. */ int64_t full_bias_ns; /** * Sub-nanosecond bias. * The value contains the 'bias uncertainty' in it. * * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS. */ double bias_ns; /** * 1-Sigma uncertainty associated with the clock's bias in nanoseconds. * The uncertainty is represented as an absolute (single sided) value. * * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS_UNCERTAINTY. */ double bias_uncertainty_ns; /** * The clock's drift in nanoseconds (per second). * A positive value means that the frequency is higher than the nominal frequency. * * The value contains the 'drift uncertainty' in it. * If the data is available 'flags' must contain GPS_CLOCK_HAS_DRIFT. * * If GpsMeasurement's 'flags' field contains GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE, * it is encouraged that this field is also provided. */ double drift_nsps; /** * 1-Sigma uncertainty associated with the clock's drift in nanoseconds (per second). * The uncertainty is represented as an absolute (single sided) value. * * If the data is available 'flags' must contain GPS_CLOCK_HAS_DRIFT_UNCERTAINTY. */ double drift_uncertainty_nsps; } gps_clock; /** * Represents an estimate of the GPS clock time. */ typedef struct { /** * A set of flags indicating the validity of the fields in this data * structure. */ GnssClockFlags flags; /** * Leap second data. * The sign of the value is defined by the following equation: * utc_time_ns = time_ns - (full_bias_ns + bias_ns) - leap_second * * 1,000,000,000 * * If the data is available 'flags' must contain GNSS_CLOCK_HAS_LEAP_SECOND. */ int16_t leap_second; /** * The GNSS receiver internal clock value. This is the local hardware clock * value. * * For local hardware clock, this value is expected to be monotonically * increasing while the hardware clock remains power on. (For the case of a * HW clock that is not continuously on, see the * hw_clock_discontinuity_count field). The receiver's estimate of GPS time * can be derived by substracting the sum of full_bias_ns and bias_ns (when * available) from this value. * * This GPS time is expected to be the best estimate of current GPS time * that GNSS receiver can achieve. * * Sub-nanosecond accuracy can be provided by means of the 'bias_ns' field. * The value contains the 'time uncertainty' in it. * * This field is mandatory. */ int64_t time_ns; /** * 1-Sigma uncertainty associated with the clock's time in nanoseconds. * The uncertainty is represented as an absolute (single sided) value. * * If the data is available, 'flags' must contain * GNSS_CLOCK_HAS_TIME_UNCERTAINTY. This value is effectively zero (it is * the reference local clock, by which all other times and time * uncertainties are measured.) (And thus this field can be not provided, * per GNSS_CLOCK_HAS_TIME_UNCERTAINTY flag, or provided & set to 0.) */ double time_uncertainty_ns; /** * The difference between hardware clock ('time' field) inside GPS receiver * and the true GPS time since 0000Z, January 6, 1980, in nanoseconds. * * The sign of the value is defined by the following equation: * local estimate of GPS time = time_ns - (full_bias_ns + bias_ns) * * This value is mandatory if the receiver has estimated GPS time. If the * computed time is for a non-GPS constellation, the time offset of that * constellation to GPS has to be applied to fill this value. The error * estimate for the sum of this and the bias_ns is the bias_uncertainty_ns, * and the caller is responsible for using this uncertainty (it can be very * large before the GPS time has been solved for.) If the data is available * 'flags' must contain GNSS_CLOCK_HAS_FULL_BIAS. */ int64_t full_bias_ns; /** * Sub-nanosecond bias. * The error estimate for the sum of this and the full_bias_ns is the * bias_uncertainty_ns * * If the data is available 'flags' must contain GNSS_CLOCK_HAS_BIAS. If GPS * has computed a position fix. This value is mandatory if the receiver has * estimated GPS time. */ double bias_ns; /** * 1-Sigma uncertainty associated with the local estimate of GPS time (clock * bias) in nanoseconds. The uncertainty is represented as an absolute * (single sided) value. * * If the data is available 'flags' must contain * GNSS_CLOCK_HAS_BIAS_UNCERTAINTY. This value is mandatory if the receiver * has estimated GPS time. */ double bias_uncertainty_ns; /** * The clock's drift in nanoseconds (per second). * * A positive value means that the frequency is higher than the nominal * frequency, and that the (full_bias_ns + bias_ns) is growing more positive * over time. * * The value contains the 'drift uncertainty' in it. * If the data is available 'flags' must contain GNSS_CLOCK_HAS_DRIFT. * * This value is mandatory if the receiver has estimated GNSS time */ double drift_nsps; /** * 1-Sigma uncertainty associated with the clock's drift in nanoseconds (per second). * The uncertainty is represented as an absolute (single sided) value. * * If the data is available 'flags' must contain * GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY. If GPS has computed a position fix this * field is mandatory and must be populated. */ double drift_uncertainty_nsps; /** * When there are any discontinuities in the HW clock, this field is * mandatory. * * A "discontinuity" is meant to cover the case of a switch from one source * of clock to another. A single free-running crystal oscillator (XO) * should generally not have any discontinuities, and this can be set and * left at 0. * * If, however, the time_ns value (HW clock) is derived from a composite of * sources, that is not as smooth as a typical XO, or is otherwise stopped & * restarted, then this value shall be incremented each time a discontinuity * occurs. (E.g. this value may start at zero at device boot-up and * increment each time there is a change in clock continuity. In the * unlikely event that this value reaches full scale, rollover (not * clamping) is required, such that this value continues to change, during * subsequent discontinuity events.) * * While this number stays the same, between GnssClock reports, it can be * safely assumed that the time_ns value has been running continuously, e.g. * derived from a single, high quality clock (XO like, or better, that's * typically used during continuous GNSS signal sampling.) * * It is expected, esp. during periods where there are few GNSS signals * available, that the HW clock be discontinuity-free as long as possible, * as this avoids the need to use (waste) a GNSS measurement to fully * re-solve for the GPS clock bias and drift, when using the accompanying * measurements, from consecutive GnssData reports. */ uint32_t hw_clock_discontinuity_count; } gnss_clock; typedef struct { /** A set of flags indicating the validity of the fields in this data structure. */ gps_measurement_flags flags; /** * Pseudo-random number in the range of [1, 32] * This is a Mandatory value. */ int8_t prn; /** * Time offset at which the measurement was taken in nanoseconds. * The reference receiver's time is specified by GpsData::clock::time_ns and should be * interpreted in the same way as indicated by GpsClock::type. * * The sign of time_offset_ns is given by the following equation: * measurement time = GpsClock::time_ns + time_offset_ns * * It provides an individual time-stamp for the measurement, and allows sub-nanosecond accuracy. * This is a Mandatory value. */ double time_offset_ns; /** * Per satellite sync state. It represents the current sync state for the associated satellite. * Based on the sync state, the 'received GPS tow' field should be interpreted accordingly. * This is a Mandatory value. */ gps_measurement_state state; /** * Received GPS Time-of-Week at the measurement time, in nanoseconds. * The value is relative to the beginning of the current GPS week. * * Given the highest sync state that can be achieved, per each satellite, valid range for * this field can be: * Searching : [ 0 ] : GPS_MEASUREMENT_STATE_UNKNOWN * C/A code lock : [ 0 1ms ] : GPS_MEASUREMENT_STATE_CODE_LOCK is set * Bit sync : [ 0 20ms ] : GPS_MEASUREMENT_STATE_BIT_SYNC is set * Subframe sync : [ 0 6s ] : GPS_MEASUREMENT_STATE_SUBFRAME_SYNC is set * TOW decoded : [ 0 1week ] : GPS_MEASUREMENT_STATE_TOW_DECODED is set * * However, if there is any ambiguity in integer millisecond, * GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field. * This value must be populated if 'state' != GPS_MEASUREMENT_STATE_UNKNOWN. */ int64_t received_gps_tow_ns; /** * 1-Sigma uncertainty of the Received GPS Time-of-Week in nanoseconds. * This value must be populated if 'state' != GPS_MEASUREMENT_STATE_UNKNOWN. */ int64_t received_gps_tow_uncertainty_ns; /** * Carrier-to-noise density in dB-Hz, in the range [0, 63]. * It contains the measured C/N0 value for the signal at the antenna input. * This is a Mandatory value. */ double c_n0_dbhz; /** * Pseudorange rate at the timestamp in m/s. * The value also includes the effects of the receiver clock frequency and satellite clock * frequency errors. * * The value includes the 'pseudorange rate uncertainty' in it. * A positive value indicates that the pseudorange is getting larger. * This is a Mandatory value. */ double pseudorange_rate_mps; /** * 1-Sigma uncertainty of the pseudurange rate in m/s. * The uncertainty is represented as an absolute (single sided) value. * This is a Mandatory value. */ double pseudorange_rate_uncertainty_mps; /** * Accumulated delta range's state. It indicates whether ADR is reset or there is a cycle slip * (indicating loss of lock). * This is a Mandatory value. */ gps_accumulated_delta_range_state accumulated_delta_range_state; /** * Accumulated delta range since the last channel reset in meters. * A positive value indicates that the SV is moving away from the receiver. * * The sign of the 'accumulated delta range' and its relation to the sign of 'carrier phase' * is given by the equation: * accumulated delta range = -k * carrier phase (where k is a constant) * * This value must be populated if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. * However, it is expected that the data is only accurate when: * 'accumulated delta range state' == GPS_ADR_STATE_VALID. */ double accumulated_delta_range_m; /** * 1-Sigma uncertainty of the accumulated delta range in meters. * The data is available if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. */ double accumulated_delta_range_uncertainty_m; /** * Best derived Pseudorange by the chip-set, in meters. * The value contains the 'pseudorange uncertainty' in it. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_PSEUDORANGE. */ double pseudorange_m; /** * 1-Sigma uncertainty of the pseudorange in meters. * The value contains the 'pseudorange' and 'clock' uncertainty in it. * The uncertainty is represented as an absolute (single sided) value. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY. */ double pseudorange_uncertainty_m; /** * A fraction of the current C/A code cycle, in the range [0.0, 1023.0] * This value contains the time (in Chip units) since the last C/A code cycle (GPS Msec epoch). * * The reference frequency is given by the field 'carrier_frequency_hz'. * The value contains the 'code-phase uncertainty' in it. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CODE_PHASE. */ double code_phase_chips; /** * 1-Sigma uncertainty of the code-phase, in a fraction of chips. * The uncertainty is represented as an absolute (single sided) value. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY. */ double code_phase_uncertainty_chips; /** * Carrier frequency at which codes and messages are modulated, it can be L1 or L2. * If the field is not set, the carrier frequency is assumed to be L1. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY. */ float carrier_frequency_hz; /** * The number of full carrier cycles between the satellite and the receiver. * The reference frequency is given by the field 'carrier_frequency_hz'. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_CYCLES. */ int64_t carrier_cycles; /** * The RF phase detected by the receiver, in the range [0.0, 1.0]. * This is usually the fractional part of the complete carrier phase measurement. * * The reference frequency is given by the field 'carrier_frequency_hz'. * The value contains the 'carrier-phase uncertainty' in it. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_PHASE. */ double carrier_phase; /** * 1-Sigma uncertainty of the carrier-phase. * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY. */ double carrier_phase_uncertainty; /** * An enumeration that indicates the 'loss of lock' state of the event. */ gps_loss_of_lock loss_of_lock; /** * The number of GPS bits transmitted since Sat-Sun midnight (GPS week). * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_BIT_NUMBER. */ int32_t bit_number; /** * The elapsed time since the last received bit in milliseconds, in the range [0, 20] * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT. */ int16_t time_from_last_bit_ms; /** * Doppler shift in Hz. * A positive value indicates that the SV is moving toward the receiver. * * The reference frequency is given by the field 'carrier_frequency_hz'. * The value contains the 'doppler shift uncertainty' in it. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_DOPPLER_SHIFT. */ double doppler_shift_hz; /** * 1-Sigma uncertainty of the doppler shift in Hz. * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY. */ double doppler_shift_uncertainty_hz; /** * An enumeration that indicates the 'multipath' state of the event. */ gps_multipath_indicator multipath_indicator; /** * Signal-to-noise ratio in dB. * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_SNR. */ double snr_db; /** * Elevation in degrees, the valid range is [-90, 90]. * The value contains the 'elevation uncertainty' in it. * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_ELEVATION. */ double elevation_deg; /** * 1-Sigma uncertainty of the elevation in degrees, the valid range is [0, 90]. * The uncertainty is represented as the absolute (single sided) value. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY. */ double elevation_uncertainty_deg; /** * Azimuth in degrees, in the range [0, 360). * The value contains the 'azimuth uncertainty' in it. * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_AZIMUTH. * */ double azimuth_deg; /** * 1-Sigma uncertainty of the azimuth in degrees, the valid range is [0, 180]. * The uncertainty is represented as an absolute (single sided) value. * * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY. */ double azimuth_uncertainty_deg; /** * Whether the GPS represented by the measurement was used for computing the most recent fix. * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_USED_IN_FIX. */ bool used_in_fix; } gps_measurement; /** * Represents a GNSS Measurement, it contains raw and computed information. * * Independence - All signal measurement information (e.g. sv_time, * pseudorange_rate, multipath_indicator) reported in this struct should be * based on GNSS signal measurements only. You may not synthesize measurements * by calculating or reporting expected measurements based on known or estimated * position, velocity, or time. */ typedef struct { /** A set of flags indicating the validity of the fields in this data structure. */ GnssMeasurementFlags flags; /** * Satellite vehicle ID number, as defined in GnssSvInfo::svid * This is a mandatory value. */ int16_t svid; /** * Defines the constellation of the given SV. Value should be one of those * GNSS_CONSTELLATION_* constants */ GnssConstellationType constellation; /** * Time offset at which the measurement was taken in nanoseconds. * The reference receiver's time is specified by GpsData::clock::time_ns and should be * interpreted in the same way as indicated by GpsClock::type. * * The sign of time_offset_ns is given by the following equation: * measurement time = GpsClock::time_ns + time_offset_ns * * It provides an individual time-stamp for the measurement, and allows sub-nanosecond accuracy. * This is a mandatory value. */ double time_offset_ns; /** * Per satellite sync state. It represents the current sync state for the associated satellite. * Based on the sync state, the 'received GPS tow' field should be interpreted accordingly. * * This is a mandatory value. */ GnssMeasurementState state; /** * The received GNSS Time-of-Week at the measurement time, in nanoseconds. * Ensure that this field is independent (see comment at top of * GnssMeasurement struct.) * * For GPS & QZSS, this is: * Received GPS Time-of-Week at the measurement time, in nanoseconds. * The value is relative to the beginning of the current GPS week. * * Given the highest sync state that can be achieved, per each satellite, valid range * for this field can be: * Searching : [ 0 ] : GNSS_MEASUREMENT_STATE_UNKNOWN * C/A code lock : [ 0 1ms ] : GNSS_MEASUREMENT_STATE_CODE_LOCK is set * Bit sync : [ 0 20ms ] : GNSS_MEASUREMENT_STATE_BIT_SYNC is set * Subframe sync : [ 0 6s ] : GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC is set * TOW decoded : [ 0 1week ] : GNSS_MEASUREMENT_STATE_TOW_DECODED is set * * Note well: if there is any ambiguity in integer millisecond, * GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field. * * This value must be populated if 'state' != GNSS_MEASUREMENT_STATE_UNKNOWN. * * For Glonass, this is: * Received Glonass time of day, at the measurement time in nanoseconds. * * Given the highest sync state that can be achieved, per each satellite, valid range for * this field can be: * Searching : [ 0 ] : GNSS_MEASUREMENT_STATE_UNKNOWN * C/A code lock : [ 0 1ms ] : GNSS_MEASUREMENT_STATE_CODE_LOCK is set * Symbol sync : [ 0 10ms ] : GNSS_MEASUREMENT_STATE_SYMBOL_SYNC is set * Bit sync : [ 0 20ms ] : GNSS_MEASUREMENT_STATE_BIT_SYNC is set * String sync : [ 0 2s ] : GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC is set * Time of day : [ 0 1day ] : GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED is set * * For Beidou, this is: * Received Beidou time of week, at the measurement time in nanoseconds. * * Given the highest sync state that can be achieved, per each satellite, valid range for * this field can be: * Searching : [ 0 ] : GNSS_MEASUREMENT_STATE_UNKNOWN * C/A code lock: [ 0 1ms ] : GNSS_MEASUREMENT_STATE_CODE_LOCK is set * Bit sync (D2): [ 0 2ms ] : GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC is set * Bit sync (D1): [ 0 20ms ] : GNSS_MEASUREMENT_STATE_BIT_SYNC is set * Subframe (D2): [ 0 0.6s ] : GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC is set * Subframe (D1): [ 0 6s ] : GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC is set * Time of week : [ 0 1week ] : GNSS_MEASUREMENT_STATE_TOW_DECODED is set * * For Galileo, this is: * Received Galileo time of week, at the measurement time in nanoseconds. * * E1BC code lock : [ 0 4ms ] : GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK is set * E1C 2nd code lock: [ 0 100ms ] : * GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK is set * * E1B page : [ 0 2s ] : GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC is set * Time of week: [ 0 1week ] : GNSS_MEASUREMENT_STATE_TOW_DECODED is set * * For SBAS, this is: * Received SBAS time, at the measurement time in nanoseconds. * * Given the highest sync state that can be achieved, per each satellite, * valid range for this field can be: * Searching : [ 0 ] : GNSS_MEASUREMENT_STATE_UNKNOWN * C/A code lock: [ 0 1ms ] : GNSS_MEASUREMENT_STATE_CODE_LOCK is set * Symbol sync : [ 0 2ms ] : GNSS_MEASUREMENT_STATE_SYMBOL_SYNC is set * Message : [ 0 1s ] : GNSS_MEASUREMENT_STATE_SBAS_SYNC is set */ int64_t received_sv_time_in_ns; /** * 1-Sigma uncertainty of the Received GPS Time-of-Week in nanoseconds. * * This value must be populated if 'state' != GPS_MEASUREMENT_STATE_UNKNOWN. */ int64_t received_sv_time_uncertainty_in_ns; /** * Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. * It contains the measured C/N0 value for the signal at the antenna port. * * This is a mandatory value. */ double c_n0_dbhz; /** * Pseudorange rate at the timestamp in m/s. The correction of a given * Pseudorange Rate value includes corrections for receiver and satellite * clock frequency errors. Ensure that this field is independent (see * comment at top of GnssMeasurement struct.) * * It is mandatory to provide the 'uncorrected' 'pseudorange rate', and provide GpsClock's * 'drift' field as well (When providing the uncorrected pseudorange rate, do not apply the * corrections described above.) * * The value includes the 'pseudorange rate uncertainty' in it. * A positive 'uncorrected' value indicates that the SV is moving away from the receiver. * * The sign of the 'uncorrected' 'pseudorange rate' and its relation to the sign of 'doppler * shift' is given by the equation: * pseudorange rate = -k * doppler shift (where k is a constant) * * This should be the most accurate pseudorange rate available, based on * fresh signal measurements from this channel. * * It is mandatory that this value be provided at typical carrier phase PRR * quality (few cm/sec per second of uncertainty, or better) - when signals * are sufficiently strong & stable, e.g. signals from a GPS simulator at >= * 35 dB-Hz. */ double pseudorange_rate_mps; /** * 1-Sigma uncertainty of the pseudorange_rate_mps. * The uncertainty is represented as an absolute (single sided) value. * * This is a mandatory value. */ double pseudorange_rate_uncertainty_mps; /** * Accumulated delta range's state. It indicates whether ADR is reset or there is a cycle slip * (indicating loss of lock). * * This is a mandatory value. */ GnssAccumulatedDeltaRangeState accumulated_delta_range_state; /** * Accumulated delta range since the last channel reset in meters. * A positive value indicates that the SV is moving away from the receiver. * * The sign of the 'accumulated delta range' and its relation to the sign of 'carrier phase' * is given by the equation: * accumulated delta range = -k * carrier phase (where k is a constant) * * This value must be populated if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. * However, it is expected that the data is only accurate when: * 'accumulated delta range state' == GPS_ADR_STATE_VALID. */ double accumulated_delta_range_m; /** * 1-Sigma uncertainty of the accumulated delta range in meters. * This value must be populated if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. */ double accumulated_delta_range_uncertainty_m; /** * Carrier frequency at which codes and messages are modulated, it can be L1 or L2. * If the field is not set, the carrier frequency is assumed to be L1. * * If the data is available, 'flags' must contain * GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY. */ float carrier_frequency_hz; /** * The number of full carrier cycles between the satellite and the receiver. * The reference frequency is given by the field 'carrier_frequency_hz'. * Indications of possible cycle slips and resets in the accumulation of * this value can be inferred from the accumulated_delta_range_state flags. * * If the data is available, 'flags' must contain * GNSS_MEASUREMENT_HAS_CARRIER_CYCLES. */ int64_t carrier_cycles; /** * The RF phase detected by the receiver, in the range [0.0, 1.0]. * This is usually the fractional part of the complete carrier phase measurement. * * The reference frequency is given by the field 'carrier_frequency_hz'. * The value contains the 'carrier-phase uncertainty' in it. * * If the data is available, 'flags' must contain * GNSS_MEASUREMENT_HAS_CARRIER_PHASE. */ double carrier_phase; /** * 1-Sigma uncertainty of the carrier-phase. * If the data is available, 'flags' must contain * GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY. */ double carrier_phase_uncertainty; /** * An enumeration that indicates the 'multipath' state of the event. * * The multipath Indicator is intended to report the presence of overlapping * signals that manifest as distorted correlation peaks. * * - if there is a distorted correlation peak shape, report that multipath * is GNSS_MULTIPATH_INDICATOR_PRESENT. * - if there is not a distorted correlation peak shape, report * GNSS_MULTIPATH_INDICATOR_NOT_PRESENT * - if signals are too weak to discern this information, report * GNSS_MULTIPATH_INDICATOR_UNKNOWN * * Example: when doing the standardized overlapping Multipath Performance * test (3GPP TS 34.171) the Multipath indicator should report * GNSS_MULTIPATH_INDICATOR_PRESENT for those signals that are tracked, and * contain multipath, and GNSS_MULTIPATH_INDICATOR_NOT_PRESENT for those * signals that are tracked and do not contain multipath. */ GnssMultipathIndicator multipath_indicator; /** * Signal-to-noise ratio at correlator output in dB. * If the data is available, 'flags' must contain GNSS_MEASUREMENT_HAS_SNR. * This is the power ratio of the "correlation peak height above the * observed noise floor" to "the noise RMS". */ double snr_db; } gnss_measurement; typedef struct { /** Number of measurements. */ size_t measurement_count; /** The array of measurements. */ gps_measurement measurements[GPS_MAX_MEASUREMENT]; /** The GPS clock time reading. */ gps_clock clock; } gps_data; /** * Represents a reading of GNSS measurements. For devices where GnssSystemInfo's * year_of_hw is set to 2016+, it is mandatory that these be provided, on * request, when the GNSS receiver is searching/tracking signals. * * - Reporting of GPS constellation measurements is mandatory. * - Reporting of all tracked constellations are encouraged. */ typedef struct { /** Number of measurements. */ size_t measurement_count; /** The array of measurements. */ gnss_measurement measurements[GNSS_MAX_MEASUREMENT]; /** The GPS clock time reading. */ gnss_clock clock; } gnss_data; typedef struct { /** * Pseudo-random number in the range of [1, 32] * This is a Mandatory value. */ int8_t prn; /** * The type of message contained in the structure. * This is a Mandatory value. */ gps_nav_msg_type type; /** * The status of the received navigation message. * No need to send any navigation message that contains words with parity error and cannot be * corrected. */ nav_msg_status status; /** * Message identifier. * It provides an index so the complete Navigation Message can be assembled. i.e. fo L1 C/A * subframe 4 and 5, this value corresponds to the 'frame id' of the navigation message. * Subframe 1, 2, 3 does not contain a 'frame id' and this value can be set to -1. */ short message_id; /** * Sub-message identifier. * If required by the message 'type', this value contains a sub-index within the current * message (or frame) that is being transmitted. * i.e. for L1 C/A the submessage id corresponds to the sub-frame id of the navigation message. */ short submessage_id; /** * The length of the data (in bytes) contained in the current message. * If this value is different from zero, 'data' must point to an array of the same size. * e.g. for L1 C/A the size of the sub-frame will be 40 bytes (10 words, 30 bits/word). * This is a Mandatory value. */ size_t data_length; /** * The data of the reported GPS message. * The bytes (or words) specified using big endian format (MSB first). * * For L1 C/A, each subframe contains 10 30-bit GPS words. Each GPS word (30 bits) should be * fitted into the last 30 bits in a 4-byte word (skip B31 and B32), with MSB first. */ char data[40]; } gps_nav_msg; /** Represents a GPS navigation message (or a fragment of it). */ typedef struct { /** set to sizeof(GnssNavigationMessage) */ size_t size; /** * Satellite vehicle ID number, as defined in GnssSvInfo::svid * This is a mandatory value. */ int16_t svid; /** * The type of message contained in the structure. * This is a mandatory value. */ GnssNavigationMessageType type; /** * The status of the received navigation message. * No need to send any navigation message that contains words with parity error and cannot be * corrected. */ NavigationMessageStatus status; /** * Message identifier. It provides an index so the complete Navigation * Message can be assembled. * * - For GPS L1 C/A subframe 4 and 5, this value corresponds to the 'frame * id' of the navigation message, in the range of 1-25 (Subframe 1, 2, 3 * does not contain a 'frame id' and this value can be set to -1.) * * - For Glonass L1 C/A, this refers to the frame ID, in the range of 1-5. * * - For BeiDou D1, this refers to the frame number in the range of 1-24 * * - For Beidou D2, this refers to the frame number, in the range of 1-120 * * - For Galileo F/NAV nominal frame structure, this refers to the subframe * number, in the range of 1-12 * * - For Galileo I/NAV nominal frame structure, this refers to the subframe * number in the range of 1-24 */ int16_t message_id; /** * Sub-message identifier. If required by the message 'type', this value * contains a sub-index within the current message (or frame) that is being * transmitted. * * - For GPS L1 C/A, BeiDou D1 & BeiDou D2, the submessage id corresponds to * the subframe number of the navigation message, in the range of 1-5. * * - For Glonass L1 C/A, this refers to the String number, in the range from * 1-15 * * - For Galileo F/NAV, this refers to the page type in the range 1-6 * * - For Galileo I/NAV, this refers to the word type in the range 1-10+ */ int16_t submessage_id; /** * The length of the data (in bytes) contained in the current message. * If this value is different from zero, 'data' must point to an array of the same size. * e.g. for L1 C/A the size of the sub-frame will be 40 bytes (10 words, 30 bits/word). * * This is a mandatory value. */ size_t data_length; /** * The data of the reported GPS message. The bytes (or words) specified * using big endian format (MSB first). * * - For GPS L1 C/A, Beidou D1 & Beidou D2, each subframe contains 10 30-bit * words. Each word (30 bits) should be fit into the last 30 bits in a * 4-byte word (skip B31 and B32), with MSB first, for a total of 40 * bytes, covering a time period of 6, 6, and 0.6 seconds, respectively. * * - For Glonass L1 C/A, each string contains 85 data bits, including the * checksum. These bits should be fit into 11 bytes, with MSB first (skip * B86-B88), covering a time period of 2 seconds. * * - For Galileo F/NAV, each word consists of 238-bit (sync & tail symbols * excluded). Each word should be fit into 30-bytes, with MSB first (skip * B239, B240), covering a time period of 10 seconds. * * - For Galileo I/NAV, each page contains 2 page parts, even and odd, with * a total of 2x114 = 228 bits, (sync & tail excluded) that should be fit * into 29 bytes, with MSB first (skip B229-B232). */ uint8_t* data; } gnss_nav_msg; void dump_gps_location(gps_location in); void dump_gnss_sv(gnss_sv in); void dump_gnss_sv_info(gnss_sv_info in); void dump_gps_data(gps_data in); void dump_gps_measurement(gps_measurement in); void dump_gps_clock(gps_clock in); void dump_gps_nav_msg(gps_nav_msg in); void dump_gnss_data(gnss_data in); void dump_gnss_measurement(gnss_measurement in); void dump_gnss_clock(gnss_clock in); void dump_gnss_nav_msg(gnss_nav_msg in); #ifdef __cplusplus } #endif #endif
39.623199
100
0.672503
[ "shape" ]
8616dcb2f5b1dc57711aa15e33f7ac1bdbe94898
978
h
C
beEntitySystem/header/beEntitySystem/beAnimatedHost.h
gcodebackups/breeze-2
1692b97f455c4bc856ec2f0eb8c0b86e708a398a
[ "MIT" ]
null
null
null
beEntitySystem/header/beEntitySystem/beAnimatedHost.h
gcodebackups/breeze-2
1692b97f455c4bc856ec2f0eb8c0b86e708a398a
[ "MIT" ]
null
null
null
beEntitySystem/header/beEntitySystem/beAnimatedHost.h
gcodebackups/breeze-2
1692b97f455c4bc856ec2f0eb8c0b86e708a398a
[ "MIT" ]
null
null
null
/************************************************************/ /* breeze Engine Entity System Module (c) Tobias Zirr 2011 */ /************************************************************/ #pragma once #ifndef BE_ENTITYSYSTEM_ANIMATEDHOST #define BE_ENTITYSYSTEM_ANIMATEDHOST #include "beEntitySystem.h" #include "beAnimated.h" #include <vector> namespace beEntitySystem { /// Animated interface. class AnimatedHost : public Animated { private: typedef std::vector<Animated*> animated_vector; animated_vector m_animate; public: /// Constructor. BE_ENTITYSYSTEM_API AnimatedHost(); /// Destructor. BE_ENTITYSYSTEM_API ~AnimatedHost(); /// Steps the animation. BE_ENTITYSYSTEM_API void Step(float timeStep); /// Adds an animated controller. BE_ENTITYSYSTEM_API void AddAnimated(Animated *animated); /// Removes an animated controller. BE_ENTITYSYSTEM_API void RemoveAnimated(Animated *animated); }; } // namespace #endif
24.45
63
0.645194
[ "vector" ]
861bc1b8317d4ae69eb5aa364ea78c30d9aaceb0
9,528
h
C
src/arch/i386-kos/include/arch/paging32.h
GrieferAtWork/KOSmk2
446a982c7930eeb48710bcb234c4e4b15446b869
[ "Zlib" ]
1
2021-01-02T22:15:14.000Z
2021-01-02T22:15:14.000Z
src/arch/i386-kos/include/arch/paging32.h
GrieferAtWork/KOSmk2
446a982c7930eeb48710bcb234c4e4b15446b869
[ "Zlib" ]
null
null
null
src/arch/i386-kos/include/arch/paging32.h
GrieferAtWork/KOSmk2
446a982c7930eeb48710bcb234c4e4b15446b869
[ "Zlib" ]
1
2019-10-21T17:39:46.000Z
2019-10-21T17:39:46.000Z
/* Copyright (c) 2017 Griefer@Work * * * * This software is provided 'as-is', without any express or implied * * warranty. In no event will the authors be held liable for any damages * * arising from the use of this software. * * * * Permission is granted to anyone to use this software for any purpose, * * including commercial applications, and to alter it and redistribute it * * freely, subject to the following restrictions: * * * * 1. The origin of this software must not be misrepresented; you must not * * claim that you wrote the original software. If you use this software * * in a product, an acknowledgement in the product documentation would be * * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not be * * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source distribution. * */ #ifndef GUARD_ARCH_I386_KOS_INCLUDE_ARCH_PAGING32_H #define GUARD_ARCH_I386_KOS_INCLUDE_ARCH_PAGING32_H 1 #include <hybrid/compiler.h> #include <hybrid/host.h> #ifndef __x86_64__ #include <hybrid/types.h> #include <hybrid/limits.h> #include <hybrid/typecore.h> #include <kernel/memory.h> #include <arch/hints.h> #include <assert.h> DECL_BEGIN #define KERNEL_BASE __UINT32_C(0xc0000000) /* Mask of all address bits that can actually be used. * NOTE: On i386, that simply is every bit there is (All 32). */ #define VIRT_MASK __UINT32_C(0xffffffff) #define PDIR_ATTR_MASK 0x0fffu #define PDIR_ATTR_GLOBAL 0x0100u /* Set to optimize mappings that appear at the same location in all * directories it appears inside of (aka: Kernel-allocated stack/memory). */ #define PDIR_ATTR_DIRTY 0x0040u /* The page was written to. */ #define PDIR_ATTR_ACCESSED 0x0020u /* The page was read from, or written to. */ #define PDIR_ATTR_USER 0x0004u /* User-space may access this page (read, or write). */ #define PDIR_ATTR_WRITE 0x0002u /* The page is writable. */ #define PDIR_ATTR_PRESENT 0x0001u /* The page is present (When not set, cause a PAGEFAULT that may be used for allocate/load-on-read). */ #ifdef __CC__ typedef u16 pdir_attr_t; /* Set of `PDIR_ATTR_*|PDIR_FLAG_*' */ #endif /* __CC__ */ /* Page directory action flags (accepted by `pdir_mprotect', `pdir_mmap', `pdir_mremap' and `pdir_munmap') */ #define PDIR_FLAG_NOFLUSH 0x8000u /* Don't sync the page directory entry - instead, the caller must invalidate it. */ /* Internal/arch-specific attributes. */ #define PDIR_ATTR_4MIB 0x0080u /* Only used by `pd_table': Directly map a physical address. * NOTE: Use of this requires the `CR4_PSE' bit to be set. */ #define PD_ENTRY_SIZE 4 #define PD_TABLE_SIZE 4 #define PD_TABLE_ENTRY_COUNT 1024 #ifdef __CC__ typedef struct _pdir pdir_t; union pd_entry { u32 pe_data; /*< Entry data. */ #ifdef __INTELLISENSE__ void *pe_map; /*< [MASK(~PDIR_ATTR_MASK)] The mapped physical pointer (page-aligned). */ u32 pe_attr; /*< [MASK(PDIR_ATTR_MASK)] Mapping attributes. */ #else PHYS void *pe_map; /*< [MASK(~PDIR_ATTR_MASK)] The mapped physical pointer (page-aligned). */ u32 pe_attr; /*< [MASK(PDIR_ATTR_MASK)] Mapping attributes. */ #endif }; #define PDENTRY_GETMAP(self) ((PHYS ppage_t)((self).pe_data&~PDIR_ATTR_MASK)) #define PDENTRY_ISPRESENT(self) ((self).pe_attr&PDIR_ATTR_PRESENT) union PACKED pd_table { u32 pt_data; /*< Table data. */ union{ PHYS union pd_entry *pt_ptev; /*< [0..1=PD_TABLE_ENTRY_COUNT][MASK(~PDIR_ATTR_MASK)] * [owned_if((self-pd_directory)*0x400000 < VM_HOST_BASE)] // NOTE: `0x400000 == (1 << 32) / PD_TABLE_ENTRY_COUNT' (Aka: The first kernel-page) * [valid_if(PDTABLE_ISVALID(self))] * [alloc_if(PDTABLE_ISALLOC(self))] * The associated page table entry-vector (Always contains PD_TABLE_ENTRY_COUNT elements). * NOTE: Index == PDIR_TINDEX(v_ptr). */ PHYS void *pt_map; /*< [MASK(~PDIR_ATTR_MASK)] * [valid_if(pt_attr&PDIR_ATTR_4MIB)] * The mapped physical pointer (page-aligned). */ }; u32 pt_attr; /*< [0..1][MASK(PDIR_ATTR_MASK)] * Page directory entry attributes (or'd together attributes of all table entries). * NOTE: Also, using `PDIR_ATTR_PRESENT', indicates the presence of a . */ }; #define PDTABLE_GETPTEV(self) ((PHYS union pd_entry *)((self).pt_data&~PDIR_ATTR_MASK)) #define PDTABLE_ISMAP(self) ((self).pt_attr&PDIR_ATTR_4MIB) #define PDTABLE_ISTABLE(self) (!((self).pt_attr&PDIR_ATTR_4MIB)) #define PDTABLE_ISALLOC(self) ((((self).pt_data&~PDIR_ATTR_MASK) != ~PDIR_ATTR_MASK) && PDTABLE_ISTABLE(self)) #define PDTABLE_ISVALID(self) ((((self).pt_data&~PDIR_ATTR_MASK) != ~PDIR_ATTR_MASK) && (((self).pt_attr&(PDIR_ATTR_PRESENT|PDIR_ATTR_4MIB)) == PDIR_ATTR_PRESENT)) #define PDTABLE_ISPRESENT(self) ((self).pt_attr&PDIR_ATTR_PRESENT) #define PDTABLE_GETMAP(self) ((PHYS ppage_t)((self).pt_data&~PDIR_ATTR_MASK)) #endif /* __CC__ */ #define PDIR_OFFSETOF_DIRECTORY 0 #define PDIR_SIZE 4096 #define PDIR_ALIGN PAGESIZE #define PDIR_TABLE_COUNT 1024 #ifdef __CC__ struct _pdir { /* [lock(this == PDIR_GTCURR())] Controller structure for a page directory. * Note, that any thread is only ever allowed to modify its, currently active directory. */ #ifndef __INTELLISENSE__ ATTR_ALIGNED(PDIR_ALIGN) #endif /* The page directory itself (this vector is your `CR3') * NOTE: Index == PDIR_DINDEX(v_ptr). */ union pd_table pd_directory[PDIR_TABLE_COUNT]; }; #endif /* __CC__ */ #define PDIR_KERNELBASE_STARTINDEX (VM_HOST_BASE/PDTABLE_REPRSIZE) #define PDIR_ROOTENTRY_REPRSIZE PDTABLE_REPRSIZE #define PDENTRY_REPRSIZE PAGESIZE /* 1 << 12 */ #define PDTABLE_REPRSIZE 0x400000 /* 1 << 22 */ #define PTTABLE_ARRAYSIZE (PDTABLE_REPRSIZE/PDENTRY_REPRSIZE) #define PDTABLE_ALLOCSIZE (PTTABLE_ARRAYSIZE*PD_ENTRY_SIZE) /* Return the directory/table index of a given virtual pointer `v_ptr'. */ #define PDIR_DINDEX(v_ptr) ((u32)(v_ptr) >> 22) #define PDIR_TINDEX(v_ptr) (((u32)(v_ptr) >> 12) & 0x3ff) /* Return the page-local offset of of a given virtual pointer `v_ptr'. */ #define PDIR_OFFSET(v_ptr) ((u32)(v_ptr) & 0xfff) #define PDIR_MOFFSET(v_ptr) ((u32)(v_ptr) & 0x3fffff) #ifdef __CC__ LOCAL KPD PHYS void *KCALL pdir_translate(pdir_t *__restrict self, VIRT void *ptr) { union pd_entry entry; union pd_table table = self->pd_directory[PDIR_DINDEX(ptr)]; if (PDTABLE_ISMAP(table)) return (void *)((uintptr_t)PDTABLE_GETMAP(table)+PDIR_MOFFSET(ptr)); assert(PDTABLE_ISVALID(table)); entry = PDTABLE_GETPTEV(table)[PDIR_TINDEX(ptr)]; assert(entry.pe_attr&PDIR_ATTR_PRESENT); return (void *)((uintptr_t)PDENTRY_GETMAP(entry)+PDIR_OFFSET(ptr)); } LOCAL KPD PHYS int KCALL pdir_test_readable(pdir_t *__restrict self, VIRT void *ptr) { union pd_entry entry; union pd_table table = self->pd_directory[PDIR_DINDEX(ptr)]; if (PDTABLE_ISMAP(table)) return (table.pt_attr&PDIR_ATTR_PRESENT); entry = PDTABLE_GETPTEV(table)[PDIR_TINDEX(ptr)]; return (entry.pe_attr&PDIR_ATTR_PRESENT); } LOCAL KPD PHYS int KCALL pdir_test_writable(pdir_t *__restrict self, VIRT void *ptr) { union pd_entry entry; union pd_table table = self->pd_directory[PDIR_DINDEX(ptr)]; if (PDTABLE_ISMAP(table)) return (table.pt_attr&(PDIR_ATTR_PRESENT|PDIR_ATTR_WRITE)) == (PDIR_ATTR_PRESENT|PDIR_ATTR_WRITE); entry = PDTABLE_GETPTEV(table)[PDIR_TINDEX(ptr)]; return (entry.pe_attr&(PDIR_ATTR_PRESENT|PDIR_ATTR_WRITE)) == (PDIR_ATTR_PRESENT|PDIR_ATTR_WRITE); } LOCAL void FCALL pdir_flushall(void) { register u32 temp; __asm__ __volatile__("movl %%cr3, %0\n" "movl %0, %%cr3\n" : "=&r" (temp)/* : : "memory"*/); } /* Get/Set the currently active page directory. * NOTE: These functions work with PHYS pointers! */ #define PDIR_GTCURR() XBLOCK({ register PHYS pdir_t *_r; __asm__ __volatile__("movl %%cr3, %0" : "=r" (_r)); XRETURN _r; }) #define PDIR_STCURR(v) XBLOCK({ __asm__ __volatile__("movl %0, %%cr3" : : "r" (v)/* : "memory"*/); (void)0; }) #if PDIR_OFFSETOF_DIRECTORY != 0 #error "Fix the above macros" #endif #ifdef CONFIG_BUILDING_KERNEL_CORE /* Used for mapping virtual memory during early booting (before paging is initialized). * WARNING: Only available in 32-bit mode, use `early_map_identity' in 64-bit mode. */ INTDEF INITCALL errno_t KCALL pdir_mmap_early(pdir_t *__restrict self, VIRT ppage_t start, size_t n_bytes, PHYS ppage_t target, pdir_attr_t flags); #endif /* CONFIG_BUILDING_KERNEL_CORE */ #endif /* __CC__ */ DECL_END #endif /* !__x86_64__ */ #endif /* !GUARD_ARCH_I386_KOS_INCLUDE_ARCH_PAGING32_H */
47.402985
175
0.659845
[ "vector" ]
861bd37a6370c81becc21e4cff67f7519e0e5013
13,877
h
C
activemq-cpp/src/main/decaf/util/concurrent/locks/Lock.h
novomatic-tech/activemq-cpp
d6f76ede90d21b7ee2f0b5d4648e440e66d63003
[ "Apache-2.0" ]
87
2015-03-02T17:58:20.000Z
2022-02-11T02:52:52.000Z
activemq-cpp/src/main/decaf/util/concurrent/locks/Lock.h
novomatic-tech/activemq-cpp
d6f76ede90d21b7ee2f0b5d4648e440e66d63003
[ "Apache-2.0" ]
3
2017-05-10T13:16:08.000Z
2019-01-23T20:21:53.000Z
activemq-cpp/src/main/decaf/util/concurrent/locks/Lock.h
novomatic-tech/activemq-cpp
d6f76ede90d21b7ee2f0b5d4648e440e66d63003
[ "Apache-2.0" ]
71
2015-04-28T06:04:04.000Z
2022-03-15T13:34:06.000Z
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _DECAF_UTIL_CONCURRENT_LOCKS_LOCK_H_ #define _DECAF_UTIL_CONCURRENT_LOCKS_LOCK_H_ #include <decaf/util/Config.h> #include <decaf/lang/exceptions/InterruptedException.h> #include <decaf/lang/exceptions/UnsupportedOperationException.h> #include <decaf/util/concurrent/locks/Condition.h> namespace decaf { namespace util { namespace concurrent { namespace locks { /** * Lock implementations provide more extensive locking operations than can be * obtained using synchronized statements. They allow more flexible structuring, * may have quite different properties, and may support multiple associated * Condition objects. * * A lock is a tool for controlling access to a shared resource by multiple * threads. Commonly, a lock provides exclusive access to a shared resource: * only one thread at a time can acquire the lock and all access to the shared * resource requires that the lock be acquired first. However, some locks may * allow concurrent access to a shared resource, such as the read lock of a * ReadWriteLock. * * While the scoping mechanism for synchronized statements makes it much easier * easier to program with monitor locks, and helps avoid many common programming * errors involving locks, there are occasions where you need to work with locks * in a more flexible way. For example, some algorithms for traversing concurrently * accessed data structures require the use of "hand-over-hand" or * "chain locking": you acquire the lock of node A, then node B, then release A * and acquire C, then release B and acquire D and so on. Implementations of the * Lock interface enable the use of such techniques by allowing a lock to be * acquired and released in different scopes, and allowing multiple locks to be * acquired and released in any order. * * With this increased flexibility comes additional responsibility. The absence of * block-structured locking removes the automatic release of locks that occurs with * synchronized statements. In most cases, the following idiom should be used: * * Lock l = ...; * l.lock(); * try { * // access the resource protected by this lock * } catch(...) { * l.unlock(); * } * * When locking and unlocking occur in different scopes, care must be taken to ensure * that all code that is executed while the lock is held is protected by try-catch * ensure that the lock is released when necessary. * * Lock implementations provide additional functionality over the use of synchronized * methods and statements by providing a non-blocking attempt to acquire a lock * (tryLock()), an attempt to acquire the lock that can be interrupted (lockInterruptibly(), * and an attempt to acquire the lock that can timeout (tryLock(long, TimeUnit)). * * Note that Lock instances are just normal objects and can themselves be used as the * target in a synchronized statement. * * The three forms of lock acquisition (interruptible, non-interruptible, and timed) * may differ in their performance characteristics, ordering guarantees, or other * implementation qualities. Further, the ability to interrupt the ongoing acquisition * of a lock may not be available in a given Lock class. Consequently, an implementation * is not required to define exactly the same guarantees or semantics for all three forms * of lock acquisition, nor is it required to support interruption of an ongoing lock * acquisition. An implementation is required to clearly document the semantics and * guarantees provided by each of the locking methods. It must also obey the interruption * semantics as defined in this interface, to the extent that interruption of lock * acquisition is supported: which is either totally, or only on method entry. * * As interruption generally implies cancellation, and checks for interruption are * often infrequent, an implementation can favor responding to an interrupt over normal * method return. This is true even if it can be shown that the interrupt occurred after * another action may have unblocked the thread. An implementation should document this * behavior. * * @since 1.0 */ class DECAF_API Lock { public: virtual ~Lock(); /** * Acquires the lock. * * If the lock is not available then the current thread becomes disabled for thread * scheduling purposes and lies dormant until the lock has been acquired. * * Implementation Considerations * * A Lock implementation may be able to detect erroneous use of the lock, such as an * invocation that would cause deadlock, and may throw an exception in such circumstances. * The circumstances and the exception type must be documented by that Lock implementation. * * @throws RuntimeException if an error occurs while acquiring the lock. */ virtual void lock() = 0; /** * Acquires the lock unless the current thread is interrupted. * <p> * Acquires the lock if it is available and returns immediately. * <p> * If the lock is not available then the current thread becomes disabled for thread * scheduling purposes and lies dormant until one of two things happens: * * * The lock is acquired by the current thread; or * * Some other thread interrupts the current thread, and interruption of lock * acquisition is supported. * * If the current thread: * * * has its interrupted status set on entry to this method; or * * is interrupted while acquiring the lock, and interruption of lock acquisition * is supported, * * then InterruptedException is thrown and the current thread's interrupted status * is cleared. * * Implementation Considerations * * The ability to interrupt a lock acquisition in some implementations may not be * possible, and if possible may be an expensive operation. The programmer should * be aware that this may be the case. An implementation should document when this * is the case. * * An implementation can favor responding to an interrupt over normal method return. * * A Lock implementation may be able to detect erroneous use of the lock, such as an * invocation that would cause deadlock, and may throw an exception in such * circumstances. The circumstances and the exception type must be documented by * that Lock implementation. * * @throws RuntimeException if an error occurs while acquiring the lock. * @throws InterruptedException * if the current thread is interrupted while acquiring the lock (and * interruption of lock acquisition is supported). */ virtual void lockInterruptibly() = 0; /** * Acquires the lock only if it is free at the time of invocation. * <p> * Acquires the lock if it is available and returns immediately with the value true. * If the lock is not available then this method will return immediately with the * value false. * <p> * A typical usage idiom for this method would be: * * Lock lock = ...; * if (lock.tryLock()) { * try { * // manipulate protected state * } catch(...) { * lock.unlock(); * } * } else { * // perform alternative actions * } * * This usage ensures that the lock is unlocked if it was acquired, and doesn't * try to unlock if the lock was not acquired. * * @return true if the lock was acquired and false otherwise * * @throws RuntimeException if an error occurs while acquiring the lock. */ virtual bool tryLock() = 0; /** * Acquires the lock if it is free within the given waiting time and the current * thread has not been interrupted. * <p> * If the lock is available this method returns immediately with the value true. * If the lock is not available then the current thread becomes disabled for thread * scheduling purposes and lies dormant until one of three things happens: * * * The lock is acquired by the current thread; or * * Some other thread interrupts the current thread, and interruption of lock * acquisition is supported; or * * The specified waiting time elapses * * If the lock is acquired then the value true is returned. * * If the current thread: * * * has its interrupted status set on entry to this method; or * * is interrupted while acquiring the lock, and interruption of lock acquisition * is supported, * * then InterruptedException is thrown and the current thread's interrupted status * is cleared. * * If the specified waiting time elapses then the value false is returned. If the * time is less than or equal to zero, the method will not wait at all. * * Implementation Considerations * * The ability to interrupt a lock acquisition in some implementations may not * be possible, and if possible may be an expensive operation. The programmer should * be aware that this may be the case. An implementation should document when this * is the case. * * An implementation can favor responding to an interrupt over normal method return, * or reporting a timeout. * * A Lock implementation may be able to detect erroneous use of the lock, such as an * invocation that would cause deadlock, and may throw an (unchecked) exception in * such circumstances. The circumstances and the exception type must be documented by * that Lock implementation. * * @param time * the maximum time to wait for the lock * @param unit * the time unit of the time argument * * @return true if the lock was acquired and false if the waiting time elapsed * before the lock was acquired * * @throws RuntimeException if an error occurs while acquiring the lock. * @throws InterruptedException * if the current thread is interrupted while acquiring the lock (and * interruption of lock acquisition is supported) */ virtual bool tryLock(long long time, const TimeUnit& unit) = 0; /** * Releases the lock. * <p> * Implementation Considerations * * A Lock implementation will usually impose restrictions on which thread can release * a lock (typically only the holder of the lock can release it) and may throw an * exception if the restriction is violated. Any restrictions and the exception * type must be documented by that Lock implementation. * * @throws RuntimeException if an error occurs while acquiring the lock. * @throws IllegalMonitorStateException if the current thread is not the owner of the lock. */ virtual void unlock() = 0; /** * Returns a new Condition instance that is bound to this Lock instance. * <p> * Before waiting on the condition the lock must be held by the current thread. * A call to Condition.await() will atomically release the lock before waiting * and re-acquire the lock before the wait returns. * <p> * Implementation Considerations * <p> * The exact operation of the Condition instance depends on the Lock implementation * and must be documented by that implementation. * * @return A new Condition instance for this Lock instance the caller must * delete the returned Condition object when done with it. * * @throws RuntimeException if an error occurs while creating the Condition. * @throws UnsupportedOperationException * if this Lock implementation does not support conditions */ virtual Condition* newCondition() = 0; /** * @return a string representation of the Lock useful for debugging purposes. */ virtual std::string toString() const = 0; }; }}}} #endif /*_DECAF_UTIL_CONCURRENT_LOCKS_LOCK_H_ */
47.361775
99
0.65432
[ "object" ]
2fc070704236d9df090705c76f66d51ff6fa5182
982
h
C
Number Theory/wheel_factorization.h
CodeISM/ccptl
dfba7049f67626f7ea79bb19ed915af8fa867f9f
[ "Unlicense" ]
17
2020-03-28T11:25:58.000Z
2022-01-26T02:48:43.000Z
Number Theory/wheel_factorization.h
CodeISM/ccptl
dfba7049f67626f7ea79bb19ed915af8fa867f9f
[ "Unlicense" ]
6
2020-02-23T05:30:07.000Z
2020-07-05T13:00:40.000Z
Number Theory/wheel_factorization.h
CodeISM/ccptl
dfba7049f67626f7ea79bb19ed915af8fa867f9f
[ "Unlicense" ]
3
2020-02-19T06:01:05.000Z
2020-05-14T13:25:26.000Z
/* * Author : cp-algorithms.com * Use : Factorize a given integer * Time Complexity : O(sqrt(N)) but ~25% faster than brute-force trial division * Space Complexity: O(1) * Input : Number to be factorized * Output: A C++ vector containing the prime factors in sorted order. * Example: If n = 2^2 * 5^1 * 3^2, then wheel_factor(n) * returns vector<int>{2,2,3,3,5} * Status: Tested */ inline vector<long long> wheel_factor(long long n) { using ll = long long; vector<ll> factorization; for (int d : {2, 3, 5}) { while (n % d == 0) { factorization.push_back(d); n /= d; } } static array<int, 8> increments = {4, 2, 4, 2, 4, 6, 2, 6}; int i = 0; for (ll d = 7; d * d <= n; d += increments[i++]) { while (n % d == 0) { factorization.push_back(d); n /= d; } if (i == 8) i = 0; } if (n > 1) factorization.push_back(n); return factorization; }
29.757576
79
0.538697
[ "vector" ]
2fc918b6178ab4da9d0ba8a65d0989bcd677dabd
3,284
h
C
common/logic/ServerNodeImpl.h
xgm-skywave/xgs
d75f3f44ca7f9a5e633f5e14330e84a0fa2777ef
[ "MIT" ]
3
2019-11-05T16:33:21.000Z
2020-10-27T10:28:36.000Z
common/logic/ServerNodeImpl.h
langxgm/xgs
d75f3f44ca7f9a5e633f5e14330e84a0fa2777ef
[ "MIT" ]
null
null
null
common/logic/ServerNodeImpl.h
langxgm/xgs
d75f3f44ca7f9a5e633f5e14330e84a0fa2777ef
[ "MIT" ]
2
2020-10-27T10:25:07.000Z
2020-11-10T05:36:33.000Z
//------------------------------------------------------------------------ // * @filename: ServerNodeImpl.h // * // * @brief: 服务器节点 // * // * @author: XGM // * @date: 2018/08/31 //------------------------------------------------------------------------ #pragma once #include "ServerNode.h" #include "xbase/TimeChecker.h" #include <map> // 服务器信息 struct ServerInfo { int32_t nID = 0; // 服务器ID int32_t nGroup = 0; // 服务器分组 std::string strName; // 服务器名字 std::string strIP; // 服务器IP int32_t nListenClientPort = 0; // 监听客户端端口 int64_t nSessionID = 0; // 连接ID }; // 服务信息 struct ServerService { std::string strName; // 服务名称 // 服务参数 struct Param { int64_t nParam1 = 0; // 参数1 int64_t nParam2 = 0; // 参数2 int64_t nParam3 = 0; // 参数3 } aParam; }; typedef std::map<std::string, ServerService> ServerServiceMap; // 基础服务器节点 class ServerNode_Base : public ServerNode { public: ServerNode_Base() {} virtual ~ServerNode_Base() {} public: //------------------------------------------------------------------------ // 更新 //------------------------------------------------------------------------ virtual void Update() override; //------------------------------------------------------------------------ // 认证 //------------------------------------------------------------------------ virtual void DoAuth(int64_t nSessionID) override {} virtual void OnAuth() override {} virtual void OnAuthResult() override {} //------------------------------------------------------------------------ // Ping //------------------------------------------------------------------------ virtual void DoPing() override {} virtual void OnPing() override; //------------------------------------------------------------------------ // Pong //------------------------------------------------------------------------ virtual void DoPong() override {} virtual void OnPong() override; public: virtual int32_t GetID() const override { return m_ServerInfo.nID; } virtual void SetID(int32_t nID) override { m_ServerInfo.nID = nID; } virtual int32_t GetGroup() const override { return m_ServerInfo.nGroup; } virtual void SetGroup(int32_t nGroup) override { m_ServerInfo.nGroup = nGroup; } virtual const std::string& GetName() const override { return m_ServerInfo.strName; } virtual void SetName(const std::string& strName) override { m_ServerInfo.strName = strName; } virtual const std::string& GetIP()const override { return m_ServerInfo.strIP; } virtual void SetIP(const std::string& strIP) override { m_ServerInfo.strIP = strIP; } virtual int64_t GetSessionID() const override { return m_ServerInfo.nSessionID; } virtual void SetSessionID(int64_t nSessionID) override { m_ServerInfo.nSessionID = nSessionID; } virtual bool IsHaveService(const std::string& strService) const override; virtual bool CheckServiceCond(const std::string& strService, const std::vector<int64_t>& vecParam) const override; virtual bool AddService(const std::string& strService, const std::vector<int64_t>& vecParam) override; virtual bool DelService(const std::string& strService) override; public: TimeChecker& GetPingTimer() { return m_PingTimer; } protected: // 服务器信息 ServerInfo m_ServerInfo; // 服务映射表 ServerServiceMap m_mapService; // Ping计时器 TimeChecker m_PingTimer; };
30.407407
115
0.560901
[ "vector" ]
2fccc75258cc376638e1bb6cd633f169ac19b6b7
311
h
C
raygame/Game.h
jday151r/CustomPhysics
af8818539d693ff59bbc788c91fe1812969be0a0
[ "MIT" ]
null
null
null
raygame/Game.h
jday151r/CustomPhysics
af8818539d693ff59bbc788c91fe1812969be0a0
[ "MIT" ]
null
null
null
raygame/Game.h
jday151r/CustomPhysics
af8818539d693ff59bbc788c91fe1812969be0a0
[ "MIT" ]
null
null
null
#pragma once #include<vector> #include"Physics.h" class Game { float accumulatedFixedTime; std::vector<PhysicsObject> physicsObjects; public: Game(); void Init(); void Tick(); void TickPhys(); void Draw() const; void Exit(); bool ShouldClose(); bool ShouldPhysics(); float targetFixedStep; };
11.961538
43
0.70418
[ "vector" ]
2fcdb303ab498ab9805c3d42643e1cd2fb36b8bd
940
c
C
src/main.c
pete-video-analysis/pete-gui
06e78f213d05e6e263e6f27872c0edcf6736bd45
[ "MIT" ]
null
null
null
src/main.c
pete-video-analysis/pete-gui
06e78f213d05e6e263e6f27872c0edcf6736bd45
[ "MIT" ]
null
null
null
src/main.c
pete-video-analysis/pete-gui
06e78f213d05e6e263e6f27872c0edcf6736bd45
[ "MIT" ]
null
null
null
#include <stdio.h> int main(void) { GLFWwindow* window; // Initialize the library if (!glfwInit()) return -1; // Create a windowed mode window and its OpenGL context window = glfwCreateWindow(640, 480, "Pete", NULL, NULL); if (!window) { glfwTerminate(); return -1; } // Make the window's context current glfwMakeContextCurrent(window); // Get width and height and create viewport int width, height; glfwGetFramebufferSize(window, &width, &height); glViewport(0, 0, width, height); // Set swap interval glfwSwapInterval(1); // Loop until the user closes the window while (!glfwWindowShouldClose(window)) { // Render here glClear(GL_COLOR_BUFFER_BIT); // Swap front and back buffers glfwSwapBuffers(window); // Poll for and process events glfwPollEvents(); } glfwTerminate(); return 0; }
20.434783
60
0.624468
[ "render" ]
2fce8852207cb353d1b266103ed43d04aa424312
8,243
h
C
src/include/fst/concat.h
grammatek/openfst
ee52bdb80e60a0d0e82ba9399d53a4bb876a966a
[ "Apache-2.0" ]
25
2016-02-19T18:03:58.000Z
2022-03-09T08:12:41.000Z
src/include/fst/concat.h
grammatek/openfst
ee52bdb80e60a0d0e82ba9399d53a4bb876a966a
[ "Apache-2.0" ]
1
2021-03-11T12:30:20.000Z
2021-03-11T12:30:20.000Z
src/include/fst/concat.h
grammatek/openfst
ee52bdb80e60a0d0e82ba9399d53a4bb876a966a
[ "Apache-2.0" ]
22
2016-02-09T07:49:44.000Z
2022-02-03T06:40:27.000Z
// Copyright 2005-2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the 'License'); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an 'AS IS' BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Functions and classes to compute the concatenation of two FSTs. #ifndef FST_CONCAT_H_ #define FST_CONCAT_H_ #include <algorithm> #include <vector> #include <fst/types.h> #include <fst/expanded-fst.h> #include <fst/mutable-fst.h> #include <fst/rational.h> namespace fst { // Computes the concatenation (product) of two FSTs. If FST1 transduces string // x to y with weight a and FST2 transduces string w to v with weight b, then // their concatenation transduces string xw to yv with weight Times(a, b). // // This version modifies its MutableFst argument (in first position). // // Complexity: // // Time: O(V1 + V2 + E2) // Space: O(V1 + V2 + E2) // // where Vi is the number of states, and Ei is the number of arcs, of the ith // FST. template <class Arc> void Concat(MutableFst<Arc> *fst1, const Fst<Arc> &fst2) { using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; // Checks that the symbol table are compatible. if (!CompatSymbols(fst1->InputSymbols(), fst2.InputSymbols()) || !CompatSymbols(fst1->OutputSymbols(), fst2.OutputSymbols())) { FSTERROR() << "Concat: Input/output symbol tables of 1st argument " << "does not match input/output symbol tables of 2nd argument"; fst1->SetProperties(kError, kError); return; } const auto props1 = fst1->Properties(kFstProperties, false); const auto props2 = fst2.Properties(kFstProperties, false); const auto start1 = fst1->Start(); if (start1 == kNoStateId) { if (props2 & kError) fst1->SetProperties(kError, kError); return; } const auto numstates1 = fst1->NumStates(); if (fst2.Properties(kExpanded, false)) { fst1->ReserveStates(numstates1 + CountStates(fst2)); } for (StateIterator<Fst<Arc>> siter2(fst2); !siter2.Done(); siter2.Next()) { const auto s1 = fst1->AddState(); const auto s2 = siter2.Value(); fst1->SetFinal(s1, fst2.Final(s2)); fst1->ReserveArcs(s1, fst2.NumArcs(s2)); for (ArcIterator<Fst<Arc>> aiter(fst2, s2); !aiter.Done(); aiter.Next()) { auto arc = aiter.Value(); arc.nextstate += numstates1; fst1->AddArc(s1, arc); } } const auto start2 = fst2.Start(); for (StateId s1 = 0; s1 < numstates1; ++s1) { const auto weight = fst1->Final(s1); if (weight != Weight::Zero()) { fst1->SetFinal(s1, Weight::Zero()); if (start2 != kNoStateId) { fst1->AddArc(s1, Arc(0, 0, weight, start2 + numstates1)); } } } if (start2 != kNoStateId) { fst1->SetProperties(ConcatProperties(props1, props2), kFstProperties); } } // Computes the concatentation of two FSTs. This version modifies its // RationalFst input (in first position). template <class Arc> void Concat(RationalFst<Arc> *fst1, const Fst<Arc> &fst2) { fst1->GetMutableImpl()->AddConcat(fst2, true); } // Computes the concatentation of two FSTs. This version modifies its // MutableFst argument (in second position). // // Complexity: // // Time: O(V1 + E1) // Space: O(V1 + E1) // // where Vi is the number of states, and Ei is the number of arcs, of the ith // FST. template <class Arc> void Concat(const Fst<Arc> &fst1, MutableFst<Arc> *fst2) { using Weight = typename Arc::Weight; // Checks that the symbol table are compatible. if (!CompatSymbols(fst1.InputSymbols(), fst2->InputSymbols()) || !CompatSymbols(fst1.OutputSymbols(), fst2->OutputSymbols())) { FSTERROR() << "Concat: Input/output symbol tables of 1st argument " << "does not match input/output symbol tables of 2nd argument"; fst2->SetProperties(kError, kError); return; } const auto props1 = fst1.Properties(kFstProperties, false); const auto props2 = fst2->Properties(kFstProperties, false); const auto start2 = fst2->Start(); if (start2 == kNoStateId) { if (props1 & kError) fst2->SetProperties(kError, kError); return; } const auto numstates2 = fst2->NumStates(); if (fst1.Properties(kExpanded, false)) { fst2->ReserveStates(numstates2 + CountStates(fst1)); } for (StateIterator<Fst<Arc>> siter(fst1); !siter.Done(); siter.Next()) { const auto s1 = siter.Value(); const auto s2 = fst2->AddState(); const auto weight = fst1.Final(s1); if (weight != Weight::Zero()) { fst2->ReserveArcs(s2, fst1.NumArcs(s1) + 1); fst2->AddArc(s2, Arc(0, 0, weight, start2)); } else { fst2->ReserveArcs(s2, fst1.NumArcs(s1)); } for (ArcIterator<Fst<Arc>> aiter(fst1, s1); !aiter.Done(); aiter.Next()) { auto arc = aiter.Value(); arc.nextstate += numstates2; fst2->AddArc(s2, arc); } } const auto start1 = fst1.Start(); if (start1 != kNoStateId) { fst2->SetStart(start1 + numstates2); fst2->SetProperties(ConcatProperties(props1, props2), kFstProperties); } else { fst2->SetStart(fst2->AddState()); } } // Same as the above but can handle arbitrarily many left-hand-side FSTs, // preallocating the states. template <class Arc> void Concat(const std::vector<const Fst<Arc> *> &fsts1, MutableFst<Arc> *fst2) { fst2->ReserveStates(CountStates(fsts1) + fst2->NumStates()); for (const auto *fst1 : fsts1) Concat(*fst1, fst2); } // Computes the concatentation of two FSTs. This version modifies its // RationalFst input (in second position). template <class Arc> void Concat(const Fst<Arc> &fst1, RationalFst<Arc> *fst2) { fst2->GetMutableImpl()->AddConcat(fst1, false); } using ConcatFstOptions = RationalFstOptions; // Computes the concatenation (product) of two FSTs; this version is a delayed // FST. If FST1 transduces string x to y with weight a and FST2 transduces // string w to v with weight b, then their concatenation transduces string xw // to yv with Times(a, b). // // Complexity: // // Time: O(v1 + e1 + v2 + e2), // Space: O(v1 + v2) // // where vi is the number of states visited, and ei is the number of arcs // visited, of the ith FST. Constant time and space to visit an input state or // arc is assumed and exclusive of caching. template <class A> class ConcatFst : public RationalFst<A> { public: using Arc = A; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; ConcatFst(const Fst<Arc> &fst1, const Fst<Arc> &fst2) { GetMutableImpl()->InitConcat(fst1, fst2); } ConcatFst(const Fst<Arc> &fst1, const Fst<Arc> &fst2, const ConcatFstOptions &opts) : RationalFst<Arc>(opts) { GetMutableImpl()->InitConcat(fst1, fst2); } // See Fst<>::Copy() for doc. ConcatFst(const ConcatFst &fst, bool safe = false) : RationalFst<Arc>(fst, safe) {} // Get a copy of this ConcatFst. See Fst<>::Copy() for further doc. ConcatFst *Copy(bool safe = false) const override { return new ConcatFst(*this, safe); } private: using ImplToFst<internal::RationalFstImpl<Arc>>::GetImpl; using ImplToFst<internal::RationalFstImpl<Arc>>::GetMutableImpl; }; // Specialization for ConcatFst. template <class Arc> class StateIterator<ConcatFst<Arc>> : public StateIterator<RationalFst<Arc>> { public: explicit StateIterator(const ConcatFst<Arc> &fst) : StateIterator<RationalFst<Arc>>(fst) {} }; // Specialization for ConcatFst. template <class Arc> class ArcIterator<ConcatFst<Arc>> : public ArcIterator<RationalFst<Arc>> { public: using StateId = typename Arc::StateId; ArcIterator(const ConcatFst<Arc> &fst, StateId s) : ArcIterator<RationalFst<Arc>>(fst, s) {} }; // Useful alias when using StdArc. using StdConcatFst = ConcatFst<StdArc>; } // namespace fst #endif // FST_CONCAT_H_
33.50813
80
0.683125
[ "vector" ]
2fd864766b1ac686efde93fadc1f0c362800a774
4,713
h
C
mediapipe/gpu/gpu_buffer.h
Ensteinjun/mediapipe
38be2ec58f2a1687f4ffca287094c7bbd7791f58
[ "Apache-2.0" ]
55
2020-08-06T05:57:42.000Z
2022-03-16T08:37:22.000Z
mediapipe/gpu/gpu_buffer.h
Ensteinjun/mediapipe
38be2ec58f2a1687f4ffca287094c7bbd7791f58
[ "Apache-2.0" ]
3
2021-02-18T07:07:47.000Z
2021-09-19T18:33:32.000Z
mediapipe/gpu/gpu_buffer.h
Ensteinjun/mediapipe
38be2ec58f2a1687f4ffca287094c7bbd7791f58
[ "Apache-2.0" ]
14
2020-08-28T01:26:37.000Z
2022-02-13T04:10:44.000Z
// Copyright 2019 The MediaPipe Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef MEDIAPIPE_GPU_GPU_BUFFER_H_ #define MEDIAPIPE_GPU_GPU_BUFFER_H_ #include <utility> #include "mediapipe/gpu/gl_base.h" #include "mediapipe/gpu/gpu_buffer_format.h" #if defined(__APPLE__) #include <CoreVideo/CoreVideo.h> #include "mediapipe/objc/CFHolder.h" #endif // defined(__APPLE__) #if !MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER #include "mediapipe/gpu/gl_texture_buffer.h" #endif // MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER namespace mediapipe { // This class wraps a platform-specific buffer of GPU data. // An instance of GpuBuffer acts as an opaque reference to the underlying // data object. class GpuBuffer { public: // Default constructor creates invalid object. GpuBuffer() = default; // Copy and move constructors and assignment operators are supported. GpuBuffer(const GpuBuffer& other) = default; GpuBuffer(GpuBuffer&& other) = default; GpuBuffer& operator=(const GpuBuffer& other) = default; GpuBuffer& operator=(GpuBuffer&& other) = default; // Constructors from platform-specific representations, and accessors for the // underlying platform-specific representation. Use with caution, since they // are not portable. Applications and calculators should normally obtain // GpuBuffers in a portable way from the framework, e.g. using // GpuBufferMultiPool. #if MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER explicit GpuBuffer(CFHolder<CVPixelBufferRef> pixel_buffer) : pixel_buffer_(std::move(pixel_buffer)) {} explicit GpuBuffer(CVPixelBufferRef pixel_buffer) : pixel_buffer_(pixel_buffer) {} CVPixelBufferRef GetCVPixelBufferRef() const { return *pixel_buffer_; } #else explicit GpuBuffer(GlTextureBufferSharedPtr texture_buffer) : texture_buffer_(std::move(texture_buffer)) {} const GlTextureBufferSharedPtr& GetGlTextureBufferSharedPtr() const { return texture_buffer_; } #endif // MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER int width() const; int height() const; GpuBufferFormat format() const; // Converts to true iff valid. explicit operator bool() const { return operator!=(nullptr); } bool operator==(const GpuBuffer& other) const; bool operator!=(const GpuBuffer& other) const { return !operator==(other); } // Allow comparison with nullptr. bool operator==(std::nullptr_t other) const; bool operator!=(std::nullptr_t other) const { return !operator==(other); } // Allow assignment from nullptr. GpuBuffer& operator=(std::nullptr_t other); private: #if MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER CFHolder<CVPixelBufferRef> pixel_buffer_; #else GlTextureBufferSharedPtr texture_buffer_; #endif // MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER }; #if MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER inline int GpuBuffer::width() const { return static_cast<int>(CVPixelBufferGetWidth(*pixel_buffer_)); } inline int GpuBuffer::height() const { return static_cast<int>(CVPixelBufferGetHeight(*pixel_buffer_)); } inline GpuBufferFormat GpuBuffer::format() const { return GpuBufferFormatForCVPixelFormat( CVPixelBufferGetPixelFormatType(*pixel_buffer_)); } inline bool GpuBuffer::operator==(std::nullptr_t other) const { return pixel_buffer_ == other; } inline bool GpuBuffer::operator==(const GpuBuffer& other) const { return pixel_buffer_ == other.pixel_buffer_; } inline GpuBuffer& GpuBuffer::operator=(std::nullptr_t other) { pixel_buffer_.reset(other); return *this; } #else inline int GpuBuffer::width() const { return texture_buffer_->width(); } inline int GpuBuffer::height() const { return texture_buffer_->height(); } inline GpuBufferFormat GpuBuffer::format() const { return texture_buffer_->format(); } inline bool GpuBuffer::operator==(std::nullptr_t other) const { return texture_buffer_ == other; } inline bool GpuBuffer::operator==(const GpuBuffer& other) const { return texture_buffer_ == other.texture_buffer_; } inline GpuBuffer& GpuBuffer::operator=(std::nullptr_t other) { texture_buffer_ = other; return *this; } #endif // MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER } // namespace mediapipe #endif // MEDIAPIPE_GPU_GPU_BUFFER_H_
31.211921
79
0.765118
[ "object" ]
2fdfd43246af25a07a0de9c447cc0eda072b05f4
13,663
h
C
vendors/cypress/WICED_SDK/include/wiced_tls.h
ictk-solution-dev/amazon-freertos
cc76512292ddfb70bba3030dbcb740ef3c6ead8b
[ "MIT" ]
2
2020-06-23T08:05:58.000Z
2020-06-24T01:25:51.000Z
vendors/cypress/WICED_SDK/include/wiced_tls.h
ictk-solution-dev/amazon-freertos
cc76512292ddfb70bba3030dbcb740ef3c6ead8b
[ "MIT" ]
2
2022-03-29T05:16:50.000Z
2022-03-29T05:16:50.000Z
vendors/cypress/WICED_SDK/include/wiced_tls.h
ictk-solution-dev/amazon-freertos
cc76512292ddfb70bba3030dbcb740ef3c6ead8b
[ "MIT" ]
null
null
null
/* * Copyright 2019, Cypress Semiconductor Corporation or a subsidiary of * Cypress Semiconductor Corporation. All Rights Reserved. * * This software, associated documentation and materials ("Software") * is owned by Cypress Semiconductor Corporation, * or one of its subsidiaries ("Cypress") and is protected by and subject to * worldwide patent protection (United States and foreign), * United States copyright laws and international treaty provisions. * Therefore, you may use this Software only as provided in the license * agreement accompanying the software package from which you * obtained this Software ("EULA"). * If no EULA applies, Cypress hereby grants you a personal, non-exclusive, * non-transferable license to copy, modify, and compile the Software * source code solely for use in connection with Cypress's * integrated circuit products. Any reproduction, modification, translation, * compilation, or representation of this Software except as specified * above is prohibited without the express written permission of Cypress. * * Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress * reserves the right to make changes to the Software without notice. Cypress * does not assume any liability arising out of the application or use of the * Software or any product or circuit described in the Software. Cypress does * not authorize its products for use in any products where a malfunction or * failure of the Cypress product may reasonably be expected to result in * significant property damage, injury or death ("High Risk Product"). By * including Cypress's product in a High Risk Product, the manufacturer * of such system or application assumes all risk of such use and in doing * so agrees to indemnify Cypress against all liability. */ #pragma once #ifndef WICED_DISABLE_TLS #include "tls_types.h" #endif #include "wiced_result.h" #ifdef __cplusplus extern "C" { #endif /****************************************************** * Macros ******************************************************/ /****************************************************** * Constants ******************************************************/ /****************************************************** * Enumerations ******************************************************/ /****************************************************** * Type Definitions ******************************************************/ /****************************************************** * Structures ******************************************************/ /****************************************************** * Global Variables ******************************************************/ /****************************************************** * Function Declarations ******************************************************/ /*****************************************************************************/ /** * @addtogroup tls TLS Security * @ingroup ipcoms * * Security initialisation functions for TLS enabled connections (Transport Layer Security - successor to SSL Secure Sockets Layer ) * * These APIs are common to both TLS client and server entities. By default, the library supports TLS v1.2 and v1.1. * * The following snippet/pseudo-code demonstrates a sample API call flow for a secure TLS client: * * 1. wiced_tcp_create_socket ( ) (Create TCP socket) * * 2. wiced_init_root_ca_certificates ( ) (Optional API. Needed only if RootCA certificates are to be loaded and verified against the peer server certificate) * * 3. wiced_tls_init_identity ( ) (Optional API. Needed only if client application desires to load its own certificate & private key) * * 4. wiced_tls_init_context ( ) (This API initializes a TLS context. Context has all the bookkeeping information to create and manage a secure connection) * * 5. wiced_tls_set_extensions ( ) (Optional API. Needed only if client desires to use TLS extension such as Maximum Fragment Length, Server Name Indication etc.) * * 6. wiced_tcp_enable_tls ( ) (Enable TLS over the normal TCP socket that was created in the first step) * * 7. wiced_tcp_connect ( ) (Initiate a TCP connection to the remote TCP/TLS server) * * The following snippet/pseudo-code demonstrates a sample API call flow for a secure TLS server: * * 1. wiced_tcp_create_socket ( ) (Create TCP socket) * * 2. wiced_init_root_ca_certificates ( ) (Optional API. Needed only if RootCA certificates are to be loaded and verified against the peer client certificate) * * 3. wiced_tls_init_identity ( ) (Optional API. Needed only if server application desires to load its own certificate & private key) * * 4. wiced_tls_init_context ( ) (This API initializes a TLS context. Context has all the bookkeeping information to create and manage a secure connection) * * 5. wiced_tcp_enable_tls ( ) (Enable TLS over the normal TCP socket that was created in the first step) * * 6. wiced_tcp_server_accept ( ) (Accept incoming TCP connection from remote TCP/TLS client) * * The client and server applications may optionally store the certificate and private keys via the WICED DCT * using the Makefile MACROs CERTIFICATE and PRIVATE_KEY. * * To store the certificate, the application MUST place the certificate in the 'resources' folder of the SDK, * define the following MACRO 'CERTIFICATE' in the application makefile and assign the path to the certificate. * For instance, CERTIFICATE := $(SOURCE_ROOT)resources/certificates/wiced_demo_server_cert.cer * * Similarly, to store the private key, the application MUST place the key in the 'resources' folder of the SDK, * define the following MACRO 'PRIVATE_KEY' in the application makefile and assign the path to the key. * For instance, PRIVATE_KEY := $(SOURCE_ROOT)resources/certificates/wiced_demo_server_cert_key.key * * @{ */ /*****************************************************************************/ #ifndef WICED_DISABLE_TLS /** Initialises a simple TLS context handle * * @param[out] context : A pointer to a wiced_tls_context_t context object that will be initialised. * The context object is analogous to a cookie which has all the information to process a TLS message. * This is the entity that has all the bookkeeping information (TLS handshake state, TLS session etc.). * @param[in] identity : A pointer to a wiced_tls_identity_t object initialised with @ref wiced_tls_init_identity. * @param[in] peer_cn : Expected peer CommonName (or NULL) * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_init_context( wiced_tls_context_t* context, wiced_tls_identity_t* identity, const char* peer_cn ); /** Initialise the trusted root CA certificates for the TLS context. * * This API is optional and only needed if the client desires to the collection of trusted root CA certificates * to verify the received certificate for this connection context. * * @param[in,out] context : A pointer to a wiced_tls_context_t context object * @param[in] trusted_ca_certificates : A chain of x509 certificates in PEM or DER format. * This chain of certificates comprise the public keys of the signing authorities. * During the handshake, these public keys are used to verify the authenticity of the peer * @param[in] length : Certificate length * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_set_context_root_ca_certificates( wiced_tls_context_t* context, const char* trusted_ca_certificates, const uint32_t length ); /** Set TLS extension. * * This API is optional and only needed if the client desires to use one of the TLS extensions * such as Maximum Fragment Length, Server Name Indication, Application Layer Protocol Negotiation etc. * * @param[in,out] context : A pointer to a wiced_tls_context_t context object * @param[in] extension : A pointer to a wiced_tls_extension_t extension * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_set_extension(wiced_tls_context_t* context, wiced_tls_extension_t* extension); /** Initializes a TLS identity using a supplied certificate and private key * * @param[out] identity : A pointer to a wiced_tls_identity_t object that will be initialized * The identity is a data structure that encompasses the device's own certificate/key. * @param[in] private_key : The server private key in binary format. This key is used to sign the handshake message * @param[in] key_length : Private key length * @param[in] certificate_data : The server x509 certificate in PEM or DER format * @param[in] certificate_length : The length of the certificate * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_init_identity( wiced_tls_identity_t* identity, const char* private_key, const uint32_t key_length, const uint8_t* certificate_data, uint32_t certificate_length ); /** Add pair of certificate and private key to identity. * NOTE: This API should be only used for server to configure multiple certificate & key ex. adding certificate and key of RSA and ECDSA type. If used for client, then only first pair of certificate * & key pair will be used. * * @param[in] identity : A pointer to a wiced_tls_identity_t object. * The identity is a data structure that encompasses the device's own certificate/key. * @param[out] credential : Pointer to a credential info. This must be unique for each certificate-key pair and has to be alive as long as certificate/key is valid. * @param[in] private_key : The server private key in binary format. This key is used to sign the handshake message * @param[in] key_length : Private key length * @param[in] certificate_data : The server x509 certificate in PEM or DER format * @param[in] certificate_length : The length of the certificate * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_add_identity( wiced_tls_identity_t* identity, wiced_tls_credentials_info_t* credential, const char* private_key, const uint32_t key_length, const uint8_t* certificate_data, uint32_t certificate_length ); /** Remove pre-added pair of certificate and key from identity. This API should be used only for server to remove pre-loaded certificate & key pair. The API should be only used for server. * * @param[in] identity : A pointer to a wiced_tls_identity_t object. * The identity is a data structure that encompasses the device's own certificate/key. * @param[in] credential : Pointer to the credential which was used to invoke wiced_tls_add_identity() API while adding identity. * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_remove_identity( wiced_tls_identity_t* identity, wiced_tls_credentials_info_t* credential ); /** * * @deprecated: This API is deprecated and will be discontinued. Use wiced_tls_set_extension() instead. * * Adds a TLS extension to the list of extensions sent in Client Hello message. * * @param[in] context : A pointer to a wiced_tls context initialized with wiced_tls_init_context * @param[in] extension : A pointer to an extension to be added in client hello message. * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_add_extension( wiced_tls_context_t* context, const ssl_extension* extension ); /** DeiInitialises a TLS identity * * @param[in] identity : A pointer to a wiced_tls_identity_t object that will be de-initialised * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_deinit_identity( wiced_tls_identity_t* tls_identity); /** Initialise the trusted root CA certificates * * Initialises the collection of trusted root CA certificates used to verify received certificates * * @param[in] trusted_ca_certificates : A chain of x509 certificates in PEM or DER format. * This chain of certificates comprise the public keys of the signing authorities. * During the handshake, these public keys are used to verify the authenticity of the peer * @param[in] length : Certificate length * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_init_root_ca_certificates( const char* trusted_ca_certificates, const uint32_t length ); /** De-initialise the trusted root CA certificates * * De-initialises the collection of trusted root CA certificates used to verify received certificates * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_deinit_root_ca_certificates( void ); /** De-initialise a previously inited simple or advanced context * * @param[in,out] context : A pointer to either a wiced_tls_context_t object * * @return @ref wiced_result_t */ wiced_result_t wiced_tls_deinit_context( wiced_tls_context_t* context ); /** @} */ #endif #ifdef __cplusplus } /* extern "C" */ #endif
52.148855
229
0.670204
[ "object" ]
2fe44cffb5064c00891c11ac3e811635634c89b8
330
h
C
src/renderer/ray_cast_model_hit.h
galek/LumixEngine
d7d1738f7fc2bc7f6cf08d1217330a591b370ed9
[ "MIT" ]
8
2015-09-06T20:05:27.000Z
2021-07-14T11:12:33.000Z
src/renderer/ray_cast_model_hit.h
gamedevforks/LumixEngine
d7d1738f7fc2bc7f6cf08d1217330a591b370ed9
[ "MIT" ]
null
null
null
src/renderer/ray_cast_model_hit.h
gamedevforks/LumixEngine
d7d1738f7fc2bc7f6cf08d1217330a591b370ed9
[ "MIT" ]
null
null
null
#pragma once #include "lumix.h" #include "core/vec3.h" namespace Lumix { class LUMIX_RENDERER_API RayCastModelHit { public: bool m_is_hit; float m_t; Vec3 m_origin; Vec3 m_dir; class Mesh* m_mesh; ComponentIndex m_component; Entity m_entity; uint32_t m_component_type; }; } // ~ namespace Lumix
13.2
41
0.69697
[ "mesh" ]
2fe5cca54ea774f2bc61a62f44ce12c91a0b6bc0
19,262
h
C
src/media/audio/audio_core/stream2.h
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
[ "BSD-2-Clause" ]
2
2022-02-24T16:24:29.000Z
2022-02-25T22:33:10.000Z
src/media/audio/audio_core/stream2.h
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
[ "BSD-2-Clause" ]
null
null
null
src/media/audio/audio_core/stream2.h
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
[ "BSD-2-Clause" ]
null
null
null
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SRC_MEDIA_AUDIO_AUDIO_CORE_STREAM_H_ #define SRC_MEDIA_AUDIO_AUDIO_CORE_STREAM_H_ #include <fuchsia/media/cpp/fidl.h> #include <lib/fpromise/result.h> #include <lib/zx/time.h> #include <optional> #include <fbl/static_vector.h> #include "src/media/audio/audio_core/packet.h" #include "src/media/audio/audio_core/stage_metrics.h" #include "src/media/audio/audio_core/stream_usage.h" #include "src/media/audio/audio_core/verbose_log.h" #include "src/media/audio/lib/clock/audio_clock.h" #include "src/media/audio/lib/format/format.h" #include "src/media/audio/lib/timeline/timeline_function.h" // TODO(fxbug.dev/50669): namespace is temporary until we move this file to stream.h namespace media::audio::stream2 { // TODO(fxbug.dev/50669): remove after replacing stream.h using ::media::audio::AudioClock; using ::media::audio::Fixed; using ::media::audio::Format; using ::media::audio::StageMetrics; using ::media::audio::StreamUsageMask; // A stream represents a single stage in an audio processing graph. class BaseStream { public: static constexpr bool kLogPresentationDelay = false; BaseStream(std::string_view name, Format format) : name_(name), format_(format) {} virtual ~BaseStream() = default; // A name provided for debugging. std::string_view name() const { return name_; } // Format of data generated by this stream. // TODO(fxbug.dev/58740): make sure this is accurate in all implementations. const Format& format() const { return format_; } // A snapshot of a `TimelineFunction` with an associated `generation`. If `generation` is equal // between two subsequent calls to `ref_time_to_fract_presentation_frame`, then the // `timeline_function` is guaranteed to be unchanged. struct TimelineFunctionSnapshot { TimelineFunction timeline_function; uint32_t generation; }; // This function translates from a timestamp to the corresponding fixed-point frame number that // will be presented at that time. The timestamp is relative to the stream's reference clock. virtual TimelineFunctionSnapshot ref_time_to_frac_presentation_frame() const = 0; virtual AudioClock& reference_clock() = 0; // Common shorthands to convert between PTS and frame numbers. Fixed FracPresentationFrameAtRefTime(zx::time ref_time) const { return Fixed::FromRaw( ref_time_to_frac_presentation_frame().timeline_function.Apply(ref_time.get())); } zx::time RefTimeAtFracPresentationFrame(Fixed frame) const { return zx::time( ref_time_to_frac_presentation_frame().timeline_function.ApplyInverse(frame.raw_value())); } // The presentation delay is defined to be the absolute difference between a frame's // presentation timestamp and the frame's safe read/write timestamp. This is always a // positive number. Ideally this should be the exact delay, if known, and otherwise a // true upper-bound of the delay, however in practice it is sometimes a best-effort // estimate that can be either low or high. // // For render pipelines, this represents the delay between reading a frame with // ReadLock and actually rendering the frame at an output device. This is also known as // the "min lead time". // // For capture pipelines, this represents the delay between capturing a frame at // an input device and reading that frame with ReadLock. zx::duration GetPresentationDelay() const { return presentation_delay_.load(); } // Presentation delays are propagated from destination streams to source streams. The // delay passed to the source stream is typically external_delay + intrinsic_delay. // The default implementation is sufficient for pipeline stages that do not introduce // extra delay. virtual void SetPresentationDelay(zx::duration external_delay) { presentation_delay_.store(external_delay); } private: std::string name_; Format format_; std::atomic<zx::duration> presentation_delay_{zx::duration(0)}; }; // A read-only stream of audio data. // ReadableStreams should be created and held as shared_ptr<>s. class ReadableStream : public BaseStream, public std::enable_shared_from_this<ReadableStream> { public: class Buffer { public: ~Buffer() { if (dtor_) { dtor_(consumed_); } } Buffer(Buffer&& rhs) = default; Buffer& operator=(Buffer&& rhs) = default; Buffer(const Buffer& rhs) = delete; Buffer& operator=(const Buffer& rhs) = delete; Fixed start() const { return start_; } Fixed end() const { return end_; } int64_t length() const { return length_; } void* payload() const { return payload_; } // Call this to indicate that frames [start(), start()+frames) have been consumed. // If not called before the Buffer is discarded, we assume the entire buffer has been consumed. void set_frames_consumed(int64_t frames) { FX_CHECK(frames <= length_) << ffl::String::DecRational << frames << " > " << length_; consumed_ = frames; } // Returns the set of usages that have contributed to this buffer. StreamUsageMask usage_mask() const { return usage_mask_; } // Returns the total gain that has been applied to the source stream. A source stream may be the // result of mixing many other sources, so in practice this value is the maximum accumulated // gain applied to any input to this source stream. // // For example, if this source stream is the result of mixing Stream A with gain -12dB applied, // and Stream B with gain +2dB applied, then total_applied_gain_db() would return +2.0. // // This is entirely unrelated to actual stream signal content and should only be used as a rough // indicator of the amplitude of the source stream. float total_applied_gain_db() const { return total_applied_gain_db_; } private: friend class ReadableStream; using DestructorT = fit::callback<void(int64_t frames_consumed)>; Buffer(Fixed start_frame, int64_t length_in_frames, void* payload, bool cache_this_buffer, StreamUsageMask usage_mask, float total_applied_gain_db, DestructorT dtor) : dtor_(std::move(dtor)), payload_(payload), start_(start_frame), end_(start_frame + Fixed(length_in_frames)), length_(length_in_frames), consumed_(length_in_frames), cache_this_buffer_(cache_this_buffer), usage_mask_(usage_mask), total_applied_gain_db_(total_applied_gain_db) {} DestructorT dtor_; void* payload_; Fixed start_; Fixed end_; int64_t length_; int64_t consumed_; bool cache_this_buffer_; StreamUsageMask usage_mask_; float total_applied_gain_db_; }; // ReadLockContext provides a container for state that can be carried through a // sequence of ReadLock calls. class ReadLockContext { private: // Capacity of per_stage_metrics_. static constexpr size_t kMaxStages = 16; public: // Adds the given metrics. Internally we maintain one StageMetrics object per stage. // If this method is called multiple times with the same stage name, the metrics are // accumulated. void AddStageMetrics(const StageMetrics& new_stage) { for (auto& old_stage : per_stage_metrics_) { if (std::string_view(old_stage.name) == std::string_view(new_stage.name)) { old_stage += new_stage; return; } } // Add a new stage, or silently drop if we've exceeded the maximum. if (per_stage_metrics_.size() < kMaxStages) { per_stage_metrics_.push_back(new_stage); } } // Returns all metrics accumulated via AddMetrics. using StageMetricsVector = fbl::static_vector<StageMetrics, kMaxStages>; const StageMetricsVector& per_stage_metrics() { return per_stage_metrics_; } private: StageMetricsVector per_stage_metrics_; }; // ReadableStream is implemented by audio pipeline stages that consume zero or more source // streams and produce a destination stream. ReadLock acquires a read lock on the destination // stream. The parameters `dest_frame` and `frame_count` represent a range of frames on the // destination stream's frame timeline. // // THE RETURNED BUFFER // // If no data is available for the requested frame range, ReadLock returns std::nullopt. // Otherwise, ReadLock returns a buffer representing all or part of the requested range. // If `start()` on the returned buffer is greater than `dest_frame`, then the stream // has no data for those initial frames and it may be treated as silence. Conversely, if `end()` // on the returned buffer is less than `dest_frame + frame_count`, this indicates the full // frame range is not available on a single contiguous buffer. Clients should call `ReadLock` // again, with `dest_frame` set to the `end()` of the previous buffer, to query if the stream // has more frames. // // The buffer must contain an integral number of frames and must satisfy the following // conditions: // // - buffer.start() > dest_frame - Fixed(1) // - buffer.end() <= dest_frame + Fixed(frame_count) // - buffer.length() <= frame_count // // The buffer's `start()` is the position of the left edge of the first frame in the buffer. // For example, given `ReadLock(Fixed(10), 5)`, if the stream's frames happen to be aligned // on positions 9.1, 10.1, 11.1, etc., then ReadLock should return a buffer with `start() = 9.1` // and `length() = 5`. // // The stream will remain locked until thebuffer is destructed. // // THE PASSAGE OF TIME // // Each ReadableStream maintains a current frame position (aka time). This position must always // move forward. Position advances to X after a call to `Trim(X)`. Position is also advanced by // ReadLock, which calls Trim as follows: // // - If ReadLock returns std::nullopt, we advance time to // `Trim(dest_frame + frame_count)`. // // - When a buffer is unlocked, we advance time to // `Trim(buffer.start + buffer.frames_consumed)`. // // Put differently, time advances when ReadLock is called, when a buffer is consumed, and on // explicit calls to Trim. Time does not go backwards: each call to ReadLock must have // `dest_frame` >= the last trimmed frame. // // RESET // // Changing a stream's ref_time_to_frac_presentation_frame TimelineFunction discards all history // recorded by prior calls to ReadLock and Trim. This allows time to go backwards as a one-time // event after a Play or Pause command seeks backwards in a stream. Note that when time advances // normally past X, then is reset to X or earlier (by Play), all internal caches are discarded // and there's no requirement for a source to reproduce the same audio that was played at X the // first time. std::optional<Buffer> ReadLock(ReadLockContext& ctx, Fixed dest_frame, int64_t frame_count); // Trims the stream by releasing any frames before the given frame. This is a declaration // that the caller will not attempt to ReadLock any frame before dest_frame. If the stream has // allocated buffers for frames before dest_frame, it can free those buffers now. // Must not be called while the stream is locked. void Trim(Fixed dest_frame); // Reports the highest frame passed to Trim, or std::nullopt if Trim has not been called or // if the stream has been reset since the last Trim. std::optional<Fixed> LastTrimmedFrame() { DetectTimelineUpdate(); return next_dest_frame_; } protected: // `name` should uniquely identify the stream. Used for debugging. ReadableStream(std::string name, Format format); // Child classes must provide stream-specific implementations of ReadLockImpl and TrimImpl. // These are called by ReadLock and Trim, respectively. // ReadLock and Trim add some default behavior, including logging, tracing, caching of // partially-consumed buffers, and validation of pre and post conditions. virtual std::optional<Buffer> ReadLockImpl(ReadLockContext& ctx, Fixed dest_frame, int64_t frame_count) = 0; virtual void TrimImpl(Fixed dest_frame) = 0; // ReadLockImpl should use this to create a cached buffer. If the buffer is not fully // consumed after one ReadLock, the next ReadLock call will return the same buffer // without asking ReadLockImpl to recreate the same data. ReadableStream will hold // onto this buffer until the buffer is fully consumed or trimmed away. // // This is useful for pipeline stages that compute buffers dynamically, such as mixers // and effects. The std::optional return type is for convenience (so that `MakeCachedBuffer(...)` // can be returned directly from ReadLockImpl) -- the returned value is never std::nullopt. // // REQUIRED: // - The buffer's `start()` must obey the buffer constraints described by ReadLock, // however the buffer's `length()` can be arbitrarily large. This is useful for pipeline // stages that generate data in fixed-sized blocks: they may cache the entire block for // future ReadLock calls. // - The payload must remain valid until the buffer is fully consumed, i.e. until the // stream is Trim'd past the end of the buffer. std::optional<Buffer> MakeCachedBuffer(Fixed start_frame, int64_t frame_count, void* payload, StreamUsageMask usage_mask, float total_applied_gain_db); // ReadLockImpl should use this to create an uncached buffer. If the buffer is not fully // consumed after one ReadLock, the next ReadLock call will ask ReadLockImpl to recreate // the buffer. // // This is useful for streams that don't need caching or that want precise control over // buffer lifetimes. Examples include ring buffers and packet queues. The std::optional // return type is for convenience -- the returned value is never std::nullopt. // // REQUIRED: // - The buffer's `start()` and `length()` must obey the buffer constraints described // by ReadLock (above). // - The payload must remain valid until the buffer is unlocked. std::optional<Buffer> MakeUncachedBuffer(Fixed start_frame, int64_t frame_count, void* payload, StreamUsageMask usage_mask, float total_applied_gain_db); // ReadLockImpl should use this when forwarding a Buffer from an upstream source. // This may be used by no-op pipeline stages. It is necessary to call ForwardBuffer, // rather than simply returning a buffer from an upstream source, so that this stream // will be Trim'd when the buffer is unlocked: // // // Good: calls this->Trim() and src->Trim() when unlocked // return ForwardBuffer(src->ReadLock(ctx, dest_frame, frame_count)); // // // Bad: calls src->Trim() when unlocked, but not this->Trim() // return src->ReadLock(ctx, dest_frame, frame_count); // // If `start_frame` is specified, the returned buffer's starting frame is set to the // given value. This shrinks the buffer by moving the starting frame forward and while // the last frame is fixed. The new `start_frame` must: // // * Be integral: (start_frame - buffer->start()).Fraction() == 0 // * Be within the buffer: (start_frame - buffer->start()) < buffer->length() // // This is useful when doing SampleAndHold on a source stream. For example: // // auto buffer = src->ReadLock(ctx, frame, frame_count); // auto start_frame = buffer->start().Ceiling(); // return ForwardBufferWithModifiedStart(std::move(buffer), start_frame); // // If start_frame is not specified, the buffers is forwarded unchanged. std::optional<Buffer> ForwardBuffer(std::optional<Buffer>&& buffer, std::optional<Fixed> start_frame = std::nullopt); private: void DetectTimelineUpdate(); std::optional<ReadableStream::Buffer> ReadFromCachedBuffer(Fixed start_frame, int64_t frame_count); std::optional<uint32_t> timeline_function_generation_; std::optional<Fixed> next_dest_frame_; // marks the passage of time std::optional<Fixed> previous_buffer_end_; bool locked_ = false; // This is cached from the last call to ReadLockImpl. // We hold onto this until buffer until next_dest_frame_ >= cached_->end. std::optional<ReadableStream::Buffer> cached_; // For TRACE_DURATION, which requires C strings. const std::string name_for_read_lock_; const std::string name_for_trim_; }; // A write-only stream of audio data. class WritableStream : public BaseStream { public: class Buffer { public: using DestructorT = fit::callback<void()>; Buffer(int64_t start_frame, int64_t length_in_frames, void* payload, DestructorT dtor = nullptr) : dtor_(std::move(dtor)), payload_(payload), start_(start_frame), end_(start_frame + length_in_frames), length_(length_in_frames) {} ~Buffer() { if (dtor_) { dtor_(); } } Buffer(Buffer&& rhs) = default; Buffer& operator=(Buffer&& rhs) = default; Buffer(const Buffer& rhs) = delete; Buffer& operator=(const Buffer& rhs) = delete; int64_t start() const { return start_; } int64_t end() const { return end_; } int64_t length() const { return length_; } void* payload() const { return payload_; } private: DestructorT dtor_; void* payload_; int64_t start_; int64_t end_; int64_t length_; }; WritableStream(std::string name, Format format) : BaseStream(std::move(name), format) {} // WritableStream is implemented by audio sinks. WriteLock acquires a write lock on the // stream. The parameters `start_frame` and `frame_count` represent a range of frames on the // stream's frame timeline. // // If data cannot be written to that frame range, WriteLock returns std::nullopt. // Otherwise, WriteLock returns a buffer representing all or part of the requested range. // If `start()` on the returned buffer is greater than `start_frame`, then frames before // `start()` must not be written. Conversely, if `end()` on the returned buffer is less than // `start_frame + frame_count`, this does not indicate those frames can be omitted. Instead // it indicates the full frame range is not available on a single contiguous buffer. Clients // should call `WriteLock` again and provide the `end()` of the previous buffer as `start_frame` // to query if the stream has more frames. // // The returned buffer must not refer to frames outside of the range // [start_frame, start_frame + frame_count). // // Callers can write directly to the payload. The buffer will remain locked until it is // destructed. It is illegal to call WriteLock again until the lock has been released. virtual std::optional<Buffer> WriteLock(int64_t start_frame, int64_t frame_count) = 0; }; } // namespace media::audio::stream2 #endif // SRC_MEDIA_AUDIO_AUDIO_CORE_STREAM_H_
44.795349
100
0.710207
[ "render", "object" ]
2fe5d0afb9908f6f59a5ad11041298be48a7aa9c
17,200
h
C
hybridse/include/vm/catalog.h
xuman2019/OpenMLDB
38d533cca517c2e119f574d5dc7f93469504d68a
[ "Apache-2.0" ]
1
2021-11-01T10:16:37.000Z
2021-11-01T10:16:37.000Z
hybridse/include/vm/catalog.h
xuman2019/OpenMLDB
38d533cca517c2e119f574d5dc7f93469504d68a
[ "Apache-2.0" ]
14
2021-04-30T06:14:30.000Z
2022-01-07T22:45:09.000Z
hybridse/include/vm/catalog.h
xuman2019/OpenMLDB
38d533cca517c2e119f574d5dc7f93469504d68a
[ "Apache-2.0" ]
1
2021-04-30T06:28:46.000Z
2021-04-30T06:28:46.000Z
/* * Copyright 2021 4Paradigm * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INCLUDE_VM_CATALOG_H_ #define INCLUDE_VM_CATALOG_H_ #include <map> #include <memory> #include <set> #include <string> #include <utility> #include <vector> #include "base/fe_slice.h" #include "base/fe_status.h" #include "codec/fe_row_codec.h" #include "codec/list_iterator_codec.h" #include "codec/row.h" #include "proto/fe_type.pb.h" #include "sdk/base.h" namespace hybridse { namespace vm { using hybridse::codec::ColInfo; using hybridse::codec::ListV; using hybridse::codec::Row; using hybridse::codec::RowIterator; using hybridse::codec::Schema; using hybridse::codec::WindowIterator; constexpr uint32_t INVALID_POS = UINT32_MAX; ///< Invalid position. A column position is invalid if equals to INVALID_POS /// Represents index information, e.g, name, first keys, second key /// information struct IndexSt { std::string name; ///< index name uint32_t index; ///< position of index uint32_t ts_pos; ///< second key column position std::vector<ColInfo> keys; ///< first keys set }; /// \typedef IndexList repeated fields of IndexDef typedef ::google::protobuf::RepeatedPtrField<::hybridse::type::IndexDef> IndexList; /// \typedef Types a map with string type key and ColInfo value typedef std::map<std::string, ColInfo> Types; /// \typedef IndexHint a map with string type key and IndexSt value typedef std::map<std::string, IndexSt> IndexHint; class PartitionHandler; class TableHandler; class RowHandler; class Tablet; enum HandlerType { kRowHandler, kTableHandler, kPartitionHandler }; enum OrderType { kDescOrder, kAscOrder, kNoneOrder }; /// \brief The basic dataset operation abstraction. /// /// It contains the basic operations available on all row-based dataset /// handlers, such as TableHandler, Partitionhandler. class DataHandler : public ListV<Row> { public: DataHandler() {} virtual ~DataHandler() {} /// Return table schema. virtual const Schema* GetSchema() = 0; /// Return table name. virtual const std::string& GetName() = 0; /// Return the name of database. virtual const std::string& GetDatabase() = 0; /// Return the type of DataHandler. virtual const HandlerType GetHanlderType() = 0; /// Return the name of handler type virtual const std::string GetHandlerTypeName() = 0; /// Return dataset status. Default is hybridse::common::kOk virtual base::Status GetStatus() { return base::Status::OK(); } }; /// \brief A sequence of DataHandler class DataHandlerList { public: DataHandlerList() {} virtual ~DataHandlerList() {} /// Return the number of elements virtual size_t GetSize() = 0; /// Return the idx-th element virtual std::shared_ptr<DataHandler> Get(size_t idx) = 0; }; /// \brief A implementation of DataHandlerList. class DataHandlerVector : public DataHandlerList { public: DataHandlerVector() : data_handlers_() {} ~DataHandlerVector() {} void Add(std::shared_ptr<DataHandler> data_handler) { data_handlers_.push_back(data_handler); } /// Return the number of elements size_t GetSize() { return data_handlers_.size(); } /// Return the idx-th element. Return `null` when position is out of range std::shared_ptr<DataHandler> Get(size_t idx) { return idx < data_handlers_.size() ? data_handlers_[idx] : std::shared_ptr<DataHandler>(); } private: std::vector<std::shared_ptr<DataHandler>> data_handlers_; }; /// \brief A implementation of DataHandlerList. /// /// Actually, we just keep one data_handler_ in container where elements are /// repeated logically. class DataHandlerRepeater : public DataHandlerList { public: /// Create DataHandlerRepeater with a DataHandler and elements number DataHandlerRepeater(std::shared_ptr<DataHandler> data_handler, size_t size) : size_(size), data_handler_(data_handler) {} ~DataHandlerRepeater() {} /// Return the number of elements size_t GetSize() { return size_; } /// Return the idx-th element. Return `null` when position is out of range std::shared_ptr<DataHandler> Get(size_t idx) { return idx < size_ ? data_handler_ : std::shared_ptr<DataHandler>(); } private: size_t size_; std::shared_ptr<DataHandler> data_handler_; }; /// \brief A row operation abstraction. class RowHandler : public DataHandler { public: RowHandler() {} virtual ~RowHandler() {} /// Return `null` since GetIterator isn't supported for a row std::unique_ptr<RowIterator> GetIterator() override { return std::unique_ptr<RowIterator>(); } /// Return `null` since GetRawIterator isn't supported for a row, RowIterator* GetRawIterator() override { return nullptr; } /// Return 0 since Getcount isn't supported for a row const uint64_t GetCount() override { return 0; } /// Return 0 since Getcount isn't supported for a row Row At(uint64_t pos) override { return Row(); } /// Return the HandlerType of the row handler. /// Return HandlerType::kRowHandler by default const HandlerType GetHanlderType() override { return kRowHandler; } /// Return value of row virtual const Row& GetValue() = 0; /// Get the name of handler type. /// \return name of handler type, default is `"RowHandler"` const std::string GetHandlerTypeName() override { return "RowHandler"; } }; /// \brief A row's error handler, representing a error row class ErrorRowHandler : public RowHandler { public: /// Creating ErrorRowHandler with status code and error msg ErrorRowHandler(common::StatusCode status_code, const std::string& msg_str) : status_(status_code, msg_str), table_name_(""), db_(""), schema_(nullptr), row_() {} ~ErrorRowHandler() {} /// Return empty Row as value const Row& GetValue() final { return row_; } /// Return handler type name, and return "ErrorRowHandler" by default. const std::string GetHandlerTypeName() override { return "ErrorRowHandler"; } const Schema* GetSchema() override { return nullptr; } const std::string& GetName() override { return table_name_; } const std::string& GetDatabase() override { return db_; } virtual base::Status GetStatus() { return status_; } private: base::Status status_; std::string table_name_; std::string db_; const Schema* schema_; Row row_; }; /// \brief A table dataset operation abstraction. class TableHandler : public DataHandler { public: TableHandler() : DataHandler() {} virtual ~TableHandler() {} /// Return table column Types information. virtual const Types& GetTypes() = 0; /// Return the index information virtual const IndexHint& GetIndex() = 0; /// Return WindowIterator /// so that user can use it to iterate datasets segment by segment. virtual std::unique_ptr<WindowIterator> GetWindowIterator( const std::string& idx_name) = 0; /// Return the HandlerType of the dataset. /// Return HandlerType::kTableHandler by default const HandlerType GetHanlderType() override { return kTableHandler; } /// Return partition handler of specify partition binding to given index. /// Return `null` by default. virtual std::shared_ptr<PartitionHandler> GetPartition( const std::string& index_name) { return std::shared_ptr<PartitionHandler>(); } /// Return the name of handler and return "TableHandler" by default. const std::string GetHandlerTypeName() override { return "TableHandler"; } /// Return the order type of the dataset, /// and return OrderType::kNoneOrder by default. virtual const OrderType GetOrderType() const { return kNoneOrder; } /// Return Tablet binding to specify index and key. /// Return `null` by default. virtual std::shared_ptr<Tablet> GetTablet(const std::string& index_name, const std::string& pk) { return std::shared_ptr<Tablet>(); } /// Return Tablet binding to specify index and keys. /// Return `null` by default. virtual std::shared_ptr<Tablet> GetTablet( const std::string& index_name, const std::vector<std::string>& pks) { return std::shared_ptr<Tablet>(); } }; /// \brief A table dataset's error handler, representing a error table class ErrorTableHandler : public TableHandler { public: /// Create ErrorTableTable with initializing status_ with /// common::kCallMethodError ErrorTableHandler() : status_(common::kCallMethodError, "error"), table_name_(""), db_(""), schema_(nullptr), types_(), index_hint_() {} /// Create ErrorTableHandler with specific status code and message ErrorTableHandler(common::StatusCode status_code, const std::string& msg_str) : status_(status_code, msg_str), table_name_(""), db_(""), schema_(nullptr), types_(), index_hint_() {} ~ErrorTableHandler() {} /// Return empty column Types. const Types& GetTypes() override { return types_; } /// Return empty table Schema. inline const Schema* GetSchema() override { return schema_; } /// Return empty table name inline const std::string& GetName() override { return table_name_; } /// Return empty indexn information inline const IndexHint& GetIndex() override { return index_hint_; } /// Return name of database inline const std::string& GetDatabase() override { return db_; } /// Return null iterator std::unique_ptr<RowIterator> GetIterator() { return std::unique_ptr<RowIterator>(); } /// Return null iterator RowIterator* GetRawIterator() { return nullptr; } /// Return null window iterator std::unique_ptr<WindowIterator> GetWindowIterator( const std::string& idx_name) { return std::unique_ptr<WindowIterator>(); } /// Return empty row virtual Row At(uint64_t pos) { return Row(); } /// Return 0 const uint64_t GetCount() override { return 0; } /// Return handler type name, and return "ErrorTableHandler" by default. const std::string GetHandlerTypeName() override { return "ErrorTableHandler"; } /// Return status virtual base::Status GetStatus() { return status_; } protected: base::Status status_; const std::string table_name_; const std::string db_; const Schema* schema_; Types types_; IndexHint index_hint_; OrderType order_type_; }; /// \brief The abstraction of partition dataset operation. /// /// A partition dataset is always organized by segments /// +-- key1 --> segment1 /// partition --+-- key2 --> segment2 /// +-- key3 --> segment3 class PartitionHandler : public TableHandler { public: PartitionHandler() : TableHandler() {} ~PartitionHandler() {} /// Return the iterator of row iterator. /// Return null by default virtual std::unique_ptr<RowIterator> GetIterator() { return std::unique_ptr<RowIterator>(); } /// Return the iterator of row iterator /// Return null by default RowIterator* GetRawIterator() { return nullptr; } virtual std::unique_ptr<WindowIterator> GetWindowIterator( const std::string& idx_name) { return std::unique_ptr<WindowIterator>(); } /// Return WindowIterator to iterate datasets /// segment-by-segment. virtual std::unique_ptr<WindowIterator> GetWindowIterator() = 0; /// Return HandlerType::kPartitionHandler by default const HandlerType GetHanlderType() override { return kPartitionHandler; } /// Return empty row, cause partition dataset does not support At operation. virtual Row At(uint64_t pos) { return Row(); } /// Return Return table handler of specific segment binding to given key. /// Return `null` by default. virtual std::shared_ptr<TableHandler> GetSegment(const std::string& key) { return std::shared_ptr<TableHandler>(); } /// Return a sequence of table handles of specify segments binding to given /// keys set. virtual std::vector<std::shared_ptr<TableHandler>> GetSegments( const std::vector<std::string>& keys) { std::vector<std::shared_ptr<TableHandler>> segments; for (auto key : keys) { segments.push_back(GetSegment(key)); } return segments; } /// Return the name of handler, and return `"PartitionHandler"` by default. const std::string GetHandlerTypeName() override { return "PartitionHandler"; } /// Return order type of the dataset, /// and return kNoneOrder by default. const OrderType GetOrderType() const { return kNoneOrder; } }; /// \brief A wrapper of table handler which is used as a asynchronous row /// handler /// /// AysncRowHandler is statefull. It is running when created. /// GetValue is invoked, status will be changed if it is running at that moment. class AysncRowHandler : public RowHandler { public: /// Create with given table_handler and row position index. /// status_ is set with common::kRunning AysncRowHandler(size_t idx, std::shared_ptr<TableHandler> aysnc_table_handler) : RowHandler(), status_(base::Status::Running()), table_name_(""), db_(""), schema_(nullptr), idx_(idx), aysnc_table_handler_(aysnc_table_handler), value_() { if (!aysnc_table_handler_) { status_ = base::Status(hybridse::common::kNullPointer, "async table handler is null"); } } virtual ~AysncRowHandler() {} /// Return the row value. /// Sync row value by invoking aysnc_table_handler_->At(idx_) /// if status isn't common::kRunning const Row& GetValue() override { if (!status_.isRunning()) { return value_; } value_ = aysnc_table_handler_->At(idx_); status_ = aysnc_table_handler_->GetStatus(); return value_; } const Schema* GetSchema() override { return schema_; } const std::string& GetName() override { return table_name_; } const std::string& GetDatabase() override { return db_; } private: base::Status status_; std::string table_name_; std::string db_; const Schema* schema_; size_t idx_; std::shared_ptr<TableHandler> aysnc_table_handler_; Row value_; }; /// \brief A component responsible to Query subtask class Tablet { public: Tablet() {} virtual ~Tablet() {} /// Return the name of tablet. virtual const std::string& GetName() const = 0; /// Return RowHandler by calling request-mode /// query on subtask which is specified by task_id and sql string virtual std::shared_ptr<RowHandler> SubQuery( uint32_t task_id, const std::string& db, const std::string& sql, const hybridse::codec::Row& row, const bool is_procedure, const bool is_debug) = 0; /// Return TableHandler by calling /// batch-request-mode query on subtask which is specified by task_id and /// sql virtual std::shared_ptr<TableHandler> SubQuery( uint32_t task_id, const std::string& db, const std::string& sql, const std::set<size_t>& common_column_indices, const std::vector<Row>& in_rows, const bool request_is_common, const bool is_procedure, const bool is_debug) = 0; }; /// \brief A Catalog handler which defines a set of operation for, e.g, /// database, table and index management. /// /// Users should implement the subclasses for their own purpose class Catalog { public: Catalog() {} virtual ~Catalog() {} /// Return whether index is supported or not. virtual bool IndexSupport() = 0; /// Return database information. virtual std::shared_ptr<type::Database> GetDatabase( const std::string& db) = 0; /// Return a table handler with given table /// name virtual std::shared_ptr<TableHandler> GetTable( const std::string& db, const std::string& table_name) = 0; /// Return ProcedureInfo instance with given database name `db` and /// procedure name `sp_name` virtual std::shared_ptr<hybridse::sdk::ProcedureInfo> GetProcedureInfo( const std::string& db, const std::string& sp_name) { return nullptr; } }; } // namespace vm } // namespace hybridse #endif // INCLUDE_VM_CATALOG_H_
34.468938
95
0.669826
[ "vector" ]
2ff37e8b3454ab12a0cd2165863561c27c07c177
4,193
h
C
src/ArrowFunctions.h
Pl4tt/arkouda
acc1a44141a46afba4cb9962477a159429a5725b
[ "MIT" ]
null
null
null
src/ArrowFunctions.h
Pl4tt/arkouda
acc1a44141a46afba4cb9962477a159429a5725b
[ "MIT" ]
null
null
null
src/ArrowFunctions.h
Pl4tt/arkouda
acc1a44141a46afba4cb9962477a159429a5725b
[ "MIT" ]
null
null
null
#include <stdint.h> #include <stdbool.h> // Wrap functions in C extern if compiling C++ object file #ifdef __cplusplus #include <iostream> #include <arrow/api.h> #include <arrow/io/api.h> #include <parquet/arrow/reader.h> #include <parquet/arrow/writer.h> #include <parquet/column_reader.h> #include <parquet/api/writer.h> extern "C" { #endif #define ARROWINT64 0 #define ARROWINT32 1 #define ARROWUINT64 2 #define ARROWUINT32 3 #define ARROWBOOLEAN 4 #define ARROWFLOAT 5 #define ARROWDOUBLE 7 #define ARROWTIMESTAMP ARROWINT64 #define ARROWSTRING 6 #define ARROWERROR -1 // Each C++ function contains the actual implementation of the // functionality, and there is a corresponding C function that // Chapel can call into through C interoperability, since there // is no C++ interoperability supported in Chapel today. int64_t c_getNumRows(const char*, char** errMsg); int64_t cpp_getNumRows(const char*, char** errMsg); int c_readColumnByName(const char* filename, void* chpl_arr, const char* colname, int64_t numElems, int64_t startIdx, int64_t batchSize, char** errMsg); int cpp_readColumnByName(const char* filename, void* chpl_arr, const char* colname, int64_t numElems, int64_t startIdx, int64_t batchSize, char** errMsg); int64_t cpp_getStringColumnNumBytes(const char* filename, const char* colname, void* chpl_offsets, int64_t numElems, int64_t startIdx, char** errMsg); int64_t c_getStringColumnNumBytes(const char* filename, const char* colname, void* chpl_offsets, int64_t numElems, int64_t startIdx, char** errMsg); int c_getType(const char* filename, const char* colname, char** errMsg); int cpp_getType(const char* filename, const char* colname, char** errMsg); int cpp_writeColumnToParquet(const char* filename, void* chpl_arr, int64_t colnum, const char* dsetname, int64_t numelems, int64_t rowGroupSize, int64_t dtype, bool compressed, char** errMsg); int c_writeColumnToParquet(const char* filename, void* chpl_arr, int64_t colnum, const char* dsetname, int64_t numelems, int64_t rowGroupSize, int64_t dtype, bool compressed, char** errMsg); int c_writeStrColumnToParquet(const char* filename, void* chpl_arr, void* chpl_offsets, const char* dsetname, int64_t numelems, int64_t rowGroupSize, int64_t dtype, bool compressed, char** errMsg); int cpp_writeStrColumnToParquet(const char* filename, void* chpl_arr, void* chpl_offsets, const char* dsetname, int64_t numelems, int64_t rowGroupSize, int64_t dtype, bool compressed, char** errMsg); int c_createEmptyParquetFile(const char* filename, const char* dsetname, int64_t dtype, bool compressed, char** errMsg); int cpp_createEmptyParquetFile(const char* filename, const char* dsetname, int64_t dtype, bool compressed, char** errMsg); int c_appendColumnToParquet(const char* filename, void* chpl_arr, const char* dsetname, int64_t numelems, int64_t dtype, bool compressed, char** errMsg); int cpp_appendColumnToParquet(const char* filename, void* chpl_arr, const char* dsetname, int64_t numelems, int64_t dtype, bool compressed, char** errMsg); const char* c_getVersionInfo(void); const char* cpp_getVersionInfo(void); int c_getDatasetNames(const char* filename, char** dsetResult, char** errMsg); int cpp_getDatasetNames(const char* filename, char** dsetResult, char** errMsg); void c_free_string(void* ptr); void cpp_free_string(void* ptr); #ifdef __cplusplus } #endif
45.576087
109
0.63129
[ "object" ]
2ffae0e732174f4686f163a1c7741698d31f7fd4
5,452
h
C
include/tpcc/lexicographic.h
guidokanschat/TensorEnumeration
883b8cdbfbdb968c1cd5f087b7e16d063bc1fa08
[ "MIT" ]
null
null
null
include/tpcc/lexicographic.h
guidokanschat/TensorEnumeration
883b8cdbfbdb968c1cd5f087b7e16d063bc1fa08
[ "MIT" ]
1
2020-12-26T23:12:08.000Z
2020-12-28T16:27:15.000Z
include/tpcc/lexicographic.h
guidokanschat/TensorEnumeration
883b8cdbfbdb968c1cd5f087b7e16d063bc1fa08
[ "MIT" ]
5
2020-05-30T15:22:25.000Z
2021-01-05T18:32:46.000Z
#ifndef TPCC_LEXICOGRAPHIC_H #define TPCC_LEXICOGRAPHIC_H #include <tpcc/element.h> namespace TPCC { /** * \brief Lexicographic enumeration of the `k`-dimensional faces in a tensor product chain complex * of dimension `n`. * * \tparam n: The dimension of the tensor product (the order of the tensor) * \tparam k: The dimensions of the object considered * \tparam Bint: The big integer used for addressing in the whole tensor product * \tparam Sint: The small integer used for addressing in each fiber * \tparam Tint: The tiny integer with values addressing the fibers * * The numbering for `k==0` and `k==n` is lexicographic with the first coordinate * changing fastest and the last one slowest. For `k` between those values, the set * of elements consists of `n` over `k` separate sets, one for each combination of `k` * different coordinates. * * These sets form the slowest moving part of the enumeration, and * they are enumerated based such that the elements orthogonal to the first `n-k` * coordinates are first, those orthogonal to the last coordinates last. * * The next level in the enumaration is formed by the fact that these sets * can be split into 'sheets', connected sets which are not connected to each other. * They are characterized by their coordinates orthogonal to the chosen `k`. Thus, their * enumeration follows a lexicographic scheme with first fastest for these coordinates. * * The fastes level of enumeration is inside each sheet, where again the first coordinates * run fastest. */ template <int n, int k, typename Bint = unsigned int, typename Sint = unsigned short, typename Tint = unsigned char> class Lexicographic { /** * \brief The dimension of the fibers in each direction. */ std::array<Sint, n> dimensions; /** * \brief The number of objects facing the same directions. */ std::array<Bint, binomial(n, k)> block_sizes; public: /// The tensor order of the chain complex static constexpr Tint order() { return n; } /// The dimension of the elements, index in the chain complex static constexpr Tint cell_dimension() { return k; } /// Index type for addressing in the tensor product typedef Bint global_index_t; /// Index type for addressing in the fibers typedef Sint fiber_index_t; /// Index type for addressing dimensions and elements of the chain complex typedef Tint dimension_index_t; /// The type of elements of this set in the complex typedef Element<n, k, Sint, Tint> value_type; /** * \brief Constructor setting the dimensions of the complex. */ constexpr Lexicographic(const std::array<Sint, n>& d) : dimensions(d) { Combinations<n, k> combinations; for (Tint i = 0; i < binomial(n, k); ++i) { Bint p = 1; auto combination = combinations[i]; for (Tint j = 0; j < k; ++j) p *= dimensions[n - 1 - combination.in(j)]; for (Tint j = 0; j < n - k; ++j) p *= 1 + dimensions[n - 1 - combination.out(j)]; block_sizes[i] = p; } } /** * \brief The number of elements in this set. */ constexpr Bint size() const { Bint sum = 0; for (unsigned int i = 0; i < block_sizes.size(); ++i) sum += block_sizes[i]; return sum; } /** * \brief The number of elements in one direction */ constexpr Bint block_size(Tint block) const { return block_sizes[block]; } /// Dimension of the fiber with given index in the tensor product constexpr Sint fiber_dimension(Tint i) const { return dimensions[i]; } /** * \brief Descriptor for the element at given `index`. */ value_type operator[](Bint index) const; /** * \brief Find index of a given element. */ Bint index(const value_type& e) const; constexpr Lexicographic<n, k - 1, Bint, Sint, Tint> boundary() const { return Lexicographic<n, k - 1, Bint, Sint, Tint>{ dimensions }; } }; template <int n, int k, typename Bint, typename Sint, typename Tint> Element<n, k, Sint, Tint> Lexicographic<n, k, Bint, Sint, Tint>::operator[](Bint index) const { unsigned int b = 0; while (b < block_sizes.size()) { if (index < block_sizes[b]) break; index -= block_sizes[b]; ++b; } if (b == block_sizes.size()) throw(b); Combinations<n, k> combinations; auto combination = combinations[b]; std::array<Sint, n> coordinates; for (int i = 0; i < k; ++i) { Sint fdim = dimensions[n - 1 - combination.in(i)]; coordinates[n - 1 - combination.in(i)] = index % fdim; index /= fdim; } for (int i = 0; i < n - k; ++i) { Sint fdim = 1 + dimensions[n - 1 - combination.out(i)]; coordinates[n - 1 - combination.out(i)] = index % fdim; index /= fdim; } return Element<n, k, Sint, Tint>{ combination, coordinates }; } template <int n, int k, typename Bint, typename Sint, typename Tint> Bint Lexicographic<n, k, Bint, Sint, Tint>::index(const value_type& e) const { Bint ci = e.direction_index(); Bint result = 0; for (unsigned int i = 0; i < ci; ++i) result += block_sizes[i]; Bint factor = 1; for (Tint i = 0; i < k; ++i) { Sint fdim = dimensions[e.along_direction(i)]; result += e.along_coordinate(i) * factor; factor *= fdim; } for (unsigned int i = 0; i < n - k; ++i) { Tint fdim = 1 + dimensions[e.across_direction(i)]; result += e.across_coordinate(i) * factor; factor *= fdim; } return result; } } // namespace TPCC #endif
30.288889
98
0.661592
[ "object" ]
2ffb8d79b29fa38db06ed04c7e9a86577219f40b
9,834
c
C
src/control/problem.c
QingleiCao/stars-h
9527e1c798a51c5dd3f7059c88b1be8707bff1e9
[ "BSD-3-Clause" ]
2
2020-11-22T22:28:45.000Z
2022-03-09T07:35:59.000Z
src/control/problem.c
QingleiCao/stars-h
9527e1c798a51c5dd3f7059c88b1be8707bff1e9
[ "BSD-3-Clause" ]
1
2020-11-04T01:10:54.000Z
2020-11-08T20:01:54.000Z
src/control/problem.c
QingleiCao/stars-h
9527e1c798a51c5dd3f7059c88b1be8707bff1e9
[ "BSD-3-Clause" ]
6
2017-11-12T16:28:00.000Z
2022-03-24T18:08:24.000Z
/*! @copyright (c) 2017 King Abdullah University of Science and * Technology (KAUST). All rights reserved. * * STARS-H is a software package, provided by King Abdullah * University of Science and Technology (KAUST) * * @file src/control/problem.c * @version 0.3.0 * @author Aleksandr Mikhalev * @date 2017-11-07 * */ #include "common.h" #include "starsh.h" int starsh_problem_new(STARSH_problem **problem, int ndim, STARSH_int *shape, char symm, char dtype, void *row_data, void *col_data, STARSH_kernel *kernel, char *name) //! Init @ref STARSH_problem object. /*! Unlike all other *_new() functions, this function creates copy of `shape` * to store internally. This is done to avoid clearing memory of static * objects, defined like `STARSH_int shape[2] = {10, 20}`. Number of dimensions * must be 2 or greater. If `ndim = 2`, then corresponding kernel is scalar. If * `ndim > 2`, then corresponding kernel returns `(ndim-2)`-dimensional tensor. * * @param[out] problem: Address of pointer to @ref STARSH_problem object. * @param[in] ndim: Dimensionality of corresponding array. Equal to `2` plus * dimensionality of kernel. * @param[in] shape: Shape of corresponding array. Subarray `shape[1:ndim-2]` * is equal to shape of kernel. * @param[in] symm: 'S' for summetric problem, 'N' for nonsymmetric. Symmetric * problem requires symmetric kernel and equality of `row_data` and * `col_data`. * @param[in] dtype: Data type of the problem. Equal to 's', 'd', 'c' or 'z' * as in LAPACK routines. * @param[in] row_data: Pointer to some structure of physical data for rows. * @param[in] col_data: Pointer to some structure of physical data for columns. * @param[in] kernel: Pointer to a function of interaction. * @param[in] name: String, containing name of the problem. * @return Error code @ref STARSH_ERRNO. * @ingroup problem * */ { if(problem == NULL) { STARSH_ERROR("Invalid value of `problem`"); return STARSH_WRONG_PARAMETER; } if(ndim < 2) { STARSH_ERROR("Invalid value of `ndim`"); return STARSH_WRONG_PARAMETER; } if(shape == NULL) { STARSH_ERROR("Invalid value of `shape`"); return STARSH_WRONG_PARAMETER; } if(kernel == NULL) { STARSH_ERROR("Invalid value of `kernel`"); return STARSH_WRONG_PARAMETER; } int i; size_t dtype_size = 0; if(dtype == 's') dtype_size = sizeof(float); else if(dtype == 'd') dtype_size = sizeof(double); else if(dtype == 'c') dtype_size = sizeof(float complex); else if(dtype == 'z') dtype_size = sizeof(double complex); else { STARSH_ERROR("Invalid value of `dtype`"); return STARSH_WRONG_PARAMETER; } size_t entry_size = dtype_size; for(i = 1; i < ndim-1; i++) entry_size *= shape[i]; STARSH_problem *P; STARSH_MALLOC(P, 1); *problem = P; P->ndim = ndim; STARSH_MALLOC(P->shape, ndim); memcpy(P->shape, shape, ndim*sizeof(*P->shape)); P->symm = symm; P->dtype = dtype; P->dtype_size = dtype_size; P->entry_size = entry_size; P->row_data = row_data; P->col_data = col_data; P->kernel = kernel; P->name = NULL; if(name != NULL) { STARSH_MALLOC(P->name, strlen(name)+1); strcpy(P->name, name); } return STARSH_SUCCESS; } void starsh_problem_free(STARSH_problem *problem) //! Free @ref STARSH_problem object. //! @ingroup problem { if(problem == NULL) return; free(problem->shape); if(problem->name != NULL) free(problem->name); free(problem); } void starsh_problem_info(STARSH_problem *problem) //! Print short info about @ref STARSH_problem object. //! @ingroup problem { if(problem == NULL) return; STARSH_problem *P = problem; printf("<STARS_Problem at %p, name \"%s\", shape (%zd", P, P->name, P->shape[0]); for(int i = 1; i < P->ndim; i++) printf(",%zd", P->shape[i]); printf("), '%c' dtype, '%c' symmetric>\n", P->dtype, P->symm); } int starsh_problem_get_block(STARSH_problem *problem, int nrows, int ncols, STARSH_int *irow, STARSH_int *icol, Array **A) //! Get submatrix on given rows and columns. /*! Rows correspond to the first dimension and columns correspond to the * last dimension. * * @param[in] problem: Pointer to @ref STARSH_problem object. * @param[in] nrows: Number of rows. * @param[in] ncols: Number of columns. * @param[in] irow: Indexes of rows. * @param[in] icol: Indexes of columns. * @param[out] A: Address of pointer to @ref array object. * @return Error code @ref STARSH_ERRNO. * @ingroup problem * */ { STARSH_problem *P = problem; if(problem == NULL) { STARSH_ERROR("Invalid value of `parameter`"); return STARSH_WRONG_PARAMETER; } if(irow == NULL) { STARSH_ERROR("Invalid value of `irow`"); return STARSH_WRONG_PARAMETER; } if(icol == NULL) { STARSH_ERROR("Invalid value of `icol`"); return STARSH_WRONG_PARAMETER; } int ndim = P->ndim, info; if(nrows < 0) { STARSH_ERROR("Invalid value of `nrows`"); return STARSH_WRONG_PARAMETER; } if(ncols < 0) { STARSH_ERROR("Invalid value of `ncols`"); return STARSH_WRONG_PARAMETER; } int *shape; STARSH_MALLOC(shape, ndim); shape[0] = nrows; shape[ndim-1] = ncols; for(int i = 1; i < ndim-1; i++) { shape[i] = problem->shape[i]; } info = array_new(A, ndim, shape, problem->dtype, 'F'); if(info != 0) return info; problem->kernel(nrows, ncols, irow, icol, problem->row_data, problem->col_data, (*A)->data, nrows); return STARSH_SUCCESS; } static void _matrix_kernel(int nrows, int ncols, STARSH_int *irow, STARSH_int *icol, void *row_data, void *col_data, void *result, int ld) //! Kernel for problems, defined by dense matrices. //! @ingroup problem { Array *A = row_data; size_t esize = A->dtype_size; STARSH_int i, j; size_t dest, src, lda; for(int i = 1; i < A->ndim-1; i++) esize *= A->shape[i]; if(A->order == 'C') { lda = A->shape[A->ndim-1]; //#pragma omp parallel for private(dest, src, i, j) for(i = 0; i < nrows; i++) for(j = 0; j < ncols; j++) { dest = j*(size_t)ld+i; src = irow[i]*lda+icol[j]; memcpy(result+dest*esize, A->data+src*esize, esize); } } else { lda = A->shape[0]; //#pragma omp parallel for private(dest, src, i, j) for(i = 0; i < nrows; i++) for(j = 0; j < ncols; j++) { dest = j*(size_t)ld+i; src = icol[j]*lda+irow[i]; memcpy(result+dest*esize, A->data+src*esize, esize); } } } int starsh_problem_from_array(STARSH_problem **problem, Array *A, char symm) //! Create STARSH_problem instance, based on dense array. /*! If @ref array `A` is sorted in C order, then temporary @ref array object * will be created as a copy of input `A`, but in Fortran order. There will be * no way to free that temporary @ref array object. * * @param[out] problem: Address of pointer to @ref STARSH_problem object. * @param[in] A: Array. * @param[in] symm: 'S' if @ref array `A` is symmetric or 'N' otherwise. * @return Error code @ref STARSH_ERRNO. * @ingroup problem * */ { if(problem == NULL) { STARSH_ERROR("Invalid value of `problem`"); return STARSH_WRONG_PARAMETER; } if(A == NULL) { STARSH_ERROR("Invalid value of `A`"); return STARSH_WRONG_PARAMETER; } if(A->ndim < 2) { STARSH_ERROR("`A` should be at least two-dimensional"); return STARSH_WRONG_PARAMETER; } if(symm != 'S' && symm != 'N') { STARSH_ERROR("Invalid value of `symm`"); return STARSH_WRONG_PARAMETER; } Array *A2 = A; int info; if(A->order == 'C') { STARSH_WARNING("A->order is 'C', creating " "copy of array with layout in Fortran style ('F'-order). It " "makes corresponding matrix non-freeable"); info = array_new_copy(&A2, A, 'F'); if(info != 0) return info; } STARSH_int shape[A->ndim]; for(int i = 0; i < A->ndim; i++) shape[i] = A->shape[i]; info = starsh_problem_new(problem, A->ndim, shape, symm, A->dtype, A2, A2, _matrix_kernel, "Problem from matrix"); return info; } int starsh_problem_to_array(STARSH_problem *problem, Array **A) //! Generate dense array by a given problem. /*! Dense matrix will be created. This function makes it easier to check * kernel. * * @param[in] problem: Pointer to @ref STARSH_problem object. * @param[out] A: Address of pointer to @ref array object. * @return Error code @ref STARSH_ERRNO. * @ingroup problem * */ { if(problem == NULL) { STARSH_ERROR("Invalid value of `problem`"); return STARSH_WRONG_PARAMETER; } if(A == NULL) { STARSH_ERROR("Invalid value of `A`"); return STARSH_WRONG_PARAMETER; } STARSH_int i; int info; int ndim = problem->ndim; STARSH_int nrows = problem->shape[0]; STARSH_int ncols = problem->shape[ndim-1]; STARSH_int *irow, *icol; STARSH_MALLOC(irow, nrows); STARSH_MALLOC(icol, ncols); for(i = 0; i < nrows; i++) irow[i] = i; for(i = 0; i < ncols; i++) icol[i] = i; info = starsh_problem_get_block(problem, nrows, ncols, irow, icol, A); free(irow); free(icol); return info; }
31.022082
79
0.601891
[ "object", "shape" ]
2ffc11eeab1b95df9dcbd09c4b539900516d1524
2,784
h
C
include/CreateEAXReverbZoneDialog.h
adct-the-experimenter/Binaural-Audio-Editor
213e37f6cfe0530f0091b82a700085159ee7babe
[ "BSD-3-Clause" ]
42
2019-05-20T12:54:14.000Z
2022-03-18T01:01:56.000Z
include/CreateEAXReverbZoneDialog.h
adct-the-experimenter/Binaural-Audio-Editor
213e37f6cfe0530f0091b82a700085159ee7babe
[ "BSD-3-Clause" ]
21
2019-05-13T18:40:32.000Z
2021-05-03T20:17:44.000Z
include/CreateEAXReverbZoneDialog.h
adct-the-experimenter/Binaural-Audio-Editor
213e37f6cfe0530f0091b82a700085159ee7babe
[ "BSD-3-Clause" ]
5
2020-05-08T06:02:07.000Z
2021-04-17T12:15:41.000Z
#ifndef CREATE_EAX_REVERB_ZONE_H #define CREATE_EAX_REVERB_ZONE_H #include <wx/wx.h> #include <wx/valnum.h> //for wxFloatingPointValidator #include <wx/textctrl.h> //for wxTextCtrl #include "effects-manager.h" class CreateEAXReverbZoneDialog : public wxDialog { public: CreateEAXReverbZoneDialog(const wxString& title,EffectsManager* effects_manager); void OnOk(wxCommandEvent& event); void OnCancel(wxCommandEvent& event); void OnPreview(wxCommandEvent& event); void Exit(); //function to return position of new sound producer object void getNewPosition(double& x, double& y, double& z); std::string getNewName(); double& getNewWidth(); ReverbEAXProperties& getNewProperties(); enum { ID_OK = wxID_HIGHEST + 1, ID_PREVIEW, ID_APPLY, ID_CANCEL, ID_RENAME, ID_LISTBOX }; bool OkClicked(); private: EffectsManager* m_effects_manager_ptr; wxButton* okButton; wxButton* cancelButton; wxButton* previewButton; wxTextCtrl* textFieldName; wxTextCtrl* textFieldX; wxTextCtrl* textFieldY; wxTextCtrl* textFieldZ; wxTextCtrl* textFieldWidth; wxListBox* listboxSoundProducers; int spt_selection_index; void SoundProducerTrackSelectedInListBox(wxCommandEvent& event ); //AL_REVERB_DENSITY, wxTextCtrl* textField_flDensity; //AL_REVERB_DIFFUSION, wxTextCtrl* textField_flDiffusion; //AL_REVERB_GAIN, wxTextCtrl* textField_flGain; //AL_REVERB_GAINHF, wxTextCtrl* textField_flGainHF; //AL_EAXREVERB_GAINLF, wxTextCtrl* textField_flGainLF; //AL_REVERB_DECAY_TIME, wxTextCtrl* textField_flDecayTime; //AL_REVERB_DECAY_HFRATIO, wxTextCtrl* textField_flDecayHFRatio; //AL_EAXREVERB_DECAY_LFRATIO, wxTextCtrl* textField_flDecayLFRatio; //AL_REVERB_REFLECTIONS_GAIN, wxTextCtrl* textField_flReflectionsGain; //AL_REVERB_REFLECTIONS_DELAY, wxTextCtrl* textField_flReflectionsDelay; //AL_REVERB_LATE_REVERB_GAIN, wxTextCtrl* textField_flLateReverbGain; //AL_REVERB_LATE_REVERB_DELAY, wxTextCtrl* textField_flLateReverbDelay; //AL_EAXREVERB_ECHO_TIME, wxTextCtrl* textField_flEchoTime; //AL_EAXREVERB_ECHO_DEPTH, wxTextCtrl* textField_flEchoDepth; //AL_EAXREVERB_MODULATION_TIME, wxTextCtrl* textField_flModulationTime; //AL_EAXREVERB_MODULATION_DEPTH, wxTextCtrl* textField_flModulationDepth; //AL_EAXREVERB_HFREFERENCE, wxTextCtrl* textField_flHFReference; //AL_EAXREVERB_LFREFERENCE, wxTextCtrl* textField_flLFReference; //AL_REVERB_AIR_ABSORPTION_GAINHF, wxTextCtrl* textField_flAirAbsorptionGainHF; //AL_REVERB_ROOM_ROLLOFF_FACTOR, wxTextCtrl* textField_flRoomRolloffFactor; std::string name; double xPosition; double yPosition; double zPosition; double width; ReverbEAXProperties properties; void initPrivateVariables(); bool okClicked; }; #endif
21.75
82
0.798132
[ "object" ]
2fffbfaeb6dcc315c0995ae7dfb2b97aa19ad3d1
3,198
h
C
sources/GEO/geo_sfc.h
bw-kiel/ogs_kb1_bw
50e2680a2bbe8f6217193472b51abed59cb8933c
[ "BSD-4-Clause" ]
null
null
null
sources/GEO/geo_sfc.h
bw-kiel/ogs_kb1_bw
50e2680a2bbe8f6217193472b51abed59cb8933c
[ "BSD-4-Clause" ]
null
null
null
sources/GEO/geo_sfc.h
bw-kiel/ogs_kb1_bw
50e2680a2bbe8f6217193472b51abed59cb8933c
[ "BSD-4-Clause" ]
null
null
null
#ifndef rf_sfc_INC #define rf_sfc_INC #include "geo_ply.h" //------------------------------------------------------------------------- class CTriangle { public: long number; double x[3]; double y[3]; double z[3]; long msh_numbers[3]; }; //------------------------------------------------------------------------- class CTIN { public: CTIN(){} ~CTIN(); std::string name; std::vector<CTriangle*> Triangles; }; //------------------------------------------------------------------------- class Surface { public: Surface(); ~Surface(); //ID long id; //CC std::string name; //Properties int type; std::string type_name; std::string data_name; //int data_type; double epsilon; double mesh_density; int mat_group; // MMP std::string mat_group_name; double Radius; // Radius of cylinder. WW //display int m_color[3]; int display_mode_2d; int display_mode_3d; int display_mode_bc; bool highlighted; // CC //topology bool order; bool createtins; double center_point[3]; bool surface_at_model_surface = false; //BW indicator whether the surface is at model surface or not 2022-01-13 //TIN CTIN* TIN; //point vector std::vector<CGLPoint*>polygon_point_vector; // polylines // list<CGLPolyline*> polyline_of_surface_list; std::vector<CGLPolyline*> polyline_of_surface_vector; std::vector<int> polyline_of_surface_orient; std::vector<double*>nodes_coor_vector; // MSH int meshing_allowed; //TK //---------------------------------------------------------------- //Method // I/O void output(FILE* geo_file, int &p_index, int &l_index, int &pl_index,int &s_index); void Write(const std::string &); std::ios::pos_type Read(std::ifstream*); //Topology void PolylineOrientation(); //CC void ReArrangePolylineList(); void PolygonPointVector(); //OK/CC //point void CalcCenterPoint(void); //display void AssignColor(); //CC // TIN void CreateTIN(void); void ReadTIN(const std::string &); //CC void WriteTIN(const std::string &); //CC void WriteTINTecplot(const std::string &); //CC //Tecplot void WriteTecplot(std::fstream*); bool PointInSurface(CGLPoint*); //OK //material long profile_code; //YD private: // friend class CGLLine; //WW }; //vector extern std::vector<Surface*> surface_vector; //CC extern std::vector<Surface*> GetSurfaceVector(void); //CC extern void GEOCreateSurfacePointVector(void); //CC //Access extern Surface* GEOGetSFCByName(const std::string &); //I/O extern void GEOReadSurfaces(const std::string & file_name_path_base); extern void GEOWriteSurfaces(const std::string &); //C //Remove extern void GEORemoveAllSurfaces(); //CC extern void GEORemoveSurface(long); //CC extern void GEORemoveSFC(Surface* m_sfc); //Topology extern void GEOSurfaceTopology(void); extern void GEOUnselectSFC(); //OK //TIN #define TIN_FILE_EXTENSION ".tin" extern void GEOWriteSurfaceTINs(const std::string &); //TIN extern void GEOCreateLayerSurfaceTINs(int,double); //TIN extern void GEOWriteSurfaceTINsTecplot(const std::string &); extern int sfc_ID_max; // MSH void MSHUnselectSFC(); //OK extern int SFCGetMaxMATGroupNumber(); //OK extern void SFCAssignMATColors(); //OK extern void SFCAssignColors(); //OK #endif
25.181102
120
0.661976
[ "vector", "model" ]
64053a218eb544a1279ea3b86005577cb5febf86
10,217
c
C
external/cairo/src/cairo-image-info.c
baiyicanggou/mapnik_mvt
9bde52fa9958d81361c015c816858534ec0931bb
[ "Apache-2.0" ]
null
null
null
external/cairo/src/cairo-image-info.c
baiyicanggou/mapnik_mvt
9bde52fa9958d81361c015c816858534ec0931bb
[ "Apache-2.0" ]
null
null
null
external/cairo/src/cairo-image-info.c
baiyicanggou/mapnik_mvt
9bde52fa9958d81361c015c816858534ec0931bb
[ "Apache-2.0" ]
null
null
null
/* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */ /* cairo - a vector graphics library with display and print output * * Copyright © 2008 Adrian Johnson * * This library is free software; you can redistribute it and/or * modify it either under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation * (the "LGPL") or, at your option, under the terms of the Mozilla * Public License Version 1.1 (the "MPL"). If you do not alter this * notice, a recipient may use your version of this file under either * the MPL or the LGPL. * * You should have received a copy of the LGPL along with this library * in the file COPYING-LGPL-2.1; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA * You should have received a copy of the MPL along with this library * in the file COPYING-MPL-1.1 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY * OF ANY KIND, either express or implied. See the LGPL or the MPL for * the specific language governing rights and limitations. * * The Original Code is the cairo graphics library. * * The Initial Developer of the Original Code is Adrian Johnson. * * Contributor(s): * Adrian Johnson <ajohnson@redneon.com> */ #include "cairoint.h" #include "cairo-error-private.h" #include "cairo-image-info-private.h" static uint32_t _get_be32 (const unsigned char *p) { return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; } /* JPEG (image/jpeg) * * http://www.w3.org/Graphics/JPEG/itu-t81.pdf */ /* Markers with no parameters. All other markers are followed by a two * byte length of the parameters. */ #define TEM 0x01 #define RST_begin 0xd0 #define RST_end 0xd7 #define SOI 0xd8 #define EOI 0xd9 /* Start of frame markers. */ #define SOF0 0xc0 #define SOF1 0xc1 #define SOF2 0xc2 #define SOF3 0xc3 #define SOF5 0xc5 #define SOF6 0xc6 #define SOF7 0xc7 #define SOF9 0xc9 #define SOF10 0xca #define SOF11 0xcb #define SOF13 0xcd #define SOF14 0xce #define SOF15 0xcf static const unsigned char * _jpeg_skip_segment (const unsigned char *p) { int len; p++; len = (p[0] << 8) | p[1]; return p + len; } static void _jpeg_extract_info (cairo_image_info_t *info, const unsigned char *p) { info->width = (p[6] << 8) + p[7]; info->height = (p[4] << 8) + p[5]; info->num_components = p[8]; info->bits_per_component = p[3]; } cairo_int_status_t _cairo_image_info_get_jpeg_info (cairo_image_info_t *info, const unsigned char *data, long length) { const unsigned char *p = data; while (p + 1 < data + length) { if (*p != 0xff) return CAIRO_INT_STATUS_UNSUPPORTED; p++; switch (*p) { /* skip fill bytes */ case 0xff: p++; break; case TEM: case SOI: case EOI: p++; break; case SOF0: case SOF1: case SOF2: case SOF3: case SOF5: case SOF6: case SOF7: case SOF9: case SOF10: case SOF11: case SOF13: case SOF14: case SOF15: /* Start of frame found. Extract the image parameters. */ if (p + 8 > data + length) return CAIRO_INT_STATUS_UNSUPPORTED; _jpeg_extract_info (info, p); return CAIRO_STATUS_SUCCESS; default: if (*p >= RST_begin && *p <= RST_end) { p++; break; } if (p + 2 > data + length) return CAIRO_INT_STATUS_UNSUPPORTED; p = _jpeg_skip_segment (p); break; } } return CAIRO_STATUS_SUCCESS; } /* JPEG 2000 (image/jp2) * * http://www.jpeg.org/public/15444-1annexi.pdf */ #define JPX_FILETYPE 0x66747970 #define JPX_JP2_HEADER 0x6A703268 #define JPX_IMAGE_HEADER 0x69686472 static const unsigned char _jpx_signature[] = { 0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a }; static const unsigned char * _jpx_next_box (const unsigned char *p) { return p + _get_be32 (p); } static const unsigned char * _jpx_get_box_contents (const unsigned char *p) { return p + 8; } static cairo_bool_t _jpx_match_box (const unsigned char *p, const unsigned char *end, uint32_t type) { uint32_t length; if (p + 8 < end) { length = _get_be32 (p); if (_get_be32 (p + 4) == type && p + length < end) return TRUE; } return FALSE; } static const unsigned char * _jpx_find_box (const unsigned char *p, const unsigned char *end, uint32_t type) { while (p < end) { if (_jpx_match_box (p, end, type)) return p; p = _jpx_next_box (p); } return NULL; } static void _jpx_extract_info (const unsigned char *p, cairo_image_info_t *info) { info->height = _get_be32 (p); info->width = _get_be32 (p + 4); info->num_components = (p[8] << 8) + p[9]; info->bits_per_component = p[10]; } cairo_int_status_t _cairo_image_info_get_jpx_info (cairo_image_info_t *info, const unsigned char *data, unsigned long length) { const unsigned char *p = data; const unsigned char *end = data + length; /* First 12 bytes must be the JPEG 2000 signature box. */ if (length < ARRAY_LENGTH(_jpx_signature) || memcmp(p, _jpx_signature, ARRAY_LENGTH(_jpx_signature)) != 0) return CAIRO_INT_STATUS_UNSUPPORTED; p += ARRAY_LENGTH(_jpx_signature); /* Next box must be a File Type Box */ if (! _jpx_match_box (p, end, JPX_FILETYPE)) return CAIRO_INT_STATUS_UNSUPPORTED; p = _jpx_next_box (p); /* Locate the JP2 header box. */ p = _jpx_find_box (p, end, JPX_JP2_HEADER); if (!p) return CAIRO_INT_STATUS_UNSUPPORTED; /* Step into the JP2 header box. First box must be the Image * Header */ p = _jpx_get_box_contents (p); if (! _jpx_match_box (p, end, JPX_IMAGE_HEADER)) return CAIRO_INT_STATUS_UNSUPPORTED; /* Get the image info */ p = _jpx_get_box_contents (p); _jpx_extract_info (p, info); return CAIRO_STATUS_SUCCESS; } /* PNG (image/png) * * http://www.w3.org/TR/2003/REC-PNG-20031110/ */ #define PNG_IHDR 0x49484452 static const unsigned char _png_magic[8] = { 137, 80, 78, 71, 13, 10, 26, 10 }; cairo_int_status_t _cairo_image_info_get_png_info (cairo_image_info_t *info, const unsigned char *data, unsigned long length) { const unsigned char *p = data; const unsigned char *end = data + length; if (length < 8 || memcmp (data, _png_magic, 8) != 0) return CAIRO_INT_STATUS_UNSUPPORTED; p += 8; /* The first chunk must be IDHR. IDHR has 13 bytes of data plus * the 12 bytes of overhead for the chunk. */ if (p + 13 + 12 > end) return CAIRO_INT_STATUS_UNSUPPORTED; p += 4; if (_get_be32 (p) != PNG_IHDR) return CAIRO_INT_STATUS_UNSUPPORTED; p += 4; info->width = _get_be32 (p); p += 4; info->height = _get_be32 (p); return CAIRO_STATUS_SUCCESS; } static const unsigned char * _jbig2_find_data_end (const unsigned char *p, const unsigned char *end, int type) { unsigned char end_seq[2]; int mmr; /* Segments of type "Immediate generic region" may have an * unspecified data length. The JBIG2 specification specifies the * method to find the end of the data for these segments. */ if (type == 36 || type == 38 || type == 39) { if (p + 18 < end) { mmr = p[17] & 0x01; if (mmr) { /* MMR encoding ends with 0x00, 0x00 */ end_seq[0] = 0x00; end_seq[1] = 0x00; } else { /* Template encoding ends with 0xff, 0xac */ end_seq[0] = 0xff; end_seq[1] = 0xac; } p += 18; while (p < end) { if (p[0] == end_seq[0] && p[1] == end_seq[1]) { /* Skip the 2 terminating bytes and the 4 byte row count that follows. */ p += 6; if (p < end) return p; } p++; } } } return NULL; } static const unsigned char * _jbig2_get_next_segment (const unsigned char *p, const unsigned char *end, int *type, const unsigned char **data, unsigned long *data_len) { unsigned long seg_num; cairo_bool_t big_page_size; int num_segs; int ref_seg_bytes; int referred_size; if (p + 6 >= end) return NULL; seg_num = _get_be32 (p); *type = p[4] & 0x3f; big_page_size = (p[4] & 0x40) != 0; p += 5; num_segs = p[0] >> 5; if (num_segs == 7) { num_segs = _get_be32 (p) & 0x1fffffff; ref_seg_bytes = 4 + ((num_segs + 1)/8); } else { ref_seg_bytes = 1; } p += ref_seg_bytes; if (seg_num <= 256) referred_size = 1; else if (seg_num <= 65536) referred_size = 2; else referred_size = 4; p += num_segs * referred_size; p += big_page_size ? 4 : 1; if (p + 4 >= end) return NULL; *data_len = _get_be32 (p); p += 4; *data = p; if (*data_len == 0xffffffff) { /* if data length is -1 we have to scan through the data to find the end */ p = _jbig2_find_data_end (*data, end, *type); if (!p || p >= end) return NULL; *data_len = p - *data; } else { p += *data_len; } if (p < end) return p; else return NULL; } static void _jbig2_extract_info (cairo_image_info_t *info, const unsigned char *p) { info->width = _get_be32 (p); info->height = _get_be32 (p + 4); info->num_components = 1; info->bits_per_component = 1; } cairo_int_status_t _cairo_image_info_get_jbig2_info (cairo_image_info_t *info, const unsigned char *data, unsigned long length) { const unsigned char *p = data; const unsigned char *end = data + length; int seg_type; const unsigned char *seg_data; unsigned long seg_data_len; while (p && p < end) { p = _jbig2_get_next_segment (p, end, &seg_type, &seg_data, &seg_data_len); if (p && seg_type == 48 && seg_data_len > 8) { /* page information segment */ _jbig2_extract_info (info, seg_data); return CAIRO_STATUS_SUCCESS; } } return CAIRO_INT_STATUS_UNSUPPORTED; }
23.871495
80
0.641676
[ "vector" ]
6407de41233b352d114e66d49f9140f031b05080
9,401
h
C
src/qt/qtwebkit/Source/WebCore/rendering/RenderInline.h
viewdy/phantomjs
eddb0db1d253fd0c546060a4555554c8ee08c13c
[ "BSD-3-Clause" ]
1
2015-05-27T13:52:20.000Z
2015-05-27T13:52:20.000Z
src/qt/qtwebkit/Source/WebCore/rendering/RenderInline.h
mrampersad/phantomjs
dca6f77a36699eb4e1c46f7600cca618f01b0ac3
[ "BSD-3-Clause" ]
null
null
null
src/qt/qtwebkit/Source/WebCore/rendering/RenderInline.h
mrampersad/phantomjs
dca6f77a36699eb4e1c46f7600cca618f01b0ac3
[ "BSD-3-Clause" ]
1
2017-03-19T13:03:23.000Z
2017-03-19T13:03:23.000Z
/* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef RenderInline_h #define RenderInline_h #include "InlineFlowBox.h" #include "RenderBoxModelObject.h" #include "RenderLineBoxList.h" namespace WebCore { class Position; class RenderInline : public RenderBoxModelObject { public: explicit RenderInline(Element*); static RenderInline* createAnonymous(Document*); RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); } RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); return children()->lastChild(); } virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0); Element* node() const { return toElement(RenderBoxModelObject::node()); } virtual LayoutUnit marginLeft() const; virtual LayoutUnit marginRight() const; virtual LayoutUnit marginTop() const; virtual LayoutUnit marginBottom() const; virtual LayoutUnit marginBefore(const RenderStyle* otherStyle = 0) const; virtual LayoutUnit marginAfter(const RenderStyle* otherStyle = 0) const; virtual LayoutUnit marginStart(const RenderStyle* otherStyle = 0) const; virtual LayoutUnit marginEnd(const RenderStyle* otherStyle = 0) const; virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const; virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const; virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&, bool* offsetDependsOnPoint = 0) const; IntRect linesBoundingBox() const; LayoutRect linesVisualOverflowBoundingBox() const; InlineFlowBox* createAndAppendInlineFlowBox(); void dirtyLineBoxes(bool fullLayout); void deleteLineBoxTree(); RenderLineBoxList* lineBoxes() { return &m_lineBoxes; } const RenderLineBoxList* lineBoxes() const { return &m_lineBoxes; } InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } InlineBox* firstLineBoxIncludingCulling() const { return alwaysCreateLineBoxes() ? firstLineBox() : culledInlineFirstLineBox(); } InlineBox* lastLineBoxIncludingCulling() const { return alwaysCreateLineBoxes() ? lastLineBox() : culledInlineLastLineBox(); } virtual RenderBoxModelObject* virtualContinuation() const { return continuation(); } RenderInline* inlineElementContinuation() const; virtual void updateDragState(bool dragOn); LayoutSize offsetForInFlowPositionedInline(const RenderBox* child) const; virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE; void paintOutline(PaintInfo&, const LayoutPoint&); using RenderBoxModelObject::continuation; using RenderBoxModelObject::setContinuation; bool alwaysCreateLineBoxes() const { return m_alwaysCreateLineBoxes; } void setAlwaysCreateLineBoxes() { m_alwaysCreateLineBoxes = true; } void updateAlwaysCreateLineBoxes(bool fullLayout); virtual LayoutRect localCaretRect(InlineBox*, int, LayoutUnit* extraWidthToEndOfLine) OVERRIDE; bool hitTestCulledInline(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset); protected: virtual void willBeDestroyed(); virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE; private: virtual RenderObjectChildList* virtualChildren() { return children(); } virtual const RenderObjectChildList* virtualChildren() const { return children(); } const RenderObjectChildList* children() const { return &m_children; } RenderObjectChildList* children() { return &m_children; } virtual const char* renderName() const; virtual bool isRenderInline() const { return true; } LayoutRect culledInlineVisualOverflowBoundingBox() const; InlineBox* culledInlineFirstLineBox() const; InlineBox* culledInlineLastLineBox() const; template<typename GeneratorContext> void generateLineBoxRects(GeneratorContext& yield) const; template<typename GeneratorContext> void generateCulledLineBoxRects(GeneratorContext& yield, const RenderInline* container) const; void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild); virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild = 0); void splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock, RenderObject* beforeChild, RenderBoxModelObject* oldCont); void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild, RenderBoxModelObject* oldCont); virtual void layout() { ASSERT_NOT_REACHED(); } // Do nothing for layout() virtual void paint(PaintInfo&, const LayoutPoint&); virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE; virtual bool requiresLayer() const { return isInFlowPositioned() || createsGroup() || hasClipPath(); } virtual LayoutUnit offsetLeft() const; virtual LayoutUnit offsetTop() const; virtual LayoutUnit offsetWidth() const { return linesBoundingBox().width(); } virtual LayoutUnit offsetHeight() const { return linesBoundingBox().height(); } virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const OVERRIDE; virtual LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const OVERRIDE; virtual void computeRectForRepaint(const RenderLayerModelObject* repaintContainer, LayoutRect&, bool fixed) const OVERRIDE; virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE; virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE; virtual VisiblePosition positionForPoint(const LayoutPoint&); virtual LayoutRect frameRectForStickyPositioning() const OVERRIDE { return linesBoundingBox(); } virtual IntRect borderBoundingBox() const { IntRect boundingBox = linesBoundingBox(); return IntRect(0, 0, boundingBox.width(), boundingBox.height()); } virtual InlineFlowBox* createInlineFlowBox(); // Subclassed by SVG and Ruby virtual void dirtyLinesFromChangedChild(RenderObject* child) { m_lineBoxes.dirtyLinesFromChangedChild(this, child); } virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; virtual void childBecameNonInline(RenderObject* child); virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION) virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&); #endif virtual void updateFromStyle() OVERRIDE; RenderInline* clone() const; void paintOutlineForLine(GraphicsContext*, const LayoutPoint&, const LayoutRect& prevLine, const LayoutRect& thisLine, const LayoutRect& nextLine, const Color); RenderBoxModelObject* continuationBefore(RenderObject* beforeChild); RenderObjectChildList m_children; RenderLineBoxList m_lineBoxes; // All of the line boxes created for this inline flow. For example, <i>Hello<br>world.</i> will have two <i> line boxes. bool m_alwaysCreateLineBoxes : 1; }; inline RenderInline* toRenderInline(RenderObject* object) { ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderInline()); return static_cast<RenderInline*>(object); } inline const RenderInline* toRenderInline(const RenderObject* object) { ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderInline()); return static_cast<const RenderInline*>(object); } // This will catch anyone doing an unnecessary cast. void toRenderInline(const RenderInline*); } // namespace WebCore #endif // RenderInline_h
44.980861
179
0.765344
[ "object", "vector" ]
64086cabce631273b7ed8e42ec1c19d8500ab448
2,608
c
C
lib/wizards/walla/dl/monsters/test.c
vlehtola/questmud
8bc3099b5ad00a9e0261faeb6637c76b521b6dbe
[ "MIT" ]
null
null
null
lib/wizards/walla/dl/monsters/test.c
vlehtola/questmud
8bc3099b5ad00a9e0261faeb6637c76b521b6dbe
[ "MIT" ]
null
null
null
lib/wizards/walla/dl/monsters/test.c
vlehtola/questmud
8bc3099b5ad00a9e0261faeb6637c76b521b6dbe
[ "MIT" ]
null
null
null
inherit "obj/monster"; int number_of_guards; object armour,weapon; reset(arg) { string chat_str, a_chat_str; ::reset(arg); number_of_guards = 0; if(arg) { return; } set_level(15); set_name("draconian"); set_alias("guard"); set_short("Draconian guard"); set_long("The draconian guard has a wicked look on his face when you approach.\n"+ "He seems all but afraid of your presence.\n"); set_al(-5); set_extra(1); set_aggressive(0); set_log(); set_block_dir("east"); set_spell_chance(100, "exs fla blt"); set_skill("cast essence", 65); set_skill("cast fire", 60); set_skill("cast bolt", 70); set_skill("critical", 11); set_skill("stun", 15); set_skill("find weakness", 10); set_skill("slash", 25); set_skill("blades", 60); if (!chat_str) { chat_str = allocate(5); chat_str[0] = "You better leave this place at once, before I call in guards to take care of you.\n"; chat_str[1] = "Draconian hisses strange mantras.\n"; chat_str[2] = "Draconian hisses madly at you.\n"; chat_str[3]= "Draconian shows his terrible claws at you and makes a quick gesture across his throat.\n"; chat_str[4]= "Draconian hisses, you have nothing to do further on, leave at once!\n"; } if (!a_chat_str) { a_chat_str = allocate(1); a_chat_str[0] = "Draconian hurles: Help me guards!\n"; } load_chat(30, chat_str); load_a_chat(15, a_chat_str); money = clone_object("obj/money"); call_other(money, "set_money", random(1000)+1230); move_object(money, this_object()); armour = clone_object("/wizards/walla/dl/eq/draccloak2"); move_object(armour, this_object()); init_command("wear cloak"); weapon = clone_object("/wizards/walla/dl/weapons/clawedblade"); move_object(weapon, this_object()); init_command("wield blade"); armour = clone_object("/wizards/walla/dl/eq/hoodofdrac"); move_object(armour, this_object()); init_command("wear hood"); } extra() { object drac_guard; if (!attacker_ob) { return; } if(random(number_of_guards + 1) == number_of_guards) { drac_guard = clone_object("/wizards/walla/dl/monsters/vakiogd"); move_object(drac_guard, environment(this_object())); say("Draconian's screams are heard and another draconian flies in.\n"); number_of_guards += 1; } } reduce_number() { number_of_guards -= 1; }
28.347826
101
0.61388
[ "object" ]
641007e17e7052ede7f57ebac287b804e947ccf9
3,068
h
C
LMDBI+NSPropertyListSerialization.h
rbartolome/LMDBKit
01bff9013196d78a18149cef52af4a88b64dab13
[ "MIT" ]
19
2015-03-16T22:41:05.000Z
2021-05-07T04:31:12.000Z
LMDBI+NSPropertyListSerialization.h
rbartolome/LMDBKit
01bff9013196d78a18149cef52af4a88b64dab13
[ "MIT" ]
null
null
null
LMDBI+NSPropertyListSerialization.h
rbartolome/LMDBKit
01bff9013196d78a18149cef52af4a88b64dab13
[ "MIT" ]
4
2015-03-30T20:18:54.000Z
2021-11-06T11:55:03.000Z
// // LMDBI+NSPropertyListSerialization.h // // Created by Raphael Bartolome on 06.05.13. // Copyright (c) 2013 Raphael Bartolome. All rights reserved. // #import "LMDBKit.h" /* Choose between binary or xml format */ #define kLMDBIBinaryPListFormat 1 @interface LMDBI (NSPropertyListSerialization) #pragma mark - Setter Methods - (BOOL)setObject: (id)object forKey: (NSString *)aKey; - (BOOL)setData: (NSData *)value forKey:(NSString *)aKey; - (BOOL)setString: (NSString *)value forKey:(NSString *)aKey; - (BOOL)setDate: (NSDate *)value forKey:(NSString *)aKey; - (BOOL)setDictionary: (NSDictionary *)value forKey:(NSString *)aKey; - (BOOL)setArray: (NSArray *)value forKey:(NSString *)aKey; - (BOOL)setBool: (BOOL)value forKey:(NSString *)aKey; - (BOOL)setFloat: (float)value forKey:(NSString *)aKey; - (BOOL)setInteger: (NSInteger)value forKey:(NSString *)aKey; - (BOOL)setDouble: (double)value forKey:(NSString *)aKey; - (BOOL)removeObjectForKey: (NSString *)aKey; #pragma mark - Getter Methods - (BOOL)keyExists: (NSString *)key; - (id)objectForKey: (NSString *)aKey; - (NSData *)dataForKey: (NSString *)aKey; - (NSString *)stringForKey: (NSString *)aKey; - (NSDate *)dateForKey: (NSString *)aKey; - (NSDictionary *)dictionaryForKey: (NSString *)aKey; - (NSArray *)arrayForKey: (NSString *)aKey; - (BOOL)boolForKey: (NSString *)aKey; - (float)floatForKey: (NSString *)aKey; - (NSInteger)integerForKey: (NSString *)aKey; - (double)doubleForKey: (NSString *)aKey; #pragma mark - Enumeration - (BOOL)enumerateKeysAndObjectsUsingBlock: (void (^) (id object, NSString *key, NSInteger count, BOOL *stop))block; - (BOOL)enumerateKeysAndObjectsStartWithKeyString: (NSString *)startKey usingBlock: (void (^) (id object, NSString *key, NSInteger count, BOOL *stop))block; - (BOOL)enumerateKeysUsingBlock: (void (^) (NSString *key, NSInteger count, BOOL *stop))block; - (BOOL)enumerateKeysStartWithKeyString: (NSString *)startKey usingBlock: (void (^) (NSString *key, NSInteger count, BOOL *stop))block; - (BOOL)enumerateObjectsUsingBlock: (void (^) (id object, NSInteger count, BOOL *stop))block; - (BOOL)enumerateObjectStartWithKeyString: (NSString *)startKey usingBlock: (void (^) (id object, NSInteger count, BOOL *stop))block; #pragma mark Sorted Set Handling - (NSInteger)objectCountForKey: (NSString *)key; - (BOOL)addObject: (id)object forKey: (NSString *)aKey; - (BOOL)replaceObjectForKey: (NSString *)aKey withObject: (id)object atIndex: (NSInteger)index; - (BOOL)replaceObject: (id)object withObject: (id)newObject forKey: (NSString *)aKey; - (BOOL)removeObjectsForKey: (NSString *)aKey; - (BOOL)removeObject: (id)object forKey: (NSString *)aKey; - (BOOL)removeObjectForKey: (NSString *)aKey atIndex: (NSInteger)index; - (NSArray *)objectsForKey: (NSString *)aKey; - (id)objectForKey: (NSString *)aKey atIndex: (NSInteger)index; - (id)lastObjectForKey: (NSString *)aKey; - (id)firstObjectForKey: (NSString *)aKey; - (BOOL)enumerateObjectsForKey: (NSString *)key usingBlock: (void (^) (id object, NSInteger index, BOOL *stop))block; @end
38.35
156
0.727184
[ "object" ]
6411be5c9866c4f0ea78b734ba1d4421e6459e31
1,558
h
C
Gems/EMotionFX/Code/Source/Editor/Plugins/SimulatedObject/SimulatedObjectSelectionWindow.h
sandeel31/o3de
db88812d61eef77c6f4451b7f8c7605d6db07412
[ "Apache-2.0", "MIT" ]
1
2021-09-07T05:35:44.000Z
2021-09-07T05:35:44.000Z
Gems/EMotionFX/Code/Source/Editor/Plugins/SimulatedObject/SimulatedObjectSelectionWindow.h
sandeel31/o3de
db88812d61eef77c6f4451b7f8c7605d6db07412
[ "Apache-2.0", "MIT" ]
2
2022-01-13T04:29:38.000Z
2022-03-12T01:05:31.000Z
Gems/EMotionFX/Code/Source/Editor/Plugins/SimulatedObject/SimulatedObjectSelectionWindow.h
sandeel31/o3de
db88812d61eef77c6f4451b7f8c7605d6db07412
[ "Apache-2.0", "MIT" ]
null
null
null
/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #if !defined(Q_MOC_RUN) #include <MCore/Source/StandardHeaders.h> #include <EMotionFX/CommandSystem/Source/SelectionCommands.h> #include <Editor/Plugins/SimulatedObject/SimulatedObjectSelectionWidget.h> #include <EMotionStudio/Plugins/StandardPlugins/Source/StandardPluginsConfig.h> #include <QDialog> #endif namespace EMStudio { class SimulatedObjectSelectionWindow : public QDialog { Q_OBJECT // AUTOMOC MCORE_MEMORYOBJECTCATEGORY(SimulatedObjectSelectionWindow, MCore::MCORE_DEFAULT_ALIGNMENT, MEMCATEGORY_STANDARDPLUGINS_ANIMGRAPH) public: SimulatedObjectSelectionWindow(QWidget* parent); SimulatedObjectSelectionWidget* GetSimulatedObjectSelectionWidget() { return m_simulatedObjectSelectionWidget; } void Update(EMotionFX::Actor* actor, const AZStd::vector<AZStd::string>& selectedSimulatedObjects) { m_simulatedObjectSelectionWidget->Update(actor, selectedSimulatedObjects); } private: SimulatedObjectSelectionWidget* m_simulatedObjectSelectionWidget = nullptr; QPushButton* m_OKButton = nullptr; QPushButton* m_cancelButton = nullptr; bool m_accepted = false; }; } // namespace EMStudio
38
190
0.706675
[ "vector", "3d" ]
6411fb84f3258c122541c30c11c9eb04a87e2dc0
4,071
h
C
include/metasinf/crossover.h
structinf/metaSInf
77a5a15bb45439c3177322530deadee955efba6a
[ "MIT" ]
null
null
null
include/metasinf/crossover.h
structinf/metaSInf
77a5a15bb45439c3177322530deadee955efba6a
[ "MIT" ]
null
null
null
include/metasinf/crossover.h
structinf/metaSInf
77a5a15bb45439c3177322530deadee955efba6a
[ "MIT" ]
null
null
null
// Copyright (c) 2016-2020 Andreas Goulas // Licensed under the MIT license. #ifndef METASINF_INCLUDE_METASINF_CROSSOVER_H_ #define METASINF_INCLUDE_METASINF_CROSSOVER_H_ #include <cassert> #include <climits> #include <random> namespace snf { /// N-point crossover. /// /// A number of crossover points are chosen at random. The elements between /// successive points are exchanged between the two parents. struct CrossoverPoint { explicit CrossoverPoint(int point_count = 1) : point_count(point_count) {} /// Number of crossover points. int point_count; template <typename T, typename Rng> void operator()(T& value0, T& value1, Rng& rng) { size_t size = std::max(value0.size(), value1.size()); std::uniform_int_distribution<size_t> dist(0, size - 1); for (int i = 0; i < point_count; ++i) { size_t index = dist(rng); std::swap_ranges(value0.begin(), value0.begin() + index, value1.begin()); } } }; /// Uniform crossover. /// /// The uniform crossover evaluates each element in the parents for exchange /// with a probability of 0.5. struct CrossoverUniform { template <typename T, typename Rng> void operator()(T& value0, T& value1, Rng& rng) { size_t size = std::min(value0.size(), value1.size()); std::bernoulli_distribution dist; for (size_t i = 0; i < size; ++i) { if (dist(rng)) { std::swap(value0[i], value1[i]); } } } }; /// Partially-matched crossover. /// /// Two crossover points are selected at random and PMX proceeds by /// position-wise exchanges. struct CrossoverPmx { template <typename T, typename Rng> void operator()(T& value0, T& value1, Rng& rng) { thread_local std::vector<size_t> p0, p1; size_t size = std::min(value0.size(), value1.size()); std::uniform_int_distribution<size_t> dist(0, size); size_t index0 = dist(rng); size_t index1 = dist(rng); if (index0 > index1) { std::swap(index0, index1); } if (index0 == index1) { return; } p0.assign(size, 0); p1.assign(size, 0); for (size_t i = 0; i < size; ++i) { assert(value0[i] < size); assert(value1[i] < size); p0[value0[i]] = i; p1[value1[i]] = i; } for (size_t i = index0; i < index1; ++i) { auto tmp0 = value0[i]; auto tmp1 = value1[i]; value0[i] = tmp1; value1[i] = tmp0; value0[p0[tmp1]] = tmp0; value1[p1[tmp0]] = tmp1; std::swap(p0[tmp0], p0[tmp1]); std::swap(p1[tmp0], p1[tmp1]); } } }; /// Intermediate recombination. /// /// The values of the offspring are selected around and between the values of /// the parents. template <typename T> struct CrossoverReal { explicit CrossoverReal(T delta = 0.0) : delta(delta) {} /// Value range. T delta; template <typename Rng> void operator()(T& value0, T& value1, Rng& rng) { std::uniform_real_distribution<T> dist(-delta, delta + 1.0); T alpha0 = dist(rng); T alpha1 = dist(rng); T tmp0 = value0 * alpha0 + value1 * (1.0 - alpha0); T tmp1 = value1 * alpha1 + value0 * (1.0 - alpha1); value0 = tmp0; value1 = tmp1; } }; /// Simulated binary crossover. /// /// A large value of eta gives a higher probability for creating near parent /// solutions and a small value of eta allows distant solutions to be /// selected as children solutions. template <typename T> struct CrossoverSbx { explicit CrossoverSbx(T eta) : eta(eta) {} /// Distribution index. T eta; template <typename Rng> void operator()(T& value0, T& value1, Rng& rng) { assert(eta >= 0.0); std::uniform_real_distribution<T> dist; T u = dist(rng); T beta = 1.0; if (u < 0.5) { beta = std::pow(2 * u, 1.0 / (eta + 1.0)); } else if (u > 0.5) { beta = std::pow(0.5 / (1.0 - u), 1.0 / (eta + 1.0)); } T average = (value0 + value1) / 2.0; T diff = std::abs(value0 - value1) / 2.0; value0 = average - beta * diff; value1 = average + beta * diff; } }; } // namespace snf #endif // METASINF_INCLUDE_METASINF_CROSSOVER_H_
26.435065
79
0.62196
[ "vector" ]
64126553fa70cd77c87cf4db99c5bf76a06fa85d
10,258
h
C
ocr/include/tencentcloud/ocr/v20181119/model/ArithmeticOCRRequest.h
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
43
2019-08-14T08:14:12.000Z
2022-03-30T12:35:09.000Z
ocr/include/tencentcloud/ocr/v20181119/model/ArithmeticOCRRequest.h
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
12
2019-07-15T10:44:59.000Z
2021-11-02T12:35:00.000Z
ocr/include/tencentcloud/ocr/v20181119/model/ArithmeticOCRRequest.h
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
28
2019-07-12T09:06:22.000Z
2022-03-30T08:04:18.000Z
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TENCENTCLOUD_OCR_V20181119_MODEL_ARITHMETICOCRREQUEST_H_ #define TENCENTCLOUD_OCR_V20181119_MODEL_ARITHMETICOCRREQUEST_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/AbstractModel.h> namespace TencentCloud { namespace Ocr { namespace V20181119 { namespace Model { /** * ArithmeticOCR请求参数结构体 */ class ArithmeticOCRRequest : public AbstractModel { public: ArithmeticOCRRequest(); ~ArithmeticOCRRequest() = default; std::string ToJsonString() const; /** * 获取图片的 Base64 值。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经Base64编码后不超过 7M。图片下载时间不超过 3 秒。 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。 * @return ImageBase64 图片的 Base64 值。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经Base64编码后不超过 7M。图片下载时间不超过 3 秒。 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。 */ std::string GetImageBase64() const; /** * 设置图片的 Base64 值。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经Base64编码后不超过 7M。图片下载时间不超过 3 秒。 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。 * @param ImageBase64 图片的 Base64 值。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经Base64编码后不超过 7M。图片下载时间不超过 3 秒。 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。 */ void SetImageBase64(const std::string& _imageBase64); /** * 判断参数 ImageBase64 是否已赋值 * @return ImageBase64 是否已赋值 */ bool ImageBase64HasBeenSet() const; /** * 获取图片的 Url 地址。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经 Base64 编码后不超过 7M。图片下载时间不超过 3 秒。 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。 非腾讯云存储的 Url 速度和稳定性可能受一定影响。 * @return ImageUrl 图片的 Url 地址。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经 Base64 编码后不超过 7M。图片下载时间不超过 3 秒。 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。 非腾讯云存储的 Url 速度和稳定性可能受一定影响。 */ std::string GetImageUrl() const; /** * 设置图片的 Url 地址。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经 Base64 编码后不超过 7M。图片下载时间不超过 3 秒。 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。 非腾讯云存储的 Url 速度和稳定性可能受一定影响。 * @param ImageUrl 图片的 Url 地址。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经 Base64 编码后不超过 7M。图片下载时间不超过 3 秒。 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。 非腾讯云存储的 Url 速度和稳定性可能受一定影响。 */ void SetImageUrl(const std::string& _imageUrl); /** * 判断参数 ImageUrl 是否已赋值 * @return ImageUrl 是否已赋值 */ bool ImageUrlHasBeenSet() const; /** * 获取用于选择是否支持横屏拍摄。打开则支持横屏拍摄图片角度判断,角度信息在返回参数的angle中,默认值为true * @return SupportHorizontalImage 用于选择是否支持横屏拍摄。打开则支持横屏拍摄图片角度判断,角度信息在返回参数的angle中,默认值为true */ bool GetSupportHorizontalImage() const; /** * 设置用于选择是否支持横屏拍摄。打开则支持横屏拍摄图片角度判断,角度信息在返回参数的angle中,默认值为true * @param SupportHorizontalImage 用于选择是否支持横屏拍摄。打开则支持横屏拍摄图片角度判断,角度信息在返回参数的angle中,默认值为true */ void SetSupportHorizontalImage(const bool& _supportHorizontalImage); /** * 判断参数 SupportHorizontalImage 是否已赋值 * @return SupportHorizontalImage 是否已赋值 */ bool SupportHorizontalImageHasBeenSet() const; /** * 获取是否拒绝非速算图,打开则拒绝非速算图(注:非速算图是指风景人物等明显不是速算图片的图片),默认值为false * @return RejectNonArithmeticPic 是否拒绝非速算图,打开则拒绝非速算图(注:非速算图是指风景人物等明显不是速算图片的图片),默认值为false */ bool GetRejectNonArithmeticPic() const; /** * 设置是否拒绝非速算图,打开则拒绝非速算图(注:非速算图是指风景人物等明显不是速算图片的图片),默认值为false * @param RejectNonArithmeticPic 是否拒绝非速算图,打开则拒绝非速算图(注:非速算图是指风景人物等明显不是速算图片的图片),默认值为false */ void SetRejectNonArithmeticPic(const bool& _rejectNonArithmeticPic); /** * 判断参数 RejectNonArithmeticPic 是否已赋值 * @return RejectNonArithmeticPic 是否已赋值 */ bool RejectNonArithmeticPicHasBeenSet() const; /** * 获取是否展开耦合算式中的竖式计算,默认值为false * @return EnableDispRelatedVertical 是否展开耦合算式中的竖式计算,默认值为false */ bool GetEnableDispRelatedVertical() const; /** * 设置是否展开耦合算式中的竖式计算,默认值为false * @param EnableDispRelatedVertical 是否展开耦合算式中的竖式计算,默认值为false */ void SetEnableDispRelatedVertical(const bool& _enableDispRelatedVertical); /** * 判断参数 EnableDispRelatedVertical 是否已赋值 * @return EnableDispRelatedVertical 是否已赋值 */ bool EnableDispRelatedVerticalHasBeenSet() const; /** * 获取是否展示竖式算式的中间结果和格式控制字符,默认值为false * @return EnableDispMidResult 是否展示竖式算式的中间结果和格式控制字符,默认值为false */ bool GetEnableDispMidResult() const; /** * 设置是否展示竖式算式的中间结果和格式控制字符,默认值为false * @param EnableDispMidResult 是否展示竖式算式的中间结果和格式控制字符,默认值为false */ void SetEnableDispMidResult(const bool& _enableDispMidResult); /** * 判断参数 EnableDispMidResult 是否已赋值 * @return EnableDispMidResult 是否已赋值 */ bool EnableDispMidResultHasBeenSet() const; /** * 获取是否开启pdf识别,默认值为true * @return EnablePdfRecognize 是否开启pdf识别,默认值为true */ bool GetEnablePdfRecognize() const; /** * 设置是否开启pdf识别,默认值为true * @param EnablePdfRecognize 是否开启pdf识别,默认值为true */ void SetEnablePdfRecognize(const bool& _enablePdfRecognize); /** * 判断参数 EnablePdfRecognize 是否已赋值 * @return EnablePdfRecognize 是否已赋值 */ bool EnablePdfRecognizeHasBeenSet() const; /** * 获取pdf页码,从0开始,默认为0 * @return PdfPageIndex pdf页码,从0开始,默认为0 */ int64_t GetPdfPageIndex() const; /** * 设置pdf页码,从0开始,默认为0 * @param PdfPageIndex pdf页码,从0开始,默认为0 */ void SetPdfPageIndex(const int64_t& _pdfPageIndex); /** * 判断参数 PdfPageIndex 是否已赋值 * @return PdfPageIndex 是否已赋值 */ bool PdfPageIndexHasBeenSet() const; private: /** * 图片的 Base64 值。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经Base64编码后不超过 7M。图片下载时间不超过 3 秒。 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。 */ std::string m_imageBase64; bool m_imageBase64HasBeenSet; /** * 图片的 Url 地址。 支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。 支持的图片大小:所下载图片经 Base64 编码后不超过 7M。图片下载时间不超过 3 秒。 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。 非腾讯云存储的 Url 速度和稳定性可能受一定影响。 */ std::string m_imageUrl; bool m_imageUrlHasBeenSet; /** * 用于选择是否支持横屏拍摄。打开则支持横屏拍摄图片角度判断,角度信息在返回参数的angle中,默认值为true */ bool m_supportHorizontalImage; bool m_supportHorizontalImageHasBeenSet; /** * 是否拒绝非速算图,打开则拒绝非速算图(注:非速算图是指风景人物等明显不是速算图片的图片),默认值为false */ bool m_rejectNonArithmeticPic; bool m_rejectNonArithmeticPicHasBeenSet; /** * 是否展开耦合算式中的竖式计算,默认值为false */ bool m_enableDispRelatedVertical; bool m_enableDispRelatedVerticalHasBeenSet; /** * 是否展示竖式算式的中间结果和格式控制字符,默认值为false */ bool m_enableDispMidResult; bool m_enableDispMidResultHasBeenSet; /** * 是否开启pdf识别,默认值为true */ bool m_enablePdfRecognize; bool m_enablePdfRecognizeHasBeenSet; /** * pdf页码,从0开始,默认为0 */ int64_t m_pdfPageIndex; bool m_pdfPageIndexHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_OCR_V20181119_MODEL_ARITHMETICOCRREQUEST_H_
36.505338
108
0.522129
[ "vector", "model" ]
6414988b49e2a2ea5ff446de77efd838cfc127dc
25,510
c
C
busybox/e2fsprogs/fsck.c
rhausam/wine-crossover
b954f98f25f195f9de29c28c41fcb074d77de0f0
[ "MIT" ]
null
null
null
busybox/e2fsprogs/fsck.c
rhausam/wine-crossover
b954f98f25f195f9de29c28c41fcb074d77de0f0
[ "MIT" ]
null
null
null
busybox/e2fsprogs/fsck.c
rhausam/wine-crossover
b954f98f25f195f9de29c28c41fcb074d77de0f0
[ "MIT" ]
null
null
null
/* vi: set sw=4 ts=4: */ /* * fsck --- A generic, parallelizing front-end for the fsck program. * It will automatically try to run fsck programs in parallel if the * devices are on separate spindles. It is based on the same ideas as * the generic front end for fsck by David Engel and Fred van Kempen, * but it has been completely rewritten from scratch to support * parallel execution. * * Written by Theodore Ts'o, <tytso@mit.edu> * * Miquel van Smoorenburg (miquels@drinkel.ow.org) 20-Oct-1994: * o Changed -t fstype to behave like with mount when -A (all file * systems) or -M (like mount) is specified. * o fsck looks if it can find the fsck.type program to decide * if it should ignore the fs type. This way more fsck programs * can be added without changing this front-end. * o -R flag skip root file system. * * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, * 2001, 2002, 2003, 2004, 2005 by Theodore Ts'o. * * Licensed under GPLv2, see file LICENSE in this source tree. */ /* All filesystem specific hooks have been removed. * If filesystem cannot be determined, we will execute * "fsck.auto". Currently this also happens if you specify * UUID=xxx or LABEL=xxx as an object to check. * Detection code for that is also probably has to be in fsck.auto. * * In other words, this is _really_ is just a driver program which * spawns actual fsck.something for each filesystem to check. * It doesn't guess filesystem types from on-disk format. */ //config:config FSCK //config: bool "fsck" //config: default y //config: help //config: fsck is used to check and optionally repair one or more filesystems. //config: In actuality, fsck is simply a front-end for the various file system //config: checkers (fsck.fstype) available under Linux. //applet:IF_FSCK(APPLET(fsck, BB_DIR_SBIN, BB_SUID_DROP)) //kbuild:lib-$(CONFIG_FSCK) += fsck.o //usage:#define fsck_trivial_usage //usage: "[-ANPRTV] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]..." //usage:#define fsck_full_usage "\n\n" //usage: "Check and repair filesystems\n" //usage: "\n -A Walk /etc/fstab and check all filesystems" //usage: "\n -N Don't execute, just show what would be done" //usage: "\n -P With -A, check filesystems in parallel" //usage: "\n -R With -A, skip the root filesystem" //usage: "\n -T Don't show title on startup" //usage: "\n -V Verbose" //DO_PROGRESS_INDICATOR is off: ////usage: "\n -C FD Write status information to specified file descriptor" //usage: "\n -t TYPE List of filesystem types to check" #include "libbb.h" #include "common_bufsiz.h" /* "progress indicator" code is somewhat buggy and ext[23] specific. * We should be filesystem agnostic. IOW: there should be a well-defined * API for fsck.something, NOT ad-hoc hacks in generic fsck. */ #define DO_PROGRESS_INDICATOR 0 /* fsck 1.41.4 (27-Jan-2009) manpage says: * 0 - No errors * 1 - File system errors corrected * 2 - System should be rebooted * 4 - File system errors left uncorrected * 8 - Operational error * 16 - Usage or syntax error * 32 - Fsck canceled by user request * 128 - Shared library error */ #define EXIT_OK 0 #define EXIT_NONDESTRUCT 1 #define EXIT_DESTRUCT 2 #define EXIT_UNCORRECTED 4 #define EXIT_ERROR 8 #define EXIT_USAGE 16 #define FSCK_CANCELED 32 /* Aborted with a signal or ^C */ /* * Internal structure for mount table entries. */ struct fs_info { struct fs_info *next; char *device; char *mountpt; char *type; char *opts; int passno; int flags; }; #define FLAG_DONE 1 #define FLAG_PROGRESS 2 /* * Structure to allow exit codes to be stored */ struct fsck_instance { struct fsck_instance *next; int pid; int flags; #if DO_PROGRESS_INDICATOR time_t start_time; #endif char *prog; char *device; char *base_device; /* /dev/hda for /dev/hdaN etc */ }; static const char ignored_types[] ALIGN1 = "ignore\0" "iso9660\0" "nfs\0" "proc\0" "sw\0" "swap\0" "tmpfs\0" "devpts\0"; #if 0 static const char really_wanted[] ALIGN1 = "minix\0" "ext2\0" "ext3\0" "jfs\0" "reiserfs\0" "xiafs\0" "xfs\0"; #endif #define BASE_MD "/dev/md" struct globals { char **args; int num_args; int verbose; #define FS_TYPE_FLAG_NORMAL 0 #define FS_TYPE_FLAG_OPT 1 #define FS_TYPE_FLAG_NEGOPT 2 char **fs_type_list; uint8_t *fs_type_flag; smallint fs_type_negated; smallint noexecute; smallint serialize; smallint skip_root; /* smallint like_mount; */ smallint parallel_root; smallint force_all_parallel; smallint kill_sent; #if DO_PROGRESS_INDICATOR smallint progress; int progress_fd; #endif int num_running; int max_running; char *fstype; struct fs_info *filesys_info; struct fs_info *filesys_last; struct fsck_instance *instance_list; } FIX_ALIASING; #define G (*(struct globals*)bb_common_bufsiz1) #define INIT_G() do { \ setup_common_bufsiz(); \ BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ } while (0) /* * Return the "base device" given a particular device; this is used to * assure that we only fsck one partition on a particular drive at any * one time. Otherwise, the disk heads will be seeking all over the * place. If the base device cannot be determined, return NULL. * * The base_device() function returns an allocated string which must * be freed. */ #if ENABLE_FEATURE_DEVFS /* * Required for the uber-silly devfs /dev/ide/host1/bus2/target3/lun3 * pathames. */ static const char *const devfs_hier[] = { "host", "bus", "target", "lun", NULL }; #endif static char *base_device(const char *device) { char *str, *cp; #if ENABLE_FEATURE_DEVFS const char *const *hier; const char *disk; int len; #endif str = xstrdup(device); /* Skip over "/dev/"; if it's not present, give up */ cp = skip_dev_pfx(str); if (cp == str) goto errout; /* * For md devices, we treat them all as if they were all * on one disk, since we don't know how to parallelize them. */ if (cp[0] == 'm' && cp[1] == 'd') { cp[2] = 0; return str; } /* Handle DAC 960 devices */ if (is_prefixed_with(cp, "rd/")) { cp += 3; if (cp[0] != 'c' || !isdigit(cp[1]) || cp[2] != 'd' || !isdigit(cp[3])) goto errout; cp[4] = 0; return str; } /* Now let's handle /dev/hd* and /dev/sd* devices.... */ if ((cp[0] == 'h' || cp[0] == 's') && cp[1] == 'd') { cp += 2; /* If there's a single number after /dev/hd, skip it */ if (isdigit(*cp)) cp++; /* What follows must be an alpha char, or give up */ if (!isalpha(*cp)) goto errout; cp[1] = 0; return str; } #if ENABLE_FEATURE_DEVFS /* Now let's handle devfs (ugh) names */ len = 0; if (is_prefixed_with(cp, "ide/")) len = 4; if (is_prefixed_with(cp, "scsi/")) len = 5; if (len) { cp += len; /* * Now we proceed down the expected devfs hierarchy. * i.e., .../host1/bus2/target3/lun4/... * If we don't find the expected token, followed by * some number of digits at each level, abort. */ for (hier = devfs_hier; *hier; hier++) { cp = is_prefixed_with(cp, *hier); if (!cp) goto errout; while (*cp != '/' && *cp != '\0') { if (!isdigit(*cp)) goto errout; cp++; } //FIXME: what if *cp = '\0' now? cp++ moves past it!!! cp++; } cp[-1] = '\0'; return str; } /* Now handle devfs /dev/disc or /dev/disk names */ disk = NULL; if (is_prefixed_with(cp, "discs/")) disk = "disc"; else if (is_prefixed_with(cp, "disks/")) disk = "disk"; if (disk) { cp += 6; cp = is_prefixed_with(cp, disk); if (!cp) goto errout; while (*cp != '/' && *cp != '\0') { if (!isdigit(*cp)) goto errout; cp++; } *cp = '\0'; return str; } #endif errout: free(str); return NULL; } static void free_instance(struct fsck_instance *p) { free(p->prog); free(p->device); free(p->base_device); free(p); } static struct fs_info *create_fs_device(const char *device, const char *mntpnt, const char *type, const char *opts, int passno) { struct fs_info *fs; fs = xzalloc(sizeof(*fs)); fs->device = xstrdup(device); fs->mountpt = xstrdup(mntpnt); if (strchr(type, ',')) type = (char *)"auto"; fs->type = xstrdup(type); fs->opts = xstrdup(opts ? opts : ""); fs->passno = passno < 0 ? 1 : passno; /*fs->flags = 0; */ /*fs->next = NULL; */ if (!G.filesys_info) G.filesys_info = fs; else G.filesys_last->next = fs; G.filesys_last = fs; return fs; } /* Load the filesystem database from /etc/fstab */ static void load_fs_info(const char *filename) { FILE *fstab; struct mntent mte; char buf[1024]; fstab = setmntent(filename, "r"); if (!fstab) { bb_perror_msg("can't read '%s'", filename); return; } // Loop through entries while (getmntent_r(fstab, &mte, buf, sizeof(buf))) { //bb_error_msg("CREATE[%s][%s][%s][%s][%d]", mte.mnt_fsname, mte.mnt_dir, // mte.mnt_type, mte.mnt_opts, // mte.mnt_passno); create_fs_device(mte.mnt_fsname, mte.mnt_dir, mte.mnt_type, mte.mnt_opts, mte.mnt_passno); } endmntent(fstab); } /* Lookup filesys in /etc/fstab and return the corresponding entry. */ static struct fs_info *lookup(char *filesys) { struct fs_info *fs; for (fs = G.filesys_info; fs; fs = fs->next) { if (strcmp(filesys, fs->device) == 0 || (fs->mountpt && strcmp(filesys, fs->mountpt) == 0) ) break; } return fs; } #if DO_PROGRESS_INDICATOR static int progress_active(void) { struct fsck_instance *inst; for (inst = G.instance_list; inst; inst = inst->next) { if (inst->flags & FLAG_DONE) continue; if (inst->flags & FLAG_PROGRESS) return 1; } return 0; } #endif /* * Send a signal to all outstanding fsck child processes */ static void kill_all_if_got_signal(void) { struct fsck_instance *inst; if (!bb_got_signal || G.kill_sent) return; for (inst = G.instance_list; inst; inst = inst->next) { if (inst->flags & FLAG_DONE) continue; kill(inst->pid, SIGTERM); } G.kill_sent = 1; } /* * Wait for one child process to exit; when it does, unlink it from * the list of executing child processes, free, and return its exit status. * If there is no exited child, return -1. */ static int wait_one(int flags) { int status; int sig; struct fsck_instance *inst, *prev; pid_t pid; if (!G.instance_list) return -1; /* if (G.noexecute) { already returned -1; } */ while (1) { pid = waitpid(-1, &status, flags); kill_all_if_got_signal(); if (pid == 0) /* flags == WNOHANG and no children exited */ return -1; if (pid < 0) { if (errno == EINTR) continue; if (errno == ECHILD) { /* paranoia */ bb_error_msg("wait: no more children"); return -1; } bb_perror_msg("wait"); continue; } prev = NULL; inst = G.instance_list; do { if (inst->pid == pid) goto child_died; prev = inst; inst = inst->next; } while (inst); } child_died: status = WEXITSTATUS(status); if (WIFSIGNALED(status)) { sig = WTERMSIG(status); status = EXIT_UNCORRECTED; if (sig != SIGINT) { printf("Warning: %s %s terminated " "by signal %d\n", inst->prog, inst->device, sig); status = EXIT_ERROR; } } #if DO_PROGRESS_INDICATOR if (progress && (inst->flags & FLAG_PROGRESS) && !progress_active()) { struct fsck_instance *inst2; for (inst2 = G.instance_list; inst2; inst2 = inst2->next) { if (inst2->flags & FLAG_DONE) continue; if (strcmp(inst2->type, "ext2") != 0 && strcmp(inst2->type, "ext3") != 0 ) { continue; } /* ext[23], we will send USR1 * (request to start displaying progress bar) * * If we've just started the fsck, wait a tiny * bit before sending the kill, to give it * time to set up the signal handler */ if (inst2->start_time >= time(NULL) - 1) sleep(1); kill(inst2->pid, SIGUSR1); inst2->flags |= FLAG_PROGRESS; break; } } #endif if (prev) prev->next = inst->next; else G.instance_list = inst->next; if (G.verbose > 1) printf("Finished with %s (exit status %d)\n", inst->device, status); G.num_running--; free_instance(inst); return status; } /* * Wait until all executing child processes have exited; return the * logical OR of all of their exit code values. */ #define FLAG_WAIT_ALL 0 #define FLAG_WAIT_ATLEAST_ONE WNOHANG static int wait_many(int flags) { int exit_status; int global_status = 0; int wait_flags = 0; while ((exit_status = wait_one(wait_flags)) != -1) { global_status |= exit_status; wait_flags |= flags; } return global_status; } /* * Execute a particular fsck program, and link it into the list of * child processes we are waiting for. */ static void execute(const char *type, const char *device, const char *mntpt /*, int interactive */) { int i; struct fsck_instance *inst; pid_t pid; G.args[0] = xasprintf("fsck.%s", type); #if DO_PROGRESS_INDICATOR if (progress && !progress_active()) { if (strcmp(type, "ext2") == 0 || strcmp(type, "ext3") == 0 ) { G.args[XXX] = xasprintf("-C%d", progress_fd); /* 1 */ inst->flags |= FLAG_PROGRESS; } } #endif G.args[G.num_args - 2] = (char*)device; /* G.args[G.num_args - 1] = NULL; - already is */ if (G.verbose || G.noexecute) { printf("[%s (%d) -- %s]", G.args[0], G.num_running, mntpt ? mntpt : device); for (i = 0; G.args[i]; i++) printf(" %s", G.args[i]); bb_putchar('\n'); } /* Fork and execute the correct program. */ pid = -1; if (!G.noexecute) { pid = spawn(G.args); if (pid < 0) bb_simple_perror_msg(G.args[0]); } #if DO_PROGRESS_INDICATOR free(G.args[XXX]); #endif /* No child, so don't record an instance */ if (pid <= 0) { free(G.args[0]); return; } inst = xzalloc(sizeof(*inst)); inst->pid = pid; inst->prog = G.args[0]; inst->device = xstrdup(device); inst->base_device = base_device(device); #if DO_PROGRESS_INDICATOR inst->start_time = time(NULL); #endif /* Add to the list of running fsck's. * (was adding to the end, but adding to the front is simpler...) */ inst->next = G.instance_list; G.instance_list = inst; } /* * Run the fsck program on a particular device * * If the type is specified using -t, and it isn't prefixed with "no" * (as in "noext2") and only one filesystem type is specified, then * use that type regardless of what is specified in /etc/fstab. * * If the type isn't specified by the user, then use either the type * specified in /etc/fstab, or "auto". */ static void fsck_device(struct fs_info *fs /*, int interactive */) { const char *type; if (strcmp(fs->type, "auto") != 0) { type = fs->type; if (G.verbose > 2) printf("using filesystem type '%s' %s\n", type, "from fstab"); } else if (G.fstype && (G.fstype[0] != 'n' || G.fstype[1] != 'o') /* != "no" */ && !is_prefixed_with(G.fstype, "opts=") && !is_prefixed_with(G.fstype, "loop") && !strchr(G.fstype, ',') ) { type = G.fstype; if (G.verbose > 2) printf("using filesystem type '%s' %s\n", type, "from -t"); } else { type = "auto"; if (G.verbose > 2) printf("using filesystem type '%s' %s\n", type, "(default)"); } G.num_running++; execute(type, fs->device, fs->mountpt /*, interactive */); } /* * Returns TRUE if a partition on the same disk is already being * checked. */ static int device_already_active(char *device) { struct fsck_instance *inst; char *base; if (G.force_all_parallel) return 0; #ifdef BASE_MD /* Don't check a soft raid disk with any other disk */ if (G.instance_list && (is_prefixed_with(G.instance_list->device, BASE_MD) || is_prefixed_with(device, BASE_MD)) ) { return 1; } #endif base = base_device(device); /* * If we don't know the base device, assume that the device is * already active if there are any fsck instances running. */ if (!base) return (G.instance_list != NULL); for (inst = G.instance_list; inst; inst = inst->next) { if (!inst->base_device || strcmp(base, inst->base_device) == 0) { free(base); return 1; } } free(base); return 0; } /* * This function returns true if a particular option appears in a * comma-delimited options list */ static int opt_in_list(char *opt, char *optlist) { char *s; int len; if (!optlist) return 0; len = strlen(opt); s = optlist - 1; while (1) { s = strstr(s + 1, opt); if (!s) return 0; /* neither "opt.." nor "xxx,opt.."? */ if (s != optlist && s[-1] != ',') continue; /* neither "..opt" nor "..opt,xxx"? */ if (s[len] != '\0' && s[len] != ',') continue; return 1; } } /* See if the filesystem matches the criteria given by the -t option */ static int fs_match(struct fs_info *fs) { int n, ret, checked_type; char *cp; if (!G.fs_type_list) return 1; ret = 0; checked_type = 0; n = 0; while (1) { cp = G.fs_type_list[n]; if (!cp) break; switch (G.fs_type_flag[n]) { case FS_TYPE_FLAG_NORMAL: checked_type++; if (strcmp(cp, fs->type) == 0) ret = 1; break; case FS_TYPE_FLAG_NEGOPT: if (opt_in_list(cp, fs->opts)) return 0; break; case FS_TYPE_FLAG_OPT: if (!opt_in_list(cp, fs->opts)) return 0; break; } n++; } if (checked_type == 0) return 1; return (G.fs_type_negated ? !ret : ret); } /* Check if we should ignore this filesystem. */ static int ignore(struct fs_info *fs) { /* * If the pass number is 0, ignore it. */ if (fs->passno == 0) return 1; /* * If a specific fstype is specified, and it doesn't match, * ignore it. */ if (!fs_match(fs)) return 1; /* Are we ignoring this type? */ if (index_in_strings(ignored_types, fs->type) >= 0) return 1; /* We can and want to check this file system type. */ return 0; } /* Check all file systems, using the /etc/fstab table. */ static int check_all(void) { struct fs_info *fs; int status = EXIT_OK; smallint not_done_yet; smallint pass_done; int passno; if (G.verbose) puts("Checking all filesystems"); /* * Do an initial scan over the filesystem; mark filesystems * which should be ignored as done, and resolve any "auto" * filesystem types (done as a side-effect of calling ignore()). */ for (fs = G.filesys_info; fs; fs = fs->next) if (ignore(fs)) fs->flags |= FLAG_DONE; /* * Find and check the root filesystem. */ if (!G.parallel_root) { for (fs = G.filesys_info; fs; fs = fs->next) { if (LONE_CHAR(fs->mountpt, '/')) { if (!G.skip_root && !ignore(fs)) { fsck_device(fs /*, 1*/); status |= wait_many(FLAG_WAIT_ALL); if (status > EXIT_NONDESTRUCT) return status; } fs->flags |= FLAG_DONE; break; } } } /* * This is for the bone-headed user who has root * filesystem listed twice. * "Skip root" will skip _all_ root entries. */ if (G.skip_root) for (fs = G.filesys_info; fs; fs = fs->next) if (LONE_CHAR(fs->mountpt, '/')) fs->flags |= FLAG_DONE; not_done_yet = 1; passno = 1; while (not_done_yet) { not_done_yet = 0; pass_done = 1; for (fs = G.filesys_info; fs; fs = fs->next) { if (bb_got_signal) break; if (fs->flags & FLAG_DONE) continue; /* * If the filesystem's pass number is higher * than the current pass number, then we didn't * do it yet. */ if (fs->passno > passno) { not_done_yet = 1; continue; } /* * If a filesystem on a particular device has * already been spawned, then we need to defer * this to another pass. */ if (device_already_active(fs->device)) { pass_done = 0; continue; } /* * Spawn off the fsck process */ fsck_device(fs /*, G.serialize*/); fs->flags |= FLAG_DONE; /* * Only do one filesystem at a time, or if we * have a limit on the number of fsck's extant * at one time, apply that limit. */ if (G.serialize || (G.num_running >= G.max_running) ) { pass_done = 0; break; } } if (bb_got_signal) break; if (G.verbose > 1) printf("--waiting-- (pass %d)\n", passno); status |= wait_many(pass_done ? FLAG_WAIT_ALL : FLAG_WAIT_ATLEAST_ONE); if (pass_done) { if (G.verbose > 1) puts("----------------------------------"); passno++; } else not_done_yet = 1; } kill_all_if_got_signal(); status |= wait_many(FLAG_WAIT_ATLEAST_ONE); return status; } /* * Deal with the fsck -t argument. * Huh, for mount "-t novfat,nfs" means "neither vfat nor nfs"! * Why here we require "-t novfat,nonfs" ?? */ static void compile_fs_type(char *fs_type) { char *s; int num = 2; smallint negate; s = fs_type; while ((s = strchr(s, ','))) { num++; s++; } G.fs_type_list = xzalloc(num * sizeof(G.fs_type_list[0])); G.fs_type_flag = xzalloc(num * sizeof(G.fs_type_flag[0])); G.fs_type_negated = -1; /* not yet known is it negated or not */ num = 0; s = fs_type; while (1) { char *comma; negate = 0; if (s[0] == 'n' && s[1] == 'o') { /* "no.." */ s += 2; negate = 1; } else if (s[0] == '!') { s++; negate = 1; } if (strcmp(s, "loop") == 0) /* loop is really short-hand for opts=loop */ goto loop_special_case; if (is_prefixed_with(s, "opts=")) { s += 5; loop_special_case: G.fs_type_flag[num] = negate ? FS_TYPE_FLAG_NEGOPT : FS_TYPE_FLAG_OPT; } else { if (G.fs_type_negated == -1) G.fs_type_negated = negate; if (G.fs_type_negated != negate) bb_error_msg_and_die( "either all or none of the filesystem types passed to -t must be prefixed " "with 'no' or '!'"); } comma = strchrnul(s, ','); G.fs_type_list[num++] = xstrndup(s, comma-s); if (*comma == '\0') break; s = comma + 1; } } static char **new_args(void) { G.args = xrealloc_vector(G.args, 2, G.num_args); return &G.args[G.num_args++]; } int fsck_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int fsck_main(int argc UNUSED_PARAM, char **argv) { int i, status; /*int interactive;*/ struct fs_info *fs; const char *fstab; char *tmp; char **devices; int num_devices; smallint opts_for_fsck; smallint doall; smallint notitle; INIT_G(); /* we want wait() to be interruptible */ signal_no_SA_RESTART_empty_mask(SIGINT, record_signo); signal_no_SA_RESTART_empty_mask(SIGTERM, record_signo); setbuf(stdout, NULL); opts_for_fsck = doall = notitle = 0; devices = NULL; num_devices = 0; new_args(); /* G.args[0] = NULL, will be replaced by fsck.<type> */ /* G.instance_list = NULL; - in bss, so already zeroed */ while (*++argv) { int j; int optpos; char *options; char *arg = *argv; /* "/dev/blk" or "/path" or "UUID=xxx" or "LABEL=xxx" */ if ((arg[0] == '/' && !opts_for_fsck) || strchr(arg, '=')) { // FIXME: must check that arg is a blkdev, or resolve // "/path", "UUID=xxx" or "LABEL=xxx" into block device name // ("UUID=xxx"/"LABEL=xxx" can probably shifted to fsck.auto duties) devices = xrealloc_vector(devices, 2, num_devices); devices[num_devices++] = arg; continue; } if (arg[0] != '-' || opts_for_fsck) { *new_args() = arg; continue; } if (LONE_CHAR(arg + 1, '-')) { /* "--" ? */ opts_for_fsck = 1; continue; } optpos = 0; options = NULL; for (j = 1; arg[j]; j++) { switch (arg[j]) { case 'A': doall = 1; break; #if DO_PROGRESS_INDICATOR case 'C': progress = 1; if (arg[++j]) { /* -Cn */ progress_fd = xatoi_positive(&arg[j]); goto next_arg; } /* -C n */ if (!*++argv) bb_show_usage(); progress_fd = xatoi_positive(*argv); goto next_arg; #endif case 'V': G.verbose++; break; case 'N': G.noexecute = 1; break; case 'R': G.skip_root = 1; break; case 'T': notitle = 1; break; /* case 'M': like_mount = 1; break; */ case 'P': G.parallel_root = 1; break; case 's': G.serialize = 1; break; case 't': if (G.fstype) bb_show_usage(); if (arg[++j]) tmp = &arg[j]; else if (*++argv) tmp = *argv; else bb_show_usage(); G.fstype = xstrdup(tmp); compile_fs_type(G.fstype); goto next_arg; case '?': bb_show_usage(); break; default: optpos++; /* one extra for '\0' */ options = xrealloc(options, optpos + 2); options[optpos] = arg[j]; break; } } next_arg: if (optpos) { options[0] = '-'; options[optpos + 1] = '\0'; *new_args() = options; } } if (getenv("FSCK_FORCE_ALL_PARALLEL")) G.force_all_parallel = 1; tmp = getenv("FSCK_MAX_INST"); G.max_running = INT_MAX; if (tmp) G.max_running = xatoi(tmp); new_args(); /* G.args[G.num_args - 2] will be replaced by <device> */ new_args(); /* G.args[G.num_args - 1] is the last, NULL element */ if (!notitle) puts("fsck (busybox "BB_VER", "BB_BT")"); /* Even plain "fsck /dev/hda1" needs fstab to get fs type, * so we are scanning it anyway */ fstab = getenv("FSTAB_FILE"); if (!fstab) fstab = "/etc/fstab"; load_fs_info(fstab); /*interactive = (num_devices == 1) | G.serialize;*/ if (num_devices == 0) /*interactive =*/ G.serialize = doall = 1; if (doall) return check_all(); status = 0; for (i = 0; i < num_devices; i++) { if (bb_got_signal) { kill_all_if_got_signal(); break; } fs = lookup(devices[i]); if (!fs) fs = create_fs_device(devices[i], "", "auto", NULL, -1); fsck_device(fs /*, interactive */); if (G.serialize || (G.num_running >= G.max_running) ) { int exit_status = wait_one(0); if (exit_status >= 0) status |= exit_status; if (G.verbose > 1) puts("----------------------------------"); } } status |= wait_many(FLAG_WAIT_ALL); return status; }
22.878924
80
0.627597
[ "object" ]
64161858a25733f1c70d7f22b67b4ba766f3989e
246,485
h
C
Include/10.0.15063.0/winrt/windows.graphics.holographic.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
5
2020-05-29T06:22:17.000Z
2021-11-28T08:21:38.000Z
Include/10.0.15063.0/winrt/windows.graphics.holographic.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
null
null
null
Include/10.0.15063.0/winrt/windows.graphics.holographic.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
5
2020-05-30T04:15:11.000Z
2021-11-28T08:48:56.000Z
/* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 8.01.0622 */ /* @@MIDL_FILE_HEADING( ) */ /* verify that the <rpcndr.h> version is high enough to compile this file*/ #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 500 #endif /* verify that the <rpcsal.h> version is high enough to compile this file*/ #ifndef __REQUIRED_RPCSAL_H_VERSION__ #define __REQUIRED_RPCSAL_H_VERSION__ 100 #endif #include "rpc.h" #include "rpcndr.h" #ifndef __RPCNDR_H_VERSION__ #error this stub requires an updated version of <rpcndr.h> #endif /* __RPCNDR_H_VERSION__ */ #ifndef COM_NO_WINDOWS_H #include "windows.h" #include "ole2.h" #endif /*COM_NO_WINDOWS_H*/ #ifndef __windows2Egraphics2Eholographic_h__ #define __windows2Egraphics2Eholographic_h__ #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif /* Forward Declarations */ #ifndef ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ #define ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ typedef interface __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera; #endif /* ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ */ #ifndef ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ #define ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ typedef interface __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera; #endif /* ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ */ #ifndef ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ #define ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ typedef interface __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose; #endif /* ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ */ #ifndef ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ #define ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ typedef interface __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose; #endif /* ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ */ #ifndef ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ #define ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ typedef interface __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera; #endif /* ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ */ #ifndef ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ #define ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ typedef interface __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose; #endif /* ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ */ #ifndef ____FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_FWD_DEFINED__ #define ____FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_FWD_DEFINED__ typedef interface __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform; #endif /* ____FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_FWD_DEFINED__ */ #ifndef ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_FWD_DEFINED__ #define ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_FWD_DEFINED__ typedef interface __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs; #endif /* ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_FWD_DEFINED__ */ #ifndef ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_FWD_DEFINED__ #define ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_FWD_DEFINED__ typedef interface __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs; #endif /* ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicCamera; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicCamera2; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicCameraPose; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicCameraRenderingParameters; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicCameraRenderingParameters2; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicCameraViewportParameters; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicDisplay; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicDisplayStatics; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicFrame; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicFramePrediction; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicSpace; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicSpaceCameraAddedEventArgs; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicSpaceCameraRemovedEventArgs; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicSpaceStatics; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_FWD_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicSpaceStatics2; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_FWD_DEFINED__ */ /* header files for imported files */ #include "inspectable.h" #include "AsyncInfo.h" #include "EventToken.h" #include "Windows.Foundation.h" #include "Windows.Foundation.Numerics.h" #include "Windows.Graphics.DirectX.Direct3D11.h" #include "Windows.Perception.h" #include "Windows.Perception.Spatial.h" #ifdef __cplusplus extern "C"{ #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0000 */ /* [local] */ #ifdef __cplusplus } /*extern "C"*/ #endif #include <windows.foundation.collections.h> #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicCamera; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicCamera; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0000 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0000_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0000_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4664 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4664 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4664_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4664_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0001 */ /* [local] */ #ifndef DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE #define DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("6acc8576-2fea-561d-84dd-4a1ab05fc7ed")) IIterator<ABI::Windows::Graphics::Holographic::HolographicCamera*> : IIterator_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicCamera*, ABI::Windows::Graphics::Holographic::IHolographicCamera*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterator`1<Windows.Graphics.Holographic.HolographicCamera>"; } }; typedef IIterator<ABI::Windows::Graphics::Holographic::HolographicCamera*> __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_t; #define ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera ABI::Windows::Foundation::Collections::__FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0001 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0001_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0001_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4665 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4665 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4665_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4665_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0002 */ /* [local] */ #ifndef DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE #define DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("b2afd154-8db0-5bb2-ad7a-684afd479264")) IIterable<ABI::Windows::Graphics::Holographic::HolographicCamera*> : IIterable_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicCamera*, ABI::Windows::Graphics::Holographic::IHolographicCamera*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterable`1<Windows.Graphics.Holographic.HolographicCamera>"; } }; typedef IIterable<ABI::Windows::Graphics::Holographic::HolographicCamera*> __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_t; #define ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera ABI::Windows::Foundation::Collections::__FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicCameraPose; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicCameraPose; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0002 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0002_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0002_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4666 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4666 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4666_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4666_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0003 */ /* [local] */ #ifndef DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE #define DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("93e27fb4-332b-591e-ae6b-6192fa0a1009")) IIterator<ABI::Windows::Graphics::Holographic::HolographicCameraPose*> : IIterator_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicCameraPose*, ABI::Windows::Graphics::Holographic::IHolographicCameraPose*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterator`1<Windows.Graphics.Holographic.HolographicCameraPose>"; } }; typedef IIterator<ABI::Windows::Graphics::Holographic::HolographicCameraPose*> __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_t; #define ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose ABI::Windows::Foundation::Collections::__FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0003 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0003_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0003_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4667 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4667 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4667_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4667_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0004 */ /* [local] */ #ifndef DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE #define DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("92111aff-8dcc-538e-ae3d-31fd252a0ad5")) IIterable<ABI::Windows::Graphics::Holographic::HolographicCameraPose*> : IIterable_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicCameraPose*, ABI::Windows::Graphics::Holographic::IHolographicCameraPose*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterable`1<Windows.Graphics.Holographic.HolographicCameraPose>"; } }; typedef IIterable<ABI::Windows::Graphics::Holographic::HolographicCameraPose*> __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_t; #define ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose ABI::Windows::Foundation::Collections::__FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0004 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0004_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0004_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4668 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4668 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4668_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4668_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0005 */ /* [local] */ #ifndef DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE #define DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("01d6c0ae-ada5-50b0-8562-41fb1205bb4a")) IVectorView<ABI::Windows::Graphics::Holographic::HolographicCamera*> : IVectorView_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicCamera*, ABI::Windows::Graphics::Holographic::IHolographicCamera*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IVectorView`1<Windows.Graphics.Holographic.HolographicCamera>"; } }; typedef IVectorView<ABI::Windows::Graphics::Holographic::HolographicCamera*> __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_t; #define ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_FWD_DEFINED__ #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera ABI::Windows::Foundation::Collections::__FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_USE */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0005 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0005_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0005_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4669 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4669 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4669_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4669_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0006 */ /* [local] */ #ifndef DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE #define DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("17c5dfb1-6e87-5a17-a791-ac07f8ee9292")) IVectorView<ABI::Windows::Graphics::Holographic::HolographicCameraPose*> : IVectorView_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicCameraPose*, ABI::Windows::Graphics::Holographic::IHolographicCameraPose*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IVectorView`1<Windows.Graphics.Holographic.HolographicCameraPose>"; } }; typedef IVectorView<ABI::Windows::Graphics::Holographic::HolographicCameraPose*> __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_t; #define ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_FWD_DEFINED__ #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose ABI::Windows::Foundation::Collections::__FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { struct HolographicStereoTransform; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0006 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0006_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0006_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4670 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4670 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4670_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4670_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0007 */ /* [local] */ #ifndef DEF___FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_USE #define DEF___FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("6e67ce78-cc67-52c0-b635-991db0bff5ca")) IReference<struct ABI::Windows::Graphics::Holographic::HolographicStereoTransform> : IReference_impl<struct ABI::Windows::Graphics::Holographic::HolographicStereoTransform> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.IReference`1<Windows.Graphics.Holographic.HolographicStereoTransform>"; } }; typedef IReference<struct ABI::Windows::Graphics::Holographic::HolographicStereoTransform> __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_t; #define ____FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_FWD_DEFINED__ #define __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform ABI::Windows::Foundation::__FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicSpace; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicSpace; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicSpaceCameraAddedEventArgs; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicSpaceCameraAddedEventArgs; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0007 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0007_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0007_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4671 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4671 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4671_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4671_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0008 */ /* [local] */ #ifndef DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_USE #define DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("71d80b7c-1d27-5102-83d1-4f0efc7c9d6f")) ITypedEventHandler<ABI::Windows::Graphics::Holographic::HolographicSpace*,ABI::Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs*> : ITypedEventHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicSpace*, ABI::Windows::Graphics::Holographic::IHolographicSpace*>,ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs*, ABI::Windows::Graphics::Holographic::IHolographicSpaceCameraAddedEventArgs*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.TypedEventHandler`2<Windows.Graphics.Holographic.HolographicSpace, Windows.Graphics.Holographic.HolographicSpaceCameraAddedEventArgs>"; } }; typedef ITypedEventHandler<ABI::Windows::Graphics::Holographic::HolographicSpace*,ABI::Windows::Graphics::Holographic::HolographicSpaceCameraAddedEventArgs*> __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_t; #define ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_FWD_DEFINED__ #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs ABI::Windows::Foundation::__FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicSpaceCameraRemovedEventArgs; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { interface IHolographicSpaceCameraRemovedEventArgs; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0008 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0008_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0008_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4672 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4672 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4672_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4672_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0009 */ /* [local] */ #ifndef DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_USE #define DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("db68cfc3-0874-502a-a3b9-2b1fe86c67be")) ITypedEventHandler<ABI::Windows::Graphics::Holographic::HolographicSpace*,ABI::Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs*> : ITypedEventHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicSpace*, ABI::Windows::Graphics::Holographic::IHolographicSpace*>,ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs*, ABI::Windows::Graphics::Holographic::IHolographicSpaceCameraRemovedEventArgs*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.TypedEventHandler`2<Windows.Graphics.Holographic.HolographicSpace, Windows.Graphics.Holographic.HolographicSpaceCameraRemovedEventArgs>"; } }; typedef ITypedEventHandler<ABI::Windows::Graphics::Holographic::HolographicSpace*,ABI::Windows::Graphics::Holographic::HolographicSpaceCameraRemovedEventArgs*> __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_t; #define ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_FWD_DEFINED__ #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs ABI::Windows::Foundation::__FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { struct SpatialBoundingFrustum; } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0009 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0009_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0009_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4673 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4673 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4673_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4673_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0010 */ /* [local] */ #ifndef DEF___FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum_USE #define DEF___FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("f434face-0c36-5749-a8a0-0bb6ce78a614")) IReference<struct ABI::Windows::Perception::Spatial::SpatialBoundingFrustum> : IReference_impl<struct ABI::Windows::Perception::Spatial::SpatialBoundingFrustum> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.IReference`1<Windows.Perception.Spatial.SpatialBoundingFrustum>"; } }; typedef IReference<struct ABI::Windows::Perception::Spatial::SpatialBoundingFrustum> __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum_t; #define ____FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum_FWD_DEFINED__ #define __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum ABI::Windows::Foundation::__FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum_USE */ interface IInspectable; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0010 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0010_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0010_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4674 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4674 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4674_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4674_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0011 */ /* [local] */ #ifndef DEF___FIEventHandler_1_IInspectable_USE #define DEF___FIEventHandler_1_IInspectable_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("c50898f6-c536-5f47-8583-8b2c2438a13b")) IEventHandler<IInspectable*> : IEventHandler_impl<IInspectable*> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.EventHandler`1<Object>"; } }; typedef IEventHandler<IInspectable*> __FIEventHandler_1_IInspectable_t; #define ____FIEventHandler_1_IInspectable_FWD_DEFINED__ #define __FIEventHandler_1_IInspectable ABI::Windows::Foundation::__FIEventHandler_1_IInspectable_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIEventHandler_1_IInspectable_USE */ #if defined(__cplusplus) } #endif // defined(__cplusplus) #include <Windows.Foundation.h> #if !defined(__windows2Efoundation2Enumerics_h__) #include <Windows.Foundation.Numerics.h> #endif // !defined(__windows2Efoundation2Enumerics_h__) #if !defined(__windows2Egraphics2Edirectx2Edirect3d11_h__) #include <Windows.Graphics.DirectX.Direct3D11.h> #endif // !defined(__windows2Egraphics2Edirectx2Edirect3d11_h__) #if !defined(__windows2Eperception_h__) #include <Windows.Perception.h> #endif // !defined(__windows2Eperception_h__) #if !defined(__windows2Eperception2Espatial_h__) #include <Windows.Perception.Spatial.h> #endif // !defined(__windows2Eperception2Espatial_h__) #if !defined(__windows2Eui2Ecore_h__) #include <Windows.UI.Core.h> #endif // !defined(__windows2Eui2Ecore_h__) #if defined(__cplusplus) extern "C" { #endif // defined(__cplusplus) #ifdef __cplusplus namespace ABI { namespace Windows { namespace Foundation { class Deferral; } /*Foundation*/ } /*Windows*/ } #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CFoundation_CNumerics_CMatrix4x4 __x_ABI_CWindows_CFoundation_CNumerics_CMatrix4x4; #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CFoundation_CNumerics_CVector2 __x_ABI_CWindows_CFoundation_CNumerics_CVector2; #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CFoundation_CNumerics_CVector3 __x_ABI_CWindows_CFoundation_CNumerics_CVector3; #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CFoundation_CRect __x_ABI_CWindows_CFoundation_CRect; #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CFoundation_CSize __x_ABI_CWindows_CFoundation_CSize; #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CFoundation_CTimeSpan __x_ABI_CWindows_CFoundation_CTimeSpan; #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { class PerceptionTimestamp; } /*Perception*/ } /*Windows*/ } #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSpatialBoundingFrustum __x_ABI_CWindows_CPerception_CSpatial_CSpatialBoundingFrustum; #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { class SpatialCoordinateSystem; } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { class SpatialLocator; } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace UI { namespace Core { class CoreWindow; } /*Core*/ } /*UI*/ } /*Windows*/ } #endif #if !defined(__cplusplus) #if !defined(__cplusplus) typedef enum __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentResult __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentResult; #endif /* end if !defined(__cplusplus) */ #endif #if !defined(__cplusplus) #if !defined(__cplusplus) typedef enum __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentWaitBehavior __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentWaitBehavior; #endif /* end if !defined(__cplusplus) */ #endif #if !defined(__cplusplus) #if !defined(__cplusplus) typedef enum __x_ABI_CWindows_CGraphics_CHolographic_CHolographicReprojectionMode __x_ABI_CWindows_CGraphics_CHolographic_CHolographicReprojectionMode; #endif /* end if !defined(__cplusplus) */ #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CHolographicAdapterId __x_ABI_CWindows_CGraphics_CHolographic_CHolographicAdapterId; #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CHolographicStereoTransform __x_ABI_CWindows_CGraphics_CHolographic_CHolographicStereoTransform; #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicCameraRenderingParameters; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicCameraViewportParameters; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicDisplay; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicFrame; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { class HolographicFramePrediction; } /*Holographic*/ } /*Graphics*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0011 */ /* [local] */ #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Foundation { namespace Numerics { typedef struct Matrix4x4 Matrix4x4; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Foundation { namespace Numerics { typedef struct Vector2 Vector2; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Foundation { namespace Numerics { typedef struct Vector3 Vector3; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Foundation { typedef struct Rect Rect; } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Foundation { typedef struct Size Size; } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Foundation { typedef struct TimeSpan TimeSpan; } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { typedef struct SpatialBoundingFrustum SpatialBoundingFrustum; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { typedef enum HolographicFramePresentResult HolographicFramePresentResult; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { typedef enum HolographicFramePresentWaitBehavior HolographicFramePresentWaitBehavior; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { typedef enum HolographicReprojectionMode HolographicReprojectionMode; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { typedef struct HolographicAdapterId HolographicAdapterId; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { typedef struct HolographicStereoTransform HolographicStereoTransform; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0011_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0011_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4675 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4675 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4675_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4675_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0012 */ /* [local] */ #ifndef DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera #define DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0012 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0012_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0012_v0_0_s_ifspec; #ifndef ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ #define ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ /* interface __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* [unique][uuid][object] */ /* interface __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("6acc8576-2fea-561d-84dd-4a1ab05fc7ed") __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Current( /* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCamera **current) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HasCurrent( /* [retval][out] */ __RPC__out boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE MoveNext( /* [retval][out] */ __RPC__out boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany( /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Graphics::Holographic::IHolographicCamera **items, /* [retval][out] */ __RPC__out unsigned int *actual) = 0; }; #else /* C style interface */ typedef struct __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Current )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera **current); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HasCurrent )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [retval][out] */ __RPC__out boolean *hasCurrent); HRESULT ( STDMETHODCALLTYPE *MoveNext )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [retval][out] */ __RPC__out boolean *hasCurrent); HRESULT ( STDMETHODCALLTYPE *GetMany )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera **items, /* [retval][out] */ __RPC__out unsigned int *actual); END_INTERFACE } __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl; interface __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera { CONST_VTBL struct __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_get_Current(This,current) \ ( (This)->lpVtbl -> get_Current(This,current) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_get_HasCurrent(This,hasCurrent) \ ( (This)->lpVtbl -> get_HasCurrent(This,hasCurrent) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_MoveNext(This,hasCurrent) \ ( (This)->lpVtbl -> MoveNext(This,hasCurrent) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetMany(This,capacity,items,actual) \ ( (This)->lpVtbl -> GetMany(This,capacity,items,actual) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0013 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0013 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0013_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0013_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4676 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4676 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4676_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4676_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0014 */ /* [local] */ #ifndef DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera #define DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0014 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0014_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0014_v0_0_s_ifspec; #ifndef ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ #define ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ /* interface __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* [unique][uuid][object] */ /* interface __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("b2afd154-8db0-5bb2-ad7a-684afd479264") __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE First( /* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera **first) = 0; }; #else /* C style interface */ typedef struct __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *First )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCamera **first); END_INTERFACE } __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl; interface __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera { CONST_VTBL struct __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_First(This,first) \ ( (This)->lpVtbl -> First(This,first) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0015 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0015 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0015_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0015_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4677 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4677 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4677_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4677_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0016 */ /* [local] */ #ifndef DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose #define DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0016 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0016_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0016_v0_0_s_ifspec; #ifndef ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ #define ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ /* interface __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* [unique][uuid][object] */ /* interface __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("93e27fb4-332b-591e-ae6b-6192fa0a1009") __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Current( /* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCameraPose **current) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HasCurrent( /* [retval][out] */ __RPC__out boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE MoveNext( /* [retval][out] */ __RPC__out boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany( /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Graphics::Holographic::IHolographicCameraPose **items, /* [retval][out] */ __RPC__out unsigned int *actual) = 0; }; #else /* C style interface */ typedef struct __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Current )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose **current); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HasCurrent )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [retval][out] */ __RPC__out boolean *hasCurrent); HRESULT ( STDMETHODCALLTYPE *MoveNext )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [retval][out] */ __RPC__out boolean *hasCurrent); HRESULT ( STDMETHODCALLTYPE *GetMany )( __RPC__in __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose **items, /* [retval][out] */ __RPC__out unsigned int *actual); END_INTERFACE } __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl; interface __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose { CONST_VTBL struct __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_get_Current(This,current) \ ( (This)->lpVtbl -> get_Current(This,current) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_get_HasCurrent(This,hasCurrent) \ ( (This)->lpVtbl -> get_HasCurrent(This,hasCurrent) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_MoveNext(This,hasCurrent) \ ( (This)->lpVtbl -> MoveNext(This,hasCurrent) ) #define __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetMany(This,capacity,items,actual) \ ( (This)->lpVtbl -> GetMany(This,capacity,items,actual) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0017 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0017 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0017_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0017_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4678 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4678 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4678_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4678_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0018 */ /* [local] */ #ifndef DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose #define DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0018 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0018_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0018_v0_0_s_ifspec; #ifndef ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ #define ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ /* interface __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* [unique][uuid][object] */ /* interface __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("92111aff-8dcc-538e-ae3d-31fd252a0ad5") __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE First( /* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose **first) = 0; }; #else /* C style interface */ typedef struct __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *First )( __RPC__in __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CGraphics__CHolographic__CHolographicCameraPose **first); END_INTERFACE } __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl; interface __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose { CONST_VTBL struct __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_First(This,first) \ ( (This)->lpVtbl -> First(This,first) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0019 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIIterable_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0019 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0019_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0019_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4679 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4679 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4679_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4679_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0020 */ /* [local] */ #ifndef DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera #define DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0020 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0020_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0020_v0_0_s_ifspec; #ifndef ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ #define ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ /* interface __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* [unique][uuid][object] */ /* interface __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("01d6c0ae-ada5-50b0-8562-41fb1205bb4a") __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE GetAt( /* [in] */ unsigned int index, /* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCamera **item) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size( /* [retval][out] */ __RPC__out unsigned int *size) = 0; virtual HRESULT STDMETHODCALLTYPE IndexOf( /* [in] */ __RPC__in_opt ABI::Windows::Graphics::Holographic::IHolographicCamera *item, /* [out] */ __RPC__out unsigned int *index, /* [retval][out] */ __RPC__out boolean *found) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany( /* [in] */ unsigned int startIndex, /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Graphics::Holographic::IHolographicCamera **items, /* [retval][out] */ __RPC__out unsigned int *actual) = 0; }; #else /* C style interface */ typedef struct __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *GetAt )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [in] */ unsigned int index, /* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera **item); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [retval][out] */ __RPC__out unsigned int *size); HRESULT ( STDMETHODCALLTYPE *IndexOf )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera *item, /* [out] */ __RPC__out unsigned int *index, /* [retval][out] */ __RPC__out boolean *found); HRESULT ( STDMETHODCALLTYPE *GetMany )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera * This, /* [in] */ unsigned int startIndex, /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera **items, /* [retval][out] */ __RPC__out unsigned int *actual); END_INTERFACE } __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl; interface __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera { CONST_VTBL struct __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetAt(This,index,item) \ ( (This)->lpVtbl -> GetAt(This,index,item) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_get_Size(This,size) \ ( (This)->lpVtbl -> get_Size(This,size) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_IndexOf(This,item,index,found) \ ( (This)->lpVtbl -> IndexOf(This,item,index,found) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_GetMany(This,startIndex,capacity,items,actual) \ ( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0021 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0021 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0021_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0021_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4680 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4680 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4680_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4680_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0022 */ /* [local] */ #ifndef DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose #define DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0022 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0022_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0022_v0_0_s_ifspec; #ifndef ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ #define ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ /* interface __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* [unique][uuid][object] */ /* interface __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("17c5dfb1-6e87-5a17-a791-ac07f8ee9292") __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE GetAt( /* [in] */ unsigned int index, /* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCameraPose **item) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size( /* [retval][out] */ __RPC__out unsigned int *size) = 0; virtual HRESULT STDMETHODCALLTYPE IndexOf( /* [in] */ __RPC__in_opt ABI::Windows::Graphics::Holographic::IHolographicCameraPose *item, /* [out] */ __RPC__out unsigned int *index, /* [retval][out] */ __RPC__out boolean *found) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany( /* [in] */ unsigned int startIndex, /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Graphics::Holographic::IHolographicCameraPose **items, /* [retval][out] */ __RPC__out unsigned int *actual) = 0; }; #else /* C style interface */ typedef struct __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *GetAt )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [in] */ unsigned int index, /* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose **item); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [retval][out] */ __RPC__out unsigned int *size); HRESULT ( STDMETHODCALLTYPE *IndexOf )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose *item, /* [out] */ __RPC__out unsigned int *index, /* [retval][out] */ __RPC__out boolean *found); HRESULT ( STDMETHODCALLTYPE *GetMany )( __RPC__in __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose * This, /* [in] */ unsigned int startIndex, /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose **items, /* [retval][out] */ __RPC__out unsigned int *actual); END_INTERFACE } __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl; interface __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose { CONST_VTBL struct __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPoseVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetAt(This,index,item) \ ( (This)->lpVtbl -> GetAt(This,index,item) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_get_Size(This,size) \ ( (This)->lpVtbl -> get_Size(This,size) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_IndexOf(This,item,index,found) \ ( (This)->lpVtbl -> IndexOf(This,item,index,found) ) #define __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_GetMany(This,startIndex,capacity,items,actual) \ ( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0023 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0023 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0023_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0023_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4681 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4681 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4681_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4681_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0024 */ /* [local] */ #ifndef DEF___FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform #define DEF___FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0024 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0024_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0024_v0_0_s_ifspec; #ifndef ____FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_INTERFACE_DEFINED__ #define ____FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_INTERFACE_DEFINED__ /* interface __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform */ /* [unique][uuid][object] */ /* interface __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("6e67ce78-cc67-52c0-b635-991db0bff5ca") __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Value( /* [retval][out] */ __RPC__out struct ABI::Windows::Graphics::Holographic::HolographicStereoTransform *value) = 0; }; #else /* C style interface */ typedef struct __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransformVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Value )( __RPC__in __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform * This, /* [retval][out] */ __RPC__out struct __x_ABI_CWindows_CGraphics_CHolographic_CHolographicStereoTransform *value); END_INTERFACE } __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransformVtbl; interface __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform { CONST_VTBL struct __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransformVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_get_Value(This,value) \ ( (This)->lpVtbl -> get_Value(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0025 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0025 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0025_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0025_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4682 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4682 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4682_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4682_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0026 */ /* [local] */ #ifndef DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs #define DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0026 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0026_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0026_v0_0_s_ifspec; #ifndef ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_INTERFACE_DEFINED__ #define ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_INTERFACE_DEFINED__ /* interface __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs */ /* [unique][uuid][object] */ /* interface __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("71d80b7c-1d27-5102-83d1-4f0efc7c9d6f") __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE Invoke( /* [in] */ __RPC__in_opt ABI::Windows::Graphics::Holographic::IHolographicSpace *sender, /* [in] */ __RPC__in_opt ABI::Windows::Graphics::Holographic::IHolographicSpaceCameraAddedEventArgs *e) = 0; }; #else /* C style interface */ typedef struct __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs * This); HRESULT ( STDMETHODCALLTYPE *Invoke )( __RPC__in __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace *sender, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs *e); END_INTERFACE } __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgsVtbl; interface __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs { CONST_VTBL struct __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_Invoke(This,sender,e) \ ( (This)->lpVtbl -> Invoke(This,sender,e) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0027 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0027 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0027_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0027_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4683 */ /* interface __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4683 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4683_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic2Eidl_0000_4683_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0028 */ /* [local] */ #ifndef DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs #define DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0028 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0028_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0028_v0_0_s_ifspec; #ifndef ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_INTERFACE_DEFINED__ #define ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_INTERFACE_DEFINED__ /* interface __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs */ /* [unique][uuid][object] */ /* interface __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("db68cfc3-0874-502a-a3b9-2b1fe86c67be") __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE Invoke( /* [in] */ __RPC__in_opt ABI::Windows::Graphics::Holographic::IHolographicSpace *sender, /* [in] */ __RPC__in_opt ABI::Windows::Graphics::Holographic::IHolographicSpaceCameraRemovedEventArgs *e) = 0; }; #else /* C style interface */ typedef struct __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs * This); HRESULT ( STDMETHODCALLTYPE *Invoke )( __RPC__in __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace *sender, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs *e); END_INTERFACE } __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgsVtbl; interface __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs { CONST_VTBL struct __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_Invoke(This,sender,e) \ ( (This)->lpVtbl -> Invoke(This,sender,e) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0029 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs */ #if !defined(__cplusplus) #if !defined(__cplusplus) /* [v1_enum] */ enum __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentResult { HolographicFramePresentResult_Success = 0, HolographicFramePresentResult_DeviceRemoved = 1 } ; #endif /* end if !defined(__cplusplus) */ #endif #if !defined(__cplusplus) #if !defined(__cplusplus) /* [v1_enum] */ enum __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentWaitBehavior { HolographicFramePresentWaitBehavior_WaitForFrameToFinish = 0, HolographicFramePresentWaitBehavior_DoNotWaitForFrameToFinish = 1 } ; #endif /* end if !defined(__cplusplus) */ #endif #if !defined(__cplusplus) #if !defined(__cplusplus) /* [v1_enum] */ enum __x_ABI_CWindows_CGraphics_CHolographic_CHolographicReprojectionMode { HolographicReprojectionMode_PositionAndOrientation = 0, HolographicReprojectionMode_OrientationOnly = 1, HolographicReprojectionMode_Disabled = 2 } ; #endif /* end if !defined(__cplusplus) */ #endif #if !defined(__cplusplus) struct __x_ABI_CWindows_CGraphics_CHolographic_CHolographicAdapterId { UINT32 LowPart; INT32 HighPart; } ; #endif #if !defined(__cplusplus) struct __x_ABI_CWindows_CGraphics_CHolographic_CHolographicStereoTransform { __x_ABI_CWindows_CFoundation_CNumerics_CMatrix4x4 Left; __x_ABI_CWindows_CFoundation_CNumerics_CMatrix4x4 Right; } ; #endif #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicCamera[] = L"Windows.Graphics.Holographic.IHolographicCamera"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0029 */ /* [local] */ #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { /* [v1_enum] */ enum HolographicFramePresentResult { HolographicFramePresentResult_Success = 0, HolographicFramePresentResult_DeviceRemoved = 1 } ; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { /* [v1_enum] */ enum HolographicFramePresentWaitBehavior { HolographicFramePresentWaitBehavior_WaitForFrameToFinish = 0, HolographicFramePresentWaitBehavior_DoNotWaitForFrameToFinish = 1 } ; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { /* [v1_enum] */ enum HolographicReprojectionMode { HolographicReprojectionMode_PositionAndOrientation = 0, HolographicReprojectionMode_OrientationOnly = 1, HolographicReprojectionMode_Disabled = 2 } ; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { struct HolographicAdapterId { UINT32 LowPart; INT32 HighPart; } ; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { struct HolographicStereoTransform { ABI::Windows::Foundation::Numerics::Matrix4x4 Left; ABI::Windows::Foundation::Numerics::Matrix4x4 Right; } ; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0029_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0029_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicCamera */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("E4E98445-9BED-4980-9BA0-E87680D1CB74") IHolographicCamera : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_RenderTargetSize( /* [out][retval] */ __RPC__out ABI::Windows::Foundation::Size *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ViewportScaleFactor( /* [out][retval] */ __RPC__out DOUBLE *value) = 0; virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ViewportScaleFactor( /* [in] */ DOUBLE value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsStereo( /* [out][retval] */ __RPC__out boolean *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Id( /* [out][retval] */ __RPC__out UINT32 *value) = 0; virtual HRESULT STDMETHODCALLTYPE SetNearPlaneDistance( /* [in] */ DOUBLE value) = 0; virtual HRESULT STDMETHODCALLTYPE SetFarPlaneDistance( /* [in] */ DOUBLE value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicCamera = __uuidof(IHolographicCamera); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_RenderTargetSize )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CFoundation_CSize *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ViewportScaleFactor )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [out][retval] */ __RPC__out DOUBLE *value); /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ViewportScaleFactor )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [in] */ DOUBLE value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsStereo )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [out][retval] */ __RPC__out boolean *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Id )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [out][retval] */ __RPC__out UINT32 *value); HRESULT ( STDMETHODCALLTYPE *SetNearPlaneDistance )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [in] */ DOUBLE value); HRESULT ( STDMETHODCALLTYPE *SetFarPlaneDistance )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera * This, /* [in] */ DOUBLE value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_get_RenderTargetSize(This,value) \ ( (This)->lpVtbl -> get_RenderTargetSize(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_get_ViewportScaleFactor(This,value) \ ( (This)->lpVtbl -> get_ViewportScaleFactor(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_put_ViewportScaleFactor(This,value) \ ( (This)->lpVtbl -> put_ViewportScaleFactor(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_get_IsStereo(This,value) \ ( (This)->lpVtbl -> get_IsStereo(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_get_Id(This,value) \ ( (This)->lpVtbl -> get_Id(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_SetNearPlaneDistance(This,value) \ ( (This)->lpVtbl -> SetNearPlaneDistance(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_SetFarPlaneDistance(This,value) \ ( (This)->lpVtbl -> SetFarPlaneDistance(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0030 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicCamera2[] = L"Windows.Graphics.Holographic.IHolographicCamera2"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0030 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0030_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0030_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicCamera2 */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("B55B9F1A-BA8C-4F84-AD79-2E7E1E2450F3") IHolographicCamera2 : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_LeftViewportParameters( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCameraViewportParameters **result) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_RightViewportParameters( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCameraViewportParameters **result) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Display( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicDisplay **result) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicCamera2 = __uuidof(IHolographicCamera2); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_LeftViewportParameters )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters **result); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_RightViewportParameters )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters **result); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Display )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay **result); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2Vtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2 { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_get_LeftViewportParameters(This,result) \ ( (This)->lpVtbl -> get_LeftViewportParameters(This,result) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_get_RightViewportParameters(This,result) \ ( (This)->lpVtbl -> get_RightViewportParameters(This,result) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_get_Display(This,result) \ ( (This)->lpVtbl -> get_Display(This,result) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera2_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0031 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicCameraPose[] = L"Windows.Graphics.Holographic.IHolographicCameraPose"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0031 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0031_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0031_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicCameraPose */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("0D7D7E30-12DE-45BD-912B-C7F6561599D1") IHolographicCameraPose : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HolographicCamera( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCamera **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Viewport( /* [out][retval] */ __RPC__out ABI::Windows::Foundation::Rect *value) = 0; virtual HRESULT STDMETHODCALLTYPE TryGetViewTransform( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem *coordinateSystem, /* [out][retval] */ __RPC__deref_out_opt __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ProjectionTransform( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::Holographic::HolographicStereoTransform *value) = 0; virtual HRESULT STDMETHODCALLTYPE TryGetCullingFrustum( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem *coordinateSystem, /* [out][retval] */ __RPC__deref_out_opt __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum **value) = 0; virtual HRESULT STDMETHODCALLTYPE TryGetVisibleFrustum( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem *coordinateSystem, /* [out][retval] */ __RPC__deref_out_opt __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_NearPlaneDistance( /* [out][retval] */ __RPC__out DOUBLE *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_FarPlaneDistance( /* [out][retval] */ __RPC__out DOUBLE *value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicCameraPose = __uuidof(IHolographicCameraPose); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPoseVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HolographicCamera )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Viewport )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CFoundation_CRect *value); HRESULT ( STDMETHODCALLTYPE *TryGetViewTransform )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialCoordinateSystem *coordinateSystem, /* [out][retval] */ __RPC__deref_out_opt __FIReference_1_Windows__CGraphics__CHolographic__CHolographicStereoTransform **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ProjectionTransform )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CHolographic_CHolographicStereoTransform *value); HRESULT ( STDMETHODCALLTYPE *TryGetCullingFrustum )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialCoordinateSystem *coordinateSystem, /* [out][retval] */ __RPC__deref_out_opt __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum **value); HRESULT ( STDMETHODCALLTYPE *TryGetVisibleFrustum )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialCoordinateSystem *coordinateSystem, /* [out][retval] */ __RPC__deref_out_opt __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingFrustum **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_NearPlaneDistance )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [out][retval] */ __RPC__out DOUBLE *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_FarPlaneDistance )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose * This, /* [out][retval] */ __RPC__out DOUBLE *value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPoseVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPoseVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_get_HolographicCamera(This,value) \ ( (This)->lpVtbl -> get_HolographicCamera(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_get_Viewport(This,value) \ ( (This)->lpVtbl -> get_Viewport(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_TryGetViewTransform(This,coordinateSystem,value) \ ( (This)->lpVtbl -> TryGetViewTransform(This,coordinateSystem,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_get_ProjectionTransform(This,value) \ ( (This)->lpVtbl -> get_ProjectionTransform(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_TryGetCullingFrustum(This,coordinateSystem,value) \ ( (This)->lpVtbl -> TryGetCullingFrustum(This,coordinateSystem,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_TryGetVisibleFrustum(This,coordinateSystem,value) \ ( (This)->lpVtbl -> TryGetVisibleFrustum(This,coordinateSystem,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_get_NearPlaneDistance(This,value) \ ( (This)->lpVtbl -> get_NearPlaneDistance(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_get_FarPlaneDistance(This,value) \ ( (This)->lpVtbl -> get_FarPlaneDistance(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0032 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicCameraRenderingParameters[] = L"Windows.Graphics.Holographic.IHolographicCameraRenderingParameters"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0032 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0032_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0032_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicCameraRenderingParameters */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("8EAC2ED1-5BF4-4E16-8236-AE0800C11D0D") IHolographicCameraRenderingParameters : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE SetFocusPoint( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem *coordinateSystem, /* [in] */ ABI::Windows::Foundation::Numerics::Vector3 position) = 0; virtual HRESULT STDMETHODCALLTYPE SetFocusPointWithNormal( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem *coordinateSystem, /* [in] */ ABI::Windows::Foundation::Numerics::Vector3 position, /* [in] */ ABI::Windows::Foundation::Numerics::Vector3 normal) = 0; virtual HRESULT STDMETHODCALLTYPE SetFocusPointWithNormalLinearVelocity( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem *coordinateSystem, /* [in] */ ABI::Windows::Foundation::Numerics::Vector3 position, /* [in] */ ABI::Windows::Foundation::Numerics::Vector3 normal, /* [in] */ ABI::Windows::Foundation::Numerics::Vector3 linearVelocity) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Direct3D11Device( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Direct3D11BackBuffer( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface **value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicCameraRenderingParameters = __uuidof(IHolographicCameraRenderingParameters); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParametersVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *SetFocusPoint )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialCoordinateSystem *coordinateSystem, /* [in] */ __x_ABI_CWindows_CFoundation_CNumerics_CVector3 position); HRESULT ( STDMETHODCALLTYPE *SetFocusPointWithNormal )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialCoordinateSystem *coordinateSystem, /* [in] */ __x_ABI_CWindows_CFoundation_CNumerics_CVector3 position, /* [in] */ __x_ABI_CWindows_CFoundation_CNumerics_CVector3 normal); HRESULT ( STDMETHODCALLTYPE *SetFocusPointWithNormalLinearVelocity )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialCoordinateSystem *coordinateSystem, /* [in] */ __x_ABI_CWindows_CFoundation_CNumerics_CVector3 position, /* [in] */ __x_ABI_CWindows_CFoundation_CNumerics_CVector3 normal, /* [in] */ __x_ABI_CWindows_CFoundation_CNumerics_CVector3 linearVelocity); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Direct3D11Device )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CDirectX_CDirect3D11_CIDirect3DDevice **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Direct3D11BackBuffer )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CDirectX_CDirect3D11_CIDirect3DSurface **value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParametersVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParametersVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_SetFocusPoint(This,coordinateSystem,position) \ ( (This)->lpVtbl -> SetFocusPoint(This,coordinateSystem,position) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_SetFocusPointWithNormal(This,coordinateSystem,position,normal) \ ( (This)->lpVtbl -> SetFocusPointWithNormal(This,coordinateSystem,position,normal) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_SetFocusPointWithNormalLinearVelocity(This,coordinateSystem,position,normal,linearVelocity) \ ( (This)->lpVtbl -> SetFocusPointWithNormalLinearVelocity(This,coordinateSystem,position,normal,linearVelocity) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_get_Direct3D11Device(This,value) \ ( (This)->lpVtbl -> get_Direct3D11Device(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_get_Direct3D11BackBuffer(This,value) \ ( (This)->lpVtbl -> get_Direct3D11BackBuffer(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0033 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicCameraRenderingParameters2[] = L"Windows.Graphics.Holographic.IHolographicCameraRenderingParameters2"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0033 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0033_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0033_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicCameraRenderingParameters2 */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("261270E3-B696-4634-94D6-BE0681643599") IHolographicCameraRenderingParameters2 : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ReprojectionMode( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::Holographic::HolographicReprojectionMode *value) = 0; virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ReprojectionMode( /* [in] */ ABI::Windows::Graphics::Holographic::HolographicReprojectionMode value) = 0; virtual HRESULT STDMETHODCALLTYPE CommitDirect3D11DepthBuffer( /* [in] */ __RPC__in_opt ABI::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface *value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicCameraRenderingParameters2 = __uuidof(IHolographicCameraRenderingParameters2); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReprojectionMode )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CHolographic_CHolographicReprojectionMode *value); /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReprojectionMode )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This, /* [in] */ __x_ABI_CWindows_CGraphics_CHolographic_CHolographicReprojectionMode value); HRESULT ( STDMETHODCALLTYPE *CommitDirect3D11DepthBuffer )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CDirectX_CDirect3D11_CIDirect3DSurface *value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2Vtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2 { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_get_ReprojectionMode(This,value) \ ( (This)->lpVtbl -> get_ReprojectionMode(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_put_ReprojectionMode(This,value) \ ( (This)->lpVtbl -> put_ReprojectionMode(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_CommitDirect3D11DepthBuffer(This,value) \ ( (This)->lpVtbl -> CommitDirect3D11DepthBuffer(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters2_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0034 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicCameraViewportParameters[] = L"Windows.Graphics.Holographic.IHolographicCameraViewportParameters"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0034 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0034_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0034_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicCameraViewportParameters */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("80CDF3F7-842A-41E1-93ED-5692AB1FBB10") IHolographicCameraViewportParameters : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HiddenAreaMesh( /* [out] */ __RPC__out UINT32 *__valueSize, /* [out][retval][size_is][size_is] */ __RPC__deref_out_ecount_full_opt(*__valueSize) ABI::Windows::Foundation::Numerics::Vector2 **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VisibleAreaMesh( /* [out] */ __RPC__out UINT32 *__valueSize, /* [out][retval][size_is][size_is] */ __RPC__deref_out_ecount_full_opt(*__valueSize) ABI::Windows::Foundation::Numerics::Vector2 **value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicCameraViewportParameters = __uuidof(IHolographicCameraViewportParameters); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParametersVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HiddenAreaMesh )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters * This, /* [out] */ __RPC__out UINT32 *__valueSize, /* [out][retval][size_is][size_is] */ __RPC__deref_out_ecount_full_opt(*__valueSize) __x_ABI_CWindows_CFoundation_CNumerics_CVector2 **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VisibleAreaMesh )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters * This, /* [out] */ __RPC__out UINT32 *__valueSize, /* [out][retval][size_is][size_is] */ __RPC__deref_out_ecount_full_opt(*__valueSize) __x_ABI_CWindows_CFoundation_CNumerics_CVector2 **value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParametersVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParametersVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_get_HiddenAreaMesh(This,__valueSize,value) \ ( (This)->lpVtbl -> get_HiddenAreaMesh(This,__valueSize,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_get_VisibleAreaMesh(This,__valueSize,value) \ ( (This)->lpVtbl -> get_VisibleAreaMesh(This,__valueSize,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraViewportParameters_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0035 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicDisplay[] = L"Windows.Graphics.Holographic.IHolographicDisplay"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0035 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0035_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0035_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicDisplay */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("9ACEA414-1D9F-4090-A388-90C06F6EAE9C") IHolographicDisplay : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_DisplayName( /* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_MaxViewportSize( /* [out][retval] */ __RPC__out ABI::Windows::Foundation::Size *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsStereo( /* [out][retval] */ __RPC__out boolean *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsOpaque( /* [out][retval] */ __RPC__out boolean *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_AdapterId( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::Holographic::HolographicAdapterId *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SpatialLocator( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::ISpatialLocator **value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicDisplay = __uuidof(IHolographicDisplay); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out][retval] */ __RPC__deref_out_opt HSTRING *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxViewportSize )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CFoundation_CSize *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsStereo )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out][retval] */ __RPC__out boolean *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsOpaque )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out][retval] */ __RPC__out boolean *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_AdapterId )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CHolographic_CHolographicAdapterId *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SpatialLocator )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialLocator **value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_get_DisplayName(This,value) \ ( (This)->lpVtbl -> get_DisplayName(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_get_MaxViewportSize(This,value) \ ( (This)->lpVtbl -> get_MaxViewportSize(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_get_IsStereo(This,value) \ ( (This)->lpVtbl -> get_IsStereo(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_get_IsOpaque(This,value) \ ( (This)->lpVtbl -> get_IsOpaque(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_get_AdapterId(This,value) \ ( (This)->lpVtbl -> get_AdapterId(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_get_SpatialLocator(This,value) \ ( (This)->lpVtbl -> get_SpatialLocator(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0036 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicDisplayStatics[] = L"Windows.Graphics.Holographic.IHolographicDisplayStatics"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0036 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0036_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0036_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicDisplayStatics */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("CB374983-E7B0-4841-8355-3AE5B536E9A4") IHolographicDisplayStatics : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE GetDefault( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicDisplay **result) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicDisplayStatics = __uuidof(IHolographicDisplayStatics); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStaticsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *GetDefault )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplay **result); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStaticsVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStaticsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_GetDefault(This,result) \ ( (This)->lpVtbl -> GetDefault(This,result) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicDisplayStatics_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0037 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicFrame[] = L"Windows.Graphics.Holographic.IHolographicFrame"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0037 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0037_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0037_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicFrame */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("C6988EB6-A8B9-3054-A6EB-D624B6536375") IHolographicFrame : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_AddedCameras( /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_RemovedCameras( /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera **value) = 0; virtual HRESULT STDMETHODCALLTYPE GetRenderingParameters( /* [in] */ __RPC__in_opt ABI::Windows::Graphics::Holographic::IHolographicCameraPose *cameraPose, /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCameraRenderingParameters **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Duration( /* [out][retval] */ __RPC__out ABI::Windows::Foundation::TimeSpan *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_CurrentPrediction( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicFramePrediction **value) = 0; virtual HRESULT STDMETHODCALLTYPE UpdateCurrentPrediction( void) = 0; virtual HRESULT STDMETHODCALLTYPE PresentUsingCurrentPrediction( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::Holographic::HolographicFramePresentResult *result) = 0; virtual HRESULT STDMETHODCALLTYPE PresentUsingCurrentPredictionWithBehavior( /* [in] */ ABI::Windows::Graphics::Holographic::HolographicFramePresentWaitBehavior waitBehavior, /* [out][retval] */ __RPC__out ABI::Windows::Graphics::Holographic::HolographicFramePresentResult *result) = 0; virtual HRESULT STDMETHODCALLTYPE WaitForFrameToFinish( void) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicFrame = __uuidof(IHolographicFrame); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrameVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_AddedCameras )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_RemovedCameras )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCamera **value); HRESULT ( STDMETHODCALLTYPE *GetRenderingParameters )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraPose *cameraPose, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCameraRenderingParameters **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CFoundation_CTimeSpan *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_CurrentPrediction )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction **value); HRESULT ( STDMETHODCALLTYPE *UpdateCurrentPrediction )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This); HRESULT ( STDMETHODCALLTYPE *PresentUsingCurrentPrediction )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentResult *result); HRESULT ( STDMETHODCALLTYPE *PresentUsingCurrentPredictionWithBehavior )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This, /* [in] */ __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentWaitBehavior waitBehavior, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CHolographic_CHolographicFramePresentResult *result); HRESULT ( STDMETHODCALLTYPE *WaitForFrameToFinish )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame * This); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrameVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrameVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_get_AddedCameras(This,value) \ ( (This)->lpVtbl -> get_AddedCameras(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_get_RemovedCameras(This,value) \ ( (This)->lpVtbl -> get_RemovedCameras(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_GetRenderingParameters(This,cameraPose,value) \ ( (This)->lpVtbl -> GetRenderingParameters(This,cameraPose,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_get_Duration(This,value) \ ( (This)->lpVtbl -> get_Duration(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_get_CurrentPrediction(This,value) \ ( (This)->lpVtbl -> get_CurrentPrediction(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_UpdateCurrentPrediction(This) \ ( (This)->lpVtbl -> UpdateCurrentPrediction(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_PresentUsingCurrentPrediction(This,result) \ ( (This)->lpVtbl -> PresentUsingCurrentPrediction(This,result) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_PresentUsingCurrentPredictionWithBehavior(This,waitBehavior,result) \ ( (This)->lpVtbl -> PresentUsingCurrentPredictionWithBehavior(This,waitBehavior,result) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_WaitForFrameToFinish(This) \ ( (This)->lpVtbl -> WaitForFrameToFinish(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0038 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicFramePrediction[] = L"Windows.Graphics.Holographic.IHolographicFramePrediction"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0038 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0038_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0038_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicFramePrediction */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("520F4DE1-5C0A-4E79-A81E-6ABE02BB2739") IHolographicFramePrediction : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_CameraPoses( /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Timestamp( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Perception::IPerceptionTimestamp **value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicFramePrediction = __uuidof(IHolographicFramePrediction); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePredictionVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_CameraPoses )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction * This, /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CHolographic__CHolographicCameraPose **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Timestamp )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CIPerceptionTimestamp **value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePredictionVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePredictionVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_get_CameraPoses(This,value) \ ( (This)->lpVtbl -> get_CameraPoses(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_get_Timestamp(This,value) \ ( (This)->lpVtbl -> get_Timestamp(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFramePrediction_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0039 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicSpace[] = L"Windows.Graphics.Holographic.IHolographicSpace"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0039 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0039_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0039_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicSpace */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("4380DBA6-5E78-434F-807C-3433D1EFE8B7") IHolographicSpace : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PrimaryAdapterId( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::Holographic::HolographicAdapterId *value) = 0; virtual HRESULT STDMETHODCALLTYPE SetDirect3D11Device( /* [in] */ __RPC__in_opt ABI::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice *value) = 0; virtual HRESULT STDMETHODCALLTYPE add_CameraAdded( /* [in] */ __RPC__in_opt __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs *handler, /* [out][retval] */ __RPC__out EventRegistrationToken *cookie) = 0; virtual HRESULT STDMETHODCALLTYPE remove_CameraAdded( /* [in] */ EventRegistrationToken cookie) = 0; virtual HRESULT STDMETHODCALLTYPE add_CameraRemoved( /* [in] */ __RPC__in_opt __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs *handler, /* [out][retval] */ __RPC__out EventRegistrationToken *cookie) = 0; virtual HRESULT STDMETHODCALLTYPE remove_CameraRemoved( /* [in] */ EventRegistrationToken cookie) = 0; virtual HRESULT STDMETHODCALLTYPE CreateNextFrame( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicFrame **value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicSpace = __uuidof(IHolographicSpace); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrimaryAdapterId )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CHolographic_CHolographicAdapterId *value); HRESULT ( STDMETHODCALLTYPE *SetDirect3D11Device )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CGraphics_CDirectX_CDirect3D11_CIDirect3DDevice *value); HRESULT ( STDMETHODCALLTYPE *add_CameraAdded )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [in] */ __RPC__in_opt __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraAddedEventArgs *handler, /* [out][retval] */ __RPC__out EventRegistrationToken *cookie); HRESULT ( STDMETHODCALLTYPE *remove_CameraAdded )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [in] */ EventRegistrationToken cookie); HRESULT ( STDMETHODCALLTYPE *add_CameraRemoved )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [in] */ __RPC__in_opt __FITypedEventHandler_2_Windows__CGraphics__CHolographic__CHolographicSpace_Windows__CGraphics__CHolographic__CHolographicSpaceCameraRemovedEventArgs *handler, /* [out][retval] */ __RPC__out EventRegistrationToken *cookie); HRESULT ( STDMETHODCALLTYPE *remove_CameraRemoved )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [in] */ EventRegistrationToken cookie); HRESULT ( STDMETHODCALLTYPE *CreateNextFrame )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicFrame **value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_get_PrimaryAdapterId(This,value) \ ( (This)->lpVtbl -> get_PrimaryAdapterId(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_SetDirect3D11Device(This,value) \ ( (This)->lpVtbl -> SetDirect3D11Device(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_add_CameraAdded(This,handler,cookie) \ ( (This)->lpVtbl -> add_CameraAdded(This,handler,cookie) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_remove_CameraAdded(This,cookie) \ ( (This)->lpVtbl -> remove_CameraAdded(This,cookie) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_add_CameraRemoved(This,handler,cookie) \ ( (This)->lpVtbl -> add_CameraRemoved(This,handler,cookie) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_remove_CameraRemoved(This,cookie) \ ( (This)->lpVtbl -> remove_CameraRemoved(This,cookie) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_CreateNextFrame(This,value) \ ( (This)->lpVtbl -> CreateNextFrame(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0040 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicSpaceCameraAddedEventArgs[] = L"Windows.Graphics.Holographic.IHolographicSpaceCameraAddedEventArgs"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0040 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0040_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0040_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicSpaceCameraAddedEventArgs */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("58F1DA35-BBB3-3C8F-993D-6C80E7FEB99F") IHolographicSpaceCameraAddedEventArgs : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Camera( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCamera **value) = 0; virtual HRESULT STDMETHODCALLTYPE GetDeferral( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IDeferral **value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicSpaceCameraAddedEventArgs = __uuidof(IHolographicSpaceCameraAddedEventArgs); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Camera )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera **value); HRESULT ( STDMETHODCALLTYPE *GetDeferral )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIDeferral **value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgsVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_get_Camera(This,value) \ ( (This)->lpVtbl -> get_Camera(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_GetDeferral(This,value) \ ( (This)->lpVtbl -> GetDeferral(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraAddedEventArgs_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0041 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicSpaceCameraRemovedEventArgs[] = L"Windows.Graphics.Holographic.IHolographicSpaceCameraRemovedEventArgs"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0041 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0041_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0041_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicSpaceCameraRemovedEventArgs */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("805444A8-F2AE-322E-8DA9-836A0A95A4C1") IHolographicSpaceCameraRemovedEventArgs : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Camera( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicCamera **value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicSpaceCameraRemovedEventArgs = __uuidof(IHolographicSpaceCameraRemovedEventArgs); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Camera )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicCamera **value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgsVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_get_Camera(This,value) \ ( (This)->lpVtbl -> get_Camera(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceCameraRemovedEventArgs_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0042 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicSpaceStatics[] = L"Windows.Graphics.Holographic.IHolographicSpaceStatics"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0042 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0042_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0042_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicSpaceStatics */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("364E6064-C8F2-3BA1-8391-66B8489E67FD") IHolographicSpaceStatics : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE CreateForCoreWindow( /* [in] */ __RPC__in_opt ABI::Windows::UI::Core::ICoreWindow *window, /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Graphics::Holographic::IHolographicSpace **value) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicSpaceStatics = __uuidof(IHolographicSpaceStatics); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStaticsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *CreateForCoreWindow )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CUI_CCore_CICoreWindow *window, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpace **value); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStaticsVtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStaticsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_CreateForCoreWindow(This,window,value) \ ( (This)->lpVtbl -> CreateForCoreWindow(This,window,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0043 */ /* [local] */ #if !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Graphics_Holographic_IHolographicSpaceStatics2[] = L"Windows.Graphics.Holographic.IHolographicSpaceStatics2"; #endif /* !defined(____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0043 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0043_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0043_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 */ /* [uuid][object] */ /* interface ABI::Windows::Graphics::Holographic::IHolographicSpaceStatics2 */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace Holographic { MIDL_INTERFACE("0E777088-75FC-48AF-8758-0652F6F07C59") IHolographicSpaceStatics2 : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsSupported( /* [out][retval] */ __RPC__out boolean *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsAvailable( /* [out][retval] */ __RPC__out boolean *value) = 0; virtual HRESULT STDMETHODCALLTYPE add_IsAvailableChanged( /* [in] */ __RPC__in_opt __FIEventHandler_1_IInspectable *handler, /* [out][retval] */ __RPC__out EventRegistrationToken *token) = 0; virtual HRESULT STDMETHODCALLTYPE remove_IsAvailableChanged( /* [in] */ EventRegistrationToken token) = 0; }; extern const __declspec(selectany) IID & IID_IHolographicSpaceStatics2 = __uuidof(IHolographicSpaceStatics2); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsSupported )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This, /* [out][retval] */ __RPC__out boolean *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsAvailable )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This, /* [out][retval] */ __RPC__out boolean *value); HRESULT ( STDMETHODCALLTYPE *add_IsAvailableChanged )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This, /* [in] */ __RPC__in_opt __FIEventHandler_1_IInspectable *handler, /* [out][retval] */ __RPC__out EventRegistrationToken *token); HRESULT ( STDMETHODCALLTYPE *remove_IsAvailableChanged )( __RPC__in __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 * This, /* [in] */ EventRegistrationToken token); END_INTERFACE } __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2Vtbl; interface __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2 { CONST_VTBL struct __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_get_IsSupported(This,value) \ ( (This)->lpVtbl -> get_IsSupported(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_get_IsAvailable(This,value) \ ( (This)->lpVtbl -> get_IsAvailable(This,value) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_add_IsAvailableChanged(This,handler,token) \ ( (This)->lpVtbl -> add_IsAvailableChanged(This,handler,token) ) #define __x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_remove_IsAvailableChanged(This,token) \ ( (This)->lpVtbl -> remove_IsAvailableChanged(This,token) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CGraphics_CHolographic_CIHolographicSpaceStatics2_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0044 */ /* [local] */ #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicCamera_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicCamera_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicCamera[] = L"Windows.Graphics.Holographic.HolographicCamera"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicCameraPose_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicCameraPose_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicCameraPose[] = L"Windows.Graphics.Holographic.HolographicCameraPose"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicCameraRenderingParameters_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicCameraRenderingParameters_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicCameraRenderingParameters[] = L"Windows.Graphics.Holographic.HolographicCameraRenderingParameters"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicCameraViewportParameters_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicCameraViewportParameters_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicCameraViewportParameters[] = L"Windows.Graphics.Holographic.HolographicCameraViewportParameters"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicDisplay_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicDisplay_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicDisplay[] = L"Windows.Graphics.Holographic.HolographicDisplay"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicFrame_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicFrame_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicFrame[] = L"Windows.Graphics.Holographic.HolographicFrame"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicFramePrediction_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicFramePrediction_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicFramePrediction[] = L"Windows.Graphics.Holographic.HolographicFramePrediction"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicSpace_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicSpace_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicSpace[] = L"Windows.Graphics.Holographic.HolographicSpace"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicSpaceCameraAddedEventArgs_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicSpaceCameraAddedEventArgs_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicSpaceCameraAddedEventArgs[] = L"Windows.Graphics.Holographic.HolographicSpaceCameraAddedEventArgs"; #endif #ifndef RUNTIMECLASS_Windows_Graphics_Holographic_HolographicSpaceCameraRemovedEventArgs_DEFINED #define RUNTIMECLASS_Windows_Graphics_Holographic_HolographicSpaceCameraRemovedEventArgs_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Graphics_Holographic_HolographicSpaceCameraRemovedEventArgs[] = L"Windows.Graphics.Holographic.HolographicSpaceCameraRemovedEventArgs"; #endif /* interface __MIDL_itf_windows2Egraphics2Eholographic_0000_0044 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0044_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Egraphics2Eholographic_0000_0044_v0_0_s_ifspec; /* Additional Prototypes for ALL interfaces */ unsigned long __RPC_USER HSTRING_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in HSTRING * ); unsigned char * __RPC_USER HSTRING_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in HSTRING * ); unsigned char * __RPC_USER HSTRING_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out HSTRING * ); void __RPC_USER HSTRING_UserFree( __RPC__in unsigned long *, __RPC__in HSTRING * ); unsigned long __RPC_USER HSTRING_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in HSTRING * ); unsigned char * __RPC_USER HSTRING_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in HSTRING * ); unsigned char * __RPC_USER HSTRING_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out HSTRING * ); void __RPC_USER HSTRING_UserFree64( __RPC__in unsigned long *, __RPC__in HSTRING * ); /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif
42.703569
550
0.754212
[ "object" ]
6416fec06c831260f7062f745d2f773bec5c6173
1,193
h
C
src/TranMgnt/Parser.h
GrahamYan/System2018-Database
6152cec1435015ae4f6a32227cc3dd218472e64d
[ "MIT" ]
null
null
null
src/TranMgnt/Parser.h
GrahamYan/System2018-Database
6152cec1435015ae4f6a32227cc3dd218472e64d
[ "MIT" ]
null
null
null
src/TranMgnt/Parser.h
GrahamYan/System2018-Database
6152cec1435015ae4f6a32227cc3dd218472e64d
[ "MIT" ]
null
null
null
// // Created by wanton-wind on 2018/5/6. // #ifndef SYSTEM2018_DATABASE_BASEPARSER_H #define SYSTEM2018_DATABASE_BASEPARSER_H #include <string> #include <vector> #include <sstream> #include <tuple> #include "Error.h" namespace sample { enum class Command{ PUT = 0, GET = 1, DEL = 2, }; class Parser { private: static Command stoc(std::string cs){ if (cs == "PUT") { return Command::PUT; } else if (cs == "GET"){ return Command::GET; } else if (cs == "DEL"){ return Command::DEL; } else { throw UnknownCommandType(); } } public: static std::tuple<Command, int, std::string> decode(std::stringstream& ss) { std::string cs; int k; std::string v; ss >> cs >> k >> v; Command c = stoc(cs); return std::make_tuple(c, k, v); }; static std::tuple<Command, int, std::string> decode(std::string s) { std::stringstream ss{s}; return decode(ss); }; }; } #endif //SYSTEM2018_DATABASE_BASEPARSER_H
22.942308
84
0.50964
[ "vector" ]
6419f98857e4e96293ee4cf5691b6a2cc076906f
1,534
h
C
aws-cpp-sdk-robomaker/include/aws/robomaker/model/DeploymentJobErrorCode.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
2
2019-03-11T15:50:55.000Z
2020-02-27T11:40:27.000Z
aws-cpp-sdk-robomaker/include/aws/robomaker/model/DeploymentJobErrorCode.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
null
null
null
aws-cpp-sdk-robomaker/include/aws/robomaker/model/DeploymentJobErrorCode.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
1
2019-01-18T13:03:55.000Z
2019-01-18T13:03:55.000Z
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/robomaker/RoboMaker_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace RoboMaker { namespace Model { enum class DeploymentJobErrorCode { NOT_SET, ResourceNotFound, FailureThresholdBreached, RobotDeploymentNoResponse, GreengrassDeploymentFailed, MissingRobotArchitecture, MissingRobotApplicationArchitecture, MissingRobotDeploymentResource, GreengrassGroupVersionDoesNotExist, ExtractingBundleFailure, PreLaunchFileFailure, PostLaunchFileFailure, BadPermissionError, InternalServerError }; namespace DeploymentJobErrorCodeMapper { AWS_ROBOMAKER_API DeploymentJobErrorCode GetDeploymentJobErrorCodeForName(const Aws::String& name); AWS_ROBOMAKER_API Aws::String GetNameForDeploymentJobErrorCode(DeploymentJobErrorCode value); } // namespace DeploymentJobErrorCodeMapper } // namespace Model } // namespace RoboMaker } // namespace Aws
28.943396
99
0.784224
[ "model" ]
641bd5aaefc3bb20c07d6b08d83ee2818b101999
3,119
h
C
gloox-1.0.22/src/forward.h
zhichao281/SuperWisdom
e3bd1608a7aaf9b36dc274138081cf427ba4bbfc
[ "Apache-2.0" ]
9
2019-04-13T03:15:32.000Z
2021-06-22T09:57:19.000Z
gloox-1.0.22/src/forward.h
zhichao281/SuperWisdom
e3bd1608a7aaf9b36dc274138081cf427ba4bbfc
[ "Apache-2.0" ]
null
null
null
gloox-1.0.22/src/forward.h
zhichao281/SuperWisdom
e3bd1608a7aaf9b36dc274138081cf427ba4bbfc
[ "Apache-2.0" ]
8
2019-09-12T03:18:05.000Z
2021-06-22T09:57:22.000Z
/* Copyright (c) 2013-2017 by Jakob Schröter <js@camaya.net> This file is part of the gloox library. http://camaya.net/gloox This software is distributed under a license. The full license agreement can be found in the file LICENSE in this distribution. This software may not be copied, modified, sold or distributed other than expressed in the named license agreement. This software is distributed without any warranty. */ #ifndef FORWARD_H__ #define FORWARD_H__ #include "stanzaextension.h" #include <string> namespace gloox { class DelayedDelivery; class Stanza; /** * @brief This is an implementation of Stanza Forwarding (@xep{0297}) as a StanzaExtension. * * @note At this point, Forward can only hold forwarded Messages, not IQ or Presence. * However, Forward can be used inside any type of stanza (&lt;message&gt;, &lt;iq&gt;, * or &lt;presence&gt;). * * XEP-Version: 0.5 * * @author Jakob Schröter <js@camaya.net> * @author Fernando Sanchez * @since 1.0.5 */ class GLOOX_API Forward : public StanzaExtension { public: /** * Creates a forwarding StanzaExtension, embedding the given Stanza and DelayedDelivery objects. * @param stanza The forwarded Stanza. This Forward instance will own the Stanza object. * @param delay The date/time the forwarded stanza was received at by the forwarder. This * Forward instance will own the DelayedDelivery object. */ Forward( Stanza* stanza, DelayedDelivery* delay ); /** * Creates a forwarding Stanza from the given Tag. The original Tag will be ripped off. * If a valid Stanza is conatined (as a child) in the Tag it will be parsed, too. * It can then be accessed through embeddedStanza(). The Tag that the Stanza was built from * is available through embeddedTag(). * @param tag The Tag to parse. */ Forward( const Tag* tag = 0 ); /** * Virtual destructor. */ virtual ~Forward(); /** * This function returns a pointer to a DelayedDelivery StanzaExtension which indicates * when the forwarder originally received the forwarded stanza. * * @return A pointer to a DelayedDelivery object. May be 0. */ const DelayedDelivery* when() const { return m_delay; } // reimplemented from StanzaExtension virtual Stanza* embeddedStanza() const { return m_stanza; } // reimplemented from StanzaExtension virtual Tag* embeddedTag() const { return m_tag; } // reimplemented from StanzaExtension virtual Tag* tag() const; // reimplemented from StanzaExtension const std::string& filterString() const; // reimplemented from StanzaExtension StanzaExtension* newInstance( const Tag* tag ) const { return new Forward( tag ); } // reimplemented from StanzaExtension StanzaExtension* clone() const; private: Stanza* m_stanza; Tag* m_tag; DelayedDelivery* m_delay; }; } #endif // FORWARD_H__
29.704762
102
0.664315
[ "object" ]