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
d656466ddd7d1d2e8a8265a5b9a9fb45d34b3034
3,191
h
C
Chroma/src/Chroma/Components/SpriteRenderer.h
ttalexander2/chroma
0e9946e66158938ebd6497d5bf3acfba8fbe9fee
[ "MIT" ]
1
2022-03-07T01:54:59.000Z
2022-03-07T01:54:59.000Z
Chroma/src/Chroma/Components/SpriteRenderer.h
ttalexander2/chroma
0e9946e66158938ebd6497d5bf3acfba8fbe9fee
[ "MIT" ]
20
2021-08-16T16:52:43.000Z
2022-03-26T02:47:09.000Z
Chroma/src/Chroma/Components/SpriteRenderer.h
ttalexander2/chroma
0e9946e66158938ebd6497d5bf3acfba8fbe9fee
[ "MIT" ]
null
null
null
#pragma once #include "Chroma/Scene/Component.h" #include "Chroma/Math/Vec4.h"; #include "Chroma/Renderer/Texture.h" #include "Chroma/Assets/Sprite.h" #include "Chroma/Scene/World.h" namespace Polychrome { class ComponentWidgets; } namespace Chroma { class SpriteRendererSystem; /// @brief Component to render a sprite. Supports both animated and non-animated. /// @see Sprite /// @see Aseprite struct SpriteRenderer : Component { CHROMA_COMPONENT(SpriteRenderer, Component); friend class Polychrome::ComponentWidgets; enum class SpriteOrigin { Center = 0, Left = 1, Right = 2, Top = 3, Bottom = 4, TopLeft = 5, TopRight = 6, BottomLeft = 7, BottomRight = 8, Custom = 9, Default = Center }; /// @brief Color to render the sprite. Default is White. Math::vec4 Color { 1.0f, 1.0f, 1.0f, 1.0f }; /// @brief Offset to render the sprite. Math::vec2 Offset { 0.0f, 0.0f}; /// @brief Layer to render the sprite. GUID Layer = GUID::Zero(); float SortingPoint = 0; /// @brief Whether to play the sprite on start. bool PlayOnStart = true; /// @brief Whether the sprite is playing. bool Playing = true; /// @brief Whether the sprite loops. bool Loop = true; /// @brief Speed of the sprite. float SpeedMultiplier = 1.0f; /// @brief Gets the sprite ID/Path /// @return Relative path/name of the sprite. const std::string& GetSpriteID() const { return SpriteID; } /// @brief Set the sprite to render. /// /// Sprite must already be loaded. /// @see AssetManager to load sprite. /// @param spriteID Name/Path of the sprite. void SetSprite(const std::string& spriteID); /// @brief Set the animation of the sprite. /// @param animation Number of the animation. void SetAnimation(unsigned int animation); /// @brief Set the animation of the sprite. /// @param animation_name Name of the animation. void SetAnimation(const std::string& animation_name); /// @brief Get the number of the current animation. /// @return unsigned int GetAnimation(); /// @brief Get the name of the animation given the number. /// @param animation animation number. /// @return Name of the animation. std::string GetAnimationName(unsigned int animation); /// @brief Get the sprite's current frame. /// @return Current frame number. int GetCurrentFrame(); /// @brief Set the sprite's current frame. /// @param Frame number to set. void SetCurrentFrame(unsigned int); void SetSpriteOrigin(SpriteOrigin origin); void SetSpriteOrigin(const Math::vec2& custom_position); SpriteOrigin GetSpriteOrigin(); const Math::vec2& GetSpriteOriginVector(); /// @brief Restart the animation. /// /// WARNING: Not Implemented. void RestartAnimation(); void Serialize(YAML::Emitter& out) override; void Deserialize(YAML::Node& node) override; private: unsigned int CurrentFrame = 0; unsigned int Animation = 0; /// @brief Origin of the sprite SpriteOrigin Origin = SpriteOrigin::Default; Math::vec2 OriginValue = { 0, 0 }; float time_till_next_frame = 0; bool looping_forward = 0; std::string SpriteID; friend class SpriteRendererSystem; }; }
24.736434
82
0.688812
[ "render" ]
d6575a8f651ce59613b06a0981a5b0a87a08580d
4,583
h
C
include_niu/GenICam/CameraLink/CLInterface.h
xiaolong1130/R-M_Robot-2
247e778659d21986c1bbf756b05bbaab352d39c5
[ "BSD-3-Clause" ]
null
null
null
include_niu/GenICam/CameraLink/CLInterface.h
xiaolong1130/R-M_Robot-2
247e778659d21986c1bbf756b05bbaab352d39c5
[ "BSD-3-Clause" ]
null
null
null
include_niu/GenICam/CameraLink/CLInterface.h
xiaolong1130/R-M_Robot-2
247e778659d21986c1bbf756b05bbaab352d39c5
[ "BSD-3-Clause" ]
1
2021-05-12T07:49:38.000Z
2021-05-12T07:49:38.000Z
#ifndef __DAHUA_GENICAM_ICLINTERFACE_H__ #define __DAHUA_GENICAM_ICLINTERFACE_H__ #include "GenICam/Defs.h" #include "GenICam/Camera.h" #include "Memory/SharedPtr.h" GENICAM_NAMESPACE_BEGIN class ICLInterface; typedef Memory::TSharedPtr<ICLInterface> ICLInterfacePtr; /// \~chinese /// \brief 相机接口类 /// \defgroup ICLInterface 连接CameraLink相机的接口类 /// \~english /// \brief camera interface class /// \defgroup ICLInterface API for CameraLink interface Only /// @{ /// \~chinese /// \brief Class ICLInterface 连接CameraLink相机的接口类 /// \~english /// \brief Class ICLInterface interface class used to connect CL Camera class GENICAM_API ICLInterface { public: enum EInterfaceType { typeEuresys = 0, ///< \~chinese Euresys采集卡 \~english Euresys board typeMatrox = 1, ///< \~chinese Matrox采集卡 \~english Matrox board typeDalsa = 2, ///< \~chinese Dalsa采集卡 \~english Dalsa board typeUndefined = 8 ///< \~chinese 未定义采集卡 \~english Undefined board }; enum ETriggerMode { Off = 0, ///< \~chinese 触发模式关闭(连续模式) \~english TriggerMode Off(Continuous Acquisition Mode) Software = 1, ///< \~chinese 软触发模式 \~english Soft TriggerMode External = 2, ///< \~chinese 外触发模式 \~english External TriggerMode Undefined = 5, ///< \~chinese 未定义模式 \~english Undefined Mode }; enum EParamName { Width = 1, ///< \~chinese 宽属性 \~english Width Heigh = 2, ///< \~chinese 高属性 \~english Heigh TriggerMode = 3, ///< \~chinese 触发模式 \~english TriggerMode SoftwareExecute = 4, ///< \~chinese 软触发执行 \~english SoftwareExecute ParamNameUndefined = 255, ///< \~chinese 未定义属性名 \~english Undefined param }; protected: /// \~chinese /// \brief 析构函数 /// \~english /// \brief destruct virtual ~ICLInterface(){} public: /// \~chinese /// \brief 连接CameraLink相机接口对象获取函数,同一个cameraPtr对应的是同一个接口对象 /// \param [in] cameraPtr CameraLink相机智能指针对象 /// \~english /// \brief CL camera object access interface, same cameraPtr is correspond to same CL camera object /// \param [in] cameraPtr CL camera smart pointer object static ICLInterfacePtr getInstance(const ICameraPtr &cameraPtr); /// \~chinese /// \brief 获取接口描述信息 /// \return 返回接口描述信息,失败返回NULL /// \~english /// \brief get interface description information /// \return success:return interface description information, fail:return NULL virtual const char * getDescription() = 0; /// \~chinese /// \brief 获取接口的供应商名 /// \return 返回接口的供应商名,失败返回NULL /// \~english /// \brief get interface's VendorName /// \return success:return interface's VendorName, fail:return NULL virtual const char * getVendorName() = 0; /// \~chinese /// \brief 获取接口的端口 /// \return 返回接口的端口,失败返回NULL /// \~english /// \brief get interface's PortId /// \return success:return interface's PortId, fail:return NULL virtual const char * getPortId() = 0; /// \~chinese /// \brief 获取接口(采集卡)类型 /// \return 返回接口(采集卡)类型 /// \~english /// \brief get interface's Type /// \return interface's Type virtual EInterfaceType getInterfaceType() const = 0; /// \~chinese /// \brief 设置指定采集卡的配置文件 /// \param [in] index 采集卡编号 /// \param [in] port 采集卡的端口 /// \param [in] pConfigFile 采集卡配置文件 /// \return 设置是否成功 /// \~english /// \brief get interface's PortId /// \param [in] index the property's value /// \param [in] port the property's value /// \param [in] pConfigFile 采集卡配置文件 /// \retval false set board config fail /// \retval true set board config success virtual bool setBoardConfig(uint16_t index, uint16_t port, const char *pConfigFile) = 0; /// \~chinese /// \brief 获取属性值 /// \param [in] paramName 属性名 /// \param [out] val 获取到的属性值 /// \return 成功返回true,否则false /// \~english /// \brief get property's value /// \param [in] paramName the property's name /// \param [out] val the property's value /// \return success:true, fail:false virtual bool getParamValue(EParamName paramName, uint32_t& val) const = 0; /// \~chinese /// \brief 设置属性值 /// \param [in] paramName 属性名 /// \param [in] val 待设置的属性值 /// \return 成功则返回true,否则返回false /// \~english /// \brief set the property's value /// \param [in] paramName the property's name /// \param [in] val the value to be set for this property /// \return success:true, fail:false virtual bool setParamValue(EParamName paramName, uint32_t val) = 0; }; /// @} GENICAM_NAMESPACE_END #endif//__DAHUA_GENICAM_ICLINTERFACE_H__
30.553333
104
0.657866
[ "object" ]
9615531f6ba8c401b74a9e3da1aa56f93c08a3ef
227
h
C
CesiumGltfWriter/src/SkinWriter.h
SC-One/cesium-native
a8232ad039db1bb83ad2204c40c6dfb5d8207bb6
[ "Apache-2.0" ]
2
2021-10-02T17:45:12.000Z
2021-10-02T17:45:15.000Z
CesiumGltfWriter/src/SkinWriter.h
SC-One/cesium-native
a8232ad039db1bb83ad2204c40c6dfb5d8207bb6
[ "Apache-2.0" ]
null
null
null
CesiumGltfWriter/src/SkinWriter.h
SC-One/cesium-native
a8232ad039db1bb83ad2204c40c6dfb5d8207bb6
[ "Apache-2.0" ]
null
null
null
#pragma once #include <CesiumGltf/Skin.h> #include <CesiumJsonWriter/JsonWriter.h> #include <vector> namespace CesiumGltf { void writeSkin( const std::vector<Skin>& skins, CesiumJsonWriter::JsonWriter& jsonWriter); }
18.916667
46
0.748899
[ "vector" ]
9615d8011a25679a0aa20b0162147e82f2ea3d27
1,653
h
C
CondFormats/HcalObjects/interface/HcalSiPMCharacteristicsGPU.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
CondFormats/HcalObjects/interface/HcalSiPMCharacteristicsGPU.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
CondFormats/HcalObjects/interface/HcalSiPMCharacteristicsGPU.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
#ifndef CondFormats_HcalObjects_interface_HcalSiPMCharacteristicsGPU_h #define CondFormats_HcalObjects_interface_HcalSiPMCharacteristicsGPU_h #include "CondFormats/HcalObjects/interface/HcalSiPMCharacteristics.h" #include "FWCore/Utilities/interface/propagate_const_array.h" #include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" #ifndef __CUDACC__ #include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h" #include "HeterogeneousCore/CUDACore/interface/ESProduct.h" #endif class HcalSiPMCharacteristicsGPU { public: struct Product { edm::propagate_const_array<cms::cuda::device::unique_ptr<int[]>> pixels; edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> parLin1; edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> parLin2; edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> parLin3; edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> crossTalk; edm::propagate_const_array<cms::cuda::device::unique_ptr<int[]>> auxi1; edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> auxi2; }; #ifndef __CUDACC__ // rearrange reco params HcalSiPMCharacteristicsGPU(HcalSiPMCharacteristics const &); // will trigger deallocation of Product thru ~Product ~HcalSiPMCharacteristicsGPU() = default; // get device pointers Product const &getProduct(cudaStream_t) const; private: std::vector<int, cms::cuda::HostAllocator<int>> pixels_, auxi1_; std::vector<float, cms::cuda::HostAllocator<float>> parLin1_, parLin2_, parLin3_, crossTalk_, auxi2_; cms::cuda::ESProduct<Product> product_; #endif }; #endif
37.568182
103
0.785844
[ "vector" ]
9616025b0f5fb917ab0df54403625a59bac073fa
46,043
h
C
be/src/service/impala-server.h
Altiscale/Impala
1a57d938ff616669a3111256c548807b10e0bff6
[ "Apache-2.0" ]
null
null
null
be/src/service/impala-server.h
Altiscale/Impala
1a57d938ff616669a3111256c548807b10e0bff6
[ "Apache-2.0" ]
null
null
null
be/src/service/impala-server.h
Altiscale/Impala
1a57d938ff616669a3111256c548807b10e0bff6
[ "Apache-2.0" ]
null
null
null
// Copyright 2012 Cloudera Inc. // // 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 IMPALA_SERVICE_IMPALA_SERVER_H #define IMPALA_SERVICE_IMPALA_SERVER_H #include <boost/thread/mutex.hpp> #include <boost/shared_ptr.hpp> #include <boost/scoped_ptr.hpp> #include <boost/unordered_map.hpp> #include <boost/unordered_set.hpp> #include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid_generators.hpp> #include <boost/uuid/uuid_io.hpp> #include "gen-cpp/ImpalaService.h" #include "gen-cpp/ImpalaHiveServer2Service.h" #include "gen-cpp/ImpalaInternalService.h" #include "gen-cpp/Frontend_types.h" #include "rpc/thrift-server.h" #include "common/status.h" #include "service/frontend.h" #include "util/metrics.h" #include "util/runtime-profile.h" #include "util/simple-logger.h" #include "util/thread-pool.h" #include "util/time.h" #include "util/uid-util.h" #include "runtime/coordinator.h" #include "runtime/runtime-state.h" #include "runtime/timestamp-value.h" #include "runtime/types.h" namespace impala { class ExecEnv; class DataSink; class CancellationWork; class Coordinator; class RowDescriptor; class TCatalogUpdate; class TPlanExecRequest; class TPlanExecParams; class TExecPlanFragmentParams; class TExecPlanFragmentResult; class TInsertResult; class TReportExecStatusArgs; class TReportExecStatusResult; class TCancelPlanFragmentArgs; class TCancelPlanFragmentResult; class TTransmitDataArgs; class TTransmitDataResult; class TNetworkAddress; class TClientRequest; class TExecRequest; class TSessionState; class TQueryOptions; // An ImpalaServer contains both frontend and backend functionality; // it implements ImpalaService (Beeswax), ImpalaHiveServer2Service (HiveServer2) // and ImpalaInternalService APIs. // This class is partially thread-safe. To ensure freedom from deadlock, // locks on the maps are obtained before locks on the items contained in the maps. // // TODO: The state of a running query is currently not cleaned up if the // query doesn't experience any errors at runtime and close() doesn't get called. // The solution is to have a separate thread that cleans up orphaned // query execution states after a timeout period. // TODO: The same doesn't apply to the execution state of an individual plan // fragment: the originating coordinator might die, but we can get notified of // that via the statestore. This still needs to be implemented. class ImpalaServer : public ImpalaServiceIf, public ImpalaHiveServer2ServiceIf, public ImpalaInternalServiceIf, public ThriftServer::ConnectionHandlerIf { public: ImpalaServer(ExecEnv* exec_env); ~ImpalaServer(); Frontend* frontend() { return frontend_.get(); } // ImpalaService rpcs: Beeswax API (implemented in impala-beeswax-server.cc) virtual void query(beeswax::QueryHandle& query_handle, const beeswax::Query& query); virtual void executeAndWait(beeswax::QueryHandle& query_handle, const beeswax::Query& query, const beeswax::LogContextId& client_ctxt); virtual void explain(beeswax::QueryExplanation& query_explanation, const beeswax::Query& query); virtual void fetch(beeswax::Results& query_results, const beeswax::QueryHandle& query_handle, const bool start_over, const int32_t fetch_size); virtual void get_results_metadata(beeswax::ResultsMetadata& results_metadata, const beeswax::QueryHandle& handle); virtual void close(const beeswax::QueryHandle& handle); virtual beeswax::QueryState::type get_state(const beeswax::QueryHandle& handle); virtual void echo(std::string& echo_string, const std::string& input_string); virtual void clean(const beeswax::LogContextId& log_context); virtual void get_log(std::string& log, const beeswax::LogContextId& context); // Return ImpalaQueryOptions default values and "support_start_over/false" to indicate // that Impala does not support start over in the fetch call. Hue relies on this not to // issue a "start_over" fetch call. // "include_hadoop" is not applicable. virtual void get_default_configuration( std::vector<beeswax::ConfigVariable>& configurations, const bool include_hadoop); // ImpalaService rpcs: unimplemented parts of Beeswax API. // These APIs will not be implemented because ODBC driver does not use them. virtual void dump_config(std::string& config); // ImpalaService rpcs: extensions over Beeswax (implemented in impala-beeswax-server.cc) virtual void Cancel(impala::TStatus& status, const beeswax::QueryHandle& query_id); virtual void CloseInsert(impala::TInsertResult& insert_result, const beeswax::QueryHandle& query_handle); // Pings the Impala service and gets the server version string. virtual void PingImpalaService(TPingImpalaServiceResp& return_val); // TODO: Need to implement HiveServer2 version of GetRuntimeProfile virtual void GetRuntimeProfile(std::string& profile_output, const beeswax::QueryHandle& query_id); // Performs a full catalog metadata reset, invalidating all table and database metadata. virtual void ResetCatalog(impala::TStatus& status); // Resets the specified table's catalog metadata, forcing a reload on the next access. // Returns an error if the table or database was not found in the catalog. virtual void ResetTable(impala::TStatus& status, const TResetTableReq& request); // ImpalaHiveServer2Service rpcs: HiveServer2 API (implemented in impala-hs2-server.cc) // TODO: Migrate existing extra ImpalaServer RPCs to ImpalaHiveServer2Service. virtual void OpenSession( apache::hive::service::cli::thrift::TOpenSessionResp& return_val, const apache::hive::service::cli::thrift::TOpenSessionReq& request); virtual void CloseSession( apache::hive::service::cli::thrift::TCloseSessionResp& return_val, const apache::hive::service::cli::thrift::TCloseSessionReq& request); virtual void GetInfo( apache::hive::service::cli::thrift::TGetInfoResp& return_val, const apache::hive::service::cli::thrift::TGetInfoReq& request); virtual void ExecuteStatement( apache::hive::service::cli::thrift::TExecuteStatementResp& return_val, const apache::hive::service::cli::thrift::TExecuteStatementReq& request); virtual void GetTypeInfo( apache::hive::service::cli::thrift::TGetTypeInfoResp& return_val, const apache::hive::service::cli::thrift::TGetTypeInfoReq& request); virtual void GetCatalogs( apache::hive::service::cli::thrift::TGetCatalogsResp& return_val, const apache::hive::service::cli::thrift::TGetCatalogsReq& request); virtual void GetSchemas( apache::hive::service::cli::thrift::TGetSchemasResp& return_val, const apache::hive::service::cli::thrift::TGetSchemasReq& request); virtual void GetTables( apache::hive::service::cli::thrift::TGetTablesResp& return_val, const apache::hive::service::cli::thrift::TGetTablesReq& request); virtual void GetTableTypes( apache::hive::service::cli::thrift::TGetTableTypesResp& return_val, const apache::hive::service::cli::thrift::TGetTableTypesReq& request); virtual void GetColumns( apache::hive::service::cli::thrift::TGetColumnsResp& return_val, const apache::hive::service::cli::thrift::TGetColumnsReq& request); virtual void GetFunctions( apache::hive::service::cli::thrift::TGetFunctionsResp& return_val, const apache::hive::service::cli::thrift::TGetFunctionsReq& request); virtual void GetOperationStatus( apache::hive::service::cli::thrift::TGetOperationStatusResp& return_val, const apache::hive::service::cli::thrift::TGetOperationStatusReq& request); virtual void CancelOperation( apache::hive::service::cli::thrift::TCancelOperationResp& return_val, const apache::hive::service::cli::thrift::TCancelOperationReq& request); virtual void CloseOperation( apache::hive::service::cli::thrift::TCloseOperationResp& return_val, const apache::hive::service::cli::thrift::TCloseOperationReq& request); virtual void GetResultSetMetadata( apache::hive::service::cli::thrift::TGetResultSetMetadataResp& return_val, const apache::hive::service::cli::thrift::TGetResultSetMetadataReq& request); virtual void FetchResults( apache::hive::service::cli::thrift::TFetchResultsResp& return_val, const apache::hive::service::cli::thrift::TFetchResultsReq& request); virtual void GetLog(apache::hive::service::cli::thrift::TGetLogResp& return_val, const apache::hive::service::cli::thrift::TGetLogReq& request); // ImpalaService common extensions (implemented in impala-server.cc) // ImpalaInternalService rpcs virtual void ExecPlanFragment( TExecPlanFragmentResult& return_val, const TExecPlanFragmentParams& params); virtual void ReportExecStatus( TReportExecStatusResult& return_val, const TReportExecStatusParams& params); virtual void CancelPlanFragment( TCancelPlanFragmentResult& return_val, const TCancelPlanFragmentParams& params); virtual void TransmitData( TTransmitDataResult& return_val, const TTransmitDataParams& params); // Prepares the given query context by populating fields required for evaluating // certain expressions, such as now(), pid(), etc. Should be called before handing // the query context to the frontend for query compilation. static void PrepareQueryContext(TQueryContext* query_ctxt); // Returns the ImpalaQueryOptions enum for the given "key". Input is case in-sensitive. // Return -1 if the input is an invalid option. static int GetQueryOption(const std::string& key); // Parse a "," separated key=value pair of query options and set it in TQueryOptions. // If the same query option is specified more than once, the last one wins. // Return an error if the input is invalid (bad format or invalid query option). static Status ParseQueryOptions(const std::string& options, TQueryOptions* query_options); // Set the key/value pair in TQueryOptions. It will override existing setting in // query_options. static Status SetQueryOptions(const std::string& key, const std::string& value, TQueryOptions* query_options); // SessionHandlerIf methods // Called when a Beeswax or HS2 connection starts. For Beeswax, registers a new // SessionState associated with the new connection. For HS2, this is a no-op (HS2 has an // explicit CreateSession RPC). virtual void ConnectionStart(const ThriftServer::ConnectionContext& session_context); // Called when a Beeswax or HS2 connection terminates. Unregisters all sessions // associated with the closed connection. virtual void ConnectionEnd(const ThriftServer::ConnectionContext& session_context); // Called when a membership update is received from the statestore. Looks for // active nodes that have failed, and cancels any queries running on them. // - incoming_topic_deltas: all changes to registered statestore topics // - subscriber_topic_updates: output parameter to publish any topic updates to. // Currently unused. void MembershipCallback(const StatestoreSubscriber::TopicDeltaMap& incoming_topic_deltas, std::vector<TTopicDelta>* subscriber_topic_updates); void CatalogUpdateCallback(const StatestoreSubscriber::TopicDeltaMap& topic_deltas, std::vector<TTopicDelta>* topic_updates); // Returns true if Impala is offline (and not accepting queries), false otherwise. bool IsOffline() { boost::lock_guard<boost::mutex> l(is_offline_lock_); return is_offline_; } private: class FragmentExecState; friend class ChildQuery; // Query result set stores converted rows returned by QueryExecState.fetchRows(). It // provides an interface to convert Impala rows to external API rows. // It is an abstract class. Subclass must implement AddOneRow(). class QueryResultSet { public: QueryResultSet() {} virtual ~QueryResultSet() {} // Add the row (list of expr value) from a select query to this result set. When a row // comes from a select query, the row is in the form of expr values (void*). 'scales' // contains the values' scales (# of digits after decimal), with -1 indicating no // scale specified. virtual Status AddOneRow( const std::vector<void*>& row, const std::vector<int>& scales) = 0; // Add the TResultRow to this result set. When a row comes from a DDL/metadata // operation, the row in the form of TResultRow. virtual Status AddOneRow(const TResultRow& row) = 0; // Copies rows in the range [start_idx, start_idx + num_rows) from the other result // set into this result set. Returns the number of rows added to this result set. // Returns 0 if the given range is out of bounds of the other result set. virtual int AddRows(const QueryResultSet* other, int start_idx, int num_rows) = 0; // Returns the approximate size of this result set in bytes. int64_t BytesSize() { return BytesSize(0, size()); } // Returns the approximate size of the given range of rows in bytes. virtual int64_t BytesSize(int start_idx, int num_rows) = 0; // Returns the size of this result set in number of rows. virtual size_t size() = 0; }; class AsciiQueryResultSet; // extends QueryResultSet class TRowQueryResultSet; // extends QueryResultSet struct SessionState; // Execution state of a query. class QueryExecState; // Relevant ODBC SQL State code; for more info, // goto http://msdn.microsoft.com/en-us/library/ms714687.aspx static const char* SQLSTATE_SYNTAX_ERROR_OR_ACCESS_VIOLATION; static const char* SQLSTATE_GENERAL_ERROR; static const char* SQLSTATE_OPTIONAL_FEATURE_NOT_IMPLEMENTED; // Ascii output precision for double/float static const int ASCII_PRECISION; // Initiate execution of plan fragment in newly created thread. // Creates new FragmentExecState and registers it in fragment_exec_state_map_. Status StartPlanFragmentExecution(const TExecPlanFragmentParams& exec_params); // Top-level loop for synchronously executing plan fragment, which runs in // exec_state's thread. Repeatedly calls GetNext() on the executor // and feeds the result into the data sink. // Returns exec status. Status ExecPlanFragment(FragmentExecState* exec_state); // Call ExecPlanFragment() and report status to coord. void RunExecPlanFragment(FragmentExecState* exec_state); // Report status of fragment execution to initiating coord. Status ReportStatus(FragmentExecState* exec_state); Status CreateDataSink( const TPlanExecRequest& request, const TPlanExecParams& params, const RowDescriptor& row_desc, DataSink** sink); // Return exec state for given query_id, or NULL if not found. // If 'lock' is true, the returned exec state's lock() will be acquired before // the query_exec_state_map_lock_ is released. boost::shared_ptr<QueryExecState> GetQueryExecState( const TUniqueId& query_id, bool lock); // Writes the session id, if found, for the given query to the output parameter. Returns // false if no query with the given ID is found. bool GetSessionIdForQuery(const TUniqueId& query_id, TUniqueId* session_id); // Return exec state for given fragment_instance_id, or NULL if not found. boost::shared_ptr<FragmentExecState> GetFragmentExecState( const TUniqueId& fragment_instance_id); // Updates the number of databases / tables metrics from the FE catalog Status UpdateCatalogMetrics(); // Starts asynchronous execution of query. Creates QueryExecState (returned // in exec_state), registers it and calls Coordinator::Execute(). // If it returns with an error status, exec_state will be NULL and nothing // will have been registered in query_exec_state_map_. // session_state is a ptr to the session running this query. // query_session_state is a snapshot of session state that changes when the // query was run. (e.g. default database). Status Execute(TQueryContext* query_ctxt, boost::shared_ptr<SessionState> session_state, boost::shared_ptr<QueryExecState>* exec_state); // Implements Execute() logic, but doesn't unregister query on error. Status ExecuteInternal(const TQueryContext& query_ctxt, boost::shared_ptr<SessionState> session_state, bool* registered_exec_state, boost::shared_ptr<QueryExecState>* exec_state); // Registers the query exec state with query_exec_state_map_ using the globally // unique query_id and add the query id to session state's open query list. Status RegisterQuery(boost::shared_ptr<SessionState> session_state, const boost::shared_ptr<QueryExecState>& exec_state); // Cancel the query execution if the query is still running. Removes exec_state from // query_exec_state_map_, and removes the query id from session state's open query list. // Updates the query's status to that provided, unless status is already not OK or // provided status is NULL. // Returns true if it found a registered exec_state, otherwise false. bool UnregisterQuery(const TUniqueId& query_id, const Status* status = NULL); // Initiates query cancellation reporting the given cause as the query status. // Assumes deliberate cancellation by the user if the cause is NULL. // Returns OK unless query_id is not found. // Queries still need to be unregistered, usually via Close, after cancellation. // Caller should not hold any locks when calling this function. Status CancelInternal(const TUniqueId& query_id, const Status* cause = NULL); // Close the session and release all resource used by this session. // Caller should not hold any locks when calling this function. // If ignore_if_absent is true, returns OK even if a session with the supplied ID does // not exist. Status CloseSessionInternal(const TUniqueId& session_id, bool ignore_if_absent); // Gets the runtime profile string for a given query_id and writes it to the output // stream. First searches for the query id in the map of in-flight queries. If no // match is found there, the query log is searched. Returns OK if the profile was // found, otherwise a Status object with an error message will be returned. The // output stream will not be modified on error. // If base64_encoded, outputs the base64 encoded profile output, otherwise the human // readable string. Status GetRuntimeProfileStr(const TUniqueId& query_id, bool base64_encoded, std::stringstream* output); // Webserver callback. Retrieves Hadoop confs from frontend and writes them to output void RenderHadoopConfigs(const Webserver::ArgumentMap& args, std::stringstream* output); // Webserver callback. Prints a sorted table of current queries, including their states, // types and IDs. void QueryStatePathHandler(const Webserver::ArgumentMap& args, std::stringstream* output); // Webserver callback. Prints the query profile (via PrettyPrint) void QueryProfilePathHandler(const Webserver::ArgumentMap& args, std::stringstream* output); // Webserver callback. Cancels an in-flight query. void CancelQueryPathHandler(const Webserver::ArgumentMap& args, std::stringstream* output); // Webserver callback. Prints the query profile as a base64 encoded object. void QueryProfileEncodedPathHandler(const Webserver::ArgumentMap& args, std::stringstream* output); // Webserver callback. Prints the inflight query ids. void InflightQueryIdsPathHandler(const Webserver::ArgumentMap& args, std::stringstream* output); // Webserver callback that prints a table of active sessions. void SessionPathHandler(const Webserver::ArgumentMap& args, std::stringstream* output); // Webserver callback that prints a list of all known databases and tables void CatalogPathHandler(const Webserver::ArgumentMap& args, std::stringstream* output); // Webserver callback that allows for dumping information on objects in the catalog. void CatalogObjectsPathHandler(const Webserver::ArgumentMap& args, std::stringstream* output); // Wrapper around Coordinator::Wait(); suitable for execution inside thread. // Must not be called with exec_state->lock() already taken. void Wait(boost::shared_ptr<QueryExecState> exec_state); // Initialize "default_configs_" to show the default values for ImpalaQueryOptions and // "support_start_over/false" to indicate that Impala does not support start over // in the fetch call. void InitializeConfigVariables(); // Registers all the per-Impalad webserver callbacks void RegisterWebserverCallbacks(Webserver* webserver); // Checks settings for profile logging, including whether the output // directory exists and is writeable, and initialises the first log file. // Returns OK unless there is some problem preventing profile log files // from being written. If an error is returned, the constructor will disable // profile logging. Status InitProfileLogging(); // Checks settings for audit event logging, including whether the output // directory exists and is writeable, and initialises the first log file. // Returns OK unless there is some problem preventing audit event log files // from being written. If an error is returned, impalad startup will be aborted. Status InitAuditEventLogging(); // Initializes a logging directory, creating the directory if it does not already // exist. If there is any error creating the directory an error will be returned. static Status InitLoggingDir(const std::string& log_dir); // Returns true if audit event logging is enabled, false otherwise. bool IsAuditEventLoggingEnabled(); // Runs once every 5s to flush the profile log file to disk. void LogFileFlushThread(); // Runs once every 5s to flush the audit log file to disk. void AuditEventLoggerFlushThread(); Status LogAuditRecord(const QueryExecState& exec_state, const TExecRequest& request); // Copies a query's state into the query log. Called immediately prior to a // QueryExecState's deletion. Also writes the query profile to the profile log on disk. // Must be called with query_exec_state_map_lock_ held void ArchiveQuery(const QueryExecState& query); // Checks whether the given user is allowed to impersonate as the specified do_as_user. // Returns OK if the authorization suceeds, otherwise returns an status with details // on why the failure occurred. Status AuthorizeProxyUser(const std::string& user, const std::string& do_as_user); // Snapshot of a query's state, archived in the query log. struct QueryStateRecord { // Pretty-printed runtime profile. TODO: Copy actual profile object std::string profile_str; // Base64 encoded runtime profile std::string encoded_profile_str; // Query id TUniqueId id; // User that ran the query std::string user; // default db for this query std::string default_db; // SQL statement text std::string stmt; // DDL, DML etc. TStmtType::type stmt_type; // True if the query required a coordinator fragment bool has_coord; // The number of fragments that have completed int64_t num_complete_fragments; // The total number of fragments int64_t total_fragments; // The number of rows fetched by the client int64_t num_rows_fetched; // The state of the query as of this snapshot beeswax::QueryState::type query_state; // Start and end time of the query TimestampValue start_time, end_time; // Initialise from an exec_state. If copy_profile is true, print the query // profile to a string and copy that into this.profile (which is expensive), // otherwise leave this.profile empty. // If encoded_str is non-empty, it is the base64 encoded string for // exec_state->profile. QueryStateRecord(const QueryExecState& exec_state, bool copy_profile = false, const std::string& encoded_str = ""); // Default constructor used only when participating in collections QueryStateRecord() { } // Comparator that sorts by start time. bool operator() (const QueryStateRecord& lhs, const QueryStateRecord& rhs) const; }; // Helper method to render a single QueryStateRecord as an HTML table // row. Used by QueryStatePathHandler. void RenderSingleQueryTableRow(const QueryStateRecord& record, bool render_end_time, bool render_cancel, std::stringstream* output); // Beeswax private methods // Helper functions to translate between Beeswax and Impala structs Status QueryToTQueryContext(const beeswax::Query& query, TQueryContext* query_ctxt); void TUniqueIdToQueryHandle(const TUniqueId& query_id, beeswax::QueryHandle* handle); void QueryHandleToTUniqueId(const beeswax::QueryHandle& handle, TUniqueId* query_id); // Helper function to raise BeeswaxException void RaiseBeeswaxException(const std::string& msg, const char* sql_state); // Executes the fetch logic. Doesn't clean up the exec state if an error occurs. Status FetchInternal(const TUniqueId& query_id, bool start_over, int32_t fetch_size, beeswax::Results* query_results); // Populate insert_result and clean up exec state. If the query // status is an error, insert_result is not populated and the status is returned. Status CloseInsertInternal(const TUniqueId& query_id, TInsertResult* insert_result); // HiveServer2 private methods (implemented in impala-hs2-server.cc) // Starts the synchronous execution of a HiverServer2 metadata operation. // If the execution succeeds, an QueryExecState will be created and registered in // query_exec_state_map_. Otherwise, nothing will be registered in query_exec_state_map_ // and an error status will be returned. As part of this call, the TMetadataOpRequest // struct will be populated with the requesting user's session state. // Returns a TOperationHandle and TStatus. void ExecuteMetadataOp( const apache::hive::service::cli::thrift::THandleIdentifier& session_handle, TMetadataOpRequest* request, apache::hive::service::cli::thrift::TOperationHandle* handle, apache::hive::service::cli::thrift::TStatus* status); // Executes the fetch logic for HiveServer2 FetchResults. If fetch_first is true, then // the query's state should be reset to fetch from the beginning of the result set. // Doesn't clean up the exec state if an error occurs. Status FetchInternal(const TUniqueId& query_id, int32_t fetch_size, bool fetch_first, apache::hive::service::cli::thrift::TFetchResultsResp* fetch_results); // Helper functions to translate between HiveServer2 and Impala structs // Returns !ok() if handle.guid.size() or handle.secret.size() != 16 static Status THandleIdentifierToTUniqueId( const apache::hive::service::cli::thrift::THandleIdentifier& handle, TUniqueId* unique_id, TUniqueId* secret); static void TUniqueIdToTHandleIdentifier( const TUniqueId& unique_id, const TUniqueId& secret, apache::hive::service::cli::thrift::THandleIdentifier* handle); Status TExecuteStatementReqToTQueryContext( const apache::hive::service::cli::thrift::TExecuteStatementReq execute_request, TQueryContext* query_ctxt); static void TColumnValueToHiveServer2TColumnValue(const TColumnValue& value, const TColumnType& type, apache::hive::service::cli::thrift::TColumnValue* hs2_col_val); static void TQueryOptionsToMap(const TQueryOptions& query_option, std::map<std::string, std::string>* configuration); // Convert an expr value to HiveServer2 TColumnValue static void ExprValueToHiveServer2TColumnValue(const void* value, const TColumnType& type, apache::hive::service::cli::thrift::TColumnValue* hs2_col_val); // Helper function to translate between Beeswax and HiveServer2 type static apache::hive::service::cli::thrift::TOperationState::type QueryStateToTOperationState(const beeswax::QueryState::type& query_state); // Helper method to process cancellations that result from failed backends, called from // the cancellation thread pool. The cancellation_work contains the query id to cancel // and a cause listing the failed backends that led to cancellation. Calls // CancelInternal directly, but has a signature compatible with the thread pool. void CancelFromThreadPool(uint32_t thread_id, const CancellationWork& cancellation_work); // Processes a CatalogUpdateResult returned from the CatalogServer and ensures // the update has been applied to the local impalad's catalog cache. If // wait_for_all_subscribers is true, this function will also wait until all // catalog topic subscribers have processed the update. Called from QueryExecState // after executing any statement that modifies the catalog. // If wait_for_all_subscribers is false AND if the TCatalogUpdateResult contains // TCatalogObject(s) to add and/or remove, this function will update the local cache // by directly calling UpdateCatalog() with the TCatalogObject results. // Otherwise this function will wait until the local impalad's catalog cache has been // updated from a statestore heartbeat that includes this catalog update's catalog // version. If wait_for_all_subscribers is true, this function also wait all other // catalog topic subscribers to process this update by checking the current // min_subscriber_topic_version included in each state store heartbeat. Status ProcessCatalogUpdateResult(const TCatalogUpdateResult& catalog_update_result, bool wait_for_all_subscribers); // To be run in a thread. Every FLAGS_idle_session_timeout / 2 seconds, wakes up and // checks all sessions for their last-idle time. Those that have been idle for longer // than FLAGS_idle_session_timeout are 'expired': they will no longer accept queries and // any running queries associated with those sessions are cancelled. void ExpireSessions(); // Cancels all queries associated with a session void CancelSessionQueries(SessionState* session_state); // Cancels all queries associated with a session asynchronously, by placing them on the // cancellation queue. void CancelSessionQueriesAsync(SessionState* session_state, const std::string& cause); // Runs forever, walking queries_by_timestamp_ and expiring any queries that have been // idle (i.e. no client input and no time spent processing locally) for // FLAGS_idle_query_timeout seconds. void ExpireQueries(); // Periodically opens a socket to FLAGS_local_nodemanager_url to check if the Yarn Node // Manager is running. If not, this method calls SetOffline(true), and when the NM // recovers, calls SetOffline(false). Only called (in nm_failure_detection_thread_) if // FLAGS_enable_rm is true. void DetectNmFailures(); // Set is_offline_ to the argument's value. void SetOffline(bool offline); // Guards query_log_ and query_log_index_ boost::mutex query_log_lock_; // FIFO list of query records, which are written after the query finishes executing typedef std::list<QueryStateRecord> QueryLog; QueryLog query_log_; // Index that allows lookup via TUniqueId into the query log typedef boost::unordered_map<TUniqueId, QueryLog::iterator> QueryLogIndex; QueryLogIndex query_log_index_; // Logger for writing encoded query profiles, one per line with the following format: // <ms-since-epoch> <query-id> <thrift query profile URL encoded and gzipped> boost::scoped_ptr<SimpleLogger> profile_logger_; // Logger for writing audit events, one per line with the format: // "<current timestamp>" : { JSON object } boost::scoped_ptr<SimpleLogger> audit_event_logger_; // If profile logging is enabled, wakes once every 5s to flush query profiles to disk boost::scoped_ptr<Thread> profile_log_file_flush_thread_; // If audit event logging is enabled, wakes once every 5s to flush audit events to disk boost::scoped_ptr<Thread> audit_event_logger_flush_thread_; // A Frontend proxy, used both for planning and for catalog requests. boost::scoped_ptr<Frontend> frontend_; // global, per-server state ExecEnv* exec_env_; // not owned // Thread pool to process cancellation requests that come from failed Impala demons to // avoid blocking the statestore callback. boost::scoped_ptr<ThreadPool<CancellationWork> > cancellation_thread_pool_; // Thread that runs ExpireSessions if FLAGS_idle_session_timeout > 0 boost::scoped_ptr<Thread> session_timeout_thread_; // map from query id to exec state; QueryExecState is owned by us and referenced // as a shared_ptr to allow asynchronous deletion typedef boost::unordered_map<TUniqueId, boost::shared_ptr<QueryExecState> > QueryExecStateMap; QueryExecStateMap query_exec_state_map_; boost::mutex query_exec_state_map_lock_; // protects query_exec_state_map_ // map from fragment id to exec state; FragmentExecState is owned by us and // referenced as a shared_ptr to allow asynchronous calls to CancelPlanFragment() typedef boost::unordered_map<TUniqueId, boost::shared_ptr<FragmentExecState> > FragmentExecStateMap; FragmentExecStateMap fragment_exec_state_map_; boost::mutex fragment_exec_state_map_lock_; // protects fragment_exec_state_map_ // Default query options in the form of TQueryOptions and beeswax::ConfigVariable TQueryOptions default_query_options_; std::vector<beeswax::ConfigVariable> default_configs_; // Per-session state. This object is reference counted using shared_ptrs. There // is one ref count in the SessionStateMap for as long as the session is active. // All queries running from this session also have a reference. struct SessionState { SessionState() : closed(false), expired(false), ref_count(0) { } TSessionType::type session_type; // Time the session was created TimestampValue start_time; // Connected user for this session, i.e. the user which originated this session. std::string connected_user; // The user to impersonate. Empty for no impersonation. std::string do_as_user; // Client network address TNetworkAddress network_address; // Protects all fields below // If this lock has to be taken with query_exec_state_map_lock, take this lock first. boost::mutex lock; // If true, the session has been closed. bool closed; // If true, the session was idle for too long and has been expired. Only set when // ref_count == 0, after which point ref_count should never become non-zero (since // clients will use ScopedSessionState to access the session, which will prevent use // after expiration). bool expired; // The default database (changed as a result of 'use' query execution) std::string database; // The default query options of this session TQueryOptions default_query_options; // Inflight queries belonging to this session boost::unordered_set<TUniqueId> inflight_queries; // Time the session was last accessed. int64_t last_accessed_ms; // Number of RPCs concurrently accessing this session state. Used to detect when a // session may be correctly expired after a timeout (when ref_count == 0). Typically // at most one RPC will be issued against a session at a time, but clients may do // something unexpected and, for example, poll in one thread and fetch in another. uint32_t ref_count; // Builds a Thrift representation of this SessionState for serialisation to // the frontend. void ToThrift(const TUniqueId& session_id, TSessionState* session_state); }; // Class that allows users of SessionState to mark a session as in-use, and therefore // immune to expiration. The marking is done in WithSession() and undone in the // destructor, so this class can be used to 'check-out' a session for the duration of a // scope. class ScopedSessionState { public: ScopedSessionState(ImpalaServer* impala) : impala_(impala) { } // Marks a session as in-use, and saves it so that it can be unmarked when this object // goes out of scope. Returns OK unless there is an error in GetSessionState. // Must only be called once per ScopedSessionState. Status WithSession(const TUniqueId& session_id, boost::shared_ptr<SessionState>* session = NULL) { DCHECK(session_.get() == NULL); RETURN_IF_ERROR(impala_->GetSessionState(session_id, &session_, true)); if (session != NULL) (*session) = session_; return Status::OK; } // Decrements the reference count so the session can be expired correctly. ~ScopedSessionState() { if (session_.get() != NULL) { impala_->MarkSessionInactive(session_); } } private: // Reference-counted pointer to the session state object. boost::shared_ptr<SessionState> session_; // Saved so that we can access ImpalaServer methods to get / return session state. ImpalaServer* impala_; }; // For access to GetSessionState() / MarkSessionInactive() friend class ScopedSessionState; // Protects session_state_map_. Should be taken before any query exec-state locks, // including query_exec_state_map_lock_. Should be taken before individual session-state // locks. boost::mutex session_state_map_lock_; // A map from session identifier to a structure containing per-session information typedef boost::unordered_map<TUniqueId, boost::shared_ptr<SessionState> > SessionStateMap; SessionStateMap session_state_map_; // Protects connection_to_sessions_map_. May be taken before session_state_map_lock_. boost::mutex connection_to_sessions_map_lock_; // Map from a connection ID to the associated list of sessions so that all can be closed // when the connection ends. HS2 allows for multiplexing several sessions across a // single connection. If a session has already been closed (only possible via HS2) it is // not removed from this map to avoid the cost of looking it up. typedef boost::unordered_map<TUniqueId, std::vector<TUniqueId> > ConnectionToSessionMap; ConnectionToSessionMap connection_to_sessions_map_; // Returns session state for given session_id. // If not found, session_state will be NULL and an error status will be returned. // If keep_alive is true, also checks if the session is expired or closed and increments // the session's reference counter if it is still alive. Status GetSessionState(const TUniqueId& session_id, boost::shared_ptr<SessionState>* session_state, bool mark_active = false); // Decrement the session's reference counter and mark last_accessed_ms so that state // expiration can proceed. inline void MarkSessionInactive(boost::shared_ptr<SessionState> session) { boost::lock_guard<boost::mutex> l(session->lock); DCHECK_GT(session->ref_count, 0); --session->ref_count; session->last_accessed_ms = ms_since_epoch(); } // protects query_locations_. Must always be taken after // query_exec_state_map_lock_ if both are required. boost::mutex query_locations_lock_; // A map from backend to the list of queries currently running there. typedef boost::unordered_map<TNetworkAddress, boost::unordered_set<TUniqueId> > QueryLocations; QueryLocations query_locations_; // A map from unique backend ID to the corresponding TNetworkAddress of that backend. // Used to track membership updates from the statestore so queries can be cancelled // when a backend is removed. It's not enough to just cancel fragments that are running // based on the deletions mentioned in the most recent statestore heartbeat; sometimes // cancellations are skipped and the statestore, at its discretion, may send only // a delta of the current membership so we need to compute any deletions. // TODO: Currently there are multiple locations where cluster membership is tracked, // here and in the scheduler. This should be consolidated so there is a single component // (the scheduler?) that tracks this information and calls other interested components. typedef boost::unordered_map<std::string, TNetworkAddress> BackendAddressMap; BackendAddressMap known_backends_; // Generate unique session id for HiveServer2 session boost::uuids::random_generator uuid_generator_; // Lock to protect uuid_generator boost::mutex uuid_lock_; // Lock for catalog_update_version_info_, min_subscriber_catalog_topic_version_, // and catalog_version_update_cv_ boost::mutex catalog_version_lock_; // Variable to signal when the catalog version has been modified boost::condition_variable catalog_version_update_cv_; // Contains details on the version information of a catalog update. struct CatalogUpdateVersionInfo { CatalogUpdateVersionInfo() : catalog_version(0L), catalog_topic_version(0L) { } // The last catalog version returned from UpdateCatalog() int64_t catalog_version; // The CatalogService ID that this catalog version is from. TUniqueId catalog_service_id; // The statestore catalog topic version this update was received in. int64_t catalog_topic_version; }; // The version information from the last successfull call to UpdateCatalog(). CatalogUpdateVersionInfo catalog_update_info_; // The current minimum topic version processed across all subscribers of the catalog // topic. Used to determine when other nodes have successfully processed a catalog // update. Updated with each catalog topic heartbeat from the statestore. int64_t min_subscriber_catalog_topic_version_; // Map of short usernames of authorized proxy users to the set of user(s) they are // allowed to impersonate. Populated by parsing the --authorized_proxy_users_config // flag. typedef boost::unordered_map<std::string, boost::unordered_set<std::string> > ProxyUserMap; ProxyUserMap authorized_proxy_user_config_; // Guards queries_by_timestamp_ boost::mutex query_expiration_lock_; // Describes a query expiration event (t, q) where t is the expiration deadline in // seconds, and q is the query ID. typedef std::pair<int64_t, TUniqueId> ExpirationEvent; // Comparator that breaks ties when two queries have identical expiration deadlines. struct ExpirationEventComparator { bool operator()(const ExpirationEvent& t1, const ExpirationEvent& t2) { if (t1.first < t2.first) return true; if (t2.first < t1.first) return false; return t1.second < t2.second; } }; // Ordered set of (expiration_time, query_id) pairs. This queue is updated either by // RegisterQuery(), which adds a new query to the set, or by ExpireQueries(), which // updates the entries as it iterates over the set. Therefore, it is not directly // accessed during normal query execution and the benefit of that is there is no // competition for locks when ExpireQueries() walks this list to find expired queries. // // In order to make the query expiration algorithm work, the following conditions always // hold: // // * For any pair (t, q) in the set, t is always a lower bound on the true expiration // time of the query q (in q->idle_time()). Therefore it is always correct to sleep // until t and then check q for expiration. // // * Any new pair (t, q) added to a non-empty set whose first value is (t', q') has t' < // t. This guarantees that it is always safe to sleep until t' without missing any new // expirations. // // The reason that the expiration time saved in each entry here may not exactly match // the true expiration time of a query is because we wish to avoid accessing (and // therefore locking) this structure on every query activity. Instead, queries maintain // an accurate expiration time, and this structure guarantees that we will always // (modulo scheduling delays out of our control) read the expiration time before it has // passed. typedef std::set<ExpirationEvent, ExpirationEventComparator> ExpirationQueue; ExpirationQueue queries_by_timestamp_; // Container for a thread that runs ExpireQueries() if FLAGS_idle_query_timeout is set. boost::scoped_ptr<Thread> query_expiration_thread_; // Container thread for DetectNmFailures(). boost::scoped_ptr<Thread> nm_failure_detection_thread_; // Protects is_offline_ boost::mutex is_offline_lock_; // True if Impala server is offline, false otherwise. bool is_offline_; }; // Create an ImpalaServer and Thrift servers. // If beeswax_port != 0 (and fe_server != NULL), creates a ThriftServer exporting // ImpalaService (Beeswax) on beeswax_port (returned via beeswax_server). // If hs2_port != 0 (and hs2_server != NULL), creates a ThriftServer exporting // ImpalaHiveServer2Service on hs2_port (returned via hs2_server). // If be_port != 0 (and be_server != NULL), create a ThriftServer exporting // ImpalaInternalService on be_port (returned via be_server). // Returns created ImpalaServer. The caller owns fe_server and be_server. // The returned ImpalaServer is referenced by both of these via shared_ptrs and will be // deleted automatically. // Returns OK unless there was some error creating the servers, in // which case none of the output parameters can be assumed to be valid. Status CreateImpalaServer(ExecEnv* exec_env, int beeswax_port, int hs2_port, int be_port, ThriftServer** beeswax_server, ThriftServer** hs2_server, ThriftServer** be_server, ImpalaServer** impala_server); } #endif
46.982653
90
0.756488
[ "render", "object", "vector" ]
961a4e1090bd7ef9cff4a334f47022c1651a66d2
5,757
h
C
sdk_k64f/middleware/emwin/emWin_header/GUI_GIF_Private.h
Sir-Branch/k64f-starter-template
f8959fd185f090363d180d69f84c2727e37cbeeb
[ "MIT" ]
1
2020-08-23T20:24:19.000Z
2020-08-23T20:24:19.000Z
sdk_k64f/middleware/emwin/emWin_header/GUI_GIF_Private.h
Sir-Branch/xxxx-starter-template
f8959fd185f090363d180d69f84c2727e37cbeeb
[ "MIT" ]
1
2020-08-24T00:41:48.000Z
2020-08-24T02:17:44.000Z
sdk_k64f/middleware/emwin/emWin_header/GUI_GIF_Private.h
Sir-Branch/xxxx-starter-template
f8959fd185f090363d180d69f84c2727e37cbeeb
[ "MIT" ]
null
null
null
/********************************************************************* * SEGGER Microcontroller GmbH * * Solutions for real time microcontroller applications * ********************************************************************** * * * (c) 1996 - 2019 SEGGER Microcontroller GmbH * * * * Internet: www.segger.com Support: support@segger.com * * * ********************************************************************** ** emWin V5.50 - Graphical user interface for embedded applications ** All Intellectual Property rights in the Software belongs to SEGGER. emWin is protected by international copyright laws. Knowledge of the source code may not be used to write a similar product. This file may only be used in accordance with the following terms: The software has been licensed to NXP Semiconductors USA, Inc. whose registered office is situated at 411 E. Plumeria Drive, San Jose, CA 95134, USA solely for the purposes of creating libraries for NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and distributed under the terms and conditions of the NXP End User License Agreement. Full source code is available at: www.segger.com We appreciate your understanding and fairness. ---------------------------------------------------------------------- Licensing information Licensor: SEGGER Microcontroller Systems LLC Licensed to: NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA Licensed SEGGER software: emWin License number: GUI-00186 License model: emWin License Agreement, dated August 20th 2011 and Amendment No. 1, dated October 17th 2017 and Amendment No. 2, dated December 18th 2018 Licensed platform: NXP's ARM 7/9, Cortex-M0, M3, M4, M7, A7, M33 ---------------------------------------------------------------------- Support and Update Agreement (SUA) SUA period: 2011-08-19 - 2020-09-02 Contact to extend SUA: sales@segger.com ---------------------------------------------------------------------- File : GUI_GIF_Private.h Purpose : Private header file for GUI_GIF... functions ---------------------------END-OF-HEADER------------------------------ */ #ifndef GUI_GIF_PRIVATE_H #define GUI_GIF_PRIVATE_H #include "GUI_Private.h" /********************************************************************* * * Defines * ********************************************************************** */ #define MAX_NUM_LWZ_BITS 12 /********************************************************************* * * Types * ********************************************************************** */ /* Context structure */ typedef struct { /* Required for getting input */ unsigned NumBytesInBuffer; /* Remaining bytes in buffer */ const U8 * pBuffer; /* Pointer into buffer for reading data */ GUI_GET_DATA_FUNC * pfGetData; /* Function pointer */ void * pParam; /* Parameter pointer passed to function */ U32 Off; /* Data pointer */ /* Decompression data */ U8 aBuffer[258]; /* Input buffer for data block */ short aCode [(1 << MAX_NUM_LWZ_BITS)]; /* This array stores the LZW codes for the compressed strings */ U8 aPrefix[(1 << MAX_NUM_LWZ_BITS)]; /* Prefix character of the LZW code. */ U8 aDecompBuffer[3000]; /* Decompression buffer. The higher the compression, the more bytes are needed in the buffer. */ U8 * sp; /* Pointer into the decompression buffer */ int CurBit; int LastBit; int GetDone; int LastByte; int ReturnClear; int CodeSize; int SetCodeSize; int MaxCode; int MaxCodeSize; int ClearCode; int EndCode; int FirstCode; int OldCode; /* Palette buffer */ GUI_COLOR aColorTable[256]; } GUI_GIF_CONTEXT; typedef struct { int XPos; int YPos; int XSize; int YSize; int Flags; int NumColors; } IMAGE_DESCRIPTOR; /* Default parameter structure for reading data from memory */ typedef struct { const U8 * pFileData; U32 FileSize; } GUI_GIF_PARAM; typedef int DRAW_FROM_DATABLOCK(GUI_GIF_CONTEXT * pContext, IMAGE_DESCRIPTOR * pDescriptor, int x0, int y0, int Transparency, int Disposal, int Num, int Denom); typedef void CLEAR_UNUSED_PIXELS(int x0, int y0, IMAGE_DESCRIPTOR * pDescriptor, GUI_GIF_IMAGE_INFO * pInfo, int Num, int Denom); /********************************************************************* * * Private data * ********************************************************************** */ extern const int GUI_GIF__aInterlaceOffset[4]; extern const int GUI_GIF__aInterlaceYPos[4]; /********************************************************************* * * Interface * ********************************************************************** */ int GUI_GIF__ReadData(GUI_GIF_CONTEXT * pContext, unsigned NumBytes, const U8 ** ppData, unsigned StartOfFile); int GUI_GIF__GetData(void * p, const U8 ** ppData, unsigned NumBytesReq, U32 Off); int GUI_GIF__DrawFromFilePointer(GUI_GIF_CONTEXT * pContext, int x0, int y0, int Index, int Num, int Denom, DRAW_FROM_DATABLOCK pfDrawFromDataBlock, CLEAR_UNUSED_PIXELS pfClearUnusedPixels); void GUI_GIF__InitLZW(GUI_GIF_CONTEXT * pContext, int InputCodeSize); int GUI_GIF__GetNextByte(GUI_GIF_CONTEXT * pContext); #endif /* GUI_GIF_PRIVATE_H */
42.644444
191
0.534132
[ "model" ]
961aa06f7477e2bec73ed4f6ac9197745f676995
1,000
h
C
libOPRF/OPPRF/binSet.h
namasikanam/MultipartyPSI
57fed04b6cb86b88eeede6f7fb50e9ccd3f84528
[ "Unlicense" ]
44
2017-10-18T07:46:17.000Z
2022-02-22T08:14:57.000Z
libOPRF/OPPRF/binSet.h
namasikanam/MultipartyPSI
57fed04b6cb86b88eeede6f7fb50e9ccd3f84528
[ "Unlicense" ]
8
2019-01-22T14:31:06.000Z
2021-11-08T09:54:33.000Z
libOPRF/OPPRF/binSet.h
namasikanam/MultipartyPSI
57fed04b6cb86b88eeede6f7fb50e9ccd3f84528
[ "Unlicense" ]
20
2017-09-25T03:04:58.000Z
2022-03-30T11:55:55.000Z
#pragma once #include "Common/Defines.h" #include "Network/Channel.h" #include "NChooseOne/NcoOtExt.h" #include "Hashing/CuckooHasher1.h" #include "Hashing/SimpleHasher1.h" namespace osuCrypto { //struct BFParam //{ // double mBinScaler[2]; //first index is for init step, 2nd index for stash step // u64 mNumHashes[2]; // u64 mSenderBinSize[2]; // /* // double mBinStashScaler; // u64 mNumStashHashes; // u64 mSenderBinStashSize;*/ //}; class binSet { public: binSet(); ~binSet(); u64 mN, mParties, mMyIdx, mStatSecParam, mNcoInputBlkSize;// , mOtMsgBlkSize; block mHashingSeed; u64 mMaskSize; u64 mOpt; std::vector<std::vector<block>> mNcoInputBuff; //hash(x) // OPPRFSender aaa; std::vector<block> mXsets; CuckooHasher1 mCuckooBins; SimpleHasher1 mSimpleBins; void init(u64 myIdx, u64 nParties, u64 setSize, u64 statSecParam, u64 opt); void hashing2Bins(std::vector<block>& inputs, int numThreads); }; }
19.607843
85
0.675
[ "vector" ]
961acb808377e3732158777f89a931d4207cfd7a
6,703
h
C
ams/include/tencentcloud/ams/v20200608/model/MediaModerationConfig.h
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
43
2019-08-14T08:14:12.000Z
2022-03-30T12:35:09.000Z
ams/include/tencentcloud/ams/v20200608/model/MediaModerationConfig.h
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
12
2019-07-15T10:44:59.000Z
2021-11-02T12:35:00.000Z
ams/include/tencentcloud/ams/v20200608/model/MediaModerationConfig.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_AMS_V20200608_MODEL_MEDIAMODERATIONCONFIG_H_ #define TENCENTCLOUD_AMS_V20200608_MODEL_MEDIAMODERATIONCONFIG_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/utils/rapidjson/document.h> #include <tencentcloud/core/utils/rapidjson/writer.h> #include <tencentcloud/core/utils/rapidjson/stringbuffer.h> #include <tencentcloud/core/AbstractModel.h> #include <tencentcloud/ams/v20200608/model/FileOutput.h> namespace TencentCloud { namespace Ams { namespace V20200608 { namespace Model { /** * 媒体审核配置 */ class MediaModerationConfig : public AbstractModel { public: MediaModerationConfig(); ~MediaModerationConfig() = default; void ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const; CoreInternalOutcome Deserialize(const rapidjson::Value &value); /** * 获取音频截帧频率。默认一分钟 * @return AudioFrequency 音频截帧频率。默认一分钟 */ int64_t GetAudioFrequency() const; /** * 设置音频截帧频率。默认一分钟 * @param AudioFrequency 音频截帧频率。默认一分钟 */ void SetAudioFrequency(const int64_t& _audioFrequency); /** * 判断参数 AudioFrequency 是否已赋值 * @return AudioFrequency 是否已赋值 */ bool AudioFrequencyHasBeenSet() const; /** * 获取图片取帧频率, 单位(秒/帧),默认 5, 可选 1 ~ 300 * @return ImageFrequency 图片取帧频率, 单位(秒/帧),默认 5, 可选 1 ~ 300 */ int64_t GetImageFrequency() const; /** * 设置图片取帧频率, 单位(秒/帧),默认 5, 可选 1 ~ 300 * @param ImageFrequency 图片取帧频率, 单位(秒/帧),默认 5, 可选 1 ~ 300 */ void SetImageFrequency(const int64_t& _imageFrequency); /** * 判断参数 ImageFrequency 是否已赋值 * @return ImageFrequency 是否已赋值 */ bool ImageFrequencyHasBeenSet() const; /** * 获取异步回调地址。 * @return CallbackUrl 异步回调地址。 */ std::string GetCallbackUrl() const; /** * 设置异步回调地址。 * @param CallbackUrl 异步回调地址。 */ void SetCallbackUrl(const std::string& _callbackUrl); /** * 判断参数 CallbackUrl 是否已赋值 * @return CallbackUrl 是否已赋值 */ bool CallbackUrlHasBeenSet() const; /** * 获取临时文件存储位置 * @return SegmentOutput 临时文件存储位置 */ FileOutput GetSegmentOutput() const; /** * 设置临时文件存储位置 * @param SegmentOutput 临时文件存储位置 */ void SetSegmentOutput(const FileOutput& _segmentOutput); /** * 判断参数 SegmentOutput 是否已赋值 * @return SegmentOutput 是否已赋值 */ bool SegmentOutputHasBeenSet() const; /** * 获取是否使用OCR,默认为true * @return UseOCR 是否使用OCR,默认为true */ bool GetUseOCR() const; /** * 设置是否使用OCR,默认为true * @param UseOCR 是否使用OCR,默认为true */ void SetUseOCR(const bool& _useOCR); /** * 判断参数 UseOCR 是否已赋值 * @return UseOCR 是否已赋值 */ bool UseOCRHasBeenSet() const; /** * 获取是否使用音频。(音频场景下,该值永远为true) * @return UseAudio 是否使用音频。(音频场景下,该值永远为true) */ bool GetUseAudio() const; /** * 设置是否使用音频。(音频场景下,该值永远为true) * @param UseAudio 是否使用音频。(音频场景下,该值永远为true) */ void SetUseAudio(const bool& _useAudio); /** * 判断参数 UseAudio 是否已赋值 * @return UseAudio 是否已赋值 */ bool UseAudioHasBeenSet() const; private: /** * 音频截帧频率。默认一分钟 */ int64_t m_audioFrequency; bool m_audioFrequencyHasBeenSet; /** * 图片取帧频率, 单位(秒/帧),默认 5, 可选 1 ~ 300 */ int64_t m_imageFrequency; bool m_imageFrequencyHasBeenSet; /** * 异步回调地址。 */ std::string m_callbackUrl; bool m_callbackUrlHasBeenSet; /** * 临时文件存储位置 */ FileOutput m_segmentOutput; bool m_segmentOutputHasBeenSet; /** * 是否使用OCR,默认为true */ bool m_useOCR; bool m_useOCRHasBeenSet; /** * 是否使用音频。(音频场景下,该值永远为true) */ bool m_useAudio; bool m_useAudioHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_AMS_V20200608_MODEL_MEDIAMODERATIONCONFIG_H_
33.019704
116
0.442936
[ "vector", "model" ]
961d731cea184817bd716a480727e060fbb4e6a4
1,640
h
C
include/Graphics.h
helgrima/shader-system
3574862c8df97f91d8d5fc7e12848e85f92f1c1b
[ "Unlicense" ]
1
2020-03-18T23:13:35.000Z
2020-03-18T23:13:35.000Z
include/Graphics.h
tahtituho/shader-system
1029f673892aacd8612b1d458773a37db067d2ac
[ "Unlicense" ]
29
2018-12-14T20:20:35.000Z
2021-04-11T19:48:41.000Z
include/Graphics.h
tahtituho/shader-system
1029f673892aacd8612b1d458773a37db067d2ac
[ "Unlicense" ]
null
null
null
#ifndef GRAPHICS_H #define GRAPHICS_H #include <GL/glew.h> #include <GLFW/glfw3.h> #include <string> #include <map> #include "lodepng.h" #include "Configuration.h" #include "Synchronizer.h" #include "Textures.h" #include "Logger.h" #include "Variable.h" #include "Camera.h" #include "Vector3.h" namespace DemoSystem { class Graphics { public: Graphics(); ~Graphics(); void initialize(Configuration::Shaders shaders, Configuration::Screen screen, Configuration::Demo demo); void registerSynchronizer(DemoSystem::Synchronizer *synchronizer); void registerTextures(std::list<Textures::Texture> *textures); void registerCamera(DemoSystem::Camera *camera); void registerKeyboardCallback(GLFWkeyfun callback); void registerMouseMoveCallback(GLFWcursorposfun callback); void registerMouseButtonsCallback(GLFWmousebuttonfun callback); void registerLogger(Logger *logger); void initShaders(std::string vertexSource, std::string fragmentSource); void initFrameBuffer(); void render(double time); void requestFullscreen(); void initStop(); bool shouldStop(); void cleanUp(); private: GLFWwindow *window; GLuint program; bool fullscreen; GLuint vertexShader; GLuint fragmentShader; unsigned int VBO, VAO, EBO; DemoSystem::Synchronizer *synchronizer; DemoSystem::Camera *camera; std::list<Textures::Texture> *textures; Logger *logger; void compileShader(const GLenum type, std::string source); }; } #endif
29.818182
112
0.675
[ "render" ]
961f1c91e0b996c52e4e6449a4a1122d153d02fd
734
h
C
source/Framework/Pipeline.h
markridgewell/Teide
def3958012c96ffccdad0a0bcc8a26cb0e2f233a
[ "MIT" ]
1
2021-12-05T23:12:43.000Z
2021-12-05T23:12:43.000Z
source/Framework/Pipeline.h
markridgewell/Teide
def3958012c96ffccdad0a0bcc8a26cb0e2f233a
[ "MIT" ]
null
null
null
source/Framework/Pipeline.h
markridgewell/Teide
def3958012c96ffccdad0a0bcc8a26cb0e2f233a
[ "MIT" ]
null
null
null
#pragma once #include "Framework/Internal/Vulkan.h" #include <vector> struct VertexLayout { vk::PipelineInputAssemblyStateCreateInfo inputAssembly; std::vector<vk::VertexInputBindingDescription> vertexInputBindings; std::vector<vk::VertexInputAttributeDescription> vertexInputAttributes; }; struct RenderStates { vk::Viewport viewport; vk::Rect2D scissor; vk::PipelineRasterizationStateCreateInfo rasterizationState; vk::PipelineDepthStencilStateCreateInfo depthStencilState; vk::PipelineColorBlendAttachmentState colorBlendAttachment; vk::PipelineColorBlendStateCreateInfo colorBlendState; std::vector<vk::DynamicState> dynamicStates; }; struct Pipeline { vk::UniquePipeline pipeline; vk::PipelineLayout layout; };
23.677419
72
0.826975
[ "vector" ]
9624829958d90150493b5bdbaa2e98dc8553a128
29,223
c
C
lib/sphinxbase/src/libsphinxbase/util/cmd_ln.c
robojamison/hello-git
8579e8d342e9d7425fa064585be8e6e9b0e306b1
[ "MIT" ]
null
null
null
lib/sphinxbase/src/libsphinxbase/util/cmd_ln.c
robojamison/hello-git
8579e8d342e9d7425fa064585be8e6e9b0e306b1
[ "MIT" ]
1
2015-04-11T16:07:00.000Z
2015-04-11T16:21:52.000Z
lib/sphinxbase/src/libsphinxbase/util/cmd_ln.c
robojamison/hello-git
8579e8d342e9d7425fa064585be8e6e9b0e306b1
[ "MIT" ]
null
null
null
/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* ==================================================================== * Copyright (c) 1999-2004 Carnegie Mellon 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: * * 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. * * This work was supported in part by funding from the Defense Advanced * Research Projects Agency and the National Science Foundation of the * United States of America, and the CMU Sphinx Speech Consortium. * * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND * ANY EXPRESSED 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 CARNEGIE MELLON UNIVERSITY * NOR ITS EMPLOYEES 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. * * ==================================================================== * */ /* * cmd_ln.c -- Command line argument parsing. * * ********************************************** * CMU ARPA Speech Project * * Copyright (c) 1999 Carnegie Mellon University. * ALL RIGHTS RESERVED. * ********************************************** * * HISTORY * * 10-Sep-1998 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University * Changed strcasecmp() call in cmp_name() to strcmp_nocase() call. * * 15-Jul-1997 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University * Added required arguments handling. * * 07-Dec-96 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University * Created, based on Eric's implementation. Basically, combined several * functions into one, eliminated validation, and simplified the interface. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #ifdef _MSC_VER #pragma warning (disable: 4996 4018) #endif #ifdef HAVE_CONFIG_H #include <config.h> #endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #include "sphinxbase/cmd_ln.h" #include "sphinxbase/err.h" #include "sphinxbase/ckd_alloc.h" #include "sphinxbase/hash_table.h" #include "sphinxbase/case.h" #include "sphinxbase/strfuncs.h" typedef struct cmd_ln_val_s { anytype_t val; int type; } cmd_ln_val_t; struct cmd_ln_s { int refcount; hash_table_t *ht; char **f_argv; uint32 f_argc; }; /** Global command-line, for non-reentrant API. */ cmd_ln_t *global_cmdln; static void arg_dump_r(cmd_ln_t *, FILE *, arg_t const *, int32); static cmd_ln_t * parse_options(cmd_ln_t *, const arg_t *, int32, char* [], int32); /* * Find max length of name and default fields in the given defn array. * Return #items in defn array. */ static int32 arg_strlen(const arg_t * defn, int32 * namelen, int32 * deflen) { int32 i, l; *namelen = *deflen = 0; for (i = 0; defn[i].name; i++) { l = strlen(defn[i].name); if (*namelen < l) *namelen = l; if (defn[i].deflt) l = strlen(defn[i].deflt); else l = strlen("(null)"); /* E_INFO("string default, %s , name %s, length %d\n",defn[i].deflt,defn[i].name,l); */ if (*deflen < l) *deflen = l; } return i; } static int32 cmp_name(const void *a, const void *b) { return (strcmp_nocase ((* (arg_t**) a)->name, (* (arg_t**) b)->name)); } static arg_t const ** arg_sort(const arg_t * defn, int32 n) { const arg_t ** pos; int32 i; pos = (arg_t const **) ckd_calloc(n, sizeof(arg_t *)); for (i = 0; i < n; ++i) pos[i] = &defn[i]; qsort(pos, n, sizeof(arg_t *), cmp_name); return pos; } static size_t strnappend(char **dest, size_t *dest_allocation, const char *source, size_t n) { size_t source_len, required_allocation; if (dest == NULL || dest_allocation == NULL) return -1; if (*dest == NULL && *dest_allocation != 0) return -1; if (source == NULL) return *dest_allocation; source_len = strlen(source); if (n && n < source_len) source_len = n; required_allocation = (*dest ? strlen(*dest) : 0) + source_len + 1; if (*dest_allocation < required_allocation) { if (*dest_allocation == 0) { *dest = (char *)ckd_calloc(required_allocation * 2, 1); } else { *dest = (char *)ckd_realloc(*dest, required_allocation * 2); } *dest_allocation = required_allocation * 2; } strncat(*dest, source, source_len); return *dest_allocation; } static size_t strappend(char **dest, size_t *dest_allocation, const char *source) { return strnappend(dest, dest_allocation, source, 0); } static char* arg_resolve_env(const char *str) { char *resolved_str = NULL; char env_name[100]; const char *env_val; size_t alloced = 0; const char *i = str, *j; /* calculate required resolved_str size */ do { j = strstr(i, "$("); if (j != NULL) { if (j != i) { strnappend(&resolved_str, &alloced, i, j - i); i = j; } j = strchr(i + 2, ')'); if (j != NULL) { if (j - (i + 2) < 100) { strncpy(env_name, i + 2, j - (i + 2)); env_name[j - (i + 2)] = '\0'; #if !defined(_WIN32_WCE) env_val = getenv(env_name); if (env_val) strappend(&resolved_str, &alloced, env_val); #else env_val = 0; #endif } i = j + 1; } else { /* unclosed, copy and skip */ j = i + 2; strnappend(&resolved_str, &alloced, i, j - i); i = j; } } else { strappend(&resolved_str, &alloced, i); } } while(j != NULL); return resolved_str; } static void arg_dump_r(cmd_ln_t *cmdln, FILE *fp, const arg_t * defn, int32 doc) { arg_t const **pos; int32 i, n; size_t l; int32 namelen, deflen; anytype_t *vp; char const **array; /* No definitions, do nothing. */ if (defn == NULL || fp == NULL) return; /* Find max lengths of name and default value fields, and #entries in defn */ n = arg_strlen(defn, &namelen, &deflen); /* E_INFO("String length %d. Name length %d, Default Length %d\n",n, namelen, deflen); */ namelen = namelen & 0xfffffff8; /* Previous tab position */ deflen = deflen & 0xfffffff8; /* Previous tab position */ fprintf(fp, "[NAME]"); for (l = strlen("[NAME]"); l < namelen; l += 8) fprintf(fp, "\t"); fprintf(fp, "\t[DEFLT]"); for (l = strlen("[DEFLT]"); l < deflen; l += 8) fprintf(fp, "\t"); if (doc) { fprintf(fp, "\t[DESCR]\n"); } else { fprintf(fp, "\t[VALUE]\n"); } /* Print current configuration, sorted by name */ pos = arg_sort(defn, n); for (i = 0; i < n; i++) { fprintf(fp, "%s", pos[i]->name); for (l = strlen(pos[i]->name); l < namelen; l += 8) fprintf(fp, "\t"); fprintf(fp, "\t"); if (pos[i]->deflt) { fprintf(fp, "%s", pos[i]->deflt); l = strlen(pos[i]->deflt); } else l = 0; for (; l < deflen; l += 8) fprintf(fp, "\t"); fprintf(fp, "\t"); if (doc) { if (pos[i]->doc) fprintf(fp, "%s", pos[i]->doc); } else { vp = cmd_ln_access_r(cmdln, pos[i]->name); if (vp) { switch (pos[i]->type) { case ARG_INTEGER: case REQARG_INTEGER: fprintf(fp, "%ld", vp->i); break; case ARG_FLOATING: case REQARG_FLOATING: fprintf(fp, "%e", vp->fl); break; case ARG_STRING: case REQARG_STRING: if (vp->ptr) fprintf(fp, "%s", (char *)vp->ptr); break; case ARG_STRING_LIST: array = (char const**)vp->ptr; if (array) for (l = 0; array[l] != 0; l++) { fprintf(fp, "%s,", array[l]); } break; case ARG_BOOLEAN: case REQARG_BOOLEAN: fprintf(fp, "%s", vp->i ? "yes" : "no"); break; default: E_ERROR("Unknown argument type: %d\n", pos[i]->type); } } } fprintf(fp, "\n"); } ckd_free(pos); fprintf(fp, "\n"); } static char ** parse_string_list(const char *str) { int count, i, j; const char *p; char **result; p = str; count = 1; while (*p) { if (*p == ',') count++; p++; } /* Should end with NULL */ result = (char **) ckd_calloc(count + 1, sizeof(char *)); p = str; for (i = 0; i < count; i++) { for (j = 0; p[j] != ',' && p[j] != 0; j++); result[i] = (char *)ckd_calloc(j + 1, sizeof(char)); strncpy( result[i], p, j); p = p + j + 1; } return result; } static cmd_ln_val_t * cmd_ln_val_init(int t, const char *str) { cmd_ln_val_t *v; anytype_t val; char *e_str; if (!str) { /* For lack of a better default value. */ memset(&val, 0, sizeof(val)); } else { int valid = 1; e_str = arg_resolve_env(str); switch (t) { case ARG_INTEGER: case REQARG_INTEGER: if (sscanf(e_str, "%ld", &val.i) != 1) valid = 0; break; case ARG_FLOATING: case REQARG_FLOATING: if (e_str == NULL || e_str[0] == 0) valid = 0; val.fl = atof_c(e_str); break; case ARG_BOOLEAN: case REQARG_BOOLEAN: if ((e_str[0] == 'y') || (e_str[0] == 't') || (e_str[0] == 'Y') || (e_str[0] == 'T') || (e_str[0] == '1')) { val.i = TRUE; } else if ((e_str[0] == 'n') || (e_str[0] == 'f') || (e_str[0] == 'N') || (e_str[0] == 'F') | (e_str[0] == '0')) { val.i = FALSE; } else { E_ERROR("Unparsed boolean value '%s'\n", str); valid = 0; } break; case ARG_STRING: case REQARG_STRING: val.ptr = ckd_salloc(e_str); break; case ARG_STRING_LIST: val.ptr = parse_string_list(e_str); break; default: E_ERROR("Unknown argument type: %d\n", t); valid = 0; } ckd_free(e_str); if (valid == 0) return NULL; } v = (cmd_ln_val_t *)ckd_calloc(1, sizeof(*v)); memcpy(v, &val, sizeof(val)); v->type = t; return v; } /* * Handles option parsing for cmd_ln_parse_file_r() and cmd_ln_init() * also takes care of storing argv. * DO NOT call it from cmd_ln_parse_r() */ static cmd_ln_t * parse_options(cmd_ln_t *cmdln, const arg_t *defn, int32 argc, char* argv[], int32 strict) { cmd_ln_t *new_cmdln; new_cmdln = cmd_ln_parse_r(cmdln, defn, argc, argv, strict); /* If this failed then clean up and return NULL. */ if (new_cmdln == NULL) { int32 i; for (i = 0; i < argc; ++i) ckd_free(argv[i]); ckd_free(argv); return NULL; } /* Otherwise, we need to add the contents of f_argv to the new object. */ if (new_cmdln == cmdln) { /* If we are adding to a previously passed-in cmdln, then * store our allocated strings in its f_argv. */ new_cmdln->f_argv = (char **)ckd_realloc(new_cmdln->f_argv, (new_cmdln->f_argc + argc) * sizeof(*new_cmdln->f_argv)); memcpy(new_cmdln->f_argv + new_cmdln->f_argc, argv, argc * sizeof(*argv)); ckd_free(argv); new_cmdln->f_argc += argc; } else { /* Otherwise, store f_argc and f_argv. */ new_cmdln->f_argc = argc; new_cmdln->f_argv = argv; } return new_cmdln; } void cmd_ln_val_free(cmd_ln_val_t *val) { int i; if (val->type & ARG_STRING_LIST) { char ** array = (char **)val->val.ptr; if (array) { for (i = 0; array[i] != NULL; i++) { ckd_free(array[i]); } ckd_free(array); } } if (val->type & ARG_STRING) ckd_free(val->val.ptr); ckd_free(val); } cmd_ln_t * cmd_ln_get(void) { return global_cmdln; } void cmd_ln_appl_enter(int argc, char *argv[], const char *default_argfn, const arg_t * defn) { /* Look for default or specified arguments file */ const char *str; str = NULL; if ((argc == 2) && (strcmp(argv[1], "help") == 0)) { cmd_ln_print_help(stderr, defn); exit(1); } if ((argc == 2) && (argv[1][0] != '-')) str = argv[1]; else if (argc == 1) { FILE *fp; E_INFO("Looking for default argument file: %s\n", default_argfn); if ((fp = fopen(default_argfn, "r")) == NULL) { E_INFO("Can't find default argument file %s.\n", default_argfn); } else { str = default_argfn; } if (fp != NULL) fclose(fp); } if (str) { /* Build command line argument list from file */ E_INFO("Parsing command lines from file %s\n", str); if (cmd_ln_parse_file(defn, str, TRUE)) { E_INFOCONT("Usage:\n"); E_INFOCONT("\t%s argument-list, or\n", argv[0]); E_INFOCONT("\t%s [argument-file] (default file: . %s)\n\n", argv[0], default_argfn); cmd_ln_print_help(stderr, defn); exit(1); } } else { cmd_ln_parse(defn, argc, argv, TRUE); } } void cmd_ln_appl_exit() { cmd_ln_free(); } cmd_ln_t * cmd_ln_parse_r(cmd_ln_t *inout_cmdln, const arg_t * defn, int32 argc, char *argv[], int strict) { int32 i, j, n, argstart; hash_table_t *defidx = NULL; cmd_ln_t *cmdln; /* Construct command-line object */ if (inout_cmdln == NULL) { cmdln = (cmd_ln_t*)ckd_calloc(1, sizeof(*cmdln)); cmdln->refcount = 1; } else cmdln = inout_cmdln; /* Build a hash table for argument definitions */ defidx = hash_table_new(50, 0); if (defn) { for (n = 0; defn[n].name; n++) { void *v; v = hash_table_enter(defidx, defn[n].name, (void *)&defn[n]); if (strict && (v != &defn[n])) { E_ERROR("Duplicate argument name in definition: %s\n", defn[n].name); goto error; } } } else { /* No definitions. */ n = 0; } /* Allocate memory for argument values */ if (cmdln->ht == NULL) cmdln->ht = hash_table_new(n, 0 /* argument names are case-sensitive */ ); /* skip argv[0] if it doesn't start with dash */ argstart = 0; if (argc > 0 && argv[0][0] != '-') { argstart = 1; } /* Parse command line arguments (name-value pairs) */ for (j = argstart; j < argc; j += 2) { arg_t *argdef; cmd_ln_val_t *val; void *v; if (hash_table_lookup(defidx, argv[j], &v) < 0) { if (strict) { E_ERROR("Unknown argument name '%s'\n", argv[j]); goto error; } else if (defn == NULL) v = NULL; else continue; } argdef = (arg_t *)v; /* Enter argument value */ if (j + 1 >= argc) { cmd_ln_print_help_r(cmdln, stderr, defn); E_ERROR("Argument value for '%s' missing\n", argv[j]); goto error; } if (argdef == NULL) val = cmd_ln_val_init(ARG_STRING, argv[j + 1]); else { if ((val = cmd_ln_val_init(argdef->type, argv[j + 1])) == NULL) { cmd_ln_print_help_r(cmdln, stderr, defn); E_ERROR("Bad argument value for %s: %s\n", argv[j], argv[j + 1]); goto error; } } if ((v = hash_table_enter(cmdln->ht, argv[j], (void *)val)) != (void *)val) { if (strict) { cmd_ln_val_free(val); E_ERROR("Duplicate argument name in arguments: %s\n", argdef->name); goto error; } else { v = hash_table_replace(cmdln->ht, argv[j], (void *)val); cmd_ln_val_free((cmd_ln_val_t *)v); } } } /* Fill in default values, if any, for unspecified arguments */ for (i = 0; i < n; i++) { cmd_ln_val_t *val; void *v; if (hash_table_lookup(cmdln->ht, defn[i].name, &v) < 0) { if ((val = cmd_ln_val_init(defn[i].type, defn[i].deflt)) == NULL) { E_ERROR ("Bad default argument value for %s: %s\n", defn[i].name, defn[i].deflt); goto error; } hash_table_enter(cmdln->ht, defn[i].name, (void *)val); } } /* Check for required arguments; exit if any missing */ j = 0; for (i = 0; i < n; i++) { if (defn[i].type & ARG_REQUIRED) { void *v; if (hash_table_lookup(cmdln->ht, defn[i].name, &v) != 0) E_ERROR("Missing required argument %s\n", defn[i].name); } } if (j > 0) { cmd_ln_print_help_r(cmdln, stderr, defn); goto error; } if (strict && argc == 1) { E_ERROR("No arguments given, available options are:\n"); cmd_ln_print_help_r(cmdln, stderr, defn); if (defidx) hash_table_free(defidx); if (inout_cmdln == NULL) cmd_ln_free_r(cmdln); return NULL; } #ifndef _WIN32_WCE /* Set up logging. We need to do this earlier because we want to dump * the information to the configured log, not to the stderr. */ if (cmd_ln_exists_r(cmdln, "-logfn") && cmd_ln_str_r(cmdln, "-logfn")) { if (err_set_logfile(cmd_ln_str_r(cmdln, "-logfn")) < 0) E_FATAL_SYSTEM("cannot redirect log output"); } /* Echo command line */ E_INFO("Parsing command line:\n"); for (i = 0; i < argc; i++) { if (argv[i][0] == '-') E_INFOCONT("\\\n\t"); E_INFOCONT("%s ", argv[i]); } E_INFOCONT("\n\n"); /* Print configuration */ E_INFOCONT("Current configuration:\n"); arg_dump_r(cmdln, err_get_logfp(), defn, 0); #endif hash_table_free(defidx); return cmdln; error: if (defidx) hash_table_free(defidx); if (inout_cmdln == NULL) cmd_ln_free_r(cmdln); E_ERROR("Failed to parse arguments list\n"); return NULL; } cmd_ln_t * cmd_ln_init(cmd_ln_t *inout_cmdln, const arg_t *defn, int32 strict, ...) { va_list args; const char *arg, *val; char **f_argv; int32 f_argc; va_start(args, strict); f_argc = 0; while ((arg = va_arg(args, const char *))) { ++f_argc; val = va_arg(args, const char*); if (val == NULL) { E_ERROR("Number of arguments must be even!\n"); return NULL; } ++f_argc; } va_end(args); /* Now allocate f_argv */ f_argv = (char**)ckd_calloc(f_argc, sizeof(*f_argv)); va_start(args, strict); f_argc = 0; while ((arg = va_arg(args, const char *))) { f_argv[f_argc] = ckd_salloc(arg); ++f_argc; val = va_arg(args, const char*); f_argv[f_argc] = ckd_salloc(val); ++f_argc; } va_end(args); return parse_options(inout_cmdln, defn, f_argc, f_argv, strict); } int cmd_ln_parse(const arg_t * defn, int32 argc, char *argv[], int strict) { cmd_ln_t *cmdln; cmdln = cmd_ln_parse_r(global_cmdln, defn, argc, argv, strict); if (cmdln == NULL) { /* Old, bogus behaviour... */ E_ERROR("Failed to parse arguments list, forced exit\n"); exit(-1); } /* Initialize global_cmdln if not present. */ if (global_cmdln == NULL) { global_cmdln = cmdln; } return 0; } cmd_ln_t * cmd_ln_parse_file_r(cmd_ln_t *inout_cmdln, const arg_t * defn, const char *filename, int32 strict) { FILE *file; int argc; int argv_size; char *str; int arg_max_length = 512; int len = 0; int quoting, ch; char **f_argv; int rv = 0; const char separator[] = " \t\r\n"; if ((file = fopen(filename, "r")) == NULL) { E_ERROR("Cannot open configuration file %s for reading\n", filename); return NULL; } ch = fgetc(file); /* Skip to the next interesting character */ for (; ch != EOF && strchr(separator, ch); ch = fgetc(file)) ; if (ch == EOF) { fclose(file); return NULL; } /* * Initialize default argv, argc, and argv_size. */ argv_size = 10; argc = 0; f_argv = (char **)ckd_calloc(argv_size, sizeof(char *)); /* Silently make room for \0 */ str = (char* )ckd_calloc(arg_max_length + 1, sizeof(char)); quoting = 0; do { /* Handle arguments that are commented out */ if (len == 0 && argc % 2 == 0) { while (ch == '#') { /* Skip everything until newline */ for (ch = fgetc(file); ch != EOF && ch != '\n'; ch = fgetc(file)) ; /* Skip to the next interesting character */ for (ch = fgetc(file); ch != EOF && strchr(separator, ch); ch = fgetc(file)) ; } /* Check if we are at the last line (without anything interesting in it) */ if (ch == EOF) break; } /* Handle quoted arguments */ if (ch == '"' || ch == '\'') { if (quoting == ch) /* End a quoted section with the same type */ quoting = 0; else if (quoting) { E_ERROR("Nesting quotations is not supported!\n"); rv = 1; break; } else quoting = ch; /* Start a quoted section */ } else if (ch == EOF || (!quoting && strchr(separator, ch))) { /* Reallocate argv so it is big enough to contain all the arguments */ if (argc >= argv_size) { char **tmp_argv; if (!(tmp_argv = (char **)ckd_realloc(f_argv, argv_size * 2 * sizeof(char *)))) { rv = 1; break; } f_argv = tmp_argv; argv_size *= 2; } /* Add the string to the list of arguments */ f_argv[argc] = ckd_salloc(str); len = 0; str[0] = '\0'; argc++; if (quoting) E_WARN("Unclosed quotation, having EOF close it...\n"); /* Skip to the next interesting character */ for (; ch != EOF && strchr(separator, ch); ch = fgetc(file)) ; if (ch == EOF) break; /* We already have the next character */ continue; } else { if (len >= arg_max_length) { /* Make room for more chars (including the \0 !) */ char *tmp_str = str; if ((tmp_str = (char *)ckd_realloc(str, (1 + arg_max_length * 2) * sizeof(char))) == NULL) { rv = 1; break; } str = tmp_str; arg_max_length *= 2; } /* Add the char to the argument string */ str[len++] = ch; /* Always null terminate */ str[len] = '\0'; } ch = fgetc(file); } while (1); fclose(file); ckd_free(str); if (rv) { for (ch = 0; ch < argc; ++ch) ckd_free(f_argv[ch]); ckd_free(f_argv); return NULL; } return parse_options(inout_cmdln, defn, argc, f_argv, strict); } int cmd_ln_parse_file(const arg_t * defn, const char *filename, int32 strict) { cmd_ln_t *cmdln; cmdln = cmd_ln_parse_file_r(global_cmdln, defn, filename, strict); if (cmdln == NULL) { return -1; } /* Initialize global_cmdln if not present. */ if (global_cmdln == NULL) { global_cmdln = cmdln; } return 0; } void cmd_ln_print_help_r(cmd_ln_t *cmdln, FILE *fp, arg_t const* defn) { if (defn == NULL) return; fprintf(fp, "Arguments list definition:\n"); arg_dump_r(cmdln, fp, defn, 1); } int cmd_ln_exists_r(cmd_ln_t *cmdln, const char *name) { void *val; if (cmdln == NULL) return FALSE; return (hash_table_lookup(cmdln->ht, name, &val) == 0); } anytype_t * cmd_ln_access_r(cmd_ln_t *cmdln, const char *name) { void *val; if (hash_table_lookup(cmdln->ht, name, &val) < 0) { E_ERROR("Unknown argument: %s\n", name); return NULL; } return (anytype_t *)val; } char const * cmd_ln_str_r(cmd_ln_t *cmdln, char const *name) { anytype_t *val; val = cmd_ln_access_r(cmdln, name); if (val == NULL) return NULL; return (char const *)val->ptr; } char const ** cmd_ln_str_list_r(cmd_ln_t *cmdln, char const *name) { anytype_t *val; val = cmd_ln_access_r(cmdln, name); if (val == NULL) return NULL; return (char const **)val->ptr; } long cmd_ln_int_r(cmd_ln_t *cmdln, char const *name) { anytype_t *val; val = cmd_ln_access_r(cmdln, name); if (val == NULL) return 0L; return val->i; } double cmd_ln_float_r(cmd_ln_t *cmdln, char const *name) { anytype_t *val; val = cmd_ln_access_r(cmdln, name); if (val == NULL) return 0.0; return val->fl; } void cmd_ln_set_str_r(cmd_ln_t *cmdln, char const *name, char const *str) { anytype_t *val; val = cmd_ln_access_r(cmdln, name); if (val == NULL) { E_ERROR("Unknown argument: %s\n", name); return; } ckd_free(val->ptr); if (str == NULL) val->ptr = NULL; else val->ptr = ckd_salloc(str); } void cmd_ln_set_int_r(cmd_ln_t *cmdln, char const *name, long iv) { anytype_t *val; val = cmd_ln_access_r(cmdln, name); if (val == NULL) { E_ERROR("Unknown argument: %s\n", name); return; } val->i = iv; } void cmd_ln_set_float_r(cmd_ln_t *cmdln, char const *name, double fv) { anytype_t *val; val = cmd_ln_access_r(cmdln, name); if (val == NULL) { E_ERROR("Unknown argument: %s\n", name); return; } val->fl = fv; } cmd_ln_t * cmd_ln_retain(cmd_ln_t *cmdln) { ++cmdln->refcount; return cmdln; } int cmd_ln_free_r(cmd_ln_t *cmdln) { if (cmdln == NULL) return 0; if (--cmdln->refcount > 0) return cmdln->refcount; if (cmdln->ht) { glist_t entries; gnode_t *gn; int32 n; entries = hash_table_tolist(cmdln->ht, &n); for (gn = entries; gn; gn = gnode_next(gn)) { hash_entry_t *e = (hash_entry_t *)gnode_ptr(gn); cmd_ln_val_free((cmd_ln_val_t *)e->val); } glist_free(entries); hash_table_free(cmdln->ht); cmdln->ht = NULL; } if (cmdln->f_argv) { int32 i; for (i = 0; i < cmdln->f_argc; ++i) { ckd_free(cmdln->f_argv[i]); } ckd_free(cmdln->f_argv); cmdln->f_argv = NULL; cmdln->f_argc = 0; } ckd_free(cmdln); return 0; } void cmd_ln_free(void) { cmd_ln_free_r(global_cmdln); global_cmdln = NULL; } /* vim: set ts=4 sw=4: */
26.98338
108
0.516545
[ "object" ]
96294c2456853ee82b73c23496cfd33d8bce2236
5,582
h
C
TED/include/localTecSim.h
jingwei87/ted
112ec68b33fd00b4adb89c99af2fe94a9376da47
[ "MIT" ]
4
2020-03-04T18:36:23.000Z
2021-06-11T10:25:25.000Z
TED/include/localTecSim.h
XieQingfeng/ted
a91673c4786f2252230bb5dd317e402766176ec0
[ "MIT" ]
null
null
null
TED/include/localTecSim.h
XieQingfeng/ted
a91673c4786f2252230bb5dd317e402766176ec0
[ "MIT" ]
3
2020-11-22T23:29:52.000Z
2021-11-05T14:00:29.000Z
/// \file localTecSim.h /// \author Zuoru YANG (zryang@cse.cuhk.edu.hk) /// \brief define the interface of local tec simulator /// \version 0.1 /// \date 2019-07-12 /// /// \copyright Copyright (c) 2019 /// #ifndef __LOCAL_TEC_SIM_H__ #define __LOCAL_TEC_SIM_H__ #include "sim.h" #include "sparsepp/spp.h" /**for in memory hash table */ #include "optSolver.h" #include "countMin.h" #include "randomGen.h" #include <unordered_set> #include <sys/time.h> class LocalTECSim : public Simulator { protected: /// \brief key generation process according to different threshold in a region /// /// \param chunkHash - chunk hash /// \param chunkHashLen - the length of chunk hash /// \param chunkSize - chunk size /// \param key - generated encryption key <return> /// \param threshold - the threshold during this region void LocalKeyGen(uint8_t* const chunkHash, size_t chunkHashLen, uint64_t const chunkSize, uint8_t key[sizeof(int)], uint32_t threshold); /// \brief update the state according to the incoming chunk in global hash table /// /// \param chunkHash - chunk hash /// \param chunkHashLen - the length of chunk hash /// \param chunkSize - chunk size void GlobalUpdateState(uint8_t* const chunkHash, size_t chunkHashLen, uint64_t const chunkSize); /// \brief update the state according to the incoming chunk in local hash table /// /// \param chunkHash - chunk hash /// \param chunkHashLen - the length of chunk hash /// \param chunkSize - chunk size void LocalUpdateState(uint8_t* const chunkHash, size_t chunkHashLen, uint64_t const chunkSize); inline void LocalHashTableCleanUp() { localKeyFreqTable_.clear(); } /// \brief simulate the encryption process: directly append the (frequency / T) to the /// end of hash /// /// \param msg - the original input message /// \param msgLen - the length of message /// \param key - the encryption key /// \param keyLen - the length of the encrytion key /// \param output void SimTECEncrypt(uint8_t* const msg, size_t const msgLen, uint8_t* const key, size_t const keyLen, uint8_t output[FP_SIZE + sizeof(int) + 1]); /**the size of the region to do optimization*/ size_t regionSize_; /**the hash table for solving the optimization*/ spp::sparse_hash_map<std::string, uint64_t> localKeyFreqTable_; /**the hash table for fast count information*/ spp::sparse_hash_map<std::string, uint64_t> globalKeyFreqTable_; /**local logical chunk counter*/ size_t localCounter_; /**global logical chunk counter*/ size_t globalCounter_; /**the batch size of each optimization unit*/ size_t batchSize_ = 0; /**the array to store threshold */ vector<uint32_t> thresholdArray_; /**storage blowup rate: [0, 1] */ double blowUpRate_; /**sketch */ CountMinSketch* cmSketch_; /**optimization solving times */ uint32_t solveTimes_ = 0; /**total solving time*/ uint64_t totalTime_ = 0; /**probalisitic option */ bool enablePro = false; /**a random number generator */ RandomGen* randomNumGen_; /**the type of distribution of random number */ int distriType_; public: /// \brief Construct a new LocalTECSim object /// LocalTECSim() { fprintf(stderr, "Initialize Local Tunable Encryption Simulator.\n"); cmSketch_ = new CountMinSketch(SKETCH_WIDTH, SKETCH_DEPTH); } /// \brief Destroy the LocalTECSim object /// ~LocalTECSim() { fprintf(stderr, "Start to destory Local Tunable Encryption Simulator.\n"); delete cmSketch_; } /// \brief Set the Region Size object /// /// \param regionSize - size of optimization region inline void SetRegionSize(int regionSize) { regionSize_ = regionSize; } inline void SetBlowUpRate(double blowUpRate) { blowUpRate_ = blowUpRate; } /// \brief process an input hash file for encryption /// /// \param inputFileName - the input file name /// \param outputFileName - the output file name void ProcessHashFile(std::string const inputFileName, std::string const outputFileName); /// \brief process an input hash file of encryption incremental local /// /// \param inputFileName - the input file name /// \param ouputFileName - the output file name void ProcessHashFileLocal(std::string const inputFileName, std::string const ouputFileName); /// \brief Set the Batch Size object /// /// \param batchSize - the batch size inline void SetBatchSize(size_t batchSize) { batchSize_ = batchSize; } /// \brief enable probalistic key generation /// /// \param type inline void EnablePro() { enablePro = true; } /// \brief Set the Probabilistic number generator /// inline void SetDistri(int type) { distriType_ = type; randomNumGen_ = new RandomGen(); } }; #endif // !__LOCAL_TEC_SIM_H__
32.643275
95
0.604085
[ "object", "vector" ]
962a09170b47b3bfd71fc59daf28bee993a7768e
1,606
h
C
tools/test/misc/vds/UC_common.h
mannau/hdf5
baf67a0ee99b484d09411d177670018a803960d3
[ "BSD-3-Clause-LBNL" ]
1
2021-09-29T20:43:03.000Z
2021-09-29T20:43:03.000Z
tools/test/misc/vds/UC_common.h
mannau/hdf5
baf67a0ee99b484d09411d177670018a803960d3
[ "BSD-3-Clause-LBNL" ]
1
2021-09-29T20:42:47.000Z
2021-10-12T21:40:57.000Z
tools/test/misc/vds/UC_common.h
mannau/hdf5
baf67a0ee99b484d09411d177670018a803960d3
[ "BSD-3-Clause-LBNL" ]
1
2018-10-26T22:56:15.000Z
2018-10-26T22:56:15.000Z
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * 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 COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef USE_CASE_COMMON_H #define USE_CASE_COMMON_H /****************************************** * Symbols used across multiple use cases * ******************************************/ /* All datasets are 3D */ #define RANK 3 /* Lengths of string identifiers (file, dataset names, etc.) */ #define NAME_LEN 32 /* Compression level */ #define COMPRESSION_LEVEL 7 /* Booleans */ #define TRUE 1 #define FALSE 0 /* Testing macros */ #define AT() printf (" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); #define UC_ERROR {puts("*ERROR*"); fflush(stdout); AT(); goto error;} #endif /* USE_CASE_COMMON_H */
40.15
86
0.468244
[ "3d" ]
962a89a8e763b0ac0770cb495650b0808c2e4cfc
3,675
h
C
src/Common/NamePrompter.h
chalice19/ClickHouse
2f38e7bc5c2113935ab86260439bb543a1737291
[ "Apache-2.0" ]
8,629
2016-06-14T21:03:01.000Z
2019-09-23T07:46:38.000Z
src/Common/NamePrompter.h
chalice19/ClickHouse
2f38e7bc5c2113935ab86260439bb543a1737291
[ "Apache-2.0" ]
4,335
2016-06-15T12:58:31.000Z
2019-09-23T11:18:43.000Z
src/Common/NamePrompter.h
chalice19/ClickHouse
2f38e7bc5c2113935ab86260439bb543a1737291
[ "Apache-2.0" ]
1,700
2016-06-15T09:25:11.000Z
2019-09-23T11:16:38.000Z
#pragma once #include <base/types.h> #include <Common/PODArray.h> #include <algorithm> #include <cctype> #include <cmath> #include <memory> #include <queue> #include <utility> namespace DB { template <size_t MaxNumHints> class NamePrompter { public: using DistanceIndex = std::pair<size_t, size_t>; using DistanceIndexQueue = std::priority_queue<DistanceIndex>; static std::vector<String> getHints(const String & name, const std::vector<String> & prompting_strings) { DistanceIndexQueue queue; for (size_t i = 0; i < prompting_strings.size(); ++i) appendToQueue(i, name, queue, prompting_strings); return release(queue, prompting_strings); } private: static size_t levenshteinDistance(const String & lhs, const String & rhs) { size_t m = lhs.size(); size_t n = rhs.size(); PODArrayWithStackMemory<size_t, 64> row(n + 1); for (size_t i = 1; i <= n; ++i) row[i] = i; for (size_t j = 1; j <= m; ++j) { row[0] = j; size_t prev = j - 1; for (size_t i = 1; i <= n; ++i) { size_t old = row[i]; row[i] = std::min(prev + (std::tolower(lhs[j - 1]) != std::tolower(rhs[i - 1])), std::min(row[i - 1], row[i]) + 1); prev = old; } } return row[n]; } static void appendToQueue(size_t ind, const String & name, DistanceIndexQueue & queue, const std::vector<String> & prompting_strings) { const String & prompt = prompting_strings[ind]; /// Clang SimpleTypoCorrector logic const size_t min_possible_edit_distance = std::abs(static_cast<int64_t>(name.size()) - static_cast<int64_t>(prompt.size())); const size_t mistake_factor = (name.size() + 2) / 3; if (min_possible_edit_distance > 0 && name.size() / min_possible_edit_distance < 3) return; if (prompt.size() <= name.size() + mistake_factor && prompt.size() + mistake_factor >= name.size()) { size_t distance = levenshteinDistance(prompt, name); if (distance <= mistake_factor) { queue.emplace(distance, ind); if (queue.size() > MaxNumHints) queue.pop(); } } } static std::vector<String> release(DistanceIndexQueue & queue, const std::vector<String> & prompting_strings) { std::vector<String> answer; answer.reserve(queue.size()); while (!queue.empty()) { auto top = queue.top(); queue.pop(); answer.push_back(prompting_strings[top.second]); } std::reverse(answer.begin(), answer.end()); return answer; } }; namespace detail { void appendHintsMessageImpl(String & message, const std::vector<String> & hints); } template <size_t MaxNumHints, typename Self> class IHints { public: virtual std::vector<String> getAllRegisteredNames() const = 0; std::vector<String> getHints(const String & name) const { return prompter.getHints(name, getAllRegisteredNames()); } void appendHintsMessage(String & message, const String & name) const { auto hints = getHints(name); detail::appendHintsMessageImpl(message, hints); } IHints() = default; IHints(const IHints &) = default; IHints(IHints &&) noexcept = default; IHints & operator=(const IHints &) = default; IHints & operator=(IHints &&) noexcept = default; virtual ~IHints() = default; private: NamePrompter<MaxNumHints> prompter; }; }
28.710938
137
0.589116
[ "vector" ]
9632df74781c1fb2ccb846befb9cbc7f78f7dfed
431,206
h
C
third_party/skia_m63/win10/Include/10.0.14393.0/um/MSClus.h
kniefliu/Win32Samples
37cef26b5dbf4300cea54b931f60be6664e15bbc
[ "MIT" ]
5
2020-05-29T06:22:17.000Z
2021-11-28T08:21:38.000Z
third_party/skia_m63/win10/Include/10.0.14393.0/um/MSClus.h
kniefliu/Win32Samples
37cef26b5dbf4300cea54b931f60be6664e15bbc
[ "MIT" ]
null
null
null
third_party/skia_m63/win10/Include/10.0.14393.0/um/MSClus.h
kniefliu/Win32Samples
37cef26b5dbf4300cea54b931f60be6664e15bbc
[ "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.0618 */ /* @@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 __msclus_h__ #define __msclus_h__ #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif /* Forward Declarations */ #ifndef __ClusApplication_FWD_DEFINED__ #define __ClusApplication_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusApplication ClusApplication; #else typedef struct ClusApplication ClusApplication; #endif /* __cplusplus */ #endif /* __ClusApplication_FWD_DEFINED__ */ #ifndef __Cluster_FWD_DEFINED__ #define __Cluster_FWD_DEFINED__ #ifdef __cplusplus typedef class Cluster Cluster; #else typedef struct Cluster Cluster; #endif /* __cplusplus */ #endif /* __Cluster_FWD_DEFINED__ */ #ifndef __ClusVersion_FWD_DEFINED__ #define __ClusVersion_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusVersion ClusVersion; #else typedef struct ClusVersion ClusVersion; #endif /* __cplusplus */ #endif /* __ClusVersion_FWD_DEFINED__ */ #ifndef __ClusResType_FWD_DEFINED__ #define __ClusResType_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResType ClusResType; #else typedef struct ClusResType ClusResType; #endif /* __cplusplus */ #endif /* __ClusResType_FWD_DEFINED__ */ #ifndef __ClusProperty_FWD_DEFINED__ #define __ClusProperty_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusProperty ClusProperty; #else typedef struct ClusProperty ClusProperty; #endif /* __cplusplus */ #endif /* __ClusProperty_FWD_DEFINED__ */ #ifndef __ClusProperties_FWD_DEFINED__ #define __ClusProperties_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusProperties ClusProperties; #else typedef struct ClusProperties ClusProperties; #endif /* __cplusplus */ #endif /* __ClusProperties_FWD_DEFINED__ */ #ifndef __DomainNames_FWD_DEFINED__ #define __DomainNames_FWD_DEFINED__ #ifdef __cplusplus typedef class DomainNames DomainNames; #else typedef struct DomainNames DomainNames; #endif /* __cplusplus */ #endif /* __DomainNames_FWD_DEFINED__ */ #ifndef __ClusNetwork_FWD_DEFINED__ #define __ClusNetwork_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusNetwork ClusNetwork; #else typedef struct ClusNetwork ClusNetwork; #endif /* __cplusplus */ #endif /* __ClusNetwork_FWD_DEFINED__ */ #ifndef __ClusNetInterface_FWD_DEFINED__ #define __ClusNetInterface_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusNetInterface ClusNetInterface; #else typedef struct ClusNetInterface ClusNetInterface; #endif /* __cplusplus */ #endif /* __ClusNetInterface_FWD_DEFINED__ */ #ifndef __ClusNetInterfaces_FWD_DEFINED__ #define __ClusNetInterfaces_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusNetInterfaces ClusNetInterfaces; #else typedef struct ClusNetInterfaces ClusNetInterfaces; #endif /* __cplusplus */ #endif /* __ClusNetInterfaces_FWD_DEFINED__ */ #ifndef __ClusResDependencies_FWD_DEFINED__ #define __ClusResDependencies_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResDependencies ClusResDependencies; #else typedef struct ClusResDependencies ClusResDependencies; #endif /* __cplusplus */ #endif /* __ClusResDependencies_FWD_DEFINED__ */ #ifndef __ClusResGroupResources_FWD_DEFINED__ #define __ClusResGroupResources_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResGroupResources ClusResGroupResources; #else typedef struct ClusResGroupResources ClusResGroupResources; #endif /* __cplusplus */ #endif /* __ClusResGroupResources_FWD_DEFINED__ */ #ifndef __ClusResTypeResources_FWD_DEFINED__ #define __ClusResTypeResources_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResTypeResources ClusResTypeResources; #else typedef struct ClusResTypeResources ClusResTypeResources; #endif /* __cplusplus */ #endif /* __ClusResTypeResources_FWD_DEFINED__ */ #ifndef __ClusResGroupPreferredOwnerNodes_FWD_DEFINED__ #define __ClusResGroupPreferredOwnerNodes_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResGroupPreferredOwnerNodes ClusResGroupPreferredOwnerNodes; #else typedef struct ClusResGroupPreferredOwnerNodes ClusResGroupPreferredOwnerNodes; #endif /* __cplusplus */ #endif /* __ClusResGroupPreferredOwnerNodes_FWD_DEFINED__ */ #ifndef __ClusResPossibleOwnerNodes_FWD_DEFINED__ #define __ClusResPossibleOwnerNodes_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResPossibleOwnerNodes ClusResPossibleOwnerNodes; #else typedef struct ClusResPossibleOwnerNodes ClusResPossibleOwnerNodes; #endif /* __cplusplus */ #endif /* __ClusResPossibleOwnerNodes_FWD_DEFINED__ */ #ifndef __ClusNetworks_FWD_DEFINED__ #define __ClusNetworks_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusNetworks ClusNetworks; #else typedef struct ClusNetworks ClusNetworks; #endif /* __cplusplus */ #endif /* __ClusNetworks_FWD_DEFINED__ */ #ifndef __ClusNetworkNetInterfaces_FWD_DEFINED__ #define __ClusNetworkNetInterfaces_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusNetworkNetInterfaces ClusNetworkNetInterfaces; #else typedef struct ClusNetworkNetInterfaces ClusNetworkNetInterfaces; #endif /* __cplusplus */ #endif /* __ClusNetworkNetInterfaces_FWD_DEFINED__ */ #ifndef __ClusNodeNetInterfaces_FWD_DEFINED__ #define __ClusNodeNetInterfaces_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusNodeNetInterfaces ClusNodeNetInterfaces; #else typedef struct ClusNodeNetInterfaces ClusNodeNetInterfaces; #endif /* __cplusplus */ #endif /* __ClusNodeNetInterfaces_FWD_DEFINED__ */ #ifndef __ClusRefObject_FWD_DEFINED__ #define __ClusRefObject_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusRefObject ClusRefObject; #else typedef struct ClusRefObject ClusRefObject; #endif /* __cplusplus */ #endif /* __ClusRefObject_FWD_DEFINED__ */ #ifndef __ClusterNames_FWD_DEFINED__ #define __ClusterNames_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusterNames ClusterNames; #else typedef struct ClusterNames ClusterNames; #endif /* __cplusplus */ #endif /* __ClusterNames_FWD_DEFINED__ */ #ifndef __ClusNode_FWD_DEFINED__ #define __ClusNode_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusNode ClusNode; #else typedef struct ClusNode ClusNode; #endif /* __cplusplus */ #endif /* __ClusNode_FWD_DEFINED__ */ #ifndef __ClusNodes_FWD_DEFINED__ #define __ClusNodes_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusNodes ClusNodes; #else typedef struct ClusNodes ClusNodes; #endif /* __cplusplus */ #endif /* __ClusNodes_FWD_DEFINED__ */ #ifndef __ClusResGroup_FWD_DEFINED__ #define __ClusResGroup_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResGroup ClusResGroup; #else typedef struct ClusResGroup ClusResGroup; #endif /* __cplusplus */ #endif /* __ClusResGroup_FWD_DEFINED__ */ #ifndef __ClusResGroups_FWD_DEFINED__ #define __ClusResGroups_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResGroups ClusResGroups; #else typedef struct ClusResGroups ClusResGroups; #endif /* __cplusplus */ #endif /* __ClusResGroups_FWD_DEFINED__ */ #ifndef __ClusResource_FWD_DEFINED__ #define __ClusResource_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResource ClusResource; #else typedef struct ClusResource ClusResource; #endif /* __cplusplus */ #endif /* __ClusResource_FWD_DEFINED__ */ #ifndef __ClusResources_FWD_DEFINED__ #define __ClusResources_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResources ClusResources; #else typedef struct ClusResources ClusResources; #endif /* __cplusplus */ #endif /* __ClusResources_FWD_DEFINED__ */ #ifndef __ClusResTypes_FWD_DEFINED__ #define __ClusResTypes_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResTypes ClusResTypes; #else typedef struct ClusResTypes ClusResTypes; #endif /* __cplusplus */ #endif /* __ClusResTypes_FWD_DEFINED__ */ #ifndef __ClusResTypePossibleOwnerNodes_FWD_DEFINED__ #define __ClusResTypePossibleOwnerNodes_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResTypePossibleOwnerNodes ClusResTypePossibleOwnerNodes; #else typedef struct ClusResTypePossibleOwnerNodes ClusResTypePossibleOwnerNodes; #endif /* __cplusplus */ #endif /* __ClusResTypePossibleOwnerNodes_FWD_DEFINED__ */ #ifndef __ClusPropertyValue_FWD_DEFINED__ #define __ClusPropertyValue_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusPropertyValue ClusPropertyValue; #else typedef struct ClusPropertyValue ClusPropertyValue; #endif /* __cplusplus */ #endif /* __ClusPropertyValue_FWD_DEFINED__ */ #ifndef __ClusPropertyValues_FWD_DEFINED__ #define __ClusPropertyValues_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusPropertyValues ClusPropertyValues; #else typedef struct ClusPropertyValues ClusPropertyValues; #endif /* __cplusplus */ #endif /* __ClusPropertyValues_FWD_DEFINED__ */ #ifndef __ClusPropertyValueData_FWD_DEFINED__ #define __ClusPropertyValueData_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusPropertyValueData ClusPropertyValueData; #else typedef struct ClusPropertyValueData ClusPropertyValueData; #endif /* __cplusplus */ #endif /* __ClusPropertyValueData_FWD_DEFINED__ */ #ifndef __ClusPartition_FWD_DEFINED__ #define __ClusPartition_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusPartition ClusPartition; #else typedef struct ClusPartition ClusPartition; #endif /* __cplusplus */ #endif /* __ClusPartition_FWD_DEFINED__ */ #ifndef __ClusPartitionEx_FWD_DEFINED__ #define __ClusPartitionEx_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusPartitionEx ClusPartitionEx; #else typedef struct ClusPartitionEx ClusPartitionEx; #endif /* __cplusplus */ #endif /* __ClusPartitionEx_FWD_DEFINED__ */ #ifndef __ClusPartitions_FWD_DEFINED__ #define __ClusPartitions_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusPartitions ClusPartitions; #else typedef struct ClusPartitions ClusPartitions; #endif /* __cplusplus */ #endif /* __ClusPartitions_FWD_DEFINED__ */ #ifndef __ClusDisk_FWD_DEFINED__ #define __ClusDisk_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusDisk ClusDisk; #else typedef struct ClusDisk ClusDisk; #endif /* __cplusplus */ #endif /* __ClusDisk_FWD_DEFINED__ */ #ifndef __ClusDisks_FWD_DEFINED__ #define __ClusDisks_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusDisks ClusDisks; #else typedef struct ClusDisks ClusDisks; #endif /* __cplusplus */ #endif /* __ClusDisks_FWD_DEFINED__ */ #ifndef __ClusScsiAddress_FWD_DEFINED__ #define __ClusScsiAddress_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusScsiAddress ClusScsiAddress; #else typedef struct ClusScsiAddress ClusScsiAddress; #endif /* __cplusplus */ #endif /* __ClusScsiAddress_FWD_DEFINED__ */ #ifndef __ClusRegistryKeys_FWD_DEFINED__ #define __ClusRegistryKeys_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusRegistryKeys ClusRegistryKeys; #else typedef struct ClusRegistryKeys ClusRegistryKeys; #endif /* __cplusplus */ #endif /* __ClusRegistryKeys_FWD_DEFINED__ */ #ifndef __ClusCryptoKeys_FWD_DEFINED__ #define __ClusCryptoKeys_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusCryptoKeys ClusCryptoKeys; #else typedef struct ClusCryptoKeys ClusCryptoKeys; #endif /* __cplusplus */ #endif /* __ClusCryptoKeys_FWD_DEFINED__ */ #ifndef __ClusResDependents_FWD_DEFINED__ #define __ClusResDependents_FWD_DEFINED__ #ifdef __cplusplus typedef class ClusResDependents ClusResDependents; #else typedef struct ClusResDependents ClusResDependents; #endif /* __cplusplus */ #endif /* __ClusResDependents_FWD_DEFINED__ */ #ifndef __ISClusApplication_FWD_DEFINED__ #define __ISClusApplication_FWD_DEFINED__ typedef interface ISClusApplication ISClusApplication; #endif /* __ISClusApplication_FWD_DEFINED__ */ #ifndef __ISDomainNames_FWD_DEFINED__ #define __ISDomainNames_FWD_DEFINED__ typedef interface ISDomainNames ISDomainNames; #endif /* __ISDomainNames_FWD_DEFINED__ */ #ifndef __ISClusterNames_FWD_DEFINED__ #define __ISClusterNames_FWD_DEFINED__ typedef interface ISClusterNames ISClusterNames; #endif /* __ISClusterNames_FWD_DEFINED__ */ #ifndef __ISClusRefObject_FWD_DEFINED__ #define __ISClusRefObject_FWD_DEFINED__ typedef interface ISClusRefObject ISClusRefObject; #endif /* __ISClusRefObject_FWD_DEFINED__ */ #ifndef __ISClusVersion_FWD_DEFINED__ #define __ISClusVersion_FWD_DEFINED__ typedef interface ISClusVersion ISClusVersion; #endif /* __ISClusVersion_FWD_DEFINED__ */ #ifndef __ISCluster_FWD_DEFINED__ #define __ISCluster_FWD_DEFINED__ typedef interface ISCluster ISCluster; #endif /* __ISCluster_FWD_DEFINED__ */ #ifndef __ISClusNode_FWD_DEFINED__ #define __ISClusNode_FWD_DEFINED__ typedef interface ISClusNode ISClusNode; #endif /* __ISClusNode_FWD_DEFINED__ */ #ifndef __ISClusNodes_FWD_DEFINED__ #define __ISClusNodes_FWD_DEFINED__ typedef interface ISClusNodes ISClusNodes; #endif /* __ISClusNodes_FWD_DEFINED__ */ #ifndef __ISClusNetwork_FWD_DEFINED__ #define __ISClusNetwork_FWD_DEFINED__ typedef interface ISClusNetwork ISClusNetwork; #endif /* __ISClusNetwork_FWD_DEFINED__ */ #ifndef __ISClusNetworks_FWD_DEFINED__ #define __ISClusNetworks_FWD_DEFINED__ typedef interface ISClusNetworks ISClusNetworks; #endif /* __ISClusNetworks_FWD_DEFINED__ */ #ifndef __ISClusNetInterface_FWD_DEFINED__ #define __ISClusNetInterface_FWD_DEFINED__ typedef interface ISClusNetInterface ISClusNetInterface; #endif /* __ISClusNetInterface_FWD_DEFINED__ */ #ifndef __ISClusNetInterfaces_FWD_DEFINED__ #define __ISClusNetInterfaces_FWD_DEFINED__ typedef interface ISClusNetInterfaces ISClusNetInterfaces; #endif /* __ISClusNetInterfaces_FWD_DEFINED__ */ #ifndef __ISClusNodeNetInterfaces_FWD_DEFINED__ #define __ISClusNodeNetInterfaces_FWD_DEFINED__ typedef interface ISClusNodeNetInterfaces ISClusNodeNetInterfaces; #endif /* __ISClusNodeNetInterfaces_FWD_DEFINED__ */ #ifndef __ISClusNetworkNetInterfaces_FWD_DEFINED__ #define __ISClusNetworkNetInterfaces_FWD_DEFINED__ typedef interface ISClusNetworkNetInterfaces ISClusNetworkNetInterfaces; #endif /* __ISClusNetworkNetInterfaces_FWD_DEFINED__ */ #ifndef __ISClusResGroup_FWD_DEFINED__ #define __ISClusResGroup_FWD_DEFINED__ typedef interface ISClusResGroup ISClusResGroup; #endif /* __ISClusResGroup_FWD_DEFINED__ */ #ifndef __ISClusResGroups_FWD_DEFINED__ #define __ISClusResGroups_FWD_DEFINED__ typedef interface ISClusResGroups ISClusResGroups; #endif /* __ISClusResGroups_FWD_DEFINED__ */ #ifndef __ISClusResource_FWD_DEFINED__ #define __ISClusResource_FWD_DEFINED__ typedef interface ISClusResource ISClusResource; #endif /* __ISClusResource_FWD_DEFINED__ */ #ifndef __ISClusResDependencies_FWD_DEFINED__ #define __ISClusResDependencies_FWD_DEFINED__ typedef interface ISClusResDependencies ISClusResDependencies; #endif /* __ISClusResDependencies_FWD_DEFINED__ */ #ifndef __ISClusResGroupResources_FWD_DEFINED__ #define __ISClusResGroupResources_FWD_DEFINED__ typedef interface ISClusResGroupResources ISClusResGroupResources; #endif /* __ISClusResGroupResources_FWD_DEFINED__ */ #ifndef __ISClusResTypeResources_FWD_DEFINED__ #define __ISClusResTypeResources_FWD_DEFINED__ typedef interface ISClusResTypeResources ISClusResTypeResources; #endif /* __ISClusResTypeResources_FWD_DEFINED__ */ #ifndef __ISClusResources_FWD_DEFINED__ #define __ISClusResources_FWD_DEFINED__ typedef interface ISClusResources ISClusResources; #endif /* __ISClusResources_FWD_DEFINED__ */ #ifndef __ISClusResGroupPreferredOwnerNodes_FWD_DEFINED__ #define __ISClusResGroupPreferredOwnerNodes_FWD_DEFINED__ typedef interface ISClusResGroupPreferredOwnerNodes ISClusResGroupPreferredOwnerNodes; #endif /* __ISClusResGroupPreferredOwnerNodes_FWD_DEFINED__ */ #ifndef __ISClusResPossibleOwnerNodes_FWD_DEFINED__ #define __ISClusResPossibleOwnerNodes_FWD_DEFINED__ typedef interface ISClusResPossibleOwnerNodes ISClusResPossibleOwnerNodes; #endif /* __ISClusResPossibleOwnerNodes_FWD_DEFINED__ */ #ifndef __ISClusResTypePossibleOwnerNodes_FWD_DEFINED__ #define __ISClusResTypePossibleOwnerNodes_FWD_DEFINED__ typedef interface ISClusResTypePossibleOwnerNodes ISClusResTypePossibleOwnerNodes; #endif /* __ISClusResTypePossibleOwnerNodes_FWD_DEFINED__ */ #ifndef __ISClusResType_FWD_DEFINED__ #define __ISClusResType_FWD_DEFINED__ typedef interface ISClusResType ISClusResType; #endif /* __ISClusResType_FWD_DEFINED__ */ #ifndef __ISClusResTypes_FWD_DEFINED__ #define __ISClusResTypes_FWD_DEFINED__ typedef interface ISClusResTypes ISClusResTypes; #endif /* __ISClusResTypes_FWD_DEFINED__ */ #ifndef __ISClusProperty_FWD_DEFINED__ #define __ISClusProperty_FWD_DEFINED__ typedef interface ISClusProperty ISClusProperty; #endif /* __ISClusProperty_FWD_DEFINED__ */ #ifndef __ISClusPropertyValue_FWD_DEFINED__ #define __ISClusPropertyValue_FWD_DEFINED__ typedef interface ISClusPropertyValue ISClusPropertyValue; #endif /* __ISClusPropertyValue_FWD_DEFINED__ */ #ifndef __ISClusPropertyValues_FWD_DEFINED__ #define __ISClusPropertyValues_FWD_DEFINED__ typedef interface ISClusPropertyValues ISClusPropertyValues; #endif /* __ISClusPropertyValues_FWD_DEFINED__ */ #ifndef __ISClusProperties_FWD_DEFINED__ #define __ISClusProperties_FWD_DEFINED__ typedef interface ISClusProperties ISClusProperties; #endif /* __ISClusProperties_FWD_DEFINED__ */ #ifndef __ISClusPropertyValueData_FWD_DEFINED__ #define __ISClusPropertyValueData_FWD_DEFINED__ typedef interface ISClusPropertyValueData ISClusPropertyValueData; #endif /* __ISClusPropertyValueData_FWD_DEFINED__ */ #ifndef __ISClusPartition_FWD_DEFINED__ #define __ISClusPartition_FWD_DEFINED__ typedef interface ISClusPartition ISClusPartition; #endif /* __ISClusPartition_FWD_DEFINED__ */ #ifndef __ISClusPartitionEx_FWD_DEFINED__ #define __ISClusPartitionEx_FWD_DEFINED__ typedef interface ISClusPartitionEx ISClusPartitionEx; #endif /* __ISClusPartitionEx_FWD_DEFINED__ */ #ifndef __ISClusPartitions_FWD_DEFINED__ #define __ISClusPartitions_FWD_DEFINED__ typedef interface ISClusPartitions ISClusPartitions; #endif /* __ISClusPartitions_FWD_DEFINED__ */ #ifndef __ISClusDisk_FWD_DEFINED__ #define __ISClusDisk_FWD_DEFINED__ typedef interface ISClusDisk ISClusDisk; #endif /* __ISClusDisk_FWD_DEFINED__ */ #ifndef __ISClusDisks_FWD_DEFINED__ #define __ISClusDisks_FWD_DEFINED__ typedef interface ISClusDisks ISClusDisks; #endif /* __ISClusDisks_FWD_DEFINED__ */ #ifndef __ISClusScsiAddress_FWD_DEFINED__ #define __ISClusScsiAddress_FWD_DEFINED__ typedef interface ISClusScsiAddress ISClusScsiAddress; #endif /* __ISClusScsiAddress_FWD_DEFINED__ */ #ifndef __ISClusRegistryKeys_FWD_DEFINED__ #define __ISClusRegistryKeys_FWD_DEFINED__ typedef interface ISClusRegistryKeys ISClusRegistryKeys; #endif /* __ISClusRegistryKeys_FWD_DEFINED__ */ #ifndef __ISClusCryptoKeys_FWD_DEFINED__ #define __ISClusCryptoKeys_FWD_DEFINED__ typedef interface ISClusCryptoKeys ISClusCryptoKeys; #endif /* __ISClusCryptoKeys_FWD_DEFINED__ */ #ifndef __ISClusResDependents_FWD_DEFINED__ #define __ISClusResDependents_FWD_DEFINED__ typedef interface ISClusResDependents ISClusResDependents; #endif /* __ISClusResDependents_FWD_DEFINED__ */ /* header files for imported files */ #include "basetsd.h" #include "oaidl.h" #ifdef __cplusplus extern "C"{ #endif /* interface __MIDL_itf_msclus_0000_0000 */ /* [local] */ #include <winapifamily.h> #pragma region Desktop Family #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #ifndef _CLUSTER_API_TYPES_ #define _CLUSTER_API_TYPES_ #pragma once #pragma warning(push) #pragma warning(disable:4668) #pragma once #pragma region Input Buffer SAL 1 compatibility macros #pragma endregion Input Buffer SAL 1 compatibility macros #pragma once #pragma once #pragma warning(pop) #pragma once #pragma warning(push) #pragma warning(disable:4001) #pragma once #pragma warning(push) #pragma warning(disable:4001) #pragma once #pragma warning(pop) #pragma warning(pop) #pragma region Desktop Family or FailoverCluster Package typedef struct _HCLUSTER *HCLUSTER; typedef struct _HNODE *HNODE; typedef struct _HRESOURCE *HRESOURCE; typedef struct _HGROUP *HGROUP; typedef struct _HNETWORK *HNETWORK; typedef struct _HNETINTERFACE *HNETINTERFACE; typedef struct _HCHANGE *HCHANGE; typedef struct _HCLUSENUM *HCLUSENUM; typedef struct _HGROUPENUM *HGROUPENUM; typedef struct _HRESENUM *HRESENUM; typedef struct _HNETWORKENUM *HNETWORKENUM; typedef struct _HNODEENUM *HNODEENUM; typedef struct _HNETINTERFACEENUM *HNETINTERFACEENUM; typedef struct _HRESTYPEENUM *HRESTYPEENUM; typedef struct _HREGBATCH *HREGBATCH; typedef struct _HREGBATCHPORT *HREGBATCHPORT; typedef struct _HREGBATCHNOTIFICATION *HREGBATCHNOTIFICATION; typedef struct _HREGREADBATCH *HREGREADBATCH; typedef struct _HREGREADBATCHREPLY *HREGREADBATCHREPLY; typedef struct _HNODEENUMEX *HNODEENUMEX; typedef struct _HCLUSENUMEX *HCLUSENUMEX; typedef struct _HGROUPENUMEX *HGROUPENUMEX; typedef struct _HRESENUMEX *HRESENUMEX; typedef struct _HGROUPSET *HGROUPSET; typedef struct _HGROUPSETENUM *HGROUPSETENUM; typedef enum CLUSTER_QUORUM_TYPE { OperationalQuorum = 0, ModifyQuorum = ( OperationalQuorum + 1 ) } CLUSTER_QUORUM_TYPE; typedef enum NODE_CLUSTER_STATE { ClusterStateNotInstalled = 0, ClusterStateNotConfigured = 0x1, ClusterStateNotRunning = ( 0x1 | 0x2 ) , ClusterStateRunning = ( ( 0x1 | 0x2 ) | 0x10 ) } NODE_CLUSTER_STATE; typedef enum CLUSTER_RESOURCE_STATE_CHANGE_REASON { eResourceStateChangeReasonUnknown = 0, eResourceStateChangeReasonMove = ( eResourceStateChangeReasonUnknown + 1 ) , eResourceStateChangeReasonFailover = ( eResourceStateChangeReasonMove + 1 ) , eResourceStateChangeReasonFailedMove = ( eResourceStateChangeReasonFailover + 1 ) , eResourceStateChangeReasonShutdown = ( eResourceStateChangeReasonFailedMove + 1 ) , eResourceStateChangeReasonRundown = ( eResourceStateChangeReasonShutdown + 1 ) } CLUSTER_RESOURCE_STATE_CHANGE_REASON; typedef enum _CLUSTER_REG_COMMAND { CLUSREG_COMMAND_NONE = 0, CLUSREG_SET_VALUE = 1, CLUSREG_CREATE_KEY = ( CLUSREG_SET_VALUE + 1 ) , CLUSREG_DELETE_KEY = ( CLUSREG_CREATE_KEY + 1 ) , CLUSREG_DELETE_VALUE = ( CLUSREG_DELETE_KEY + 1 ) , CLUSREG_SET_KEY_SECURITY = ( CLUSREG_DELETE_VALUE + 1 ) , CLUSREG_VALUE_DELETED = ( CLUSREG_SET_KEY_SECURITY + 1 ) , CLUSREG_READ_KEY = ( CLUSREG_VALUE_DELETED + 1 ) , CLUSREG_READ_VALUE = ( CLUSREG_READ_KEY + 1 ) , CLUSREG_READ_ERROR = ( CLUSREG_READ_VALUE + 1 ) , CLUSREG_CONTROL_COMMAND = ( CLUSREG_READ_ERROR + 1 ) , CLUSREG_CONDITION_EXISTS = ( CLUSREG_CONTROL_COMMAND + 1 ) , CLUSREG_CONDITION_NOT_EXISTS = ( CLUSREG_CONDITION_EXISTS + 1 ) , CLUSREG_CONDITION_IS_EQUAL = ( CLUSREG_CONDITION_NOT_EXISTS + 1 ) , CLUSREG_CONDITION_IS_NOT_EQUAL = ( CLUSREG_CONDITION_IS_EQUAL + 1 ) , CLUSREG_CONDITION_IS_GREATER_THAN = ( CLUSREG_CONDITION_IS_NOT_EQUAL + 1 ) , CLUSREG_CONDITION_IS_LESS_THAN = ( CLUSREG_CONDITION_IS_GREATER_THAN + 1 ) , CLUSREG_CONDITION_KEY_EXISTS = ( CLUSREG_CONDITION_IS_LESS_THAN + 1 ) , CLUSREG_CONDITION_KEY_NOT_EXISTS = ( CLUSREG_CONDITION_KEY_EXISTS + 1 ) , CLUSREG_LAST_COMMAND = ( CLUSREG_CONDITION_KEY_NOT_EXISTS + 1 ) } CLUSTER_REG_COMMAND; typedef struct _CLUSTER_ENUM_ITEM { DWORD dwVersion; DWORD dwType; DWORD cbId; LPWSTR lpszId; DWORD cbName; LPWSTR lpszName; } CLUSTER_ENUM_ITEM; typedef struct _CLUSTER_ENUM_ITEM *PCLUSTER_ENUM_ITEM; typedef /* [public][public][public] */ enum __MIDL___MIDL_itf_msclus_0000_0000_0001 { ClusGroupTypeCoreCluster = 1, ClusGroupTypeAvailableStorage = 2, ClusGroupTypeTemporary = 3, ClusGroupTypeSharedVolume = 4, ClusGroupTypeStoragePool = 5, ClusGroupTypeFileServer = 100, ClusGroupTypePrintServer = 101, ClusGroupTypeDhcpServer = 102, ClusGroupTypeDtc = 103, ClusGroupTypeMsmq = 104, ClusGroupTypeWins = 105, ClusGroupTypeStandAloneDfs = 106, ClusGroupTypeGenericApplication = 107, ClusGroupTypeGenericService = 108, ClusGroupTypeGenericScript = 109, ClusGroupTypeIScsiNameService = 110, ClusGroupTypeVirtualMachine = 111, ClusGroupTypeTsSessionBroker = 112, ClusGroupTypeIScsiTarget = 113, ClusGroupTypeScaleoutFileServer = 114, ClusGroupTypeVMReplicaBroker = 115, ClusGroupTypeTaskScheduler = 116, ClusGroupTypeClusterUpdateAgent = 117, ClusGroupTypeScaleoutCluster = 118, ClusGroupTypeStorageReplica = 119, ClusGroupTypeVMReplicaCoordinator = 120, ClusGroupTypeCrossClusterOrchestrator = 121, ClusGroupTypeUnknown = 9999 } CLUSGROUP_TYPE; typedef enum __MIDL___MIDL_itf_msclus_0000_0000_0001 *PCLUSGROUP_TYPE; typedef struct _CLUSTER_CREATE_GROUP_INFO { DWORD dwVersion; CLUSGROUP_TYPE groupType; } CLUSTER_CREATE_GROUP_INFO; typedef struct _CLUSTER_CREATE_GROUP_INFO *PCLUSTER_CREATE_GROUP_INFO; typedef /* [public] */ enum __MIDL___MIDL_itf_msclus_0000_0000_0002 { CLUSTER_MGMT_POINT_TYPE_NONE = 0, CLUSTER_MGMT_POINT_TYPE_CNO = ( CLUSTER_MGMT_POINT_TYPE_NONE + 1 ) , CLUSTER_MGMT_POINT_TYPE_DNS_ONLY = ( CLUSTER_MGMT_POINT_TYPE_CNO + 1 ) , CLUSTER_MGMT_POINT_TYPE_CNO_ONLY = ( CLUSTER_MGMT_POINT_TYPE_DNS_ONLY + 1 ) } CLUSTER_MGMT_POINT_TYPE; typedef /* [public] */ enum __MIDL___MIDL_itf_msclus_0000_0000_0003 { CLUS_GROUP_START_ALWAYS = 0, CLUS_GROUP_DO_NOT_START = 1, CLUS_GROUP_START_ALLOWED = 2 } CLUS_GROUP_START_SETTING; typedef enum CLUSTER_QUORUM_VALUE { CLUSTER_QUORUM_MAINTAINED = 0, CLUSTER_QUORUM_LOST = 1 } CLUSTER_QUORUM_VALUE; typedef enum CLUSTER_CHANGE { CLUSTER_CHANGE_NODE_STATE = 0x1, CLUSTER_CHANGE_NODE_DELETED = 0x2, CLUSTER_CHANGE_NODE_ADDED = 0x4, CLUSTER_CHANGE_NODE_PROPERTY = 0x8, CLUSTER_CHANGE_REGISTRY_NAME = 0x10, CLUSTER_CHANGE_REGISTRY_ATTRIBUTES = 0x20, CLUSTER_CHANGE_REGISTRY_VALUE = 0x40, CLUSTER_CHANGE_REGISTRY_SUBTREE = 0x80, CLUSTER_CHANGE_RESOURCE_STATE = 0x100, CLUSTER_CHANGE_RESOURCE_DELETED = 0x200, CLUSTER_CHANGE_RESOURCE_ADDED = 0x400, CLUSTER_CHANGE_RESOURCE_PROPERTY = 0x800, CLUSTER_CHANGE_GROUP_STATE = 0x1000, CLUSTER_CHANGE_GROUP_DELETED = 0x2000, CLUSTER_CHANGE_GROUP_ADDED = 0x4000, CLUSTER_CHANGE_GROUP_PROPERTY = 0x8000, CLUSTER_CHANGE_RESOURCE_TYPE_DELETED = 0x10000, CLUSTER_CHANGE_RESOURCE_TYPE_ADDED = 0x20000, CLUSTER_CHANGE_RESOURCE_TYPE_PROPERTY = 0x40000, CLUSTER_CHANGE_CLUSTER_RECONNECT = 0x80000, CLUSTER_CHANGE_NETWORK_STATE = 0x100000, CLUSTER_CHANGE_NETWORK_DELETED = 0x200000, CLUSTER_CHANGE_NETWORK_ADDED = 0x400000, CLUSTER_CHANGE_NETWORK_PROPERTY = 0x800000, CLUSTER_CHANGE_NETINTERFACE_STATE = 0x1000000, CLUSTER_CHANGE_NETINTERFACE_DELETED = 0x2000000, CLUSTER_CHANGE_NETINTERFACE_ADDED = 0x4000000, CLUSTER_CHANGE_NETINTERFACE_PROPERTY = 0x8000000, CLUSTER_CHANGE_QUORUM_STATE = 0x10000000, CLUSTER_CHANGE_CLUSTER_STATE = 0x20000000, CLUSTER_CHANGE_CLUSTER_PROPERTY = 0x40000000, CLUSTER_CHANGE_HANDLE_CLOSE = 0x80000000, CLUSTER_CHANGE_ALL = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( CLUSTER_CHANGE_NODE_STATE | CLUSTER_CHANGE_NODE_DELETED ) | CLUSTER_CHANGE_NODE_ADDED ) | CLUSTER_CHANGE_NODE_PROPERTY ) | CLUSTER_CHANGE_REGISTRY_NAME ) | CLUSTER_CHANGE_REGISTRY_ATTRIBUTES ) | CLUSTER_CHANGE_REGISTRY_VALUE ) | CLUSTER_CHANGE_REGISTRY_SUBTREE ) | CLUSTER_CHANGE_RESOURCE_STATE ) | CLUSTER_CHANGE_RESOURCE_DELETED ) | CLUSTER_CHANGE_RESOURCE_ADDED ) | CLUSTER_CHANGE_RESOURCE_PROPERTY ) | CLUSTER_CHANGE_GROUP_STATE ) | CLUSTER_CHANGE_GROUP_DELETED ) | CLUSTER_CHANGE_GROUP_ADDED ) | CLUSTER_CHANGE_GROUP_PROPERTY ) | CLUSTER_CHANGE_RESOURCE_TYPE_DELETED ) | CLUSTER_CHANGE_RESOURCE_TYPE_ADDED ) | CLUSTER_CHANGE_RESOURCE_TYPE_PROPERTY ) | CLUSTER_CHANGE_NETWORK_STATE ) | CLUSTER_CHANGE_NETWORK_DELETED ) | CLUSTER_CHANGE_NETWORK_ADDED ) | CLUSTER_CHANGE_NETWORK_PROPERTY ) | CLUSTER_CHANGE_NETINTERFACE_STATE ) | CLUSTER_CHANGE_NETINTERFACE_DELETED ) | CLUSTER_CHANGE_NETINTERFACE_ADDED ) | CLUSTER_CHANGE_NETINTERFACE_PROPERTY ) | CLUSTER_CHANGE_QUORUM_STATE ) | CLUSTER_CHANGE_CLUSTER_STATE ) | CLUSTER_CHANGE_CLUSTER_PROPERTY ) | CLUSTER_CHANGE_CLUSTER_RECONNECT ) | CLUSTER_CHANGE_HANDLE_CLOSE ) } CLUSTER_CHANGE; typedef enum CLUSTER_NOTIFICATIONS_VERSION { CLUSTER_NOTIFICATIONS_V1 = 0x1, CLUSTER_NOTIFICATIONS_V2 = 0x2 } CLUSTER_NOTIFICATIONS_VERSION; typedef enum CLUSTER_CHANGE_CLUSTER_V2 { CLUSTER_CHANGE_CLUSTER_RECONNECT_V2 = 0x1, CLUSTER_CHANGE_CLUSTER_STATE_V2 = 0x2, CLUSTER_CHANGE_CLUSTER_GROUP_ADDED_V2 = 0x4, CLUSTER_CHANGE_CLUSTER_HANDLE_CLOSE_V2 = 0x8, CLUSTER_CHANGE_CLUSTER_NETWORK_ADDED_V2 = 0x10, CLUSTER_CHANGE_CLUSTER_NODE_ADDED_V2 = 0x20, CLUSTER_CHANGE_CLUSTER_RESOURCE_TYPE_ADDED_V2 = 0x40, CLUSTER_CHANGE_CLUSTER_COMMON_PROPERTY_V2 = 0x80, CLUSTER_CHANGE_CLUSTER_PRIVATE_PROPERTY_V2 = 0x100, CLUSTER_CHANGE_CLUSTER_LOST_NOTIFICATIONS_V2 = 0x200, CLUSTER_CHANGE_CLUSTER_RENAME_V2 = 0x400, CLUSTER_CHANGE_CLUSTER_MEMBERSHIP_V2 = 0x800, CLUSTER_CHANGE_CLUSTER_UPGRADED_V2 = 0x1000, CLUSTER_CHANGE_CLUSTER_ALL_V2 = ( ( ( ( ( ( ( ( ( ( ( ( CLUSTER_CHANGE_CLUSTER_RECONNECT_V2 | CLUSTER_CHANGE_CLUSTER_STATE_V2 ) | CLUSTER_CHANGE_CLUSTER_GROUP_ADDED_V2 ) | CLUSTER_CHANGE_CLUSTER_HANDLE_CLOSE_V2 ) | CLUSTER_CHANGE_CLUSTER_NETWORK_ADDED_V2 ) | CLUSTER_CHANGE_CLUSTER_NODE_ADDED_V2 ) | CLUSTER_CHANGE_CLUSTER_RESOURCE_TYPE_ADDED_V2 ) | CLUSTER_CHANGE_CLUSTER_COMMON_PROPERTY_V2 ) | CLUSTER_CHANGE_CLUSTER_PRIVATE_PROPERTY_V2 ) | CLUSTER_CHANGE_CLUSTER_LOST_NOTIFICATIONS_V2 ) | CLUSTER_CHANGE_CLUSTER_RENAME_V2 ) | CLUSTER_CHANGE_CLUSTER_MEMBERSHIP_V2 ) | CLUSTER_CHANGE_CLUSTER_UPGRADED_V2 ) } CLUSTER_CHANGE_CLUSTER_V2; typedef enum CLUSTER_CHANGE_GROUP_V2 { CLUSTER_CHANGE_GROUP_DELETED_V2 = 0x1, CLUSTER_CHANGE_GROUP_COMMON_PROPERTY_V2 = 0x2, CLUSTER_CHANGE_GROUP_PRIVATE_PROPERTY_V2 = 0x4, CLUSTER_CHANGE_GROUP_STATE_V2 = 0x8, CLUSTER_CHANGE_GROUP_OWNER_NODE_V2 = 0x10, CLUSTER_CHANGE_GROUP_PREFERRED_OWNERS_V2 = 0x20, CLUSTER_CHANGE_GROUP_RESOURCE_ADDED_V2 = 0x40, CLUSTER_CHANGE_GROUP_RESOURCE_GAINED_V2 = 0x80, CLUSTER_CHANGE_GROUP_RESOURCE_LOST_V2 = 0x100, CLUSTER_CHANGE_GROUP_HANDLE_CLOSE_V2 = 0x200, CLUSTER_CHANGE_GROUP_ALL_V2 = ( ( ( ( ( ( ( ( ( CLUSTER_CHANGE_GROUP_DELETED_V2 | CLUSTER_CHANGE_GROUP_COMMON_PROPERTY_V2 ) | CLUSTER_CHANGE_GROUP_PRIVATE_PROPERTY_V2 ) | CLUSTER_CHANGE_GROUP_STATE_V2 ) | CLUSTER_CHANGE_GROUP_OWNER_NODE_V2 ) | CLUSTER_CHANGE_GROUP_PREFERRED_OWNERS_V2 ) | CLUSTER_CHANGE_GROUP_RESOURCE_ADDED_V2 ) | CLUSTER_CHANGE_GROUP_RESOURCE_GAINED_V2 ) | CLUSTER_CHANGE_GROUP_RESOURCE_LOST_V2 ) | CLUSTER_CHANGE_GROUP_HANDLE_CLOSE_V2 ) } CLUSTER_CHANGE_GROUP_V2; typedef enum CLUSTER_CHANGE_GROUPSET_V2 { CLUSTER_CHANGE_GROUPSET_DELETED_v2 = 0x1, CLUSTER_CHANGE_GROUPSET_COMMON_PROPERTY_V2 = 0x2, CLUSTER_CHANGE_GROUPSET_PRIVATE_PROPERTY_V2 = 0x4, CLUSTER_CHANGE_GROUPSET_STATE_V2 = 0x8, CLUSTER_CHANGE_GROUPSET_GROUP_ADDED = 0x10, CLUSTER_CHANGE_GROUPSET_GROUP_REMOVED = 0x20, CLUSTER_CHANGE_GROUPSET_DEPENDENCIES_V2 = 0x40, CLUSTER_CHANGE_GROUPSET_DEPENDENTS_V2 = 0x80, CLUSTER_CHANGE_GROUPSET_HANDLE_CLOSE_v2 = 0x100, CLUSTER_CHANGE_GROUPSET_ALL_V2 = ( ( ( ( ( ( ( ( CLUSTER_CHANGE_GROUPSET_DELETED_v2 | CLUSTER_CHANGE_GROUPSET_COMMON_PROPERTY_V2 ) | CLUSTER_CHANGE_GROUPSET_PRIVATE_PROPERTY_V2 ) | CLUSTER_CHANGE_GROUPSET_STATE_V2 ) | CLUSTER_CHANGE_GROUPSET_GROUP_ADDED ) | CLUSTER_CHANGE_GROUPSET_GROUP_REMOVED ) | CLUSTER_CHANGE_GROUPSET_DEPENDENCIES_V2 ) | CLUSTER_CHANGE_GROUPSET_DEPENDENTS_V2 ) | CLUSTER_CHANGE_GROUPSET_HANDLE_CLOSE_v2 ) } CLUSTER_CHANGE_GROUPSET_V2; typedef enum CLUSTER_CHANGE_RESOURCE_V2 { CLUSTER_CHANGE_RESOURCE_COMMON_PROPERTY_V2 = 0x1, CLUSTER_CHANGE_RESOURCE_PRIVATE_PROPERTY_V2 = 0x2, CLUSTER_CHANGE_RESOURCE_STATE_V2 = 0x4, CLUSTER_CHANGE_RESOURCE_OWNER_GROUP_V2 = 0x8, CLUSTER_CHANGE_RESOURCE_DEPENDENCIES_V2 = 0x10, CLUSTER_CHANGE_RESOURCE_DEPENDENTS_V2 = 0x20, CLUSTER_CHANGE_RESOURCE_POSSIBLE_OWNERS_V2 = 0x40, CLUSTER_CHANGE_RESOURCE_DELETED_V2 = 0x80, CLUSTER_CHANGE_RESOURCE_DLL_UPGRADED_V2 = 0x100, CLUSTER_CHANGE_RESOURCE_HANDLE_CLOSE_V2 = 0x200, CLUSTER_CHANGE_RESOURCE_TERMINAL_STATE_V2 = 0x400, CLUSTER_CHANGE_RESOURCE_ALL_V2 = ( ( ( ( ( ( ( ( ( ( CLUSTER_CHANGE_RESOURCE_COMMON_PROPERTY_V2 | CLUSTER_CHANGE_RESOURCE_PRIVATE_PROPERTY_V2 ) | CLUSTER_CHANGE_RESOURCE_STATE_V2 ) | CLUSTER_CHANGE_RESOURCE_OWNER_GROUP_V2 ) | CLUSTER_CHANGE_RESOURCE_DEPENDENCIES_V2 ) | CLUSTER_CHANGE_RESOURCE_DEPENDENTS_V2 ) | CLUSTER_CHANGE_RESOURCE_POSSIBLE_OWNERS_V2 ) | CLUSTER_CHANGE_RESOURCE_DELETED_V2 ) | CLUSTER_CHANGE_RESOURCE_DLL_UPGRADED_V2 ) | CLUSTER_CHANGE_RESOURCE_HANDLE_CLOSE_V2 ) | CLUSTER_CHANGE_RESOURCE_TERMINAL_STATE_V2 ) } CLUSTER_CHANGE_RESOURCE_V2; typedef enum CLUSTER_CHANGE_RESOURCE_TYPE_V2 { CLUSTER_CHANGE_RESOURCE_TYPE_DELETED_V2 = 0x1, CLUSTER_CHANGE_RESOURCE_TYPE_COMMON_PROPERTY_V2 = 0x2, CLUSTER_CHANGE_RESOURCE_TYPE_PRIVATE_PROPERTY_V2 = 0x4, CLUSTER_CHANGE_RESOURCE_TYPE_POSSIBLE_OWNERS_V2 = 0x8, CLUSTER_CHANGE_RESOURCE_TYPE_DLL_UPGRADED_V2 = 0x10, CLUSTER_RESOURCE_TYPE_SPECIFIC_V2 = 0x20, CLUSTER_CHANGE_RESOURCE_TYPE_ALL_V2 = ( ( ( ( ( CLUSTER_CHANGE_RESOURCE_TYPE_DELETED_V2 | CLUSTER_CHANGE_RESOURCE_TYPE_COMMON_PROPERTY_V2 ) | CLUSTER_CHANGE_RESOURCE_TYPE_PRIVATE_PROPERTY_V2 ) | CLUSTER_CHANGE_RESOURCE_TYPE_POSSIBLE_OWNERS_V2 ) | CLUSTER_CHANGE_RESOURCE_TYPE_DLL_UPGRADED_V2 ) | CLUSTER_RESOURCE_TYPE_SPECIFIC_V2 ) } CLUSTER_CHANGE_RESOURCE_TYPE_V2; typedef enum CLUSTER_CHANGE_NETINTERFACE_V2 { CLUSTER_CHANGE_NETINTERFACE_DELETED_V2 = 0x1, CLUSTER_CHANGE_NETINTERFACE_COMMON_PROPERTY_V2 = 0x2, CLUSTER_CHANGE_NETINTERFACE_PRIVATE_PROPERTY_V2 = 0x4, CLUSTER_CHANGE_NETINTERFACE_STATE_V2 = 0x8, CLUSTER_CHANGE_NETINTERFACE_HANDLE_CLOSE_V2 = 0x10, CLUSTER_CHANGE_NETINTERFACE_ALL_V2 = ( ( ( ( CLUSTER_CHANGE_NETINTERFACE_DELETED_V2 | CLUSTER_CHANGE_NETINTERFACE_COMMON_PROPERTY_V2 ) | CLUSTER_CHANGE_NETINTERFACE_PRIVATE_PROPERTY_V2 ) | CLUSTER_CHANGE_NETINTERFACE_STATE_V2 ) | CLUSTER_CHANGE_NETINTERFACE_HANDLE_CLOSE_V2 ) } CLUSTER_CHANGE_NETINTERFACE_V2; typedef enum CLUSTER_CHANGE_NETWORK_V2 { CLUSTER_CHANGE_NETWORK_DELETED_V2 = 0x1, CLUSTER_CHANGE_NETWORK_COMMON_PROPERTY_V2 = 0x2, CLUSTER_CHANGE_NETWORK_PRIVATE_PROPERTY_V2 = 0x4, CLUSTER_CHANGE_NETWORK_STATE_V2 = 0x8, CLUSTER_CHANGE_NETWORK_HANDLE_CLOSE_V2 = 0x10, CLUSTER_CHANGE_NETWORK_ALL_V2 = ( ( ( ( CLUSTER_CHANGE_NETWORK_DELETED_V2 | CLUSTER_CHANGE_NETWORK_COMMON_PROPERTY_V2 ) | CLUSTER_CHANGE_NETWORK_PRIVATE_PROPERTY_V2 ) | CLUSTER_CHANGE_NETWORK_STATE_V2 ) | CLUSTER_CHANGE_NETWORK_HANDLE_CLOSE_V2 ) } CLUSTER_CHANGE_NETWORK_V2; typedef enum CLUSTER_CHANGE_NODE_V2 { CLUSTER_CHANGE_NODE_NETINTERFACE_ADDED_V2 = 0x1, CLUSTER_CHANGE_NODE_DELETED_V2 = 0x2, CLUSTER_CHANGE_NODE_COMMON_PROPERTY_V2 = 0x4, CLUSTER_CHANGE_NODE_PRIVATE_PROPERTY_V2 = 0x8, CLUSTER_CHANGE_NODE_STATE_V2 = 0x10, CLUSTER_CHANGE_NODE_GROUP_GAINED_V2 = 0x20, CLUSTER_CHANGE_NODE_GROUP_LOST_V2 = 0x40, CLUSTER_CHANGE_NODE_HANDLE_CLOSE_V2 = 0x80, CLUSTER_CHANGE_NODE_ALL_V2 = ( ( ( ( ( ( ( CLUSTER_CHANGE_NODE_NETINTERFACE_ADDED_V2 | CLUSTER_CHANGE_NODE_DELETED_V2 ) | CLUSTER_CHANGE_NODE_COMMON_PROPERTY_V2 ) | CLUSTER_CHANGE_NODE_PRIVATE_PROPERTY_V2 ) | CLUSTER_CHANGE_NODE_STATE_V2 ) | CLUSTER_CHANGE_NODE_GROUP_GAINED_V2 ) | CLUSTER_CHANGE_NODE_GROUP_LOST_V2 ) | CLUSTER_CHANGE_NODE_HANDLE_CLOSE_V2 ) } CLUSTER_CHANGE_NODE_V2; typedef enum CLUSTER_CHANGE_REGISTRY_V2 { CLUSTER_CHANGE_REGISTRY_ATTRIBUTES_V2 = 0x1, CLUSTER_CHANGE_REGISTRY_NAME_V2 = 0x2, CLUSTER_CHANGE_REGISTRY_SUBTREE_V2 = 0x4, CLUSTER_CHANGE_REGISTRY_VALUE_V2 = 0x8, CLUSTER_CHANGE_REGISTRY_HANDLE_CLOSE_V2 = 0x10, CLUSTER_CHANGE_REGISTRY_ALL_V2 = ( ( ( ( CLUSTER_CHANGE_REGISTRY_ATTRIBUTES_V2 | CLUSTER_CHANGE_REGISTRY_NAME_V2 ) | CLUSTER_CHANGE_REGISTRY_SUBTREE_V2 ) | CLUSTER_CHANGE_REGISTRY_VALUE_V2 ) | CLUSTER_CHANGE_REGISTRY_HANDLE_CLOSE_V2 ) } CLUSTER_CHANGE_REGISTRY_V2; typedef enum CLUSTER_CHANGE_QUORUM_V2 { CLUSTER_CHANGE_QUORUM_STATE_V2 = 0x1, CLUSTER_CHANGE_QUORUM_ALL_V2 = CLUSTER_CHANGE_QUORUM_STATE_V2 } CLUSTER_CHANGE_QUORUM_V2; typedef enum CLUSTER_CHANGE_SHARED_VOLUME_V2 { CLUSTER_CHANGE_SHARED_VOLUME_STATE_V2 = 0x1, CLUSTER_CHANGE_SHARED_VOLUME_ADDED_V2 = 0x2, CLUSTER_CHANGE_SHARED_VOLUME_REMOVED_V2 = 0x4, CLUSTER_CHANGE_SHARED_VOLUME_ALL_V2 = ( ( CLUSTER_CHANGE_SHARED_VOLUME_STATE_V2 | CLUSTER_CHANGE_SHARED_VOLUME_ADDED_V2 ) | CLUSTER_CHANGE_SHARED_VOLUME_REMOVED_V2 ) } CLUSTER_CHANGE_SHARED_VOLUME_V2; typedef enum CLUSTER_CHANGE_SPACEPORT_V2 { CLUSTER_CHANGE_SPACEPORT_CUSTOM_PNP_V2 = 0x1 } CLUSTER_CHANGE_SPACEPORT_V2; typedef enum CLUSTER_CHANGE_NODE_UPGRADE_PHASE_V2 { CLUSTER_CHANGE_UPGRADE_NODE_PREPARE = 0x1, CLUSTER_CHANGE_UPGRADE_NODE_COMMIT = 0x2, CLUSTER_CHANGE_UPGRADE_NODE_POSTCOMMIT = 0x4, CLUSTER_CHANGE_UPGRADE_ALL = ( ( CLUSTER_CHANGE_UPGRADE_NODE_PREPARE | CLUSTER_CHANGE_UPGRADE_NODE_COMMIT ) | CLUSTER_CHANGE_UPGRADE_NODE_POSTCOMMIT ) } CLUSTER_CHANGE_NODE_UPGRADE_PHASE_V2; typedef enum CLUSTER_OBJECT_TYPE { CLUSTER_OBJECT_TYPE_NONE = 0, CLUSTER_OBJECT_TYPE_CLUSTER = 0x1, CLUSTER_OBJECT_TYPE_GROUP = 0x2, CLUSTER_OBJECT_TYPE_RESOURCE = 0x3, CLUSTER_OBJECT_TYPE_RESOURCE_TYPE = 0x4, CLUSTER_OBJECT_TYPE_NETWORK_INTERFACE = 0x5, CLUSTER_OBJECT_TYPE_NETWORK = 0x6, CLUSTER_OBJECT_TYPE_NODE = 0x7, CLUSTER_OBJECT_TYPE_REGISTRY = 0x8, CLUSTER_OBJECT_TYPE_QUORUM = 0x9, CLUSTER_OBJECT_TYPE_SHARED_VOLUME = 0xa, CLUSTER_OBJECT_TYPE_GROUPSET = 0xd } CLUSTER_OBJECT_TYPE; typedef struct _NOTIFY_FILTER_AND_TYPE { DWORD dwObjectType; LONGLONG FilterFlags; } NOTIFY_FILTER_AND_TYPE; typedef struct _NOTIFY_FILTER_AND_TYPE *PNOTIFY_FILTER_AND_TYPE; typedef struct _CLUSTER_MEMBERSHIP_INFO { BOOL HasQuorum; DWORD UpnodesSize; BYTE Upnodes[ 1 ]; } CLUSTER_MEMBERSHIP_INFO; typedef struct _CLUSTER_MEMBERSHIP_INFO *PCLUSTER_MEMBERSHIP_INFO; typedef enum CLUSTER_ENUM { CLUSTER_ENUM_NODE = 0x1, CLUSTER_ENUM_RESTYPE = 0x2, CLUSTER_ENUM_RESOURCE = 0x4, CLUSTER_ENUM_GROUP = 0x8, CLUSTER_ENUM_NETWORK = 0x10, CLUSTER_ENUM_NETINTERFACE = 0x20, CLUSTER_ENUM_SHARED_VOLUME_GROUP = 0x20000000, CLUSTER_ENUM_SHARED_VOLUME_RESOURCE = 0x40000000, CLUSTER_ENUM_INTERNAL_NETWORK = 0x80000000, CLUSTER_ENUM_ALL = ( ( ( ( ( CLUSTER_ENUM_NODE | CLUSTER_ENUM_RESTYPE ) | CLUSTER_ENUM_RESOURCE ) | CLUSTER_ENUM_GROUP ) | CLUSTER_ENUM_NETWORK ) | CLUSTER_ENUM_NETINTERFACE ) } CLUSTER_ENUM; typedef enum CLUSTER_NODE_ENUM { CLUSTER_NODE_ENUM_NETINTERFACES = 0x1, CLUSTER_NODE_ENUM_GROUPS = 0x2, CLUSTER_NODE_ENUM_PREFERRED_GROUPS = 0x4, CLUSTER_NODE_ENUM_ALL = ( CLUSTER_NODE_ENUM_NETINTERFACES | CLUSTER_NODE_ENUM_GROUPS ) } CLUSTER_NODE_ENUM; typedef enum CLUSTER_NODE_STATE { ClusterNodeStateUnknown = -1, ClusterNodeUp = ( ClusterNodeStateUnknown + 1 ) , ClusterNodeDown = ( ClusterNodeUp + 1 ) , ClusterNodePaused = ( ClusterNodeDown + 1 ) , ClusterNodeJoining = ( ClusterNodePaused + 1 ) } CLUSTER_NODE_STATE; typedef enum CLUSTER_NODE_DRAIN_STATUS { NodeDrainStatusNotInitiated = 0, NodeDrainStatusInProgress = ( NodeDrainStatusNotInitiated + 1 ) , NodeDrainStatusCompleted = ( NodeDrainStatusInProgress + 1 ) , NodeDrainStatusFailed = ( NodeDrainStatusCompleted + 1 ) , ClusterNodeDrainStatusCount = ( NodeDrainStatusFailed + 1 ) } CLUSTER_NODE_DRAIN_STATUS; typedef enum CLUSTER_NODE_STATUS { NodeStatusNormal = 0, NodeStatusIsolated = 0x1, NodeStatusQuarantined = 0x2, NodeStatusDrainInProgress = 0x4, NodeStatusDrainCompleted = 0x8, NodeStatusDrainFailed = 0x10, NodeStatusMax = ( ( NodeStatusIsolated | NodeStatusQuarantined ) | NodeStatusDrainFailed ) } CLUSTER_NODE_STATUS; typedef enum CLUSTER_GROUP_ENUM { CLUSTER_GROUP_ENUM_CONTAINS = 0x1, CLUSTER_GROUP_ENUM_NODES = 0x2, CLUSTER_GROUP_ENUM_ALL = ( CLUSTER_GROUP_ENUM_CONTAINS | CLUSTER_GROUP_ENUM_NODES ) } CLUSTER_GROUP_ENUM; typedef enum CLUSTER_GROUP_STATE { ClusterGroupStateUnknown = -1, ClusterGroupOnline = ( ClusterGroupStateUnknown + 1 ) , ClusterGroupOffline = ( ClusterGroupOnline + 1 ) , ClusterGroupFailed = ( ClusterGroupOffline + 1 ) , ClusterGroupPartialOnline = ( ClusterGroupFailed + 1 ) , ClusterGroupPending = ( ClusterGroupPartialOnline + 1 ) } CLUSTER_GROUP_STATE; typedef enum CLUSTER_GROUP_PRIORITY { PriorityDisabled = 0, PriorityLow = 1000, PriorityMedium = 2000, PriorityHigh = 3000 } CLUSTER_GROUP_PRIORITY; typedef enum CLUSTER_GROUP_AUTOFAILBACK_TYPE { ClusterGroupPreventFailback = 0, ClusterGroupAllowFailback = ( ClusterGroupPreventFailback + 1 ) , ClusterGroupFailbackTypeCount = ( ClusterGroupAllowFailback + 1 ) } CLUSTER_GROUP_AUTOFAILBACK_TYPE; typedef enum CLUSTER_GROUP_AUTOFAILBACK_TYPE CGAFT; typedef struct _CLUSTER_GROUP_ENUM_ITEM { DWORD dwVersion; DWORD cbId; LPWSTR lpszId; DWORD cbName; LPWSTR lpszName; CLUSTER_GROUP_STATE state; DWORD cbOwnerNode; LPWSTR lpszOwnerNode; DWORD dwFlags; DWORD cbProperties; PVOID pProperties; DWORD cbRoProperties; PVOID pRoProperties; } CLUSTER_GROUP_ENUM_ITEM; typedef struct _CLUSTER_GROUP_ENUM_ITEM *PCLUSTER_GROUP_ENUM_ITEM; typedef struct _CLUSTER_RESOURCE_ENUM_ITEM { DWORD dwVersion; DWORD cbId; LPWSTR lpszId; DWORD cbName; LPWSTR lpszName; DWORD cbOwnerGroupName; LPWSTR lpszOwnerGroupName; DWORD cbOwnerGroupId; LPWSTR lpszOwnerGroupId; DWORD cbProperties; PVOID pProperties; DWORD cbRoProperties; PVOID pRoProperties; } CLUSTER_RESOURCE_ENUM_ITEM; typedef struct _CLUSTER_RESOURCE_ENUM_ITEM *PCLUSTER_RESOURCE_ENUM_ITEM; typedef enum CLUSTER_RESOURCE_STATE { ClusterResourceStateUnknown = -1, ClusterResourceInherited = ( ClusterResourceStateUnknown + 1 ) , ClusterResourceInitializing = ( ClusterResourceInherited + 1 ) , ClusterResourceOnline = ( ClusterResourceInitializing + 1 ) , ClusterResourceOffline = ( ClusterResourceOnline + 1 ) , ClusterResourceFailed = ( ClusterResourceOffline + 1 ) , ClusterResourcePending = 128, ClusterResourceOnlinePending = ( ClusterResourcePending + 1 ) , ClusterResourceOfflinePending = ( ClusterResourceOnlinePending + 1 ) } CLUSTER_RESOURCE_STATE; typedef enum CLUSTER_RESOURCE_RESTART_ACTION { ClusterResourceDontRestart = 0, ClusterResourceRestartNoNotify = ( ClusterResourceDontRestart + 1 ) , ClusterResourceRestartNotify = ( ClusterResourceRestartNoNotify + 1 ) , ClusterResourceRestartActionCount = ( ClusterResourceRestartNotify + 1 ) } CLUSTER_RESOURCE_RESTART_ACTION; typedef enum CLUSTER_RESOURCE_RESTART_ACTION CRRA; typedef enum CLUSTER_RESOURCE_EMBEDDED_FAILURE_ACTION { ClusterResourceEmbeddedFailureActionNone = 0, ClusterResourceEmbeddedFailureActionLogOnly = 1, ClusterResourceEmbeddedFailureActionRecover = ( ClusterResourceEmbeddedFailureActionLogOnly + 1 ) } CLUSTER_RESOURCE_EMBEDDED_FAILURE_ACTION; typedef enum CLUSTER_RESOURCE_CREATE_FLAGS { CLUSTER_RESOURCE_DEFAULT_MONITOR = 0, CLUSTER_RESOURCE_SEPARATE_MONITOR = 1, CLUSTER_RESOURCE_VALID_FLAGS = CLUSTER_RESOURCE_SEPARATE_MONITOR } CLUSTER_RESOURCE_CREATE_FLAGS; typedef enum CLUSTER_SHARED_VOLUME_SNAPSHOT_STATE { ClusterSharedVolumeSnapshotStateUnknown = 0, ClusterSharedVolumePrepareForHWSnapshot = ( ClusterSharedVolumeSnapshotStateUnknown + 1 ) , ClusterSharedVolumeHWSnapshotCompleted = ( ClusterSharedVolumePrepareForHWSnapshot + 1 ) , ClusterSharedVolumePrepareForFreeze = ( ClusterSharedVolumeHWSnapshotCompleted + 1 ) } CLUSTER_SHARED_VOLUME_SNAPSHOT_STATE; typedef enum CLUSTER_PROPERTY_TYPE { CLUSPROP_TYPE_UNKNOWN = -1, CLUSPROP_TYPE_ENDMARK = 0, CLUSPROP_TYPE_LIST_VALUE = ( CLUSPROP_TYPE_ENDMARK + 1 ) , CLUSPROP_TYPE_RESCLASS = ( CLUSPROP_TYPE_LIST_VALUE + 1 ) , CLUSPROP_TYPE_RESERVED1 = ( CLUSPROP_TYPE_RESCLASS + 1 ) , CLUSPROP_TYPE_NAME = ( CLUSPROP_TYPE_RESERVED1 + 1 ) , CLUSPROP_TYPE_SIGNATURE = ( CLUSPROP_TYPE_NAME + 1 ) , CLUSPROP_TYPE_SCSI_ADDRESS = ( CLUSPROP_TYPE_SIGNATURE + 1 ) , CLUSPROP_TYPE_DISK_NUMBER = ( CLUSPROP_TYPE_SCSI_ADDRESS + 1 ) , CLUSPROP_TYPE_PARTITION_INFO = ( CLUSPROP_TYPE_DISK_NUMBER + 1 ) , CLUSPROP_TYPE_FTSET_INFO = ( CLUSPROP_TYPE_PARTITION_INFO + 1 ) , CLUSPROP_TYPE_DISK_SERIALNUMBER = ( CLUSPROP_TYPE_FTSET_INFO + 1 ) , CLUSPROP_TYPE_DISK_GUID = ( CLUSPROP_TYPE_DISK_SERIALNUMBER + 1 ) , CLUSPROP_TYPE_DISK_SIZE = ( CLUSPROP_TYPE_DISK_GUID + 1 ) , CLUSPROP_TYPE_PARTITION_INFO_EX = ( CLUSPROP_TYPE_DISK_SIZE + 1 ) , CLUSPROP_TYPE_PARTITION_INFO_EX2 = ( CLUSPROP_TYPE_PARTITION_INFO_EX + 1 ) , CLUSPROP_TYPE_STORAGE_DEVICE_ID_DESCRIPTOR = ( CLUSPROP_TYPE_PARTITION_INFO_EX2 + 1 ) , CLUSPROP_TYPE_USER = 32768 } CLUSTER_PROPERTY_TYPE; typedef enum CLUSTER_PROPERTY_FORMAT { CLUSPROP_FORMAT_UNKNOWN = 0, CLUSPROP_FORMAT_BINARY = ( CLUSPROP_FORMAT_UNKNOWN + 1 ) , CLUSPROP_FORMAT_DWORD = ( CLUSPROP_FORMAT_BINARY + 1 ) , CLUSPROP_FORMAT_SZ = ( CLUSPROP_FORMAT_DWORD + 1 ) , CLUSPROP_FORMAT_EXPAND_SZ = ( CLUSPROP_FORMAT_SZ + 1 ) , CLUSPROP_FORMAT_MULTI_SZ = ( CLUSPROP_FORMAT_EXPAND_SZ + 1 ) , CLUSPROP_FORMAT_ULARGE_INTEGER = ( CLUSPROP_FORMAT_MULTI_SZ + 1 ) , CLUSPROP_FORMAT_LONG = ( CLUSPROP_FORMAT_ULARGE_INTEGER + 1 ) , CLUSPROP_FORMAT_EXPANDED_SZ = ( CLUSPROP_FORMAT_LONG + 1 ) , CLUSPROP_FORMAT_SECURITY_DESCRIPTOR = ( CLUSPROP_FORMAT_EXPANDED_SZ + 1 ) , CLUSPROP_FORMAT_LARGE_INTEGER = ( CLUSPROP_FORMAT_SECURITY_DESCRIPTOR + 1 ) , CLUSPROP_FORMAT_WORD = ( CLUSPROP_FORMAT_LARGE_INTEGER + 1 ) , CLUSPROP_FORMAT_FILETIME = ( CLUSPROP_FORMAT_WORD + 1 ) , CLUSPROP_FORMAT_VALUE_LIST = ( CLUSPROP_FORMAT_FILETIME + 1 ) , CLUSPROP_FORMAT_PROPERTY_LIST = ( CLUSPROP_FORMAT_VALUE_LIST + 1 ) , CLUSPROP_FORMAT_USER = 32768 } CLUSTER_PROPERTY_FORMAT; typedef enum CLUSTER_PROPERTY_SYNTAX { CLUSPROP_SYNTAX_ENDMARK = ( DWORD )(( ( CLUSPROP_TYPE_ENDMARK << 16 ) | CLUSPROP_FORMAT_UNKNOWN ) ), CLUSPROP_SYNTAX_NAME = ( DWORD )(( ( CLUSPROP_TYPE_NAME << 16 ) | CLUSPROP_FORMAT_SZ ) ), CLUSPROP_SYNTAX_RESCLASS = ( DWORD )(( ( CLUSPROP_TYPE_RESCLASS << 16 ) | CLUSPROP_FORMAT_DWORD ) ), CLUSPROP_SYNTAX_LIST_VALUE_SZ = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_SZ ) ), CLUSPROP_SYNTAX_LIST_VALUE_EXPAND_SZ = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_EXPAND_SZ ) ), CLUSPROP_SYNTAX_LIST_VALUE_DWORD = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_DWORD ) ), CLUSPROP_SYNTAX_LIST_VALUE_BINARY = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_BINARY ) ), CLUSPROP_SYNTAX_LIST_VALUE_MULTI_SZ = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_MULTI_SZ ) ), CLUSPROP_SYNTAX_LIST_VALUE_LONG = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_LONG ) ), CLUSPROP_SYNTAX_LIST_VALUE_EXPANDED_SZ = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_EXPANDED_SZ ) ), CLUSPROP_SYNTAX_LIST_VALUE_SECURITY_DESCRIPTOR = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_SECURITY_DESCRIPTOR ) ), CLUSPROP_SYNTAX_LIST_VALUE_LARGE_INTEGER = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_LARGE_INTEGER ) ), CLUSPROP_SYNTAX_LIST_VALUE_ULARGE_INTEGER = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_ULARGE_INTEGER ) ), CLUSPROP_SYNTAX_LIST_VALUE_WORD = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_WORD ) ), CLUSPROP_SYNTAX_LIST_VALUE_PROPERTY_LIST = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_PROPERTY_LIST ) ), CLUSPROP_SYNTAX_LIST_VALUE_FILETIME = ( DWORD )(( ( CLUSPROP_TYPE_LIST_VALUE << 16 ) | CLUSPROP_FORMAT_FILETIME ) ), CLUSPROP_SYNTAX_DISK_SIGNATURE = ( DWORD )(( ( CLUSPROP_TYPE_SIGNATURE << 16 ) | CLUSPROP_FORMAT_DWORD ) ), CLUSPROP_SYNTAX_SCSI_ADDRESS = ( DWORD )(( ( CLUSPROP_TYPE_SCSI_ADDRESS << 16 ) | CLUSPROP_FORMAT_DWORD ) ), CLUSPROP_SYNTAX_DISK_NUMBER = ( DWORD )(( ( CLUSPROP_TYPE_DISK_NUMBER << 16 ) | CLUSPROP_FORMAT_DWORD ) ), CLUSPROP_SYNTAX_PARTITION_INFO = ( DWORD )(( ( CLUSPROP_TYPE_PARTITION_INFO << 16 ) | CLUSPROP_FORMAT_BINARY ) ), CLUSPROP_SYNTAX_FTSET_INFO = ( DWORD )(( ( CLUSPROP_TYPE_FTSET_INFO << 16 ) | CLUSPROP_FORMAT_BINARY ) ), CLUSPROP_SYNTAX_DISK_SERIALNUMBER = ( DWORD )(( ( CLUSPROP_TYPE_DISK_SERIALNUMBER << 16 ) | CLUSPROP_FORMAT_SZ ) ), CLUSPROP_SYNTAX_DISK_GUID = ( DWORD )(( ( CLUSPROP_TYPE_DISK_GUID << 16 ) | CLUSPROP_FORMAT_SZ ) ), CLUSPROP_SYNTAX_DISK_SIZE = ( DWORD )(( ( CLUSPROP_TYPE_DISK_SIZE << 16 ) | CLUSPROP_FORMAT_ULARGE_INTEGER ) ), CLUSPROP_SYNTAX_PARTITION_INFO_EX = ( DWORD )(( ( CLUSPROP_TYPE_PARTITION_INFO_EX << 16 ) | CLUSPROP_FORMAT_BINARY ) ), CLUSPROP_SYNTAX_PARTITION_INFO_EX2 = ( DWORD )(( ( CLUSPROP_TYPE_PARTITION_INFO_EX2 << 16 ) | CLUSPROP_FORMAT_BINARY ) ), CLUSPROP_SYNTAX_STORAGE_DEVICE_ID_DESCRIPTOR = ( DWORD )(( ( CLUSPROP_TYPE_STORAGE_DEVICE_ID_DESCRIPTOR << 16 ) | CLUSPROP_FORMAT_BINARY ) ) } CLUSTER_PROPERTY_SYNTAX; typedef struct GROUP_FAILURE_INFO { DWORD dwFailoverAttemptsRemaining; DWORD dwFailoverPeriodRemaining; } GROUP_FAILURE_INFO; typedef struct GROUP_FAILURE_INFO *PGROUP_FAILURE_INFO; typedef struct GROUP_FAILURE_INFO_BUFFER { DWORD dwVersion; GROUP_FAILURE_INFO Info; } GROUP_FAILURE_INFO_BUFFER; typedef struct GROUP_FAILURE_INFO_BUFFER *PGROUP_FAILURE_INFO_BUFFER; typedef struct RESOURCE_FAILURE_INFO { DWORD dwRestartAttemptsRemaining; DWORD dwRestartPeriodRemaining; } RESOURCE_FAILURE_INFO; typedef struct RESOURCE_FAILURE_INFO *PRESOURCE_FAILURE_INFO; typedef struct RESOURCE_FAILURE_INFO_BUFFER { DWORD dwVersion; RESOURCE_FAILURE_INFO Info; } RESOURCE_FAILURE_INFO_BUFFER; typedef struct RESOURCE_FAILURE_INFO_BUFFER *PRESOURCE_FAILURE_INFO_BUFFER; typedef struct RESOURCE_TERMINAL_FAILURE_INFO_BUFFER { BOOL isTerminalFailure; DWORD restartPeriodRemaining; } RESOURCE_TERMINAL_FAILURE_INFO_BUFFER; typedef struct RESOURCE_TERMINAL_FAILURE_INFO_BUFFER *PRESOURCE_TERMINAL_FAILURE_INFO_BUFFER; typedef enum CLUSTER_CONTROL_OBJECT { CLUS_OBJECT_INVALID = 0, CLUS_OBJECT_RESOURCE = ( CLUS_OBJECT_INVALID + 1 ) , CLUS_OBJECT_RESOURCE_TYPE = ( CLUS_OBJECT_RESOURCE + 1 ) , CLUS_OBJECT_GROUP = ( CLUS_OBJECT_RESOURCE_TYPE + 1 ) , CLUS_OBJECT_NODE = ( CLUS_OBJECT_GROUP + 1 ) , CLUS_OBJECT_NETWORK = ( CLUS_OBJECT_NODE + 1 ) , CLUS_OBJECT_NETINTERFACE = ( CLUS_OBJECT_NETWORK + 1 ) , CLUS_OBJECT_CLUSTER = ( CLUS_OBJECT_NETINTERFACE + 1 ) , CLUS_OBJECT_GROUPSET = ( CLUS_OBJECT_CLUSTER + 1 ) , CLUS_OBJECT_USER = 128 } CLUSTER_CONTROL_OBJECT; typedef enum CLCTL_CODES { CLCTL_UNKNOWN = ( ( ( 0 << 0 ) | ( ( 0 + 0 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_CHARACTERISTICS = ( ( ( 0x1 << 0 ) | ( ( 0 + 1 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_FLAGS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_CLASS_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 3 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_REQUIRED_DEPENDENCIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 4 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_ARB_TIMEOUT = ( ( ( 0x1 << 0 ) | ( ( 0 + 5 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_FAILURE_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 6 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_NAME = ( ( ( 0x1 << 0 ) | ( ( 0 + 10 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_RESOURCE_TYPE = ( ( ( 0x1 << 0 ) | ( ( 0 + 11 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_NODE = ( ( ( 0x1 << 0 ) | ( ( 0 + 12 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_NETWORK = ( ( ( 0x1 << 0 ) | ( ( 0 + 13 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_ID = ( ( ( 0x1 << 0 ) | ( ( 0 + 14 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_FQDN = ( ( ( 0x1 << 0 ) | ( ( 0 + 15 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_CLUSTER_SERVICE_ACCOUNT_NAME = ( ( ( 0x1 << 0 ) | ( ( 0 + 16 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_CHECK_VOTER_EVICT = ( ( ( 0x1 << 0 ) | ( ( 0 + 17 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_CHECK_VOTER_DOWN = ( ( ( 0x1 << 0 ) | ( ( 0 + 18 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SHUTDOWN = ( ( ( 0x1 << 0 ) | ( ( 0 + 19 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_ENUM_COMMON_PROPERTIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 20 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_RO_COMMON_PROPERTIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 21 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_COMMON_PROPERTIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 22 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SET_COMMON_PROPERTIES = ( ( ( 0x2 << 0 ) | ( ( 0 + 23 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_VALIDATE_COMMON_PROPERTIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 24 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_COMMON_PROPERTY_FMTS = ( ( ( 0x1 << 0 ) | ( ( 0 + 25 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_COMMON_RESOURCE_PROPERTY_FMTS = ( ( ( 0x1 << 0 ) | ( ( 0 + 26 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_ENUM_PRIVATE_PROPERTIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 30 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_RO_PRIVATE_PROPERTIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 31 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_PRIVATE_PROPERTIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 32 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SET_PRIVATE_PROPERTIES = ( ( ( 0x2 << 0 ) | ( ( 0 + 33 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_VALIDATE_PRIVATE_PROPERTIES = ( ( ( 0x1 << 0 ) | ( ( 0 + 34 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_PRIVATE_PROPERTY_FMTS = ( ( ( 0x1 << 0 ) | ( ( 0 + 35 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_PRIVATE_RESOURCE_PROPERTY_FMTS = ( ( ( 0x1 << 0 ) | ( ( 0 + 36 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_ADD_REGISTRY_CHECKPOINT = ( ( ( 0x2 << 0 ) | ( ( 0 + 40 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_DELETE_REGISTRY_CHECKPOINT = ( ( ( 0x2 << 0 ) | ( ( 0 + 41 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GET_REGISTRY_CHECKPOINTS = ( ( ( 0x1 << 0 ) | ( ( 0 + 42 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_ADD_CRYPTO_CHECKPOINT = ( ( ( 0x2 << 0 ) | ( ( 0 + 43 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_DELETE_CRYPTO_CHECKPOINT = ( ( ( 0x2 << 0 ) | ( ( 0 + 44 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GET_CRYPTO_CHECKPOINTS = ( ( ( 0x1 << 0 ) | ( ( 0 + 45 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_RESOURCE_UPGRADE_DLL = ( ( ( 0x2 << 0 ) | ( ( 0 + 46 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_ADD_REGISTRY_CHECKPOINT_64BIT = ( ( ( 0x2 << 0 ) | ( ( 0 + 47 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_ADD_REGISTRY_CHECKPOINT_32BIT = ( ( ( 0x2 << 0 ) | ( ( 0 + 48 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GET_LOADBAL_PROCESS_LIST = ( ( ( 0x1 << 0 ) | ( ( 0 + 50 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SET_ACCOUNT_ACCESS = ( ( ( 0x2 << 0 ) | ( ( 0 + 60 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GET_NETWORK_NAME = ( ( ( 0x1 << 0 ) | ( ( 0 + 90 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NETNAME_GET_VIRTUAL_SERVER_TOKEN = ( ( ( 0x1 << 0 ) | ( ( 0 + 91 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NETNAME_REGISTER_DNS_RECORDS = ( ( ( 0x2 << 0 ) | ( ( 0 + 92 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_DNS_NAME = ( ( ( 0x1 << 0 ) | ( ( 0 + 93 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NETNAME_SET_PWD_INFO = ( ( ( 0x2 << 0 ) | ( ( 0 + 94 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NETNAME_DELETE_CO = ( ( ( 0x2 << 0 ) | ( ( 0 + 95 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NETNAME_VALIDATE_VCO = ( ( ( 0x1 << 0 ) | ( ( 0 + 96 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NETNAME_RESET_VCO = ( ( ( 0x1 << 0 ) | ( ( 0 + 97 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NETNAME_REPAIR_VCO = ( ( ( 0x1 << 0 ) | ( ( 0 + 99 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_DISK_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 100 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_AVAILABLE_DISKS = ( ( ( 0x1 << 0 ) | ( ( 0 + 101 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_IS_PATH_VALID = ( ( ( 0x1 << 0 ) | ( ( 0 + 102 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_SYNC_CLUSDISK_DB = ( ( ( 0x2 << 0 ) | ( ( 0 + 103 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STORAGE_GET_DISK_NUMBER_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 104 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_QUERY_DELETE = ( ( ( 0x1 << 0 ) | ( ( 0 + 110 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_IPADDRESS_RENEW_LEASE = ( ( ( 0x2 << 0 ) | ( ( 0 + 111 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_IPADDRESS_RELEASE_LEASE = ( ( ( 0x2 << 0 ) | ( ( 0 + 112 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_QUERY_MAINTENANCE_MODE = ( ( ( 0x1 << 0 ) | ( ( 0 + 120 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SET_MAINTENANCE_MODE = ( ( ( 0x2 << 0 ) | ( ( 0 + 121 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STORAGE_SET_DRIVELETTER = ( ( ( 0x2 << 0 ) | ( ( 0 + 122 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STORAGE_GET_DRIVELETTERS = ( ( ( 0x1 << 0 ) | ( ( 0 + 123 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_DISK_INFO_EX = ( ( ( 0x1 << 0 ) | ( ( 0 + 124 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_AVAILABLE_DISKS_EX = ( ( ( 0x1 << 0 ) | ( ( 0 + 125 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_DISK_INFO_EX2 = ( ( ( 0x1 << 0 ) | ( ( 0 + 126 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_CLUSPORT_DISK_COUNT = ( ( ( 0x1 << 0 ) | ( ( 0 + 127 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_REMAP_DRIVELETTER = ( ( ( 0x1 << 0 ) | ( ( 0 + 128 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_DISKID = ( ( ( 0x1 << 0 ) | ( ( 0 + 129 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_IS_CLUSTERABLE = ( ( ( 0x1 << 0 ) | ( ( 0 + 130 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_REMOVE_VM_OWNERSHIP = ( ( ( 0x2 << 0 ) | ( ( 0 + 131 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STORAGE_GET_MOUNTPOINTS = ( ( ( 0x1 << 0 ) | ( ( 0 + 132 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_DIRTY = ( ( ( 0x1 << 0 ) | ( ( 0 + 134 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_SHARED_VOLUME_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 137 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_IS_CSV_FILE = ( ( ( 0x1 << 0 ) | ( ( 0 + 138 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_RESOURCEID = ( ( ( 0x1 << 0 ) | ( ( 0 + 139 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_VALIDATE_PATH = ( ( ( 0x1 << 0 ) | ( ( 0 + 140 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_VALIDATE_NETNAME = ( ( ( 0x1 << 0 ) | ( ( 0 + 141 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_VALIDATE_DIRECTORY = ( ( ( 0x1 << 0 ) | ( ( 0 + 142 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_BATCH_BLOCK_KEY = ( ( ( 0x2 << 0 ) | ( ( 0 + 143 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_BATCH_UNBLOCK_KEY = ( ( ( 0x1 << 0 ) | ( ( 0 + 144 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_FILESERVER_SHARE_ADD = ( ( ( 0x2 << 0 ) | ( ( 0 + 145 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_FILESERVER_SHARE_DEL = ( ( ( 0x2 << 0 ) | ( ( 0 + 146 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_FILESERVER_SHARE_MODIFY = ( ( ( 0x2 << 0 ) | ( ( 0 + 147 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_FILESERVER_SHARE_REPORT = ( ( ( 0x1 << 0 ) | ( ( 0 + 148 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NETNAME_GET_OU_FOR_VCO = ( ( ( 0x2 << 0 ) | ( ( 0 + 155 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_ENABLE_SHARED_VOLUME_DIRECTIO = ( ( ( 0x2 << 0 ) | ( ( 0 + 162 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_DISABLE_SHARED_VOLUME_DIRECTIO = ( ( ( 0x2 << 0 ) | ( ( 0 + 163 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GET_SHARED_VOLUME_ID = ( ( ( 0x1 << 0 ) | ( ( 0 + 164 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SET_CSV_MAINTENANCE_MODE = ( ( ( 0x2 << 0 ) | ( ( 0 + 165 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_SET_SHARED_VOLUME_BACKUP_MODE = ( ( ( 0x2 << 0 ) | ( ( 0 + 166 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STORAGE_GET_SHARED_VOLUME_PARTITION_NAMES = ( ( ( 0x1 << 0 ) | ( ( 0 + 167 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_SHARED_VOLUME_STATES = ( ( ( 0x2 << 0 ) | ( ( 0 + 168 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STORAGE_IS_SHARED_VOLUME = ( ( ( 0x1 << 0 ) | ( ( 0 + 169 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_CLUSDB_TIMESTAMP = ( ( ( 0x1 << 0 ) | ( ( 0 + 170 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_RW_MODIFY_NOOP = ( ( ( 0x2 << 0 ) | ( ( 0 + 171 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_IS_QUORUM_BLOCKED = ( ( ( 0x1 << 0 ) | ( ( 0 + 172 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_POOL_GET_DRIVE_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 173 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_GUM_LOCK_OWNER = ( ( ( 0x1 << 0 ) | ( ( 0 + 174 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_STUCK_NODES = ( ( ( 0x1 << 0 ) | ( ( 0 + 175 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_INJECT_GEM_FAULT = ( ( ( 0x1 << 0 ) | ( ( 0 + 176 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_INTRODUCE_GEM_REPAIR_DELAY = ( ( ( 0x1 << 0 ) | ( ( 0 + 177 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SEND_DUMMY_GEM_MESSAGES = ( ( ( 0x1 << 0 ) | ( ( 0 + 178 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_BLOCK_GEM_SEND_RECV = ( ( ( 0x1 << 0 ) | ( ( 0 + 179 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_GEMID_VECTOR = ( ( ( 0x1 << 0 ) | ( ( 0 + 180 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_ADD_CRYPTO_CHECKPOINT_EX = ( ( ( 0x2 << 0 ) | ( ( 0 + 181 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GROUP_GET_LAST_MOVE_TIME = ( ( ( 0x1 << 0 ) | ( ( 0 + 182 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SET_STORAGE_CONFIGURATION = ( ( ( 0x2 << 0 ) | ( ( 0 + 184 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GET_STORAGE_CONFIGURATION = ( ( ( 0x1 << 0 ) | ( ( 0 + 185 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_STORAGE_CONFIG_ATTRIBUTES = ( ( ( 0x1 << 0 ) | ( ( 0 + 186 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REMOVE_NODE = ( ( ( 0x2 << 0 ) | ( ( 0 + 187 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_IS_FEATURE_INSTALLED = ( ( ( 0x1 << 0 ) | ( ( 0 + 188 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_IS_S2D_FEATURE_SUPPORTED = ( ( ( 0x1 << 0 ) | ( ( 0 + 189 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_PHYSICAL_DISK_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 190 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_CLUSBFLT_PATHS = ( ( ( 0x1 << 0 ) | ( ( 0 + 191 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_CLUSBFLT_PATHINFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 192 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_CLEAR_NODE_CONNECTION_INFO = ( ( ( 0x2 << 0 ) | ( ( 0 + 193 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_SET_DNS_DOMAIN = ( ( ( 0x2 << 0 ) | ( ( 0 + 194 ) << 2 ) ) | ( 0x1 << 22 ) ) , CTCTL_GET_ROUTESTATUS_BASIC = ( ( ( 0x1 << 0 ) | ( ( 0 + 195 ) << 2 ) ) | ( 0 << 22 ) ) , CTCTL_GET_ROUTESTATUS_EXTENDED = ( ( ( 0x1 << 0 ) | ( ( 0 + 196 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_STORAGE_GET_AVAILABLE_DISKS_EX2_INT = ( ( ( 0x1 << 0 ) | ( ( 0 + 2040 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_CLOUD_WITNESS_RESOURCE_TYPE_VALIDATE_CREDENTIALS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2104 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_CLOUD_WITNESS_RESOURCE_UPDATE_TOKEN = ( ( ( 0x2 << 0 ) | ( ( 0 + 2105 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_RESOURCE_PREPARE_UPGRADE = ( ( ( 0x2 << 0 ) | ( ( 0 + 2106 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_RESOURCE_UPGRADE_COMPLETED = ( ( ( 0x2 << 0 ) | ( ( 0 + 2107 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_CLOUD_WITNESS_RESOURCE_TYPE_VALIDATE_CREDENTIALS_WITH_KEY = ( ( ( 0x1 << 0 ) | ( ( 0 + 2108 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_CLOUD_WITNESS_RESOURCE_UPDATE_KEY = ( ( ( 0x2 << 0 ) | ( ( 0 + 2109 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_REPLICATION_GET_LOG_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 2129 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REPLICATION_GET_ELIGIBLE_LOGDISKS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2130 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REPLICATION_GET_ELIGIBLE_TARGET_DATADISKS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2131 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REPLICATION_GET_ELIGIBLE_SOURCE_DATADISKS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2132 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REPLICATION_GET_REPLICATED_DISKS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2133 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REPLICATION_GET_REPLICA_VOLUMES = ( ( ( 0x1 << 0 ) | ( ( 0 + 2134 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REPLICATION_GET_LOG_VOLUME = ( ( ( 0x1 << 0 ) | ( ( 0 + 2135 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REPLICATION_GET_RESOURCE_GROUP = ( ( ( 0x1 << 0 ) | ( ( 0 + 2136 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_REPLICATION_GET_REPLICATED_PARTITION_INFO = ( ( ( 0x1 << 0 ) | ( ( 0 + 2137 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GET_STATE_CHANGE_TIME = ( ( ( 0x1 << 0 ) | ( ( 0 + 2903 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_SET_CLUSTER_S2D_ENABLED = ( ( ( 0x2 << 0 ) | ( ( 0 + 2904 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_SET_CLUSTER_S2D_CACHE_METADATA_RESERVE_BYTES = ( ( ( 0x2 << 0 ) | ( ( 0 + 2907 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GROUPSET_GET_GROUPS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2908 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GROUPSET_GET_PROVIDER_GROUPS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2909 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GROUPSET_GET_PROVIDER_GROUPSETS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2910 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GROUP_GET_PROVIDER_GROUPS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2911 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_GROUP_GET_PROVIDER_GROUPSETS = ( ( ( 0x1 << 0 ) | ( ( 0 + 2912 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_DELETE = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 1 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_INSTALL_NODE = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 2 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_EVICT_NODE = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 3 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_ADD_DEPENDENCY = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 4 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_REMOVE_DEPENDENCY = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 5 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_ADD_OWNER = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 6 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_REMOVE_OWNER = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 7 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_SET_NAME = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 9 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_CLUSTER_NAME_CHANGED = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 10 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_CLUSTER_VERSION_CHANGED = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 11 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_FIXUP_ON_UPGRADE = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 12 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STARTING_PHASE1 = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 13 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STARTING_PHASE2 = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 14 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_HOLD_IO = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 15 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_RESUME_IO = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 16 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_FORCE_QUORUM = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 17 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_INITIALIZE = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 18 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_STATE_CHANGE_REASON = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 19 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_PROVIDER_STATE_CHANGE = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 20 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_LEAVING_GROUP = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 21 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_JOINING_GROUP = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 22 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_FSWITNESS_GET_EPOCH_INFO = ( ( ( ( 0x1 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 23 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_FSWITNESS_SET_EPOCH_INFO = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 24 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_FSWITNESS_RELEASE_LOCK = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 25 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_NETNAME_CREDS_NOTIFYCAM = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 26 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_NOTIFY_QUORUM_STATUS = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 31 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_GET_OPERATION_CONTEXT = ( ( ( ( 0x1 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 2106 ) << 2 ) ) | ( 0 << 22 ) ) , CLCTL_NOTIFY_OWNER_CHANGE = ( ( ( ( 0x2 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 2120 ) << 2 ) ) | ( 0x1 << 22 ) ) , CLCTL_VALIDATE_CHANGE_GROUP = ( ( ( ( 0x1 << 0 ) | ( 1 << 20 ) ) | ( ( 0 + 2121 ) << 2 ) ) | ( 0 << 22 ) ) } CLCTL_CODES; typedef enum CLUSCTL_RESOURCE_CODES { CLUSCTL_RESOURCE_UNKNOWN = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_UNKNOWN ) , CLUSCTL_RESOURCE_GET_CHARACTERISTICS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_CHARACTERISTICS ) , CLUSCTL_RESOURCE_GET_FLAGS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_FLAGS ) , CLUSCTL_RESOURCE_GET_CLASS_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_CLASS_INFO ) , CLUSCTL_RESOURCE_GET_REQUIRED_DEPENDENCIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_REQUIRED_DEPENDENCIES ) , CLUSCTL_RESOURCE_GET_NAME = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_NAME ) , CLUSCTL_RESOURCE_GET_ID = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_ID ) , CLUSCTL_RESOURCE_GET_RESOURCE_TYPE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_RESOURCE_TYPE ) , CLUSCTL_RESOURCE_ENUM_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ENUM_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_GET_RO_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_RO_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_GET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_SET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_SET_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_VALIDATE_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_VALIDATE_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_GET_COMMON_PROPERTY_FMTS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_COMMON_PROPERTY_FMTS ) , CLUSCTL_RESOURCE_ENUM_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ENUM_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_GET_RO_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_RO_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_SET_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_VALIDATE_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_VALIDATE_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTY_FMTS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_PRIVATE_PROPERTY_FMTS ) , CLUSCTL_RESOURCE_ADD_REGISTRY_CHECKPOINT = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ADD_REGISTRY_CHECKPOINT ) , CLUSCTL_RESOURCE_DELETE_REGISTRY_CHECKPOINT = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_DELETE_REGISTRY_CHECKPOINT ) , CLUSCTL_RESOURCE_GET_REGISTRY_CHECKPOINTS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_REGISTRY_CHECKPOINTS ) , CLUSCTL_RESOURCE_ADD_CRYPTO_CHECKPOINT = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ADD_CRYPTO_CHECKPOINT ) , CLUSCTL_RESOURCE_DELETE_CRYPTO_CHECKPOINT = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_DELETE_CRYPTO_CHECKPOINT ) , CLUSCTL_RESOURCE_ADD_CRYPTO_CHECKPOINT_EX = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ADD_CRYPTO_CHECKPOINT_EX ) , CLUSCTL_RESOURCE_GET_CRYPTO_CHECKPOINTS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_CRYPTO_CHECKPOINTS ) , CLUSCTL_RESOURCE_GET_LOADBAL_PROCESS_LIST = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_LOADBAL_PROCESS_LIST ) , CLUSCTL_RESOURCE_GET_NETWORK_NAME = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_NETWORK_NAME ) , CLUSCTL_RESOURCE_NETNAME_GET_VIRTUAL_SERVER_TOKEN = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_GET_VIRTUAL_SERVER_TOKEN ) , CLUSCTL_RESOURCE_NETNAME_SET_PWD_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_SET_PWD_INFO ) , CLUSCTL_RESOURCE_NETNAME_DELETE_CO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_DELETE_CO ) , CLUSCTL_RESOURCE_NETNAME_VALIDATE_VCO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_VALIDATE_VCO ) , CLUSCTL_RESOURCE_NETNAME_RESET_VCO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_RESET_VCO ) , CLUSCTL_RESOURCE_NETNAME_REPAIR_VCO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_REPAIR_VCO ) , CLUSCTL_RESOURCE_NETNAME_REGISTER_DNS_RECORDS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_REGISTER_DNS_RECORDS ) , CLUSCTL_RESOURCE_GET_DNS_NAME = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_DNS_NAME ) , CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_DISK_INFO ) , CLUSCTL_RESOURCE_STORAGE_GET_DISK_NUMBER_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_DISK_NUMBER_INFO ) , CLUSCTL_RESOURCE_STORAGE_IS_PATH_VALID = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_IS_PATH_VALID ) , CLUSCTL_RESOURCE_QUERY_DELETE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_QUERY_DELETE ) , CLUSCTL_RESOURCE_UPGRADE_DLL = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_RESOURCE_UPGRADE_DLL ) , CLUSCTL_RESOURCE_IPADDRESS_RENEW_LEASE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_IPADDRESS_RENEW_LEASE ) , CLUSCTL_RESOURCE_IPADDRESS_RELEASE_LEASE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_IPADDRESS_RELEASE_LEASE ) , CLUSCTL_RESOURCE_ADD_REGISTRY_CHECKPOINT_64BIT = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ADD_REGISTRY_CHECKPOINT_64BIT ) , CLUSCTL_RESOURCE_ADD_REGISTRY_CHECKPOINT_32BIT = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ADD_REGISTRY_CHECKPOINT_32BIT ) , CLUSCTL_RESOURCE_QUERY_MAINTENANCE_MODE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_QUERY_MAINTENANCE_MODE ) , CLUSCTL_RESOURCE_SET_MAINTENANCE_MODE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_SET_MAINTENANCE_MODE ) , CLUSCTL_RESOURCE_STORAGE_SET_DRIVELETTER = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_SET_DRIVELETTER ) , CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO_EX = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_DISK_INFO_EX ) , CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO_EX2 = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_DISK_INFO_EX2 ) , CLUSCTL_RESOURCE_STORAGE_GET_MOUNTPOINTS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_MOUNTPOINTS ) , CLUSCTL_RESOURCE_STORAGE_GET_DIRTY = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_DIRTY ) , CLUSCTL_RESOURCE_STORAGE_GET_SHARED_VOLUME_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_SHARED_VOLUME_INFO ) , CLUSCTL_RESOURCE_SET_CSV_MAINTENANCE_MODE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_SET_CSV_MAINTENANCE_MODE ) , CLUSCTL_RESOURCE_ENABLE_SHARED_VOLUME_DIRECTIO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ENABLE_SHARED_VOLUME_DIRECTIO ) , CLUSCTL_RESOURCE_DISABLE_SHARED_VOLUME_DIRECTIO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_DISABLE_SHARED_VOLUME_DIRECTIO ) , CLUSCTL_RESOURCE_SET_SHARED_VOLUME_BACKUP_MODE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_SET_SHARED_VOLUME_BACKUP_MODE ) , CLUSCTL_RESOURCE_STORAGE_GET_SHARED_VOLUME_PARTITION_NAMES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_SHARED_VOLUME_PARTITION_NAMES ) , CLUSCTL_RESOURCE_GET_FAILURE_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_FAILURE_INFO ) , CLUSCTL_RESOURCE_STORAGE_GET_DISKID = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_DISKID ) , CLUSCTL_RESOURCE_STORAGE_GET_SHARED_VOLUME_STATES = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_GET_SHARED_VOLUME_STATES ) , CLUSCTL_RESOURCE_STORAGE_IS_SHARED_VOLUME = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_IS_SHARED_VOLUME ) , CLUSCTL_RESOURCE_IS_QUORUM_BLOCKED = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_IS_QUORUM_BLOCKED ) , CLUSCTL_RESOURCE_POOL_GET_DRIVE_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_POOL_GET_DRIVE_INFO ) , CLUSCTL_RESOURCE_RLUA_GET_VIRTUAL_SERVER_TOKEN = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_GET_VIRTUAL_SERVER_TOKEN ) , CLUSCTL_RESOURCE_RLUA_SET_PWD_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_SET_PWD_INFO ) , CLUSCTL_RESOURCE_DELETE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_DELETE ) , CLUSCTL_RESOURCE_INSTALL_NODE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_INSTALL_NODE ) , CLUSCTL_RESOURCE_EVICT_NODE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_EVICT_NODE ) , CLUSCTL_RESOURCE_ADD_DEPENDENCY = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ADD_DEPENDENCY ) , CLUSCTL_RESOURCE_REMOVE_DEPENDENCY = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_REMOVE_DEPENDENCY ) , CLUSCTL_RESOURCE_ADD_OWNER = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_ADD_OWNER ) , CLUSCTL_RESOURCE_REMOVE_OWNER = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_REMOVE_OWNER ) , CLUSCTL_RESOURCE_SET_NAME = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_SET_NAME ) , CLUSCTL_RESOURCE_CLUSTER_NAME_CHANGED = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_CLUSTER_NAME_CHANGED ) , CLUSCTL_RESOURCE_CLUSTER_VERSION_CHANGED = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_CLUSTER_VERSION_CHANGED ) , CLUSCTL_RESOURCE_FORCE_QUORUM = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_FORCE_QUORUM ) , CLUSCTL_RESOURCE_INITIALIZE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_INITIALIZE ) , CLUSCTL_RESOURCE_STATE_CHANGE_REASON = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STATE_CHANGE_REASON ) , CLUSCTL_RESOURCE_PROVIDER_STATE_CHANGE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_PROVIDER_STATE_CHANGE ) , CLUSCTL_RESOURCE_LEAVING_GROUP = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_LEAVING_GROUP ) , CLUSCTL_RESOURCE_JOINING_GROUP = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_JOINING_GROUP ) , CLUSCTL_RESOURCE_FSWITNESS_GET_EPOCH_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_FSWITNESS_GET_EPOCH_INFO ) , CLUSCTL_RESOURCE_FSWITNESS_SET_EPOCH_INFO = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_FSWITNESS_SET_EPOCH_INFO ) , CLUSCTL_RESOURCE_FSWITNESS_RELEASE_LOCK = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_FSWITNESS_RELEASE_LOCK ) , CLUSCTL_RESOURCE_NETNAME_CREDS_NOTIFYCAM = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NETNAME_CREDS_NOTIFYCAM ) , CLUSCTL_RESOURCE_GET_OPERATION_CONTEXT = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_OPERATION_CONTEXT ) , CLUSCTL_RESOURCE_RW_MODIFY_NOOP = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_RW_MODIFY_NOOP ) , CLUSCTL_RESOURCE_NOTIFY_QUORUM_STATUS = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NOTIFY_QUORUM_STATUS ) , CLUSCTL_RESOURCE_NOTIFY_OWNER_CHANGE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_NOTIFY_OWNER_CHANGE ) , CLUSCTL_RESOURCE_VALIDATE_CHANGE_GROUP = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_VALIDATE_CHANGE_GROUP ) , CLUSCTL_CLOUD_WITNESS_RESOURCE_UPDATE_TOKEN = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_CLOUD_WITNESS_RESOURCE_UPDATE_TOKEN ) , CLUSCTL_CLOUD_WITNESS_RESOURCE_UPDATE_KEY = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_CLOUD_WITNESS_RESOURCE_UPDATE_KEY ) , CLUSCTL_RESOURCE_PREPARE_UPGRADE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_RESOURCE_PREPARE_UPGRADE ) , CLUSCTL_RESOURCE_UPGRADE_COMPLETED = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_RESOURCE_UPGRADE_COMPLETED ) , CLUSCTL_RESOURCE_GET_STATE_CHANGE_TIME = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_GET_STATE_CHANGE_TIME ) } CLUSCTL_RESOURCE_CODES; typedef enum CLUSCTL_RESOURCE_TYPE_CODES { CLUSCTL_RESOURCE_TYPE_UNKNOWN = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_UNKNOWN ) , CLUSCTL_RESOURCE_TYPE_GET_CHARACTERISTICS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_CHARACTERISTICS ) , CLUSCTL_RESOURCE_TYPE_GET_FLAGS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_FLAGS ) , CLUSCTL_RESOURCE_TYPE_GET_CLASS_INFO = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_CLASS_INFO ) , CLUSCTL_RESOURCE_TYPE_GET_REQUIRED_DEPENDENCIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_REQUIRED_DEPENDENCIES ) , CLUSCTL_RESOURCE_TYPE_GET_ARB_TIMEOUT = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_ARB_TIMEOUT ) , CLUSCTL_RESOURCE_TYPE_ENUM_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_ENUM_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_GET_RO_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_RO_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_GET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_VALIDATE_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_VALIDATE_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_SET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_SET_COMMON_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_GET_COMMON_PROPERTY_FMTS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_COMMON_PROPERTY_FMTS ) , CLUSCTL_RESOURCE_TYPE_GET_COMMON_RESOURCE_PROPERTY_FMTS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_COMMON_RESOURCE_PROPERTY_FMTS ) , CLUSCTL_RESOURCE_TYPE_ENUM_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_ENUM_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_GET_RO_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_RO_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_GET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_SET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_SET_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_VALIDATE_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_VALIDATE_PRIVATE_PROPERTIES ) , CLUSCTL_RESOURCE_TYPE_GET_PRIVATE_PROPERTY_FMTS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_PRIVATE_PROPERTY_FMTS ) , CLUSCTL_RESOURCE_TYPE_GET_PRIVATE_RESOURCE_PROPERTY_FMTS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_PRIVATE_RESOURCE_PROPERTY_FMTS ) , CLUSCTL_RESOURCE_TYPE_GET_REGISTRY_CHECKPOINTS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_REGISTRY_CHECKPOINTS ) , CLUSCTL_RESOURCE_TYPE_GET_CRYPTO_CHECKPOINTS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_GET_CRYPTO_CHECKPOINTS ) , CLUSCTL_RESOURCE_TYPE_STORAGE_GET_AVAILABLE_DISKS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_GET_AVAILABLE_DISKS ) , CLUSCTL_RESOURCE_TYPE_STORAGE_SYNC_CLUSDISK_DB = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_SYNC_CLUSDISK_DB ) , CLUSCTL_RESOURCE_TYPE_NETNAME_VALIDATE_NETNAME = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_VALIDATE_NETNAME ) , CLUSCTL_RESOURCE_TYPE_NETNAME_GET_OU_FOR_VCO = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_NETNAME_GET_OU_FOR_VCO ) , CLUSCTL_RESOURCE_TYPE_GEN_APP_VALIDATE_PATH = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_VALIDATE_PATH ) , CLUSCTL_RESOURCE_TYPE_GEN_APP_VALIDATE_DIRECTORY = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_VALIDATE_DIRECTORY ) , CLUSCTL_RESOURCE_TYPE_GEN_SCRIPT_VALIDATE_PATH = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_VALIDATE_PATH ) , CLUSCTL_RESOURCE_TYPE_QUERY_DELETE = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_QUERY_DELETE ) , CLUSCTL_RESOURCE_TYPE_STORAGE_GET_DRIVELETTERS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_GET_DRIVELETTERS ) , CLUSCTL_RESOURCE_TYPE_STORAGE_GET_AVAILABLE_DISKS_EX = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_GET_AVAILABLE_DISKS_EX ) , CLUSCTL_RESOURCE_TYPE_STORAGE_REMAP_DRIVELETTER = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_REMAP_DRIVELETTER ) , CLUSCTL_RESOURCE_TYPE_STORAGE_GET_DISKID = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_GET_DISKID ) , CLUSCTL_RESOURCE_TYPE_STORAGE_GET_RESOURCEID = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_GET_RESOURCEID ) , CLUSCTL_RESOURCE_TYPE_STORAGE_IS_CLUSTERABLE = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_IS_CLUSTERABLE ) , CLUSCTL_RESOURCE_TYPE_STORAGE_REMOVE_VM_OWNERSHIP = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_REMOVE_VM_OWNERSHIP ) , CLUSCTL_RESOURCE_TYPE_STORAGE_IS_CSV_FILE = ( ( CLUS_OBJECT_RESOURCE << 24 ) | CLCTL_STORAGE_IS_CSV_FILE ) , CLUSCTL_RESOURCE_TYPE_WITNESS_VALIDATE_PATH = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_VALIDATE_PATH ) , CLUSCTL_RESOURCE_TYPE_INSTALL_NODE = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_INSTALL_NODE ) , CLUSCTL_RESOURCE_TYPE_EVICT_NODE = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_EVICT_NODE ) , CLUSCTL_RESOURCE_TYPE_CLUSTER_VERSION_CHANGED = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_CLUSTER_VERSION_CHANGED ) , CLUSCTL_RESOURCE_TYPE_FIXUP_ON_UPGRADE = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_FIXUP_ON_UPGRADE ) , CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1 = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STARTING_PHASE1 ) , CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2 = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STARTING_PHASE2 ) , CLUSCTL_RESOURCE_TYPE_HOLD_IO = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_HOLD_IO ) , CLUSCTL_RESOURCE_TYPE_RESUME_IO = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_RESUME_IO ) , CLUSCTL_RESOURCE_TYPE_STORAGE_GET_AVAILABLE_DISKS_EX2_INT = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_STORAGE_GET_AVAILABLE_DISKS_EX2_INT ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_ELIGIBLE_LOGDISKS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_ELIGIBLE_LOGDISKS ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_ELIGIBLE_TARGET_DATADISKS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_ELIGIBLE_TARGET_DATADISKS ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_ELIGIBLE_SOURCE_DATADISKS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_ELIGIBLE_SOURCE_DATADISKS ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_REPLICATED_DISKS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_REPLICATED_DISKS ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_REPLICA_VOLUMES = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_REPLICA_VOLUMES ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_LOG_VOLUME = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_LOG_VOLUME ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_RESOURCE_GROUP = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_RESOURCE_GROUP ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_REPLICATED_PARTITION_INFO = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_REPLICATED_PARTITION_INFO ) , CLUSCTL_RESOURCE_TYPE_REPLICATION_GET_LOG_INFO = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_REPLICATION_GET_LOG_INFO ) , CLUSCTL_CLOUD_WITNESS_RESOURCE_TYPE_VALIDATE_CREDENTIALS = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_CLOUD_WITNESS_RESOURCE_TYPE_VALIDATE_CREDENTIALS ) , CLUSCTL_CLOUD_WITNESS_RESOURCE_TYPE_VALIDATE_CREDENTIALS_WITH_KEY = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_CLOUD_WITNESS_RESOURCE_TYPE_VALIDATE_CREDENTIALS_WITH_KEY ) , CLUSCTL_RESOURCE_TYPE_PREPARE_UPGRADE = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_RESOURCE_PREPARE_UPGRADE ) , CLUSCTL_RESOURCE_TYPE_UPGRADE_COMPLETED = ( ( CLUS_OBJECT_RESOURCE_TYPE << 24 ) | CLCTL_RESOURCE_UPGRADE_COMPLETED ) } CLUSCTL_RESOURCE_TYPE_CODES; typedef enum CLUSCTL_GROUP_CODES { CLUSCTL_GROUP_UNKNOWN = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_UNKNOWN ) , CLUSCTL_GROUP_GET_CHARACTERISTICS = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_CHARACTERISTICS ) , CLUSCTL_GROUP_GET_FLAGS = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_FLAGS ) , CLUSCTL_GROUP_GET_NAME = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_NAME ) , CLUSCTL_GROUP_GET_ID = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_ID ) , CLUSCTL_GROUP_ENUM_COMMON_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_ENUM_COMMON_PROPERTIES ) , CLUSCTL_GROUP_GET_RO_COMMON_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_RO_COMMON_PROPERTIES ) , CLUSCTL_GROUP_GET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_COMMON_PROPERTIES ) , CLUSCTL_GROUP_SET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_SET_COMMON_PROPERTIES ) , CLUSCTL_GROUP_VALIDATE_COMMON_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_VALIDATE_COMMON_PROPERTIES ) , CLUSCTL_GROUP_ENUM_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_ENUM_PRIVATE_PROPERTIES ) , CLUSCTL_GROUP_GET_RO_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_RO_PRIVATE_PROPERTIES ) , CLUSCTL_GROUP_GET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_PRIVATE_PROPERTIES ) , CLUSCTL_GROUP_SET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_SET_PRIVATE_PROPERTIES ) , CLUSCTL_GROUP_VALIDATE_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_VALIDATE_PRIVATE_PROPERTIES ) , CLUSCTL_GROUP_QUERY_DELETE = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_QUERY_DELETE ) , CLUSCTL_GROUP_GET_COMMON_PROPERTY_FMTS = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_COMMON_PROPERTY_FMTS ) , CLUSCTL_GROUP_GET_PRIVATE_PROPERTY_FMTS = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_PRIVATE_PROPERTY_FMTS ) , CLUSCTL_GROUP_GET_FAILURE_INFO = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GET_FAILURE_INFO ) , CLUSCTL_GROUP_GET_LAST_MOVE_TIME = ( ( CLUS_OBJECT_GROUP << 24 ) | CLCTL_GROUP_GET_LAST_MOVE_TIME ) } CLUSCTL_GROUP_CODES; typedef enum CLUSCTL_NODE_CODES { CLUSCTL_NODE_UNKNOWN = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_UNKNOWN ) , CLUSCTL_NODE_GET_CHARACTERISTICS = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_CHARACTERISTICS ) , CLUSCTL_NODE_GET_FLAGS = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_FLAGS ) , CLUSCTL_NODE_GET_NAME = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_NAME ) , CLUSCTL_NODE_GET_ID = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_ID ) , CLUSCTL_NODE_ENUM_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_ENUM_COMMON_PROPERTIES ) , CLUSCTL_NODE_GET_RO_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_RO_COMMON_PROPERTIES ) , CLUSCTL_NODE_GET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_COMMON_PROPERTIES ) , CLUSCTL_NODE_SET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_SET_COMMON_PROPERTIES ) , CLUSCTL_NODE_VALIDATE_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_VALIDATE_COMMON_PROPERTIES ) , CLUSCTL_NODE_ENUM_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_ENUM_PRIVATE_PROPERTIES ) , CLUSCTL_NODE_GET_RO_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_RO_PRIVATE_PROPERTIES ) , CLUSCTL_NODE_GET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_PRIVATE_PROPERTIES ) , CLUSCTL_NODE_SET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_SET_PRIVATE_PROPERTIES ) , CLUSCTL_NODE_VALIDATE_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_VALIDATE_PRIVATE_PROPERTIES ) , CLUSCTL_NODE_GET_COMMON_PROPERTY_FMTS = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_COMMON_PROPERTY_FMTS ) , CLUSCTL_NODE_GET_PRIVATE_PROPERTY_FMTS = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_PRIVATE_PROPERTY_FMTS ) , CLUSCTL_NODE_GET_CLUSTER_SERVICE_ACCOUNT_NAME = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_CLUSTER_SERVICE_ACCOUNT_NAME ) , CLUSCTL_NODE_GET_STUCK_NODES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_STUCK_NODES ) , CLUSCTL_NODE_INJECT_GEM_FAULT = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_INJECT_GEM_FAULT ) , CLUSCTL_NODE_INTRODUCE_GEM_REPAIR_DELAY = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_INTRODUCE_GEM_REPAIR_DELAY ) , CLUSCTL_NODE_SEND_DUMMY_GEM_MESSAGES = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_SEND_DUMMY_GEM_MESSAGES ) , CLUSCTL_NODE_BLOCK_GEM_SEND_RECV = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_BLOCK_GEM_SEND_RECV ) , CLUSCTL_NODE_GET_GEMID_VECTOR = ( ( CLUS_OBJECT_NODE << 24 ) | CLCTL_GET_GEMID_VECTOR ) } CLUSCTL_NODE_CODES; typedef enum CLUSCTL_NETWORK_CODES { CLUSCTL_NETWORK_UNKNOWN = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_UNKNOWN ) , CLUSCTL_NETWORK_GET_CHARACTERISTICS = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_CHARACTERISTICS ) , CLUSCTL_NETWORK_GET_FLAGS = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_FLAGS ) , CLUSCTL_NETWORK_GET_NAME = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_NAME ) , CLUSCTL_NETWORK_GET_ID = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_ID ) , CLUSCTL_NETWORK_ENUM_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_ENUM_COMMON_PROPERTIES ) , CLUSCTL_NETWORK_GET_RO_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_RO_COMMON_PROPERTIES ) , CLUSCTL_NETWORK_GET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_COMMON_PROPERTIES ) , CLUSCTL_NETWORK_SET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_SET_COMMON_PROPERTIES ) , CLUSCTL_NETWORK_VALIDATE_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_VALIDATE_COMMON_PROPERTIES ) , CLUSCTL_NETWORK_ENUM_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_ENUM_PRIVATE_PROPERTIES ) , CLUSCTL_NETWORK_GET_RO_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_RO_PRIVATE_PROPERTIES ) , CLUSCTL_NETWORK_GET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_PRIVATE_PROPERTIES ) , CLUSCTL_NETWORK_SET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_SET_PRIVATE_PROPERTIES ) , CLUSCTL_NETWORK_VALIDATE_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_VALIDATE_PRIVATE_PROPERTIES ) , CLUSCTL_NETWORK_GET_COMMON_PROPERTY_FMTS = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_COMMON_PROPERTY_FMTS ) , CLUSCTL_NETWORK_GET_PRIVATE_PROPERTY_FMTS = ( ( CLUS_OBJECT_NETWORK << 24 ) | CLCTL_GET_PRIVATE_PROPERTY_FMTS ) } CLUSCTL_NETWORK_CODES; typedef enum CLUSCTL_NETINTERFACE_CODES { CLUSCTL_NETINTERFACE_UNKNOWN = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_UNKNOWN ) , CLUSCTL_NETINTERFACE_GET_CHARACTERISTICS = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_CHARACTERISTICS ) , CLUSCTL_NETINTERFACE_GET_FLAGS = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_FLAGS ) , CLUSCTL_NETINTERFACE_GET_NAME = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_NAME ) , CLUSCTL_NETINTERFACE_GET_ID = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_ID ) , CLUSCTL_NETINTERFACE_GET_NODE = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_NODE ) , CLUSCTL_NETINTERFACE_GET_NETWORK = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_NETWORK ) , CLUSCTL_NETINTERFACE_ENUM_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_ENUM_COMMON_PROPERTIES ) , CLUSCTL_NETINTERFACE_GET_RO_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_RO_COMMON_PROPERTIES ) , CLUSCTL_NETINTERFACE_GET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_COMMON_PROPERTIES ) , CLUSCTL_NETINTERFACE_SET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_SET_COMMON_PROPERTIES ) , CLUSCTL_NETINTERFACE_VALIDATE_COMMON_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_VALIDATE_COMMON_PROPERTIES ) , CLUSCTL_NETINTERFACE_ENUM_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_ENUM_PRIVATE_PROPERTIES ) , CLUSCTL_NETINTERFACE_GET_RO_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_RO_PRIVATE_PROPERTIES ) , CLUSCTL_NETINTERFACE_GET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_PRIVATE_PROPERTIES ) , CLUSCTL_NETINTERFACE_SET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_SET_PRIVATE_PROPERTIES ) , CLUSCTL_NETINTERFACE_VALIDATE_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_VALIDATE_PRIVATE_PROPERTIES ) , CLUSCTL_NETINTERFACE_GET_COMMON_PROPERTY_FMTS = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_COMMON_PROPERTY_FMTS ) , CLUSCTL_NETINTERFACE_GET_PRIVATE_PROPERTY_FMTS = ( ( CLUS_OBJECT_NETINTERFACE << 24 ) | CLCTL_GET_PRIVATE_PROPERTY_FMTS ) } CLUSCTL_NETINTERFACE_CODES; typedef enum CLUSCTL_CLUSTER_CODES { CLUSCTL_CLUSTER_UNKNOWN = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_UNKNOWN ) , CLUSCTL_CLUSTER_GET_FQDN = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_FQDN ) , CLUSCTL_CLUSTER_SET_STORAGE_CONFIGURATION = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_SET_STORAGE_CONFIGURATION ) , CLUSCTL_CLUSTER_GET_STORAGE_CONFIGURATION = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_STORAGE_CONFIGURATION ) , CLUSCTL_CLUSTER_GET_STORAGE_CONFIG_ATTRIBUTES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_STORAGE_CONFIG_ATTRIBUTES ) , CLUSCTL_CLUSTER_ENUM_COMMON_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_ENUM_COMMON_PROPERTIES ) , CLUSCTL_CLUSTER_GET_RO_COMMON_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_RO_COMMON_PROPERTIES ) , CLUSCTL_CLUSTER_GET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_COMMON_PROPERTIES ) , CLUSCTL_CLUSTER_SET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_SET_COMMON_PROPERTIES ) , CLUSCTL_CLUSTER_VALIDATE_COMMON_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_VALIDATE_COMMON_PROPERTIES ) , CLUSCTL_CLUSTER_ENUM_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_ENUM_PRIVATE_PROPERTIES ) , CLUSCTL_CLUSTER_GET_RO_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_RO_PRIVATE_PROPERTIES ) , CLUSCTL_CLUSTER_GET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_PRIVATE_PROPERTIES ) , CLUSCTL_CLUSTER_SET_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_SET_PRIVATE_PROPERTIES ) , CLUSCTL_CLUSTER_VALIDATE_PRIVATE_PROPERTIES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_VALIDATE_PRIVATE_PROPERTIES ) , CLUSCTL_CLUSTER_GET_COMMON_PROPERTY_FMTS = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_COMMON_PROPERTY_FMTS ) , CLUSCTL_CLUSTER_GET_PRIVATE_PROPERTY_FMTS = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_PRIVATE_PROPERTY_FMTS ) , CLUSCTL_CLUSTER_CHECK_VOTER_EVICT = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_CHECK_VOTER_EVICT ) , CLUSCTL_CLUSTER_CHECK_VOTER_DOWN = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_CHECK_VOTER_DOWN ) , CLUSCTL_CLUSTER_SHUTDOWN = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_SHUTDOWN ) , CLUSCTL_CLUSTER_BATCH_BLOCK_KEY = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_BATCH_BLOCK_KEY ) , CLUSCTL_CLUSTER_BATCH_UNBLOCK_KEY = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_BATCH_UNBLOCK_KEY ) , CLUSCTL_CLUSTER_GET_SHARED_VOLUME_ID = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_SHARED_VOLUME_ID ) , CLUSCTL_CLUSTER_GET_CLUSDB_TIMESTAMP = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_CLUSDB_TIMESTAMP ) , CLUSCTL_CLUSTER_GET_GUM_LOCK_OWNER = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_GET_GUM_LOCK_OWNER ) , CLUSCTL_CLUSTER_REMOVE_NODE = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_REMOVE_NODE ) , CLUSCTL_CLUSTER_SET_ACCOUNT_ACCESS = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_SET_ACCOUNT_ACCESS ) , CLUSCTL_CLUSTER_CLEAR_NODE_CONNECTION_INFO = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_CLEAR_NODE_CONNECTION_INFO ) , CLUSCTL_CLUSTER_SET_DNS_DOMAIN = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_SET_DNS_DOMAIN ) , CLUSCTL_CLUSTER_SET_CLUSTER_S2D_ENABLED = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_SET_CLUSTER_S2D_ENABLED ) , CLUSCTL_CLUSTER_SET_CLUSTER_S2D_CACHE_METADATA_RESERVE_BYTES = ( ( CLUS_OBJECT_CLUSTER << 24 ) | CLCTL_SET_CLUSTER_S2D_CACHE_METADATA_RESERVE_BYTES ) } CLUSCTL_CLUSTER_CODES; typedef enum CLUSCTL_GROUPSET_CODES { CLUSCTL_GROUPSET_GET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_GET_COMMON_PROPERTIES ) , CLUSCTL_GROUPSET_GET_RO_COMMON_PROPERTIES = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_GET_RO_COMMON_PROPERTIES ) , CLUSCTL_GROUPSET_SET_COMMON_PROPERTIES = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_SET_COMMON_PROPERTIES ) , CLUSCTL_GROUPSET_GET_GROUPS = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_GROUPSET_GET_GROUPS ) , CLUSCTL_GROUPSET_GET_PROVIDER_GROUPS = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_GROUPSET_GET_PROVIDER_GROUPS ) , CLUSCTL_GROUPSET_GET_PROVIDER_GROUPSETS = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_GROUPSET_GET_PROVIDER_GROUPSETS ) , CLUSCTL_GROUP_GET_PROVIDER_GROUPS = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_GROUP_GET_PROVIDER_GROUPS ) , CLUSCTL_GROUP_GET_PROVIDER_GROUPSETS = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_GROUP_GET_PROVIDER_GROUPSETS ) , CLUSCTL_GROUPSET_GET_ID = ( ( CLUS_OBJECT_GROUPSET << 24 ) | CLCTL_GET_ID ) } CLUSCTL_GROUPSET_CODES; typedef enum CLUSTER_RESOURCE_CLASS { CLUS_RESCLASS_UNKNOWN = 0, CLUS_RESCLASS_STORAGE = ( CLUS_RESCLASS_UNKNOWN + 1 ) , CLUS_RESCLASS_NETWORK = ( CLUS_RESCLASS_STORAGE + 1 ) , CLUS_RESCLASS_USER = 32768 } CLUSTER_RESOURCE_CLASS; typedef enum CLUS_RESSUBCLASS { CLUS_RESSUBCLASS_SHARED = 0x80000000 } CLUS_RESSUBCLASS; typedef enum CLUS_RESSUBCLASS_STORAGE { CLUS_RESSUBCLASS_STORAGE_SHARED_BUS = 0x80000000, CLUS_RESSUBCLASS_STORAGE_DISK = 0x40000000, CLUS_RESSUBCLASS_STORAGE_REPLICATION = 0x10000000 } CLUS_RESSUBCLASS_STORAGE; typedef enum CLUS_RESSUBCLASS_NETWORK { CLUS_RESSUBCLASS_NETWORK_INTERNET_PROTOCOL = 0x80000000 } CLUS_RESSUBCLASS_NETWORK; typedef enum CLUS_CHARACTERISTICS { CLUS_CHAR_UNKNOWN = 0, CLUS_CHAR_QUORUM = 0x1, CLUS_CHAR_DELETE_REQUIRES_ALL_NODES = 0x2, CLUS_CHAR_LOCAL_QUORUM = 0x4, CLUS_CHAR_LOCAL_QUORUM_DEBUG = 0x8, CLUS_CHAR_REQUIRES_STATE_CHANGE_REASON = 0x10, CLUS_CHAR_BROADCAST_DELETE = 0x20, CLUS_CHAR_SINGLE_CLUSTER_INSTANCE = 0x40, CLUS_CHAR_SINGLE_GROUP_INSTANCE = 0x80, CLUS_CHAR_COEXIST_IN_SHARED_VOLUME_GROUP = 0x100, CLUS_CHAR_PLACEMENT_DATA = 0x200, CLUS_CHAR_MONITOR_DETACH = 0x400, CLUS_CHAR_MONITOR_REATTACH = 0x800, CLUS_CHAR_OPERATION_CONTEXT = 0x1000, CLUS_CHAR_CLONES = 0x2000, CLUS_CHAR_NOT_PREEMPTABLE = 0x4000, CLUS_CHAR_NOTIFY_NEW_OWNER = 0x8000, CLUS_CHAR_SUPPORTS_UNMONITORED_STATE = 0x10000, CLUS_CHAR_INFRASTRUCTURE = 0x20000 } CLUS_CHARACTERISTICS; typedef enum CLUS_FLAGS { CLUS_FLAG_CORE = 0x1 } CLUS_FLAGS; typedef enum CLUSPROP_PIFLAGS { CLUSPROP_PIFLAG_STICKY = 0x1, CLUSPROP_PIFLAG_REMOVABLE = 0x2, CLUSPROP_PIFLAG_USABLE = 0x4, CLUSPROP_PIFLAG_DEFAULT_QUORUM = 0x8, CLUSPROP_PIFLAG_USABLE_FOR_CSV = 0x10, CLUSPROP_PIFLAG_ENCRYPTION_ENABLED = 0x20, CLUSPROP_PIFLAG_UNKNOWN = 0x80000000 } CLUSPROP_PIFLAGS; typedef enum CLUSTER_RESOURCE_ENUM { CLUSTER_RESOURCE_ENUM_DEPENDS = 0x1, CLUSTER_RESOURCE_ENUM_PROVIDES = 0x2, CLUSTER_RESOURCE_ENUM_NODES = 0x4, CLUSTER_RESOURCE_ENUM_ALL = ( ( CLUSTER_RESOURCE_ENUM_DEPENDS | CLUSTER_RESOURCE_ENUM_PROVIDES ) | CLUSTER_RESOURCE_ENUM_NODES ) } CLUSTER_RESOURCE_ENUM; typedef enum CLUSTER_RESOURCE_TYPE_ENUM { CLUSTER_RESOURCE_TYPE_ENUM_NODES = 0x1, CLUSTER_RESOURCE_TYPE_ENUM_RESOURCES = 0x2, CLUSTER_RESOURCE_TYPE_ENUM_ALL = ( CLUSTER_RESOURCE_TYPE_ENUM_NODES | CLUSTER_RESOURCE_TYPE_ENUM_RESOURCES ) } CLUSTER_RESOURCE_TYPE_ENUM; typedef enum CLUSTER_NETWORK_ENUM { CLUSTER_NETWORK_ENUM_NETINTERFACES = 0x1, CLUSTER_NETWORK_ENUM_ALL = CLUSTER_NETWORK_ENUM_NETINTERFACES } CLUSTER_NETWORK_ENUM; typedef enum CLUSTER_NETWORK_STATE { ClusterNetworkStateUnknown = -1, ClusterNetworkUnavailable = ( ClusterNetworkStateUnknown + 1 ) , ClusterNetworkDown = ( ClusterNetworkUnavailable + 1 ) , ClusterNetworkPartitioned = ( ClusterNetworkDown + 1 ) , ClusterNetworkUp = ( ClusterNetworkPartitioned + 1 ) } CLUSTER_NETWORK_STATE; typedef enum CLUSTER_NETWORK_ROLE { ClusterNetworkRoleNone = 0, ClusterNetworkRoleInternalUse = 0x1, ClusterNetworkRoleClientAccess = 0x2, ClusterNetworkRoleInternalAndClient = 0x3 } CLUSTER_NETWORK_ROLE; typedef enum CLUSTER_NETINTERFACE_STATE { ClusterNetInterfaceStateUnknown = -1, ClusterNetInterfaceUnavailable = ( ClusterNetInterfaceStateUnknown + 1 ) , ClusterNetInterfaceFailed = ( ClusterNetInterfaceUnavailable + 1 ) , ClusterNetInterfaceUnreachable = ( ClusterNetInterfaceFailed + 1 ) , ClusterNetInterfaceUp = ( ClusterNetInterfaceUnreachable + 1 ) } CLUSTER_NETINTERFACE_STATE; #pragma endregion #endif // _CLUSTER_API_TYPES_ extern RPC_IF_HANDLE __MIDL_itf_msclus_0000_0000_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_msclus_0000_0000_v0_0_s_ifspec; #ifndef __MSClusterLib_LIBRARY_DEFINED__ #define __MSClusterLib_LIBRARY_DEFINED__ /* library MSClusterLib */ /* [helpstring][version][uuid] */ typedef CLUSTER_QUORUM_TYPE _CLUSTER_QUORUM_TYPE; typedef NODE_CLUSTER_STATE _NODE_CLUSTER_STATE; typedef CLUSTER_RESOURCE_STATE_CHANGE_REASON _CLUSTER_RESOURCE_STATE_CHANGE_REASON; typedef CLUSTER_CHANGE _CLUSTER_CHANGE; typedef CLUSTER_ENUM _CLUSTER_ENUM; typedef CLUSTER_NODE_ENUM _CLUSTER_NODE_ENUM; typedef CLUSTER_NODE_STATE _CLUSTER_NODE_STATE; typedef CLUSTER_GROUP_ENUM _CLUSTER_GROUP_ENUM; typedef CLUSTER_GROUP_STATE _CLUSTER_GROUP_STATE; typedef CLUSTER_GROUP_AUTOFAILBACK_TYPE _CLUSTER_GROUP_AUTOFAILBACK_TYPE; typedef CLUSTER_RESOURCE_STATE _CLUSTER_RESOURCE_STATE; typedef CLUSTER_RESOURCE_RESTART_ACTION _CLUSTER_RESOURCE_RESTART_ACTION; typedef CLUSTER_RESOURCE_CREATE_FLAGS _CLUSTER_RESOURCE_CREATE_FLAGS; typedef CLUSTER_PROPERTY_TYPE _CLUSTER_PROPERTY_TYPE; typedef CLUSTER_PROPERTY_FORMAT _CLUSTER_PROPERTY_FORMAT; typedef CLUSTER_PROPERTY_SYNTAX _CLUSTER_PROPERTY_SYNTAX; typedef CLUSTER_CONTROL_OBJECT _CLUSTER_CONTROL_OBJECT; typedef CLCTL_CODES _CLCTL_CODES; typedef CLUSCTL_RESOURCE_CODES _CLUSCTL_RESOURCE_CODES; typedef CLUSCTL_RESOURCE_TYPE_CODES _CLUSCTL_RESOURCE_TYPE_CODES; typedef CLUSCTL_GROUP_CODES _CLUSCTL_GROUP_CODES; typedef CLUSCTL_NODE_CODES _CLUSCTL_NODE_CODES; typedef CLUSCTL_NETWORK_CODES _CLUSCTL_NETWORK_CODES; typedef CLUSCTL_NETINTERFACE_CODES _CLUSCTL_NETINTERFACE_CODES; typedef CLUSCTL_CLUSTER_CODES _CLUSCTL_CLUSTER_CODES; typedef CLUSTER_RESOURCE_CLASS _CLUSTER_RESOURCE_CLASS; typedef CLUS_RESSUBCLASS _CLUS_RESSUBCLASS; typedef CLUS_CHARACTERISTICS _CLUS_CHARACTERISTICS; typedef CLUS_FLAGS _CLUS_FLAGS; typedef CLUSPROP_PIFLAGS _CLUSPROP_PIFLAGS; typedef CLUSTER_RESOURCE_ENUM _CLUSTER_RESOURCE_ENUM; typedef CLUSTER_RESOURCE_TYPE_ENUM _CLUSTER_RESOURCE_TYPE_ENUM; typedef CLUSTER_NETWORK_ENUM _CLUSTER_NETWORK_ENUM; typedef CLUSTER_NETWORK_STATE _CLUSTER_NETWORK_STATE; typedef CLUSTER_NETWORK_ROLE _CLUSTER_NETWORK_ROLE; typedef CLUSTER_NETINTERFACE_STATE _CLUSTER_NETINTERFACE_STATE; EXTERN_C const IID LIBID_MSClusterLib; EXTERN_C const CLSID CLSID_ClusApplication; #ifdef __cplusplus class DECLSPEC_UUID("f2e606e5-2631-11d1-89f1-00a0c90d061e") ClusApplication; #endif EXTERN_C const CLSID CLSID_Cluster; #ifdef __cplusplus class DECLSPEC_UUID("f2e606e3-2631-11d1-89f1-00a0c90d061e") Cluster; #endif EXTERN_C const CLSID CLSID_ClusVersion; #ifdef __cplusplus class DECLSPEC_UUID("f2e60715-2631-11d1-89f1-00a0c90d061e") ClusVersion; #endif EXTERN_C const CLSID CLSID_ClusResType; #ifdef __cplusplus class DECLSPEC_UUID("f2e6070f-2631-11d1-89f1-00a0c90d061e") ClusResType; #endif EXTERN_C const CLSID CLSID_ClusProperty; #ifdef __cplusplus class DECLSPEC_UUID("f2e606fd-2631-11d1-89f1-00a0c90d061e") ClusProperty; #endif EXTERN_C const CLSID CLSID_ClusProperties; #ifdef __cplusplus class DECLSPEC_UUID("f2e606ff-2631-11d1-89f1-00a0c90d061e") ClusProperties; #endif EXTERN_C const CLSID CLSID_DomainNames; #ifdef __cplusplus class DECLSPEC_UUID("f2e606e1-2631-11d1-89f1-00a0c90d061e") DomainNames; #endif EXTERN_C const CLSID CLSID_ClusNetwork; #ifdef __cplusplus class DECLSPEC_UUID("f2e606f1-2631-11d1-89f1-00a0c90d061e") ClusNetwork; #endif EXTERN_C const CLSID CLSID_ClusNetInterface; #ifdef __cplusplus class DECLSPEC_UUID("f2e606ed-2631-11d1-89f1-00a0c90d061e") ClusNetInterface; #endif EXTERN_C const CLSID CLSID_ClusNetInterfaces; #ifdef __cplusplus class DECLSPEC_UUID("f2e606ef-2631-11d1-89f1-00a0c90d061e") ClusNetInterfaces; #endif EXTERN_C const CLSID CLSID_ClusResDependencies; #ifdef __cplusplus class DECLSPEC_UUID("f2e60703-2631-11d1-89f1-00a0c90d061e") ClusResDependencies; #endif EXTERN_C const CLSID CLSID_ClusResGroupResources; #ifdef __cplusplus class DECLSPEC_UUID("f2e606e9-2631-11d1-89f1-00a0c90d061e") ClusResGroupResources; #endif EXTERN_C const CLSID CLSID_ClusResTypeResources; #ifdef __cplusplus class DECLSPEC_UUID("f2e60713-2631-11d1-89f1-00a0c90d061e") ClusResTypeResources; #endif EXTERN_C const CLSID CLSID_ClusResGroupPreferredOwnerNodes; #ifdef __cplusplus class DECLSPEC_UUID("f2e606e7-2631-11d1-89f1-00a0c90d061e") ClusResGroupPreferredOwnerNodes; #endif EXTERN_C const CLSID CLSID_ClusResPossibleOwnerNodes; #ifdef __cplusplus class DECLSPEC_UUID("f2e6070d-2631-11d1-89f1-00a0c90d061e") ClusResPossibleOwnerNodes; #endif EXTERN_C const CLSID CLSID_ClusNetworks; #ifdef __cplusplus class DECLSPEC_UUID("f2e606f3-2631-11d1-89f1-00a0c90d061e") ClusNetworks; #endif EXTERN_C const CLSID CLSID_ClusNetworkNetInterfaces; #ifdef __cplusplus class DECLSPEC_UUID("f2e606f5-2631-11d1-89f1-00a0c90d061e") ClusNetworkNetInterfaces; #endif EXTERN_C const CLSID CLSID_ClusNodeNetInterfaces; #ifdef __cplusplus class DECLSPEC_UUID("f2e606fb-2631-11d1-89f1-00a0c90d061e") ClusNodeNetInterfaces; #endif EXTERN_C const CLSID CLSID_ClusRefObject; #ifdef __cplusplus class DECLSPEC_UUID("f2e60701-2631-11d1-89f1-00a0c90d061e") ClusRefObject; #endif EXTERN_C const CLSID CLSID_ClusterNames; #ifdef __cplusplus class DECLSPEC_UUID("f2e606eb-2631-11d1-89f1-00a0c90d061e") ClusterNames; #endif EXTERN_C const CLSID CLSID_ClusNode; #ifdef __cplusplus class DECLSPEC_UUID("f2e606f7-2631-11d1-89f1-00a0c90d061e") ClusNode; #endif EXTERN_C const CLSID CLSID_ClusNodes; #ifdef __cplusplus class DECLSPEC_UUID("f2e606f9-2631-11d1-89f1-00a0c90d061e") ClusNodes; #endif EXTERN_C const CLSID CLSID_ClusResGroup; #ifdef __cplusplus class DECLSPEC_UUID("f2e60705-2631-11d1-89f1-00a0c90d061e") ClusResGroup; #endif EXTERN_C const CLSID CLSID_ClusResGroups; #ifdef __cplusplus class DECLSPEC_UUID("f2e60707-2631-11d1-89f1-00a0c90d061e") ClusResGroups; #endif EXTERN_C const CLSID CLSID_ClusResource; #ifdef __cplusplus class DECLSPEC_UUID("f2e60709-2631-11d1-89f1-00a0c90d061e") ClusResource; #endif EXTERN_C const CLSID CLSID_ClusResources; #ifdef __cplusplus class DECLSPEC_UUID("f2e6070b-2631-11d1-89f1-00a0c90d061e") ClusResources; #endif EXTERN_C const CLSID CLSID_ClusResTypes; #ifdef __cplusplus class DECLSPEC_UUID("f2e60711-2631-11d1-89f1-00a0c90d061e") ClusResTypes; #endif EXTERN_C const CLSID CLSID_ClusResTypePossibleOwnerNodes; #ifdef __cplusplus class DECLSPEC_UUID("f2e60717-2631-11d1-89f1-00a0c90d061e") ClusResTypePossibleOwnerNodes; #endif EXTERN_C const CLSID CLSID_ClusPropertyValue; #ifdef __cplusplus class DECLSPEC_UUID("f2e60719-2631-11d1-89f1-00a0c90d061e") ClusPropertyValue; #endif EXTERN_C const CLSID CLSID_ClusPropertyValues; #ifdef __cplusplus class DECLSPEC_UUID("f2e6071b-2631-11d1-89f1-00a0c90d061e") ClusPropertyValues; #endif EXTERN_C const CLSID CLSID_ClusPropertyValueData; #ifdef __cplusplus class DECLSPEC_UUID("f2e6071d-2631-11d1-89f1-00a0c90d061e") ClusPropertyValueData; #endif EXTERN_C const CLSID CLSID_ClusPartition; #ifdef __cplusplus class DECLSPEC_UUID("f2e6071f-2631-11d1-89f1-00a0c90d061e") ClusPartition; #endif EXTERN_C const CLSID CLSID_ClusPartitionEx; #ifdef __cplusplus class DECLSPEC_UUID("53d51d26-b51b-4a79-b2c3-5048d93a98fc") ClusPartitionEx; #endif EXTERN_C const CLSID CLSID_ClusPartitions; #ifdef __cplusplus class DECLSPEC_UUID("f2e60721-2631-11d1-89f1-00a0c90d061e") ClusPartitions; #endif EXTERN_C const CLSID CLSID_ClusDisk; #ifdef __cplusplus class DECLSPEC_UUID("f2e60723-2631-11d1-89f1-00a0c90d061e") ClusDisk; #endif EXTERN_C const CLSID CLSID_ClusDisks; #ifdef __cplusplus class DECLSPEC_UUID("f2e60725-2631-11d1-89f1-00a0c90d061e") ClusDisks; #endif EXTERN_C const CLSID CLSID_ClusScsiAddress; #ifdef __cplusplus class DECLSPEC_UUID("f2e60727-2631-11d1-89f1-00a0c90d061e") ClusScsiAddress; #endif EXTERN_C const CLSID CLSID_ClusRegistryKeys; #ifdef __cplusplus class DECLSPEC_UUID("f2e60729-2631-11d1-89f1-00a0c90d061e") ClusRegistryKeys; #endif EXTERN_C const CLSID CLSID_ClusCryptoKeys; #ifdef __cplusplus class DECLSPEC_UUID("f2e6072b-2631-11d1-89f1-00a0c90d061e") ClusCryptoKeys; #endif EXTERN_C const CLSID CLSID_ClusResDependents; #ifdef __cplusplus class DECLSPEC_UUID("f2e6072d-2631-11d1-89f1-00a0c90d061e") ClusResDependents; #endif #endif /* __MSClusterLib_LIBRARY_DEFINED__ */ #ifndef __ISClusApplication_INTERFACE_DEFINED__ #define __ISClusApplication_INTERFACE_DEFINED__ /* interface ISClusApplication */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusApplication; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606e6-2631-11d1-89f1-00a0c90d061e") ISClusApplication : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DomainNames( /* [retval][out] */ __RPC__deref_out_opt ISDomainNames **ppDomains) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ClusterNames( /* [in] */ __RPC__in BSTR bstrDomainName, /* [retval][out] */ __RPC__deref_out_opt ISClusterNames **ppClusters) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE OpenCluster( /* [in] */ __RPC__in BSTR bstrClusterName, /* [retval][out] */ __RPC__deref_out_opt ISCluster **pCluster) = 0; }; #else /* C style interface */ typedef struct ISClusApplicationVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusApplication * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusApplication * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusApplication * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusApplication * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusApplication * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusApplication * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusApplication * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DomainNames )( __RPC__in ISClusApplication * This, /* [retval][out] */ __RPC__deref_out_opt ISDomainNames **ppDomains); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ClusterNames )( __RPC__in ISClusApplication * This, /* [in] */ __RPC__in BSTR bstrDomainName, /* [retval][out] */ __RPC__deref_out_opt ISClusterNames **ppClusters); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *OpenCluster )( __RPC__in ISClusApplication * This, /* [in] */ __RPC__in BSTR bstrClusterName, /* [retval][out] */ __RPC__deref_out_opt ISCluster **pCluster); END_INTERFACE } ISClusApplicationVtbl; interface ISClusApplication { CONST_VTBL struct ISClusApplicationVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusApplication_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusApplication_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusApplication_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusApplication_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusApplication_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusApplication_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusApplication_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusApplication_get_DomainNames(This,ppDomains) \ ( (This)->lpVtbl -> get_DomainNames(This,ppDomains) ) #define ISClusApplication_get_ClusterNames(This,bstrDomainName,ppClusters) \ ( (This)->lpVtbl -> get_ClusterNames(This,bstrDomainName,ppClusters) ) #define ISClusApplication_OpenCluster(This,bstrClusterName,pCluster) \ ( (This)->lpVtbl -> OpenCluster(This,bstrClusterName,pCluster) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusApplication_INTERFACE_DEFINED__ */ #ifndef __ISDomainNames_INTERFACE_DEFINED__ #define __ISDomainNames_INTERFACE_DEFINED__ /* interface ISDomainNames */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISDomainNames; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606e2-2631-11d1-89f1-00a0c90d061e") ISDomainNames : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDomainName) = 0; }; #else /* C style interface */ typedef struct ISDomainNamesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISDomainNames * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISDomainNames * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISDomainNames * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISDomainNames * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISDomainNames * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISDomainNames * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISDomainNames * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISDomainNames * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISDomainNames * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISDomainNames * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISDomainNames * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDomainName); END_INTERFACE } ISDomainNamesVtbl; interface ISDomainNames { CONST_VTBL struct ISDomainNamesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISDomainNames_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISDomainNames_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISDomainNames_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISDomainNames_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISDomainNames_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISDomainNames_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISDomainNames_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISDomainNames_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISDomainNames_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISDomainNames_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISDomainNames_get_Item(This,varIndex,pbstrDomainName) \ ( (This)->lpVtbl -> get_Item(This,varIndex,pbstrDomainName) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISDomainNames_INTERFACE_DEFINED__ */ #ifndef __ISClusterNames_INTERFACE_DEFINED__ #define __ISClusterNames_INTERFACE_DEFINED__ /* interface ISClusterNames */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusterNames; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606ec-2631-11d1-89f1-00a0c90d061e") ISClusterNames : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrClusterName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DomainName( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDomainName) = 0; }; #else /* C style interface */ typedef struct ISClusterNamesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusterNames * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusterNames * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusterNames * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusterNames * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusterNames * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusterNames * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusterNames * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusterNames * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusterNames * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusterNames * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusterNames * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrClusterName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DomainName )( __RPC__in ISClusterNames * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDomainName); END_INTERFACE } ISClusterNamesVtbl; interface ISClusterNames { CONST_VTBL struct ISClusterNamesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusterNames_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusterNames_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusterNames_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusterNames_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusterNames_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusterNames_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusterNames_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusterNames_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusterNames_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusterNames_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusterNames_get_Item(This,varIndex,pbstrClusterName) \ ( (This)->lpVtbl -> get_Item(This,varIndex,pbstrClusterName) ) #define ISClusterNames_get_DomainName(This,pbstrDomainName) \ ( (This)->lpVtbl -> get_DomainName(This,pbstrDomainName) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusterNames_INTERFACE_DEFINED__ */ #ifndef __ISClusRefObject_INTERFACE_DEFINED__ #define __ISClusRefObject_INTERFACE_DEFINED__ /* interface ISClusRefObject */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusRefObject; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60702-2631-11d1-89f1-00a0c90d061e") ISClusRefObject : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Handle( /* [retval][out] */ __RPC__out ULONG_PTR *phandle) = 0; }; #else /* C style interface */ typedef struct ISClusRefObjectVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusRefObject * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusRefObject * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusRefObject * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusRefObject * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusRefObject * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusRefObject * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusRefObject * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Handle )( __RPC__in ISClusRefObject * This, /* [retval][out] */ __RPC__out ULONG_PTR *phandle); END_INTERFACE } ISClusRefObjectVtbl; interface ISClusRefObject { CONST_VTBL struct ISClusRefObjectVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusRefObject_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusRefObject_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusRefObject_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusRefObject_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusRefObject_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusRefObject_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusRefObject_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusRefObject_get_Handle(This,phandle) \ ( (This)->lpVtbl -> get_Handle(This,phandle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusRefObject_INTERFACE_DEFINED__ */ #ifndef __ISClusVersion_INTERFACE_DEFINED__ #define __ISClusVersion_INTERFACE_DEFINED__ /* interface ISClusVersion */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusVersion; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60716-2631-11d1-89f1-00a0c90d061e") ISClusVersion : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrClusterName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MajorVersion( /* [retval][out] */ __RPC__out long *pnMajorVersion) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MinorVersion( /* [retval][out] */ __RPC__out long *pnMinorVersion) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BuildNumber( /* [retval][out] */ __RPC__out SHORT *pnBuildNumber) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_VendorId( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrVendorId) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CSDVersion( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrCSDVersion) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ClusterHighestVersion( /* [retval][out] */ __RPC__out long *pnClusterHighestVersion) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ClusterLowestVersion( /* [retval][out] */ __RPC__out long *pnClusterLowestVersion) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Flags( /* [retval][out] */ __RPC__out long *pnFlags) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MixedVersion( /* [retval][out] */ __RPC__out VARIANT *pvarMixedVersion) = 0; }; #else /* C style interface */ typedef struct ISClusVersionVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusVersion * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusVersion * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusVersion * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusVersion * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusVersion * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusVersion * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusVersion * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrClusterName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MajorVersion )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__out long *pnMajorVersion); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MinorVersion )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__out long *pnMinorVersion); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BuildNumber )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__out SHORT *pnBuildNumber); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_VendorId )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrVendorId); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CSDVersion )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrCSDVersion); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ClusterHighestVersion )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__out long *pnClusterHighestVersion); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ClusterLowestVersion )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__out long *pnClusterLowestVersion); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Flags )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__out long *pnFlags); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MixedVersion )( __RPC__in ISClusVersion * This, /* [retval][out] */ __RPC__out VARIANT *pvarMixedVersion); END_INTERFACE } ISClusVersionVtbl; interface ISClusVersion { CONST_VTBL struct ISClusVersionVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusVersion_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusVersion_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusVersion_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusVersion_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusVersion_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusVersion_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusVersion_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusVersion_get_Name(This,pbstrClusterName) \ ( (This)->lpVtbl -> get_Name(This,pbstrClusterName) ) #define ISClusVersion_get_MajorVersion(This,pnMajorVersion) \ ( (This)->lpVtbl -> get_MajorVersion(This,pnMajorVersion) ) #define ISClusVersion_get_MinorVersion(This,pnMinorVersion) \ ( (This)->lpVtbl -> get_MinorVersion(This,pnMinorVersion) ) #define ISClusVersion_get_BuildNumber(This,pnBuildNumber) \ ( (This)->lpVtbl -> get_BuildNumber(This,pnBuildNumber) ) #define ISClusVersion_get_VendorId(This,pbstrVendorId) \ ( (This)->lpVtbl -> get_VendorId(This,pbstrVendorId) ) #define ISClusVersion_get_CSDVersion(This,pbstrCSDVersion) \ ( (This)->lpVtbl -> get_CSDVersion(This,pbstrCSDVersion) ) #define ISClusVersion_get_ClusterHighestVersion(This,pnClusterHighestVersion) \ ( (This)->lpVtbl -> get_ClusterHighestVersion(This,pnClusterHighestVersion) ) #define ISClusVersion_get_ClusterLowestVersion(This,pnClusterLowestVersion) \ ( (This)->lpVtbl -> get_ClusterLowestVersion(This,pnClusterLowestVersion) ) #define ISClusVersion_get_Flags(This,pnFlags) \ ( (This)->lpVtbl -> get_Flags(This,pnFlags) ) #define ISClusVersion_get_MixedVersion(This,pvarMixedVersion) \ ( (This)->lpVtbl -> get_MixedVersion(This,pvarMixedVersion) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusVersion_INTERFACE_DEFINED__ */ #ifndef __ISCluster_INTERFACE_DEFINED__ #define __ISCluster_INTERFACE_DEFINED__ /* interface ISCluster */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISCluster; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606e4-2631-11d1-89f1-00a0c90d061e") ISCluster : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_Handle( /* [retval][out] */ __RPC__out ULONG_PTR *phandle) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Open( /* [in] */ __RPC__in BSTR bstrClusterName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Name( /* [in] */ __RPC__in BSTR bstrClusterName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Version( /* [retval][out] */ __RPC__deref_out_opt ISClusVersion **ppClusVersion) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_QuorumResource( /* [in] */ __RPC__in_opt ISClusResource *pClusterResource) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_QuorumResource( /* [retval][out] */ __RPC__deref_out_opt ISClusResource **pClusterResource) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_QuorumLogSize( /* [retval][out] */ __RPC__out long *pnLogSize) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_QuorumLogSize( /* [in] */ long nLogSize) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_QuorumPath( /* [retval][out] */ __RPC__deref_out_opt BSTR *ppPath) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_QuorumPath( __RPC__in BSTR pPath) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Nodes( /* [retval][out] */ __RPC__deref_out_opt ISClusNodes **ppNodes) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ResourceGroups( /* [retval][out] */ __RPC__deref_out_opt ISClusResGroups **ppClusterResourceGroups) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Resources( /* [retval][out] */ __RPC__deref_out_opt ISClusResources **ppClusterResources) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ResourceTypes( /* [retval][out] */ __RPC__deref_out_opt ISClusResTypes **ppResourceTypes) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Networks( /* [retval][out] */ __RPC__deref_out_opt ISClusNetworks **ppNetworks) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NetInterfaces( /* [retval][out] */ __RPC__deref_out_opt ISClusNetInterfaces **ppNetInterfaces) = 0; }; #else /* C style interface */ typedef struct ISClusterVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISCluster * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISCluster * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISCluster * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISCluster * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISCluster * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISCluster * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISCluster * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonProperties )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateProperties )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonROProperties )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateROProperties )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Handle )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__out ULONG_PTR *phandle); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Open )( __RPC__in ISCluster * This, /* [in] */ __RPC__in BSTR bstrClusterName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Name )( __RPC__in ISCluster * This, /* [in] */ __RPC__in BSTR bstrClusterName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusVersion **ppClusVersion); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_QuorumResource )( __RPC__in ISCluster * This, /* [in] */ __RPC__in_opt ISClusResource *pClusterResource); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_QuorumResource )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **pClusterResource); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_QuorumLogSize )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__out long *pnLogSize); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_QuorumLogSize )( __RPC__in ISCluster * This, /* [in] */ long nLogSize); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_QuorumPath )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *ppPath); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_QuorumPath )( __RPC__in ISCluster * This, __RPC__in BSTR pPath); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Nodes )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusNodes **ppNodes); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ResourceGroups )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroups **ppClusterResourceGroups); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Resources )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResources **ppClusterResources); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ResourceTypes )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResTypes **ppResourceTypes); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Networks )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusNetworks **ppNetworks); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetInterfaces )( __RPC__in ISCluster * This, /* [retval][out] */ __RPC__deref_out_opt ISClusNetInterfaces **ppNetInterfaces); END_INTERFACE } ISClusterVtbl; interface ISCluster { CONST_VTBL struct ISClusterVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISCluster_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISCluster_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISCluster_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISCluster_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISCluster_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISCluster_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISCluster_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISCluster_get_CommonProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonProperties(This,ppProperties) ) #define ISCluster_get_PrivateProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateProperties(This,ppProperties) ) #define ISCluster_get_CommonROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonROProperties(This,ppProperties) ) #define ISCluster_get_PrivateROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateROProperties(This,ppProperties) ) #define ISCluster_get_Handle(This,phandle) \ ( (This)->lpVtbl -> get_Handle(This,phandle) ) #define ISCluster_Open(This,bstrClusterName) \ ( (This)->lpVtbl -> Open(This,bstrClusterName) ) #define ISCluster_get_Name(This,pbstrName) \ ( (This)->lpVtbl -> get_Name(This,pbstrName) ) #define ISCluster_put_Name(This,bstrClusterName) \ ( (This)->lpVtbl -> put_Name(This,bstrClusterName) ) #define ISCluster_get_Version(This,ppClusVersion) \ ( (This)->lpVtbl -> get_Version(This,ppClusVersion) ) #define ISCluster_put_QuorumResource(This,pClusterResource) \ ( (This)->lpVtbl -> put_QuorumResource(This,pClusterResource) ) #define ISCluster_get_QuorumResource(This,pClusterResource) \ ( (This)->lpVtbl -> get_QuorumResource(This,pClusterResource) ) #define ISCluster_get_QuorumLogSize(This,pnLogSize) \ ( (This)->lpVtbl -> get_QuorumLogSize(This,pnLogSize) ) #define ISCluster_put_QuorumLogSize(This,nLogSize) \ ( (This)->lpVtbl -> put_QuorumLogSize(This,nLogSize) ) #define ISCluster_get_QuorumPath(This,ppPath) \ ( (This)->lpVtbl -> get_QuorumPath(This,ppPath) ) #define ISCluster_put_QuorumPath(This,pPath) \ ( (This)->lpVtbl -> put_QuorumPath(This,pPath) ) #define ISCluster_get_Nodes(This,ppNodes) \ ( (This)->lpVtbl -> get_Nodes(This,ppNodes) ) #define ISCluster_get_ResourceGroups(This,ppClusterResourceGroups) \ ( (This)->lpVtbl -> get_ResourceGroups(This,ppClusterResourceGroups) ) #define ISCluster_get_Resources(This,ppClusterResources) \ ( (This)->lpVtbl -> get_Resources(This,ppClusterResources) ) #define ISCluster_get_ResourceTypes(This,ppResourceTypes) \ ( (This)->lpVtbl -> get_ResourceTypes(This,ppResourceTypes) ) #define ISCluster_get_Networks(This,ppNetworks) \ ( (This)->lpVtbl -> get_Networks(This,ppNetworks) ) #define ISCluster_get_NetInterfaces(This,ppNetInterfaces) \ ( (This)->lpVtbl -> get_NetInterfaces(This,ppNetInterfaces) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISCluster_INTERFACE_DEFINED__ */ #ifndef __ISClusNode_INTERFACE_DEFINED__ #define __ISClusNode_INTERFACE_DEFINED__ /* interface ISClusNode */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusNode; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606f8-2631-11d1-89f1-00a0c90d061e") ISClusNode : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; virtual /* [helpstring][id][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_Handle( /* [retval][out] */ __RPC__out ULONG_PTR *phandle) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NodeID( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrNodeID) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_State( /* [retval][out] */ __RPC__out CLUSTER_NODE_STATE *dwState) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Pause( void) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Resume( void) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Evict( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ResourceGroups( /* [retval][out] */ __RPC__deref_out_opt ISClusResGroups **ppResourceGroups) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Cluster( /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NetInterfaces( /* [retval][out] */ __RPC__deref_out_opt ISClusNodeNetInterfaces **ppClusNetInterfaces) = 0; }; #else /* C style interface */ typedef struct ISClusNodeVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusNode * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusNode * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusNode * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusNode * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusNode * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusNode * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusNode * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonProperties )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateProperties )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonROProperties )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateROProperties )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); /* [helpstring][id][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Handle )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__out ULONG_PTR *phandle); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NodeID )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrNodeID); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_State )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__out CLUSTER_NODE_STATE *dwState); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Pause )( __RPC__in ISClusNode * This); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Resume )( __RPC__in ISClusNode * This); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Evict )( __RPC__in ISClusNode * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ResourceGroups )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroups **ppResourceGroups); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Cluster )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetInterfaces )( __RPC__in ISClusNode * This, /* [retval][out] */ __RPC__deref_out_opt ISClusNodeNetInterfaces **ppClusNetInterfaces); END_INTERFACE } ISClusNodeVtbl; interface ISClusNode { CONST_VTBL struct ISClusNodeVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusNode_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusNode_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusNode_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusNode_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusNode_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusNode_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusNode_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusNode_get_CommonProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonProperties(This,ppProperties) ) #define ISClusNode_get_PrivateProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateProperties(This,ppProperties) ) #define ISClusNode_get_CommonROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonROProperties(This,ppProperties) ) #define ISClusNode_get_PrivateROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateROProperties(This,ppProperties) ) #define ISClusNode_get_Name(This,pbstrName) \ ( (This)->lpVtbl -> get_Name(This,pbstrName) ) #define ISClusNode_get_Handle(This,phandle) \ ( (This)->lpVtbl -> get_Handle(This,phandle) ) #define ISClusNode_get_NodeID(This,pbstrNodeID) \ ( (This)->lpVtbl -> get_NodeID(This,pbstrNodeID) ) #define ISClusNode_get_State(This,dwState) \ ( (This)->lpVtbl -> get_State(This,dwState) ) #define ISClusNode_Pause(This) \ ( (This)->lpVtbl -> Pause(This) ) #define ISClusNode_Resume(This) \ ( (This)->lpVtbl -> Resume(This) ) #define ISClusNode_Evict(This) \ ( (This)->lpVtbl -> Evict(This) ) #define ISClusNode_get_ResourceGroups(This,ppResourceGroups) \ ( (This)->lpVtbl -> get_ResourceGroups(This,ppResourceGroups) ) #define ISClusNode_get_Cluster(This,ppCluster) \ ( (This)->lpVtbl -> get_Cluster(This,ppCluster) ) #define ISClusNode_get_NetInterfaces(This,ppClusNetInterfaces) \ ( (This)->lpVtbl -> get_NetInterfaces(This,ppClusNetInterfaces) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusNode_INTERFACE_DEFINED__ */ #ifndef __ISClusNodes_INTERFACE_DEFINED__ #define __ISClusNodes_INTERFACE_DEFINED__ /* interface ISClusNodes */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusNodes; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606fa-2631-11d1-89f1-00a0c90d061e") ISClusNodes : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppNode) = 0; }; #else /* C style interface */ typedef struct ISClusNodesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusNodes * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusNodes * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusNodes * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusNodes * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusNodes * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusNodes * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusNodes * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusNodes * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusNodes * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusNodes * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusNodes * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppNode); END_INTERFACE } ISClusNodesVtbl; interface ISClusNodes { CONST_VTBL struct ISClusNodesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusNodes_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusNodes_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusNodes_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusNodes_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusNodes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusNodes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusNodes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusNodes_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusNodes_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusNodes_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusNodes_get_Item(This,varIndex,ppNode) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppNode) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusNodes_INTERFACE_DEFINED__ */ #ifndef __ISClusNetwork_INTERFACE_DEFINED__ #define __ISClusNetwork_INTERFACE_DEFINED__ /* interface ISClusNetwork */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusNetwork; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606f2-2631-11d1-89f1-00a0c90d061e") ISClusNetwork : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_Handle( /* [retval][out] */ __RPC__out ULONG_PTR *phandle) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Name( /* [in] */ __RPC__in BSTR bstrNetworkName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NetworkID( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrNetworkID) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_State( /* [retval][out] */ __RPC__out CLUSTER_NETWORK_STATE *dwState) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NetInterfaces( /* [retval][out] */ __RPC__deref_out_opt ISClusNetworkNetInterfaces **ppClusNetInterfaces) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Cluster( /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster) = 0; }; #else /* C style interface */ typedef struct ISClusNetworkVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusNetwork * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusNetwork * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusNetwork * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusNetwork * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusNetwork * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusNetwork * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusNetwork * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonProperties )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateProperties )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonROProperties )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateROProperties )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Handle )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__out ULONG_PTR *phandle); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Name )( __RPC__in ISClusNetwork * This, /* [in] */ __RPC__in BSTR bstrNetworkName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetworkID )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrNetworkID); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_State )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__out CLUSTER_NETWORK_STATE *dwState); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NetInterfaces )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__deref_out_opt ISClusNetworkNetInterfaces **ppClusNetInterfaces); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Cluster )( __RPC__in ISClusNetwork * This, /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster); END_INTERFACE } ISClusNetworkVtbl; interface ISClusNetwork { CONST_VTBL struct ISClusNetworkVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusNetwork_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusNetwork_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusNetwork_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusNetwork_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusNetwork_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusNetwork_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusNetwork_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusNetwork_get_CommonProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonProperties(This,ppProperties) ) #define ISClusNetwork_get_PrivateProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateProperties(This,ppProperties) ) #define ISClusNetwork_get_CommonROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonROProperties(This,ppProperties) ) #define ISClusNetwork_get_PrivateROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateROProperties(This,ppProperties) ) #define ISClusNetwork_get_Handle(This,phandle) \ ( (This)->lpVtbl -> get_Handle(This,phandle) ) #define ISClusNetwork_get_Name(This,pbstrName) \ ( (This)->lpVtbl -> get_Name(This,pbstrName) ) #define ISClusNetwork_put_Name(This,bstrNetworkName) \ ( (This)->lpVtbl -> put_Name(This,bstrNetworkName) ) #define ISClusNetwork_get_NetworkID(This,pbstrNetworkID) \ ( (This)->lpVtbl -> get_NetworkID(This,pbstrNetworkID) ) #define ISClusNetwork_get_State(This,dwState) \ ( (This)->lpVtbl -> get_State(This,dwState) ) #define ISClusNetwork_get_NetInterfaces(This,ppClusNetInterfaces) \ ( (This)->lpVtbl -> get_NetInterfaces(This,ppClusNetInterfaces) ) #define ISClusNetwork_get_Cluster(This,ppCluster) \ ( (This)->lpVtbl -> get_Cluster(This,ppCluster) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusNetwork_INTERFACE_DEFINED__ */ #ifndef __ISClusNetworks_INTERFACE_DEFINED__ #define __ISClusNetworks_INTERFACE_DEFINED__ /* interface ISClusNetworks */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusNetworks; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606f4-2631-11d1-89f1-00a0c90d061e") ISClusNetworks : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNetwork **ppClusNetwork) = 0; }; #else /* C style interface */ typedef struct ISClusNetworksVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusNetworks * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusNetworks * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusNetworks * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusNetworks * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusNetworks * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusNetworks * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusNetworks * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusNetworks * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusNetworks * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusNetworks * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusNetworks * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNetwork **ppClusNetwork); END_INTERFACE } ISClusNetworksVtbl; interface ISClusNetworks { CONST_VTBL struct ISClusNetworksVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusNetworks_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusNetworks_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusNetworks_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusNetworks_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusNetworks_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusNetworks_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusNetworks_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusNetworks_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusNetworks_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusNetworks_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusNetworks_get_Item(This,varIndex,ppClusNetwork) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusNetwork) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusNetworks_INTERFACE_DEFINED__ */ #ifndef __ISClusNetInterface_INTERFACE_DEFINED__ #define __ISClusNetInterface_INTERFACE_DEFINED__ /* interface ISClusNetInterface */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusNetInterface; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606ee-2631-11d1-89f1-00a0c90d061e") ISClusNetInterface : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; virtual /* [helpstring][id][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_Handle( /* [retval][out] */ __RPC__out ULONG_PTR *phandle) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_State( /* [retval][out] */ __RPC__out CLUSTER_NETINTERFACE_STATE *dwState) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Cluster( /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster) = 0; }; #else /* C style interface */ typedef struct ISClusNetInterfaceVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusNetInterface * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusNetInterface * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusNetInterface * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusNetInterface * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusNetInterface * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusNetInterface * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusNetInterface * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonProperties )( __RPC__in ISClusNetInterface * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateProperties )( __RPC__in ISClusNetInterface * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonROProperties )( __RPC__in ISClusNetInterface * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateROProperties )( __RPC__in ISClusNetInterface * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISClusNetInterface * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); /* [helpstring][id][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Handle )( __RPC__in ISClusNetInterface * This, /* [retval][out] */ __RPC__out ULONG_PTR *phandle); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_State )( __RPC__in ISClusNetInterface * This, /* [retval][out] */ __RPC__out CLUSTER_NETINTERFACE_STATE *dwState); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Cluster )( __RPC__in ISClusNetInterface * This, /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster); END_INTERFACE } ISClusNetInterfaceVtbl; interface ISClusNetInterface { CONST_VTBL struct ISClusNetInterfaceVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusNetInterface_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusNetInterface_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusNetInterface_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusNetInterface_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusNetInterface_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusNetInterface_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusNetInterface_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusNetInterface_get_CommonProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonProperties(This,ppProperties) ) #define ISClusNetInterface_get_PrivateProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateProperties(This,ppProperties) ) #define ISClusNetInterface_get_CommonROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonROProperties(This,ppProperties) ) #define ISClusNetInterface_get_PrivateROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateROProperties(This,ppProperties) ) #define ISClusNetInterface_get_Name(This,pbstrName) \ ( (This)->lpVtbl -> get_Name(This,pbstrName) ) #define ISClusNetInterface_get_Handle(This,phandle) \ ( (This)->lpVtbl -> get_Handle(This,phandle) ) #define ISClusNetInterface_get_State(This,dwState) \ ( (This)->lpVtbl -> get_State(This,dwState) ) #define ISClusNetInterface_get_Cluster(This,ppCluster) \ ( (This)->lpVtbl -> get_Cluster(This,ppCluster) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusNetInterface_INTERFACE_DEFINED__ */ #ifndef __ISClusNetInterfaces_INTERFACE_DEFINED__ #define __ISClusNetInterfaces_INTERFACE_DEFINED__ /* interface ISClusNetInterfaces */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusNetInterfaces; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606f0-2631-11d1-89f1-00a0c90d061e") ISClusNetInterfaces : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNetInterface **ppClusNetInterface) = 0; }; #else /* C style interface */ typedef struct ISClusNetInterfacesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusNetInterfaces * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusNetInterfaces * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusNetInterfaces * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusNetInterfaces * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusNetInterfaces * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusNetInterfaces * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusNetInterfaces * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusNetInterfaces * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusNetInterfaces * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusNetInterfaces * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusNetInterfaces * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNetInterface **ppClusNetInterface); END_INTERFACE } ISClusNetInterfacesVtbl; interface ISClusNetInterfaces { CONST_VTBL struct ISClusNetInterfacesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusNetInterfaces_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusNetInterfaces_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusNetInterfaces_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusNetInterfaces_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusNetInterfaces_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusNetInterfaces_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusNetInterfaces_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusNetInterfaces_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusNetInterfaces_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusNetInterfaces_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusNetInterfaces_get_Item(This,varIndex,ppClusNetInterface) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusNetInterface) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusNetInterfaces_INTERFACE_DEFINED__ */ #ifndef __ISClusNodeNetInterfaces_INTERFACE_DEFINED__ #define __ISClusNodeNetInterfaces_INTERFACE_DEFINED__ /* interface ISClusNodeNetInterfaces */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusNodeNetInterfaces; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606fc-2631-11d1-89f1-00a0c90d061e") ISClusNodeNetInterfaces : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNetInterface **ppClusNetInterface) = 0; }; #else /* C style interface */ typedef struct ISClusNodeNetInterfacesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusNodeNetInterfaces * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusNodeNetInterfaces * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusNodeNetInterfaces * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusNodeNetInterfaces * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusNodeNetInterfaces * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusNodeNetInterfaces * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusNodeNetInterfaces * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusNodeNetInterfaces * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusNodeNetInterfaces * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusNodeNetInterfaces * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusNodeNetInterfaces * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNetInterface **ppClusNetInterface); END_INTERFACE } ISClusNodeNetInterfacesVtbl; interface ISClusNodeNetInterfaces { CONST_VTBL struct ISClusNodeNetInterfacesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusNodeNetInterfaces_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusNodeNetInterfaces_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusNodeNetInterfaces_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusNodeNetInterfaces_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusNodeNetInterfaces_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusNodeNetInterfaces_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusNodeNetInterfaces_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusNodeNetInterfaces_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusNodeNetInterfaces_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusNodeNetInterfaces_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusNodeNetInterfaces_get_Item(This,varIndex,ppClusNetInterface) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusNetInterface) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusNodeNetInterfaces_INTERFACE_DEFINED__ */ #ifndef __ISClusNetworkNetInterfaces_INTERFACE_DEFINED__ #define __ISClusNetworkNetInterfaces_INTERFACE_DEFINED__ /* interface ISClusNetworkNetInterfaces */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusNetworkNetInterfaces; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606f6-2631-11d1-89f1-00a0c90d061e") ISClusNetworkNetInterfaces : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNetInterface **ppClusNetInterface) = 0; }; #else /* C style interface */ typedef struct ISClusNetworkNetInterfacesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusNetworkNetInterfaces * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusNetworkNetInterfaces * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusNetworkNetInterfaces * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusNetworkNetInterfaces * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusNetworkNetInterfaces * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusNetworkNetInterfaces * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusNetworkNetInterfaces * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusNetworkNetInterfaces * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusNetworkNetInterfaces * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusNetworkNetInterfaces * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusNetworkNetInterfaces * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNetInterface **ppClusNetInterface); END_INTERFACE } ISClusNetworkNetInterfacesVtbl; interface ISClusNetworkNetInterfaces { CONST_VTBL struct ISClusNetworkNetInterfacesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusNetworkNetInterfaces_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusNetworkNetInterfaces_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusNetworkNetInterfaces_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusNetworkNetInterfaces_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusNetworkNetInterfaces_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusNetworkNetInterfaces_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusNetworkNetInterfaces_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusNetworkNetInterfaces_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusNetworkNetInterfaces_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusNetworkNetInterfaces_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusNetworkNetInterfaces_get_Item(This,varIndex,ppClusNetInterface) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusNetInterface) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusNetworkNetInterfaces_INTERFACE_DEFINED__ */ #ifndef __ISClusResGroup_INTERFACE_DEFINED__ #define __ISClusResGroup_INTERFACE_DEFINED__ /* interface ISClusResGroup */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResGroup; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60706-2631-11d1-89f1-00a0c90d061e") ISClusResGroup : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_Handle( /* [retval][out] */ __RPC__out ULONG_PTR *phandle) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Name( /* [in] */ __RPC__in BSTR bstrGroupName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_State( /* [retval][out] */ __RPC__out CLUSTER_GROUP_STATE *dwState) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OwnerNode( /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppOwnerNode) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Resources( /* [retval][out] */ __RPC__deref_out_opt ISClusResGroupResources **ppClusterGroupResources) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PreferredOwnerNodes( /* [retval][out] */ __RPC__deref_out_opt ISClusResGroupPreferredOwnerNodes **ppOwnerNodes) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Delete( void) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Online( /* [in] */ VARIANT varTimeout, /* [optional][in] */ VARIANT varNode, /* [retval][out] */ __RPC__out VARIANT *pvarPending) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Move( /* [in] */ VARIANT varTimeout, /* [optional][in] */ VARIANT varNode, /* [retval][out] */ __RPC__out VARIANT *pvarPending) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Offline( /* [in] */ VARIANT varTimeout, /* [retval][out] */ __RPC__out VARIANT *pvarPending) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Cluster( /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster) = 0; }; #else /* C style interface */ typedef struct ISClusResGroupVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResGroup * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResGroup * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResGroup * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResGroup * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResGroup * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResGroup * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResGroup * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonProperties )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateProperties )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonROProperties )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateROProperties )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Handle )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__out ULONG_PTR *phandle); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Name )( __RPC__in ISClusResGroup * This, /* [in] */ __RPC__in BSTR bstrGroupName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_State )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__out CLUSTER_GROUP_STATE *dwState); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OwnerNode )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppOwnerNode); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Resources )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroupResources **ppClusterGroupResources); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PreferredOwnerNodes )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroupPreferredOwnerNodes **ppOwnerNodes); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Delete )( __RPC__in ISClusResGroup * This); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Online )( __RPC__in ISClusResGroup * This, /* [in] */ VARIANT varTimeout, /* [optional][in] */ VARIANT varNode, /* [retval][out] */ __RPC__out VARIANT *pvarPending); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Move )( __RPC__in ISClusResGroup * This, /* [in] */ VARIANT varTimeout, /* [optional][in] */ VARIANT varNode, /* [retval][out] */ __RPC__out VARIANT *pvarPending); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Offline )( __RPC__in ISClusResGroup * This, /* [in] */ VARIANT varTimeout, /* [retval][out] */ __RPC__out VARIANT *pvarPending); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Cluster )( __RPC__in ISClusResGroup * This, /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster); END_INTERFACE } ISClusResGroupVtbl; interface ISClusResGroup { CONST_VTBL struct ISClusResGroupVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResGroup_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResGroup_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResGroup_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResGroup_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResGroup_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResGroup_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResGroup_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResGroup_get_CommonProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonProperties(This,ppProperties) ) #define ISClusResGroup_get_PrivateProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateProperties(This,ppProperties) ) #define ISClusResGroup_get_CommonROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonROProperties(This,ppProperties) ) #define ISClusResGroup_get_PrivateROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateROProperties(This,ppProperties) ) #define ISClusResGroup_get_Handle(This,phandle) \ ( (This)->lpVtbl -> get_Handle(This,phandle) ) #define ISClusResGroup_get_Name(This,pbstrName) \ ( (This)->lpVtbl -> get_Name(This,pbstrName) ) #define ISClusResGroup_put_Name(This,bstrGroupName) \ ( (This)->lpVtbl -> put_Name(This,bstrGroupName) ) #define ISClusResGroup_get_State(This,dwState) \ ( (This)->lpVtbl -> get_State(This,dwState) ) #define ISClusResGroup_get_OwnerNode(This,ppOwnerNode) \ ( (This)->lpVtbl -> get_OwnerNode(This,ppOwnerNode) ) #define ISClusResGroup_get_Resources(This,ppClusterGroupResources) \ ( (This)->lpVtbl -> get_Resources(This,ppClusterGroupResources) ) #define ISClusResGroup_get_PreferredOwnerNodes(This,ppOwnerNodes) \ ( (This)->lpVtbl -> get_PreferredOwnerNodes(This,ppOwnerNodes) ) #define ISClusResGroup_Delete(This) \ ( (This)->lpVtbl -> Delete(This) ) #define ISClusResGroup_Online(This,varTimeout,varNode,pvarPending) \ ( (This)->lpVtbl -> Online(This,varTimeout,varNode,pvarPending) ) #define ISClusResGroup_Move(This,varTimeout,varNode,pvarPending) \ ( (This)->lpVtbl -> Move(This,varTimeout,varNode,pvarPending) ) #define ISClusResGroup_Offline(This,varTimeout,pvarPending) \ ( (This)->lpVtbl -> Offline(This,varTimeout,pvarPending) ) #define ISClusResGroup_get_Cluster(This,ppCluster) \ ( (This)->lpVtbl -> get_Cluster(This,ppCluster) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResGroup_INTERFACE_DEFINED__ */ #ifndef __ISClusResGroups_INTERFACE_DEFINED__ #define __ISClusResGroups_INTERFACE_DEFINED__ /* interface ISClusResGroups */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResGroups; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60708-2631-11d1-89f1-00a0c90d061e") ISClusResGroups : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroup **ppClusResGroup) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrResourceGroupName, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroup **ppResourceGroup) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DeleteItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusResGroupsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResGroups * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResGroups * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResGroups * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResGroups * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResGroups * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResGroups * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResGroups * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResGroups * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResGroups * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResGroups * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResGroups * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroup **ppClusResGroup); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusResGroups * This, /* [in] */ __RPC__in BSTR bstrResourceGroupName, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroup **ppResourceGroup); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( __RPC__in ISClusResGroups * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusResGroupsVtbl; interface ISClusResGroups { CONST_VTBL struct ISClusResGroupsVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResGroups_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResGroups_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResGroups_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResGroups_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResGroups_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResGroups_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResGroups_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResGroups_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResGroups_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResGroups_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResGroups_get_Item(This,varIndex,ppClusResGroup) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusResGroup) ) #define ISClusResGroups_CreateItem(This,bstrResourceGroupName,ppResourceGroup) \ ( (This)->lpVtbl -> CreateItem(This,bstrResourceGroupName,ppResourceGroup) ) #define ISClusResGroups_DeleteItem(This,varIndex) \ ( (This)->lpVtbl -> DeleteItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResGroups_INTERFACE_DEFINED__ */ #ifndef __ISClusResource_INTERFACE_DEFINED__ #define __ISClusResource_INTERFACE_DEFINED__ /* interface ISClusResource */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResource; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6070a-2631-11d1-89f1-00a0c90d061e") ISClusResource : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][hidden][propget] */ HRESULT STDMETHODCALLTYPE get_Handle( /* [retval][out] */ __RPC__out ULONG_PTR *phandle) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Name( /* [in] */ __RPC__in BSTR bstrResourceName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_State( /* [retval][out] */ __RPC__out CLUSTER_RESOURCE_STATE *dwState) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CoreFlag( /* [retval][out] */ __RPC__out CLUS_FLAGS *dwCoreFlag) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE BecomeQuorumResource( /* [in] */ __RPC__in BSTR bstrDevicePath, /* [in] */ long lMaxLogSize) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Delete( void) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Fail( void) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Online( /* [in] */ long nTimeout, /* [retval][out] */ __RPC__out VARIANT *pvarPending) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Offline( /* [in] */ long nTimeout, /* [retval][out] */ __RPC__out VARIANT *pvarPending) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ChangeResourceGroup( /* [in] */ __RPC__in_opt ISClusResGroup *pResourceGroup) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddResourceNode( /* [in] */ __RPC__in_opt ISClusNode *pNode) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveResourceNode( /* [in] */ __RPC__in_opt ISClusNode *pNode) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CanResourceBeDependent( /* [in] */ __RPC__in_opt ISClusResource *pResource, /* [retval][out] */ __RPC__out VARIANT *pvarDependent) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PossibleOwnerNodes( /* [retval][out] */ __RPC__deref_out_opt ISClusResPossibleOwnerNodes **ppOwnerNodes) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Dependencies( /* [retval][out] */ __RPC__deref_out_opt ISClusResDependencies **ppResDependencies) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Dependents( /* [retval][out] */ __RPC__deref_out_opt ISClusResDependents **ppResDependents) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Group( /* [retval][out] */ __RPC__deref_out_opt ISClusResGroup **ppResGroup) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OwnerNode( /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppOwnerNode) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Cluster( /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ClassInfo( /* [retval][out] */ __RPC__out CLUSTER_RESOURCE_CLASS *prcClassInfo) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Disk( /* [retval][out] */ __RPC__deref_out_opt ISClusDisk **ppDisk) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_RegistryKeys( /* [retval][out] */ __RPC__deref_out_opt ISClusRegistryKeys **ppRegistryKeys) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CryptoKeys( /* [retval][out] */ __RPC__deref_out_opt ISClusCryptoKeys **ppCryptoKeys) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TypeName( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrTypeName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Type( /* [retval][out] */ __RPC__deref_out_opt ISClusResType **ppResourceType) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaintenanceMode( /* [retval][out] */ __RPC__out BOOL *pbMaintenanceMode) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaintenanceMode( /* [in] */ BOOL bMaintenanceMode) = 0; }; #else /* C style interface */ typedef struct ISClusResourceVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResource * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResource * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResource * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResource * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResource * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResource * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResource * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonProperties )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateProperties )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonROProperties )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateROProperties )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][hidden][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Handle )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__out ULONG_PTR *phandle); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Name )( __RPC__in ISClusResource * This, /* [in] */ __RPC__in BSTR bstrResourceName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_State )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__out CLUSTER_RESOURCE_STATE *dwState); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CoreFlag )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__out CLUS_FLAGS *dwCoreFlag); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BecomeQuorumResource )( __RPC__in ISClusResource * This, /* [in] */ __RPC__in BSTR bstrDevicePath, /* [in] */ long lMaxLogSize); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Delete )( __RPC__in ISClusResource * This); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Fail )( __RPC__in ISClusResource * This); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Online )( __RPC__in ISClusResource * This, /* [in] */ long nTimeout, /* [retval][out] */ __RPC__out VARIANT *pvarPending); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Offline )( __RPC__in ISClusResource * This, /* [in] */ long nTimeout, /* [retval][out] */ __RPC__out VARIANT *pvarPending); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ChangeResourceGroup )( __RPC__in ISClusResource * This, /* [in] */ __RPC__in_opt ISClusResGroup *pResourceGroup); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddResourceNode )( __RPC__in ISClusResource * This, /* [in] */ __RPC__in_opt ISClusNode *pNode); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveResourceNode )( __RPC__in ISClusResource * This, /* [in] */ __RPC__in_opt ISClusNode *pNode); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CanResourceBeDependent )( __RPC__in ISClusResource * This, /* [in] */ __RPC__in_opt ISClusResource *pResource, /* [retval][out] */ __RPC__out VARIANT *pvarDependent); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PossibleOwnerNodes )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResPossibleOwnerNodes **ppOwnerNodes); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Dependencies )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResDependencies **ppResDependencies); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Dependents )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResDependents **ppResDependents); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Group )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResGroup **ppResGroup); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OwnerNode )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppOwnerNode); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Cluster )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ClassInfo )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__out CLUSTER_RESOURCE_CLASS *prcClassInfo); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Disk )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusDisk **ppDisk); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_RegistryKeys )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusRegistryKeys **ppRegistryKeys); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CryptoKeys )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusCryptoKeys **ppCryptoKeys); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TypeName )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrTypeName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResType **ppResourceType); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaintenanceMode )( __RPC__in ISClusResource * This, /* [retval][out] */ __RPC__out BOOL *pbMaintenanceMode); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaintenanceMode )( __RPC__in ISClusResource * This, /* [in] */ BOOL bMaintenanceMode); END_INTERFACE } ISClusResourceVtbl; interface ISClusResource { CONST_VTBL struct ISClusResourceVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResource_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResource_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResource_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResource_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResource_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResource_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResource_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResource_get_CommonProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonProperties(This,ppProperties) ) #define ISClusResource_get_PrivateProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateProperties(This,ppProperties) ) #define ISClusResource_get_CommonROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonROProperties(This,ppProperties) ) #define ISClusResource_get_PrivateROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateROProperties(This,ppProperties) ) #define ISClusResource_get_Handle(This,phandle) \ ( (This)->lpVtbl -> get_Handle(This,phandle) ) #define ISClusResource_get_Name(This,pbstrName) \ ( (This)->lpVtbl -> get_Name(This,pbstrName) ) #define ISClusResource_put_Name(This,bstrResourceName) \ ( (This)->lpVtbl -> put_Name(This,bstrResourceName) ) #define ISClusResource_get_State(This,dwState) \ ( (This)->lpVtbl -> get_State(This,dwState) ) #define ISClusResource_get_CoreFlag(This,dwCoreFlag) \ ( (This)->lpVtbl -> get_CoreFlag(This,dwCoreFlag) ) #define ISClusResource_BecomeQuorumResource(This,bstrDevicePath,lMaxLogSize) \ ( (This)->lpVtbl -> BecomeQuorumResource(This,bstrDevicePath,lMaxLogSize) ) #define ISClusResource_Delete(This) \ ( (This)->lpVtbl -> Delete(This) ) #define ISClusResource_Fail(This) \ ( (This)->lpVtbl -> Fail(This) ) #define ISClusResource_Online(This,nTimeout,pvarPending) \ ( (This)->lpVtbl -> Online(This,nTimeout,pvarPending) ) #define ISClusResource_Offline(This,nTimeout,pvarPending) \ ( (This)->lpVtbl -> Offline(This,nTimeout,pvarPending) ) #define ISClusResource_ChangeResourceGroup(This,pResourceGroup) \ ( (This)->lpVtbl -> ChangeResourceGroup(This,pResourceGroup) ) #define ISClusResource_AddResourceNode(This,pNode) \ ( (This)->lpVtbl -> AddResourceNode(This,pNode) ) #define ISClusResource_RemoveResourceNode(This,pNode) \ ( (This)->lpVtbl -> RemoveResourceNode(This,pNode) ) #define ISClusResource_CanResourceBeDependent(This,pResource,pvarDependent) \ ( (This)->lpVtbl -> CanResourceBeDependent(This,pResource,pvarDependent) ) #define ISClusResource_get_PossibleOwnerNodes(This,ppOwnerNodes) \ ( (This)->lpVtbl -> get_PossibleOwnerNodes(This,ppOwnerNodes) ) #define ISClusResource_get_Dependencies(This,ppResDependencies) \ ( (This)->lpVtbl -> get_Dependencies(This,ppResDependencies) ) #define ISClusResource_get_Dependents(This,ppResDependents) \ ( (This)->lpVtbl -> get_Dependents(This,ppResDependents) ) #define ISClusResource_get_Group(This,ppResGroup) \ ( (This)->lpVtbl -> get_Group(This,ppResGroup) ) #define ISClusResource_get_OwnerNode(This,ppOwnerNode) \ ( (This)->lpVtbl -> get_OwnerNode(This,ppOwnerNode) ) #define ISClusResource_get_Cluster(This,ppCluster) \ ( (This)->lpVtbl -> get_Cluster(This,ppCluster) ) #define ISClusResource_get_ClassInfo(This,prcClassInfo) \ ( (This)->lpVtbl -> get_ClassInfo(This,prcClassInfo) ) #define ISClusResource_get_Disk(This,ppDisk) \ ( (This)->lpVtbl -> get_Disk(This,ppDisk) ) #define ISClusResource_get_RegistryKeys(This,ppRegistryKeys) \ ( (This)->lpVtbl -> get_RegistryKeys(This,ppRegistryKeys) ) #define ISClusResource_get_CryptoKeys(This,ppCryptoKeys) \ ( (This)->lpVtbl -> get_CryptoKeys(This,ppCryptoKeys) ) #define ISClusResource_get_TypeName(This,pbstrTypeName) \ ( (This)->lpVtbl -> get_TypeName(This,pbstrTypeName) ) #define ISClusResource_get_Type(This,ppResourceType) \ ( (This)->lpVtbl -> get_Type(This,ppResourceType) ) #define ISClusResource_get_MaintenanceMode(This,pbMaintenanceMode) \ ( (This)->lpVtbl -> get_MaintenanceMode(This,pbMaintenanceMode) ) #define ISClusResource_put_MaintenanceMode(This,bMaintenanceMode) \ ( (This)->lpVtbl -> put_MaintenanceMode(This,bMaintenanceMode) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResource_INTERFACE_DEFINED__ */ #ifndef __ISClusResDependencies_INTERFACE_DEFINED__ #define __ISClusResDependencies_INTERFACE_DEFINED__ /* interface ISClusResDependencies */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResDependencies; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60704-2631-11d1-89f1-00a0c90d061e") ISClusResDependencies : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrResourceType, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DeleteItem( /* [in] */ VARIANT varIndex) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddItem( /* [in] */ __RPC__in_opt ISClusResource *pResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusResDependenciesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResDependencies * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResDependencies * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResDependencies * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResDependencies * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResDependencies * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResDependencies * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResDependencies * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResDependencies * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResDependencies * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResDependencies * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResDependencies * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusResDependencies * This, /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrResourceType, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( __RPC__in ISClusResDependencies * This, /* [in] */ VARIANT varIndex); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddItem )( __RPC__in ISClusResDependencies * This, /* [in] */ __RPC__in_opt ISClusResource *pResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveItem )( __RPC__in ISClusResDependencies * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusResDependenciesVtbl; interface ISClusResDependencies { CONST_VTBL struct ISClusResDependenciesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResDependencies_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResDependencies_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResDependencies_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResDependencies_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResDependencies_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResDependencies_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResDependencies_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResDependencies_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResDependencies_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResDependencies_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResDependencies_get_Item(This,varIndex,ppClusResource) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusResource) ) #define ISClusResDependencies_CreateItem(This,bstrResourceName,bstrResourceType,dwFlags,ppClusterResource) \ ( (This)->lpVtbl -> CreateItem(This,bstrResourceName,bstrResourceType,dwFlags,ppClusterResource) ) #define ISClusResDependencies_DeleteItem(This,varIndex) \ ( (This)->lpVtbl -> DeleteItem(This,varIndex) ) #define ISClusResDependencies_AddItem(This,pResource) \ ( (This)->lpVtbl -> AddItem(This,pResource) ) #define ISClusResDependencies_RemoveItem(This,varIndex) \ ( (This)->lpVtbl -> RemoveItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResDependencies_INTERFACE_DEFINED__ */ #ifndef __ISClusResGroupResources_INTERFACE_DEFINED__ #define __ISClusResGroupResources_INTERFACE_DEFINED__ /* interface ISClusResGroupResources */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResGroupResources; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606ea-2631-11d1-89f1-00a0c90d061e") ISClusResGroupResources : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrResourceType, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DeleteItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusResGroupResourcesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResGroupResources * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResGroupResources * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResGroupResources * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResGroupResources * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResGroupResources * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResGroupResources * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResGroupResources * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResGroupResources * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResGroupResources * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResGroupResources * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResGroupResources * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusResGroupResources * This, /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrResourceType, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( __RPC__in ISClusResGroupResources * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusResGroupResourcesVtbl; interface ISClusResGroupResources { CONST_VTBL struct ISClusResGroupResourcesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResGroupResources_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResGroupResources_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResGroupResources_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResGroupResources_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResGroupResources_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResGroupResources_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResGroupResources_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResGroupResources_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResGroupResources_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResGroupResources_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResGroupResources_get_Item(This,varIndex,ppClusResource) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusResource) ) #define ISClusResGroupResources_CreateItem(This,bstrResourceName,bstrResourceType,dwFlags,ppClusterResource) \ ( (This)->lpVtbl -> CreateItem(This,bstrResourceName,bstrResourceType,dwFlags,ppClusterResource) ) #define ISClusResGroupResources_DeleteItem(This,varIndex) \ ( (This)->lpVtbl -> DeleteItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResGroupResources_INTERFACE_DEFINED__ */ #ifndef __ISClusResTypeResources_INTERFACE_DEFINED__ #define __ISClusResTypeResources_INTERFACE_DEFINED__ /* interface ISClusResTypeResources */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResTypeResources; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60714-2631-11d1-89f1-00a0c90d061e") ISClusResTypeResources : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrGroupName, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DeleteItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusResTypeResourcesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResTypeResources * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResTypeResources * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResTypeResources * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResTypeResources * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResTypeResources * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResTypeResources * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResTypeResources * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResTypeResources * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResTypeResources * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResTypeResources * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResTypeResources * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusResTypeResources * This, /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrGroupName, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( __RPC__in ISClusResTypeResources * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusResTypeResourcesVtbl; interface ISClusResTypeResources { CONST_VTBL struct ISClusResTypeResourcesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResTypeResources_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResTypeResources_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResTypeResources_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResTypeResources_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResTypeResources_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResTypeResources_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResTypeResources_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResTypeResources_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResTypeResources_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResTypeResources_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResTypeResources_get_Item(This,varIndex,ppClusResource) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusResource) ) #define ISClusResTypeResources_CreateItem(This,bstrResourceName,bstrGroupName,dwFlags,ppClusterResource) \ ( (This)->lpVtbl -> CreateItem(This,bstrResourceName,bstrGroupName,dwFlags,ppClusterResource) ) #define ISClusResTypeResources_DeleteItem(This,varIndex) \ ( (This)->lpVtbl -> DeleteItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResTypeResources_INTERFACE_DEFINED__ */ #ifndef __ISClusResources_INTERFACE_DEFINED__ #define __ISClusResources_INTERFACE_DEFINED__ /* interface ISClusResources */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResources; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6070c-2631-11d1-89f1-00a0c90d061e") ISClusResources : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrResourceType, /* [in] */ __RPC__in BSTR bstrGroupName, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DeleteItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusResourcesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResources * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResources * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResources * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResources * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResources * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResources * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResources * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResources * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResources * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResources * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResources * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusResources * This, /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrResourceType, /* [in] */ __RPC__in BSTR bstrGroupName, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( __RPC__in ISClusResources * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusResourcesVtbl; interface ISClusResources { CONST_VTBL struct ISClusResourcesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResources_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResources_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResources_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResources_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResources_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResources_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResources_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResources_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResources_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResources_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResources_get_Item(This,varIndex,ppClusResource) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusResource) ) #define ISClusResources_CreateItem(This,bstrResourceName,bstrResourceType,bstrGroupName,dwFlags,ppClusterResource) \ ( (This)->lpVtbl -> CreateItem(This,bstrResourceName,bstrResourceType,bstrGroupName,dwFlags,ppClusterResource) ) #define ISClusResources_DeleteItem(This,varIndex) \ ( (This)->lpVtbl -> DeleteItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResources_INTERFACE_DEFINED__ */ #ifndef __ISClusResGroupPreferredOwnerNodes_INTERFACE_DEFINED__ #define __ISClusResGroupPreferredOwnerNodes_INTERFACE_DEFINED__ /* interface ISClusResGroupPreferredOwnerNodes */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResGroupPreferredOwnerNodes; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606e8-2631-11d1-89f1-00a0c90d061e") ISClusResGroupPreferredOwnerNodes : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppNode) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE InsertItem( /* [in] */ __RPC__in_opt ISClusNode *pNode, /* [in] */ long nPosition) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveItem( /* [in] */ VARIANT varIndex) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Modified( /* [retval][out] */ __RPC__out VARIANT *pvarModified) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SaveChanges( void) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddItem( /* [in] */ __RPC__in_opt ISClusNode *pNode) = 0; }; #else /* C style interface */ typedef struct ISClusResGroupPreferredOwnerNodesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResGroupPreferredOwnerNodes * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResGroupPreferredOwnerNodes * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResGroupPreferredOwnerNodes * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResGroupPreferredOwnerNodes * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppNode); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *InsertItem )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [in] */ __RPC__in_opt ISClusNode *pNode, /* [in] */ long nPosition); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveItem )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [in] */ VARIANT varIndex); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modified )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [retval][out] */ __RPC__out VARIANT *pvarModified); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SaveChanges )( __RPC__in ISClusResGroupPreferredOwnerNodes * This); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddItem )( __RPC__in ISClusResGroupPreferredOwnerNodes * This, /* [in] */ __RPC__in_opt ISClusNode *pNode); END_INTERFACE } ISClusResGroupPreferredOwnerNodesVtbl; interface ISClusResGroupPreferredOwnerNodes { CONST_VTBL struct ISClusResGroupPreferredOwnerNodesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResGroupPreferredOwnerNodes_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResGroupPreferredOwnerNodes_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResGroupPreferredOwnerNodes_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResGroupPreferredOwnerNodes_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResGroupPreferredOwnerNodes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResGroupPreferredOwnerNodes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResGroupPreferredOwnerNodes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResGroupPreferredOwnerNodes_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResGroupPreferredOwnerNodes_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResGroupPreferredOwnerNodes_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResGroupPreferredOwnerNodes_get_Item(This,varIndex,ppNode) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppNode) ) #define ISClusResGroupPreferredOwnerNodes_InsertItem(This,pNode,nPosition) \ ( (This)->lpVtbl -> InsertItem(This,pNode,nPosition) ) #define ISClusResGroupPreferredOwnerNodes_RemoveItem(This,varIndex) \ ( (This)->lpVtbl -> RemoveItem(This,varIndex) ) #define ISClusResGroupPreferredOwnerNodes_get_Modified(This,pvarModified) \ ( (This)->lpVtbl -> get_Modified(This,pvarModified) ) #define ISClusResGroupPreferredOwnerNodes_SaveChanges(This) \ ( (This)->lpVtbl -> SaveChanges(This) ) #define ISClusResGroupPreferredOwnerNodes_AddItem(This,pNode) \ ( (This)->lpVtbl -> AddItem(This,pNode) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResGroupPreferredOwnerNodes_INTERFACE_DEFINED__ */ #ifndef __ISClusResPossibleOwnerNodes_INTERFACE_DEFINED__ #define __ISClusResPossibleOwnerNodes_INTERFACE_DEFINED__ /* interface ISClusResPossibleOwnerNodes */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResPossibleOwnerNodes; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6070e-2631-11d1-89f1-00a0c90d061e") ISClusResPossibleOwnerNodes : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppNode) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddItem( /* [in] */ __RPC__in_opt ISClusNode *pNode) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveItem( /* [in] */ VARIANT varIndex) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Modified( /* [retval][out] */ __RPC__out VARIANT *pvarModified) = 0; }; #else /* C style interface */ typedef struct ISClusResPossibleOwnerNodesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResPossibleOwnerNodes * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResPossibleOwnerNodes * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResPossibleOwnerNodes * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResPossibleOwnerNodes * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppNode); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddItem )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [in] */ __RPC__in_opt ISClusNode *pNode); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveItem )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [in] */ VARIANT varIndex); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modified )( __RPC__in ISClusResPossibleOwnerNodes * This, /* [retval][out] */ __RPC__out VARIANT *pvarModified); END_INTERFACE } ISClusResPossibleOwnerNodesVtbl; interface ISClusResPossibleOwnerNodes { CONST_VTBL struct ISClusResPossibleOwnerNodesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResPossibleOwnerNodes_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResPossibleOwnerNodes_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResPossibleOwnerNodes_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResPossibleOwnerNodes_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResPossibleOwnerNodes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResPossibleOwnerNodes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResPossibleOwnerNodes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResPossibleOwnerNodes_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResPossibleOwnerNodes_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResPossibleOwnerNodes_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResPossibleOwnerNodes_get_Item(This,varIndex,ppNode) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppNode) ) #define ISClusResPossibleOwnerNodes_AddItem(This,pNode) \ ( (This)->lpVtbl -> AddItem(This,pNode) ) #define ISClusResPossibleOwnerNodes_RemoveItem(This,varIndex) \ ( (This)->lpVtbl -> RemoveItem(This,varIndex) ) #define ISClusResPossibleOwnerNodes_get_Modified(This,pvarModified) \ ( (This)->lpVtbl -> get_Modified(This,pvarModified) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResPossibleOwnerNodes_INTERFACE_DEFINED__ */ #ifndef __ISClusResTypePossibleOwnerNodes_INTERFACE_DEFINED__ #define __ISClusResTypePossibleOwnerNodes_INTERFACE_DEFINED__ /* interface ISClusResTypePossibleOwnerNodes */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResTypePossibleOwnerNodes; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60718-2631-11d1-89f1-00a0c90d061e") ISClusResTypePossibleOwnerNodes : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppNode) = 0; }; #else /* C style interface */ typedef struct ISClusResTypePossibleOwnerNodesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResTypePossibleOwnerNodes * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResTypePossibleOwnerNodes * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResTypePossibleOwnerNodes * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResTypePossibleOwnerNodes * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResTypePossibleOwnerNodes * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResTypePossibleOwnerNodes * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResTypePossibleOwnerNodes * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResTypePossibleOwnerNodes * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResTypePossibleOwnerNodes * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResTypePossibleOwnerNodes * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResTypePossibleOwnerNodes * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusNode **ppNode); END_INTERFACE } ISClusResTypePossibleOwnerNodesVtbl; interface ISClusResTypePossibleOwnerNodes { CONST_VTBL struct ISClusResTypePossibleOwnerNodesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResTypePossibleOwnerNodes_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResTypePossibleOwnerNodes_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResTypePossibleOwnerNodes_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResTypePossibleOwnerNodes_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResTypePossibleOwnerNodes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResTypePossibleOwnerNodes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResTypePossibleOwnerNodes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResTypePossibleOwnerNodes_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResTypePossibleOwnerNodes_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResTypePossibleOwnerNodes_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResTypePossibleOwnerNodes_get_Item(This,varIndex,ppNode) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppNode) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResTypePossibleOwnerNodes_INTERFACE_DEFINED__ */ #ifndef __ISClusResType_INTERFACE_DEFINED__ #define __ISClusResType_INTERFACE_DEFINED__ /* interface ISClusResType */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResType; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60710-2631-11d1-89f1-00a0c90d061e") ISClusResType : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommonROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PrivateROProperties( /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Delete( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Cluster( /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Resources( /* [retval][out] */ __RPC__deref_out_opt ISClusResTypeResources **ppClusterResTypeResources) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PossibleOwnerNodes( /* [retval][out] */ __RPC__deref_out_opt ISClusResTypePossibleOwnerNodes **ppOwnerNodes) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AvailableDisks( /* [retval][out] */ __RPC__deref_out_opt ISClusDisks **ppAvailableDisks) = 0; }; #else /* C style interface */ typedef struct ISClusResTypeVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResType * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResType * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResType * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResType * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResType * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResType * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResType * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonProperties )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateProperties )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CommonROProperties )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PrivateROProperties )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt ISClusProperties **ppProperties); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Delete )( __RPC__in ISClusResType * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Cluster )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt ISCluster **ppCluster); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Resources )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResTypeResources **ppClusterResTypeResources); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PossibleOwnerNodes )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt ISClusResTypePossibleOwnerNodes **ppOwnerNodes); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_AvailableDisks )( __RPC__in ISClusResType * This, /* [retval][out] */ __RPC__deref_out_opt ISClusDisks **ppAvailableDisks); END_INTERFACE } ISClusResTypeVtbl; interface ISClusResType { CONST_VTBL struct ISClusResTypeVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResType_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResType_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResType_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResType_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResType_get_CommonProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonProperties(This,ppProperties) ) #define ISClusResType_get_PrivateProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateProperties(This,ppProperties) ) #define ISClusResType_get_CommonROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_CommonROProperties(This,ppProperties) ) #define ISClusResType_get_PrivateROProperties(This,ppProperties) \ ( (This)->lpVtbl -> get_PrivateROProperties(This,ppProperties) ) #define ISClusResType_get_Name(This,pbstrName) \ ( (This)->lpVtbl -> get_Name(This,pbstrName) ) #define ISClusResType_Delete(This) \ ( (This)->lpVtbl -> Delete(This) ) #define ISClusResType_get_Cluster(This,ppCluster) \ ( (This)->lpVtbl -> get_Cluster(This,ppCluster) ) #define ISClusResType_get_Resources(This,ppClusterResTypeResources) \ ( (This)->lpVtbl -> get_Resources(This,ppClusterResTypeResources) ) #define ISClusResType_get_PossibleOwnerNodes(This,ppOwnerNodes) \ ( (This)->lpVtbl -> get_PossibleOwnerNodes(This,ppOwnerNodes) ) #define ISClusResType_get_AvailableDisks(This,ppAvailableDisks) \ ( (This)->lpVtbl -> get_AvailableDisks(This,ppAvailableDisks) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResType_INTERFACE_DEFINED__ */ #ifndef __ISClusResTypes_INTERFACE_DEFINED__ #define __ISClusResTypes_INTERFACE_DEFINED__ /* interface ISClusResTypes */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResTypes; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60712-2631-11d1-89f1-00a0c90d061e") ISClusResTypes : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResType **ppClusResType) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrResourceTypeName, /* [in] */ __RPC__in BSTR bstrDisplayName, /* [in] */ __RPC__in BSTR bstrResourceTypeDll, /* [in] */ long dwLooksAlivePollInterval, /* [in] */ long dwIsAlivePollInterval, /* [retval][out] */ __RPC__deref_out_opt ISClusResType **ppResourceType) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DeleteItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusResTypesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResTypes * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResTypes * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResTypes * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResTypes * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResTypes * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResTypes * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResTypes * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResTypes * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResTypes * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResTypes * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResTypes * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResType **ppClusResType); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusResTypes * This, /* [in] */ __RPC__in BSTR bstrResourceTypeName, /* [in] */ __RPC__in BSTR bstrDisplayName, /* [in] */ __RPC__in BSTR bstrResourceTypeDll, /* [in] */ long dwLooksAlivePollInterval, /* [in] */ long dwIsAlivePollInterval, /* [retval][out] */ __RPC__deref_out_opt ISClusResType **ppResourceType); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( __RPC__in ISClusResTypes * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusResTypesVtbl; interface ISClusResTypes { CONST_VTBL struct ISClusResTypesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResTypes_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResTypes_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResTypes_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResTypes_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResTypes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResTypes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResTypes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResTypes_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResTypes_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResTypes_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResTypes_get_Item(This,varIndex,ppClusResType) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusResType) ) #define ISClusResTypes_CreateItem(This,bstrResourceTypeName,bstrDisplayName,bstrResourceTypeDll,dwLooksAlivePollInterval,dwIsAlivePollInterval,ppResourceType) \ ( (This)->lpVtbl -> CreateItem(This,bstrResourceTypeName,bstrDisplayName,bstrResourceTypeDll,dwLooksAlivePollInterval,dwIsAlivePollInterval,ppResourceType) ) #define ISClusResTypes_DeleteItem(This,varIndex) \ ( (This)->lpVtbl -> DeleteItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResTypes_INTERFACE_DEFINED__ */ #ifndef __ISClusProperty_INTERFACE_DEFINED__ #define __ISClusProperty_INTERFACE_DEFINED__ /* interface ISClusProperty */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusProperty; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e606fe-2631-11d1-89f1-00a0c90d061e") ISClusProperty : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Name( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Length( /* [retval][out] */ __RPC__out long *pLength) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ValueCount( /* [retval][out] */ __RPC__out long *pCount) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Values( /* [retval][out] */ __RPC__deref_out_opt ISClusPropertyValues **ppClusterPropertyValues) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Value( /* [retval][out] */ __RPC__out VARIANT *pvarValue) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Value( /* [in] */ VARIANT varValue) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Type( /* [retval][out] */ __RPC__out CLUSTER_PROPERTY_TYPE *pType) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Type( /* [in] */ CLUSTER_PROPERTY_TYPE Type) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Format( /* [retval][out] */ __RPC__out CLUSTER_PROPERTY_FORMAT *pFormat) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Format( /* [in] */ CLUSTER_PROPERTY_FORMAT Format) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReadOnly( /* [retval][out] */ __RPC__out VARIANT *pvarReadOnly) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Private( /* [retval][out] */ __RPC__out VARIANT *pvarPrivate) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Common( /* [retval][out] */ __RPC__out VARIANT *pvarCommon) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Modified( /* [retval][out] */ __RPC__out VARIANT *pvarModified) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE UseDefaultValue( void) = 0; }; #else /* C style interface */ typedef struct ISClusPropertyVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusProperty * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusProperty * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusProperty * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusProperty * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusProperty * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusProperty * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusProperty * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Name )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Length )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out long *pLength); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ValueCount )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out long *pCount); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Values )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__deref_out_opt ISClusPropertyValues **ppClusterPropertyValues); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Value )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out VARIANT *pvarValue); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Value )( __RPC__in ISClusProperty * This, /* [in] */ VARIANT varValue); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out CLUSTER_PROPERTY_TYPE *pType); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Type )( __RPC__in ISClusProperty * This, /* [in] */ CLUSTER_PROPERTY_TYPE Type); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Format )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out CLUSTER_PROPERTY_FORMAT *pFormat); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Format )( __RPC__in ISClusProperty * This, /* [in] */ CLUSTER_PROPERTY_FORMAT Format); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReadOnly )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out VARIANT *pvarReadOnly); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Private )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out VARIANT *pvarPrivate); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Common )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out VARIANT *pvarCommon); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modified )( __RPC__in ISClusProperty * This, /* [retval][out] */ __RPC__out VARIANT *pvarModified); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *UseDefaultValue )( __RPC__in ISClusProperty * This); END_INTERFACE } ISClusPropertyVtbl; interface ISClusProperty { CONST_VTBL struct ISClusPropertyVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusProperty_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusProperty_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusProperty_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusProperty_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusProperty_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusProperty_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusProperty_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusProperty_get_Name(This,pbstrName) \ ( (This)->lpVtbl -> get_Name(This,pbstrName) ) #define ISClusProperty_get_Length(This,pLength) \ ( (This)->lpVtbl -> get_Length(This,pLength) ) #define ISClusProperty_get_ValueCount(This,pCount) \ ( (This)->lpVtbl -> get_ValueCount(This,pCount) ) #define ISClusProperty_get_Values(This,ppClusterPropertyValues) \ ( (This)->lpVtbl -> get_Values(This,ppClusterPropertyValues) ) #define ISClusProperty_get_Value(This,pvarValue) \ ( (This)->lpVtbl -> get_Value(This,pvarValue) ) #define ISClusProperty_put_Value(This,varValue) \ ( (This)->lpVtbl -> put_Value(This,varValue) ) #define ISClusProperty_get_Type(This,pType) \ ( (This)->lpVtbl -> get_Type(This,pType) ) #define ISClusProperty_put_Type(This,Type) \ ( (This)->lpVtbl -> put_Type(This,Type) ) #define ISClusProperty_get_Format(This,pFormat) \ ( (This)->lpVtbl -> get_Format(This,pFormat) ) #define ISClusProperty_put_Format(This,Format) \ ( (This)->lpVtbl -> put_Format(This,Format) ) #define ISClusProperty_get_ReadOnly(This,pvarReadOnly) \ ( (This)->lpVtbl -> get_ReadOnly(This,pvarReadOnly) ) #define ISClusProperty_get_Private(This,pvarPrivate) \ ( (This)->lpVtbl -> get_Private(This,pvarPrivate) ) #define ISClusProperty_get_Common(This,pvarCommon) \ ( (This)->lpVtbl -> get_Common(This,pvarCommon) ) #define ISClusProperty_get_Modified(This,pvarModified) \ ( (This)->lpVtbl -> get_Modified(This,pvarModified) ) #define ISClusProperty_UseDefaultValue(This) \ ( (This)->lpVtbl -> UseDefaultValue(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusProperty_INTERFACE_DEFINED__ */ #ifndef __ISClusPropertyValue_INTERFACE_DEFINED__ #define __ISClusPropertyValue_INTERFACE_DEFINED__ /* interface ISClusPropertyValue */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusPropertyValue; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6071a-2631-11d1-89f1-00a0c90d061e") ISClusPropertyValue : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Value( /* [retval][out] */ __RPC__out VARIANT *pvarValue) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Value( /* [in] */ VARIANT varValue) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Type( /* [retval][out] */ __RPC__out CLUSTER_PROPERTY_TYPE *pType) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Type( /* [in] */ CLUSTER_PROPERTY_TYPE Type) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Format( /* [retval][out] */ __RPC__out CLUSTER_PROPERTY_FORMAT *pFormat) = 0; virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Format( /* [in] */ CLUSTER_PROPERTY_FORMAT Format) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Length( /* [retval][out] */ __RPC__out long *pLength) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DataCount( /* [retval][out] */ __RPC__out long *pCount) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Data( /* [retval][out] */ __RPC__deref_out_opt ISClusPropertyValueData **ppClusterPropertyValueData) = 0; }; #else /* C style interface */ typedef struct ISClusPropertyValueVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusPropertyValue * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusPropertyValue * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusPropertyValue * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusPropertyValue * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusPropertyValue * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusPropertyValue * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusPropertyValue * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Value )( __RPC__in ISClusPropertyValue * This, /* [retval][out] */ __RPC__out VARIANT *pvarValue); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Value )( __RPC__in ISClusPropertyValue * This, /* [in] */ VARIANT varValue); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )( __RPC__in ISClusPropertyValue * This, /* [retval][out] */ __RPC__out CLUSTER_PROPERTY_TYPE *pType); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Type )( __RPC__in ISClusPropertyValue * This, /* [in] */ CLUSTER_PROPERTY_TYPE Type); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Format )( __RPC__in ISClusPropertyValue * This, /* [retval][out] */ __RPC__out CLUSTER_PROPERTY_FORMAT *pFormat); /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Format )( __RPC__in ISClusPropertyValue * This, /* [in] */ CLUSTER_PROPERTY_FORMAT Format); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Length )( __RPC__in ISClusPropertyValue * This, /* [retval][out] */ __RPC__out long *pLength); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DataCount )( __RPC__in ISClusPropertyValue * This, /* [retval][out] */ __RPC__out long *pCount); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Data )( __RPC__in ISClusPropertyValue * This, /* [retval][out] */ __RPC__deref_out_opt ISClusPropertyValueData **ppClusterPropertyValueData); END_INTERFACE } ISClusPropertyValueVtbl; interface ISClusPropertyValue { CONST_VTBL struct ISClusPropertyValueVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusPropertyValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusPropertyValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusPropertyValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusPropertyValue_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusPropertyValue_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusPropertyValue_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusPropertyValue_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusPropertyValue_get_Value(This,pvarValue) \ ( (This)->lpVtbl -> get_Value(This,pvarValue) ) #define ISClusPropertyValue_put_Value(This,varValue) \ ( (This)->lpVtbl -> put_Value(This,varValue) ) #define ISClusPropertyValue_get_Type(This,pType) \ ( (This)->lpVtbl -> get_Type(This,pType) ) #define ISClusPropertyValue_put_Type(This,Type) \ ( (This)->lpVtbl -> put_Type(This,Type) ) #define ISClusPropertyValue_get_Format(This,pFormat) \ ( (This)->lpVtbl -> get_Format(This,pFormat) ) #define ISClusPropertyValue_put_Format(This,Format) \ ( (This)->lpVtbl -> put_Format(This,Format) ) #define ISClusPropertyValue_get_Length(This,pLength) \ ( (This)->lpVtbl -> get_Length(This,pLength) ) #define ISClusPropertyValue_get_DataCount(This,pCount) \ ( (This)->lpVtbl -> get_DataCount(This,pCount) ) #define ISClusPropertyValue_get_Data(This,ppClusterPropertyValueData) \ ( (This)->lpVtbl -> get_Data(This,ppClusterPropertyValueData) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusPropertyValue_INTERFACE_DEFINED__ */ #ifndef __ISClusPropertyValues_INTERFACE_DEFINED__ #define __ISClusPropertyValues_INTERFACE_DEFINED__ /* interface ISClusPropertyValues */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusPropertyValues; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6071c-2631-11d1-89f1-00a0c90d061e") ISClusPropertyValues : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusPropertyValue **ppPropertyValue) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrName, /* [in] */ VARIANT varValue, /* [retval][out] */ __RPC__deref_out_opt ISClusPropertyValue **ppPropertyValue) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusPropertyValuesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusPropertyValues * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusPropertyValues * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusPropertyValues * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusPropertyValues * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusPropertyValues * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusPropertyValues * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusPropertyValues * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusPropertyValues * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusPropertyValues * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusPropertyValues * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusPropertyValue **ppPropertyValue); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusPropertyValues * This, /* [in] */ __RPC__in BSTR bstrName, /* [in] */ VARIANT varValue, /* [retval][out] */ __RPC__deref_out_opt ISClusPropertyValue **ppPropertyValue); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveItem )( __RPC__in ISClusPropertyValues * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusPropertyValuesVtbl; interface ISClusPropertyValues { CONST_VTBL struct ISClusPropertyValuesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusPropertyValues_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusPropertyValues_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusPropertyValues_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusPropertyValues_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusPropertyValues_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusPropertyValues_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusPropertyValues_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusPropertyValues_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusPropertyValues_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusPropertyValues_get_Item(This,varIndex,ppPropertyValue) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppPropertyValue) ) #define ISClusPropertyValues_CreateItem(This,bstrName,varValue,ppPropertyValue) \ ( (This)->lpVtbl -> CreateItem(This,bstrName,varValue,ppPropertyValue) ) #define ISClusPropertyValues_RemoveItem(This,varIndex) \ ( (This)->lpVtbl -> RemoveItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusPropertyValues_INTERFACE_DEFINED__ */ #ifndef __ISClusProperties_INTERFACE_DEFINED__ #define __ISClusProperties_INTERFACE_DEFINED__ /* interface ISClusProperties */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusProperties; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60700-2631-11d1-89f1-00a0c90d061e") ISClusProperties : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusProperty **ppClusProperty) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrName, /* [in] */ VARIANT varValue, /* [retval][out] */ __RPC__deref_out_opt ISClusProperty **pProperty) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE UseDefaultValue( /* [in] */ VARIANT varIndex) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SaveChanges( /* [defaultvalue][out] */ __RPC__out VARIANT *pvarStatusCode = 0) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReadOnly( /* [retval][out] */ __RPC__out VARIANT *pvarReadOnly) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Private( /* [retval][out] */ __RPC__out VARIANT *pvarPrivate) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Common( /* [retval][out] */ __RPC__out VARIANT *pvarCommon) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Modified( /* [retval][out] */ __RPC__out VARIANT *pvarModified) = 0; }; #else /* C style interface */ typedef struct ISClusPropertiesVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusProperties * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusProperties * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusProperties * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusProperties * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusProperties * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusProperties * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusProperties * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusProperties * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusProperties * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusProperties * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusProperties * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusProperty **ppClusProperty); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusProperties * This, /* [in] */ __RPC__in BSTR bstrName, /* [in] */ VARIANT varValue, /* [retval][out] */ __RPC__deref_out_opt ISClusProperty **pProperty); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *UseDefaultValue )( __RPC__in ISClusProperties * This, /* [in] */ VARIANT varIndex); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SaveChanges )( __RPC__in ISClusProperties * This, /* [defaultvalue][out] */ __RPC__out VARIANT *pvarStatusCode); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReadOnly )( __RPC__in ISClusProperties * This, /* [retval][out] */ __RPC__out VARIANT *pvarReadOnly); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Private )( __RPC__in ISClusProperties * This, /* [retval][out] */ __RPC__out VARIANT *pvarPrivate); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Common )( __RPC__in ISClusProperties * This, /* [retval][out] */ __RPC__out VARIANT *pvarCommon); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Modified )( __RPC__in ISClusProperties * This, /* [retval][out] */ __RPC__out VARIANT *pvarModified); END_INTERFACE } ISClusPropertiesVtbl; interface ISClusProperties { CONST_VTBL struct ISClusPropertiesVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusProperties_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusProperties_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusProperties_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusProperties_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusProperties_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusProperties_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusProperties_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusProperties_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusProperties_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusProperties_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusProperties_get_Item(This,varIndex,ppClusProperty) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusProperty) ) #define ISClusProperties_CreateItem(This,bstrName,varValue,pProperty) \ ( (This)->lpVtbl -> CreateItem(This,bstrName,varValue,pProperty) ) #define ISClusProperties_UseDefaultValue(This,varIndex) \ ( (This)->lpVtbl -> UseDefaultValue(This,varIndex) ) #define ISClusProperties_SaveChanges(This,pvarStatusCode) \ ( (This)->lpVtbl -> SaveChanges(This,pvarStatusCode) ) #define ISClusProperties_get_ReadOnly(This,pvarReadOnly) \ ( (This)->lpVtbl -> get_ReadOnly(This,pvarReadOnly) ) #define ISClusProperties_get_Private(This,pvarPrivate) \ ( (This)->lpVtbl -> get_Private(This,pvarPrivate) ) #define ISClusProperties_get_Common(This,pvarCommon) \ ( (This)->lpVtbl -> get_Common(This,pvarCommon) ) #define ISClusProperties_get_Modified(This,pvarModified) \ ( (This)->lpVtbl -> get_Modified(This,pvarModified) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusProperties_INTERFACE_DEFINED__ */ #ifndef __ISClusPropertyValueData_INTERFACE_DEFINED__ #define __ISClusPropertyValueData_INTERFACE_DEFINED__ /* interface ISClusPropertyValueData */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusPropertyValueData; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6071e-2631-11d1-89f1-00a0c90d061e") ISClusPropertyValueData : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__out VARIANT *pvarValue) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ VARIANT varValue, /* [retval][out] */ __RPC__out VARIANT *pvarData) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusPropertyValueDataVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusPropertyValueData * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusPropertyValueData * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusPropertyValueData * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusPropertyValueData * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusPropertyValueData * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusPropertyValueData * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusPropertyValueData * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusPropertyValueData * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusPropertyValueData * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusPropertyValueData * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__out VARIANT *pvarValue); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusPropertyValueData * This, /* [in] */ VARIANT varValue, /* [retval][out] */ __RPC__out VARIANT *pvarData); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveItem )( __RPC__in ISClusPropertyValueData * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusPropertyValueDataVtbl; interface ISClusPropertyValueData { CONST_VTBL struct ISClusPropertyValueDataVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusPropertyValueData_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusPropertyValueData_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusPropertyValueData_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusPropertyValueData_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusPropertyValueData_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusPropertyValueData_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusPropertyValueData_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusPropertyValueData_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusPropertyValueData_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusPropertyValueData_get_Item(This,varIndex,pvarValue) \ ( (This)->lpVtbl -> get_Item(This,varIndex,pvarValue) ) #define ISClusPropertyValueData_CreateItem(This,varValue,pvarData) \ ( (This)->lpVtbl -> CreateItem(This,varValue,pvarData) ) #define ISClusPropertyValueData_RemoveItem(This,varIndex) \ ( (This)->lpVtbl -> RemoveItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusPropertyValueData_INTERFACE_DEFINED__ */ #ifndef __ISClusPartition_INTERFACE_DEFINED__ #define __ISClusPartition_INTERFACE_DEFINED__ /* interface ISClusPartition */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusPartition; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60720-2631-11d1-89f1-00a0c90d061e") ISClusPartition : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Flags( /* [retval][out] */ __RPC__out long *plFlags) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DeviceName( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceName) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_VolumeLabel( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrVolumeLabel) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SerialNumber( /* [retval][out] */ __RPC__out long *plSerialNumber) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaximumComponentLength( /* [retval][out] */ __RPC__out long *plMaximumComponentLength) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FileSystemFlags( /* [retval][out] */ __RPC__out long *plFileSystemFlags) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FileSystem( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrFileSystem) = 0; }; #else /* C style interface */ typedef struct ISClusPartitionVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusPartition * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusPartition * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusPartition * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusPartition * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusPartition * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusPartition * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusPartition * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Flags )( __RPC__in ISClusPartition * This, /* [retval][out] */ __RPC__out long *plFlags); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DeviceName )( __RPC__in ISClusPartition * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_VolumeLabel )( __RPC__in ISClusPartition * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrVolumeLabel); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SerialNumber )( __RPC__in ISClusPartition * This, /* [retval][out] */ __RPC__out long *plSerialNumber); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaximumComponentLength )( __RPC__in ISClusPartition * This, /* [retval][out] */ __RPC__out long *plMaximumComponentLength); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FileSystemFlags )( __RPC__in ISClusPartition * This, /* [retval][out] */ __RPC__out long *plFileSystemFlags); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FileSystem )( __RPC__in ISClusPartition * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrFileSystem); END_INTERFACE } ISClusPartitionVtbl; interface ISClusPartition { CONST_VTBL struct ISClusPartitionVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusPartition_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusPartition_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusPartition_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusPartition_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusPartition_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusPartition_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusPartition_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusPartition_get_Flags(This,plFlags) \ ( (This)->lpVtbl -> get_Flags(This,plFlags) ) #define ISClusPartition_get_DeviceName(This,pbstrDeviceName) \ ( (This)->lpVtbl -> get_DeviceName(This,pbstrDeviceName) ) #define ISClusPartition_get_VolumeLabel(This,pbstrVolumeLabel) \ ( (This)->lpVtbl -> get_VolumeLabel(This,pbstrVolumeLabel) ) #define ISClusPartition_get_SerialNumber(This,plSerialNumber) \ ( (This)->lpVtbl -> get_SerialNumber(This,plSerialNumber) ) #define ISClusPartition_get_MaximumComponentLength(This,plMaximumComponentLength) \ ( (This)->lpVtbl -> get_MaximumComponentLength(This,plMaximumComponentLength) ) #define ISClusPartition_get_FileSystemFlags(This,plFileSystemFlags) \ ( (This)->lpVtbl -> get_FileSystemFlags(This,plFileSystemFlags) ) #define ISClusPartition_get_FileSystem(This,pbstrFileSystem) \ ( (This)->lpVtbl -> get_FileSystem(This,pbstrFileSystem) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusPartition_INTERFACE_DEFINED__ */ #ifndef __ISClusPartitionEx_INTERFACE_DEFINED__ #define __ISClusPartitionEx_INTERFACE_DEFINED__ /* interface ISClusPartitionEx */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusPartitionEx; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("8802d4fe-b32e-4ad1-9dbd-64f18e1166ce") ISClusPartitionEx : public ISClusPartition { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TotalSize( /* [retval][out] */ __RPC__out long *plTotalSize) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FreeSpace( /* [retval][out] */ __RPC__out long *plFreeSpace) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DeviceNumber( /* [retval][out] */ __RPC__out long *plDeviceNumber) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PartitionNumber( /* [retval][out] */ __RPC__out long *plPartitionNumber) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_VolumeGuid( /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrVolumeGuid) = 0; }; #else /* C style interface */ typedef struct ISClusPartitionExVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusPartitionEx * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusPartitionEx * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusPartitionEx * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusPartitionEx * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusPartitionEx * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusPartitionEx * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusPartitionEx * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Flags )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__out long *plFlags); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DeviceName )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceName); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_VolumeLabel )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrVolumeLabel); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SerialNumber )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__out long *plSerialNumber); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaximumComponentLength )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__out long *plMaximumComponentLength); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FileSystemFlags )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__out long *plFileSystemFlags); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FileSystem )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrFileSystem); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TotalSize )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__out long *plTotalSize); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FreeSpace )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__out long *plFreeSpace); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DeviceNumber )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__out long *plDeviceNumber); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PartitionNumber )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__out long *plPartitionNumber); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_VolumeGuid )( __RPC__in ISClusPartitionEx * This, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrVolumeGuid); END_INTERFACE } ISClusPartitionExVtbl; interface ISClusPartitionEx { CONST_VTBL struct ISClusPartitionExVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusPartitionEx_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusPartitionEx_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusPartitionEx_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusPartitionEx_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusPartitionEx_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusPartitionEx_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusPartitionEx_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusPartitionEx_get_Flags(This,plFlags) \ ( (This)->lpVtbl -> get_Flags(This,plFlags) ) #define ISClusPartitionEx_get_DeviceName(This,pbstrDeviceName) \ ( (This)->lpVtbl -> get_DeviceName(This,pbstrDeviceName) ) #define ISClusPartitionEx_get_VolumeLabel(This,pbstrVolumeLabel) \ ( (This)->lpVtbl -> get_VolumeLabel(This,pbstrVolumeLabel) ) #define ISClusPartitionEx_get_SerialNumber(This,plSerialNumber) \ ( (This)->lpVtbl -> get_SerialNumber(This,plSerialNumber) ) #define ISClusPartitionEx_get_MaximumComponentLength(This,plMaximumComponentLength) \ ( (This)->lpVtbl -> get_MaximumComponentLength(This,plMaximumComponentLength) ) #define ISClusPartitionEx_get_FileSystemFlags(This,plFileSystemFlags) \ ( (This)->lpVtbl -> get_FileSystemFlags(This,plFileSystemFlags) ) #define ISClusPartitionEx_get_FileSystem(This,pbstrFileSystem) \ ( (This)->lpVtbl -> get_FileSystem(This,pbstrFileSystem) ) #define ISClusPartitionEx_get_TotalSize(This,plTotalSize) \ ( (This)->lpVtbl -> get_TotalSize(This,plTotalSize) ) #define ISClusPartitionEx_get_FreeSpace(This,plFreeSpace) \ ( (This)->lpVtbl -> get_FreeSpace(This,plFreeSpace) ) #define ISClusPartitionEx_get_DeviceNumber(This,plDeviceNumber) \ ( (This)->lpVtbl -> get_DeviceNumber(This,plDeviceNumber) ) #define ISClusPartitionEx_get_PartitionNumber(This,plPartitionNumber) \ ( (This)->lpVtbl -> get_PartitionNumber(This,plPartitionNumber) ) #define ISClusPartitionEx_get_VolumeGuid(This,pbstrVolumeGuid) \ ( (This)->lpVtbl -> get_VolumeGuid(This,pbstrVolumeGuid) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusPartitionEx_INTERFACE_DEFINED__ */ #ifndef __ISClusPartitions_INTERFACE_DEFINED__ #define __ISClusPartitions_INTERFACE_DEFINED__ /* interface ISClusPartitions */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusPartitions; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60722-2631-11d1-89f1-00a0c90d061e") ISClusPartitions : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusPartition **ppPartition) = 0; }; #else /* C style interface */ typedef struct ISClusPartitionsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusPartitions * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusPartitions * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusPartitions * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusPartitions * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusPartitions * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusPartitions * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusPartitions * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusPartitions * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusPartitions * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusPartitions * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusPartition **ppPartition); END_INTERFACE } ISClusPartitionsVtbl; interface ISClusPartitions { CONST_VTBL struct ISClusPartitionsVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusPartitions_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusPartitions_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusPartitions_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusPartitions_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusPartitions_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusPartitions_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusPartitions_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusPartitions_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusPartitions_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusPartitions_get_Item(This,varIndex,ppPartition) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppPartition) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusPartitions_INTERFACE_DEFINED__ */ #ifndef __ISClusDisk_INTERFACE_DEFINED__ #define __ISClusDisk_INTERFACE_DEFINED__ /* interface ISClusDisk */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusDisk; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60724-2631-11d1-89f1-00a0c90d061e") ISClusDisk : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Signature( /* [retval][out] */ __RPC__out long *plSignature) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScsiAddress( /* [retval][out] */ __RPC__deref_out_opt ISClusScsiAddress **ppScsiAddress) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DiskNumber( /* [retval][out] */ __RPC__out long *plDiskNumber) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Partitions( /* [retval][out] */ __RPC__deref_out_opt ISClusPartitions **ppPartitions) = 0; }; #else /* C style interface */ typedef struct ISClusDiskVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusDisk * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusDisk * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusDisk * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusDisk * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusDisk * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusDisk * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusDisk * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Signature )( __RPC__in ISClusDisk * This, /* [retval][out] */ __RPC__out long *plSignature); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScsiAddress )( __RPC__in ISClusDisk * This, /* [retval][out] */ __RPC__deref_out_opt ISClusScsiAddress **ppScsiAddress); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DiskNumber )( __RPC__in ISClusDisk * This, /* [retval][out] */ __RPC__out long *plDiskNumber); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Partitions )( __RPC__in ISClusDisk * This, /* [retval][out] */ __RPC__deref_out_opt ISClusPartitions **ppPartitions); END_INTERFACE } ISClusDiskVtbl; interface ISClusDisk { CONST_VTBL struct ISClusDiskVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusDisk_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusDisk_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusDisk_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusDisk_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusDisk_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusDisk_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusDisk_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusDisk_get_Signature(This,plSignature) \ ( (This)->lpVtbl -> get_Signature(This,plSignature) ) #define ISClusDisk_get_ScsiAddress(This,ppScsiAddress) \ ( (This)->lpVtbl -> get_ScsiAddress(This,ppScsiAddress) ) #define ISClusDisk_get_DiskNumber(This,plDiskNumber) \ ( (This)->lpVtbl -> get_DiskNumber(This,plDiskNumber) ) #define ISClusDisk_get_Partitions(This,ppPartitions) \ ( (This)->lpVtbl -> get_Partitions(This,ppPartitions) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusDisk_INTERFACE_DEFINED__ */ #ifndef __ISClusDisks_INTERFACE_DEFINED__ #define __ISClusDisks_INTERFACE_DEFINED__ /* interface ISClusDisks */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusDisks; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60726-2631-11d1-89f1-00a0c90d061e") ISClusDisks : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusDisk **ppDisk) = 0; }; #else /* C style interface */ typedef struct ISClusDisksVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusDisks * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusDisks * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusDisks * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusDisks * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusDisks * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusDisks * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusDisks * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusDisks * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusDisks * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusDisks * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusDisk **ppDisk); END_INTERFACE } ISClusDisksVtbl; interface ISClusDisks { CONST_VTBL struct ISClusDisksVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusDisks_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusDisks_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusDisks_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusDisks_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusDisks_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusDisks_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusDisks_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusDisks_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusDisks_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusDisks_get_Item(This,varIndex,ppDisk) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppDisk) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusDisks_INTERFACE_DEFINED__ */ #ifndef __ISClusScsiAddress_INTERFACE_DEFINED__ #define __ISClusScsiAddress_INTERFACE_DEFINED__ /* interface ISClusScsiAddress */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusScsiAddress; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e60728-2631-11d1-89f1-00a0c90d061e") ISClusScsiAddress : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PortNumber( /* [retval][out] */ __RPC__out VARIANT *pvarPortNumber) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PathId( /* [retval][out] */ __RPC__out VARIANT *pvarPathId) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TargetId( /* [retval][out] */ __RPC__out VARIANT *pvarTargetId) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Lun( /* [retval][out] */ __RPC__out VARIANT *pvarLun) = 0; }; #else /* C style interface */ typedef struct ISClusScsiAddressVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusScsiAddress * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusScsiAddress * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusScsiAddress * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusScsiAddress * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusScsiAddress * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusScsiAddress * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusScsiAddress * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortNumber )( __RPC__in ISClusScsiAddress * This, /* [retval][out] */ __RPC__out VARIANT *pvarPortNumber); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PathId )( __RPC__in ISClusScsiAddress * This, /* [retval][out] */ __RPC__out VARIANT *pvarPathId); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TargetId )( __RPC__in ISClusScsiAddress * This, /* [retval][out] */ __RPC__out VARIANT *pvarTargetId); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Lun )( __RPC__in ISClusScsiAddress * This, /* [retval][out] */ __RPC__out VARIANT *pvarLun); END_INTERFACE } ISClusScsiAddressVtbl; interface ISClusScsiAddress { CONST_VTBL struct ISClusScsiAddressVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusScsiAddress_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusScsiAddress_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusScsiAddress_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusScsiAddress_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusScsiAddress_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusScsiAddress_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusScsiAddress_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusScsiAddress_get_PortNumber(This,pvarPortNumber) \ ( (This)->lpVtbl -> get_PortNumber(This,pvarPortNumber) ) #define ISClusScsiAddress_get_PathId(This,pvarPathId) \ ( (This)->lpVtbl -> get_PathId(This,pvarPathId) ) #define ISClusScsiAddress_get_TargetId(This,pvarTargetId) \ ( (This)->lpVtbl -> get_TargetId(This,pvarTargetId) ) #define ISClusScsiAddress_get_Lun(This,pvarLun) \ ( (This)->lpVtbl -> get_Lun(This,pvarLun) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusScsiAddress_INTERFACE_DEFINED__ */ #ifndef __ISClusRegistryKeys_INTERFACE_DEFINED__ #define __ISClusRegistryKeys_INTERFACE_DEFINED__ /* interface ISClusRegistryKeys */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusRegistryKeys; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6072a-2631-11d1-89f1-00a0c90d061e") ISClusRegistryKeys : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrRegistryKey) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddItem( /* [in] */ __RPC__in BSTR bstrRegistryKey) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusRegistryKeysVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusRegistryKeys * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusRegistryKeys * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusRegistryKeys * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusRegistryKeys * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusRegistryKeys * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusRegistryKeys * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusRegistryKeys * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusRegistryKeys * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusRegistryKeys * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusRegistryKeys * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusRegistryKeys * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrRegistryKey); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddItem )( __RPC__in ISClusRegistryKeys * This, /* [in] */ __RPC__in BSTR bstrRegistryKey); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveItem )( __RPC__in ISClusRegistryKeys * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusRegistryKeysVtbl; interface ISClusRegistryKeys { CONST_VTBL struct ISClusRegistryKeysVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusRegistryKeys_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusRegistryKeys_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusRegistryKeys_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusRegistryKeys_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusRegistryKeys_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusRegistryKeys_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusRegistryKeys_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusRegistryKeys_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusRegistryKeys_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusRegistryKeys_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusRegistryKeys_get_Item(This,varIndex,pbstrRegistryKey) \ ( (This)->lpVtbl -> get_Item(This,varIndex,pbstrRegistryKey) ) #define ISClusRegistryKeys_AddItem(This,bstrRegistryKey) \ ( (This)->lpVtbl -> AddItem(This,bstrRegistryKey) ) #define ISClusRegistryKeys_RemoveItem(This,varIndex) \ ( (This)->lpVtbl -> RemoveItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusRegistryKeys_INTERFACE_DEFINED__ */ #ifndef __ISClusCryptoKeys_INTERFACE_DEFINED__ #define __ISClusCryptoKeys_INTERFACE_DEFINED__ /* interface ISClusCryptoKeys */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusCryptoKeys; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6072c-2631-11d1-89f1-00a0c90d061e") ISClusCryptoKeys : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrCyrptoKey) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddItem( /* [in] */ __RPC__in BSTR bstrCryptoKey) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusCryptoKeysVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusCryptoKeys * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusCryptoKeys * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusCryptoKeys * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusCryptoKeys * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusCryptoKeys * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusCryptoKeys * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusCryptoKeys * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusCryptoKeys * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusCryptoKeys * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusCryptoKeys * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusCryptoKeys * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrCyrptoKey); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddItem )( __RPC__in ISClusCryptoKeys * This, /* [in] */ __RPC__in BSTR bstrCryptoKey); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveItem )( __RPC__in ISClusCryptoKeys * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusCryptoKeysVtbl; interface ISClusCryptoKeys { CONST_VTBL struct ISClusCryptoKeysVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusCryptoKeys_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusCryptoKeys_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusCryptoKeys_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusCryptoKeys_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusCryptoKeys_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusCryptoKeys_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusCryptoKeys_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusCryptoKeys_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusCryptoKeys_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusCryptoKeys_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusCryptoKeys_get_Item(This,varIndex,pbstrCyrptoKey) \ ( (This)->lpVtbl -> get_Item(This,varIndex,pbstrCyrptoKey) ) #define ISClusCryptoKeys_AddItem(This,bstrCryptoKey) \ ( (This)->lpVtbl -> AddItem(This,bstrCryptoKey) ) #define ISClusCryptoKeys_RemoveItem(This,varIndex) \ ( (This)->lpVtbl -> RemoveItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusCryptoKeys_INTERFACE_DEFINED__ */ #ifndef __ISClusResDependents_INTERFACE_DEFINED__ #define __ISClusResDependents_INTERFACE_DEFINED__ /* interface ISClusResDependents */ /* [unique][helpstring][dual][uuid][object][nonextensible][hidden][oleautomation] */ EXTERN_C const IID IID_ISClusResDependents; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2e6072e-2631-11d1-89f1-00a0c90d061e") ISClusResDependents : public IDispatch { public: virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Count( /* [retval][out] */ __RPC__out long *plCount) = 0; virtual /* [helpstring][id][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__NewEnum( /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Refresh( void) = 0; virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Item( /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateItem( /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrResourceType, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DeleteItem( /* [in] */ VARIANT varIndex) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddItem( /* [in] */ __RPC__in_opt ISClusResource *pResource) = 0; virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RemoveItem( /* [in] */ VARIANT varIndex) = 0; }; #else /* C style interface */ typedef struct ISClusResDependentsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in ISClusResDependents * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in ISClusResDependents * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in ISClusResDependents * This); HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( __RPC__in ISClusResDependents * This, /* [out] */ __RPC__out UINT *pctinfo); HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( __RPC__in ISClusResDependents * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( __RPC__in ISClusResDependents * This, /* [in] */ __RPC__in REFIID riid, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ISClusResDependents * This, /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, /* [annotation][in] */ _In_ WORD wFlags, /* [annotation][out][in] */ _In_ DISPPARAMS *pDispParams, /* [annotation][out] */ _Out_opt_ VARIANT *pVarResult, /* [annotation][out] */ _Out_opt_ EXCEPINFO *pExcepInfo, /* [annotation][out] */ _Out_opt_ UINT *puArgErr); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( __RPC__in ISClusResDependents * This, /* [retval][out] */ __RPC__out long *plCount); /* [helpstring][id][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__NewEnum )( __RPC__in ISClusResDependents * This, /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Refresh )( __RPC__in ISClusResDependents * This); /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( __RPC__in ISClusResDependents * This, /* [in] */ VARIANT varIndex, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateItem )( __RPC__in ISClusResDependents * This, /* [in] */ __RPC__in BSTR bstrResourceName, /* [in] */ __RPC__in BSTR bstrResourceType, /* [in] */ CLUSTER_RESOURCE_CREATE_FLAGS dwFlags, /* [retval][out] */ __RPC__deref_out_opt ISClusResource **ppClusterResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( __RPC__in ISClusResDependents * This, /* [in] */ VARIANT varIndex); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddItem )( __RPC__in ISClusResDependents * This, /* [in] */ __RPC__in_opt ISClusResource *pResource); /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RemoveItem )( __RPC__in ISClusResDependents * This, /* [in] */ VARIANT varIndex); END_INTERFACE } ISClusResDependentsVtbl; interface ISClusResDependents { CONST_VTBL struct ISClusResDependentsVtbl *lpVtbl; }; #ifdef COBJMACROS #define ISClusResDependents_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define ISClusResDependents_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define ISClusResDependents_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define ISClusResDependents_GetTypeInfoCount(This,pctinfo) \ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define ISClusResDependents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define ISClusResDependents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define ISClusResDependents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define ISClusResDependents_get_Count(This,plCount) \ ( (This)->lpVtbl -> get_Count(This,plCount) ) #define ISClusResDependents_get__NewEnum(This,retval) \ ( (This)->lpVtbl -> get__NewEnum(This,retval) ) #define ISClusResDependents_Refresh(This) \ ( (This)->lpVtbl -> Refresh(This) ) #define ISClusResDependents_get_Item(This,varIndex,ppClusResource) \ ( (This)->lpVtbl -> get_Item(This,varIndex,ppClusResource) ) #define ISClusResDependents_CreateItem(This,bstrResourceName,bstrResourceType,dwFlags,ppClusterResource) \ ( (This)->lpVtbl -> CreateItem(This,bstrResourceName,bstrResourceType,dwFlags,ppClusterResource) ) #define ISClusResDependents_DeleteItem(This,varIndex) \ ( (This)->lpVtbl -> DeleteItem(This,varIndex) ) #define ISClusResDependents_AddItem(This,pResource) \ ( (This)->lpVtbl -> AddItem(This,pResource) ) #define ISClusResDependents_RemoveItem(This,varIndex) \ ( (This)->lpVtbl -> RemoveItem(This,varIndex) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __ISClusResDependents_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_msclus_0000_0041 */ /* [local] */ #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ #pragma endregion extern RPC_IF_HANDLE __MIDL_itf_msclus_0000_0041_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_msclus_0000_0041_v0_0_s_ifspec; /* Additional Prototypes for ALL interfaces */ unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); unsigned long __RPC_USER VARIANT_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in VARIANT * ); unsigned char * __RPC_USER VARIANT_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); unsigned char * __RPC_USER VARIANT_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); void __RPC_USER VARIANT_UserFree( __RPC__in unsigned long *, __RPC__in VARIANT * ); unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); unsigned long __RPC_USER VARIANT_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in VARIANT * ); unsigned char * __RPC_USER VARIANT_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); unsigned char * __RPC_USER VARIANT_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); void __RPC_USER VARIANT_UserFree64( __RPC__in unsigned long *, __RPC__in VARIANT * ); /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif
40.534499
1,240
0.647565
[ "object" ]
9634e21138282f7dede572977518da20e6852514
972
h
C
chrome/browser/ui/webauthn/transport_utils.h
iridium-browser/iridium-browser
907e31cf5ce5ad14d832796e3a7c11e496828959
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
575
2015-06-18T23:58:20.000Z
2022-03-23T09:32:39.000Z
chrome/browser/ui/webauthn/transport_utils.h
iridium-browser/iridium-browser
907e31cf5ce5ad14d832796e3a7c11e496828959
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
113
2015-05-04T09:58:14.000Z
2022-01-31T19:35:03.000Z
chrome/browser/ui/webauthn/transport_utils.h
iridium-browser/iridium-browser
907e31cf5ce5ad14d832796e3a7c11e496828959
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
52
2015-07-14T10:40:50.000Z
2022-03-15T01:11:49.000Z
// 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 CHROME_BROWSER_UI_WEBAUTHN_TRANSPORT_UTILS_H_ #define CHROME_BROWSER_UI_WEBAUTHN_TRANSPORT_UTILS_H_ #include <string> #include "chrome/browser/webauthn/authenticator_transport.h" namespace gfx { struct VectorIcon; } enum class TransportSelectionContext { kTransportSelectionSheet, kOtherTransportsMenu, }; // Returns the human readable name shown for |transport| in the given |context|. std::u16string GetTransportHumanReadableName(AuthenticatorTransport transport, TransportSelectionContext context); // Returns the vector icon to show next to the |transport| in the manual // transport selection list. const gfx::VectorIcon* GetTransportVectorIcon(AuthenticatorTransport transport); #endif // CHROME_BROWSER_UI_WEBAUTHN_TRANSPORT_UTILS_H_
32.4
80
0.782922
[ "vector" ]
96368cb26a977b21ad7ad9c87a0ca67a659db335
19,472
h
C
components/SE050/COMPONENT_SE050/sss/inc/fsl_sss_sscp.h
scpf19/mbed-os
041765eaa846f984870301e5f20871f503f6d521
[ "Apache-2.0" ]
1
2020-08-23T20:24:19.000Z
2020-08-23T20:24:19.000Z
sdk_k64f/middleware/se_hostlib/sss/inc/fsl_sss_sscp.h
Sir-Branch/xxxx-starter-template
f8959fd185f090363d180d69f84c2727e37cbeeb
[ "MIT" ]
1
2020-08-24T00:41:48.000Z
2020-08-24T02:17:44.000Z
sdk_k64f/middleware/se_hostlib/sss/inc/fsl_sss_sscp.h
Sir-Branch/xxxx-starter-template
f8959fd185f090363d180d69f84c2727e37cbeeb
[ "MIT" ]
null
null
null
/* * Copyright 2018,2019 NXP * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _FSL_SSS_SSCP_H_ #define _FSL_SSS_SSCP_H_ #include "fsl_sscp.h" #include "fsl_sss_api.h" #if defined(SSS_USE_FTR_FILE) #include "fsl_sss_ftr.h" #else #include "fsl_sss_ftr_default.h" #endif #if !defined(SSS_SSCP_CONFIG_FILE) #include "fsl_sss_sscp_config.h" #else #include SSS_SSCP_CONFIG_FILE #endif #define SSS_SUBSYSTEM_TYPE_IS_SSCP(subsystem) \ ((subsystem == kType_SSS_SE_A71CH) || (subsystem == kType_SSS_SE_A71CL)) #define SSS_SESSION_TYPE_IS_SSCP(session) \ (session && SSS_SUBSYSTEM_TYPE_IS_SSCP(session->subsystem)) #define SSS_KEY_STORE_TYPE_IS_SSCP(keyStore) \ (keyStore && SSS_SESSION_TYPE_IS_SSCP(keyStore->session)) #define SSS_OBJECT_TYPE_IS_SSCP(pObject) \ (pObject && SSS_KEY_STORE_TYPE_IS_SSCP(pObject->keyStore)) #define SSS_DERIVE_KEY_TYPE_IS_SSCP(context) \ (context && SSS_SESSION_TYPE_IS_SSCP(context->session)) #define SSS_ASYMMETRIC_TYPE_IS_SSCP(context) \ (context && SSS_SESSION_TYPE_IS_SSCP(context->session)) #define SSS_SYMMETRIC_TYPE_IS_SSCP(context) \ (context && SSS_SESSION_TYPE_IS_SSCP(context->session)) #define SSS_MAC_TYPE_IS_SSCP(context) \ (context && SSS_SESSION_TYPE_IS_SSCP(context->session)) #define SSS_RNG_CONTEXT_TYPE_IS_SSCP(context) \ (context && SSS_SESSION_TYPE_IS_SSCP(context->session)) #define SSS_DIGEST_TYPE_IS_SSCP(context) \ (context && SSS_SESSION_TYPE_IS_SSCP(context->session)) #define SSS_AEAD_TYPE_IS_SSCP(context) \ (context && SSS_SESSION_TYPE_IS_SSCP(context->session)) typedef void (*fn_sscp_close_t)(void); typedef struct _sss_sscp_session { /*! Indicates which security subsystem is selected to be used. */ sss_type_t subsystem; /*! Implementation specific part * This will be NULL unitl and unless we are not ready to use the sscp_context. */ sscp_context_t *sscp_context; /** * Allocated structure, not to be used directly... * Use only sscp_context */ sscp_context_t mem_sscp_ctx; /** session identifier */ uint32_t sessionId; /** Function pointer that can be used to close the last active session. */ fn_sscp_close_t fp_closeConnection; } sss_sscp_session_t; typedef struct _sss_sscp_key_store { /*! Virtual connection between application (user context) and specific * security subsystem and function thereof. */ sss_sscp_session_t *session; /*! Implementation specific part */ uint32_t keyStoreId; } sss_sscp_key_store_t; typedef struct _sss_sscp_object { /*! key store holding the data and other properties */ sss_sscp_key_store_t *keyStore; uint32_t objectType; /*!< Object types */ uint32_t cipherType; /*!< Cipher types */ /*! Application specific key identifier. The keyId is kept in the key store along with the key data and other * properties. */ uint32_t keyId; void *transientObject; size_t transientObjectLen; size_t transientObjectBitLen; } sss_sscp_object_t; /*! @brief ::sss_symmetric_t with SSCP specific information */ typedef struct _sss_sscp_symmetric { /*! Virtual connection between application (user context) and specific security subsystem and function thereof. */ sss_sscp_session_t *session; sss_sscp_object_t *keyObject; /*!< Reference to key and it's properties. */ sss_algorithm_t algorithm; /*!< What eventual operation algorithm be performed */ sss_mode_t mode; /*!< High level operation, encrypt/decrypt/etc. */ uint32_t sessionId; /*!< Session identifier in case of parallel contexts */ /*! Implementation specific part */ struct { uint8_t data[SSS_SSCP_SYMMETRIC_CONTEXT_SIZE]; } context; } sss_sscp_symmetric_t; typedef struct _sss_sscp_aead { /*! Virtual connection between application (user context) and specific * security subsystem and function thereof. */ sss_sscp_session_t *session; sss_sscp_object_t *keyObject; /*!< Reference to key and it's properties. */ sss_algorithm_t algorithm; /*!< */ sss_mode_t mode; /*!< */ /*! Implementation specific part */ } sss_sscp_aead_t; typedef struct _sss_sscp_digest { /*! Virtual connection between application (user context) and specific security subsystem and function thereof. */ sss_sscp_session_t *session; sss_algorithm_t algorithm; /*!< */ sss_mode_t mode; /*!< */ /*! Full digest length per algorithm definition. This field is initialized along with algorithm. */ size_t digestFullLen; /*! Implementation specific part */ struct { uint8_t data[SSS_SSCP_DIGEST_CONTEXT_SIZE]; } context; } sss_sscp_digest_t; typedef struct _sss_sscp_mac { /*! Virtual connection between application (user context) and specific * security subsystem and function thereof. */ sss_sscp_session_t *session; sss_sscp_object_t *keyObject; /*!< Reference to key and it's properties. */ sss_algorithm_t algorithm; /*!< */ sss_mode_t mode; /*!< */ /*! Implementation specific part */ uint32_t macFullLen; struct { uint8_t data[SSS_SSCP_MAC_CONTEXT_SIZE]; } context; } sss_sscp_mac_t; typedef struct _sss_sscp_asymmetric { sss_sscp_session_t *session; sss_sscp_object_t *keyObject; sss_algorithm_t algorithm; /*!< */ sss_mode_t mode; /*!< */ size_t signatureFullLen; uint32_t sessionId; /*!< */ /*! Implementation specific part */ } sss_sscp_asymmetric_t; typedef struct _sss_sscp_tunnel { sss_sscp_session_t *session; uint32_t tunnelType; uint32_t sessionId; /*!< */ /*! Implementation specific part */ } sss_sscp_tunnel_t; typedef struct _sss_sscp_derive_key { sss_sscp_session_t *session; sss_sscp_object_t *keyObject; sss_algorithm_t algorithm; /*!< */ sss_mode_t mode; /*!< */ uint32_t sessionId; /*!< */ /*! Implementation specific part */ } sss_sscp_derive_key_t; typedef struct { /** Context holder of session */ sss_sscp_session_t *session; } sss_sscp_rng_context_t; /******************************************************************************* * API ******************************************************************************/ #if defined(__cplusplus) extern "C" { #endif /* ************************************************************************** */ /* Functions */ /* ************************************************************************** */ /** * @addtogroup sss_sscp_session * @{ */ /** @copydoc sss_session_open * */ sss_status_t sss_sscp_session_open(sss_sscp_session_t *session, sss_type_t subsystem, uint32_t application_id, sss_connection_type_t connetion_type, void *connectionData); /** @copydoc sss_session_prop_get_u32 * */ sss_status_t sss_sscp_session_prop_get_u32( sss_sscp_session_t *session, uint32_t property, uint32_t *pValue); /** @copydoc sss_session_prop_get_au8 * */ sss_status_t sss_sscp_session_prop_get_au8(sss_sscp_session_t *session, uint32_t property, uint8_t *pValue, size_t *pValueLen); /** @copydoc sss_session_close * */ void sss_sscp_session_close(sss_sscp_session_t *session); /*! @} */ /* end of : sss_sscp_session */ /** * @addtogroup sss_sscp_keyobj * @{ */ /** @copydoc sss_key_object_init * */ sss_status_t sss_sscp_key_object_init( sss_sscp_object_t *keyObject, sss_sscp_key_store_t *keyStore); /** @copydoc sss_key_object_allocate_handle * */ sss_status_t sss_sscp_key_object_allocate_handle(sss_sscp_object_t *keyObject, uint32_t keyId, sss_key_part_t keyPart, sss_cipher_type_t cipherType, size_t keyByteLenMax, uint32_t options); /** @copydoc sss_key_object_get_handle * */ sss_status_t sss_sscp_key_object_get_handle( sss_sscp_object_t *keyObject, uint32_t keyId); /** @copydoc sss_key_object_set_user * */ sss_status_t sss_sscp_key_object_set_user( sss_sscp_object_t *keyObject, uint32_t user, uint32_t options); /** @copydoc sss_key_object_set_purpose * */ sss_status_t sss_sscp_key_object_set_purpose( sss_sscp_object_t *keyObject, sss_mode_t purpose, uint32_t options); /** @copydoc sss_key_object_set_access * */ sss_status_t sss_sscp_key_object_set_access( sss_sscp_object_t *keyObject, uint32_t access, uint32_t options); /** @copydoc sss_key_object_set_eccgfp_group * */ sss_status_t sss_sscp_key_object_set_eccgfp_group( sss_sscp_object_t *keyObject, sss_eccgfp_group_t *group); /** @copydoc sss_key_object_get_user * */ sss_status_t sss_sscp_key_object_get_user( sss_sscp_object_t *keyObject, uint32_t *user); /** @copydoc sss_key_object_get_purpose * */ sss_status_t sss_sscp_key_object_get_purpose( sss_sscp_object_t *keyObject, sss_mode_t *purpose); /** @copydoc sss_key_object_get_access * */ sss_status_t sss_sscp_key_object_get_access( sss_sscp_object_t *keyObject, uint32_t *access); /** @copydoc sss_key_object_free * */ void sss_sscp_key_object_free(sss_sscp_object_t *keyObject); /*! @} */ /* end of : sss_sscp_keyobj */ /** * @addtogroup sss_sscp_keyderive * @{ */ /** @copydoc sss_derive_key_context_init * */ sss_status_t sss_sscp_derive_key_context_init(sss_sscp_derive_key_t *context, sss_sscp_session_t *session, sss_sscp_object_t *keyObject, sss_algorithm_t algorithm, sss_mode_t mode); /** @copydoc sss_derive_key_go * */ sss_status_t sss_sscp_derive_key_go(sss_sscp_derive_key_t *context, const uint8_t *saltData, size_t saltLen, const uint8_t *info, size_t infoLen, sss_sscp_object_t *derivedKeyObject, uint16_t deriveDataLen, uint8_t *hkdfOutput, size_t *hkdfOutputLen); /** @copydoc sss_derive_key_dh * */ sss_status_t sss_sscp_derive_key_dh(sss_sscp_derive_key_t *context, sss_sscp_object_t *otherPartyKeyObject, sss_sscp_object_t *derivedKeyObject); /** @copydoc sss_derive_key_context_free * */ void sss_sscp_derive_key_context_free(sss_sscp_derive_key_t *context); /*! @} */ /* end of : sss_sscp_keyderive */ /** * @addtogroup sss_sscp_keystore * @{ */ /** @copydoc sss_key_store_context_init * */ sss_status_t sss_sscp_key_store_context_init( sss_sscp_key_store_t *keyStore, sss_sscp_session_t *session); /** @copydoc sss_key_store_allocate * */ sss_status_t sss_sscp_key_store_allocate( sss_sscp_key_store_t *keyStore, uint32_t keyStoreId); /** @copydoc sss_key_store_save * */ sss_status_t sss_sscp_key_store_save(sss_sscp_key_store_t *keyStore); /** @copydoc sss_key_store_load * */ sss_status_t sss_sscp_key_store_load(sss_sscp_key_store_t *keyStore); /** @copydoc sss_key_store_set_key * */ sss_status_t sss_sscp_key_store_set_key(sss_sscp_key_store_t *keyStore, sss_sscp_object_t *keyObject, const uint8_t *data, size_t dataLen, size_t keyBitLen, void *options, size_t optionsLen); /** @copydoc sss_key_store_generate_key * */ sss_status_t sss_sscp_key_store_generate_key(sss_sscp_key_store_t *keyStore, sss_sscp_object_t *keyObject, size_t keyBitLen, void *options); /** @copydoc sss_key_store_get_key * */ sss_status_t sss_sscp_key_store_get_key(sss_sscp_key_store_t *keyStore, sss_sscp_object_t *keyObject, uint8_t *data, size_t *dataLen, size_t *pKeyBitLen); #if 0 /* To be reviewed: Purnank */ /** @copydoc sss_sscp_key_store_get_key_fromoffset * */ sss_status_t sss_sscp_key_store_get_key_fromoffset(sss_sscp_key_store_t *keyStore, sss_sscp_object_t *keyObject, uint8_t *data, size_t *dataLen, size_t *pKeyBitLen, uint16_t offset); #endif /** @copydoc sss_key_store_open_key * */ sss_status_t sss_sscp_key_store_open_key( sss_sscp_key_store_t *keyStore, sss_sscp_object_t *keyObject); /** @copydoc sss_key_store_freeze_key * */ sss_status_t sss_sscp_key_store_freeze_key( sss_sscp_key_store_t *keyStore, sss_sscp_object_t *keyObject); /** @copydoc sss_key_store_erase_key * */ sss_status_t sss_sscp_key_store_erase_key( sss_sscp_key_store_t *keyStore, sss_sscp_object_t *keyObject); /** @copydoc sss_key_store_prop_get_u32 * */ sss_status_t sss_sscp_key_store_prop_get_u32( sss_sscp_key_store_t *session, uint32_t property, uint32_t *pValue); /** @copydoc sss_key_store_prop_get_au8 * */ sss_status_t sss_sscp_key_store_prop_get_au8(sss_sscp_key_store_t *session, uint32_t property, uint8_t *pValue, size_t *pValueLen); /** @copydoc sss_key_store_context_free * */ void sss_sscp_key_store_context_free(sss_sscp_key_store_t *keyStore); /*! @} */ /* end of : sss_sscp_keystore */ /** * @addtogroup sss_sscp_asym * @{ */ /** @copydoc sss_asymmetric_context_init * */ sss_status_t sss_sscp_asymmetric_context_init(sss_sscp_asymmetric_t *context, sss_sscp_session_t *session, sss_sscp_object_t *keyObject, sss_algorithm_t algorithm, sss_mode_t mode); /** @copydoc sss_asymmetric_encrypt * */ sss_status_t sss_sscp_asymmetric_encrypt(sss_sscp_asymmetric_t *context, const uint8_t *srcData, size_t srcLen, uint8_t *destData, size_t *destLen); /** @copydoc sss_asymmetric_decrypt * */ sss_status_t sss_sscp_asymmetric_decrypt(sss_sscp_asymmetric_t *context, const uint8_t *srcData, size_t srcLen, uint8_t *destData, size_t *destLen); /** @copydoc sss_asymmetric_sign_digest * */ sss_status_t sss_sscp_asymmetric_sign_digest(sss_sscp_asymmetric_t *context, uint8_t *digest, size_t digestLen, uint8_t *signature, size_t *signatureLen); /** @copydoc sss_asymmetric_verify_digest * */ sss_status_t sss_sscp_asymmetric_verify_digest(sss_sscp_asymmetric_t *context, uint8_t *digest, size_t digestLen, uint8_t *signature, size_t signatureLen); /** @copydoc sss_asymmetric_context_free * */ void sss_sscp_asymmetric_context_free(sss_sscp_asymmetric_t *context); /*! @} */ /* end of : sss_sscp_asym */ /** * @addtogroup sss_sscp_symm * @{ */ /** @copydoc sss_symmetric_context_init * */ sss_status_t sss_sscp_symmetric_context_init(sss_sscp_symmetric_t *context, sss_sscp_session_t *session, sss_sscp_object_t *keyObject, sss_algorithm_t algorithm, sss_mode_t mode); /** @copydoc sss_cipher_one_go * */ sss_status_t sss_sscp_cipher_one_go(sss_sscp_symmetric_t *context, uint8_t *iv, size_t ivLen, const uint8_t *srcData, uint8_t *destData, size_t dataLen); /** @copydoc sss_cipher_init * */ sss_status_t sss_sscp_cipher_init( sss_sscp_symmetric_t *context, uint8_t *iv, size_t ivLen); /** @copydoc sss_cipher_update * */ sss_status_t sss_sscp_cipher_update(sss_sscp_symmetric_t *context, const uint8_t *srcData, size_t srcLen, uint8_t *destData, size_t *destLen); /** @copydoc sss_cipher_finish * */ sss_status_t sss_sscp_cipher_finish(sss_sscp_symmetric_t *context, const uint8_t *srcData, size_t srcLen, uint8_t *destData, size_t *destLen); /** @copydoc sss_cipher_crypt_ctr * */ sss_status_t sss_sscp_cipher_crypt_ctr(sss_sscp_symmetric_t *context, const uint8_t *srcData, uint8_t *destData, size_t size, uint8_t *initialCounter, uint8_t *lastEncryptedCounter, size_t *szLeft); /** @copydoc sss_symmetric_context_free * */ void sss_sscp_symmetric_context_free(sss_sscp_symmetric_t *context); /*! @} */ /* end of : sss_sscp_symm */ /** * @addtogroup sss_sscp_aead * @{ */ /** @copydoc sss_aead_context_init * */ sss_status_t sss_sscp_aead_context_init(sss_sscp_aead_t *context, sss_sscp_session_t *session, sss_sscp_object_t *keyObject, sss_algorithm_t algorithm, sss_mode_t mode); /** @copydoc sss_aead_one_go * */ sss_status_t sss_sscp_aead_one_go(sss_sscp_aead_t *context, const uint8_t *srcData, uint8_t *destData, size_t size, uint8_t *nonce, size_t nonceLen, const uint8_t *aad, size_t aadLen, uint8_t *tag, size_t *tagLen); /** @copydoc sss_aead_init * */ sss_status_t sss_sscp_aead_init(sss_sscp_aead_t *context, uint8_t *nonce, size_t nonceLen, size_t tagLen, size_t aadLen, size_t payloadLen); /** @copydoc sss_aead_update_aad * */ sss_status_t sss_sscp_aead_update_aad( sss_sscp_aead_t *context, const uint8_t *aadData, size_t aadDataLen); /** @copydoc sss_aead_update * */ sss_status_t sss_sscp_aead_update(sss_sscp_aead_t *context, const uint8_t *srcData, size_t srcLen, uint8_t destData, size_t *destLen); /** @copydoc sss_aead_finish * */ sss_status_t sss_sscp_aead_finish(sss_sscp_aead_t *context, const uint8_t *srcData, size_t srcLen, uint8_t destData, size_t *destLen, uint8_t *tag, size_t *tagLen); /** @copydoc sss_aead_context_free * */ void sss_sscp_aead_context_free(sss_sscp_aead_t *context); /*! @} */ /* end of : sss_sscp_aead */ /** * @addtogroup sss_sscp_mac * @{ */ /** @copydoc sss_mac_context_init * */ sss_status_t sss_sscp_mac_context_init(sss_sscp_mac_t *context, sss_sscp_session_t *session, sss_sscp_object_t *keyObject, sss_algorithm_t algorithm, sss_mode_t mode); /** @copydoc sss_mac_one_go * */ sss_status_t sss_sscp_mac_one_go(sss_sscp_mac_t *context, const uint8_t *message, size_t messageLen, uint8_t *mac, size_t *macLen); /** @copydoc sss_mac_init * */ sss_status_t sss_sscp_mac_init(sss_sscp_mac_t *context); /** @copydoc sss_mac_update * */ sss_status_t sss_sscp_mac_update( sss_sscp_mac_t *context, const uint8_t *message, size_t messageLen); /** @copydoc sss_mac_finish * */ sss_status_t sss_sscp_mac_finish( sss_sscp_mac_t *context, uint8_t *mac, size_t *macLen); /** @copydoc sss_mac_context_free * */ void sss_sscp_mac_context_free(sss_sscp_mac_t *context); /*! @} */ /* end of : sss_sscp_mac */ /** * @addtogroup sss_sscp_md * @{ */ /** @copydoc sss_digest_context_init * */ sss_status_t sss_sscp_digest_context_init(sss_sscp_digest_t *context, sss_sscp_session_t *session, sss_algorithm_t algorithm, sss_mode_t mode); /** @copydoc sss_digest_one_go * */ sss_status_t sss_sscp_digest_one_go(sss_sscp_digest_t *context, const uint8_t *message, size_t messageLen, uint8_t *digest, size_t *digestLen); /** @copydoc sss_digest_init * */ sss_status_t sss_sscp_digest_init(sss_sscp_digest_t *context); /** @copydoc sss_digest_update * */ sss_status_t sss_sscp_digest_update( sss_sscp_digest_t *context, const uint8_t *message, size_t messageLen); /** @copydoc sss_digest_finish * */ sss_status_t sss_sscp_digest_finish( sss_sscp_digest_t *context, uint8_t *digest, size_t *digestLen); /** @copydoc sss_digest_context_free * */ void sss_sscp_digest_context_free(sss_sscp_digest_t *context); /*! @} */ /* end of : sss_sscp_md */ /** * @addtogroup sss_sscp_rng * @{ */ /** @copydoc sss_rng_context_init * */ sss_status_t sss_sscp_rng_context_init( sss_sscp_rng_context_t *context, sss_sscp_session_t *session); /** @copydoc sss_rng_get_random * */ sss_status_t sss_sscp_rng_get_random( sss_sscp_rng_context_t *context, uint8_t *random_data, size_t dataLen); /** @copydoc sss_rng_context_free * */ sss_status_t sss_sscp_rng_context_free(sss_sscp_rng_context_t *context); /*! @} */ /* end of : sss_sscp_rng */ #if defined(__cplusplus) } #endif #endif /* _FSL_SSS_SSCP_H_ */
25.060489
118
0.721549
[ "object" ]
9637155343b4ac349870335127bf7959ca380ab3
5,658
h
C
core/fpdfapi/page/pageint.h
imxiangpeng/pdfium
1a89e3691b320b2e577dad8e4617be6356545396
[ "BSD-3-Clause" ]
2
2019-01-12T07:06:12.000Z
2021-01-23T00:47:10.000Z
core/fpdfapi/page/pageint.h
imxiangpeng/pdfium
1a89e3691b320b2e577dad8e4617be6356545396
[ "BSD-3-Clause" ]
null
null
null
core/fpdfapi/page/pageint.h
imxiangpeng/pdfium
1a89e3691b320b2e577dad8e4617be6356545396
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef CORE_FPDFAPI_PAGE_PAGEINT_H_ #define CORE_FPDFAPI_PAGE_PAGEINT_H_ #include <memory> #include <vector> #include "core/fpdfapi/page/cpdf_colorspace.h" #include "core/fpdfapi/page/cpdf_countedobject.h" class CPDF_ExpIntFunc; class CPDF_Pattern; class CPDF_SampledFunc; class CPDF_StitchFunc; class CPDF_StreamAcc; class CPDF_Function { public: enum class Type { kTypeInvalid = -1, kType0Sampled = 0, kType2ExpotentialInterpolation = 2, kType3Stitching = 3, kType4PostScript = 4, }; static std::unique_ptr<CPDF_Function> Load(CPDF_Object* pFuncObj); static Type IntegerToFunctionType(int iType); virtual ~CPDF_Function(); bool Call(float* inputs, uint32_t ninputs, float* results, int* nresults) const; uint32_t CountInputs() const { return m_nInputs; } uint32_t CountOutputs() const { return m_nOutputs; } float GetDomain(int i) const { return m_pDomains[i]; } float GetRange(int i) const { return m_pRanges[i]; } const CPDF_SampledFunc* ToSampledFunc() const; const CPDF_ExpIntFunc* ToExpIntFunc() const; const CPDF_StitchFunc* ToStitchFunc() const; protected: explicit CPDF_Function(Type type); bool Init(CPDF_Object* pObj); virtual bool v_Init(CPDF_Object* pObj) = 0; virtual bool v_Call(float* inputs, float* results) const = 0; uint32_t m_nInputs; uint32_t m_nOutputs; float* m_pDomains; float* m_pRanges; const Type m_Type; }; class CPDF_ExpIntFunc : public CPDF_Function { public: CPDF_ExpIntFunc(); ~CPDF_ExpIntFunc() override; // CPDF_Function bool v_Init(CPDF_Object* pObj) override; bool v_Call(float* inputs, float* results) const override; uint32_t m_nOrigOutputs; float m_Exponent; float* m_pBeginValues; float* m_pEndValues; }; class CPDF_SampledFunc : public CPDF_Function { public: struct SampleEncodeInfo { float encode_max; float encode_min; uint32_t sizes; }; struct SampleDecodeInfo { float decode_max; float decode_min; }; CPDF_SampledFunc(); ~CPDF_SampledFunc() override; // CPDF_Function bool v_Init(CPDF_Object* pObj) override; bool v_Call(float* inputs, float* results) const override; const std::vector<SampleEncodeInfo>& GetEncodeInfo() const { return m_EncodeInfo; } uint32_t GetBitsPerSample() const { return m_nBitsPerSample; } const CPDF_StreamAcc* GetSampleStream() const { return m_pSampleStream.get(); } private: std::vector<SampleEncodeInfo> m_EncodeInfo; std::vector<SampleDecodeInfo> m_DecodeInfo; uint32_t m_nBitsPerSample; uint32_t m_SampleMax; std::unique_ptr<CPDF_StreamAcc> m_pSampleStream; }; class CPDF_StitchFunc : public CPDF_Function { public: CPDF_StitchFunc(); ~CPDF_StitchFunc() override; // CPDF_Function bool v_Init(CPDF_Object* pObj) override; bool v_Call(float* inputs, float* results) const override; const std::vector<std::unique_ptr<CPDF_Function>>& GetSubFunctions() const { return m_pSubFunctions; } float GetBound(size_t i) const { return m_pBounds[i]; } private: std::vector<std::unique_ptr<CPDF_Function>> m_pSubFunctions; float* m_pBounds; float* m_pEncode; static const uint32_t kRequiredNumInputs = 1; }; class CPDF_IccProfile { public: CPDF_IccProfile(const uint8_t* pData, uint32_t dwSize); ~CPDF_IccProfile(); bool IsValid() const { return IsSRGB() || IsSupported(); } bool IsSRGB() const { return m_bsRGB; } bool IsSupported() const { return !!m_pTransform; } void* transform() { return m_pTransform; } uint32_t GetComponents() const { return m_nSrcComponents; } private: const bool m_bsRGB; void* m_pTransform = nullptr; uint32_t m_nSrcComponents = 0; }; class CPDF_DeviceCS : public CPDF_ColorSpace { public: CPDF_DeviceCS(CPDF_Document* pDoc, int family); ~CPDF_DeviceCS() override; // CPDF_ColorSpace: bool GetRGB(float* pBuf, float* R, float* G, float* B) const override; bool SetRGB(float* pBuf, float R, float G, float B) const override; bool v_GetCMYK(float* pBuf, float* c, float* m, float* y, float* k) const override; bool v_SetCMYK(float* pBuf, float c, float m, float y, float k) const override; void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, bool bTransMask) const override; }; class CPDF_PatternCS : public CPDF_ColorSpace { public: explicit CPDF_PatternCS(CPDF_Document* pDoc); ~CPDF_PatternCS() override; // CPDF_ColorSpace: bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override; bool GetRGB(float* pBuf, float* R, float* G, float* B) const override; CPDF_ColorSpace* GetBaseCS() const override; private: CPDF_ColorSpace* m_pBaseCS; CPDF_CountedColorSpace* m_pCountedBaseCS; }; #define MAX_PATTERN_COLORCOMPS 16 struct PatternValue { CPDF_Pattern* m_pPattern; CPDF_CountedPattern* m_pCountedPattern; int m_nComps; float m_Comps[MAX_PATTERN_COLORCOMPS]; }; CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr); CFX_ByteStringC PDF_FindValueAbbreviationForTesting( const CFX_ByteStringC& abbr); #endif // CORE_FPDFAPI_PAGE_PAGEINT_H_
27.201923
80
0.709968
[ "vector", "transform" ]
963fdbd14200cf4713e787b42e5555e3e2128035
84,187
h
C
10.0.16299.0/winrt/impl/Windows.Graphics.Printing3D.0.h
Scottj1s/cppwinrt
6b7266d14678141b4f42395e8d6e81aab0395808
[ "MIT" ]
null
null
null
10.0.16299.0/winrt/impl/Windows.Graphics.Printing3D.0.h
Scottj1s/cppwinrt
6b7266d14678141b4f42395e8d6e81aab0395808
[ "MIT" ]
null
null
null
10.0.16299.0/winrt/impl/Windows.Graphics.Printing3D.0.h
Scottj1s/cppwinrt
6b7266d14678141b4f42395e8d6e81aab0395808
[ "MIT" ]
1
2019-11-22T07:17:34.000Z
2019-11-22T07:17:34.000Z
// C++/WinRT v1.0.171013.2 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once WINRT_EXPORT namespace winrt::Windows::Foundation::Collections { struct IPropertySet; } WINRT_EXPORT namespace winrt::Windows::Storage::Streams { struct IBuffer; struct IRandomAccessStream; struct IRandomAccessStreamWithContentType; } WINRT_EXPORT namespace winrt::Windows::UI { struct Color; } WINRT_EXPORT namespace winrt::Windows::Graphics::Printing3D { enum class Print3DTaskCompletion : int32_t { Abandoned = 0, Canceled = 1, Failed = 2, Slicing = 3, Submitted = 4, }; enum class Print3DTaskDetail : int32_t { Unknown = 0, ModelExceedsPrintBed = 1, UploadFailed = 2, InvalidMaterialSelection = 3, InvalidModel = 4, ModelNotManifold = 5, InvalidPrintTicket = 6, }; enum class Printing3DBufferFormat : int32_t { Unknown = 0, R32G32B32A32Float = 2, R32G32B32A32UInt = 3, R32G32B32Float = 6, R32G32B32UInt = 7, Printing3DDouble = 500, Printing3DUInt = 501, }; enum class Printing3DMeshVerificationMode : int32_t { FindFirstError = 0, FindAllErrors = 1, }; enum class Printing3DModelUnit : int32_t { Meter = 0, Micron = 1, Millimeter = 2, Centimeter = 3, Inch = 4, Foot = 5, }; enum class Printing3DObjectType : int32_t { Model = 0, Support = 1, Others = 2, }; enum class Printing3DPackageCompression : int32_t { Low = 0, Medium = 1, High = 2, }; enum class Printing3DTextureEdgeBehavior : int32_t { None = 0, Wrap = 1, Mirror = 2, Clamp = 3, }; struct IPrint3DManager; struct IPrint3DManagerStatics; struct IPrint3DTask; struct IPrint3DTaskCompletedEventArgs; struct IPrint3DTaskRequest; struct IPrint3DTaskRequestedEventArgs; struct IPrint3DTaskSourceChangedEventArgs; struct IPrint3DTaskSourceRequestedArgs; struct IPrinting3D3MFPackage; struct IPrinting3D3MFPackage2; struct IPrinting3D3MFPackageStatics; struct IPrinting3DBaseMaterial; struct IPrinting3DBaseMaterialGroup; struct IPrinting3DBaseMaterialGroupFactory; struct IPrinting3DBaseMaterialStatics; struct IPrinting3DColorMaterial; struct IPrinting3DColorMaterial2; struct IPrinting3DColorMaterialGroup; struct IPrinting3DColorMaterialGroupFactory; struct IPrinting3DComponent; struct IPrinting3DComponentWithMatrix; struct IPrinting3DCompositeMaterial; struct IPrinting3DCompositeMaterialGroup; struct IPrinting3DCompositeMaterialGroup2; struct IPrinting3DCompositeMaterialGroupFactory; struct IPrinting3DFaceReductionOptions; struct IPrinting3DMaterial; struct IPrinting3DMesh; struct IPrinting3DMeshVerificationResult; struct IPrinting3DModel; struct IPrinting3DModel2; struct IPrinting3DModelTexture; struct IPrinting3DMultiplePropertyMaterial; struct IPrinting3DMultiplePropertyMaterialGroup; struct IPrinting3DMultiplePropertyMaterialGroupFactory; struct IPrinting3DTexture2CoordMaterial; struct IPrinting3DTexture2CoordMaterialGroup; struct IPrinting3DTexture2CoordMaterialGroup2; struct IPrinting3DTexture2CoordMaterialGroupFactory; struct IPrinting3DTextureResource; struct Print3DManager; struct Print3DTask; struct Print3DTaskCompletedEventArgs; struct Print3DTaskRequest; struct Print3DTaskRequestedEventArgs; struct Print3DTaskSourceChangedEventArgs; struct Print3DTaskSourceRequestedArgs; struct Printing3D3MFPackage; struct Printing3DBaseMaterial; struct Printing3DBaseMaterialGroup; struct Printing3DColorMaterial; struct Printing3DColorMaterialGroup; struct Printing3DComponent; struct Printing3DComponentWithMatrix; struct Printing3DCompositeMaterial; struct Printing3DCompositeMaterialGroup; struct Printing3DFaceReductionOptions; struct Printing3DMaterial; struct Printing3DMesh; struct Printing3DMeshVerificationResult; struct Printing3DModel; struct Printing3DModelTexture; struct Printing3DMultiplePropertyMaterial; struct Printing3DMultiplePropertyMaterialGroup; struct Printing3DTexture2CoordMaterial; struct Printing3DTexture2CoordMaterialGroup; struct Printing3DTextureResource; struct Printing3DBufferDescription; struct Print3DTaskSourceRequestedHandler; } namespace winrt::impl { template <> struct category<Windows::Graphics::Printing3D::IPrint3DManager>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrint3DManagerStatics>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrint3DTask>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrint3DTaskCompletedEventArgs>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrint3DTaskRequest>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrint3DTaskRequestedEventArgs>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrint3DTaskSourceChangedEventArgs>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrint3DTaskSourceRequestedArgs>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3D3MFPackage>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3D3MFPackage2>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3D3MFPackageStatics>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DBaseMaterial>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroup>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroupFactory>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialStatics>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DColorMaterial>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DColorMaterial2>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroup>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroupFactory>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DComponent>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DComponentWithMatrix>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterial>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup2>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroupFactory>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DFaceReductionOptions>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DMaterial>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DMesh>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DMeshVerificationResult>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DModel>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DModel2>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DModelTexture>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterial>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroup>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroupFactory>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterial>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup2>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroupFactory>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::IPrinting3DTextureResource>{ using type = interface_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DManager>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTask>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTaskCompletedEventArgs>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTaskRequest>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTaskSourceChangedEventArgs>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTaskSourceRequestedArgs>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3D3MFPackage>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DBaseMaterial>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DBaseMaterialGroup>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DColorMaterial>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DColorMaterialGroup>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DComponent>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DComponentWithMatrix>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DCompositeMaterial>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DCompositeMaterialGroup>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DFaceReductionOptions>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DMaterial>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DMesh>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DMeshVerificationResult>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DModel>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DModelTexture>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterial>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterialGroup>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterial>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterialGroup>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DTextureResource>{ using type = class_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTaskCompletion>{ using type = enum_category; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTaskDetail>{ using type = enum_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DBufferFormat>{ using type = enum_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DMeshVerificationMode>{ using type = enum_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DModelUnit>{ using type = enum_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DObjectType>{ using type = enum_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DPackageCompression>{ using type = enum_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior>{ using type = enum_category; }; template <> struct category<Windows::Graphics::Printing3D::Printing3DBufferDescription>{ using type = struct_category<Windows::Graphics::Printing3D::Printing3DBufferFormat,uint32_t>; }; template <> struct category<Windows::Graphics::Printing3D::Print3DTaskSourceRequestedHandler>{ using type = delegate_category; }; template <> struct name<Windows::Graphics::Printing3D::IPrint3DManager>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrint3DManager" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrint3DManagerStatics>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrint3DManagerStatics" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrint3DTask>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrint3DTask" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrint3DTaskCompletedEventArgs>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrint3DTaskCompletedEventArgs" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrint3DTaskRequest>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrint3DTaskRequest" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrint3DTaskRequestedEventArgs>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrint3DTaskRequestedEventArgs" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrint3DTaskSourceChangedEventArgs>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrint3DTaskSourceChangedEventArgs" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrint3DTaskSourceRequestedArgs>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrint3DTaskSourceRequestedArgs" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3D3MFPackage>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3D3MFPackage" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3D3MFPackage2>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3D3MFPackage2" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3D3MFPackageStatics>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3D3MFPackageStatics" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DBaseMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DBaseMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DBaseMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroupFactory>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DBaseMaterialGroupFactory" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialStatics>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DBaseMaterialStatics" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DColorMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DColorMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DColorMaterial2>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DColorMaterial2" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DColorMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroupFactory>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DColorMaterialGroupFactory" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DComponent>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DComponent" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DComponentWithMatrix>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DComponentWithMatrix" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DCompositeMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DCompositeMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup2>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DCompositeMaterialGroup2" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroupFactory>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DCompositeMaterialGroupFactory" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DFaceReductionOptions>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DFaceReductionOptions" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DMesh>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DMesh" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DMeshVerificationResult>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DMeshVerificationResult" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DModel>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DModel" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DModel2>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DModel2" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DModelTexture>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DModelTexture" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DMultiplePropertyMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DMultiplePropertyMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroupFactory>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DMultiplePropertyMaterialGroupFactory" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DTexture2CoordMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DTexture2CoordMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup2>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DTexture2CoordMaterialGroup2" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroupFactory>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DTexture2CoordMaterialGroupFactory" }; }; template <> struct name<Windows::Graphics::Printing3D::IPrinting3DTextureResource>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.IPrinting3DTextureResource" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DManager>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DManager" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTask>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTask" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTaskCompletedEventArgs>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTaskCompletedEventArgs" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTaskRequest>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTaskRequest" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTaskRequestedEventArgs" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTaskSourceChangedEventArgs>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTaskSourceChangedEventArgs" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTaskSourceRequestedArgs>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTaskSourceRequestedArgs" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3D3MFPackage>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3D3MFPackage" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DBaseMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DBaseMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DBaseMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DBaseMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DColorMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DColorMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DColorMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DColorMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DComponent>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DComponent" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DComponentWithMatrix>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DComponentWithMatrix" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DCompositeMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DCompositeMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DCompositeMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DCompositeMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DFaceReductionOptions>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DFaceReductionOptions" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DMesh>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DMesh" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DMeshVerificationResult>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DMeshVerificationResult" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DModel>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DModel" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DModelTexture>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DModelTexture" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DMultiplePropertyMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DMultiplePropertyMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterial>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DTexture2CoordMaterial" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterialGroup>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DTexture2CoordMaterialGroup" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DTextureResource>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DTextureResource" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTaskCompletion>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTaskCompletion" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTaskDetail>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTaskDetail" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DBufferFormat>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DBufferFormat" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DMeshVerificationMode>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DMeshVerificationMode" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DModelUnit>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DModelUnit" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DObjectType>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DObjectType" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DPackageCompression>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DPackageCompression" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DTextureEdgeBehavior" }; }; template <> struct name<Windows::Graphics::Printing3D::Printing3DBufferDescription>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Printing3DBufferDescription" }; }; template <> struct name<Windows::Graphics::Printing3D::Print3DTaskSourceRequestedHandler>{ static constexpr auto & value{ L"Windows.Graphics.Printing3D.Print3DTaskSourceRequestedHandler" }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrint3DManager>{ static constexpr GUID value{ 0x4D2FCB0A,0x7366,0x4971,{ 0x8B,0xD5,0x17,0xC4,0xE3,0xE8,0xC6,0xC0 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrint3DManagerStatics>{ static constexpr GUID value{ 0x0EF1CAFE,0xA9AD,0x4C08,{ 0xA9,0x17,0x1D,0x1F,0x86,0x3E,0xAB,0xCB } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrint3DTask>{ static constexpr GUID value{ 0x8CE3D080,0x2118,0x4C28,{ 0x80,0xDE,0xF4,0x26,0xD7,0x01,0x91,0xAE } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrint3DTaskCompletedEventArgs>{ static constexpr GUID value{ 0xCC1914AF,0x2614,0x4F1D,{ 0xAC,0xCC,0xD6,0xFC,0x4F,0xDA,0x54,0x55 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrint3DTaskRequest>{ static constexpr GUID value{ 0x2595C46F,0x2245,0x4C5A,{ 0x87,0x31,0x0D,0x60,0x4D,0xC6,0xBC,0x3C } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrint3DTaskRequestedEventArgs>{ static constexpr GUID value{ 0x150CB77F,0x18C5,0x40D7,{ 0x9F,0x40,0xFA,0xB3,0x09,0x6E,0x05,0xA9 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrint3DTaskSourceChangedEventArgs>{ static constexpr GUID value{ 0x5BCD34AF,0x24E9,0x4C10,{ 0x8D,0x07,0x14,0xC3,0x46,0xBA,0x3F,0xCF } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrint3DTaskSourceRequestedArgs>{ static constexpr GUID value{ 0xC77C9ABA,0x24AF,0x424D,{ 0xA3,0xBF,0x92,0x25,0x0C,0x35,0x56,0x02 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3D3MFPackage>{ static constexpr GUID value{ 0xF64DD5C8,0x2AB7,0x45A9,{ 0xA1,0xB7,0x26,0x7E,0x94,0x8D,0x5B,0x18 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3D3MFPackage2>{ static constexpr GUID value{ 0x965C7AC4,0x93CB,0x4430,{ 0x92,0xB8,0x78,0x9C,0xD4,0x54,0xF8,0x83 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3D3MFPackageStatics>{ static constexpr GUID value{ 0x7058D9AF,0x7A9A,0x4787,{ 0xB8,0x17,0xF6,0xF4,0x59,0x21,0x48,0x23 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DBaseMaterial>{ static constexpr GUID value{ 0xD0F0E743,0xC50C,0x4BCB,{ 0x9D,0x04,0xFC,0x16,0xAD,0xCE,0xA2,0xC9 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroup>{ static constexpr GUID value{ 0x94F070B8,0x2515,0x4A8D,{ 0xA1,0xF0,0xD0,0xFC,0x13,0xD0,0x60,0x21 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroupFactory>{ static constexpr GUID value{ 0x5C1546DC,0x8697,0x4193,{ 0x97,0x6B,0x84,0xBB,0x41,0x16,0xE5,0xBF } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialStatics>{ static constexpr GUID value{ 0x815A47BC,0x374A,0x476D,{ 0xBE,0x92,0x3E,0xCF,0xD1,0xCB,0x97,0x76 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DColorMaterial>{ static constexpr GUID value{ 0xE1899928,0x7CE7,0x4285,{ 0xA3,0x5D,0xF1,0x45,0xC9,0x51,0x0C,0x7B } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DColorMaterial2>{ static constexpr GUID value{ 0xFAB0E852,0x0AEF,0x44E9,{ 0x9D,0xDD,0x36,0xEE,0xEA,0x5A,0xCD,0x44 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroup>{ static constexpr GUID value{ 0x001A6BD0,0xAADF,0x4226,{ 0xAF,0xE9,0xF3,0x69,0xA0,0xB4,0x50,0x04 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroupFactory>{ static constexpr GUID value{ 0x71D38D6D,0xB1EA,0x4A5B,{ 0xBC,0x54,0x19,0xC6,0x5F,0x3D,0xF0,0x44 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DComponent>{ static constexpr GUID value{ 0x7E287845,0xBF7F,0x4CDB,{ 0xA2,0x7F,0x30,0xA0,0x14,0x37,0xFE,0xDE } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DComponentWithMatrix>{ static constexpr GUID value{ 0x3279F335,0x0EF0,0x456B,{ 0x9A,0x21,0x49,0xBE,0xBE,0x8B,0x51,0xC2 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterial>{ static constexpr GUID value{ 0x462238DD,0x562E,0x4F6C,{ 0x88,0x2D,0xF4,0xD8,0x41,0xFD,0x63,0xC7 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup>{ static constexpr GUID value{ 0x8D946A5B,0x40F1,0x496D,{ 0xA5,0xFB,0x34,0x0A,0x5A,0x67,0x8E,0x30 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup2>{ static constexpr GUID value{ 0x06E86D62,0x7D3B,0x41E1,{ 0x94,0x4C,0xBA,0xFD,0xE4,0x55,0x54,0x83 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroupFactory>{ static constexpr GUID value{ 0xD08ECD13,0x92FF,0x43AA,{ 0xA6,0x27,0x8D,0x43,0xC2,0x2C,0x81,0x7E } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DFaceReductionOptions>{ static constexpr GUID value{ 0xBBFED397,0x2D74,0x46F7,{ 0xBE,0x85,0x99,0xA6,0x7B,0xBB,0x66,0x29 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DMaterial>{ static constexpr GUID value{ 0x378DB256,0xED62,0x4952,{ 0xB8,0x5B,0x03,0x56,0x7D,0x7C,0x46,0x5E } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DMesh>{ static constexpr GUID value{ 0x192E90DC,0x0228,0x2E01,{ 0xBC,0x20,0xC5,0x29,0x0C,0xBF,0x32,0xC4 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DMeshVerificationResult>{ static constexpr GUID value{ 0x195671BA,0xE93A,0x4E8A,{ 0xA4,0x6F,0xDE,0xA8,0xE8,0x52,0x19,0x7E } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DModel>{ static constexpr GUID value{ 0x2D012EF0,0x52FB,0x919A,{ 0x77,0xB0,0x4B,0x1A,0x3B,0x80,0x32,0x4F } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DModel2>{ static constexpr GUID value{ 0xC92069C7,0xC841,0x47F3,{ 0xA8,0x4E,0xA1,0x49,0xFD,0x08,0xB6,0x57 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DModelTexture>{ static constexpr GUID value{ 0x5DAFCF01,0xB59D,0x483C,{ 0x97,0xBB,0xA4,0xD5,0x46,0xD1,0xC7,0x5C } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterial>{ static constexpr GUID value{ 0x25A6254B,0xC6E9,0x484D,{ 0xA2,0x14,0xA2,0x5E,0x57,0x76,0xBA,0x62 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroup>{ static constexpr GUID value{ 0xF0950519,0xAEB9,0x4515,{ 0xA3,0x9B,0xA0,0x88,0xFB,0xBB,0x27,0x7C } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroupFactory>{ static constexpr GUID value{ 0x323E196E,0xD4C6,0x451E,{ 0xA8,0x14,0x4D,0x78,0xA2,0x10,0xFE,0x53 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterial>{ static constexpr GUID value{ 0x8D844BFB,0x07E9,0x4986,{ 0x98,0x33,0x8D,0xD3,0xD4,0x8C,0x68,0x59 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup>{ static constexpr GUID value{ 0x627D7CA7,0x6D90,0x4FB9,{ 0x9F,0xC4,0x9F,0xEF,0xF3,0xDF,0xA8,0x92 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup2>{ static constexpr GUID value{ 0x69FBDBBA,0xB12E,0x429B,{ 0x83,0x86,0xDF,0x52,0x84,0xF6,0xE8,0x0F } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroupFactory>{ static constexpr GUID value{ 0xCBB049B0,0x468A,0x4C6F,{ 0xB2,0xA2,0x8E,0xB8,0xBA,0x8D,0xEA,0x48 } }; }; template <> struct guid<Windows::Graphics::Printing3D::IPrinting3DTextureResource>{ static constexpr GUID value{ 0xA70DF32D,0x6AB1,0x44AE,{ 0xBC,0x45,0xA2,0x73,0x82,0xC0,0xD3,0x8C } }; }; template <> struct guid<Windows::Graphics::Printing3D::Print3DTaskSourceRequestedHandler>{ static constexpr GUID value{ 0xE9175E70,0xC917,0x46DE,{ 0xBB,0x51,0xD9,0xA9,0x4D,0xB3,0x71,0x1F } }; }; template <> struct default_interface<Windows::Graphics::Printing3D::Print3DManager>{ using type = Windows::Graphics::Printing3D::IPrint3DManager; }; template <> struct default_interface<Windows::Graphics::Printing3D::Print3DTask>{ using type = Windows::Graphics::Printing3D::IPrint3DTask; }; template <> struct default_interface<Windows::Graphics::Printing3D::Print3DTaskCompletedEventArgs>{ using type = Windows::Graphics::Printing3D::IPrint3DTaskCompletedEventArgs; }; template <> struct default_interface<Windows::Graphics::Printing3D::Print3DTaskRequest>{ using type = Windows::Graphics::Printing3D::IPrint3DTaskRequest; }; template <> struct default_interface<Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs>{ using type = Windows::Graphics::Printing3D::IPrint3DTaskRequestedEventArgs; }; template <> struct default_interface<Windows::Graphics::Printing3D::Print3DTaskSourceChangedEventArgs>{ using type = Windows::Graphics::Printing3D::IPrint3DTaskSourceChangedEventArgs; }; template <> struct default_interface<Windows::Graphics::Printing3D::Print3DTaskSourceRequestedArgs>{ using type = Windows::Graphics::Printing3D::IPrint3DTaskSourceRequestedArgs; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3D3MFPackage>{ using type = Windows::Graphics::Printing3D::IPrinting3D3MFPackage; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DBaseMaterial>{ using type = Windows::Graphics::Printing3D::IPrinting3DBaseMaterial; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DBaseMaterialGroup>{ using type = Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroup; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DColorMaterial>{ using type = Windows::Graphics::Printing3D::IPrinting3DColorMaterial; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DColorMaterialGroup>{ using type = Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroup; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DComponent>{ using type = Windows::Graphics::Printing3D::IPrinting3DComponent; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DComponentWithMatrix>{ using type = Windows::Graphics::Printing3D::IPrinting3DComponentWithMatrix; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DCompositeMaterial>{ using type = Windows::Graphics::Printing3D::IPrinting3DCompositeMaterial; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DCompositeMaterialGroup>{ using type = Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DFaceReductionOptions>{ using type = Windows::Graphics::Printing3D::IPrinting3DFaceReductionOptions; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DMaterial>{ using type = Windows::Graphics::Printing3D::IPrinting3DMaterial; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DMesh>{ using type = Windows::Graphics::Printing3D::IPrinting3DMesh; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DMeshVerificationResult>{ using type = Windows::Graphics::Printing3D::IPrinting3DMeshVerificationResult; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DModel>{ using type = Windows::Graphics::Printing3D::IPrinting3DModel; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DModelTexture>{ using type = Windows::Graphics::Printing3D::IPrinting3DModelTexture; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterial>{ using type = Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterial; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterialGroup>{ using type = Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroup; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterial>{ using type = Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterial; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterialGroup>{ using type = Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup; }; template <> struct default_interface<Windows::Graphics::Printing3D::Printing3DTextureResource>{ using type = Windows::Graphics::Printing3D::IPrinting3DTextureResource; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrint3DManager { event_token TaskRequested(Windows::Foundation::TypedEventHandler<Windows::Graphics::Printing3D::Print3DManager, Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs> const& eventHandler) const; using TaskRequested_revoker = event_revoker<Windows::Graphics::Printing3D::IPrint3DManager>; TaskRequested_revoker TaskRequested(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Graphics::Printing3D::Print3DManager, Windows::Graphics::Printing3D::Print3DTaskRequestedEventArgs> const& eventHandler) const; void TaskRequested(event_token const& token) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrint3DManager> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrint3DManager<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrint3DManagerStatics { Windows::Graphics::Printing3D::Print3DManager GetForCurrentView() const; Windows::Foundation::IAsyncOperation<bool> ShowPrintUIAsync() const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrint3DManagerStatics> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrint3DManagerStatics<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrint3DTask { Windows::Graphics::Printing3D::Printing3D3MFPackage Source() const noexcept; event_token Submitting(Windows::Foundation::TypedEventHandler<Windows::Graphics::Printing3D::Print3DTask, Windows::Foundation::IInspectable> const& eventHandler) const; using Submitting_revoker = event_revoker<Windows::Graphics::Printing3D::IPrint3DTask>; Submitting_revoker Submitting(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Graphics::Printing3D::Print3DTask, Windows::Foundation::IInspectable> const& eventHandler) const; void Submitting(event_token const& eventCookie) const; event_token Completed(Windows::Foundation::TypedEventHandler<Windows::Graphics::Printing3D::Print3DTask, Windows::Graphics::Printing3D::Print3DTaskCompletedEventArgs> const& eventHandler) const; using Completed_revoker = event_revoker<Windows::Graphics::Printing3D::IPrint3DTask>; Completed_revoker Completed(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Graphics::Printing3D::Print3DTask, Windows::Graphics::Printing3D::Print3DTaskCompletedEventArgs> const& eventHandler) const; void Completed(event_token const& eventCookie) const; event_token SourceChanged(Windows::Foundation::TypedEventHandler<Windows::Graphics::Printing3D::Print3DTask, Windows::Graphics::Printing3D::Print3DTaskSourceChangedEventArgs> const& eventHandler) const; using SourceChanged_revoker = event_revoker<Windows::Graphics::Printing3D::IPrint3DTask>; SourceChanged_revoker SourceChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Graphics::Printing3D::Print3DTask, Windows::Graphics::Printing3D::Print3DTaskSourceChangedEventArgs> const& eventHandler) const; void SourceChanged(event_token const& eventCookie) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrint3DTask> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrint3DTask<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrint3DTaskCompletedEventArgs { Windows::Graphics::Printing3D::Print3DTaskCompletion Completion() const noexcept; Windows::Graphics::Printing3D::Print3DTaskDetail ExtendedStatus() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrint3DTaskCompletedEventArgs> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrint3DTaskCompletedEventArgs<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrint3DTaskRequest { Windows::Graphics::Printing3D::Print3DTask CreateTask(param::hstring const& title, param::hstring const& printerId, Windows::Graphics::Printing3D::Print3DTaskSourceRequestedHandler const& handler) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrint3DTaskRequest> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrint3DTaskRequest<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrint3DTaskRequestedEventArgs { Windows::Graphics::Printing3D::Print3DTaskRequest Request() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrint3DTaskRequestedEventArgs> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrint3DTaskRequestedEventArgs<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrint3DTaskSourceChangedEventArgs { Windows::Graphics::Printing3D::Printing3D3MFPackage Source() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrint3DTaskSourceChangedEventArgs> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrint3DTaskSourceChangedEventArgs<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrint3DTaskSourceRequestedArgs { void SetSource(Windows::Graphics::Printing3D::Printing3D3MFPackage const& source) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrint3DTaskSourceRequestedArgs> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrint3DTaskSourceRequestedArgs<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3D3MFPackage { Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IRandomAccessStream> SaveAsync() const; Windows::Storage::Streams::IRandomAccessStream PrintTicket() const noexcept; void PrintTicket(Windows::Storage::Streams::IRandomAccessStream const& value) const noexcept; Windows::Storage::Streams::IRandomAccessStream ModelPart() const noexcept; void ModelPart(Windows::Storage::Streams::IRandomAccessStream const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DTextureResource Thumbnail() const noexcept; void Thumbnail(Windows::Graphics::Printing3D::Printing3DTextureResource const& value) const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DTextureResource> Textures() const noexcept; Windows::Foundation::IAsyncOperation<Windows::Graphics::Printing3D::Printing3DModel> LoadModelFromPackageAsync(Windows::Storage::Streams::IRandomAccessStream const& value) const; Windows::Foundation::IAsyncAction SaveModelToPackageAsync(Windows::Graphics::Printing3D::Printing3DModel const& value) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3D3MFPackage> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3D3MFPackage<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3D3MFPackage2 { Windows::Graphics::Printing3D::Printing3DPackageCompression Compression() const noexcept; void Compression(Windows::Graphics::Printing3D::Printing3DPackageCompression const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3D3MFPackage2> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3D3MFPackage2<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3D3MFPackageStatics { Windows::Foundation::IAsyncOperation<Windows::Graphics::Printing3D::Printing3D3MFPackage> LoadAsync(Windows::Storage::Streams::IRandomAccessStream const& value) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3D3MFPackageStatics> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3D3MFPackageStatics<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DBaseMaterial { hstring Name() const noexcept; void Name(param::hstring const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DColorMaterial Color() const noexcept; void Color(Windows::Graphics::Printing3D::Printing3DColorMaterial const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DBaseMaterial> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DBaseMaterial<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DBaseMaterialGroup { Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DBaseMaterial> Bases() const noexcept; uint32_t MaterialGroupId() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroup> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DBaseMaterialGroup<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DBaseMaterialGroupFactory { Windows::Graphics::Printing3D::Printing3DBaseMaterialGroup Create(uint32_t MaterialGroupId) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroupFactory> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DBaseMaterialGroupFactory<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DBaseMaterialStatics { hstring Abs() const noexcept; hstring Pla() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialStatics> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DBaseMaterialStatics<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DColorMaterial { uint32_t Value() const noexcept; void Value(uint32_t value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DColorMaterial> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DColorMaterial<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DColorMaterial2 { Windows::UI::Color Color() const noexcept; void Color(Windows::UI::Color const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DColorMaterial2> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DColorMaterial2<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DColorMaterialGroup { Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DColorMaterial> Colors() const noexcept; uint32_t MaterialGroupId() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroup> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DColorMaterialGroup<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DColorMaterialGroupFactory { Windows::Graphics::Printing3D::Printing3DColorMaterialGroup Create(uint32_t MaterialGroupId) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroupFactory> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DColorMaterialGroupFactory<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DComponent { Windows::Graphics::Printing3D::Printing3DMesh Mesh() const noexcept; void Mesh(Windows::Graphics::Printing3D::Printing3DMesh const& value) const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DComponentWithMatrix> Components() const noexcept; Windows::Graphics::Printing3D::Printing3DTextureResource Thumbnail() const noexcept; void Thumbnail(Windows::Graphics::Printing3D::Printing3DTextureResource const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DObjectType Type() const noexcept; void Type(Windows::Graphics::Printing3D::Printing3DObjectType const& value) const noexcept; hstring Name() const noexcept; void Name(param::hstring const& value) const noexcept; hstring PartNumber() const noexcept; void PartNumber(param::hstring const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DComponent> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DComponent<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DComponentWithMatrix { Windows::Graphics::Printing3D::Printing3DComponent Component() const noexcept; void Component(Windows::Graphics::Printing3D::Printing3DComponent const& value) const noexcept; Windows::Foundation::Numerics::float4x4 Matrix() const noexcept; void Matrix(Windows::Foundation::Numerics::float4x4 const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DComponentWithMatrix> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DComponentWithMatrix<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DCompositeMaterial { Windows::Foundation::Collections::IVector<double> Values() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterial> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DCompositeMaterial<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DCompositeMaterialGroup { Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DCompositeMaterial> Composites() const noexcept; uint32_t MaterialGroupId() const noexcept; Windows::Foundation::Collections::IVector<uint32_t> MaterialIndices() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DCompositeMaterialGroup<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DCompositeMaterialGroup2 { Windows::Graphics::Printing3D::Printing3DBaseMaterialGroup BaseMaterialGroup() const noexcept; void BaseMaterialGroup(Windows::Graphics::Printing3D::Printing3DBaseMaterialGroup const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup2> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DCompositeMaterialGroup2<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DCompositeMaterialGroupFactory { Windows::Graphics::Printing3D::Printing3DCompositeMaterialGroup Create(uint32_t MaterialGroupId) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroupFactory> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DCompositeMaterialGroupFactory<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DFaceReductionOptions { double MaxReductionArea() const noexcept; void MaxReductionArea(double value) const noexcept; uint32_t TargetTriangleCount() const noexcept; void TargetTriangleCount(uint32_t value) const noexcept; double MaxEdgeLength() const noexcept; void MaxEdgeLength(double value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DFaceReductionOptions> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DFaceReductionOptions<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DMaterial { Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DBaseMaterialGroup> BaseGroups() const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DColorMaterialGroup> ColorGroups() const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterialGroup> Texture2CoordGroups() const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DCompositeMaterialGroup> CompositeGroups() const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterialGroup> MultiplePropertyGroups() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DMaterial> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DMaterial<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DMesh { uint32_t VertexCount() const noexcept; void VertexCount(uint32_t value) const noexcept; uint32_t IndexCount() const noexcept; void IndexCount(uint32_t value) const noexcept; Windows::Graphics::Printing3D::Printing3DBufferDescription VertexPositionsDescription() const noexcept; void VertexPositionsDescription(Windows::Graphics::Printing3D::Printing3DBufferDescription const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DBufferDescription VertexNormalsDescription() const noexcept; void VertexNormalsDescription(Windows::Graphics::Printing3D::Printing3DBufferDescription const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DBufferDescription TriangleIndicesDescription() const noexcept; void TriangleIndicesDescription(Windows::Graphics::Printing3D::Printing3DBufferDescription const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DBufferDescription TriangleMaterialIndicesDescription() const noexcept; void TriangleMaterialIndicesDescription(Windows::Graphics::Printing3D::Printing3DBufferDescription const& value) const noexcept; Windows::Storage::Streams::IBuffer GetVertexPositions() const; void CreateVertexPositions(uint32_t value) const; Windows::Storage::Streams::IBuffer GetVertexNormals() const; void CreateVertexNormals(uint32_t value) const; Windows::Storage::Streams::IBuffer GetTriangleIndices() const; void CreateTriangleIndices(uint32_t value) const; Windows::Storage::Streams::IBuffer GetTriangleMaterialIndices() const; void CreateTriangleMaterialIndices(uint32_t value) const; Windows::Foundation::Collections::IPropertySet BufferDescriptionSet() const noexcept; Windows::Foundation::Collections::IPropertySet BufferSet() const noexcept; Windows::Foundation::IAsyncOperation<Windows::Graphics::Printing3D::Printing3DMeshVerificationResult> VerifyAsync(Windows::Graphics::Printing3D::Printing3DMeshVerificationMode const& value) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DMesh> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DMesh<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DMeshVerificationResult { bool IsValid() const noexcept; Windows::Foundation::Collections::IVectorView<uint32_t> NonmanifoldTriangles() const noexcept; Windows::Foundation::Collections::IVectorView<uint32_t> ReversedNormalTriangles() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DMeshVerificationResult> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DMeshVerificationResult<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DModel { Windows::Graphics::Printing3D::Printing3DModelUnit Unit() const noexcept; void Unit(Windows::Graphics::Printing3D::Printing3DModelUnit const& value) const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DModelTexture> Textures() const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DMesh> Meshes() const noexcept; Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DComponent> Components() const noexcept; Windows::Graphics::Printing3D::Printing3DMaterial Material() const noexcept; void Material(Windows::Graphics::Printing3D::Printing3DMaterial const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DComponent Build() const noexcept; void Build(Windows::Graphics::Printing3D::Printing3DComponent const& value) const noexcept; hstring Version() const noexcept; void Version(param::hstring const& value) const noexcept; Windows::Foundation::Collections::IVector<hstring> RequiredExtensions() const noexcept; Windows::Foundation::Collections::IMap<hstring, hstring> Metadata() const noexcept; Windows::Foundation::IAsyncAction RepairAsync() const; Windows::Graphics::Printing3D::Printing3DModel Clone() const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DModel> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DModel<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DModel2 { Windows::Foundation::IAsyncOperation<bool> TryPartialRepairAsync() const; Windows::Foundation::IAsyncOperation<bool> TryPartialRepairAsync(Windows::Foundation::TimeSpan const& maxWaitTime) const; Windows::Foundation::IAsyncOperationWithProgress<bool, double> TryReduceFacesAsync() const; Windows::Foundation::IAsyncOperationWithProgress<bool, double> TryReduceFacesAsync(Windows::Graphics::Printing3D::Printing3DFaceReductionOptions const& printing3DFaceReductionOptions) const; Windows::Foundation::IAsyncOperationWithProgress<bool, double> TryReduceFacesAsync(Windows::Graphics::Printing3D::Printing3DFaceReductionOptions const& printing3DFaceReductionOptions, Windows::Foundation::TimeSpan const& maxWait) const; Windows::Foundation::IAsyncOperationWithProgress<bool, double> RepairWithProgressAsync() const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DModel2> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DModel2<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DModelTexture { Windows::Graphics::Printing3D::Printing3DTextureResource TextureResource() const noexcept; void TextureResource(Windows::Graphics::Printing3D::Printing3DTextureResource const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior TileStyleU() const noexcept; void TileStyleU(Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior const& value) const noexcept; Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior TileStyleV() const noexcept; void TileStyleV(Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DModelTexture> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DModelTexture<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DMultiplePropertyMaterial { Windows::Foundation::Collections::IVector<uint32_t> MaterialIndices() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterial> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DMultiplePropertyMaterial<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DMultiplePropertyMaterialGroup { Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterial> MultipleProperties() const noexcept; Windows::Foundation::Collections::IVector<uint32_t> MaterialGroupIndices() const noexcept; uint32_t MaterialGroupId() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroup> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DMultiplePropertyMaterialGroup<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DMultiplePropertyMaterialGroupFactory { Windows::Graphics::Printing3D::Printing3DMultiplePropertyMaterialGroup Create(uint32_t MaterialGroupId) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroupFactory> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DMultiplePropertyMaterialGroupFactory<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DTexture2CoordMaterial { Windows::Graphics::Printing3D::Printing3DModelTexture Texture() const noexcept; void Texture(Windows::Graphics::Printing3D::Printing3DModelTexture const& value) const noexcept; double U() const noexcept; void U(double value) const noexcept; double V() const noexcept; void V(double value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterial> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DTexture2CoordMaterial<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DTexture2CoordMaterialGroup { Windows::Foundation::Collections::IVector<Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterial> Texture2Coords() const noexcept; uint32_t MaterialGroupId() const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DTexture2CoordMaterialGroup<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DTexture2CoordMaterialGroup2 { Windows::Graphics::Printing3D::Printing3DModelTexture Texture() const noexcept; void Texture(Windows::Graphics::Printing3D::Printing3DModelTexture const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup2> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DTexture2CoordMaterialGroup2<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DTexture2CoordMaterialGroupFactory { Windows::Graphics::Printing3D::Printing3DTexture2CoordMaterialGroup Create(uint32_t MaterialGroupId) const; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroupFactory> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DTexture2CoordMaterialGroupFactory<D>; }; template <typename D> struct consume_Windows_Graphics_Printing3D_IPrinting3DTextureResource { Windows::Storage::Streams::IRandomAccessStreamWithContentType TextureData() const noexcept; void TextureData(Windows::Storage::Streams::IRandomAccessStreamWithContentType const& value) const noexcept; hstring Name() const noexcept; void Name(param::hstring const& value) const noexcept; }; template <> struct consume<Windows::Graphics::Printing3D::IPrinting3DTextureResource> { template <typename D> using type = consume_Windows_Graphics_Printing3D_IPrinting3DTextureResource<D>; }; template <> struct abi<Windows::Graphics::Printing3D::IPrint3DManager>{ struct type : ::IInspectable { virtual HRESULT __stdcall add_TaskRequested(::IUnknown* eventHandler, event_token* token) = 0; virtual HRESULT __stdcall remove_TaskRequested(event_token token) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrint3DManagerStatics>{ struct type : ::IInspectable { virtual HRESULT __stdcall GetForCurrentView(::IUnknown** result) = 0; virtual HRESULT __stdcall ShowPrintUIAsync(::IUnknown** result) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrint3DTask>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Source(::IUnknown** value) = 0; virtual HRESULT __stdcall add_Submitting(::IUnknown* eventHandler, event_token* eventCookie) = 0; virtual HRESULT __stdcall remove_Submitting(event_token eventCookie) = 0; virtual HRESULT __stdcall add_Completed(::IUnknown* eventHandler, event_token* eventCookie) = 0; virtual HRESULT __stdcall remove_Completed(event_token eventCookie) = 0; virtual HRESULT __stdcall add_SourceChanged(::IUnknown* eventHandler, event_token* eventCookie) = 0; virtual HRESULT __stdcall remove_SourceChanged(event_token eventCookie) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrint3DTaskCompletedEventArgs>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Completion(Windows::Graphics::Printing3D::Print3DTaskCompletion* value) = 0; virtual HRESULT __stdcall get_ExtendedStatus(Windows::Graphics::Printing3D::Print3DTaskDetail* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrint3DTaskRequest>{ struct type : ::IInspectable { virtual HRESULT __stdcall CreateTask(HSTRING title, HSTRING printerId, ::IUnknown* handler, ::IUnknown** result) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrint3DTaskRequestedEventArgs>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Request(::IUnknown** value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrint3DTaskSourceChangedEventArgs>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Source(::IUnknown** value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrint3DTaskSourceRequestedArgs>{ struct type : ::IInspectable { virtual HRESULT __stdcall SetSource(::IUnknown* source) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3D3MFPackage>{ struct type : ::IInspectable { virtual HRESULT __stdcall SaveAsync(::IUnknown** operation) = 0; virtual HRESULT __stdcall get_PrintTicket(::IUnknown** value) = 0; virtual HRESULT __stdcall put_PrintTicket(::IUnknown* value) = 0; virtual HRESULT __stdcall get_ModelPart(::IUnknown** value) = 0; virtual HRESULT __stdcall put_ModelPart(::IUnknown* value) = 0; virtual HRESULT __stdcall get_Thumbnail(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Thumbnail(::IUnknown* value) = 0; virtual HRESULT __stdcall get_Textures(::IUnknown** value) = 0; virtual HRESULT __stdcall LoadModelFromPackageAsync(::IUnknown* value, ::IUnknown** operation) = 0; virtual HRESULT __stdcall SaveModelToPackageAsync(::IUnknown* value, ::IUnknown** operation) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3D3MFPackage2>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Compression(Windows::Graphics::Printing3D::Printing3DPackageCompression* value) = 0; virtual HRESULT __stdcall put_Compression(Windows::Graphics::Printing3D::Printing3DPackageCompression value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3D3MFPackageStatics>{ struct type : ::IInspectable { virtual HRESULT __stdcall LoadAsync(::IUnknown* value, ::IUnknown** operation) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DBaseMaterial>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Name(HSTRING* value) = 0; virtual HRESULT __stdcall put_Name(HSTRING value) = 0; virtual HRESULT __stdcall get_Color(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Color(::IUnknown* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroup>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Bases(::IUnknown** value) = 0; virtual HRESULT __stdcall get_MaterialGroupId(uint32_t* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialGroupFactory>{ struct type : ::IInspectable { virtual HRESULT __stdcall Create(uint32_t MaterialGroupId, ::IUnknown** result) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DBaseMaterialStatics>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Abs(HSTRING* value) = 0; virtual HRESULT __stdcall get_Pla(HSTRING* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DColorMaterial>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Value(uint32_t* value) = 0; virtual HRESULT __stdcall put_Value(uint32_t value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DColorMaterial2>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Color(struct_of<4>* value) = 0; virtual HRESULT __stdcall put_Color(struct_of<4> value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroup>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Colors(::IUnknown** value) = 0; virtual HRESULT __stdcall get_MaterialGroupId(uint32_t* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DColorMaterialGroupFactory>{ struct type : ::IInspectable { virtual HRESULT __stdcall Create(uint32_t MaterialGroupId, ::IUnknown** result) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DComponent>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Mesh(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Mesh(::IUnknown* value) = 0; virtual HRESULT __stdcall get_Components(::IUnknown** value) = 0; virtual HRESULT __stdcall get_Thumbnail(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Thumbnail(::IUnknown* value) = 0; virtual HRESULT __stdcall get_Type(Windows::Graphics::Printing3D::Printing3DObjectType* value) = 0; virtual HRESULT __stdcall put_Type(Windows::Graphics::Printing3D::Printing3DObjectType value) = 0; virtual HRESULT __stdcall get_Name(HSTRING* value) = 0; virtual HRESULT __stdcall put_Name(HSTRING value) = 0; virtual HRESULT __stdcall get_PartNumber(HSTRING* value) = 0; virtual HRESULT __stdcall put_PartNumber(HSTRING value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DComponentWithMatrix>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Component(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Component(::IUnknown* value) = 0; virtual HRESULT __stdcall get_Matrix(Windows::Foundation::Numerics::float4x4* value) = 0; virtual HRESULT __stdcall put_Matrix(Windows::Foundation::Numerics::float4x4 value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterial>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Values(::IUnknown** value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Composites(::IUnknown** value) = 0; virtual HRESULT __stdcall get_MaterialGroupId(uint32_t* value) = 0; virtual HRESULT __stdcall get_MaterialIndices(::IUnknown** value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroup2>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_BaseMaterialGroup(::IUnknown** value) = 0; virtual HRESULT __stdcall put_BaseMaterialGroup(::IUnknown* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DCompositeMaterialGroupFactory>{ struct type : ::IInspectable { virtual HRESULT __stdcall Create(uint32_t MaterialGroupId, ::IUnknown** result) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DFaceReductionOptions>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_MaxReductionArea(double* value) = 0; virtual HRESULT __stdcall put_MaxReductionArea(double value) = 0; virtual HRESULT __stdcall get_TargetTriangleCount(uint32_t* value) = 0; virtual HRESULT __stdcall put_TargetTriangleCount(uint32_t value) = 0; virtual HRESULT __stdcall get_MaxEdgeLength(double* value) = 0; virtual HRESULT __stdcall put_MaxEdgeLength(double value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DMaterial>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_BaseGroups(::IUnknown** value) = 0; virtual HRESULT __stdcall get_ColorGroups(::IUnknown** value) = 0; virtual HRESULT __stdcall get_Texture2CoordGroups(::IUnknown** value) = 0; virtual HRESULT __stdcall get_CompositeGroups(::IUnknown** value) = 0; virtual HRESULT __stdcall get_MultiplePropertyGroups(::IUnknown** value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DMesh>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_VertexCount(uint32_t* value) = 0; virtual HRESULT __stdcall put_VertexCount(uint32_t value) = 0; virtual HRESULT __stdcall get_IndexCount(uint32_t* value) = 0; virtual HRESULT __stdcall put_IndexCount(uint32_t value) = 0; virtual HRESULT __stdcall get_VertexPositionsDescription(struct_of<8>* value) = 0; virtual HRESULT __stdcall put_VertexPositionsDescription(struct_of<8> value) = 0; virtual HRESULT __stdcall get_VertexNormalsDescription(struct_of<8>* value) = 0; virtual HRESULT __stdcall put_VertexNormalsDescription(struct_of<8> value) = 0; virtual HRESULT __stdcall get_TriangleIndicesDescription(struct_of<8>* value) = 0; virtual HRESULT __stdcall put_TriangleIndicesDescription(struct_of<8> value) = 0; virtual HRESULT __stdcall get_TriangleMaterialIndicesDescription(struct_of<8>* value) = 0; virtual HRESULT __stdcall put_TriangleMaterialIndicesDescription(struct_of<8> value) = 0; virtual HRESULT __stdcall GetVertexPositions(::IUnknown** buffer) = 0; virtual HRESULT __stdcall CreateVertexPositions(uint32_t value) = 0; virtual HRESULT __stdcall GetVertexNormals(::IUnknown** buffer) = 0; virtual HRESULT __stdcall CreateVertexNormals(uint32_t value) = 0; virtual HRESULT __stdcall GetTriangleIndices(::IUnknown** buffer) = 0; virtual HRESULT __stdcall CreateTriangleIndices(uint32_t value) = 0; virtual HRESULT __stdcall GetTriangleMaterialIndices(::IUnknown** buffer) = 0; virtual HRESULT __stdcall CreateTriangleMaterialIndices(uint32_t value) = 0; virtual HRESULT __stdcall get_BufferDescriptionSet(::IUnknown** value) = 0; virtual HRESULT __stdcall get_BufferSet(::IUnknown** value) = 0; virtual HRESULT __stdcall VerifyAsync(Windows::Graphics::Printing3D::Printing3DMeshVerificationMode value, ::IUnknown** operation) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DMeshVerificationResult>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_IsValid(bool* value) = 0; virtual HRESULT __stdcall get_NonmanifoldTriangles(::IUnknown** value) = 0; virtual HRESULT __stdcall get_ReversedNormalTriangles(::IUnknown** value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DModel>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Unit(Windows::Graphics::Printing3D::Printing3DModelUnit* value) = 0; virtual HRESULT __stdcall put_Unit(Windows::Graphics::Printing3D::Printing3DModelUnit value) = 0; virtual HRESULT __stdcall get_Textures(::IUnknown** value) = 0; virtual HRESULT __stdcall get_Meshes(::IUnknown** value) = 0; virtual HRESULT __stdcall get_Components(::IUnknown** value) = 0; virtual HRESULT __stdcall get_Material(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Material(::IUnknown* value) = 0; virtual HRESULT __stdcall get_Build(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Build(::IUnknown* value) = 0; virtual HRESULT __stdcall get_Version(HSTRING* value) = 0; virtual HRESULT __stdcall put_Version(HSTRING value) = 0; virtual HRESULT __stdcall get_RequiredExtensions(::IUnknown** value) = 0; virtual HRESULT __stdcall get_Metadata(::IUnknown** value) = 0; virtual HRESULT __stdcall RepairAsync(::IUnknown** operation) = 0; virtual HRESULT __stdcall Clone(::IUnknown** value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DModel2>{ struct type : ::IInspectable { virtual HRESULT __stdcall TryPartialRepairAsync(::IUnknown** operation) = 0; virtual HRESULT __stdcall TryPartialRepairWithTimeAsync(Windows::Foundation::TimeSpan maxWaitTime, ::IUnknown** operation) = 0; virtual HRESULT __stdcall TryReduceFacesAsync(::IUnknown** operation) = 0; virtual HRESULT __stdcall TryReduceFacesWithOptionsAsync(::IUnknown* printing3DFaceReductionOptions, ::IUnknown** operation) = 0; virtual HRESULT __stdcall TryReduceFacesWithOptionsAndTimeAsync(::IUnknown* printing3DFaceReductionOptions, Windows::Foundation::TimeSpan maxWait, ::IUnknown** operation) = 0; virtual HRESULT __stdcall RepairWithProgressAsync(::IUnknown** operation) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DModelTexture>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_TextureResource(::IUnknown** value) = 0; virtual HRESULT __stdcall put_TextureResource(::IUnknown* value) = 0; virtual HRESULT __stdcall get_TileStyleU(Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior* value) = 0; virtual HRESULT __stdcall put_TileStyleU(Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior value) = 0; virtual HRESULT __stdcall get_TileStyleV(Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior* value) = 0; virtual HRESULT __stdcall put_TileStyleV(Windows::Graphics::Printing3D::Printing3DTextureEdgeBehavior value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterial>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_MaterialIndices(::IUnknown** value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroup>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_MultipleProperties(::IUnknown** value) = 0; virtual HRESULT __stdcall get_MaterialGroupIndices(::IUnknown** value) = 0; virtual HRESULT __stdcall get_MaterialGroupId(uint32_t* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DMultiplePropertyMaterialGroupFactory>{ struct type : ::IInspectable { virtual HRESULT __stdcall Create(uint32_t MaterialGroupId, ::IUnknown** result) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterial>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Texture(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Texture(::IUnknown* value) = 0; virtual HRESULT __stdcall get_U(double* value) = 0; virtual HRESULT __stdcall put_U(double value) = 0; virtual HRESULT __stdcall get_V(double* value) = 0; virtual HRESULT __stdcall put_V(double value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Texture2Coords(::IUnknown** value) = 0; virtual HRESULT __stdcall get_MaterialGroupId(uint32_t* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroup2>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_Texture(::IUnknown** value) = 0; virtual HRESULT __stdcall put_Texture(::IUnknown* value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DTexture2CoordMaterialGroupFactory>{ struct type : ::IInspectable { virtual HRESULT __stdcall Create(uint32_t MaterialGroupId, ::IUnknown** result) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::IPrinting3DTextureResource>{ struct type : ::IInspectable { virtual HRESULT __stdcall get_TextureData(::IUnknown** value) = 0; virtual HRESULT __stdcall put_TextureData(::IUnknown* value) = 0; virtual HRESULT __stdcall get_Name(HSTRING* value) = 0; virtual HRESULT __stdcall put_Name(HSTRING value) = 0; };}; template <> struct abi<Windows::Graphics::Printing3D::Print3DTaskSourceRequestedHandler>{ struct type : ::IUnknown { virtual HRESULT __stdcall Invoke(::IUnknown* args) = 0; };}; }
75.707734
240
0.803236
[ "mesh", "model" ]
96400edeed746520753de2a43a631262882bc5fd
16,644
c
C
opal/class/opal_rb_tree.c
abouteiller/ompi-aurelien
3fedbf777c4864c9c4f864228d787b27fadf0f74
[ "BSD-3-Clause-Open-MPI" ]
1,585
2015-01-03T04:10:59.000Z
2022-03-31T19:48:54.000Z
opal/class/opal_rb_tree.c
abouteiller/ompi-aurelien
3fedbf777c4864c9c4f864228d787b27fadf0f74
[ "BSD-3-Clause-Open-MPI" ]
7,655
2015-01-04T14:42:56.000Z
2022-03-31T22:51:57.000Z
opal/class/opal_rb_tree.c
shintaro-iwasaki/ompi
aa5803c1e40018f1df374f347e3706dc62da8467
[ "BSD-3-Clause-Open-MPI" ]
846
2015-01-20T15:01:44.000Z
2022-03-27T13:06:07.000Z
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ /* * @file */ #include "opal_config.h" #include "opal/class/opal_rb_tree.h" /* Private functions */ static void btree_insert(opal_rb_tree_t *tree, opal_rb_tree_node_t *node); static void btree_delete_fixup(opal_rb_tree_t *tree, opal_rb_tree_node_t *x); static opal_rb_tree_node_t *btree_successor(opal_rb_tree_t *tree, opal_rb_tree_node_t *node); static opal_rb_tree_node_t *opal_rb_tree_find_node(opal_rb_tree_t *tree, void *key); static void left_rotate(opal_rb_tree_t *tree, opal_rb_tree_node_t *x); static void right_rotate(opal_rb_tree_t *tree, opal_rb_tree_node_t *x); static void inorder_destroy(opal_rb_tree_t *tree, opal_rb_tree_node_t *node); static void inorder_traversal(opal_rb_tree_t *tree, opal_rb_tree_condition_fn_t cond, opal_rb_tree_action_fn_t action, opal_rb_tree_node_t *node); /** * the constructor function. creates the free list to get the nodes from * * @param object the tree that is to be used * * @retval NONE */ static void opal_rb_tree_construct(opal_object_t *object) { opal_rb_tree_t *tree = (opal_rb_tree_t *) object; tree->root_ptr = NULL; OBJ_CONSTRUCT(&(tree->free_list), opal_free_list_t); opal_free_list_init(&(tree->free_list), sizeof(opal_rb_tree_node_t), opal_cache_line_size, OBJ_CLASS(opal_rb_tree_node_t), 0, opal_cache_line_size, 0, -1, 128, NULL, 0, NULL, NULL, NULL); } /** * the destructor function. Free the tree and destroys the free list. * * @param object the tree object */ static void opal_rb_tree_destruct(opal_object_t *object) { if (NULL != ((opal_rb_tree_t *) object)->root_ptr) { opal_rb_tree_destroy((opal_rb_tree_t *) object); } OBJ_DESTRUCT(&(((opal_rb_tree_t *) object)->free_list)); return; } /* declare the instance of the classes */ OBJ_CLASS_INSTANCE(opal_rb_tree_node_t, opal_free_list_item_t, NULL, NULL); OBJ_CLASS_INSTANCE(opal_rb_tree_t, opal_object_t, opal_rb_tree_construct, opal_rb_tree_destruct); /* Create the tree */ int opal_rb_tree_init(opal_rb_tree_t *tree, opal_rb_tree_comp_fn_t comp) { opal_free_list_item_t *node; /* we need to get memory for the root pointer from the free list */ node = opal_free_list_get(&(tree->free_list)); tree->root_ptr = (opal_rb_tree_node_t *) node; if (NULL == node) { return OPAL_ERR_OUT_OF_RESOURCE; } node = opal_free_list_get(&(tree->free_list)); if (NULL == node) { opal_free_list_return(&tree->free_list, (opal_free_list_item_t *) tree->root_ptr); return OPAL_ERR_OUT_OF_RESOURCE; } tree->nill = (opal_rb_tree_node_t *) node; /* initialize tree->nill */ tree->nill->color = BLACK; tree->nill->left = tree->nill; tree->nill->right = tree->nill; tree->nill->parent = tree->nill; /* initialize the 'root' pointer */ tree->root_ptr->left = tree->nill; tree->root_ptr->right = tree->nill; tree->root_ptr->parent = tree->nill; tree->root_ptr->color = BLACK; tree->comp = comp; /* set the tree size to zero */ tree->tree_size = 0; return OPAL_SUCCESS; } /* This inserts a node into the tree based on the passed values. */ int opal_rb_tree_insert(opal_rb_tree_t *tree, void *key, void *value) { opal_rb_tree_node_t *y; opal_rb_tree_node_t *node; opal_free_list_item_t *item; /* get the memory for a node */ item = opal_free_list_get(&tree->free_list); if (NULL == item) { return OPAL_ERR_OUT_OF_RESOURCE; } node = (opal_rb_tree_node_t *) item; /* insert the data into the node */ node->key = key; node->value = value; /* insert the node into the tree */ btree_insert(tree, node); /*do the rotations */ /* usually one would have to check for NULL, but because of the sentinal, * we don't have to */ while (node->parent->color == RED) { if (node->parent == node->parent->parent->left) { y = node->parent->parent->right; if (y->color == RED) { node->parent->color = BLACK; y->color = BLACK; node->parent->parent->color = RED; node = node->parent->parent; } else { if (node == node->parent->right) { node = node->parent; left_rotate(tree, node); } node->parent->color = BLACK; node->parent->parent->color = RED; right_rotate(tree, node->parent->parent); } } else { y = node->parent->parent->left; if (y->color == RED) { node->parent->color = BLACK; y->color = BLACK; node->parent->parent->color = RED; node = node->parent->parent; } else { if (node == node->parent->left) { node = node->parent; right_rotate(tree, node); } node->parent->color = BLACK; node->parent->parent->color = RED; left_rotate(tree, node->parent->parent); } } } /* after the rotations the root is black */ tree->root_ptr->left->color = BLACK; return OPAL_SUCCESS; } /* Finds the node in the tree based on the key */ void *opal_rb_tree_find_with(opal_rb_tree_t *tree, void *key, opal_rb_tree_comp_fn_t compfn) { opal_rb_tree_node_t *node; int compvalue; node = tree->root_ptr->left; while (node != tree->nill) { compvalue = compfn(key, node->key); /* if the result of the comparison function is 0, we found it */ if (compvalue == 0) { return node->value; } /* else if it is less than 0, go left, else right */ node = ((compvalue < 0) ? node->left : node->right); } /* if we didn't find anything, return NULL */ return NULL; } /* Finds the node in the tree based on the key and returns a pointer * to the node. This is a bit a code duplication, but this has to be fast * so we go ahead with the duplication */ static opal_rb_tree_node_t *opal_rb_tree_find_node(opal_rb_tree_t *tree, void *key) { opal_rb_tree_node_t *node; int compvalue; node = tree->root_ptr->left; while (node != tree->nill) { compvalue = tree->comp(key, node->key); /* if the result of the comparison function is 0, we found it */ if (compvalue == 0) { return node; } /* else if it is less than 0, go left, else right */ node = ((compvalue < 0) ? node->left : node->right); } /* if we didn't find anything, return NULL */ return NULL; } /* Delete a node from the tree based on the key */ int opal_rb_tree_delete(opal_rb_tree_t *tree, void *key) { opal_rb_tree_node_t *p; opal_rb_tree_node_t *todelete; opal_rb_tree_node_t *y; opal_free_list_item_t *item; p = opal_rb_tree_find_node(tree, key); if (NULL == p) { return OPAL_ERR_NOT_FOUND; } if ((p->left == tree->nill) || (p->right == tree->nill)) { todelete = p; } else { todelete = btree_successor(tree, p); } if (todelete->left == tree->nill) { y = todelete->right; } else { y = todelete->left; } y->parent = todelete->parent; if (y->parent == tree->root_ptr) { tree->root_ptr->left = y; } else { if (todelete == todelete->parent->left) { todelete->parent->left = y; } else { todelete->parent->right = y; } } if (todelete != p) { p->key = todelete->key; p->value = todelete->value; } if (todelete->color == BLACK) { btree_delete_fixup(tree, y); } item = (opal_free_list_item_t *) todelete; opal_free_list_return(&(tree->free_list), item); --tree->tree_size; return OPAL_SUCCESS; } /* Destroy the hashmap */ int opal_rb_tree_destroy(opal_rb_tree_t *tree) { opal_free_list_item_t *item; /* Recursive inorder traversal for delete */ inorder_destroy(tree, tree->root_ptr); /* Now free the root -- root does not get free'd in the above * inorder destroy */ item = (opal_free_list_item_t *) tree->root_ptr; opal_free_list_return(&(tree->free_list), item); /* free the tree->nill node */ item = (opal_free_list_item_t *) tree->nill; opal_free_list_return(&(tree->free_list), item); return OPAL_SUCCESS; } /* Find the next inorder successor of a node */ static opal_rb_tree_node_t *btree_successor(opal_rb_tree_t *tree, opal_rb_tree_node_t *node) { opal_rb_tree_node_t *p; if (node->right == tree->nill) { p = node->parent; while (node == p->right) { node = p; p = p->parent; } if (p == tree->root_ptr) { return tree->nill; } return p; } p = node->right; while (p->left != tree->nill) { p = p->left; } return p; } /* Insert an element in the normal binary search tree fashion */ /* this function goes through the tree and finds the leaf where * the node will be inserted */ static void btree_insert(opal_rb_tree_t *tree, opal_rb_tree_node_t *node) { opal_rb_tree_node_t *parent = tree->root_ptr; opal_rb_tree_node_t *n = parent->left; /* the real root of the tree */ /* set up initial values for the node */ node->color = RED; node->parent = NULL; node->left = tree->nill; node->right = tree->nill; /* find the leaf where we will insert the node */ while (n != tree->nill) { parent = n; n = ((tree->comp(node->key, n->key) <= 0) ? n->left : n->right); } /* place it on either the left or the right */ if ((parent == tree->root_ptr) || (tree->comp(node->key, parent->key) <= 0)) { parent->left = node; } else { parent->right = node; } /* set its parent and children */ node->parent = parent; node->left = tree->nill; node->right = tree->nill; ++(tree->tree_size); return; } /* Fixup the balance of the btree after deletion */ static void btree_delete_fixup(opal_rb_tree_t *tree, opal_rb_tree_node_t *x) { opal_rb_tree_node_t *w; opal_rb_tree_node_t *root = tree->root_ptr->left; while ((x != root) && (x->color == BLACK)) { if (x == x->parent->left) { w = x->parent->right; if (w->color == RED) { w->color = BLACK; x->parent->color = RED; left_rotate(tree, x->parent); w = x->parent->right; } if ((w->left->color == BLACK) && (w->right->color == BLACK)) { w->color = RED; x = x->parent; } else { if (w->right->color == BLACK) { w->left->color = BLACK; w->color = RED; right_rotate(tree, w); w = x->parent->right; } w->color = x->parent->color; x->parent->color = BLACK; w->right->color = BLACK; left_rotate(tree, x->parent); x = root; } } else { /* right */ w = x->parent->left; if (w->color == RED) { w->color = BLACK; x->parent->color = RED; right_rotate(tree, x->parent); w = x->parent->left; } if ((w->right->color == BLACK) && (w->left->color == BLACK)) { w->color = RED; x = x->parent; } else { if (w->left->color == BLACK) { w->right->color = BLACK; w->color = RED; left_rotate(tree, w); w = x->parent->left; } w->color = x->parent->color; x->parent->color = BLACK; w->left->color = BLACK; right_rotate(tree, x->parent); x = root; } } } x->color = BLACK; return; } /* Free the nodes in inorder fashion */ static void inorder_destroy(opal_rb_tree_t *tree, opal_rb_tree_node_t *node) { opal_free_list_item_t *item; if (node == tree->nill) { return; } inorder_destroy(tree, node->left); if (node->left != tree->nill) { item = (opal_free_list_item_t *) node->left; --tree->tree_size; opal_free_list_return(&tree->free_list, item); } inorder_destroy(tree, node->right); if (node->right != tree->nill) { item = (opal_free_list_item_t *) node->right; --tree->tree_size; opal_free_list_return(&tree->free_list, item); } } /* Try to access all the elements of the hashmap conditionally */ int opal_rb_tree_traverse(opal_rb_tree_t *tree, opal_rb_tree_condition_fn_t cond, opal_rb_tree_action_fn_t action) { if ((cond == NULL) || (action == NULL)) { return OPAL_ERROR; } inorder_traversal(tree, cond, action, tree->root_ptr->left); return OPAL_SUCCESS; } static void inorder_traversal(opal_rb_tree_t *tree, opal_rb_tree_condition_fn_t cond, opal_rb_tree_action_fn_t action, opal_rb_tree_node_t *node) { if (node == tree->nill) { return; } inorder_traversal(tree, cond, action, node->left); if (cond(node->value)) { action(node->key, node->value); } inorder_traversal(tree, cond, action, node->right); } /* Left rotate the tree */ /* basically what we want to do is to make x be the left child * of its right child */ static void left_rotate(opal_rb_tree_t *tree, opal_rb_tree_node_t *x) { opal_rb_tree_node_t *y; y = x->right; /* make the left child of y's parent be x if it is not the sentinal node*/ if (y->left != tree->nill) { y->left->parent = x; } /* normlly we would have to check to see if we are at the root. * however, the root sentinal takes care of it for us */ if (x == x->parent->left) { x->parent->left = y; } else { x->parent->right = y; } /* the old parent of x is now y's parent */ y->parent = x->parent; /* x's parent is y */ x->parent = y; x->right = y->left; y->left = x; return; } /* Right rotate the tree */ /* basically what we want to do is to make x be the right child * of its left child */ static void right_rotate(opal_rb_tree_t *tree, opal_rb_tree_node_t *x) { opal_rb_tree_node_t *y; y = x->left; if (y->right != tree->nill) { y->right->parent = x; } if (x == x->parent->left) { x->parent->left = y; } else { x->parent->right = y; } y->parent = x->parent; x->parent = y; x->left = y->right; y->right = x; return; } /* returns the size of the tree */ int opal_rb_tree_size(opal_rb_tree_t *tree) { return tree->tree_size; } /* below are a couple of debugging functions */ #if 0 # include <stdio.h> static void inorder(opal_rb_tree_t * tree, opal_rb_tree_node_t * node); static void print_inorder(opal_rb_tree_t * tree); void inorder(opal_rb_tree_t * tree, opal_rb_tree_node_t * node) { static int level = 0; if (node == tree->nill) { printf("nill\n"); return; } level++; inorder(tree, node->left); level--; printf("%d, level: %d\n", *((int *)node->value), level); level++; inorder(tree, node->right); level--; } void print_inorder(opal_rb_tree_t *tree) { inorder(tree, tree->root_ptr->left); } #endif
29.989189
98
0.577806
[ "object" ]
96404c449be37eadcb3fbb2575ff3f90b862fae3
5,304
c
C
usr/vmkitmon/console.c
HawxChen/barrelfishOS
d8fbca601bfac61cc92ac06f5f5dd79ab18a8eaa
[ "MIT" ]
81
2015-01-02T23:53:38.000Z
2021-12-26T23:04:47.000Z
usr/vmkitmon/console.c
salivarick/barrelfish
252246b89117b0a23f6caa48a8b166c7bf12f885
[ "MIT" ]
1
2016-09-21T06:27:06.000Z
2016-10-05T07:16:28.000Z
usr/vmkitmon/console.c
salivarick/barrelfish
252246b89117b0a23f6caa48a8b166c7bf12f885
[ "MIT" ]
7
2015-03-11T14:27:15.000Z
2017-11-08T23:03:45.000Z
/** * \file */ /* * Copyright (c) 2009, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. */ #include "vmkitmon.h" #include "console.h" #include <stdlib.h> #include <barrelfish/terminal.h> struct console * console_new (void) { struct console *ret = calloc(1, sizeof(struct console)); return ret; } static int handle_set_cursor_position (struct console *c, struct guest *g) { // only support mode 0 for now if (guest_get_bh(g) != 0) { return HANDLER_ERR_UNHANDELED; } c->cursor_pos_x = guest_get_dl(g); c->cursor_pos_y = guest_get_dh(g); return HANDLER_ERR_OK; } static int handle_write_char_with_attr (struct console *c, struct guest *g) { // only support mode 0 for now if (guest_get_bh(g) != 0) { return HANDLER_ERR_UNHANDELED; } // we only support "normal" text output atm if (guest_get_bl(g) != 7) { return HANDLER_ERR_UNHANDELED; } // FIXME: Here we completely ignore the postition of the cursor atm since we // do not have proper terminal support in BF. // We also ignore multiple char writes, they make no sense atm. int r; char chr = guest_get_al(g); r = terminal_write(&chr, 1); assert(r == 1); return HANDLER_ERR_OK; } static int handle_teletype_output (struct console *c, struct guest *g) { // only support mode 0 for now if (guest_get_bh(g) != 0) { return HANDLER_ERR_UNHANDELED; } // we do not yet have a real understanding of the terminal, assume it is // 80x25 and we simply insert new lines at the end of the "screen" int r; char chr = guest_get_al(g); // treat CR and LF as column clearing chars if (chr == '\r' || chr == '\n') { c->cursor_pos_x = 0; } // insert a CR if we are passed the last column of the screen else if (c->cursor_pos_x > 79) { r = terminal_write("\n", 1); assert(r == 1); c->cursor_pos_x = 0; } // in all other cases just increase the column else { c->cursor_pos_x++; } r = terminal_write(&chr, 1); assert(r == 1); return HANDLER_ERR_OK; } static int handle_get_cursor_pos_and_size (struct console *c, struct guest *g) { // only support mode 0 for now if (guest_get_bh(g) != 0) { return HANDLER_ERR_UNHANDELED; } // set ax to 0 guest_set_ax(g, 0); // we do not support scan-lines guest_set_cx(g, 0); // set the position guest_set_dl(g, c->cursor_pos_x); guest_set_dh(g, c->cursor_pos_y); return HANDLER_ERR_OK; } static int handle_set_text_cursor_shape (struct console *c, struct guest *g) { // we only handle primitive cursors if (guest_get_cx(g) != 0) { printf("console: Unsupported cursor requested\n"); return HANDLER_ERR_FATAL; } return HANDLER_ERR_OK; } static int handle_get_current_video_mode (struct console *c, struct guest *g) { // FIXME: for the terminal to be more flexible this should not be hardcoded guest_set_ah(g, 80), guest_set_al(g, 0x6); // VGA, 80x25, 8x8 box, res 640x200, 2 colors guest_set_bh(g, 0); return HANDLER_ERR_OK; } static int handle_get_ega_info (struct console *c, struct guest *g) { // FIXME: only partially implemented, linux wants BX to be 0x10 to believe // it is confronted with a CGA card. guest_set_bx(g, 0x10); return HANDLER_ERR_OK; } static int handle_get_svga_info (struct console *c, struct guest *g) { // we do not support vesa yet guest_set_ax(g, 0); return HANDLER_ERR_OK; } static int handle_set_video_mode (struct console *c, struct guest *g) { // FIXME: Ignored for now. return HANDLER_ERR_OK; } int console_handle_int10 (struct console *c, struct guest *g) { // VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION if (guest_get_ax(g) == 0x4f00) { return handle_get_svga_info(c, g); } // VIDEO - SET VIDEO MODE if (guest_get_ah(g) == 0x0) { return handle_set_video_mode(c, g); } // VIDEO - SET TEXT-MODE CURSOR SHAPE if (guest_get_ah(g) == 0x1) { return handle_set_text_cursor_shape(c, g); } // VIDEO - SET CURSOR POSITION else if (guest_get_ah(g) == 0x2) { return handle_set_cursor_position(c, g); } // VIDEO - GET CURSOR POSITION AND SIZE else if (guest_get_ah(g) == 0x3) { return handle_get_cursor_pos_and_size(c, g); } // VIDEO - WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION else if (guest_get_ah(g) == 0x9) { return handle_write_char_with_attr(c, g); } // VIDEO - TELETYPE OUTPUT else if (guest_get_ah(g) == 0xe) { return handle_teletype_output(c, g); } // VIDEO - GET CURRENT VIDEO MODEL_CGA else if (guest_get_ah(g) == 0xf) { return handle_get_current_video_mode(c, g); } // VIDEO - ALTERNATE FUNCTION SELECT (PS, EGA, VGA, MCGA) - GET EGA INFO else if (guest_get_ah(g) == 0x12 && guest_get_bl(g) == 0x10) { return handle_get_ega_info(c, g); } return HANDLER_ERR_UNHANDELED; }
25.257143
80
0.6431
[ "shape" ]
9645e27cf2d8ade18f9dfdc72411816a3e6f4049
3,338
h
C
c_VSIP_testing/crvsub_f.h
rrjudd/jvsip
56a965fff595b027139ff151d27d434f2480b9e8
[ "MIT" ]
10
2016-01-16T04:10:13.000Z
2022-03-22T02:17:44.000Z
c_VSIP_testing/crvsub_f.h
rrjudd/jvsip
56a965fff595b027139ff151d27d434f2480b9e8
[ "MIT" ]
1
2015-09-11T04:48:03.000Z
2015-09-11T13:44:29.000Z
c_VSIP_testing/crvsub_f.h
rrjudd/jvsip
56a965fff595b027139ff151d27d434f2480b9e8
[ "MIT" ]
4
2017-06-13T21:48:23.000Z
2020-08-26T15:07:44.000Z
/* Created RJudd */ /* SPAWARSYSCEN D857 */ /********************************************************************** // For TASP VSIPL Documentation and Code neither the United States / // Government, the United States Navy, nor any of their employees, / // makes any warranty, express or implied, including the warranties / // of merchantability and fitness for a particular purpose, or / // assumes any legal liability or responsibility for the accuracy, / // completeness, or usefulness of any information, apparatus, / // product, or process disclosed, or represents that its use would / // not infringe privately owned rights / **********************************************************************/ /* $Id: crvsub_f.h,v 2.0 2003/02/22 15:23:22 judd Exp $ */ #include"VU_vprintm_f.include" #include"VU_cvprintm_f.include" static void crvsub_f(void){ printf("********\nTEST crvsub_f\n"); { vsip_scalar_f data_b[] = { 1.1, 1.2, 2.1, 2.2, -3.1, -3.3}; vsip_scalar_f data_a_r[] = { 8.1, 10.2, -12.1, 10.2, -11.1, -2.3}; vsip_scalar_f data_a_i[] = {10.1, 11.2, 22.1, 12.2, -13.1, -0.3}; vsip_scalar_f ans_r[] = {7.0, 9.0, -14.2, 8.0, -8.0, 1.0 }; vsip_scalar_f ans_i[] = {10.1, 11.2, 22.1, 12.2, -13.1, -0.3 }; vsip_block_f *block_b = vsip_blockbind_f(data_b,6,VSIP_MEM_NONE); vsip_cblock_f *block_a = vsip_cblockbind_f(data_a_r,data_a_i,6,VSIP_MEM_NONE); vsip_cblock_f *block_c = vsip_cblockcreate_f(30,VSIP_MEM_NONE); vsip_cblock_f *block_d = vsip_cblockcreate_f(30,VSIP_MEM_NONE); vsip_cblock_f *ans_block = vsip_cblockbind_f(ans_r,ans_i,6,VSIP_MEM_NONE); vsip_vview_f *b = vsip_vbind_f(block_b,0,1,6); vsip_cvview_f *a = vsip_cvbind_f(block_a,0,1,6); vsip_cvview_f *c = vsip_cvbind_f(block_c,18,-2,6); vsip_cvview_f *d = vsip_cvbind_f(block_d,2,3,6); vsip_cvview_f *ansv = vsip_cvbind_f(ans_block,0,1,6); vsip_cvview_f *chk = vsip_cvcreate_f(6,VSIP_MEM_NONE); vsip_vview_f *chk_r = vsip_vrealview_f(chk); vsip_blockadmit_f(block_b,VSIP_TRUE); vsip_cblockadmit_f(block_a,VSIP_TRUE); vsip_cblockadmit_f(ans_block,VSIP_TRUE); printf("vsip_crvsub_f(a,b,c)\n"); vsip_crvsub_f(a,b,c); printf("vector a\n");VU_cvprintm_f("8.6",a); printf("vector b\n");VU_vprintm_f("8.6",b); printf("vector c\n");VU_cvprintm_f("8.6",c); printf("right answer\n");VU_cvprintm_f("8.4",ansv); vsip_cvsub_f(c,ansv,chk); vsip_cvmag_f(chk,chk_r); vsip_vclip_f(chk_r,.0001,.0001,0,1,chk_r); if(vsip_vsumval_f(chk_r) > .5) printf("error\n"); else printf("correct\n"); printf("\nb,c in place, <b> real view of <c>\n"); { vsip_vview_f *b_r = vsip_vrealview_f(d); vsip_vcopy_f_f(b,b_r); vsip_crvsub_f(a,b_r,d); vsip_vdestroy_f(b_r); } vsip_cvsub_f(d,ansv,chk); vsip_cvmag_f(chk,chk_r); vsip_vclip_f(chk_r,.0001,.0001,0,1,chk_r); if(vsip_vsumval_f(chk_r) > .5) printf("error\n"); else printf("correct\n"); vsip_valldestroy_f(b); vsip_cvalldestroy_f(a); vsip_cvalldestroy_f(c); vsip_cvalldestroy_f(d); vsip_vdestroy_f(chk_r); vsip_cvalldestroy_f(chk); vsip_cvalldestroy_f(ansv); } return; }
42.794872
98
0.619832
[ "vector" ]
964718b54d104fda87dd56a1d55c259bf61b5558
31,518
c
C
src/liboyranos_config/oyranos.c
Acidburn0zzz/oyranos
b87dcf0e7a88e9b2f5f6c2e3314ddbd3af045575
[ "BSD-3-Clause" ]
null
null
null
src/liboyranos_config/oyranos.c
Acidburn0zzz/oyranos
b87dcf0e7a88e9b2f5f6c2e3314ddbd3af045575
[ "BSD-3-Clause" ]
null
null
null
src/liboyranos_config/oyranos.c
Acidburn0zzz/oyranos
b87dcf0e7a88e9b2f5f6c2e3314ddbd3af045575
[ "BSD-3-Clause" ]
null
null
null
/** @file oyranos.c * * Oyranos is an open source Color Management System * * @par Copyright: * 2004-2015 (C) Kai-Uwe Behrmann * * @brief public Oyranos API's * @author Kai-Uwe Behrmann <ku.b@gmx.de> * @par License: * new BSD <http://www.opensource.org/licenses/BSD-3-Clause> * @since 2004/11/25 */ #include "oyranos.h" /* define HAVE_POSIX */ #include <sys/stat.h> #ifdef HAVE_POSIX #include <unistd.h> #endif #include <stdarg.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "oyProfile_s.h" /* OY_ICC_VERSION_2 */ #include "oyranos_config_internal.h" #include "oyranos_check.h" #include "oyranos_color.h" #include "oyranos_debug.h" #include "oyranos_devices.h" #include "oyranos_helper.h" #include "oyranos_internal.h" #include "oyranos_io.h" #include "oyranos_sentinel.h" #include "oyranos_string.h" #include "oyranos_texts.h" #include "oyranos_xml.h" #ifdef __APPLE__ #include "oyranos_cs.h" #endif /* --- Helpers --- */ #if 1 #define ERR if (rc<=0 && oy_debug) { oyMessageFunc_p(oyMSG_WARN,0,"%s:%d %d\n", __FILE__,__LINE__,rc); perror("Error"); } #else #define ERR #endif #define WARNc_PROFILE_S(text_,fileName_) \ { \ int l_1 = oyStrlen_(text_); \ int l_2 = oyStrlen_(oyNoEmptyName_m_(fileName_)); \ char * tmp = oyAllocateFunc_ (l_1 + l_2 + 12); \ memcpy(tmp, text_, l_1); \ memcpy(&tmp[l_1], " ", 1); \ memcpy(&tmp[l_1+1], oyNoEmptyName_m_(fileName_), l_2); \ tmp[l_1+1+l_2] = 0; \ \ WARNc_S( tmp ); \ oyDeAllocateFunc_(tmp); \ } /* --- static variables --- */ /* --- structs, typedefs, enums --- */ /* --- internal API definition --- */ /* --- function definitions --- */ /* public API implementation */ /* path names API */ /* default profiles API */ int oySetDefaultProfile_ ( oyPROFILE_e type, oySCOPE_e scope, const char * file_name ) { int r = 0; DBG_PROG_START if( type == oyASSUMED_WEB && !strstr( file_name,"sRGB" ) ) { WARNc_S(_("wrong profile for static web color space selected, need sRGB")) return 1; } r = oySetProfile_ (file_name, scope, type, 0); DBG_PROG_ENDE return r; } /*int* oyGroupSetGet (oyGROUP_e group, int * count ) { return 0; }*/ char* oyGetDefaultProfileName_ (oyPROFILE_e type, oyAlloc_f allocate_func) { char* name = 0; DBG_PROG_START DBG_PROG_V( type ) /* a static_profile */ if(type == oyASSUMED_WEB) { name = oyStringCopy_( OY_WEB_RGB, allocate_func ); DBG_PROG_S( name ) return name; } { const oyOption_t_ * t = oyOptionGet_((oyWIDGET_e)type); if( !t || !t->config_string ) { WARNc2_S( "%s %d", _("Option not supported type:"), type) return NULL; } else name = oyGetPersistentString( t->config_string, 0, oySCOPE_USER_SYS, allocate_func ); } #ifdef __APPLE__ if(!(name && name[0])) name = oyGetDefaultProfileNameOSX_( type ); #endif if(name && name[0]) { DBG_PROG_S(name); /* cut off the path part of a file name */ if (oyStrrchr_ (name, OY_SLASH_C)) { char * f = oyStringCopy_( oyStrrchr_ (name, OY_SLASH_C) + 1, allocate_func ); oyFree_m_(name); name = f; } } else { const oyOption_t_ * t = oyOptionGet_((oyWIDGET_e)type); if(t && t->default_string) { name = oyStringCopy_( t->default_string, allocate_func ); } else { if(t && t->id) name = oyStringCopy_( "", allocate_func ); else WARNc2_S( "%s %d", _("Option not supported type:"), type) } } DBG_PROG_ENDE return name; } /* --- internal API decoupling --- */ #include "oyranos.h" /** \addtogroup defaults_apis * @brief Percistently stored user and system preferences - @ref policy - load / save of user policies - @ref options - layout and describe options to the user; part of user policies - @ref behaviour - get and set common behaviour; part of user policies - @ref default_profiles - get and set commonly used profiles; part of user policies - @ref cmm_handling - get and set commonly used CMMs oyProfile_FromStd() and oyProfiles_ForStd() offer default profile selection in a object oriented way. oyConversion_Correct() applies settings from the above default APIs to a given DAG. * @{ *//* defaults_apis */ /** \addtogroup options Options API * @brief The idea behind this API is to provide one layout for * presenting a configuration dialog to users. The advantage is, every * application, like KDE and Gnome control panels, will inherit the same logic. * A user can easily use the one and the other panel * without too much relearning. * To illustrate a bit: * In analogy to the WWW, I suggest to implement something like a minimalistic * HTML display. * Once the HTML alike content logic is done in Oyranos, the HTML page works * and appears everywhere compareable. Smaller changes to the Oyranos HTML * alike pages will appear everywhere in all HTML page display programms. * To remain in the WWW analogy, CSS would be optional to adapt visually. * Functions are provided to set and query for Options layout and * UI strings in Oyranos. * @{ *//* options */ /** @brief all widgets of a group * * @param group specify which group dialog to build * @param[out] count number of widgets contained in list * * @return list of widgets to create in correct order */ oyWIDGET_e * oyWidgetListGet (oyGROUP_e group, int * count, oyAlloc_f allocate_func ) { oyWIDGET_e *list = NULL; DBG_PROG_START oyExportStart_(EXPORT_CHECK_NO); oyTextsCheck_ (); list = oyWidgetListGet_ ( group, count, allocate_func); oyExportEnd_(); DBG_PROG_ENDE return list; } /** @brief Get a special Options UI strings. * * @param option merges oyBEHAVIOUR_e and oyPROFILE_e * @param[out] categories enums list, to place into the right group widget * { n, first category, second c., ... , n'th c. } * for widget of type oyGROUP_e this is empty * @param[out] name transated widget title * @param[out] tooltip transated tooltip * * @return widget type, gives a hint to further properties, * { like choices or int/float value ranges ... } */ oyWIDGET_TYPE_e oyWidgetTitleGet (oyWIDGET_e option, const oyGROUP_e ** categories, const char ** name, const char ** tooltip, int * flags ) { oyWIDGET_TYPE_e type = oyWIDGETTYPE_START; DBG_PROG_START oyExportStart_(EXPORT_CHECK_NO); oyTextsCheck_ (); type = oyWidgetTitleGet_ ( option, categories, name, tooltip, flags ); oyExportEnd_(); DBG_PROG_ENDE return type; } oyWIDGET_TYPE_e oyWidgetDescriptionGet ( oyWIDGET_e option, const char ** description, int choice ) { oyWIDGET_TYPE_e type = oyWIDGETTYPE_START; DBG_PROG_START oyExportStart_(EXPORT_CHECK_NO); oyTextsCheck_ (); type = oyWidgetDescriptionGet_ ( option, 0, description, choice ); oyExportEnd_(); DBG_PROG_ENDE return type; } /** @brief Get a Options choices UI strings. * * This function is checked for double occuring profiles. Such are sorted out. * @todo In the future a second choices_string_list may appear for displaying. * * @param option merge oyBEHAVIOUR_e and oyPROFILE_e * @param[out] choices n choices; if choices is zero then you need to * optain the choices otherwise, like for profiles * @param[out] choices_strings translated list of n choices * @param[out] current the actual setting * * @return error */ int oyOptionChoicesGet (oyWIDGET_e option, int * choices, const char *** choices_string_list, int * current ) { int error = 0; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); oyTextsCheck_ (); error = oyOptionChoicesGet_ ( option, 0, oyNAME_NAME, choices, choices_string_list, current ); oyExportEnd_(); DBG_PROG_ENDE return error; } /** * @brief see oyOptionChoicesGet() * * flags can come from oyICCProfileSelectionFlagsFromRegistration() * and is for oyProfiles_Create() . Possible values for name_type come * from oyNAME_e. * * The flags argument relates to the option arg. * For profile options see oyICCProfileSelectionFlagsFromRegistration(). * The name_type argument can be a ::oyNAME_e . * * @version Oyranos: 0.9.6 * @date 2014/06/13 * @since 2014/04/08 (Oyranos: 0.9.6) */ int oyOptionChoicesGet2 ( oyWIDGET_e option, uint32_t flags, int name_type, int * choices, const char *** choices_string_list, int * current ) { int error = 0; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); oyTextsCheck_ (); error = oyOptionChoicesGet_ ( option, flags, name_type, choices, choices_string_list, current ); oyExportEnd_(); DBG_PROG_ENDE return error; } /** @brief delete list of choices from a option * @param list string list * @param size number of strings in the list to free */ void oyOptionChoicesFree (oyWIDGET_e option, const char *** list, int size) { DBG_PROG_START oyExportStart_(EXPORT_CHECK_NO); oyOptionChoicesFree_ (option, list, size); oyExportEnd_(); DBG_PROG_ENDE } /** @} *//* options */ /** \addtogroup behaviour Behaviour API * @brief Set and query for behaviour on various actions * @todo is the missing description of available choices<br> * Take a look at the Oyranos settings xml file. Options are described <a href="../../../color/settings/office.policy.xml">there</a>. * Otherwise look at the \b oyranos-config-fltk application or the description on * <a href="http://www.oyranos.com/wiki/index.php?title=Oyranos_Use_Cases">ColourWiki</a>. * @{ *//* behaviour */ /** Set a special behaviour. Usual in control panel in Oyranos.\n * * @param type the type of behaviour * @param scope oySCOPE_USER and oySCOPE_SYSTEM are possible * @param choice the selected option * @return error */ int oySetBehaviour ( oyBEHAVIOUR_e type, oySCOPE_e scope, int choice ) { int error = 0; DBG_PROG_START oyExportStart_(EXPORT_SETTING); oyTextsCheck_ (); error = oySetBehaviour_(type, scope, choice); oyExportEnd_(); DBG_PROG_ENDE return error; } /** Get a special behaviour.\n * @todo The options should silently fallback to defaults. * * @param type the type of behaviour * @return the behaviour option (-1 if not available or not set) */ int oyGetBehaviour (oyBEHAVIOUR_e type) { int n = 0; DBG_PROG_START oyExportStart_(EXPORT_SETTING); oyTextsCheck_ (); n = oyGetBehaviour_(type); oyExportEnd_(); DBG_PROG_ENDE return n; } /** @} *//* behaviour */ /** \addtogroup policy Policy API * @brief Set and export policies in Oyranos * * Policies are a set of options used to group color management settings. * * The core API consists of oyReadXMLPolicy() and its reversal oyPolicyToXML(). * * Additional oyPolicySaveActual() is used to store the actual options into a * policy, oyPolicyFileNameGet() to obtain the file name for a given policy * name and oyPolicySet() to import the actual policy from a file. * * For getting the count, names and actual one of the installed policy files * use oyOptionChoicesGet() e.g. * oyOptionChoicesGet( oyWIDGET_POLICY, &count, &names, &current ) * * @par Future: * The policies are abstracted into the backend API oyCMMapi9_s. The * layout of these options can be obtained from the according backends. * The color management policy module for Oyranos is named "oicc". * * @todo define some default policies internally * * @{ *//* policy */ /** @brief save a options group to a file * * The function is basically a wrapper for oyPolicyToXML() and will write * the resulting XML to a file somewhere in XDG_CONFIG_HOME. * * A convenience function. * * @param group use oyGROUP_ALL for a typical snapshot * @param scope supported are: * - oySCOPE_USER for HOME install * - oySCOPE_SYSTEM for system wide install * @param name the name will become part of a filename * @return error * * @version Oyranos: 0.9.6 * @date 2015/02/13 * @since 2008/07/23 (Oyranos: 0.1.8) */ int oyPolicySaveActual ( oyGROUP_e group, oySCOPE_e scope, const char * name ) { int error = !name; char * text = 0; char * filename = 0; const char * xdg_home_dir = getenv("XDG_CONFIG_HOME"); char * path = 0, * ptr; DBG_PROG_START oyExportStart_(EXPORT_SETTING); oyTextsCheck_ (); if(!error) { text = oyPolicyToXML_(group, 1, oyAllocateFunc_); error = !text; } if(!error) { if(scope == oySCOPE_USER) { if(xdg_home_dir) { path = oyStringCopy_( xdg_home_dir, oyAllocateFunc_ ); ptr = oyStrchr_( path, ':' ); if(ptr) *ptr = '\000'; oyStringAdd_( &filename, path, oyAllocateFunc_, oyDeAllocateFunc_ ); } else oyStringAdd_( &filename, "~/.config", oyAllocateFunc_, oyDeAllocateFunc_ ); oyStringAdd_( &filename, "/color/settings/", oyAllocateFunc_, oyDeAllocateFunc_ ); oyStringAdd_( &filename, name, oyAllocateFunc_, oyDeAllocateFunc_ ); oyStringAdd_( &filename, ".xml", oyAllocateFunc_, oyDeAllocateFunc_ ); } else if(scope == oySCOPE_SYSTEM) { char * path = oyGetInstallPath( oyPATH_POLICY, scope, oyAllocateFunc_ ); oyStringAddPrintf( &filename, oyAllocateFunc_, oyDeAllocateFunc_, "%s/%s.xml", path, name ); } else { WARNc1_S( "scope not supported: %d", scope ); error = 1; } if(oyIsFile_(filename)) WARNc2_S("%s %s",_("will overwrite policy file"), filename); if(!error) error = oyWriteMemToFile_( filename, text, oyStrlen_(text)+1 ); } oyExportEnd_(); DBG_PROG_ENDE return error; } /** Save a group of policy settings.\n * Write only such variables, which are available and ignore unknown ones. * This currently produces pseudo xml configuration files. * * @param group the policy group * @param add_header add description * @param allocate_func user provided function for allocating the strings memory * @return the configuration as XML to save to file */ char * oyPolicyToXML (oyGROUP_e group, int add_header, oyAlloc_f allocate_func) { char* text = 0; DBG_PROG_START oyExportStart_(EXPORT_SETTING); oyTextsCheck_ (); text = oyPolicyToXML_(group, add_header, allocate_func); oyExportEnd_(); DBG_PROG_ENDE return text; } /** Load a group of policy settings.\n * use xml-ish input produced by oyPolicyToXML() * * @param group the policy group * @param xml xml configuration string * @return errors */ int oyReadXMLPolicy (oyGROUP_e group, const char *xml) { int n = 0; DBG_PROG_START oyExportStart_(EXPORT_SETTING); oyTextsCheck_ (); n = oyReadXMLPolicy_(group, xml); oyExportEnd_(); DBG_PROG_ENDE return n; } /** Function oyPolicyFileNameGet * @brief resolve the file name of a policy * * The resolving is done by weak string matching. So it is possible to use * short hands, e.g. "Photo" for "Photographer". The first letter is ignored. * A convenience function. * * @param[in] policy_name the selected policy * @param[out] full_name the full file name of policy_name * @param[in] allocateFunc optional user allocator * @return error * * @version Oyranos: 0.1.10 * @since 2010/02/28 (Oyranos: 0.1.10) * @date 2010/02/28 */ int oyPolicyFileNameGet ( const char * policy_name, char ** full_name, oyAlloc_f allocateFunc ) { int error = 0; DBG_PROG_START oyExportStart_(EXPORT_SETTING); oyTextsCheck_ (); error = oyPolicyFileNameGet_( policy_name, full_name, allocateFunc ? allocateFunc : oyAllocateFunc_ ); oyExportEnd_(); DBG_PROG_ENDE return error; } /** Load a group of policy settings.\n * use xml-ish file input produced by oyPolicyToXML() * * A convenience function. * * @param policy_file the policy file, will be locked up in standard paths * @param full_name file name including path * @return errors */ int oyPolicySet (const char * policy_file, const char * full_name ) { int n = 0; DBG_PROG_START oyExportStart_(EXPORT_SETTING); oyTextsCheck_ (); n = oyPolicySet_(policy_file, full_name); oyExportEnd_(); DBG_PROG_ENDE return n; } /** @} *//* policy */ /** \addtogroup default_profiles Default Profiles * @brief Configure default profiles * @see @ref path_names * @{ *//* default_profiles */ /** Sets a profile, which is available in the current configured path. * * @param type the kind of default profile * @param file_name the profile which shall become the default for the above * specified profile type * @return success */ int oySetDefaultProfile ( oyPROFILE_e type, oySCOPE_e scope, const char * file_name ) { int n = 0; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); oyTextsCheck_ (); n = oySetDefaultProfile_ (type, scope, file_name); oyExportEnd_(); DBG_PROG_ENDE return n; } /** Gets a default profile filename. * * @param type the kind of default profile * @param allocate_func the allocation function needed to reserve memory for the filename string * @return filename */ char * oyGetDefaultProfileName ( oyPROFILE_e type, oyAlloc_f allocate_func) { char* name = NULL; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); oyTextsCheck_ (); name = oyGetDefaultProfileName_ (type, allocate_func); oyExportEnd_(); DBG_PROG_ENDE return name; } /** * @brief set the CIE*XYZ coordinates for display white point target * * The function sets a custom white point target for the display. Note this * setting will only be active when ::OY_DEFAULT_DISPLAY_WHITE_POINT is set * to 1 - automatic. * * @param[out] ICC_XYZ ICC*XYZ trio in 0.0 - 2.0 range * @param[in] scope supported are: * - oySCOPE_USER for HOME install * - oySCOPE_SYSTEM for system wide install * @param[in] comment string * * @version Oyranos: 0.9.7 * @date 2018/03/01 * @since 2017/06/01 (Oyranos: 0.9.7) */ int oySetDisplayWhitePoint ( double * XYZ, oySCOPE_e scope, const char * comment ) { int r = 1; char * value = NULL; if(XYZ[0] != 0.0 || XYZ[1] != 0.0 || XYZ[1] != 0.0) { oyStringAddPrintfC( &value, 0,0, "%g", XYZ[0] ); r = oySetPersistentString( OY_DEFAULT_DISPLAY_WHITE_POINT_X, scope, value, comment ); oyFree_m_( value ); oyStringAddPrintfC( &value, 0,0, "%g", XYZ[1] ); r = oySetPersistentString( OY_DEFAULT_DISPLAY_WHITE_POINT_Y, scope, value, comment ); oyFree_m_( value ); oyStringAddPrintfC( &value, 0,0, "%g", XYZ[2] ); r = oySetPersistentString( OY_DEFAULT_DISPLAY_WHITE_POINT_Z, scope, value, comment ); oyFree_m_( value ); } return r; } /** @} *//* default_profiles */ /** @} *//* defaults_apis */ /** \addtogroup objects_profile * @{ *//* objects_profile */ /** * @brief get Search Path names for ICC Profiles * * @see path_names * * @version Oyranos: 0.9.6 * @date 2015/02/08 * @since 2015/02/08 (Oyranos: 0.9.6) */ char ** oyProfilePathsGet ( int * size, oyAlloc_f allocateFunc ) { return oyProfilePathsGet_(size, allocateFunc); } /** \addtogroup profile_lists Profile Lists API * @brief Fast profile name lists * @see @ref path_names * @{ *//* profile_lists */ /** @brief get a list of profile filenames * @param colorsig filter as ICC 4 byte string * @param[out] size profile filenames count * @return the profiles filename list allocated within Oyranos * * @see @ref path_names */ char ** oyProfileListGet ( const char * colorsig, uint32_t * size, oyAlloc_f allocateFunc ) { char **names = NULL, ** tmp = 0; uint32_t n = 0; int tmp_n = 0; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); oyTextsCheck_ (); if(!allocateFunc) allocateFunc = oyAllocateFunc_; tmp = oyProfileListGet_(colorsig, 0, &n); names = oyStringListAppend_( (const char**)tmp, n, 0,0, &tmp_n, allocateFunc ); oyStringListRelease_( &tmp, n, oyDeAllocateFunc_ ); *size = tmp_n; oyExportEnd_(); DBG_PROG_ENDE return names; } /** @} *//* profile_lists */ /** \addtogroup profile_handling Profile Handling API * @brief Basic profile helpers * @{ *//* profile_handling */ /** @brief check an file if it is a profile * * @param filename the filename to check * @param colorsig color space signature as described in the <a href="http://www.color.org">ICC specification</a> * @return true/false */ int oyCheckProfile (const char* filename, const char* colorsig) { int n = 0; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); oyTextsCheck_ (); /* colorsig is currently ignored */ n = oyCheckProfile_ (filename, colorsig, 0); oyExportEnd_(); DBG_PROG_ENDE return n; } /** @brief check an memory block if it is a profile * * @param mem the memory containing the profile * @param size the size of the memory block * @param colorsig currently ignored * @return true/false */ int oyCheckProfileMem (const void* mem, size_t size, const char* colorsig) { int n = 0; DBG_PROG_START oyExportStart_(EXPORT_CHECK_NO); oyTextsCheck_ (); /* colorsig is currently ignored */ n = oyCheckProfileMem_ (mem, size, colorsig, 0); oyExportEnd_(); DBG_PROG_ENDE return n; } /** @brief get the profiles size * * @param profilename specifies the profile * @return size */ size_t oyGetProfileSize ( const char * profilename ) { size_t size = 0; char * fullFileName = NULL; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); fullFileName = oyFindProfile_( profilename, 0 ); if(fullFileName) { size = oyGetProfileSize_( fullFileName ); oyFree_m_( fullFileName ); } oyExportEnd_(); DBG_PROG_ENDE return size; } /** @brief obtain an memory block in the responsibility of the user * * Please note the size parameter is sensible. Eighter set it to zero or to * the size obtained with oyGetProfileSize to get the full data or * specify the size you want to get a partitial profile. \n * This feature is useful for instance to get only the headers of many profiles. * * @param profilename specifies the profile * @param[in] size desired size, or zero for a complete copy @param[out] size the size of the returned block * @param allocate_func the users memory allocation function * @return the profile block in memory allocated by oyAlloc_f */ void * oyGetProfileBlock ( const char * profilename, size_t * size, oyAlloc_f allocate_func) { char * block = NULL; char * fullFileName = NULL; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); fullFileName = oyFindProfile_( profilename, 0 ); if(fullFileName) { block = oyGetProfileBlock_ (fullFileName, size, allocate_func); oyFree_m_( fullFileName ); } DBG_PROG3_S( "%s %hd %d", profilename, (int)(intptr_t)block, (int)(intptr_t)*size) DBG_PROG oyExportEnd_(); DBG_PROG_ENDE return block; } #if 1 /** Find out where in the Oyranos search path the specified profile resides. * * @deprecated This function will be substituded by oyProfile_GetFileName. * * @param profile_name the filename find in the Oyranos search path * @param allocate_func user provided function for allocating the string memory * @return the path name where the profile was found in the Oyranos search path */ char* oyGetPathFromProfileName (const char* profile_name, oyAlloc_f allocate_func) { char* path_name = NULL; int flags = 0; DBG_PROG_START oyExportStart_(EXPORT_PATH | EXPORT_SETTING); path_name = oyGetPathFromProfileName_ (profile_name, flags, allocate_func); oyExportEnd_(); DBG_PROG_ENDE return path_name; } #endif /** @brief calculate a md5 digest beginning after the header offset * * The md5 implementation is written by L. Peter Deutsch * * @param[in] buffer complete profiles buffer * @param[in] size over all profile size * @param[out] md5_return buffer to write in the md5 digest (128 bytes) * @return -1 wrong profile_id detected, 0 - good, 1 - error * * @return error */ int oyProfileGetMD5 ( void *buffer, size_t size, unsigned char *md5_return ) { int error = 0; DBG_PROG_START oyExportStart_(EXPORT_CHECK_NO); error = oyProfileGetMD5_(buffer, size, md5_return); oyExportEnd_(); DBG_PROG_ENDE return error; } /** @} *//* profile_handling */ /** @} *//* objects_profile */ /** \addtogroup misc Miscellaneous * @brief Miscellaneous stuff * @{ *//* misc */ /** \addtogroup i18n * @{ *//* i18n */ /** @brief switch internationalisation of strings on or off * * @param active bool * @param reserved for future use */ void oyI18NSet ( int active, int reserved ) { DBG_PROG_START oyInit_(); oyI18NSet_(active, reserved); oyExportEnd_(); DBG_PROG_ENDE } /** @} *//* i18n */ /** \addtogroup path_names * @{ *//* i18n */ /** * @brief get Path Name for Installation * * Note: Not all combinations return a path name. Some make no sense. * So be careful and test the result. The returned paths are absolute. * * ::oyPATH_MODULE + ::oySCOPE_USER and ::oyPATH_MODULE + ::oySCOPE_OYRANOS are * supported. ::oyPATH_SCRIPT gives no result at all. * * @version Oyranos: 0.9.6 * @date 2016/03/16 * @since 2015/02/08 (Oyranos: 0.9.6) */ char * oyGetInstallPath ( oyPATH_TYPE_e type, oySCOPE_e scope, oyAlloc_f allocFunc ) { char * path = NULL, * full_name = NULL; #define F(p) full_name = oyResolveDirFileName_( p ); switch (type) { case oyPATH_ICC: switch((int)scope) { case oySCOPE_USER: F( OS_ICC_USER_DIR ); break; case oySCOPE_SYSTEM: F( OS_ICC_SYSTEM_DIR ) ; break; case oySCOPE_OYRANOS: F( OY_SYSCOLORDIR OY_SLASH OY_ICCDIRNAME ); break; case oySCOPE_MACHINE: F( OS_ICC_MACHINE_DIR ); break; default: path = NULL; } break; case oyPATH_POLICY: { switch((int)scope) { case oySCOPE_USER: F( OS_SETTINGS_USER_DIR ); break; case oySCOPE_SYSTEM: F( OS_SETTINGS_SYSTEM_DIR ); break; case oySCOPE_OYRANOS: F( OY_SYSCOLORDIR OY_SLASH OY_SETTINGSDIRNAME); break; case oySCOPE_MACHINE: F( OS_SETTINGS_MACHINE_DIR ); break; } break; } case oyPATH_MODULE: { switch((int)scope) { case oySCOPE_USER: { char * t = NULL; oyStringAddPrintf( &t, oyAllocateFunc_, oyDeAllocateFunc_, "~/.local/lib%s/" OY_CMMSUBPATH, strstr(OY_LIBDIR, "lib64") ? "64":""); F( t ); oyFree_m_(t); break; } case oySCOPE_OYRANOS: F( OY_CMMDIR ); break; default: path = NULL; } break; } case oyPATH_CACHE: { switch((int)scope) { case oySCOPE_USER: F( OS_DL_CACHE_USER_DIR ); break; case oySCOPE_SYSTEM: F( OS_DL_CACHE_SYSTEM_DIR ); break; default: path = NULL; } break; } default: path = NULL; } if(full_name) { if(allocFunc) { path = oyStringCopy( full_name, allocFunc ); oyFree_m_( full_name ); } else path = full_name; } return path; } /** @} *//* i18n */ /** @} *//* misc */
27.695958
134
0.587347
[ "object" ]
9651985a4beb176d40abe7e48473a8dc4d9c073e
2,987
h
C
target/COMPONENT_WCM/wifi_cert_sigma.h
HectorTa1989/WFA-Wi-Fi-Cert-middleware
cd7db43f805df80c553e42976253afb049f918bb
[ "MIT" ]
null
null
null
target/COMPONENT_WCM/wifi_cert_sigma.h
HectorTa1989/WFA-Wi-Fi-Cert-middleware
cd7db43f805df80c553e42976253afb049f918bb
[ "MIT" ]
null
null
null
target/COMPONENT_WCM/wifi_cert_sigma.h
HectorTa1989/WFA-Wi-Fi-Cert-middleware
cd7db43f805df80c553e42976253afb049f918bb
[ "MIT" ]
null
null
null
#include "wifi_cert_commands.h" #ifndef WIFICERT_NO_HARDWARE #include "task.h" #endif #define GET_TARGET_NAME_STR(tgt_name) #tgt_name #define GET_TARGET_NAME(tgt_name) GET_TARGET_NAME_STR(tgt_name) #define MODEL GET_TARGET_NAME(TARGET_NAME) #define GET_BUILD_TIME(str) #str #define GET_BUILD_TIME_STRING(str) GET_BUILD_TIME(str) #define BUILD_TIME_STAMP_VALUE GET_BUILD_TIME_STRING(BUILD_TIME_STAMP) #define PLATFORM MODEL #define PLATFORM_VERSION "1" #define FREERTOS_VERSION tskKERNEL_VERSION_NUMBER #define PRIO_OFFSET_BETWEEN_AC 1 /* All TX thread priority will be atleast this much lower than RX thread */ #define PRIO_LOW_THRESH 4 #define PRIO_HIGH_THRESH 1 #define FREERTOS_RTOS_TX_ADJUSTMENT 1 #define FREERTOS_RTOS_RX_ADJUSTMENT 3 #define TRAFFIC_AGENT_SOCKET_TIMEOUT 1 #define PRIO_RX_HIGH_THRESH 0 #define SINGLE_STREAM_PRIO_BOOST_OF_RX_THREAD_WRT_TX 1 #define PRIO_BOOST_OF_RX_THREAD_WRT_TX 1 #define PRIORITY_TO_NATIVE_PRIORITY(priority) (CY_RTOS_PRIORITY_HIGH - (priority )) #define TRAFFIC_END_OF_THREAD( thread ) cy_rtos_exit_thread() /** Sigma Certification Commands * Class that represents a Sigma DUT Agent * Common inteface to external test agent (UCC) and * interface to host MBED Stack and WLAN Chip */ typedef struct sigmadut { cy_mutex_t sigmadut_mutex;/* data protection mutex */ wifi_cert_time_t time; /* Current Date and time set to 0 */ char _interface[16]; /* = TEST_INTERFACE */ char _passphrase[64]; /* = TEST_PASSPHRASE_DEFAULT; */ uint8_t _wepkey_buffer[64];/* = HEX values of WEP */ char _sectype[16]; /* = TEST_SECTYPE_DEFAULT; */ char _encptype[16]; /* = TEST_ENCPTYPE_DEFAULT; */ char _keymgmttype[16]; /* = TEST_KEYMGMTTYPE_DEFAULT; */ char _pmf[32]; /* = TEST_PMF_DEFAULT; */ char _ssid[33]; /* = TEST_SSID_DEFAULT; */ char _bssid[18]; /* = TEST_BSSID_DEFAULT; */ char _channel[4]; /* = TEST_CHANNEL_DEFAULT; */ char _using_dhcp[4]; /* = TEST_USING_DHCP_DEFAULT; */ char dut_ip_addr[16]; /* = DUT_IP_ADDR_DEFAULT; */ char dut_netmask[16]; /* = DUT_NETMASK_DEFAULT; */ char dut_gateway[16]; /* = DUT_GATEWAY_DEFAULT; */ char dut_primary_dns[16]; /* = DUT_PRIMARY_DNS_DEFAULT; */ char dut_secondary_dns[16]; /* = DUT_SECONDARY_DNS_DEFAULT; */ char username[32]; /* USER_NAME for WPA-ENT */ char password[64]; /* password for PEAP */ char clientcert[32]; /* Client Certificate name */ char trustedrootcrt[32]; /* Trusted Root CA name*/ char innereap[32]; /* Inner EAP type */ char peapver[32]; /* PEAP Version */ void *enterprise_sec_handle;/* Enterprise security handle */ wpa2_ent_eap_type_t ent_eap_type; /* Type of EAP */ wiced_wep_key_t wepkey; /* WEP encryption key */ traffic_stream_t stream_table[NUM_STREAM_TABLE_ENTRIES]; }sigmadut_t; cy_mutex_t *sigmadut_get_mutex_instance (void ); void sigmadut_init ( void );
43.289855
83
0.719786
[ "model" ]
965209a1108d32061f021a9da38c8436cde276df
10,837
h
C
ScreenCopy/PresetsDlg.h
wjongman/ScreenCopy
4420078c501d93d48193a019dce07613ecbd4da9
[ "MIT" ]
null
null
null
ScreenCopy/PresetsDlg.h
wjongman/ScreenCopy
4420078c501d93d48193a019dce07613ecbd4da9
[ "MIT" ]
null
null
null
ScreenCopy/PresetsDlg.h
wjongman/ScreenCopy
4420078c501d93d48193a019dce07613ecbd4da9
[ "MIT" ]
null
null
null
#pragma once #include "PresetsListCtl.h" //////////////////////////////////////////////////////////////////////////////// /// /// Dialog for adding and editing a grabber-preset /// class CEditPresetDlg : public CDialogImpl<CEditPresetDlg> { CEdit m_nameEdit; CButton m_okButton; std::wstring m_title = L"Edit Preset"; GrabberPreset m_preset; public: enum { IDD = IDD_EDITPRESETDLG }; BEGIN_MSG_MAP(CEditPresetDlg) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) COMMAND_ID_HANDLER(IDOK, OnOk) COMMAND_ID_HANDLER(IDCANCEL, OnCancel) COMMAND_HANDLER(IDC_PRESET_NAME, EN_CHANGE, OnNameEditChange) END_MSG_MAP() //--------------------------------------------------------------------------- CEditPresetDlg() = default; //--------------------------------------------------------------------------- CEditPresetDlg(GrabberPreset const& preset) { m_preset = preset; } //--------------------------------------------------------------------------- void SetCaption(std::wstring const& title) { m_title = title; } //--------------------------------------------------------------------------- void SetPreset(GrabberPreset preset) { m_preset = preset; } //--------------------------------------------------------------------------- GrabberPreset GetPreset() { return m_preset; } private: //--------------------------------------------------------------------------- LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { m_nameEdit.Attach(GetDlgItem(IDC_PRESET_NAME)); m_okButton.Attach(GetDlgItem(IDOK)); SetWindowText(m_title.c_str()); CenterWindow(GetParent()); ::SetWindowText(GetDlgItem(IDC_PRESET_NAME), m_preset.description.c_str()); ::SetWindowText(GetDlgItem(IDC_PRESET_X), std::to_wstring(m_preset.rect.left).c_str()); ::SetWindowText(GetDlgItem(IDC_PRESET_Y), std::to_wstring(m_preset.rect.top).c_str()); ::SetWindowText(GetDlgItem(IDC_PRESET_W), std::to_wstring(m_preset.rect.Width()).c_str()); ::SetWindowText(GetDlgItem(IDC_PRESET_H), std::to_wstring(m_preset.rect.Height()).c_str()); bool empty = (m_nameEdit.GetWindowTextLength() == 0); m_okButton.EnableWindow(!empty); return TRUE; } //------------------------------------------------------------------------- LRESULT OnNameEditChange(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { bool empty = (m_nameEdit.GetWindowTextLength() == 0); m_okButton.EnableWindow(!empty); return 0; } //--------------------------------------------------------------------------- LRESULT OnOk(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { std::vector<wchar_t> buffer(m_nameEdit.GetWindowTextLength() + 1); m_nameEdit.GetWindowText(buffer.data(), buffer.size()); m_preset.description = buffer.data(); int x = GetDlgItemInt(IDC_PRESET_X); int y = GetDlgItemInt(IDC_PRESET_Y); int w = GetDlgItemInt(IDC_PRESET_W); int h = GetDlgItemInt(IDC_PRESET_H); m_preset.rect = { x, y, x + w, y + h }; EndDialog(wID); return 0; } //--------------------------------------------------------------------------- LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { EndDialog(wID); return 0; } }; //////////////////////////////////////////////////////////////////////////////// /// /// Dialog for managing grabber-presets /// class CManagePresetsDlg : public CDialogImpl<CManagePresetsDlg> { CPresetsListCtrl m_listView; // We use m_presetsList as the underlying container, all // operations in the listview will be carried out on this // container, from which the listview is then repopulated. PresetsList m_presetsList; public: enum { IDD = IDD_MANAGEPRESETSDLG }; BEGIN_MSG_MAP(CManagePresetsDlg) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) COMMAND_ID_HANDLER(IDC_PRESET_ADD, OnAdd) COMMAND_ID_HANDLER(IDC_PRESET_EDIT, OnEdit) COMMAND_ID_HANDLER(IDC_PRESET_DELETE, OnDelete) COMMAND_ID_HANDLER(IDC_PRESET_MOVEUP, OnMoveUp) COMMAND_ID_HANDLER(IDC_PRESET_MOVEDOWN, OnMoveDown) COMMAND_ID_HANDLER(IDOK, OnOk) COMMAND_ID_HANDLER(IDCANCEL, OnCancel) NOTIFY_HANDLER(IDC_LISTVIEW, LVN_ITEMCHANGED, OnListSelChange) NOTIFY_HANDLER(IDC_LISTVIEW, NM_DBLCLK, OnListItemDblClick) END_MSG_MAP() //--------------------------------------------------------------------------- CManagePresetsDlg(PresetsList const& presetsList) { m_presetsList = presetsList; } //--------------------------------------------------------------------------- PresetsList GetPresets() { return m_presetsList; } //--------------------------------------------------------------------------- void AddPreset(GrabberPreset preset) { CEditPresetDlg dlg; dlg.SetCaption(L"Add Preset"); if (dlg.DoModal() == IDOK) { m_presetsList.push_back(dlg.GetPreset()); m_listView.Populate(m_presetsList); } } private: //--------------------------------------------------------------------------- LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { CenterWindow(GetParent()); m_listView.Attach(GetDlgItem(IDC_LISTVIEW)); ::EnableWindow(GetDlgItem(IDC_PRESET_EDIT), false); ::EnableWindow(GetDlgItem(IDC_PRESET_DELETE), false); m_listView.Populate(m_presetsList); m_listView.SelectItem(0); return TRUE; } //--------------------------------------------------------------------------- LRESULT OnAdd(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { CEditPresetDlg dlg; dlg.SetCaption(L"Add Preset"); if (dlg.DoModal() == IDOK) { m_presetsList.push_back(dlg.GetPreset()); m_listView.Populate(m_presetsList); m_listView.SelectItem(m_presetsList.size() - 1); } return 0; } //--------------------------------------------------------------------------- LRESULT OnEdit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { int selIndex = m_listView.GetSelectedIndex(); if (selIndex != -1) { GrabberPreset preset = m_presetsList[selIndex]; CEditPresetDlg dlg; dlg.SetPreset(preset); dlg.SetCaption(L"Edit Preset"); if (dlg.DoModal() == IDOK) { m_presetsList[selIndex] = dlg.GetPreset(); m_listView.Populate(m_presetsList); m_listView.SelectItem(selIndex); } } return 0; } //--------------------------------------------------------------------------- LRESULT OnDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { size_t selIndex = m_listView.GetSelectedIndex(); if (selIndex != -1) { m_presetsList.erase(m_presetsList.begin() + selIndex); m_listView.Populate(m_presetsList); if (m_presetsList.size() > 0 && selIndex < m_presetsList.size()) { m_listView.SelectItem(selIndex); } else { BOOL handled = false; OnListSelChange(0, 0, handled); } } return 0; } //--------------------------------------------------------------------------- LRESULT OnMoveUp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { int selIndex = m_listView.GetSelectedIndex(); if (selIndex > 0) { MovePresetItem(selIndex, selIndex - 1); m_listView.Populate(m_presetsList); m_listView.SelectItem(selIndex - 1); } m_listView.SetFocus(); return 0; } //--------------------------------------------------------------------------- LRESULT OnMoveDown(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { int selIndex = m_listView.GetSelectedIndex(); if (selIndex < m_listView.GetItemCount() - 1) { MovePresetItem(selIndex, selIndex + 1); m_listView.Populate(m_presetsList); m_listView.SelectItem(selIndex + 1); } m_listView.SetFocus(); return 0; } //--------------------------------------------------------------------------- void MovePresetItem(size_t from, size_t to) { if (to > m_presetsList.size()) to = m_presetsList.size(); GrabberPreset tmp = m_presetsList[from]; m_presetsList.erase(m_presetsList.begin() + from); m_presetsList.insert(m_presetsList.begin() + to, tmp); } //--------------------------------------------------------------------------- LRESULT OnOk(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { EndDialog(wID); return 0; } //--------------------------------------------------------------------------- LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { EndDialog(wID); return 0; } //------------------------------------------------------------------------- LRESULT OnListSelChange(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) { int selIndex = m_listView.GetSelectedIndex(); bool canEdit = selIndex != -1 && !m_presetsList.empty(); ::EnableWindow(GetDlgItem(IDC_PRESET_EDIT), canEdit); ::EnableWindow(GetDlgItem(IDC_PRESET_DELETE), canEdit); bool canMoveUp = selIndex != -1 && selIndex > 0; ::EnableWindow(GetDlgItem(IDC_PRESET_MOVEUP), canMoveUp); bool canMoveDown = selIndex != -1 && selIndex < m_listView.GetItemCount() - 1; ::EnableWindow(GetDlgItem(IDC_PRESET_MOVEDOWN), canMoveDown); return 0; } //------------------------------------------------------------------------- LRESULT OnListItemDblClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { // auto lpnmitem = reinterpret_cast<LPNMITEMACTIVATE>(pnmh); size_t selIndex = m_listView.GetSelectedIndex(); // Close dialog and select preset EndDialog(ID_PRESET_FIRST + selIndex); return 0; } };
34.733974
99
0.496171
[ "vector" ]
96582608bd093342cf6a8c286dd461be2c5d8c66
3,079
h
C
common/WhirlyGlobeLib/include/ParticleSystemDrawableGLES.h
akovalov/WhirlyGlobe
09f3e7447ce8c049dedfb92550ff649ad1895bb7
[ "Apache-2.0" ]
null
null
null
common/WhirlyGlobeLib/include/ParticleSystemDrawableGLES.h
akovalov/WhirlyGlobe
09f3e7447ce8c049dedfb92550ff649ad1895bb7
[ "Apache-2.0" ]
null
null
null
common/WhirlyGlobeLib/include/ParticleSystemDrawableGLES.h
akovalov/WhirlyGlobe
09f3e7447ce8c049dedfb92550ff649ad1895bb7
[ "Apache-2.0" ]
null
null
null
/* * ParticleSystemDrawableGLES.h * WhirlyGlobeLib * * Created by Steve Gifford on 4/28/15. * Copyright 2011-2022 mousebird consulting * * 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. * */ #import "ParticleSystemDrawable.h" #import "ProgramGLES.h" #import "WrapperGLES.h" #import "BasicDrawableGLES.h" #import "VertexAttributeGLES.h" namespace WhirlyKit { // Shader name //#define kParticleSystemShaderName "Default Part Sys (Point)" // Build the particle system default shader ProgramGLES *BuildParticleSystemProgramGLES(const std::string &name,SceneRenderer *renderer); // Maximum size of particle buffers (8MB) #define kMaxParticleMemory (8*1024*1024) /// OpenGL ES version of the particle system drawable class ParticleSystemDrawableGLES : virtual public ParticleSystemDrawable, virtual public DrawableGLES { friend class ParticleSystemDrawableBuilderGLES; public: ParticleSystemDrawableGLES(const std::string &name); virtual ~ParticleSystemDrawableGLES(); /// Add the vertex data (all of it) at once void addAttributeData(const RenderSetupInfo *setupInfo,const std::vector<AttributeData> &attrData,const Batch &batch) override; /// Create our buffers in GL virtual void setupForRenderer(const RenderSetupInfo *,Scene *scene) override; /// Destroy GL buffers virtual void teardownForRenderer(const RenderSetupInfo *setupInfo,Scene *scene,RenderTeardownInfoRef teardown) override; /// Particles can calculate their positions void calculate(RendererFrameInfoGLES *frameInfo,Scene *scene) override; /// Called on the rendering thread to draw void draw(RendererFrameInfoGLES *frameInfo,Scene *scene) override; protected: std::vector<SingleVertexAttributeInfoGLES> vertAttrs; std::vector<SingleVertexAttributeInfoGLES> varyAttrs; class VaryBufferPair { public: GLuint buffers[2]; }; std::vector<VaryBufferPair> varyBuffers; std::vector<SimpleIdentity> varyNames; GLuint pointBuffer,rectBuffer; void drawSetupTextures(RendererFrameInfo *frameInfo,Scene *scene,ProgramGLES *prog,bool hasTexture[],int &progTexBound); void drawTeardownTextures(RendererFrameInfo *frameInfo,Scene *scene,ProgramGLES *prog,bool hasTexture[],int progTexBound); void drawSetupUniforms(RendererFrameInfo *frameInfo,Scene *scene,ProgramGLES *prog); void drawBindAttrs(RendererFrameInfo *frameInfo,Scene *scene,ProgramGLES *prog,const BufferChunk &chunk,int pointsSoFar,bool useInstancingHere); void drawUnbindAttrs(ProgramGLES *prog); }; }
37.096386
148
0.763235
[ "vector" ]
966063e149cbd8621d11bc3266b358f1e4373399
958
h
C
contrib/depends/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/EventKit.framework/Versions/A/Headers/EKObject.h
Amity-Network/amity
3e57379f01af4ca851079c8e469fbda7c8165b47
[ "MIT" ]
416
2016-08-20T03:40:59.000Z
2022-03-30T14:27:47.000Z
contrib/depends/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/EventKit.framework/Versions/A/Headers/EKObject.h
Amity-Network/amity
3e57379f01af4ca851079c8e469fbda7c8165b47
[ "MIT" ]
41
2016-08-22T14:41:42.000Z
2022-02-25T11:38:16.000Z
contrib/depends/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/EventKit.framework/Versions/A/Headers/EKObject.h
Amity-Network/amity
3e57379f01af4ca851079c8e469fbda7c8165b47
[ "MIT" ]
173
2016-08-28T15:09:18.000Z
2022-03-23T15:42:52.000Z
// // EKObject.h // EventKit // // Copyright 2011 Apple Inc. All rights reserved. // #import <Foundation/Foundation.h> @interface EKObject : NSObject // Returns YES if this object or any sub-object (alarm, etc.) has uncommitted changes. @property (nonatomic, readonly) BOOL hasChanges; // Returns YES if this object has never been saved. #if defined(__cplusplus) - (BOOL)isNew; #else @property (nonatomic, readonly, getter=isNew) BOOL new; #endif // If this object is not new, this method will unload all loaded properties and clear any dirty state - (void)reset; // If this object is not new, this method will unload dirty state only. - (void)rollback; // Determines if the object is still valid (i.e. it still exists in the database), and unloads all // properties that have not been modified. If this ever returns NO, it indicates the record was deleted // and this instance should be discarded and no longer referenced. - (BOOL)refresh; @end
27.371429
103
0.740084
[ "object" ]
96615a2d56f5d8d27cebba2aceacd1cb8e1ccb67
39,991
h
C
contrib/gnu/gdb/dist/sim/mips/sim-main.h
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
3
2021-05-04T17:09:06.000Z
2021-10-04T07:19:26.000Z
contrib/gnu/gdb/dist/sim/mips/sim-main.h
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
contrib/gnu/gdb/dist/sim/mips/sim-main.h
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
/* MIPS Simulator definition. Copyright (C) 1997-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of the MIPS sim. 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 3 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, see <http://www.gnu.org/licenses/>. */ #ifndef SIM_MAIN_H #define SIM_MAIN_H /* MIPS uses an unusual format for floating point quiet NaNs. */ #define SIM_QUIET_NAN_NEGATED #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ mips_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR)) #include "sim-basics.h" #include "sim-base.h" #include "bfd.h" /* Deprecated macros and types for manipulating 64bit values. Use ../common/sim-bits.h and ../common/sim-endian.h macros instead. */ typedef signed64 word64; typedef unsigned64 uword64; #define WORD64LO(t) (unsigned int)((t)&0xFFFFFFFF) #define WORD64HI(t) (unsigned int)(((uword64)(t))>>32) #define SET64LO(t) (((uword64)(t))&0xFFFFFFFF) #define SET64HI(t) (((uword64)(t))<<32) #define WORD64(h,l) ((word64)((SET64HI(h)|SET64LO(l)))) #define UWORD64(h,l) (SET64HI(h)|SET64LO(l)) /* Check if a value will fit within a halfword: */ #define NOTHALFWORDVALUE(v) ((((((uword64)(v)>>16) == 0) && !((v) & ((unsigned)1 << 15))) || (((((uword64)(v)>>32) == 0xFFFFFFFF) && ((((uword64)(v)>>16) & 0xFFFF) == 0xFFFF)) && ((v) & ((unsigned)1 << 15)))) ? (1 == 0) : (1 == 1)) typedef enum { cp0_dmfc0, cp0_dmtc0, cp0_mfc0, cp0_mtc0, cp0_tlbr, cp0_tlbwi, cp0_tlbwr, cp0_tlbp, cp0_cache, cp0_eret, cp0_deret, cp0_rfe } CP0_operation; /* Floating-point operations: */ #include "sim-fpu.h" #include "cp1.h" /* FPU registers must be one of the following types. All other values are reserved (and undefined). */ typedef enum { fmt_single = 0, fmt_double = 1, fmt_word = 4, fmt_long = 5, fmt_ps = 6, /* The following are well outside the normal acceptable format range, and are used in the register status vector. */ fmt_unknown = 0x10000000, fmt_uninterpreted = 0x20000000, fmt_uninterpreted_32 = 0x40000000, fmt_uninterpreted_64 = 0x80000000U, } FP_formats; /* For paired word (pw) operations, the opcode representation is fmt_word, but register transfers (StoreFPR, ValueFPR, etc.) are done as fmt_long. */ #define fmt_pw fmt_long /* This should be the COC1 value at the start of the preceding instruction: */ #define PREVCOC1() ((STATE & simPCOC1) ? 1 : 0) #ifdef TARGET_ENABLE_FR /* FIXME: this should be enabled for all targets, but needs testing first. */ #define SizeFGR() (((WITH_TARGET_FLOATING_POINT_BITSIZE) == 64) \ ? ((SR & status_FR) ? 64 : 32) \ : (WITH_TARGET_FLOATING_POINT_BITSIZE)) #else #define SizeFGR() (WITH_TARGET_FLOATING_POINT_BITSIZE) #endif /* HI/LO register accesses */ /* For some MIPS targets, the HI/LO registers have certain timing restrictions in that, for instance, a read of a HI register must be separated by at least three instructions from a preceeding read. The struct below is used to record the last access by each of A MT, MF or other OP instruction to a HI/LO register. See mips.igen for more details. */ typedef struct _hilo_access { signed64 timestamp; address_word cia; } hilo_access; typedef struct _hilo_history { hilo_access mt; hilo_access mf; hilo_access op; } hilo_history; /* Integer ALU operations: */ #include "sim-alu.h" #define ALU32_END(ANS) \ if (ALU32_HAD_OVERFLOW) \ SignalExceptionIntegerOverflow (); \ (ANS) = (signed32) ALU32_OVERFLOW_RESULT #define ALU64_END(ANS) \ if (ALU64_HAD_OVERFLOW) \ SignalExceptionIntegerOverflow (); \ (ANS) = ALU64_OVERFLOW_RESULT; /* The following is probably not used for MIPS IV onwards: */ /* Slots for delayed register updates. For the moment we just have a fixed number of slots (rather than a more generic, dynamic system). This keeps the simulator fast. However, we only allow for the register update to be delayed for a single instruction cycle. */ #define PSLOTS (8) /* Maximum number of instruction cycles */ typedef struct _pending_write_queue { int in; int out; int total; int slot_delay[PSLOTS]; int slot_size[PSLOTS]; int slot_bit[PSLOTS]; void *slot_dest[PSLOTS]; unsigned64 slot_value[PSLOTS]; } pending_write_queue; #ifndef PENDING_TRACE #define PENDING_TRACE 0 #endif #define PENDING_IN ((CPU)->pending.in) #define PENDING_OUT ((CPU)->pending.out) #define PENDING_TOTAL ((CPU)->pending.total) #define PENDING_SLOT_SIZE ((CPU)->pending.slot_size) #define PENDING_SLOT_BIT ((CPU)->pending.slot_bit) #define PENDING_SLOT_DELAY ((CPU)->pending.slot_delay) #define PENDING_SLOT_DEST ((CPU)->pending.slot_dest) #define PENDING_SLOT_VALUE ((CPU)->pending.slot_value) /* Invalidate the pending write queue, all pending writes are discarded. */ #define PENDING_INVALIDATE() \ memset (&(CPU)->pending, 0, sizeof ((CPU)->pending)) /* Schedule a write to DEST for N cycles time. For 64 bit destinations, schedule two writes. For floating point registers, the caller should schedule a write to both the dest register and the FPR_STATE register. When BIT is non-negative, only BIT of DEST is updated. */ #define PENDING_SCHED(DEST,VAL,DELAY,BIT) \ do { \ if (PENDING_SLOT_DEST[PENDING_IN] != NULL) \ sim_engine_abort (SD, CPU, cia, \ "PENDING_SCHED - buffer overflow\n"); \ if (PENDING_TRACE) \ sim_io_eprintf (SD, "PENDING_SCHED - 0x%lx - dest 0x%lx, val 0x%lx, bit %d, size %d, pending_in %d, pending_out %d, pending_total %d\n", \ (unsigned long) cia, (unsigned long) &(DEST), \ (unsigned long) (VAL), (BIT), (int) sizeof (DEST),\ PENDING_IN, PENDING_OUT, PENDING_TOTAL); \ PENDING_SLOT_DELAY[PENDING_IN] = (DELAY) + 1; \ PENDING_SLOT_DEST[PENDING_IN] = &(DEST); \ PENDING_SLOT_VALUE[PENDING_IN] = (VAL); \ PENDING_SLOT_SIZE[PENDING_IN] = sizeof (DEST); \ PENDING_SLOT_BIT[PENDING_IN] = (BIT); \ PENDING_IN = (PENDING_IN + 1) % PSLOTS; \ PENDING_TOTAL += 1; \ } while (0) #define PENDING_WRITE(DEST,VAL,DELAY) PENDING_SCHED(DEST,VAL,DELAY,-1) #define PENDING_BIT(DEST,VAL,DELAY,BIT) PENDING_SCHED(DEST,VAL,DELAY,BIT) #define PENDING_TICK() pending_tick (SD, CPU, cia) #define PENDING_FLUSH() abort () /* think about this one */ #define PENDING_FP() abort () /* think about this one */ /* For backward compatibility */ #define PENDING_FILL(R,VAL) \ do { \ if ((R) >= FGR_BASE && (R) < FGR_BASE + NR_FGR) \ { \ PENDING_SCHED(FGR[(R) - FGR_BASE], VAL, 1, -1); \ PENDING_SCHED(FPR_STATE[(R) - FGR_BASE], fmt_uninterpreted, 1, -1); \ } \ else \ PENDING_SCHED(GPR[(R)], VAL, 1, -1); \ } while (0) enum float_operation { FLOP_ADD, FLOP_SUB, FLOP_MUL, FLOP_MADD, FLOP_MSUB, FLOP_MAX=10, FLOP_MIN, FLOP_ABS, FLOP_ITOF0=14, FLOP_FTOI0=18, FLOP_NEG=23 }; /* The internal representation of an MDMX accumulator. Note that 24 and 48 bit accumulator elements are represented in 32 or 64 bits. Since the accumulators are 2's complement with overflow suppressed, high-order bits can be ignored in most contexts. */ typedef signed32 signed24; typedef signed64 signed48; typedef union { signed24 ob[8]; signed48 qh[4]; } MDMX_accumulator; /* Conventional system arguments. */ #define SIM_STATE sim_cpu *cpu, address_word cia #define SIM_ARGS CPU, cia struct _sim_cpu { /* The following are internal simulator state variables: */ address_word dspc; /* delay-slot PC */ #define DSPC ((CPU)->dspc) #define DELAY_SLOT(TARGET) NIA = delayslot32 (SD_, (TARGET)) #define NULLIFY_NEXT_INSTRUCTION() NIA = nullify_next_insn32 (SD_) /* State of the simulator */ unsigned int state; unsigned int dsstate; #define STATE ((CPU)->state) #define DSSTATE ((CPU)->dsstate) /* Flags in the "state" variable: */ #define simHALTEX (1 << 2) /* 0 = run; 1 = halt on exception */ #define simHALTIN (1 << 3) /* 0 = run; 1 = halt on interrupt */ #define simTRACE (1 << 8) /* 0 = do nothing; 1 = trace address activity */ #define simPCOC0 (1 << 17) /* COC[1] from current */ #define simPCOC1 (1 << 18) /* COC[1] from previous */ #define simDELAYSLOT (1 << 24) /* 0 = do nothing; 1 = delay slot entry exists */ #define simSKIPNEXT (1 << 25) /* 0 = do nothing; 1 = skip instruction */ #define simSIGINT (1 << 28) /* 0 = do nothing; 1 = SIGINT has occured */ #define simJALDELAYSLOT (1 << 29) /* 1 = in jal delay slot */ #ifndef ENGINE_ISSUE_PREFIX_HOOK #define ENGINE_ISSUE_PREFIX_HOOK() \ { \ /* Perform any pending writes */ \ PENDING_TICK(); \ /* Set previous flag, depending on current: */ \ if (STATE & simPCOC0) \ STATE |= simPCOC1; \ else \ STATE &= ~simPCOC1; \ /* and update the current value: */ \ if (GETFCC(0)) \ STATE |= simPCOC0; \ else \ STATE &= ~simPCOC0; \ } #endif /* ENGINE_ISSUE_PREFIX_HOOK */ /* This is nasty, since we have to rely on matching the register numbers used by GDB. Unfortunately, depending on the MIPS target GDB uses different register numbers. We cannot just include the relevant "gdb/tm.h" link, since GDB may not be configured before the sim world, and also the GDB header file requires too much other state. */ #ifndef TM_MIPS_H #define LAST_EMBED_REGNUM (96) #define NUM_REGS (LAST_EMBED_REGNUM + 1) #define FP0_REGNUM 38 /* Floating point register 0 (single float) */ #define FCRCS_REGNUM 70 /* FP control/status */ #define FCRIR_REGNUM 71 /* FP implementation/revision */ #endif /* To keep this default simulator simple, and fast, we use a direct vector of registers. The internal simulator engine then uses manifests to access the correct slot. */ unsigned_word registers[LAST_EMBED_REGNUM + 1]; int register_widths[NUM_REGS]; #define REGISTERS ((CPU)->registers) #define GPR (&REGISTERS[0]) #define GPR_SET(N,VAL) (REGISTERS[(N)] = (VAL)) #define LO (REGISTERS[33]) #define HI (REGISTERS[34]) #define PCIDX 37 #define PC (REGISTERS[PCIDX]) #define CAUSE (REGISTERS[36]) #define SRIDX (32) #define SR (REGISTERS[SRIDX]) /* CPU status register */ #define FCR0IDX (71) #define FCR0 (REGISTERS[FCR0IDX]) /* really a 32bit register */ #define FCR31IDX (70) #define FCR31 (REGISTERS[FCR31IDX]) /* really a 32bit register */ #define FCSR (FCR31) #define Debug (REGISTERS[86]) #define DEPC (REGISTERS[87]) #define EPC (REGISTERS[88]) #define ACX (REGISTERS[89]) #define AC0LOIDX (33) /* Must be the same register as LO */ #define AC0HIIDX (34) /* Must be the same register as HI */ #define AC1LOIDX (90) #define AC1HIIDX (91) #define AC2LOIDX (92) #define AC2HIIDX (93) #define AC3LOIDX (94) #define AC3HIIDX (95) #define DSPLO(N) (REGISTERS[DSPLO_REGNUM[N]]) #define DSPHI(N) (REGISTERS[DSPHI_REGNUM[N]]) #define DSPCRIDX (96) /* DSP control register */ #define DSPCR (REGISTERS[DSPCRIDX]) #define DSPCR_POS_SHIFT (0) #define DSPCR_POS_MASK (0x3f) #define DSPCR_POS_SMASK (DSPCR_POS_MASK << DSPCR_POS_SHIFT) #define DSPCR_SCOUNT_SHIFT (7) #define DSPCR_SCOUNT_MASK (0x3f) #define DSPCR_SCOUNT_SMASK (DSPCR_SCOUNT_MASK << DSPCR_SCOUNT_SHIFT) #define DSPCR_CARRY_SHIFT (13) #define DSPCR_CARRY_MASK (1) #define DSPCR_CARRY_SMASK (DSPCR_CARRY_MASK << DSPCR_CARRY_SHIFT) #define DSPCR_CARRY (1 << DSPCR_CARRY_SHIFT) #define DSPCR_EFI_SHIFT (14) #define DSPCR_EFI_MASK (1) #define DSPCR_EFI_SMASK (DSPCR_EFI_MASK << DSPCR_EFI_SHIFT) #define DSPCR_EFI (1 << DSPCR_EFI_MASK) #define DSPCR_OUFLAG_SHIFT (16) #define DSPCR_OUFLAG_MASK (0xff) #define DSPCR_OUFLAG_SMASK (DSPCR_OUFLAG_MASK << DSPCR_OUFLAG_SHIFT) #define DSPCR_OUFLAG4 (1 << (DSPCR_OUFLAG_SHIFT + 4)) #define DSPCR_OUFLAG5 (1 << (DSPCR_OUFLAG_SHIFT + 5)) #define DSPCR_OUFLAG6 (1 << (DSPCR_OUFLAG_SHIFT + 6)) #define DSPCR_OUFLAG7 (1 << (DSPCR_OUFLAG_SHIFT + 7)) #define DSPCR_CCOND_SHIFT (24) #define DSPCR_CCOND_MASK (0xf) #define DSPCR_CCOND_SMASK (DSPCR_CCOND_MASK << DSPCR_CCOND_SHIFT) /* All internal state modified by signal_exception() that may need to be rolled back for passing moment-of-exception image back to gdb. */ unsigned_word exc_trigger_registers[LAST_EMBED_REGNUM + 1]; unsigned_word exc_suspend_registers[LAST_EMBED_REGNUM + 1]; int exc_suspended; #define SIM_CPU_EXCEPTION_TRIGGER(SD,CPU,CIA) mips_cpu_exception_trigger(SD,CPU,CIA) #define SIM_CPU_EXCEPTION_SUSPEND(SD,CPU,EXC) mips_cpu_exception_suspend(SD,CPU,EXC) #define SIM_CPU_EXCEPTION_RESUME(SD,CPU,EXC) mips_cpu_exception_resume(SD,CPU,EXC) unsigned_word c0_config_reg; #define C0_CONFIG ((CPU)->c0_config_reg) /* The following are pseudonyms for standard registers */ #define ZERO (REGISTERS[0]) #define V0 (REGISTERS[2]) #define A0 (REGISTERS[4]) #define A1 (REGISTERS[5]) #define A2 (REGISTERS[6]) #define A3 (REGISTERS[7]) #define T8IDX 24 #define T8 (REGISTERS[T8IDX]) #define SPIDX 29 #define SP (REGISTERS[SPIDX]) #define RAIDX 31 #define RA (REGISTERS[RAIDX]) /* While space is allocated in the main registers arrray for some of the COP0 registers, that space isn't sufficient. Unknown COP0 registers overflow into the array below */ #define NR_COP0_GPR 32 unsigned_word cop0_gpr[NR_COP0_GPR]; #define COP0_GPR ((CPU)->cop0_gpr) #define COP0_BADVADDR (COP0_GPR[8]) /* While space is allocated for the floating point registers in the main registers array, they are stored separatly. This is because their size may not necessarily match the size of either the general-purpose or system specific registers. */ #define NR_FGR (32) #define FGR_BASE FP0_REGNUM fp_word fgr[NR_FGR]; #define FGR ((CPU)->fgr) /* Keep the current format state for each register: */ FP_formats fpr_state[32]; #define FPR_STATE ((CPU)->fpr_state) pending_write_queue pending; /* The MDMX accumulator (used only for MDMX ASE). */ MDMX_accumulator acc; #define ACC ((CPU)->acc) /* LLBIT = Load-Linked bit. A bit of "virtual" state used by atomic read-write instructions. It is set when a linked load occurs. It is tested and cleared by the conditional store. It is cleared (during other CPU operations) when a store to the location would no longer be atomic. In particular, it is cleared by exception return instructions. */ int llbit; #define LLBIT ((CPU)->llbit) /* The HIHISTORY and LOHISTORY timestamps are used to ensure that corruptions caused by using the HI or LO register too close to a following operation is spotted. See mips.igen for more details. */ hilo_history hi_history; #define HIHISTORY (&(CPU)->hi_history) hilo_history lo_history; #define LOHISTORY (&(CPU)->lo_history) sim_cpu_base base; }; extern void mips_sim_close (SIM_DESC sd, int quitting); #define SIM_CLOSE_HOOK(...) mips_sim_close (__VA_ARGS__) /* MIPS specific simulator watch config */ void watch_options_install (SIM_DESC sd); struct swatch { sim_event *pc; sim_event *clock; sim_event *cycles; }; /* FIXME: At present much of the simulator is still static */ struct sim_state { struct swatch watch; sim_cpu *cpu[MAX_NR_PROCESSORS]; /* microMIPS ISA mode. */ int isa_mode; sim_state_base base; }; /* Status information: */ /* TODO : these should be the bitmasks for these bits within the status register. At the moment the following are VR4300 bit-positions: */ #define status_KSU_mask (0x18) /* mask for KSU bits */ #define status_KSU_shift (3) /* shift for field */ #define ksu_kernel (0x0) #define ksu_supervisor (0x1) #define ksu_user (0x2) #define ksu_unknown (0x3) #define SR_KSU ((SR & status_KSU_mask) >> status_KSU_shift) #define status_IE (1 << 0) /* Interrupt enable */ #define status_EIE (1 << 16) /* Enable Interrupt Enable */ #define status_EXL (1 << 1) /* Exception level */ #define status_RE (1 << 25) /* Reverse Endian in user mode */ #define status_FR (1 << 26) /* enables MIPS III additional FP registers */ #define status_SR (1 << 20) /* soft reset or NMI */ #define status_BEV (1 << 22) /* Location of general exception vectors */ #define status_TS (1 << 21) /* TLB shutdown has occurred */ #define status_ERL (1 << 2) /* Error level */ #define status_IM7 (1 << 15) /* Timer Interrupt Mask */ #define status_RP (1 << 27) /* Reduced Power mode */ /* Specializations for TX39 family */ #define status_IEc (1 << 0) /* Interrupt enable (current) */ #define status_KUc (1 << 1) /* Kernel/User mode */ #define status_IEp (1 << 2) /* Interrupt enable (previous) */ #define status_KUp (1 << 3) /* Kernel/User mode */ #define status_IEo (1 << 4) /* Interrupt enable (old) */ #define status_KUo (1 << 5) /* Kernel/User mode */ #define status_IM_mask (0xff) /* Interrupt mask */ #define status_IM_shift (8) #define status_NMI (1 << 20) /* NMI */ #define status_NMI (1 << 20) /* NMI */ /* Status bits used by MIPS32/MIPS64. */ #define status_UX (1 << 5) /* 64-bit user addrs */ #define status_SX (1 << 6) /* 64-bit supervisor addrs */ #define status_KX (1 << 7) /* 64-bit kernel addrs */ #define status_TS (1 << 21) /* TLB shutdown has occurred */ #define status_PX (1 << 23) /* Enable 64 bit operations */ #define status_MX (1 << 24) /* Enable MDMX resources */ #define status_CU0 (1 << 28) /* Coprocessor 0 usable */ #define status_CU1 (1 << 29) /* Coprocessor 1 usable */ #define status_CU2 (1 << 30) /* Coprocessor 2 usable */ #define status_CU3 (1 << 31) /* Coprocessor 3 usable */ /* Bits reserved for implementations: */ #define status_SBX (1 << 16) /* Enable SiByte SB-1 extensions. */ #define cause_BD ((unsigned)1 << 31) /* L1 Exception in branch delay slot */ #define cause_BD2 (1 << 30) /* L2 Exception in branch delay slot */ #define cause_CE_mask 0x30000000 /* Coprocessor exception */ #define cause_CE_shift 28 #define cause_EXC2_mask 0x00070000 #define cause_EXC2_shift 16 #define cause_IP7 (1 << 15) /* Interrupt pending */ #define cause_SIOP (1 << 12) /* SIO pending */ #define cause_IP3 (1 << 11) /* Int 0 pending */ #define cause_IP2 (1 << 10) /* Int 1 pending */ #define cause_EXC_mask (0x1c) /* Exception code */ #define cause_EXC_shift (2) #define cause_SW0 (1 << 8) /* Software interrupt 0 */ #define cause_SW1 (1 << 9) /* Software interrupt 1 */ #define cause_IP_mask (0x3f) /* Interrupt pending field */ #define cause_IP_shift (10) #define cause_set_EXC(x) CAUSE = (CAUSE & ~cause_EXC_mask) | ((x << cause_EXC_shift) & cause_EXC_mask) #define cause_set_EXC2(x) CAUSE = (CAUSE & ~cause_EXC2_mask) | ((x << cause_EXC2_shift) & cause_EXC2_mask) /* NOTE: We keep the following status flags as bit values (1 for true, 0 for false). This allows them to be used in binary boolean operations without worrying about what exactly the non-zero true value is. */ /* UserMode */ #ifdef SUBTARGET_R3900 #define UserMode ((SR & status_KUc) ? 1 : 0) #else #define UserMode ((((SR & status_KSU_mask) >> status_KSU_shift) == ksu_user) ? 1 : 0) #endif /* SUBTARGET_R3900 */ /* BigEndianMem */ /* Hardware configuration. Affects endianness of LoadMemory and StoreMemory and the endianness of Kernel and Supervisor mode execution. The value is 0 for little-endian; 1 for big-endian. */ #define BigEndianMem (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) /*(state & simBE) ? 1 : 0)*/ /* ReverseEndian */ /* This mode is selected if in User mode with the RE bit being set in SR (Status Register). It reverses the endianness of load and store instructions. */ #define ReverseEndian (((SR & status_RE) && UserMode) ? 1 : 0) /* BigEndianCPU */ /* The endianness for load and store instructions (0=little;1=big). In User mode this endianness may be switched by setting the state_RE bit in the SR register. Thus, BigEndianCPU may be computed as (BigEndianMem EOR ReverseEndian). */ #define BigEndianCPU (BigEndianMem ^ ReverseEndian) /* Already bits */ /* Exceptions: */ /* NOTE: These numbers depend on the processor architecture being simulated: */ enum ExceptionCause { Interrupt = 0, TLBModification = 1, TLBLoad = 2, TLBStore = 3, AddressLoad = 4, AddressStore = 5, InstructionFetch = 6, DataReference = 7, SystemCall = 8, BreakPoint = 9, ReservedInstruction = 10, CoProcessorUnusable = 11, IntegerOverflow = 12, /* Arithmetic overflow (IDT monitor raises SIGFPE) */ Trap = 13, FPE = 15, DebugBreakPoint = 16, /* Impl. dep. in MIPS32/MIPS64. */ MDMX = 22, Watch = 23, MCheck = 24, CacheErr = 30, NMIReset = 31, /* Reserved in MIPS32/MIPS64. */ /* The following exception code is actually private to the simulator world. It is *NOT* a processor feature, and is used to signal run-time errors in the simulator. */ SimulatorFault = 0xFFFFFFFF }; #define TLB_REFILL (0) #define TLB_INVALID (1) /* The following break instructions are reserved for use by the simulator. The first is used to halt the simulation. The second is used by gdb for break-points. NOTE: Care must be taken, since this value may be used in later revisions of the MIPS ISA. */ #define HALT_INSTRUCTION_MASK (0x03FFFFC0) #define HALT_INSTRUCTION (0x03ff000d) #define HALT_INSTRUCTION2 (0x0000ffcd) #define BREAKPOINT_INSTRUCTION (0x0005000d) #define BREAKPOINT_INSTRUCTION2 (0x0000014d) void interrupt_event (SIM_DESC sd, void *data); void signal_exception (SIM_DESC sd, sim_cpu *cpu, address_word cia, int exception, ...); #define SignalException(exc,instruction) signal_exception (SD, CPU, cia, (exc), (instruction)) #define SignalExceptionInterrupt(level) signal_exception (SD, CPU, cia, Interrupt, level) #define SignalExceptionInstructionFetch() signal_exception (SD, CPU, cia, InstructionFetch) #define SignalExceptionAddressStore() signal_exception (SD, CPU, cia, AddressStore) #define SignalExceptionAddressLoad() signal_exception (SD, CPU, cia, AddressLoad) #define SignalExceptionDataReference() signal_exception (SD, CPU, cia, DataReference) #define SignalExceptionSimulatorFault(buf) signal_exception (SD, CPU, cia, SimulatorFault, buf) #define SignalExceptionFPE() signal_exception (SD, CPU, cia, FPE) #define SignalExceptionIntegerOverflow() signal_exception (SD, CPU, cia, IntegerOverflow) #define SignalExceptionCoProcessorUnusable(cop) signal_exception (SD, CPU, cia, CoProcessorUnusable) #define SignalExceptionNMIReset() signal_exception (SD, CPU, cia, NMIReset) #define SignalExceptionTLBRefillStore() signal_exception (SD, CPU, cia, TLBStore, TLB_REFILL) #define SignalExceptionTLBRefillLoad() signal_exception (SD, CPU, cia, TLBLoad, TLB_REFILL) #define SignalExceptionTLBInvalidStore() signal_exception (SD, CPU, cia, TLBStore, TLB_INVALID) #define SignalExceptionTLBInvalidLoad() signal_exception (SD, CPU, cia, TLBLoad, TLB_INVALID) #define SignalExceptionTLBModification() signal_exception (SD, CPU, cia, TLBModification) #define SignalExceptionMDMX() signal_exception (SD, CPU, cia, MDMX) #define SignalExceptionWatch() signal_exception (SD, CPU, cia, Watch) #define SignalExceptionMCheck() signal_exception (SD, CPU, cia, MCheck) #define SignalExceptionCacheErr() signal_exception (SD, CPU, cia, CacheErr) /* Co-processor accesses */ /* XXX FIXME: For now, assume that FPU (cp1) is always usable. */ #define COP_Usable(coproc_num) (coproc_num == 1) void cop_lw (SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg, unsigned int memword); void cop_ld (SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg, uword64 memword); unsigned int cop_sw (SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg); uword64 cop_sd (SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg); #define COP_LW(coproc_num,coproc_reg,memword) \ cop_lw (SD, CPU, cia, coproc_num, coproc_reg, memword) #define COP_LD(coproc_num,coproc_reg,memword) \ cop_ld (SD, CPU, cia, coproc_num, coproc_reg, memword) #define COP_SW(coproc_num,coproc_reg) \ cop_sw (SD, CPU, cia, coproc_num, coproc_reg) #define COP_SD(coproc_num,coproc_reg) \ cop_sd (SD, CPU, cia, coproc_num, coproc_reg) void decode_coproc (SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigned int instruction, int coprocnum, CP0_operation op, int rt, int rd, int sel); #define DecodeCoproc(instruction,coprocnum,op,rt,rd,sel) \ decode_coproc (SD, CPU, cia, (instruction), (coprocnum), (op), \ (rt), (rd), (sel)) int sim_monitor (SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigned int arg); /* FPR access. */ unsigned64 value_fpr (SIM_STATE, int fpr, FP_formats); #define ValueFPR(FPR,FMT) value_fpr (SIM_ARGS, (FPR), (FMT)) void store_fpr (SIM_STATE, int fpr, FP_formats fmt, unsigned64 value); #define StoreFPR(FPR,FMT,VALUE) store_fpr (SIM_ARGS, (FPR), (FMT), (VALUE)) unsigned64 ps_lower (SIM_STATE, unsigned64 op); #define PSLower(op) ps_lower (SIM_ARGS, op) unsigned64 ps_upper (SIM_STATE, unsigned64 op); #define PSUpper(op) ps_upper (SIM_ARGS, op) unsigned64 pack_ps (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats from); #define PackPS(op1,op2) pack_ps (SIM_ARGS, op1, op2, fmt_single) /* FCR access. */ unsigned_word value_fcr (SIM_STATE, int fcr); #define ValueFCR(FCR) value_fcr (SIM_ARGS, (FCR)) void store_fcr (SIM_STATE, int fcr, unsigned_word value); #define StoreFCR(FCR,VALUE) store_fcr (SIM_ARGS, (FCR), (VALUE)) void test_fcsr (SIM_STATE); #define TestFCSR() test_fcsr (SIM_ARGS) /* FPU operations. */ void fp_cmp (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt, int abs, int cond, int cc); #define Compare(op1,op2,fmt,cond,cc) fp_cmp(SIM_ARGS, op1, op2, fmt, 0, cond, cc) unsigned64 fp_abs (SIM_STATE, unsigned64 op, FP_formats fmt); #define AbsoluteValue(op,fmt) fp_abs(SIM_ARGS, op, fmt) unsigned64 fp_neg (SIM_STATE, unsigned64 op, FP_formats fmt); #define Negate(op,fmt) fp_neg(SIM_ARGS, op, fmt) unsigned64 fp_add (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt); #define Add(op1,op2,fmt) fp_add(SIM_ARGS, op1, op2, fmt) unsigned64 fp_sub (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt); #define Sub(op1,op2,fmt) fp_sub(SIM_ARGS, op1, op2, fmt) unsigned64 fp_mul (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt); #define Multiply(op1,op2,fmt) fp_mul(SIM_ARGS, op1, op2, fmt) unsigned64 fp_div (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt); #define Divide(op1,op2,fmt) fp_div(SIM_ARGS, op1, op2, fmt) unsigned64 fp_recip (SIM_STATE, unsigned64 op, FP_formats fmt); #define Recip(op,fmt) fp_recip(SIM_ARGS, op, fmt) unsigned64 fp_sqrt (SIM_STATE, unsigned64 op, FP_formats fmt); #define SquareRoot(op,fmt) fp_sqrt(SIM_ARGS, op, fmt) unsigned64 fp_rsqrt (SIM_STATE, unsigned64 op, FP_formats fmt); #define RSquareRoot(op,fmt) fp_rsqrt(SIM_ARGS, op, fmt) unsigned64 fp_madd (SIM_STATE, unsigned64 op1, unsigned64 op2, unsigned64 op3, FP_formats fmt); #define MultiplyAdd(op1,op2,op3,fmt) fp_madd(SIM_ARGS, op1, op2, op3, fmt) unsigned64 fp_msub (SIM_STATE, unsigned64 op1, unsigned64 op2, unsigned64 op3, FP_formats fmt); #define MultiplySub(op1,op2,op3,fmt) fp_msub(SIM_ARGS, op1, op2, op3, fmt) unsigned64 fp_nmadd (SIM_STATE, unsigned64 op1, unsigned64 op2, unsigned64 op3, FP_formats fmt); #define NegMultiplyAdd(op1,op2,op3,fmt) fp_nmadd(SIM_ARGS, op1, op2, op3, fmt) unsigned64 fp_nmsub (SIM_STATE, unsigned64 op1, unsigned64 op2, unsigned64 op3, FP_formats fmt); #define NegMultiplySub(op1,op2,op3,fmt) fp_nmsub(SIM_ARGS, op1, op2, op3, fmt) unsigned64 convert (SIM_STATE, int rm, unsigned64 op, FP_formats from, FP_formats to); #define Convert(rm,op,from,to) convert (SIM_ARGS, rm, op, from, to) unsigned64 convert_ps (SIM_STATE, int rm, unsigned64 op, FP_formats from, FP_formats to); #define ConvertPS(rm,op,from,to) convert_ps (SIM_ARGS, rm, op, from, to) /* MIPS-3D ASE operations. */ #define CompareAbs(op1,op2,fmt,cond,cc) \ fp_cmp(SIM_ARGS, op1, op2, fmt, 1, cond, cc) unsigned64 fp_add_r (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt); #define AddR(op1,op2,fmt) fp_add_r(SIM_ARGS, op1, op2, fmt) unsigned64 fp_mul_r (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt); #define MultiplyR(op1,op2,fmt) fp_mul_r(SIM_ARGS, op1, op2, fmt) unsigned64 fp_recip1 (SIM_STATE, unsigned64 op, FP_formats fmt); #define Recip1(op,fmt) fp_recip1(SIM_ARGS, op, fmt) unsigned64 fp_recip2 (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt); #define Recip2(op1,op2,fmt) fp_recip2(SIM_ARGS, op1, op2, fmt) unsigned64 fp_rsqrt1 (SIM_STATE, unsigned64 op, FP_formats fmt); #define RSquareRoot1(op,fmt) fp_rsqrt1(SIM_ARGS, op, fmt) unsigned64 fp_rsqrt2 (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt); #define RSquareRoot2(op1,op2,fmt) fp_rsqrt2(SIM_ARGS, op1, op2, fmt) /* MDMX access. */ typedef unsigned int MX_fmtsel; /* MDMX format select field (5 bits). */ #define ob_fmtsel(sel) (((sel)<<1)|0x0) #define qh_fmtsel(sel) (((sel)<<2)|0x1) #define fmt_mdmx fmt_uninterpreted #define MX_VECT_AND (0) #define MX_VECT_NOR (1) #define MX_VECT_OR (2) #define MX_VECT_XOR (3) #define MX_VECT_SLL (4) #define MX_VECT_SRL (5) #define MX_VECT_ADD (6) #define MX_VECT_SUB (7) #define MX_VECT_MIN (8) #define MX_VECT_MAX (9) #define MX_VECT_MUL (10) #define MX_VECT_MSGN (11) #define MX_VECT_SRA (12) #define MX_VECT_ABSD (13) /* SB-1 only. */ #define MX_VECT_AVG (14) /* SB-1 only. */ unsigned64 mdmx_cpr_op (SIM_STATE, int op, unsigned64 op1, int vt, MX_fmtsel fmtsel); #define MX_Add(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_ADD, op1, vt, fmtsel) #define MX_And(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_AND, op1, vt, fmtsel) #define MX_Max(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_MAX, op1, vt, fmtsel) #define MX_Min(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_MIN, op1, vt, fmtsel) #define MX_Msgn(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_MSGN, op1, vt, fmtsel) #define MX_Mul(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_MUL, op1, vt, fmtsel) #define MX_Nor(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_NOR, op1, vt, fmtsel) #define MX_Or(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_OR, op1, vt, fmtsel) #define MX_ShiftLeftLogical(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_SLL, op1, vt, fmtsel) #define MX_ShiftRightArith(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_SRA, op1, vt, fmtsel) #define MX_ShiftRightLogical(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_SRL, op1, vt, fmtsel) #define MX_Sub(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_SUB, op1, vt, fmtsel) #define MX_Xor(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_XOR, op1, vt, fmtsel) #define MX_AbsDiff(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_ABSD, op1, vt, fmtsel) #define MX_Avg(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_AVG, op1, vt, fmtsel) #define MX_C_EQ 0x1 #define MX_C_LT 0x4 void mdmx_cc_op (SIM_STATE, int cond, unsigned64 op1, int vt, MX_fmtsel fmtsel); #define MX_Comp(op1,cond,vt,fmtsel) mdmx_cc_op(SIM_ARGS, cond, op1, vt, fmtsel) unsigned64 mdmx_pick_op (SIM_STATE, int tf, unsigned64 op1, int vt, MX_fmtsel fmtsel); #define MX_Pick(tf,op1,vt,fmtsel) mdmx_pick_op(SIM_ARGS, tf, op1, vt, fmtsel) #define MX_VECT_ADDA (0) #define MX_VECT_ADDL (1) #define MX_VECT_MULA (2) #define MX_VECT_MULL (3) #define MX_VECT_MULS (4) #define MX_VECT_MULSL (5) #define MX_VECT_SUBA (6) #define MX_VECT_SUBL (7) #define MX_VECT_ABSDA (8) /* SB-1 only. */ void mdmx_acc_op (SIM_STATE, int op, unsigned64 op1, int vt, MX_fmtsel fmtsel); #define MX_AddA(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_ADDA, op1, vt, fmtsel) #define MX_AddL(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_ADDL, op1, vt, fmtsel) #define MX_MulA(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_MULA, op1, vt, fmtsel) #define MX_MulL(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_MULL, op1, vt, fmtsel) #define MX_MulS(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_MULS, op1, vt, fmtsel) #define MX_MulSL(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_MULSL, op1, vt, fmtsel) #define MX_SubA(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_SUBA, op1, vt, fmtsel) #define MX_SubL(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_SUBL, op1, vt, fmtsel) #define MX_AbsDiffC(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_ABSDA, op1, vt, fmtsel) #define MX_FMT_OB (0) #define MX_FMT_QH (1) /* The following codes chosen to indicate the units of shift. */ #define MX_RAC_L (0) #define MX_RAC_M (1) #define MX_RAC_H (2) unsigned64 mdmx_rac_op (SIM_STATE, int, int); #define MX_RAC(op,fmt) mdmx_rac_op(SIM_ARGS, op, fmt) void mdmx_wacl (SIM_STATE, int, unsigned64, unsigned64); #define MX_WACL(fmt,vs,vt) mdmx_wacl(SIM_ARGS, fmt, vs, vt) void mdmx_wach (SIM_STATE, int, unsigned64); #define MX_WACH(fmt,vs) mdmx_wach(SIM_ARGS, fmt, vs) #define MX_RND_AS (0) #define MX_RND_AU (1) #define MX_RND_ES (2) #define MX_RND_EU (3) #define MX_RND_ZS (4) #define MX_RND_ZU (5) unsigned64 mdmx_round_op (SIM_STATE, int, int, MX_fmtsel); #define MX_RNAS(vt,fmt) mdmx_round_op(SIM_ARGS, MX_RND_AS, vt, fmt) #define MX_RNAU(vt,fmt) mdmx_round_op(SIM_ARGS, MX_RND_AU, vt, fmt) #define MX_RNES(vt,fmt) mdmx_round_op(SIM_ARGS, MX_RND_ES, vt, fmt) #define MX_RNEU(vt,fmt) mdmx_round_op(SIM_ARGS, MX_RND_EU, vt, fmt) #define MX_RZS(vt,fmt) mdmx_round_op(SIM_ARGS, MX_RND_ZS, vt, fmt) #define MX_RZU(vt,fmt) mdmx_round_op(SIM_ARGS, MX_RND_ZU, vt, fmt) unsigned64 mdmx_shuffle (SIM_STATE, int, unsigned64, unsigned64); #define MX_SHFL(shop,op1,op2) mdmx_shuffle(SIM_ARGS, shop, op1, op2) /* Memory accesses */ /* The following are generic to all versions of the MIPS architecture to date: */ #define isINSTRUCTION (1 == 0) /* FALSE */ #define isDATA (1 == 1) /* TRUE */ #define isLOAD (1 == 0) /* FALSE */ #define isSTORE (1 == 1) /* TRUE */ #define isREAL (1 == 0) /* FALSE */ #define isRAW (1 == 1) /* TRUE */ /* The parameter HOST (isTARGET / isHOST) is ignored */ #define isTARGET (1 == 0) /* FALSE */ /* #define isHOST (1 == 1) TRUE */ /* The "AccessLength" specifications for Loads and Stores. NOTE: This is the number of bytes minus 1. */ #define AccessLength_BYTE (0) #define AccessLength_HALFWORD (1) #define AccessLength_TRIPLEBYTE (2) #define AccessLength_WORD (3) #define AccessLength_QUINTIBYTE (4) #define AccessLength_SEXTIBYTE (5) #define AccessLength_SEPTIBYTE (6) #define AccessLength_DOUBLEWORD (7) #define AccessLength_QUADWORD (15) #define LOADDRMASK (WITH_TARGET_WORD_BITSIZE == 64 \ ? AccessLength_DOUBLEWORD /*7*/ \ : AccessLength_WORD /*3*/) #define PSIZE (WITH_TARGET_ADDRESS_BITSIZE) INLINE_SIM_MAIN (void) load_memory (SIM_DESC sd, sim_cpu *cpu, address_word cia, uword64* memvalp, uword64* memval1p, int CCA, unsigned int AccessLength, address_word pAddr, address_word vAddr, int IorD); #define LoadMemory(memvalp,memval1p,AccessLength,pAddr,vAddr,IorD,raw) \ load_memory (SD, CPU, cia, memvalp, memval1p, 0, AccessLength, pAddr, vAddr, IorD) INLINE_SIM_MAIN (void) store_memory (SIM_DESC sd, sim_cpu *cpu, address_word cia, int CCA, unsigned int AccessLength, uword64 MemElem, uword64 MemElem1, address_word pAddr, address_word vAddr); #define StoreMemory(AccessLength,MemElem,MemElem1,pAddr,vAddr,raw) \ store_memory (SD, CPU, cia, 0, AccessLength, MemElem, MemElem1, pAddr, vAddr) INLINE_SIM_MAIN (void) cache_op (SIM_DESC sd, sim_cpu *cpu, address_word cia, int op, address_word pAddr, address_word vAddr, unsigned int instruction); #define CacheOp(op,pAddr,vAddr,instruction) \ cache_op (SD, CPU, cia, op, pAddr, vAddr, instruction) INLINE_SIM_MAIN (void) sync_operation (SIM_DESC sd, sim_cpu *cpu, address_word cia, int stype); #define SyncOperation(stype) \ sync_operation (SD, CPU, cia, (stype)) void unpredictable_action (sim_cpu *cpu, address_word cia); #define NotWordValue(val) not_word_value (SD_, (val)) #define Unpredictable() unpredictable (SD_) #define UnpredictableResult() /* For now, do nothing. */ INLINE_SIM_MAIN (unsigned32) ifetch32 (SIM_DESC sd, sim_cpu *cpu, address_word cia, address_word vaddr); #define IMEM32(CIA) ifetch32 (SD, CPU, (CIA), (CIA)) INLINE_SIM_MAIN (unsigned16) ifetch16 (SIM_DESC sd, sim_cpu *cpu, address_word cia, address_word vaddr); #define IMEM16(CIA) ifetch16 (SD, CPU, (CIA), ((CIA) & ~1)) #define IMEM16_IMMED(CIA,NR) ifetch16 (SD, CPU, (CIA), ((CIA) & ~1) + 2 * (NR)) #define IMEM32_MICROMIPS(CIA) \ (ifetch16 (SD, CPU, (CIA), (CIA)) << 16 | ifetch16 (SD, CPU, (CIA + 2), \ (CIA + 2))) #define IMEM16_MICROMIPS(CIA) ifetch16 (SD, CPU, (CIA), ((CIA))) #define MICROMIPS_MINOR_OPCODE(INSN) ((INSN & 0x1C00) >> 10) #define MICROMIPS_DELAYSLOT_SIZE_ANY 0 #define MICROMIPS_DELAYSLOT_SIZE_16 2 #define MICROMIPS_DELAYSLOT_SIZE_32 4 extern int isa_mode; #define ISA_MODE_MIPS32 0 #define ISA_MODE_MICROMIPS 1 address_word micromips_instruction_decode (SIM_DESC sd, sim_cpu * cpu, address_word cia, int instruction_size); #if WITH_TRACE_ANY_P void dotrace (SIM_DESC sd, sim_cpu *cpu, FILE *tracefh, int type, SIM_ADDR address, int width, char *comment, ...); extern FILE *tracefh; #else #define dotrace(sd, cpu, tracefh, type, address, width, comment, ...) #endif extern int DSPLO_REGNUM[4]; extern int DSPHI_REGNUM[4]; INLINE_SIM_MAIN (void) pending_tick (SIM_DESC sd, sim_cpu *cpu, address_word cia); extern SIM_CORE_SIGNAL_FN mips_core_signal; char* pr_addr (SIM_ADDR addr); char* pr_uword64 (uword64 addr); #define GPR_CLEAR(N) do { GPR_SET((N),0); } while (0) void mips_cpu_exception_trigger(SIM_DESC sd, sim_cpu* cpu, address_word pc); void mips_cpu_exception_suspend(SIM_DESC sd, sim_cpu* cpu, int exception); void mips_cpu_exception_resume(SIM_DESC sd, sim_cpu* cpu, int exception); #ifdef MIPS_MACH_MULTI extern int mips_mach_multi(SIM_DESC sd); #define MIPS_MACH(SD) mips_mach_multi(SD) #else #define MIPS_MACH(SD) MIPS_MACH_DEFAULT #endif /* Macros for determining whether a MIPS IV or MIPS V part is subject to the hi/lo restrictions described in mips.igen. */ #define MIPS_MACH_HAS_MT_HILO_HAZARD(SD) \ (MIPS_MACH (SD) != bfd_mach_mips5500) #define MIPS_MACH_HAS_MULT_HILO_HAZARD(SD) \ (MIPS_MACH (SD) != bfd_mach_mips5500) #define MIPS_MACH_HAS_DIV_HILO_HAZARD(SD) \ (MIPS_MACH (SD) != bfd_mach_mips5500) #if H_REVEALS_MODULE_P (SIM_MAIN_INLINE) #include "sim-main.c" #endif #endif
38.750969
231
0.705409
[ "vector", "3d" ]
966846006194024593fca79273993a85b172d64b
5,622
h
C
3rd_party/PxShared/src/pvd/src/PxProfileZoneManager.h
THISISAGOODNAME/phsyxOpenGL
41564c07d6c86c71b711136cbe9d4ac8fe01204d
[ "MIT" ]
5
2017-09-24T17:05:47.000Z
2022-01-27T06:00:21.000Z
3rd_party/PxShared/src/pvd/src/PxProfileZoneManager.h
THISISAGOODNAME/phsyxOpenGL
41564c07d6c86c71b711136cbe9d4ac8fe01204d
[ "MIT" ]
null
null
null
3rd_party/PxShared/src/pvd/src/PxProfileZoneManager.h
THISISAGOODNAME/phsyxOpenGL
41564c07d6c86c71b711136cbe9d4ac8fe01204d
[ "MIT" ]
null
null
null
// This code contains NVIDIA Confidential Information and is disclosed to you // under a form of NVIDIA software license agreement provided separately to you. // // Notice // NVIDIA Corporation and its licensors retain all intellectual property and // proprietary rights in and to this software and related documentation and // any modifications thereto. Any use, reproduction, disclosure, or // distribution of this software and related documentation without an express // license agreement from NVIDIA Corporation is strictly prohibited. // // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. // // Information and code furnished is believed to be accurate and reliable. // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such // information or for any infringement of patents or other rights of third parties that may // result from its use. No license is granted by implication or otherwise under any patent // or patent rights of NVIDIA Corporation. Details are subject to change without notice. // This code supersedes and replaces all information previously supplied. // NVIDIA Corporation products are not authorized for use as critical // components in life support devices or systems without express written approval of // NVIDIA Corporation. // // Copyright (c) 2008-2017 NVIDIA Corporation. All rights reserved. #ifndef PXPVDSDK_PXPROFILEZONEMANAGER_H #define PXPVDSDK_PXPROFILEZONEMANAGER_H #include "PxProfileEventSender.h" #include "PxProfileEventNames.h" namespace physx { class PxAllocatorCallback; namespace profile { class PxProfileZone; class PxProfileNameProvider; /** \brief Profile zone handler for zone add/remove notification. */ class PxProfileZoneHandler { protected: virtual ~PxProfileZoneHandler(){} public: /** \brief On zone added notification \note Not a threadsafe call; handlers are expected to be able to handle this from any thread. \param inSDK Added zone. */ virtual void onZoneAdded( PxProfileZone& inSDK ) = 0; /** \brief On zone removed notification \note Not a threadsafe call; handlers are expected to be able to handle this from any thread. \param inSDK removed zone. */ virtual void onZoneRemoved( PxProfileZone& inSDK ) = 0; }; /** \brief The profiling system was setup in the expectation that there would be several systems that each had its own island of profile information. PhysX, client code, and APEX would be the first examples of these. Each one of these islands is represented by a profile zone. The Manager is a singleton-like object where all these different systems can be registered so that clients of the profiling system can have one point to capture *all* profiling events. Flushing the manager implies that you want to loop through all the profile zones and flush each one. @see PxProfileEventFlusher */ class PxProfileZoneManager : public PxProfileEventFlusher //Tell all SDK's to flush their queue of profile events. { protected: virtual ~PxProfileZoneManager(){} public: /** \brief Add new profile zone for the manager. \note Threadsafe call, can be done from any thread. Handlers that are already connected will get a new callback on the current thread. \param inSDK Profile zone to add. */ virtual void addProfileZone( PxProfileZone& inSDK ) = 0; /** \brief Removes profile zone from the manager. \note Threadsafe call, can be done from any thread. Handlers that are already connected will get a new callback on the current thread. \param inSDK Profile zone to remove. */ virtual void removeProfileZone( PxProfileZone& inSDK ) = 0; /** \brief Add profile zone handler callback for the profile zone notifications. \note Threadsafe call. The new handler will immediately be notified about all known SDKs. \param inHandler Profile zone handler to add. */ virtual void addProfileZoneHandler( PxProfileZoneHandler& inHandler ) = 0; /** \brief Removes profile zone handler callback for the profile zone notifications. \note Threadsafe call. The new handler will immediately be notified about all known SDKs. \param inHandler Profile zone handler to remove. */ virtual void removeProfileZoneHandler( PxProfileZoneHandler& inHandler ) = 0; /** \brief Create a new profile zone. This means you don't need access to a PxFoundation to create your profile zone object, and your object is automatically registered with the profile zone manager. You still need to release your object when you are finished with it. \param inSDKName Name of the SDK object. \param inNames Option set of event id to name mappings. \param inEventBufferByteSize rough maximum size of the event buffer. May exceed this size by sizeof one event. When full an immediate call to all listeners is made. */ virtual PxProfileZone& createProfileZone( const char* inSDKName, PxProfileNames inNames = PxProfileNames(), uint32_t inEventBufferByteSize = 0x4000 /*16k*/ ) = 0; /** \brief Releases the profile manager instance. */ virtual void release() = 0; /** \brief Create the profile zone manager. \param inAllocatorCallback Allocator callback. */ static PxProfileZoneManager& createProfileZoneManager(PxAllocatorCallback* inAllocatorCallback ); }; } } #endif // PXPVDSDK_PXPROFILEZONEMANAGER_H
36.038462
164
0.763785
[ "object" ]
96688abe80a27ca924e35a3183736c77d87f85ff
6,721
h
C
Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h
ffteja/cgal
c1c7f4ad9a4cd669e33ca07a299062a461581812
[ "CC0-1.0" ]
3,227
2015-03-05T00:19:18.000Z
2022-03-31T08:20:35.000Z
Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h
ffteja/cgal
c1c7f4ad9a4cd669e33ca07a299062a461581812
[ "CC0-1.0" ]
5,574
2015-03-05T00:01:56.000Z
2022-03-31T15:08:11.000Z
Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h
ffteja/cgal
c1c7f4ad9a4cd669e33ca07a299062a461581812
[ "CC0-1.0" ]
1,274
2015-03-05T00:01:12.000Z
2022-03-31T14:47:56.000Z
// Copyright (c) 1997-2000 Max-Planck-Institute Saarbruecken (Germany). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Michael Seel <seel@mpi-sb.mpg.de> #ifndef CGAL_CONVEX_HULL_D_TRAITS_3_H #define CGAL_CONVEX_HULL_D_TRAITS_3_H #include <CGAL/license/Convex_hull_d.h> #define CGAL_DEPRECATED_HEADER "<CGAL/Convex_hull_d_traits_3.h>" #define CGAL_DEPRECATED_MESSAGE_DETAILS \ "The Triangulation package (see https://doc.cgal.org/latest/Triangulation) should be used instead." #include <CGAL/Installation/internal/deprecation_warning.h> #include <CGAL/Point_3.h> #include <CGAL/Vector_3.h> #include <CGAL/Plane_3.h> #include <CGAL/Ray_3.h> #include <CGAL/Triangle_3.h> #include <CGAL/Tetrahedron_3.h> #include <CGAL/predicates_on_points_3.h> #include <CGAL/intersection_3.h> #include <vector> #include <CGAL/use.h> namespace CGAL { template <class R_> struct Convex_hull_d_traits_3 { typedef R_ R; typedef typename R_::RT RT; typedef typename R_::FT FT; typedef typename R_::Point_3 Point_d; typedef typename R_::Plane_3 Hyperplane_d; typedef typename R_::Vector_3 Vector_d; typedef typename R_::Ray_3 Ray_d; typedef typename R::Oriented_side_3 Oriented_side_d; Oriented_side_d oriented_side_d_object() const { return Oriented_side_d(); } typedef typename R::Has_on_positive_side_3 Has_on_positive_side_d; Has_on_positive_side_d has_on_positive_side_d_object() const { return Has_on_positive_side_d(); } struct Orientation_d { template <class I> Orientation operator()(I s, I e) { CGAL_USE(e); Point_d A[4]; CGAL_assertion(s != e); A[0] = *s; ++s; CGAL_assertion(s != e); A[1] = *s; ++s; CGAL_assertion(s != e); A[2] = *s; ++s; CGAL_assertion(s != e); A[3] = *s; ++s; CGAL_assertion(s == e); return orientation(A[0],A[1],A[2],A[3]); } }; Orientation_d orientation_d_object() const { return Orientation_d(); } struct Affinely_independent_d { template <class I> bool operator()(I s, I e) { Point_d A[4]; CGAL_assertion(s != e); A[0] = *s; ++s; if(s == e){ return true; } A[1] = *s; ++s; if (s == e){ return A[0] != A[1]; } A[2] = *s; ++s; if (s == e){ return ! collinear( A[0], A[1], A[2] ); } A[3] = *s; ++s; if (s == e){ return !coplanar( A[0], A[1], A[2], A[3] ); } return false; } }; Affinely_independent_d affinely_independent_d_object() const { return Affinely_independent_d(); } struct Contained_in_simplex_d { template <class I> bool operator()(I s, I e, const Point_d& p) { Point_d A[4]; CGAL_assertion(s != e); A[0] = *s; ++s; if(s == e){ return A[0] == p; } A[1] = *s; ++s; if (s == e){ typename R_::Segment_3 s( A[0], A[1] ); return s.has_on(p); } A[2] = *s; ++s; if (s == e){ typename R_::Triangle_3 t( A[0], A[1], A[2] ); return t.has_on(p); } A[3] = *s; ++s; if (s == e){ typename R_::Tetrahedron_3 t( A[0], A[1], A[2], A[3] ); return !t.has_on_unbounded_side(p); } return false; // should be unreachable ! } }; Contained_in_simplex_d contained_in_simplex_d_object() const { return Contained_in_simplex_d(); } struct Contained_in_affine_hull_d { template <class I> bool operator()(I s, I e, const Point_d& p) { CGAL_assertion_code( Affinely_independent_d affinely_independent; ) CGAL_assertion( affinely_independent(s,e) ); Point_d A[3]; A[0] = *s; ++s; if(s == e){ return p == A[0]; } A[1] = *s; ++s; if (s == e){ return collinear( p, A[0], A[1] ); } A[2] = *s; ++s; if (s == e){ return coplanar( p, A[0], A[1], A[2] ); } return false; } }; Contained_in_affine_hull_d contained_in_affine_hull_d_object() const { return Contained_in_affine_hull_d(); } struct Component_accessor_d { template <typename C> int dimension(const C& c) const { return c.dimension(); } template <typename C> RT homogeneous(const C& c, int i) { return c.homogeneous(i); } template <typename C> FT cartesian(const C& c, int i) { return c.cartesian(i); } }; Component_accessor_d component_accessor_d_object() const { return Component_accessor_d(); } struct Orthogonal_vector_d { Vector_d operator()(const Hyperplane_d& h) const { return h.orthogonal_vector(); } }; Orthogonal_vector_d orthogonal_vector_d_object() const { return Orthogonal_vector_d(); } struct Point_to_vector_d { Vector_d operator()(const Point_d& p) const { return p-CGAL::ORIGIN; } }; Point_to_vector_d point_to_vector_d_object() const { return Point_to_vector_d(); } struct Vector_to_point_d { Point_d operator()(const Vector_d& v) const { return CGAL::ORIGIN+v; } }; Vector_to_point_d vector_to_point_d_object() const { return Vector_to_point_d(); } struct Construct_vector_d { Vector_d operator()(int, Null_vector) const { return Vector_d(NULL_VECTOR); } }; Construct_vector_d construct_vector_d_object() const { return Construct_vector_d(); } struct Construct_hyperplane_d { template <class I> Hyperplane_d operator()(I s, I e, const Point_d& p, Oriented_side side) { Hyperplane_d pl; Point_d A[3]; A[0] = *s; ++s; if(s == e){ pl = Hyperplane_d( A[0], A[0] - p); } else { A[1] = *s; ++s; if(s == e){ typename R_::Point_3 hp = A[0] + cross_product( p - A[0], A[1] - A[0] ); pl = Hyperplane_d( A[0], A[1], hp ); } else { A[2] = *s; ++s; if(s == e){ pl = Hyperplane_d( A[0], A[1], A[2] ); } else { CGAL_error(); } } } if (side != 0) { if ( pl.oriented_side(p) != side ) { pl = pl.opposite(); } } return pl; } }; Construct_hyperplane_d construct_hyperplane_d_object() const { return Construct_hyperplane_d(); } typedef typename R::Intersect_3 Intersect_d; Intersect_d intersect_d_object() const { return Intersect_d(); } }; } //namespace CGAL #endif // CGAL_CONVEX_HULL_D_TRAITS_3_H
24.089606
101
0.581759
[ "vector" ]
966b378ccce7e7351b8b49dd42bf9f529b2e6744
3,500
h
C
src/path.h
fstromback/mymake
1ccb9adbc5a336e29ca222f11e9368cdd026ee1b
[ "MIT" ]
3
2017-05-30T11:29:06.000Z
2021-09-04T15:32:23.000Z
src/path.h
fstromback/mymake
1ccb9adbc5a336e29ca222f11e9368cdd026ee1b
[ "MIT" ]
5
2016-01-22T20:06:19.000Z
2019-02-03T18:30:58.000Z
src/path.h
fstromback/mymake
1ccb9adbc5a336e29ca222f11e9368cdd026ee1b
[ "MIT" ]
null
null
null
#pragma once #include "timestamp.h" /** * Information about a file. Returned from the Path::info() member. Avoids calling exists(), cTime() * and mTime() separately if they are all needed. */ class FileInfo { public: // Create. FileInfo(bool exists, Timestamp cTime = Timestamp(0), Timestamp mTime = Timestamp(0)) : exists(exists), cTime(cTime), mTime(mTime) {} // Does the file exist? bool exists; // Created time. 0 if the file does not exist. Timestamp cTime; // Modified time. 0 if the file does not exist. Timestamp mTime; }; /** * A class for managing path names. */ class Path { friend std::ostream &operator <<(std::ostream &to, const Path &path); public: // Current working directory. static Path cwd(); // User's home directory. static Path home(); // Are the string equal regarding the current OS? static bool equal(const String &a, const String &b); static int compare(const String &a, const String &b); // Create an empty path. Path(); // Create a path object from a string. explicit Path(const String &path); // Comparison. bool operator ==(const Path &o) const; inline bool operator !=(const Path &o) const { return !(*this == o); } bool operator <(const Path &o) const; bool operator >(const Path &o) const; // Concat this path with another path, the other path must be relative. Path operator +(const Path &other) const; Path &operator +=(const Path &other); // Add a string to go deeper into the hierarchy. If this object is not // a directory already, it will be made into one. Path operator +(const String &file) const; Path &operator +=(const String &file); // Status about this path. bool isDir() const; bool isAbsolute() const; bool isEmpty() const; // Make this obj a directory. inline void makeDir() { isDirectory = true; } // Get parent directory. Path parent() const; // Get first directory part. String first() const; // Get the title of this file or directory. String title() const; String titleNoExt() const; // Get file extension (always the last one). String ext() const; // Set the file extension (always the last one). void makeExt(const String &ext); // Set the title (includes ext). void makeTitle(const String &title); // Does the file exist? bool exists() const; // Delete the file. void deleteFile() const; void deleteDir() const; // Recursive removal of file/directory. void recursiveDelete() const; // Make this path relative to another path. Absolute-making is accomplished by // using the + operator above. Path makeRelative(const Path &to) const; // Make this path absolute if it is not already. Path makeAbsolute() const; Path makeAbsolute(const Path &abs) const; // Check if this path is a child of another path. bool isChild(const Path &to) const; // Find the children of this path. vector<Path> children() const; // Modified time. Timestamp mTime() const; // Created time. Timestamp cTime() const; // Get file information. Essentially calls cTime, mTime and exists at the same time. FileInfo info() const; // Create this path as directory if it does not already exist. void createDir() const; // Hash. size_t hash() const; private: // Internal representation is a list of strings, one for each part of the pathname. vector<String> parts; // Is this a directory? bool isDirectory; // Parse a path string. void parseStr(const String &str); // Simplify a path string, which means to remove any . and .. void simplify(); };
24.475524
100
0.698
[ "object", "vector" ]
966c4033750686dcb977648aa79e1eb2737e46b7
1,269
c
C
DistanceField/DistanceField/src/core/Font.c
chunkyguy/EWOGL
29fd10b37e2e19e5e586c7ca794649200c514b7b
[ "MIT" ]
2
2015-03-25T23:20:33.000Z
2016-12-03T04:37:46.000Z
DistanceField/DistanceField/src/core/Font.c
chunkyguy/EWOGL
29fd10b37e2e19e5e586c7ca794649200c514b7b
[ "MIT" ]
null
null
null
DistanceField/DistanceField/src/core/Font.c
chunkyguy/EWOGL
29fd10b37e2e19e5e586c7ca794649200c514b7b
[ "MIT" ]
null
null
null
/* example1.c */ /* */ /* This small program shows how to print a rotated string with the */ /* FreeType 2 library. */ #include "Font.h" #include <assert.h> #include <stdio.h> #include <string.h> #include <math.h> #include "std_incl.h" #include "Utilities.h" #include "Constants.h" #define FONT_FREETYPE #if defined (FONT_FREETYPE) #include <ft2build.h> #include FT_FREETYPE_H Font *CreateFont(Font *font, const char *path) { FT_Error error = FT_Init_FreeType( &font->library ); /* initialize library */ assert(!error); error = FT_New_Face( font->library, path, 0, &font->face );/* create face object */ assert(!error); return font; } void ReleaseFont(Font *font) { FT_Done_Face ( font->face ); FT_Done_FreeType( font->library ); font = NULL; } #else #include "../fontstash/fontstash.h" Font *CreateFont(Font *font, const char *path, const Vec2i *size) { font->stash = sth_create(size->x, size->y); font->size = 14.0f; font->ID = sth_add_font(font->stash, path); return font; } void ReleaseFont(Font *font) { sth_delete(font->stash); font = NULL; } #endif /* EOF */
23.072727
91
0.587864
[ "object" ]
966f3515cf36ca68d5ce6980cb762202ace0a429
10,646
h
C
VART/samples/adas_detection/src/utils.h
dendisuhubdy/Vitis-AI
524f65224c52314155dafc011d488ed30e458fcb
[ "Apache-2.0" ]
848
2019-12-03T00:16:17.000Z
2022-03-31T22:53:17.000Z
dsa/WAA-TRD/app/adas_detection/src/utils.h
wangyifan778/Vitis-AI
f61061eef7550d98bf02a171604c9a9f283a7c47
[ "Apache-2.0" ]
656
2019-12-03T00:48:46.000Z
2022-03-31T18:41:54.000Z
dsa/WAA-TRD/app/adas_detection/src/utils.h
wangyifan778/Vitis-AI
f61061eef7550d98bf02a171604c9a9f283a7c47
[ "Apache-2.0" ]
506
2019-12-03T00:46:26.000Z
2022-03-30T10:34:56.000Z
/* * Copyright 2019 Xilinx Inc. * * 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. */ /* The following source code derives from Darknet */ #include <algorithm> #include <iomanip> #include <iosfwd> #include <memory> #include <string> #include <utility> #include <vector> #include <math.h> #include <opencv2/opencv.hpp> using namespace std; using namespace std::chrono; #define CONF 0.5 const int classificationCnt = 3; const int anchorCnt = 5; typedef struct { int w; int h; int c; float *data; } image; image load_image_cv(const cv::Mat& img); image letterbox_image(image im, int w, int h); void free_image(image m); inline float sigmoid(float p) { return 1.0 / (1 + exp(-p * 1.0)); } inline float overlap(float x1, float w1, float x2, float w2) { float left = max(x1 - w1 / 2.0, x2 - w2 / 2.0); float right = min(x1 + w1 / 2.0, x2 + w2 / 2.0); return right - left; } inline float cal_iou(vector<float> box, vector<float>truth) { float w = overlap(box[0], box[2], truth[0], truth[2]); float h = overlap(box[1], box[3], truth[1], truth[3]); if(w < 0 || h < 0) return 0; float inter_area = w * h; float union_area = box[2] * box[3] + truth[2] * truth[3] - inter_area; return inter_area * 1.0 / union_area; } void correct_region_boxes(vector<vector<float>>& boxes, int n, int w, int h, int netw, int neth, int relative = 0) { int new_w=0; int new_h=0; if (((float)netw/w) < ((float)neth/h)) { new_w = netw; new_h = (h * netw)/w; } else { new_h = neth; new_w = (w * neth)/h; } for (int i = 0; i < n; ++i){ boxes[i][0] = (boxes[i][0] - (netw - new_w)/2./netw) / ((float)new_w/(float)netw); boxes[i][1] = (boxes[i][1] - (neth - new_h)/2./neth) / ((float)new_h/(float)neth); boxes[i][2] *= (float)netw/new_w; boxes[i][3] *= (float)neth/new_h; } } void detect(vector<vector<float>> &boxes, vector<float> result, int channel, int height, int weight, int num, int sh, int sw); void detect(vector<vector<float>> &boxes, vector<float> result, int channel, int height, int width, int num, int sHeight, int sWidth) { vector<float> biases{ 123,100, 167,83, 98,174, 165,158, 347,98, 76,37, 40,97, 74,64, 105,63, 66,131,18,46, 33,29, 47,23, 28,68, 52,42, 5.5,7, 8,17, 14,11, 13,29, 24,17 }; int conf_box = 5 + classificationCnt; float swap[height * width][anchorCnt][conf_box]; for (int h = 0; h < height; ++h) { for (int w = 0; w < width; ++w) { for (int c = 0; c < channel; ++c) { int temp = c * height * width + h * width + w; swap[h * width + w][c / conf_box][c % conf_box] = result[temp]; } } } for (int h = 0; h < height; ++h) { for (int w = 0; w < width; ++w) { for (int c = 0; c < anchorCnt; ++c) { float obj_score = sigmoid(swap[h * width + w][c][4]); if (obj_score < CONF) continue; vector<float> box; box.push_back((w + sigmoid(swap[h * width + w][c][0])) / width); box.push_back((h + sigmoid(swap[h * width + w][c][1])) / height); box.push_back(exp(swap[h * width + w][c][2]) * biases[2 * c + 10 * num] / float(sWidth)); box.push_back(exp(swap[h * width + w][c][3]) * biases[2 * c + 10 * num + 1] / float(sHeight)); box.push_back(-1); box.push_back(obj_score); for (int p = 0; p < classificationCnt; p++) { box.push_back(obj_score * sigmoid(swap[h * width + w][c][5 + p])); } boxes.push_back(box); } } } } vector<vector<float>> applyNMS(vector<vector<float>>& boxes,int classes, const float thres) { vector<pair<int, float>> order(boxes.size()); vector<vector<float>> result; for(int k = 0; k < classes; k++) { for (size_t i = 0; i < boxes.size(); ++i) { order[i].first = i; boxes[i][4] = k; order[i].second = boxes[i][6 + k]; } sort(order.begin(), order.end(), [](const pair<int, float> &ls, const pair<int, float> &rs) { return ls.second > rs.second; }); vector<bool> exist_box(boxes.size(), true); for (size_t _i = 0; _i < boxes.size(); ++_i) { size_t i = order[_i].first; if (!exist_box[i]) continue; if (boxes[i][6 + k] < CONF) { exist_box[i] = false; continue; } /* add a box as result */ result.push_back(boxes[i]); for (size_t _j = _i + 1; _j < boxes.size(); ++_j) { size_t j = order[_j].first; if (!exist_box[j]) continue; float ovr = cal_iou(boxes[j], boxes[i]); if (ovr >= thres) exist_box[j] = false; } } } return result; } void get_output(float* dpuOut, int sizeOut, int oc, int oh, int ow, vector<float>& result) { //vector<int8_t> nums(sizeOut); //memcpy(nums.data(), dpuOut, sizeOut); for(int a = 0; a < oc; ++a){ for(int b = 0; b < oh; ++b){ for(int c = 0; c < ow; ++c) { int offset = b * oc * ow + c * oc + a; result[a * oh * ow + b * ow + c] = dpuOut[offset]; } } } } static float get_pixel(image m, int x, int y, int c) { assert(x < m.w && y < m.h && c < m.c); return m.data[c*m.h*m.w + y*m.w + x]; } static void set_pixel(image m, int x, int y, int c, float val) { if (x < 0 || y < 0 || c < 0 || x >= m.w || y >= m.h || c >= m.c) return; assert(x < m.w && y < m.h && c < m.c); m.data[c*m.h*m.w + y*m.w + x] = val; } static void add_pixel(image m, int x, int y, int c, float val) { assert(x < m.w && y < m.h && c < m.c); m.data[c*m.h*m.w + y*m.w + x] += val; } image make_empty_image(int w, int h, int c) { image out; out.data = 0; out.h = h; out.w = w; out.c = c; return out; } void free_image(image m) { if(m.data){ free(m.data); } } image make_image(int w, int h, int c) { image out = make_empty_image(w,h,c); out.data = (float*) calloc(h*w*c, sizeof(float)); return out; } void fill_image(image m, float s) { int i; for(i = 0; i < m.h*m.w*m.c; ++i) m.data[i] = s; } void embed_image(image source, image dest, int dx, int dy) { int x,y,k; for(k = 0; k < source.c; ++k){ for(y = 0; y < source.h; ++y){ for(x = 0; x < source.w; ++x){ float val = get_pixel(source, x,y,k); set_pixel(dest, dx+x, dy+y, k, val); } } } } void ipl_into_image(IplImage* src, image im) { unsigned char *data = (unsigned char *)src->imageData; int h = src->height; int w = src->width; int c = src->nChannels; int step = src->widthStep; int i, j, k; for(i = 0; i < h; ++i){ for(k= 0; k < c; ++k){ for(j = 0; j < w; ++j){ im.data[k*w*h + i*w + j] = data[i*step + j*c + k]/256.; } } } } image ipl_to_image(IplImage* src) { int h = src->height; int w = src->width; int c = src->nChannels; image out = make_image(w, h, c); ipl_into_image(src, out); return out; } void rgbgr_image(image im) { int i; for(i = 0; i < im.w*im.h; ++i){ float swap = im.data[i]; im.data[i] = im.data[i+im.w*im.h*2]; im.data[i+im.w*im.h*2] = swap; } } image resize_image(image im, int w, int h) { image resized = make_image(w, h, im.c); image part = make_image(w, im.h, im.c); int r, c, k; float w_scale = (float)(im.w - 1) / (w - 1); float h_scale = (float)(im.h - 1) / (h - 1); for(k = 0; k < im.c; ++k){ for(r = 0; r < im.h; ++r){ for(c = 0; c < w; ++c){ float val = 0; if(c == w-1 || im.w == 1){ val = get_pixel(im, im.w-1, r, k); } else { float sx = c*w_scale; int ix = (int) sx; float dx = sx - ix; val = (1 - dx) * get_pixel(im, ix, r, k) + dx * get_pixel(im, ix+1, r, k); } set_pixel(part, c, r, k, val); } } } for(k = 0; k < im.c; ++k){ for(r = 0; r < h; ++r){ float sy = r*h_scale; int iy = (int) sy; float dy = sy - iy; for(c = 0; c < w; ++c){ float val = (1-dy) * get_pixel(part, c, iy, k); set_pixel(resized, c, r, k, val); } if(r == h-1 || im.h == 1) continue; for(c = 0; c < w; ++c){ float val = dy * get_pixel(part, c, iy+1, k); add_pixel(resized, c, r, k, val); } } } free_image(part); return resized; } image load_image_cv(const cv::Mat& img) { int h = img.rows; int w = img.cols; int c = img.channels(); image im = make_image(w, h, c); unsigned char *data = img.data; for(int i = 0; i < h; ++i){ for(int k= 0; k < c; ++k){ for(int j = 0; j < w; ++j){ im.data[k*w*h + i*w + j] = data[i*w*c + j*c + k]/256.; } } } for(int i = 0; i < im.w*im.h; ++i){ float swap = im.data[i]; im.data[i] = im.data[i+im.w*im.h*2]; im.data[i+im.w*im.h*2] = swap; } return im; } image letterbox_image(image im, int w, int h) { int new_w = im.w; int new_h = im.h; if (((float)w/im.w) < ((float)h/im.h)) { new_w = w; new_h = (im.h * w)/im.w; } else { new_h = h; new_w = (im.w * h)/im.h; } image resized = resize_image(im, new_w, new_h); image boxed = make_image(w, h, im.c); fill_image(boxed, .5); embed_image(resized, boxed, (w-new_w)/2, (h-new_h)/2); free_image(resized); return boxed; }
28.772973
110
0.495116
[ "vector" ]
966f4302d66e74af06d067ce78b1aa351aac74a2
26,013
c
C
libs/gum/heap/gumallocatorprobe.c
bannsec/frida-gum
b992f7aeea0e342882a6a20d814e9996109c0c24
[ "BSD-2-Clause", "BSD-3-Clause" ]
1
2020-02-01T19:50:06.000Z
2020-02-01T19:50:06.000Z
libs/gum/heap/gumallocatorprobe.c
bannsec/frida-gum
b992f7aeea0e342882a6a20d814e9996109c0c24
[ "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
libs/gum/heap/gumallocatorprobe.c
bannsec/frida-gum
b992f7aeea0e342882a6a20d814e9996109c0c24
[ "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
/* * Copyright (C) 2008-2019 Ole André Vadla Ravnås <oleavr@nowsecure.com> * Copyright (C) 2008 Christian Berentsen <jc.berentsen@gmail.com> * * Licence: wxWindows Library Licence, Version 3.1 */ #include "gumallocatorprobe.h" #include "gum-init.h" #include "guminterceptor.h" #include "gumprocess.h" #include "gumsymbolutil.h" #include <gmodule.h> #define DEFAULT_ENABLE_COUNTERS FALSE #define GUM_DBGCRT_UNKNOWN_BLOCK (-1) #define GUM_DBGCRT_NORMAL_BLOCK (1) #define GUM_DBGCRT_BLOCK_TYPE(type_bits) ((type_bits) & 0xffff) typedef struct _FunctionContext FunctionContext; typedef struct _HeapHandlers HeapHandlers; typedef struct _ThreadContext ThreadContext; typedef struct _AllocThreadContext AllocThreadContext; typedef struct _ReallocThreadContext ReallocThreadContext; typedef void (* HeapEnterHandler) (GumAllocatorProbe * self, gpointer thread_ctx, GumInvocationContext * invocation_ctx, gpointer user_data); typedef void (* HeapLeaveHandler) (GumAllocatorProbe * self, gpointer thread_ctx, GumInvocationContext * invocation_ctx, gpointer user_data); typedef gint (* GumReportBlockTypeFunc) (gpointer block); struct _GumAllocatorProbe { GObject parent; gboolean disposed; GumInterceptor * interceptor; GPtrArray * function_contexts; GumAllocationTracker * allocation_tracker; gboolean enable_counters; guint malloc_count; guint realloc_count; guint free_count; }; enum { PROP_0, PROP_ALLOCATION_TRACKER, PROP_ENABLE_COUNTERS, PROP_MALLOC_COUNT, PROP_REALLOC_COUNT, PROP_FREE_COUNT }; struct _ThreadContext { gboolean ignored; GumCpuContext cpu_context; gpointer function_specific_storage[4]; }; struct _HeapHandlers { HeapEnterHandler enter_handler; HeapLeaveHandler leave_handler; }; struct _FunctionContext { HeapHandlers handlers; gpointer handler_data; ThreadContext thread_contexts[GUM_MAX_THREADS]; volatile gint thread_context_count; }; struct _AllocThreadContext { gboolean ignored; GumCpuContext cpu_context; gsize size; }; struct _ReallocThreadContext { gboolean ignored; GumCpuContext cpu_context; gpointer old_address; gsize new_size; }; struct _FreeThreadContext { gboolean ignored; GumCpuContext cpu_context; gpointer address; }; static void gum_allocator_probe_deinit (void); static void gum_allocator_probe_listener_iface_init (gpointer g_iface, gpointer iface_data); static void gum_allocator_probe_dispose (GObject * object); static void gum_allocator_probe_finalize (GObject * object); static void gum_allocator_probe_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gum_allocator_probe_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void gum_allocator_probe_apply_default_suppressions ( GumAllocatorProbe * self); static void gum_allocator_probe_on_enter (GumInvocationListener * listener, GumInvocationContext * context); static void gum_allocator_probe_on_leave (GumInvocationListener * listener, GumInvocationContext * context); static void attach_to_function (GumAllocatorProbe * self, gpointer function_address, const HeapHandlers * function_handlers, gpointer user_data); static void gum_allocator_probe_on_malloc (GumAllocatorProbe * self, gpointer address, guint size, const GumCpuContext * cpu_context); static void gum_allocator_probe_on_free (GumAllocatorProbe * self, gpointer address, const GumCpuContext * cpu_context); static void gum_allocator_probe_on_realloc (GumAllocatorProbe * self, gpointer old_address, gpointer new_address, guint new_size, const GumCpuContext * cpu_context); static void on_malloc_enter_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx); static void on_calloc_enter_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx); static void on_shared_xalloc_leave_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx); static void on_realloc_enter_handler (GumAllocatorProbe * self, ReallocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx); static void on_realloc_leave_handler (GumAllocatorProbe * self, ReallocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx); static void on_free_enter_handler (GumAllocatorProbe * self, gpointer thread_ctx, GumInvocationContext * invocation_ctx); static void on_malloc_dbg_enter_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx); static void on_calloc_dbg_enter_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx); static void on_realloc_dbg_enter_handler (GumAllocatorProbe * self, ReallocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx); static void on_free_dbg_enter_handler (GumAllocatorProbe * self, ThreadContext * thread_ctx, GumInvocationContext * invocation_ctx, gpointer user_data); static void decide_ignore_from_block_type (ThreadContext * thread_ctx, gint block_type); G_DEFINE_TYPE_EXTENDED (GumAllocatorProbe, gum_allocator_probe, G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE (GUM_TYPE_INVOCATION_LISTENER, gum_allocator_probe_listener_iface_init)) G_LOCK_DEFINE (_gum_allocator_probe_ignored_functions); static GArray * _gum_allocator_probe_ignored_functions = NULL; static void gum_allocator_probe_class_init (GumAllocatorProbeClass * klass) { GObjectClass * object_class = G_OBJECT_CLASS (klass); GParamSpec * pspec; object_class->set_property = gum_allocator_probe_set_property; object_class->get_property = gum_allocator_probe_get_property; object_class->dispose = gum_allocator_probe_dispose; object_class->finalize = gum_allocator_probe_finalize; pspec = g_param_spec_object ("allocation-tracker", "AllocationTracker", "AllocationTracker to use", GUM_TYPE_ALLOCATION_TRACKER, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_ALLOCATION_TRACKER, pspec); pspec = g_param_spec_boolean ("enable-counters", "Enable Counters", "Enable counters for probed functions", DEFAULT_ENABLE_COUNTERS, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_ENABLE_COUNTERS, pspec); pspec = g_param_spec_uint ("malloc-count", "Malloc Count", "Number of malloc() calls seen so far", 0, G_MAXUINT, 0, (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_MALLOC_COUNT, pspec); pspec = g_param_spec_uint ("realloc-count", "Realloc Count", "Number of realloc() calls seen so far", 0, G_MAXUINT, 0, (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_REALLOC_COUNT, pspec); pspec = g_param_spec_uint ("free-count", "Free Count", "Number of free() calls seen so far", 0, G_MAXUINT, 0, (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_FREE_COUNT, pspec); _gum_register_destructor (gum_allocator_probe_deinit); } static void gum_allocator_probe_deinit (void) { if (_gum_allocator_probe_ignored_functions != NULL) { g_array_free (_gum_allocator_probe_ignored_functions, TRUE); _gum_allocator_probe_ignored_functions = NULL; } } static void gum_allocator_probe_listener_iface_init (gpointer g_iface, gpointer iface_data) { GumInvocationListenerInterface * iface = g_iface; iface->on_enter = gum_allocator_probe_on_enter; iface->on_leave = gum_allocator_probe_on_leave; } static void gum_allocator_probe_init (GumAllocatorProbe * self) { self->interceptor = gum_interceptor_obtain (); self->function_contexts = g_ptr_array_sized_new (3); self->enable_counters = DEFAULT_ENABLE_COUNTERS; } static void gum_allocator_probe_dispose (GObject * object) { GumAllocatorProbe * self = GUM_ALLOCATOR_PROBE (object); if (!self->disposed) { self->disposed = TRUE; gum_allocator_probe_detach (self); g_clear_object (&self->allocation_tracker); g_clear_object (&self->interceptor); } G_OBJECT_CLASS (gum_allocator_probe_parent_class)->dispose (object); } static void gum_allocator_probe_finalize (GObject * object) { GumAllocatorProbe * self = GUM_ALLOCATOR_PROBE (object); g_ptr_array_free (self->function_contexts, TRUE); G_OBJECT_CLASS (gum_allocator_probe_parent_class)->finalize (object); } static void gum_allocator_probe_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { GumAllocatorProbe * self = GUM_ALLOCATOR_PROBE (object); switch (property_id) { case PROP_ALLOCATION_TRACKER: if (self->allocation_tracker != NULL) g_object_unref (self->allocation_tracker); self->allocation_tracker = g_value_dup_object (value); break; case PROP_ENABLE_COUNTERS: self->enable_counters = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void gum_allocator_probe_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GumAllocatorProbe * self = GUM_ALLOCATOR_PROBE (object); switch (property_id) { case PROP_ALLOCATION_TRACKER: g_value_set_object (value, self->allocation_tracker); break; case PROP_ENABLE_COUNTERS: g_value_set_boolean (value, self->enable_counters); break; case PROP_MALLOC_COUNT: g_value_set_uint (value, self->malloc_count); break; case PROP_REALLOC_COUNT: g_value_set_uint (value, self->realloc_count); break; case PROP_FREE_COUNT: g_value_set_uint (value, self->free_count); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static gboolean gum_allocator_probe_add_suppression_addresses_if_glib (const GumModuleDetails * details, gpointer user_data) { static const gchar * glib_function_name[] = { "g_quark_from_string", "g_quark_from_static_string", NULL }; static const gchar * gobject_function_name[] = { "g_signal_connect_data", "g_signal_handlers_destroy", "g_type_register_static", "g_type_add_interface_static", "g_param_spec_pool_insert", NULL }; GArray * ignored = (GArray *) user_data; gchar * name_lowercase; static const gchar ** function_name; name_lowercase = g_ascii_strdown (details->name, -1); if (g_strstr_len (name_lowercase, -1, "glib-2.0") != NULL) function_name = glib_function_name; else if (g_strstr_len (name_lowercase, -1, "gobject-2.0") != NULL) function_name = gobject_function_name; else function_name = NULL; if (function_name != NULL) { GModule * module; guint i; module = g_module_open (details->path, (GModuleFlags) 0); for (i = 0; function_name[i] != NULL; i++) { gpointer address = NULL; g_module_symbol (module, function_name[i], &address); g_array_append_val (ignored, address); } g_module_close (module); } g_free (name_lowercase); return TRUE; } static void gum_allocator_probe_apply_default_suppressions (GumAllocatorProbe * self) { GumInterceptor * interceptor = self->interceptor; GArray * ignored; guint i; G_LOCK (_gum_allocator_probe_ignored_functions); if (_gum_allocator_probe_ignored_functions == NULL) { static const gchar * internal_function_name[] = { "g_quark_new", "instance_real_class_set", "instance_real_class_remove", "gst_object_set_name_default" }; ignored = g_array_new (FALSE, FALSE, sizeof (gpointer)); for (i = 0; i != G_N_ELEMENTS (internal_function_name); i++) { GArray * addrs = gum_find_functions_named (internal_function_name[i]); if (addrs->len != 0) g_array_append_vals (ignored, addrs->data, addrs->len); g_array_free (addrs, TRUE); } gum_process_enumerate_modules ( gum_allocator_probe_add_suppression_addresses_if_glib, ignored); _gum_allocator_probe_ignored_functions = ignored; } else { ignored = _gum_allocator_probe_ignored_functions; } G_UNLOCK (_gum_allocator_probe_ignored_functions); gum_interceptor_begin_transaction (interceptor); for (i = 0; i != ignored->len; i++) gum_allocator_probe_suppress (self, g_array_index (ignored, gpointer, i)); gum_allocator_probe_suppress (self, GUM_FUNCPTR_TO_POINTER (g_quark_from_string)); gum_allocator_probe_suppress (self, GUM_FUNCPTR_TO_POINTER (g_quark_from_static_string)); gum_allocator_probe_suppress (self, GUM_FUNCPTR_TO_POINTER (g_signal_connect_data)); gum_allocator_probe_suppress (self, GUM_FUNCPTR_TO_POINTER (g_signal_handlers_destroy)); gum_allocator_probe_suppress (self, GUM_FUNCPTR_TO_POINTER (g_type_register_static)); gum_allocator_probe_suppress (self, GUM_FUNCPTR_TO_POINTER (g_type_add_interface_static)); gum_allocator_probe_suppress (self, GUM_FUNCPTR_TO_POINTER (g_param_spec_pool_insert)); gum_interceptor_end_transaction (interceptor); } static void gum_allocator_probe_on_enter (GumInvocationListener * listener, GumInvocationContext * context) { GumAllocatorProbe * self; FunctionContext * function_ctx; self = GUM_ALLOCATOR_PROBE (listener); function_ctx = GUM_IC_GET_FUNC_DATA (context, FunctionContext *); gum_interceptor_ignore_current_thread (self->interceptor); if (function_ctx != NULL) { ThreadContext * base_thread_ctx; base_thread_ctx = GUM_IC_GET_INVOCATION_DATA (context, ThreadContext); base_thread_ctx->ignored = FALSE; function_ctx->handlers.enter_handler (self, base_thread_ctx, context, function_ctx->handler_data); } } static void gum_allocator_probe_on_leave (GumInvocationListener * listener, GumInvocationContext * context) { GumAllocatorProbe * self; FunctionContext * function_ctx; self = GUM_ALLOCATOR_PROBE (listener); function_ctx = GUM_IC_GET_FUNC_DATA (context, FunctionContext *); if (function_ctx != NULL) { ThreadContext * base_thread_ctx; base_thread_ctx = GUM_IC_GET_INVOCATION_DATA (context, ThreadContext); if (!base_thread_ctx->ignored) { if (function_ctx->handlers.leave_handler != NULL) { function_ctx->handlers.leave_handler (self, base_thread_ctx, context, function_ctx->handler_data); } } } gum_interceptor_unignore_current_thread (self->interceptor); } GumAllocatorProbe * gum_allocator_probe_new (void) { return g_object_new (GUM_TYPE_ALLOCATOR_PROBE, NULL); } static const HeapHandlers gum_malloc_handlers = { (HeapEnterHandler) on_malloc_enter_handler, (HeapLeaveHandler) on_shared_xalloc_leave_handler }; static const HeapHandlers gum_calloc_handlers = { (HeapEnterHandler) on_calloc_enter_handler, (HeapLeaveHandler) on_shared_xalloc_leave_handler }; static const HeapHandlers gum_realloc_handlers = { (HeapEnterHandler) on_realloc_enter_handler, (HeapLeaveHandler) on_realloc_leave_handler }; static const HeapHandlers gum_free_handlers = { (HeapEnterHandler) on_free_enter_handler, NULL }; static const HeapHandlers gum__malloc_dbg_handlers = { (HeapEnterHandler) on_malloc_dbg_enter_handler, (HeapLeaveHandler) on_shared_xalloc_leave_handler }; static const HeapHandlers gum__calloc_dbg_handlers = { (HeapEnterHandler) on_calloc_dbg_enter_handler, (HeapLeaveHandler) on_shared_xalloc_leave_handler }; static const HeapHandlers gum__realloc_dbg_handlers = { (HeapEnterHandler) on_realloc_dbg_enter_handler, (HeapLeaveHandler) on_realloc_leave_handler }; static const HeapHandlers gum__free_dbg_handlers = { (HeapEnterHandler) on_free_dbg_enter_handler, NULL }; void gum_allocator_probe_attach (GumAllocatorProbe * self) { GumHeapApiList * apis = gum_process_find_heap_apis (); gum_allocator_probe_attach_to_apis (self, apis); gum_heap_api_list_free (apis); } #define GUM_ATTACH_TO_API_FUNC(name) \ attach_to_function (self, GUM_FUNCPTR_TO_POINTER (api->name), \ &gum_##name##_handlers, NULL) #define GUM_ATTACH_TO_API_FUNC_WITH_DATA(name, data) \ attach_to_function (self, GUM_FUNCPTR_TO_POINTER (api->name), \ &gum_##name##_handlers, data) void gum_allocator_probe_attach_to_apis (GumAllocatorProbe * self, const GumHeapApiList * apis) { guint i; gum_interceptor_ignore_current_thread (self->interceptor); gum_interceptor_begin_transaction (self->interceptor); for (i = 0; i != apis->len; i++) { const GumHeapApi * api = gum_heap_api_list_get_nth (apis, i); GUM_ATTACH_TO_API_FUNC (malloc); GUM_ATTACH_TO_API_FUNC (calloc); GUM_ATTACH_TO_API_FUNC (realloc); GUM_ATTACH_TO_API_FUNC (free); if (api->_malloc_dbg != NULL) { GUM_ATTACH_TO_API_FUNC (_malloc_dbg); GUM_ATTACH_TO_API_FUNC (_calloc_dbg); GUM_ATTACH_TO_API_FUNC (_realloc_dbg); GUM_ATTACH_TO_API_FUNC_WITH_DATA (_free_dbg, GUM_FUNCPTR_TO_POINTER (api->_CrtReportBlockType)); } } gum_allocator_probe_apply_default_suppressions (self); gum_interceptor_end_transaction (self->interceptor); gum_interceptor_unignore_current_thread (self->interceptor); } void gum_allocator_probe_detach (GumAllocatorProbe * self) { guint i; gum_interceptor_ignore_current_thread (self->interceptor); gum_interceptor_detach (self->interceptor, GUM_INVOCATION_LISTENER (self)); for (i = 0; i < self->function_contexts->len; i++) { FunctionContext * function_ctx = (FunctionContext *) g_ptr_array_index (self->function_contexts, i); g_free (function_ctx); } g_ptr_array_set_size (self->function_contexts, 0); self->malloc_count = 0; self->realloc_count = 0; self->free_count = 0; gum_interceptor_unignore_current_thread (self->interceptor); } static void attach_to_function (GumAllocatorProbe * self, gpointer function_address, const HeapHandlers * function_handlers, gpointer user_data) { GumInvocationListener * listener = GUM_INVOCATION_LISTENER (self); FunctionContext * function_ctx; function_ctx = g_new0 (FunctionContext, 1); function_ctx->handlers = *function_handlers; function_ctx->handler_data = user_data; g_ptr_array_add (self->function_contexts, function_ctx); gum_interceptor_attach (self->interceptor, function_address, listener, function_ctx); } void gum_allocator_probe_suppress (GumAllocatorProbe * self, gpointer function_address) { GumInvocationListener * listener = GUM_INVOCATION_LISTENER (self); gum_interceptor_attach (self->interceptor, function_address, listener, NULL); } static void gum_allocator_probe_on_malloc (GumAllocatorProbe * self, gpointer address, guint size, const GumCpuContext * cpu_context) { if (self->enable_counters) self->malloc_count++; if (self->allocation_tracker != NULL) { gum_allocation_tracker_on_malloc_full (self->allocation_tracker, address, size, cpu_context); } } static void gum_allocator_probe_on_free (GumAllocatorProbe * self, gpointer address, const GumCpuContext * cpu_context) { if (self->enable_counters) self->free_count++; if (self->allocation_tracker != NULL) { gum_allocation_tracker_on_free_full (self->allocation_tracker, address, cpu_context); } } static void gum_allocator_probe_on_realloc (GumAllocatorProbe * self, gpointer old_address, gpointer new_address, guint new_size, const GumCpuContext * cpu_context) { if (self->enable_counters) self->realloc_count++; if (self->allocation_tracker != NULL) { gum_allocation_tracker_on_realloc_full (self->allocation_tracker, old_address, new_address, new_size, cpu_context); } } static void on_malloc_enter_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx) { thread_ctx->cpu_context = *invocation_ctx->cpu_context; thread_ctx->size = (gsize) gum_invocation_context_get_nth_argument (invocation_ctx, 0); } static void on_calloc_enter_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx) { gsize num, size; num = (gsize) gum_invocation_context_get_nth_argument (invocation_ctx, 0); size = (gsize) gum_invocation_context_get_nth_argument (invocation_ctx, 1); thread_ctx->cpu_context = *invocation_ctx->cpu_context; thread_ctx->size = num * size; } static void on_shared_xalloc_leave_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx) { gpointer return_value; return_value = gum_invocation_context_get_return_value (invocation_ctx); if (return_value != NULL) { gum_allocator_probe_on_malloc (self, return_value, thread_ctx->size, &thread_ctx->cpu_context); } } static void on_realloc_enter_handler (GumAllocatorProbe * self, ReallocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx) { thread_ctx->cpu_context = *invocation_ctx->cpu_context; thread_ctx->old_address = gum_invocation_context_get_nth_argument (invocation_ctx, 0); thread_ctx->new_size = (gsize) gum_invocation_context_get_nth_argument (invocation_ctx, 1); } static void on_realloc_leave_handler (GumAllocatorProbe * self, ReallocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx) { gpointer return_value; return_value = gum_invocation_context_get_return_value (invocation_ctx); if (return_value != NULL) { gum_allocator_probe_on_realloc (self, thread_ctx->old_address, return_value, thread_ctx->new_size, &thread_ctx->cpu_context); } } static void on_free_enter_handler (GumAllocatorProbe * self, gpointer thread_ctx, GumInvocationContext * invocation_ctx) { gpointer address; address = gum_invocation_context_get_nth_argument (invocation_ctx, 0); gum_allocator_probe_on_free (self, address, invocation_ctx->cpu_context); } static void on_malloc_dbg_enter_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx) { gint block_type; block_type = (gint) GPOINTER_TO_SIZE ( gum_invocation_context_get_nth_argument (invocation_ctx, 1)); decide_ignore_from_block_type ((ThreadContext *) thread_ctx, block_type); if (!thread_ctx->ignored) on_malloc_enter_handler (self, thread_ctx, invocation_ctx); } static void on_calloc_dbg_enter_handler (GumAllocatorProbe * self, AllocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx) { gint block_type; block_type = (gint) GPOINTER_TO_SIZE ( gum_invocation_context_get_nth_argument (invocation_ctx, 2)); decide_ignore_from_block_type ((ThreadContext *) thread_ctx, block_type); if (!thread_ctx->ignored) on_calloc_enter_handler (self, thread_ctx, invocation_ctx); } static void on_realloc_dbg_enter_handler (GumAllocatorProbe * self, ReallocThreadContext * thread_ctx, GumInvocationContext * invocation_ctx) { gint block_type; block_type = (gint) GPOINTER_TO_SIZE ( gum_invocation_context_get_nth_argument (invocation_ctx, 2)); decide_ignore_from_block_type ((ThreadContext *) thread_ctx, block_type); if (!thread_ctx->ignored) on_realloc_enter_handler (self, thread_ctx, invocation_ctx); } static void on_free_dbg_enter_handler (GumAllocatorProbe * self, ThreadContext * thread_ctx, GumInvocationContext * invocation_ctx, gpointer user_data) { gint block_type; block_type = (gint) GPOINTER_TO_SIZE ( gum_invocation_context_get_nth_argument (invocation_ctx, 1)); if (block_type == GUM_DBGCRT_UNKNOWN_BLOCK) { gpointer block; GumReportBlockTypeFunc report_block_type; block = gum_invocation_context_get_nth_argument (invocation_ctx, 0); report_block_type = GUM_POINTER_TO_FUNCPTR (GumReportBlockTypeFunc, user_data); block_type = GUM_DBGCRT_BLOCK_TYPE (report_block_type (block)); } decide_ignore_from_block_type ((ThreadContext *) thread_ctx, block_type); if (!thread_ctx->ignored) on_free_enter_handler (self, thread_ctx, invocation_ctx); } static void decide_ignore_from_block_type (ThreadContext * thread_ctx, gint block_type) { thread_ctx->ignored = (block_type != GUM_DBGCRT_NORMAL_BLOCK); }
30.212544
88
0.728597
[ "object" ]
96759b6da3307bb05c29c12c3d8eb63e1ada7d7b
771
h
C
Shoot/include/OpenGL/OpenGLVertexBufferES_1_1_NoVAO.h
franticsoftware/vlad-heavy-strike
a4da4df617e9ccd6ebd9819ad166d892924638ce
[ "MIT" ]
3
2019-10-04T19:44:44.000Z
2021-07-27T15:59:39.000Z
Shoot/include/OpenGL/OpenGLVertexBufferES_1_1_NoVAO.h
franticsoftware/vlad-heavy-strike
a4da4df617e9ccd6ebd9819ad166d892924638ce
[ "MIT" ]
1
2019-07-20T05:36:31.000Z
2019-07-20T22:22:49.000Z
Shoot/include/OpenGL/OpenGLVertexBufferES_1_1_NoVAO.h
aminere/vlad-heavy-strike
a4da4df617e9ccd6ebd9819ad166d892924638ce
[ "MIT" ]
null
null
null
/* Amine Rehioui Created: July 11th 2013 */ #ifndef _OPENGL_VERTEX_BUFFER_ES_1_1_NoVAO_H_INCLUDED_ #define _OPENGL_VERTEX_BUFFER_ES_1_1_NoVAO_H_INCLUDED_ #include "OpenGLVertexBufferES_1_1.h" namespace shoot { //! OpenGL vertex buffer ES 1.1 No VAO class OpenGLVertexBufferES_1_1_NoVAO : public OpenGLVertexBufferES_1_1 { public: //! Load into video memory void GraphicLoad(); //! returns loaded status bool IsLoaded() { return m_VBO_ID != 0; } //! updates the vertex buffer data void UpdateData(); //! begins rendering using this vertex buffer void Begin(); //! ends rendering by this vertex buffer void End(); //! create a copy of the object Object* Copy() const; }; } #endif // _OPENGL_VERTEX_BUFFER_ES_1_1_NoVAO_H_INCLUDED_
18.357143
71
0.7393
[ "object" ]
323484ab43b4d04648b6e37126698fff69d0b5ba
60,387
c
C
dlls/wined3d/nvidia_texture_shader.c
Rondom/wine
47b50cfc2644572c61accb8d4badad50efd495e8
[ "MIT" ]
42
2018-12-28T11:06:21.000Z
2022-02-26T23:29:51.000Z
dlls/wined3d/nvidia_texture_shader.c
jzengc/wine-git
cab0766d9b038c52ca9a39d1baef5ad906d54fbd
[ "MIT" ]
20
2018-12-15T13:10:16.000Z
2019-10-21T09:51:56.000Z
dlls/wined3d/nvidia_texture_shader.c
jzengc/wine-git
cab0766d9b038c52ca9a39d1baef5ad906d54fbd
[ "MIT" ]
3
2019-01-03T21:40:44.000Z
2019-05-20T12:53:35.000Z
/* * Fixed function pipeline replacement using GL_NV_register_combiners * and GL_NV_texture_shader * * Copyright 2006 Henri Verbeet * Copyright 2008 Stefan Dösinger(for CodeWeavers) * * 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 2.1 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. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" #include "wine/port.h" #include <stdio.h> #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); /* Context activation for state handlers is done by the caller. */ static void nvts_activate_dimensions(const struct wined3d_state *state, DWORD stage, struct wined3d_context *context) { const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_texture *texture; BOOL bumpmap = FALSE; if (stage > 0 && (state->texture_states[stage - 1][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP_LUMINANCE || state->texture_states[stage - 1][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP)) { bumpmap = TRUE; context->texShaderBumpMap |= (1u << stage); } else { context->texShaderBumpMap &= ~(1u << stage); } if ((texture = state->textures[stage])) { switch (wined3d_texture_gl(texture)->target) { case GL_TEXTURE_2D: gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, bumpmap ? GL_OFFSET_TEXTURE_2D_NV : GL_TEXTURE_2D); checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, ...)"); break; case GL_TEXTURE_RECTANGLE_ARB: gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, bumpmap ? GL_OFFSET_TEXTURE_2D_NV : GL_TEXTURE_RECTANGLE_ARB); checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, ...)"); break; case GL_TEXTURE_3D: gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_3D); checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_3D)"); break; case GL_TEXTURE_CUBE_MAP_ARB: gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_CUBE_MAP_ARB); checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_CUBE_MAP_ARB)"); break; default: FIXME("Unhandled target %#x.\n", wined3d_texture_gl(texture)->target); break; } } else { gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE); checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE)"); } } struct tex_op_args { GLenum input[3]; GLenum mapping[3]; GLenum component_usage[3]; }; static GLenum d3dta_to_combiner_input(DWORD d3dta, DWORD stage, INT texture_idx) { switch (d3dta) { case WINED3DTA_DIFFUSE: return GL_PRIMARY_COLOR_NV; case WINED3DTA_CURRENT: if (stage) return GL_SPARE0_NV; else return GL_PRIMARY_COLOR_NV; case WINED3DTA_TEXTURE: if (texture_idx > -1) return GL_TEXTURE0_ARB + texture_idx; else return GL_PRIMARY_COLOR_NV; case WINED3DTA_TFACTOR: return GL_CONSTANT_COLOR0_NV; case WINED3DTA_SPECULAR: return GL_SECONDARY_COLOR_NV; case WINED3DTA_TEMP: return GL_SPARE1_NV; case WINED3DTA_CONSTANT: /* TODO: Support per stage constants (WINED3D_TSS_CONSTANT, NV_register_combiners2) */ FIXME("WINED3DTA_CONSTANT, not properly supported.\n"); return GL_CONSTANT_COLOR1_NV; default: FIXME("Unrecognized texture arg %#x\n", d3dta); return GL_TEXTURE; } } static GLenum invert_mapping(GLenum mapping) { if (mapping == GL_UNSIGNED_INVERT_NV) return GL_UNSIGNED_IDENTITY_NV; else if (mapping == GL_UNSIGNED_IDENTITY_NV) return GL_UNSIGNED_INVERT_NV; FIXME("Unhandled mapping %#x\n", mapping); return mapping; } static void get_src_and_opr_nvrc(DWORD stage, DWORD arg, BOOL is_alpha, GLenum* input, GLenum* mapping, GLenum *component_usage, INT texture_idx) { /* The WINED3DTA_COMPLEMENT flag specifies the complement of the input should * be used. */ if (arg & WINED3DTA_COMPLEMENT) *mapping = GL_UNSIGNED_INVERT_NV; else *mapping = GL_UNSIGNED_IDENTITY_NV; /* Clamp all values to positive ranges */ /* The WINED3DTA_ALPHAREPLICATE flag specifies the alpha component of the input * should be used for all input components. */ if (is_alpha || arg & WINED3DTA_ALPHAREPLICATE) *component_usage = GL_ALPHA; else *component_usage = GL_RGB; *input = d3dta_to_combiner_input(arg & WINED3DTA_SELECTMASK, stage, texture_idx); } void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, BOOL is_alpha, int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst) { struct tex_op_args tex_op_args = {{0}, {0}, {0}}; GLenum portion = is_alpha ? GL_ALPHA : GL_RGB; GLenum target = GL_COMBINER0_NV + stage; GLenum output; TRACE("stage %d, is_alpha %d, op %s, arg1 %#x, arg2 %#x, arg3 %#x, texture_idx %d\n", stage, is_alpha, debug_d3dtop(op), arg1, arg2, arg3, texture_idx); /* If a texture stage references an invalid texture unit the stage just * passes through the result from the previous stage */ if (is_invalid_op(state, stage, op, arg1, arg2, arg3)) { arg1 = WINED3DTA_CURRENT; op = WINED3D_TOP_SELECT_ARG1; } get_src_and_opr_nvrc(stage, arg1, is_alpha, &tex_op_args.input[0], &tex_op_args.mapping[0], &tex_op_args.component_usage[0], texture_idx); get_src_and_opr_nvrc(stage, arg2, is_alpha, &tex_op_args.input[1], &tex_op_args.mapping[1], &tex_op_args.component_usage[1], texture_idx); get_src_and_opr_nvrc(stage, arg3, is_alpha, &tex_op_args.input[2], &tex_op_args.mapping[2], &tex_op_args.component_usage[2], texture_idx); if(dst == WINED3DTA_TEMP) { output = GL_SPARE1_NV; } else { output = GL_SPARE0_NV; } switch (op) { case WINED3D_TOP_DISABLE: /* Only for alpha */ if (!is_alpha) ERR("Shouldn't be called for WINED3D_TSS_COLOR_OP (WINED3DTOP_DISABLE).\n"); /* Input, prev_alpha*1 */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA)); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_SPARE0_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_SELECT_ARG1: case WINED3D_TOP_SELECT_ARG2: /* Input, arg*1 */ if (op == WINED3D_TOP_SELECT_ARG1) GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); else GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_MODULATE: case WINED3D_TOP_MODULATE_2X: case WINED3D_TOP_MODULATE_4X: /* Input, arg1*arg2 */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); /* Output */ if (op == WINED3D_TOP_MODULATE) GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); else if (op == WINED3D_TOP_MODULATE_2X) GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV, GL_DISCARD_NV, GL_SCALE_BY_TWO_NV, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); else if (op == WINED3D_TOP_MODULATE_4X) GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV, GL_DISCARD_NV, GL_SCALE_BY_FOUR_NV, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_ADD: case WINED3D_TOP_ADD_SIGNED: case WINED3D_TOP_ADD_SIGNED_2X: /* Input, arg1*1+arg2*1 */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); /* Output */ if (op == WINED3D_TOP_ADD) GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); else if (op == WINED3D_TOP_ADD_SIGNED) GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_BIAS_BY_NEGATIVE_ONE_HALF_NV, GL_FALSE, GL_FALSE, GL_FALSE)); else if (op == WINED3D_TOP_ADD_SIGNED_2X) GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_SCALE_BY_TWO_NV, GL_BIAS_BY_NEGATIVE_ONE_HALF_NV, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_SUBTRACT: /* Input, arg1*1+-arg2*1 */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[1], GL_SIGNED_NEGATE_NV, tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_ADD_SMOOTH: /* Input, arg1*1+(1-arg1)*arg2 */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[0], invert_mapping(tex_op_args.mapping[0]), tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_BLEND_DIFFUSE_ALPHA: case WINED3D_TOP_BLEND_TEXTURE_ALPHA: case WINED3D_TOP_BLEND_FACTOR_ALPHA: case WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM: case WINED3D_TOP_BLEND_CURRENT_ALPHA: { GLenum alpha_src = GL_PRIMARY_COLOR_NV; if (op == WINED3D_TOP_BLEND_DIFFUSE_ALPHA) alpha_src = d3dta_to_combiner_input(WINED3DTA_DIFFUSE, stage, texture_idx); else if (op == WINED3D_TOP_BLEND_TEXTURE_ALPHA) alpha_src = d3dta_to_combiner_input(WINED3DTA_TEXTURE, stage, texture_idx); else if (op == WINED3D_TOP_BLEND_FACTOR_ALPHA) alpha_src = d3dta_to_combiner_input(WINED3DTA_TFACTOR, stage, texture_idx); else if (op == WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM) alpha_src = d3dta_to_combiner_input(WINED3DTA_TEXTURE, stage, texture_idx); else if (op == WINED3D_TOP_BLEND_CURRENT_ALPHA) alpha_src = d3dta_to_combiner_input(WINED3DTA_CURRENT, stage, texture_idx); else FIXME("Unhandled texture op %s, shouldn't happen.\n", debug_d3dtop(op)); /* Input, arg1*alpha_src+arg2*(1-alpha_src) */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); if (op == WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM) { GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); } else { GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, alpha_src, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA)); } GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, alpha_src, GL_UNSIGNED_INVERT_NV, GL_ALPHA)); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; } case WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR: /* Input, arg1_alpha*arg2_rgb+arg1_rgb*1 */ if (is_alpha) ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEALPHA_ADDCOLOR).\n"); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], GL_ALPHA)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA: /* Input, arg1_rgb*arg2_rgb+arg1_alpha*1 */ if (is_alpha) ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATECOLOR_ADDALPHA).\n"); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[0], tex_op_args.mapping[0], GL_ALPHA)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR: /* Input, (1-arg1_alpha)*arg2_rgb+arg1_rgb*1 */ if (is_alpha) ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEINVALPHA_ADDCOLOR).\n"); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], invert_mapping(tex_op_args.mapping[0]), GL_ALPHA)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA: /* Input, (1-arg1_rgb)*arg2_rgb+arg1_alpha*1 */ if (is_alpha) ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEINVCOLOR_ADDALPHA).\n"); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], invert_mapping(tex_op_args.mapping[0]), tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[0], tex_op_args.mapping[0], GL_ALPHA)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_DOTPRODUCT3: /* Input, arg1 . arg2 */ /* FIXME: DX7 uses a different calculation? */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], GL_EXPAND_NORMAL_NV, tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, tex_op_args.input[1], GL_EXPAND_NORMAL_NV, tex_op_args.component_usage[1])); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE, GL_TRUE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_MULTIPLY_ADD: /* Input, arg3*1+arg1*arg2 */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[2], tex_op_args.mapping[2], tex_op_args.component_usage[2])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_LERP: /* Input, arg3*arg1+(1-arg3)*arg2 */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[2], tex_op_args.mapping[2], tex_op_args.component_usage[2])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV, tex_op_args.input[2], invert_mapping(tex_op_args.mapping[2]), tex_op_args.component_usage[2])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); /* Output */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV, output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; case WINED3D_TOP_BUMPENVMAP_LUMINANCE: case WINED3D_TOP_BUMPENVMAP: if (!gl_info->supported[NV_TEXTURE_SHADER]) { WARN("BUMPENVMAP requires GL_NV_texture_shader in this codepath\n"); break; } /* The bump map stage itself isn't exciting, just read the texture. But tell the next stage to * perform bump mapping and source from the current stage. Pretty much a SELECTARG2. * ARG2 is passed through unmodified(apps will most likely use D3DTA_CURRENT for arg2, arg1 * (which will most likely be D3DTA_TEXTURE) is available as a texture shader input for the * next stage */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, portion)); /* Always pass through to CURRENT, ignore temp arg */ GL_EXTCALL(glCombinerOutputNV(target, portion, GL_SPARE0_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE)); break; default: FIXME("Unhandled texture op: stage %d, is_alpha %d, op %s (%#x), arg1 %#x, arg2 %#x, arg3 %#x, texture_idx %d.\n", stage, is_alpha, debug_d3dtop(op), op, arg1, arg2, arg3, texture_idx); } checkGLcall("set_tex_op_nvrc()"); } static void nvrc_colorop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); BOOL tex_used = context->fixed_function_usage_map & (1u << stage); DWORD mapped_stage = context->tex_unit_map[stage]; const struct wined3d_gl_info *gl_info = context->gl_info; TRACE("Setting color op for stage %u.\n", stage); /* Using a pixel shader? Don't care for anything here, the shader applying does it */ if (use_ps(state)) return; if (stage != mapped_stage) WARN("Using non 1:1 mapping: %d -> %d!\n", stage, mapped_stage); if (mapped_stage != WINED3D_UNMAPPED_STAGE) { if (tex_used && mapped_stage >= gl_info->limits.textures) { FIXME("Attempt to enable unsupported stage!\n"); return; } context_active_texture(context, gl_info, mapped_stage); } if (context->lowest_disabled_stage > 0) { gl_info->gl_ops.gl.p_glEnable(GL_REGISTER_COMBINERS_NV); GL_EXTCALL(glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, context->lowest_disabled_stage)); } else { gl_info->gl_ops.gl.p_glDisable(GL_REGISTER_COMBINERS_NV); } if (stage >= context->lowest_disabled_stage) { TRACE("Stage disabled\n"); if (mapped_stage != WINED3D_UNMAPPED_STAGE) { /* Disable everything here */ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D); checkGLcall("glDisable(GL_TEXTURE_2D)"); gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D); checkGLcall("glDisable(GL_TEXTURE_3D)"); if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) { gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB); checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)"); } if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) { gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB); checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)"); } if (gl_info->supported[NV_TEXTURE_SHADER2] && mapped_stage < gl_info->limits.textures) { gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE); } } /* All done */ return; } /* The sampler will also activate the correct texture dimensions, so no need to do it here * if the sampler for this stage is dirty */ if (!isStateDirty(context, STATE_SAMPLER(stage))) { if (tex_used) { if (gl_info->supported[NV_TEXTURE_SHADER2]) { nvts_activate_dimensions(state, stage, context); } else { texture_activate_dimensions(state->textures[stage], gl_info); } } } /* Set the texture combiners */ set_tex_op_nvrc(gl_info, state, FALSE, stage, state->texture_states[stage][WINED3D_TSS_COLOR_OP], state->texture_states[stage][WINED3D_TSS_COLOR_ARG1], state->texture_states[stage][WINED3D_TSS_COLOR_ARG2], state->texture_states[stage][WINED3D_TSS_COLOR_ARG0], mapped_stage, state->texture_states[stage][WINED3D_TSS_RESULT_ARG]); /* In register combiners bump mapping is done in the stage AFTER the one that has the bump map operation set, * thus the texture shader may have to be updated */ if (gl_info->supported[NV_TEXTURE_SHADER2]) { BOOL usesBump = (state->texture_states[stage][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP_LUMINANCE || state->texture_states[stage][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP); BOOL usedBump = !!(context->texShaderBumpMap & 1u << (stage + 1)); if (usesBump != usedBump) { context_active_texture(context, gl_info, mapped_stage + 1); nvts_activate_dimensions(state, stage + 1, context); context_active_texture(context, gl_info, mapped_stage); } } } static void nvrc_resultarg(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); TRACE("Setting result arg for stage %u.\n", stage); if (!isStateDirty(context, STATE_TEXTURESTAGE(stage, WINED3D_TSS_COLOR_OP))) { context_apply_state(context, state, STATE_TEXTURESTAGE(stage, WINED3D_TSS_COLOR_OP)); } if (!isStateDirty(context, STATE_TEXTURESTAGE(stage, WINED3D_TSS_ALPHA_OP))) { context_apply_state(context, state, STATE_TEXTURESTAGE(stage, WINED3D_TSS_ALPHA_OP)); } } static void nvts_texdim(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD sampler = state_id - STATE_SAMPLER(0); DWORD mapped_stage = context->tex_unit_map[sampler]; /* No need to enable / disable anything here for unused samplers. The tex_colorop * handler takes care. Also no action is needed with pixel shaders, or if tex_colorop * will take care of this business. */ if (mapped_stage == WINED3D_UNMAPPED_STAGE || mapped_stage >= context->gl_info->limits.textures) return; if (sampler >= context->lowest_disabled_stage) return; if (isStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP))) return; nvts_activate_dimensions(state, sampler, context); } static void nvts_bumpenvmat(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); DWORD mapped_stage = context->tex_unit_map[stage + 1]; const struct wined3d_gl_info *gl_info = context->gl_info; float mat[2][2]; /* Direct3D sets the matrix in the stage reading the perturbation map. The result is used to * offset the destination stage(always stage + 1 in d3d). In GL_NV_texture_shader, the bump * map offsetting is done in the stage reading the bump mapped texture, and the perturbation * map is read from a specified source stage(always stage - 1 for d3d). Thus set the matrix * for stage + 1. Keep the nvrc tex unit mapping in mind too */ if (mapped_stage < gl_info->limits.textures) { context_active_texture(context, gl_info, mapped_stage); /* We can't just pass a pointer to the state to GL due to the * different matrix format (column major vs row major). */ mat[0][0] = *((float *)&state->texture_states[stage][WINED3D_TSS_BUMPENV_MAT00]); mat[1][0] = *((float *)&state->texture_states[stage][WINED3D_TSS_BUMPENV_MAT01]); mat[0][1] = *((float *)&state->texture_states[stage][WINED3D_TSS_BUMPENV_MAT10]); mat[1][1] = *((float *)&state->texture_states[stage][WINED3D_TSS_BUMPENV_MAT11]); gl_info->gl_ops.gl.p_glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, (float *)mat); checkGLcall("glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, mat)"); } } static void nvrc_texfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_color color; wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_TEXTUREFACTOR]); GL_EXTCALL(glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, &color.r)); } /* Context activation is done by the caller. */ static void nvrc_enable(const struct wined3d_gl_info *gl_info, BOOL enable) { if (enable) { gl_info->gl_ops.gl.p_glEnable(GL_REGISTER_COMBINERS_NV); checkGLcall("glEnable(GL_REGISTER_COMBINERS_NV)"); } else { gl_info->gl_ops.gl.p_glDisable(GL_REGISTER_COMBINERS_NV); checkGLcall("glDisable(GL_REGISTER_COMBINERS_NV)"); } } /* Context activation is done by the caller. */ static void nvts_enable(const struct wined3d_gl_info *gl_info, BOOL enable) { nvrc_enable(gl_info, enable); if (enable) { gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_SHADER_NV); checkGLcall("glEnable(GL_TEXTURE_SHADER_NV)"); } else { gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_SHADER_NV); checkGLcall("glDisable(GL_TEXTURE_SHADER_NV)"); } } static void nvrc_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) { caps->wined3d_caps = 0; caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP; /* The caps below can be supported but aren't handled yet in utils.c * 'd3dta_to_combiner_input', disable them until support is fixed */ #if 0 if (gl_info->supported[NV_REGISTER_COMBINERS2]) caps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_PERSTAGECONSTANT; #endif caps->TextureOpCaps = WINED3DTEXOPCAPS_ADD | WINED3DTEXOPCAPS_ADDSIGNED | WINED3DTEXOPCAPS_ADDSIGNED2X | WINED3DTEXOPCAPS_MODULATE | WINED3DTEXOPCAPS_MODULATE2X | WINED3DTEXOPCAPS_MODULATE4X | WINED3DTEXOPCAPS_SELECTARG1 | WINED3DTEXOPCAPS_SELECTARG2 | WINED3DTEXOPCAPS_DISABLE | WINED3DTEXOPCAPS_BLENDDIFFUSEALPHA | WINED3DTEXOPCAPS_BLENDTEXTUREALPHA | WINED3DTEXOPCAPS_BLENDFACTORALPHA | WINED3DTEXOPCAPS_BLENDCURRENTALPHA | WINED3DTEXOPCAPS_LERP | WINED3DTEXOPCAPS_SUBTRACT | WINED3DTEXOPCAPS_ADDSMOOTH | WINED3DTEXOPCAPS_MULTIPLYADD | WINED3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR | WINED3DTEXOPCAPS_MODULATECOLOR_ADDALPHA | WINED3DTEXOPCAPS_BLENDTEXTUREALPHAPM | WINED3DTEXOPCAPS_DOTPRODUCT3 | WINED3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR | WINED3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA; if (gl_info->supported[NV_TEXTURE_SHADER2]) { /* Bump mapping is supported already in NV_TEXTURE_SHADER, but that extension does * not support 3D textures. This asks for trouble if an app uses both bump mapping * and 3D textures. It also allows us to keep the code simpler by having texture * shaders constantly enabled. */ caps->TextureOpCaps |= WINED3DTEXOPCAPS_BUMPENVMAP; /* TODO: Luminance bump map? */ } #if 0 /* FIXME: Add caps->TextureOpCaps |= WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE WINED3DTEXOPCAPS_PREMODULATE */ #endif caps->MaxTextureBlendStages = min(WINED3D_MAX_TEXTURES, gl_info->limits.general_combiners); caps->MaxSimultaneousTextures = gl_info->limits.textures; } static DWORD nvrc_fragment_get_emul_mask(const struct wined3d_gl_info *gl_info) { return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; } static void *nvrc_fragment_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv) { return shader_priv; } /* Context activation is done by the caller. */ static void nvrc_fragment_free(struct wined3d_device *device) {} /* Two fixed function pipeline implementations using GL_NV_register_combiners and * GL_NV_texture_shader. The nvts_fragment_pipeline assumes that both extensions * are available(geforce 3 and newer), while nvrc_fragment_pipeline uses only the * register combiners extension(Pre-GF3). */ static BOOL nvts_color_fixup_supported(struct color_fixup_desc fixup) { /* We only support identity conversions. */ return is_identity_fixup(fixup); } static const struct wined3d_state_entry_template nvrc_fragmentstate_template[] = { { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(0, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(1, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(1, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(2, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(2, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(3, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(3, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(4, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(4, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(5, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(5, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(6, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(6, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(7, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE }, { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), apply_pixelshader }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), { STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), nvrc_texfactor }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ALPHAFUNC), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ALPHAREF), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), state_alpha_test }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_COLORKEYENABLE), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_COLOR_KEY, { STATE_COLOR_KEY, state_nop }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGCOLOR), { STATE_RENDER(WINED3D_RS_FOGCOLOR), state_fogcolor }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGDENSITY), { STATE_RENDER(WINED3D_RS_FOGDENSITY), state_fogdensity }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGENABLE), { STATE_RENDER(WINED3D_RS_FOGENABLE), state_fog_fragpart }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGTABLEMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGVERTEXMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGSTART), { STATE_RENDER(WINED3D_RS_FOGSTART), state_fogstartend }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGEND), { STATE_RENDER(WINED3D_RS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SHADEMODE), { STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(0), { STATE_SAMPLER(0), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(1), { STATE_SAMPLER(1), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(1), { STATE_SAMPLER(1), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(2), { STATE_SAMPLER(2), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(2), { STATE_SAMPLER(2), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(3), { STATE_SAMPLER(3), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(3), { STATE_SAMPLER(3), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(4), { STATE_SAMPLER(4), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(4), { STATE_SAMPLER(4), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(5), { STATE_SAMPLER(5), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(5), { STATE_SAMPLER(5), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(6), { STATE_SAMPLER(6), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(6), { STATE_SAMPLER(6), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(7), { STATE_SAMPLER(7), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(7), { STATE_SAMPLER(7), sampler_texdim }, WINED3D_GL_EXT_NONE }, {0 /* Terminate */, { 0, 0 }, WINED3D_GL_EXT_NONE }, }; static BOOL nvrc_context_alloc(struct wined3d_context *context) { return TRUE; } static void nvrc_context_free(struct wined3d_context *context) { } const struct fragment_pipeline nvts_fragment_pipeline = { nvts_enable, nvrc_fragment_get_caps, nvrc_fragment_get_emul_mask, nvrc_fragment_alloc, nvrc_fragment_free, nvrc_context_alloc, nvrc_context_free, nvts_color_fixup_supported, nvrc_fragmentstate_template, }; const struct fragment_pipeline nvrc_fragment_pipeline = { nvrc_enable, nvrc_fragment_get_caps, nvrc_fragment_get_emul_mask, nvrc_fragment_alloc, nvrc_fragment_free, nvrc_context_alloc, nvrc_context_free, nvts_color_fixup_supported, nvrc_fragmentstate_template, };
63.901587
169
0.632719
[ "3d" ]
3235d64cbbbfad4513a6f0bc887bc8fd415baa64
9,107
c
C
source/blender/modifiers/intern/MOD_datatransfer.c
juangea/B28_boneMaster
6be9d19951ed460829d379aa90953b14a9f281f2
[ "Naumen", "Condor-1.1", "MS-PL" ]
2
2019-06-03T02:47:42.000Z
2020-04-03T10:23:33.000Z
source/blender/modifiers/intern/MOD_datatransfer.c
juangea/B28_boneMaster
6be9d19951ed460829d379aa90953b14a9f281f2
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
source/blender/modifiers/intern/MOD_datatransfer.c
juangea/B28_boneMaster
6be9d19951ed460829d379aa90953b14a9f281f2
[ "Naumen", "Condor-1.1", "MS-PL" ]
1
2019-10-23T12:02:29.000Z
2019-10-23T12:02:29.000Z
/* * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2014 Blender Foundation. * All rights reserved. */ /** \file * \ingroup modifiers */ #include "BLI_utildefines.h" #include "BLI_math.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" #include "BKE_customdata.h" #include "BKE_data_transfer.h" #include "BKE_library.h" #include "BKE_library_query.h" #include "BKE_mesh_mapping.h" #include "BKE_mesh_remap.h" #include "BKE_modifier.h" #include "BKE_report.h" #include "DEG_depsgraph_query.h" #include "MEM_guardedalloc.h" #include "MOD_util.h" /************************************** * Modifiers functions. * **************************************/ static void initData(ModifierData *md) { DataTransferModifierData *dtmd = (DataTransferModifierData *)md; int i; dtmd->ob_source = NULL; dtmd->data_types = 0; dtmd->vmap_mode = MREMAP_MODE_VERT_NEAREST; dtmd->emap_mode = MREMAP_MODE_EDGE_NEAREST; dtmd->lmap_mode = MREMAP_MODE_LOOP_NEAREST_POLYNOR; dtmd->pmap_mode = MREMAP_MODE_POLY_NEAREST; dtmd->map_max_distance = 1.0f; dtmd->map_ray_radius = 0.0f; for (i = 0; i < DT_MULTILAYER_INDEX_MAX; i++) { dtmd->layers_select_src[i] = DT_LAYERS_ALL_SRC; dtmd->layers_select_dst[i] = DT_LAYERS_NAME_DST; } dtmd->mix_mode = CDT_MIX_TRANSFER; dtmd->mix_factor = 1.0f; dtmd->defgrp_name[0] = '\0'; dtmd->flags = MOD_DATATRANSFER_OBSRC_TRANSFORM; } static void requiredDataMask(Object *UNUSED(ob), ModifierData *md, CustomData_MeshMasks *r_cddata_masks) { DataTransferModifierData *dtmd = (DataTransferModifierData *)md; if (dtmd->defgrp_name[0] != '\0') { /* We need vertex groups! */ r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT; } BKE_object_data_transfer_dttypes_to_cdmask(dtmd->data_types, r_cddata_masks); } static bool dependsOnNormals(ModifierData *md) { DataTransferModifierData *dtmd = (DataTransferModifierData *)md; int item_types = BKE_object_data_transfer_get_dttypes_item_types(dtmd->data_types); if ((item_types & ME_VERT) && (dtmd->vmap_mode & (MREMAP_USE_NORPROJ | MREMAP_USE_NORMAL))) { return true; } if ((item_types & ME_EDGE) && (dtmd->emap_mode & (MREMAP_USE_NORPROJ | MREMAP_USE_NORMAL))) { return true; } if ((item_types & ME_LOOP) && (dtmd->lmap_mode & (MREMAP_USE_NORPROJ | MREMAP_USE_NORMAL))) { return true; } if ((item_types & ME_POLY) && (dtmd->pmap_mode & (MREMAP_USE_NORPROJ | MREMAP_USE_NORMAL))) { return true; } return false; } static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData) { DataTransferModifierData *dtmd = (DataTransferModifierData *)md; walk(userData, ob, &dtmd->ob_source, IDWALK_CB_NOP); } static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) { DataTransferModifierData *dtmd = (DataTransferModifierData *)md; if (dtmd->ob_source != NULL) { CustomData_MeshMasks cddata_masks = {0}; BKE_object_data_transfer_dttypes_to_cdmask(dtmd->data_types, &cddata_masks); BKE_mesh_remap_calc_source_cddata_masks_from_map_modes( dtmd->vmap_mode, dtmd->emap_mode, dtmd->lmap_mode, dtmd->pmap_mode, &cddata_masks); DEG_add_object_relation( ctx->node, dtmd->ob_source, DEG_OB_COMP_GEOMETRY, "DataTransfer Modifier"); DEG_add_customdata_mask(ctx->node, dtmd->ob_source, &cddata_masks); if (dtmd->flags & MOD_DATATRANSFER_OBSRC_TRANSFORM) { DEG_add_object_relation( ctx->node, dtmd->ob_source, DEG_OB_COMP_TRANSFORM, "DataTransfer Modifier"); DEG_add_modifier_to_transform_relation(ctx->node, "DataTransfer Modifier"); } } } static bool isDisabled(const struct Scene *UNUSED(scene), ModifierData *md, bool UNUSED(useRenderParams)) { DataTransferModifierData *dtmd = (DataTransferModifierData *)md; /* If no source object, bypass. */ return (dtmd->ob_source == NULL); } #define HIGH_POLY_WARNING 10000 #define DT_TYPES_AFFECT_MESH \ (DT_TYPE_BWEIGHT_VERT | DT_TYPE_BWEIGHT_EDGE | DT_TYPE_CREASE | DT_TYPE_SHARP_EDGE | \ DT_TYPE_LNOR | DT_TYPE_SHARP_FACE) static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mesh *me_mod) { DataTransferModifierData *dtmd = (DataTransferModifierData *)md; struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph); Mesh *result = me_mod; ReportList reports; /* Only used to check wehther we are operating on org data or not... */ Mesh *me = ctx->object->data; Object *ob_source = dtmd->ob_source; const bool invert_vgroup = (dtmd->flags & MOD_DATATRANSFER_INVERT_VGROUP) != 0; const float max_dist = (dtmd->flags & MOD_DATATRANSFER_MAP_MAXDIST) ? dtmd->map_max_distance : FLT_MAX; SpaceTransform space_transform_data; SpaceTransform *space_transform = (dtmd->flags & MOD_DATATRANSFER_OBSRC_TRANSFORM) ? &space_transform_data : NULL; if (space_transform) { BLI_SPACE_TRANSFORM_SETUP(space_transform, ctx->object, ob_source); } if (((result == me) || (me->mvert == result->mvert) || (me->medge == result->medge)) && (dtmd->data_types & DT_TYPES_AFFECT_MESH)) { /* We need to duplicate data here, otherwise setting custom normals, edges' shaprness, etc., * could modify org mesh, see T43671. */ BKE_id_copy_ex(NULL, &me_mod->id, (ID **)&result, LIB_ID_COPY_LOCALIZE); } BKE_reports_init(&reports, RPT_STORE); /* Note: no islands precision for now here. */ BKE_object_data_transfer_ex(ctx->depsgraph, scene, ob_source, ctx->object, result, dtmd->data_types, false, dtmd->vmap_mode, dtmd->emap_mode, dtmd->lmap_mode, dtmd->pmap_mode, space_transform, false, max_dist, dtmd->map_ray_radius, 0.0f, dtmd->layers_select_src, dtmd->layers_select_dst, dtmd->mix_mode, dtmd->mix_factor, dtmd->defgrp_name, invert_vgroup, &reports); if (BKE_reports_contain(&reports, RPT_ERROR)) { modifier_setError(md, "%s", BKE_reports_string(&reports, RPT_ERROR)); } else if ((dtmd->data_types & DT_TYPE_LNOR) && !(me->flag & ME_AUTOSMOOTH)) { modifier_setError((ModifierData *)dtmd, "Enable 'Auto Smooth' option in mesh settings"); } else if (result->totvert > HIGH_POLY_WARNING || ((Mesh *)(ob_source->data))->totvert > HIGH_POLY_WARNING) { modifier_setError( md, "You are using a rather high poly as source or destination, computation might be slow"); } return result; } #undef HIGH_POLY_WARNING #undef DT_TYPES_AFFECT_MESH ModifierTypeInfo modifierType_DataTransfer = { /* name */ "DataTransfer", /* structName */ "DataTransferModifierData", /* structSize */ sizeof(DataTransferModifierData), /* type */ eModifierTypeType_NonGeometrical, /* flags */ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsMapping | eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_UsesPreview, /* copyData */ modifier_copyData_generic, /* deformVerts */ NULL, /* deformMatrices */ NULL, /* deformVertsEM */ NULL, /* deformMatricesEM */ NULL, /* applyModifier */ applyModifier, /* initData */ initData, /* requiredDataMask */ requiredDataMask, /* freeData */ NULL, /* isDisabled */ isDisabled, /* updateDepsgraph */ updateDepsgraph, /* dependsOnTime */ NULL, /* dependsOnNormals */ dependsOnNormals, /* foreachObjectLink */ foreachObjectLink, /* foreachIDLink */ NULL, /* foreachTexLink */ NULL, /* freeRuntimeData */ NULL, };
34.89272
96
0.647524
[ "mesh", "object" ]
3237c6a0a40e7f50adf45e5cbc4eb67b6a973ae9
5,256
h
C
aws-cpp-sdk-pinpoint/include/aws/pinpoint/model/CampaignHook.h
woohoou/aws-sdk-cpp
a42835a8aad2eac1e334d899a3fbfedcaa341d51
[ "Apache-2.0" ]
1
2020-07-16T19:03:13.000Z
2020-07-16T19:03:13.000Z
aws-cpp-sdk-pinpoint/include/aws/pinpoint/model/CampaignHook.h
woohoou/aws-sdk-cpp
a42835a8aad2eac1e334d899a3fbfedcaa341d51
[ "Apache-2.0" ]
18
2018-05-15T16:41:07.000Z
2018-05-21T00:46:30.000Z
aws-cpp-sdk-pinpoint/include/aws/pinpoint/model/CampaignHook.h
woohoou/aws-sdk-cpp
a42835a8aad2eac1e334d899a3fbfedcaa341d51
[ "Apache-2.0" ]
1
2019-10-31T11:19:50.000Z
2019-10-31T11:19:50.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/pinpoint/Pinpoint_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/pinpoint/model/Mode.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace Pinpoint { namespace Model { class AWS_PINPOINT_API CampaignHook { public: CampaignHook(); CampaignHook(const Aws::Utils::Json::JsonValue& jsonValue); CampaignHook& operator=(const Aws::Utils::Json::JsonValue& jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * Lambda function name or arn to be called for delivery */ inline const Aws::String& GetLambdaFunctionName() const{ return m_lambdaFunctionName; } /** * Lambda function name or arn to be called for delivery */ inline void SetLambdaFunctionName(const Aws::String& value) { m_lambdaFunctionNameHasBeenSet = true; m_lambdaFunctionName = value; } /** * Lambda function name or arn to be called for delivery */ inline void SetLambdaFunctionName(Aws::String&& value) { m_lambdaFunctionNameHasBeenSet = true; m_lambdaFunctionName = std::move(value); } /** * Lambda function name or arn to be called for delivery */ inline void SetLambdaFunctionName(const char* value) { m_lambdaFunctionNameHasBeenSet = true; m_lambdaFunctionName.assign(value); } /** * Lambda function name or arn to be called for delivery */ inline CampaignHook& WithLambdaFunctionName(const Aws::String& value) { SetLambdaFunctionName(value); return *this;} /** * Lambda function name or arn to be called for delivery */ inline CampaignHook& WithLambdaFunctionName(Aws::String&& value) { SetLambdaFunctionName(std::move(value)); return *this;} /** * Lambda function name or arn to be called for delivery */ inline CampaignHook& WithLambdaFunctionName(const char* value) { SetLambdaFunctionName(value); return *this;} /** * What mode Lambda should be invoked in. */ inline const Mode& GetMode() const{ return m_mode; } /** * What mode Lambda should be invoked in. */ inline void SetMode(const Mode& value) { m_modeHasBeenSet = true; m_mode = value; } /** * What mode Lambda should be invoked in. */ inline void SetMode(Mode&& value) { m_modeHasBeenSet = true; m_mode = std::move(value); } /** * What mode Lambda should be invoked in. */ inline CampaignHook& WithMode(const Mode& value) { SetMode(value); return *this;} /** * What mode Lambda should be invoked in. */ inline CampaignHook& WithMode(Mode&& value) { SetMode(std::move(value)); return *this;} /** * Web URL to call for hook. If the URL has authentication specified it will be * added as authentication to the request */ inline const Aws::String& GetWebUrl() const{ return m_webUrl; } /** * Web URL to call for hook. If the URL has authentication specified it will be * added as authentication to the request */ inline void SetWebUrl(const Aws::String& value) { m_webUrlHasBeenSet = true; m_webUrl = value; } /** * Web URL to call for hook. If the URL has authentication specified it will be * added as authentication to the request */ inline void SetWebUrl(Aws::String&& value) { m_webUrlHasBeenSet = true; m_webUrl = std::move(value); } /** * Web URL to call for hook. If the URL has authentication specified it will be * added as authentication to the request */ inline void SetWebUrl(const char* value) { m_webUrlHasBeenSet = true; m_webUrl.assign(value); } /** * Web URL to call for hook. If the URL has authentication specified it will be * added as authentication to the request */ inline CampaignHook& WithWebUrl(const Aws::String& value) { SetWebUrl(value); return *this;} /** * Web URL to call for hook. If the URL has authentication specified it will be * added as authentication to the request */ inline CampaignHook& WithWebUrl(Aws::String&& value) { SetWebUrl(std::move(value)); return *this;} /** * Web URL to call for hook. If the URL has authentication specified it will be * added as authentication to the request */ inline CampaignHook& WithWebUrl(const char* value) { SetWebUrl(value); return *this;} private: Aws::String m_lambdaFunctionName; bool m_lambdaFunctionNameHasBeenSet; Mode m_mode; bool m_modeHasBeenSet; Aws::String m_webUrl; bool m_webUrlHasBeenSet; }; } // namespace Model } // namespace Pinpoint } // namespace Aws
32.04878
142
0.686644
[ "model" ]
32385c56eeb58ee8a075657dfe2fa186f1eee538
4,233
h
C
nitan/kungfu/class/ultra/ultra.h
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
1
2019-03-27T07:25:16.000Z
2019-03-27T07:25:16.000Z
nitan/kungfu/class/ultra/ultra.h
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
nitan/kungfu/class/ultra/ultra.h
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
// ultra.h 宗師評價玩家的公共代碼 int calc_level(object me, string skill); void check_ultra(object me); // check level // level is calculate as: // level = (skill effect level) + (action["force"] - 200) / 5 mapping opinions_rank = ([ 520 : "宗師", 490 : "登峯造極", 460 : "超凡脱俗", 430 : "臻至化境", 400 : "爐火純青", 360 : "已有大成", 320 : "非同凡響", 280 : "出類拔萃", 240 : "身手不凡", 200 : "已有小成", ]); // generate opinion void check_opinion(object me) { string msg; string rank; int *ks; int lvl; int next_lvl; int opinion; int i; delete_temp("opinion"); if (! me || environment(me) != environment()) { command("sigh"); return; } // rank: 原有的評價稱號 // ks: 不同評價需要的等級按照升序排列 // lvl: 原有評價所在的等級 // next_lvl: 在原有的評價下下一等級需要的lvl // opinion : 此次的評價等級,如果為-1就沒有變化 rank=query("opinion/"MY_OPINION, me); ks = sort_array(keys(opinions_rank), 1); if (! stringp(rank)) { // 以前沒有評價,設置最小評價需要的等級 next_lvl = ks[0]; } else { // 以前有評價,看這一次如果提升的話需要 // 到多少級 for (i = 0; i < sizeof(ks) - 1; i++) if (opinions_rank[ks[i]] == rank) { next_lvl = ks[i + 1]; break; } if (i >= sizeof(ks)) { // 無法找到原先的等級,設置最小評價 next_lvl = ks[0]; } } opinion = -1; for (i = 0; i < sizeof(my_opinions); i++) { lvl = calc_level(me, my_opinions[i]); if (lvl >= next_lvl && lvl > opinion) // 記錄:第i項武學有更好的評價 opinion = lvl; } if (opinion == -1) { if (next_lvl == ks[0]) { message_vision(CYN "\n$N" CYN "淡淡一笑,對$n" CYN "道:“你的" OPINION_TYPE + NOR + CYN "不行啊!好好努力" "吧!”\n" NOR, this_object(), me); return; } message_vision(CYN "\n$N" CYN "對$n" CYN "搖搖頭道:" "“不怎麼樣,我發現你的" OPINION_TYPE + NOR + CYN "比上次沒什麼太大的進步。" "”\n" NOR, this_object(), me); return; } for (i = sizeof(ks) - 1; i > 0; i--) if (opinion >= ks[i]) break; set("opinion/"MY_OPINION, opinions_rank[ks[i]], me); if (i == sizeof(ks) -1) { // 到了終極 message_vision(CYN "\n$N" CYN "對$n" CYN "笑道:“恭" "喜!" + RANK_D->query_respect(me) + "的" OPINION_TYPE + NOR + CYN "已然到" "了宗師境界!武道無窮,閣下自重!”\n" NOR, this_object(), me); set("opinions/master", 1, me); check_ultra(me); return; } message_vision(CYN "\n$N" CYN "沉思片刻,對$n" CYN "道:“就" "目前來看,你的" OPINION_TYPE + NOR + CYN "已" "經可以算得上是" + opinions_rank[ks[i]] + NOR + CYN "了。”\n" NOR, this_object(), me); } void check_ultra(object me) { object *ultra; if( query("opinion/unarmed", me) != "宗師" || query("opinion/weapon", me) != "宗師" || query("opinion/force", me) != "宗師" || query("opinion/dodge", me) != "宗師" ) return; set("opinion/ultra", 1, me); ultra = NPC_D->query_ultra_master(); ultra -= ({ this_object() }); command("chat真是長江後浪推前浪,想不到今日又有"+query("name", me)+ "躋身武林大宗師的行列!"); ultra->do_congration(me); CHANNEL_D->do_channel(find_object(MASTER_OB), "rumor", "聽説"+query("name", me)+"成為武學大宗師。"); }
31.125
66
0.389086
[ "object" ]
32386429f836152d8882683b7c25d47aaeea4ca4
8,500
h
C
client/include/wx/statusbr.h
bateman/speech-translation-tools
cb1c92895b329b32678d5037cbe36bc43bdf3e5d
[ "MIT" ]
null
null
null
client/include/wx/statusbr.h
bateman/speech-translation-tools
cb1c92895b329b32678d5037cbe36bc43bdf3e5d
[ "MIT" ]
null
null
null
client/include/wx/statusbr.h
bateman/speech-translation-tools
cb1c92895b329b32678d5037cbe36bc43bdf3e5d
[ "MIT" ]
null
null
null
///////////////////////////////////////////////////////////////////////////// // Name: wx/statusbr.h // Purpose: wxStatusBar class interface // Author: Vadim Zeitlin // Modified by: // Created: 05.02.00 // RCS-ID: $Id$ // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STATUSBR_H_BASE_ #define _WX_STATUSBR_H_BASE_ #include "wx/defs.h" #if wxUSE_STATUSBAR #include "wx/control.h" #include "wx/list.h" #include "wx/dynarray.h" extern WXDLLIMPEXP_DATA_CORE(const char) wxStatusBarNameStr[]; // ---------------------------------------------------------------------------- // wxStatusBar constants // ---------------------------------------------------------------------------- // wxStatusBar styles #define wxSTB_SIZEGRIP 0x0010 #define wxSTB_SHOW_TIPS 0x0020 #define wxSTB_ELLIPSIZE_START 0x0040 #define wxSTB_ELLIPSIZE_MIDDLE 0x0080 #define wxSTB_ELLIPSIZE_END 0x0100 #define wxSTB_DEFAULT_STYLE (wxSTB_SIZEGRIP|wxSTB_ELLIPSIZE_END|wxSTB_SHOW_TIPS|wxFULL_REPAINT_ON_RESIZE) // old compat style name: #define wxST_SIZEGRIP wxSTB_SIZEGRIP // style flags for wxStatusBar fields #define wxSB_NORMAL 0x0000 #define wxSB_FLAT 0x0001 #define wxSB_RAISED 0x0002 // ---------------------------------------------------------------------------- // wxStatusBarPane: an helper for wxStatusBar // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxStatusBarPane { public: wxStatusBarPane(int style = wxSB_NORMAL, size_t width = 0) : m_nStyle(style), m_nWidth(width) { m_bEllipsized = false; } int GetWidth() const { return m_nWidth; } int GetStyle() const { return m_nStyle; } wxString GetText() const { return m_text; } // implementation-only from now on // ------------------------------- bool IsEllipsized() const { return m_bEllipsized; } void SetIsEllipsized(bool isEllipsized) { m_bEllipsized = isEllipsized; } void SetWidth(int width) { m_nWidth = width; } void SetStyle(int style) { m_nStyle = style; } // set text, return true if it changed or false if it was already set to // this value bool SetText(const wxString& text); // save the existing text on top of our stack and make the new text // current; return true if the text really changed bool PushText(const wxString& text); // restore the message saved by the last call to Push() (unless it was // changed by an intervening call to SetText()) and return true if we // really restored anything bool PopText(); private: int m_nStyle; int m_nWidth; // may be negative, indicating a variable-width field wxString m_text; // the array used to keep the previous values of this pane after a // PushStatusText() call, its top element is the value to restore after the // next PopStatusText() call while the currently shown value is always in // m_text wxArrayString m_arrStack; // is the currently shown value shown with ellipsis in the status bar? bool m_bEllipsized; }; WX_DECLARE_EXPORTED_OBJARRAY(wxStatusBarPane, wxStatusBarPaneArray); // ---------------------------------------------------------------------------- // wxStatusBar: a window near the bottom of the frame used for status info // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxStatusBarBase : public wxControl { public: wxStatusBarBase(); virtual ~wxStatusBarBase(); // field count // ----------- // set the number of fields and call SetStatusWidths(widths) if widths are // given virtual void SetFieldsCount(int number = 1, const int *widths = NULL); int GetFieldsCount() const { return m_panes.GetCount(); } // field text // ---------- // just change or get the currently shown text void SetStatusText(const wxString& text, int number = 0); wxString GetStatusText(int number = 0) const; // change the currently shown text to the new one and save the current // value to be restored by the next call to PopStatusText() void PushStatusText(const wxString& text, int number = 0); void PopStatusText(int number = 0); // fields widths // ------------- // set status field widths as absolute numbers: positive widths mean that // the field has the specified absolute width, negative widths are // interpreted as the sizer options, i.e. the extra space (total space // minus the sum of fixed width fields) is divided between the fields with // negative width according to the abs value of the width (field with width // -2 grows twice as much as one with width -1 &c) virtual void SetStatusWidths(int n, const int widths[]); int GetStatusWidth(int n) const { return m_panes[n].GetWidth(); } // field styles // ------------ // Set the field style. Use either wxSB_NORMAL (default) for a standard 3D // border around a field, wxSB_FLAT for no border around a field, so that it // appears flat or wxSB_POPOUT to make the field appear raised. // Setting field styles only works on wxMSW virtual void SetStatusStyles(int n, const int styles[]); int GetStatusStyle(int n) const { return m_panes[n].GetStyle(); } // geometry // -------- // Get the position and size of the field's internal bounding rectangle virtual bool GetFieldRect(int i, wxRect& rect) const = 0; // sets the minimal vertical size of the status bar virtual void SetMinHeight(int height) = 0; // get the dimensions of the horizontal and vertical borders virtual int GetBorderX() const = 0; virtual int GetBorderY() const = 0; wxSize GetBorders() const { return wxSize(GetBorderX(), GetBorderY()); } // miscellaneous // ------------- const wxStatusBarPane& GetField(int n) const { return m_panes[n]; } // wxWindow overrides: // don't want status bars to accept the focus at all virtual bool AcceptsFocus() const { return false; } // the client size of a toplevel window doesn't include the status bar virtual bool CanBeOutsideClientArea() const { return true; } protected: // called after the status bar pane text changed and should update its // display virtual void DoUpdateStatusText(int number) = 0; // wxWindow overrides: #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ) { wxASSERT_MSG(!HasFlag(wxSTB_SHOW_TIPS), "Do not set tooltip(s) manually when using wxSTB_SHOW_TIPS!"); wxWindow::DoSetToolTip(tip); } #endif // wxUSE_TOOLTIPS virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } // internal helpers & data: // calculate the real field widths for the given total available size wxArrayInt CalculateAbsWidths(wxCoord widthTotal) const; // should be called to remember if the pane text is currently being show // ellipsized or not void SetEllipsizedFlag(int n, bool isEllipsized); // the array with the pane infos: wxStatusBarPaneArray m_panes; // if true overrides the width info of the wxStatusBarPanes bool m_bSameWidthForAllPanes; wxDECLARE_NO_COPY_CLASS(wxStatusBarBase); }; // ---------------------------------------------------------------------------- // include the actual wxStatusBar class declaration // ---------------------------------------------------------------------------- #if defined(__WXUNIVERSAL__) #define wxStatusBarUniv wxStatusBar #include "wx/univ/statusbr.h" #elif defined(__WXPALMOS__) #define wxStatusBarPalm wxStatusBar #include "wx/palmos/statusbr.h" #elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR #include "wx/msw/statusbar.h" #elif defined(__WXMAC__) #define wxStatusBarMac wxStatusBar #include "wx/generic/statusbr.h" #include "wx/osx/statusbr.h" #else #define wxStatusBarGeneric wxStatusBar #include "wx/generic/statusbr.h" #endif #endif // wxUSE_STATUSBAR #endif // _WX_STATUSBR_H_BASE_
33.333333
109
0.605647
[ "geometry", "3d" ]
324271540a1298ae58ee665311a46645a726cc73
9,241
h
C
NewClockWorkEngine/Wwise/AK/SoundEngine/Common/AkSimdMath.h
xsiro/NewClockWorkEngine
973627ac98261f1009b5a0fd1f8a4b4d706d330a
[ "MIT" ]
null
null
null
NewClockWorkEngine/Wwise/AK/SoundEngine/Common/AkSimdMath.h
xsiro/NewClockWorkEngine
973627ac98261f1009b5a0fd1f8a4b4d706d330a
[ "MIT" ]
null
null
null
NewClockWorkEngine/Wwise/AK/SoundEngine/Common/AkSimdMath.h
xsiro/NewClockWorkEngine
973627ac98261f1009b5a0fd1f8a4b4d706d330a
[ "MIT" ]
null
null
null
/*********************************************************************** The content of this file includes source code for the sound engine portion of the AUDIOKINETIC Wwise Technology and constitutes "Level Two Source Code" as defined in the Source Code Addendum attached with this file. Any use of the Level Two Source Code shall be subject to the terms and conditions outlined in the Source Code Addendum and the End User License Agreement for Wwise(R). Version: v2019.2.8 Build: 7432 Copyright (c) 2006-2020 Audiokinetic Inc. ***********************************************************************/ ////////////////////////////////////////////////////////////////////// // // AkSimdMath.h // // Library of static functions for math computations with SIMD in mind. // ////////////////////////////////////////////////////////////////////// #ifndef _AKSIMDMATH_H_ #define _AKSIMDMATH_H_ #include <AK/Tools/Common/AkPlatformFuncs.h> #include <AK/SoundEngine/Common/AkSimd.h> #include <AkMath.h> namespace AkMath { //Take 4 vectors <x,y,z> and return <x,x,x,x>, <y,y,y,y> and <z,z,z,z> AkForceInline void PermuteVectors3(const AKSIMD_V4F32& v0, const AKSIMD_V4F32& v1, const AKSIMD_V4F32& v2, const AKSIMD_V4F32& v3, AKSIMD_V4F32& out_xxxx, AKSIMD_V4F32& out_yyyy, AKSIMD_V4F32& out_zzzz) { AKSIMD_V4F32 xyxy0 = AKSIMD_SHUFFLE_V4F32(v0, v1, AKSIMD_SHUFFLE(1, 0, 1, 0)); AKSIMD_V4F32 xyxy1 = AKSIMD_SHUFFLE_V4F32(v2, v3, AKSIMD_SHUFFLE(1, 0, 1, 0)); out_xxxx = AKSIMD_SHUFFLE_V4F32(xyxy0, xyxy1, AKSIMD_SHUFFLE(2, 0, 2, 0)); out_yyyy = AKSIMD_SHUFFLE_V4F32(xyxy0, xyxy1, AKSIMD_SHUFFLE(3, 1, 3, 1)); AKSIMD_V4F32 zwzw0 = AKSIMD_SHUFFLE_V4F32(v0, v1, AKSIMD_SHUFFLE(3, 2, 3, 2)); AKSIMD_V4F32 zwzw1 = AKSIMD_SHUFFLE_V4F32(v2, v3, AKSIMD_SHUFFLE(3, 2, 3, 2)); out_zzzz = AKSIMD_SHUFFLE_V4F32(zwzw0, zwzw1, AKSIMD_SHUFFLE(2, 0, 2, 0)); } //Take 3 vectors <x3,x2,x1,x0>, <y,y,y,y> and <z,z,z,z> and return 4 vectors <x,y,z,z> AkForceInline void UnpermuteVectors3(const AKSIMD_V4F32& xxxx, const AKSIMD_V4F32& yyyy, const AKSIMD_V4F32& zzzz, AKSIMD_V4F32& out_v0, AKSIMD_V4F32& out_v1, AKSIMD_V4F32& out_v2, AKSIMD_V4F32& out_v3) { /*__m128 _mm_shuffle_ps(__m128 lo, __m128 hi, _MM_SHUFFLE(hi3, hi2, lo1, lo0)) Interleave inputs into low 2 floats and high 2 floats of output.Basically out[0] = lo[lo0]; out[1] = lo[lo1]; out[2] = hi[hi2]; out[3] = hi[hi3]; */ AKSIMD_V4F32 x0x1y0y1 = AKSIMD_SHUFFLE_V4F32(xxxx, yyyy, AKSIMD_SHUFFLE(1, 0, 1, 0)); AKSIMD_V4F32 z0z1z0z1 = AKSIMD_SHUFFLE_V4F32(zzzz, zzzz, AKSIMD_SHUFFLE(1, 0, 1, 0)); out_v0 = AKSIMD_SHUFFLE_V4F32(x0x1y0y1, z0z1z0z1, AKSIMD_SHUFFLE(2, 0, 2, 0)); out_v1 = AKSIMD_SHUFFLE_V4F32(x0x1y0y1, z0z1z0z1, AKSIMD_SHUFFLE(3, 1, 3, 1)); AKSIMD_V4F32 x2x3y2y3 = AKSIMD_SHUFFLE_V4F32(xxxx, yyyy, AKSIMD_SHUFFLE(3, 2, 3, 2)); AKSIMD_V4F32 z2z3z2z3 = AKSIMD_SHUFFLE_V4F32(zzzz, zzzz, AKSIMD_SHUFFLE(3, 2, 3, 2)); out_v2 = AKSIMD_SHUFFLE_V4F32(x2x3y2y3, z2z3z2z3, AKSIMD_SHUFFLE(2, 0, 2, 0)); out_v3 = AKSIMD_SHUFFLE_V4F32(x2x3y2y3, z2z3z2z3, AKSIMD_SHUFFLE(3, 1, 3, 1)); } //Take 4 vectors <x,y,z,w> and return <x,x,x,x>, <y,y,y,y>, <z,z,z,z> and <w,w,w,w> AkForceInline void PermuteVectors4(const AKSIMD_V4F32& v0, const AKSIMD_V4F32& v1, const AKSIMD_V4F32& v2, const AKSIMD_V4F32& v3, AKSIMD_V4F32& out_xxxx, AKSIMD_V4F32& out_yyyy, AKSIMD_V4F32& out_zzzz, AKSIMD_V4F32& out_wwww) { AKSIMD_V4F32 xyxy0 = AKSIMD_SHUFFLE_V4F32(v0, v1, AKSIMD_SHUFFLE(1, 0, 1, 0)); AKSIMD_V4F32 xyxy1 = AKSIMD_SHUFFLE_V4F32(v2, v3, AKSIMD_SHUFFLE(1, 0, 1, 0)); out_xxxx = AKSIMD_SHUFFLE_V4F32(xyxy0, xyxy1, AKSIMD_SHUFFLE(2, 0, 2, 0)); out_yyyy = AKSIMD_SHUFFLE_V4F32(xyxy0, xyxy1, AKSIMD_SHUFFLE(3, 1, 3, 1)); AKSIMD_V4F32 zwzw0 = AKSIMD_SHUFFLE_V4F32(v0, v1, AKSIMD_SHUFFLE(3, 2, 3, 2)); AKSIMD_V4F32 zwzw1 = AKSIMD_SHUFFLE_V4F32(v2, v3, AKSIMD_SHUFFLE(3, 2, 3, 2)); out_zzzz = AKSIMD_SHUFFLE_V4F32(zwzw0, zwzw1, AKSIMD_SHUFFLE(2, 0, 2, 0)); out_wwww = AKSIMD_SHUFFLE_V4F32(zwzw0, zwzw1, AKSIMD_SHUFFLE(3, 1, 3, 1)); } // 3-element dot product of 4 vectors. AkForceInline AKSIMD_V4F32 DotPoduct3_4x4(const AKSIMD_V4F32& v0_x, const AKSIMD_V4F32& v0_y, const AKSIMD_V4F32& v0_z, const AKSIMD_V4F32& v1_x, const AKSIMD_V4F32& v1_y, const AKSIMD_V4F32& v1_z) { return AKSIMD_ADD_V4F32(AKSIMD_ADD_V4F32(AKSIMD_MUL_V4F32(v0_x, v1_x), AKSIMD_MUL_V4F32(v0_y, v1_y)), AKSIMD_MUL_V4F32(v0_z, v1_z)); } // 3-element dot product of 1 common vector with 4 vectors AkForceInline AKSIMD_V4F32 DotPoduct3_1x4(const AKSIMD_V4F32& v0_xyz, const AKSIMD_V4F32& v1_x, const AKSIMD_V4F32& v1_y, const AKSIMD_V4F32& v1_z) { const AKSIMD_V4F32 v0_x = AKSIMD_SHUFFLE_V4F32(v0_xyz, v0_xyz, AKSIMD_SHUFFLE(0, 0, 0, 0)); const AKSIMD_V4F32 v0_y = AKSIMD_SHUFFLE_V4F32(v0_xyz, v0_xyz, AKSIMD_SHUFFLE(1, 1, 1, 1)); const AKSIMD_V4F32 v0_z = AKSIMD_SHUFFLE_V4F32(v0_xyz, v0_xyz, AKSIMD_SHUFFLE(2, 2, 2, 2)); return DotPoduct3_4x4(v0_x, v0_y, v0_z, v1_x, v1_y, v1_z); } // 4-element dot product of 4 vectors. AkForceInline AKSIMD_V4F32 DotPoduct4_4x4(const AKSIMD_V4F32& v0_x, const AKSIMD_V4F32& v0_y, const AKSIMD_V4F32& v0_z, const AKSIMD_V4F32& v0_w, const AKSIMD_V4F32& v1_x, const AKSIMD_V4F32& v1_y, const AKSIMD_V4F32& v1_z, const AKSIMD_V4F32& v1_w) { return AKSIMD_ADD_V4F32( AKSIMD_ADD_V4F32( AKSIMD_MUL_V4F32(v0_x, v1_x), AKSIMD_MUL_V4F32(v0_y, v1_y)), AKSIMD_ADD_V4F32( AKSIMD_MUL_V4F32(v0_z, v1_z), AKSIMD_MUL_V4F32(v0_w, v1_w))); } // 4-element dot product of 1 common vector with 4 vectors AkForceInline AKSIMD_V4F32 DotPoduct4_1x4(const AKSIMD_V4F32& v0_xyz, const AKSIMD_V4F32& v1_x, const AKSIMD_V4F32& v1_y, const AKSIMD_V4F32& v1_z, const AKSIMD_V4F32& v1_w) { const AKSIMD_V4F32 v0_x = AKSIMD_SHUFFLE_V4F32(v0_xyz, v0_xyz, AKSIMD_SHUFFLE(0, 0, 0, 0)); const AKSIMD_V4F32 v0_y = AKSIMD_SHUFFLE_V4F32(v0_xyz, v0_xyz, AKSIMD_SHUFFLE(1, 1, 1, 1)); const AKSIMD_V4F32 v0_z = AKSIMD_SHUFFLE_V4F32(v0_xyz, v0_xyz, AKSIMD_SHUFFLE(2, 2, 2, 2)); const AKSIMD_V4F32 v0_w = AKSIMD_SHUFFLE_V4F32(v0_xyz, v0_xyz, AKSIMD_SHUFFLE(2, 2, 2, 2)); return DotPoduct4_4x4(v0_x, v0_y, v0_z, v0_w, v1_x, v1_y, v1_z, v1_w); } // Trig functions approximation (based on the Fast versions found in AkMath.h) AkForceInline AKSIMD_V4F32 AKSIMD_SIN_V4F32(const AKSIMD_V4F32 x) { const AKSIMD_V4F32 B = AKSIMD_SET_V4F32(4 / PI); const AKSIMD_V4F32 C = AKSIMD_SET_V4F32(-4 / (PI * PI)); const AKSIMD_V4F32 P = AKSIMD_SET_V4F32(0.225f); //float y = B * x + C * x * fabs(x); //float y = X*(B+C*fabs(x)); AKSIMD_V4F32 y = AKSIMD_ABS_V4F32(x); y = AKSIMD_MADD_V4F32(y, C, B); y = AKSIMD_MUL_V4F32(y, x); // return P * (y * fabs(y) - y) + y; AKSIMD_V4F32 sine = AKSIMD_ABS_V4F32(y); sine = AKSIMD_MSUB_V4F32(y, sine, y); sine = AKSIMD_MADD_V4F32(sine, P, y); return sine; } AkForceInline AKSIMD_V4F32 AKSIMD_COS_V4F32(const AKSIMD_V4F32 x) { //Compute the offset needed for the cosinus. If you compare with FastCos, the constants have been combined. const AKSIMD_V4F32 offsetNoWrap = AKSIMD_SET_V4F32(PI / 2); // cos = sin(x+pi/2) const AKSIMD_V4F32 offsetWrap = AKSIMD_SET_V4F32(PI / 2 - 2 * PI); // Wrap: cos(x) = cos(x - 2 pi) const AKSIMD_V4F32 vHalfPI = AKSIMD_SET_V4F32(PI / 2); // (cond1 >= cond2) ? a : b AKSIMD_V4F32 offset = AKSIMD_SEL_GTEZ_V4F32(AKSIMD_SUB_V4F32(x, vHalfPI), offsetWrap, offsetNoWrap); return AKSIMD_SIN_V4F32(AKSIMD_ADD_V4F32(x, offset)); } AkForceInline AKSIMD_V4F32 AKSIMD_ATAN2_V4F32(AKSIMD_V4F32 y, AKSIMD_V4F32 x) { const AKSIMD_V4F32 vNeg = AKSIMD_SET_V4F32(-1.0f); const AKSIMD_V4F32 vOne = AKSIMD_SET_V4F32(1.0f); const AKSIMD_V4F32 vZero = AKSIMD_SET_V4F32(0.0f); const AKSIMD_V4F32 vK = AKSIMD_SET_V4F32(0.28f); const AKSIMD_V4F32 vKRepro = AKSIMD_SET_V4F32(1.f / 0.28f); const AKSIMD_V4F32 vHalfPI = AKSIMD_SET_V4F32(PI / 2); const AKSIMD_V4F32 vPI = AKSIMD_SET_V4F32(PI); const AKSIMD_V4F32 vEpsilon = AKSIMD_SET_V4F32(1e-20f); //Ensure x is not zero a == 0 ? b : c. x = AKSIMD_VSEL_V4F32(x, vEpsilon, AKSIMD_EQ_V4F32(x, vZero)); AKSIMD_V4F32 z = AKSIMD_DIV_V4F32(y, x); AKSIMD_V4F32 absz = AKSIMD_ABS_V4F32(z); AKSIMD_V4COND zcond = AKSIMD_GTEQ_V4F32(vOne, absz); //The approximation is done in 2 segments of the form: offset + z/a*(z*z + b); //if ( fabsf( z ) < 1.0f ) then use .28 for the a coef AKSIMD_V4F32 a = AKSIMD_VSEL_V4F32(vNeg, vK, zcond); //if ( fabsf( z ) < 1.0f ) then use 1 for the b factor, else use 0.28 AKSIMD_V4F32 b = AKSIMD_VSEL_V4F32(vK, vKRepro, zcond); AKSIMD_V4F32 atan = AKSIMD_MADD_V4F32(z, z, b); atan = AKSIMD_MUL_V4F32(atan, a); atan = AKSIMD_DIV_V4F32(z, atan); //Adjust for quadrant // zcond x<0 y<0 offset // 1 0 0 0 // 1 0 1 0 // 1 1 0 +PI // 1 1 1 -PI // 0 0 0 +PI/2 // 0 0 1 -PI/2 // 0 1 0 +PI/2 // 0 1 1 -PI/2 AKSIMD_V4F32 offsetByX = AKSIMD_SEL_GTEZ_V4F32(x, vZero, vPI); AKSIMD_V4F32 offset = AKSIMD_VSEL_V4F32(vHalfPI, offsetByX, zcond); AKSIMD_V4F32 sign = AKSIMD_SEL_GTEZ_V4F32(y, vOne, vNeg); //Apply computed offset. atan = AKSIMD_MADD_V4F32(offset, sign, atan); return atan; } } #endif //_AKSIMDMATH_H_
44.859223
174
0.701656
[ "vector" ]
324ba8797af2dcf0be1194f49c9c4ce787fc3d55
825
h
C
unit_tests/problem_examples/problem_example_3.h
RodolfoALopes/decomposition_library
a7d19d63074fefd8f0ac0c92f37f90beed441da8
[ "MIT" ]
1
2021-08-23T03:22:50.000Z
2021-08-23T03:22:50.000Z
unit_tests/problem_examples/problem_example_3.h
RodolfoALopes/decomposition_library
a7d19d63074fefd8f0ac0c92f37f90beed441da8
[ "MIT" ]
null
null
null
unit_tests/problem_examples/problem_example_3.h
RodolfoALopes/decomposition_library
a7d19d63074fefd8f0ac0c92f37f90beed441da8
[ "MIT" ]
null
null
null
#ifndef DECOMPOSITION_LIBRARY_PROBLEM_EXAMPLE_3_H #define DECOMPOSITION_LIBRARY_PROBLEM_EXAMPLE_3_H #include <decomposition/optimization_problem.h> /* * problem_example_3 class * NonSeparable Problem */ using namespace decompose; class problem_example_3 : public optimization_problem { public: using super = optimization_problem; public: explicit problem_example_3(size_t dimension, std::vector<scalar> lower_bound, std::vector<scalar> upper_bound) : super(dimension, std::move(lower_bound), std::move(upper_bound)) {} scalar value(const std::vector<scalar> &x) override { scalar sum = 0.0; for(size_t i = 0; i < dimension-1; i++){ sum += ((100*pow(x[i+1] - pow(x[i],2),2)) + pow(x[i]-1,2)); } return sum; } }; #endif
25.78125
81
0.660606
[ "vector" ]
32578114d73f4163fe1a13ffb0459e152e1c3636
11,593
h
C
src/async/future.h
myxor/ceema
e0a9f299fd488da38a9a1492502017995d59e183
[ "Apache-2.0" ]
null
null
null
src/async/future.h
myxor/ceema
e0a9f299fd488da38a9a1492502017995d59e183
[ "Apache-2.0" ]
null
null
null
src/async/future.h
myxor/ceema
e0a9f299fd488da38a9a1492502017995d59e183
[ "Apache-2.0" ]
null
null
null
/** * Copyright 2017 Harold Bruintjes * * 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. */ #pragma once #include <functional> #include <memory> #include <exception> #include <mutex> #include <boost/optional.hpp> namespace ceema { /** * Wraps a callable in shared_ptr so it can be copied * Used by lambdas as future callbacks */ template<typename F> struct shared_function { std::shared_ptr<F> m_fptr; shared_function() = delete; shared_function(F &&f) : m_fptr(std::make_shared<F>(std::move(f))) {} shared_function(shared_function const &) = default; shared_function(shared_function &&) = default; template<typename...As> auto operator()(As &&...as) const { return (*m_fptr)(std::forward<As>(as)...); } }; template<typename F> shared_function<std::decay_t<F> > make_shared_function(F &&f) { return {std::forward<F>(f)}; } template<typename T> class future; // Async data container template<typename T> class async_data : public std::enable_shared_from_this<async_data<T>> { std::mutex m_lock; boost::optional<T> m_data; std::exception_ptr m_exc; std::function<void(std::shared_ptr<async_data<T>>)> m_callback; public: async_data() { m_lock.lock(); } T get() { m_lock.lock(); // No need to unlock until reset if (m_exc) { std::rethrow_exception(m_exc); } T res(std::move(*m_data)); m_data.reset(); return res; } void set_value(T t) { m_data = std::move(t); m_lock.unlock(); if (m_callback) { m_callback(this->shared_from_this()); } } void set_exception(std::exception_ptr exc) { m_exc = exc; m_lock.unlock(); if (m_callback) { m_callback(this->shared_from_this()); } } void set_callback(std::function<void(std::shared_ptr < async_data<T>>)> callback) { m_callback = std::move(callback); if (m_exc || m_data) { m_callback(this->shared_from_this()); } } }; template<> class async_data<void> : public std::enable_shared_from_this<async_data<void>> { std::mutex m_lock; std::exception_ptr m_exc; std::function<void(std::shared_ptr<async_data<void>>)> m_callback; bool m_data; public: async_data() : m_data(false) { m_lock.lock(); } void get() { m_lock.lock(); // No need to unlock until reset if (m_exc) { std::rethrow_exception(m_exc); } m_data = false; } void set_value() { m_lock.unlock(); m_data = true; if (m_callback) { m_callback(this->shared_from_this()); } } void set_exception(std::exception_ptr exc) { m_exc = exc; m_lock.unlock(); if (m_callback) { m_callback(this->shared_from_this()); } } void set_callback(std::function<void(std::shared_ptr < async_data<void>>)> callback) { m_callback = std::move(callback); if (m_exc || m_data) { m_callback(this->shared_from_this()); } } }; template<typename T> using async_data_ptr = std::shared_ptr<async_data<T> >; /** * Read handle of an async data object * @tparam T */ template<typename T> class future_base { public: async_data_ptr<T> m_data; public: //future_base() = default; future_base(async_data_ptr<T> d) : m_data(d) {} future_base(future_base const &) = delete; future_base(future_base &&) = default; future_base &operator=(future_base const &) = delete; future_base &operator=(future_base &&) = default; template<typename U = T> std::enable_if_t<!std::is_void<U>::value, T> get() { if (!m_data) { throw std::runtime_error("Invalid future"); } T res = m_data->get(); m_data.reset(); return res; } template<typename U = T> std::enable_if_t<std::is_void<U>::value, T> get() { if (!m_data) { throw std::runtime_error("Invalid future"); } } bool valid() const { return m_data.get(); } explicit operator bool() const { return valid(); } }; /** * Read handle of an async data object * @tparam T */ template<typename T> class future : public future_base<T> { public: using future_base<T>::future_base; explicit future() : future_base<T>(async_data_ptr<T>()) {} // Return a new future waiting for a callback template<typename F> inline auto next(F &&fun) -> future<decltype(fun((std::declval<future<T>>())))>; }; /** * Read handle of an async data object * Specialized for wrapped future, which next() unwraps * @tparam U */ template<typename U> class future<future<U> > : public future_base<future<U> > { public: typedef future<U> T; using future_base<T>::future_base; // Return a new future waiting for a callback template<typename F> inline auto next(F &&fun) -> future<decltype(fun((std::declval<future<U>>())))>; }; // Write handle of an async data object template<typename T> class promise { private: async_data_ptr<T> data; future<T> fut; public: promise() : data(std::make_shared<async_data<T>>()), fut(data) {} promise(promise const &) = delete; promise(promise &&) = default; ~promise() { if (data) { data->set_exception(std::make_exception_ptr( std::runtime_error("Broken promise"))); } } promise &operator=(promise const &) = delete; promise &operator=(promise &&) = default; future<T> get_future() { if (!fut.valid()) { throw std::logic_error("future already taken"); } return std::move(fut); } template<typename U = T> std::enable_if_t<!std::is_void<U>::value && std::is_copy_constructible<U>::value> set_value(U const &t) { if (!data) { throw std::runtime_error("Promise already satisfied"); } data->set_value(t); data.reset(); } template<typename U = T> std::enable_if_t<!std::is_void<U>::value && std::is_move_constructible<U>::value> set_value(U &&t) { if (!data) { throw std::runtime_error("Promise already satisfied"); } data->set_value(std::move(t)); data.reset(); } template<typename U = T> std::enable_if_t<std::is_void<U>::value> set_value() { if (!data) { throw std::runtime_error("Promise already satisfied"); } data->set_value(); data.reset(); } void set_exception(std::exception_ptr exc) { if (!data) { throw std::runtime_error("Promise already satisfied"); } data->set_exception(exc); data.reset(); } }; template<typename F, typename R, typename T> void async_callback(F&& f, promise<R> p, async_data_ptr<T> dat) { // Re-create future to pass as callback argument try { // Call fun, useresult to set promise' value p.set_value(f(future<T>{dat})); } catch(std::exception& e) { p.set_exception(std::current_exception()); } } template<typename F, typename T> void async_callback(F&& f, promise<void> p, async_data_ptr<T> dat) { // Re-create future to pass as callback argument try { // Call fun, useresult to set promise' value f(future<T>{dat}); p.set_value(); } catch(std::exception& e) { p.set_exception(std::current_exception()); } } template<typename T> template<typename F> auto future<T>::next(F&& fun) -> future<decltype(fun((std::declval<future<T>>())))> { if (!this->valid()) { throw std::logic_error("Future has no data"); } using R = decltype(fun(std::declval<future<T>>())); // Promise resulting from setting the callback promise<R> p; // Future that is returned future<R> fut_r = p.get_future(); // Lambda captures the promise, and set the value upon call auto type_erase = [prom{std::move(p)}, f{std::move(fun)}](async_data_ptr<T> dat) mutable -> void { async_callback(std::move(f), std::move(prom), dat); }; // Enable callback this->m_data->set_callback(make_shared_function(std::move(type_erase))); // invalidate self this->m_data = nullptr; // return the future associated with type erasing callback return fut_r; } template<typename U> template<typename F> auto future<future<U> >::next(F&& fun) -> future<decltype(fun((std::declval<future<U>>())))> { using R = decltype(fun(std::declval<future<U>>())); // Promise resulting from setting the callback promise<R> p; // Future that is returned future<R> fut_r = p.get_future(); // Lambda captures the promise, and passing it one deeper upon call auto type_erase = [prom = std::move(p), f = std::move(fun)](async_data_ptr<T> dat) mutable -> void { // prom and f are now two local variables auto unwrapped_call =[prom=std::move(prom), f=std::move(f)](async_data_ptr<U> dat) mutable -> void { async_callback(std::move(f), std::move(prom), dat); }; try { future<U> ft = dat->get(); ft.m_data->set_callback(make_shared_function(std::move(unwrapped_call))); } catch (std::exception &e) { promise<U> p; future<U> ft = p.get_future(); ft.m_data->set_callback(make_shared_function(std::move(unwrapped_call))); p.set_exception(std::current_exception()); } }; // Enable callback this->m_data->set_callback(make_shared_function(std::move(type_erase))); // invalidate self this->m_data = nullptr; // return the future associated with type erasing callback return fut_r; } }
29.956072
116
0.54369
[ "object" ]
32587f42ff5a70cc78afc22cf63d38246d87f491
10,385
h
C
Plugins/RunebergVR_Plugin/Source/Public/RunebergVR_Teleporter.h
1runeberg/OpenJam2017
a2ed232d6120acd0ae20358305ce189d2d1a7677
[ "MIT" ]
1
2018-01-31T06:20:01.000Z
2018-01-31T06:20:01.000Z
Plugins/RunebergVR_Plugin/Source/Public/RunebergVR_Teleporter.h
1runeberg/OpenJam2017
a2ed232d6120acd0ae20358305ce189d2d1a7677
[ "MIT" ]
null
null
null
Plugins/RunebergVR_Plugin/Source/Public/RunebergVR_Teleporter.h
1runeberg/OpenJam2017
a2ed232d6120acd0ae20358305ce189d2d1a7677
[ "MIT" ]
null
null
null
// Copyright (C) 2016, 2017 Runeberg (github: 1runeberg, UE4 Forums: runeberg) /* The MIT License (MIT) Copyright (c) 2016, 2017 runeberg (github: 1runeberg, UE4 Forums: runeberg) 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. */ #pragma once #include "Components/SceneComponent.h" #include "Components/SplineComponent.h" #include "Components/SplineMeshComponent.h" #include "RunebergVR_Teleporter.generated.h" // World fade settings USTRUCT(BlueprintType) struct FWorldFadeSettings { GENERATED_USTRUCT_BODY() /** Whether or not we want a world fade effect */ UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "VR") bool bDoWorldFade = false; /** Starting opacity of the world for the fade effect */ UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "VR") float FromOpacity = 0.f; /** The world's end opacity for the fade effect */ UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "VR") float ToOpacity = 0.f; /** How long will the fade effect will run */ UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "VR") float FadeDuration = 0.f; /** Color to use for the fade effect */ UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "VR") FLinearColor FadeColor = FLinearColor::Black; /** Whether or not to fade the audio */ UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "VR") bool bShouldFadeAudio = false; }; // Teleport Marker Movement Direction UENUM(BlueprintType) enum class EMoveDirectionEnum : uint8 { MOVE_FORWARD UMETA(DisplayName = "Towards Player"), MOVE_BACKWARD UMETA(DisplayName = "Away from Player"), MOVE_LEFT UMETA(DisplayName = "Left of Player"), MOVE_RIGHT UMETA(DisplayName = "Right of Player"), MOVE_CUSTOM UMETA(DisplayName = "Use a Custom Rotation for Direction") }; UCLASS( ClassGroup=(VR), meta=(BlueprintSpawnableComponent) ) class RUNEBERGVRPLUGIN_API URunebergVR_Teleporter : public USceneComponent { GENERATED_BODY() public: // Sets default values for this component's properties URunebergVR_Teleporter(); protected: // Called when the game starts virtual void BeginPlay() override; public: // Called every frame virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; /** How much earlier than fade out duration should the pawn teleport */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - World Fade") float FadeOutTeleportOffset = -1.f; /** These are the objects that the teleport beam will recognize as boundaries */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Beam Parameters") TArray<TEnumAsByte<EObjectTypeQuery> > TeleportBoundary_ObjectTypes; // The teleport beam's mesh UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Beam Parameters") class UStaticMesh* TeleportBeamMesh = nullptr; /** The teleport beam's Launch Velocity Magnitude - higher number increases range of teleport */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Beam Parameters") float BeamMagnitude = 500.f; /** A location offset from the parent mesh origin where the teleport beam will start */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Beam Parameters") FVector BeamLocationOffset = FVector::ZeroVector; /** For ray type beam, ensure the lenth of the beam reaches target location instantenously. Uses RayScaleRate as base length unit */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Beam Parameters") bool RayInstantScale = true; /** How much the ray will scale up until it reaches target location */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Beam Parameters") float RayScaleRate = 1.f; /** The teleport beam's navigation mesh tolerance - fine tune to fit your nav mesh bounds */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Beam Parameters") FVector BeamHitNavMeshTolerance = FVector(10.f, 10.f, 10.f); /** The teleport beam's custom gravity */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Beam Parameters") float ArcOverrideGravity = 0.f; // The teleport target stuff /** Additional offset of pawn (internal offsets are Steam: 112, Rift: 250) */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") FVector TeleportTargetPawnSpawnOffset = FVector(0.f, 0.f, 0.f); UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") float FloorIsAtZ = 0.f; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") class UStaticMesh* TeleportTargetMesh = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") FVector TeleportTargetMeshScale = FVector(1.f, 1.f, 1.f); UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") FVector TeleportTargetMeshSpawnOffset = FVector(0.f, 0.f, 5.f); /** Custom marker rotation (applied per frame) */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") FRotator CustomMarkerRotation = FRotator::ZeroRotator; /** If player should face marker rotation (use with Custom Marker Rotation) */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") bool bFaceMarkerRotation = false; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") class UParticleSystem* TeleportTargetParticle = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") FVector TeleportTargetParticleScale = FVector(1.f, 1.f, 1.f); UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR - Teleport Target Parameters") FVector TeleportTargetParticleSpawnOffset = FVector(0.f, 0.f, 0.f); /** SteamVR HMD Location Offset */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR") float SteamVRHeightOffset = 112.f; /** Oculus HMD Location Offset */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR") float OculusHeightOffset = 262.f; /** Check to see if an active teleport mode is turned on */ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VR - Read Only") bool IsTeleporting = false; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VR - Read Only") bool bIsTargetLocationValid = false; // Show the teleportation arc trace UFUNCTION(BlueprintCallable, Category = "VR") bool ShowTeleportArc(); // Show the teleportation ray trace UFUNCTION(BlueprintCallable, Category = "VR") bool ShowTeleportRay(); // Remove the teleportation arc trace UFUNCTION(BlueprintCallable, Category = "VR") bool HideTeleportArc(); // Remove the teleportation ray trace UFUNCTION(BlueprintCallable, Category = "VR") bool HideTeleportRay(); // Show marker in the world UFUNCTION(BlueprintCallable, Category = "VR") bool ShowMarker(); // Move Marker UFUNCTION(BlueprintCallable, Category = "VR") bool MoveMarker(EMoveDirectionEnum MarkerDirection = EMoveDirectionEnum::MOVE_FORWARD, int Rate = 25, FRotator CustomDirection = FRotator::ZeroRotator); // Remove marker UFUNCTION(BlueprintCallable, Category = "VR") bool HideMarker(); // Teleport UFUNCTION(BlueprintCallable, Category = "VR") bool TeleportNow(FWorldFadeSettings FadeOutOptions, FWorldFadeSettings FadeInOptions, bool ForceTeleport = false, bool TeleportPhysics = false); private: // Teleport target height offset - defaults to SteamVR FVector PawnHeightOffset = FVector(0.f, 0.f, 112.f); // Teleport targetting mode int TeleportMode = -1; // Teleport Arc constants const float ArcRadius = 0.f; const float MaxSimTime = 2.f; const float SimFrequency = 30.f; // Teleport Arc spline parameters USplineComponent* ArcSpline = nullptr; TArray<FVector> ArcPoints; TArray<USplineMeshComponent*> ArcSplineMeshes; FVector RayMeshScale = FVector(1.0f, 1.0f, 1.0f); FVector RayMeshScale_Max = FVector(1.0f, 1.0f, 1.0f); bool bIsBeamTypeTeleport = false; float RayNumOfTimesToScale = 0.f; float RayNumOfTimesToScale_Actual = 0.f; float RayDistanceToTarget = 0.f; // TeleportRay mesh UStaticMeshComponent* RayMesh = nullptr; // Teleport target location FVector TargetLocation = FVector::ZeroVector; FRotator TargetRotation = FRotator::ZeroRotator; // Spawned visible components for targetting marker UParticleSystemComponent* TargetParticleSystemComponent = nullptr; UStaticMeshComponent* TargetStaticMeshComponent = nullptr; // Teleport World Target Vars FTimerHandle FadeTimerHandle; FVector TeleportTargetLoc = FVector::ZeroVector; bool TeleportTargetPhys = false; // Draw teleport arc void DrawTeleportArc(); // Clear teleport arc spline void ClearTeleportArc(); // Draw teleport ray void DrawTeleportRay(); // Clear teleport arc spline void ClearTeleportRay(); // Spawn target location marker void SpawnTargetMarker(FVector MarkerLocation = FVector::ZeroVector, FRotator MarkerRotation = FRotator::ZeroRotator); // Show target location marker void SetTargetMarkerVisibility(bool MakeVisible=false); // Show target location marker void SetTargetMarkerLocationAndRotation(FVector MarkerLocation = FVector::ZeroVector, FRotator MarkerRotation = FRotator::ZeroRotator); // Remove target location marker void RemoveTargetMarker(); // Teleport Pawn Event void OnTeleport(); };
39.942308
460
0.773519
[ "mesh" ]
325b32ce80fe11041115460b2e5b1ba28b418a2b
10,132
h
C
sdk/robocore/include/hSensors/Mindsensors_LineLeader.h
varun-iyer/husarion-novscode
6188a64815c8b18c3d3cfad685bdc4a56336afc7
[ "MIT" ]
null
null
null
sdk/robocore/include/hSensors/Mindsensors_LineLeader.h
varun-iyer/husarion-novscode
6188a64815c8b18c3d3cfad685bdc4a56336afc7
[ "MIT" ]
null
null
null
sdk/robocore/include/hSensors/Mindsensors_LineLeader.h
varun-iyer/husarion-novscode
6188a64815c8b18c3d3cfad685bdc4a56336afc7
[ "MIT" ]
null
null
null
#ifndef __MINDSENSOR_LINELEADER_H__ #define __MINDSENSOR_LINELEADER_H__ #include <hFramework.h> namespace hSensors { /** * @brief Provides interface for LineLeader sensor. */ class Mindsensors_LineLeader { public: enum EError { ERROR_OK, ERROR_PROTO }; /** * @brief Create sensor object. * @param sensor - I2C capable hSensor port (eg. hSens1, hSens2) or software I2C * implementation (eg. \c hSens3.getSoftwareI2C(), \c hSens4.getSoftwareI2C()) */ Mindsensors_LineLeader(ILegoSensor_i2c& sensor); ~Mindsensors_LineLeader(); //!< Destory sensor object. EError init(); //!< Initialize sensor. void deinit(); //!< Deinitialize sensor. /** * @brief Read the uncalibrated sensors' values from the Line Leader. * * Each sensor returns a 16 bit value. * @param SensorUncVal - is 8 bytes returned. One for each sensor. * @return error code */ EError readSensorUncalibrated(int8_t *SensorUncVal); /** * @brief Read the "Raw Sensor" values from the Line Leader. * * Amount of light or dark each sensor sees. Typically between 0-20. 0=black, 100=white * @param pTab - is 8 ubytes returned. One for each sensor. * @return error code */ EError readSensorRaw(uint8_t *pTab); /** * @brief Read ubyte value with each bit equal to a sensor. * * 1 = Line<br> * 0 = No Line * <pre>SENSOR: 0 1 2 3 4 5 6 7 * MULTIPLIER: 1 2 4 8 16 32 64 128</pre> * To determine if a given sensor is over a line or not, use binary math * to test each bit.<br> * EXAMPLE: A returned value of 5 means sensor 0 and 2 are over a line. * @param v - is a ubyte returned. * @return error code */ EError readResult(uint8_t &v); /** * @brief Read the Weighted "Average" value from the sensor. * * Average is calculated internally by the sensor where each of the eight sensors is either triggered or not * and multiplied by a a factor to help determine if the line is left, right or * on center of the line (according to the set point).<br> * EXPECTED VALUES: 0-80<br> * <pre>SENSOR: 0 1 2 3 4 5 6 7 * MULTIPLIER: 10 20 30 40 50 60 70 80</pre> * FORMULA: Sum(Weighted Values)/Number sensors on line<br> * EXAMPLE: if sensor 6 and 7 are over a line, the average is:<br> * (0 + 0 + 0 + 0 + 0 + 0 + 70 + 80)/2 = 75<br> * in this case 75 > 45 (set point) so the bot is right of center * @param v - is a ubyte returned. * @return error code */ EError readAverage(uint8_t &v); /** * @brief Read the "Steering" value from the sensor. * * This value is calculated internally and can directly be used to set turning values for the robot's motors.<br> * EXPECTED VALUES: -100 to 100 * @param v - is a one byte returned. * @return error code */ EError readSteering(int8_t &v); /** *@brief Reads the "setPoint" value from the sensor. * * The set point is used by internally (or externally) by the sensor to * determine the middle of the sensor over a line. * @param v - is a ubyte returned. * @return error code */ EError readsetPoint(uint8_t &v); /** * @brief Read the "Kp" value from the sensor. * * Reads Kp value, p = Kp / KpFactor * @param v - return value. * @return error code */ EError readKp(uint8_t &v); /** * @brief Read the "Kp factor" value from the sensor. * * @param v - returned value. * @return error code */ EError readKpFactor(uint8_t &v); /** * @brief Read the "Ki" value from the sensor. * * This function reads Ki value, i = Ki / KiFactor * @param v - retured value. * @return error code */ EError readKi(uint8_t &v); /** * @brief Read the "Ki factor" value from the sensor. * * @param v - returned value. * @return error code */ EError readKiFactor(uint8_t &v); /** * @brief Read the "Kd" value from the sensor. * * This function reads Kd value, d = Kd / KdFactor * @param v - returned value. * @return error code */ EError readKd(uint8_t &v); /** * @brief Read the "Kd factor" value from the sensor. * * @param v - returned value. * @return error code */ EError readKdFactor(uint8_t &v); /** * @brief Read the "White Threshold" values from the Line Leader for each sensor. * * Each of the eight sensors has a value. Raw values greater then this threshold * equal white (area).<br> * The values are set when calibrating the white points for the sensor. * @param pTab - is 8 bytes returned. One for each sensor with Threshold. * @return error code */ EError readWhiteThresh(uint8_t *pTab); /** * @brief Read the "Black Threshold" values * * Read the "Black Threshold" values from the Line Leader for each sensor.<br> * Each of the eight sensors has a value. Raw values less then this threshold * equal black (line).<br> * The values are set when calibrating the black points for the sensor. * @param pTab - is 8 bytes returned. One for each sensor with Threshold. * @return error code */ EError readBlackThresh(uint8_t *pTab); /** *@brief Wake up the sensor * * This function wakes the line leader to prepare for use. * Using any function reading from sensor or writing to it also wake up line leader. * @return error code */ EError wakeUp(); /** * @brief Puts to sleep mode * * This function puts the line leader to sleep conserve power. * @return error code */ EError sleep(); /** * @brief Invert Line color * * The function toggles from dark line on light to light line on dark and back. * @return error code */ EError invertLineColor(); /** * @brief Reset line's color to default * * The function resets to default of sensing a dark line on light background * @return error code */ EError resetLineColor(); /** * @brief Take a snapshot * * This function takes a snapshot of the line under the sensor * and tracks that position in subsequent tracking operations. * Also this function will set inversion if it sees white line * on dark background * @return error code */ EError takeSnapshot(); /** * @brief Calibration White Thresold * * This function calibrates the white threshold for each sensor in the array. * Place the array over the white surface with all sensors on the white * area. Execute this command to set white values internally. * @return error code */ EError calWhite(); /** * @brief Calibration Black Threshold * * This function calibrates the black threshold for each sensor in the array. * Place the array over the white surface with all sensors on the black * area. Execute this command to set black values internally. * @return error code */ EError calBlack(); /** * Setting parameters */ /** * @brief Set the "Kp" value for the sensor's internal PID calculations. * * This value is usually set close to 1.0 default 25/32<br> * EXPECTED VALUES: 0 to 255<br> * DEFAULT VALUE: 25<br> * EXPECTED FACTORS: 1 to 255<br> * DEFAULT FACTOR: 32 * @param k - the value to set Kp * @param factor - the Kp factor, p = Kp/Kpfactor * @return error code */ EError setKp(uint8_t k, uint8_t factor); /** * @brief Set the "Ki" value for the sensor's internal PID calculations. * * This value is usually set close to 0 default 0/1<br> * EXPECTED VALUES: 0 to 255<br> * DEFAULT VALUE: 0<br> * EXPECTED FACTORS: 1 to 255<br> * DEFAULT FACTOR: 1 * @param k - the value to set Ki * @param factor - the Ki factor, i = Ki/Kifactor * @return error code */ EError setKi(uint8_t k, uint8_t factor); /** * @brief Set the "Kd" value for the sensor's internal PID calculations. * * This value is usually set lower to stabilize default 8/32<br> * EXPECTED VALUES: 0 to 255<br> * DEFAULT VALUE: 8<br> * EXPECTED VALUES: 1 to 255<br> * DEFAULT FACTOR: 32 * @param k - the value to set Kd * @param factor - the Kd factor, d = Kd/Kdfactor * @return error code */ EError setKd(uint8_t k, uint8_t factor); /** * @brief Set "SetPoint" value, * * The set point is used by internally (or externally) by the sensor to * determine the middle of the sensor over a line. This value is compared to * the average value to help the robot know if it is left or right of center. * @param data - the value to set the set point to. * @return error code */ EError setPoint(uint8_t data); private: /** * @brief Reads multiple bytes from a register in the Line leader sensor over I2C. * * Note: this is an internal function and should not be called directly. * @param regToRead - the register to read from * @param numBytes - the number of bytes to read * @param pDataMsg - one bytes array to store reply * @return error code */ EError _read(uint8_t regToRead, uint16_t numBytes, uint8_t *pDataTab); /** * @brief Reads one ubyte from a register in the Line leader sensor over I2C. * * Note: this is an internal function and should not be called directly. * @param regToRead - the register to read from * @param retval - the uint8_t value in which to store the reply * @return error code */ EError _read(uint8_t regToRead, uint8_t *retval); //funkcje używane do wpisywania wartości do sensora /** * @brief Sending command to line leader * This function sends a command to the lineleader over I2C. * * @param cmd - the command to be sent * @return error code PRELIMINARY COMMANDS FROM NXC LIB CODE - A American frequency compensation - B for black calibration - D sensor power down - E European frequency compensation - I invert line color - P power on sensor - R reset line color to dark - S snapshot to determine line color - U Universal frequency compensation (default) - S setpoint based on snapshot (automatically set's invert if needed) - W White balance */ EError sendCmd(uint8_t cmd); /** * @brief Writing data to sensor * This function writes data to a register in the line leader sensor over I2C. * * Note: this is an internal function and should not be called directly. * @param regToWrite - the register to write to * @param data - the value to write to the register * @return error code */ EError _write(uint8_t regToWrite, uint8_t data); ILegoSensor_i2c &sens; bool initialized; }; } #endif
28.460674
113
0.687919
[ "object" ]
32613c0b2fe014c7da636f6531993f043fdfd5fe
3,753
h
C
YBImageBrowser/ImageBrowse/YBImageBrowseCellData.h
zhongguoming/YBImageBrowser
863f0bdec3229e94fca82ade22361ce758ab417c
[ "MIT" ]
1
2018-10-23T13:13:12.000Z
2018-10-23T13:13:12.000Z
YBImageBrowser/ImageBrowse/YBImageBrowseCellData.h
zhongguoming/YBImageBrowser
863f0bdec3229e94fca82ade22361ce758ab417c
[ "MIT" ]
null
null
null
YBImageBrowser/ImageBrowse/YBImageBrowseCellData.h
zhongguoming/YBImageBrowser
863f0bdec3229e94fca82ade22361ce758ab417c
[ "MIT" ]
null
null
null
// // YBImageBrowseCellData.h // YBImageBrowserDemo // // Created by 杨波 on 2018/8/25. // Copyright © 2018年 杨波. All rights reserved. // #import <Foundation/Foundation.h> #import <Photos/Photos.h> #import "YBImage.h" #import "YBImageBrowserCellDataProtocol.h" typedef NS_ENUM(NSUInteger, YBImageBrowseFillType) { YBImageBrowseFillTypeUnknown, // The width of the image is up to the width of the screen, the height automatic adaptation. YBImageBrowseFillTypeFullWidth, // The image maximization display but ensure integrity. YBImageBrowseFillTypeCompletely }; typedef YBImage* (^YBIBLocalImageBlock)(void); NS_ASSUME_NONNULL_BEGIN @interface YBImageBrowseCellData : NSObject <YBImageBrowserCellDataProtocol> /** For local image. The usage of 'YBImage' is the same as 'UIImage', support GIF, WebP and APNG. */ @property (nonatomic, copy, nullable) YBIBLocalImageBlock imageBlock; /** For network image. The network address of image. */ @property (nonatomic, strong, nullable) NSURL *url; /** Image from the system album */ @property (nonatomic, strong, nullable) PHAsset *phAsset; /** The source rendering object corresponding to the current data model, it's used for animation. In general, it's 'UIImageView', but it can also be 'UIView' or 'CALayer'. */ @property (nonatomic, weak, nullable) id sourceObject; /** As a preview image. It's usually a low quality image. If 'sourceObject' is valid and is kind of 'UIImageView', it will automatic setting 'thumbImage'. */ @property (nonatomic, strong, nullable) UIImage *thumbImage; /** As a preview image. It's invalid if it is not found in the cache. */ @property (nonatomic, strong, nullable) NSURL *thumbUrl; /** The final image. */ @property (nonatomic, strong, readonly, nullable) YBImage *image; /** Preloading data right now, but it may bring some CPU pressure. Before calling this method, make sure that one of 'imageBlock' 'url' 'phAsset' is valid. */ - (void)preload; /** When the image is big enough, cutting image at the time of preload. Set before call '-preload', the default is YES. */ @property (nonatomic, class) BOOL precutLargeImage; /** The maximum zoom scale of image, must be greater than or equal to 1. If there is no explicit settings, it will automatically calculate through the image's pixel. */ @property (nonatomic, assign) CGFloat maxZoomScale; /** When the zoom scale is automatically calculated, the result multiplied by this surplus as the final scaling. The defalut is 1.5. */ @property (nonatomic, class) CGFloat globalZoomScaleSurplus; /** The maximum texture size, defalut is '(CGSize){4096, 4096}'. When the image exceeds this texture size, it will be compressed asynchronously and cut asynchronously. It is best to set this value before instantiating all variables. */ @property (nonatomic, class) CGSize globalMaxTextureSize; /** The default is 'YBImageBrowseFillTypeFullWidth'. */ @property (nonatomic, class) YBImageBrowseFillType globalVerticalfillType; /** The default is 'YBImageBrowseFillTypeFullWidth'. */ @property (nonatomic, class) YBImageBrowseFillType globalHorizontalfillType; /** The current instance variable will ignore the global configuration when this value is valid. */ @property (nonatomic, assign) YBImageBrowseFillType verticalfillType; /** The current instance variable will ignore the global configuration when this value is valid. */ @property (nonatomic, assign) YBImageBrowseFillType horizontalfillType; /** The default is YES. */ @property (nonatomic, assign) BOOL allowSaveToPhotoAlbum; /** The default is YES. */ @property (nonatomic, assign) BOOL allowShowSheetView; /** You can set any data. */ @property (nonatomic, strong, nullable) id extraData; @end NS_ASSUME_NONNULL_END
37.53
135
0.75886
[ "object", "model" ]
3265225d1a55513e5e7fc051820eb491140a53d2
758
h
C
include/il2cpp/Dpr/Battle/Logic/BTL_CLIENT/ClientMainProc.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
1
2022-01-15T20:20:27.000Z
2022-01-15T20:20:27.000Z
include/il2cpp/Dpr/Battle/Logic/BTL_CLIENT/ClientMainProc.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
null
null
null
include/il2cpp/Dpr/Battle/Logic/BTL_CLIENT/ClientMainProc.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
null
null
null
#pragma once #include "il2cpp.h" void Dpr_Battle_Logic_BTL_CLIENT_ClientMainProc___ctor (Dpr_Battle_Logic_BTL_CLIENT_ClientMainProc_o* __this, Il2CppObject* object, intptr_t method, const MethodInfo* method_info); bool Dpr_Battle_Logic_BTL_CLIENT_ClientMainProc__Invoke (Dpr_Battle_Logic_BTL_CLIENT_ClientMainProc_o* __this, const MethodInfo* method_info); System_IAsyncResult_o* Dpr_Battle_Logic_BTL_CLIENT_ClientMainProc__BeginInvoke (Dpr_Battle_Logic_BTL_CLIENT_ClientMainProc_o* __this, System_AsyncCallback_o* callback, Il2CppObject* object, const MethodInfo* method_info); bool Dpr_Battle_Logic_BTL_CLIENT_ClientMainProc__EndInvoke (Dpr_Battle_Logic_BTL_CLIENT_ClientMainProc_o* __this, System_IAsyncResult_o* result, const MethodInfo* method_info);
84.222222
221
0.890501
[ "object" ]
326d6890003ab1a99444e9468e950da1cd5b4243
4,877
h
C
src/android/android-uvc.h
KroniKare/RealSense-NewAndroid
f60eec84eb977f46f31b8a39bf7d5ba4767165b0
[ "Apache-2.0" ]
1
2019-02-25T19:49:53.000Z
2019-02-25T19:49:53.000Z
src/android/android-uvc.h
leeecheng/RealSense-NewAndroid
f60eec84eb977f46f31b8a39bf7d5ba4767165b0
[ "Apache-2.0" ]
null
null
null
src/android/android-uvc.h
leeecheng/RealSense-NewAndroid
f60eec84eb977f46f31b8a39bf7d5ba4767165b0
[ "Apache-2.0" ]
2
2019-04-22T07:02:14.000Z
2020-10-07T14:05:32.000Z
// License: Apache 2.0. See LICENSE file in root directory. // Copyright(c) 2015 Intel Corporation. All Rights Reserved. #pragma once #include "../backend.h" #include "usb_host/android_uvc.h" #include <unordered_map> #include <mutex> #include <atomic> #define UVC_AE_MODE_D0_MANUAL ( 1 << 0 ) #define UVC_AE_MODE_D1_AUTO ( 1 << 1 ) #define UVC_AE_MODE_D2_SP ( 1 << 2 ) #define UVC_AE_MODE_D3_AP ( 1 << 3 ) struct usbhost_uvc_device; namespace librealsense { namespace platform { class android_backend; struct profile_and_callback { stream_profile profile; frame_callback callback = nullptr; }; typedef std::function<void(const uvc_device_info&)> uvc_enumeration_callback; class android_uvc_device : public std::enable_shared_from_this<android_uvc_device>, public uvc_device { public: android_uvc_device(const uvc_device_info& info, std::shared_ptr<const android_backend> backend); ~android_uvc_device(); //std::vector<uvc_device_info> query_uvc_devices() const; void probe_and_commit(stream_profile profile, frame_callback callback, int buffers) override; // open thread and take frames void stream_on(std::function<void(const notification& n)> error_handler = [](const notification& n){}) override; void start_callbacks() override; void stop_callbacks() override; void close(stream_profile profile) override; void set_power_state(power_state state) override; power_state get_power_state() const override { return _power_state; } std::vector<stream_profile> get_profiles() const override; static bool is_connected(const uvc_device_info& info); void init_xu(const extension_unit& xu) override; bool set_xu(const extension_unit& xu, uint8_t ctrl, const uint8_t* data, int len) override; bool get_xu(const extension_unit& xu, uint8_t ctrl, uint8_t* data, int len) const override; control_range get_xu_range(const extension_unit& xu, uint8_t ctrl, int len) const override; bool get_pu(rs2_option opt, int32_t& value) const override; bool set_pu(rs2_option opt, int value) override; control_range get_pu_range(rs2_option opt) const override; void lock() const override { _systemwide_lock.lock(); } void unlock() const override {_systemwide_lock.unlock(); } std::string get_device_location() const override { return _location; } usb_spec get_usb_specification() const override { return _device_usb_spec; } private: friend class source_reader_callback; int32_t rs2_value_translate(uvc_req_code action, rs2_option option, int32_t value) const; void play_profile(stream_profile profile, frame_callback callback); void stop_stream_cleanup(const stream_profile& profile, std::vector<profile_and_callback>::iterator& elem); void flush(int sIndex); void check_connection() const; int rs2_option_to_ctrl_selector(rs2_option option, int &unit) const; int32_t get_data_usb(uvc_req_code action, int control, int unit, unsigned int length = sizeof(uint32_t)) const; void set_data_usb(uvc_req_code action, int control, int unit, int value) const; const uvc_device_info _info; power_state _power_state = D3; // power state change is unsupported uint16_t _streamIndex; std::vector<profile_and_callback> _streams; std::mutex _streams_mutex; std::shared_ptr<const android_backend> _backend; std::string _location; usb_spec _device_usb_spec; std::vector<stream_profile> _profiles; std::vector<frame_callback> _frame_callbacks; bool _streaming = false; std::atomic<bool> _is_started = {false}; std::shared_ptr<usbhost_uvc_device> _device = nullptr; int _input_terminal = 0; int _processing_unit = 0; int _extension_unit = 0; mutable std::recursive_mutex _systemwide_lock; mutable std::mutex _power_mutex; void poll_interrupts(); std::atomic_bool _keep_pulling_interrupts; std::shared_ptr<std::thread> _interrupt_polling_thread; }; } }
42.780702
124
0.613697
[ "vector" ]
326ed8026f8036f0dcd65b6b424f29fb8ef8b135
11,481
h
C
map_manager/include/dbdriver/dbdriver.h
MarvinStuede/cmr_localization
25392ed993242ba48a61ece19490d73be97ba2e2
[ "BSD-3-Clause" ]
3
2020-12-02T05:56:12.000Z
2021-03-22T06:45:45.000Z
map_manager/include/dbdriver/dbdriver.h
MarvinStuede/cmr_localization
25392ed993242ba48a61ece19490d73be97ba2e2
[ "BSD-3-Clause" ]
null
null
null
map_manager/include/dbdriver/dbdriver.h
MarvinStuede/cmr_localization
25392ed993242ba48a61ece19490d73be97ba2e2
[ "BSD-3-Clause" ]
2
2022-02-02T15:08:57.000Z
2022-02-17T08:24:26.000Z
/* ***************************************************************** * * map_manager * * Copyright (c) 2019 * Institute of Mechatronic Systems, * Leibniz Universitaet Hannover. * (BSD License) * All rights reserved. * * http://www.imes.uni-hannover.de * * This software is distributed WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. * * For further information see http://www.linfo.org/bsdlicense.html * ******************************************************************/ /** * @file dbdriver.h * @author Simon Ehlers (simon.ehlers@stud.uni-hannover.de) * @date 26.07.2019 * * @brief Driver for accessing the database linkpoint.db */ #ifndef DBDRIVER_H #define DBDRIVER_H #include "ros/ros.h" #include "std_msgs/String.h" #include "std_srvs/Empty.h" #include "stdio.h" #include "sqlite3.h" #include "iostream" #include <memory> #include <rtabmap/core/DBDriverSqlite3.h> #include <rtabmap/core/util3d.h> #include <rtabmap/core/Compression.h> #include <rtabmap/utilite/UtiLite.h> #include <rtabmap/core/DBDriverSqlite3.h> #include <rtabmap/core/Transform.h> #include <stdlib.h> #include <cstdlib> #include <string> #include <sstream> #include <linkpoint/linkpoint.h> #include <tuple> #include <sensor_msgs/Image.h> #include <sensor_msgs/PointCloud2.h> #include <opencv2/opencv.hpp> #include <rtabmap/core/Compression.h> #include <pcl_conversions/pcl_conversions.h> #include <pcl/point_types.h> #include <pcl/PCLPointCloud2.h> #include <pcl/conversions.h> #include <pcl_ros/transforms.h> /** * @brief The DBDriver class: Driver for accessing the database linkpoint.db */ class DBDriver { public: /** * Method for opening the database for a give url * * @brief DBDriver::open_database * @param url (std::string) * @return conn (sqlite3*) */ sqlite3* open_database(std::string url); //################### METHODS FOR TABLE LINKPOINTS ######################################################## /** * Creates the tabel LINKPOINTS in the linkpoint.db * * @brief DBDriver::create_table_linkpoints * @param url */ void create_table_linkpoints(std::string url); /** * Insert linkpoint in sqlite3 databse * * @brief DBDriver::insert_linkpoint * @param url (std::string) * @param lp (LinkPoint) * @return bool (if insertion succeeded) */ bool insert_linkpoint(std::string url, LinkPoint lp); /** * Retrieve LinkPoint from a given databse with a certain id. * * @brief DBDriver::get_linkpoint * @param url (std::string) * @param id (int) * @return LinkPoint */ LinkPoint get_linkpoint(std::string url, int id); /** * Retrieves an entry of type int from a database based on a specified table, property and id. * * @brief DBDriver::get_db_property_int * @param url (std::string) * @param id (int) * @param property (std::string) * @param table (std::string) * @return value (int) */ int get_db_property_int(std::string url, int id, std::string property, std::string table); /** * Retrieves an entry of type double from a database based on a specified table, property and id. * * @brief DBDriver::get_db_property_double * @param url (std::string) * @param id (int) * @param property (std::string) * @param table (std::string) * @return value (double) */ double get_db_property_double(std::string url, int id, std::string property, std::string table); /** * Retrieves an entry of type text (std::string) from a database based on a specified table, property and id. * * @brief DBDriver::get_db_property_text * @param url (std::string) * @param id (int) * @param property (std::string) * @param table (std::string) * @return text (std::string) */ std::string get_db_property_text(std::string url, int id, std::string property, std::string table); /** * Get id of Linkpoint by providing the tag. * * @brief DBDriver::get_lp_id_by_tag * @param url (std::string) * @param tag (std::string) * @return linkpoint id (int) */ int get_lp_id_by_tag(std::string url, std::string tag); /** * Insert linkpoint with images in database. * The images can be used for appearance-based loop closure detection. * * @brief DBDriver::insert_linkpoint_with_images * @param url (std::string) * @param lp (LinkPoint) * @param img_front (cv::Mat) * @param img_rear (cv::Mat) * @return bool (if succeeded) */ bool insert_linkpoint_with_images(std::string url, LinkPoint lp, cv::Mat img_front, cv::Mat img_rear); /** * Get image from linkpoint. The cam position (FRONT or REAR) has to be determined. * * @brief DBDriver::get_linkpoint_image * @param url (std::string) * @param id (int) * @param cam_position (std::string) * @return image (cv::Mat) */ cv::Mat get_linkpoint_image(std::string url, int id, std::string cam_position); /** * Method for deleting linkpoint * * @brief DBDriver::delete_linkpoint * @param url * @param id */ void delete_linkpoint(std::string url, int id); /** * Get all the available linkpoint ids (from table (LINKPOINTS) in a vector. * This is used for text_io_. * * @brief DBDriver::get_linkpoint_ids * @param url (std::string) * @return linkpoint_ids (std::vector<int>) */ std::vector<int> get_linkpoint_ids(std::string url); //################### METHODS FOR TABLE MAPS ######################################################## /** * Method for creating the table maps in database * * @brief DBDriver::create_table_maps * @param url (std::string) */ void create_table_maps(std::string url); /** * Inserting map in database with name and path for the given url. * * @brief DBDriver::insert_map * @param url (std::string) * @param map_id (int) * @param name (std::string) * @param path (std::string) * @param indoor (bool) */ void insert_map(std::string url, int map_id, std::string name, std::string path, bool indoor); /** * Inserts the property (string) for the corresponding strands_db in this entry. * Comment: Somehow, the UPDATE feature in sqlite3 did not work, so the old row is deleted and a new one inserted. * * @brief DBDriver::insert_strandsDB_into_map * @param url (std::string) to the database * @param map_id (int) * @param strands_db (std::string) Information (name or path) which should be saved. */ void insert_strandsDB_into_map(std::string url, int map_id, std::string strands_db); /** * Retrieve map troperty text (std::string). * * @brief DBDriver::get_map_property_text * @param url (std::string) * @param id (int) * @param property (std::string) * @return entry (std::string) */ std::string get_map_property_text(std::string url, int map_id, std::string property); /** * Retrieve map property int. * * @brief DBDriver::get_map_property_int * @param url (std::string) * @param id (int) * @param property (std::string) * @return value (int) */ int get_map_property_int(std::string url, int map_id, std::string property); /** * Deletes the map entry for the given id (int). * * @brief DBDriver::delete_map * @param url (std::string) * @param map_id (int) */ void delete_map(std::string url, int map_id); /** * Get all the available map ids (from table (MAPS) in a vector. * This is used for text_io_. * * @brief DBDriver::get_map_ids * @param url (std::string) * @return map_ids (std::vector<int>) */ std::vector<int> get_map_ids(std::string url); //################### METHODS FOR TABLE LINKPOINT CANDIDATES ################# /** * Creates the table LINKPOINTCANDIDATES in the databse. * * @brief DBDriver::create_table_linkpoint_candidates * @param url (std::string) */ void create_table_linkpoint_candidates(std::string url); /** * Insert linkpoint candiate into table LINKPOINTCANDIDATES * * @brief DBDriver::insert_linkpoint_candidate * @param url (std::string) * @param lp (LinkPoint) * @param img (cv::Mat) image for following loop closure detection * @param pointcloud_path (std::string) path to external stored pcl pointcloud * @return bool if succeded */ bool insert_linkpoint_candidate(std::string url, LinkPoint lp, cv::Mat img, std::string pointcloud_path); /** * Retrieve link point candidate from database. * * @brief DBDriver::get_linkpoint_candidate * @param url (std::string) * @param id (int) * @return LinkPoint */ LinkPoint get_linkpoint_candidate(std::string url, int id); /** * Retrieve image from linkpoint candidate. * * @brief DBDriver::get_linkpoint_candidate_image * @param url (std::string) * @param id (int) * @return image (cv::Mat) */ cv::Mat get_linkpoint_candidate_image(std::string url, int id); /** * Retrieve pointcloud from linkpoint cadidate in table LINKPOINTCANDIDATES. * Note, the poincloud is not saved in the sqlite3 database but external. * * @brief DBDriver::get_linkpoint_candidate_pointcloud * @param url (std::string) * @param id (int) * @return pointcloud_ptr (pcl::PointCloud<pcl::PointXYZ>::Ptr) */ pcl::PointCloud<pcl::PointXYZ>::Ptr get_linkpoint_candidate_pointcloud(std::string url, int id); /** * Deletes linkpoint candidates entry in table LINKPOINTCONDIDATES. * * @brief DBDriver::delete_linkpoint_candidate * @param url (std::string) * @param id (int) */ void delete_linkpoint_candidate(std::string url, int id); /** * Get all the available linkpoint candidates ids (from table (LINKPOINTCANDIDATES) in a vector. * This is used for loop closure detection. * * @brief DBDriver::get_lp_candidate_ids * @param url (std::string) * @return lp_candidate_ids (std::vector<int>) */ std::vector<int> get_lp_candidate_ids(std::string url); //###### UTILITY METHODS ############# /** * Compresses the given image for insertion in sqlite3 database. * Code from rtabmap corelib/src/Compression.cpp line 102 * @brief DBDriver::compress_image * @param image * @return compressed image (cv::Mat) */ cv::Mat compress_image(cv::Mat img); /** * Converts a cv::Mat into a pcl pointcloud. * * @brief DBDriver::cv_mat_to_pcl * @param openCVpointcloud (cv::Mat) * @return point_cloud_ptr (pcl::PointCloud<pcl::PointXYZ>::Ptr) */ pcl::PointCloud<pcl::PointXYZ>::Ptr cv_mat_to_pcl(cv::Mat openCVpointcloud); /** * Returns the numer of rows in the table, which can be used for setting the id for a new entry. * * @brief DBDriver::get_number_of_rows * @param url (std::string) * @param table (std::string) * @return cnt_rows (int) */ int get_number_of_rows(std::string url, std::string table); }; #endif // DBDRIVER_H
30.780161
118
0.624771
[ "vector", "transform" ]
3273158c2b769a3c9f892f542a8a776be5633f7a
437
h
C
Sourceress.h
dimitroffangel/PathfindingGame
38e725a2c67fabc4f4b88e6a62a9b01bee731f00
[ "MIT" ]
null
null
null
Sourceress.h
dimitroffangel/PathfindingGame
38e725a2c67fabc4f4b88e6a62a9b01bee731f00
[ "MIT" ]
null
null
null
Sourceress.h
dimitroffangel/PathfindingGame
38e725a2c67fabc4f4b88e6a62a9b01bee731f00
[ "MIT" ]
null
null
null
#ifndef SOURCERESS_H_GUARD #define SOURCERESS_H_GUARD #include "EnitityComponent.h" #include "PlayerCharacter.h" #include <vector> #include <string> #include <stack> class Sourceress : public PlayerCharacter { private: std::stack<Position> m_ShortestWay; public: virtual void Move() override; virtual void InitializeCharacter() override; private: std::vector<std::vector<int>> CalculateTheDistanceToEveryPosition(); }; #endif
16.807692
69
0.778032
[ "vector" ]
3273342fbdd2948f8407ebfaac395689837dc70c
35,604
c
C
dmach~.c
Lucarda/pd-lyonpotpourri
74a106d5f07b558cf8e42e612417ff4cf2f45a43
[ "MIT" ]
9
2021-02-02T16:57:14.000Z
2021-09-16T19:58:22.000Z
dmach~.c
Lucarda/pd-lyonpotpourri
74a106d5f07b558cf8e42e612417ff4cf2f45a43
[ "MIT" ]
15
2021-02-04T00:22:57.000Z
2022-01-07T05:23:54.000Z
dmach~.c
Lucarda/pd-lyonpotpourri
74a106d5f07b558cf8e42e612417ff4cf2f45a43
[ "MIT" ]
4
2021-02-04T11:46:05.000Z
2022-02-12T04:13:27.000Z
#include "MSPd.h" #define MAX_ATTACKS (512) #define MAX_PATTERNS (1024) #define OBJECT_NAME "dmach~" static t_class *dmach_class; typedef struct { float trigger_point; float increment; float amplitude; } t_attack; typedef struct { short active; // flag for if this drum slot is used in current pattern int attack_count; // number of attacks in this pattern int adex; // index to current attack t_attack *attacks; // array containing attack data } t_drumline; typedef struct { float beats; // how many beats in this pattern float dsamps; //duration of pattern in samples t_drumline *drumlines; } t_pattern; typedef struct _dmach { t_object x_obj; float x_f; short mute; // global mute float clocker; // global sample counter clock float tempo; float tempo_factor; // multiplier to get actual beat duration t_pattern *patterns; // contains all drum patterns short *stored_patterns;// which locations contain a pattern float *gtranspose;// transpose factor for each individual drum slot float *gains; // gain factor for each individual drum slot float *current_increment;// maintains increment for sustained output int this_pattern; // number of current pattern int next_pattern; // number of pattern to call at end of current pattern float global_gain; float global_transpose; float sr; int drum_count; // number of drum slots to instantiate int outlet_count; // number of outlets on object short virgin; // no patterns stored - turn off performance /* sequencer */ short playsequence; // flag to play through a stored sequence once short loopsequence; // flag to loop repeatedly through sequence int *sequence; // contains the sequence of bars to play int sequence_length; // how many bars are stored in sequence int seqptr; // keep track of current sequencer position float zeroalias; // use this to send a coded "zero" message (i.e. bar number is zero) t_atom *listdata; // for list output void *listraw_outlet;// send a list short clickincr; //flag that click increment is on (i.e. no sample and hold) short *attackpattern; // holds full attack sequence including zeros (for list output) int attackpattern_count;// how many ticks in attack pattern t_attack *tmpatks; // hold local copy of new slot pattern short *connected; // list of vector connections short *muted; // state of each slot short instant_recall; // flag that pattern gets loaded immediately (loops only) } t_dmach; static void dmach_store(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void *dmach_new(t_symbol *s, int argc, t_atom *argv); static t_int *dmach_perform(t_int *w); static void dmach_mute(t_dmach *x, t_floatarg toggle); static void dmach_dsp(t_dmach *x, t_signal **sp); static void dmach_dsp_free(t_dmach *x); static void dmach_init_pattern(t_dmach *x, int pnum); static void dmach_show(t_dmach *x, t_floatarg fn); static void dmach_tempo(t_dmach *x, t_floatarg new_tempo); static void dmach_recall(t_dmach *x, t_floatarg pnf); static void dmach_transpose(t_dmach *x, t_floatarg slotf, t_floatarg new_transpose_factor); static void dmach_gain(t_dmach *x, t_floatarg slotf, t_floatarg new_gain_factor); static void dmach_arm(t_dmach *x, t_floatarg pnf); static void dmach_playsequence(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void dmach_slotamps(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void dmach_printraw(t_dmach *x, t_floatarg fn); static void dmach_readraw(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void dmach_slotincrs(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void dmach_loopsequence(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void dmach_muteslot(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void dmach_slotampsfull(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void dmach_nosequence(t_dmach *x); static void dmach_copypattern(t_dmach *x, t_floatarg pn1, t_floatarg pn2); static void dmach_listraw(t_dmach *x, t_symbol *s, int argc, t_atom *argv); static void dmach_clickincr(t_dmach *x, t_floatarg toggle); static void dmach_instant_recall(t_dmach *x, t_floatarg toggle); void dmach_tilde_setup(void) { dmach_class = class_new(gensym("dmach~"), (t_newmethod)dmach_new, (t_method)dmach_dsp_free,sizeof(t_dmach), 0,A_GIMME,0); CLASS_MAINSIGNALIN(dmach_class, t_dmach, x_f); class_addmethod(dmach_class,(t_method)dmach_dsp, gensym("dsp"), A_CANT, 0); class_addmethod(dmach_class,(t_method)dmach_mute,gensym("mute"),A_FLOAT,0); class_addmethod(dmach_class,(t_method)dmach_show,gensym("show"),A_FLOAT,0); class_addmethod(dmach_class,(t_method)dmach_tempo,gensym("tempo"),A_FLOAT,0); class_addmethod(dmach_class,(t_method)dmach_store,gensym("store"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_recall,gensym("recall"),A_FLOAT,0); class_addmethod(dmach_class,(t_method)dmach_transpose,gensym("transpose"),A_FLOAT,A_FLOAT, 0); class_addmethod(dmach_class,(t_method)dmach_gain,gensym("gain"),A_FLOAT,A_FLOAT, 0); class_addmethod(dmach_class,(t_method)dmach_printraw,gensym("printraw"),A_FLOAT,0); class_addmethod(dmach_class,(t_method)dmach_arm,gensym("arm"),A_FLOAT,0); class_addmethod(dmach_class,(t_method)dmach_readraw,gensym("readraw"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_listraw,gensym("listraw"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_playsequence,gensym("playsequence"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_slotamps,gensym("slotamps"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_slotampsfull,gensym("slotampsfull"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_slotincrs,gensym("slotincrs"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_loopsequence,gensym("loopsequence"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_muteslot,gensym("muteslot"),A_GIMME,0); class_addmethod(dmach_class,(t_method)dmach_nosequence,gensym("nosequence"),0); class_addmethod(dmach_class,(t_method)dmach_copypattern,gensym("copypattern"),A_FLOAT,A_FLOAT, 0); class_addmethod(dmach_class,(t_method)dmach_clickincr,gensym("clickincr"),A_FLOAT,0); class_addmethod(dmach_class,(t_method)dmach_instant_recall,gensym("instant_recall"),A_FLOAT,0); potpourri_announce(OBJECT_NAME); } void dmach_muteslot(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int slot; int drum_count = x->drum_count; short mutestate; if(argc < 2) { post("muteslot: pattern number, slot number"); return; } slot = (int)atom_getfloatarg(0,argc,argv); mutestate = (short)atom_getfloatarg(1,argc,argv); if(slot < 0 || slot > drum_count - 1) { error("muteslot: illegal slot index: %d",slot); return; } x->muted[slot] = mutestate; } void dmach_nosequence(t_dmach *x) { x->playsequence = 0; x->loopsequence = 0; } void dmach_playsequence(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int i; int pnum; if(argc < 1) { error("%s: zero length sequence",OBJECT_NAME); return; } /* need safety check here */ for(i = 0; i < argc; i++) { pnum = (int) atom_getfloatarg(i,argc,argv); if(! x->stored_patterns[pnum]) { error("%d is not currently stored",pnum); return; } } for(i = 0; i < argc; i++) { x->sequence[i] = (int) atom_getfloatarg(i,argc,argv); } // if(x->instant_recall) { x->this_pattern = x->sequence[0]; x->clocker = x->patterns[x->this_pattern].dsamps; } else { x->next_pattern = x->sequence[0]; } x->mute = 0; x->playsequence = 1; x->loopsequence = 0; x->sequence_length = argc; x->seqptr = 0; } void dmach_loopsequence(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int i; int pnum; if(argc < 1) { error("%s: zero length sequence",OBJECT_NAME); return; } for(i = 0; i < argc; i++) { pnum = (int) atom_getfloatarg(i,argc,argv); if(! x->stored_patterns[pnum]) { error("%d is not currently stored",pnum); return; } } for(i = 0; i < argc; i++) { x->sequence[i] = (int) atom_getfloatarg(i,argc,argv); } if(x->instant_recall) { x->this_pattern = x->sequence[0]; x->clocker = x->patterns[x->this_pattern].dsamps; } else { x->next_pattern = x->sequence[0]; } x->mute = 0; x->playsequence = 1; x->loopsequence = 1; x->sequence_length = argc; x->seqptr = 0; } void dmach_gain(t_dmach *x, t_floatarg slotf, t_floatarg new_gain_factor) { int slot = slotf; // float ratio; // float gain_factor; // short *stored_patterns = x->stored_patterns; float *gains = x->gains; // t_pattern *p = x->patterns; int drum_count = x->drum_count; // int i,j,k; if(slot < 0 || slot > drum_count - 1) { error("illegal slot index: %d",slot); return; } /* if(new_gain_factor <= 0) { error("illegal gain factor %f", new_gain_factor); return; } */ // gain_factor = gains[slot]; // ratio = new_gain_factor / gain_factor; gains[slot] = new_gain_factor; } void dmach_transpose(t_dmach *x, t_floatarg slotf, t_floatarg new_transpose_factor) { int slot = slotf; float *gtranspose = x->gtranspose; int drum_count = x->drum_count; if(slot < 0 || slot > drum_count - 1) { error("%s: transpose given illegal slot index: %d",OBJECT_NAME, slot); return; } if(new_transpose_factor == 0) { error("illegal transpose factor %f", new_transpose_factor); return; } gtranspose[slot] = new_transpose_factor; } void dmach_recall(t_dmach *x, t_floatarg pnf) { int pnum = pnf; /* post("requested recall of %d, ignored",pnum); return;*/ if(pnum < 0) { error("requested index is less than zero"); return; } if(pnum >= MAX_PATTERNS) { error("requested index is greater than the maximum of %d",MAX_PATTERNS-1); return; } if(! x->stored_patterns[pnum]) { error("%d is not currently stored",pnum); return; } // x->this_pattern = x->next_pattern = pnum; x->mute = 0; x->next_pattern = pnum; } void dmach_arm(t_dmach *x, t_floatarg pnf) { int pnum = pnf; int i; t_pattern *p = x->patterns; if(pnum < 0) { error("requested index is less than zero"); return; } if(pnum > MAX_PATTERNS) { error("%s: requested index is greater than the maximum of %d",OBJECT_NAME,MAX_PATTERNS-1); return; } if(! x->stored_patterns[pnum]) { error("%s: %d is not currently stored",OBJECT_NAME,pnum); return; } x->mute = 1; x->clocker = 0; x->next_pattern = x->this_pattern = pnum; for(i = 0; i < x->drum_count; i++){ /* reset pointers */ p[x->this_pattern].drumlines[i].adex = 0; } } void dmach_tempo(t_dmach *x, t_floatarg new_tempo) { float ratio; int i, j, k; short *stored_patterns = x->stored_patterns; t_pattern *p = x->patterns; int drum_count = x->drum_count; float sr = x->sr; float tempo_factor = x->tempo_factor; if(new_tempo <= 0.0) { error("tempo must be greater than zero, but was %f",new_tempo); return; } ratio = x->tempo / new_tempo; x->clocker *= ratio; x->tempo = new_tempo; tempo_factor = (60.0/new_tempo); for(i = 0; i < MAX_PATTERNS; i++) { if(stored_patterns[i]) { p[i].dsamps = p[i].beats * tempo_factor * sr; for(j = 0; j < drum_count; j++) { if(p[i].drumlines[j].active) { for(k = 0; k < p[i].drumlines[j].attack_count; k++) { p[i].drumlines[j].attacks[k].trigger_point *= ratio; } } } } } x->tempo_factor = tempo_factor; } void dmach_show(t_dmach *x, t_floatarg fn) { int i,j; int pnum = (int) fn; t_pattern *p = x->patterns; t_attack *ptr; int drum_count = x->drum_count; if(pnum < 0 || pnum > MAX_PATTERNS-1) { error("illegal pattern number: %d",pnum); return; } if(! x->stored_patterns[pnum]) { error("%d is not currently stored",pnum); return; } post("showing pattern %d",pnum); /* need to check if pattern is valid */ for(j = 0; j < drum_count; j++) { if(p[pnum].drumlines[j].active) { post("*** drum line for slot %d ***",j); ptr = p[pnum].drumlines[j].attacks; post("there are %d attacks",p[pnum].drumlines[j].attack_count); for(i = 0; i < p[pnum].drumlines[j].attack_count; i++) { post("amp: %f, transp: %f, trigger: %f", ptr->amplitude, ptr->increment, ptr->trigger_point); ptr++; } } } } void dmach_printraw(t_dmach *x, t_floatarg fn) { int i,j; int pnum = (int) fn; t_pattern *p = x->patterns; t_attack *ptr; int drum_count = x->drum_count; float normalized_trigger; float tempo_factor = x->tempo_factor; float sr = x->sr; if(pnum < 0 || pnum > MAX_PATTERNS-1) { error("illegal pattern number: %d",pnum); return; } if(! x->stored_patterns[pnum]) { error("%d is not currently stored",pnum); return; } if(!tempo_factor) { error("tempo factor is zero!"); return; } post("readraw %d %f",pnum, p[pnum].beats); for(j = 0; j < drum_count; j++) { if(p[pnum].drumlines[j].active) { ptr = p[pnum].drumlines[j].attacks; post("%d %d",j, p[pnum].drumlines[j].attack_count); for(i = 0; i < p[pnum].drumlines[j].attack_count; i++) { /* scale attack times to factor out sample rate and tempo */ normalized_trigger = ptr->trigger_point / (tempo_factor * sr); post("%f %f %f", ptr->amplitude, ptr->increment, normalized_trigger); ptr++; } } } } void dmach_listraw(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int i,j; int pnum; t_pattern *p = x->patterns; t_attack *ptr; int drum_count = x->drum_count; float normalized_trigger; float tempo_factor = x->tempo_factor; float sr = x->sr; int ldex = 0; t_atom *listdata = x->listdata; if(argc < 1) { pnum = x->this_pattern; } else { pnum = (int) atom_getfloatarg(0,argc,argv); } if(pnum < 0 || pnum > MAX_PATTERNS-1) { error("illegal pattern number: %d",pnum); return; } if(! x->stored_patterns[pnum]) { error("%d is not currently stored",pnum); return; } if(!tempo_factor) { error("tempo factor is zero!"); return; } /* note: format of MACROS requires that ldex be incremented outside of call. Also note that traditional indexing A[x] cannot be used; instead must use A+x format. */ SETSYMBOL(listdata + ldex, gensym("readraw")); ++ldex; SETFLOAT(listdata + ldex, (float)pnum); ++ldex; SETFLOAT(listdata + ldex, p[pnum].beats); ++ldex; for(j = 0; j < drum_count; j++) { if(p[pnum].drumlines[j].active) { ptr = p[pnum].drumlines[j].attacks; SETFLOAT(listdata + ldex, (float)j); ++ldex; SETFLOAT(listdata + ldex, (float)(p[pnum].drumlines[j].attack_count)); ++ldex; for(i = 0; i < p[pnum].drumlines[j].attack_count; i++) { normalized_trigger = ptr->trigger_point / (tempo_factor * sr); SETFLOAT(listdata + ldex, ptr->amplitude); ++ldex; SETFLOAT(listdata + ldex, ptr->increment); ++ldex; SETFLOAT(listdata + ldex, normalized_trigger); ++ldex; ptr++; } } } outlet_list(x->listraw_outlet,0,ldex,listdata); } void dmach_copypattern(t_dmach *x, t_floatarg pn1, t_floatarg pn2) { int i,j; int pnum_from = (int) pn1; int pnum_to = (int) pn2; t_pattern *p = x->patterns; t_attack *ptr_from, *ptr_to; int drum_count = x->drum_count; if(pnum_from < 0 || pnum_from > MAX_PATTERNS-1) { error("illegal source pattern number: %d",pnum_from); return; } if(pnum_to < 0 || pnum_to > MAX_PATTERNS-1) { error("illegal dest pattern number: %d",pnum_to); return; } if(pnum_from == pnum_to) { error("source and dest patterns are the same"); return; } if(! x->stored_patterns[pnum_from]) { error("%d is not currently stored",pnum_from); return; } dmach_init_pattern(x,pnum_to); // post("readraw %d %f %f",pnum, p[pnum].beats, p[pnum].dsamps); p[pnum_to].beats = p[pnum_from].beats; p[pnum_to].dsamps = p[pnum_from].dsamps; for(j = 0; j < drum_count; j++) { p[pnum_to].drumlines[j].active = p[pnum_from].drumlines[j].active; if(p[pnum_from].drumlines[j].active) { ptr_from = p[pnum_from].drumlines[j].attacks; ptr_to = p[pnum_to].drumlines[j].attacks; p[pnum_to].drumlines[j].attack_count = p[pnum_from].drumlines[j].attack_count; for(i = 0; i < p[pnum_from].drumlines[j].attack_count; i++) { ptr_to->amplitude = ptr_from->amplitude; ptr_to->increment = ptr_from->increment; ptr_to->trigger_point = ptr_from->trigger_point; ptr_from++; ptr_to++; } } } x->stored_patterns[pnum_to] = 1;// assert that a legal pattern is now stored there } void dmach_readraw(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int i; int pnum; int pdex = 0; int slot; t_pattern *p = x->patterns; t_attack *ptr; // int drum_count = x->drum_count; float tempo_factor = x->tempo_factor; float sr = x->sr; short mutein; mutein = x->mute; x->mute = 1; pnum = (int) atom_getfloatarg(pdex++,argc,argv); if(pnum < 0 || pnum > MAX_PATTERNS-1) { error("%s: illegal pattern number: %d",OBJECT_NAME,pnum); return; } if(! x->stored_patterns[pnum]) { x->stored_patterns[pnum] = 1; // means there's something there now dmach_init_pattern(x,pnum); post("readraw: loading pattern %d",pnum); } else { post("readraw: reloading pattern %d",pnum); } p[pnum].beats = atom_getfloatarg(pdex++,argc,argv); // p[pnum].dsamps = atom_getfloatarg(pdex++,argc,argv); p[pnum].dsamps = p[pnum].beats * tempo_factor * sr; // post("dsamps calculated to be %f", p[pnum].dsamps); while(pdex < argc) { slot = (int) atom_getfloatarg(pdex++,argc,argv); p[pnum].drumlines[slot].active = 1; p[pnum].drumlines[slot].attack_count = (int) atom_getfloatarg(pdex++,argc,argv); p[pnum].drumlines[slot].adex = 0; ptr = p[pnum].drumlines[slot].attacks; for(i = 0; i < p[pnum].drumlines[slot].attack_count; i++) { ptr->amplitude = atom_getfloatarg(pdex++,argc,argv); ptr->increment = atom_getfloatarg(pdex++,argc,argv); ptr->trigger_point = (sr * tempo_factor) * atom_getfloatarg(pdex++,argc,argv); ptr++; } } x->this_pattern = x->next_pattern = pnum; x->virgin = 0; x->mute = mutein; } void dmach_slotamps(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int pdex,i; int slot = 0; float beatseg; // float tmpbeats; float subdiv; float beat_samps; float tempo_factor; int attack_count; int local_attacks; float trigger_point; float val; int pnum; t_pattern *p = x->patterns; float tempo = x->tempo; float sr = x->sr; t_attack *tmpatks = x->tmpatks; pdex = 0; pnum = atom_getfloatarg(pdex++,argc,argv); /* post("skipping slotamps for %d",pnum); return;*/ if(pnum < 0 || pnum > MAX_PATTERNS - 1) { error("%s: invalid pattern number: %d",OBJECT_NAME,pnum); return; } if(!x->stored_patterns[pnum]) { error("%s: no pattern found at location : %d",OBJECT_NAME,pnum); return; } slot = (int) atom_getfloatarg(pdex++,argc,argv); if(slot < 0 || slot >= x->drum_count) { post("%s: %d is an illegal slot",OBJECT_NAME,slot); return; } // post("filling slotamps %d for %d",slot, pnum); if(tempo <= 0) { tempo = 60; error("zero tempo found"); } tempo_factor = (60.0/tempo); beatseg = p[pnum].beats; // less general but we're going for ease here subdiv = atom_getfloatarg(pdex++,argc,argv); beat_samps = (beatseg/subdiv) * tempo_factor * sr; trigger_point = 0; attack_count = 0; /* read attack cycle and store any non-zero attacks */ local_attacks = 0; // clean me memset((void *)tmpatks, 0, MAX_ATTACKS * sizeof(t_attack) ); for(i = 0; i < subdiv; i++) { val = atom_getfloatarg(pdex++,argc,argv); if(val) { tmpatks[local_attacks].amplitude = val; // force to integer sample point tmpatks[local_attacks].trigger_point = (int)trigger_point; ++local_attacks; } trigger_point += beat_samps; } /* initialize with increment of 1.0 for each non-zero amplitude attack. */ for(i = 0; i < local_attacks; i++) { if(tmpatks[i].amplitude) { tmpatks[i].increment = 1.0; } else { tmpatks[i].increment = 0.0; } } p[pnum].drumlines[slot].active = 0; memcpy((void *)p[pnum].drumlines[slot].attacks,(void *)tmpatks, MAX_ATTACKS * sizeof(t_attack)); p[pnum].drumlines[slot].attack_count = local_attacks; p[pnum].drumlines[slot].adex = 0; p[pnum].drumlines[slot].active = 1; x->this_pattern = x->next_pattern = pnum; // set pattern to what we're working on } /* more general version */ void dmach_slotampsfull(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int pdex,i; int slot = 0; float beatseg; float tmpbeats; float subdiv; float beat_samps; float tempo_factor; int attack_count; int local_attacks; float trigger_point; float val; int pnum; t_pattern *p = x->patterns; float tempo = x->tempo; float sr = x->sr; if(argc > MAX_ATTACKS + 1) { post("%s: %d is too long an atk message",OBJECT_NAME,argc); return; } pdex = 0; pnum = atom_getfloatarg(pdex++,argc,argv); if(pnum < 0 || pnum > MAX_PATTERNS - 1) { error("%s: invalid pattern number: %d",OBJECT_NAME,pnum); return; } if(!x->stored_patterns[pnum]) { error("%s: no pattern found at location : %d",OBJECT_NAME,pnum); return; } x->this_pattern = x->next_pattern = pnum; // set current pattern to what we're working on slot = (int) atom_getfloatarg(pdex++,argc,argv); p[pnum].drumlines[slot].active = 1; tempo_factor = (60.0/tempo); tmpbeats = p[pnum].beats; trigger_point = 0; attack_count = 0; while(tmpbeats > 0) { local_attacks = 0; beatseg = atom_getfloatarg(pdex++,argc,argv); subdiv = atom_getfloatarg(pdex++,argc,argv); beat_samps = (beatseg/subdiv) * tempo_factor * sr; /* read attack cycle and store any non-zero attacks */ local_attacks = 0; for(i = 0; i < subdiv; i++) { val = atom_getfloatarg(pdex++,argc,argv); if(val) { p[pnum].drumlines[slot].attacks[attack_count + local_attacks].amplitude = val; /* force to integer sample point (couldn't get round() to work) */ p[pnum].drumlines[slot].attacks[attack_count + local_attacks].trigger_point = (int)trigger_point; ++local_attacks; } trigger_point += beat_samps; } for(i = 0; i < local_attacks; i++) { p[pnum].drumlines[slot].attacks[i + attack_count].increment = 1.0; } tmpbeats -= beatseg; attack_count += local_attacks; } p[pnum].drumlines[slot].attack_count = attack_count; } void dmach_slotincrs(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int pdex,i; int slot = 0; int local_attacks; int pnum; t_pattern *p = x->patterns; if(argc > MAX_ATTACKS + 1) { post("%s: %d is too long a slotincrs message",OBJECT_NAME,argc); return; } pdex = 0; pnum = (int) atom_getfloatarg(pdex++,argc,argv); slot = (int) atom_getfloatarg(pdex++,argc,argv); if(slot < 0 || slot >= x->drum_count) { post("%s: %d is an illegal slot",OBJECT_NAME,slot); return; } local_attacks = p[pnum].drumlines[slot].attack_count; if(argc != local_attacks + 2) { // post("rejected slotincrs with %d local atks, argc = %d",local_attacks, argc - 2); return; } // post("%d local atks, argc = %d",local_attacks, argc); if(pnum < 0 || pnum >= MAX_PATTERNS) { error("%s: slotincrs sent invalid pattern number: %d",OBJECT_NAME,pnum); return; } if(!x->stored_patterns[pnum]) { error("%s: slotincrs: no pattern found at location : %d",OBJECT_NAME,pnum); return; } // post("filling slotincr for slot %d pnum %d",slot, pnum); for(i = 0; i < local_attacks; i++) { p[pnum].drumlines[slot].attacks[i].increment = atom_getfloatarg(pdex++,argc,argv); } x->this_pattern = x->next_pattern = pnum; // set current pattern to what we're working on // x->mute = mutein; } void dmach_store(t_dmach *x, t_symbol *s, int argc, t_atom *argv) { int pdex,i; int slot = 0; float beatseg; float tmpbeats; float subdiv; float beat_samps; float tempo_factor = x->tempo_factor; int attack_count; int local_attacks; float trigger_point; float val; int pnum; t_pattern *p = x->patterns; float tempo = x->tempo; float sr = x->sr; pnum = atom_getfloatarg(0,argc,argv); if(pnum < 0 || pnum > MAX_PATTERNS - 1) { error("invalid pattern number: %d",pnum); return; } // post("%d arguments to \"store\" at pattern %d",argc,pnum); dmach_init_pattern(x,pnum); p[pnum].beats = atom_getfloatarg(1,argc,argv); if(p[pnum].beats <= 0) { post("illegal beats at pnum %d: %f",pnum,p[pnum].beats); p[pnum].beats = 4; } if(tempo <= 0) { error("zero tempo in store msg"); tempo = 60; } tempo_factor = (60.0/tempo); p[pnum].dsamps = p[pnum].beats * tempo_factor * sr; pdex = 2; // post("%f beats %f samps in this pattern",p[pnum].beats,p[pnum].dsamps ); while(pdex < argc) { slot = atom_getfloatarg(pdex++,argc,argv); p[pnum].drumlines[slot].active = 1; tmpbeats = p[pnum].beats; trigger_point = 0; attack_count = 0; while(tmpbeats > 0) { local_attacks = 0; beatseg = atom_getfloatarg(pdex++,argc,argv); subdiv = atom_getfloatarg(pdex++,argc,argv); beat_samps = (beatseg/subdiv) * tempo_factor * sr; /* read attack cycle and store any non-zero attacks */ for(i = 0; i < subdiv; i++) { val = atom_getfloatarg(pdex++,argc,argv); if(val) { p[pnum].drumlines[slot].attacks[attack_count + local_attacks].amplitude = val; /* force to integer sample point (couldn't get round() to work) */ p[pnum].drumlines[slot].attacks[attack_count + local_attacks].trigger_point = (int)trigger_point; ++local_attacks; } trigger_point += beat_samps; } /* we now know number of attacks and read that many transpose factors */ for(i = 0; i < local_attacks; i++) { p[pnum].drumlines[slot].attacks[i + attack_count].increment = atom_getfloatarg(pdex++,argc,argv); } tmpbeats -= beatseg; attack_count += local_attacks; } p[pnum].drumlines[slot].attack_count = attack_count; // post("%d attacks in slot %d for pattern %d",attack_count, slot, pnum); } // new - set internal pointer to start of array p[pnum].drumlines[slot].adex = 0; // set current pattern to this (to avoid crash if pnum 0 is uninitialized) x->this_pattern = x->next_pattern = pnum; x->virgin = 0; // now at least one pattern is stored x->stored_patterns[pnum] = 1; // means there's something there now x->tempo_factor = tempo_factor;//restore this value // post("pattern stored at %d with %f beats",pnum,p[pnum].beats); } void dmach_init_pattern(t_dmach *x, int pnum) { int i; int drum_count = x->drum_count; t_pattern *p = x->patterns; if(pnum < 0 || pnum >= MAX_PATTERNS) { error("invalid pattern number: %d",pnum); return; } if( x->stored_patterns[pnum] ) { // post("replacing pattern stored at %d",pnum); } if(p[pnum].drumlines == NULL) { // post("initializing drumline memory at location %d",pnum); p[pnum].drumlines = (t_drumline *)malloc(drum_count * sizeof(t_drumline)); } for(i = 0; i < drum_count; i++) { p[pnum].drumlines[i].attacks = (t_attack *)calloc(MAX_ATTACKS, sizeof(t_attack)); p[pnum].drumlines[i].adex = 0; p[pnum].drumlines[i].active = 0; p[pnum].drumlines[i].attack_count = 0; } } void dmach_dsp_free( t_dmach *x ) { /* need some freeing action here! */ free(x->patterns); free(x->stored_patterns); free(x->current_increment); free(x->gtranspose); free(x->gains); free(x->sequence); free(x->listdata); free(x->connected); free(x->tmpatks); free(x->muted); } void dmach_mute(t_dmach *x, t_floatarg toggle) { x->mute = (short)toggle; } void dmach_instant_recall(t_dmach *x, t_floatarg toggle) { x->instant_recall = (short)toggle; } void dmach_clickincr(t_dmach *x, t_floatarg toggle) { x->clickincr = (short)toggle; } void *dmach_new(t_symbol *s, int argc, t_atom *argv) { int i; t_dmach *x; x = (t_dmach *)pd_new(dmach_class); if(argc >= 1) x->tempo = atom_getfloatarg(0,argc,argv); else x->tempo = 120; if(argc >= 2) x->drum_count = atom_getfloatarg(1,argc,argv); else x->drum_count = 8; x->outlet_count = x->drum_count * 2 + 1; // one extra for pattern start click for(i = 0; i < x->outlet_count; i++) { outlet_new(&x->x_obj, gensym("signal")); } x->listraw_outlet = outlet_new(&x->x_obj, gensym("list")); x->patterns = (t_pattern *) malloc(MAX_PATTERNS * sizeof(t_pattern)); x->stored_patterns = (short *) malloc(MAX_PATTERNS * sizeof(short)); x->current_increment = (float *) malloc(x->drum_count * sizeof(float)); // for sample + hold of increment x->gtranspose = (float *) malloc(x->drum_count * sizeof(float)); x->gains = (float *) malloc(x->drum_count * sizeof(float)); x->sequence = (int *) malloc(1024 * sizeof(int)); x->listdata = (t_atom *) malloc(1024 * sizeof(t_atom)); x->connected = (short *) malloc(1024 * sizeof(short)); x->tmpatks = (t_attack *)calloc(MAX_ATTACKS, sizeof(t_attack)); x->muted = (short *)calloc(x->drum_count, sizeof(short)); // by default mute is off on each slot x->seqptr = 0; x->sequence_length = 0; x->playsequence = 0; x->loopsequence = 0; x->zeroalias = -1.0; x->clickincr = 0; x->instant_recall = 0; if(x->tempo <= 0 || x->tempo > 6666) x->tempo = 60.0; // post("initial tempo is %f",x->tempo); for(i = 0; i < MAX_PATTERNS; i++) { x->patterns[i].drumlines = NULL; x->stored_patterns[i] = 0; } x->this_pattern = x->next_pattern = 0; x->mute = 0; x->clocker = 0; x->sr = sys_getsr(); x->tempo_factor = 60.0 / x->tempo ; for(i = 0; i < x->drum_count; i++) { x->gains[i] = 1.0; x->gtranspose[i] = 1.0; x->current_increment[i] = 1.0; } // safety - init memory for all drum patterns for(i = 0; i < MAX_PATTERNS; i++) { dmach_init_pattern(x,i); } x->virgin = 1; return (x); } t_int *dmach_perform(t_int *w) { int i,j; t_float *trig_outlet, *incr_outlet; t_dmach *x = (t_dmach *) w[1]; int outlet_count = x->outlet_count; // t_float *in_sync = (t_float *) w[2]; // input for sync trigger (not implemented yet) t_float *sync = (t_float *) w[outlet_count + 2]; int n = (int) w[outlet_count + 3]; int this_pattern = x->this_pattern; int next_pattern = x->next_pattern; t_pattern *p = x->patterns; float *current_increment = x->current_increment; float clocker = x->clocker; float dsamps = p[this_pattern].dsamps; int drum_count = x->drum_count; int adex; /* sequence stuff */ int *sequence = x->sequence; short playsequence = x->playsequence; short loopsequence = x->loopsequence; short clickincr = x->clickincr; int seqptr = x->seqptr; int sequence_length = x->sequence_length; short *connected = x->connected; short *muted = x->muted; float *gtranspose = x->gtranspose; float *gains = x->gains; /* clean pnum click outlet */ memset((void *)sync, 0, n * sizeof(float)); if( x->mute || x->virgin ) { for(i = 0; i < drum_count; i++) { if(connected[i * 2 + 1]) { // post("cleaning outlet pair %d", i); trig_outlet = (t_float *) w[i * 2 + 3]; memset((void *)trig_outlet, 0, n * sizeof(float)); } } return w + (outlet_count + 4); } /* pre-clean all connected trigger vectors */ for(i = 0; i < drum_count; i++) { if(connected[i * 2 + 1]) { trig_outlet = (t_float *) w[i * 2 + 3]; memset((void *)trig_outlet, 0, n * sizeof(float)); } } for(j = 0; j < n; j++) { if(clocker >= dsamps){ // ready for next pattern now clocker -= dsamps; /* this is the pattern sequencer */ if(playsequence) { if (seqptr >= sequence_length) { if(loopsequence) { seqptr = 0; } else { /* this is fine, the playthrough has concluded and we now mute external */ x->mute = 1; goto escape; } } this_pattern = sequence[seqptr++]; } /* we do this if we're not pattern sequencing: */ else if(next_pattern != this_pattern) { this_pattern = next_pattern; } for(i = 0; i < drum_count; i++){ /* reset pointers */ p[this_pattern].drumlines[i].adex = 0; } /* send current bar number if in sequence. Note kludge for if bar is 0. We cannot send a 0 click so we alias it to something else. */ if(playsequence) { if(this_pattern) { sync[j] = this_pattern; } else { sync[j] = x->zeroalias; } } else{ sync[j] = 1; /* send a sync click */ } } else { sync[j] = 0; } for(i = 0; i < drum_count; i++) { // float locamp; if(p[this_pattern].drumlines[i].active && ! muted[i]) { trig_outlet = (t_float *) w[i * 2 + 3]; incr_outlet = (t_float *) w[i * 2 + 4]; adex = p[this_pattern].drumlines[i].adex; // overflow danger ??? if((int)clocker == (int)p[this_pattern].drumlines[i].attacks[adex].trigger_point) { current_increment[i] = p[this_pattern].drumlines[i].attacks[adex].increment * gtranspose[i]; /* put sync click into sample j of the output vector */ trig_outlet[j] = p[this_pattern].drumlines[i].attacks[adex].amplitude * gains[i]; ++adex; p[this_pattern].drumlines[i].adex = adex; incr_outlet[j] = current_increment[i]; /* post("t: sample %d, slot %d, amp: %f, incr: %f", (int)clocker, i, locamp, current_increment[i]); */ } else { trig_outlet[j] = 0; // not sure we need these assignments ?? if(clickincr) { incr_outlet[j] = 0; } else { incr_outlet[j] = current_increment[i]; // samp + hold the increment to outlet } } } } ++clocker; } escape: x->clocker = clocker; x->this_pattern = this_pattern; x->seqptr = seqptr; return w + (outlet_count + 4); } void dmach_dsp(t_dmach *x, t_signal **sp) { long i; t_int **sigvec; int pointer_count; if(x->virgin) { post("%s: no patterns are stored",OBJECT_NAME); // return; } if(x->sr != sp[0]->s_sr) { x->sr = sp[0]->s_sr; /* still need to adjust every stored pattern dsamps variable */ } pointer_count = x->outlet_count + 3; // all outlets, 1 inlet, object and s_n // post("pointer count %d", pointer_count); // copy vector to be safe for(i = 0; i < pointer_count - 2; i++) { x->connected[i] = 1; } sigvec = (t_int **) calloc(pointer_count, sizeof(t_int *)); for(i = 0; i < pointer_count; i++) { sigvec[i] = (t_int *) calloc(sizeof(t_int),1); } sigvec[0] = (t_int *)x; // first pointer is to the object sigvec[pointer_count - 1] = (t_int *)sp[0]->s_n; // last pointer is to vector size (N) for(i = 1; i < pointer_count - 1; i++){ // now attach the inlet and all outlets sigvec[i] = (t_int *)sp[i-1]->s_vec; } dsp_addv(dmach_perform, pointer_count, (t_int *) sigvec); free(sigvec); }
29.06449
107
0.639844
[ "object", "vector" ]
327498a9e1e9a7fb46f1ba04f6a8e9dd115e2fae
4,715
h
C
source/visual/cShadow.h
MausGames/project-one
157c93e8b4a926528ce5e77efacfcd950ea361f9
[ "Zlib" ]
3
2015-06-30T00:10:29.000Z
2021-03-09T21:05:11.000Z
source/visual/cShadow.h
MausGames/project-one
157c93e8b4a926528ce5e77efacfcd950ea361f9
[ "Zlib" ]
null
null
null
source/visual/cShadow.h
MausGames/project-one
157c93e8b4a926528ce5e77efacfcd950ea361f9
[ "Zlib" ]
null
null
null
/////////////////////////////////////////////////////// //*-------------------------------------------------*// //| Part of Project One (https://www.maus-games.at) |// //*-------------------------------------------------*// //| Released under the zlib License |// //| More information available in the readme file |// //*-------------------------------------------------*// /////////////////////////////////////////////////////// #pragma once #ifndef _P1_GUARD_SHADOW_H_ #define _P1_GUARD_SHADOW_H_ // TODO 3: change projection to perfectly fit the screen // TODO 3: check if reusing the center of the shadow-map is feasible // TODO 5: poisson sampling // TODO 3: make sure no textures are changed when rendering shadow or outline // TODO 3: check if projected texture-sampling-offsets in shader are correct (and check if shadow of stings on stings in snow-background can be fixed) // NOTE: shadow map binds local objects (per frame buffer) and global objects (on all frame buffers, for transitions) // NOTE: all global objects are on the foreground // **************************************************************** // shadow definitions #define SHADOW_VIEW_DISTANCE (90.0f) // distance from origin to light source #define SHADOW_CLIP_NEAR (1.0f) // near clipping plane #define SHADOW_CLIP_FAR (145.0f) // far clipping plane #define SHADOW_RANGE_X (56.0f) // view range of the shadow map (smaller = sharper, but more artifacts) #define SHADOW_RANGE_Y (62.0f) // same for Y #define SHADOW_HEIGHT_FACTOR (2.5f) // height correction factor (to reduce shadow length) #define SHADOW_TEST_FACTOR (0.2f) // #define SHADOW_RES_LOW (1.0f) // #define SHADOW_RES_HIGH (1.5f) // #define SHADOW_HANDLE_OUTDOOR (0u) // outdoor-surface handle #define SHADOW_HANDLE_OUTDOOR_GLOW (1u) // #define SHADOW_HANDLE_OUTDOOR_LIGHT (2u) // #define SHADOW_HANDLE_OUTDOOR_LIGHT_GLOW (3u) // #define SHADOW_HANDLE_OBJECT (4u) // single object handle #define SHADOW_HANDLE_OBJECT_INST (5u) // instanced object handle #define SHADOW_HANDLES (6u) // number of handles for shader-programs for shadow-receiving objects // **************************************************************** // shadow map class class cShadow final : public cBindContainerIn, public coreResourceRelation { private: coreFrameBuffer m_FrameBuffer; // shadow map frame buffer coreUint8 m_iLevel; // current configuration level static cBindContainer s_GlobalContainer; // global shadow-casting objects (in all frame buffers) static coreProgramPtr s_pProgramSingle; // shader-program for single shadow-casting objects static coreProgramPtr s_pProgramInstanced; // shader-program for instanced shadow-casting objects static coreProgramPtr s_apHandle[SHADOW_HANDLES]; // handles for shader-programs for shadow-receiving objects static coreMatrix4 s_amDrawShadowMatrix[2]; // matrices used for view transformation of depth values (0 = background, 1 = foreground) static coreMatrix4 s_mReadShadowMatrix; // matrix with additional coordinate adjustment public: cShadow()noexcept; DISABLE_COPY(cShadow) // update the shadow map void Update(); // adjust to current configuration void Reconfigure(); // access frame buffer inline coreFrameBuffer* GetFrameBuffer() {return &m_FrameBuffer;} // control the shadow map class static void GlobalInit(); static void GlobalExit(); static void GlobalUpdate(); // recompile shader-programs for shadow-receiving objects static void Recompile(); // render shadow-casting objects static void RenderSingle (const coreMatrix4& mTransform, const coreList<coreBatchList*>& apList, const coreList<coreObject3D*>& apObject); static void RenderSingle (const coreMatrix4& mTransform, const coreList<coreBatchList*>& apList); static void RenderInstanced(const coreMatrix4& mTransform, const coreList<coreBatchList*>& apList); // enable shader-program and apply read shadow matrix static void EnableShadowRead(const coreUintW iHandleIndex); // access global bind container static inline cBindContainer* GetGlobalContainer() {return &s_GlobalContainer;} private: // reset with the resource manager void __Reset(const coreResourceReset eInit)final; // send transformation matrix to shader-program static void __SendTransform(const coreProgramPtr& pProgram, const coreMatrix4& mTransform); }; #endif // _P1_GUARD_SHADOW_H_
44.904762
150
0.651962
[ "render", "object" ]
327ab393d6fd3e58cea3cd4a9d5bf69a978d1da6
5,437
h
C
src/drive/inc/MemoryRegion.h
chisuhua/codrive
9b4cd8649004d1bee1fe90a49a41e8f44f2bb5be
[ "MIT" ]
null
null
null
src/drive/inc/MemoryRegion.h
chisuhua/codrive
9b4cd8649004d1bee1fe90a49a41e8f44f2bb5be
[ "MIT" ]
null
null
null
src/drive/inc/MemoryRegion.h
chisuhua/codrive
9b4cd8649004d1bee1fe90a49a41e8f44f2bb5be
[ "MIT" ]
null
null
null
#pragma once // #include "inc/hsakmt.h" // #include "inc/Device.h" #include "inc/Runtime.h" #include "core/IMemoryRegion.h" // #include "inc/platform.h" #include "util/locks.h" #include "simple_heap.h" #include "inc/hsakmttypes.h" #include "inc/drive_api.h" #include "inc/Platform.h" #include "core/IAgent.h" // #include "inc/pps_ext.h" /* namespace core { class Device; }*/ // namespace hcs { class MemoryRegion : public core::IMemoryRegion { public: #if 0 /// @brief Convert this object into region_t. static region_t Handle(MemoryRegion* region) { const region_t region_handle = { static_cast<uint64_t>(reinterpret_cast<uintptr_t>(region)) }; return region_handle; } static const region_t Handle(const MemoryRegion* region) { const region_t region_handle = { static_cast<uint64_t>(reinterpret_cast<uintptr_t>(region)) }; return region_handle; } /// @brief Convert region_t into hcs::MemoryRegion *. static MemoryRegion* Object(region_t region) { return reinterpret_cast<MemoryRegion*>(region.handle); } #endif /// @brief Allocate agent accessible memory (system / local memory). static void* AllocateKfdMemory(const HsaMemFlags& flag, uint32_t node_id, size_t size); /// @brief Free agent accessible memory (system / local memory). static void FreeKfdMemory(void* ptr, size_t size); static bool RegisterMemory(void* ptr, size_t size, const HsaMemFlags& MemFlags); // static bool RegisterMemory(void* ptr, size_t size, size_t num_nodes, // const uint32_t* nodes); static void DeregisterMemory(void* ptr); /// @brief Pin memory. static bool MakeKfdMemoryResident(size_t num_node, const uint32_t* nodes, const void* ptr, size_t size, uint64_t* alternate_va, HsaMemMapFlags map_flag); /// @brief Unpin memory. static void MakeKfdMemoryUnresident(const void* ptr); MemoryRegion(bool fine_grain, bool full_profile, core::IAgent* owner, const HsaMemoryProperties& mem_props); ~MemoryRegion(); status_t Allocate(size_t& size, AllocateFlags alloc_flags, void** address) const; status_t Free(void* address, size_t size) const; status_t IPCFragmentExport(void* address) const; status_t GetInfo(region_info_t attribute, void* value) const; status_t GetPoolInfo(hsa_amd_memory_pool_info_t attribute, void* value) const; status_t GetAgentPoolInfo(const core::IAgent& agent, hsa_amd_agent_memory_pool_info_t attribute, void* value) const; status_t AllowAccess(uint32_t num_agents, core::IAgent** agents, const void* ptr, size_t size) const; status_t CanMigrate(const MemoryRegion& dst, bool& result) const; status_t Migrate(uint32_t flag, const void* ptr) const; status_t Lock(uint32_t num_agents, core::IAgent** agents, void* host_ptr, size_t size, void** agent_ptr) const; status_t Unlock(void* host_ptr) const; uint64_t GetBaseAddress() const { return mem_props_.VirtualBaseAddress; } uint64_t GetPhysicalSize() const { return mem_props_.SizeInBytes; } uint64_t GetVirtualSize() const { return virtual_size_; } status_t AssignAgent(void* ptr, size_t size, const core::IAgent& agent, hsa_access_permission_t access) const; bool IsLocalMemory() const { return ((mem_props_.HeapType == HSA_HEAPTYPE_FRAME_BUFFER_PRIVATE) || (mem_props_.HeapType == HSA_HEAPTYPE_FRAME_BUFFER_PUBLIC)); } bool IsPublic() const { return (mem_props_.HeapType == HSA_HEAPTYPE_FRAME_BUFFER_PUBLIC); } bool IsSystem() const { return mem_props_.HeapType == HSA_HEAPTYPE_SYSTEM; } bool IsLDS() const { return mem_props_.HeapType == HSA_HEAPTYPE_GPU_LDS; } bool IsGDS() const { return mem_props_.HeapType == HSA_HEAPTYPE_GPU_GDS; } bool IsScratch() const { return mem_props_.HeapType == HSA_HEAPTYPE_GPU_SCRATCH; } uint32_t BusWidth() const { return static_cast<uint32_t>(mem_props_.Width); } uint32_t MaxMemCloc() const { return static_cast<uint32_t>(mem_props_.MemoryClockMax); } private: const HsaMemoryProperties mem_props_; HsaMemFlags mem_flag_; HsaMemMapFlags map_flag_; size_t max_single_alloc_size_; // Used to collect total system memory static size_t max_sysmem_alloc_size_; uint64_t virtual_size_; mutable KernelMutex access_lock_; static const size_t kPageSize_ = 4096; // Determine access type allowed to requesting device hsa_amd_memory_pool_access_t GetAccessInfo(const core::IAgent& device, const LinkInfo& link_info) const; class BlockAllocator { private: MemoryRegion& region_; static const size_t block_size_ = 2 * 1024 * 1024; // 2MB blocks. public: explicit BlockAllocator(MemoryRegion& region) : region_(region) { } void* alloc(size_t request_size, size_t& allocated_size) const; void free(void* ptr, size_t length) const { region_.Free(ptr, length); } size_t block_size() const { return block_size_; } }; mutable SimpleHeap<BlockAllocator> fragment_allocator_; }; // } // namespace
28.465969
137
0.676108
[ "object" ]
3280f4d0ed6739a19274e5b68a822cf2e147eef1
1,012
h
C
Rocket/Engine/Parser/ImageParser.h
rocketman123456/RocketEngine
ede1670d70c4689a5dc8543ca5351e8f23fcb840
[ "Apache-2.0" ]
null
null
null
Rocket/Engine/Parser/ImageParser.h
rocketman123456/RocketEngine
ede1670d70c4689a5dc8543ca5351e8f23fcb840
[ "Apache-2.0" ]
null
null
null
Rocket/Engine/Parser/ImageParser.h
rocketman123456/RocketEngine
ede1670d70c4689a5dc8543ca5351e8f23fcb840
[ "Apache-2.0" ]
null
null
null
#pragma once #include "Memory/MemoryDefine.h" #include "Core/Declare.h" #include <Eigen/Eigen> #include <string> #include <string_view> #include <vector> #include <utility> namespace Rocket { class ImageParser { public: ImageParser() = default; ImageParser(const std::string& full) : full_path_(full) {} ImageParser(const std::string& path, const std::string& name) : path_(path), name_(name), full_path_(path + name) {} ~ImageParser() = default; inline void Reset(const std::string& full) { full_path_ = full; } inline void Reset(const std::string& path, const std::string& name) { path_ = path; name_ = name; full_path_ = path + name; } std::pair<int32_t, int32_t> Parse(); std::pair<int32_t, int32_t> Parse(std::vector<Eigen::Vector4f>& data); std::pair<int32_t, int32_t> Parse(std::vector<Eigen::Vector3f>& data); private: std::string path_; std::string name_; std::string full_path_; }; }
30.666667
133
0.639328
[ "vector" ]
3289900af6e337462208863fe17c102b537afe75
2,123
h
C
src/behaviorPlannerCPlusPlus/vehicle.h
yinzixuan126/my_udacity
cada1bc047cd21282b008a0eb85a1df52fd94034
[ "MIT" ]
1
2019-11-05T02:23:47.000Z
2019-11-05T02:23:47.000Z
src/behaviorPlannerCPlusPlus/vehicle.h
yinzixuan126/my_udacity
cada1bc047cd21282b008a0eb85a1df52fd94034
[ "MIT" ]
null
null
null
src/behaviorPlannerCPlusPlus/vehicle.h
yinzixuan126/my_udacity
cada1bc047cd21282b008a0eb85a1df52fd94034
[ "MIT" ]
1
2019-11-05T02:23:51.000Z
2019-11-05T02:23:51.000Z
// // Created by Tianzi Harrison on 8/5/17. // #ifndef BEHAVIORPLANNERCPLUSPLUS_VEHICLE_H #define BEHAVIORPLANNERCPLUSPLUS_VEHICLE_H #include <iostream> #include <random> #include <sstream> #include <fstream> #include <math.h> #include <vector> #include <map> #include <string> #include <iterator> using namespace std; class Vehicle { public: struct collider { bool collision; // is there a collision? int time; // time collision happens }; int L = 1; int preferred_buffer = 6; // impacts "keep lane" behavior. int lane; int s; int v; int a; int target_speed; int lanes_available; int max_acceleration; int goal_lane; int goal_s; string state; /** * Constructor */ Vehicle(int lane, int s, int v, int a); /** * Destructor */ virtual ~Vehicle(); vector<string> find_possible_next_states(string current_state); void update_state(map<int, vector<vector<int> > > predictions); void configure(vector<int> road_data); string display(); void increment(int dt); vector<int> state_at(int t); bool collides_with(Vehicle other, int at_time); collider will_collide_with(Vehicle other, int timesteps); void realize_state(map<int, vector<vector<int> > > predictions); void realize_constant_speed(); int _max_accel_for_lane(map<int, vector<vector<int> > > predictions, int lane, int s); void realize_keep_lane(map<int, vector<vector<int> > > predictions); void realize_lane_change(map<int, vector<vector<int> > > predictions, string direction); void realize_prep_lane_change(map<int, vector<vector<int> > > predictions, string direction); vector<vector<int> > generate_predictions(int horizon); double cost_for_action(map<int, vector<vector<int> > > predictions, string action, int current_lane, int target_lane, int available_lanes, int target_speed); }; #endif //BEHAVIORPLANNERCPLUSPLUS_VEHICLE_H
20.219048
97
0.645313
[ "vector" ]
328a8b7405800bbb4ae02c944a8c489ccd9afaee
5,395
h
C
Kernel/VM/AnonymousVMObject.h
holdengreen/serenity
0fccada6e9f714f76b2fbe0d189dcf4f26de38d4
[ "BSD-2-Clause" ]
1
2021-10-05T14:07:23.000Z
2021-10-05T14:07:23.000Z
Kernel/VM/AnonymousVMObject.h
holdengreen/serenity
0fccada6e9f714f76b2fbe0d189dcf4f26de38d4
[ "BSD-2-Clause" ]
null
null
null
Kernel/VM/AnonymousVMObject.h
holdengreen/serenity
0fccada6e9f714f76b2fbe0d189dcf4f26de38d4
[ "BSD-2-Clause" ]
null
null
null
/* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include <Kernel/PhysicalAddress.h> #include <Kernel/VM/AllocationStrategy.h> #include <Kernel/VM/PageFaultResponse.h> #include <Kernel/VM/PurgeablePageRanges.h> #include <Kernel/VM/VMObject.h> namespace Kernel { class AnonymousVMObject : public VMObject { friend class PurgeablePageRanges; public: virtual ~AnonymousVMObject() override; static RefPtr<AnonymousVMObject> create_with_size(size_t, AllocationStrategy); static RefPtr<AnonymousVMObject> create_for_physical_range(PhysicalAddress paddr, size_t size); static NonnullRefPtr<AnonymousVMObject> create_with_physical_page(PhysicalPage& page); static NonnullRefPtr<AnonymousVMObject> create_with_physical_pages(NonnullRefPtrVector<PhysicalPage>); virtual RefPtr<VMObject> clone() override; RefPtr<PhysicalPage> allocate_committed_page(size_t); PageFaultResponse handle_cow_fault(size_t, VirtualAddress); size_t cow_pages() const; bool should_cow(size_t page_index, bool) const; void set_should_cow(size_t page_index, bool); void register_purgeable_page_ranges(PurgeablePageRanges&); void unregister_purgeable_page_ranges(PurgeablePageRanges&); int purge(); int purge_with_interrupts_disabled(Badge<MemoryManager>); bool is_any_volatile() const; template<typename F> IterationDecision for_each_volatile_range(F f) const { VERIFY(m_lock.is_locked()); // This is a little ugly. Basically, we're trying to find the // volatile ranges that all share, because those are the only // pages we can actually purge for (auto* purgeable_range : m_purgeable_ranges) { ScopedSpinLock purgeable_lock(purgeable_range->m_volatile_ranges_lock); for (auto& r1 : purgeable_range->volatile_ranges().ranges()) { VolatilePageRange range(r1); for (auto* purgeable_range2 : m_purgeable_ranges) { if (purgeable_range2 == purgeable_range) continue; ScopedSpinLock purgeable2_lock(purgeable_range2->m_volatile_ranges_lock); if (purgeable_range2->is_empty()) { // If just one doesn't allow any purging, we can // immediately bail return IterationDecision::Continue; } for (const auto& r2 : purgeable_range2->volatile_ranges().ranges()) { range = range.intersected(r2); if (range.is_empty()) break; } if (range.is_empty()) break; } if (range.is_empty()) continue; IterationDecision decision = f(range); if (decision != IterationDecision::Continue) return decision; } } return IterationDecision::Continue; } template<typename F> IterationDecision for_each_nonvolatile_range(F f) const { size_t base = 0; for_each_volatile_range([&](const VolatilePageRange& volatile_range) { if (volatile_range.base == base) return IterationDecision::Continue; IterationDecision decision = f({ base, volatile_range.base - base }); if (decision != IterationDecision::Continue) return decision; base = volatile_range.base + volatile_range.count; return IterationDecision::Continue; }); if (base < page_count()) return f({ base, page_count() - base }); return IterationDecision::Continue; } private: explicit AnonymousVMObject(size_t, AllocationStrategy); explicit AnonymousVMObject(PhysicalAddress, size_t); explicit AnonymousVMObject(PhysicalPage&); explicit AnonymousVMObject(NonnullRefPtrVector<PhysicalPage>); explicit AnonymousVMObject(const AnonymousVMObject&); virtual const char* class_name() const override { return "AnonymousVMObject"; } int purge_impl(); void update_volatile_cache(); void set_was_purged(const VolatilePageRange&); size_t remove_lazy_commit_pages(const VolatilePageRange&); void range_made_volatile(const VolatilePageRange&); void range_made_nonvolatile(const VolatilePageRange&); size_t count_needed_commit_pages_for_nonvolatile_range(const VolatilePageRange&); size_t mark_committed_pages_for_nonvolatile_range(const VolatilePageRange&, size_t); bool is_nonvolatile(size_t page_index); AnonymousVMObject& operator=(const AnonymousVMObject&) = delete; AnonymousVMObject& operator=(AnonymousVMObject&&) = delete; AnonymousVMObject(AnonymousVMObject&&) = delete; virtual bool is_anonymous() const override { return true; } Bitmap& ensure_cow_map(); void ensure_or_reset_cow_map(); VolatilePageRanges m_volatile_ranges_cache; bool m_volatile_ranges_cache_dirty { true }; Vector<PurgeablePageRanges*> m_purgeable_ranges; size_t m_unused_committed_pages { 0 }; Bitmap m_cow_map; // We share a pool of committed cow-pages with clones RefPtr<CommittedCowPages> m_shared_committed_cow_pages; }; }
38.81295
106
0.67266
[ "vector" ]
328eae8e81d3ba9895f1224b9016f7c1e59db1f4
5,457
h
C
serialisation/include/serialisation/internal/memory/memoryPool.h
Zefiros-Software/SerLib2
63ea5ddab58313b29a1cbb95166f69ec179cf991
[ "MIT" ]
null
null
null
serialisation/include/serialisation/internal/memory/memoryPool.h
Zefiros-Software/SerLib2
63ea5ddab58313b29a1cbb95166f69ec179cf991
[ "MIT" ]
null
null
null
serialisation/include/serialisation/internal/memory/memoryPool.h
Zefiros-Software/SerLib2
63ea5ddab58313b29a1cbb95166f69ec179cf991
[ "MIT" ]
null
null
null
/** * @cond ___LICENSE___ * * Copyright (c) 2016-2018 Zefiros Software. * * 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. * * @endcond */ #pragma once #ifndef __SERIALISATION_UNSYNCHRONISEDMEMORYPOOLINSTANTIATOR_H__ #define __SERIALISATION_UNSYNCHRONISEDMEMORYPOOLINSTANTIATOR_H__ #include <assert.h> #include <stdlib.h> #include <vector> /// @addtogroup Instantiators /// @{ /** * An instantiator that stores the objects in contiguous memory for better caching and also * functions as a memory pool. * * This is the unsynchronised version of @see MemoryPoolInstantiator. * * @tparam tT The instantiated object type. * @tparam tBase The base type the instantiated type should derive from. * * @sa AbstractMemoryPooledInstantiator<tBase> * @sa NonAssignable */ template< typename tT, typename tBase = tT > class UnsychronisedMemoryPoolInstantiator { public: /** * Constructs the instantiator and fills the first block. * * @param blocksize (optional) the amount of objects per block. * @param maxBlocks (optional) the maximum amount of blocks. */ explicit UnsychronisedMemoryPoolInstantiator(const size_t blocksize = 1000, const size_t maxBlocks = 1000) noexcept : mBlockSize(blocksize), mMaxBlocks(maxBlocks) { // static_assert( Util::IsChildParent< tT, tBase >::value, // "UnsychronisedMemoryPoolInstantiator::UnsychronisedMemoryPoolInstantiator():\n\tThe child type should derive from the base type." ); AddMemoryBlockArray(); } /** * Frees all the memory used by the memory pool. * * @warning All objects should be returned to the pool * to avoid memory leaks. */ ~UnsychronisedMemoryPoolInstantiator() { assert(mBlockSize == 0 || mAvailablePtrs.size() / (mBlockSize * mMemoryBlocks.size()) == 1); mAvailablePtrs.clear(); for (auto it = mMemoryBlocks.begin(), end = mMemoryBlocks.end(); it != end; ++it) { delete[] *it; } } /// @name Object creation /// @{ /** * Creates the instance. When there are still objects available, retrieve them * from the pool. Otherwise we either add a new memory block of pointers or * we just create an object. * * @return The new instance. */ tBase *Create() { if (!mAvailablePtrs.empty()) { return GetObject(); } else if (mMemoryBlocks.size() <= mMaxBlocks) { AddMemoryBlockArray(); return GetObject(); } else { return new tT; } } /// @} /// @name Object deletion /// @{ /** * Destroys the object described by object. * * @param [in,out] object If non-null, the object. */ void Destroy(tBase *object) { for (auto it = mMemoryBlocks.begin(), end = mMemoryBlocks.end(); it != end; ++it) { // Check whether the pointer falls in this memory block if (object >= *it && *it + mBlockSize > object) { mAvailablePtrs.push_back(static_cast< tT * >(object)); return; } } delete object; } /// @} private: /// @name Pool state /// @{ /** * Adds a full block of memory to the available object pointers. */ void AddMemoryBlockArray() { tT *memBlock = new tT[ mBlockSize ]; mMemoryBlocks.push_back(memBlock); mAvailablePtrs.reserve(mAvailablePtrs.size() + mBlockSize); for (size_t i = 0; i < mBlockSize; ++i) { mAvailablePtrs.push_back(memBlock++); } } /// @} /// @name Object retrieval /// @{ /** * Gets an object from the pointer vector. * * @return The object. */ tBase *GetObject() { tT *object = mAvailablePtrs.back(); mAvailablePtrs.pop_back(); return object; } /// @} /// Holds all the available pointers to object std::vector< tT * > mAvailablePtrs; /// Holds the used memory blocks std::vector< tT * > mMemoryBlocks; /// The amount of objects per block const size_t mBlockSize; /// The maximum of blocks used by this instantiator const size_t mMaxBlocks; }; //// @} #endif
26.490291
166
0.622137
[ "object", "vector" ]
329657d4f10643bbc794a7fa421838b5a1f7e8d0
3,930
h
C
src/include/execution/compiler/operator/insert_translator.h
Poojita-Raj/terrier
43fb57c264b3c1b33ee3eb4f7e701af73680ee1c
[ "MIT" ]
null
null
null
src/include/execution/compiler/operator/insert_translator.h
Poojita-Raj/terrier
43fb57c264b3c1b33ee3eb4f7e701af73680ee1c
[ "MIT" ]
null
null
null
src/include/execution/compiler/operator/insert_translator.h
Poojita-Raj/terrier
43fb57c264b3c1b33ee3eb4f7e701af73680ee1c
[ "MIT" ]
null
null
null
#pragma once #include <vector> #include "catalog/schema.h" #include "execution/compiler/ast_fwd.h" #include "execution/compiler/operator/operator_translator.h" namespace terrier::planner { class InsertPlanNode; } // namespace terrier::planner namespace terrier::execution::compiler { /** * InsertTranslator */ class InsertTranslator : public OperatorTranslator { public: /** * Create a new translator for the given insert plan. The compilation occurs within the * provided compilation context and the operator is participating in the provided pipeline. * @param plan The plan. * @param compilation_context The context of compilation this translation is occurring in. * @param pipeline The pipeline this operator is participating in. */ InsertTranslator(const planner::InsertPlanNode &plan, CompilationContext *compilation_context, Pipeline *pipeline); /** * Does nothing. * @param decls The top-level declarations. */ void DefineHelperFunctions(util::RegionVector<ast::FunctionDecl *> *decls) override {} /** * Does nothing. * @param pipeline The current pipeline. * @param function The pipeline generating function. */ void InitializePipelineState(const Pipeline &pipeline, FunctionBuilder *function) const override {} /** * Implement insertion logic where it fills in the insert PR obtained from the StorageInterface struct * with values from the child. * @param context The context of the work. * @param function The pipeline generating function. */ void PerformPipelineWork(WorkContext *context, FunctionBuilder *function) const override; /** * @return The child's output at the given index. */ ast::Expr *GetChildOutput(WorkContext *context, uint32_t child_idx, uint32_t attr_idx) const override; /** * @return An expression representing the value of the column with the given OID. */ ast::Expr *GetTableColumn(catalog::col_oid_t col_oid) const override; private: // Declare storage interface. void DeclareInserter(FunctionBuilder *builder) const; // Free the storage interface. void GenInserterFree(FunctionBuilder *builder) const; // Sets the oids that we are inserting on, using the schema from the insert plan node. void SetOids(FunctionBuilder *builder) const; // Declares the projected row that we will be using the insert values with. void DeclareInsertPR(FunctionBuilder *builder) const; // Gets the projected row pointer that we will fill in with values to insert. void GetInsertPR(FunctionBuilder *builder) const; // Sets the values in the projected row which we will use to insert into the table. void GenSetTablePR(FunctionBuilder *builder, WorkContext *context, uint32_t idx) const; // Insert into the table. void GenTableInsert(FunctionBuilder *builder) const; // Insert into an index of this table. void GenIndexInsert(WorkContext *context, FunctionBuilder *builder, const catalog::index_oid_t &index_oid) const; // Gets all the column oids in a schema. static std::vector<catalog::col_oid_t> AllColOids(const catalog::Schema &table_schema_) { std::vector<catalog::col_oid_t> oids; for (const auto &col : table_schema_.GetColumns()) { oids.emplace_back(col.Oid()); } return oids; } // Storage interface inserter struct which we use to insert. ast::Identifier inserter_; // Projected row that the inserter spits out for us to insert with. ast::Identifier insert_pr_; // Column oids that we are inserting on. ast::Identifier col_oids_; // Schema of the table that we are inserting on. const catalog::Schema &table_schema_; // All the oids that we are inserting on. std::vector<catalog::col_oid_t> all_oids_; // Projection map of the table that we are inserting into. // This maps column oids to offsets in a projected row. storage::ProjectionMap table_pm_; }; } // namespace terrier::execution::compiler
34.173913
117
0.742494
[ "vector" ]
d0cd7fec9f7002bf5f25c2f90dbb52377d51fc31
1,059
h
C
dir600b_v2.03/kernels/rt305x/include/asm-sparc64/pconf.h
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
1
2019-07-21T01:58:19.000Z
2019-07-21T01:58:19.000Z
dir600b_v2.03/kernels/rt305x/include/asm-sparc64/pconf.h
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
null
null
null
dir600b_v2.03/kernels/rt305x/include/asm-sparc64/pconf.h
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
2
2020-03-06T22:45:39.000Z
2021-12-23T13:58:14.000Z
/* $Id: pconf.h,v 1.1.1.1 2007-05-25 06:50:14 bruce Exp $ * pconf.h: pathconf() and fpathconf() defines for SunOS * system call compatibility. * * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) */ #ifndef _SPARC64_PCONF_H #define _SPARC64_PCONF_H #include <linux/fs.h> #include <linux/limits.h> #define _PCONF_LINK 1 /* Max number of links to an object */ #define _PCONF_CANON 2 /* TTY input buffer line size */ #define _PCONF_INPUT 3 /* Biggest packet a tty can imbibe at once */ #define _PCONF_NAME 4 /* Filename length max */ #define _PCONF_PATH 5 /* Max size of a pathname */ #define _PCONF_PIPE 6 /* Buffer size for a pipe */ #define _PCONF_CHRESTRICT 7 /* Can only root chown files? */ #define _PCONF_NOTRUNC 8 /* Are pathnames truncated if too big? */ #define _PCONF_VDISABLE 9 /* Magic char to disable special tty chars */ #define _PCONF_MAXPCONF 9 #endif /* !(_SPARC64_PCONF_H) */
40.730769
73
0.625118
[ "object" ]
d0d65a4569dd272987662ad8035f9f12ff9a8b74
19,000
c
C
Life-2.33/Life-1.02/Source/xdisplaylist.c
djdarland/WildLIFE
e2496b76bf3fdafd861d8ed36a4e3ad4a254b6b3
[ "FSFAP", "ADSL" ]
3
2022-02-16T20:11:27.000Z
2022-02-16T20:11:50.000Z
Life-2.33/Life-1.02/Source/xdisplaylist.c
djdarland/WildLIFE
e2496b76bf3fdafd861d8ed36a4e3ad4a254b6b3
[ "FSFAP", "ADSL" ]
2
2019-08-20T19:21:25.000Z
2019-08-20T21:23:57.000Z
Life-2.33/Life-1.02/Source/xdisplaylist.c
djdarland/WildLIFE
e2496b76bf3fdafd861d8ed36a4e3ad4a254b6b3
[ "FSFAP", "ADSL" ]
null
null
null
/* Copyright 1991 Digital Equipment Corporation. ** All Rights Reserved. ** Last modified on Thu Feb 17 16:32:31 MET 1994 by rmeyer *****************************************************************/ /* $Id: xdisplaylist.c,v 1.2 1994/12/08 23:37:00 duchier Exp $ */ #ifndef lint static char vcid[] = "$Id: xdisplaylist.c,v 1.2 1994/12/08 23:37:00 duchier Exp $"; #endif /* lint */ #ifdef X11 #include <stdio.h> /* #include <malloc.h> 11.9 */ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <limits.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include "extern.h" #include "xdisplaylist.h" /*****************************************/ typedef struct wl_Line { Action action; ListLinks links; int x0, y0, x1, y1; long function; long color; long linewidth; } Line; typedef struct wl_Rectangle { Action action; ListLinks links; int x, y, width, height; long function; long color; long linewidth; } Rectangle; typedef struct wl_Arc { Action action; ListLinks links; int x, y, width, height, startangle, arcangle; long function; long color; long linewidth; } Arc; typedef struct wl_String { Action action; ListLinks links; int x, y; char *str; long function; long color; long font; } String; typedef struct wl_GraphicClosure { Display *display; Drawable drawable; GC gc; } GraphicClosure; typedef struct wl_PostScriptClosure { long display; Drawable window; long f; long height; } PostScriptClosure; typedef struct wl_Polygon { Action action; ListLinks links; XPoint *points; long npoints; long function; long color; long linewidth; } Polygon; typedef union wl_DisplayElt { Action action; Line line; Rectangle rectangle; Arc arc; String str; Polygon polygon; } DisplayElt; typedef DisplayElt *RefDisplayElt; /*****************************************/ static ListLinks *x_get_links_of_display_list (elt) DisplayElt *elt; { return &((Line *) elt)->links; } ListHeader * x_display_list () { ListHeader *display_list; display_list = (ListHeader *) malloc (sizeof (ListHeader)); List_SetLinkProc (display_list, x_get_links_of_display_list); return display_list; } /*****************************************/ void x_set_gc (display, gc, function, color, linewidth, font) Display *display; GC gc; long function; unsigned long color; long linewidth; Font font; { XGCValues gcvalues; unsigned long valuemask; gcvalues.function = function; gcvalues.foreground = color; valuemask = GCFunction | GCForeground; if (linewidth != xDefaultLineWidth) { gcvalues.line_width = linewidth; valuemask |= GCLineWidth; } if (font != xDefaultFont) { gcvalues.font = font; valuemask |= GCFont; } XChangeGC (display, gc, valuemask, &gcvalues); } /*****************************************/ #define AllocDisplayElt() malloc (sizeof (DisplayElt)) #define FreeDisplayElt(E) free (E) void x_record_line (displaylist, action, x0, y0, x1, y1, function, color, linewidth) ListHeader *displaylist; Action action; long x0, y0, x1, y1; unsigned long function, color, linewidth; { Line * elt; elt = (Line *) AllocDisplayElt (); elt->action = action; elt->x0 = x0; elt->y0 = y0; elt->x1 = x1; elt->y1 = y1; elt->function = function; elt->color = color; elt->linewidth = linewidth; List_Append (displaylist, (Ref) elt); } /*****************************************/ void x_record_arc (displaylist, action, x, y, width, height, startangle, arcangle, function, color, linewidth) ListHeader *displaylist; Action action; long x, y, width, height, startangle, arcangle; unsigned long function, color, linewidth; { Arc * elt; elt = (Arc *) AllocDisplayElt (); elt->action = action; elt->x = x; elt->y = y; elt->width = width; elt->height = height; elt->startangle = startangle; elt->arcangle = arcangle; elt->function = function; elt->color = color; elt->linewidth = linewidth; List_Append (displaylist, (Ref) elt); } /*****************************************/ void x_record_rectangle (displaylist, action, x, y, width, height, function, color, linewidth) ListHeader *displaylist; Action action; long x, y, width, height; unsigned long function, color, linewidth; { Rectangle * elt; elt = (Rectangle *) AllocDisplayElt (); elt->action = action; elt->x = x; elt->y = y; elt->width = width; elt->height = height; elt->function = function; elt->color = color; elt->linewidth = linewidth; List_Append (displaylist, (Ref) elt); } /*****************************************/ void x_record_polygon (displaylist, action, points, npoints, function, color, linewidth) ListHeader *displaylist; Action action; XPoint *points; long npoints; unsigned long function, color, linewidth; { Polygon * elt; XPoint *p; elt = (Polygon *) AllocDisplayElt (); elt->action = action; elt->npoints = npoints; elt->points = p = (XPoint *) malloc (npoints*2*sizeof(short)); for (; npoints > 0; npoints--, p++, points++) *p = *points; elt->function = function; elt->color = color; elt->linewidth = linewidth; List_Append (displaylist, (Ref) elt); } /*****************************************/ void x_record_string (displaylist, action, x, y, str, font, function, color) ListHeader *displaylist; Action action; long x, y, font; char *str; unsigned long function, color; { String * elt; elt = (String *) AllocDisplayElt (); elt->action = action; elt->x = x; elt->y = y; elt->str = (char *) malloc (strlen (str)+1); /* 11.9 */ strcpy (elt->str, str); *(elt->str+strlen(str)) = '\0'; elt->function = function; elt->color = color; elt->font = font; List_Append (displaylist, (Ref) elt); } /*****************************************/ static long x_draw_elt (elt, g) DisplayElt *elt; GraphicClosure *g; { Line *line; Arc *arc; Rectangle *rectangle; String *s; Polygon *polygon; switch (elt->action) { case DRAW_LINE: line = (Line *) elt; x_set_gc (g->display, g->gc, line->function, line->color, line->linewidth, xDefaultFont); XDrawLine (g->display, g->drawable, g->gc, line->x0, line->y0, line->x1, line->y1); break; case DRAW_ARC: case FILL_ARC: arc = (Arc *) elt; x_set_gc (g->display, g->gc, arc->function, arc->color, arc->linewidth, xDefaultFont); if (arc->action == DRAW_ARC) XDrawArc (g->display, g->drawable, g->gc, arc->x, arc->y, arc->width, arc->height, arc->startangle, arc->arcangle); else XFillArc (g->display, g->drawable, g->gc, arc->x, arc->y, arc->width, arc->height, arc->startangle, arc->arcangle); break; case DRAW_RECTANGLE: case FILL_RECTANGLE: rectangle = (Rectangle *) elt; x_set_gc (g->display, g->gc, rectangle->function, rectangle->color, rectangle->linewidth, xDefaultFont); if (rectangle->action == DRAW_RECTANGLE) XDrawRectangle (g->display, g->drawable, g->gc, rectangle->x, rectangle->y, rectangle->width, rectangle->height); else XFillRectangle (g->display, g->drawable, g->gc, rectangle->x, rectangle->y, rectangle->width, rectangle->height); break; case DRAW_STRING: case DRAW_IMAGE_STRING: s = (String *) elt; x_set_gc (g->display, g->gc, s->function, s->color, xDefaultLineWidth, s->font); if (s->action == DRAW_STRING) XDrawString (g->display, g->drawable, g->gc, s->x, s->y, s->str, strlen (s->str)); else XDrawImageString (g->display, g->drawable, g->gc, s->x, s->y, s->str, strlen (s->str)); break; case DRAW_POLYGON: case FILL_POLYGON: polygon = (Polygon *) elt; x_set_gc (g->display, g->gc, polygon->function, polygon->color, polygon->linewidth, xDefaultFont); if (polygon->action == FILL_POLYGON) XFillPolygon (g->display, g->drawable, g->gc, polygon->points, polygon->npoints, Complex, CoordModeOrigin); else XDrawLines (g->display, g->drawable, g->gc, polygon->points, polygon->npoints, CoordModeOrigin); break; } return TRUE; } /*****************************************/ /* note if we have not been able to create a pixmap for the window, then the pixmap is the window itself, and the pixmapgc is the gc of the window. - jch - Thu Aug 6 16:58:22 MET DST 1992 */ void x_refresh_window (display, window, pixmap, pixmapgc, displaylist) Display *display; Window window; Pixmap pixmap; GC pixmapgc; ListHeader *displaylist; { XWindowAttributes attr; GraphicClosure g; /* disable the GraphicsExpose emitted by XCopyArea */ XSetGraphicsExposures (display, pixmapgc, False); /* get the geometry of the window */ XGetWindowAttributes (display, window, &attr); #if 0 /* does not work with a pixmap, only with windows !! @#@^&%#(*&! - jch */ XClearArea (display, pixmap, 0, 0, attr.width, attr.height, False); #endif x_set_gc (display, pixmapgc, GXcopy, attr.backing_pixel, xDefaultLineWidth, xDefaultFont); XFillRectangle (display, pixmap, pixmapgc, 0, 0, attr.width, attr.height); g.display = display; g.drawable = pixmap; g.gc = pixmapgc; List_Enum (displaylist, x_draw_elt, &g); if (window != pixmap) XCopyArea (display, pixmap, window, pixmapgc, 0, 0, attr.width, attr.height, 0, 0); XSync (display, 0); } /*****************************************/ static long x_free_elt (elt, closure) DisplayElt *elt; long *closure; { Line *line; Arc *arc; Rectangle *rectangle; String *s; Polygon *polygon; /* free the attributes of the element */ switch (elt->action) { case DRAW_LINE: /* no attribute to free ? */ break; case DRAW_ARC: case FILL_ARC: /* no attribute to free ? */ break; case DRAW_RECTANGLE: case FILL_RECTANGLE: /* no attribute to free ? */ break; case DRAW_STRING: case DRAW_IMAGE_STRING: s = (String *) elt; free (s->str); break; case DRAW_POLYGON: case FILL_POLYGON: polygon = (Polygon *) elt; free (polygon->points); break; } /* finaly, free the element itself */ FreeDisplayElt (elt); return TRUE; } /*****************************************/ void x_free_display_list (displaylist) ListHeader *displaylist; { List_Enum (displaylist, x_free_elt, NULL); } /*****************************************/ static char *prolog[] = { "%!PS-Adobe-2.0\n", "/mt {moveto} def /lt {lineto} def /slw {setlinewidth} def\n", "/np {newpath} def /st {stroke} def /fi {fill} def /cp {closepath} def\n", "1 setlinecap 1 setlinejoin\n", "/line {/lw exch def /b exch def /g exch def /r exch def\n", " /y1 exch def /x1 exch def \n", " /y0 exch def /x0 exch def\n", " r 65535 div g 65535 div b 65535 div setrgbcolor\n", " np lw slw x0 y0 mt x1 y1 lt st} def\n", "/rect {/sf exch def /lw exch def\n", " /b exch def /g exch def /r exch def\n", " /h exch def /w exch def \n", " /y exch def /x exch def\n", " r 65535 div g 65535 div b 65535 div setrgbcolor\n", " np lw slw x y mt x w add y lt x w add y h sub lt\n", " x y h sub lt cp sf {st} {fi} ifelse} def\n", "/earcdict 100 dict def\n", /* see cookbook ex #3 */ "earcdict /mtrx matrix put\n", "/earc {earcdict begin\n", " /sf exch def /lw exch def\n", " /b exch def /g exch def /r exch def\n", " r 65535 div g 65535 div b 65535 div setrgbcolor\n", " /ea exch def /sa exch def\n", " /yr exch def /xr exch def /y exch def /x exch def\n", " /savematrix mtrx currentmatrix def\n", " np x y translate xr yr scale 0 0 1 sa ea arc\n", " savematrix setmatrix lw slw sf {st} {fi} ifelse\n", " end} def\n", "/Helvetica findfont 18 scalefont setfont\n", "/dstr {/sf exch def\n", " /b exch def /g exch def /r exch def\n", " /str exch def /y exch def /x exch def\n", " r 65535 div g 65535 div b 65535 div setrgbcolor\n", " x y mt str show} def\n", 0 }; static void x_postscript_prolog (f) long f; { long i; for (i = 0; prolog[i] != 0; i++) write (f, prolog[i], strlen (prolog[i])); } /*****************************************/ #define BUF_SIZE 512 static char nstr[BUF_SIZE]; static char *add_number (buf, n) char *buf; long n; { long m, i; char *s; for (m=n, i=1; m>=10; i++) m /= 10; if (i < BUF_SIZE && strlen (buf) + i < BUF_SIZE) { sprintf (nstr, "%ld ", n); strcat (buf, nstr); } return buf; } static char *add_string (buf, s) char *buf, *s; { if (strlen (buf) + strlen(s) < BUF_SIZE) strcat (buf, s); return buf; } static void x_get_rgb_values (display, window, color, rgb) Display *display; Window window; unsigned long color; XColor *rgb; { XWindowAttributes windowAttributes; XGetWindowAttributes (display, window, &windowAttributes); rgb->pixel = color; XQueryColor (display, windowAttributes.colormap, rgb); } static long x_postscript_elt (elt, psc) DisplayElt *elt; PostScriptClosure *psc; { Line *line; Arc *arc; Rectangle *rectangle; String *s; Polygon *polygon; char buf[BUF_SIZE]; char *pbuf; XPoint *p; XColor color; long i; buf[0] = 0; pbuf = buf; switch (elt->action) { case DRAW_LINE: line = (Line *) elt; pbuf = add_number (pbuf, line->x0); pbuf = add_number (pbuf, psc->height - line->y0); pbuf = add_number (pbuf, line->x1); pbuf = add_number (pbuf, psc->height - line->y1); x_get_rgb_values (psc->display, psc->window, line->color, &color); pbuf = add_number (pbuf, color.red); pbuf = add_number (pbuf, color.green); pbuf = add_number (pbuf, color.blue); pbuf = add_number (pbuf, line->linewidth); pbuf = add_string (pbuf, "line\n"); write (psc->f, pbuf, strlen (pbuf)); break; case DRAW_RECTANGLE: case FILL_RECTANGLE: rectangle = (Rectangle *) elt; pbuf = add_number (pbuf, rectangle->x); pbuf = add_number (pbuf, psc->height - rectangle->y); pbuf = add_number (pbuf, rectangle->width); pbuf = add_number (pbuf, rectangle->height); x_get_rgb_values (psc->display, psc->window, rectangle->color, &color); pbuf = add_number (pbuf, color.red); pbuf = add_number (pbuf, color.green); pbuf = add_number (pbuf, color.blue); if (rectangle->action == DRAW_RECTANGLE) { pbuf = add_number (pbuf, rectangle->linewidth); pbuf = add_string (pbuf, "true "); } else { pbuf = add_number (pbuf, 1); pbuf = add_string (pbuf, "false "); } pbuf = add_string (pbuf, "rect\n"); write (psc->f, pbuf, strlen (pbuf)); break; case DRAW_ARC: case FILL_ARC: arc = (Arc *) elt; pbuf = add_number (pbuf, arc->x+arc->width/2); pbuf = add_number (pbuf, psc->height - (arc->y+arc->height/2)); pbuf = add_number (pbuf, arc->width/2); pbuf = add_number (pbuf, arc->height/2); pbuf = add_number (pbuf, arc->startangle); pbuf = add_number (pbuf, (arc->startangle+arc->arcangle)/64); x_get_rgb_values (psc->display, psc->window, arc->color, &color); pbuf = add_number (pbuf, color.red); pbuf = add_number (pbuf, color.green); pbuf = add_number (pbuf, color.blue); if (arc->action == DRAW_ARC) { pbuf = add_number (pbuf, arc->linewidth); pbuf = add_string (pbuf, "true "); } else { pbuf = add_number (pbuf, 1); pbuf = add_string (pbuf, "false "); } pbuf = add_string (pbuf, "earc\n"); write (psc->f, pbuf, strlen (pbuf)); break; case DRAW_STRING: case DRAW_IMAGE_STRING: s = (String *) elt; pbuf = add_number (pbuf, s->x); pbuf = add_number (pbuf, psc->height - s->y); pbuf = add_string (pbuf, "("); pbuf = add_string (pbuf, s->str); pbuf = add_string (pbuf, ") "); x_get_rgb_values (psc->display, psc->window, s->color, &color); pbuf = add_number (pbuf, color.red); pbuf = add_number (pbuf, color.green); pbuf = add_number (pbuf, color.blue); if (s->action == DRAW_STRING) pbuf = add_string (pbuf, "true "); else pbuf = add_string (pbuf, "false "); pbuf = add_string (pbuf, "dstr\n"); write (psc->f, pbuf, strlen (pbuf)); break; case FILL_POLYGON: polygon = (Polygon *) elt; x_get_rgb_values (psc->display, psc->window, polygon->color, &color); pbuf = add_number (pbuf, color.red); pbuf = add_string (pbuf, "65535 div "); pbuf = add_number (pbuf, color.green); pbuf = add_string (pbuf, "65535 div "); pbuf = add_number (pbuf, color.blue); pbuf = add_string (pbuf, "65535 div "); pbuf = add_string (pbuf, "setrgbcolor "); p = polygon->points; pbuf = add_string (pbuf, "np "); pbuf = add_number (pbuf, p->x); pbuf = add_number (pbuf, psc->height - p->y); pbuf = add_string (pbuf, "mt\n"); ++p; for (i=1; i<polygon->npoints; i++, p++) { pbuf = add_number (pbuf, p->x); pbuf = add_number (pbuf, psc->height - p->y); pbuf = add_string (pbuf, "lt "); if (i%4==0) pbuf = add_string (pbuf, "\n"); } pbuf = add_string (pbuf, "cp fi\n"); write (psc->f, pbuf, strlen (pbuf)); break; } return TRUE; } /*****************************************/ long x_postscript_window (display, window, displaylist, filename) Display *display; Window window; ListHeader *displaylist; char *filename; { XWindowAttributes windowAttributes; PostScriptClosure psc; psc.display =(long)display; psc.window = window; if ((psc.f = open (filename, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR|S_IWUSR|S_IRWXG)) == -1) { Errorline ("\n*** Error: cannot open file %s.\n", filename); return FALSE; } XGetWindowAttributes (display, window, &windowAttributes); psc.height = windowAttributes.height; x_postscript_prolog (psc.f); List_Enum (displaylist, x_postscript_elt, &psc); write (psc.f, "showpage\n", strlen ("showpage\n")); close (psc.f); return TRUE; } /*****************************************/ #endif
23.227384
83
0.579684
[ "geometry" ]
d0d6d190cbdd84bafba3ac67218b0f09f25849ad
991
h
C
C++/OOPBasics/OOP/Set.h
Yeva9/ITC-projects
19e967d656c86c64f04cc1ffbe03540f97c6eb34
[ "MIT" ]
null
null
null
C++/OOPBasics/OOP/Set.h
Yeva9/ITC-projects
19e967d656c86c64f04cc1ffbe03540f97c6eb34
[ "MIT" ]
null
null
null
C++/OOPBasics/OOP/Set.h
Yeva9/ITC-projects
19e967d656c86c64f04cc1ffbe03540f97c6eb34
[ "MIT" ]
null
null
null
#pragma once #include <iostream> /*Class objects are sets with value limitation [0, 10000]*/ class Set { friend std::ostream& operator<<(std::ostream&, const Set&); public: Set(); // default ctor Set(int, const int*); // ctor with parameters Set(const Set&); // copy ctor Set& operator=(const Set&); // assignemt operator ~Set(); // dtor bool contains(int) const; // checks if *this contains given value bool is_sub_set(const Set&) const; // checks if given Multiset object is subset for *this Set& operator&=(const Set&); // intersection Set& operator|=(const Set&); // union Set& operator-=(const Set&); // minus bool operator==(const Set&) const; private: void allocate_and_initialize(const bool*); void deallocate(); void check_size(int) const; private: static const int s_set_limit = 10001; int m_size; bool* m_data; }; Set operator&(Set, const Set&); Set operator|(Set, const Set&); Set operator-(Set, const Set&); bool operator!=(const Set&, const Set&);
23.595238
90
0.691221
[ "object" ]
d0da6da099de680af5e8e8ad212c52eee8ed1067
27,286
h
C
src/dataStyleCSS.h
loisspitz/ESPUI
a9505b9b4de43d13fe0375773e3f129ca09380d8
[ "MIT" ]
null
null
null
src/dataStyleCSS.h
loisspitz/ESPUI
a9505b9b4de43d13fe0375773e3f129ca09380d8
[ "MIT" ]
null
null
null
src/dataStyleCSS.h
loisspitz/ESPUI
a9505b9b4de43d13fe0375773e3f129ca09380d8
[ "MIT" ]
null
null
null
const char CSS_STYLE[] PROGMEM = R"=====( .container{position:relative;width:79%;margin:20px;box-sizing:border-box}.column,.columns{width:100%;float:left}.card{margin-top:2%;border-radius:6px;box-shadow:0 4px 4px rgba(204,197,185,0.5);padding-left:20px;padding-right:20px;margin-bottom:10px;min-width:500px;color:#fff}@media(max-width:630px){.card{min-width:98%}}.card-slider{padding-bottom:10px}.turquoise{background:#1abc9c;border-bottom:#16a085 3px solid}.emerald{background:#2ecc71;border-bottom:#27ae60 3px solid}.peterriver{background:#3498db;border-bottom:#2980b9 3px solid}.wetasphalt{background:#34495e;border-bottom:#2c3e50 3px solid}.sunflower{background:#f1c40f;border-bottom:#e6bb0f 3px solid}.carrot{background:#e67e22;border-bottom:#d35400 3px solid}.alizarin{background:#e74c3c;border-bottom:#c0392b 3px solid}.dark{background:#444857;border-bottom:#444857 3px solid}.label{box-sizing:border-box;white-space:nowrap;border-radius:.2em;padding:.12em .4em .14em;text-align:center;color:#fff;font-weight:700;line-height:1;margin-bottom:5px;display:inline-block;white-space:nowrap;vertical-align:baseline;position:relative;top:-.15em;background-color:#999;margin-bottom:10px}.label-wrap{width:90%;white-space:pre-wrap;word-wrap:break-word}.label.color-blue{background-color:#6f9ad1}.label.color-red{background-color:#d37c7c}.label.color-green{background-color:#9bc268}.label.color-orange{background-color:#dea154}.label.color-yellow{background-color:#e9d641}.label.color-purple{background-color:#9f83d1}@media(min-width:400px){.container{width:84%}}@media(min-width:630px){.container{width:98%}.column,.columns{margin-right:2%}.column:first-child,.columns:first-child{margin-left:0}.one.column,.one.columns{width:4.66666666667%}.two.columns{width:13.3333333333%}.three.columns{width:22%}.four.columns{width:30.6666666667%}.five.columns{width:39.3333333333%}.six.columns{width:48%}.seven.columns{width:56.6666666667%}.eight.columns{width:65.3333333333%}.nine.columns{width:74%}.ten.columns{width:82.6666666667%}.eleven.columns{width:91.3333333333%}.twelve.columns{width:100%;margin-left:0}.one-third.column{width:30.6666666667%}.two-thirds.column{width:65.3333333333%}.one-half.column{width:48%}.offset-by-one.column,.offset-by-one.columns{margin-left:8.66666666667%}.offset-by-two.column,.offset-by-two.columns{margin-left:17.3333333333%}.offset-by-three.column,.offset-by-three.columns{margin-left:26%}.offset-by-four.column,.offset-by-four.columns{margin-left:34.6666666667%}.offset-by-five.column,.offset-by-five.columns{margin-left:43.3333333333%}.offset-by-six.column,.offset-by-six.columns{margin-left:52%}.offset-by-seven.column,.offset-by-seven.columns{margin-left:60.6666666667%}.offset-by-eight.column,.offset-by-eight.columns{margin-left:69.3333333333%}.offset-by-nine.column,.offset-by-nine.columns{margin-left:78%}.offset-by-ten.column,.offset-by-ten.columns{margin-left:86.6666666667%}.offset-by-eleven.column,.offset-by-eleven.columns{margin-left:95.3333333333%}.offset-by-one-third.column,.offset-by-one-third.columns{margin-left:34.6666666667%}.offset-by-two-thirds.column,.offset-by-two-thirds.columns{margin-left:69.3333333333%}.offset-by-one-half.column,.offset-by-one-half.columns{margin-left:52%}}html{font-size:62.5%}body{margin:0;font-size:1.5em;line-height:1;font-weight:400;font-family:"Open Sans",sans-serif;color:#222;background-color:#ecf0f1}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:300}h1{font-size:4rem;line-height:1.2;letter-spacing:-.1rem}h2{font-size:3.6rem;line-height:1.25;letter-spacing:-.1rem}h3{font-size:3rem;line-height:1.3;letter-spacing:-.1rem}h4{font-size:2.4rem;line-height:1.35;letter-spacing:-.08rem}h5{font-size:1.8rem;line-height:1.5;letter-spacing:-.05rem}h6{font-size:1.5rem;line-height:1.6;letter-spacing:0}@media(min-width:630px){h1{font-size:5rem}h2{font-size:4.2rem}h3{font-size:3.6rem}h4{font-size:3rem}h5{font-size:2rem}h6{font-size:1.5rem}}p{margin-top:0}a{color:#1eaedb}a:hover{color:#0fa0ce}button{display:inline-block;padding:10px;border-radius:3px;color:#fff;background-color:#999}#mainHeader{display:inline-block}#conStatus{position:inherit;font-size:.75em}button,.button{margin-bottom:1rem}.u-full-width{width:100%;box-sizing:border-box}.u-max-full-width{max-width:100%;box-sizing:border-box}.u-pull-right{float:right}.u-pull-left{float:left}.tcenter{text-align:center}hr{margin-top:.5rem;margin-bottom:1.2rem;border-width:0;border-top:1px solid #e1e1e1}.container:after,.row:after,.u-cf{content:"";display:table;clear:both}.control{background-color:#ddd;background-image:linear-gradient(hsla(0,0%,0%,0.1),hsla(0,0%,100%,0.1));border-radius:50%;box-shadow:inset 0 1px 1px 1px hsla(0,0%,100%,0.5),0 0 1px 1px hsla(0,0%,100%,0.75),0 0 1px 2px hsla(0,0%,100%,0.25),0 0 1px 3px hsla(0,0%,100%,0.25),0 0 1px 4px hsla(0,0%,100%,0.25),0 0 1px 6px hsla(0,0%,0%,0.75);height:9em;margin:3em auto;position:relative;width:9em}.control ul{height:100%;padding:0;transform:rotate(45deg)}.control li{border-radius:100% 0 0 0;box-shadow:inset -1px -1px 1px hsla(0,0%,100%,0.5),0 0 1px hsla(0,0%,0%,0.75);display:inline-block;height:50%;overflow:hidden;width:50%}.control ul li:nth-child(2){transform:rotate(90deg)}.control ul li:nth-child(3){transform:rotate(-90deg)}.control ul li:nth-child(4){transform:rotate(180deg)}.control ul a{height:200%;position:relative;transform:rotate(-45deg);width:200%}.control a:hover,.control a:focus{background-color:hsla(0,0%,100%,0.25)}.control a{border-radius:50%;color:#333;display:block;font:bold 1em/3 sans-serif;text-align:center;text-decoration:none;text-shadow:0 1px 1px hsla(0,0%,100%,0.4);transition:.15s}.control .confirm{background-color:#ddd;background-image:linear-gradient(hsla(0,0%,0%,0.15),hsla(0,0%,100%,0.25));box-shadow:inset 0 1px 1px 1px hsla(0,0%,100%,0.5),0 0 1px 1px hsla(0,0%,100%,0.25),0 0 1px 2px hsla(0,0%,100%,0.25),0 0 1px 3px hsla(0,0%,100%,0.25),0 0 1px 4px hsla(0,0%,100%,0.25),0 0 1px 6px hsla(0,0%,0%,0.85);left:50%;line-height:3;margin:-1.5em;position:absolute;top:50%;width:3em}.control .confirm:hover,.control .confirm:focus{background-color:#eee}.switch{display:inline-block !important;background-color:#bebebe;border-radius:4px;box-shadow:inset 0 0 6px rgba(0,0,0,0.3);color:#fff;cursor:pointer;display:block;font-size:14px;height:26px;margin-bottom:12px;position:relative;width:60px;-webkit-transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out;-o-transition:background-color .2s ease-in-out;-ms-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.switch.checked{background-color:#76d21d}.switch input[type="checkbox"]{display:none;cursor:pointer;height:10px;left:12px;position:absolute;top:8px;width:10px}.in{position:absolute;top:8px;left:12px;-webkit-transition:left .08s ease-in-out;-moz-transition:left .08s ease-in-out;-o-transition:left .08s ease-in-out;-ms-transition:left .08s ease-in-out;transition:left .08s ease-in-out}.switch.checked div{left:38px}.switch .in:before{background:#fff;background:-moz-linear-gradient(top,#fff 0,#f0f0f0 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(100%,#f0f0f0));background:-webkit-linear-gradient(top,#fff 0,#f0f0f0 100%);background:-o-linear-gradient(top,#fff 0,#f0f0f0 100%);background:-ms-linear-gradient(top,#fff 0,#f0f0f0 100%);background:linear-gradient(to bottom,#fff 0,#f0f0f0 100%);border:1px solid #fff;border-radius:2px;box-shadow:0 0 4px rgba(0,0,0,0.3);content:"";height:18px;position:absolute;top:-5px;left:-9px;width:26px}.switch .in:after{background:#f0f0f0;background:-moz-linear-gradient(top,#f0f0f0 0,#fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#f0f0f0),color-stop(100%,#fff));background:-webkit-linear-gradient(top,#f0f0f0 0,#fff 100%);background:-o-linear-gradient(top,#f0f0f0 0,#fff 100%);background:-ms-linear-gradient(top,#f0f0f0 0,#fff 100%);background:linear-gradient(to bottom,#f0f0f0 0,#fff 100%);border-radius:10px;content:"";height:12px;margin:-1px 0 0 -1px;position:absolute;width:12px}.rkmd-slider{display:block;position:relative;font-size:16px;font-family:"Roboto",sans-serif}.rkmd-slider input[type="range"]{overflow:hidden;position:absolute;width:1px;height:1px;opacity:0}.rkmd-slider input[type="range"]+.slider{display:block;position:relative;width:100%;height:27px;border-radius:13px;background-color:#bebebe}@media(pointer:fine){.rkmd-slider input[type="range"]+.slider{height:4px;border-radius:0}}.rkmd-slider input[type="range"]+.slider .slider-fill{display:block;position:absolute;width:0;height:100%;user-select:none;z-index:1}.rkmd-slider input[type="range"]+.slider .slider-handle{cursor:pointer;position:absolute;top:12px;left:0;width:15px;height:15px;margin-left:-8px;border-radius:50%;transition:all .2s ease;user-select:none;z-index:2}@media(pointer:fine){.rkmd-slider input[type="range"]+.slider .slider-handle{top:-5.5px}}.rkmd-slider input[type="range"]:disabled+.slider{background-color:#b0b0b0 !important}.rkmd-slider input[type="range"]:disabled+.slider .slider-fill,.rkmd-slider input[type="range"]:disabled+.slider .slider-handle{cursor:default !important;background-color:#b0b0b0 !important}.rkmd-slider input[type="range"]:disabled+.slider .slider-fill .slider-label,.rkmd-slider input[type="range"]:disabled+.slider .slider-handle .slider-label{display:none;background-color:#b0b0b0 !important}.rkmd-slider input[type="range"]:disabled+.slider .slider-fill.is-active,.rkmd-slider input[type="range"]:disabled+.slider .slider-handle.is-active{top:-5.5px;width:15px;height:15px;margin-left:-8px}.rkmd-slider input[type="range"]:disabled+.slider .slider-fill.is-active .slider-label,.rkmd-slider input[type="range"]:disabled+.slider .slider-handle.is-active .slider-label{display:none;border-radius:50%;transform:none}.rkmd-slider input[type="range"]:disabled+.slider .slider-handle:active{box-shadow:none !important;transform:scale(1) !important}.rkmd-slider.slider-discrete .slider .slider-handle{position:relative;z-index:1}.rkmd-slider.slider-discrete .slider .slider-handle .slider-label{position:absolute;top:-17.5px;left:4px;width:30px;height:30px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%;border-radius:50%;-webkit-transform:scale(1) rotate(-45deg);transform:scale(1) rotate(-45deg);-webkit-transition:all .2s ease;transition:all .2s ease}@media(pointer:fine){.rkmd-slider.slider-discrete .slider .slider-handle .slider-label{left:-2px;-webkit-transform:scale(0.5) rotate(-45deg);transform:scale(0.5) rotate(-45deg)}}.rkmd-slider.slider-discrete .slider .slider-handle .slider-label span{position:absolute;top:7px;left:0;width:100%;color:#fff;font-size:16px;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media(pointer:fine){.rkmd-slider.slider-discrete .slider .slider-handle .slider-label span{font-size:12px}}.rkmd-slider.slider-discrete .slider .slider-handle.is-active{top:0;margin-left:-2px;width:4px;height:4px}.rkmd-slider.slider-discrete .slider .slider-handle.is-active .slider-label{top:-15px;left:-2px;border-radius:15px 15px 15px 0;-webkit-transform:rotate(-45deg) translate(23px,-25px);transform:rotate(-45deg) translate(23px,-25px)}.rkmd-slider.slider-discrete .slider .slider-handle.is-active .slider-label span{opacity:1}.rkmd-slider.slider-discrete.slider-turquoise .slider-label{background-color:#16a085}.rkmd-slider.slider-discrete.slider-emerald .slider-label{background-color:#27ae60}.peterriver{background:#3498db;border-bottom:#2980b9 3px solid}.rkmd-slider.slider-discrete.slider-peterriver .slider-label{background-color:#2980b9}.wetasphalt{background:#34495e;border-bottom:#2c3e50 3px solid}.rkmd-slider.slider-discrete.slider-wetasphalt .slider-label{background-color:#2c3e50}.sunflower{background:#f1c40f;border-bottom:#e6bb0f 3px solid}.rkmd-slider.slider-discrete.slider-sunflower .slider-label{background-color:#e6bb0f}.carrot{background:#e67e22;border-bottom:#d35400 3px solid}.rkmd-slider.slider-discrete.slider-carrot .slider-label{background-color:#d35400}.alizarin{background:#e74c3c;border-bottom:#c0392b 3px solid}.rkmd-slider.slider-discrete.slider-alizarin .slider-label{background-color:#c0392b}input{margin:0 auto 1.2rem auto;padding:2px 5px;width:100%;box-sizing:border-box;border:0;border-radius:4px;box-shadow:inset 0 0 6px rgba(0,0,0,0.3);background:rgba(255,255,255,0.8)}select{margin:0 auto 1.2rem auto;padding:2px 5px;width:100%;box-sizing:border-box;border:0;border-radius:4px;box-shadow:inset 0 0 6px rgba(0,0,0,0.3);background:rgba(255,255,255,0.8)}input[id^="num"]{max-width:6em;width:auto;text-align:right;font-weight:bold;font-size:115%}body div>ul.navigation{margin:0;padding:0;border-bottom:3px solid #666;overflow:hidden}ul.navigation li{list-style:none;float:left;margin-right:4px}ul.navigation li.controls{float:right}ul.navigation li a{font-weight:bold;display:inline-block;padding:6px 12px;color:#888;outline:0;text-decoration:none;background:#f3f3f3;background:-webkit-gradient(linear,0 0,0 bottom,from(#eee),to(#e4e4e4));background:-moz-linear-gradient(#eee,#e4e4e4);background:linear-gradient(#eee,#e4e4e4);-pie-background:linear-gradient(#eee,#e4e4e4)}ul.navigation li.active a{pointer-events:none;color:white;background:#666;background:-webkit-gradient(linear,0 0,0 bottom,from(#888),to(#666));background:-moz-linear-gradient(#888,#666);background:linear-gradient(#888,#666);-pie-background:linear-gradient(#888,#666)}div.tabscontent>div{padding:0 15px}#tabsnav:empty{display:none}.range-slider{margin:0}.range-slider{width:100%}.range-slider__range{-webkit-appearance:none;width:calc(100% - (45px));height:10px;border-radius:5px;outline:0;padding:0;margin:0}.range-slider__range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;cursor:pointer;transition:background .15s ease-in-out}.range-slider__range::-webkit-slider-thumb:hover{background:#1abc9c}.range-slider__range:active::-webkit-slider-thumb{background:#1abc9c}.range-slider__range::-moz-range-thumb{width:20px;height:20px;border:0;border-radius:50%;cursor:pointer;transition:background .15s ease-in-out}.range-slider__range:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #fff,0 0 0 6px #1abc9c}.range-slider__value{display:inline-block;position:relative;width:30px;color:#fff;line-height:20px;text-align:center;border-radius:3px;padding:5px 5px;margin-left:2px}.range-slider__value:after{position:absolute;top:8px;left:-7px;width:0;height:0;content:""}::-moz-range-track{border:0}input::-moz-focus-inner,input::-moz-focus-outer{border:0}svg{display:block;width:100%;height:100%}.y-axis path,.x-axis path{stroke:gray;stroke-width:1;fill:none}.series{stroke:steelblue;stroke-width:3;fill:none}.data-points circle{stroke:steelblue;stroke-width:2;fill:white}.data-points text{display:none}.data-points circle:hover{fill:steelblue;stroke-width:6}.data-points circle:hover+text{display:inline-block}text{text-anchor:end} )====="; const uint8_t CSS_STYLE_GZIP[3402] PROGMEM = { 31,139,8,0,193,22,6,94,2,255,213,27,219,110,171,72,242,87,216,68,145,98,13,176,220,109,131,102,180,143,251,182,210,206,227,106,118,212,134,38,160,96,240,66,251,36,25,139,127,223,190,1,125,35,118,46,163,213,30,159,147,131,155,170,234,186,117,85,117,117,199,205,187,22,129,186,133,253,229,212,13,53,170,187,54,237,97,3,80,253,3,102,47,117,129,170,116,187,127,200,142,160,127,170,219,52,240,78,175,217,161,123,117,134,250,143,186,125,74,15,93,95,192,222,193,35,163,155,119,205,249,216,218,252,255,225,194,144,125,207,123,200,202,166,3,40,109,96,137,48,24,232,139,11,35,231,160,238,148,6,15,25,167,210,131,162,62,15,105,50,77,81,129,162,123,73,61,43,58,189,210,127,253,211,1,60,6,94,100,251,251,173,237,239,98,219,115,227,77,118,2,69,129,89,113,8,117,198,223,52,210,215,79,21,31,226,243,29,58,132,186,35,230,137,12,225,239,140,197,216,35,223,49,219,93,159,222,151,101,57,254,237,8,139,26,60,30,193,43,135,72,66,12,177,185,112,222,103,196,253,238,97,100,2,57,67,83,23,68,133,124,106,97,162,209,69,231,254,63,231,174,30,224,229,0,242,231,167,190,59,183,69,122,239,131,67,190,207,179,89,131,20,225,222,79,128,183,139,173,16,139,59,116,152,230,232,194,35,236,65,83,72,184,1,204,243,173,175,226,6,91,0,19,79,196,61,65,4,251,30,91,178,151,208,195,104,191,43,14,26,250,126,231,29,246,34,250,11,68,96,56,85,160,65,10,122,180,143,161,134,158,135,48,150,102,31,206,45,54,252,139,50,121,233,231,145,87,170,216,48,57,28,188,82,196,198,106,237,59,121,98,152,108,97,16,168,168,69,24,71,158,52,49,104,234,63,64,95,183,50,242,54,202,67,77,223,185,23,238,131,131,136,92,128,254,89,66,140,162,104,23,111,85,68,54,42,34,54,224,0,155,139,113,113,100,47,85,141,160,51,156,64,14,211,182,123,233,193,73,113,122,55,128,199,201,113,83,215,199,223,44,55,34,63,124,252,51,67,240,21,57,88,170,167,54,205,97,139,109,42,120,107,86,226,5,236,188,64,234,236,91,207,203,26,188,152,157,138,125,247,21,207,143,177,163,23,245,112,106,192,91,90,183,20,242,208,116,249,179,137,65,236,53,168,206,65,195,39,62,128,1,18,132,76,15,19,100,25,59,174,31,99,78,23,197,57,156,197,253,126,111,88,126,92,93,14,153,137,71,138,61,14,20,34,27,167,30,210,215,217,11,214,20,125,74,15,61,4,207,14,249,206,241,93,58,9,150,225,44,46,174,105,234,164,220,131,194,151,65,123,88,24,32,139,112,155,111,115,25,242,169,135,176,53,192,238,15,121,144,236,100,216,174,7,237,147,137,133,2,2,63,142,100,224,55,216,224,101,97,0,134,251,34,137,20,126,79,231,254,212,152,40,239,203,93,136,133,155,98,213,28,148,34,143,199,170,57,174,179,241,93,132,131,149,6,61,71,54,5,154,132,54,45,162,115,51,242,184,58,3,164,101,221,15,200,201,171,186,41,102,96,113,112,66,164,33,218,27,221,174,133,51,237,229,121,202,24,145,155,204,127,182,120,18,244,210,169,57,37,116,195,249,15,129,168,176,169,20,152,128,240,87,118,231,94,25,15,61,87,162,94,98,7,86,65,246,50,249,161,126,85,89,36,218,25,224,15,216,42,47,226,68,166,78,87,161,2,147,196,50,249,182,214,84,176,141,136,84,26,245,93,160,80,111,12,44,236,125,69,57,47,176,209,68,164,89,89,183,138,131,170,186,47,56,236,138,194,176,57,24,216,32,195,169,98,17,114,56,117,148,50,20,213,92,87,150,3,68,206,225,205,145,60,193,48,58,72,174,179,83,60,99,193,88,124,196,54,142,202,116,252,173,194,234,130,33,120,146,189,50,46,211,10,18,137,128,224,113,182,121,88,70,15,35,119,69,36,193,49,109,243,176,76,41,10,215,132,90,252,215,54,142,202,116,226,64,70,22,92,204,94,25,151,9,36,222,154,72,226,106,176,87,198,21,90,251,53,161,132,85,99,155,135,101,74,91,217,241,144,81,40,180,34,210,46,89,21,169,89,209,143,178,54,69,106,251,120,77,40,117,9,218,239,188,187,213,143,180,245,106,191,247,242,86,245,43,171,219,94,127,165,123,215,88,161,99,115,161,101,11,174,148,96,154,4,110,252,48,30,186,226,141,131,166,94,182,188,245,93,82,87,200,69,141,88,242,224,124,199,190,151,224,88,55,111,233,221,63,78,176,181,126,5,237,112,103,15,248,39,246,212,190,46,167,130,41,32,245,163,158,120,243,210,43,253,177,242,237,42,176,171,208,174,34,187,138,237,42,17,247,41,158,82,197,184,113,143,249,18,57,9,61,15,147,16,4,139,122,149,115,55,200,26,136,112,1,71,107,28,82,235,225,186,9,67,141,85,32,224,133,110,98,192,140,215,80,67,17,85,71,12,215,240,34,1,47,112,13,204,134,134,41,189,29,197,141,47,162,133,118,58,174,9,53,166,168,137,132,26,235,168,137,138,234,173,214,45,146,186,99,77,145,145,27,232,26,162,202,149,165,15,53,153,130,21,86,199,241,36,57,197,8,46,220,135,124,8,96,113,24,65,90,117,100,191,197,71,189,18,120,57,28,15,103,236,51,237,197,88,122,79,85,191,207,246,214,226,174,32,148,246,165,230,226,122,188,63,226,194,237,239,16,144,253,167,105,130,241,30,23,119,191,34,128,206,195,178,197,175,219,10,47,11,36,172,51,119,139,215,25,103,212,118,57,195,74,225,78,20,224,158,157,242,220,52,204,14,98,57,177,210,22,56,59,100,31,45,160,44,219,234,247,209,78,4,133,214,154,23,214,63,160,207,243,27,18,78,46,98,99,1,177,173,209,69,219,44,141,85,47,218,140,185,156,34,25,117,148,73,251,140,59,111,250,74,144,252,105,159,103,221,67,159,124,198,165,100,78,65,137,103,177,221,190,123,153,30,207,78,94,94,8,0,102,32,189,187,155,247,92,8,28,26,152,229,13,4,61,150,22,85,140,74,223,53,166,173,67,81,136,22,175,143,224,9,166,196,172,128,236,77,176,131,96,218,143,213,208,128,71,207,246,30,232,95,215,223,216,203,8,81,47,29,219,40,110,21,79,106,103,29,150,186,197,145,219,242,44,34,227,244,79,163,18,111,108,79,128,209,222,111,5,128,192,4,16,8,0,225,53,128,232,26,64,34,1,76,28,100,60,134,236,103,3,167,33,222,68,131,51,234,178,181,238,214,158,248,52,183,130,117,110,46,83,24,34,190,57,45,77,47,67,120,131,55,148,93,127,76,251,14,47,37,248,24,197,5,124,218,44,152,77,125,145,149,76,8,88,132,93,79,215,181,67,68,112,110,209,181,65,70,99,16,225,92,19,203,146,240,67,250,46,105,85,23,5,108,179,169,201,245,32,138,137,249,77,91,84,177,253,217,99,176,185,104,2,238,61,89,64,21,39,52,224,56,215,144,34,3,146,191,211,145,192,100,134,128,154,65,239,56,104,51,51,123,112,97,9,214,66,143,135,100,91,24,40,187,28,71,67,109,205,153,92,78,160,115,209,151,17,95,171,184,60,154,237,194,12,66,2,43,94,226,77,97,249,240,248,215,208,18,74,17,189,155,67,71,10,152,119,61,160,114,182,184,134,98,131,115,19,116,213,89,162,13,211,6,211,144,235,199,195,194,49,121,192,251,240,227,119,69,151,216,16,94,176,138,54,223,30,77,130,255,121,52,217,225,149,198,42,86,108,101,177,62,9,167,200,226,176,202,116,118,78,112,192,9,226,140,88,59,140,96,241,253,179,24,95,38,131,168,30,57,143,175,56,230,61,132,112,116,135,151,26,229,149,49,201,91,127,169,143,167,174,71,160,69,134,50,225,0,201,71,201,2,145,220,103,159,236,230,81,109,208,94,59,214,6,249,184,225,70,172,66,242,115,63,224,231,83,87,83,223,213,221,158,215,75,132,254,180,138,19,189,7,31,144,78,253,74,76,78,72,41,132,203,234,195,115,141,28,193,187,85,201,44,55,24,44,8,6,232,96,194,221,25,101,206,177,251,227,99,8,221,7,233,15,31,130,255,0,236,100,94,55,175,96,254,108,236,82,110,147,34,240,139,9,208,170,219,211,25,253,11,189,157,224,207,119,20,9,91,243,238,183,217,61,104,16,81,140,53,39,55,172,95,214,10,145,204,32,185,240,14,191,153,234,52,210,176,173,219,203,58,224,66,204,96,54,242,210,194,59,135,247,109,181,2,213,221,66,105,184,14,116,13,64,213,191,85,212,63,46,108,111,189,35,226,115,165,99,53,164,7,136,83,143,124,154,35,151,231,41,149,77,141,166,88,87,54,1,180,60,252,159,71,62,22,137,69,27,9,145,107,111,70,98,68,108,202,50,33,64,31,216,26,178,89,135,120,192,195,143,30,165,188,17,135,104,156,227,19,109,140,147,124,138,193,238,115,104,216,68,159,193,211,113,38,225,205,152,52,194,137,213,58,53,140,20,247,2,245,124,209,91,78,23,165,136,55,87,239,211,170,217,173,174,21,39,158,214,128,179,159,151,13,137,122,146,223,208,205,129,236,54,148,249,27,61,135,9,202,44,253,189,158,195,124,196,224,60,216,165,62,224,57,87,24,236,62,135,182,234,57,239,227,189,231,57,38,76,165,120,167,59,111,205,3,130,57,143,165,180,124,39,206,67,30,12,110,193,67,103,64,124,160,127,62,206,71,196,114,190,212,51,160,144,65,73,214,148,90,91,255,236,176,8,157,216,215,146,104,75,25,129,158,72,225,116,160,110,7,86,57,93,210,53,121,236,72,239,5,189,145,131,129,43,51,252,228,222,40,153,176,233,159,234,130,173,214,242,240,73,207,99,173,130,153,250,64,60,157,165,37,182,241,230,114,51,131,124,214,72,155,212,27,111,150,210,226,255,59,101,221,52,107,34,43,170,245,50,113,83,121,30,72,107,11,54,48,71,44,71,255,129,51,80,1,95,83,255,227,76,84,160,45,26,120,81,178,188,57,70,81,231,101,135,61,147,41,98,193,230,241,82,162,177,64,182,211,212,68,138,90,33,141,130,166,153,139,152,117,169,130,175,25,77,21,149,69,91,23,115,123,221,102,41,54,15,105,184,20,179,7,24,28,203,35,31,161,124,254,56,85,201,37,236,207,163,203,198,44,96,9,206,13,186,82,216,127,51,247,243,23,122,4,253,101,89,100,114,114,101,250,231,11,227,214,131,3,114,18,122,190,44,200,66,74,112,192,91,87,209,183,137,241,205,214,89,35,172,216,201,28,2,104,243,133,0,140,95,101,35,229,138,21,106,50,66,87,116,252,101,198,33,7,13,124,244,55,107,94,50,145,198,115,230,61,68,179,100,234,34,211,179,147,57,10,223,72,79,81,224,74,145,232,111,221,185,78,140,102,255,33,39,25,147,255,132,218,198,151,72,237,116,125,77,74,14,172,124,90,173,100,235,111,116,107,105,212,22,29,42,189,179,235,16,134,189,157,148,4,86,198,175,103,128,207,169,153,173,176,192,164,50,46,2,233,52,93,19,211,0,51,126,221,7,172,225,4,214,54,204,91,45,17,123,75,43,113,190,210,181,212,128,122,195,80,151,87,106,75,175,181,171,151,170,110,166,160,229,109,186,1,49,140,14,250,160,58,240,39,217,153,169,82,208,73,160,38,255,27,201,42,81,220,147,35,117,48,175,72,161,115,21,41,225,251,195,51,41,46,203,226,192,178,91,12,244,2,56,38,77,209,249,135,183,110,107,238,172,22,125,209,144,145,0,23,207,182,19,96,188,77,246,49,240,239,20,146,217,107,114,181,247,227,233,244,125,190,35,171,232,75,175,18,216,13,217,155,136,242,171,179,87,73,178,139,179,95,190,46,123,3,71,203,12,215,153,162,244,191,124,9,247,6,166,150,25,174,51,69,233,127,245,106,239,13,60,205,19,92,101,137,145,255,210,125,225,27,248,97,212,175,50,195,104,127,241,6,242,13,236,76,244,175,50,196,168,143,180,44,155,111,215,208,3,81,139,157,121,243,195,81,126,208,73,206,90,132,202,118,245,124,126,106,180,121,95,57,83,16,116,195,174,246,199,177,61,253,243,220,221,102,100,169,229,255,142,109,86,3,215,197,191,127,190,107,207,199,187,223,132,27,15,9,60,114,38,41,255,66,98,167,151,27,164,235,68,228,240,80,172,4,124,126,73,138,52,166,127,57,55,110,11,126,212,79,244,188,112,185,54,181,28,88,203,94,22,46,13,209,36,73,212,35,226,81,162,70,142,178,155,122,192,211,162,183,6,178,76,191,220,179,200,164,75,192,36,61,170,200,211,161,214,32,93,219,80,161,44,112,209,132,125,247,122,12,49,5,109,97,112,207,222,237,118,89,119,70,4,146,156,207,155,78,80,165,216,20,146,207,45,13,83,210,24,244,166,94,97,217,119,199,71,114,250,182,177,81,135,31,34,242,81,122,162,166,142,45,65,177,39,240,247,218,146,50,160,115,170,177,220,55,66,235,154,231,217,24,92,120,5,230,144,59,136,104,224,71,65,84,111,244,134,189,164,25,226,16,159,83,11,54,1,83,11,38,113,139,78,48,188,77,97,223,85,200,2,117,85,27,51,232,136,215,132,139,112,145,205,123,182,191,144,195,155,121,49,208,74,106,188,39,239,177,190,82,120,60,161,55,105,147,139,99,46,217,171,78,45,218,105,57,41,195,75,116,145,95,252,254,59,187,253,63,105,14,156,78,152,77,208,230,124,241,48,60,188,215,200,105,91,221,114,44,92,142,227,154,107,35,29,199,41,59,55,210,130,157,189,123,89,214,102,214,56,7,233,108,188,169,170,170,206,199,195,42,95,102,62,3,97,59,26,120,198,30,160,210,110,52,30,114,90,228,38,130,124,190,118,51,199,252,10,157,254,219,82,102,26,204,235,87,132,191,149,8,115,89,246,134,97,190,171,14,45,133,124,179,94,232,61,128,53,145,228,195,43,86,202,144,125,163,237,205,73,107,69,214,31,128,252,166,140,57,206,174,244,235,67,249,151,227,164,187,16,84,33,250,238,84,191,196,56,57,112,204,19,181,116,131,158,110,177,116,54,249,113,217,149,51,103,103,59,231,253,185,205,238,9,71,55,163,108,217,30,27,226,50,153,144,101,106,14,64,53,142,109,210,194,222,214,199,177,161,136,71,78,136,195,143,39,165,247,175,31,110,176,64,241,230,128,215,122,176,78,0,85,182,251,186,124,185,12,56,71,62,195,20,7,179,183,140,61,79,183,34,51,210,245,227,113,137,28,242,192,97,2,30,16,132,13,249,101,39,25,35,20,49,10,128,128,67,93,112,176,242,186,207,27,120,5,59,96,216,52,49,200,232,196,178,74,156,212,169,243,197,74,105,172,204,144,172,227,253,36,205,33,93,91,165,111,152,115,181,121,133,221,15,182,197,248,95,172,216,174,129,175,58,0,0 };
4,547.666667
15,023
0.754966
[ "transform", "solid" ]
d0e133785b3f8139fa162e275188fc94b1980c57
11,952
h
C
services/camera/libcameraservice/device3/Camera3Stream.h
rubis-lab/NANS_framework_av
fc0e7dfab044f96b33c641d7ddf60d5a8f1ac46e
[ "Apache-2.0" ]
null
null
null
services/camera/libcameraservice/device3/Camera3Stream.h
rubis-lab/NANS_framework_av
fc0e7dfab044f96b33c641d7ddf60d5a8f1ac46e
[ "Apache-2.0" ]
null
null
null
services/camera/libcameraservice/device3/Camera3Stream.h
rubis-lab/NANS_framework_av
fc0e7dfab044f96b33c641d7ddf60d5a8f1ac46e
[ "Apache-2.0" ]
null
null
null
/* * Copyright (C) 2013 The Android Open Source Project * * 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 ANDROID_SERVERS_CAMERA3_STREAM_H #define ANDROID_SERVERS_CAMERA3_STREAM_H #include <gui/Surface.h> #include <utils/RefBase.h> #include <utils/String8.h> #include <utils/String16.h> #include <utils/List.h> #include "hardware/camera3.h" #include "Camera3StreamBufferListener.h" #include "Camera3StreamInterface.h" namespace android { namespace camera3 { /** * A class for managing a single stream of input or output data from the camera * device. * * The stream has an internal state machine to track whether it's * connected/configured/etc. * * States: * * STATE_ERROR: A serious error has occurred, stream is unusable. Outstanding * buffers may still be returned. * * STATE_CONSTRUCTED: The stream is ready for configuration, but buffers cannot * be gotten yet. Not connected to any endpoint, no buffers are registered * with the HAL. * * STATE_IN_CONFIG: Configuration has started, but not yet concluded. During this * time, the usage, max_buffers, and priv fields of camera3_stream returned by * startConfiguration() may be modified. * * STATE_IN_RE_CONFIG: Configuration has started, and the stream has been * configured before. Need to track separately from IN_CONFIG to avoid * re-registering buffers with HAL. * * STATE_CONFIGURED: Stream is configured, and has registered buffers with the * HAL. The stream's getBuffer/returnBuffer work. The priv pointer may still be * modified. * * Transition table: * * <none> => STATE_CONSTRUCTED: * When constructed with valid arguments * <none> => STATE_ERROR: * When constructed with invalid arguments * STATE_CONSTRUCTED => STATE_IN_CONFIG: * When startConfiguration() is called * STATE_IN_CONFIG => STATE_CONFIGURED: * When finishConfiguration() is called * STATE_IN_CONFIG => STATE_ERROR: * When finishConfiguration() fails to allocate or register buffers. * STATE_CONFIGURED => STATE_IN_RE_CONFIG: * * When startConfiguration() is called again, after making sure stream is * idle with waitUntilIdle(). * STATE_IN_RE_CONFIG => STATE_CONFIGURED: * When finishConfiguration() is called. * STATE_IN_RE_CONFIG => STATE_ERROR: * When finishConfiguration() fails to allocate or register buffers. * STATE_CONFIGURED => STATE_CONSTRUCTED: * When disconnect() is called after making sure stream is idle with * waitUntilIdle(). * * Status Tracking: * Each stream is tracked by StatusTracker as a separate component, * depending on the handed out buffer count. The state must be STATE_CONFIGURED * in order for the component to be marked. * * It's marked in one of two ways: * * - ACTIVE: One or more buffers have been handed out (with #getBuffer). * - IDLE: All buffers have been returned (with #returnBuffer), and their * respective release_fence(s) have been signaled. * * A typical use case is output streams. When the HAL has any buffers * dequeued, the stream is marked ACTIVE. When the HAL returns all buffers * (e.g. if no capture requests are active), the stream is marked IDLE. * In this use case, the app consumer does not affect the component status. * */ class Camera3Stream : protected camera3_stream, public virtual Camera3StreamInterface, public virtual RefBase { public: virtual ~Camera3Stream(); static Camera3Stream* cast(camera3_stream *stream); static const Camera3Stream* cast(const camera3_stream *stream); /** * Get the stream's ID */ int getId() const; /** * Get the stream's dimensions and format */ uint32_t getWidth() const; uint32_t getHeight() const; int getFormat() const; /** * Start the stream configuration process. Returns a handle to the stream's * information to be passed into the HAL device's configure_streams call. * * Until finishConfiguration() is called, no other methods on the stream may be * called. The usage and max_buffers fields of camera3_stream may be modified * between start/finishConfiguration, but may not be changed after that. * The priv field of camera3_stream may be modified at any time after * startConfiguration. * * Returns NULL in case of error starting configuration. */ camera3_stream* startConfiguration(); /** * Check if the stream is mid-configuration (start has been called, but not * finish). Used for lazy completion of configuration. */ bool isConfiguring() const; /** * Completes the stream configuration process. During this call, the stream * may call the device's register_stream_buffers() method. The stream * information structure returned by startConfiguration() may no longer be * modified after this call, but can still be read until the destruction of * the stream. * * Returns: * OK on a successful configuration * NO_INIT in case of a serious error from the HAL device * NO_MEMORY in case of an error registering buffers * INVALID_OPERATION in case connecting to the consumer failed */ status_t finishConfiguration(camera3_device *hal3Device); /** * Cancels the stream configuration process. This returns the stream to the * initial state, allowing it to be configured again later. * This is done if the HAL rejects the proposed combined stream configuration */ status_t cancelConfiguration(); /** * Fill in the camera3_stream_buffer with the next valid buffer for this * stream, to hand over to the HAL. * * This method may only be called once finishConfiguration has been called. * For bidirectional streams, this method applies to the output-side * buffers. * */ status_t getBuffer(camera3_stream_buffer *buffer); /** * Return a buffer to the stream after use by the HAL. * * This method may only be called for buffers provided by getBuffer(). * For bidirectional streams, this method applies to the output-side buffers */ status_t returnBuffer(const camera3_stream_buffer &buffer, nsecs_t timestamp); /** * Fill in the camera3_stream_buffer with the next valid buffer for this * stream, to hand over to the HAL. * * This method may only be called once finishConfiguration has been called. * For bidirectional streams, this method applies to the input-side * buffers. * */ status_t getInputBuffer(camera3_stream_buffer *buffer); /** * Return a buffer to the stream after use by the HAL. * * This method may only be called for buffers provided by getBuffer(). * For bidirectional streams, this method applies to the input-side buffers */ status_t returnInputBuffer(const camera3_stream_buffer &buffer); /** * Whether any of the stream's buffers are currently in use by the HAL, * including buffers that have been returned but not yet had their * release fence signaled. */ bool hasOutstandingBuffers() const; enum { TIMEOUT_NEVER = -1 }; /** * Set the status tracker to notify about idle transitions */ virtual status_t setStatusTracker(sp<StatusTracker> statusTracker); /** * Disconnect stream from its non-HAL endpoint. After this, * start/finishConfiguration must be called before the stream can be used * again. This cannot be called if the stream has outstanding dequeued * buffers. */ status_t disconnect(); /** * Debug dump of the stream's state. */ virtual void dump(int fd, const Vector<String16> &args) const = 0; /** * Add a camera3 buffer listener. Adding the same listener twice has * no effect. */ void addBufferListener( wp<Camera3StreamBufferListener> listener); /** * Remove a camera3 buffer listener. Removing the same listener twice * or the listener that was never added has no effect. */ void removeBufferListener( const sp<Camera3StreamBufferListener>& listener); protected: const int mId; const String8 mName; // Zero for formats with fixed buffer size for given dimensions. const size_t mMaxSize; enum { STATE_ERROR, STATE_CONSTRUCTED, STATE_IN_CONFIG, STATE_IN_RECONFIG, STATE_CONFIGURED } mState; mutable Mutex mLock; Camera3Stream(int id, camera3_stream_type type, uint32_t width, uint32_t height, size_t maxSize, int format); /** * Interface to be implemented by derived classes */ // getBuffer / returnBuffer implementations // Since camera3_stream_buffer includes a raw pointer to the stream, // cast to camera3_stream*, implementations must increment the // refcount of the stream manually in getBufferLocked, and decrement it in // returnBufferLocked. virtual status_t getBufferLocked(camera3_stream_buffer *buffer); virtual status_t returnBufferLocked(const camera3_stream_buffer &buffer, nsecs_t timestamp); virtual status_t getInputBufferLocked(camera3_stream_buffer *buffer); virtual status_t returnInputBufferLocked( const camera3_stream_buffer &buffer); virtual bool hasOutstandingBuffersLocked() const = 0; // Can return -ENOTCONN when we are already disconnected (not an error) virtual status_t disconnectLocked() = 0; // Configure the buffer queue interface to the other end of the stream, // after the HAL has provided usage and max_buffers values. After this call, // the stream must be ready to produce all buffers for registration with // HAL. virtual status_t configureQueueLocked() = 0; // Get the total number of buffers in the queue virtual size_t getBufferCountLocked() = 0; // Get handout output buffer count. virtual size_t getHandoutOutputBufferCountLocked() = 0; // Get handout input buffer count. virtual size_t getHandoutInputBufferCountLocked() = 0; // Get the usage flags for the other endpoint, or return // INVALID_OPERATION if they cannot be obtained. virtual status_t getEndpointUsage(uint32_t *usage) = 0; // Tracking for idle state wp<StatusTracker> mStatusTracker; // Status tracker component ID int mStatusId; private: uint32_t oldUsage; uint32_t oldMaxBuffers; Condition mOutputBufferReturnedSignal; Condition mInputBufferReturnedSignal; static const nsecs_t kWaitForBufferDuration = 3000000000LL; // 3000 ms // Gets all buffers from endpoint and registers them with the HAL. status_t registerBuffersLocked(camera3_device *hal3Device); void fireBufferListenersLocked(const camera3_stream_buffer& buffer, bool acquired, bool output); List<wp<Camera3StreamBufferListener> > mBufferListenerList; }; // class Camera3Stream }; // namespace camera3 }; // namespace android #endif
35.784431
83
0.68658
[ "vector" ]
d0e3d5adb0187e415d094fb275e6b522fbe048fa
3,165
h
C
src/dawn_wire/client/Client.h
jhanssen/dawn
73668344d656e4bad2f6a1dd75c85ffae1e56973
[ "Apache-2.0" ]
1
2021-03-29T02:42:47.000Z
2021-03-29T02:42:47.000Z
src/dawn_wire/client/Client.h
jhanssen/dawn
73668344d656e4bad2f6a1dd75c85ffae1e56973
[ "Apache-2.0" ]
null
null
null
src/dawn_wire/client/Client.h
jhanssen/dawn
73668344d656e4bad2f6a1dd75c85ffae1e56973
[ "Apache-2.0" ]
null
null
null
// Copyright 2019 The Dawn 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 DAWNWIRE_CLIENT_CLIENT_H_ #define DAWNWIRE_CLIENT_CLIENT_H_ #include <dawn/webgpu.h> #include <dawn_wire/Wire.h> #include "common/LinkedList.h" #include "dawn_wire/ChunkedCommandSerializer.h" #include "dawn_wire/WireClient.h" #include "dawn_wire/WireCmd_autogen.h" #include "dawn_wire/WireDeserializeAllocator.h" #include "dawn_wire/client/ClientBase_autogen.h" namespace dawn_wire { namespace client { class Device; class MemoryTransferService; class Client : public ClientBase { public: Client(CommandSerializer* serializer, MemoryTransferService* memoryTransferService); ~Client() override; // ChunkedCommandHandler implementation const volatile char* HandleCommandsImpl(const volatile char* commands, size_t size) override; WGPUDevice GetDevice(); MemoryTransferService* GetMemoryTransferService() const { return mMemoryTransferService; } ReservedTexture ReserveTexture(WGPUDevice device); ReservedDevice ReserveDevice(); void ReclaimTextureReservation(const ReservedTexture& reservation); void ReclaimDeviceReservation(const ReservedDevice& reservation); template <typename Cmd> void SerializeCommand(const Cmd& cmd) { mSerializer.SerializeCommand(cmd, *this); } template <typename Cmd, typename ExtraSizeSerializeFn> void SerializeCommand(const Cmd& cmd, size_t extraSize, ExtraSizeSerializeFn&& SerializeExtraSize) { mSerializer.SerializeCommand(cmd, *this, extraSize, SerializeExtraSize); } void Disconnect(); bool IsDisconnected() const; template <typename T> void TrackObject(T* object) { mObjects[ObjectTypeToTypeEnum<T>::value].Append(object); } private: void DestroyAllObjects(); #include "dawn_wire/client/ClientPrototypes_autogen.inc" Device* mDevice = nullptr; ChunkedCommandSerializer mSerializer; WireDeserializeAllocator mAllocator; MemoryTransferService* mMemoryTransferService = nullptr; std::unique_ptr<MemoryTransferService> mOwnedMemoryTransferService = nullptr; PerObjectType<LinkedList<ObjectBase>> mObjects; bool mDisconnected = false; }; std::unique_ptr<MemoryTransferService> CreateInlineMemoryTransferService(); }} // namespace dawn_wire::client #endif // DAWNWIRE_CLIENT_CLIENT_H_
33.670213
92
0.69763
[ "object" ]
d0e4a09b58d612c2fb7d0b7104b41f19253e120b
3,592
c
C
code/graphics.c
sinf/aircraftgame
3c52dc663e123ba1d98c79a4dca376db1efdaa3b
[ "MIT" ]
null
null
null
code/graphics.c
sinf/aircraftgame
3c52dc663e123ba1d98c79a4dca376db1efdaa3b
[ "MIT" ]
null
null
null
code/graphics.c
sinf/aircraftgame
3c52dc663e123ba1d98c79a4dca376db1efdaa3b
[ "MIT" ]
null
null
null
#include <stdlib.h> #include "system.h" #include "support.h" #include "game.h" #include "graphics.h" #include "models.h" #include "lowgfx.h" /* You can see this many game units horizontally on the screen */ #define HORZ_VISION_RANGE 90.0f #define VERT_VISION_RANGE (HORZ_VISION_RANGE/P_SCREEN_RATIO) /* Size of the biggest game object. This value is used for occlusion culling */ #define LARGEST_OBJECT_RADIUS 10.0 #define ENABLE_BLEND 1 #define ENABLE_WIREFRAME 1 #define ENABLE_GRID ENABLE_WIREFRAME static Real clip_test_x0 = 0; static Real clip_test_x1 = 0; static int object_is_visible( Real x ) { return ( clip_test_x0 <= x ) && ( x < clip_test_x1 ); } const float COMMON_MATRICES[2][16] = { {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, /* The projection matrix is pre-scaled so that values of type Real can be passed to GL without translating/scaling */ #define COORD_SCALE ( 1.0f / (1<<REAL_FRACT_BITS) ) #define P_SCREEN_RATIO ((float)SCREEN_H/(float)SCREEN_W) #define P_RIGHT (HORZ_VISION_RANGE/2.0) #define P_LEFT (-P_RIGHT) #define P_BOTTOM ( P_SCREEN_RATIO * HORZ_VISION_RANGE / 2.0 ) #define P_TOP (-P_BOTTOM) #define P_NEAR -128.0 #define P_FAR 128.0 /* Le orthographic projection matrix: */ {2.0 / ( P_RIGHT - P_LEFT ) * COORD_SCALE, 0, 0, 0, 0, 2.0 / ( P_TOP - P_BOTTOM ) * COORD_SCALE, 0, 0, 0, 0, -1.0 / ( P_FAR - P_NEAR ) * COORD_SCALE, 0, -( P_RIGHT + P_LEFT ) / ( P_RIGHT - P_LEFT ), -( P_TOP + P_BOTTOM ) / ( P_TOP - P_BOTTOM ), -P_NEAR / ( P_FAR - P_NEAR ), 1} }; /* 128 -> 6.5 */ void generate_clouds( void ); void setup2D( void ) { unpack_models(); generate_clouds(); } static GfxBlob get_particle_blob( Thing *thing ) { static const Real PARTICLE_SIZE[] = { REALF(0.5), REALF(0.5), /* water1 */ REALF(2), REALF(1), /* water2*/ REALF(1), REALF(1), /* smoke (size should be random) */ }; ParticleType type = thing->data.pt.type; U8 g, a; Real w, h; GfxBlob blob; /* 8-bit grayscale values for particles: 0xf4 ... water1 0xf4 ... water2 0x32 ... smoke */ g = 0x32f4f4 >> ( type << 3 ); #if ENABLE_BLEND /* Fade out */ a = 0xFF - ( thing->age << 8 ) / ( REALF( MAX_PARTICLE_TIME ) + 1 ); #else a = g; #endif w = PARTICLE_SIZE[type << 1]; h = PARTICLE_SIZE[(type << 1) + 1]; blob.mode = BLOB_SHARP; blob.color = RGBA_32( g, g, g, a ); blob.x = thing->phys.pos.x; blob.y = thing->phys.pos.y; blob.scale_x = w; blob.scale_y = h; if ( type == PT_SMOKE ) { blob.scale_y = blob.scale_x = \ REALF( 1.0 ) + REALF( 0.75 ) * thing->age / (unsigned)( MAX_PARTICLE_TIME * GAME_TICKS_PER_SEC ); blob.mode = BLOB_FUZZY; } return blob; } static void draw_water( void ) { const U32 c_surf = RGBA_32( 0, 0, 255, 80 ); const U32 c_bottom = RGBA_32( 0, 0, 32, 255 ); const Water *w = &WORLD.water; GfxVertex *verts; unsigned begin, end, n; unsigned num_cells, num_verts; S32 offset_y = REALF( W_WATER_LEVEL ); S32 bottom = REALF( W_WATER_LEVEL + W_WATER_DEPTH ); S32 pos_x; begin = MAX( WATER_CELL_AT_X( clip_test_x0 ), 0 ); end = WATER_CELL_AT_X( clip_test_x1 ); num_cells = ( end - begin + 1 ); num_verts = 2 * num_cells; verts = alloca( num_verts * sizeof(*verts) ); pos_x = begin * REALF( WATER_ELEM_SPACING ); for( n=0; n<num_cells; n++ ) { unsigned a = 2*n; unsigned b = a+1; verts[a].x = pos_x; verts[a].y = w->z[(begin+n)%WATER_RESOL] + offset_y; verts[a].color = c_surf; verts[b].x = pos_x; verts[b].y = bottom; verts[b].color = c_bottom; pos_x += REALF( WATER_ELEM_SPACING ); } //draw_triangle_strip( num_verts, verts ); }
24.27027
125
0.650891
[ "object" ]
d0e52559033176c9936fc49ada49d508fa18a95b
655
h
C
onnx/version_converter/helper.h
pchandrasekaran1595/onnx
10da6f2e919c8515877e227a41cd44e86ae0bb2d
[ "Apache-2.0" ]
12,820
2017-09-07T07:00:24.000Z
2022-03-31T14:41:57.000Z
onnx/version_converter/helper.h
pchandrasekaran1595/onnx
10da6f2e919c8515877e227a41cd44e86ae0bb2d
[ "Apache-2.0" ]
3,213
2017-09-07T17:48:17.000Z
2022-03-31T19:44:57.000Z
onnx/version_converter/helper.h
pchandrasekaran1595/onnx
10da6f2e919c8515877e227a41cd44e86ae0bb2d
[ "Apache-2.0" ]
2,922
2017-09-07T07:46:00.000Z
2022-03-31T15:55:24.000Z
/* * SPDX-License-Identifier: Apache-2.0 */ // Helper Methods for Adapters #pragma once #include "onnx/common/ir.h" namespace ONNX_NAMESPACE { namespace version_conversion { int check_numpy_unibroadcastable_and_require_broadcast( const std::vector<Dimension>& input1_sizes, const std::vector<Dimension>& input2_sizes); void assert_numpy_multibroadcastable(const std::vector<Dimension>& input1_sizes, const std::vector<Dimension>& input2_sizes); void assertNotParams(const std::vector<Dimension>& sizes); void assertInputsAvailable(const ArrayRef<Value*>& inputs, const char* name, uint64_t num_inputs); }}
28.478261
102
0.745038
[ "vector" ]
d0e5d7098fa75b6d5dff1f87a356e4fb405252a4
30,414
h
C
ThirdParty/MiniDDK/include/ntiologc.h
Vicshann/Common
f5f5145382ecac5e44459ad9fceb4bc281afd5df
[ "MIT" ]
4
2018-05-22T13:43:34.000Z
2021-12-21T08:33:59.000Z
ThirdParty/MiniDDK/include/ntiologc.h
Vicshann/Common
f5f5145382ecac5e44459ad9fceb4bc281afd5df
[ "MIT" ]
null
null
null
ThirdParty/MiniDDK/include/ntiologc.h
Vicshann/Common
f5f5145382ecac5e44459ad9fceb4bc281afd5df
[ "MIT" ]
3
2020-03-21T10:56:17.000Z
2021-12-24T11:31:10.000Z
/*++ BUILD Version: 0001 // Increment this if a change has global effects Copyright (c) 1991 Microsoft Corporation Module Name: ntiologc.h Abstract: Constant definitions for the I/O error code log values. Author: Jeff Havens (jhavens) 21-Aug-1991 Revision History: --*/ #ifndef _NTIOLOGC_ #define _NTIOLOGC_ // // Status values are 32 bit values layed out as follows: // // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 // +---+-+-------------------------+-------------------------------+ // |Sev|C| Facility | Code | // +---+-+-------------------------+-------------------------------+ // // where // // Sev - is the severity code // // 00 - Success // 01 - Informational // 10 - Warning // 11 - Error // // C - is the Customer code flag // // Facility - is the facility code // // Code - is the facility's status code // // // Values are 32 bit values layed out as follows: // // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 // +---+-+-+-----------------------+-------------------------------+ // |Sev|C|R| Facility | Code | // +---+-+-+-----------------------+-------------------------------+ // // where // // Sev - is the severity code // // 00 - Success // 01 - Informational // 10 - Warning // 11 - Error // // C - is the Customer code flag // // R - is a reserved bit // // Facility - is the facility code // // Code - is the facility's status code // // // Define the facility codes // #define FACILITY_RPC_STUBS 0x3 #define FACILITY_RPC_RUNTIME 0x2 #define FACILITY_MCA_ERROR_CODE 0x5 #define FACILITY_IO_ERROR_CODE 0x4 // // Define the severity codes // #define STATUS_SEVERITY_WARNING 0x2 #define STATUS_SEVERITY_SUCCESS 0x0 #define STATUS_SEVERITY_INFORMATIONAL 0x1 #define STATUS_SEVERITY_ERROR 0x3 // // MessageId: IO_ERR_RETRY_SUCCEEDED // // MessageText: // // A retry was successful on %1. // #define IO_ERR_RETRY_SUCCEEDED ((NTSTATUS)0x00040001L) // // MessageId: IO_ERR_INSUFFICIENT_RESOURCES // // MessageText: // // The driver could not allocate something necessary for the request for %1. // #define IO_ERR_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC0040002L) // // MessageId: IO_ERR_CONFIGURATION_ERROR // // MessageText: // // Driver or device is incorrectly configured for %1. // #define IO_ERR_CONFIGURATION_ERROR ((NTSTATUS)0xC0040003L) // // MessageId: IO_ERR_DRIVER_ERROR // // MessageText: // // Driver detected an internal error in its data structures for %1. // #define IO_ERR_DRIVER_ERROR ((NTSTATUS)0xC0040004L) // // MessageId: IO_ERR_PARITY // // MessageText: // // A parity error was detected on %1. // #define IO_ERR_PARITY ((NTSTATUS)0xC0040005L) // // MessageId: IO_ERR_SEEK_ERROR // // MessageText: // // The device, %1, had a seek error. // #define IO_ERR_SEEK_ERROR ((NTSTATUS)0xC0040006L) // // MessageId: IO_ERR_BAD_BLOCK // // MessageText: // // The device, %1, has a bad block. // #define IO_ERR_BAD_BLOCK ((NTSTATUS)0xC0040007L) // // MessageId: IO_ERR_OVERRUN_ERROR // // MessageText: // // An overrun occurred on %1. // #define IO_ERR_OVERRUN_ERROR ((NTSTATUS)0xC0040008L) // // MessageId: IO_ERR_TIMEOUT // // MessageText: // // The device, %1, did not respond within the timeout period. // #define IO_ERR_TIMEOUT ((NTSTATUS)0xC0040009L) // // MessageId: IO_ERR_SEQUENCE // // MessageText: // // The driver detected an unexpected sequence by the device, %1. // #define IO_ERR_SEQUENCE ((NTSTATUS)0xC004000AL) // // MessageId: IO_ERR_CONTROLLER_ERROR // // MessageText: // // The driver detected a controller error on %1. // #define IO_ERR_CONTROLLER_ERROR ((NTSTATUS)0xC004000BL) // // MessageId: IO_ERR_INTERNAL_ERROR // // MessageText: // // The driver detected an internal driver error on %1. // #define IO_ERR_INTERNAL_ERROR ((NTSTATUS)0xC004000CL) // // MessageId: IO_ERR_INCORRECT_IRQL // // MessageText: // // The driver was configured with an incorrect interrupt for %1. // #define IO_ERR_INCORRECT_IRQL ((NTSTATUS)0xC004000DL) // // MessageId: IO_ERR_INVALID_IOBASE // // MessageText: // // The driver was configured with an invalid I/O base address for %1. // #define IO_ERR_INVALID_IOBASE ((NTSTATUS)0xC004000EL) // // MessageId: IO_ERR_NOT_READY // // MessageText: // // The device, %1, is not ready for access yet. // #define IO_ERR_NOT_READY ((NTSTATUS)0xC004000FL) // // MessageId: IO_ERR_INVALID_REQUEST // // MessageText: // // The request is incorrectly formatted for %1. // #define IO_ERR_INVALID_REQUEST ((NTSTATUS)0xC0040010L) // // MessageId: IO_ERR_VERSION // // MessageText: // // The wrong version of the driver has been loaded. // #define IO_ERR_VERSION ((NTSTATUS)0xC0040011L) // // MessageId: IO_ERR_LAYERED_FAILURE // // MessageText: // // The driver beneath this one has failed in some way for %1. // #define IO_ERR_LAYERED_FAILURE ((NTSTATUS)0xC0040012L) // // MessageId: IO_ERR_RESET // // MessageText: // // The device, %1, has been reset. // #define IO_ERR_RESET ((NTSTATUS)0xC0040013L) // // MessageId: IO_ERR_PROTOCOL // // MessageText: // // A transport driver received a frame which violated the protocol. // #define IO_ERR_PROTOCOL ((NTSTATUS)0xC0040014L) // // MessageId: IO_ERR_MEMORY_CONFLICT_DETECTED // // MessageText: // // A conflict has been detected between two drivers which claimed two overlapping // memory regions. // Driver %2, with device <%3>, claimed a memory range with starting address // in data address 0x28 and 0x2c, and length in data address 0x30. // #define IO_ERR_MEMORY_CONFLICT_DETECTED ((NTSTATUS)0xC0040015L) // // MessageId: IO_ERR_PORT_CONFLICT_DETECTED // // MessageText: // // A conflict has been detected between two drivers which claimed two overlapping // Io port regions. // Driver %2, with device <%3>, claimed an IO port range with starting address // in data address 0x28 and 0x2c, and length in data address 0x30. // #define IO_ERR_PORT_CONFLICT_DETECTED ((NTSTATUS)0xC0040016L) // // MessageId: IO_ERR_DMA_CONFLICT_DETECTED // // MessageText: // // A conflict has been detected between two drivers which claimed equivalent DMA // channels. // Driver %2, with device <%3>, claimed the DMA Channel in data address 0x28, with // optinal port in data address 0x2c. // #define IO_ERR_DMA_CONFLICT_DETECTED ((NTSTATUS)0xC0040017L) // // MessageId: IO_ERR_IRQ_CONFLICT_DETECTED // // MessageText: // // A conflict has been detected between two drivers which claimed equivalent IRQs. // Driver %2, with device <%3>, claimed an interrupt with Level in data address // 0x28, vector in data address 0x2c and Affinity in data address 0x30. // #define IO_ERR_IRQ_CONFLICT_DETECTED ((NTSTATUS)0xC0040018L) // // MessageId: IO_ERR_BAD_FIRMWARE // // MessageText: // // The driver has detected a device with old or out-of-date firmware. The // device will not be used. // #define IO_ERR_BAD_FIRMWARE ((NTSTATUS)0xC0040019L) // // MessageId: IO_WRN_BAD_FIRMWARE // // MessageText: // // The driver has detected that device %1 has old or out-of-date firmware. // Reduced performance may result. // #define IO_WRN_BAD_FIRMWARE ((NTSTATUS)0x8004001AL) // // MessageId: IO_ERR_DMA_RESOURCE_CONFLICT // // MessageText: // // The device could not allocate one or more required resources due to conflicts // with other devices. The device DMA setting of '%2' could not be // satisified due to a conflict with Driver '%3'. // #define IO_ERR_DMA_RESOURCE_CONFLICT ((NTSTATUS)0xC004001BL) // // MessageId: IO_ERR_INTERRUPT_RESOURCE_CONFLICT // // MessageText: // // The device could not allocate one or more required resources due to conflicts // with other devices. The device interrupt setting of '%2' could not be // satisified due to a conflict with Driver '%3'. // #define IO_ERR_INTERRUPT_RESOURCE_CONFLICT ((NTSTATUS)0xC004001CL) // // MessageId: IO_ERR_MEMORY_RESOURCE_CONFLICT // // MessageText: // // The device could not allocate one or more required resources due to conflicts // with other devices. The device memory setting of '%2' could not be // satisified due to a conflict with Driver '%3'. // #define IO_ERR_MEMORY_RESOURCE_CONFLICT ((NTSTATUS)0xC004001DL) // // MessageId: IO_ERR_PORT_RESOURCE_CONFLICT // // MessageText: // // The device could not allocate one or more required resources due to conflicts // with other devices. The device port setting of '%2' could not be // satisified due to a conflict with Driver '%3'. // #define IO_ERR_PORT_RESOURCE_CONFLICT ((NTSTATUS)0xC004001EL) // // MessageId: IO_BAD_BLOCK_WITH_NAME // // MessageText: // // The file %2 on device %1 contains a bad disk block. // #define IO_BAD_BLOCK_WITH_NAME ((NTSTATUS)0xC004001FL) // // MessageId: IO_WRITE_CACHE_ENABLED // // MessageText: // // The driver detected that the device %1 has its write cache enabled. Data corruption // may occur. // #define IO_WRITE_CACHE_ENABLED ((NTSTATUS)0x80040020L) // // MessageId: IO_RECOVERED_VIA_ECC // // MessageText: // // Data was recovered using error correction code on device %1. // #define IO_RECOVERED_VIA_ECC ((NTSTATUS)0x80040021L) // // MessageId: IO_WRITE_CACHE_DISABLED // // MessageText: // // The driver disabled the write cache on device %1. // #define IO_WRITE_CACHE_DISABLED ((NTSTATUS)0x80040022L) // // MessageId: IO_FILE_QUOTA_THRESHOLD // // MessageText: // // A user hit their quota threshold on volume %2. // #define IO_FILE_QUOTA_THRESHOLD ((NTSTATUS)0x40040024L) // // MessageId: IO_FILE_QUOTA_LIMIT // // MessageText: // // A user hit their quota limit on volume %2. // #define IO_FILE_QUOTA_LIMIT ((NTSTATUS)0x40040025L) // // MessageId: IO_FILE_QUOTA_STARTED // // MessageText: // // The system has started rebuilding the user disk quota information on // device %1 with label "%2". // #define IO_FILE_QUOTA_STARTED ((NTSTATUS)0x40040026L) // // MessageId: IO_FILE_QUOTA_SUCCEEDED // // MessageText: // // The system has successfully rebuilt the user disk quota information on // device %1 with label "%2". // #define IO_FILE_QUOTA_SUCCEEDED ((NTSTATUS)0x40040027L) // // MessageId: IO_FILE_QUOTA_FAILED // // MessageText: // // The system has encounted an error rebuilding the user disk quota // information on device %1 with label "%2". // #define IO_FILE_QUOTA_FAILED ((NTSTATUS)0x80040028L) // // MessageId: IO_FILE_SYSTEM_CORRUPT // // MessageText: // // The file system structure on the disk is corrupt and unusable. // Please run the chkdsk utility on the device %1 with label "%2". // #define IO_FILE_SYSTEM_CORRUPT ((NTSTATUS)0xC0040029L) // // MessageId: IO_FILE_QUOTA_CORRUPT // // MessageText: // // The user disk quota information is unusable. // To ensure accuracy, the file system quota information on the device %1 with label "%2" will // be rebuilt. // #define IO_FILE_QUOTA_CORRUPT ((NTSTATUS)0xC004002AL) // // MessageId: IO_SYSTEM_SLEEP_FAILED // // MessageText: // // The system sleep operation failed // #define IO_SYSTEM_SLEEP_FAILED ((NTSTATUS)0xC004002BL) // // MessageId: IO_DUMP_POINTER_FAILURE // // MessageText: // // The system could not get file retrieval pointers for the dump file. // #define IO_DUMP_POINTER_FAILURE ((NTSTATUS)0xC004002CL) // // MessageId: IO_DUMP_DRIVER_LOAD_FAILURE // // MessageText: // // The system could not sucessfully load the crash dump driver. // #define IO_DUMP_DRIVER_LOAD_FAILURE ((NTSTATUS)0xC004002DL) // // MessageId: IO_DUMP_INITIALIZATION_FAILURE // // MessageText: // // Crash dump initialization failed! // #define IO_DUMP_INITIALIZATION_FAILURE ((NTSTATUS)0xC004002EL) // // MessageId: IO_DUMP_DUMPFILE_CONFLICT // // MessageText: // // A valid crash dump was found in the paging file while trying to configure // a direct dump. Direct dump is disabled! This occurs when the direct dump // option is set in the registry but a stop error occured before configuration // completed // #define IO_DUMP_DUMPFILE_CONFLICT ((NTSTATUS)0xC004002FL) // // MessageId: IO_DUMP_DIRECT_CONFIG_FAILED // // MessageText: // // Direct dump configuration failed. Validate the filename and make sure the target device // is not a Fault Tolerant set member, remote, or floppy device. The failure may // be because there is not enough room on the dump device to create the dump file. // #define IO_DUMP_DIRECT_CONFIG_FAILED ((NTSTATUS)0xC0040030L) // // MessageId: IO_DUMP_PAGE_CONFIG_FAILED // // MessageText: // // Configuring the Page file for crash dump failed. Make sure there is a page // file on the boot partition and that is large enough to contain all physical // memory. // #define IO_DUMP_PAGE_CONFIG_FAILED ((NTSTATUS)0xC0040031L) // // MessageId: IO_LOST_DELAYED_WRITE // // MessageText: // // {Delayed Write Failed} // Windows was unable to save all the data for the file %1. The data has been lost. // This error may be caused by a failure of your computer hardware or network connection. Please try to save this file elsewhere. // #define IO_LOST_DELAYED_WRITE ((NTSTATUS)0x80040032L) // // MessageId: IO_WARNING_PAGING_FAILURE // // MessageText: // // An error was detected on device %1 during a paging operation. // #define IO_WARNING_PAGING_FAILURE ((NTSTATUS)0x80040033L) // // MessageId: IO_WRN_FAILURE_PREDICTED // // MessageText: // // The driver has detected that device %1 has predicted that it will fail. // Immediately back up your data and replace your hard disk drive. A failure // may be imminent. // #define IO_WRN_FAILURE_PREDICTED ((NTSTATUS)0x80040034L) // // MessageId: IO_WARNING_INTERRUPT_STILL_PENDING // // MessageText: // // A pending interrupt was detected on device %1 during a timeout operation. A // large number of these warnings may indicate that the system is not correctly // receiving or processing interrupts from the device. // #define IO_WARNING_INTERRUPT_STILL_PENDING ((NTSTATUS)0x80040035L) // // MessageId: IO_DRIVER_CANCEL_TIMEOUT // // MessageText: // // An Io Request to the device %1 did not complete or canceled within the // specific timeout. This can occur if the device driver does not set a // cancel routine for a given IO request packet. // #define IO_DRIVER_CANCEL_TIMEOUT ((NTSTATUS)0x80040036L) // // MessageId: IO_FILE_SYSTEM_CORRUPT_WITH_NAME // // MessageText: // // The file system structure on the disk is corrupt and unusable. // Please run the chkdsk utility on the volume %2. // #define IO_FILE_SYSTEM_CORRUPT_WITH_NAME ((NTSTATUS)0xC0040037L) // // MessageId: IO_WARNING_ALLOCATION_FAILED // // MessageText: // // The driver failed to allocate memory. // #define IO_WARNING_ALLOCATION_FAILED ((NTSTATUS)0x80040038L) // // MessageId: IO_WARNING_LOG_FLUSH_FAILED // // MessageText: // // The system failed to flush data to the transaction log. Corruption may occur. // #define IO_WARNING_LOG_FLUSH_FAILED ((NTSTATUS)0x80040039L) // // MessageId: IO_WARNING_DUPLICATE_SIGNATURE // // MessageText: // // Changing the disk signature of disk %2 because it is equal to the disk // signature of disk %3. // #define IO_WARNING_DUPLICATE_SIGNATURE ((NTSTATUS)0x8004003AL) // // MessageId: IO_WARNING_DUPLICATE_PATH // // MessageText: // // Disk %2 will not be used because it is a redundant path for disk %3. // #define IO_WARNING_DUPLICATE_PATH ((NTSTATUS)0x8004003BL) // // MessageId: MCA_WARNING_CACHE // // MessageText: // // Machine Check Event reported is a corrected level %3 Cache error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_CACHE ((NTSTATUS)0x8005003CL) // // MessageId: MCA_ERROR_CACHE // // MessageText: // // Machine Check Event reported is a fatal level %3 Cache error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_CACHE ((NTSTATUS)0xC005003DL) // // MessageId: MCA_WARNING_TLB // // MessageText: // // Machine Check Event reported is a corrected level %3 translation Buffer error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_TLB ((NTSTATUS)0x8005003EL) // // MessageId: MCA_ERROR_TLB // // MessageText: // // Machine Check Event reported is a fatal level %3 translation Buffer error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_TLB ((NTSTATUS)0xC005003FL) // // MessageId: MCA_WARNING_CPU_BUS // // MessageText: // // Machine Check Event reported is a corrected External/Internal bus error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_CPU_BUS ((NTSTATUS)0x80050040L) // // MessageId: MCA_ERROR_CPU_BUS // // MessageText: // // Machine Check Event reported is a fatal External/Internal bus error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_CPU_BUS ((NTSTATUS)0xC0050041L) // // MessageId: MCA_WARNING_REGISTER_FILE // // MessageText: // // Machine Check Event reported is a corrected internal CPU register access error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_REGISTER_FILE ((NTSTATUS)0x80050042L) // // MessageId: MCA_ERROR_REGISTER_FILE // // MessageText: // // Machine Check Event reported is a fatal internal CPU register access error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_REGISTER_FILE ((NTSTATUS)0xC0050043L) // // MessageId: MCA_WARNING_MAS // // MessageText: // // Machine Check Event reported is a corrected Micro Architecture Structure error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_MAS ((NTSTATUS)0x80050044L) // // MessageId: MCA_ERROR_MAS // // MessageText: // // Machine Check Event reported is a fatal Micro Architecture Structure error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_MAS ((NTSTATUS)0xC0050045L) // // MessageId: MCA_WARNING_MEM_UNKNOWN // // MessageText: // // Machine Check Event reported is a corrected ECC memory error at an unknown physical address reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_MEM_UNKNOWN ((NTSTATUS)0x80050046L) // // MessageId: MCA_ERROR_MEM_UNKNOWN // // MessageText: // // Machine Check Event reported is a fatal ECC memory error at an unknown physical address reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_MEM_UNKNOWN ((NTSTATUS)0xC0050047L) // // MessageId: MCA_WARNING_MEM_1_2 // // MessageText: // // Machine Check Event reported is a corrected ECC memory error at physical address %3 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_MEM_1_2 ((NTSTATUS)0x80050048L) // // MessageId: MCA_ERROR_MEM_1_2 // // MessageText: // // Machine Check Event reported is a fatal ECC memory error at physical address %3 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_MEM_1_2 ((NTSTATUS)0xC0050049L) // // MessageId: MCA_WARNING_MEM_1_2_5 // // MessageText: // // Machine Check Event reported is a corrected ECC memory error at physical address %3 on memory module %4 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_MEM_1_2_5 ((NTSTATUS)0x8005004AL) // // MessageId: MCA_ERROR_MEM_1_2_5 // // MessageText: // // Machine Check Event reported is a fatal ECC memory error at physical address %3 on memory module %4 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_MEM_1_2_5 ((NTSTATUS)0xC005004BL) // // MessageId: MCA_WARNING_MEM_1_2_5_4 // // MessageText: // // Machine Check Event reported is a corrected ECC memory error at physical address %3 on memory module %4 on memory card %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_MEM_1_2_5_4 ((NTSTATUS)0x8005004CL) // // MessageId: MCA_ERROR_MEM_1_2_5_4 // // MessageText: // // Machine Check Event reported is a fatal ECC memory error at physical address %3 on memory module %4 on memory card %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_MEM_1_2_5_4 ((NTSTATUS)0xC005004DL) // // MessageId: MCA_WARNING_SYSTEM_EVENT // // MessageText: // // Machine Check Event reported is a corrected System Event error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_SYSTEM_EVENT ((NTSTATUS)0x8005004EL) // // MessageId: MCA_ERROR_SYSTEM_EVENT // // MessageText: // // Machine Check Event reported is a fatal System Event error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_SYSTEM_EVENT ((NTSTATUS)0xC005004FL) // // MessageId: MCA_WARNING_PCI_BUS_PARITY // // MessageText: // // Machine Check Event reported is a corrected PCI bus Parity error during a transaction type %3 at address %4 on PCI bus %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_PARITY ((NTSTATUS)0x80050050L) // // MessageId: MCA_ERROR_PCI_BUS_PARITY // // MessageText: // // Machine Check Event reported is a fatal PCI bus Parity error during a transaction type %3 at address %4 on PCI bus %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_PARITY ((NTSTATUS)0xC0050051L) // // MessageId: MCA_WARNING_PCI_BUS_PARITY_NO_INFO // // MessageText: // // Machine Check Event reported is a corrected PCI bus Parity error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_PARITY_NO_INFO ((NTSTATUS)0x80050052L) // // MessageId: MCA_ERROR_PCI_BUS_PARITY_NO_INFO // // MessageText: // // Machine Check Event reported is a fatal PCI bus Parity error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_PARITY_NO_INFO ((NTSTATUS)0xC0050053L) // // MessageId: MCA_WARNING_PCI_BUS_SERR // // MessageText: // // Machine Check Event reported is a corrected PCI bus SERR error during a transaction type %3 at address %4 on PCI bus %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_SERR ((NTSTATUS)0x80050054L) // // MessageId: MCA_ERROR_PCI_BUS_SERR // // MessageText: // // Machine Check Event reported is a fatal PCI bus SERR error during a transaction type %3 at address %4 on PCI bus %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_SERR ((NTSTATUS)0xC0050055L) // // MessageId: MCA_WARNING_PCI_BUS_SERR_NO_INFO // // MessageText: // // Machine Check Event reported is a corrected PCI bus SERR error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_SERR_NO_INFO ((NTSTATUS)0x80050056L) // // MessageId: MCA_ERROR_PCI_BUS_SERR_NO_INFO // // MessageText: // // Machine Check Event reported is a fatal PCI bus SERR error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_SERR_NO_INFO ((NTSTATUS)0xC0050057L) // // MessageId: MCA_WARNING_PCI_BUS_MASTER_ABORT // // MessageText: // // Machine Check Event reported is a corrected PCI bus Master abort error during a transaction type %3 at address %4 on PCI bus %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_MASTER_ABORT ((NTSTATUS)0x80050058L) // // MessageId: MCA_ERROR_PCI_BUS_MASTER_ABORT // // MessageText: // // Machine Check Event reported is a fatal PCI bus Master abort error during a transaction type %3 at address %4 on PCI bus %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_MASTER_ABORT ((NTSTATUS)0xC0050059L) // // MessageId: MCA_WARNING_PCI_BUS_MASTER_ABORT_NO_INFO // // MessageText: // // Machine Check Event reported is a corrected PCI bus Master abort error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_MASTER_ABORT_NO_INFO ((NTSTATUS)0x8005005AL) // // MessageId: MCA_ERROR_PCI_BUS_MASTER_ABORT_NO_INFO // // MessageText: // // Machine Check Event reported is a fatal PCI bus Master abort error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_MASTER_ABORT_NO_INFO ((NTSTATUS)0xC005005BL) // // MessageId: MCA_WARNING_PCI_BUS_TIMEOUT // // MessageText: // // Machine Check Event reported is a corrected PCI bus Timeout error during a transaction type %3 at address %4 on PCI bus %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_TIMEOUT ((NTSTATUS)0x8005005CL) // // MessageId: MCA_ERROR_PCI_BUS_TIMEOUT // // MessageText: // // Machine Check Event reported is a fatal PCI bus Timeout error during a transaction type %3 at address %4 on PCI bus %5 reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_TIMEOUT ((NTSTATUS)0xC005005DL) // // MessageId: MCA_WARNING_PCI_BUS_TIMEOUT_NO_INFO // // MessageText: // // Machine Check Event reported is a corrected PCI bus Timeout error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_TIMEOUT_NO_INFO ((NTSTATUS)0x8005005EL) // // MessageId: MCA_ERROR_PCI_BUS_TIMEOUT_NO_INFO // // MessageText: // // Machine Check Event reported is a fatal PCI bus Timeout error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_TIMEOUT_NO_INFO ((NTSTATUS)0xC005005FL) // // MessageId: MCA_WARNING_PCI_BUS_UNKNOWN // // MessageText: // // Machine Check Event reported is an unknown corrected PCI bus error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_BUS_UNKNOWN ((NTSTATUS)0x80050060L) // // MessageId: MCA_ERROR_PCI_BUS_UNKNOWN // // MessageText: // // Machine Check Event reported is an unknown fatal PCI bus error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_BUS_UNKNOWN ((NTSTATUS)0xC0050061L) // // MessageId: MCA_WARNING_PCI_DEVICE // // MessageText: // // Machine Check Event reported is a corrected PCI component error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PCI_DEVICE ((NTSTATUS)0x80050062L) // // MessageId: MCA_ERROR_PCI_DEVICE // // MessageText: // // Machine Check Event reported is a fatal PCI component error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PCI_DEVICE ((NTSTATUS)0xC0050063L) // // MessageId: MCA_WARNING_SMBIOS // // MessageText: // // Machine Check Event reported is a corrected SMBIOS Device Type %3 error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_SMBIOS ((NTSTATUS)0x80050064L) // // MessageId: MCA_ERROR_SMBIOS // // MessageText: // // Machine Check Event reported is a fatal SMBIOS Device Type %3 error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_SMBIOS ((NTSTATUS)0xC0050065L) // // MessageId: MCA_WARNING_PLATFORM_SPECIFIC // // MessageText: // // Machine Check Event reported is a corrected Platform Specific error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_WARNING_PLATFORM_SPECIFIC ((NTSTATUS)0x80050066L) // // MessageId: MCA_ERROR_PLATFORM_SPECIFIC // // MessageText: // // Machine Check Event reported is a fatal Platform Specific error reported to CPU %1. %2 additional error(s) are contained within the record. // #define MCA_ERROR_PLATFORM_SPECIFIC ((NTSTATUS)0xC0050067L) // // MessageId: MCA_WARNING_UNKNOWN // // MessageText: // // Machine Check Event reported is a non compliant corrected error reported to CPU %1. // #define MCA_WARNING_UNKNOWN ((NTSTATUS)0x80050068L) // // MessageId: MCA_ERROR_UNKNOWN // // MessageText: // // Machine Check Event reported is a non compliant fatal error reported to CPU %1. // #define MCA_ERROR_UNKNOWN ((NTSTATUS)0xC0050069L) // // MessageId: MCA_WARNING_UNKNOWN_NO_CPU // // MessageText: // // Machine Check Event reported is a non compliant corrected error. // #define MCA_WARNING_UNKNOWN_NO_CPU ((NTSTATUS)0x8005006AL) // // MessageId: MCA_ERROR_UNKNOWN_NO_CPU // // MessageText: // // Machine Check Event reported is a non compliant fatal error. // #define MCA_ERROR_UNKNOWN_NO_CPU ((NTSTATUS)0xC005006BL) // // MessageId: IO_ERR_THREAD_STUCK_IN_DEVICE_DRIVER // // MessageText: // // The driver %3 for the %2 device %1 got stuck in an infinite loop. This // usually indicates a problem with the device itself or with the device // driver programming the hardware incorrectly. Please check with your // hardware device vendor for any driver updates. // #define IO_ERR_THREAD_STUCK_IN_DEVICE_DRIVER ((NTSTATUS)0xC004006CL) #endif /* _NTIOLOGC_ */
27.499096
207
0.706747
[ "vector" ]
d0eda209538e52b01c711ea1b320cc33658fce17
6,240
c
C
Chapter_6/VertexArrayObjects/VertexArrayObjects.c
176zane/opengles3-book
1bc2959c37f35399eff869c28182be1640c8a2fb
[ "MIT" ]
null
null
null
Chapter_6/VertexArrayObjects/VertexArrayObjects.c
176zane/opengles3-book
1bc2959c37f35399eff869c28182be1640c8a2fb
[ "MIT" ]
null
null
null
Chapter_6/VertexArrayObjects/VertexArrayObjects.c
176zane/opengles3-book
1bc2959c37f35399eff869c28182be1640c8a2fb
[ "MIT" ]
null
null
null
// The MIT License (MIT) // // Copyright (c) 2013 Dan Ginsburg, Budirijanto Purnomo // // 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. // // Book: OpenGL(R) ES 3.0 Programming Guide, 2nd Edition // Authors: Dan Ginsburg, Budirijanto Purnomo, Dave Shreiner, Aaftab Munshi // ISBN-10: 0-321-93388-5 // ISBN-13: 978-0-321-93388-1 // Publisher: Addison-Wesley Professional // URLs: http://www.opengles-book.com // http://my.safaribooksonline.com/book/animation-and-3d/9780133440133 // // VertexArrayObjects.c // // This example demonstrates drawing a primitive with // Vertex Array Objects (VAOs) // #include "esUtil.h" typedef struct { // Handle to a program object GLuint programObject; // VertexBufferObject Ids GLuint vboIds[2]; // VertexArrayObject Id GLuint vaoId; } UserData; #define VERTEX_POS_SIZE 3 // x, y and z #define VERTEX_COLOR_SIZE 4 // r, g, b, and a #define VERTEX_POS_INDX 0 #define VERTEX_COLOR_INDX 1 #define VERTEX_STRIDE ( sizeof(GLfloat) * \ ( VERTEX_POS_SIZE + \ VERTEX_COLOR_SIZE ) ) int Init ( ESContext *esContext ) { UserData *userData = esContext->userData; const char vShaderStr[] = "#version 300 es \n" "layout(location = 0) in vec4 a_position; \n" "layout(location = 1) in vec4 a_color; \n" "out vec4 v_color; \n" "void main() \n" "{ \n" " v_color = a_color; \n" " gl_Position = a_position; \n" "}"; const char fShaderStr[] = "#version 300 es \n" "precision mediump float; \n" "in vec4 v_color; \n" "out vec4 o_fragColor; \n" "void main() \n" "{ \n" " o_fragColor = v_color; \n" "}" ; GLuint programObject; // 3 vertices, with (x,y,z) ,(r, g, b, a) per-vertex GLfloat vertices[3 * ( VERTEX_POS_SIZE + VERTEX_COLOR_SIZE )] = { 0.0f, 0.5f, 0.0f, // v0 1.0f, 0.0f, 0.0f, 1.0f, // c0 -0.5f, -0.5f, 0.0f, // v1 0.0f, 1.0f, 0.0f, 1.0f, // c1 0.5f, -0.5f, 0.0f, // v2 0.0f, 0.0f, 1.0f, 1.0f, // c2 }; // Index buffer data GLushort indices[3] = { 0, 1, 2 }; // Create the program object programObject = esLoadProgram ( vShaderStr, fShaderStr ); if ( programObject == 0 ) { return GL_FALSE; } // Store the program object userData->programObject = programObject; // Generate VBO Ids and load the VBOs with data glGenBuffers ( 2, userData->vboIds ); glBindBuffer ( GL_ARRAY_BUFFER, userData->vboIds[0] ); glBufferData ( GL_ARRAY_BUFFER, sizeof ( vertices ), vertices, GL_STATIC_DRAW ); glBindBuffer ( GL_ELEMENT_ARRAY_BUFFER, userData->vboIds[1] ); glBufferData ( GL_ELEMENT_ARRAY_BUFFER, sizeof ( indices ), indices, GL_STATIC_DRAW ); // Generate VAO Id,array指向一个n个元素的数组的指针,该数组是分配的顶点数组对象返回的位置 glGenVertexArrays ( 1, &userData->vaoId ); // Bind the VAO and then setup the vertex attributes //每个VAO都包含一个完整的状态向量,描述所有顶点缓冲区绑定和启用的顶点客户状态,绑定时,它的状态向量提供顶点缓冲区状态的当前设置,绑定后,修改顶点数组状态的后续调用将影响新的VAO glBindVertexArray ( userData->vaoId ); glBindBuffer ( GL_ARRAY_BUFFER, userData->vboIds[0] ); glBindBuffer ( GL_ELEMENT_ARRAY_BUFFER, userData->vboIds[1] ); glEnableVertexAttribArray ( VERTEX_POS_INDX ); glEnableVertexAttribArray ( VERTEX_COLOR_INDX ); glVertexAttribPointer ( VERTEX_POS_INDX, VERTEX_POS_SIZE, GL_FLOAT, GL_FALSE, VERTEX_STRIDE, ( const void * ) 0 ); glVertexAttribPointer ( VERTEX_COLOR_INDX, VERTEX_COLOR_SIZE, GL_FLOAT, GL_FALSE, VERTEX_STRIDE, ( const void * ) ( VERTEX_POS_SIZE * sizeof ( GLfloat ) ) ); // Reset to the default VAO glBindVertexArray ( 0 ); glClearColor ( 1.0f, 1.0f, 1.0f, 0.0f ); return GL_TRUE; } void Draw ( ESContext *esContext ) { UserData *userData = esContext->userData; glViewport ( 0, 0, esContext->width, esContext->height ); glClear ( GL_COLOR_BUFFER_BIT ); glUseProgram ( userData->programObject ); // Bind the VAO glBindVertexArray ( userData->vaoId ); // Draw with the VAO settings glDrawElements ( GL_TRIANGLES, 3, GL_UNSIGNED_SHORT, ( const void * ) 0 ); // Return to the default VAO glBindVertexArray ( 0 ); } void Shutdown ( ESContext *esContext ) { UserData *userData = esContext->userData; glDeleteProgram ( userData->programObject ); glDeleteBuffers ( 2, userData->vboIds ); glDeleteVertexArrays ( 1, &userData->vaoId ); } int esMain ( ESContext *esContext ) { esContext->userData = malloc ( sizeof ( UserData ) ); esCreateWindow ( esContext, "VertexArrayObjects", 320, 240, ES_WINDOW_RGB ); if ( !Init ( esContext ) ) { return GL_FALSE; } esRegisterShutdownFunc ( esContext, Shutdown ); esRegisterDrawFunc ( esContext, Draw ); return GL_TRUE; }
32
95
0.627564
[ "object", "3d" ]
d0eddf025ce8ffd4770b6eb8a2dda7f5b3087636
14,196
h
C
src/cascadia/TerminalSettingsEditor/Utils.h
NotWearingPants/terminal
37e8769b3706402706d62f19202554080796b3e3
[ "MIT" ]
4
2021-01-17T22:56:36.000Z
2021-08-29T16:28:33.000Z
src/cascadia/TerminalSettingsEditor/Utils.h
WilliamMajanja/terminal
fbd50af8afb2d0bcdd7b4a252515c6d7fe729e84
[ "MIT" ]
null
null
null
src/cascadia/TerminalSettingsEditor/Utils.h
WilliamMajanja/terminal
fbd50af8afb2d0bcdd7b4a252515c6d7fe729e84
[ "MIT" ]
1
2021-09-30T09:27:32.000Z
2021-09-30T09:27:32.000Z
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. #pragma once #include "../inc/cppwinrt_utils.h" // This macro must be used alongside GETSET_BINDABLE_ENUM_SETTING. // Use this in your class's constructor after Initialize_Component(). // It sorts and initializes the observable list of enum entries with the enum name // being its localized name, and also initializes the enum to EnumEntry // map that's required to tell XAML what enum value the currently active // setting has. #define INITIALIZE_BINDABLE_ENUM_SETTING(name, enumMappingsName, enumType, resourceSectionAndType, resourceProperty) \ do \ { \ std::vector<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry> name##List; \ _##name##Map = winrt::single_threaded_map<enumType, winrt::Microsoft::Terminal::Settings::Editor::EnumEntry>(); \ auto enumMapping##name = winrt::Microsoft::Terminal::Settings::Model::EnumMappings::enumMappingsName(); \ for (auto [key, value] : enumMapping##name) \ { \ auto enumName = LocalizedNameForEnumName(resourceSectionAndType, key, resourceProperty); \ auto entry = winrt::make<winrt::Microsoft::Terminal::Settings::Editor::implementation::EnumEntry>(enumName, winrt::box_value<enumType>(value)); \ name##List.emplace_back(entry); \ _##name##Map.Insert(value, entry); \ } \ std::sort(name##List.begin(), name##List.end(), EnumEntryComparator<enumType>()); \ _##name##List = winrt::single_threaded_observable_vector<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry>(std::move(name##List)); \ } while (0); #define INITIALIZE_BINDABLE_ENUM_SETTING_REVERSE_ORDER(name, enumMappingsName, enumType, resourceSectionAndType, resourceProperty) \ do \ { \ std::vector<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry> name##List; \ _##name##Map = winrt::single_threaded_map<enumType, winrt::Microsoft::Terminal::Settings::Editor::EnumEntry>(); \ auto enumMapping##name = winrt::Microsoft::Terminal::Settings::Model::EnumMappings::enumMappingsName(); \ for (auto [key, value] : enumMapping##name) \ { \ auto enumName = LocalizedNameForEnumName(resourceSectionAndType, key, resourceProperty); \ auto entry = winrt::make<winrt::Microsoft::Terminal::Settings::Editor::implementation::EnumEntry>(enumName, winrt::box_value<enumType>(value)); \ name##List.emplace_back(entry); \ _##name##Map.Insert(value, entry); \ } \ std::sort(name##List.begin(), name##List.end(), EnumEntryReverseComparator<enumType>()); \ _##name##List = winrt::single_threaded_observable_vector<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry>(std::move(name##List)); \ } while (0); // This macro must be used alongside INITIALIZE_BINDABLE_ENUM_SETTING. // It declares the needed data structures, getters, and setters to make // the given enum type bindable to XAML. It provides an observable list // of EnumEntries so that we may display all possible values of the given // enum type and its localized names. It also provides a getter and setter // for the setting we wish to bind to. #define GETSET_BINDABLE_ENUM_SETTING(name, enumType, settingsModelName, settingNameInModel) \ public: \ winrt::Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry> name##List() \ { \ return _##name##List; \ } \ \ winrt::Windows::Foundation::IInspectable Current##name() \ { \ return winrt::box_value<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry>(_##name##Map.Lookup(settingsModelName().settingNameInModel())); \ } \ \ void Current##name(const winrt::Windows::Foundation::IInspectable& enumEntry) \ { \ if (auto ee = enumEntry.try_as<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry>()) \ { \ auto setting = winrt::unbox_value<enumType>(ee.EnumValue()); \ settingsModelName().settingNameInModel(setting); \ } \ } \ \ private: \ winrt::Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry> _##name##List; \ winrt::Windows::Foundation::Collections::IMap<enumType, winrt::Microsoft::Terminal::Settings::Editor::EnumEntry> _##name##Map; // This macro defines a dependency property for a WinRT class. // Use this in your class' header file after declaring it in the idl. // Remember to register your dependency property in the respective cpp file. #define DEPENDENCY_PROPERTY(type, name) \ public: \ static winrt::Windows::UI::Xaml::DependencyProperty name##Property() \ { \ return _##name##Property; \ } \ type name() const \ { \ return winrt::unbox_value<type>(GetValue(_##name##Property)); \ } \ void name(type const& value) \ { \ SetValue(_##name##Property, winrt::box_value(value)); \ } \ \ private: \ static winrt::Windows::UI::Xaml::DependencyProperty _##name##Property; // Function Description: // - This function presents a File Open "common dialog" and returns its selected file asynchronously. // Parameters: // - customize: A lambda that receives an IFileDialog* to customize. // Return value: // (async) path to the selected item. template<typename TLambda> winrt::Windows::Foundation::IAsyncOperation<winrt::hstring> OpenFilePicker(HWND parentHwnd, TLambda&& customize) { auto fileDialog{ winrt::create_instance<IFileDialog>(CLSID_FileOpenDialog) }; DWORD flags{}; THROW_IF_FAILED(fileDialog->GetOptions(&flags)); THROW_IF_FAILED(fileDialog->SetOptions(flags | FOS_FORCEFILESYSTEM | FOS_NOCHANGEDIR | FOS_DONTADDTORECENT)); // filesystem objects only; no recent places customize(fileDialog.get()); auto hr{ fileDialog->Show(parentHwnd) }; if (!SUCCEEDED(hr)) { if (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED)) { co_return winrt::hstring{}; } THROW_HR(hr); } winrt::com_ptr<IShellItem> result; THROW_IF_FAILED(fileDialog->GetResult(result.put())); wil::unique_cotaskmem_string filePath; THROW_IF_FAILED(result->GetDisplayName(SIGDN_FILESYSPATH, &filePath)); co_return winrt::hstring{ filePath.get() }; } winrt::Windows::Foundation::IAsyncOperation<winrt::hstring> OpenImagePicker(HWND parentHwnd); namespace winrt::Microsoft::Terminal::Settings { winrt::hstring GetSelectedItemTag(winrt::Windows::Foundation::IInspectable const& comboBoxAsInspectable); winrt::hstring LocalizedNameForEnumName(const std::wstring_view sectionAndType, const std::wstring_view enumValue, const std::wstring_view propertyType); } // BODGY! // // The following function and struct are a workaround for GH#9320. // // DismissAllPopups can be used to dismiss all popups for a particular UI // element. However, we've got a bunch of pages with scroll viewers that may or // may not have popups in them. Rather than define the same exact body for all // their ViewChanging events, the HasScrollViewer struct will just do it for // you! inline void DismissAllPopups(winrt::Windows::UI::Xaml::XamlRoot const& xamlRoot) { const auto popups{ winrt::Windows::UI::Xaml::Media::VisualTreeHelper::GetOpenPopupsForXamlRoot(xamlRoot) }; for (const auto& p : popups) { p.IsOpen(false); } } template<typename T> struct HasScrollViewer { // When the ScrollViewer scrolls, dismiss any popups we might have. void ViewChanging(winrt::Windows::Foundation::IInspectable const& sender, const winrt::Windows::UI::Xaml::Controls::ScrollViewerViewChangingEventArgs& /*e*/) { // Inside this struct, we can't get at the XamlRoot() that our subclass // implements. I mean, _we_ can, but when XAML does it's code // generation, _XAML_ won't be able to figure it out. // // Fortunately for us, we don't need to! The sender is a UIElement, so // we can just get _their_ XamlRoot(). if (const auto& uielem{ sender.try_as<winrt::Windows::UI::Xaml::UIElement>() }) { DismissAllPopups(uielem.XamlRoot()); } } };
79.307263
159
0.405185
[ "vector", "model" ]
d0f05426b823fcefd622b618a7492693e38e53d3
19,726
c
C
apps/driver/usart/sync/usart_multi_instance/firmware/src/config/sam_e54_xpro_freertos/driver/usart/src/drv_usart.c
apapillon/core
f0a1fe8dbd292ff75dcc8e60dcd59ff67b165db1
[ "0BSD" ]
1
2020-03-10T07:27:17.000Z
2020-03-10T07:27:17.000Z
apps/driver/usart/sync/usart_multi_instance/firmware/src/config/sam_e54_xpro_freertos/driver/usart/src/drv_usart.c
apapillon/core
f0a1fe8dbd292ff75dcc8e60dcd59ff67b165db1
[ "0BSD" ]
null
null
null
apps/driver/usart/sync/usart_multi_instance/firmware/src/config/sam_e54_xpro_freertos/driver/usart/src/drv_usart.c
apapillon/core
f0a1fe8dbd292ff75dcc8e60dcd59ff67b165db1
[ "0BSD" ]
null
null
null
/******************************************************************************* USART Driver Implementation. Company: Microchip Technology Inc. File Name: drv_usart.c Summary: Source code for the USART driver dynamic implementation. Description: This file contains the source code for the dynamic implementation of the USART driver. *******************************************************************************/ //DOM-IGNORE-BEGIN /******************************************************************************* * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * responsibility to comply with third party license terms applicable to your * use of third party software (including open source software) that may * accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A * PARTICULAR PURPOSE. * * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. *******************************************************************************/ //DOM-IGNORE-END // ***************************************************************************** // ***************************************************************************** // Section: Included Files // ***************************************************************************** // ***************************************************************************** #include "configuration.h" #include "driver/usart/drv_usart.h" #include "drv_usart_local.h" // ***************************************************************************** // ***************************************************************************** // Section: Global Data // ***************************************************************************** // ***************************************************************************** /* This is the driver instance object array. */ static DRV_USART_OBJ gDrvUSARTObj[DRV_USART_INSTANCES_NUMBER] ; // ***************************************************************************** // ***************************************************************************** // Section: File scope functions // ***************************************************************************** // ***************************************************************************** static inline uint32_t _DRV_USART_MAKE_HANDLE(uint16_t token, uint8_t drvIndex, uint8_t clientIndex) { return ((token << 16) | (drvIndex << 8) | clientIndex); } static inline uint16_t _DRV_USART_UPDATE_TOKEN(uint16_t token) { token++; if (token >= DRV_USART_TOKEN_MAX) { token = 1; } return token; } static void _DRV_USART_TX_PLIB_CallbackHandler( uintptr_t context ) { DRV_USART_OBJ *dObj = (DRV_USART_OBJ *)context; dObj->txRequestStatus = DRV_USART_REQUEST_STATUS_COMPLETE; OSAL_SEM_PostISR(&dObj->txTransferDone); } static DRV_USART_ERROR _DRV_USART_GetErrorType(const uint32_t* remapError, uint32_t errorMask) { uint32_t i; DRV_USART_ERROR error = DRV_USART_ERROR_NONE; for (i = 0; i < 3; i++) { if (remapError[i] == errorMask) { error = (DRV_USART_ERROR)(i+1); break; } } return error; } static void _DRV_USART_RX_PLIB_CallbackHandler( uintptr_t context ) { DRV_USART_OBJ *dObj = (DRV_USART_OBJ *)context; DRV_USART_CLIENT_OBJ* clientObj = (DRV_USART_CLIENT_OBJ*)dObj->currentRxClient; uint32_t errorMask; errorMask = dObj->usartPlib->errorGet(); if(errorMask == (uint32_t) DRV_USART_ERROR_NONE) { clientObj->errors = DRV_USART_ERROR_NONE; dObj->rxRequestStatus = DRV_USART_REQUEST_STATUS_COMPLETE; } else { clientObj->errors = _DRV_USART_GetErrorType(dObj->remapError, errorMask); dObj->rxRequestStatus = DRV_USART_REQUEST_STATUS_ERROR; } OSAL_SEM_PostISR(&dObj->rxTransferDone); } static void _DRV_USART_TX_DMA_CallbackHandler(SYS_DMA_TRANSFER_EVENT event, uintptr_t context) { DRV_USART_OBJ *dObj = (DRV_USART_OBJ *)context; if(event == SYS_DMA_TRANSFER_COMPLETE) { dObj->txRequestStatus = DRV_USART_REQUEST_STATUS_COMPLETE; } else if(event == SYS_DMA_TRANSFER_ERROR) { dObj->txRequestStatus = DRV_USART_REQUEST_STATUS_ERROR; } OSAL_SEM_PostISR(&dObj->txTransferDone); } static void _DRV_USART_RX_DMA_CallbackHandler(SYS_DMA_TRANSFER_EVENT event, uintptr_t context) { DRV_USART_OBJ *dObj = (DRV_USART_OBJ *)context; if(event == SYS_DMA_TRANSFER_COMPLETE) { dObj->rxRequestStatus = DRV_USART_REQUEST_STATUS_COMPLETE; } else if(event == SYS_DMA_TRANSFER_ERROR) { dObj->rxRequestStatus = DRV_USART_REQUEST_STATUS_ERROR; } OSAL_SEM_PostISR(&dObj->rxTransferDone); } static DRV_USART_CLIENT_OBJ* _DRV_USART_DriverHandleValidate(DRV_HANDLE handle) { /* This function returns the pointer to the client object that is associated with this handle if the handle is valid. Returns NULL otherwise. */ uint32_t drvInstance = 0; DRV_USART_CLIENT_OBJ* clientObj = NULL; if((handle != DRV_HANDLE_INVALID) && (handle != 0)) { /* Extract the instance value from the handle */ drvInstance = ((handle & DRV_USART_INSTANCE_INDEX_MASK) >> 8); if (drvInstance >= DRV_USART_INSTANCES_NUMBER) { return (NULL); } if ((handle & DRV_USART_CLIENT_INDEX_MASK) >= gDrvUSARTObj[drvInstance].nClientsMax) { return (NULL); } clientObj = &((DRV_USART_CLIENT_OBJ *)gDrvUSARTObj[drvInstance].clientObjPool)[handle & DRV_USART_CLIENT_INDEX_MASK]; if ((handle != clientObj->clientHandle) || (clientObj->inUse == false)) { return (NULL); } } return(clientObj); } // ***************************************************************************** // ***************************************************************************** // Section: USART Driver Common Interface Implementation // ***************************************************************************** // ***************************************************************************** SYS_MODULE_OBJ DRV_USART_Initialize( const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT * const init ) { DRV_USART_OBJ *dObj = NULL; DRV_USART_INIT *usartInit = (DRV_USART_INIT *)init ; /* Validate the request */ if(drvIndex >= DRV_USART_INSTANCES_NUMBER) { //SYS_DEBUG(SYS_ERROR_ERROR, "Invalid driver instance"); return SYS_MODULE_OBJ_INVALID; } if(gDrvUSARTObj[drvIndex].inUse != false) { //SYS_DEBUG(SYS_ERROR_ERROR, "Instance already in use"); return SYS_MODULE_OBJ_INVALID; } /* Allocate the driver object */ dObj = &gDrvUSARTObj[drvIndex]; dObj->inUse = true; dObj->usartPlib = usartInit->usartPlib; dObj->clientObjPool = usartInit->clientObjPool; dObj->nClientsMax = usartInit->numClients; dObj->nClients = 0; dObj->currentRxClient = (uintptr_t)NULL; dObj->currentTxClient = (uintptr_t)NULL; dObj->isExclusive = false; dObj->usartTokenCount = 1; dObj->txDMAChannel = usartInit->dmaChannelTransmit; dObj->rxDMAChannel = usartInit->dmaChannelReceive; dObj->txAddress = usartInit->usartTransmitAddress; dObj->rxAddress = usartInit->usartReceiveAddress; dObj->remapDataWidth = usartInit->remapDataWidth; dObj->remapParity = usartInit->remapParity; dObj->remapStopBits = usartInit->remapStopBits; dObj->remapError = usartInit->remapError; if (OSAL_MUTEX_Create(&dObj->clientMutex) == OSAL_RESULT_FALSE) { /* If the mutex was not created because the memory required to hold the mutex could not be allocated then NULL is returned. */ return SYS_MODULE_OBJ_INVALID; } if (OSAL_MUTEX_Create(&dObj->txTransferMutex) == OSAL_RESULT_FALSE) { /* If the mutex was not created because the memory required to hold the mutex could not be allocated then NULL is returned. */ return SYS_MODULE_OBJ_INVALID; } if (OSAL_MUTEX_Create(&dObj->rxTransferMutex) == OSAL_RESULT_FALSE) { /* If the mutex was not created because the memory required to hold the mutex could not be allocated then NULL is returned. */ return SYS_MODULE_OBJ_INVALID; } if (OSAL_SEM_Create(&dObj->txTransferDone, OSAL_SEM_TYPE_BINARY, 0, 0) == OSAL_RESULT_FALSE) { /* There was insufficient memory available for the semaphore to be created successfully. */ return SYS_MODULE_OBJ_INVALID; } if (OSAL_SEM_Create(&dObj->rxTransferDone, OSAL_SEM_TYPE_BINARY, 0, 0) == OSAL_RESULT_FALSE) { /* There was insufficient memory available for the semaphore to be created successfully. */ return SYS_MODULE_OBJ_INVALID; } /* Register a callback with either DMA or USART PLIB based on configuration. * dObj is used as a context parameter, that will be used to distinguish the * events for different driver instances. */ if(dObj->txDMAChannel != SYS_DMA_CHANNEL_NONE) { SYS_DMA_ChannelCallbackRegister(dObj->txDMAChannel, _DRV_USART_TX_DMA_CallbackHandler, (uintptr_t)dObj); } else { dObj->usartPlib->writeCallbackRegister(_DRV_USART_TX_PLIB_CallbackHandler, (uintptr_t)dObj); (void)_DRV_USART_TX_DMA_CallbackHandler; } if(dObj->rxDMAChannel != SYS_DMA_CHANNEL_NONE) { SYS_DMA_ChannelCallbackRegister(dObj->rxDMAChannel, _DRV_USART_RX_DMA_CallbackHandler, (uintptr_t)dObj); } else { dObj->usartPlib->readCallbackRegister(_DRV_USART_RX_PLIB_CallbackHandler, (uintptr_t)dObj); (void)_DRV_USART_RX_DMA_CallbackHandler; } /* Update the status */ dObj->status = SYS_STATUS_READY; /* Return the object structure */ return ( (SYS_MODULE_OBJ)drvIndex ); } SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object) { /* Validate the request */ if( (object == SYS_MODULE_OBJ_INVALID) || (object >= DRV_USART_INSTANCES_NUMBER) ) { //SYS_DEBUG(SYS_ERROR_ERROR, "Invalid system object handle"); return SYS_STATUS_UNINITIALIZED; } return (gDrvUSARTObj[object].status); } DRV_HANDLE DRV_USART_Open( const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent ) { DRV_USART_OBJ *dObj = NULL; DRV_USART_CLIENT_OBJ *clientObj = NULL; uint32_t iClient; /* Validate the request */ if (drvIndex >= DRV_USART_INSTANCES_NUMBER) { //SYS_DEBUG(SYS_ERROR_ERROR, "Invalid Driver Instance"); return DRV_HANDLE_INVALID; } dObj = &gDrvUSARTObj[drvIndex]; if(dObj->status != SYS_STATUS_READY) { //SYS_DEBUG(SYS_ERROR_ERROR, "Was the driver initialized?"); return DRV_HANDLE_INVALID; } /* Acquire the instance specific mutex to protect the instance specific * client pool */ if (OSAL_MUTEX_Lock(&dObj->clientMutex , OSAL_WAIT_FOREVER ) == OSAL_RESULT_FALSE) { return DRV_HANDLE_INVALID; } if(dObj->isExclusive) { /* This means the another client has opened the driver in exclusive mode. The driver cannot be opened again */ OSAL_MUTEX_Unlock( &dObj->clientMutex); return DRV_HANDLE_INVALID; } if((dObj->nClients > 0) && (ioIntent & DRV_IO_INTENT_EXCLUSIVE)) { /* This means the driver was already opened and another driver was trying to open it exclusively. We cannot give exclusive access in this case */ OSAL_MUTEX_Unlock( &dObj->clientMutex); return(DRV_HANDLE_INVALID); } /* Enter here only if the lock was obtained */ for(iClient = 0; iClient != dObj->nClientsMax; iClient++) { if(false == ((DRV_USART_CLIENT_OBJ *)dObj->clientObjPool)[iClient].inUse) { /* This means we have a free client object to use */ clientObj = &((DRV_USART_CLIENT_OBJ *)dObj->clientObjPool)[iClient]; clientObj->inUse = true; clientObj->hDriver = dObj; clientObj->ioIntent = ioIntent; clientObj->errors = DRV_USART_ERROR_NONE; if(ioIntent & DRV_IO_INTENT_EXCLUSIVE) { /* Set the driver exclusive flag */ dObj->isExclusive = true; } dObj->nClients ++; /* Generate and save client handle in the client object, which will * be then used to verify the validity of the client handle. */ clientObj->clientHandle = _DRV_USART_MAKE_HANDLE(dObj->usartTokenCount, drvIndex, iClient); /* Increment the instance specific token counter */ dObj->usartTokenCount = _DRV_USART_UPDATE_TOKEN(dObj->usartTokenCount); break; } } OSAL_MUTEX_Unlock(&dObj->clientMutex); /* Driver index is the handle */ return clientObj ? ((DRV_HANDLE)clientObj->clientHandle) : DRV_HANDLE_INVALID; } bool DRV_USART_SerialSetup( const DRV_HANDLE handle, DRV_USART_SERIAL_SETUP* setup ) { DRV_USART_OBJ* dObj; DRV_USART_CLIENT_OBJ* clientObj; DRV_USART_SERIAL_SETUP setupRemap; bool isSuccess = false; /* Validate the request */ clientObj = _DRV_USART_DriverHandleValidate(handle); if ((clientObj != NULL) && (setup != NULL)) { dObj = (DRV_USART_OBJ *)clientObj->hDriver; setupRemap.dataWidth = (DRV_USART_DATA_BIT)dObj->remapDataWidth[setup->dataWidth]; setupRemap.parity = (DRV_USART_PARITY)dObj->remapParity[setup->parity]; setupRemap.stopBits = (DRV_USART_STOP_BIT)dObj->remapStopBits[setup->stopBits]; setupRemap.baudRate = setup->baudRate; if( (setupRemap.dataWidth != DRV_USART_DATA_BIT_INVALID) && (setupRemap.parity != DRV_USART_PARITY_INVALID) && (setupRemap.stopBits != DRV_USART_STOP_BIT_INVALID)) { /* Clock source cannot be modified dynamically, so passing the '0' to pick * the configured clock source value */ isSuccess = dObj->usartPlib->serialSetup(&setupRemap, 0); } } return isSuccess; } void DRV_USART_Close( DRV_HANDLE handle ) { DRV_USART_CLIENT_OBJ* clientObj; DRV_USART_OBJ* dObj; /* Validate the handle */ clientObj = _DRV_USART_DriverHandleValidate(handle); if(clientObj != NULL) { dObj = (DRV_USART_OBJ *)clientObj->hDriver; /* Acquire the instance specifc mutex to protect the instance specific * client pool */ if (OSAL_MUTEX_Lock(&dObj->clientMutex , OSAL_WAIT_FOREVER ) == OSAL_RESULT_TRUE) { /* Reduce the number of clients */ dObj->nClients --; /* Reset the exclusive flag */ dObj->isExclusive = false; /* De-allocate the object */ clientObj->inUse = false; /* Release the instance specific mutex */ OSAL_MUTEX_Unlock( &dObj->clientMutex ); } } } DRV_USART_ERROR DRV_USART_ErrorGet( const DRV_HANDLE handle ) { DRV_USART_CLIENT_OBJ* clientObj; DRV_USART_ERROR errors = DRV_USART_ERROR_NONE; /* Validate the handle */ clientObj = _DRV_USART_DriverHandleValidate(handle); if(clientObj != NULL) { errors = clientObj->errors; } return errors; } bool DRV_USART_WriteBuffer ( const DRV_HANDLE handle, void* buffer, const size_t numbytes ) { DRV_USART_CLIENT_OBJ* clientObj = (DRV_USART_CLIENT_OBJ *)NULL; DRV_USART_OBJ* dObj = NULL; bool isSuccess = false; /* Validate the driver handle */ clientObj = _DRV_USART_DriverHandleValidate(handle); if((clientObj != NULL) && (numbytes != 0) && (buffer != NULL)) { dObj = clientObj->hDriver; /* Obtain transmit mutex */ if (OSAL_MUTEX_Lock(&dObj->txTransferMutex, OSAL_WAIT_FOREVER) == OSAL_RESULT_TRUE) { /* Error is cleared for every new transfer */ clientObj->errors = DRV_USART_ERROR_NONE; dObj->currentTxClient = (uintptr_t)clientObj; if(dObj->txDMAChannel != SYS_DMA_CHANNEL_NONE) { SYS_DMA_ChannelTransfer( dObj->txDMAChannel, (const void *)buffer, (const void *)dObj->txAddress, numbytes ); } else { dObj->usartPlib->write(buffer, numbytes); } /* Wait for transfer to complete */ if (OSAL_SEM_Pend(&dObj->txTransferDone, OSAL_WAIT_FOREVER) == OSAL_RESULT_TRUE) { if (dObj->txRequestStatus == DRV_USART_REQUEST_STATUS_COMPLETE) { isSuccess = true; } } /* Release transmit mutex */ OSAL_MUTEX_Unlock(&dObj->txTransferMutex); } } return isSuccess; } bool DRV_USART_ReadBuffer ( const DRV_HANDLE handle, void* buffer, const size_t numbytes ) { DRV_USART_CLIENT_OBJ* clientObj = (DRV_USART_CLIENT_OBJ *)NULL; DRV_USART_OBJ* dObj = NULL; bool isSuccess = false; /* Validate the driver handle */ clientObj = _DRV_USART_DriverHandleValidate(handle); if((clientObj != NULL) && (numbytes != 0) && (buffer != NULL)) { dObj = clientObj->hDriver; /* Obtain receive mutex */ if (OSAL_MUTEX_Lock(&dObj->rxTransferMutex, OSAL_WAIT_FOREVER) == OSAL_RESULT_TRUE) { /* Error is cleared for every new transfer */ clientObj->errors = DRV_USART_ERROR_NONE; dObj->currentRxClient = (uintptr_t)clientObj; if(dObj->rxDMAChannel != SYS_DMA_CHANNEL_NONE) { SYS_DMA_ChannelTransfer( dObj->rxDMAChannel, (const void *)dObj->rxAddress, (const void *)buffer, numbytes ); } else { dObj->usartPlib->read(buffer, numbytes); } /* Wait for transfer to complete */ if (OSAL_SEM_Pend(&dObj->rxTransferDone, OSAL_WAIT_FOREVER) == OSAL_RESULT_TRUE) { /* Check and return status */ if (dObj->rxRequestStatus == DRV_USART_REQUEST_STATUS_COMPLETE) { isSuccess = true; } } /* Release receive mutex */ OSAL_MUTEX_Unlock(&dObj->rxTransferMutex); } } return isSuccess; }
33.097315
171
0.593075
[ "object" ]
d0f4ed3155df2638ef72b195f42b02399bdd1ff7
672
h
C
src/utils/SkMatrix22.h
llluiop/skia
0dd01ee5b5abc06935dced8430d5290c6ac3f958
[ "BSD-3-Clause" ]
1
2015-11-06T00:05:58.000Z
2015-11-06T00:05:58.000Z
src/utils/SkMatrix22.h
llluiop/skia
0dd01ee5b5abc06935dced8430d5290c6ac3f958
[ "BSD-3-Clause" ]
null
null
null
src/utils/SkMatrix22.h
llluiop/skia
0dd01ee5b5abc06935dced8430d5290c6ac3f958
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright 2014 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "SkPoint.h" class SkMatrix; /** Find the Givens matrix G, which is the rotational matrix * that rotates the vector h to the positive hoizontal axis. * G * h = [hypot(h), 0] * * This is equivalent to * * SkScalar r = h.length(); * SkScalar r_inv = r ? SkScalarInvert(r) : 0; * h.scale(r_inv); * G->setSinCos(-h.fY, h.fX); * * but has better numerical stability by using (partial) hypot, * and saves a multiply by not computing r. */ void SkComputeGivensRotation(const SkVector& h, SkMatrix* G);
24.888889
73
0.671131
[ "vector" ]
d0f7c562cf3c93f3cd1844b263dac3db4261415c
1,515
h
C
include/component/Renderer.h
FuriousProton/proton
1bb790932e730d119ad68266159a77ad93eeef99
[ "MIT" ]
null
null
null
include/component/Renderer.h
FuriousProton/proton
1bb790932e730d119ad68266159a77ad93eeef99
[ "MIT" ]
null
null
null
include/component/Renderer.h
FuriousProton/proton
1bb790932e730d119ad68266159a77ad93eeef99
[ "MIT" ]
null
null
null
// // Created by teeebor on 2017-10-25. // #pragma once #include "../utility.h" #include "../interface/Uniform.h" #include <map> #include "Component.h" #include <glm/gtc/type_ptr.hpp> #include <glbinding/gl/gl.h> namespace proton { class Shader; class Component; class IndexBuffer; class VertexArray; class Buffer; class Texture; class PROTON_API Renderer : public Component { private: Shader *mpShader; std::map<const char *, Uniform *> mUniforms; IndexBuffer *mpIndexBuffer; VertexArray *mpVertexArray; std::vector<Texture*> mpTextures; GLenum renderMode; public: explicit Renderer(const char *shader); ~Renderer(); void setModel(IndexBuffer *ibo, VertexArray *vao); void addBuffer(Buffer *buffer, unsigned short location); void setRendeMode(GLenum renderMode); void setTexture(Texture *texture, int index); int addTexture(Texture *texture); Shader *getShader() { return mpShader; } void calculateNormals(unsigned int *indices, int indexLen, float *vertex, int count); void set(const char *name, int v); void set(const char *name, float v); void set(const char *name, glm::vec2 &value); void set(const char *name, glm::vec3 &value); void set(const char *name, glm::vec4 &value); void set(const char *name, glm::mat4 &value); void render(); void loadData(); }; }
20.753425
93
0.623762
[ "render", "vector" ]
d0fa9f5c5659ba3366c73df3e3ba2345d0b15c2c
19,817
c
C
source/blender/python/mathutils/mathutils.c
juangea/B28_boneMaster
6be9d19951ed460829d379aa90953b14a9f281f2
[ "Naumen", "Condor-1.1", "MS-PL" ]
2
2019-06-03T02:47:42.000Z
2020-04-03T10:23:33.000Z
source/blender/python/mathutils/mathutils.c
juangea/B28_boneMaster
6be9d19951ed460829d379aa90953b14a9f281f2
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
source/blender/python/mathutils/mathutils.c
juangea/B28_boneMaster
6be9d19951ed460829d379aa90953b14a9f281f2
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
/* * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** \file * \ingroup pymathutils */ #include <Python.h> #include "mathutils.h" #include "BLI_math.h" #include "BLI_utildefines.h" #include "../generic/python_utildefines.h" #ifndef MATH_STANDALONE # include "BLI_dynstr.h" #endif PyDoc_STRVAR( M_Mathutils_doc, "This module provides access to math operations.\n" "\n" ".. note::\n" "\n" " Classes, methods and attributes that accept vectors also accept other numeric sequences,\n" " such as tuples, lists." "\n\n" "Submodules:\n" "\n" ".. toctree::\n" " :maxdepth: 1\n" "\n" " mathutils.geometry.rst\n" " mathutils.bvhtree.rst\n" " mathutils.kdtree.rst\n" " mathutils.interpolate.rst\n" " mathutils.noise.rst\n" "\n" "The :mod:`mathutils` module provides the following classes:\n" "\n" "- :class:`Color`,\n" "- :class:`Euler`,\n" "- :class:`Matrix`,\n" "- :class:`Quaternion`,\n" "- :class:`Vector`,\n"); static int mathutils_array_parse_fast(float *array, int size, PyObject *value_fast, const char *error_prefix) { PyObject *item; PyObject **value_fast_items = PySequence_Fast_ITEMS(value_fast); int i; i = size; do { i--; if (((array[i] = PyFloat_AsDouble((item = value_fast_items[i]))) == -1.0f) && PyErr_Occurred()) { PyErr_Format(PyExc_TypeError, "%.200s: sequence index %d expected a number, " "found '%.200s' type, ", error_prefix, i, Py_TYPE(item)->tp_name); size = -1; break; } } while (i); return size; } /** * helper function that returns a Python ``__hash__``. * * \note consistent with the equivalent tuple of floats (CPython's 'tuplehash') */ Py_hash_t mathutils_array_hash(const float *array, size_t array_len) { int i; Py_uhash_t x; /* Unsigned for defined overflow behavior. */ Py_hash_t y; Py_uhash_t mult; Py_ssize_t len; mult = _PyHASH_MULTIPLIER; len = array_len; x = 0x345678UL; i = 0; while (--len >= 0) { y = _Py_HashDouble((double)(array[i++])); if (y == -1) { return -1; } x = (x ^ y) * mult; /* the cast might truncate len; that doesn't change hash stability */ mult += (Py_hash_t)(82520UL + len + len); } x += 97531UL; if (x == (Py_uhash_t)-1) { x = -2; } return x; } /* helper function returns length of the 'value', -1 on error */ int mathutils_array_parse( float *array, int array_min, int array_max, PyObject *value, const char *error_prefix) { const unsigned int flag = array_max; int size; array_max &= ~MU_ARRAY_FLAGS; #if 1 /* approx 6x speedup for mathutils types */ if ((size = VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) || (size = EulerObject_Check(value) ? 3 : 0) || (size = QuaternionObject_Check(value) ? 4 : 0) || (size = ColorObject_Check(value) ? 3 : 0)) { if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } if (flag & MU_ARRAY_SPILL) { CLAMP_MAX(size, array_max); } if (size > array_max || size < array_min) { if (array_max == array_min) { PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected %d", error_prefix, size, array_max); } else { PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected [%d - %d]", error_prefix, size, array_min, array_max); } return -1; } memcpy(array, ((BaseMathObject *)value)->data, size * sizeof(float)); } else #endif { PyObject *value_fast = NULL; /* non list/tuple cases */ if (!(value_fast = PySequence_Fast(value, error_prefix))) { /* PySequence_Fast sets the error */ return -1; } size = PySequence_Fast_GET_SIZE(value_fast); if (flag & MU_ARRAY_SPILL) { CLAMP_MAX(size, array_max); } if (size > array_max || size < array_min) { if (array_max == array_min) { PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected %d", error_prefix, size, array_max); } else { PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected [%d - %d]", error_prefix, size, array_min, array_max); } Py_DECREF(value_fast); return -1; } size = mathutils_array_parse_fast(array, size, value_fast, error_prefix); Py_DECREF(value_fast); } if (size != -1) { if (flag & MU_ARRAY_ZERO) { int size_left = array_max - size; if (size_left) { memset(&array[size], 0, sizeof(float) * size_left); } } } return size; } /* on error, -1 is returned and no allocation is made */ int mathutils_array_parse_alloc(float **array, int array_min, PyObject *value, const char *error_prefix) { int size; #if 1 /* approx 6x speedup for mathutils types */ if ((size = VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) || (size = EulerObject_Check(value) ? 3 : 0) || (size = QuaternionObject_Check(value) ? 4 : 0) || (size = ColorObject_Check(value) ? 3 : 0)) { if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } if (size < array_min) { PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected > %d", error_prefix, size, array_min); return -1; } *array = PyMem_Malloc(size * sizeof(float)); memcpy(*array, ((BaseMathObject *)value)->data, size * sizeof(float)); return size; } else #endif { PyObject *value_fast = NULL; // *array = NULL; int ret; /* non list/tuple cases */ if (!(value_fast = PySequence_Fast(value, error_prefix))) { /* PySequence_Fast sets the error */ return -1; } size = PySequence_Fast_GET_SIZE(value_fast); if (size < array_min) { Py_DECREF(value_fast); PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected > %d", error_prefix, size, array_min); return -1; } *array = PyMem_Malloc(size * sizeof(float)); ret = mathutils_array_parse_fast(*array, size, value_fast, error_prefix); Py_DECREF(value_fast); if (ret == -1) { PyMem_Free(*array); } return ret; } } /* parse an array of vectors */ int mathutils_array_parse_alloc_v(float **array, int array_dim, PyObject *value, const char *error_prefix) { PyObject *value_fast; const int array_dim_flag = array_dim; int i, size; /* non list/tuple cases */ if (!(value_fast = PySequence_Fast(value, error_prefix))) { /* PySequence_Fast sets the error */ return -1; } size = PySequence_Fast_GET_SIZE(value_fast); if (size != 0) { PyObject **value_fast_items = PySequence_Fast_ITEMS(value_fast); float *fp; array_dim &= ~MU_ARRAY_FLAGS; fp = *array = PyMem_Malloc(size * array_dim * sizeof(float)); for (i = 0; i < size; i++, fp += array_dim) { PyObject *item = value_fast_items[i]; if (mathutils_array_parse(fp, array_dim, array_dim_flag, item, error_prefix) == -1) { PyMem_Free(*array); *array = NULL; size = -1; break; } } } Py_DECREF(value_fast); return size; } int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error_prefix) { if (EulerObject_Check(value)) { if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } else { eulO_to_mat3(rmat, ((EulerObject *)value)->eul, ((EulerObject *)value)->order); return 0; } } else if (QuaternionObject_Check(value)) { if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } else { float tquat[4]; normalize_qt_qt(tquat, ((QuaternionObject *)value)->quat); quat_to_mat3(rmat, tquat); return 0; } } else if (MatrixObject_Check(value)) { if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } else if (((MatrixObject *)value)->num_row < 3 || ((MatrixObject *)value)->num_col < 3) { PyErr_Format( PyExc_ValueError, "%.200s: matrix must have minimum 3x3 dimensions", error_prefix); return -1; } else { matrix_as_3x3(rmat, (MatrixObject *)value); normalize_m3(rmat); return 0; } } else { PyErr_Format(PyExc_TypeError, "%.200s: expected a Euler, Quaternion or Matrix type, " "found %.200s", error_prefix, Py_TYPE(value)->tp_name); return -1; } } /* ----------------------------------MATRIX FUNCTIONS-------------------- */ /* Utility functions */ /* LomontRRDCompare4, Ever Faster Float Comparisons by Randy Dillon */ /* XXX We may want to use 'safer' BLI's compare_ff_relative ultimately? * LomontRRDCompare4() is an optimized version of Dawson's AlmostEqual2sComplement() * (see [1] and [2]). * Dawson himself now claims this is not a 'safe' thing to do * (pushing ULP method beyond its limits), * an recommends using work from [3] instead, which is done in BLI func... * * [1] http://www.randydillon.org/Papers/2007/everfast.htm * [2] http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm * [3] https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ * instead. */ #define SIGNMASK(i) (-(int)(((unsigned int)(i)) >> 31)) int EXPP_FloatsAreEqual(float af, float bf, int maxDiff) { /* solid, fast routine across all platforms * with constant time behavior */ int ai = *(int *)(&af); int bi = *(int *)(&bf); int test = SIGNMASK(ai ^ bi); int diff, v1, v2; assert((0 == test) || (0xFFFFFFFF == test)); diff = (ai ^ (test & 0x7fffffff)) - bi; v1 = maxDiff + diff; v2 = maxDiff - diff; return (v1 | v2) >= 0; } /*---------------------- EXPP_VectorsAreEqual ------------------------- * Builds on EXPP_FloatsAreEqual to test vectors */ int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int floatSteps) { int x; for (x = 0; x < size; x++) { if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) { return 0; } } return 1; } #ifndef MATH_STANDALONE /* dynstr as python string utility functions, frees 'ds'! */ PyObject *mathutils_dynstr_to_py(struct DynStr *ds) { const int ds_len = BLI_dynstr_get_len(ds); /* space for \0 */ char *ds_buf = PyMem_Malloc(ds_len + 1); PyObject *ret; BLI_dynstr_get_cstring_ex(ds, ds_buf); BLI_dynstr_free(ds); ret = PyUnicode_FromStringAndSize(ds_buf, ds_len); PyMem_Free(ds_buf); return ret; } #endif /* Mathutils Callbacks */ /* For mathutils internal use only, * eventually should re-alloc but to start with we only have a few users. */ #define MATHUTILS_TOT_CB 17 static Mathutils_Callback *mathutils_callbacks[MATHUTILS_TOT_CB] = {NULL}; unsigned char Mathutils_RegisterCallback(Mathutils_Callback *cb) { unsigned char i; /* find the first free slot */ for (i = 0; mathutils_callbacks[i]; i++) { if (mathutils_callbacks[i] == cb) { /* already registered? */ return i; } } BLI_assert(i + 1 < MATHUTILS_TOT_CB); mathutils_callbacks[i] = cb; return i; } /* use macros to check for NULL */ int _BaseMathObject_ReadCallback(BaseMathObject *self) { Mathutils_Callback *cb = mathutils_callbacks[self->cb_type]; if (LIKELY(cb->get(self, self->cb_subtype) != -1)) { return 0; } if (!PyErr_Occurred()) { PyErr_Format(PyExc_RuntimeError, "%s read, user has become invalid", Py_TYPE(self)->tp_name); } return -1; } int _BaseMathObject_WriteCallback(BaseMathObject *self) { Mathutils_Callback *cb = mathutils_callbacks[self->cb_type]; if (LIKELY(cb->set(self, self->cb_subtype) != -1)) { return 0; } if (!PyErr_Occurred()) { PyErr_Format(PyExc_RuntimeError, "%s write, user has become invalid", Py_TYPE(self)->tp_name); } return -1; } int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index) { Mathutils_Callback *cb = mathutils_callbacks[self->cb_type]; if (LIKELY(cb->get_index(self, self->cb_subtype, index) != -1)) { return 0; } if (!PyErr_Occurred()) { PyErr_Format( PyExc_RuntimeError, "%s read index, user has become invalid", Py_TYPE(self)->tp_name); } return -1; } int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index) { Mathutils_Callback *cb = mathutils_callbacks[self->cb_type]; if (LIKELY(cb->set_index(self, self->cb_subtype, index) != -1)) { return 0; } if (!PyErr_Occurred()) { PyErr_Format( PyExc_RuntimeError, "%s write index, user has become invalid", Py_TYPE(self)->tp_name); } return -1; } void _BaseMathObject_RaiseFrozenExc(const BaseMathObject *self) { PyErr_Format(PyExc_TypeError, "%s is frozen (immutable)", Py_TYPE(self)->tp_name); } void _BaseMathObject_RaiseNotFrozenExc(const BaseMathObject *self) { PyErr_Format( PyExc_TypeError, "%s is not frozen (mutable), call freeze first", Py_TYPE(self)->tp_name); } /* BaseMathObject generic functions for all mathutils types */ char BaseMathObject_owner_doc[] = "The item this is wrapping or None (read-only)."; PyObject *BaseMathObject_owner_get(BaseMathObject *self, void *UNUSED(closure)) { PyObject *ret = self->cb_user ? self->cb_user : Py_None; return Py_INCREF_RET(ret); } char BaseMathObject_is_wrapped_doc[] = "True when this object wraps external data (read-only).\n\n:type: boolean"; PyObject *BaseMathObject_is_wrapped_get(BaseMathObject *self, void *UNUSED(closure)) { return PyBool_FromLong((self->flag & BASE_MATH_FLAG_IS_WRAP) != 0); } char BaseMathObject_is_frozen_doc[] = "True when this object has been frozen (read-only).\n\n:type: boolean"; PyObject *BaseMathObject_is_frozen_get(BaseMathObject *self, void *UNUSED(closure)) { return PyBool_FromLong((self->flag & BASE_MATH_FLAG_IS_FROZEN) != 0); } char BaseMathObject_freeze_doc[] = ".. function:: freeze()\n" "\n" " Make this object immutable.\n" "\n" " After this the object can be hashed, used in dictionaries & sets.\n" "\n" " :return: An instance of this object.\n"; PyObject *BaseMathObject_freeze(BaseMathObject *self) { if ((self->flag & BASE_MATH_FLAG_IS_WRAP) || (self->cb_user != NULL)) { PyErr_SetString(PyExc_TypeError, "Cannot freeze wrapped/owned data"); return NULL; } self->flag |= BASE_MATH_FLAG_IS_FROZEN; return Py_INCREF_RET((PyObject *)self); } int BaseMathObject_traverse(BaseMathObject *self, visitproc visit, void *arg) { Py_VISIT(self->cb_user); return 0; } int BaseMathObject_clear(BaseMathObject *self) { Py_CLEAR(self->cb_user); return 0; } void BaseMathObject_dealloc(BaseMathObject *self) { /* only free non wrapped */ if ((self->flag & BASE_MATH_FLAG_IS_WRAP) == 0) { PyMem_Free(self->data); } if (self->cb_user) { PyObject_GC_UnTrack(self); BaseMathObject_clear(self); } Py_TYPE(self)->tp_free(self); // PyObject_DEL(self); // breaks subtypes } /*----------------------------MODULE INIT-------------------------*/ static struct PyMethodDef M_Mathutils_methods[] = { {NULL, NULL, 0, NULL}, }; static struct PyModuleDef M_Mathutils_module_def = { PyModuleDef_HEAD_INIT, "mathutils", /* m_name */ M_Mathutils_doc, /* m_doc */ 0, /* m_size */ M_Mathutils_methods, /* m_methods */ NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL, /* m_free */ }; /* submodules only */ #include "mathutils_geometry.h" #include "mathutils_interpolate.h" #ifndef MATH_STANDALONE # include "mathutils_bvhtree.h" # include "mathutils_kdtree.h" # include "mathutils_noise.h" #endif PyMODINIT_FUNC PyInit_mathutils(void) { PyObject *mod; PyObject *submodule; PyObject *sys_modules = PyImport_GetModuleDict(); if (PyType_Ready(&vector_Type) < 0) { return NULL; } if (PyType_Ready(&matrix_Type) < 0) { return NULL; } if (PyType_Ready(&matrix_access_Type) < 0) { return NULL; } if (PyType_Ready(&euler_Type) < 0) { return NULL; } if (PyType_Ready(&quaternion_Type) < 0) { return NULL; } if (PyType_Ready(&color_Type) < 0) { return NULL; } mod = PyModule_Create(&M_Mathutils_module_def); /* each type has its own new() function */ PyModule_AddObject(mod, vector_Type.tp_name, (PyObject *)&vector_Type); PyModule_AddObject(mod, matrix_Type.tp_name, (PyObject *)&matrix_Type); PyModule_AddObject(mod, euler_Type.tp_name, (PyObject *)&euler_Type); PyModule_AddObject(mod, quaternion_Type.tp_name, (PyObject *)&quaternion_Type); PyModule_AddObject(mod, color_Type.tp_name, (PyObject *)&color_Type); /* submodule */ PyModule_AddObject(mod, "geometry", (submodule = PyInit_mathutils_geometry())); /* XXX, python doesn't do imports with this usefully yet * 'from mathutils.geometry import PolyFill' * ...fails without this. */ PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); PyModule_AddObject(mod, "interpolate", (submodule = PyInit_mathutils_interpolate())); /* XXX, python doesnt do imports with this usefully yet * 'from mathutils.geometry import PolyFill' * ...fails without this. */ PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); #ifndef MATH_STANDALONE /* Noise submodule */ PyModule_AddObject(mod, "noise", (submodule = PyInit_mathutils_noise())); PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); /* BVHTree submodule */ PyModule_AddObject(mod, "bvhtree", (submodule = PyInit_mathutils_bvhtree())); PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); /* KDTree_3d submodule */ PyModule_AddObject(mod, "kdtree", (submodule = PyInit_mathutils_kdtree())); PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); #endif mathutils_matrix_row_cb_index = Mathutils_RegisterCallback(&mathutils_matrix_row_cb); mathutils_matrix_col_cb_index = Mathutils_RegisterCallback(&mathutils_matrix_col_cb); mathutils_matrix_translation_cb_index = Mathutils_RegisterCallback( &mathutils_matrix_translation_cb); return mod; }
28.513669
99
0.627138
[ "geometry", "object", "vector", "solid" ]
d0faa0464dbefdbe6b06ed45dd3aa1da4d9d8a5e
1,715
h
C
src/plane.h
gulesh/raytracer
744f5038685905226adb24173a18bce624088ac4
[ "CC0-1.0" ]
null
null
null
src/plane.h
gulesh/raytracer
744f5038685905226adb24173a18bce624088ac4
[ "CC0-1.0" ]
null
null
null
src/plane.h
gulesh/raytracer
744f5038685905226adb24173a18bce624088ac4
[ "CC0-1.0" ]
null
null
null
#ifndef PLANE_H_ #define PLANE_H_ #include "hittable.h" #include "AGLM.h" class plane : public hittable { public: plane() : a(0), n(0), mat_ptr(0) {} plane(const glm::point3& p, const glm::vec3& normal, std::shared_ptr<material> m) : a(p), n(normal), mat_ptr(m) {}; virtual bool hit(const ray& r, hit_record& rec) const override; public: glm::vec3 a; glm::vec3 n; std::shared_ptr<material> mat_ptr; }; bool plane::hit(const ray& r, hit_record& rec) const { glm::vec3 pNot = r.origin() - a; glm::vec3 p_prime = a - r.origin(); glm::vec3 v = r.direction(); float t = -1; float valueDV = dot(v, n); if(dot(pNot, n) == 0 && valueDV == 0) //ray is in the plane along with ray direction { return false; } else { if(dot(pNot, n) == 0) //ray origin in the plane { if (valueDV == length(v) * length(n) ) { t = 0; } else if(valueDV == -1 * length(v) * length(n)) { t = 0; } } if (valueDV == 0) { t = infinity; } else { float t = dot(p_prime, n)/ valueDV; if (t < 0 ) { return false; } rec.t = t; // save the time when we hit the object rec.p = r.at(t); // ray.origin + t * ray.direction rec.mat_ptr = mat_ptr; // save normal glm::vec3 outward_normal = n; rec.set_face_normal(r, outward_normal); return true; } return false; } } #endif
23.493151
90
0.460641
[ "object" ]
190386493299b7321e08edbe899f81110ac1f30b
7,371
c
C
kernel-3.10/drivers/misc/mediatek/gpu/mt8127/mali/mali/linux/mali_sync.c
zhengdejin/SC1_Code
dccccf55f2875fb64ec621f4356c625cd48bef7e
[ "Apache-2.0" ]
null
null
null
kernel-3.10/drivers/misc/mediatek/gpu/mt8127/mali/mali/linux/mali_sync.c
zhengdejin/SC1_Code
dccccf55f2875fb64ec621f4356c625cd48bef7e
[ "Apache-2.0" ]
null
null
null
kernel-3.10/drivers/misc/mediatek/gpu/mt8127/mali/mali/linux/mali_sync.c
zhengdejin/SC1_Code
dccccf55f2875fb64ec621f4356c625cd48bef7e
[ "Apache-2.0" ]
null
null
null
/* * This confidential and proprietary software may be used only as * authorised by a licensing agreement from ARM Limited * (C) COPYRIGHT 2012-2013 ARM Limited * ALL RIGHTS RESERVED * The entire notice above must be reproduced on all authorised * copies and copies may only be made to the extent permitted * by a licensing agreement from ARM Limited. */ #include "mali_sync.h" #include "mali_osk.h" #include "mali_kernel_common.h" #include "mali_timeline.h" #include <linux/file.h> #include <linux/seq_file.h> #include <linux/module.h> struct mali_sync_pt { struct sync_pt sync_pt; struct mali_sync_flag *flag; }; /** * The sync flag is used to connect sync fences to the Mali Timeline system. Sync fences can be * created from a sync flag, and when the flag is signaled, the sync fences will also be signaled. */ struct mali_sync_flag { struct sync_timeline *sync_tl; /**< Sync timeline this flag is connected to. */ u32 point; /**< Point on timeline. */ int status; /**< 0 if unsignaled, 1 if signaled without error or negative if signaled with error. */ struct kref refcount; /**< Reference count. */ }; MALI_STATIC_INLINE struct mali_sync_pt *to_mali_sync_pt(struct sync_pt *pt) { return container_of(pt, struct mali_sync_pt, sync_pt); } static struct sync_pt *timeline_dup(struct sync_pt *pt) { struct mali_sync_pt *mpt, *new_mpt; struct sync_pt *new_pt; MALI_DEBUG_ASSERT_POINTER(pt); mpt = to_mali_sync_pt(pt); new_pt = sync_pt_create(pt->parent, sizeof(struct mali_sync_pt)); if (NULL == new_pt) return NULL; new_mpt = to_mali_sync_pt(new_pt); mali_sync_flag_get(mpt->flag); new_mpt->flag = mpt->flag; return new_pt; } static int timeline_has_signaled(struct sync_pt *pt) { struct mali_sync_pt *mpt; MALI_DEBUG_ASSERT_POINTER(pt); mpt = to_mali_sync_pt(pt); MALI_DEBUG_ASSERT_POINTER(mpt->flag); return mpt->flag->status; } static int timeline_compare(struct sync_pt *pta, struct sync_pt *ptb) { struct mali_sync_pt *mpta; struct mali_sync_pt *mptb; u32 a, b; MALI_DEBUG_ASSERT_POINTER(pta); MALI_DEBUG_ASSERT_POINTER(ptb); mpta = to_mali_sync_pt(pta); mptb = to_mali_sync_pt(ptb); MALI_DEBUG_ASSERT_POINTER(mpta->flag); MALI_DEBUG_ASSERT_POINTER(mptb->flag); a = mpta->flag->point; b = mpta->flag->point; if (a == b) return 0; return ((b - a) < (a - b) ? -1 : 1); } static void timeline_free_pt(struct sync_pt *pt) { struct mali_sync_pt *mpt; MALI_DEBUG_ASSERT_POINTER(pt); mpt = to_mali_sync_pt(pt); mali_sync_flag_put(mpt->flag); } static void timeline_release(struct sync_timeline *sync_timeline) { module_put(THIS_MODULE); } static void timeline_print_pt(struct seq_file *s, struct sync_pt *sync_pt) { struct mali_sync_pt *mpt; MALI_DEBUG_ASSERT_POINTER(s); MALI_DEBUG_ASSERT_POINTER(sync_pt); mpt = to_mali_sync_pt(sync_pt); MALI_DEBUG_ASSERT_POINTER(mpt->flag); seq_printf(s, "%u", mpt->flag->point); } static struct sync_timeline_ops mali_timeline_ops = { .driver_name = "Mali", .dup = timeline_dup, .has_signaled = timeline_has_signaled, .compare = timeline_compare, .free_pt = timeline_free_pt, .release_obj = timeline_release, .print_pt = timeline_print_pt, }; struct sync_timeline *mali_sync_timeline_create(const char *name) { struct sync_timeline *sync_tl; sync_tl = sync_timeline_create(&mali_timeline_ops, sizeof(struct sync_timeline), name); if (NULL == sync_tl) return NULL; /* Grab a reference on the module to ensure the callbacks are present * as long some timeline exists. The reference is released when the * timeline is freed. * Since this function is called from a ioctl on an open file we know * we already have a reference, so using __module_get is safe. */ __module_get(THIS_MODULE); return sync_tl; } mali_bool mali_sync_timeline_is_ours(struct sync_timeline *sync_tl) { MALI_DEBUG_ASSERT_POINTER(sync_tl); return (sync_tl->ops == &mali_timeline_ops) ? MALI_TRUE : MALI_FALSE; } s32 mali_sync_fence_fd_alloc(struct sync_fence *sync_fence) { s32 fd = -1; fd = get_unused_fd(); if (fd < 0) { sync_fence_put(sync_fence); MALI_DEBUG_PRINT(1, ("get_unused_fd() got fd < 0, fd=%x\n", fd)); return -1; } sync_fence_install(sync_fence, fd); return fd; } struct sync_fence *mali_sync_fence_merge(struct sync_fence *sync_fence1, struct sync_fence *sync_fence2) { struct sync_fence *sync_fence; MALI_DEBUG_ASSERT_POINTER(sync_fence1); MALI_DEBUG_ASSERT_POINTER(sync_fence1); sync_fence = sync_fence_merge("mali_merge_fence", sync_fence1, sync_fence2); sync_fence_put(sync_fence1); sync_fence_put(sync_fence2); return sync_fence; } struct sync_fence *mali_sync_timeline_create_signaled_fence(struct sync_timeline *sync_tl) { struct mali_sync_flag *flag; struct sync_fence *sync_fence; MALI_DEBUG_ASSERT_POINTER(sync_tl); flag = mali_sync_flag_create(sync_tl, 0); if (NULL == flag) return NULL; sync_fence = mali_sync_flag_create_fence(flag); mali_sync_flag_signal(flag, 0); mali_sync_flag_put(flag); return sync_fence; } struct mali_sync_flag *mali_sync_flag_create(struct sync_timeline *sync_tl, mali_timeline_point point) { struct mali_sync_flag *flag; if (NULL == sync_tl) return NULL; flag = _mali_osk_calloc(1, sizeof(*flag)); if (NULL == flag) return NULL; flag->sync_tl = sync_tl; flag->point = point; flag->status = 0; kref_init(&flag->refcount); return flag; } void mali_sync_flag_get(struct mali_sync_flag *flag) { MALI_DEBUG_ASSERT_POINTER(flag); kref_get(&flag->refcount); } /** * Free sync flag. * * @param ref kref object embedded in sync flag that should be freed. */ static void mali_sync_flag_free(struct kref *ref) { struct mali_sync_flag *flag; MALI_DEBUG_ASSERT_POINTER(ref); flag = container_of(ref, struct mali_sync_flag, refcount); _mali_osk_free(flag); } void mali_sync_flag_put(struct mali_sync_flag *flag) { MALI_DEBUG_ASSERT_POINTER(flag); kref_put(&flag->refcount, mali_sync_flag_free); } void mali_sync_flag_signal(struct mali_sync_flag *flag, int error) { MALI_DEBUG_ASSERT_POINTER(flag); MALI_DEBUG_ASSERT(0 == flag->status); flag->status = (0 > error) ? error : 1; _mali_osk_write_mem_barrier(); sync_timeline_signal(flag->sync_tl); } /** * Create a sync point attached to given sync flag. * * @note Sync points must be triggered in *exactly* the same order as they are created. * * @param flag Sync flag. * @return New sync point if successful, NULL if not. */ static struct sync_pt *mali_sync_flag_create_pt(struct mali_sync_flag *flag) { struct sync_pt *pt; struct mali_sync_pt *mpt; MALI_DEBUG_ASSERT_POINTER(flag); MALI_DEBUG_ASSERT_POINTER(flag->sync_tl); pt = sync_pt_create(flag->sync_tl, sizeof(struct mali_sync_pt)); if (NULL == pt) return NULL; mali_sync_flag_get(flag); mpt = to_mali_sync_pt(pt); mpt->flag = flag; return pt; } struct sync_fence *mali_sync_flag_create_fence(struct mali_sync_flag *flag) { struct sync_pt *sync_pt; struct sync_fence *sync_fence; MALI_DEBUG_ASSERT_POINTER(flag); MALI_DEBUG_ASSERT_POINTER(flag->sync_tl); sync_pt = mali_sync_flag_create_pt(flag); if (NULL == sync_pt) return NULL; sync_fence = sync_fence_create("mali_flag_fence", sync_pt); if (NULL == sync_fence) { sync_pt_free(sync_pt); return NULL; } return sync_fence; }
24.088235
121
0.743454
[ "object" ]
190c05ba265a446d25283a0d3fe84cec45a1a8f1
8,631
h
C
src/qt/qtbase/src/gui/opengl/qopengl.h
viewdy/phantomjs
eddb0db1d253fd0c546060a4555554c8ee08c13c
[ "BSD-3-Clause" ]
3
2015-03-18T03:12:27.000Z
2020-11-19T10:40:12.000Z
src/qt/qtbase/src/gui/opengl/qopengl.h
mrampersad/phantomjs
dca6f77a36699eb4e1c46f7600cca618f01b0ac3
[ "BSD-3-Clause" ]
null
null
null
src/qt/qtbase/src/gui/opengl/qopengl.h
mrampersad/phantomjs
dca6f77a36699eb4e1c46f7600cca618f01b0ac3
[ "BSD-3-Clause" ]
1
2022-02-18T10:41:38.000Z
2022-02-18T10:41:38.000Z
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QOPENGL_H #define QOPENGL_H #include <QtCore/qglobal.h> #ifndef QT_NO_OPENGL // Windows always needs this to ensure that APIENTRY gets defined #if defined(Q_OS_WIN) # include <QtCore/qt_windows.h> #endif // Note: Mac OSX is a "controlled platform" for OpenGL ABI so we // use the system provided headers there. Controlled means that the // headers always match the actual driver implementation so there // is no possibility of drivers exposing additional functionality // from the system headers. Also it means that the vendor can // (and does) make different choices about some OpenGL types. For // e.g. Apple uses void* for GLhandleARB whereas other platforms // use unsigned int. // // For the "uncontrolled" Windows and Linux platforms we use the // official Khronos headers. On these platforms this gives // access to additional functionality the drivers may expose but // which the system headers do not. #if defined(QT_OPENGL_ES_2) # if defined(Q_OS_MAC) // iOS # include <OpenGLES/ES2/gl.h> # include <OpenGLES/ES2/glext.h> /* OES_EGL_image_external is not included in the Apple provided system headers yet, but we define the missing typedef so that the qopenglextensions.cpp code will magically work once Apple include the extension in their drivers. */ typedef void* GLeglImageOES; # else // "uncontrolled" ES2 platforms # include <GLES2/gl2.h> /* Some GLES2 implementations (like the one on Harmattan) are missing the typedef for GLchar. Work around it here by adding it. The Kkronos headers specify GLChar as a typedef to char, so if an implementation already provides it, then this doesn't do any harm. */ typedef char GLchar; # include <QtGui/qopengles2ext.h> # endif // Q_OS_MAC # ifndef GL_DOUBLE # define GL_DOUBLE GL_FLOAT # endif # ifndef GLdouble typedef GLfloat GLdouble; # endif #else // non-ES2 platforms # if defined(Q_OS_MAC) # include <OpenGL/gl.h> # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 # define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED # include <OpenGL/gl3.h> # endif # include <OpenGL/glext.h> # else # define GL_GLEXT_LEGACY // Prevents GL/gl.h from #including system glext.h # include <GL/gl.h> # include <QtGui/qopenglext.h> # endif // Q_OS_MAC #endif // QT_OPENGL_ES_2 // Desktops, apart from Mac OS X prior to 10.7 can support OpenGL 3 // and desktops apart from Mac can support OpenGL 4 #if !defined(QT_OPENGL_ES_2) # if !defined(Q_OS_MAC) || (defined(Q_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) # define QT_OPENGL_3 # define QT_OPENGL_3_2 # endif #if !defined(Q_OS_MAC) # define QT_OPENGL_4 # define QT_OPENGL_4_3 #endif #endif QT_BEGIN_NAMESPACE // When all else fails we provide sensible fallbacks - this is needed to // allow compilation on OS X 10.6 #if !defined(QT_OPENGL_ES_2) // OS X 10.6 doesn't define these which are needed below // OS X 10.7 and later defien them in gl3.h #ifndef APIENTRY #define APIENTRY #endif #ifndef APIENTRYP #define APIENTRYP APIENTRY * #endif #ifndef GLAPI #define GLAPI extern #endif // This block is copied from glext.h and defines the types needed by // a few extension classes. #include <stddef.h> #ifndef GL_VERSION_2_0 /* GL type for program/shader text */ typedef char GLchar; #endif #ifndef GL_VERSION_1_5 /* GL types for handling large vertex buffer objects */ typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLsizeiptr; #endif #ifndef GL_ARB_vertex_buffer_object /* GL types for handling large vertex buffer objects */ typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; #endif #ifndef GL_ARB_shader_objects /* GL types for program/shader text and shader object handles */ typedef char GLcharARB; typedef unsigned int GLhandleARB; #endif /* GL type for "half" precision (s10e5) float data in host memory */ #ifndef GL_ARB_half_float_pixel typedef unsigned short GLhalfARB; #endif #ifndef GL_NV_half_float typedef unsigned short GLhalfNV; #endif #ifndef GLEXT_64_TYPES_DEFINED /* This code block is duplicated in glxext.h, so must be protected */ #define GLEXT_64_TYPES_DEFINED /* Define int32_t, int64_t, and uint64_t types for UST/MSC */ /* (as used in the GL_EXT_timer_query extension). */ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include <inttypes.h> #elif defined(__sun__) || defined(__digital__) #include <inttypes.h> #if defined(__STDC__) #if defined(__arch64__) || defined(_LP64) typedef long int int64_t; typedef unsigned long int uint64_t; #else typedef long long int int64_t; typedef unsigned long long int uint64_t; #endif /* __arch64__ */ #endif /* __STDC__ */ #elif defined( __VMS ) || defined(__sgi) #include <inttypes.h> #elif defined(__SCO__) || defined(__USLC__) #include <stdint.h> #elif defined(__UNIXOS2__) || defined(__SOL64__) typedef long int int32_t; typedef long long int int64_t; typedef unsigned long long int uint64_t; #elif defined(_WIN32) && defined(__GNUC__) #include <stdint.h> #elif defined(_WIN32) typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #else /* Fallback if nothing above works */ #include <inttypes.h> #endif #endif #ifndef GL_EXT_timer_query typedef int64_t GLint64EXT; typedef uint64_t GLuint64EXT; #endif #ifndef GL_ARB_sync typedef int64_t GLint64; typedef uint64_t GLuint64; typedef struct __GLsync *GLsync; #endif #ifndef GL_ARB_cl_event /* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */ struct _cl_context; struct _cl_event; #endif #ifndef GL_ARB_debug_output typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); #endif #ifndef GL_AMD_debug_output typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); #endif #ifndef GL_KHR_debug typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); #endif #ifndef GL_NV_vdpau_interop typedef GLintptr GLvdpauSurfaceNV; #endif // End of block copied from glext.h #endif // Types that aren't defined in all system's gl.h files. typedef ptrdiff_t qopengl_GLintptr; typedef ptrdiff_t qopengl_GLsizeiptr; #if defined(APIENTRY) && !defined(QOPENGLF_APIENTRY) # define QOPENGLF_APIENTRY APIENTRY #endif # ifndef QOPENGLF_APIENTRYP # ifdef QOPENGLF_APIENTRY # define QOPENGLF_APIENTRYP QOPENGLF_APIENTRY * # else # define QOPENGLF_APIENTRY # define QOPENGLF_APIENTRYP * # endif # endif QT_END_NAMESPACE #endif // QT_NO_OPENGL #endif // QOPENGL_H
30.606383
148
0.757039
[ "object" ]
190d26e2e75f9e7a8c5bf2fd35fe4c202d9380f3
8,947
c
C
openeuler-kernel/drivers/watchdog/sp805_wdt.c
Ddnirvana/test-CI
dd7a0a71281075e8ab300bddbab4a9fa039958f0
[ "MulanPSL-1.0" ]
31
2021-04-27T08:50:40.000Z
2022-03-01T02:26:21.000Z
openeuler-kernel/drivers/watchdog/sp805_wdt.c
Ddnirvana/test-CI
dd7a0a71281075e8ab300bddbab4a9fa039958f0
[ "MulanPSL-1.0" ]
13
2021-07-10T04:36:17.000Z
2022-03-03T10:50:05.000Z
openeuler-kernel/drivers/watchdog/sp805_wdt.c
Ddnirvana/test-CI
dd7a0a71281075e8ab300bddbab4a9fa039958f0
[ "MulanPSL-1.0" ]
12
2021-04-06T02:23:10.000Z
2022-02-28T11:43:19.000Z
/* * drivers/char/watchdog/sp805-wdt.c * * Watchdog driver for ARM SP805 watchdog module * * Copyright (C) 2010 ST Microelectronics * Viresh Kumar <vireshk@kernel.org> * * This file is licensed under the terms of the GNU General Public * License version 2 or later. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ #include <linux/acpi.h> #include <linux/device.h> #include <linux/resource.h> #include <linux/amba/bus.h> #include <linux/bitops.h> #include <linux/clk.h> #include <linux/io.h> #include <linux/ioport.h> #include <linux/kernel.h> #include <linux/math64.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/of.h> #include <linux/pm.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/types.h> #include <linux/watchdog.h> /* default timeout in seconds */ #define DEFAULT_TIMEOUT 60 #define MODULE_NAME "sp805-wdt" /* watchdog register offsets and masks */ #define WDTLOAD 0x000 #define LOAD_MIN 0x00000001 #define LOAD_MAX 0xFFFFFFFF #define WDTVALUE 0x004 #define WDTCONTROL 0x008 /* control register masks */ #define INT_ENABLE (1 << 0) #define RESET_ENABLE (1 << 1) #define ENABLE_MASK (INT_ENABLE | RESET_ENABLE) #define WDTINTCLR 0x00C #define WDTRIS 0x010 #define WDTMIS 0x014 #define INT_MASK (1 << 0) #define WDTLOCK 0xC00 #define UNLOCK 0x1ACCE551 #define LOCK 0x00000001 /** * struct sp805_wdt: sp805 wdt device structure * @wdd: instance of struct watchdog_device * @lock: spin lock protecting dev structure and io access * @base: base address of wdt * @clk: clock structure of wdt * @adev: amba device structure of wdt * @status: current status of wdt * @load_val: load value to be set for current timeout */ struct sp805_wdt { struct watchdog_device wdd; spinlock_t lock; void __iomem *base; struct clk *clk; u64 rate; struct amba_device *adev; unsigned int load_val; }; static bool nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Set to 1 to keep watchdog running after device release"); /* returns true if wdt is running; otherwise returns false */ static bool wdt_is_running(struct watchdog_device *wdd) { struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); u32 wdtcontrol = readl_relaxed(wdt->base + WDTCONTROL); return (wdtcontrol & ENABLE_MASK) == ENABLE_MASK; } /* This routine finds load value that will reset system in required timout */ static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout) { struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); u64 load, rate; rate = wdt->rate; /* * sp805 runs counter with given value twice, after the end of first * counter it gives an interrupt and then starts counter again. If * interrupt already occurred then it resets the system. This is why * load is half of what should be required. */ load = div_u64(rate, 2) * timeout - 1; load = (load > LOAD_MAX) ? LOAD_MAX : load; load = (load < LOAD_MIN) ? LOAD_MIN : load; spin_lock(&wdt->lock); wdt->load_val = load; /* roundup timeout to closest positive integer value */ wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate); spin_unlock(&wdt->lock); return 0; } /* returns number of seconds left for reset to occur */ static unsigned int wdt_timeleft(struct watchdog_device *wdd) { struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); u64 load; spin_lock(&wdt->lock); load = readl_relaxed(wdt->base + WDTVALUE); /*If the interrupt is inactive then time left is WDTValue + WDTLoad. */ if (!(readl_relaxed(wdt->base + WDTRIS) & INT_MASK)) load += wdt->load_val + 1; spin_unlock(&wdt->lock); return div_u64(load, wdt->rate); } static int wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd) { struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); writel_relaxed(UNLOCK, wdt->base + WDTLOCK); writel_relaxed(0, wdt->base + WDTCONTROL); writel_relaxed(0, wdt->base + WDTLOAD); writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL); /* Flush posted writes. */ readl_relaxed(wdt->base + WDTLOCK); return 0; } static int wdt_config(struct watchdog_device *wdd, bool ping) { struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); int ret; if (!ping) { ret = clk_prepare_enable(wdt->clk); if (ret) { dev_err(&wdt->adev->dev, "clock enable fail"); return ret; } } spin_lock(&wdt->lock); writel_relaxed(UNLOCK, wdt->base + WDTLOCK); writel_relaxed(wdt->load_val, wdt->base + WDTLOAD); writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); if (!ping) writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL); writel_relaxed(LOCK, wdt->base + WDTLOCK); /* Flush posted writes. */ readl_relaxed(wdt->base + WDTLOCK); spin_unlock(&wdt->lock); return 0; } static int wdt_ping(struct watchdog_device *wdd) { return wdt_config(wdd, true); } /* enables watchdog timers reset */ static int wdt_enable(struct watchdog_device *wdd) { return wdt_config(wdd, false); } /* disables watchdog timers reset */ static int wdt_disable(struct watchdog_device *wdd) { struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); spin_lock(&wdt->lock); writel_relaxed(UNLOCK, wdt->base + WDTLOCK); writel_relaxed(0, wdt->base + WDTCONTROL); writel_relaxed(LOCK, wdt->base + WDTLOCK); /* Flush posted writes. */ readl_relaxed(wdt->base + WDTLOCK); spin_unlock(&wdt->lock); clk_disable_unprepare(wdt->clk); return 0; } static const struct watchdog_info wdt_info = { .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, .identity = MODULE_NAME, }; static const struct watchdog_ops wdt_ops = { .owner = THIS_MODULE, .start = wdt_enable, .stop = wdt_disable, .ping = wdt_ping, .set_timeout = wdt_setload, .get_timeleft = wdt_timeleft, .restart = wdt_restart, }; static int sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) { struct sp805_wdt *wdt; int ret = 0; wdt = devm_kzalloc(&adev->dev, sizeof(*wdt), GFP_KERNEL); if (!wdt) { ret = -ENOMEM; goto err; } wdt->base = devm_ioremap_resource(&adev->dev, &adev->res); if (IS_ERR(wdt->base)) return PTR_ERR(wdt->base); if (adev->dev.of_node) { wdt->clk = devm_clk_get(&adev->dev, NULL); if (IS_ERR(wdt->clk)) { dev_err(&adev->dev, "Clock not found\n"); return PTR_ERR(wdt->clk); } wdt->rate = clk_get_rate(wdt->clk); } else if (has_acpi_companion(&adev->dev)) { /* * When Driver probe with ACPI device, clock devices * are not available, so watchdog rate get from * clock-frequency property given in _DSD object. */ device_property_read_u64(&adev->dev, "clock-frequency", &wdt->rate); if (!wdt->rate) { dev_err(&adev->dev, "no clock-frequency property\n"); return -ENODEV; } } wdt->adev = adev; wdt->wdd.info = &wdt_info; wdt->wdd.ops = &wdt_ops; wdt->wdd.parent = &adev->dev; spin_lock_init(&wdt->lock); watchdog_set_nowayout(&wdt->wdd, nowayout); watchdog_set_drvdata(&wdt->wdd, wdt); watchdog_set_restart_priority(&wdt->wdd, 128); /* * If 'timeout-sec' devicetree property is specified, use that. * Otherwise, use DEFAULT_TIMEOUT */ wdt->wdd.timeout = DEFAULT_TIMEOUT; watchdog_init_timeout(&wdt->wdd, 0, &adev->dev); wdt_setload(&wdt->wdd, wdt->wdd.timeout); /* * If HW is already running, enable/reset the wdt and set the running * bit to tell the wdt subsystem */ if (wdt_is_running(&wdt->wdd)) { wdt_enable(&wdt->wdd); set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); } ret = watchdog_register_device(&wdt->wdd); if (ret) goto err; amba_set_drvdata(adev, wdt); dev_info(&adev->dev, "registration successful\n"); return 0; err: dev_err(&adev->dev, "Probe Failed!!!\n"); return ret; } static int sp805_wdt_remove(struct amba_device *adev) { struct sp805_wdt *wdt = amba_get_drvdata(adev); watchdog_unregister_device(&wdt->wdd); watchdog_set_drvdata(&wdt->wdd, NULL); return 0; } static int __maybe_unused sp805_wdt_suspend(struct device *dev) { struct sp805_wdt *wdt = dev_get_drvdata(dev); if (watchdog_active(&wdt->wdd)) return wdt_disable(&wdt->wdd); return 0; } static int __maybe_unused sp805_wdt_resume(struct device *dev) { struct sp805_wdt *wdt = dev_get_drvdata(dev); if (watchdog_active(&wdt->wdd)) return wdt_enable(&wdt->wdd); return 0; } static SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend, sp805_wdt_resume); static const struct amba_id sp805_wdt_ids[] = { { .id = 0x00141805, .mask = 0x00ffffff, }, { 0, 0 }, }; MODULE_DEVICE_TABLE(amba, sp805_wdt_ids); static struct amba_driver sp805_wdt_driver = { .drv = { .name = MODULE_NAME, .pm = &sp805_wdt_dev_pm_ops, }, .id_table = sp805_wdt_ids, .probe = sp805_wdt_probe, .remove = sp805_wdt_remove, }; module_amba_driver(sp805_wdt_driver); MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>"); MODULE_DESCRIPTION("ARM SP805 Watchdog Driver"); MODULE_LICENSE("GPL");
24.512329
77
0.712865
[ "object" ]
190dea17934e7e763c5857df88c115197d92063c
11,722
h
C
Classes/LevelDB.h
trthtai/Objective-LevelDB
44d6010c0622f8a6bbb5b4b5dbc07b1c7cb36c8b
[ "MIT" ]
null
null
null
Classes/LevelDB.h
trthtai/Objective-LevelDB
44d6010c0622f8a6bbb5b4b5dbc07b1c7cb36c8b
[ "MIT" ]
null
null
null
Classes/LevelDB.h
trthtai/Objective-LevelDB
44d6010c0622f8a6bbb5b4b5dbc07b1c7cb36c8b
[ "MIT" ]
null
null
null
// // LevelDB.h // // Copyright 2011 Pave Labs. // See LICENCE for details. // #import <Foundation/Foundation.h> @class LDBSnapshot; @class LDBWritebatch; typedef struct LevelDBOptions { BOOL createIfMissing ; BOOL createIntermediateDirectories; BOOL errorIfExists ; BOOL paranoidCheck ; BOOL compression ; int filterPolicy ; size_t cacheSize; } LevelDBOptions; typedef struct { const char * data; NSUInteger length; } LevelDBKey; typedef NSData * (^LevelDBEncoderBlock) (LevelDBKey * key, id object); typedef id (^LevelDBDecoderBlock) (LevelDBKey * key, id data); typedef void (^LevelDBKeyBlock) (LevelDBKey * key, BOOL *stop); typedef void (^LevelDBKeyValueBlock)(LevelDBKey * key, id value, BOOL *stop); typedef id (^LevelDBValueGetterBlock) (void); typedef void (^LevelDBLazyKeyValueBlock) (LevelDBKey * key, LevelDBValueGetterBlock lazyValue, BOOL *stop); FOUNDATION_EXPORT NSString * const kLevelDBChangeType; FOUNDATION_EXPORT NSString * const kLevelDBChangeTypePut; FOUNDATION_EXPORT NSString * const kLevelDBChangeTypeDelete; FOUNDATION_EXPORT NSString * const kLevelDBChangeValue; FOUNDATION_EXPORT NSString * const kLevelDBChangeKey; #ifdef __cplusplus extern "C" { #endif NSString * NSStringFromLevelDBKey(LevelDBKey * key); NSData * NSDataFromLevelDBKey (LevelDBKey * key); #ifdef __cplusplus } #endif @interface LevelDB : NSObject ///------------------------------------------------------------------------ /// @name A LevelDB object, used to query to the database instance on disk ///------------------------------------------------------------------------ /** The path of the database on disk */ @property (nonatomic, retain) NSString *path; /** The name of the database. */ @property (nonatomic, retain) NSString *name; /** A boolean value indicating whether write operations should be synchronous (flush to disk before returning). */ @property (nonatomic) BOOL safe; /** A boolean value indicating whether read operations should try to use the configured cache (defaults to true). */ @property (nonatomic) BOOL useCache; /** A boolean readonly value indicating whether the database is closed or not. */ @property (readonly) BOOL closed; /** The data encoding block. */ @property (nonatomic, copy) LevelDBEncoderBlock encoder; /** The data decoding block. */ @property (nonatomic, copy) LevelDBDecoderBlock decoder; /** A class method that returns a LevelDBOptions struct, which can be modified to finetune leveldb */ + (LevelDBOptions) makeOptions; /** A class method that returns an autoreleased instance of LevelDB with the given name, inside the Library folder @param name The database's filename */ + (id) databaseInLibraryWithName:(NSString *)name; /** A class method that returns an autoreleased instance of LevelDB with the given name and options, inside the Library folder @param name The database's filename @param opts A LevelDBOptions struct with options for fine tuning leveldb */ + (id) databaseInLibraryWithName:(NSString *)name andOptions:(LevelDBOptions)opts; + (id) databaseInBundleWithName:(NSString *)name; + (id) databaseInDocumentsWithName:(NSString *)name; /** Initialize a leveldb instance @param path The parent directory of the database file on disk @param name the filename of the database file on disk */ - (id) initWithPath:(NSString *)path andName:(NSString *)name; /** Initialize a leveldb instance @param path The parent directory of the database file on disk @param name the filename of the database file on disk @param opts A LevelDBOptions struct with options for fine tuning leveldb */ - (id) initWithPath:(NSString *)path name:(NSString *)name andOptions:(LevelDBOptions)opts; /** Delete the database file on disk */ - (void) deleteDatabaseFromDisk; /** Close the database. @warning The instance cannot be used to perform any query after it has been closed. */ - (void) close; #pragma mark - Setters /** Set the value associated with a key in the database The instance's encoder block will be used to produce a NSData instance from the provided value. @param value The value to put in the database @param key The key at which the value can be found */ - (void) setObject:(id)value forKey:(id)key; /** Same as `[self setObject:forKey:]` */ - (void) setObject:(id)value forKeyedSubscript:(id)key; /** Same as `[self setObject:forKey:]` */ - (void) setValue:(id)value forKey:(NSString *)key ; /** Take all key-value pairs in the provided dictionary and insert them in the database @param dictionary A dictionary from which key-value pairs will be inserted */ - (void) addEntriesFromDictionary:(NSDictionary *)dictionary; #pragma mark - Write batches /** Return an retained LDBWritebatch instance for this database */ - (LDBWritebatch *) newWritebatch; /** Apply the operations from a writebatch into the current database */ - (void) applyWritebatch:(LDBWritebatch *)writeBatch; /** Create new writebatch, apply the operations in block from a writebatch into the current database */ - (void) performWritebatch:(void (^)(LDBWritebatch *wb))block; #pragma mark - Getters /** Return the value associated with a key @param key The key to retrieve from the database */ - (id) objectForKey:(id)key; - (id) stringForKey:(id)key; /** Same as `[self objectForKey:]` */ - (id) objectForKeyedSubscript:(id)key; /** Same as `[self objectForKey:]` */ - (id) valueForKey:(NSString *)key; /** Return an array containing the values associated with the provided list of keys. For keys that can't be found in the database, the `marker` value is used in place. @warning marker should not be `nil` @param keys The list of keys to fetch from the database @param marker The value to associate to missing keys */ - (id) objectsForKeys:(NSArray *)keys notFoundMarker:(id)marker; /** Return a boolean value indicating whether or not the key exists in the database @param key The key to check for existence */ - (BOOL) objectExistsForKey:(id)key; #pragma mark - Removers /** Remove a key (and its associated value) from the database @param key The key to remove from the database */ - (void) removeObjectForKey:(id)key; /** Remove a set of keys (and their associated values) from the database @param keyArray An array of keys to remove from the database */ - (void) removeObjectsForKeys:(NSArray *)keyArray; /** Remove all objects from the database */ - (void) removeAllObjects; /** Remove all objects prefixed with a given value (`NSString` or `NSData`) @param prefix The key prefix used to remove all matching keys (of type `NSString` or `NSData`) */ - (void) removeAllObjectsWithPrefix:(id)prefix; #pragma mark - Selection /** Return an array containing all the keys of the database @warning This shouldn't be used with very large databases, since every key will be stored in memory */ - (NSArray *) allKeys; /** Return an array of key for which the value match the given predicate @param predicate A `NSPredicate` instance tested against the database's values to retrieve the corresponding keys */ - (NSArray *) keysByFilteringWithPredicate:(NSPredicate *)predicate; /** Return a dictionary with all key-value pairs, where values match the given predicate @param predicate A `NSPredicate` instance tested against the database's values to retrieve the corresponding key-value pairs */ - (NSDictionary *) dictionaryByFilteringWithPredicate:(NSPredicate *)predicate; /** Return an retained LDBSnapshot instance for this database LDBSnapshots are a way to "freeze" the state of the database. Write operation applied to the database after the snapshot was taken do not affect the snapshot. Most *read* methods available in the LevelDB class are also available in the LDBSnapshot class. */ - (LDBSnapshot *) newSnapshot; #pragma mark - Enumeration /** Enumerate over the keys in the database, in order. Same as `[self enumerateKeysBackward:FALSE startingAtKey:nil filteredByPredicate:nil andPrefix:nil usingBlock:block]` @param block The enumeration block used when iterating over all the keys. */ - (void) enumerateKeysUsingBlock:(LevelDBKeyBlock)block; /** Enumerate over the keys in the database, in direct or backward order, with some options to control the keys iterated over @param backward A boolean value indicating whether the enumeration happens in direct or backward order @param key (optional) The key at which to start iteration. If the key isn't present in the database, the enumeration starts at the key immediately greater than the provided one. The key can be a `NSData` or `NSString` @param predicate A `NSPredicate` instance tested against the values. The iteration block will only be called for keys associated to values matching the predicate. If `nil`, this is ignored. @param prefix A `NSString` or `NSData` prefix used to filter the keys. If provided, only the keys prefixed with this value will be iterated over. @param block The enumeration block used when iterating over all the keys. It takes two arguments: the first is a pointer to a `LevelDBKey` struct. You can convert this to a `NSString` or `NSData` instance, using `NSDataFromLevelDBKey(LevelDBKey *key)` and `NSStringFromLevelDBKey(LevelDBKey *key)` respectively. The second arguments to the block is a `BOOL *` that can be used to stop enumeration at any time (e.g. `*stop = TRUE;`). */ - (void) enumerateKeysBackward:(BOOL)backward startingAtKey:(id)key filteredByPredicate:(NSPredicate *)predicate andPrefix:(id)prefix usingBlock:(LevelDBKeyBlock)block; /** Enumerate over the key value pairs in the database, in order. Same as `[self enumerateKeysAndObjectsBackward:FALSE startingAtKey:nil filteredByPredicate:nil andPrefix:nil usingBlock:block]` @param block The enumeration block used when iterating over all the key value pairs. */ - (void) enumerateKeysAndObjectsUsingBlock:(LevelDBKeyValueBlock)block; /** Enumerate over the keys in the database, in direct or backward order, with some options to control the keys iterated over @param backward A boolean value indicating whether the enumeration happens in direct or backward order @param key (optional) The key at which to start iteration. If the key isn't present in the database, the enumeration starts at the key immediately greater than the provided one. The key can be a `NSData` or `NSString` @param predicate A `NSPredicate` instance tested against the values. The iteration block will only be called for keys associated to values matching the predicate. If `nil`, this is ignored. @param prefix A `NSString` or `NSData` prefix used to filter the keys. If provided, only the keys prefixed with this value will be iterated over. @param block The enumeration block used when iterating over all the keys. It takes three arguments: the first is a pointer to a `LevelDBKey` struct. You can convert this to a `NSString` or `NSData` instance, using `NSDataFromLevelDBKey(LevelDBKey *key)` and `NSStringFromLevelDBKey(LevelDBKey *key)` respectively. The second argument is the value associated with the key. The third arguments to the block is a `BOOL *` that can be used to stop enumeration at any time (e.g. `*stop = TRUE;`). */ - (void) enumerateKeysAndObjectsBackward:(BOOL)backward lazily:(BOOL)lazily startingAtKey:(id)key filteredByPredicate:(NSPredicate *)predicate andPrefix:(id)prefix usingBlock:(id)block; @end
33.78098
492
0.729739
[ "object" ]
1910a693c0a8240ac3fa174c5c292f9c9b9d140f
9,574
h
C
src/prod/src/ServiceGroup/Service/ServiceGroup.ServiceGroupCommonEventSource.h
gridgentoo/ServiceFabricAzure
c3e7a07617e852322d73e6cc9819d266146866a4
[ "MIT" ]
2,542
2018-03-14T21:56:12.000Z
2019-05-06T01:18:20.000Z
src/prod/src/ServiceGroup/Service/ServiceGroup.ServiceGroupCommonEventSource.h
gridgentoo/ServiceFabricAzure
c3e7a07617e852322d73e6cc9819d266146866a4
[ "MIT" ]
994
2019-05-07T02:39:30.000Z
2022-03-31T13:23:04.000Z
src/prod/src/ServiceGroup/Service/ServiceGroup.ServiceGroupCommonEventSource.h
gridgentoo/ServiceFabricAzure
c3e7a07617e852322d73e6cc9819d266146866a4
[ "MIT" ]
300
2018-03-14T21:57:17.000Z
2019-05-06T20:07:00.000Z
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #pragma once namespace ServiceGroup { #define DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(trace_name, ...) Common::TraceEventWriter<__VA_ARGS__> trace_name #define SERVICEGROUPCOMMON_STRUCTURED_TRACE(trace_name, trace_id, trace_level, ...) \ trace_name( \ Common::TraceTaskCodes::ServiceGroupCommon, \ trace_id, \ #trace_name, \ Common::LogLevel::trace_level, \ __VA_ARGS__) class ServiceGroupCommonEventSource { public: DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_0_OperationContext, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_0_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_0_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_1_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_2_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_3_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_1_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_2_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_4_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_3_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_4_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_5_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_6_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_5_ServiceGroupFactoryBuilder, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_7_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_6_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_7_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_8_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_9_ServiceGroupFactoryBuilder, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_0_ServiceGroupCommon, std::wstring, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_0_ServiceGroupCommon, std::wstring, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Warning_0_ServiceGroupCommon, std::wstring, uintptr_t, std::wstring); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_1_ServiceGroupCommon, std::wstring, uintptr_t, std::wstring, uint32, Common::Guid); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_1_ServiceGroupCommon, std::wstring, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_2_ServiceGroupCommon, std::wstring, uintptr_t, std::wstring, uint32, Common::Guid); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_2_ServiceGroupCommon, std::wstring, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_3_ServiceGroupCommon, std::wstring, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_4_ServiceGroupCommon, std::wstring, uintptr_t); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_3_ServiceGroupCommon, std::wstring, uintptr_t, std::wstring, uint32); DECLARE_SERVICEGROUPCOMMON_STRUCTURED_TRACE(ReplicaAlreadyClosed, std::wstring, uintptr_t, int64); ServiceGroupCommonEventSource() : SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_0_OperationContext, 4, Info, "this={0} - Cancel not supported", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_0_ServiceGroupFactoryBuilder, 5, Info, "this={0} - Adding stateless service factory", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_0_ServiceGroupFactoryBuilder, 6, Error, Common::TraceChannelType::Debug, "this={0} - Member service type name is invalid", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_1_ServiceGroupFactoryBuilder, 7, Error, Common::TraceChannelType::Debug, "this={0} - Service type {1} already registered as stateful (mixed mode not supported)", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_2_ServiceGroupFactoryBuilder, 8, Error, "this={0} - Could not store new factory for service type {1}", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_3_ServiceGroupFactoryBuilder, 9, Error, Common::TraceChannelType::Debug, "this={0} - Factory for service type {1} already added", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_1_ServiceGroupFactoryBuilder, 10, Info, "this={0} - Added stateless service factory for service type {1}", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_2_ServiceGroupFactoryBuilder, 11, Info, "this={0} - Adding stateful service factory", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_4_ServiceGroupFactoryBuilder, 12, Error, Common::TraceChannelType::Debug, "this={0} - Service type {1} already registered as stateless (mixed mode not supported)", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_3_ServiceGroupFactoryBuilder, 13, Info, "this={0} - Added stateful service factory for service type {1}", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_4_ServiceGroupFactoryBuilder, 14, Info, "this={0} - Removing factory", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_5_ServiceGroupFactoryBuilder, 15, Info, "this={0} - Removing stateless factory for service type {1}", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_6_ServiceGroupFactoryBuilder, 16, Info, "this={0} - Removing stateful factory for service type {1}", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_5_ServiceGroupFactoryBuilder, 17, Error, Common::TraceChannelType::Debug, "this={0} - Could not remove factory for service type {1}", "object", "memberServiceType"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_7_ServiceGroupFactoryBuilder, 18, Info, "this={0} - Building service group factory", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_6_ServiceGroupFactoryBuilder, 19, Error, "this={0} - Could not create stateful class factory", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_7_ServiceGroupFactoryBuilder, 20, Error, "this={0} - Could not initialize stateful class factory", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_8_ServiceGroupFactoryBuilder, 21, Error, "this={0} - Could not create stateless class factory", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_9_ServiceGroupFactoryBuilder, 22, Error, "this={0} - Could not initialize stateless class factory", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_0_ServiceGroupCommon, 23, Info, "this={1} - Update load metrics", "id", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_0_ServiceGroupCommon, 24, Error, Common::TraceChannelType::Debug, "this={1} - Metric name is invalid", "id", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Warning_0_ServiceGroupCommon, 25, Warning, Common::TraceChannelType::Debug, "this={1} - Metric {2} reported more than once", "id", "object", "name"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_1_ServiceGroupCommon, 26, Info, "this={1} - Metric ({2},{3}) reported by service member {4}", "id", "object", "name", "metricValue", "serviceReporting"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_1_ServiceGroupCommon, 27, Error, "this={1} - Could not store initial metrics", "id", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_2_ServiceGroupCommon, 28, Info, "this={1} - Metric ({2},{3}) reported by service member {4} has not changed", "id", "object", "name", "metricValue", "serviceReporting"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_2_ServiceGroupCommon, 29, Error, "this={1} - Could not store new metrics", "id", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_3_ServiceGroupCommon, 30, Error, Common::TraceChannelType::Debug, "this={1} Overflow metric", "id", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Error_4_ServiceGroupCommon, 31, Error, "this={1} - Could not compute metrics", "id", "object"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(Info_3_ServiceGroupCommon, 32, Info, "this={1} - Updated metric {2} value is {3}", "id", "object", "name", "updateMetricValue"), SERVICEGROUPCOMMON_STRUCTURED_TRACE(ReplicaAlreadyClosed, 33, Warning, Common::TraceChannelType::Debug, "this={1} replicaId={2} - Replica already closed", "id", "object", "replicaId") { } static ServiceGroupCommonEventSource const & GetEvents(); }; }
105.208791
249
0.757259
[ "object" ]
191c3c5c032bb39177022f7e49e2d67654e66f0e
185,425
h
C
cswinrt/code_writers.h
angelazhangmsft/CsWinRT
58e0224e985f87594c81dc0aaa124d18b2b8a54a
[ "MIT" ]
1
2022-02-11T16:49:13.000Z
2022-02-11T16:49:13.000Z
cswinrt/code_writers.h
angelazhangmsft/CsWinRT
58e0224e985f87594c81dc0aaa124d18b2b8a54a
[ "MIT" ]
null
null
null
cswinrt/code_writers.h
angelazhangmsft/CsWinRT
58e0224e985f87594c81dc0aaa124d18b2b8a54a
[ "MIT" ]
null
null
null
#pragma once #include <functional> #include <set> #include <filesystem> namespace cswinrt { using namespace winmd::reader; static inline bool starts_with(std::string_view const& value, std::string_view const& match) noexcept { return 0 == value.compare(0, match.size(), match); } static const struct { char const* csharp; char const* dotnet; } type_mappings[] = { {"bool", "Boolean"}, {"char", "Char"}, {"sbyte", "SByte"}, {"byte", "Byte"}, {"short", "Int16"}, {"ushort", "UInt16"}, {"int", "Int32"}, {"uint", "UInt32"}, {"long", "Int64"}, {"ulong", "UInt64"}, {"float", "Float"}, {"double", "Double"}, {"string", "String"}, }; auto to_csharp_type(fundamental_type type) { return type_mappings[(int)type].csharp; } auto to_dotnet_type(fundamental_type type) { return type_mappings[(int)type].dotnet; } auto get_delegate_type_suffix(fundamental_type type) { if (type == fundamental_type::String) { return "String"; } return type_mappings[(int)type].dotnet; } static std::string get_vmethod_name(writer& w, TypeDef const& type, MethodDef const& method) { uint32_t const vtable_base = type.MethodList().first.index(); uint32_t const vtable_index = method.index() - vtable_base; return w.write_temp("%_%", method.Name(), vtable_index); } bool is_type_blittable(type_semantics const& semantics) { return call(semantics, [&](object_type) { return false; }, [&](type_definition const& type) { switch (get_category(type)) { case category::enum_type: return true; case category::struct_type: if (auto mapping = get_mapped_type(type.TypeNamespace(), type.TypeName())) { return !mapping->requires_marshaling; } for (auto&& field : type.FieldList()) { if (!is_type_blittable(get_type_semantics(field.Signature().Type()))) { return false; } } return true; default: return false; } }, [&](generic_type_instance const& /*type*/) { return false; }, [&](fundamental_type const& type) { return (type != fundamental_type::String) && (type != fundamental_type::Char) && (type != fundamental_type::Boolean); }, [&](auto&&) { return true; }); } bool is_value_type(type_semantics const& semantics) { return call(semantics, [&](object_type) { return false; }, [&](type_definition const& type) { switch (get_category(type)) { case category::enum_type: return true; case category::struct_type: if (auto mapping = get_mapped_type(type.TypeNamespace(), type.TypeName())) { return true; } for (auto&& field : type.FieldList()) { if (!is_value_type(get_type_semantics(field.Signature().Type()))) { return false; } } return true; default: return false; } }, [&](generic_type_instance const& /*type*/) { return false; }, [&](fundamental_type const& type) { return (type != fundamental_type::String); }, [&](auto&&) { return true; }); } void write_fundamental_type(writer& w, fundamental_type type) { w.write(to_csharp_type(type)); } void write_projection_type(writer& w, type_semantics const& semantics); void write_generic_type_name_base(writer& w, uint32_t index) { write_projection_type(w, w.get_generic_arg_scope(index).first); } void write_generic_type_name(writer& w, uint32_t index) { w.write_generic_type_name_custom ? w.write_generic_type_name_custom(w, index) : write_generic_type_name_base(w, index); } template<typename TAction, typename TResult = std::invoke_result_t<TAction, type_definition>> TResult for_typedef(writer& w, type_semantics const& semantics, TAction action) { return call(semantics, [&](type_definition const& type) { return action(type); }, [&](generic_type_instance const& type) { auto guard{ w.push_generic_args(type) }; return action(type.generic_type); }, [](auto) { throw_invalid("type definition expected"); #pragma warning(disable:4702) return TResult(); }); } void write_typedef_name(writer& w, type_definition const& type, bool abiNamespace = false, bool forceWriteNamespace = false) { auto typeNamespace = type.TypeNamespace(); auto typeName = type.TypeName(); if (auto proj = get_mapped_type(typeNamespace, typeName)) { typeNamespace = proj->mapped_namespace; typeName = proj->mapped_name; } if (forceWriteNamespace || ((typeNamespace != w._current_namespace) || (abiNamespace != w._in_abi_namespace))) { w.write("global::"); if (abiNamespace) { w.write("ABI."); } w.write("%.", typeNamespace); } w.write("@", typeName); } void write_type_params(writer& w, TypeDef const& type) { if (distance(type.GenericParam()) == 0) { return; } separator s{ w }; uint32_t index = 0; w.write("<%>", bind_each([&](writer& w, GenericParam const& /*gp*/) { s(); write_generic_type_name(w, index++); }, type.GenericParam())); } void write_type_name(writer& w, type_semantics const& semantics, bool abiNamespace = false, bool forceWriteNamespace = false) { for_typedef(w, semantics, [&](auto type) { write_typedef_name(w, type, abiNamespace, forceWriteNamespace); write_type_params(w, type); }); } auto write_type_name_temp(writer& w, type_semantics const& type, char const* format = "%", bool abiNamespace = false) { return w.write_temp(format, bind<write_type_name>(type, abiNamespace, false)); } void write_projection_type(writer& w, type_semantics const& semantics) { call(semantics, [&](object_type) { w.write("object"); }, [&](guid_type) { w.write("Guid"); }, [&](type_type) { w.write("Type"); }, [&](type_definition const& type) { write_typedef_name(w, type); }, [&](generic_type_index const& var) { write_generic_type_name(w, var.index); }, [&](generic_type_instance const& type) { auto guard{ w.push_generic_args(type) }; w.write("%<%>", bind<write_projection_type>(type.generic_type), bind_list<write_projection_type>(", ", type.generic_args)); }, [&](generic_type_param const& param) { w.write(param.Name()); }, [&](fundamental_type const& type) { write_fundamental_type(w, type); }); } bool is_keyword(std::string_view str) { static constexpr std::string_view keywords[] = { "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class", "const", "continue", "decimal", "default", "delegate", "do", "double", "else", "enum", "event", "explicit", "extern", "false", "finally", "fixed", "float", "for", "foreach", "goto", "if", "implicit", "in", "int", "interface", "internal", "is", "lock", "long", "namespace", "new", "null", "object", "operator", "out", "override", "params", "private", "protected", "public", "readonly", "ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", "string", "struct", "switch", "this", "throw", "true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort", "using", "virtual", "void", "volatile", "while" }; #if 0 assert(std::is_sorted(std::begin(keywords), std::end(keywords))); #endif return std::binary_search(std::begin(keywords), std::end(keywords), str); } void write_escaped_identifier(writer& w, std::string_view identifier) { if (is_keyword(identifier)) { w.write("@"); } w.write(identifier); } void write_parameter_name(writer& w, method_signature::param_t const& param) { write_escaped_identifier(w, param.first.Name()); } void write_parameter_name_with_modifier(writer& w, method_signature::param_t const& param) { switch (get_param_category(param)) { case param_category::out: case param_category::receive_array: w.write("out "); break; default: break; } write_parameter_name(w, param); } void write_projection_parameter_type(writer& w, method_signature::param_t const& param) { auto semantics = get_type_semantics(param.second->Type()); switch (get_param_category(param)) { case param_category::in: w.write("%", bind<write_projection_type>(semantics)); break; case param_category::out: w.write("out %", bind<write_projection_type>(semantics)); break; case param_category::pass_array: case param_category::fill_array: w.write("%[]", bind<write_projection_type>(semantics)); break; case param_category::receive_array: w.write("out %[]", bind<write_projection_type>(semantics)); break; } } void write_projected_signature(writer& w, TypeSig const& type_sig) { write_projection_type(w, get_type_semantics(type_sig)); if(type_sig.is_szarray()) w.write("[]"); }; void write_projection_return_type(writer& w, method_signature const& signature) { if (auto return_sig = signature.return_signature()) { write_projected_signature(w, return_sig.Type()); } else { w.write("void"); } } void write_projection_parameter(writer& w, method_signature::param_t const& param) { w.write("% %", bind<write_projection_parameter_type>(param), bind<write_parameter_name>(param)); } void write_abi_type(writer& w, type_semantics const& semantics) { call(semantics, [&](object_type) { w.write("IntPtr"); }, [&](guid_type) { w.write("Guid"); }, [&](type_type) { throw_invalid("System.Type not implemented"); }, [&](type_definition const& type) { switch (get_category(type)) { case category::enum_type: write_type_name(w, type); break; case category::struct_type: write_type_name(w, type, !is_type_blittable(semantics)); break; default: w.write("IntPtr"); break; }; }, [&](generic_type_index const& var) { write_generic_type_name(w, var.index); }, [&](generic_type_instance const&) { w.write("IntPtr"); }, [&](generic_type_param const& param) { w.write(param.Name()); }, [&](fundamental_type type) { if (type == fundamental_type::String) { w.write("IntPtr"); } else { if (type == fundamental_type::Boolean) { type = fundamental_type::UInt8; } if (type == fundamental_type::Char) { type = fundamental_type::UInt16; } write_fundamental_type(w, type); } }); } void write_abi_parameter(writer& w, method_signature::param_t const& param) { auto semantics = get_type_semantics(param.second->Type()); auto param_name = w.write_temp("%", bind<write_parameter_name>(param)); switch (get_param_category(param)) { case param_category::in: w.write(", % %", bind<write_abi_type>(semantics), param_name); break; case param_category::out: w.write(settings.netstandard_compat ? ", out % %" : ", %* %", bind<write_abi_type>(semantics), param_name); break; case param_category::pass_array: case param_category::fill_array: w.write(", int __%Size, IntPtr %", param_name, param_name); break; case param_category::receive_array: w.write(settings.netstandard_compat ? ", out int __%Size, out IntPtr %" : ", int* __%Size, IntPtr* %", param_name, param_name); break; } } void write_abi_parameter_type(writer& w, method_signature::param_t const& param) { auto semantics = get_type_semantics(param.second->Type()); switch (get_param_category(param)) { case param_category::in: w.write(", %", bind<write_abi_type>(semantics)); break; case param_category::out: w.write(", out %", bind<write_abi_type>(semantics)); break; case param_category::pass_array: case param_category::fill_array: w.write(", int, IntPtr"); break; case param_category::receive_array: w.write(", out int, out IntPtr"); break; } } void write_abi_parameter_type_pointer(writer& w, method_signature::param_t const& param) { auto semantics = get_type_semantics(param.second->Type()); switch (get_param_category(param)) { case param_category::in: w.write(", %", bind<write_abi_type>(semantics)); break; case param_category::out: w.write(", %*", bind<write_abi_type>(semantics)); break; case param_category::pass_array: case param_category::fill_array: w.write(", int, IntPtr"); break; case param_category::receive_array: w.write(", int*, IntPtr*"); break; } } void write_abi_return(writer& w, method_signature const& signature) { if (auto return_sig = signature.return_signature()) { auto semantics = get_type_semantics(return_sig.Type()); auto return_param = w.write_temp("%", bind<write_escaped_identifier>(signature.return_param_name())); if (settings.netstandard_compat) { return_sig.Type().is_szarray() ? w.write(", out int __%Size, out IntPtr %", signature.return_param_name(), return_param) : w.write(", out % %", bind<write_abi_type>(semantics), return_param); } else { return_sig.Type().is_szarray() ? w.write(", int* __%Size, IntPtr* %", signature.return_param_name(), return_param) : w.write(", %* %", bind<write_abi_type>(semantics), return_param); } } } void write_abi_return_type(writer& w, method_signature const& signature) { if (auto return_sig = signature.return_signature()) { auto semantics = get_type_semantics(return_sig.Type()); return_sig.Type().is_szarray() ? w.write(", out int, out IntPtr") : w.write(", out %", bind<write_abi_type>(semantics)); } } void write_abi_return_type_pointer(writer& w, method_signature const& signature) { if (auto return_sig = signature.return_signature()) { auto semantics = get_type_semantics(return_sig.Type()); return_sig.Type().is_szarray() ? w.write(", int*, IntPtr*") : w.write(", %*", bind<write_abi_type>(semantics)); } } void write_abi_parameters(writer& w, method_signature const& signature) { w.write("IntPtr thisPtr"); for (auto&& param : signature.params()) { write_abi_parameter(w, param); } write_abi_return(w, signature); } void write_abi_parameter_types(writer& w, method_signature const& signature) { w.write("IntPtr"); for (auto&& param : signature.params()) { write_abi_parameter_type(w, param); } write_abi_return_type(w, signature); } void write_abi_parameter_types_pointer(writer& w, method_signature const& signature) { w.write("IntPtr"); for (auto&& param : signature.params()) { write_abi_parameter_type_pointer(w, param); } write_abi_return_type_pointer(w, signature); } bool abi_signature_has_generic_parameters(writer& w, method_signature const& signature) { bool signature_has_generic_parameters{}; writer::write_generic_type_name_guard g(w, [&](writer& /*w*/, uint32_t /*index*/) { signature_has_generic_parameters = true; }); auto _ = w.write_temp("%", bind<write_abi_parameters>(signature)); return signature_has_generic_parameters; } template<typename write_params> void write_event_params(writer& w, row_base<Event>::value_type const& evt, write_params params) { method_signature add_sig{ std::get<0>(get_event_methods(evt)) }; auto semantics = get_type_semantics(add_sig.params().at(0).second->Type()); if (auto td = std::get_if<type_definition>(&semantics)) { method_signature invoke_sig{ get_delegate_invoke(*td) }; if (invoke_sig.params().size() > 0) { params(w, invoke_sig); } } else if (auto gti = std::get_if<generic_type_instance>(&semantics)) { auto guard{ w.push_generic_args(*gti) }; method_signature invoke_sig{ get_delegate_invoke(gti->generic_type) }; params(w, invoke_sig); } } void write_event_param_types(writer& w, row_base<Event>::value_type const& evt) { auto write_params = [](writer& w, method_signature const& invoke_sig) { w.write("<%>", bind_list<write_projection_parameter_type>(", ", invoke_sig.params())); }; write_event_params(w, evt, write_params); } void write_delegate_abi_call(writer& w, TypeDef const& type, std::string_view call, std::string_view name) { w.write("%%.%(%)", bind<write_typedef_name>(type, true, false), bind<write_type_params>(type), call, name); } void write_object_marshal_from_abi(writer& w, type_semantics const& param_type, TypeDef const& type, std::string_view name, bool is_boxed = false) { switch (get_category(type)) { case category::enum_type: { if (is_boxed) { w.write("(%)", bind<write_type_name>(type, false, false)); } w.write("%", name); return; } case category::delegate_type: { write_delegate_abi_call(w, type, "FromAbi", name); return; } case category::struct_type: { if (is_type_blittable(param_type)) { w.write("%", name); } else { w.write("%.FromAbi(%)", bind<write_type_name>(param_type, true, true), name); } return; } case category::interface_type: { w.write("MarshalInterface<%>.FromAbi(%)", bind<write_type_name>(type, false, false), name); return; } case category::class_type: { w.write("%.FromAbi(%)", bind<write_projection_type>(param_type), name); return; } } } void write_fundamental_marshal_to_abi(writer& w, fundamental_type type, std::string_view name) { switch (type) { case fundamental_type::String: w.write("%.Handle", name); break; case fundamental_type::Boolean: w.write("(byte)(% ? 1 : 0)", name); break; case fundamental_type::Char: w.write("(ushort)%", name); break; default: w.write("%", name); break; } } void write_fundamental_marshal_from_abi(writer& w, fundamental_type type, std::string_view name, bool is_boxed = false) { if (type == fundamental_type::String) { w.write(R"(MarshalString.FromAbi(%))", name); } else if (type == fundamental_type::Boolean) { w.write(is_boxed ? "((byte)(object)% != 0)" : "(% != 0)", name); } else if (type == fundamental_type::Char) { w.write(is_boxed ? "(char)(ushort)(object)%" : "(char)%", name); } else if (is_boxed) { w.write("(%)(object)%", bind<write_fundamental_type>(type), name); } else { w.write("%", name); } } void write_class_modifiers(writer& w, TypeDef const& type) { if (is_static(type)) { w.write("static "); return; } if (type.Flags().Sealed()) { w.write("sealed "); } } void write_method(writer& w, method_signature signature, std::string_view method_name, std::string_view return_type, std::string_view method_target, std::string_view access_spec = ""sv, std::string_view method_spec = ""sv) { w.write(R"( %%% %(%) => %.%(%); )", access_spec, method_spec, return_type, method_name, bind_list<write_projection_parameter>(", ", signature.params()), method_target, method_name, bind_list<write_parameter_name_with_modifier>(", ", signature.params()) ); } void write_explicitly_implemented_method(writer& w, MethodDef const& method, std::string_view return_type, TypeDef const& method_interface, std::string_view method_target) { method_signature signature{ method }; w.write(R"( % %.%(%) => %.%(%); )", return_type, bind<write_type_name>(method_interface, false, false), method.Name(), bind_list<write_projection_parameter>(", ", signature.params()), method_target, method.Name(), bind_list<write_parameter_name_with_modifier>(", ", signature.params()) ); } void write_class_method(writer& w, MethodDef const& method, TypeDef const& class_type, bool is_overridable, bool is_protected, std::string_view interface_member) { if (method.SpecialName()) { return; } auto access_spec = is_protected || is_overridable ? "protected " : "public "; std::string method_spec = ""; // If this interface is overridable but the type is sealed, don't mark the member as virtual. // The C# compiler errors out about declaring a virtual member in a sealed class. if (is_overridable && !class_type.Flags().Sealed()) { // All overridable methods in the WinRT type system have protected visibility. access_spec = "protected "; method_spec = "virtual "; } method_signature signature{ method }; auto raw_return_type = w.write_temp("%", [&](writer& w) { write_projection_return_type(w, signature); }); auto return_type = raw_return_type; if (method.Name() == "ToString") { method_spec += "new "; if (signature.params().empty()) { if (auto ret = signature.return_signature()) { auto semantics = get_type_semantics(ret.Type()); if (auto ft = std::get_if<fundamental_type>(&semantics)) { if (*ft == fundamental_type::String) { method_spec = "override "; return_type = "string"; } } } } } write_method(w, signature, method.Name(), return_type, interface_member, access_spec, method_spec); if (is_overridable || !is_exclusive_to(method.Parent())) { w.write(R"( % %.%(%) => %(%);)", bind<write_projection_return_type>(signature), bind<write_type_name>(method.Parent(), false, false), method.Name(), bind_list<write_projection_parameter>(", ", signature.params()), method.Name(), bind_list<write_parameter_name_with_modifier>(", ", signature.params()) ); } } void write_property(writer& w, std::string_view external_prop_name, std::string_view prop_name, std::string_view prop_type, std::string_view getter_target, std::string_view setter_target, std::string_view access_spec = ""sv, std::string_view method_spec = ""sv) { if (setter_target.empty()) { w.write(R"( %%% % => %.%; )", access_spec, method_spec, prop_type, external_prop_name, getter_target, prop_name); } else { w.write(R"( %%% % { get => %.%; set => %.% = value; } )", access_spec, method_spec, prop_type, external_prop_name, getter_target, prop_name, setter_target, prop_name); } } std::string write_as_cast(writer& w, TypeDef const& iface, bool as_abi) { return w.write_temp(as_abi ? "As<%>()" : "AsInternal(new InterfaceTag<%>())", bind<write_type_name>(iface, as_abi, false)); } void write_lazy_interface_initialization(writer& w, TypeDef const& type) { for (auto&& ii : type.InterfaceImpl()) { if (has_attribute(ii, "Windows.Foundation.Metadata", "DefaultAttribute")) { continue; } for_typedef(w, get_type_semantics(ii.Interface()), [&](auto interface_type) { auto interface_name = write_type_name_temp(w, interface_type); auto interface_abi_name = write_type_name_temp(w, interface_type, "%", true); w.write(R"( {typeof(%), new Lazy<%>(() => new %(GetReferenceForQI()))},)", interface_name, interface_abi_name, interface_abi_name); }); } } std::string write_explicit_name(writer& w, TypeDef const& iface, std::string_view name) { return w.write_temp("%.%", write_type_name_temp(w, iface), name); } std::string write_prop_type(writer& w, Property const& prop) { return w.write_temp("%", bind<write_projected_signature>(prop.Type().Type())); } void write_explicitly_implemented_property(writer& w, Property const& prop, TypeDef const& iface, bool as_abi) { auto prop_target = write_as_cast(w, iface, as_abi); auto [getter, setter] = get_property_methods(prop); auto getter_target = getter ? prop_target : ""; auto setter_target = setter ? prop_target : ""; write_property(w, write_explicit_name(w, iface, prop.Name()), prop.Name(), write_prop_type(w, prop), getter_target, setter_target); } void write_event(writer& w, std::string_view external_event_name, Event const& event, std::string_view event_target, std::string_view access_spec = ""sv, std::string_view method_spec = ""sv) { auto event_type = w.write_temp("%", bind<write_type_name>(get_type_semantics(event.EventType()), false, false)); // ICommand has a lower-fidelity type mapping where the type of the event handler doesn't project one-to-one // so we need to hard-code mapping the event handler from the mapped WinRT type to the correct .NET type. if (event.Name() == "CanExecuteChanged" && event_type == "global::System.EventHandler<object>") { event_type = "global::System.EventHandler"; } w.write(R"( %%event % % { add => %.% += value; remove => %.% -= value; } )", access_spec, method_spec, event_type, external_event_name, event_target, event.Name(), event_target, event.Name()); } void write_explicitly_implemented_event(writer& w, Event const& evt, TypeDef const& iface, bool as_abi) { write_event(w, write_explicit_name(w, iface, evt.Name()), evt, write_as_cast(w, iface, as_abi)); } void write_class_event(writer& w, Event const& event, bool is_overridable, bool is_protected, std::string_view interface_member) { auto visibility = "public "; if (is_protected) { visibility = "protected "; } if (is_overridable) { visibility = "protected virtual "; } write_event(w, event.Name(), event, interface_member, visibility); if (is_overridable || !is_exclusive_to(event.Parent())) { write_event(w, w.write_temp("%.%", bind<write_type_name>(event.Parent(), false, false), event.Name()), event, "this"); } } struct attributed_type { TypeDef type; bool activatable{}; bool statics{}; bool composable{}; bool visible{}; }; static auto get_attributed_types(writer& w, TypeDef const& type) { auto get_system_type = [&](auto&& signature) -> TypeDef { for (auto&& arg : signature.FixedArgs()) { if (auto type_param = std::get_if<ElemSig::SystemType>(&std::get<ElemSig>(arg.value).value)) { return type.get_cache().find_required(type_param->name); } } return {}; }; std::map<std::string, attributed_type> result; for (auto&& attribute : type.CustomAttribute()) { auto attribute_name = attribute.TypeNamespaceAndName(); if (attribute_name.first != "Windows.Foundation.Metadata") { continue; } auto signature = attribute.Value(); attributed_type info; if (attribute_name.second == "ActivatableAttribute") { info.type = get_system_type(signature); info.activatable = true; } else if (attribute_name.second == "StaticAttribute") { info.type = get_system_type(signature); info.statics = true; } else if (attribute_name.second == "ComposableAttribute") { info.type = get_system_type(signature); info.composable = true; for (auto&& arg : signature.FixedArgs()) { if (auto visibility = std::get_if<ElemSig::EnumValue>(&std::get<ElemSig>(arg.value).value)) { info.visible = std::get<int32_t>(visibility->value) == 2; break; } } } else { continue; } std::string name; if (info.type) { name = w.write_temp("%", info.type.TypeName()); } result[name] = std::move(info); } return result; } void write_composing_factory_method(writer& w, MethodDef const& method); void write_abi_method_with_raw_return_type(writer& w, MethodDef const& method); template<auto method_writer> std::string write_factory_cache_object(writer& w, TypeDef const& factory_type, TypeDef const& class_type); std::string write_static_cache_object(writer& w, std::string_view cache_type_name, TypeDef const& class_type) { w.write(R"( internal class _% : ABI.%.% { public _%() : base(%._factory._As<ABI.%.%.Vftbl>()) { } private static WeakLazy<_%> _instance = new WeakLazy<_%>(); internal static % Instance => _instance.Value; } )", cache_type_name, class_type.TypeNamespace(), cache_type_name, cache_type_name, class_type.TypeName(), class_type.TypeNamespace(), cache_type_name, cache_type_name, cache_type_name, cache_type_name); return w.write_temp("_%.Instance", cache_type_name); } static std::string get_default_interface_name(writer& w, TypeDef const& type, bool abiNamespace = true) { return w.write_temp("%", bind<write_type_name>(get_type_semantics(get_default_interface(type)), abiNamespace, false)); } void write_factory_constructors(writer& w, TypeDef const& factory_type, TypeDef const& class_type) { auto default_interface_name = get_default_interface_name(w, class_type); if (factory_type) { auto cache_object = write_factory_cache_object<write_abi_method_with_raw_return_type>(w, factory_type, class_type); for (auto&& method : factory_type.MethodList()) { method_signature signature{ method }; w.write(R"( public %(%) : this(((Func<%>)(() => { IntPtr ptr = (%.%(%)); try { return new %(ComWrappersSupport.GetObjectReferenceForInterface(ptr)); } finally { MarshalInspectable.DisposeAbi(ptr); } }))()) { ComWrappersSupport.RegisterObjectForInterface(this, ThisPtr); } )", class_type.TypeName(), bind_list<write_projection_parameter>(", ", signature.params()), default_interface_name, cache_object, method.Name(), bind_list<write_parameter_name_with_modifier>(", ", signature.params()), default_interface_name); } } else { w.write(R"( public %() : this(new %(ActivationFactory<%>.ActivateInstance<%.Vftbl>())) { ComWrappersSupport.RegisterObjectForInterface(this, ThisPtr); } )", class_type.TypeName(), default_interface_name, class_type.TypeName(), default_interface_name); } } void write_composable_constructors(writer& w, TypeDef const& composable_type, TypeDef const& class_type, std::string_view visibility) { auto cache_object = write_factory_cache_object<write_composing_factory_method>(w, composable_type, class_type); auto default_interface_name = get_default_interface_name(w, class_type); for (auto&& method : composable_type.MethodList()) { method_signature signature{ method }; bool has_base_type = !std::holds_alternative<object_type>(get_type_semantics(class_type.Extends())); auto params_without_objects = signature.params(); params_without_objects.pop_back(); params_without_objects.pop_back(); w.write(R"( % %(%)% { object baseInspectable = this.GetType() != typeof(%) ? this : null; IntPtr composed = %.%(%%baseInspectable, out IntPtr ptr); using IObjectReference composedRef = ObjectReference<IUnknownVftbl>.Attach(ref composed); try { _inner = ComWrappersSupport.GetObjectReferenceForInterface(ptr); var defaultInterface = new %(_inner); _defaultLazy = new Lazy<%>(() => defaultInterface); _lazyInterfaces = new Dictionary<Type, object>() {% }; ComWrappersSupport.RegisterObjectForInterface(this, ThisPtr); } finally { MarshalInspectable.DisposeAbi(ptr); } } )", visibility, class_type.TypeName(), bind_list<write_projection_parameter>(", ", params_without_objects), has_base_type ? ":base(global::WinRT.DerivedComposed.Instance)" : "", bind<write_type_name>(class_type, false, false), cache_object, method.Name(), bind_list<write_parameter_name_with_modifier>(", ", params_without_objects), [&](writer& w) {w.write("%", params_without_objects.empty() ? " " : ", "); }, default_interface_name, default_interface_name, bind<write_lazy_interface_initialization>(class_type)); } } void write_static_method(writer& w, MethodDef const& method, std::string_view method_target) { if (method.SpecialName()) { return; } method_signature signature{ method }; auto return_type = w.write_temp("%", [&](writer& w) { write_projection_return_type(w, signature); }); write_method(w, signature, method.Name(), return_type, method_target, "public "sv, "static "sv); } void write_static_property(writer& w, Property const& prop, std::string_view prop_target) { auto [getter, setter] = get_property_methods(prop); auto getter_target = getter ? prop_target : ""; auto setter_target = setter ? prop_target : ""; write_property(w, prop.Name(), prop.Name(), write_prop_type(w, prop), getter_target, setter_target, "public "sv, "static "sv); } void write_static_event(writer& w, Event const& event, std::string_view event_target) { write_event(w, event.Name(), event, event_target, "public "sv, "static "sv); } void write_static_members(writer& w, TypeDef const& static_type, TypeDef const& class_type) { auto cache_object = write_static_cache_object(w, static_type.TypeName(), class_type); w.write_each<write_static_method>(static_type.MethodList(), cache_object); w.write_each<write_static_property>(static_type.PropertyList(), cache_object); w.write_each<write_static_event>(static_type.EventList(), cache_object); } void write_attributed_types(writer& w, TypeDef const& type) { bool factory_written{}; for (auto&& [interface_name, factory] : get_attributed_types(w, type)) { if (factory.activatable) { write_factory_constructors(w, factory.type, type); } else if (factory.composable) { write_composable_constructors(w, factory.type, type, factory.visible ? "public"sv : "protected"sv); } else if (factory.statics) { if (!factory_written) { factory_written = true; bool has_base_factory{}; auto extends = type.Extends(); while(!has_base_factory) { auto base_semantics = get_type_semantics(extends); if (std::holds_alternative<object_type>(base_semantics)) { break; } for_typedef(w, base_semantics, [&](auto base_type) { for (auto&& [_, base_factory] : get_attributed_types(w, base_type)) { if (base_factory.statics) { has_base_factory = true; break; } } extends = base_type.Extends(); }); } w.write(R"( internal static %BaseActivationFactory _factory = new BaseActivationFactory("%", "%.%"); public static %I As<I>() => _factory.AsInterface<I>(); )", has_base_factory ? "new " : "", type.TypeNamespace(), type.TypeNamespace(), type.TypeName(), has_base_factory ? "new " : ""); } write_static_members(w, factory.type, type); } } } void write_nongeneric_enumerable_members(writer& w, std::string_view target) { w.write(R"( IEnumerator IEnumerable.GetEnumerator() => %.GetEnumerator(); )", target); } void write_enumerable_members(writer& w, std::string_view target, bool include_nongeneric) { auto element = w.write_temp("%", bind<write_generic_type_name>(0)); w.write(R"( public IEnumerator<%> GetEnumerator() => %.GetEnumerator(); )", element, target); if (!include_nongeneric) return; w.write(R"( IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); )"); } void write_enumerator_members(writer& w, std::string_view target) { auto element = w.write_temp("%", bind<write_generic_type_name>(0)); w.write(R"( public bool MoveNext() => %.MoveNext(); public void Reset() => %.Reset(); public void Dispose() => %.Dispose(); public % Current => %.Current; object IEnumerator.Current => Current; )", target, target, target, element, target); } void write_readonlydictionary_members(writer& w, std::string_view target, bool include_enumerable) { auto key = w.write_temp("%", bind<write_generic_type_name>(0)); auto value = w.write_temp("%", bind<write_generic_type_name>(1)); w.write(R"( public IEnumerable<%> Keys => %.Keys; public IEnumerable<%> Values => %.Values; public int Count => %.Count; public % this[% key] => %[key]; public bool ContainsKey(% key) => %.ContainsKey(key); public bool TryGetValue(% key, out % value) => %.TryGetValue(key, out value); )", key, target, value, target, target, value, key, target, key, target, key, value, target); if (!include_enumerable) return; w.write(R"( public IEnumerator<KeyValuePair<%, %>> GetEnumerator() => %.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); )", key, value, target); } void write_dictionary_members(writer& w, std::string_view target, bool include_enumerable) { auto key = w.write_temp("%", bind<write_generic_type_name>(0)); auto value = w.write_temp("%", bind<write_generic_type_name>(1)); w.write(R"( public ICollection<%> Keys => %.Keys; public ICollection<%> Values => %.Values; public int Count => %.Count; public bool IsReadOnly => %.IsReadOnly; public % this[% key] { get => %[key]; set => %[key] = value; } public void Add(% key, % value) => %.Add(key, value); public bool ContainsKey(% key) => %.ContainsKey(key); public bool Remove(% key) => %.Remove(key); public bool TryGetValue(% key, out % value) => %.TryGetValue(key, out value); public void Add(KeyValuePair<%, %> item) => %.Add(item); public void Clear() => %.Clear(); public bool Contains(KeyValuePair<%, %> item) => %.Contains(item); public void CopyTo(KeyValuePair<%, %>[] array, int arrayIndex) => %.CopyTo(array, arrayIndex); bool ICollection<KeyValuePair<%, %>>.Remove(KeyValuePair<%, %> item) => %.Remove(item); )", key, target, value, target, target, target, value, key, target, target, key, value, target, key, target, key, target, key, value, target, key, value, target, target, key, value, target, key, value, target, key, value, key, value, target); if (!include_enumerable) return; w.write(R"( public IEnumerator<KeyValuePair<%, %>> GetEnumerator() => %.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); )", key, value, target); } void write_readonlylist_members(writer& w, std::string_view target, bool include_enumerable) { auto element = w.write_temp("%", bind<write_generic_type_name>(0)); w.write(R"( public int Count => %.Count; [global::System.Runtime.CompilerServices.IndexerName("ReadOnlyListItem")] public % this[int index] => %[index]; )", target, element, target); if (!include_enumerable) return; w.write(R"( public IEnumerator<%> GetEnumerator() => %.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); )", element, target); } void write_nongeneric_list_members(writer& w, std::string_view target, bool include_enumerable) { w.write(R"( public int Count => %.Count; public bool IsSynchronized => %.IsSynchronized; public object SyncRoot => %.SyncRoot; public void CopyTo(Array array, int index) => %.CopyTo(array, index); [global::System.Runtime.CompilerServices.IndexerName("NonGenericListItem")] public object this[int index] { get => %[index]; set => %[index] = value; } public bool IsFixedSize => %.IsFixedSize; public bool IsReadOnly => %.IsReadOnly; public int Add(object value) => %.Add(value); public void Clear() => %.Clear(); public bool Contains(object value) => %.Contains(value); public int IndexOf(object value) => %.IndexOf(value); public void Insert(int index, object value) => %.Insert(index, value); public void Remove(object value) => %.Remove(value); public void RemoveAt(int index) => %.RemoveAt(index); )", target, target, target, target, target, target, target, target, target, target, target, target, target, target, target); if (!include_enumerable) return; w.write(R"( IEnumerator IEnumerable.GetEnumerator() => %.GetEnumerator(); )", target); } void write_list_members(writer& w, std::string_view target, bool include_enumerable) { auto element = w.write_temp("%", bind<write_generic_type_name>(0)); w.write(R"( public int Count => %.Count; public bool IsReadOnly => %.IsReadOnly; [global::System.Runtime.CompilerServices.IndexerName("ListItem")] public % this[int index] { get => %[index]; set => %[index] = value; } public int IndexOf(% item) => %.IndexOf(item); public void Insert(int index, % item) => %.Insert(index, item); public void RemoveAt(int index) => %.RemoveAt(index); public void Add(% item) => %.Add(item); public void Clear() => %.Clear(); public bool Contains(% item) => %.Contains(item); public void CopyTo(%[] array, int arrayIndex) => %.CopyTo(array, arrayIndex); public bool Remove(% item) => %.Remove(item); )", target, target, element, target, target, element, target, element, target, target, element, target, target, element, target, element, target, element, target); if (!include_enumerable) return; w.write(R"( public IEnumerator<%> GetEnumerator() => %.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); )", element, target); } void write_idisposable_members(writer& w, std::string_view target) { w.write(R"( public void Dispose() => %.Dispose(); )", target); } void write_custom_mapped_type_members(writer& w, std::string_view target, mapped_type const& mapping) { if (mapping.abi_name == "IIterable`1") { write_enumerable_members(w, target, true); } else if (mapping.abi_name == "IIterator`1") { write_enumerator_members(w, target); } else if (mapping.abi_name == "IMapView`2") { write_readonlydictionary_members(w, target, false); } else if (mapping.abi_name == "IMap`2") { write_dictionary_members(w, target, false); } else if (mapping.abi_name == "IVectorView`1") { write_readonlylist_members(w, target, false); } else if (mapping.abi_name == "IVector`1") { write_list_members(w, target, false); } else if (mapping.abi_name == "IBindableIterable") { write_nongeneric_enumerable_members(w, target); } else if (mapping.abi_name == "IBindableVector") { write_nongeneric_list_members(w, target, false); } else if (mapping.mapped_namespace == "System" && mapping.mapped_name == "IDisposable") { write_idisposable_members(w, target); } } std::pair<std::string, bool> find_property_interface(writer& w, TypeDef const& setter_iface, std::string_view prop_name) { std::string getter_iface; auto search_interface = [&](TypeDef const& type) { for (auto&& prop : type.PropertyList()) { if (prop.Name() == prop_name) { getter_iface = write_type_name_temp(w, type, "%", true); return true; } } return false; }; std::function<bool(TypeDef const&)> search_interfaces = [&](TypeDef const& type) { for (auto&& iface : type.InterfaceImpl()) { auto semantics = get_type_semantics(iface.Interface()); if (for_typedef(w, semantics, [&](auto&& type) { return (setter_iface != type) && (search_interface(type) || search_interfaces(type)); })) { return true; } } return false; }; // first search base interfaces for property getter if (search_interfaces(setter_iface)) { return { getter_iface, true }; } // then search peer exclusive-to interfaces and their bases if (auto exclusive_to_attr = get_attribute(setter_iface, "Windows.Foundation.Metadata", "ExclusiveToAttribute")) { auto sig = exclusive_to_attr.Value(); auto const& fixed_args = sig.FixedArgs(); XLANG_ASSERT(fixed_args.size() == 1); auto sys_type = std::get<ElemSig::SystemType>(std::get<ElemSig>(fixed_args[0].value).value); auto exclusive_to_type = setter_iface.get_cache().find_required(sys_type.name); if (search_interfaces(exclusive_to_type)) { return { getter_iface, false }; } } throw_invalid("Could not find property getter interface"); } void write_class_members(writer& w, TypeDef const& type) { std::map<std::string_view, std::tuple<std::string, std::string, std::string, bool, bool>> properties; for (auto&& ii : type.InterfaceImpl()) { auto semantics = get_type_semantics(ii.Interface()); auto write_class_interface = [&](TypeDef const& interface_type) { auto interface_name = write_type_name_temp(w, interface_type); auto interface_abi_name = write_type_name_temp(w, interface_type, "%", true); auto is_default_interface = has_attribute(ii, "Windows.Foundation.Metadata", "DefaultAttribute"); auto target = is_default_interface ? "_default" : write_type_name_temp(w, interface_type, "AsInternal(new InterfaceTag<%>())"); if (!is_default_interface) { w.write(R"( private % AsInternal(InterfaceTag<%> _) => ((Lazy<%>)_lazyInterfaces[typeof(%)]).Value; )", interface_name, interface_name, interface_abi_name, interface_name); } if(auto mapping = get_mapped_type(interface_type.TypeNamespace(), interface_type.TypeName()); mapping && mapping->has_custom_members_output) { write_custom_mapped_type_members(w, target, *mapping); return; } auto is_overridable_interface = has_attribute(ii, "Windows.Foundation.Metadata", "OverridableAttribute"); auto is_protected_interface = has_attribute(ii, "Windows.Foundation.Metadata", "ProtectedAttribute"); w.write_each<write_class_method>(interface_type.MethodList(), type, is_overridable_interface, is_protected_interface, target); w.write_each<write_class_event>(interface_type.EventList(), is_overridable_interface, is_protected_interface, target); // Merge property getters/setters, since such may be defined across interfaces // Since a property has to either be overridable or not, for (auto&& prop : interface_type.PropertyList()) { MethodDef getter, setter; std::tie(getter, setter) = get_property_methods(prop); auto prop_type = write_prop_type(w, prop); auto [prop_targets, inserted] = properties.try_emplace(prop.Name(), prop_type, getter ? target : "", setter ? target : "", is_overridable_interface, !is_protected_interface && !is_overridable_interface // By default, an overridable member is protected. ); if (!inserted) { auto& [property_type, getter_target, setter_target, is_overridable, is_public] = prop_targets->second; XLANG_ASSERT(property_type == prop_type); if (getter) { XLANG_ASSERT(getter_target.empty()); getter_target = target; } if (setter) { XLANG_ASSERT(setter_target.empty()); setter_target = target; } is_overridable |= is_overridable_interface; is_public |= !is_overridable_interface && !is_protected_interface; XLANG_ASSERT(!getter_target.empty() || !setter_target.empty()); } // If this interface is overridable then we need to emit an explicit implementation of the property for that interface. if (is_overridable_interface || !is_exclusive_to(interface_type)) { w.write("% %.% {%%}", prop_type, bind<write_type_name>(interface_type, false, false), prop.Name(), bind([&](writer& w) { if (getter || find_property_interface(w, interface_type, prop.Name()).second) { w.write("get => %; ", prop.Name()); } }), bind([&](writer& w) { if (setter) { w.write("set => % = value; ", prop.Name()); } })); } } }; for_typedef(w, semantics, [&](auto type) { write_class_interface(type); }); } // Write properties with merged accessors for (auto& [prop_name, prop_data] : properties) { auto& [prop_type, getter_target, setter_target, is_overridable, is_public] = prop_data; std::string_view access_spec = is_public ? "public "sv : "protected "sv; std::string_view method_spec = is_overridable ? "virtual "sv : ""sv; write_property(w, prop_name, prop_name, prop_type, getter_target, setter_target, access_spec, method_spec); } } void write_winrt_attribute(writer& w, TypeDef const& type) { std::filesystem::path db_path(type.get_database().path()); w.write(R"([global::WinRT.WindowsRuntimeType("%")] )", db_path.stem().string()); } void write_static_class(writer& w, TypeDef const& type) { w.write(R"(%public static class % { %})", bind<write_winrt_attribute>(type), bind<write_type_name>(type, false, false), bind<write_attributed_types>(type) ); } void write_event_source_ctors(writer& w, TypeDef const& type) { uint32_t const vtable_base = type.MethodList().first.index(); for (auto&& evt : type.EventList()) { auto [add, remove] = get_event_methods(evt); w.write(R"( _% = new EventSource<%>(_obj, _obj.Vftbl.%, _obj.Vftbl.%);)", evt.Name(), bind<write_type_name>(get_type_semantics(evt.EventType()), false, false), get_vmethod_name(w, type, add), get_vmethod_name(w, type, remove)); } } void write_event_sources(writer& w, TypeDef const& type) { for (auto&& evt : type.EventList()) { w.write(R"( private EventSource<%> _%;)", bind<write_type_name>(get_type_semantics(evt.EventType()), false, false), evt.Name()); } } void write_interface_member_signatures(writer& w, TypeDef const& type) { for (auto&& method : type.MethodList()) { if (is_special(method)) { continue; } method_signature signature{ method }; w.write(R"( % %(%);)", bind<write_projection_return_type>(signature), method.Name(), bind_list<write_projection_parameter>(", ", signature.params()) ); } for (auto&& prop : type.PropertyList()) { auto [getter, setter] = get_property_methods(prop); // "new" required if overriding a getter in a base interface auto new_keyword = (!getter && setter && find_property_interface(w, type, prop.Name()).second) ? "new " : ""; w.write(R"( %% % {%% })", new_keyword, write_prop_type(w, prop), prop.Name(), getter || setter ? " get;" : "", setter ? " set;" : "" ); } for (auto&& evt : type.EventList()) { w.write(R"( event % %;)", bind<write_type_name>(get_type_semantics(evt.EventType()), false, false), evt.Name()); } } struct abi_marshaler { std::string param_name; int param_index; param_category category; bool is_return; std::string param_type; std::string local_type; std::string marshaler_type; bool is_value_type; bool is_out() const { return (category == param_category::out) || (category == param_category::receive_array); } bool is_ref() const { return (category == param_category::fill_array); } bool is_generic() const { return param_index > -1; } bool is_array() const { return category >= param_category::pass_array; } bool is_object_in() const { return (category == param_category::in) && marshaler_type.empty() && local_type == "IntPtr"; } std::string get_marshaler_local(writer& w) const { return w.write_temp("__%", param_name); } std::string get_param_local(writer& w) const { if (!is_generic()) { return is_array() ? w.write_temp("(__%_length, __%_data)", param_name, param_name) : get_marshaler_local(w); } return is_array() ? w.write_temp("(__params[%], __params[%])", param_index, param_index + 1) : w.write_temp("__params[%]", param_index); } void write_locals(writer& w) const { if (is_generic()) { if (!is_out() && !marshaler_type.empty()) { w.write("% __% = default;\n", local_type, param_name); } return; } if (is_object_in() || local_type.empty()) return; if (!is_array() || !is_out()) { w.write("% __% = default;\n", local_type, param_name); } if (is_array()) { w.write("int __%_length = default;\n", param_name); w.write("IntPtr __%_data = default;\n", param_name); } } void write_create(writer& w, std::string_view source) const { w.write("%.CreateMarshaler%(%)", marshaler_type, is_array() ? "Array" : "", source); } auto get_escaped_param_name(writer& w) const { return w.write_temp("%", bind<write_escaped_identifier>(param_name)); } void write_assignments(writer& w) const { if (is_object_in() || is_out() || local_type.empty()) return; w.write("% = %.CreateMarshaler%(%);\n", get_marshaler_local(w), marshaler_type, is_array() ? "Array" : "", bind<write_escaped_identifier>(param_name)); if (is_generic() || is_array()) { w.write("% = %.GetAbi%(%);\n", get_param_local(w), marshaler_type, is_array() ? "Array" : "", get_marshaler_local(w)); } } void write_marshal_to_abi(writer& w, std::string_view source = "") const { if (!is_generic()) { if (is_array()) { w.write("%__%_length, %__%_data", is_out() ? "out " : "", param_name, is_out() ? "out " : "", param_name); return; } if (is_out()) { w.write("%__%", "out ", param_name); return; } if (is_object_in()) { w.write("%%.ThisPtr", source, bind<write_escaped_identifier>(param_name)); return; } if (marshaler_type.empty()) { if (param_type == "bool") { w.write("(byte)(%% ? 1 : 0)", source, bind<write_escaped_identifier>(param_name)); return; } if (param_type == "char") { w.write("(ushort)%%", source, bind<write_escaped_identifier>(param_name)); return; } w.write("%%", source, bind<write_escaped_identifier>(param_name)); return; } } if (is_array()) { w.write("__%_length, __%_data", param_name, param_name); return; } if (marshaler_type.empty()) { write_escaped_identifier(w, param_name); return; } w.write("%.GetAbi%(%)", marshaler_type, is_array() ? "Array" : "", get_marshaler_local(w)); } void write_from_abi(writer& w, std::string_view source) const { auto param_cast = is_generic() ? w.write_temp("(%)", param_type) : ""; if (marshaler_type.empty()) { if (local_type == "IntPtr" && param_type != "IntPtr") { w.write("%.FromAbi(%)", param_type, source); return; } if (param_type == "bool") { w.write(is_generic() ? "(byte)% != 0" : "% != 0", source); return; } if (param_type == "char") { w.write(is_generic() ? "(char)(ushort)%" : "(char)%", source); return; } w.write("%%", param_cast, source); return; } w.write("%.FromAbi%(%)", marshaler_type, is_array() ? "Array" : "", source); } void write_from_managed(writer& w, std::string_view source) const { auto param_cast = is_generic() ? w.write_temp("(%)", param_type) : ""; if (marshaler_type.empty()) { if (local_type == "IntPtr") { w.write("%.FromManaged(%)", param_type, source); return; } if (param_type == "bool") { w.write("(byte)(% ? 1 : 0)", source); return; } if (param_type == "char") { w.write("(ushort)%", source); return; } w.write("%%", param_cast, source); return; } w.write("%.FromManaged%(%)", marshaler_type, is_array() ? "Array" : "", source); } void write_marshal_from_abi(writer& w) const { if (!is_ref() && (!is_out() || local_type.empty())) return; if (is_ref()) { if (!starts_with(marshaler_type, "MarshalBlittable")) { w.write("%.CopyAbiArray(%, (__%_length, __%_data));\n", marshaler_type, bind<write_escaped_identifier>(param_name), param_name, param_name); } return; } is_return ? w.write("return ") : w.write("% = ", bind<write_escaped_identifier>(param_name)); write_from_abi(w, get_param_local(w)); w.write(";\n"); } void write_dispose(writer& w) const { if (is_object_in() || local_type.empty()) return; if (marshaler_type.empty()) { if (is_out() && (local_type == "IntPtr" && param_type != "IntPtr")) { w.write("MarshalInspectable.DisposeAbi(%);\n", get_marshaler_local(w)); } return; } if (is_out()) { w.write("%.DisposeAbi%(%);\n", marshaler_type, is_array() ? "Array" : "", get_param_local(w)); } else { w.write("%.DisposeMarshaler%(%);\n", marshaler_type, is_array() ? "Array" : "", get_marshaler_local(w)); } } }; void set_abi_marshaler(writer& w, TypeSig const& type_sig, abi_marshaler& m, std::string_view prop_name = "") { auto semantics = get_type_semantics(type_sig); m.param_type = w.write_temp("%", bind<write_projection_type>(semantics)); m.is_value_type = is_value_type(semantics); auto get_abi_type = [&]() { auto abi_type = w.write_temp("%", bind<write_type_name>(semantics, true, false)); if (abi_type != prop_name) { return abi_type; } return w.write_temp("%", bind<write_type_name>(semantics, true, true)); }; auto set_simple_marshaler_type = [&](abi_marshaler& m, TypeDef const& type) { if (m.is_array()) { m.marshaler_type = is_type_blittable(semantics) ? "MarshalBlittable" : "MarshalNonBlittable"; m.marshaler_type += "<" + m.param_type + ">"; m.local_type = m.marshaler_type + ".MarshalerArray"; } else if (!is_type_blittable(type)) { m.marshaler_type = get_abi_type(); m.local_type = m.marshaler_type; if (!m.is_out()) m.local_type += ".Marshaler"; } }; auto set_typedef_marshaler = [&](abi_marshaler& m, TypeDef const& type) { switch (get_category(type)) { case category::enum_type: break; case category::struct_type: set_simple_marshaler_type(m, type); break; case category::interface_type: if (get_mapped_type(type.TypeNamespace(), type.TypeName()) && type.TypeNamespace() == "Windows.Foundation.Collections") { m.marshaler_type = get_abi_type(); } else { m.marshaler_type = "MarshalInterface<" + m.param_type + ">"; } if (m.is_array()) { m.local_type = w.write_temp("MarshalInterfaceHelper<%>.MarshalerArray", m.param_type); } else { m.local_type = m.is_out() ? "IntPtr" : "IObjectReference"; } break; case category::class_type: m.marshaler_type = w.write_temp("%", bind<write_type_name>(semantics, true, true)); if (m.is_array()) { m.local_type = w.write_temp("MarshalInterfaceHelper<%>.MarshalerArray", m.param_type); } else { m.local_type = m.is_out() ? "IntPtr" : "IObjectReference"; } break; case category::delegate_type: m.marshaler_type = get_abi_type(); if (m.is_array()) { m.local_type = w.write_temp("MarshalInterfaceHelper<%>.MarshalerArray", m.param_type); } else { m.local_type = m.is_out() ? "IntPtr" : "IObjectReference"; } break; } }; call(semantics, [&](object_type) { m.marshaler_type = "MarshalInspectable"; if (m.is_array()) { m.local_type = "MarshalInterfaceHelper<object>.MarshalerArray"; } else { m.local_type = m.is_out() ? "IntPtr" : "IObjectReference"; } }, [&](type_definition const& type) { set_typedef_marshaler(m, type); }, [&](generic_type_index const& /*var*/) { m.param_type = w.write_temp("%", bind<write_projection_type>(semantics)); m.marshaler_type = w.write_temp("Marshaler<%>", m.param_type); m.local_type = "object"; }, [&](generic_type_instance const& type) { auto guard{ w.push_generic_args(type) }; set_typedef_marshaler(m, type.generic_type); }, [&](fundamental_type type) { if (type == fundamental_type::String) { if (m.is_array()) { m.marshaler_type = "MarshalString"; m.local_type = "MarshalString.MarshalerArray"; } else { m.marshaler_type = "MarshalString"; m.local_type = m.is_out() ? "IntPtr" : "MarshalString"; } } }, [&](auto const&) {}); if (m.is_out() && m.local_type.empty()) { m.local_type = w.write_temp("%", bind<write_abi_type>(semantics)); } if (m.is_array() && m.marshaler_type.empty()) { if (m.is_generic()) { m.marshaler_type = w.write_temp("Marshaler<%>", m.param_type); m.local_type = "object"; } else { m.marshaler_type = is_type_blittable(semantics) ? "MarshalBlittable" : "MarshalNonBlittable"; m.marshaler_type += "<" + m.param_type + ">"; m.local_type = m.marshaler_type + ".MarshalerArray"; } } } auto get_abi_marshalers(writer& w, method_signature const& signature, bool is_generic, std::string_view prop_name = "", bool raw_return_type = false) { std::vector<abi_marshaler> marshalers; int param_index = 1; for (auto&& param : signature.params()) { abi_marshaler m{ std::string(param.first.Name()), is_generic ? param_index : -1, get_param_category(param) }; param_index += m.is_array() ? 2 : 1; set_abi_marshaler(w, param.second->Type(), m, prop_name); marshalers.push_back(std::move(m)); } if (auto ret = signature.return_signature()) { abi_marshaler m{ "retval", is_generic ? param_index : -1, ret.Type().is_szarray() && !raw_return_type ? param_category::receive_array : param_category::out, true }; param_index += m.is_array() ? 2 : 1; if (!raw_return_type) { set_abi_marshaler(w, ret.Type(), m, prop_name); } else { m.param_type = w.write_temp("%", bind<write_abi_type>(get_type_semantics(ret.Type()))); m.local_type = m.param_type; m.is_value_type = true; } marshalers.push_back(std::move(m)); } return marshalers; } void write_abi_method_call_marshalers(writer& w, std::string_view invoke_target, bool is_generic, std::vector<abi_marshaler> const& marshalers) { auto write_abi_invoke = [&](writer& w) { if (is_generic) { w.write("%.DynamicInvokeAbi(__params);\n", invoke_target); } else { w.write("global::WinRT.ExceptionHelpers.ThrowExceptionForHR(%(ThisPtr%));\n", invoke_target, bind_each([](writer& w, abi_marshaler const& m) { w.write(", "); m.write_marshal_to_abi(w); }, marshalers)); } for (auto&& m : marshalers) { m.write_marshal_from_abi(w); } }; w.write("\n"); for (auto&& m : marshalers) { m.write_locals(w); } if (is_generic) { w.write("var __params = new object[]{ ThisPtr"); for (auto&& m : marshalers) { w.write(", "); if (m.is_array()) w.write("null, null"); else if (!m.is_out() && m.marshaler_type.empty()) m.write_marshal_to_abi(w); else w.write("null"); } w.write(" };\n"); } bool have_disposers = std::find_if(marshalers.begin(), marshalers.end(), [](abi_marshaler const& m) { return !m.marshaler_type.empty(); }) != marshalers.end(); if (!have_disposers) { write_abi_invoke(w); return; } w.write(R"(try { %%} finally { %} )", bind_each([](writer& w, abi_marshaler const& m) { m.write_assignments(w); }, marshalers), bind(write_abi_invoke), bind_each([](writer& w, abi_marshaler const& m) { m.write_dispose(w); }, marshalers) ); } void write_abi_method_call(writer& w, method_signature signature, std::string_view invoke_target, bool is_generic, bool raw_return_type = false) { write_abi_method_call_marshalers(w, invoke_target, is_generic, get_abi_marshalers(w, signature, is_generic, "", raw_return_type)); } void write_abi_method_with_raw_return_type(writer& w, MethodDef const& method) { if (is_special(method)) { return; } auto get_method_info = [&](MethodDef const& method) { auto vmethod_name = get_vmethod_name(w, method.Parent(), method); method_signature signature{ method }; return std::pair{ "_obj.Vftbl." + vmethod_name, abi_signature_has_generic_parameters(w, signature) }; }; auto write_raw_return_type = [](writer& w, method_signature const& sig) { if (auto return_sig = sig.return_signature()) { write_abi_type(w, get_type_semantics(return_sig.Type())); } else { w.write("void"); } }; method_signature signature{ method }; auto [invoke_target, is_generic] = get_method_info(method); w.write(R"( public unsafe new % %(%) {%} )", bind(write_raw_return_type, signature), method.Name(), bind_list<write_projection_parameter>(", ", signature.params()), bind<write_abi_method_call>(signature, invoke_target, is_generic, true)); } void write_composing_factory_method(writer& w, MethodDef const& method) { if (is_special(method)) { return; } auto get_method_info = [&](MethodDef const& method) { auto vmethod_name = get_vmethod_name(w, method.Parent(), method); method_signature signature{ method }; return std::pair{ "_obj.Vftbl." + vmethod_name, abi_signature_has_generic_parameters(w, signature) }; }; auto write_composable_constructor_params = [&](writer& w, method_signature const& method_sig) { auto const& params = method_sig.params(); // We need to special case the last parameter separator s{ w }; for (size_t i = 0; i < params.size() - 1; i++) { s(); write_projection_parameter(w, params[i]); } // The innerIterface parameter is always an out IntPtr. XLANG_ASSERT(get_param_category(params[params.size() - 1]) == param_category::out); s(); w.write("out IntPtr %", bind<write_parameter_name>(params[params.size() - 1])); }; auto write_raw_return_type = [](writer& w, method_signature const& sig) { if (auto return_sig = sig.return_signature()) { write_abi_type(w, get_type_semantics(return_sig.Type())); } else { w.write("void"); } }; method_signature signature{ method }; auto [invoke_target, is_generic] = get_method_info(method); auto abi_marshalers = get_abi_marshalers(w, signature, is_generic, "", true); // The last abi marshaler is the return value and the second-to-last one // is the inner object (which is the return value we want). size_t inner_inspectable_index = abi_marshalers.size() - 2; abi_marshaler const& inner_inspectable_ref = abi_marshalers[inner_inspectable_index]; abi_marshalers[inner_inspectable_index] = { inner_inspectable_ref.param_name, inner_inspectable_ref.param_index, inner_inspectable_ref.category, inner_inspectable_ref.is_return, "IntPtr", "IntPtr", {}, true }; w.write(R"( public unsafe % %(%) {%} )", bind(write_raw_return_type, signature), method.Name(), bind(write_composable_constructor_params, signature), bind<write_abi_method_call_marshalers>(invoke_target, is_generic, abi_marshalers)); } template<auto method_writer> std::string write_factory_cache_object(writer& w, TypeDef const& factory_type, TypeDef const& class_type) { std::string_view cache_type_name = factory_type.TypeName(); auto cache_interface = w.write_temp( R"(ActivationFactory<%>.As<ABI.%.%.Vftbl>)", class_type.TypeName(), class_type.TypeNamespace(), cache_type_name); w.write(R"( internal class _% : ABI.%.% { public _%() : base(%()) { } private static WeakLazy<_%> _instance = new WeakLazy<_%>(); internal static _% Instance => _instance.Value; % } )", cache_type_name, class_type.TypeNamespace(), cache_type_name, cache_type_name, cache_interface, cache_type_name, cache_type_name, cache_type_name, bind_each<method_writer>(factory_type.MethodList()) ); return w.write_temp("_%.Instance", cache_type_name); } void write_interface_members(writer& w, TypeDef const& type, std::set<std::string> const& generic_methods) { auto get_method_info = [&](MethodDef const& method) { auto vmethod_name = get_vmethod_name(w, type, method); return std::pair{ "_obj.Vftbl." + vmethod_name, generic_methods.find(vmethod_name) != generic_methods.end()}; }; for (auto&& method : type.MethodList()) { if (is_special(method)) { continue; } method_signature signature{ method }; auto [invoke_target, is_generic] = get_method_info(method); w.write(R"( public unsafe %% %(%) {%} )", (method.Name() == "ToString"sv) ? "override " : "", bind<write_projection_return_type>(signature), method.Name(), bind_list<write_projection_parameter>(", ", signature.params()), bind<write_abi_method_call>(signature, invoke_target, is_generic, false)); } for (auto&& prop : type.PropertyList()) { auto [getter, setter] = get_property_methods(prop); w.write(R"( public unsafe % % { )", write_prop_type(w, prop), prop.Name()); if (getter) { auto [invoke_target, is_generic] = get_method_info(getter); auto signature = method_signature(getter); auto marshalers = get_abi_marshalers(w, signature, is_generic, prop.Name()); w.write(R"(get {%} )", bind<write_abi_method_call_marshalers>(invoke_target, is_generic, marshalers)); } if (setter) { if (!getter) { auto getter_interface = find_property_interface(w, type, prop.Name()); w.write("get{ return As<%>().%; }\n", getter_interface.first, prop.Name()); } auto [invoke_target, is_generic] = get_method_info(setter); auto signature = method_signature(setter); auto marshalers = get_abi_marshalers(w, signature, is_generic, prop.Name()); marshalers[0].param_name = "value"; w.write(R"(set {%} )", bind<write_abi_method_call_marshalers>(invoke_target, is_generic, marshalers)); } w.write("}\n"); } for (auto&& evt : type.EventList()) { auto semantics = get_type_semantics(evt.EventType()); w.write(R"( public event % % { add => _%.Subscribe(value); remove => _%.Unsubscribe(value); } )", bind<write_type_name>(get_type_semantics(evt.EventType()), false, false), evt.Name(), evt.Name(), evt.Name()); } } struct required_interface { std::string members; std::string helper_wrapper; std::string adapter; }; void write_required_interface_members_for_abi_type(writer& w, TypeDef const& type, std::map<std::string, required_interface>& required_interfaces) { auto write_required_interface = [&](TypeDef const& iface) { auto interface_name = write_type_name_temp(w, iface); if (required_interfaces.find(interface_name) != required_interfaces.end()) { // We've already written this required interface, so don't write it again. return; } if (auto mapping = get_mapped_type(iface.TypeNamespace(), iface.TypeName())) { auto remove_enumerable = [&](std::string generic_enumerable = "") { required_interfaces[std::move("global::System.Collections.IEnumerable")] = {}; if(generic_enumerable.empty()) return; required_interfaces[std::move(generic_enumerable)] = {}; }; if (mapping->abi_name == "IIterable`1") // IEnumerable`1 { auto element = w.write_temp("%", bind<write_generic_type_name>(0)); required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_enumerable_members>("_iterableToEnumerable", true)), w.write_temp("ABI.System.Collections.Generic.IEnumerable<%>", element), "_iterableToEnumerable" }; remove_enumerable(); } else if (mapping->abi_name == "IIterator`1") // IEnumerator`1 { auto element = w.write_temp("%", bind<write_generic_type_name>(0)); required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_enumerator_members>("_iteratorToEnumerator")), w.write_temp("ABI.System.Collections.Generic.IEnumerator<%>", element), "_iteratorToEnumerator" }; } else if (mapping->abi_name == "IMapView`2") // IReadOnlyDictionary`2 { auto key = w.write_temp("%", bind<write_generic_type_name>(0)); auto value = w.write_temp("%", bind<write_generic_type_name>(1)); required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_readonlydictionary_members>("_mapViewToReadOnlyDictionary", true)), w.write_temp("ABI.System.Collections.Generic.IReadOnlyDictionary<%, %>", key, value), "_mapViewToReadOnlyDictionary" }; remove_enumerable(w.write_temp("global::System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<%, %>>", key, value)); } else if (mapping->abi_name == "IMap`2") // IDictionary<TKey, TValue> { auto key = w.write_temp("%", bind<write_generic_type_name>(0)); auto value = w.write_temp("%", bind<write_generic_type_name>(1)); required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_dictionary_members>("_mapToDictionary", true)), w.write_temp("ABI.System.Collections.Generic.IDictionary<%, %>", key, value), "_mapToDictionary" }; remove_enumerable(w.write_temp("global::System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<%, %>>", key, value)); } else if (mapping->abi_name == "IVectorView`1") // IReadOnlyList`1 { auto element = w.write_temp("%", bind<write_generic_type_name>(0)); required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_readonlylist_members>("_vectorViewToReadOnlyList", true)), w.write_temp("ABI.System.Collections.Generic.IReadOnlyList<%>", element), "_vectorViewToReadOnlyList" }; remove_enumerable(w.write_temp("global::System.Collections.Generic.IEnumerable<%>", element)); } else if (mapping->abi_name == "IVector`1") // IList`1 { auto element = w.write_temp("%", bind<write_generic_type_name>(0)); required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_list_members>("_vectorToList", true)), w.write_temp("ABI.System.Collections.Generic.IList<%>", element), "_vectorToList" }; remove_enumerable(w.write_temp("global::System.Collections.Generic.IEnumerable<%>", element)); } else if (mapping->abi_name == "IBindableIterable") // IEnumerable { required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_nongeneric_enumerable_members>("_bindableIterableToEnumerable")), "ABI.System.Collections.IEnumerable", "_bindableIterableToEnumerable" }; } else if (mapping->abi_name == "IBindableVector") // IList { required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_nongeneric_list_members>("_bindableVectorToList", true)), "ABI.System.Collections.IList", "_bindableVectorToList" }; remove_enumerable(); } else if (mapping->mapped_name == "IDisposable") { required_interfaces[std::move(interface_name)] = { w.write_temp("%", bind<write_idisposable_members>("As<global::ABI.System.IDisposable>()")) }; } return; } auto methods = w.write_temp("%", [&](writer& w) { for (auto&& method : iface.MethodList()) { if (!method.SpecialName()) { auto method_target = w.write_temp("As<%>()", bind<write_type_name>(iface, true, false)); auto return_type = w.write_temp("%", bind<write_projection_return_type>(method_signature{ method })); write_explicitly_implemented_method(w, method, return_type, iface, method_target); } } w.write_each<write_explicitly_implemented_property>(iface.PropertyList(), iface, true); w.write_each<write_explicitly_implemented_event>(iface.EventList(), iface, true); }); required_interfaces[std::move(interface_name)] = { methods }; }; for (auto&& iface : type.InterfaceImpl()) { for_typedef(w, get_type_semantics(iface.Interface()), [&](auto type) { if (has_attribute(iface, "Windows.Foundation.Metadata", "OverridableAttribute") || !is_exclusive_to(type)) { write_required_interface(type); write_required_interface_members_for_abi_type(w, type, required_interfaces); } }); } } void write_guid_attribute(writer& w, TypeDef const& type) { auto fully_qualify_guid = (type.TypeNamespace() == "Windows.Foundation.Metadata"); auto attribute = get_attribute(type, "Windows.Foundation.Metadata", "GuidAttribute"); if (!attribute) { throw_invalid("'Windows.Foundation.Metadata.GuidAttribute' attribute for type '", type.TypeNamespace(), ".", type.TypeName(), "' not found"); } auto args = attribute.Value().FixedArgs(); using std::get; auto get_arg = [&](decltype(args)::size_type index) { return get<ElemSig>(args[index].value).value; }; w.write_printf(R"([%s("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X")])", fully_qualify_guid ? "global::System.Runtime.InteropServices.Guid" : "Guid", get<uint32_t>(get_arg(0)), get<uint16_t>(get_arg(1)), get<uint16_t>(get_arg(2)), get<uint8_t>(get_arg(3)), get<uint8_t>(get_arg(4)), get<uint8_t>(get_arg(5)), get<uint8_t>(get_arg(6)), get<uint8_t>(get_arg(7)), get<uint8_t>(get_arg(8)), get<uint8_t>(get_arg(9)), get<uint8_t>(get_arg(10))); } void write_type_inheritance(writer& w, TypeDef const& type, type_semantics base_semantics, bool add_custom_qi) { auto delimiter{ " : " }; auto write_delimiter = [&]() { w.write(delimiter); delimiter = ", "; }; if (!std::holds_alternative<object_type>(base_semantics)) { write_delimiter(); write_projection_type(w, base_semantics); } for (auto&& iface : type.InterfaceImpl()) { for_typedef(w, get_type_semantics(iface.Interface()), [&](auto type) { if (has_attribute(iface, "Windows.Foundation.Metadata", "OverridableAttribute") || !is_exclusive_to(type)) { write_delimiter(); w.write("%", bind<write_type_name>(type, false, false)); } }); } if (add_custom_qi) { write_delimiter(); w.write("global::System.Runtime.InteropServices.ICustomQueryInterface"); } } std::string get_vmethod_delegate_type(writer& w, MethodDef const& method, std::string vmethod_name) { method_signature signature{ method }; if (is_special(method)) { bool getter = starts_with(method.Name(), "get_"); bool setter = starts_with(method.Name(), "put_"); if (getter || setter) { std::string suffix{}; auto prop_type = getter ? signature.return_signature().Type() : signature.params()[0].second->Type(); if (prop_type.is_szarray()) { return ""; } call(get_type_semantics(prop_type), [&](guid_type) { suffix = "Guid"; }, [&](type_type) { throw_invalid("System.Type not implemented"); }, [&](fundamental_type const& type) { suffix = get_delegate_type_suffix(type); }, [&](generic_type_index const& /*var*/) {}, [&](type_definition const& /*type*/) {}, [&](auto) { suffix = "Object"; }); if (!suffix.empty()) { return w.write_temp("%_PropertyAs%", (getter ? "_get" : "_put"), suffix); } } else if (starts_with(method.Name(), "add_")) { return "_add_EventHandler"; } else if (starts_with(method.Name(), "remove_")) { return "_remove_EventHandler"; } } return ""; } struct generic_abi_param { std::string abi_type; std::string generic_param; std::string param_name; }; std::pair<std::string, std::string> get_generic_abi_type(writer& w, type_semantics semantics) { std::string generic_param{}; writer::write_generic_type_name_guard g(w, [&](writer& w, uint32_t index) { auto generic_type_name = w.write_temp("%", bind<write_generic_type_name_base>(index)); generic_param = generic_type_name + "Abi"; w.write("Marshaler<%>.AbiType", generic_type_name); }); auto generic_abi_type = w.write_temp("%", bind<write_abi_type>(semantics)); return {generic_abi_type, generic_param}; } auto get_generic_abi_types(writer& w, method_signature const& signature) { std::vector<std::pair<std::string, std::string>> generic_abi_types; auto add_generic_abi_type = [&](TypeSig sig, bool byref) { auto const [generic_abi_type, generic_param] = get_generic_abi_type(w, get_type_semantics(sig)); generic_abi_types.push_back({w.write_temp(!generic_param.empty() ? "%%" : "typeof(%)%", generic_abi_type, byref ? ".MakeByRefType()" : ""), generic_param }); }; auto add_array_param = [&](param_category category) { XLANG_ASSERT(category > param_category::out); switch (category) { case param_category::pass_array: generic_abi_types.push_back({ "typeof(int)", "" }); generic_abi_types.push_back({ "typeof(IntPtr)", "" }); break; case param_category::fill_array: generic_abi_types.push_back({ "typeof(int)", "" }); generic_abi_types.push_back({ "typeof(IntPtr).MakeByRefType()", "" }); break; case param_category::receive_array: generic_abi_types.push_back({ "typeof(int).MakeByRefType()", "" }); generic_abi_types.push_back({ "typeof(IntPtr).MakeByRefType()", "" }); break; } }; for (auto&& param : signature.params()) { param_category category = get_param_category(param); if (category <= param_category::out) { add_generic_abi_type(param.second->Type(), category == param_category::out); } else { add_array_param(category); } } if (signature.return_signature()) { if (!signature.return_signature().Type().is_szarray()) { add_generic_abi_type(signature.return_signature().Type(), true); } else { add_array_param(param_category::receive_array); } } return generic_abi_types; } void write_abi_signature(writer& w, MethodDef const& method) { bool is_generic = distance(method.GenericParam()) > 0; method_signature signature{ method }; auto generic_abi_types = get_generic_abi_types(w, signature); bool have_generic_params = std::find_if(generic_abi_types.begin(), generic_abi_types.end(), [](auto&& pair) { return !pair.second.empty(); }) != generic_abi_types.end(); if (!is_generic && !have_generic_params) { w.write("(%)", bind<write_abi_parameters>(signature)); return; } if (have_generic_params) { w.write("<"); int count = 0; for (auto&& pair : generic_abi_types) { if (pair.second.empty()) continue; w.write(count++ == 0 ? "" : ", "); w.write(pair.second); } w.write(">"); } w.write(have_generic_params ? "(void* thisPtr" : "(IntPtr thisPtr"); int index = 0; for (auto&& param : signature.params()) { auto generic_type = generic_abi_types[index++].second; auto param_cat = get_param_category(param); if (!generic_type.empty() && (param_cat <= param_category::out)) { std::string_view param_prefix = ""; std::string_view param_suffix = ""; if (param_cat == param_category::out) { if (settings.netstandard_compat) { param_prefix = "out "; } else { param_suffix = "*"; } } w.write(", %%% %", param_prefix, generic_type, param_suffix, bind<write_parameter_name>(param)); } else { write_abi_parameter(w, param); } } if (auto return_sig = signature.return_signature()) { auto generic_type = generic_abi_types[index++].second; if (!return_sig.Type().is_szarray() && !generic_type.empty()) { if (settings.netstandard_compat || have_generic_params) { w.write(", out % %", generic_type, bind<write_escaped_identifier>(signature.return_param_name())); } else { w.write(", %* %", generic_type, bind<write_escaped_identifier>(signature.return_param_name())); } } else { write_abi_return(w, signature); } } w.write(")"); } struct managed_marshaler { std::string param_name; param_category category; std::string param_type; std::string local_type; std::string marshaler_type; bool abi_boxed; bool use_pointers; bool is_out() const { return (category == param_category::out) || (category == param_category::receive_array); } bool is_ref() const { return (category == param_category::fill_array); } bool is_array() const { return category >= param_category::pass_array; } std::string get_param_local(writer& w) const { return w.write_temp("__%", param_name); } void write_local(writer& w) const { if ((category == param_category::in) || (category == param_category::pass_array)) return; if (category == param_category::fill_array) { w.write("% __% = %.FromAbiArray((__%Size, %));\n", local_type, param_name, marshaler_type, param_name, bind<write_escaped_identifier>(param_name)); return; } std::string_view out_local_type; if (param_type == "bool") { out_local_type = is_array() ? "bool[]" : "bool"; } else if (param_type == "char") { out_local_type = is_array() ? "char[]" : "char"; } else { out_local_type = local_type; } w.write("% __% = default;\n", out_local_type, param_name); } void write_out_initialize(writer& w) const { XLANG_ASSERT(is_out()); if (!use_pointers) { w.write("% = default;\n", bind<write_escaped_identifier>(param_name)); if (is_array()) { w.write("__%Size = default;\n", param_name); } } else { w.write("*% = default;\n", bind<write_escaped_identifier>(param_name)); if (is_array()) { w.write("*__%Size = default;\n", param_name); } } } void write_marshal_to_managed(writer& w) const { if (is_out() || is_ref()) { w.write("% __%", is_out() ? "out" : "", param_name); } else if (marshaler_type.empty()) { std::string_view format_string; if (param_type == "bool") { format_string = "% != 0"; } else if (param_type == "char") { format_string = "(char)%"; } else { format_string = "%"; } w.write(format_string, bind<write_escaped_identifier>(param_name)); } else if (is_array()) { w.write("%.FromAbiArray((__%Size, %))", marshaler_type, param_name, bind<write_escaped_identifier>(param_name)); } else { w.write("%.FromAbi(%)", marshaler_type, bind<write_escaped_identifier>(param_name)); } } void write_marshal_from_managed(writer& w) const { if (!is_ref() && (!is_out() || local_type.empty())) return; auto param_local = get_param_local(w); if (is_ref()) { w.write("%.CopyManagedArray(%, %);\n", marshaler_type, param_local, bind<write_escaped_identifier>(param_name)); return; } if (!use_pointers) { is_array() ? w.write("(__%Size, %) = ", param_name, bind<write_escaped_identifier>(param_name)) : w.write("% = ", bind<write_escaped_identifier>(param_name)); } else { is_array() ? w.write("(*__%Size, *%) = ", param_name, bind<write_escaped_identifier>(param_name)) : w.write("*% = ", bind<write_escaped_identifier>(param_name)); } if (marshaler_type.empty()) { if (local_type == "IntPtr") { w.write("%.FromManaged(%);", param_type, param_local); } else { if (param_type == "bool") { w.write("(byte)(% ? 1 : 0);", param_local); } else if (param_type == "char") { w.write("(ushort)%;", param_local); } else { w.write("%;", param_local); } } } else { w.write("%%.FromManaged%(%);", abi_boxed && !is_array() ? w.write_temp("(%)", param_type) : "", marshaler_type, is_array() ? "Array" : "", param_local); } w.write("\n"); } }; auto get_managed_marshalers(writer& w, method_signature const& signature, bool is_generic) { std::vector<managed_marshaler> marshalers; auto set_marshaler = [is_generic](writer& w, type_semantics const& semantics, managed_marshaler& m) { m.param_type = w.write_temp("%", bind<write_projection_type>(semantics)); auto get_abi_type = [&]() { return w.write_temp("%", bind<write_type_name>(semantics, true, true)); }; auto set_typedef_marshaler = [&](TypeDef const& type) { switch (get_category(type)) { case category::enum_type: break; case category::struct_type: if (!is_type_blittable(type)) { if (!m.is_array()) { m.marshaler_type = get_abi_type(); } m.local_type = m.param_type; } break; case category::interface_type: if (get_mapped_type(type.TypeNamespace(), type.TypeName()) && type.TypeNamespace() == "Windows.Foundation.Collections") { m.marshaler_type = get_abi_type(); } else { m.marshaler_type = w.write_temp("MarshalInterface<%>", m.param_type); } m.local_type = m.param_type; break; case category::class_type: m.marshaler_type = get_abi_type(); m.local_type = m.param_type; break; case category::delegate_type: m.marshaler_type = get_abi_type(); m.local_type = m.param_type; break; } }; call(semantics, [&](object_type const&) { m.marshaler_type = "MarshalInspectable"; m.local_type = "object"; }, [&](type_definition const& type) { set_typedef_marshaler(type); }, [&](generic_type_index const& /*var*/) { m.param_type = get_generic_abi_type(w, semantics).second; m.local_type = w.write_temp("%", bind<write_projection_type>(semantics)); m.marshaler_type = w.write_temp("Marshaler<%>", m.local_type); m.abi_boxed = true; }, [&](generic_type_instance const& type) { auto guard{ w.push_generic_args(type) }; set_typedef_marshaler(type.generic_type); }, [&](fundamental_type type) { if (type == fundamental_type::String) { m.marshaler_type = "MarshalString"; m.local_type = m.is_out() ? "string" : ""; } }, [&](auto const&) {}); if (m.is_out() && m.local_type.empty()) { m.local_type = w.write_temp("%", bind<write_abi_type>(semantics)); } if (m.is_array()) { if (m.marshaler_type.empty()) { m.marshaler_type = is_type_blittable(semantics) ? "MarshalBlittable" : "MarshalNonBlittable"; m.marshaler_type += "<" + m.param_type + ">"; } m.local_type = (m.local_type.empty() ? m.param_type : m.local_type) + "[]"; } m.use_pointers = !settings.netstandard_compat && !is_generic; }; for (auto&& param : signature.params()) { managed_marshaler m{ std::string(param.first.Name()) }; m.category = get_param_category(param); set_marshaler(w, get_type_semantics(param.second->Type()), m); marshalers.push_back(std::move(m)); } if (auto ret = signature.return_signature()) { managed_marshaler m{ std::string(signature.return_param_name()), ret.Type().is_szarray() ? param_category::receive_array : param_category::out }; set_marshaler(w, get_type_semantics(ret.Type()), m); return std::pair{ marshalers, m }; } return std::pair{ marshalers, managed_marshaler{} }; } void write_managed_method_call(writer& w, method_signature signature, std::string invoke_expression_format) { auto generic_abi_types = get_generic_abi_types(w, signature); bool have_generic_params = std::find_if(generic_abi_types.begin(), generic_abi_types.end(), [](auto&& pair) { return !pair.second.empty(); }) != generic_abi_types.end(); auto managed_marshalers = get_managed_marshalers(w, signature, have_generic_params); auto marshalers = managed_marshalers.first; auto return_marshaler = managed_marshalers.second; auto return_sig = signature.return_signature(); w.write( R"(% % try { % %% } catch (Exception __exception__) { global::WinRT.ExceptionHelpers.SetErrorInfo(__exception__); return global::WinRT.ExceptionHelpers.GetHRForException(__exception__); } return 0;)", [&](writer& w) { if (!return_sig) return; return_marshaler.write_local(w); }, [&](writer& w) { w.write(bind_each([](writer& w, managed_marshaler const& m) { if (m.is_out()) { m.write_out_initialize(w); } }, marshalers)); if (return_sig) { return_marshaler.write_out_initialize(w); } w.write(bind_each([](writer& w, managed_marshaler const& m) { m.write_local(w); }, marshalers)); }, [&](writer& w) { if (return_sig) { w.write("__% = ", return_marshaler.param_name); } w.write(R"(%;)", bind([&](writer& w) { w.write(invoke_expression_format, bind_list([](writer& w, managed_marshaler const& m) { m.write_marshal_to_managed(w); }, ", ", marshalers)); })); }, bind_each([](writer& w, managed_marshaler const& m) { m.write_marshal_from_managed(w); }, marshalers), [&](writer& w) { if (!return_sig) return; return_marshaler.write_marshal_from_managed(w); }); } void write_method_abi_invoke(writer& w, MethodDef const& method) { if (method.SpecialName()) return; method_signature signature{ method }; auto return_sig = signature.return_signature(); auto type_name = write_type_name_temp(w, method.Parent()); auto vmethod_name = get_vmethod_name(w, method.Parent(), method); auto generic_abi_types = get_generic_abi_types(w, signature); bool have_generic_params = std::find_if(generic_abi_types.begin(), generic_abi_types.end(), [](auto&& pair) { return !pair.second.empty(); }) != generic_abi_types.end(); w.write( R"( % private static unsafe int Do_Abi_%% { % })", !settings.netstandard_compat && !have_generic_params ? "[UnmanagedCallersOnly]" : "", vmethod_name, bind<write_abi_signature>(method), bind<write_managed_method_call>( signature, w.write_temp("global::WinRT.ComWrappersSupport.FindObject<%>(%).%%", type_name, have_generic_params ? "new IntPtr(thisPtr)" : "thisPtr", method.Name(), "(%)"))); } void write_property_abi_invoke(writer& w, Property const& prop) { auto [getter, setter] = get_property_methods(prop); auto type_name = write_type_name_temp(w, prop.Parent()); if (setter) { method_signature setter_sig{ setter }; auto vmethod_name = get_vmethod_name(w, setter.Parent(), setter); auto generic_abi_types = get_generic_abi_types(w, setter_sig); bool have_generic_params = std::find_if(generic_abi_types.begin(), generic_abi_types.end(), [](auto&& pair) { return !pair.second.empty(); }) != generic_abi_types.end(); // WinRT properties can't be indexers. XLANG_ASSERT(setter_sig.params().size() == 1); w.write( R"( % private static unsafe int Do_Abi_%% { % })", !settings.netstandard_compat ? "[UnmanagedCallersOnly]" : "", vmethod_name, bind<write_abi_signature>(setter), bind<write_managed_method_call>( setter_sig, w.write_temp("global::WinRT.ComWrappersSupport.FindObject<%>(%).% = %", type_name, have_generic_params ? "new IntPtr(thisPtr)" : "thisPtr", prop.Name(), "%"))); } if (getter) { method_signature getter_sig{ getter }; auto vmethod_name = get_vmethod_name(w, getter.Parent(), getter); auto generic_abi_types = get_generic_abi_types(w, getter_sig); bool have_generic_params = std::find_if(generic_abi_types.begin(), generic_abi_types.end(), [](auto&& pair) { return !pair.second.empty(); }) != generic_abi_types.end(); // WinRT properties can't be indexers. XLANG_ASSERT(getter_sig.params().size() == 0); w.write( R"( % private static unsafe int Do_Abi_%% { % })", !settings.netstandard_compat ? "[UnmanagedCallersOnly]" : "", vmethod_name, bind<write_abi_signature>(getter), bind<write_managed_method_call>( getter_sig, w.write_temp("global::WinRT.ComWrappersSupport.FindObject<%>(%).%%", type_name, have_generic_params ? "new IntPtr(thisPtr)" : "thisPtr", prop.Name(), "%"))); } } void write_event_abi_invoke(writer& w, Event const& evt) { auto type_name = write_type_name_temp(w, evt.Parent()); auto semantics = get_type_semantics(evt.EventType()); auto [add_method, remove_method] = get_event_methods(evt); auto add_signature = method_signature{ add_method }; auto handler_parameter_name = add_signature.params().back().first.Name(); auto add_handler_event_token_name = add_signature.return_param_name(); auto remove_handler_event_token_name = method_signature{ remove_method }.params().back().first.Name(); w.write("\nprivate static global::System.Runtime.CompilerServices.ConditionalWeakTable<%, global::WinRT.EventRegistrationTokenTable<%>> _%_TokenTables = new global::System.Runtime.CompilerServices.ConditionalWeakTable<%, global::WinRT.EventRegistrationTokenTable<%>>();", type_name, bind<write_type_name>(semantics, false, false), evt.Name(), type_name, bind<write_type_name>(semantics, false, false)); w.write( R"( % private static unsafe int Do_Abi_%% { %% = default; try { var __this = global::WinRT.ComWrappersSupport.FindObject<%>(thisPtr); var __handler = %.FromAbi(%); %% = _%_TokenTables.GetOrCreateValue(__this).AddEventHandler(__handler); __this.% += __handler; return 0; } catch (Exception __ex) { return __ex.HResult; } })", !settings.netstandard_compat ? "[UnmanagedCallersOnly]" : "", get_vmethod_name(w, add_method.Parent(), add_method), bind<write_abi_signature>(add_method), settings.netstandard_compat ? "" : "*", add_handler_event_token_name, type_name, bind<write_type_name>(semantics, true, false), handler_parameter_name, settings.netstandard_compat ? "" : "*", add_handler_event_token_name, evt.Name(), evt.Name()); w.write( R"( % private static unsafe int Do_Abi_%% { try { var __this = global::WinRT.ComWrappersSupport.FindObject<%>(thisPtr); if(_%_TokenTables.TryGetValue(__this, out var __table) && __table.RemoveEventHandler(%, out var __handler)) { __this.% -= __handler; } return 0; } catch (Exception __ex) { return __ex.HResult; } })", !settings.netstandard_compat ? "[UnmanagedCallersOnly]" : "", get_vmethod_name(w, remove_method.Parent(), remove_method), bind<write_abi_signature>(remove_method), type_name, evt.Name(), remove_handler_event_token_name, evt.Name()); } void write_vtable(writer& w, TypeDef const& type, std::string const& type_name, std::set<std::string>& generic_methods, std::string const& nongenerics_class, std::vector<std::string>& nongeneric_delegates) { auto methods = type.MethodList(); auto is_generic = distance(type.GenericParam()) > 0; std::vector<std::string> method_marshals_to_abi; std::vector<std::string> method_marshals_to_projection; std::vector<std::string> method_create_delegates_to_projection; w.write(R"(% public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; %%%%%% })", bind<write_guid_attribute>(type), bind_each([&](writer& w, MethodDef const& method) { bool signature_has_generic_parameters{}; auto generic_abi_types = get_generic_abi_types(w, method_signature{ method }); bool have_generic_type_parameters = std::find_if(generic_abi_types.begin(), generic_abi_types.end(), [](auto&& pair) { return !pair.second.empty(); }) != generic_abi_types.end(); auto vmethod_name = get_vmethod_name(w, type, method); auto delegate_type = get_vmethod_delegate_type(w, method, vmethod_name); std::string vtable_field_type; bool function_pointer = false; if(vtable_field_type == "") { delegate_type = nongenerics_class + "." + vmethod_name; writer::write_generic_type_name_guard g(w, [&](writer& /*w*/, uint32_t /*index*/) { signature_has_generic_parameters = true; }); auto delegate_definition = w.write_temp("public unsafe delegate int %(%);\n", vmethod_name, bind<write_abi_parameters>(method_signature{ method })); if (signature_has_generic_parameters) { delegate_type = vtable_field_type = "global::System.Delegate"; } else { if (settings.netstandard_compat) { nongeneric_delegates.push_back(delegate_definition); vtable_field_type = w.write_temp("delegate* stdcall<%, int>", bind<write_abi_parameter_types>(method_signature{ method })); } else { vtable_field_type = w.write_temp("delegate* stdcall<%, int>", bind<write_abi_parameter_types>(method_signature{ method })); } function_pointer = true; } } else { // We're a well-known delegate type, but we still need to get the function pointer type. if (settings.netstandard_compat) { vtable_field_type = w.write_temp("delegate* stdcall<%, int>", bind<write_abi_parameter_types>(method_signature{ method })); } else { vtable_field_type = w.write_temp("delegate* stdcall<%, int>", bind<write_abi_parameter_types>(method_signature{ method })); } function_pointer = true; } if (!function_pointer) { w.write("public % %;", vtable_field_type, vmethod_name); } else if (settings.netstandard_compat) { // Work around https://github.com/dotnet/runtime/issues/37295 w.write("private void* _%;\n", vmethod_name); w.write("public % % { get => (%)_%; set => _%=(void*)value; }\n", vtable_field_type, vmethod_name, vtable_field_type, vmethod_name, vmethod_name); } else { // Work around C# compiler's lack of support for UnmanagedCallersOnly w.write("private delegate*<%, int> _%;\n", bind<write_abi_parameter_types_pointer>(method_signature{ method }), vmethod_name); w.write("public % % { get => (%)_%; set => _%=(delegate*<%, int>)value; }\n", vtable_field_type, vmethod_name, vtable_field_type, vmethod_name, vmethod_name, bind<write_abi_parameter_types_pointer>(method_signature{ method })); } uint32_t const delegate_cache_index = method.index() - methods.first.index(); uint32_t const vtable_index = delegate_cache_index + 6; if (is_generic) { method_marshals_to_abi.emplace_back(signature_has_generic_parameters ? w.write_temp("% = Marshal.GetDelegateForFunctionPointer(vftbl[%], %_Type);\n", vmethod_name, vtable_index, vmethod_name) : w.write_temp("% = (%)(vftbl[%]);\n", vmethod_name, vtable_field_type, vtable_index) ); method_marshals_to_projection.emplace_back(signature_has_generic_parameters ? w.write_temp("nativeVftbl[%] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.%);\n", vtable_index, vmethod_name) : w.write_temp("nativeVftbl[%] = (IntPtr)AbiToProjectionVftable._%;", vtable_index, vmethod_name) ); if (have_generic_type_parameters) { method_create_delegates_to_projection.emplace_back( w.write_temp(R"(% = %global::System.Delegate.CreateDelegate(%, typeof(Vftbl).GetMethod("Do_Abi_%", BindingFlags.NonPublic | BindingFlags.Static).MakeGenericMethod(%)))", vmethod_name, !signature_has_generic_parameters ? w.write_temp("(%)", vtable_field_type) : "", !signature_has_generic_parameters ? w.write_temp("typeof(%)", vtable_field_type) : vmethod_name + "_Type", vmethod_name, bind([&](writer& w, method_signature const& sig) { separator s{ w }; auto write_abi_type = [&](writer& w, type_semantics type) { auto const [generic_abi_type, generic_type_parameter] = get_generic_abi_type(w, type); if (!generic_type_parameter.empty()) { s(); w.write(generic_abi_type); } }; for (auto&& param : sig.params()) { write_abi_type(w, get_type_semantics(param.second->Type())); } if (sig.return_signature()) { write_abi_type(w, get_type_semantics(sig.return_signature().Type())); } }, method_signature{ method }))); } else if (settings.netstandard_compat) { method_create_delegates_to_projection.emplace_back( w.write_temp("_% = (void*)Marshal.GetFunctionPointerForDelegate(DelegateCache[%] = new %(Do_Abi_%))", vmethod_name, delegate_cache_index, delegate_type, vmethod_name)); } else { // Work around C# compiler's lack of support for UnmanagedCallersOnly method_create_delegates_to_projection.emplace_back( w.write_temp("_% = &Do_Abi_%", vmethod_name, vmethod_name) ); } } else if (settings.netstandard_compat) { method_create_delegates_to_projection.emplace_back( w.write_temp("_% = (void*)Marshal.GetFunctionPointerForDelegate(DelegateCache[%] = new %(Do_Abi_%))", vmethod_name, delegate_cache_index, delegate_type, vmethod_name)); } else { // Work around C# compiler's lack of support for UnmanagedCallersOnly method_create_delegates_to_projection.emplace_back( w.write_temp("_% = &Do_Abi_%", vmethod_name, vmethod_name) ); } }, methods), [&](writer& w) { if (!is_generic) return; w.write("public static Guid PIID = GuidGenerator.CreateIID(typeof(%));\n", type_name); w.write(R"(% internal unsafe Vftbl(IntPtr thisPtr) : this() { var vftblPtr = Marshal.PtrToStructure<VftblPtr>(thisPtr); var vftbl = (IntPtr*)vftblPtr.Vftbl; IInspectableVftbl = Marshal.PtrToStructure<IInspectable.Vftbl>(vftblPtr.Vftbl); %} )", bind_each([&](writer& w, MethodDef const& method) { auto vmethod_name = get_vmethod_name(w, type, method); if (abi_signature_has_generic_parameters(w, method_signature{ method })) { auto generic_abi_types = get_generic_abi_types(w, method_signature{ method }); w.write("public static readonly Type %_Type = Expression.GetDelegateType(new Type[]{ typeof(void*), %typeof(int) });\n", vmethod_name, bind_each([&](writer& w, auto&& pair) { w.write("%, ", pair.first); }, generic_abi_types)); generic_methods.insert(vmethod_name); } }, methods), bind_each(method_marshals_to_abi) ); }, bind([&](writer& w) { if (is_generic) { w.write(R"( private static readonly Vftbl AbiToProjectionVftable; public static readonly IntPtr AbiToProjectionVftablePtr; % static unsafe Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = global::WinRT.IInspectable.Vftbl.AbiToProjectionVftable, % }; var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * %); % AbiToProjectionVftablePtr = (IntPtr)nativeVftbl; } )", bind([&](writer& w) { if (settings.netstandard_compat) { w.write("private static Delegate[] DelegateCache = new Delegate[%];", std::to_string(distance(methods))); } }), bind_list(",\n", method_create_delegates_to_projection), std::to_string(distance(methods)), bind([&](writer& w) { if (!is_generic) { w.write("Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false);"); } else { w.write("Marshal.StructureToPtr(AbiToProjectionVftable.IInspectableVftbl, (IntPtr)nativeVftbl, false);\n"); w.write("%", bind_each(method_marshals_to_projection)); } })); } else { w.write(R"( public static readonly IntPtr AbiToProjectionVftablePtr; % static unsafe Vftbl() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * %); (*(Vftbl*)AbiToProjectionVftablePtr) = new Vftbl { IInspectableVftbl = global::WinRT.IInspectable.Vftbl.AbiToProjectionVftable, % }; } )", bind([&](writer& w) { if (settings.netstandard_compat) { w.write("private static Delegate[] DelegateCache = new Delegate[%];", std::to_string(distance(methods))); } }), std::to_string(distance(methods)), bind_list(",\n", method_create_delegates_to_projection) ); } }), bind_each<write_method_abi_invoke>(methods), bind_each<write_property_abi_invoke>(type.PropertyList()), bind_each<write_event_abi_invoke>(type.EventList()) ); } void write_base_constructor_dispatch(writer& w, type_semantics type) { std::string base_default_interface_name; call(type, [&](object_type) {}, [&](type_definition const& def) { base_default_interface_name = get_default_interface_name(w, def); }, [&](generic_type_instance const& inst) { auto guard{ w.push_generic_args(inst) }; base_default_interface_name = get_default_interface_name(w, inst.generic_type); }, [](auto) { throw_invalid("Invalid base class type."); }); if (!std::holds_alternative<object_type>(type)) { w.write(R"( : base(ifc.As<%>()) )", base_default_interface_name); } } void write_custom_attributes(writer& w, TypeDef const& type) { auto write_fixed_arg = [&](writer& w, FixedArgSig arg) { if (std::holds_alternative<std::vector<ElemSig>>(arg.value)) { throw_invalid("ElemSig list unexpected"); } auto&& arg_value = std::get<ElemSig>(arg.value); call(arg_value.value, [&](ElemSig::SystemType system_type) { auto arg_type = type.get_cache().find_required(system_type.name); w.write("typeof(%)", bind<write_projection_type>(arg_type)); }, [&](ElemSig::EnumValue enum_value) { if (enum_value.type.m_typedef.TypeName() == "AttributeTargets") { std::vector<std::string> values; auto value = std::get<uint32_t>(enum_value.value); if (value == 4294967295) { values.emplace_back("All"); } else { static struct { uint32_t value; char const* name; } attribute_target_enums[] = { { 1, "Delegate" }, { 2, "Enum" }, { 4, "Event" }, { 8, "Field" }, { 16, "Interface" }, { 64, "Method" }, { 128, "Parameter" }, { 256, "Property" }, { 512, "Class" }, // "RuntimeClass" { 1024, "Struct" }, { 2048, "All" }, // "InterfaceImpl" { 8192, "Struct" }, // "ApiContract" }; for (auto&& target_enum : attribute_target_enums) { if (value & target_enum.value) { values.emplace_back(target_enum.name); } } } w.write("%", bind_list([](writer& w, auto&& value){ w.write("AttributeTargets.%", value); }, " | ", values)); } else for (auto field : enum_value.type.m_typedef.FieldList()) { if (field.Name() == "value__") continue; auto field_value = field.Constant().Value(); if (std::visit([&](auto&& v) { return Constant::constant_type{ v } == field_value; }, enum_value.value)) { w.write("%.%", bind<write_projection_type>(enum_value.type.m_typedef), field.Name()); } } }, [&](std::string_view type_name) { w.write("\"%\"", type_name); }, [&](auto&&) { if (auto uint32_value = std::get_if<uint32_t>(&arg_value.value)) { w.write("%u", *uint32_value); } else if (auto int32_value = std::get_if<int32_t>(&arg_value.value)) { w.write(*int32_value); } else if (auto uint64_value = std::get_if<uint64_t>(&arg_value.value)) { w.write(*uint64_value); } else if (auto int64_value = std::get_if<int64_t>(&arg_value.value)) { w.write(*int64_value); } else if (auto bool_value = std::get_if<bool>(&arg_value.value)) { w.write(*bool_value ? "true" : "false"); } else if (auto char_value = std::get_if<char16_t>(&arg_value.value)) { w.write(*char_value); } else if (auto uint8_value = std::get_if<uint8_t>(&arg_value.value)) { w.write(*uint8_value); } else if (auto int8_value = std::get_if<int8_t>(&arg_value.value)) { w.write(*int8_value); } else if (auto uint16_value = std::get_if<uint16_t>(&arg_value.value)) { w.write(*uint16_value); } else if (auto int16_value = std::get_if<int16_t>(&arg_value.value)) { w.write(*int16_value); } else if (auto float_value = std::get_if<float>(&arg_value.value)) { w.write_printf("f", *float_value); } else if (auto double_value = std::get_if<double>(&arg_value.value)) { w.write_printf("f", *double_value); } }); }; std::map<std::string, std::vector<std::string>> attributes; for (auto&& attribute : type.CustomAttribute()) { auto [attribute_namespace, attribute_name] = attribute.TypeNamespaceAndName(); attribute_name = attribute_name.substr(0, attribute_name.length() - "Attribute"sv.length()); // Guid and Flags are handled explicitly if (attribute_name == "Guid" || attribute_name == "Flags") continue; auto attribute_full = (attribute_name == "AttributeUsage") ? "AttributeUsage" : w.write_temp("%.%", attribute_namespace, attribute_name); std::vector<std::string> params; auto signature = attribute.Value(); for (auto&& arg : signature.FixedArgs()) { params.push_back(w.write_temp("%", bind(write_fixed_arg, arg))); } for (auto&& arg : signature.NamedArgs()) { params.push_back(w.write_temp("% = %", arg.name, bind(write_fixed_arg, arg.value))); } attributes[attribute_full] = std::move(params); } if (auto&& usage = attributes.find("AttributeUsage"); usage != attributes.end()) { bool allow_multiple = attributes.find("Windows.Foundation.Metadata.AllowMultiple") != attributes.end(); usage->second.push_back(w.write_temp("AllowMultiple = %", allow_multiple ? "true" : "false")); } for (auto&& attribute : attributes) { w.write("["); w.write(attribute.first); if (!attribute.second.empty()) { w.write("(%)", bind_list(", ", attribute.second)); } w.write("]\n"); } } void write_contract(writer& w, TypeDef const& type) { auto type_name = write_type_name_temp(w, type); w.write(R"(%public enum % { } )", bind<write_custom_attributes>(type), type_name); } void write_attribute(writer& w, TypeDef const& type) { auto type_name = write_type_name_temp(w, type); w.write(R"(%%public sealed class %: Attribute { %} )", bind<write_winrt_attribute>(type), bind<write_custom_attributes>(type), type_name, [&](writer& w) { auto methods = type.MethodList(); for (auto&& method : methods) { if (method.Name() != ".ctor") continue; method_signature signature{ method }; w.write("public %(%){}\n", type_name, bind_list<write_projection_parameter>(", ", signature.params())); } for (auto&& field : type.FieldList()) { w.write("public % %;\n", bind<write_projection_type>(get_type_semantics(field.Signature().Type())), field.Name()); } }); } void write_interface(writer& w, TypeDef const& type) { XLANG_ASSERT(get_category(type) == category::interface_type); auto type_name = write_type_name_temp(w, type); uint32_t const vtable_base = type.MethodList().first.index(); w.write(R"(%% %% interface %% {% } )", // Interface bind<write_winrt_attribute>(type), bind<write_guid_attribute>(type), bind<write_custom_attributes>(type), is_exclusive_to(type) ? "internal" : "public", type_name, bind<write_type_inheritance>(type, object_type{}, false), bind<write_interface_member_signatures>(type) ); } bool write_abi_interface(writer& w, TypeDef const& type) { XLANG_ASSERT(get_category(type) == category::interface_type); auto type_name = write_type_name_temp(w, type, "%", true); auto nongenerics_class = w.write_temp("%_Delegates", bind<write_typedef_name>(type, true, false)); auto is_generic = distance(type.GenericParam()) > 0; std::set<std::string> generic_methods; std::vector<std::string> nongeneric_delegates; uint32_t const vtable_base = type.MethodList().first.index(); std::map<std::string, required_interface> required_interfaces; write_required_interface_members_for_abi_type(w, type, required_interfaces); w.write(R"([global::WinRT.ObjectReferenceWrapper(nameof(_obj))] % public unsafe class % : % { % internal static ObjectReference<Vftbl> FromAbi(IntPtr thisPtr)% public static implicit operator %(IObjectReference obj) => (obj != null) ? new %(obj) : null; protected readonly ObjectReference<Vftbl> _obj; public IObjectReference ObjRef { get => _obj; } public IntPtr ThisPtr => _obj.ThisPtr; public ObjectReference<I> AsInterface<I>() => _obj.As<I>(); public A As<A>() => _obj.AsType<A>(); public @(IObjectReference obj) : this(obj.As<Vftbl>()) {} internal @(ObjectReference<Vftbl> obj) { _obj = obj;% %} %%%%} )", // Interface abi implementation bind<write_guid_attribute>(type), type_name, bind<write_type_name>(type, false, false), // Vftbl bind<write_vtable>(type, type_name, generic_methods, nongenerics_class, nongeneric_delegates), // Interface impl [&](writer& w) { if (!is_generic) { w.write(" => ObjectReference<Vftbl>.FromAbi(thisPtr);\n"); return; } w.write(R"( { if (thisPtr == IntPtr.Zero) { return null; } var vftblT = new Vftbl(thisPtr); return ObjectReference<Vftbl>.FromAbi(thisPtr, vftblT); } public static Guid PIID = Vftbl.PIID; )"); }, type_name, type_name, type.TypeName(), type.TypeName(), bind<write_event_source_ctors>(type), [&](writer& w) { for (auto required_interface : required_interfaces) { if (required_interface.second.helper_wrapper.empty()) continue; w.write("% = new %.FromAbiHelper(ObjRef);\n", required_interface.second.adapter, required_interface.second.helper_wrapper); } }, [&](writer& w) { for (auto required_interface : required_interfaces) { if (required_interface.second.helper_wrapper.empty()) continue; w.write("%.FromAbiHelper %;\n", required_interface.second.helper_wrapper, required_interface.second.adapter); } }, bind<write_interface_members>(type, generic_methods), bind<write_event_sources>(type), [&](writer& w) { for (auto required_interface : required_interfaces) { w.write("%", required_interface.second.members); } } ); if (!nongeneric_delegates.empty()) { w.write(R"([global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static class % { %} )", nongenerics_class, bind_each(nongeneric_delegates)); } w.write("\n"); return true; } void write_class(writer& w, TypeDef const& type) { if (is_static(type)) { write_static_class(w, type); return; } auto type_name = write_type_name_temp(w, type); auto default_interface_name = get_default_interface_name(w, type, false); auto default_interface_abi_name = get_default_interface_name(w, type, true); auto base_semantics = get_type_semantics(type.Extends()); auto derived_new = std::holds_alternative<object_type>(base_semantics) ? "" : "new "; w.write(R"(%[global::WinRT.ProjectedRuntimeClass(nameof(_default))] %public %class %%, IEquatable<%> { public %IntPtr ThisPtr => _default.ThisPtr; private IObjectReference _inner = null; private readonly Lazy<%> _defaultLazy; private readonly Dictionary<Type, object> _lazyInterfaces; private % _default => _defaultLazy.Value; % public static %% FromAbi(IntPtr thisPtr) { if (thisPtr == IntPtr.Zero) return null; var obj = MarshalInspectable.FromAbi(thisPtr); return obj is % ? (%)obj : new %((%)obj); } % %(% ifc)% { _defaultLazy = new Lazy<%>(() => ifc); _lazyInterfaces = new Dictionary<Type, object>() {% }; } public static bool operator ==(% x, % y) => (x?.ThisPtr ?? IntPtr.Zero) == (y?.ThisPtr ?? IntPtr.Zero); public static bool operator !=(% x, % y) => !(x == y); public bool Equals(% other) => this == other; public override bool Equals(object obj) => obj is % that && this == that; public override int GetHashCode() => ThisPtr.GetHashCode(); % private struct InterfaceTag<I>{}; private % AsInternal(InterfaceTag<%> _) => _default; %% } )", bind<write_winrt_attribute>(type), bind<write_custom_attributes>(type), bind<write_class_modifiers>(type), type_name, bind<write_type_inheritance>(type, base_semantics, true), type_name, derived_new, default_interface_abi_name, default_interface_abi_name, bind<write_attributed_types>(type), derived_new, type_name, type_name, type_name, type_name, default_interface_abi_name, type.Flags().Sealed() ? "internal" : "protected internal", type_name, default_interface_abi_name, bind<write_base_constructor_dispatch>(base_semantics), default_interface_abi_name, bind<write_lazy_interface_initialization>(type), type_name, type_name, type_name, type_name, type_name, type_name, bind([&](writer& w) { bool has_base_type = !std::holds_alternative<object_type>(get_type_semantics(type.Extends())); if (!type.Flags().Sealed()) { w.write(R"( protected %(global::WinRT.DerivedComposed _)% { _defaultLazy = new Lazy<%>(() => GetDefaultReference<%.Vftbl>()); _lazyInterfaces = new Dictionary<Type, object>() {% }; })", type.TypeName(), has_base_type ? ":base(_)" : "", default_interface_abi_name, default_interface_abi_name, bind<write_lazy_interface_initialization>(type)); } std::string_view access_spec = "protected "; std::string_view override_spec = has_base_type ? "override " : "virtual "; if (type.Flags().Sealed() && !has_base_type) { access_spec = "private "; override_spec = " "; } w.write(R"( %%IObjectReference GetDefaultReference<T>() => _default.AsInterface<T>();)", access_spec, override_spec); w.write(R"( %%IObjectReference GetReferenceForQI() => _inner ?? _default.ObjRef;)", access_spec, override_spec); }), default_interface_name, default_interface_name, bind<write_class_members>(type), bind([&](writer& w) { bool has_base_class = !std::holds_alternative<object_type>(get_type_semantics(type.Extends())); separator s{ w, " || " }; w.write(R"( %bool IsOverridableInterface(Guid iid) => %%; global::System.Runtime.InteropServices.CustomQueryInterfaceResult global::System.Runtime.InteropServices.ICustomQueryInterface.GetInterface(ref Guid iid, out IntPtr ppv) { ppv = IntPtr.Zero; if (IsOverridableInterface(iid) || typeof(global::WinRT.IInspectable).GUID == iid) { return global::System.Runtime.InteropServices.CustomQueryInterfaceResult.NotHandled; } if (GetReferenceForQI().TryAs<IUnknownVftbl>(iid, out ObjectReference<IUnknownVftbl> objRef) >= 0) { using (objRef) { ppv = objRef.GetRef(); return global::System.Runtime.InteropServices.CustomQueryInterfaceResult.Handled; } } return global::System.Runtime.InteropServices.CustomQueryInterfaceResult.NotHandled; })", bind([&](writer& w) { auto visibility = "protected "; auto overridable = "virtual "; if (has_base_class) { overridable = "override "; } else if (type.Flags().Sealed()) { visibility = "private "; overridable = ""; } w.write(visibility); w.write(overridable); }), bind_each([&](writer& w, InterfaceImpl const& iface) { if (has_attribute(iface, "Windows.Foundation.Metadata", "OverridableAttribute")) { s(); w.write("GuidGenerator.GetIID(typeof(%)) == iid", bind<write_type_name>(get_type_semantics(iface.Interface()), false, false)); } }, type.InterfaceImpl()), bind([&](writer& w) { if (has_base_class) { s(); w.write("base.IsOverridableInterface(iid)"); } if (s.first) { w.write("false"); } })); })); } void write_abi_class(writer& w, TypeDef const& type) { if (is_static(type)) { return; } auto abi_type_name = write_type_name_temp(w, type, "%", true); auto projected_type_name = write_type_name_temp(w, type); auto default_interface_abi_name = get_default_interface_name(w, type, true); w.write(R"([global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public struct % { public static IObjectReference CreateMarshaler(% obj) => obj is null ? null : MarshalInspectable.CreateMarshaler(obj).As<%.Vftbl>(); public static IntPtr GetAbi(IObjectReference value) => value is null ? IntPtr.Zero : MarshalInterfaceHelper<object>.GetAbi(value); public static % FromAbi(IntPtr thisPtr) => %.FromAbi(thisPtr); public static IntPtr FromManaged(% obj) => obj is null ? IntPtr.Zero : CreateMarshaler(obj).GetRef(); public static unsafe MarshalInterfaceHelper<%>.MarshalerArray CreateMarshalerArray(%[] array) => MarshalInterfaceHelper<%>.CreateMarshalerArray(array, (o) => CreateMarshaler(o)); public static (int length, IntPtr data) GetAbiArray(object box) => MarshalInterfaceHelper<%>.GetAbiArray(box); public static unsafe %[] FromAbiArray(object box) => MarshalInterfaceHelper<%>.FromAbiArray(box, FromAbi); public static (int length, IntPtr data) FromManagedArray(%[] array) => MarshalInterfaceHelper<%>.FromManagedArray(array, (o) => FromManaged(o)); public static void DisposeMarshaler(IObjectReference value) => MarshalInspectable.DisposeMarshaler(value); public static void DisposeMarshalerArray(MarshalInterfaceHelper<%>.MarshalerArray array) => MarshalInterfaceHelper<%>.DisposeMarshalerArray(array); public static void DisposeAbi(IntPtr abi) => MarshalInspectable.DisposeAbi(abi); public static unsafe void DisposeAbiArray(object box) => MarshalInspectable.DisposeAbiArray(box); } )", abi_type_name, projected_type_name, default_interface_abi_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name, projected_type_name); } void write_delegate(writer& w, TypeDef const& type) { method_signature signature{ get_delegate_invoke(type) }; w.write(R"(%%public delegate % %(%); )", bind<write_winrt_attribute>(type), bind<write_custom_attributes>(type), bind<write_projection_return_type>(signature), bind<write_type_name>(type, false, false), bind_list<write_projection_parameter>(", ", signature.params())); } void write_abi_delegate(writer& w, TypeDef const& type) { auto method = get_delegate_invoke(type); method_signature signature{ method }; auto type_name = write_type_name_temp(w, type); auto type_params = w.write_temp("%", bind<write_type_params>(type)); auto is_generic = distance(type.GenericParam()) > 0; auto generic_abi_types = get_generic_abi_types(w, signature); bool have_generic_params = std::find_if(generic_abi_types.begin(), generic_abi_types.end(), [](auto&& pair){ return !pair.second.empty(); }) != generic_abi_types.end(); w.write(R"([global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] % public static class @% {% % private static readonly global::WinRT.Interop.IDelegateVftbl AbiToProjectionVftable; public static readonly IntPtr AbiToProjectionVftablePtr; static unsafe @() {% AbiToProjectionVftable = new global::WinRT.Interop.IDelegateVftbl { IUnknownVftbl = global::WinRT.Interop.IUnknownVftbl.AbiToProjectionVftbl, Invoke = % }; var nativeVftbl = ComWrappersSupport.AllocateVtableMemory(typeof(@%), Marshal.SizeOf<global::WinRT.Interop.IDelegateVftbl>()); Marshal.StructureToPtr(AbiToProjectionVftable, nativeVftbl, false); AbiToProjectionVftablePtr = nativeVftbl; } % public static unsafe IObjectReference CreateMarshaler(% managedDelegate) => managedDelegate is null ? null : ComWrappersSupport.CreateCCWForObject(managedDelegate).As<global::WinRT.Interop.IDelegateVftbl>(GuidGenerator.GetIID(typeof(@%))); public static IntPtr GetAbi(IObjectReference value) => MarshalInterfaceHelper<%>.GetAbi(value); public static unsafe % FromAbi(IntPtr nativeDelegate) { var abiDelegate = ObjectReference<IDelegateVftbl>.FromAbi(nativeDelegate); return abiDelegate is null ? null : (%)ComWrappersSupport.TryRegisterObjectForInterface(new %(new NativeDelegateWrapper(abiDelegate).Invoke), nativeDelegate); } [global::WinRT.ObjectReferenceWrapper(nameof(_nativeDelegate))] private class NativeDelegateWrapper { private readonly ObjectReference<global::WinRT.Interop.IDelegateVftbl> _nativeDelegate; private readonly AgileReference _agileReference = default; public NativeDelegateWrapper(ObjectReference<global::WinRT.Interop.IDelegateVftbl> nativeDelegate) { _nativeDelegate = nativeDelegate; if (_nativeDelegate.TryAs<ABI.WinRT.Interop.IAgileObject.Vftbl>(out var objRef) < 0) { _agileReference = new AgileReference(_nativeDelegate); } else { objRef.Dispose(); } } public unsafe % Invoke(%) { using var agileDelegate = _agileReference?.Get()?.As<global::WinRT.Interop.IDelegateVftbl>(GuidGenerator.GetIID(typeof(@%))); var delegateToInvoke = agileDelegate ?? _nativeDelegate; IntPtr ThisPtr = delegateToInvoke.ThisPtr; %% } } public static IntPtr FromManaged(% managedDelegate) => CreateMarshaler(managedDelegate)?.GetRef() ?? IntPtr.Zero; public static void DisposeMarshaler(IObjectReference value) => MarshalInterfaceHelper<%>.DisposeMarshaler(value); public static void DisposeAbi(IntPtr abi) => MarshalInterfaceHelper<%>.DisposeAbi(abi); % private static unsafe int Do_Abi_Invoke% { % } } )", bind<write_guid_attribute>(type), type.TypeName(), type_params, [&](writer& w) { if (type_params.empty()) return; w.write(R"( public static Guid PIID = GuidGenerator.CreateIID(typeof(%));)", type_name ); }, [&](writer& w) { if (!is_generic) { if (settings.netstandard_compat) { w.write("private unsafe delegate int Abi_Invoke(%);\n", bind<write_abi_parameters>(signature)); } return; } w.write(R"(private static readonly Type Abi_Invoke_Type = Expression.GetDelegateType(new Type[] { typeof(void*), %typeof(int) }); )", bind_each([&](writer& w, auto&& pair) { w.write("%, ", pair.first); }, generic_abi_types)); }, // class constructor type.TypeName(), [&](writer& w) { if (!is_generic) { if (settings.netstandard_compat) { w.write("\nAbiInvokeDelegate = new Abi_Invoke(Do_Abi_Invoke);"); } return; } w.write("\nAbiInvokeDelegate = global::System.Delegate.CreateDelegate(Abi_Invoke_Type, typeof(@%).GetMethod(nameof(Do_Abi_Invoke), BindingFlags.Static | BindingFlags.NonPublic)%);", type.TypeName(), type_params, [&](writer& w) { if (!have_generic_params) return; w.write(".MakeGenericMethod(new Type[]{ % })\n", [&](writer& w) { int count = 0; for (auto&& pair : generic_abi_types) { if (pair.second.empty()) continue; w.write(count++ == 0 ? "" : ", "); w.write(pair.first); } }); }); }, bind([&](writer& w) { if (settings.netstandard_compat || is_generic) { w.write("Marshal.GetFunctionPointerForDelegate(AbiInvokeDelegate)"); } else { w.write("(IntPtr)(delegate*<%, int>)&Do_Abi_Invoke", bind<write_abi_parameter_types_pointer>(signature)); } }), type.TypeName(), type_params, settings.netstandard_compat || is_generic ? "\npublic static global::System.Delegate AbiInvokeDelegate { get; }\n" : "", // CreateMarshaler type_name, type.TypeName(), type_params, // GetAbi type_name, // FromAbi type_name, type_name, type_name, // NativeDelegateWrapper.Invoke bind<write_projection_return_type>(signature), bind_list<write_projection_parameter>(", ", signature.params()), type.TypeName(), type_params, bind([&](writer& w) { if (is_generic || settings.netstandard_compat) { w.write("var abiInvoke = Marshal.GetDelegateForFunctionPointer%(delegateToInvoke.Vftbl.Invoke%);", is_generic ? "" : "<Abi_Invoke>", is_generic ? ", Abi_Invoke_Type" : ""); } else { w.write("var abiInvoke = (delegate* stdcall<%, int>)(delegateToInvoke.Vftbl.Invoke);", bind<write_abi_parameter_types>(signature)); } }), bind<write_abi_method_call>(signature, "abiInvoke", is_generic, false), // FromManaged type_name, // DisposeMarshaler type_name, // DisposeAbi type_name, // Do_Abi_Invoke !is_generic && !settings.netstandard_compat ? "\n[UnmanagedCallersOnly]" : "", [&](writer& w) { if (!is_generic) { w.write("(%)", bind<write_abi_parameters>(signature)); return; } if (have_generic_params) { w.write("<"); int count = 0; for (auto&& pair : generic_abi_types) { if (pair.second.empty()) continue; w.write(count++ == 0 ? "" : ", "); w.write(pair.second); } w.write(">"); } w.write("(void* thisPtr"); int index = 0; for (auto&& param : signature.params()) { auto generic_type = generic_abi_types[index++].second; auto param_cat = get_param_category(param); if (!generic_type.empty() && (param_cat <= param_category::out)) { w.write(", %% %", param_cat == param_category::out ? "out " : "", generic_type, bind<write_parameter_name>(param)); } else { write_abi_parameter(w, param); } } if (auto return_sig = signature.return_signature()) { auto generic_type = generic_abi_types[index++].second; if (!return_sig.Type().is_szarray() && !generic_type.empty()) { w.write(", out % %", generic_type, signature.return_param_name()); } else { write_abi_return(w, signature); } } w.write(")"); }, bind<write_managed_method_call>(signature, w.write_temp(R"(global::WinRT.ComWrappersSupport.MarshalDelegateInvoke(%, (% invoke) => { % }))", is_generic ? "new IntPtr(thisPtr)" : "thisPtr", is_generic ? "global::System.Delegate" : type_name, bind([&](writer& w) { if (is_generic) { w.write(R"(invoke.DynamicInvoke(%);)", "%"); } else if (signature.return_signature()) { w.write("return invoke(%);", "%"); } else { w.write("invoke(%);"); } }) ))); } void write_constant(writer& w, Constant const& value) { switch (value.Type()) { case ConstantType::Int32: w.write_printf("%#0x", value.ValueInt32()); break; case ConstantType::UInt32: w.write_printf("%#0x", value.ValueUInt32()); break; } } void write_enum(writer& w, TypeDef const& type) { if (is_flags_enum(type)) { w.write("[FlagsAttribute]\n"); } auto enum_underlying_type = is_flags_enum(type) ? "uint" : "int"; w.write(R"(%%public enum % : % { )", bind<write_winrt_attribute>(type), bind<write_custom_attributes>(type), bind<write_type_name>(type, false, false), enum_underlying_type); { for (auto&& field : type.FieldList()) { if (auto constant = field.Constant()) { w.write("% = unchecked((%)%),\n", field.Name(), enum_underlying_type, bind<write_constant>(constant)); } } } w.write("}\n"); } void write_struct(writer& w, TypeDef const& type) { auto name = w.write_temp("%", bind<write_type_name>(type, false, false)); struct field_info { std::string type; std::string name; bool is_interface; }; std::vector<field_info> fields; for (auto&& field : type.FieldList()) { auto semantics = get_type_semantics(field.Signature().Type()); field_info field_info{}; field_info.type = w.write_temp("%", [&](writer& w){ write_projection_type(w, semantics); }); field_info.name = field.Name(); if (auto td = std::get_if<type_definition>(&semantics)) { field_info.is_interface = get_category(*td) == category::interface_type; } else if (auto gti = std::get_if<generic_type_instance>(&semantics)) { field_info.is_interface = get_category(gti->generic_type) == category::interface_type; } fields.emplace_back(field_info); } w.write(R"(%%public struct %: IEquatable<%> { % public %(%) { % } public static bool operator ==(% x, % y) => %; public static bool operator !=(% x, % y) => !(x == y); public bool Equals(% other) => this == other; public override bool Equals(object obj) => obj is % that && this == that; public override int GetHashCode() => %; } )", // struct bind<write_winrt_attribute>(type), bind<write_custom_attributes>(type), name, name, bind_each([](writer& w, auto&& field) { w.write("public % %;\n", field.type, field.name); }, fields), // ctor name, bind_list([](writer& w, auto&& field) { w.write("% _%", field.type, field.name); }, ", ", fields), bind_each([](writer& w, auto&& field) { w.write("% = _%; ", field.name, field.name); }, fields), // == name, name, bind_list([](writer& w, auto&& field) { w.write("x.% == y.%", field.name, field.name); }, " && ", fields), // !=, Equals name, name, name, name, // GetHashCode bind_list([](writer& w, auto&& field) { w.write("%.GetHashCode()", field.name); }, " ^ ", fields) ); } void write_abi_struct(writer& w, TypeDef const& type) { if (is_type_blittable(type)) { return; } w.write("[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\npublic struct %\n{\n", bind<write_type_name>(type, true, false)); for (auto&& field : type.FieldList()) { w.write("public "); write_abi_type(w, get_type_semantics(field.Signature().Type())); w.write(" %;\n", field.Name()); } auto projected_type = w.write_temp("%", bind<write_projection_type>(type)); auto abi_type = w.write_temp("%", bind<write_type_name>(type, true, false)); std::vector<abi_marshaler> marshalers; for (auto&& field : type.FieldList()) { abi_marshaler m{ std::string(field.Name()), -1 }; set_abi_marshaler(w, field.Signature().Type(), m); marshalers.push_back(std::move(m)); } // blittable: (no marshaler) value type requiring no marshaling/disposing // marshalable: (marshaler, is_value_type) value type requiring only marshaling, no disposing // disposable: (marshaler, !is_value_type) ref type requiring marshaling and disposing bool have_disposers = std::find_if(marshalers.begin(), marshalers.end(), [](abi_marshaler const& m) { return !m.is_value_type; }) != marshalers.end(); w.write(R"( internal struct Marshaler { %public % __abi; )", bind_each([](writer& w, abi_marshaler const& m) { if (m.marshaler_type.empty()) return; w.write("public % _%;\n", m.local_type, m.param_name); }, marshalers), abi_type); if (have_disposers) { w.write(R"(public void Dispose() { %} )", bind_each([](writer& w, abi_marshaler const& m) { if(m.is_value_type) return; w.write("%.DisposeMarshaler(_%);\n", m.marshaler_type, m.param_name); }, marshalers)); } w.write("}\n"); w.write(R"( internal static Marshaler CreateMarshaler(% arg) { var m = new Marshaler();)", projected_type); if (have_disposers) { w.write(R"( Func<bool> dispose = () => { m.Dispose(); return false; }; try {)"); } for (auto&& m : marshalers) { if (m.marshaler_type.empty()) continue; w.write("\nm._% = ", m.param_name); m.write_create(w, "arg." + m.get_escaped_param_name(w)); w.write(";"); } w.write(R"( m.__abi = new %() { %}; return m;)", abi_type, [&](writer& w) { int count = 0; for (auto&& m : marshalers) { w.write(count++ == 0 ? "" : ", "); if (m.marshaler_type.empty()) { std::string format; if (m.param_type == "bool") { format = "% = (byte)(arg.% ? 1 : 0)\n"; } else if (m.param_type == "char") { format = "% = (ushort)arg.%\n"; } else { format = "% = arg.%\n"; } w.write(format, m.get_escaped_param_name(w), m.get_escaped_param_name(w)); continue; } w.write("% = %.GetAbi(m._%)\n", m.get_escaped_param_name(w), m.marshaler_type, m.param_name); } }); if (have_disposers) { w.write(R"( } catch (Exception) when (dispose()) { // Will never execute return default; } )"); } w.write("}\n"); w.write(R"( internal static % GetAbi(Marshaler m) => m.__abi; )", abi_type); w.write(R"( public static % FromAbi(% arg) { return new %() { %}; } )", projected_type, abi_type, projected_type, [&](writer& w) { int count = 0; for (auto&& m : marshalers) { w.write(count++ == 0 ? "" : ", "); if (m.marshaler_type.empty()) { std::string format; if (m.param_type == "bool") { format = "% = arg.% != 0\n"; } else if (m.param_type == "char") { format = "% = (char)arg.%\n"; } else { format = "% = arg.%\n"; } w.write(format, m.get_escaped_param_name(w), m.get_escaped_param_name(w)); continue; } w.write("% = %\n", m.get_escaped_param_name(w), [&](writer& w) {m.write_from_abi(w, "arg." + m.get_escaped_param_name(w)); }); } }); w.write(R"( public static % FromManaged(% arg) { return new %() { %}; } )", abi_type, projected_type, abi_type, [&](writer& w) { int count = 0; for (auto&& m : marshalers) { w.write(count++ == 0 ? "" : ", "); if (m.marshaler_type.empty()) { std::string format; if (m.param_type == "bool") { format = "% = (byte)(arg.% ? 1 : 0)\n"; } else if (m.param_type == "char") { format = "% = (ushort)arg.%\n"; } else { format = "% = arg.%\n"; } w.write(format, m.get_escaped_param_name(w), m.get_escaped_param_name(w)); continue; } w.write("% = %\n", m.get_escaped_param_name(w), [&](writer& w) { m.write_from_managed(w, "arg." + m.get_escaped_param_name(w)); }); } }); w.write(R"( internal static unsafe void CopyAbi(Marshaler arg, IntPtr dest) => *(%*)dest.ToPointer() = GetAbi(arg); )", abi_type); w.write(R"( public static unsafe void CopyManaged(% arg, IntPtr dest) => *(%*)dest.ToPointer() = FromManaged(arg); )", projected_type, abi_type); w.write(R"( internal static void DisposeMarshaler(Marshaler m) % )", have_disposers ? "=> m.Dispose();" : "{}"); w.write(R"( public static void DisposeAbi(% abi){ /*todo*/ } } )", abi_type); } }
36.422117
279
0.502047
[ "object", "vector" ]
1923415cecf646785cfd920765d5ca44d8983362
983
h
C
src/GpsPosition/GpsPosition.h
Andrewiski/GPS_HardwareSerial_Parsing
c792755bcb09114570750501c249a8e9ae3fbfc6
[ "MIT" ]
null
null
null
src/GpsPosition/GpsPosition.h
Andrewiski/GPS_HardwareSerial_Parsing
c792755bcb09114570750501c249a8e9ae3fbfc6
[ "MIT" ]
null
null
null
src/GpsPosition/GpsPosition.h
Andrewiski/GPS_HardwareSerial_Parsing
c792755bcb09114570750501c249a8e9ae3fbfc6
[ "MIT" ]
null
null
null
#ifndef _GPSPOSITION_H #define _GPSPOSITION_H #include "Arduino.h" #include <Adafruit_GPS.h> class GpsPosition { public: GpsPosition(); // Constructor GpsPosition(Adafruit_GPS GPS); // Constructor bool valid; uint8_t hour; ///< GMT hours uint8_t minute; ///< GMT minutes uint8_t seconds; ///< GMT seconds uint16_t milliseconds; ///< GMT milliseconds uint8_t year; ///< GMT year uint8_t month; ///< GMT month uint8_t day; ///< GMT day float lat; float lng; float altitude; float speed; float angle; float magvariation; uint8_t fixquality; ///< Fix quality (0, 1, 2 = Invalid, GPS, DGPS) uint8_t fixquality_3d; ///< 3D fix quality (1, 3, 3 = Nofix, 2D fix, 3D fix) uint8_t satellites; String getFilename(); String getJsonTimestamp(); String getJson(); private: void common_init(void); String getTimestamp(String type); }; #endif
26.567568
80
0.618515
[ "3d" ]
19261b47af2f5339719e6cd62f4b027afdd8d015
11,418
c
C
tool/vapid.c
web-push-libs/ecec
9c51ad6b959bc775b6a99018a43803d090ed9f05
[ "MIT" ]
13
2017-05-04T04:08:33.000Z
2021-04-27T11:28:34.000Z
tool/vapid.c
web-push-libs/ecec
9c51ad6b959bc775b6a99018a43803d090ed9f05
[ "MIT" ]
32
2017-03-21T21:08:07.000Z
2021-07-19T15:59:06.000Z
tool/vapid.c
kitcambridge/ecec
9c51ad6b959bc775b6a99018a43803d090ed9f05
[ "MIT" ]
8
2017-04-03T13:13:56.000Z
2021-07-29T00:33:16.000Z
#include <stdlib.h> #include <string.h> #include <unistd.h> #include <openssl/bn.h> #include <openssl/ec.h> #include <openssl/obj_mac.h> #include <openssl/sha.h> #include <ece.h> #include <ece/keys.h> #define VAPID_HEADER "{\"alg\":\"ES256\",\"typ\":\"JWT\"}" #define VAPID_HEADER_LENGTH 27 static const char vapid_hex_table[] = "0123456789abcdef"; // Indicates whether `c` is an ASCII control character, and must be escaped // to appear in a JSON string. static inline bool vapid_json_escape_is_control(char c) { return c >= '\0' && c <= '\x1f'; } // Returns an escaped literal for a control character, double quote, or reverse // solidus; `\0` otherwise. static inline char vapid_json_escape_literal(char c) { switch (c) { case '\b': return 'b'; case '\n': return 'n'; case '\f': return 'f'; case '\r': return 'r'; case '\t': return 't'; case '"': case '\\': return c; } return '\0'; } // Writes a Unicode escape sequence for a control character. static inline size_t vapid_json_escape_unicode(char c, char* result) { result[0] = '\\'; result[1] = 'u'; result[2] = '0'; result[3] = '0'; result[4] = vapid_hex_table[(c >> 4) & 0xf]; result[5] = vapid_hex_table[c & 0xf]; return 6; } // Returns the length of `str` as a JSON string, including room for double // quotes and escape sequences for special characters. static size_t vapid_json_quoted_length(const char* str, size_t strLen) { // 2 bytes for the opening and closing quotes. size_t len = 2; for (size_t i = 0; i < strLen; i++) { if (vapid_json_escape_literal(str[i])) { // 2 bytes: "\", followed by the escaped literal. len += 2; } else if (vapid_json_escape_is_control(str[i])) { // 6 bytes: "\u", followed by a four-byte Unicode escape sequence. len += 6; } else { len++; } } return len; } // Converts `str` into a double-quoted JSON string and escapes all special // characters. This is the only JSON encoding we'll need to do, since our claims // object contains two strings and a number. static char* vapid_json_quote(const char* str, size_t strLen) { size_t quotedLen = vapid_json_quoted_length(str, strLen); char* quotedStr = malloc(quotedLen + 1); if (!quotedStr) { return NULL; } char* result = quotedStr; *result++ = '"'; for (size_t i = 0; i < strLen; i++) { char escLiteral = vapid_json_escape_literal(str[i]); if (escLiteral) { // Some special characters have escaped literal forms. *result++ = '\\'; *result++ = escLiteral; } else if (vapid_json_escape_is_control(str[i])) { // Other control characters need Unicode escape sequences. result += vapid_json_escape_unicode(str[i], result); } else { *result++ = str[i]; } } *result++ = '"'; quotedStr[quotedLen] = '\0'; return quotedStr; } // Builds and returns the signature base string. This is what we'll sign with // our private key. The base string is *not* null-terminated. static char* vapid_build_signature_base(const char* aud, size_t audLen, uint32_t exp, const char* sub, size_t subLen, size_t* sigBaseLen) { char* quotedAud = NULL; char* quotedSub = NULL; char* payload = NULL; char* sigBase = NULL; // Build the payload, which contains the audience, expiry, and subject claims. // Since we only need to include three claims, and since this tool is meant to // show how Vapid works with few dependencies, we build our JSON string using // `sprintf`. I don't recommend this approach; it's almost always better to // use a proper serialization library. quotedAud = vapid_json_quote(aud, audLen); if (!quotedAud) { goto end; } quotedSub = vapid_json_quote(sub, subLen); if (!quotedSub) { goto end; } int payloadLen = snprintf(NULL, 0, "{\"aud\":%s,\"exp\":%" PRIu32 ",\"sub\":%s}", quotedAud, exp, quotedSub); if (payloadLen <= 0) { goto end; } // Allocate an extra byte for the null terminator, which `sprintf` appends. payload = malloc((size_t) payloadLen + 1); if (!payload) { goto end; } if (sprintf(payload, "{\"aud\":%s,\"exp\":%" PRIu32 ",\"sub\":%s}", quotedAud, exp, quotedSub) <= 0) { goto end; } // Determine the Base64url-encoded sizes of the header and payload, and // allocate a buffer large enough to hold the encoded strings and a `.` // separator. size_t b64HeaderLen = ece_base64url_encode( VAPID_HEADER, VAPID_HEADER_LENGTH, ECE_BASE64URL_OMIT_PADDING, NULL, 0); size_t b64PayloadLen = ece_base64url_encode( payload, (size_t) payloadLen, ECE_BASE64URL_OMIT_PADDING, NULL, 0); *sigBaseLen = b64HeaderLen + b64PayloadLen + 1; sigBase = malloc(*sigBaseLen); if (!sigBase) { goto end; } // Finally, write the encoded header, a `.`, and the encoded payload. ece_base64url_encode(VAPID_HEADER, VAPID_HEADER_LENGTH, ECE_BASE64URL_OMIT_PADDING, sigBase, b64HeaderLen); sigBase[b64HeaderLen] = '.'; ece_base64url_encode(payload, (size_t) payloadLen, ECE_BASE64URL_OMIT_PADDING, &sigBase[b64HeaderLen + 1], b64PayloadLen); end: free(quotedAud); free(quotedSub); free(payload); return sigBase; } // Signs a signature base string with the given `key`, and returns the raw // signature. static uint8_t* vapid_sign(EC_KEY* key, const void* sigBase, size_t sigBaseLen, size_t* sigLen) { ECDSA_SIG* sig = NULL; const BIGNUM* r; const BIGNUM* s; uint8_t* rawSig = NULL; // Our algorithm is "ES256", so we compute the SHA-256 digest. uint8_t digest[SHA256_DIGEST_LENGTH]; SHA256(sigBase, sigBaseLen, digest); // OpenSSL has an `ECDSA_sign` function that writes a DER-encoded ASN.1 // structure. We use `ECDSA_do_sign` instead because we want to write // `s` and `r` directly. sig = ECDSA_do_sign(digest, SHA256_DIGEST_LENGTH, key); if (!sig) { goto end; } ECDSA_SIG_get0(sig, &r, &s); size_t rLen = (size_t) BN_num_bytes(r); size_t sLen = (size_t) BN_num_bytes(s); *sigLen = rLen + sLen; rawSig = calloc(*sigLen, sizeof(uint8_t)); if (!rawSig) { goto end; } BN_bn2bin(r, rawSig); BN_bn2bin(s, &rawSig[rLen]); end: ECDSA_SIG_free(sig); return rawSig; } // Builds a signed Vapid token to include in the `Authorization` header. The // token is null-terminated. static char* vapid_build_token(EC_KEY* key, const char* aud, size_t audLen, uint32_t exp, const char* sub, size_t subLen) { char* sigBase = NULL; uint8_t* sig = NULL; char* token = NULL; // Build and sign the signature base string. size_t sigBaseLen; sigBase = vapid_build_signature_base(aud, audLen, exp, sub, subLen, &sigBaseLen); if (!sigBase) { goto error; } size_t sigLen; sig = vapid_sign(key, sigBase, sigBaseLen, &sigLen); if (!sig) { goto error; } // The token comprises the base string, another `.`, and the encoded // signature. First, we grow the base string to hold the `.`, signature, and // null terminator. size_t b64SigLen = ece_base64url_encode(sig, sigLen, ECE_BASE64URL_OMIT_PADDING, NULL, 0); size_t tokenLen = sigBaseLen + 1 + b64SigLen; token = realloc(sigBase, tokenLen + 1); if (!token) { goto error; } sigBase = NULL; // Then, we append the signature, and null-terminate the string. token[sigBaseLen] = '.'; ece_base64url_encode(sig, sigLen, ECE_BASE64URL_OMIT_PADDING, &token[sigBaseLen + 1], b64SigLen); token[tokenLen] = '\0'; goto end; error: free(token); token = NULL; end: free(sigBase); free(sig); return token; } static EC_KEY* vapid_import_private_key(const char* b64PrivKey) { return NULL; } static EC_KEY* vapid_generate_keys() { EC_KEY* key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); if (!key) { return NULL; } if (EC_KEY_generate_key(key) != 1) { EC_KEY_free(key); return NULL; } return key; } static char* vapid_export_private_key(EC_KEY* key) { uint8_t rawPrivKey[ECE_WEBPUSH_PRIVATE_KEY_LENGTH]; if (!EC_KEY_priv2oct(key, rawPrivKey, ECE_WEBPUSH_PRIVATE_KEY_LENGTH)) { return NULL; } size_t b64PrivKeyLen = ece_base64url_encode(rawPrivKey, ECE_WEBPUSH_PRIVATE_KEY_LENGTH, ECE_BASE64URL_OMIT_PADDING, NULL, 0); if (!b64PrivKeyLen) { return NULL; } char* b64PrivKey = malloc(b64PrivKeyLen + 1); if (!b64PrivKey) { return NULL; } ece_base64url_encode(rawPrivKey, ECE_WEBPUSH_PRIVATE_KEY_LENGTH, ECE_BASE64URL_OMIT_PADDING, b64PrivKey, b64PrivKeyLen); b64PrivKey[b64PrivKeyLen] = '\0'; return b64PrivKey; } static char* vapid_export_public_key(EC_KEY* key) { uint8_t rawPubKey[ECE_WEBPUSH_PUBLIC_KEY_LENGTH]; if (!EC_POINT_point2oct(EC_KEY_get0_group(key), EC_KEY_get0_public_key(key), POINT_CONVERSION_UNCOMPRESSED, rawPubKey, ECE_WEBPUSH_PUBLIC_KEY_LENGTH, NULL)) { return NULL; } size_t b64PubKeyLen = ece_base64url_encode(rawPubKey, ECE_WEBPUSH_PUBLIC_KEY_LENGTH, ECE_BASE64URL_OMIT_PADDING, NULL, 0); char* b64PubKey = malloc(b64PubKeyLen + 1); if (!b64PubKey) { return NULL; } ece_base64url_encode(rawPubKey, ECE_WEBPUSH_PUBLIC_KEY_LENGTH, ECE_BASE64URL_OMIT_PADDING, b64PubKey, b64PubKeyLen); b64PubKey[b64PubKeyLen] = '\0'; return b64PubKey; } static void usage(void) { fprintf(stderr, "usage: vapid -a audience -e expiry -s subject [-k key]\n"); } int main(int argc, char** argv) { bool ok = true; char* aud = NULL; uint32_t exp = 0; char* sub = NULL; EC_KEY* key = NULL; char* b64PrivKey = NULL; char* b64PubKey = NULL; char* token = NULL; while (ok) { int opt = getopt(argc, argv, "a:e:s:k:"); if (opt < 0) { break; } switch (opt) { case 'a': aud = optarg; break; case 'e': ok = sscanf(optarg, "%" SCNu32, &exp) > 0; if (!ok) { fprintf(stderr, "vapid: Invalid expiry\n"); } break; case 's': sub = optarg; break; case 'k': key = vapid_import_private_key(optarg); if (!key) { fprintf(stderr, "vapid: Invalid EC private key\n"); ok = false; } break; default: usage(); ok = false; } } if (!ok) { goto end; } if (!aud || !exp || !sub) { usage(); ok = false; goto end; } if (!key) { key = vapid_generate_keys(); if (!key) { fprintf(stderr, "vapid: Error generating EC keys\n"); ok = false; goto end; } } b64PrivKey = vapid_export_private_key(key); if (!b64PrivKey) { fprintf(stderr, "vapid: Error exporting private key\n"); ok = false; goto end; } b64PubKey = vapid_export_public_key(key); if (!b64PubKey) { fprintf(stderr, "vapid: Error exporting public key\n"); ok = false; goto end; } token = vapid_build_token(key, aud, strlen(aud), exp, sub, strlen(sub)); if (!token) { fprintf(stderr, "vapid: Error signing token\n"); ok = false; goto end; } printf("Private key: %s\n", b64PrivKey); printf("Public key: %s\n", b64PubKey); printf("Expiry: %" PRIu32 "\n", exp); printf("Token: %s\n", token); end: EC_KEY_free(key); free(b64PrivKey); free(b64PubKey); free(token); return !ok; }
26.802817
80
0.646435
[ "object" ]
19271bfc1bd23e47dd716fc055ea2681e00eb0e6
12,701
h
C
src/PyVM.h
kumokay/zippypy
63b60d432996111669889d2fe49b91e0b96555cc
[ "Apache-2.0" ]
1
2021-01-30T12:22:57.000Z
2021-01-30T12:22:57.000Z
src/PyVM.h
kumokay/zippypy
63b60d432996111669889d2fe49b91e0b96555cc
[ "Apache-2.0" ]
null
null
null
src/PyVM.h
kumokay/zippypy
63b60d432996111669889d2fe49b91e0b96555cc
[ "Apache-2.0" ]
1
2018-01-18T08:06:55.000Z
2018-01-18T08:06:55.000Z
// Copyright 2015 by Intigua, Inc. // 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. #pragma once #include "defs.h" #include "ObjPool.h" #include "baseObject.h" #include "VarArray.h" #include "log.h" #include "CodeDefinition.h" #include <iostream> #include <functional> #include <algorithm> // for reverse #include <vector> #include <map> #include <sstream> #include <memory> #ifdef USE_BOOST #include <boost/container/flat_map.hpp> #endif #pragma warning (disable: 4355) // 'this' : used in base member initializer list using namespace std; class ModuleObject; typedef PoolPtr<ModuleObject> ModuleObjRef; class Builtins; typedef PoolPtr<Builtins> BuiltinsObjRef; class CodeObject; typedef PoolPtr<CodeObject> CodeObjRef; class ClassObject; typedef PoolPtr<ClassObject> ClassObjRef; typedef map<string, ModuleObjRef> ModulesDict; #ifdef USE_BOOST typedef boost::container::flat_map<string, ObjRef> NameDict; #else typedef map<string, ObjRef> NameDict; #endif typedef map<int64, ObjRef> IntDict; string stdstr(const ObjRef& vref, bool repr=false); void print(const ObjRef& vref, ostream& out, bool repr); int vmVersion(); class PyVM; class Frame; enum EObjSlot { SLOT_RETVAL = 0, SLOT_YIELD = 1 }; typedef std::function<void(EObjSlot s, const ObjRef&)> SetObjCallback; //extern int g_maxStackSize; template<typename T> class Stack { public: void push(const T& ref) { m_stack.push_back(ref); //if (g_maxStackSize < m_stack.size()) // g_maxStackSize = (int)m_stack.size(); } // push an element some distance from the top. pushAt(0,r) is equivalent to push(r) void pushAt(int fromTop, const T& ref) { CHECK((int)m_stack.size() >= fromTop, "pushAt underflow"); //m_stack.insert(m_stack.size() - fromTop, ref); m_stack.insert(m_stack.end() - fromTop, ref); } T pop() { CHECK(m_stack.size() > 0, "stack underflow"); ObjRef r = m_stack.back(); m_stack.pop_back(); return r; } // i - offset from the top. 0=TOS T peek(int i) { CHECK((int)m_stack.size() > i, "peek underflow"); return m_stack[m_stack.size() - 1 - i]; } T top() { return peek(0); } int size() const { return (int)m_stack.size(); } void clear() { m_stack.clear(); } vector<T> data() { // for testers vector<T> r; //m_stack.foreach([&](const T& v) { r.push_back(v); }); auto f = [&](const T& v) { r.push_back(v); }; m_stack.foreach(f); //r = m_stack; return r; } void reserve(int sz) { m_stack.reserve(sz); } private: // on average operation the stack does not go over 6 items VarArray<T, 6> m_stack; //vector<T> m_stack; }; extern map<string, int> g_lookups; template<typename T> T tryLookup(const map<string, T>& d, const string& name) { auto it = d.find(name); if (it == d.end()) return T(); return it->second; } inline ObjRef tryLookup(const NameDict& d, const string& name) { //++g_lookups[name]; auto it = d.find(name); if (it == d.end()) return ObjRef(); return it->second; } template<typename T> T lookup(const map<string, T>& d, const string& name) { auto it = d.find(name); CHECK(it != d.end(), "KeyError: could not find `" << name << "`"); return it->second; } inline ObjRef lookup(const NameDict& d, const string& name) { //++g_lookups[name]; auto it = d.find(name); CHECK(it != d.end(), "KeyError: could not find `" << name << "`"); return it->second; } //struct nullptrType {}; //template<typename T> //struct IsType { enum { nullptrType = false; }; }; //template<> struct IsType<nullptrType> { enum { nullptrType = true }; }; class StreamPrinter { public: StreamPrinter(ostream* os = nullptr) : m_os(os) {} virtual ~StreamPrinter() {} virtual void endL() { if (m_os != nullptr) (*m_os) << std::endl; } public: ostream* m_os; }; class LoggerPrinter : public StreamPrinter { public: LoggerPrinter(LogLevel lvl) : m_lvl(lvl) { m_os = &m_s; } virtual void endL() { log(m_lvl, m_s.str()); m_s.str(string()); // clear the buffer } private: DISALLOW_COPY_AND_ASSIGN(LoggerPrinter); // needed because we're taking m_s address std::ostringstream m_s; LogLevel m_lvl; }; class PyVM { public: PyVM(); ~PyVM(); void setStdout(ostream* s) { m_out.reset(new StreamPrinter(s)); } void addGlobalFunc(const CodeDefinition& code); ObjRef callv(const ObjRef& func, const vector<ObjRef>& posargs); ObjRef callv(const string& funcname, const vector<ObjRef>& posargs); template<typename ...Args> ObjRef call(const ObjRef& func, Args&&... args) { vector<ObjRef> argv({ makeFromT(args)... }); return callv(func, argv); } template<typename ...Args> ObjRef call(const string& funcname, Args&&... args) { vector<ObjRef> argv({ makeFromT(args)... }); return callv(funcname, argv); } ObjRef eval(const CodeObjRef& code, ModuleObjRef module); ModuleObjRef addEmptyModule(const string& name); // ModuleObjRef importModule(const CodeDefinition& moduleDef, const string& name); ModuleObjRef getModule(const string& name); ModuleObjRef importPycStream(istream& is, const string& path, bool hasHeader); ModuleObjRef importPycFile(const string& pycpath); ModuleObjRef importPycBuf(const string& pyctext, bool hasHeader = false); // void addDummyModule(const string& name) { // m_modules[name] = ModuleObjRef(); // } void clear(); ObjRef alloc(Object *o) { return m_alloc.add(o); } template<typename T> PoolPtr<T> alloct(T* t) { Object* o = static_cast<Object*>(t); ObjRef r = m_alloc.add(o); return static_pcast<T>(r); } template<typename T> ObjRef makeFromT(T v); template<typename T> ObjRef makeFromT(const PoolPtr<T>& v) { return ObjRef(v); } ObjRef makeNone(void) { return m_noneObject; } template<typename ObjT, typename InitT> // give the object type to construct ObjRef makeFromT2(const InitT& v); template<typename A1, typename A2> ObjRef makeTuple(const A1& a1, const A2& a2); // memory introspection void memDump(ostream& os); int countObjects() { return m_alloc.size(); } void validateCode(const CodeObjRef& def); // in instruction.cpp ModuleObjRef mainModule() { return m_defaultModule; } template<typename T> // T should be some Object void addBuiltin(const string& name, const PoolPtr<T>& v); void addBuiltin(const ClassObjRef& v); // name taken from the class string instructionPointer(); ObjRef lookupQual(const string& name, ModuleObjRef* mod); ObjPool<Object>& objPool() { return m_alloc; } const ModulesDict& modules() const { return m_modules; } // the import callback returns a pair with the stream to read the pyc from and a bool that says if the stream has a header typedef std::function<pair<unique_ptr<istream>,bool>(const string&)> TImportCallback; void setImportCallback(TImportCallback callback) { m_importCallback = callback; } Frame* currentFrame() { return m_currentFrame; } #if USE_CPYTHON void runInteractive(); #endif private: DISALLOW_COPY_AND_ASSIGN(PyVM); friend class Frame; friend class OpImp; ObjRef callFunction(Frame& from, int posCount, int kwCount); private: ObjPool<Object> m_alloc; // must be first member so it would be destructed last, after all references are down std::unique_ptr<StreamPrinter> m_out; ModuleObjRef m_defaultModule; // module of __main__ BuiltinsObjRef m_builtins; ModulesDict m_modules; // this is sys.modules ObjRef m_noneObject, m_trueObject, m_falseObject; TImportCallback m_importCallback; // used for debugging Frame* m_currentFrame; // managed by Frame object c'tor and d'tor int m_lastFramei; // the m_lasti of the last frame that returned }; template<> inline ObjRef PyVM::makeFromT(ObjRef v) { return v; } int64 hashStr(const string& s); // this class is istantiated on the stack to save the current state of the object pool // when it goes out of scope it calls 'clear()' for all objects created after it's instantiation // This clears out any reference circles which occured in the run of the python code to avoid memory leaks. // NOTICE: this also means that there should not be globally referenced objects created in that scope. class StateClearer { public: StateClearer(PyVM* vm) :m_vm(vm), m_savedHead(vm->objPool().listHead()) { } ~StateClearer() { try { bool tillend = m_vm->objPool().foreach([this](const ObjRef& o)->bool { if (o.get() == m_savedHead.get()) return false; // stop iteration o->clear(); return true; }); if (tillend) LOG_ERROR("!!!!! StateClearer went too far (did not find savedHead)"); } catch(const PyException& e) { LOG_ERROR("!!!!! Caught exception in StateClearer ", e.what()); } } private: ObjRef m_savedHead; PyVM* m_vm; }; struct Block { Block(int _type, int _handler, int _stackSize) :type(_type), handlerAddr(_handler), stackSize(_stackSize) {} int type; int handlerAddr; int stackSize; }; struct CallArgs { // usually there are no more than 4 positional arguments for an internal function typedef VarArray<ObjRef, 4> TPosVector; TPosVector pos; NameDict kw; ObjRef operator[](int i) { return pos[i]; } void posReverse() { std::reverse(pos.begin(), pos.end()); } }; class Frame { public: Frame(PyVM* vm, const ModuleObjRef& module, NameDict *locals) :m_lasti(0), m_vm(vm), m_module(module), m_locals(locals), m_retslot(SLOT_RETVAL) { m_lastFrame = m_vm->m_currentFrame; m_vm->m_currentFrame = this; //m_stack.reserve(6); } ~Frame() { m_vm->m_currentFrame = m_lastFrame; } void push(const ObjRef& ref) { m_stack.push(ref); } ObjRef pop() { return m_stack.pop(); } ObjRef top() { return m_stack.top(); } ObjRef alloc(Object *o) { return m_vm->alloc(o); } void pushBlock(int type, int handler) { m_blocks.push_back(Block(type, handler, m_stack.size())); } Block popBlock() { CHECK(m_blocks.size() > 0, "block stack underflow"); Block r = m_blocks.back(); m_blocks.pop_back(); CHECK(r.stackSize <= m_stack.size(), "Wrong stack size"); while (r.stackSize < m_stack.size()) m_stack.pop(); return r; } void doOpcode(SetObjCallback& setObj); ObjRef lookupGlobal(const string& name); void argsFromStack(Frame& from, int posCount, int kwCount, CallArgs& args); // void localsFromArgs(const vector<ObjRef>& args); void localsFromStack(Frame& from, ObjRef self, int posCount, int kwCount); NameDict& locals() { return *m_locals; } NameDict& globals(); ObjRef run(); void clear(); void setCode(const CodeObjRef& code); const CodeObjRef& code() { return m_code; } public: uint m_lasti; // index in the code object string of the curret instruction NameDict *m_locals; // points to a dict on the stack PyVM* m_vm; ModuleObjRef m_module; // for globals, needs an objet to reference, m_globals is not an object vector<Block> m_blocks; // every for,try,except,finally,with is a block Frame* m_lastFrame; // previous frame on the stack Stack<ObjRef> m_stack; // value stack EObjSlot m_retslot; // the slot filled with the return value after a function call returns // "usually" there are no more than 5 locals in a function typedef VarArray<ObjRef, 5> TFastLocalsList; private: CodeObjRef m_code; TFastLocalsList m_fastlocals; };
28.099558
126
0.64491
[ "object", "vector" ]
192d4adbe794325aa4d181d3ff6856d39347b0fb
4,751
h
C
aws-cpp-sdk-glue/include/aws/glue/model/BatchGetBlueprintsRequest.h
perfectrecall/aws-sdk-cpp
fb8cbebf2fd62720b65aeff841ad2950e73d8ebd
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-glue/include/aws/glue/model/BatchGetBlueprintsRequest.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-glue/include/aws/glue/model/BatchGetBlueprintsRequest.h
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-11-09T12:02:58.000Z
2021-11-09T12:02:58.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/glue/Glue_EXPORTS.h> #include <aws/glue/GlueRequest.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Glue { namespace Model { /** */ class AWS_GLUE_API BatchGetBlueprintsRequest : public GlueRequest { public: BatchGetBlueprintsRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "BatchGetBlueprints"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>A list of blueprint names.</p> */ inline const Aws::Vector<Aws::String>& GetNames() const{ return m_names; } /** * <p>A list of blueprint names.</p> */ inline bool NamesHasBeenSet() const { return m_namesHasBeenSet; } /** * <p>A list of blueprint names.</p> */ inline void SetNames(const Aws::Vector<Aws::String>& value) { m_namesHasBeenSet = true; m_names = value; } /** * <p>A list of blueprint names.</p> */ inline void SetNames(Aws::Vector<Aws::String>&& value) { m_namesHasBeenSet = true; m_names = std::move(value); } /** * <p>A list of blueprint names.</p> */ inline BatchGetBlueprintsRequest& WithNames(const Aws::Vector<Aws::String>& value) { SetNames(value); return *this;} /** * <p>A list of blueprint names.</p> */ inline BatchGetBlueprintsRequest& WithNames(Aws::Vector<Aws::String>&& value) { SetNames(std::move(value)); return *this;} /** * <p>A list of blueprint names.</p> */ inline BatchGetBlueprintsRequest& AddNames(const Aws::String& value) { m_namesHasBeenSet = true; m_names.push_back(value); return *this; } /** * <p>A list of blueprint names.</p> */ inline BatchGetBlueprintsRequest& AddNames(Aws::String&& value) { m_namesHasBeenSet = true; m_names.push_back(std::move(value)); return *this; } /** * <p>A list of blueprint names.</p> */ inline BatchGetBlueprintsRequest& AddNames(const char* value) { m_namesHasBeenSet = true; m_names.push_back(value); return *this; } /** * <p>Specifies whether or not to include the blueprint in the response.</p> */ inline bool GetIncludeBlueprint() const{ return m_includeBlueprint; } /** * <p>Specifies whether or not to include the blueprint in the response.</p> */ inline bool IncludeBlueprintHasBeenSet() const { return m_includeBlueprintHasBeenSet; } /** * <p>Specifies whether or not to include the blueprint in the response.</p> */ inline void SetIncludeBlueprint(bool value) { m_includeBlueprintHasBeenSet = true; m_includeBlueprint = value; } /** * <p>Specifies whether or not to include the blueprint in the response.</p> */ inline BatchGetBlueprintsRequest& WithIncludeBlueprint(bool value) { SetIncludeBlueprint(value); return *this;} /** * <p>Specifies whether or not to include the parameters, as a JSON string, for the * blueprint in the response.</p> */ inline bool GetIncludeParameterSpec() const{ return m_includeParameterSpec; } /** * <p>Specifies whether or not to include the parameters, as a JSON string, for the * blueprint in the response.</p> */ inline bool IncludeParameterSpecHasBeenSet() const { return m_includeParameterSpecHasBeenSet; } /** * <p>Specifies whether or not to include the parameters, as a JSON string, for the * blueprint in the response.</p> */ inline void SetIncludeParameterSpec(bool value) { m_includeParameterSpecHasBeenSet = true; m_includeParameterSpec = value; } /** * <p>Specifies whether or not to include the parameters, as a JSON string, for the * blueprint in the response.</p> */ inline BatchGetBlueprintsRequest& WithIncludeParameterSpec(bool value) { SetIncludeParameterSpec(value); return *this;} private: Aws::Vector<Aws::String> m_names; bool m_namesHasBeenSet; bool m_includeBlueprint; bool m_includeBlueprintHasBeenSet; bool m_includeParameterSpec; bool m_includeParameterSpecHasBeenSet; }; } // namespace Model } // namespace Glue } // namespace Aws
32.993056
148
0.683225
[ "vector", "model" ]
aaac889e6ed2a92e52132a6827b897d0e0cf83fb
3,853
h
C
lldb/include/lldb/Expression/Expression.h
rarutyun/llvm
76fa6b3bcade074bdedef740001c4528e1aa08a8
[ "Apache-2.0" ]
305
2019-09-14T17:16:05.000Z
2022-03-31T15:05:20.000Z
lldb/include/lldb/Expression/Expression.h
rarutyun/llvm
76fa6b3bcade074bdedef740001c4528e1aa08a8
[ "Apache-2.0" ]
410
2019-06-06T20:52:32.000Z
2022-01-18T14:21:48.000Z
lldb/include/lldb/Expression/Expression.h
rarutyun/llvm
76fa6b3bcade074bdedef740001c4528e1aa08a8
[ "Apache-2.0" ]
50
2019-05-10T21:12:24.000Z
2022-01-21T06:39:47.000Z
//===-- Expression.h --------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLDB_EXPRESSION_EXPRESSION_H #define LLDB_EXPRESSION_EXPRESSION_H #include <map> #include <string> #include <vector> #include "lldb/Expression/ExpressionTypeSystemHelper.h" #include "lldb/lldb-forward.h" #include "lldb/lldb-private.h" namespace lldb_private { class RecordingMemoryManager; /// \class Expression Expression.h "lldb/Expression/Expression.h" Encapsulates /// a single expression for use in lldb /// /// LLDB uses expressions for various purposes, notably to call functions /// and as a backend for the expr command. Expression encapsulates the /// objects needed to parse and interpret or JIT an expression. It uses the /// expression parser appropriate to the language of the expression to produce /// LLVM IR from the expression. class Expression { public: enum ResultType { eResultTypeAny, eResultTypeId }; Expression(Target &target); Expression(ExecutionContextScope &exe_scope); /// Destructor virtual ~Expression() {} /// Return the string that the parser should parse. Must be a full /// translation unit. virtual const char *Text() = 0; /// Return the function name that should be used for executing the /// expression. Text() should contain the definition of this function. virtual const char *FunctionName() = 0; /// Return the language that should be used when parsing. To use the /// default, return eLanguageTypeUnknown. virtual lldb::LanguageType Language() const { return lldb::eLanguageTypeUnknown; } /// Return the Materializer that the parser should use when registering /// external values. virtual Materializer *GetMaterializer() { return nullptr; } /// Return the desired result type of the function, or eResultTypeAny if /// indifferent. virtual ResultType DesiredResultType() { return eResultTypeAny; } /// Flags /// Return true if validation code should be inserted into the expression. virtual bool NeedsValidation() = 0; /// Return true if external variables in the expression should be resolved. virtual bool NeedsVariableResolution() = 0; virtual EvaluateExpressionOptions *GetOptions() { return nullptr; }; /// Return the address of the function's JIT-compiled code, or /// LLDB_INVALID_ADDRESS if the function is not JIT compiled lldb::addr_t StartAddress() { return m_jit_start_addr; } /// Called to notify the expression that it is about to be executed. virtual void WillStartExecuting() {} /// Called to notify the expression that its execution has finished. virtual void DidFinishExecuting() {} virtual ExpressionTypeSystemHelper *GetTypeSystemHelper() { return nullptr; } // LLVM RTTI support virtual bool isA(const void *ClassID) const = 0; protected: lldb::TargetWP m_target_wp; /// Expression's always have to have a target... lldb::ProcessWP m_jit_process_wp; /// An expression might have a process, but /// it doesn't need to (e.g. calculator /// mode.) lldb::addr_t m_jit_start_addr; ///< The address of the JITted function within ///the JIT allocation. LLDB_INVALID_ADDRESS if ///invalid. lldb::addr_t m_jit_end_addr; ///< The address of the JITted function within ///the JIT allocation. LLDB_INVALID_ADDRESS if ///invalid. }; } // namespace lldb_private #endif // LLDB_EXPRESSION_EXPRESSION_H
36.009346
80
0.677135
[ "vector" ]
aaacc0941a121cd8d5c8179ac9bb05fce28c342c
2,101
h
C
venv/lib/python3.7/site-packages/torch/include/ATen/native/TensorTransformations.h
GOOGLE-M/SGC
78ad8d02b80808302e38559e2d0f430f66a809bd
[ "MIT" ]
6
2021-09-05T06:00:59.000Z
2022-01-07T07:05:18.000Z
venv/lib/python3.7/site-packages/torch/include/ATen/native/TensorTransformations.h
GOOGLE-M/SGC
78ad8d02b80808302e38559e2d0f430f66a809bd
[ "MIT" ]
2
2022-01-10T03:56:45.000Z
2022-02-01T03:39:54.000Z
venv/lib/python3.7/site-packages/torch/include/ATen/native/TensorTransformations.h
GOOGLE-M/SGC
78ad8d02b80808302e38559e2d0f430f66a809bd
[ "MIT" ]
1
2021-09-05T06:01:04.000Z
2021-09-05T06:01:04.000Z
#include <ATen/ATen.h> #include <ATen/WrapDimUtils.h> #include <c10/util/Exception.h> #include <algorithm> #include <vector> namespace at { namespace native { static inline void flip_check_errors(int64_t total_dims, int64_t flip_dims_size, IntArrayRef dims) { if (flip_dims_size==0) { return; } // check if number of axis in dim is valid if (flip_dims_size < 0 || flip_dims_size > total_dims) { TORCH_CHECK_INDEX(false, "flip dims size out of range, got flip dims size=", flip_dims_size); } auto flip_dims_v = dims.vec(); // check if dims axis within range auto min_max_d = std::minmax_element(flip_dims_v.begin(), flip_dims_v.end()); if (*min_max_d.first >= total_dims || *min_max_d.first < -total_dims) { TORCH_CHECK_INDEX(false, "The min flip dims out of range, got min flip dims=", *min_max_d.first); } if (*min_max_d.second >= total_dims || *min_max_d.second < -total_dims) { TORCH_CHECK_INDEX(false, "The max flip dims out of range, got max flip dims=", *min_max_d.second); } // check duplicates in dims wrap_all_dims(flip_dims_v, total_dims); flip_dims_v.erase(std::unique(flip_dims_v.begin(), flip_dims_v.end()), flip_dims_v.end()); TORCH_CHECK((int64_t)flip_dims_v.size() == flip_dims_size, "dims has duplicates, original flip dims size=", flip_dims_size, ", but unique flip dims size=", flip_dims_v.size()); } static inline Tensor roll_common(const Tensor& self, IntArrayRef shifts, IntArrayRef dims) { TORCH_CHECK(shifts.size() > 0, "`shifts` required"); if (dims.size() == 0 && shifts.size() == 1) { auto flattened = self.contiguous().view(self.numel()); return roll(flattened, shifts[0], 0).view(self.sizes()); } TORCH_CHECK( shifts.size() == dims.size(), "shifts and dimensions must align. shifts: ", shifts.size(), ", dims:", dims.size() ); AT_ASSERT(dims.size() > 1); auto tail_shifts = shifts.slice(1); auto tail_dims = dims.slice(1); auto first_dim_rolled = roll(self, shifts[0], dims[0]); return at::roll(first_dim_rolled, tail_shifts, tail_dims); } }} // namespace at::native
35.016667
102
0.695859
[ "vector" ]
aaaecacff25f6724dced6996bdcb84fc633dd1e9
4,714
h
C
server/gis_pointgeom.h
Amine-El-Ghaoual/griddb
fa1d5698711b0243efa4f216c22210e2bb77f081
[ "Apache-2.0" ]
646
2016-02-24T13:44:26.000Z
2022-03-30T19:24:55.000Z
server/gis_pointgeom.h
ouellani/griddb_nosql
2ccb037d7ea2d79d3b9ee5830cdcb209f8d6d612
[ "Apache-2.0" ]
57
2020-06-20T01:17:56.000Z
2022-03-12T02:22:48.000Z
server/gis_pointgeom.h
ouellani/griddb_nosql
2ccb037d7ea2d79d3b9ee5830cdcb209f8d6d612
[ "Apache-2.0" ]
1,697
2020-06-17T08:43:28.000Z
2022-03-31T21:25:58.000Z
/* Copyright (c) 2017 TOSHIBA Digital Solutions Corporation This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /*! @file @brief Point-collection-based class for 3D-geometry data */ #ifndef GIS_POINTGEOM_H_ #define GIS_POINTGEOM_H_ #include "util/container.h" #include <sstream> #include "expression.h" #include "gis_geometry.h" #include "gis_point.h" /*! * @brief Base class for point container classes * */ class PointGeom : public Geometry { public: bool isSimple() const { return isSimple_; } virtual GeometryType getType() const = 0; /*! * @brief Get the in-memory size of geometry * * @return size */ size_t getRawSize() const { return sizeof(*this); } const TrRectTag &getBoundingRect() const { return boundingRect_; } Point &getPoint(int n) const { if (static_cast<size_t>(n) >= p_.size() || n < 0) { GS_THROW_USER_ERROR(GS_ERROR_TQ_INTERNAL_GIS_GET_VALUE_FAILED, "Internal logic error: cannot obtain point"); } return *p_[n]; } const QP_XArray<Point *> &getPoints() const { return p_; } int numPoints() const { return static_cast<int>(p_.size()); } bool crossGeometry() const { return false; } virtual PointGeom *assign(TransactionContext &txn, ObjectManager &objectManager, ContainerRowWrapper *amap, FunctionMap *fmap, EvalMode mode = EVAL_MODE_NORMAL) { if (isAssigned_ || isEmpty_) { return static_cast<PointGeom *>(dup(txn, objectManager)); } PointGeom *x = static_cast<PointGeom *>(this->dup(txn, objectManager)); for (QP_XArray<Point *>::const_iterator it = x->p_.begin(); it != x->p_.end(); ++it) { QP_DELETE(*it); } x->p_.clear(); for (QP_XArray<Point *>::const_iterator it = p_.begin(); it != p_.end(); ++it) { Point *p = (*it)->assign(txn, objectManager, amap, fmap, mode); x->p_.push_back(p); } if (!x->p_.empty() && x->isAssigned_) { x->calcBoundingRectAndSimplicity(); } return x; } virtual void stringify( TransactionContext &txn, util::NormalOStringStream &os) const { if (isEmpty_) { os << "EMPTY"; } else { for (size_t i = 0; i < p_.size(); i++) { p_[i]->stringify(txn, os); if (i < p_.size() - 1) os << ','; } } if (srId_ != -1) { os << ";" << srId_; } } virtual ~PointGeom() { for (QP_XArray<Point *>::const_iterator it = p_.begin(); it != p_.end(); ++it) { QP_DELETE(*it); } } protected: explicit PointGeom(TransactionContext &txn) : Geometry(txn), p_(txn.getDefaultAllocator()) { isEmpty_ = true; isSimple_ = true; isClosed_ = false; p_.clear(); } PointGeom(srid_t id, const QP_XArray<Point *> &parray, TransactionContext &txn, ObjectManager &objectManager) : Geometry(txn), p_(txn.getDefaultAllocator()) { isSimple_ = true; isEmpty_ = false; srId_ = id; isAssigned_ = true; isClosed_ = false; dimension_ = -1; for (QP_XArray<Point *>::const_iterator it = parray.begin(); it != parray.end(); ++it) { p_.push_back((*it)->dup(txn, objectManager)); isAssigned_ &= (*it)->isAssigned(); int d = (*it)->getDimension(); if (dimension_ != -1 && d != dimension_) { GS_THROW_USER_ERROR(GS_ERROR_TQ_CRITICAL_LOGIC_ERROR, "Internal logic error: " "Different dimensions in multipoint geometry."); } dimension_ = d; } } virtual size_t getSerializedSize() const { size_t s = sizeof(uint16_t); for (uint32_t i = 0; i < p_.size(); i++) { s += p_[i]->getSerializedSize(); } return s; } void serializeObject(util::XArray<uint8_t> &out, uint64_t &offset) { if (isAssigned_) { if (dimension_ != 0) { uint16_t len = static_cast<uint16_t>(p_.size()); out.push_back( reinterpret_cast<uint8_t *>(&len), sizeof(uint16_t)); offset += sizeof(uint16_t); for (uint32_t i = 0; i < len; i++) { p_[i]->serializeObject(out, offset); } } } else { GS_THROW_USER_ERROR(GS_ERROR_TQ_INTERNAL_GIS_CANNOT_SERIALIZE, "Internal logic error: Cannot serialize geometry object"); } } virtual void calcBoundingRectAndSimplicity() = 0; QP_XArray<Point *> p_; bool isSimple_; bool isClosed_; }; #endif /* GIS_POINTGEOM_HPP */
25.344086
74
0.667374
[ "geometry", "object", "3d" ]
aab3a97f85074b7530bf41fb289b9972f7c7cbe8
5,015
c
C
web/JsRequset.c
Sc-Softs/Multi-Threading-JS-Engine
3f58ae7c2098b2084a71281d9c911510ae6e0c48
[ "MIT" ]
null
null
null
web/JsRequset.c
Sc-Softs/Multi-Threading-JS-Engine
3f58ae7c2098b2084a71281d9c911510ae6e0c48
[ "MIT" ]
null
null
null
web/JsRequset.c
Sc-Softs/Multi-Threading-JS-Engine
3f58ae7c2098b2084a71281d9c911510ae6e0c48
[ "MIT" ]
null
null
null
#include"JsObject.h" #include"JsContext.h" #include"JsEngine.h" #include"JsVm.h" #include"JsList.h" #include"JsValue.h" #include"JsSys.h" #include"JsDebug.h" #include"JsException.h" #include"JsAst.h" #include"JsParser.h" #include"JsEval.h" #include"JsWeb.h" #include<stdlib.h> #include<stdio.h> #include<string.h> #include<setjmp.h> #include<unistd.h> #include <sys/dir.h> #include <sys/stat.h> #include <microhttpd.h> #define JS_REQUEST_FLOOR 1 struct JsRequest{ struct MHD_Connection *connection; const char *url; const char *method; }; static void JsInitRequest(struct JsObject* req); static void getParameter(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res); static void getServerName(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res); static void getMethod(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res); static void getServerPort(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res); static void getRequestURI(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res); /* getParameter(): String 可以让您指定请求参数名称,以取得对应的设定值. getServerName():String 请求的服务器. getMethod(): "POST" | "GET" | "DELETE" ... 请求方法. getServerPort(): Number 请求端口号. getRequestURI():URI路径.-> '/main/list.do' 除去http://localhost:8080/部分的地址 */ struct JsObject* JsCreateRequest(struct MHD_Connection *connection, const char *url, const char *method){ struct JsObject* b = JsAllocObject(JS_REQUEST_FLOOR); JsCreateStandardObject(b); b->Class = "Request"; //初始化自己的Sb struct JsRequest* p = (struct JsRequest*)JsGcMalloc(sizeof(struct JsRequest),NULL,NULL); p->connection = connection; p->url = url; p->method = method; b->sb[JS_REQUEST_FLOOR] = p; //初始化Object方法函数 JsInitRequest(b); return b; } static void JsInitRequest(struct JsObject* req){ struct JsValue* p= NULL; p= JsCreateValue(); p->type = JS_OBJECT; p->u.object = JsCreateStandardFunctionObject(NULL,NULL,FALSE); p->u.object->Call = &getParameter; (*req->Put)(req,"getParameter",p,JS_OBJECT_ATTR_STRICT); p= JsCreateValue(); p->type = JS_OBJECT; p->u.object = JsCreateStandardFunctionObject(NULL,NULL,FALSE); p->u.object->Call = &getServerName; (*req->Put)(req,"getServerName",p,JS_OBJECT_ATTR_STRICT); p= JsCreateValue(); p->type = JS_OBJECT; p->u.object = JsCreateStandardFunctionObject(NULL,NULL,FALSE); p->u.object->Call = &getMethod; (*req->Put)(req,"getMethod",p,JS_OBJECT_ATTR_STRICT); p= JsCreateValue(); p->type = JS_OBJECT; p->u.object = JsCreateStandardFunctionObject(NULL,NULL,FALSE); p->u.object->Call = &getServerPort; (*req->Put)(req,"getServerPort",p,JS_OBJECT_ATTR_STRICT); p= JsCreateValue(); p->type = JS_OBJECT; p->u.object = JsCreateStandardFunctionObject(NULL,NULL,FALSE); p->u.object->Call = &getRequestURI; (*req->Put)(req,"getRequestURI",p,JS_OBJECT_ATTR_STRICT); } static void getParameter(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res){ if(strcmp(thisobj->Class,"Request")!=0) JsThrowString("The Object Is't Requset"); if(argc >= 1 && argv[0]->type == JS_STRING && argv[0]->u.string != NULL){ struct JsRequest* req = (struct JsRequest*)thisobj->sb[JS_REQUEST_FLOOR]; const char* v0 = MHD_lookup_connection_value (req->connection, MHD_POSTDATA_KIND|MHD_GET_ARGUMENT_KIND, argv[0]->u.string); if(v0 == NULL){ res->type = JS_NULL; }else{ char* v1 = (char*)JsGcMalloc(strlen(v0)+4,NULL,NULL); strcpy(v1,v0); res->type = JS_STRING; res->u.string = v1; } }else{ JsThrowString("getParameter Args Is Error"); } } static void getServerName(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res){ res->type = JS_NULL; } static void getMethod(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res){ if(strcmp(thisobj->Class,"Request")!=0) JsThrowString("The Object Is't Requset"); struct JsRequest* req = (struct JsRequest*)thisobj->sb[JS_REQUEST_FLOOR]; char* m = (char*)JsGcMalloc(strlen(req->method) + 4,NULL,NULL); strcpy(m,req->method); res->type = JS_STRING; res->u.string = m; } static void getServerPort(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res){ res->type = JS_NULL; } static void getRequestURI(struct JsObject *self, struct JsObject *thisobj, int argc, struct JsValue **argv, struct JsValue *res){ if(strcmp(thisobj->Class,"Request")!=0) JsThrowString("The Object Is't Requset"); struct JsRequest* req = (struct JsRequest*)thisobj->sb[JS_REQUEST_FLOOR]; char* m = (char*)JsGcMalloc(strlen(req->url) + 4,NULL,NULL); strcpy(m,req->url); res->type = JS_STRING; res->u.string = m; }
33.657718
129
0.71346
[ "object" ]
aab7ceeeef175b520e1c50b9bbbbbc97c5531b4c
1,082
h
C
MultiSource/Benchmarks/Prolangs-C/loader/pass2.h
Nuullll/llvm-test-suite
afbdd0a9ee7770e074708b68b34a6a5312bb0b36
[ "Apache-2.0" ]
70
2019-01-15T03:03:55.000Z
2022-03-28T02:16:13.000Z
MultiSource/Benchmarks/Prolangs-C/loader/pass2.h
Nuullll/llvm-test-suite
afbdd0a9ee7770e074708b68b34a6a5312bb0b36
[ "Apache-2.0" ]
519
2020-09-15T07:40:51.000Z
2022-03-31T20:51:15.000Z
MultiSource/Benchmarks/Prolangs-C/loader/pass2.h
Nuullll/llvm-test-suite
afbdd0a9ee7770e074708b68b34a6a5312bb0b36
[ "Apache-2.0" ]
117
2020-06-24T13:11:04.000Z
2022-03-23T15:44:23.000Z
/* %%%%%%%%%%%%%%%%%%%% (c) William Landi 1991 %%%%%%%%%%%%%%%%%%%%%%%%%%%% */ /* Permission to use this code is granted as long as the copyright */ /* notice remains in place. */ /* ============================== pass2.h ================================== */ /* --------------------------------- pass2 --------------------------------- */ /* 5 parameters: */ /* 1) MEM_SPACE MEMORY; The SIC/XE's main memory */ /* 2) SYMBOL_TABLE *SYM_TAB; loaders [global] symbol table */ /* 3) int *LOCATION; Location to load next csect */ /* 4) int *ERROR; any errors in the object code? */ /* 5) FILE *INPUT; stream with the object code */ /* Process Text, Modify, and Reference records of one object file. Also */ /* does minimal recomputation of the number of bytes needs to be shifted to */ /* accomidate the relocation. */ extern void PASS2();
63.647059
79
0.410351
[ "object" ]
aaba494dd292f29f0bc50b8249f4b418354416f3
513
c
C
src/vector/foreach.c
brendan-rius/babc
30c5ae08d4fafdf6f67e00bae5f28e54468898dc
[ "MIT" ]
3
2017-01-23T15:44:41.000Z
2019-01-07T18:42:20.000Z
src/vector/foreach.c
brendan-rius/babc
30c5ae08d4fafdf6f67e00bae5f28e54468898dc
[ "MIT" ]
5
2016-06-20T07:23:55.000Z
2016-06-20T07:25:55.000Z
src/vector/foreach.c
brendan-rius/babc
30c5ae08d4fafdf6f67e00bae5f28e54468898dc
[ "MIT" ]
2
2017-10-06T16:58:00.000Z
2020-07-16T15:37:24.000Z
/* ** foreach.c for libmy in /home/person_l ** ** Made by Louis Person ** Login <person_l@epitech.net> ** ** Started on Tue Apr 28 14:38:58 2015 Louis Person ** Last update Tue Apr 28 14:41:32 2015 Louis Person */ #include <sys/types.h> #include <assert.h> #include <stdlib.h> #include "vector.h" int vec_foreach(struct s_vec *vec, t_consumer_fct f) { size_t i; assert(vec != NULL); assert(f != NULL); i = 0; while (i < vec->size) { f(vec->_data[i]); i++; } return (0); }
17.1
53
0.608187
[ "vector" ]
aabe070b7e1457c922e12c66dd25197fe3940a50
3,867
h
C
src/TCPServer.h
IgVelasco/Marvel_Vs_Capcom
a714453d1cba9596c1fdc99383a0228e62334cf7
[ "MIT" ]
null
null
null
src/TCPServer.h
IgVelasco/Marvel_Vs_Capcom
a714453d1cba9596c1fdc99383a0228e62334cf7
[ "MIT" ]
null
null
null
src/TCPServer.h
IgVelasco/Marvel_Vs_Capcom
a714453d1cba9596c1fdc99383a0228e62334cf7
[ "MIT" ]
1
2020-05-06T23:30:36.000Z
2020-05-06T23:30:36.000Z
// // Created by IgVelasco on 5/4/19. // #ifndef TCP_SERVER_H #define TCP_SERVER_H #include <iostream> #include <vector> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <string.h> #include <arpa/inet.h> #include <pthread.h> #include "Socket.h" #include "tools/logger/Logger.h" #include "data_structs.h" #include "Team.h" #include "tools/json/ConfigFileParser/ConfigFileParser.h" #include "Queue/Queue.h" #include "ServerCursor.h" #include "EventHandler.h" #include <mutex> #include <thread> #include "Menu/Menu.h" using namespace std; #define MAXPACKETSIZE 4096 #define MAXPLAYERS 4 #define TWO_PLAYERS 2 #define THREE_PLAYERS 3 #define FOUR_PLAYERS 4 //No tocar esto. "declaration forward" class Menu; class TCPServer { private: double posPlayers[2]; std::thread receiveFromClientThreads[MAXPLAYERS]; std::thread sendToClientThreads[MAXPLAYERS]; Team* team[2]; int port; Socket* clientsSockets[MAXPLAYERS]; Logger* logger; game_instance_t server_state; Menu* menu; json config; ServerCursor* serverCursors[MAXPLAYERS]; bool activeClients[MAXPLAYERS]; bool endgame; //MUTEXS std::mutex m; std::mutex numberOfConnections_mtx; std::mutex connection_mtx[MAXPLAYERS]; std::mutex incoming_msg_mtx; std::mutex updaters_queue_mtx[MAXPLAYERS]; std::mutex server_state_mtx; std::mutex teams_mtx; std::mutex endgame_mtx; public: Queue<incoming_msg_t*>* incoming_msges_queue; //cola de los mensajes entrantes del cliente Queue<character_updater_t*>* client_updater_queue[MAXPLAYERS]; //colas de mensajes de escritura para cada cliente Queue<client_menu_t*>* incoming_menu_actions_queue; ip_status_t iplist[4]; int numberOfConnections; Socket* serverSocket; Socket* newSockFd; int n; char msg[ MAXPACKETSIZE ]; TCPServer(); bool setup(int port, Logger* logger, int numberOfPlayers); void receive(); void detach(); void clean(); void initServer(); void reportClientConnected(const struct sockaddr_in* clientAddress, socklen_t clientAddress_len, Logger* logger); int getNumberOfConections(); void runServer(); void configJson(json config); void receiveFromClient(int clientSocket); void sendToClient(int clientSocket); Socket *getClientSocket(int i); bool invalidIntroAction(actions_t action); int numberOfPlayers; void updateModel(); void disconnectionsManager(incoming_msg_t *incoming_msg); bool clientIsActive(int clientSocket); void manageDisconnection(int clientSocket); void getTeams(int *teamToUpdate, int *enemyTeam, int client); void reconnections(); void sendCharacterBuildersToSocket(int socketNumber); int getTeamNumber(int client); bool isIpListActive(int clientSocket); void treatDisconnectionsAfterSelection(); void endgameForDisconnections(); bool getEndgame(); void setEndgame(bool condition); void disconnectSocket(int clientSocket, Socket *socket); bool isActionInteractive(actions_t actions, int teamToUpdate); void putUpdatersInEachQueue(character_updater_t *update_msg, int clientNumber); bool isActionPunch(actions_t actions); bool isActionKick(actions_t action); bool collition(int teamToUpdate, int enemyTeam, actions_t action); bool isColliding(int giver, int receiver); bool isAlreadyInteracting(int team); bool isProjectileActive(int teamToCheck); void roundRun(int whoWon, EventHandler *handler, int roundNum); bool ignoreMessages = false; int getCurrentWinner(); bool anyTeamLost(); void resetCharactersLife(); void endgameByWinningTeam(Team **winningTeam, int teamno); }; #endif
21.483333
117
0.727696
[ "vector" ]
aac135b08a49b356270c28bada0d05ea9427f11e
5,903
c
C
lib/xdr_stdio.c
myousefi2016/libtirpc
d5aff1aedd2140bb135bd5eb5f08fb112187d7f3
[ "MIT" ]
1
2019-01-10T04:18:30.000Z
2019-01-10T04:18:30.000Z
lib/xdr_stdio.c
myousefi2016/libtirpc
d5aff1aedd2140bb135bd5eb5f08fb112187d7f3
[ "MIT" ]
null
null
null
lib/xdr_stdio.c
myousefi2016/libtirpc
d5aff1aedd2140bb135bd5eb5f08fb112187d7f3
[ "MIT" ]
1
2019-01-10T04:18:33.000Z
2019-01-10T04:18:33.000Z
/* * Copyright (c) 2009, Sun Microsystems, Inc. * 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 Sun Microsystems, Inc. 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. */ /* * xdr_stdio.c, XDR implementation on standard i/o file. * * Copyright (C) 1984, Sun Microsystems, Inc. * * This set of routines implements a XDR on a stdio stream. * XDR_ENCODE serializes onto the stream, XDR_DECODE de-serializes * from the stream. */ #include <stdio.h> #include <rpc/types.h> #include <rpc/xdr.h> #include "xdr_private.h" static void xdrstdio_destroy (XDR *); static bool_t xdrstdio_getlong (XDR *, long *); static bool_t xdrstdio_putlong (XDR *, const long *); static bool_t xdrstdio_getbytes (XDR *, char *, u_int); static bool_t xdrstdio_putbytes (XDR *, const char *, u_int); static u_int xdrstdio_getpos (XDR *); static bool_t xdrstdio_setpos (XDR *, u_int); static int32_t *xdrstdio_inline (XDR *, u_int); static bool_t xdrstdio_getint32 (XDR*, int32_t *); static bool_t xdrstdio_putint32 (XDR*, const int32_t *); /* * Ops vector for stdio type XDR */ static const struct xdr_ops xdrstdio_ops = { xdrstdio_getlong, /* deseraialize a long int */ xdrstdio_putlong, /* seraialize a long int */ xdrstdio_getbytes, /* deserialize counted bytes */ xdrstdio_putbytes, /* serialize counted bytes */ xdrstdio_getpos, /* get offset in the stream */ xdrstdio_setpos, /* set offset in the stream */ xdrstdio_inline, /* prime stream for inline macros */ xdrstdio_destroy, /* destroy stream */ xdrstdio_getint32, /* deseraialize an int */ xdrstdio_putint32 /* seraialize an long int */ }; /* * Initialize a stdio xdr stream. * Sets the xdr stream handle xdrs for use on the stream file. * Operation flag is set to op. */ void xdrstdio_create (XDR * xdrs, FILE * file, enum xdr_op op) { xdrs->x_op = op; xdrs->x_ops = (struct xdr_ops *) &xdrstdio_ops; xdrs->x_private = (void *) file; xdrs->x_handy = 0; xdrs->x_base = 0; } /* * Destroy a stdio xdr stream. * Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create. */ static void xdrstdio_destroy (XDR * xdrs) { (void) fflush ((FILE *) xdrs->x_private); /* XXX: should we close the file ?? */ } static bool_t xdrstdio_getlong (XDR * xdrs, long *lp) { u_int32_t temp; if (fread (&temp, sizeof (int32_t), 1, (FILE *) xdrs->x_private) != 1) return FALSE; *lp = (long) (int32_t) ntohl (temp); return TRUE; } static bool_t xdrstdio_putlong (XDR * xdrs, const long *lp) { u_int32_t temp = htonl ((u_int32_t) * lp); if (fwrite (&temp, sizeof (int32_t), 1, (FILE *) xdrs->x_private) != 1) return FALSE; return TRUE; } static bool_t xdrstdio_getbytes (XDR * xdrs, char *addr, u_int len) { if ((len != 0) && (fread (addr, (size_t) len, 1, (FILE *) xdrs->x_private) != 1)) return FALSE; return TRUE; } static bool_t xdrstdio_putbytes (XDR * xdrs, const char *addr, u_int len) { if ((len != 0) && (fwrite (addr, (size_t) len, 1, (FILE *) xdrs->x_private) != 1)) return FALSE; return TRUE; } static u_int xdrstdio_getpos (XDR * xdrs) { return ((u_int) ftell ((FILE *) xdrs->x_private)); } static bool_t xdrstdio_setpos (XDR * xdrs, u_int pos) { return ((fseek ((FILE *) xdrs->x_private, (long) pos, 0) < 0) ? FALSE : TRUE); } #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable:4100) #endif /* ARGSUSED */ static int32_t * xdrstdio_inline (XDR * xdrs, u_int len) { /* * Must do some work to implement this: must insure * enough data in the underlying stdio buffer, * that the buffer is aligned so that we can indirect through a * long *, and stuff this pointer in xdrs->x_buf. Doing * a fread or fwrite to a scratch buffer would defeat * most of the gains to be had here and require storage * management on this buffer, so we don't do this. */ return NULL; } #ifdef _MSC_VER # pragma warning(pop) #endif static bool_t xdrstdio_getint32 (XDR *xdrs, int32_t *ip) { int32_t temp; if (fread (&temp, sizeof (int32_t), 1, (FILE *) xdrs->x_private) != 1) return FALSE; *ip = ntohl (temp); return TRUE; } static bool_t xdrstdio_putint32 (XDR *xdrs, const int32_t *ip) { int32_t temp = htonl (*ip); if (fwrite (&temp, sizeof (int32_t), 1, (FILE *) xdrs->x_private) != 1) return FALSE; return TRUE; }
30.271795
78
0.681857
[ "vector" ]
aac3e5c6580ebf69ba08dd731dca0bc74d115945
1,187
h
C
Hiya-Why-You-Use-Reinforcement-Learning-To-Play-Tetris-You-Dont-Know-How-To-Play-It-Yourself-Uncle-Roger-So-Sad-Now/include/client.h
lawrence910426/ProgrammingII_FinalProject
493183dc2a674310e65bffe3a5e00395e8bebb4b
[ "MIT" ]
null
null
null
Hiya-Why-You-Use-Reinforcement-Learning-To-Play-Tetris-You-Dont-Know-How-To-Play-It-Yourself-Uncle-Roger-So-Sad-Now/include/client.h
lawrence910426/ProgrammingII_FinalProject
493183dc2a674310e65bffe3a5e00395e8bebb4b
[ "MIT" ]
null
null
null
Hiya-Why-You-Use-Reinforcement-Learning-To-Play-Tetris-You-Dont-Know-How-To-Play-It-Yourself-Uncle-Roger-So-Sad-Now/include/client.h
lawrence910426/ProgrammingII_FinalProject
493183dc2a674310e65bffe3a5e00395e8bebb4b
[ "MIT" ]
null
null
null
#pragma once #include <allegro5/allegro5.h> #include <arpa/inet.h> #include <netdb.h> #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <set> #include "game.h" class Game; class Client { public: Client(char *host, int port, Game &game); Client(int fd, Game &game); ~Client(); bool handle(); bool running = true; void Stop(); void HandleMessage(char *msg); void SendRegister(std::string &name); void SendUpdateBoard(Board &board); void SendAttack(int target, int lines); void SendDead(); int master_fd = -1; int id = -1; int sock{}; bool is_master; std::map<int, std::tuple<std::string, Board, bool>> players; std::vector<int> player_list; std::set<int> players_alive; private: std::set<int> client_fds; sockaddr_in addr{}; fd_set fds{}; fd_set active_fds{}; char buffer[BUFFER_SIZE]{}; char message[BUFFER_SIZE]{}; bool recvFromServer(); void sendToServer(char *message) const; Game &game; };
16.71831
64
0.641955
[ "vector" ]
aac7753219b6032c74551ff466341306deb79adf
4,838
h
C
cvplot/include/cvplot/figure.h
farzingkh/RoboND-MCL-Lab
db580d33cc5fb93ab7268fa2e4b8edf2d104ab16
[ "MIT" ]
1
2022-03-05T08:43:09.000Z
2022-03-05T08:43:09.000Z
cvplot/include/cvplot/figure.h
farzingkh/Occupancy-Grid-Mapping
07fa03d343a1970a7ee46c7ab6a973819549258e
[ "MIT" ]
null
null
null
cvplot/include/cvplot/figure.h
farzingkh/Occupancy-Grid-Mapping
07fa03d343a1970a7ee46c7ab6a973819549258e
[ "MIT" ]
null
null
null
#ifndef CVPLOT_FIGURE_H #define CVPLOT_FIGURE_H #include "color.h" #include "window.h" #include <map> #include <string> #include <vector> namespace cvplot { struct Point2 { float x, y; Point2() : Point2(0, 0) {} Point2(float x, float y) : x(x), y(y) {} }; struct Point3 { float x, y, z; Point3() : Point3(0, 0, 0) {} Point3(float x, float y, float z) : x(x), y(y), z(z) {} }; enum Type { Line, DotLine, Dots, FillLine, RangeLine, Histogram, Vistogram, Horizontal, Vertical, Range, Circle, }; class Series { public: Series(const std::string &label, enum Type type, Color color) : label_(label), type_(type), color_(color), dims_(0), depth_(0), legend_(true), dynamic_color_(false) {} Series &type(enum Type type); Series &color(Color color); Series &dynamicColor(bool dynamic_color); Series &legend(bool legend); Series &add(const std::vector<std::pair<float, float>> &data); Series &add(const std::vector<std::pair<float, Point2>> &data); Series &add(const std::vector<std::pair<float, Point3>> &data); Series &addValue(const std::vector<float> &values); Series &addValue(const std::vector<Point2> &values); Series &addValue(const std::vector<Point3> &values); Series &add(float key, float value); Series &add(float key, Point2 value); Series &add(float key, Point3 value); Series &addValue(float value); Series &addValue(float value_a, float value_b); Series &addValue(float value_a, float value_b, float value_c); Series &set(const std::vector<std::pair<float, float>> &data); Series &set(const std::vector<std::pair<float, Point2>> &data); Series &set(const std::vector<std::pair<float, Point3>> &data); Series &setValue(const std::vector<float> &values); Series &setValue(const std::vector<Point2> &values); Series &setValue(const std::vector<Point3> &values); Series &set(float key, float value); Series &set(float key, float value_a, float value_b); Series &set(float key, float value_a, float value_b, float value_c); Series &setValue(float value); Series &setValue(float value_a, float value_b); Series &setValue(float value_a, float value_b, float value_c); Series &clear(); const std::string &label() const; bool legend() const; Color color() const; void draw(void *buffer, float x_min, float x_max, float y_min, float y_max, float x_axis, float xs, float xd, float ys, float yd, float y_axis, int unit, float offset) const; bool collides() const; void dot(void *b, int x, int y, int r) const; void bounds(float &x_min, float &x_max, float &y_min, float &y_max, int &n_max, int &p_max) const; void verifyParams() const; protected: void ensureDimsDepth(int dims, int depth); bool flipAxis() const; protected: std::vector<int> entries_; std::vector<float> data_; enum Type type_; Color color_; std::string label_; int dims_; int depth_; bool legend_; bool dynamic_color_; }; class Figure { public: Figure(View &view) : view_(view), border_size_(50), background_color_(White), axis_color_(Black), sub_axis_color_(Light), text_color_(Black), include_zero_x_(true), include_zero_y_(true), aspect_square_(false), grid_size_(60), grid_padding_(20), axis_defined(false) {} Figure &clear(); Figure &origin(bool x, bool y); Figure &square(bool square); Figure &border(int size); Figure &alpha(int alpha); Figure &gridSize(int size); Figure &backgroundColor(Color color); Figure &axisColor(Color color); Figure &subaxisColor(Color color); Figure &textColor(Color color); Figure &setAxes(float x_min, float y_min, float x_max, float y_max); Color backgroundColor(); Color axisColor(); Color subaxisColor(); Color textColor(); void draw(void *b, float x_min, float x_max, float y_min, float y_max, int n_max, int p_max) const; void show(bool flush = true) const; Series &series(const std::string &label); protected: View &view_; std::vector<Series> series_; int border_size_; Color background_color_; Color axis_color_; Color sub_axis_color_; Color text_color_; bool include_zero_x_; bool include_zero_y_; bool aspect_square_; int grid_size_; int grid_padding_; float xx_min; float yy_min; float xx_max; float yy_max; bool axis_defined; }; Figure &figure(const std::string &view); } // namespace cvplot #endif // CVPLOT_FIGURE_H
27.488636
81
0.633733
[ "vector" ]
aac9b81178b4336555afabba8554a2771f12627a
13,751
h
C
src/base/image.h
backwardn/colmap
07b46598471e8bd2185c843dd6450e3108aaa640
[ "BSD-3-Clause" ]
23
2019-12-03T03:01:17.000Z
2021-12-10T07:30:32.000Z
src/base/image.h
backwardn/colmap
07b46598471e8bd2185c843dd6450e3108aaa640
[ "BSD-3-Clause" ]
1
2020-04-14T08:40:19.000Z
2020-04-15T08:33:39.000Z
src/base/image.h
backwardn/colmap
07b46598471e8bd2185c843dd6450e3108aaa640
[ "BSD-3-Clause" ]
7
2020-01-04T16:23:46.000Z
2021-12-10T06:28:24.000Z
// Copyright (c) 2018, ETH Zurich and UNC Chapel Hill. // 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 ETH Zurich and UNC Chapel Hill 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 HOLDERS 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. // // Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de) #ifndef COLMAP_SRC_BASE_IMAGE_H_ #define COLMAP_SRC_BASE_IMAGE_H_ #include <string> #include <vector> #include <Eigen/Core> #include "base/camera.h" #include "base/point2d.h" #include "base/visibility_pyramid.h" #include "util/alignment.h" #include "util/logging.h" #include "util/math.h" #include "util/types.h" namespace colmap { // Class that holds information about an image. An image is the product of one // camera shot at a certain location (parameterized as the pose). An image may // share a camera with multiple other images, if its intrinsics are the same. class Image { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW Image(); // Setup / tear down the image and necessary internal data structures before // and after being used in reconstruction. void SetUp(const Camera& camera); void TearDown(); // Access the unique identifier of the image. inline image_t ImageId() const; inline void SetImageId(const image_t image_id); // Access the name of the image. inline const std::string& Name() const; inline std::string& Name(); inline void SetName(const std::string& name); // Access the unique identifier of the camera. Note that multiple images // might share the same camera. inline camera_t CameraId() const; inline void SetCameraId(const camera_t camera_id); // Check whether identifier of camera has been set. inline bool HasCamera() const; // Check if image is registered. inline bool IsRegistered() const; inline void SetRegistered(const bool registered); // Get the number of image points. inline point2D_t NumPoints2D() const; // Get the number of triangulations, i.e. the number of points that // are part of a 3D point track. inline point2D_t NumPoints3D() const; // Get the number of observations, i.e. the number of image points that // have at least one correspondence to another image. inline point2D_t NumObservations() const; inline void SetNumObservations(const point2D_t num_observations); // Get the number of correspondences for all image points. inline point2D_t NumCorrespondences() const; inline void SetNumCorrespondences(const point2D_t num_observations); // Get the number of observations that see a triangulated point, i.e. the // number of image points that have at least one correspondence to a // triangulated point in another image. inline point2D_t NumVisiblePoints3D() const; // Get the score of triangulated observations. In contrast to // `NumVisiblePoints3D`, this score also captures the distribution // of triangulated observations in the image. This is useful to select // the next best image in incremental reconstruction, because a more // uniform distribution of observations results in more robust registration. inline size_t Point3DVisibilityScore() const; // Access quaternion vector as (qw, qx, qy, qz) specifying the rotation of the // pose which is defined as the transformation from world to image space. inline const Eigen::Vector4d& Qvec() const; inline Eigen::Vector4d& Qvec(); inline double Qvec(const size_t idx) const; inline double& Qvec(const size_t idx); inline void SetQvec(const Eigen::Vector4d& qvec); // Quaternion prior, e.g. given by EXIF gyroscope tag. inline const Eigen::Vector4d& QvecPrior() const; inline Eigen::Vector4d& QvecPrior(); inline double QvecPrior(const size_t idx) const; inline double& QvecPrior(const size_t idx); inline bool HasQvecPrior() const; inline void SetQvecPrior(const Eigen::Vector4d& qvec); // Access quaternion vector as (tx, ty, tz) specifying the translation of the // pose which is defined as the transformation from world to image space. inline const Eigen::Vector3d& Tvec() const; inline Eigen::Vector3d& Tvec(); inline double Tvec(const size_t idx) const; inline double& Tvec(const size_t idx); inline void SetTvec(const Eigen::Vector3d& tvec); // Quaternion prior, e.g. given by EXIF GPS tag. inline const Eigen::Vector3d& TvecPrior() const; inline Eigen::Vector3d& TvecPrior(); inline double TvecPrior(const size_t idx) const; inline double& TvecPrior(const size_t idx); inline bool HasTvecPrior() const; inline void SetTvecPrior(const Eigen::Vector3d& tvec); // Access the coordinates of image points. inline const class Point2D& Point2D(const point2D_t point2D_idx) const; inline class Point2D& Point2D(const point2D_t point2D_idx); inline const std::vector<class Point2D>& Points2D() const; void SetPoints2D(const std::vector<Eigen::Vector2d>& points); void SetPoints2D(const std::vector<class Point2D>& points); // Set the point as triangulated, i.e. it is part of a 3D point track. void SetPoint3DForPoint2D(const point2D_t point2D_idx, const point3D_t point3D_id); // Set the point as not triangulated, i.e. it is not part of a 3D point track. void ResetPoint3DForPoint2D(const point2D_t point2D_idx); // Check whether an image point has a correspondence to an image point in // another image that has a 3D point. inline bool IsPoint3DVisible(const point2D_t point2D_idx) const; // Check whether one of the image points is part of the 3D point track. bool HasPoint3D(const point3D_t point3D_id) const; // Indicate that another image has a point that is triangulated and has // a correspondence to this image point. Note that this must only be called // after calling `SetUp`. void IncrementCorrespondenceHasPoint3D(const point2D_t point2D_idx); // Indicate that another image has a point that is not triangulated any more // and has a correspondence to this image point. This assumes that // `IncrementCorrespondenceHasPoint3D` was called for the same image point // and correspondence before. Note that this must only be called // after calling `SetUp`. void DecrementCorrespondenceHasPoint3D(const point2D_t point2D_idx); // Normalize the quaternion vector. void NormalizeQvec(); // Compose the projection matrix from world to image space. Eigen::Matrix3x4d ProjectionMatrix() const; // Compose the inverse projection matrix from image to world space Eigen::Matrix3x4d InverseProjectionMatrix() const; // Compose rotation matrix from quaternion vector. Eigen::Matrix3d RotationMatrix() const; // Extract the projection center in world space. Eigen::Vector3d ProjectionCenter() const; // Extract the viewing direction of the image. Eigen::Vector3d ViewingDirection() const; // The number of levels in the 3D point multi-resolution visibility pyramid. static const int kNumPoint3DVisibilityPyramidLevels; private: // Identifier of the image, if not specified `kInvalidImageId`. image_t image_id_; // The name of the image, i.e. the relative path. std::string name_; // The identifier of the associated camera. Note that multiple images might // share the same camera. If not specified `kInvalidCameraId`. camera_t camera_id_; // Whether the image is successfully registered in the reconstruction. bool registered_; // The number of 3D points the image observes, i.e. the sum of its `points2D` // where `point3D_id != kInvalidPoint3DId`. point2D_t num_points3D_; // The number of image points that have at least one correspondence to // another image. point2D_t num_observations_; // The sum of correspondences per image point. point2D_t num_correspondences_; // The number of 2D points, which have at least one corresponding 2D point in // another image that is part of a 3D point track, i.e. the sum of `points2D` // where `num_tris > 0`. point2D_t num_visible_points3D_; // The pose of the image, defined as the transformation from world to image. Eigen::Vector4d qvec_; Eigen::Vector3d tvec_; // The pose prior of the image, e.g. extracted from EXIF tags. Eigen::Vector4d qvec_prior_; Eigen::Vector3d tvec_prior_; // All image points, including points that are not part of a 3D point track. std::vector<class Point2D> points2D_; // Per image point, the number of correspondences that have a 3D point. std::vector<image_t> num_correspondences_have_point3D_; // Data structure to compute the distribution of triangulated correspondences // in the image. Note that this structure is only usable after `SetUp`. VisibilityPyramid point3D_visibility_pyramid_; }; //////////////////////////////////////////////////////////////////////////////// // Implementation //////////////////////////////////////////////////////////////////////////////// image_t Image::ImageId() const { return image_id_; } void Image::SetImageId(const image_t image_id) { image_id_ = image_id; } const std::string& Image::Name() const { return name_; } std::string& Image::Name() { return name_; } void Image::SetName(const std::string& name) { name_ = name; } inline camera_t Image::CameraId() const { return camera_id_; } inline void Image::SetCameraId(const camera_t camera_id) { CHECK_NE(camera_id, kInvalidCameraId); camera_id_ = camera_id; } inline bool Image::HasCamera() const { return camera_id_ != kInvalidCameraId; } bool Image::IsRegistered() const { return registered_; } void Image::SetRegistered(const bool registered) { registered_ = registered; } point2D_t Image::NumPoints2D() const { return static_cast<point2D_t>(points2D_.size()); } point2D_t Image::NumPoints3D() const { return num_points3D_; } point2D_t Image::NumObservations() const { return num_observations_; } void Image::SetNumObservations(const point2D_t num_observations) { num_observations_ = num_observations; } point2D_t Image::NumCorrespondences() const { return num_correspondences_; } void Image::SetNumCorrespondences(const point2D_t num_correspondences) { num_correspondences_ = num_correspondences; } point2D_t Image::NumVisiblePoints3D() const { return num_visible_points3D_; } size_t Image::Point3DVisibilityScore() const { return point3D_visibility_pyramid_.Score(); } const Eigen::Vector4d& Image::Qvec() const { return qvec_; } Eigen::Vector4d& Image::Qvec() { return qvec_; } inline double Image::Qvec(const size_t idx) const { return qvec_(idx); } inline double& Image::Qvec(const size_t idx) { return qvec_(idx); } void Image::SetQvec(const Eigen::Vector4d& qvec) { qvec_ = qvec; } const Eigen::Vector4d& Image::QvecPrior() const { return qvec_prior_; } Eigen::Vector4d& Image::QvecPrior() { return qvec_prior_; } inline double Image::QvecPrior(const size_t idx) const { return qvec_prior_(idx); } inline double& Image::QvecPrior(const size_t idx) { return qvec_prior_(idx); } inline bool Image::HasQvecPrior() const { return !IsNaN(qvec_prior_.sum()); } void Image::SetQvecPrior(const Eigen::Vector4d& qvec) { qvec_prior_ = qvec; } const Eigen::Vector3d& Image::Tvec() const { return tvec_; } Eigen::Vector3d& Image::Tvec() { return tvec_; } inline double Image::Tvec(const size_t idx) const { return tvec_(idx); } inline double& Image::Tvec(const size_t idx) { return tvec_(idx); } void Image::SetTvec(const Eigen::Vector3d& tvec) { tvec_ = tvec; } const Eigen::Vector3d& Image::TvecPrior() const { return tvec_prior_; } Eigen::Vector3d& Image::TvecPrior() { return tvec_prior_; } inline double Image::TvecPrior(const size_t idx) const { return tvec_prior_(idx); } inline double& Image::TvecPrior(const size_t idx) { return tvec_prior_(idx); } inline bool Image::HasTvecPrior() const { return !IsNaN(tvec_prior_.sum()); } void Image::SetTvecPrior(const Eigen::Vector3d& tvec) { tvec_prior_ = tvec; } const class Point2D& Image::Point2D(const point2D_t point2D_idx) const { return points2D_.at(point2D_idx); } class Point2D& Image::Point2D(const point2D_t point2D_idx) { return points2D_.at(point2D_idx); } const std::vector<class Point2D>& Image::Points2D() const { return points2D_; } bool Image::IsPoint3DVisible(const point2D_t point2D_idx) const { return num_correspondences_have_point3D_.at(point2D_idx) > 0; } } // namespace colmap EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_CUSTOM(colmap::Image) #endif // COLMAP_SRC_BASE_IMAGE_H_
37.673973
80
0.742128
[ "vector", "3d" ]
aacf7d5d28806a57b617904ef1d4171df84323a5
12,661
h
C
HLT/BASE/HLTbaseLinkDef.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
null
null
null
HLT/BASE/HLTbaseLinkDef.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
2
2016-11-25T08:40:56.000Z
2019-10-11T12:29:29.000Z
HLT/BASE/HLTbaseLinkDef.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
null
null
null
// $Id$ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliHLTAsyncProcessor; #pragma link C++ class AliHLTComponent+; #pragma link C++ class AliHLTComponentHandler+; #pragma link C++ class AliHLTSystem+; #pragma link C++ class AliHLTReconstructorBase+; #pragma link C++ class AliHLTPluginBase+; #pragma link C++ class AliHLTProcessor+; #pragma link C++ class AliHLTCalibrationProcessor+; #pragma link C++ class AliHLTConfiguration+; #pragma link C++ class AliHLTComponentConfiguration+; #pragma link C++ class AliHLTConfigurationHandler+; #pragma link C++ class AliHLTOnlineConfiguration+; #pragma link C++ class AliHLTTTreeProcessor+; #pragma link C++ class AliHLTTask+; #pragma link C++ class AliHLTDumpTask+; #pragma link C++ class AliHLTControlTask+; #pragma link C++ class AliHLTLogging+; #pragma link C++ class AliHLTErrorGuard+; #pragma link C++ class AliHLTDataBuffer+; #pragma link C++ class AliHLTDataBuffer::AliHLTRawBuffer+; #pragma link C++ class AliHLTDataBuffer::AliHLTRawPage+; #pragma link C++ class AliHLTConsumerDescriptor+; #pragma link C++ class AliHLTDataSource+; #pragma link C++ class AliHLTDataSink+; #pragma link C++ class AliHLTOfflineInterface+; #pragma link C++ class AliHLTOfflineDataSource+; #pragma link C++ class AliHLTModuleAgent+; #pragma link C++ class AliHLTModulePreprocessor+; #pragma link C++ class AliHLTShuttleInterface+; #pragma link C++ class AliHLTDimServer+; #pragma link C++ class AliHLTHOMERLibManager+; #pragma link C++ class AliHLTHOMERManager+; #pragma link C++ class AliHLTDirectHOMERManager+; #pragma link C++ class AliHLTHOMERProxyHandler+; #pragma link C++ class AliHLTHOMERBlockDesc+; #pragma link C++ class AliHLTHOMERSourceDesc+; #pragma link C++ class AliHLTEsdManager+; #pragma link C++ class AliHLTDAQ+; #pragma link C++ class AliHLTOUT+; #pragma link C++ class AliHLTOUTHomerBuffer+; #pragma link C++ class AliHLTOUTTask+; #pragma link C++ class AliHLTOUTHandler+; #pragma link C++ class AliHLTOUTHandlerIgnore+; #pragma link C++ class AliHLTOUTHandlerEquId+; #pragma link C++ class AliHLTOUTHandlerDetectorDDL+; #pragma link C++ class AliHLTOUTHandlerChain+; #pragma link C++ class AliHLTOUTHandlerEsdBranch+; #pragma link C++ class AliHLTMemoryFile+; #pragma link C++ class AliHLTMessage+; #pragma link C++ class AliHLTEventStatistics+; #pragma link C++ class AliHLTBlockDataCollection+; #pragma link C++ class AliHLTTriggerDecision+; #pragma link C++ class AliHLTComponentBenchmark+; #pragma link C++ class AliHLTDataDeflater+; #pragma link C++ class AliHLTDataDeflaterSimple+; #pragma link C++ class AliHLTDataDeflaterHuffman+; #pragma link C++ class AliHLTHuffmanNode+; #pragma link C++ class AliHLTHuffmanTreeNode+; #pragma link C++ class AliHLTHuffmanLeaveNode+; #pragma link C++ class AliHLTHuffman+; #pragma link C++ class AliHLTDataInflater+; #pragma link C++ class AliHLTDataInflaterSimple+; #pragma link C++ class AliHLTDataInflaterHuffman+; #include "RVersion.h" #if ROOT_VERSION_CODE < 334336 //ROOT_VERSION(5,26,0) #pragma link C++ class AliHLTGlobalTriggerDecision-; // '-' option since the class uses a custom streamer. #pragma link C++ class AliHLTReadoutList-; // '-' option since the class uses a custom streamer. #else // ROOT version check #pragma link C++ class AliHLTGlobalTriggerDecision+; // Scheme rule to mark all objects in the trigger decision loaded from file as // deletable. Meaning the new object owns all the input objects. #pragma read sourceClass="AliHLTGlobalTriggerDecision" version="[1-]" targetClass="AliHLTGlobalTriggerDecision"\ source="" target="" code="{ newObj->MarkInputObjectsAsOwned(); }" #pragma link C++ class AliHLTReadoutList+; // Do nothing special with schema evolution for new versions of the readout list. #pragma read sourceClass="AliHLTReadoutList" version="[4-]" targetClass="AliHLTReadoutList" // For old versions we need to convert the format of the readout list into the new one. #pragma read sourceClass="AliHLTReadoutList" version="[3]" targetClass="AliHLTReadoutList"\ source="AliHLTEventDDL fReadoutList" target="fReadoutList"\ code="{\ fReadoutList.fCount = gkAliHLTDDLListSize;\ for (int i = 0; i<30; ++i) fReadoutList.fList[i] = onfile.fReadoutList.fList[i];\ fReadoutList.fList[30] = 0x0;\ fReadoutList.fList[31] = onfile.fReadoutList.fList[30];\ }" #pragma read sourceClass="AliHLTReadoutList" version="[1-2]" targetClass="AliHLTReadoutList"\ source="AliHLTEventDDL fReadoutList" target="fReadoutList"\ code="{\ fReadoutList.fCount = gkAliHLTDDLListSize;\ for (int i = 0; i < 28; ++i) fReadoutList.fList[i] = onfile.fReadoutList.fList[i];\ fReadoutList.fList[28] = 0x0;\ fReadoutList.fList[29] = onfile.fReadoutList.fList[28];\ fReadoutList.fList[30] = 0x0;\ fReadoutList.fList[31] = onfile.fReadoutList.fList[29];\ }" #endif // ROOT version check #pragma link C++ class AliHLTTriggerDomain+; #pragma link C++ class AliHLTDomainEntry+; #pragma link C++ class AliHLTTriggerMenu+; #pragma link C++ class AliHLTTriggerMenuItem+; // For old versions of the trigger menu item we need to set the missing values to appropriate defaults. #pragma read sourceClass="AliHLTTriggerMenuItem" version="[1-3]" targetClass="AliHLTTriggerMenuItem"\ source="" target=""\ code="{\ newObj->DefaultResult(true);\ newObj->ScaleDown(1);\ }" #pragma read sourceClass="AliHLTHuffmanNode" version="[1-]" targetClass="AliHLTHuffmanNode"\ source="float fWeight" target="fWeightDouble"\ code="{\ fWeightDouble = onfile.fWeight;\ }" #pragma link C++ class AliHLTTriggerMenuSymbol+; #pragma link C++ class AliHLTRunStatistics+; #pragma link C++ class AliHLTSpacePointContainer+; #pragma link C++ class AliHLTIndexGrid<float, AliHLTSpacePointContainer::AliHLTSpacePointProperties>+; #pragma link C++ class AliHLTIndexGrid<float, AliHLTUInt32_t>+; #pragma link C++ class AliHLTIndexGrid<int, AliHLTUInt32_t>+; #pragma link C++ class AliHLTTrackGeometry+; #pragma link C++ class AliHLTMisc+; #pragma link C++ class AliHLTCTPData+; #pragma read sourceClass="AliHLTCTPData" targetClass="AliHLTCTPData" source="AliHLTUInt64_t fMask" version="[-2]" target="fMask" targetType="AliHLTTriggerMask_t" include="Rtypes.h" code="{fMask.reset(); for(Int_t i=0; i<64; ++i) fMask.set(i,TESTBIT(onfile.fMask,i));}" #pragma read sourceClass="AliHLTCTPData" targetClass="AliHLTCTPData" source="AliHLTUInt64_t fTriggers" version="[-2]" target="fTriggers" targetType="AliHLTTriggerMask_t" include="Rtypes.h" code="{fTriggers.reset(); for(Int_t i=0; i<64; ++i) fTriggers.set(i,TESTBIT(onfile.fTriggers,i));}" #pragma link C++ class AliHLTScalars+; #pragma link C++ class AliHLTScalars::AliScalar+; // Need to initialise the hash table which is transient after reading the class. #pragma read sourceClass="AliHLTScalars" version="[1-]" targetClass="AliHLTScalars"\ source="" target="fMap" code="{fMap.AddAll(newObj->GetScalars());}" #pragma link C++ struct AliHLTComponentEventData+; #pragma link C++ struct AliHLTComponentBlockData+; #pragma link C++ struct AliHLTComponentDataType+; #pragma link C++ struct AliHLTEventDDLV0+; // Only added to have proper dictionary generation and ROOT I/O for AliHLTReadoutList class. #pragma link C++ struct AliHLTEventDDLV1+; // Only added to have proper dictionary generation and ROOT I/O for AliHLTReadoutList class. #pragma link C++ struct AliHLTEventDDLV2+; // Only added to have proper dictionary generation and ROOT I/O for AliHLTReadoutList class. #pragma link C++ struct AliHLTRunDesc+; #pragma link C++ struct AliHLTComponentStatistics+; #pragma link C++ struct AliHLTComponentTableEntry; #pragma link C++ struct AliHLTDataTopic+; #pragma link C++ function operator==( const AliHLTComponentDataType&, const AliHLTComponentDataType&); #pragma link C++ function operator!=( const AliHLTComponentDataType&, const AliHLTComponentDataType&); #pragma link C++ function operator|(const AliHLTComponentDataType, const char*); #pragma link C++ function AliHLTComponentDataTypeInitializer(const char*, const char*); #pragma link C++ function AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType, const char*); #pragma link C++ function operator<<(ostream &, const AliHLTComponentDataType &); #pragma link C++ function operator<<(ostream &, const AliHLTSpacePointContainer &); #pragma link C++ global kAliHLTComponentDataTypefOriginSize; #pragma link C++ global kAliHLTComponentDataTypefIDsize; #pragma link C++ global kAliHLTDataOriginVoid; #pragma link C++ global kAliHLTDataOriginAny; #pragma link C++ global kAliHLTDataOriginOut; #pragma link C++ global kAliHLTDataOriginHLT; #pragma link C++ global kAliHLTDataOriginOffline; #pragma link C++ global kAliHLTDataOriginPrivate; #pragma link C++ global kAliHLTDataOriginTPC; #pragma link C++ global kAliHLTDataOriginPHOS; #pragma link C++ global kAliHLTDataOriginFMD; #pragma link C++ global kAliHLTDataOriginMUON; #pragma link C++ global kAliHLTDataOriginTRD; #pragma link C++ global kAliHLTDataOriginITS; #pragma link C++ global kAliHLTDataOriginITSSPD; #pragma link C++ global kAliHLTDataOriginITSSDD; #pragma link C++ global kAliHLTDataOriginITSSSD; #pragma link C++ global kAliHLTDataOriginSample; #pragma link C++ global kAliHLTDataOriginEMCAL; #pragma link C++ global kAliHLTAnyDataType; #pragma link C++ global kAliHLTAllDataType; #pragma link C++ global kAliHLTVoidDataType; #pragma link C++ global kAliHLTMultipleDataType; #pragma link C++ global kAliHLTDataTypeFXSCalib; #pragma link C++ global kAliHLTDataTypeDDL; #pragma link C++ global kAliHLTDataTypeDAQRDOUT; #pragma link C++ global kAliHLTDataTypeClusters; #pragma link C++ global kAliHLTDataTypeSOR; #pragma link C++ global kAliHLTDataTypeEOR; #pragma link C++ global kAliHLTDataTypeRunType; #pragma link C++ global kAliHLTDataTypeEvent; #pragma link C++ global kAliHLTDataTypeECSParam; #pragma link C++ global kAliHLTDataTypeComConf; #pragma link C++ global kAliHLTDataTypeConfig; #pragma link C++ global kAliHLTDataTypeInfo; #pragma link C++ global kAliHLTDataTypeCDBEntry; #pragma link C++ global kAliHLTDataTypeUpdtDCS; #pragma link C++ global kAliHLTDataTypeDDLRaw; #pragma link C++ global kAliHLTDataTypeMCObject; #pragma link C++ global kAliHLTDataTypeESDObject; #pragma link C++ global kAliHLTDataTypeESDTree; #pragma link C++ global kAliHLTDataTypeAliTreeD; #pragma link C++ global kAliHLTDataTypeAliTreeR; #pragma link C++ global kAliHLTDataTypeHwAddr16; #pragma link C++ global kAliHLTDataTypeEventStatistics; #pragma link C++ global kAliHLTDataTypeEventSummary; #pragma link C++ global kAliHLTDataTypeRunStatistics; #pragma link C++ global kAliHLTDataTypeRunSummary; #pragma link C++ global kAliHLTDataTypeTriggerDecision; #pragma link C++ global kAliHLTDataTypeGlobalTrigger; #pragma link C++ global kAliHLTDataTypeComponentStatistics; #pragma link C++ global kAliHLTDataTypeComponentTable; #pragma link C++ global kAliHLTDataTypeTObject; #pragma link C++ global kAliHLTDataTypeTObjArray; #pragma link C++ global kAliHLTDataTypeTTree; #pragma link C++ global kAliHLTDataTypeHistogram; #pragma link C++ global kAliHLTDataTypeTNtuple; #pragma link C++ global kAliHLTDataTypeTrack; #pragma link C++ global kAliHLTDataTypeTrackMC; #pragma link C++ global kAliHLTDataTypeExternalTrackParam; #pragma link C++ global kAliHLTDataTypeJet; #pragma link C++ global kAliHLTVoidEventID; #pragma link C++ global kAliHLTVoidDataSpec; #pragma link C++ global kAliHLTVoidRunNo; #pragma link C++ global kAliHLTVoidRunType; #pragma link C++ global kAliHLTVoidRunDesc; #pragma link C++ global gkAliEventTypeUnknown; #pragma link C++ global gkAliEventTypeStartOfRun; #pragma link C++ global gkAliEventTypeData; #pragma link C++ global gkAliEventTypeEndOfRun; #pragma link C++ global gkAliEventTypeCorruptID; #pragma link C++ global gkAliEventTypeCalibration; #pragma link C++ global gkAliEventTypeDataReplay; #pragma link C++ global gkAliEventTypeConfiguration; #pragma link C++ global gkAliEventTypeReadPreprocessor; #pragma link C++ global gkAliEventTypeTick; #pragma link C++ global gkAliEventTypeMax; #pragma link C++ global kHLTLogNone; #pragma link C++ global kHLTLogBenchmark; #pragma link C++ global kHLTLogDebug; #pragma link C++ global kHLTLogInfo; #pragma link C++ global kHLTLogWarning; #pragma link C++ global kHLTLogError; #pragma link C++ global kHLTLogFatal; #pragma link C++ global kHLTLogImportant; #pragma link C++ global kHLTLogAll; #pragma link C++ global kHLTLogDefault; #pragma link C++ class AliHLTOUTComponent+; #endif
47.777358
289
0.774267
[ "object" ]
aadd732b59b8b92ee94abaeebd17a2ddb3bae3fe
6,927
h
C
util/math/funcs.h
Kelendral-gh/godot_voxel
36cc952daa5d17d6e1996bd6e874a81d45c5dcc6
[ "MIT" ]
null
null
null
util/math/funcs.h
Kelendral-gh/godot_voxel
36cc952daa5d17d6e1996bd6e874a81d45c5dcc6
[ "MIT" ]
null
null
null
util/math/funcs.h
Kelendral-gh/godot_voxel
36cc952daa5d17d6e1996bd6e874a81d45c5dcc6
[ "MIT" ]
null
null
null
#ifndef VOXEL_MATH_FUNCS_H #define VOXEL_MATH_FUNCS_H #include "vector2f.h" #include "vector3f.h" #include <core/math/vector3.h> namespace zylann::math { // Trilinear interpolation between corner values of a cube. // // 6---------------7 // /| /| // / | / | // 5---------------4 | // | | | | // | | | | // | | | | // | 2------------|--3 Y // | / | / | Z // |/ |/ |/ // 1---------------0 X----o // template <typename T> inline T interpolate(const T v0, const T v1, const T v2, const T v3, const T v4, const T v5, const T v6, const T v7, Vector3f position) { const float one_min_x = 1.f - position.x; const float one_min_y = 1.f - position.y; const float one_min_z = 1.f - position.z; const float one_min_x_one_min_y = one_min_x * one_min_y; const float x_one_min_y = position.x * one_min_y; T res = one_min_z * (v0 * one_min_x_one_min_y + v1 * x_one_min_y + v4 * one_min_x * position.y); res += position.z * (v3 * one_min_x_one_min_y + v2 * x_one_min_y + v7 * one_min_x * position.y); res += position.x * position.y * (v5 * one_min_z + v6 * position.z); return res; } template <typename T> inline T min(const T a, const T b) { return a < b ? a : b; } template <typename T> inline T max(const T a, const T b) { return a > b ? a : b; } template <typename T> inline T min(const T a, const T b, const T c, const T d) { return min(min(a, b), min(c, d)); } template <typename T> inline T max(const T a, const T b, const T c, const T d) { return max(max(a, b), max(c, d)); } template <typename T> inline T min(const T a, const T b, const T c, const T d, const T e, const T f) { return min(min(min(a, b), min(c, d)), min(e, f)); } template <typename T> inline T max(const T a, const T b, const T c, const T d, const T e, const T f) { return max(max(max(a, b), max(c, d)), max(e, f)); } template <typename T> inline T min(const T a, const T b, const T c, const T d, const T e, const T f, const T g, const T h) { return min(min(a, b, c, d), min(e, f, g, h)); } template <typename T> inline T max(const T a, const T b, const T c, const T d, const T e, const T f, const T g, const T h) { return max(max(a, b, c, d), max(e, f, g, h)); } // template versions require explicit types. // float versions do not require casting all the time, so optional double-precision support with `real_t` is easier. inline float minf(float a, float b) { return a < b ? a : b; } inline double minf(double a, double b) { return a < b ? a : b; } inline float maxf(float a, float b) { return a > b ? a : b; } inline float maxf(double a, double b) { return a > b ? a : b; } template <typename T> inline T clamp(const T x, const T min_value, const T max_value) { // TODO Optimization: clang can optimize a min/max implementation. Worth changing to that? if (x < min_value) { return min_value; } if (x > max_value) { return max_value; } return x; } inline float clampf(float x, float min_value, float max_value) { return fmin(fmax(x, min_value), max_value); } template <typename T> inline T squared(const T x) { return x * x; } // Performs euclidean division, aka floored division. // This implementation expects a strictly positive divisor. // // Example with division by 3: // // x | `/` | floordiv // ---------------------- // -6 | -2 | -2 // -5 | -1 | -2 // -4 | -1 | -2 // -3 | -1 | -1 // -2 | 0 | -1 // -1 | 0 | -1 // 0 | 0 | 0 // 1 | 0 | 0 // 2 | 0 | 0 // 3 | 1 | 1 // 4 | 1 | 1 // 5 | 1 | 1 // 6 | 2 | 2 inline int floordiv(int x, int d) { #ifdef DEBUG_ENABLED CRASH_COND(d <= 0); #endif if (x < 0) { return (x - d + 1) / d; } else { return x / d; } } inline int ceildiv(int x, int d) { return -floordiv(-x, d); } // TODO Rename `wrapi` // `Math::wrapi` with zero min inline int wrap(int x, int d) { return ((unsigned int)x - (x < 0)) % (unsigned int)d; //return ((x % d) + d) % d; } // Math::wrapf with zero min inline float wrapf(float x, float d) { return Math::is_zero_approx(d) ? 0.f : x - (d * Math::floor(x / d)); } inline double wrapf(double x, double d) { return Math::is_zero_approx(d) ? 0.0 : x - (d * Math::floor(x / d)); } // Similar to Math::smoothstep but doesn't use macro to clamp inline float smoothstep(float p_from, float p_to, float p_weight) { if (Math::is_equal_approx(p_from, p_to)) { return p_from; } float x = clamp((p_weight - p_from) / (p_to - p_from), 0.0f, 1.0f); return x * x * (3.0f - 2.0f * x); } inline double smoothstep(double p_from, double p_to, double p_weight) { if (Math::is_equal_approx(p_from, p_to)) { return p_from; } double x = clamp((p_weight - p_from) / (p_to - p_from), 0.0, 1.0); return x * x * (3.0 - 2.0 * x); } inline float fract(float x) { return x - Math::floor(x); } inline double fract(double x) { return x - Math::floor(x); } inline Vector3 fract(const Vector3 &p) { return Vector3(fract(p.x), fract(p.y), fract(p.z)); } inline bool is_valid_size(const Vector3 &s) { return s.x >= 0 && s.y >= 0 && s.z >= 0; } inline bool is_valid_size(const Vector3i &s) { return s.x >= 0 && s.y >= 0 && s.z >= 0; } inline bool is_power_of_two(size_t x) { return x != 0 && (x & (x - 1)) == 0; } // If `x` is a power of two, returns `x`. // Otherwise, returns the closest power of two greater than `x`. inline unsigned int get_next_power_of_two_32(unsigned int x) { if (x == 0) { return 0; } --x; x |= x >> 1; x |= x >> 2; x |= x >> 4; x |= x >> 8; x |= x >> 16; return ++x; } // Assuming `pot == (1 << i)`, returns `i`. inline unsigned int get_shift_from_power_of_two_32(unsigned int pot) { #ifdef DEBUG_ENABLED CRASH_COND(!is_power_of_two(pot)); #endif for (unsigned int i = 0; i < 32; ++i) { if (pot == (1u << i)) { return i; } } CRASH_NOW_MSG("Input was not a valid power of two"); return 0; } // If the provided address `a` is not aligned to the number of bytes specified in `align`, // returns the next aligned address. `align` must be a power of two. inline size_t alignup(size_t a, size_t align) { #ifdef DEBUG_ENABLED CRASH_COND(!is_power_of_two(align)); #endif return (a + align - 1) & ~(align - 1); } inline bool has_nan(const Vector3 &v) { return Math::is_nan(v.x) || Math::is_nan(v.y) || Math::is_nan(v.z); } // inline bool is_power_of_two(int i) { // return i & (i - 1); // } // Float version of Geometry::is_point_in_triangle() inline bool is_point_in_triangle(const Vector2f &s, const Vector2f &a, const Vector2f &b, const Vector2f &c) { const Vector2f an = a - s; const Vector2f bn = b - s; const Vector2f cn = c - s; const bool orientation = an.cross(bn) > 0; if ((bn.cross(cn) > 0) != orientation) { return false; } return (cn.cross(an) > 0) == orientation; } } // namespace zylann::math #endif // VOXEL_MATH_FUNCS_H
25.097826
116
0.597084
[ "geometry" ]
aade68961df1f7e16e6693f6bea701ac7fbda62d
25,518
h
C
public/util/network/method/server_method_handler.h
room77/77up
736806fbf52a5e722e8e57ef5c248823b067175d
[ "MIT" ]
3
2015-05-18T14:52:47.000Z
2018-11-12T07:51:00.000Z
public/util/network/method/server_method_handler.h
room77/77up
736806fbf52a5e722e8e57ef5c248823b067175d
[ "MIT" ]
null
null
null
public/util/network/method/server_method_handler.h
room77/77up
736806fbf52a5e722e8e57ef5c248823b067175d
[ "MIT" ]
3
2015-08-04T05:58:18.000Z
2018-11-12T07:51:01.000Z
// Copyright 2012 Room77 Inc. All Rights Reserved. // Author: pramodg@room77.com (Pramod Gupta) // File created as part of refactoring rpcserver.h // Handler for server method. #ifndef _PUBLIC_UTIL_NETWORK_METHOD_SERVER_METHOD_HANDLER_H_ #define _PUBLIC_UTIL_NETWORK_METHOD_SERVER_METHOD_HANDLER_H_ #include <algorithm> #include <functional> #include <memory> #include <mutex> #include <type_traits> #include <unordered_map> #include "base/common.h" #include "util/network/netserver.h" #include "util/network/rpcclient.h" #include "util/factory/factory.h" #include "util/hash/hash_util.h" #include "util/serial/serializer.h" #include "util/templates/sfinae.h" extern int gFlag_max_binary_response_size; extern int gFlag_max_json_response_size; namespace network { struct tErrorMessage_JSON { string error_msg; SERIALIZE(error_msg*1); }; enum ServerMethodStatus { kServerMethodStatusValid, kServerMethodStatusInvalid, kServerMethodStatusNotImplemented, kServerMethodStatusMax, }; enum class MockMethodStatus { SUCCESS, FAILURE, UNIMPLEMENTED }; // Returns the server message string corresponding to the status. inline string GetServerMethodStatusMsg(ServerMethodStatus status) { string msg; switch(status) { case kServerMethodStatusValid : msg = "PASSED"; break; case kServerMethodStatusNotImplemented : msg = "NOT IMPLEMENTED"; break; case kServerMethodStatusInvalid : msg = "FAILED"; break; default: msg = "UNKNOWN"; break; } return msg; } // base class for all RPC Handler classes class ServerMethodHandlerBase { public: ServerMethodHandlerBase() {}; virtual ~ServerMethodHandlerBase() {}; // Function to process an RPC request. virtual void ProcessRPC(const tConnectionInfo* connection, const tServerRequestMessage& request, tServerReplyMessage* response) const = 0; // Function to process a JSON request. virtual void ProcessJSON(const tConnectionInfo* connection, const tServerRequestMessage& request, bool debug_json, tServerReplyMessage* response) const = 0; virtual string ProcessCascade(const void *caller, const void *input, void *output) const = 0; // Translate an RPC query into JSON string. virtual string RPCToJSON(const string& message, int indent = 0) const = 0; // Function to retrieve the sample input value, in JSON format. virtual string GetSampleInput_JSON() const = 0; // Function to validate the server method. virtual ServerMethodStatus Validate(const tConnectionInfo* connection, const tServerRequestMessage& request, ostream& out) const = 0; // Function to check if the live traffic to the server method can be recorded. virtual bool CanRecord() const = 0; // Function to check if the method expects empty request. i.e. no 'q' CGI // param. virtual bool AllowEmptyRequest() const = 0; }; // Actual RPC handler with input/output type template. // 3 parameters: // -- input type // -- output type // -- Server Method function (with operator() that takes "const tInput&" and // "tOutput*" and returns an error message string ("" for success). template<class tInput, class tOutput, class tFunc> class ServerMethodHandler : public ServerMethodHandlerBase { public: explicit ServerMethodHandler(const string& name, const tInput& sample_input) : name_(name), sample_input_(sample_input) {} virtual void ProcessRPC(const tConnectionInfo* connection, const tServerRequestMessage& request, tServerReplyMessage* response) const override { response->Clear(); VLOG(3) << "processrpc:"; // strutil::PrintRaw(request.message); // parse input from serialized string tInput input; if (!serial::Serializer::FromBinary(request.message, &input)) { // error during input parsing response->message = "RPC parsing error -- server mismatch?"; response->success = false; return; } // Run the server method. shared_ptr<tOutput> output(new tOutput); tFunc f = GetServerMethod(connection, request); string error_msg = RunServerMethod(f, request.arg_map, input, output, response); if (error_msg.empty()) { // return output in serialized string format response->message = serial::Serializer::ToBinary(output); ASSERT_LE(response->message.size(), gFlag_max_binary_response_size) << "Serialized Binary response too large (size=" << response->message.size() << "). Please increase command-line flag max_binary_response_size. Request: " << serial::Serializer::ToJSON(input); response->success = true; } else { response->message = error_msg; response->success = false; } } virtual void ProcessJSON(const tConnectionInfo* connection, const tServerRequestMessage& request, bool debug_json, tServerReplyMessage* response) const override { response->Clear(); VLOG(4) << "processjson: " << request.message; // parse input from serialized string string error_msg; tInput input; if (!serial::Serializer::FromJSON(request.message, &input, {&error_msg})) { // error: unable to parse JSON input tErrorMessage_JSON err; err.error_msg = error_msg; response->message = err.ToJSON({2}); response->success = false; return; } // run the server method shared_ptr<tOutput> output(new tOutput); tFunc f = GetServerMethod(connection, request); string error_msg_func = RunServerMethod(f, request.arg_map, input, output, response); if (error_msg_func.empty()) { // return output in JSON format // (if debug_json is true, format JSON output to be human-readable) response->message = serial::Serializer::ToJSON(output, {(debug_json ? 2 : 0)}); ASSERT_LE(response->message.size(), gFlag_max_json_response_size) << "Serialized JSON response too large (size=" << response->message.size() << "). Please increase command-line flag max_json_response_size. Request: " << serial::Serializer::ToJSON(input); response->success = true; } else { // error: return error message to caller tErrorMessage_JSON err; err.error_msg = error_msg_func; response->message = err.ToJSON({2}); response->success = false; } } virtual string ProcessCascade(const void *caller, const void *input, void *output) const override { const tInput *input_data = static_cast<const tInput*>(input); tOutput *output_data = static_cast<tOutput*>(output); tFunc f; f.Cascade(caller); return RunServerMethod(f, f.arg_map(), *input_data, output_data); } // translate an RPC query into JSON string virtual string RPCToJSON(const string& message, int indent = 0) const override { tInput input; if (serial::Serializer::FromBinary(message, &input)) return serial::Serializer::ToJSON(input, {indent}); else return "[Error in RPC string]"; } virtual string GetSampleInput_JSON() const override { return serial::Serializer::ToJSON(sample_input_, {2}); } virtual ServerMethodStatus Validate(const tConnectionInfo* connection, const tServerRequestMessage& request, ostream& out) const override { tFunc f = GetServerMethod(connection, request); return f.RunValidate(out); } virtual bool CanRecord() const override { return tFunc().CanRecord(); } virtual bool AllowEmptyRequest() const override { return tFunc().AllowEmptyRequest(); } protected: tFunc GetServerMethod(const tConnectionInfo* connection, const tServerRequestMessage& request) const { tFunc f; f.SetConnection(connection); f.ParseInputCookie(request.cookie); f.SetReferrer(request.referrer); f.set_http_header(request.http_header); f.set_arg_map(request.arg_map); // Set whether the call is internal or from a real user. string user_agent = f.GetHttpHeader("User-Agent"); bool internal = (user_agent.empty() || user_agent == gFlag_r77_user_agent) ? true : false; f.set_internal_call(internal); return f; } // the shared_ptr version that either executes the shared_ptr OR the // pointer version of the server methods // runs the appropriate mock or server method // @return the error_msg string RunServerMethod(tFunc server_method, const unordered_map<string, string>& arg_map, const tInput& input, shared_ptr<tOutput>& output, tServerReplyMessage* response = nullptr) const { string err_msg; // if mock didn't run, run the real method if (!TryRunMock(server_method, arg_map, input, output.get(), &err_msg, response)) { err_msg = RunHandler<tFunc>(server_method, input, output); } if (response != nullptr) response->cookies = server_method.output_cookies(); return err_msg; } string RunServerMethod(tFunc server_method, const unordered_map<string, string>& arg_map, const tInput& input, tOutput *output, tServerReplyMessage* response = nullptr) const { string err_msg; // if mock didn't run, run the real method if (!TryRunMock(server_method, arg_map, input, output, &err_msg, response)) { err_msg = server_method(input, output); } if (response != nullptr) response->cookies = server_method.output_cookies(); return err_msg; } // @return true if the mock was run, false otherwise bool TryRunMock(tFunc server_method, const unordered_map<string, string>& arg_map, const tInput& input, tOutput *output, string *err_msg, tServerReplyMessage* response = nullptr) const { MockMethodStatus status = CheckAndExecuteMock<tFunc>(arg_map, &server_method, input, output, err_msg); bool success = true; if (status == MockMethodStatus::FAILURE) { stringstream ss; ss << "failed to generate mock for method: " << name_; *err_msg = ss.str(); } else if (status == MockMethodStatus::UNIMPLEMENTED) { success = false; } return success; } CREATE_MEMBER_FUNC_SOFT_SIG_CHECK(Mock); // execute the mock method if it exists and set the output to err_msg // @return true if the mock succeeded template<typename T> typename std::enable_if< has_member_func_sig_Mock<T, MockMethodStatus(const string&, const tInput&, tOutput *) >::value, MockMethodStatus>::type CheckAndExecuteMock(const unordered_map<string, string>& arg_map, tFunc *f, const tInput& input, tOutput *output, string *err_msg) const { const string mocktype = ParseMock(arg_map); if (mocktype.empty()) return MockMethodStatus::UNIMPLEMENTED; return f->Mock(mocktype, input, output); } template<typename T> typename std::enable_if< !has_member_func_sig_Mock<T, MockMethodStatus(const string&, const tInput&, tOutput *) >::value, MockMethodStatus>::type CheckAndExecuteMock(const unordered_map<string, string>& arg_map, tFunc *f, const tInput& input, tOutput *output, string *err_msg) const { return MockMethodStatus::UNIMPLEMENTED; } CREATE_MEMBER_FUNC_SOFT_SIG_CHECK(Run); template<typename T> typename std::enable_if< has_member_func_sig_Run<T, string(const tInput&, shared_ptr<tOutput>&) >::value, string>::type RunHandler(tFunc& f, const tInput& input, shared_ptr<tOutput>& output) const { return f.Run(input, output); } template<typename T> typename std::enable_if< !has_member_func_sig_Run<T, string(const tInput&, shared_ptr<tOutput>&) >::value, string>::type RunHandler(tFunc& f, const tInput& input, shared_ptr<tOutput>& output) const { return f(input, output.get()); } // @return the mock string for this server method. empty string if this server // method is not valid string ParseMock(const unordered_map<string, string>& arg_map) const { string mocktype; const auto& it = arg_map.find("mock"); if (it != arg_map.end()) { // parse the general format MetaSearch:mockname1+*:mockname2,... vector<string> mock_entries; strutil::Split(it->second, mock_entries, "+"); for (auto& mock_entry : mock_entries) { // check for wildcard or this server name vector<string> mock_parts; strutil::Split(mock_entry, mock_parts, ":"); if (mock_parts.size() == 2) { string method_name = strutil::Trim(mock_parts[0]); // check if entry applies to wildcard OR this server specifically if (method_name == "*" || method_name == name_) { mocktype = strutil::Trim(mock_parts[1]); break; } } } } return mocktype; } private: const string name_; tInput sample_input_; }; // server message class tMessageBase { public: virtual ~tMessageBase() {} virtual bool FromBinary(const string &s) = 0; virtual bool FromJSON(const string &s, string *err) = 0; virtual string ToBinary() =0; virtual string ToJSON(int indent = 0) = 0; }; template <class T> class tMessage : public T, public tMessageBase { public: virtual ~tMessage<T>(){} virtual bool FromBinary(const string &s) override { return serial::Serializer::FromBinary(s, this); } virtual bool FromJSON(const string &s, string *err) override { return serial::Serializer::FromJSON(s, this, {err}); } virtual string ToJSON(int indent = 0) override { return serial::Serializer::ToJSON(static_cast<T*>(this), {indent}); } virtual string ToBinary() override { return serial::Serializer::ToBinary(static_cast<T*>(this)); } }; // new server method class tServerMethodBase { public: virtual ~tServerMethodBase(){} virtual tMessageBase* CreateRequest() const =0; virtual tMessageBase* CreateResponse() const =0; virtual string FillRequest(const tConnectionInfo& connection, const tServerRequestMessage& reqMsg, tMessageBase* request) const =0; virtual string operator()(const tMessageBase& request, tMessageBase* response, vector<string>* outCookies) const =0; virtual string ExampleJSON() const =0; virtual ServerMethodStatus Validate(const tMessageBase& request, ostream& out) const =0; virtual bool CanRecord(const tMessageBase& request) const =0; }; template <class Req, class Res> class tServerMethod : public tServerMethodBase{ public: typedef tMessage<Req> Request; typedef tMessage<Res> Response; virtual ~tServerMethod<Req, Res>(){} // request & response factory virtual tMessageBase* CreateRequest() const override {return new Request;} virtual tMessageBase* CreateResponse() const override { return new Response;} // store connection specific data in the request. e.g. country user is coming from virtual string FillRequest(const tConnectionInfo& connection, const tServerRequestMessage& reqMsg, Req* request) const { return ""; } virtual string FillRequest(const tConnectionInfo& connection, const tServerRequestMessage& reqMsg, tMessageBase* request) const override { Req* req = dynamic_cast<Request*>(request); return FillRequest(connection, reqMsg, req); } // actual server call virtual string operator()(const Req& request, Res* res, vector<string>* outCookie) const =0; virtual string operator()(const tMessageBase& request, tMessageBase* response, vector<string>* outCookies) const override { const Req& req = dynamic_cast<const Request&>(request); Response* res = dynamic_cast<Response*>(response); return operator()(req, res, outCookies); } // sample request virtual void Example(Req* req) const {} virtual string ExampleJSON() const override { Request req; Example(&req); return req.ToJSON(2); } // Function to run the validator for the server method. virtual ServerMethodStatus Validate(const Req &req, ostream& out) const{ out << "Not implemented yet!" << endl; return kServerMethodStatusNotImplemented; } virtual ServerMethodStatus Validate(const tMessageBase& request, ostream& out) const override { const Req& req = dynamic_cast<const Request&>(request); return Validate(req, out); } // Returns true if a server method does not contain sensitive data and // live traffic to it can be recorded. virtual bool CanRecord(const Req &req) const { return true; } virtual bool CanRecord(const tMessageBase& request) const override { const Req& req = dynamic_cast<const Request&>(request); return CanRecord(req); } }; // new server method handler class ServerMethodHandler2 : public ServerMethodHandlerBase { public: ServerMethodHandler2(shared_ptr<tServerMethodBase> m) : ServerMethod(m) {} virtual void ProcessRPC(const tConnectionInfo* connection, const tServerRequestMessage& reqMsg, tServerReplyMessage* response) const override; virtual void ProcessJSON(const tConnectionInfo* connection, const tServerRequestMessage& request, bool debug_json, tServerReplyMessage* response) const override; virtual string RPCToJSON(const string& message, int indent = 0) const override; virtual string GetSampleInput_JSON() const override; virtual ServerMethodStatus Validate(const tConnectionInfo* connection, const tServerRequestMessage& request, ostream& out) const override; virtual bool CanRecord() const override {return true; }; virtual bool AllowEmptyRequest() const override { return false; } virtual string ProcessCascade(const void *caller, const void *input, void *output) const override { return ""; } private: shared_ptr<tServerMethodBase> ServerMethod; }; // Collection of all the server methods for a particular server. // We assume all server methods will be registered before the server is started // and no new ones would be added after that. This allows us to do all gets // on method handlers without locking the mutex. In case this changes in the // future, we will have to modify the code accordingly. class ServerMethodHandlerCollection : public Factory<ServerMethodHandlerCollection> { public: typedef unordered_map<string, shared_ptr<ServerMethodHandlerBase>, ::hash::string_casefold_hash, ::hash::string_casefold_eq> HandlerMap; ServerMethodHandlerCollection() {} ServerMethodHandlerCollection(const ServerMethodHandlerCollection& collection) { AddCollection(collection); } // Returns the proxy for the method collection for the given server. static shared_proxy GetCollectionForServer(const string& server_name) { shared_proxy proxy = make_shared(server_name); if (proxy == nullptr) { bind(server_name, [] { return new ServerMethodHandlerCollection(); }); proxy = make_shared(server_name); } ASSERT_NOTNULL(proxy) << "Could not get collection for server " << server_name; return proxy; } // @return look across all methods and return the server handler if the method // name is found. if not found, return nullptr static ServerMethodHandlerBase* GetMethod(const string& method_name) { struct Initialize { shared_ptr<ServerMethodHandlerCollection> operator()() { vector<string> keys; Factory<ServerMethodHandlerCollection>::append_keys(keys); shared_ptr<ServerMethodHandlerCollection> method_collection(new ServerMethodHandlerCollection); for (auto& key : keys) { method_collection->AddCollection(*GetCollectionForServer(key)); } return method_collection; } }; static shared_ptr<ServerMethodHandlerCollection> all_methods = Initialize()(); ServerMethodHandlerBase *server_method = all_methods->GetHandler(method_name); // can be nullptr return server_method; } // template with 3 parameters: // - input type // - output type // - RPC function (with operator() that takes "const tInput&" and "tOutput *" // and returns 0 (for success) or non-zero error code) template<class tInput, class tOutput, class tFunc> void Register(const string& name, const tInput& sample_input) const { // sanity checks ASSERT(name.size() > 0) << "opname cannot be empty."; ASSERT(name.find(' ') == string::npos) << "opname cannot contain space characters."; ASSERT(name != "GET") << "opname cannot be 'GET'."; ASSERT(name != "POST") << "opname cannot be 'POST'."; ASSERT(name != "URL") << "opname cannot be 'URL'."; ASSERT(name != "URL") << "opname cannot be 'URL'."; ASSERT(name[0] != '_') << "opname cannot start with '_'."; lock_guard<std::mutex> l(mutex_); // Check for duplicates. ASSERT(handlers_.find(name) == handlers_.end()) << "Duplicate handler op-name: " << name; LOG(INFO) << "Registering method: " << name; handlers_[name] = shared_ptr<ServerMethodHandlerBase>( new ServerMethodHandler<tInput, tOutput, tFunc>(name, sample_input)); } void Register(const string& name, shared_ptr<tServerMethodBase> method) const { // sanity checks ASSERT(name.size() > 0) << "opname cannot be empty."; ASSERT(name.find(' ') == string::npos) << "opname cannot contain space characters."; ASSERT(name != "GET") << "opname cannot be 'GET'."; ASSERT(name != "POST") << "opname cannot be 'POST'."; ASSERT(name != "URL") << "opname cannot be 'URL'."; ASSERT(name != "URL") << "opname cannot be 'URL'."; ASSERT(name[0] != '_') << "opname cannot start with '_'."; lock_guard<std::mutex> l(mutex_); // Check for duplicates. ASSERT(handlers_.find(name) == handlers_.end()) << "Duplicate handler op-name: " << name; LOG(INFO) << "Registering method: " << name; handlers_[name] = shared_ptr<ServerMethodHandlerBase>( new ServerMethodHandler2(method)); } // Returns the handler for the input method name. ServerMethodHandlerBase* GetHandler(const string& name) const { const auto iter = handlers_.find(name); if (iter != handlers_.end()) return iter->second.get(); return nullptr; } // Returns the registered name and the handler for the input method name. pair<string, ServerMethodHandlerBase*> GetHandlerAndName( const string& name) const { const auto iter = handlers_.find(name); if (iter != handlers_.end()) return {iter->first, iter->second.get()}; return {name, nullptr}; } const HandlerMap& handlers() const { return handlers_; } int size() const { return handlers_.size(); } bool empty() const { return handlers_.empty(); } // Returns the method names. template<typename C> C MethodNames() const { C names; for (const auto& p : handlers_) names.insert(names.end(), p.first); return names; } // Adds the given collection to the current collection. void AddCollection(const ServerMethodHandlerCollection& collection) { for (const auto& p : collection.handlers_) handlers_.insert(p); } private: mutable HandlerMap handlers_; mutable std::mutex mutex_; }; // Structure to register a new server method with the given servers. // A single method can be registered with multiple servers by providing // Comma separated list of server names. template<class tInput, class tOutput, class tFunc> struct ServerMethodRegister { ServerMethodRegister(const string& server_names, const string& method_name, const tInput& sample_input) { vector<string> servers; ASSERT(strutil::SplitString(server_names, ",", &servers)); for (const string& server_name : servers) { VLOG(3) << __PRETTY_FUNCTION__ << " S: " << server_name << ", M: " << method_name; ServerMethodHandlerCollection::shared_proxy proxy = ServerMethodHandlerCollection::GetCollectionForServer(server_name); proxy->Register<tInput, tOutput, tFunc>(method_name, sample_input); // Pin this proxy to ensure it is never destroyed. ServerMethodHandlerCollection::pin(proxy); } } }; template <class T> struct tServerMethodRegister { tServerMethodRegister(const string& server_names, const string& method_name) { vector<string> servers; ASSERT(strutil::SplitString(server_names, ",", &servers)); shared_ptr<tServerMethodBase> method(new T); for (const string& server_name : servers) { VLOG(3) << __PRETTY_FUNCTION__ << " S: " << server_name << ", M: " << method_name; ServerMethodHandlerCollection::shared_proxy proxy = ServerMethodHandlerCollection::GetCollectionForServer(server_name); proxy->Register(method_name, method); // Pin this proxy to ensure it is never destroyed. ServerMethodHandlerCollection::pin(proxy); } } }; } // namespace network #endif // _PUBLIC_UTIL_NETWORK_METHOD_SERVER_METHOD_HANDLER_H_
37.804444
140
0.677679
[ "vector" ]
aae0cd09c2b8927126504f912f69fa76811a8e70
59,226
c
C
usr/src/uts/common/io/fd.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/uts/common/io/fd.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/uts/common/io/fd.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
1
2020-12-30T00:04:16.000Z
2020-12-30T00:04:16.000Z
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* * Copyright (c) 2018, Joyent, Inc. */ /* * Floppy Disk driver */ /* * Set CMOS feature: * CMOS_CONF_MEM: CMOS memory contains configuration info */ #define CMOS_CONF_MEM #include <sys/types.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/buf.h> #include <sys/file.h> #include <sys/open.h> #include <sys/ioctl.h> #include <sys/uio.h> #include <sys/conf.h> #include <sys/stat.h> #include <sys/autoconf.h> #include <sys/vtoc.h> #include <sys/dkio.h> #include <sys/ddi.h> #include <sys/sunddi.h> #include <sys/kstat.h> #include <sys/kmem.h> #include <sys/ddidmareq.h> #include <sys/fdio.h> #include <sys/fdc.h> #include <sys/fd_debug.h> #include <sys/fdmedia.h> #include <sys/debug.h> #include <sys/modctl.h> /* * Local Function Prototypes */ static int fd_unit_is_open(struct fdisk *); static int fdgetlabel(struct fcu_obj *, int); static void fdstart(struct fcu_obj *); static int fd_build_label_vtoc(struct fcu_obj *, struct fdisk *, struct vtoc *, struct dk_label *); static void fd_build_user_vtoc(struct fcu_obj *, struct fdisk *, struct vtoc *); static int fd_rawioctl(struct fcu_obj *, int, caddr_t, int); static void fd_media_watch(void *); static int fd_open(dev_t *, int, int, cred_t *); static int fd_close(dev_t, int, int, cred_t *); static int fd_strategy(struct buf *); static int fd_read(dev_t, struct uio *, cred_t *); static int fd_write(dev_t, struct uio *, cred_t *); static int fd_ioctl(dev_t, int, intptr_t, int, cred_t *, int *); static int fd_prop_op(dev_t, dev_info_t *, ddi_prop_op_t, int, char *, caddr_t, int *); static int fd_check_media(dev_t dev, enum dkio_state state); static int fd_get_media_info(struct fcu_obj *fjp, caddr_t buf, int flag); static struct cb_ops fd_cb_ops = { fd_open, /* open */ fd_close, /* close */ fd_strategy, /* strategy */ nodev, /* print */ nodev, /* dump */ fd_read, /* read */ fd_write, /* write */ fd_ioctl, /* ioctl */ nodev, /* devmap */ nodev, /* mmap */ nodev, /* segmap */ nochpoll, /* poll */ fd_prop_op, /* cb_prop_op */ 0, /* streamtab */ D_NEW | D_MP /* Driver compatibility flag */ }; static int fd_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); static int fd_probe(dev_info_t *); static int fd_attach(dev_info_t *, ddi_attach_cmd_t); static int fd_detach(dev_info_t *, ddi_detach_cmd_t); static struct dev_ops fd_ops = { DEVO_REV, /* devo_rev, */ 0, /* refcnt */ fd_getinfo, /* getinfo */ nulldev, /* identify */ fd_probe, /* probe */ fd_attach, /* attach */ fd_detach, /* detach */ nodev, /* reset */ &fd_cb_ops, /* driver operations */ (struct bus_ops *)0, /* bus operations */ NULL, /* power */ ddi_quiesce_not_supported, /* devo_quiesce */ }; /* * static data */ static void *fd_state_head; /* opaque handle top of state structs */ static int fd_check_media_time = 5000000; /* 5 second state check */ /* * error handling * * for debugging, * set fderrlevel to 1 * set fderrmask to 224 or 644 */ #ifdef DEBUG static uint_t fderrmask = FDEM_ALL; #endif static int fderrlevel = 5; #define KIOSP KSTAT_IO_PTR(fdp->d_iostat) static struct driver_minor_data { char *name; int minor; int type; } fd_minor [] = { { "a", 0, S_IFBLK}, { "b", 1, S_IFBLK}, { "c", 2, S_IFBLK}, { "a,raw", 0, S_IFCHR}, { "b,raw", 1, S_IFCHR}, { "c,raw", 2, S_IFCHR}, {0} }; static struct modldrv modldrv = { &mod_driverops, /* Type of module. This one is a driver */ "Floppy Disk driver", /* Name of the module. */ &fd_ops, /* driver ops */ }; static struct modlinkage modlinkage = { MODREV_1, (void *)&modldrv, NULL }; int _init(void) { int retval; if ((retval = ddi_soft_state_init(&fd_state_head, sizeof (struct fdisk) + sizeof (struct fd_drive) + sizeof (struct fd_char) + sizeof (struct fdattr), 0)) != 0) return (retval); if ((retval = mod_install(&modlinkage)) != 0) ddi_soft_state_fini(&fd_state_head); return (retval); } int _fini(void) { int retval; if ((retval = mod_remove(&modlinkage)) != 0) return (retval); ddi_soft_state_fini(&fd_state_head); return (retval); } int _info(struct modinfo *modinfop) { return (mod_info(&modlinkage, modinfop)); } static int fd_getdrive(dev_t dev, struct fcu_obj **fjpp, struct fdisk **fdpp) { if (fdpp) { *fdpp = ddi_get_soft_state(fd_state_head, DRIVE(dev)); if (*fdpp && fjpp) { *fjpp = (*fdpp)->d_obj; if (*fjpp) return ((*fjpp)->fj_unit); } } return (-1); } /*ARGSUSED*/ static int fd_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **result) { dev_t dev = (dev_t)arg; struct fcu_obj *fjp = NULL; struct fdisk *fdp = NULL; int rval; switch (cmd) { case DDI_INFO_DEVT2DEVINFO: (void) fd_getdrive(dev, &fjp, &fdp); /* * Ignoring return value because success is checked by * verifying fjp and fdp and returned unit value is not used. */ if (fjp && fdp) { *result = fjp->fj_dip; rval = DDI_SUCCESS; } else rval = DDI_FAILURE; break; case DDI_INFO_DEVT2INSTANCE: *result = (void *)(uintptr_t)DRIVE(dev); rval = DDI_SUCCESS; break; default: rval = DDI_FAILURE; } return (rval); } #ifdef CMOS_CONF_MEM #define CMOS_ADDR 0x70 #define CMOS_DATA 0x71 #define CMOS_FDRV 0x10 #endif /* CMOS_CONF_MEM */ static int fd_probe(dev_info_t *dip) { #ifdef CMOS_CONF_MEM int cmos; int drive_type; #endif /* CMOS_CONF_MEM */ int debug[2]; int drive_size; int len; int unit_num; char density[8]; len = sizeof (debug); if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF, DDI_PROP_DONTPASS, "debug", (caddr_t)debug, &len) == DDI_PROP_SUCCESS) { fderrlevel = debug[0]; #ifdef DEBUG fderrmask = (uint_t)debug[1]; #endif } len = sizeof (unit_num); if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF, DDI_PROP_DONTPASS, "unit", (caddr_t)&unit_num, &len) != DDI_PROP_SUCCESS) { FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_probe failed: dip %p", (void *)dip)); return (DDI_PROBE_FAILURE); } #ifdef CMOS_CONF_MEM /* get the cmos memory values quick and dirty */ outb(CMOS_ADDR, CMOS_FDRV); cmos = drive_type = (int)inb(CMOS_DATA); #endif /* CMOS_CONF_MEM */ switch (unit_num) { #ifdef CMOS_CONF_MEM case 0: drive_type = drive_type >> 4; /* FALLTHROUGH */ case 1: if (cmos && (drive_type & 0x0F)) { break; } /* * Some enhanced floppy-disk controller adaptor cards * require NO drives defined in the CMOS configuration * memory. * So fall through */ #endif /* CMOS_CONF_MEM */ /* FALLTHROUGH */ default: /* need to check conf file */ len = sizeof (density); if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF, DDI_PROP_DONTPASS, "density", (caddr_t)&density, &len) != DDI_PROP_SUCCESS) { FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_probe failed density: dip %p unit %d", (void *)dip, unit_num)); return (DDI_PROBE_FAILURE); } len = sizeof (drive_size); if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF, DDI_PROP_DONTPASS, "size", (caddr_t)&drive_size, &len) != DDI_PROP_SUCCESS) { FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_probe failed size: dip %p unit %d", (void *)dip, unit_num)); return (DDI_PROBE_FAILURE); } } FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_probe dip %p unit %d", (void *)dip, unit_num)); return (DDI_PROBE_SUCCESS); } /* ARGSUSED */ static int fd_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) { struct fcu_obj *fjp; struct fdisk *fdp; struct driver_minor_data *dmdp; int mode_3D; int drive_num, drive_size, drive_type; #ifdef CMOS_CONF_MEM int cmos; #endif /* CMOS_CONF_MEM */ int len, sig_minor; int unit_num; char density[8]; char name[MAXNAMELEN]; switch (cmd) { case DDI_ATTACH: len = sizeof (unit_num); if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF, DDI_PROP_DONTPASS, "unit", (caddr_t)&unit_num, &len) != DDI_PROP_SUCCESS) { FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_attach failed: dip %p", (void *)dip)); return (DDI_FAILURE); } #ifdef CMOS_CONF_MEM outb(CMOS_ADDR, CMOS_FDRV); cmos = drive_type = (int)inb(CMOS_DATA); #endif /* CMOS_CONF_MEM */ switch (unit_num) { #ifdef CMOS_CONF_MEM case 0: drive_type = drive_type >> 4; /* FALLTHROUGH */ case 1: drive_type = drive_type & 0x0F; if (cmos) break; /* * Some enhanced floppy-disk controller adaptor cards * require NO drives defined in the CMOS configuration * memory. * So fall through */ #endif /* CMOS_CONF_MEM */ /* FALLTHROUGH */ default: /* need to check .conf file */ drive_type = 0; len = sizeof (density); if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF, DDI_PROP_DONTPASS, "density", (caddr_t)&density, &len) != DDI_PROP_SUCCESS) density[0] = '\0'; len = sizeof (drive_size); if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF, DDI_PROP_DONTPASS, "size", (caddr_t)&drive_size, &len) != DDI_PROP_SUCCESS) drive_size = 0; if (strcmp(density, "DSDD") == 0) { if (drive_size == 5) drive_type = 1; else if (drive_size == 3) drive_type = 3; } else if (strcmp(density, "DSHD") == 0) { if (drive_size == 5) drive_type = 2; else if (drive_size == 3) drive_type = 4; } else if (strcmp(density, "DSED") == 0 && drive_size == 3) { drive_type = 6; } break; } if (drive_type == 0) { FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_attach failed type: dip %p unit %d", (void *)dip, unit_num)); return (DDI_FAILURE); } drive_num = ddi_get_instance(dip); if (ddi_soft_state_zalloc(fd_state_head, drive_num) != 0) return (DDI_FAILURE); fdp = ddi_get_soft_state(fd_state_head, drive_num); fjp = fdp->d_obj = ddi_get_driver_private(dip); mutex_init(&fjp->fj_lock, NULL, MUTEX_DRIVER, *fjp->fj_iblock); sema_init(&fdp->d_ocsem, 1, NULL, SEMA_DRIVER, NULL); fjp->fj_drive = (struct fd_drive *)(fdp + 1); fjp->fj_chars = (struct fd_char *)(fjp->fj_drive + 1); fjp->fj_attr = (struct fdattr *)(fjp->fj_chars + 1); /* * set default floppy drive characteristics & geometry */ switch (drive_type) { /* assume doubled sided */ case 2: /* 5.25 high density */ *fjp->fj_drive = dfd_525HD; fdp->d_media = 1<<FMT_5H | 1<<FMT_5D9 | 1<<FMT_5D8 | 1<<FMT_5D4 | 1<<FMT_5D16; fdp->d_deffdtype = fdp->d_curfdtype = FMT_5H; break; case 4: /* 3.5 high density */ *fjp->fj_drive = dfd_350HD; fdp->d_media = 1<<FMT_3H | 1<<FMT_3I | 1<<FMT_3D; len = sizeof (mode_3D); if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF, DDI_PROP_DONTPASS, "mode_3D", (caddr_t)&mode_3D, &len) != DDI_PROP_SUCCESS) mode_3D = 0; if (mode_3D && (fjp->fj_fdc->c_flags & FCFLG_3DMODE)) /* * 3D mode should be enabled only if a dual- * speed 3.5" high-density drive and a * supported floppy controller are installed. */ fdp->d_media |= 1 << FMT_3M; fdp->d_deffdtype = fdp->d_curfdtype = FMT_3H; break; case 1: /* 5.25 double density */ *fjp->fj_drive = dfd_525DD; fdp->d_media = 1<<FMT_5D9 | 1<<FMT_5D8 | 1<<FMT_5D4 | 1<<FMT_5D16; fdp->d_deffdtype = fdp->d_curfdtype = FMT_5D9; break; case 3: /* 3.5 double density */ *fjp->fj_drive = dfd_350HD; fdp->d_media = 1<<FMT_3D; fdp->d_deffdtype = fdp->d_curfdtype = FMT_3D; break; case 5: /* 3.5 extended density */ case 6: case 7: *fjp->fj_drive = dfd_350ED; fdp->d_media = 1<<FMT_3E | 1<<FMT_3H | 1<<FMT_3I | 1<<FMT_3D; fdp->d_deffdtype = fdp->d_curfdtype = FMT_3E; break; case 0: /* no drive defined */ default: goto no_attach; } *fjp->fj_chars = *defchar[fdp->d_deffdtype]; *fjp->fj_attr = fdtypes[fdp->d_deffdtype]; bcopy(fdparts[fdp->d_deffdtype], fdp->d_part, sizeof (struct partition) * NDKMAP); fjp->fj_rotspd = fdtypes[fdp->d_deffdtype].fda_rotatespd; sig_minor = drive_num << 3; for (dmdp = fd_minor; dmdp->name != NULL; dmdp++) { if (ddi_create_minor_node(dip, dmdp->name, dmdp->type, sig_minor | dmdp->minor, DDI_NT_FD, 0) == DDI_FAILURE) { ddi_remove_minor_node(dip, NULL); goto no_attach; } } FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_attach: dip %p unit %d", (void *)dip, unit_num)); (void) sprintf(name, "fd%d", drive_num); fdp->d_iostat = kstat_create("fd", drive_num, name, "disk", KSTAT_TYPE_IO, 1, KSTAT_FLAG_PERSISTENT); if (fdp->d_iostat) { fdp->d_iostat->ks_lock = &fjp->fj_lock; kstat_install(fdp->d_iostat); } fjp->fj_data = (caddr_t)fdp; fjp->fj_flags |= FUNIT_DRVATCH; /* * Add a zero-length attribute to tell the world we support * kernel ioctls (for layered drivers) */ (void) ddi_prop_create(DDI_DEV_T_NONE, dip, DDI_PROP_CANSLEEP, DDI_KERNEL_IOCTL, NULL, 0); /* * We want to get suspend/resume events, so that we can * refuse to suspend when pcfs is mounted. */ (void) ddi_prop_update_string(DDI_DEV_T_NONE, dip, "pm-hardware-state", "needs-suspend-resume"); /* * Ignoring return value because, for passed arguments, only * DDI_SUCCESS is returned. */ ddi_report_dev(dip); return (DDI_SUCCESS); case DDI_RESUME: /* nothing for us to do */ return (DDI_SUCCESS); default: return (DDI_FAILURE); } no_attach: fjp->fj_drive = NULL; fjp->fj_chars = NULL; fjp->fj_attr = NULL; mutex_destroy(&fjp->fj_lock); sema_destroy(&fdp->d_ocsem); ddi_soft_state_free(fd_state_head, drive_num); FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_attach failed: dip %p unit %d", (void *)dip, unit_num)); return (DDI_FAILURE); } /* ARGSUSED */ static int fd_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { struct fcu_obj *fjp; struct fdisk *fdp; int drive_num; int rval = DDI_SUCCESS; FDERRPRINT(FDEP_L3, FDEM_ATTA, (CE_WARN, "fd_detach dip %p", (void *)dip)); drive_num = ddi_get_instance(dip); if (!(fdp = ddi_get_soft_state(fd_state_head, drive_num))) return (rval); switch (cmd) { case DDI_DETACH: if (fd_unit_is_open(fdp)) { rval = DDI_FAILURE; break; } kstat_delete(fdp->d_iostat); fdp->d_iostat = NULL; fjp = (struct fcu_obj *)fdp->d_obj; fjp->fj_flags &= ~FUNIT_DRVATCH; fjp->fj_data = NULL; fjp->fj_drive = NULL; fjp->fj_chars = NULL; fjp->fj_attr = NULL; ddi_prop_remove_all(dip); mutex_destroy(&fjp->fj_lock); sema_destroy(&fdp->d_ocsem); ddi_soft_state_free(fd_state_head, drive_num); break; case DDI_SUSPEND: /* * Bad, bad, bad things will happen if someone * *changes* the disk in the drive while it is mounted * and the system is suspended. We have no way to * detect that. (Undetected filesystem corruption. * Its akin to changing the boot disk while the system * is suspended. Don't do it!) * * So we refuse to suspend if there is a mounted filesystem. * (We guess this by looking for a block open. Character * opens are fine.) This limits some of the usability of * suspend/resume, but it certainly avoids this * potential filesystem corruption from pilot error. * Given the decreasing popularity of floppy media, we * don't see this as much of a limitation. */ if (fdp->d_regopen[OTYP_BLK]) { cmn_err(CE_NOTE, "Unable to suspend while floppy is in use."); rval = DDI_FAILURE; } break; default: rval = DDI_FAILURE; break; } return (rval); } static int fd_part_is_open(struct fdisk *fdp, int part) { int i; for (i = 0; i < (OTYPCNT - 1); i++) if (fdp->d_regopen[i] & (1 << part)) return (1); return (0); } static int fd_unit_is_open(struct fdisk *fdp) { int i; for (i = 0; i < NDKMAP; i++) if (fdp->d_lyropen[i]) return (1); for (i = 0; i < (OTYPCNT - 1); i++) if (fdp->d_regopen[i]) return (1); return (0); } /*ARGSUSED*/ static int fd_open(dev_t *devp, int flag, int otyp, cred_t *cred_p) { struct fcu_obj *fjp = NULL; struct fdisk *fdp = NULL; struct partition *pp; dev_t dev; int part, unit; int part_is_open; int rval; uint_t pbit; dev = *devp; unit = fd_getdrive(dev, &fjp, &fdp); if (!fjp || !fdp) return (ENXIO); part = PARTITION(dev); pbit = 1 << part; pp = &fdp->d_part[part]; /* * Serialize opens/closes */ sema_p(&fdp->d_ocsem); FDERRPRINT(FDEP_L1, FDEM_OPEN, (CE_CONT, "fd_open: fd%d part %d flag %x otype %x\n", DRIVE(dev), part, flag, otyp)); /* * Check for previous exclusive open, or trying to exclusive open * An "exclusive open" on any partition is not guaranteed to * protect against opens on another partition that overlaps it. */ if (otyp == OTYP_LYR) { part_is_open = (fdp->d_lyropen[part] != 0); } else { part_is_open = fd_part_is_open(fdp, part); } if ((fdp->d_exclmask & pbit) || ((flag & FEXCL) && part_is_open)) { FDERRPRINT(FDEP_L0, FDEM_OPEN, (CE_CONT, "fd_open: exclparts %lx openparts %lx lyrcnt %lx pbit %x\n", fdp->d_exclmask, fdp->d_regopen[otyp], fdp->d_lyropen[part], pbit)); sema_v(&fdp->d_ocsem); return (EBUSY); } /* * Ensure that drive is recalibrated on first open of new diskette. */ fjp->fj_ops->fco_select(fjp, unit, 1); if (fjp->fj_ops->fco_getchng(fjp, unit) != 0) { if (fjp->fj_ops->fco_rcseek(fjp, unit, -1, 0)) { FDERRPRINT(FDEP_L2, FDEM_OPEN, (CE_NOTE, "fd_open fd%d: not ready", DRIVE(dev))); fjp->fj_ops->fco_select(fjp, unit, 0); sema_v(&fdp->d_ocsem); return (ENXIO); } fjp->fj_flags &= ~(FUNIT_LABELOK | FUNIT_UNLABELED); } if (flag & (FNDELAY | FNONBLOCK)) { /* don't attempt access, just return successfully */ fjp->fj_ops->fco_select(fjp, unit, 0); goto out; } /* * auto-sense the density/format of the diskette */ rval = fdgetlabel(fjp, unit); fjp->fj_ops->fco_select(fjp, unit, 0); if (rval) { /* didn't find label (couldn't read anything) */ FDERRPRINT(FDEP_L2, FDEM_OPEN, (CE_NOTE, "fd%d: drive not ready", DRIVE(dev))); sema_v(&fdp->d_ocsem); return (EIO); } /* check partition */ if (pp->p_size == 0) { sema_v(&fdp->d_ocsem); return (ENXIO); } /* * if opening for writing, check write protect on diskette */ if ((flag & FWRITE) && (fdp->d_obj->fj_flags & FUNIT_WPROT)) { sema_v(&fdp->d_ocsem); return (EROFS); } out: /* * mark open as having succeeded */ if (flag & FEXCL) fdp->d_exclmask |= pbit; if (otyp == OTYP_LYR) fdp->d_lyropen[part]++; else fdp->d_regopen[otyp] |= 1 << part; sema_v(&fdp->d_ocsem); return (0); } /* * fdgetlabel - read the SunOS label off the diskette * if it can read a valid label it does so, else it will use a * default. If it can`t read the diskette - that is an error. * * RETURNS: 0 for ok - meaning that it could at least read the device, * !0 for error XXX TBD NYD error codes */ static int fdgetlabel(struct fcu_obj *fjp, int unit) { struct dk_label *label; struct fdisk *fdp; char *newlabel; short *sp; short count; short xsum; int tries, try_this; uint_t nexttype; int rval; short oldlvl; int i; FDERRPRINT(FDEP_L0, FDEM_GETL, (CE_CONT, "fdgetlabel fd unit %d\n", unit)); fdp = (struct fdisk *)fjp->fj_data; fjp->fj_flags &= ~(FUNIT_UNLABELED); /* * get some space to play with the label */ label = kmem_zalloc(sizeof (struct dk_label), KM_SLEEP); FDERRPRINT(FDEP_L0, FDEM_GETL, (CE_CONT, "fdgetlabel fd unit %d kmem_zalloc: ptr = %p, size = %lx\n", unit, (void *)label, (size_t)sizeof (struct dk_label))); /* * read block 0 (0/0/1) to find the label * (disk is potentially not present or unformatted) */ /* noerrprint since this is a private cmd */ oldlvl = fderrlevel; fderrlevel = FDEP_LMAX; /* * try different characteristics (ie densities) * * if fdp->d_curfdtype is -1 then the current characteristics * were set by ioctl and need to try it as well as everything * in the table */ nexttype = fdp->d_deffdtype; try_this = 1; /* always try the current characteristics */ rval = ENXIO; for (tries = nfdtypes; tries; tries--) { if (try_this) { fjp->fj_flags &= ~FUNIT_CHAROK; /* try reading last sector of cyl 1, head 0 */ if (!(rval = fjp->fj_ops->fco_rw(fjp, unit, FDREAD, 1, 0, fjp->fj_chars->fdc_secptrack, (caddr_t)label, sizeof (struct dk_label))) && /* and last sector plus 1 of cylinder 1 */ fjp->fj_ops->fco_rw(fjp, unit, FDREAD, 1, 0, fjp->fj_chars->fdc_secptrack + 1, (caddr_t)label, sizeof (struct dk_label)) && /* and label sector on cylinder 0 */ !(rval = fjp->fj_ops->fco_rw(fjp, unit, FDREAD, 0, 0, 1, (caddr_t)label, sizeof (struct dk_label)))) break; if (rval == ENXIO) break; } /* * try the next entry in the characteristics tbl */ fdp->d_curfdtype = (signed char)nexttype; nexttype = (nexttype + 1) % nfdtypes; if ((1 << fdp->d_curfdtype) & fdp->d_media) { *fjp->fj_chars = *defchar[fdp->d_curfdtype]; *fjp->fj_attr = fdtypes[fdp->d_curfdtype]; bcopy(fdparts[fdp->d_curfdtype], fdp->d_part, sizeof (struct partition) * NDKMAP); /* * check for a double_density diskette * in a high_density 5.25" drive */ if (fjp->fj_chars->fdc_transfer_rate == 250 && fjp->fj_rotspd > fjp->fj_attr->fda_rotatespd) { /* * yes - adjust transfer rate since we don't * know if we have a 5.25" dual-speed drive */ fjp->fj_attr->fda_rotatespd = 360; fjp->fj_chars->fdc_transfer_rate = 300; fjp->fj_chars->fdc_medium = 5; } if ((2 * fjp->fj_chars->fdc_ncyl) == defchar[fdp->d_deffdtype]->fdc_ncyl) { /* yes - adjust steps per cylinder */ fjp->fj_chars->fdc_steps = 2; } else fjp->fj_chars->fdc_steps = 1; try_this = 1; } else try_this = 0; } fderrlevel = oldlvl; /* print errors again */ if (rval) { fdp->d_curfdtype = fdp->d_deffdtype; goto out; /* couldn't read anything */ } FDERRPRINT(FDEP_L0, FDEM_GETL, (CE_CONT, "fdgetlabel fd unit=%d ncyl=%d nsct=%d step=%d rpm=%d intlv=%d\n", unit, fjp->fj_chars->fdc_ncyl, fjp->fj_chars->fdc_secptrack, fjp->fj_chars->fdc_steps, fjp->fj_attr->fda_rotatespd, fjp->fj_attr->fda_intrlv)); /* * _something_ was read - look for unixtype label */ if (label->dkl_magic != DKL_MAGIC || label->dkl_vtoc.v_sanity != VTOC_SANE) { /* not a label - no magic number */ goto nolabel; /* no errors, but no label */ } count = sizeof (struct dk_label) / sizeof (short); sp = (short *)label; xsum = 0; while (count--) xsum ^= *sp++; /* should add up to 0 */ if (xsum) { /* not a label - checksum didn't compute */ goto nolabel; /* no errors, but no label */ } /* * the SunOS label overrides current diskette characteristics */ fjp->fj_chars->fdc_ncyl = label->dkl_pcyl; fjp->fj_chars->fdc_nhead = label->dkl_nhead; fjp->fj_chars->fdc_secptrack = (label->dkl_nsect * DEV_BSIZE) / fjp->fj_chars->fdc_sec_size; if (defchar[fdp->d_deffdtype]->fdc_ncyl == 2 * fjp->fj_chars->fdc_ncyl) fjp->fj_chars->fdc_steps = 2; else fjp->fj_chars->fdc_steps = 1; fjp->fj_attr->fda_rotatespd = label->dkl_rpm; fjp->fj_attr->fda_intrlv = label->dkl_intrlv; fdp->d_vtoc_version = label->dkl_vtoc.v_version; bcopy(label->dkl_vtoc.v_volume, fdp->d_vtoc_volume, LEN_DKL_VVOL); bcopy(label->dkl_vtoc.v_asciilabel, fdp->d_vtoc_asciilabel, LEN_DKL_ASCII); /* * logical partitions */ for (i = 0; i < NDKMAP; i++) { fdp->d_part[i].p_tag = label->dkl_vtoc.v_part[i].p_tag; fdp->d_part[i].p_flag = label->dkl_vtoc.v_part[i].p_flag; fdp->d_part[i].p_start = label->dkl_vtoc.v_part[i].p_start; fdp->d_part[i].p_size = label->dkl_vtoc.v_part[i].p_size; fdp->d_vtoc_timestamp[i] = label->dkl_vtoc.timestamp[i]; } fjp->fj_flags |= FUNIT_LABELOK; goto out; nolabel: /* * if not found, fill in label info from default (mark default used) */ if (fdp->d_media & (1<<FMT_3D)) newlabel = deflabel_35; else /* if (fdp->d_media & (1<<FMT_5D9)) */ newlabel = deflabel_525; bzero(fdp->d_vtoc_volume, LEN_DKL_VVOL); (void) sprintf(fdp->d_vtoc_asciilabel, newlabel, fjp->fj_chars->fdc_ncyl, fjp->fj_chars->fdc_nhead, fjp->fj_chars->fdc_secptrack); fjp->fj_flags |= FUNIT_UNLABELED; out: kmem_free(label, sizeof (struct dk_label)); return (rval); } /*ARGSUSED*/ static int fd_close(dev_t dev, int flag, int otyp, cred_t *cred_p) { struct fcu_obj *fjp = NULL; struct fdisk *fdp = NULL; int part, part_is_closed; #ifdef DEBUG int unit; #define DEBUG_ASSIGN unit= #else #define DEBUG_ASSIGN (void) #endif DEBUG_ASSIGN fd_getdrive(dev, &fjp, &fdp); /* * Ignoring return in non DEBUG mode because success is checked by * verifying fjp and fdp and returned unit value is not used. */ if (!fjp || !fdp) return (ENXIO); part = PARTITION(dev); sema_p(&fdp->d_ocsem); FDERRPRINT(FDEP_L1, FDEM_CLOS, (CE_CONT, "fd_close: fd unit %d part %d otype %x\n", unit, part, otyp)); if (otyp == OTYP_LYR) { if (fdp->d_lyropen[part]) fdp->d_lyropen[part]--; part_is_closed = (fdp->d_lyropen[part] == 0); } else { fdp->d_regopen[otyp] &= ~(1<<part); part_is_closed = 1; } if (part_is_closed) { if (part == 2 && fdp->d_exclmask&(1<<part)) fdp->d_exclmask = 0; else fdp->d_exclmask &= ~(1<<part); FDERRPRINT(FDEP_L0, FDEM_CLOS, (CE_CONT, "fd_close: exclparts %lx openparts %lx lyrcnt %lx\n", fdp->d_exclmask, fdp->d_regopen[otyp], fdp->d_lyropen[part])); if (fd_unit_is_open(fdp) == 0) fdp->d_obj->fj_flags &= ~FUNIT_CHANGED; } sema_v(&fdp->d_ocsem); return (0); } /* ARGSUSED */ static int fd_read(dev_t dev, struct uio *uio, cred_t *cred_p) { return (physio(fd_strategy, NULL, dev, B_READ, minphys, uio)); } /* ARGSUSED */ static int fd_write(dev_t dev, struct uio *uio, cred_t *cred_p) { return (physio(fd_strategy, NULL, dev, B_WRITE, minphys, uio)); } /* * fd_strategy * checks operation, hangs buf struct off fdcntlr, calls fdstart * if not already busy. Note that if we call start, then the operation * will already be done on return (start sleeps). */ static int fd_strategy(struct buf *bp) { struct fcu_obj *fjp; struct fdisk *fdp; struct partition *pp; FDERRPRINT(FDEP_L1, FDEM_STRA, (CE_CONT, "fd_strategy: bp = 0x%p, dev = 0x%lx\n", (void *)bp, bp->b_edev)); (void) fd_getdrive(bp->b_edev, &fjp, &fdp); /* * Ignoring return because device exist. * Returned unit value is not used. */ pp = &fdp->d_part[PARTITION(bp->b_edev)]; if (fjp->fj_chars->fdc_sec_size > NBPSCTR && (bp->b_blkno & 1)) { FDERRPRINT(FDEP_L3, FDEM_STRA, (CE_WARN, "fd%d: block %ld is not start of sector!", DRIVE(bp->b_edev), (long)bp->b_blkno)); bp->b_error = EINVAL; goto bad; } if ((bp->b_blkno > pp->p_size)) { FDERRPRINT(FDEP_L3, FDEM_STRA, (CE_WARN, "fd%d: block %ld is past the end! (nblk=%ld)", DRIVE(bp->b_edev), (long)bp->b_blkno, pp->p_size)); bp->b_error = ENOSPC; goto bad; } /* if at end of file, skip out now */ if (bp->b_blkno == pp->p_size) { if ((bp->b_flags & B_READ) == 0) { /* a write needs to get an error! */ bp->b_error = ENOSPC; goto bad; } bp->b_resid = bp->b_bcount; biodone(bp); return (0); } /* if operation not a multiple of sector size, is error! */ if (bp->b_bcount % fjp->fj_chars->fdc_sec_size) { FDERRPRINT(FDEP_L3, FDEM_STRA, (CE_WARN, "fd%d: count %ld must be a multiple of %d", DRIVE(bp->b_edev), bp->b_bcount, fjp->fj_chars->fdc_sec_size)); bp->b_error = EINVAL; goto bad; } /* * Put the buf request in the drive's queue, FIFO. */ bp->av_forw = 0; mutex_enter(&fjp->fj_lock); if (fdp->d_iostat) kstat_waitq_enter(KIOSP); if (fdp->d_actf) fdp->d_actl->av_forw = bp; else fdp->d_actf = bp; fdp->d_actl = bp; if (!(fjp->fj_flags & FUNIT_BUSY)) { fdstart(fjp); } mutex_exit(&fjp->fj_lock); return (0); bad: bp->b_resid = bp->b_bcount; bp->b_flags |= B_ERROR; biodone(bp); return (0); } /* * fdstart * called from fd_strategy() or from fdXXXX() to setup and * start operations of read or write only (using buf structs). * Because the chip doesn't handle crossing cylinder boundaries on * the fly, this takes care of those boundary conditions. Note that * it sleeps until the operation is done *within fdstart* - so that * when fdstart returns, the operation is already done. */ static void fdstart(struct fcu_obj *fjp) { struct buf *bp; struct fdisk *fdp = (struct fdisk *)fjp->fj_data; struct fd_char *chp; struct partition *pp; uint_t ptend; uint_t bincyl; /* (the number of the desired) block in cyl. */ uint_t blk, len, tlen; uint_t secpcyl; /* number of sectors per cylinder */ int cyl, head, sect; int sctrshft, unit; caddr_t addr; ASSERT(MUTEX_HELD(&fjp->fj_lock)); fjp->fj_flags |= FUNIT_BUSY; while ((bp = fdp->d_actf) != NULL) { fdp->d_actf = bp->av_forw; fdp->d_current = bp; if (fdp->d_iostat) { kstat_waitq_to_runq(KIOSP); } mutex_exit(&fjp->fj_lock); FDERRPRINT(FDEP_L0, FDEM_STRT, (CE_CONT, "fdstart: bp=0x%p blkno=0x%lx bcount=0x%lx\n", (void *)bp, (long)bp->b_blkno, bp->b_bcount)); bp->b_flags &= ~B_ERROR; bp->b_error = 0; bp->b_resid = bp->b_bcount; /* init resid */ ASSERT(DRIVE(bp->b_edev) == ddi_get_instance(fjp->fj_dip)); unit = fjp->fj_unit; fjp->fj_ops->fco_select(fjp, unit, 1); bp_mapin(bp); /* map in buffers */ pp = &fdp->d_part[PARTITION(bp->b_edev)]; /* starting blk adjusted for the partition */ blk = bp->b_blkno + pp->p_start; ptend = pp->p_start + pp->p_size; /* end of the partition */ chp = fjp->fj_chars; secpcyl = chp->fdc_nhead * chp->fdc_secptrack; switch (chp->fdc_sec_size) { /* convert logical block numbers to sector numbers */ case 1024: sctrshft = SCTRSHFT + 1; blk >>= 1; ptend >>= 1; break; default: case NBPSCTR: sctrshft = SCTRSHFT; break; case 256: sctrshft = SCTRSHFT - 1; blk <<= 1; ptend <<= 1; break; } /* * If off the end, limit to actual amount that * can be transferred. */ if ((blk + (bp->b_bcount >> sctrshft)) > ptend) /* to end of partition */ len = (ptend - blk) << sctrshft; else len = bp->b_bcount; addr = bp->b_un.b_addr; /* data buffer address */ /* * now we have the real start blk, addr and len for xfer op */ while (len != 0) { /* start cyl of req */ cyl = blk / secpcyl; bincyl = blk % secpcyl; /* start head of req */ head = bincyl / chp->fdc_secptrack; /* start sector of req */ sect = (bincyl % chp->fdc_secptrack) + 1; /* * If the desired block and length will go beyond the * cylinder end, then limit it to the cylinder end. */ if (bp->b_flags & B_READ) { if (len > ((secpcyl - bincyl) << sctrshft)) tlen = (secpcyl - bincyl) << sctrshft; else tlen = len; } else { if (len > ((chp->fdc_secptrack - sect + 1) << sctrshft)) tlen = (chp->fdc_secptrack - sect + 1) << sctrshft; else tlen = len; } FDERRPRINT(FDEP_L0, FDEM_STRT, (CE_CONT, " blk 0x%x addr 0x%p len 0x%x " "cyl %d head %d sec %d\n resid 0x%lx, tlen %d\n", blk, (void *)addr, len, cyl, head, sect, bp->b_resid, tlen)); /* * (try to) do the operation - failure returns an errno */ bp->b_error = fjp->fj_ops->fco_rw(fjp, unit, bp->b_flags & B_READ, cyl, head, sect, addr, tlen); if (bp->b_error != 0) { FDERRPRINT(FDEP_L3, FDEM_STRT, (CE_WARN, "fdstart: bad exec of bp: 0x%p, err=%d", (void *)bp, bp->b_error)); bp->b_flags |= B_ERROR; break; } blk += tlen >> sctrshft; len -= tlen; addr += tlen; bp->b_resid -= tlen; } FDERRPRINT(FDEP_L0, FDEM_STRT, (CE_CONT, "fdstart done: b_resid %lu, b_count %lu\n", bp->b_resid, bp->b_bcount)); if (fdp->d_iostat) { if (bp->b_flags & B_READ) { KIOSP->reads++; KIOSP->nread += (bp->b_bcount - bp->b_resid); } else { KIOSP->writes++; KIOSP->nwritten += (bp->b_bcount - bp->b_resid); } kstat_runq_exit(KIOSP); } bp_mapout(bp); biodone(bp); fjp->fj_ops->fco_select(fjp, unit, 0); mutex_enter(&fjp->fj_lock); fdp->d_current = 0; } fjp->fj_flags ^= FUNIT_BUSY; } /* ARGSUSED */ static int fd_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, cred_t *cred_p, int *rval_p) { union { struct dk_cinfo dki; struct dk_geom dkg; struct dk_allmap dka; struct fd_char fdchar; struct fd_drive drvchar; int temp; } cpy; struct vtoc vtoc; struct fcu_obj *fjp = NULL; struct fdisk *fdp = NULL; struct dk_map *dmp; struct dk_label *label; int nblks, part, unit; int rval = 0; enum dkio_state state; unit = fd_getdrive(dev, &fjp, &fdp); if (!fjp || !fdp) return (ENXIO); FDERRPRINT(FDEP_L1, FDEM_IOCT, (CE_CONT, "fd_ioctl fd unit %d: cmd %x, arg %lx\n", unit, cmd, arg)); switch (cmd) { case DKIOCINFO: fjp->fj_ops->fco_dkinfo(fjp, &cpy.dki); cpy.dki.dki_cnum = FDCTLR(fjp->fj_unit); cpy.dki.dki_unit = FDUNIT(fjp->fj_unit); cpy.dki.dki_partition = PARTITION(dev); if (ddi_copyout(&cpy.dki, (void *)arg, sizeof (cpy.dki), flag)) rval = EFAULT; break; case DKIOCG_PHYGEOM: case DKIOCG_VIRTGEOM: cpy.dkg.dkg_nsect = fjp->fj_chars->fdc_secptrack; goto get_geom; case DKIOCGGEOM: if (fjp->fj_flags & FUNIT_LABELOK) cpy.dkg.dkg_nsect = (fjp->fj_chars->fdc_secptrack * fjp->fj_chars->fdc_sec_size) / DEV_BSIZE; else cpy.dkg.dkg_nsect = fjp->fj_chars->fdc_secptrack; get_geom: cpy.dkg.dkg_pcyl = fjp->fj_chars->fdc_ncyl; cpy.dkg.dkg_ncyl = fjp->fj_chars->fdc_ncyl; cpy.dkg.dkg_nhead = fjp->fj_chars->fdc_nhead; cpy.dkg.dkg_intrlv = fjp->fj_attr->fda_intrlv; cpy.dkg.dkg_rpm = fjp->fj_attr->fda_rotatespd; cpy.dkg.dkg_read_reinstruct = (int)(cpy.dkg.dkg_nsect * cpy.dkg.dkg_rpm * 4) / 60000; cpy.dkg.dkg_write_reinstruct = cpy.dkg.dkg_read_reinstruct; if (ddi_copyout(&cpy.dkg, (void *)arg, sizeof (cpy.dkg), flag)) rval = EFAULT; break; case DKIOCSGEOM: if (ddi_copyin((void *)arg, &cpy.dkg, sizeof (struct dk_geom), flag)) { rval = EFAULT; break; } mutex_enter(&fjp->fj_lock); fjp->fj_chars->fdc_ncyl = cpy.dkg.dkg_ncyl; fjp->fj_chars->fdc_nhead = cpy.dkg.dkg_nhead; fjp->fj_chars->fdc_secptrack = cpy.dkg.dkg_nsect; fjp->fj_attr->fda_intrlv = cpy.dkg.dkg_intrlv; fjp->fj_attr->fda_rotatespd = cpy.dkg.dkg_rpm; fdp->d_curfdtype = -1; mutex_exit(&fjp->fj_lock); break; /* * return the map of all logical partitions */ case DKIOCGAPART: /* * Note the conversion from starting sector number * to starting cylinder number. * Return error if division results in a remainder. */ nblks = fjp->fj_chars->fdc_nhead * fjp->fj_chars->fdc_secptrack; #ifdef _MULTI_DATAMODEL switch (ddi_model_convert_from(flag & FMODELS)) { case DDI_MODEL_ILP32: { struct dk_allmap32 dka32; for (part = 0; part < NDKMAP; part++) { if ((fdp->d_part[part].p_start % nblks) != 0) return (EINVAL); dka32.dka_map[part].dkl_cylno = fdp->d_part[part].p_start / nblks; dka32.dka_map[part].dkl_nblk = fdp->d_part[part].p_size; } if (ddi_copyout(&dka32, (void *)arg, sizeof (struct dk_allmap32), flag)) rval = EFAULT; break; } case DDI_MODEL_NONE: #endif /* _MULTI_DATAMODEL */ dmp = (struct dk_map *)&cpy.dka; for (part = 0; part < NDKMAP; part++) { if ((fdp->d_part[part].p_start % nblks) != 0) return (EINVAL); dmp->dkl_cylno = fdp->d_part[part].p_start / nblks; dmp->dkl_nblk = fdp->d_part[part].p_size; dmp++; } if (ddi_copyout(&cpy.dka, (void *)arg, sizeof (struct dk_allmap), flag)) rval = EFAULT; #ifdef _MULTI_DATAMODEL break; } #endif /* _MULTI_DATAMODEL */ break; /* * Set the map of all logical partitions */ case DKIOCSAPART: #ifdef _MULTI_DATAMODEL switch (ddi_model_convert_from(flag & FMODELS)) { case DDI_MODEL_ILP32: { struct dk_allmap32 dka32; if (ddi_copyin((void *)arg, &dka32, sizeof (dka32), flag)) { rval = EFAULT; break; } for (part = 0; part < NDKMAP; part++) { cpy.dka.dka_map[part].dkl_cylno = dka32.dka_map[part].dkl_cylno; cpy.dka.dka_map[part].dkl_nblk = dka32.dka_map[part].dkl_nblk; } break; } case DDI_MODEL_NONE: #endif /* _MULTI_DATAMODEL */ if (ddi_copyin((void *)arg, &cpy.dka, sizeof (cpy.dka), flag)) rval = EFAULT; #ifdef _MULTI_DATAMODEL break; } #endif /* _MULTI_DATAMODEL */ if (rval != 0) break; dmp = (struct dk_map *)&cpy.dka; nblks = fjp->fj_chars->fdc_nhead * fjp->fj_chars->fdc_secptrack; mutex_enter(&fjp->fj_lock); /* * Note the conversion from starting cylinder number * to starting sector number. */ for (part = 0; part < NDKMAP; part++) { fdp->d_part[part].p_start = dmp->dkl_cylno * nblks; fdp->d_part[part].p_size = dmp->dkl_nblk; dmp++; } mutex_exit(&fjp->fj_lock); break; case DKIOCGVTOC: mutex_enter(&fjp->fj_lock); /* * Exit if the diskette has no label. * Also, get the label to make sure the correct one is * being used since the diskette may have changed */ fjp->fj_ops->fco_select(fjp, unit, 1); rval = fdgetlabel(fjp, unit); fjp->fj_ops->fco_select(fjp, unit, 0); if (rval) { mutex_exit(&fjp->fj_lock); rval = EINVAL; break; } fd_build_user_vtoc(fjp, fdp, &vtoc); mutex_exit(&fjp->fj_lock); #ifdef _MULTI_DATAMODEL switch (ddi_model_convert_from(flag & FMODELS)) { case DDI_MODEL_ILP32: { struct vtoc32 vtoc32; vtoctovtoc32(vtoc, vtoc32); if (ddi_copyout(&vtoc32, (void *)arg, sizeof (vtoc32), flag)) rval = EFAULT; break; } case DDI_MODEL_NONE: #endif /* _MULTI_DATAMODEL */ if (ddi_copyout(&vtoc, (void *)arg, sizeof (vtoc), flag)) rval = EFAULT; #ifdef _MULTI_DATAMODEL break; } #endif /* _MULTI_DATAMODEL */ break; case DKIOCSVTOC: #ifdef _MULTI_DATAMODEL switch (ddi_model_convert_from(flag & FMODELS)) { case DDI_MODEL_ILP32: { struct vtoc32 vtoc32; if (ddi_copyin((void *)arg, &vtoc32, sizeof (vtoc32), flag)) { rval = EFAULT; break; } vtoc32tovtoc(vtoc32, vtoc); break; } case DDI_MODEL_NONE: #endif /* _MULTI_DATAMODEL */ if (ddi_copyin((void *)arg, &vtoc, sizeof (vtoc), flag)) rval = EFAULT; #ifdef _MULTI_DATAMODEL break; } #endif /* _MULTI_DATAMODEL */ if (rval != 0) break; label = kmem_zalloc(sizeof (struct dk_label), KM_SLEEP); mutex_enter(&fjp->fj_lock); if ((rval = fd_build_label_vtoc(fjp, fdp, &vtoc, label)) == 0) { fjp->fj_ops->fco_select(fjp, unit, 1); rval = fjp->fj_ops->fco_rw(fjp, unit, FDWRITE, 0, 0, 1, (caddr_t)label, sizeof (struct dk_label)); fjp->fj_ops->fco_select(fjp, unit, 0); } mutex_exit(&fjp->fj_lock); kmem_free(label, sizeof (struct dk_label)); break; case DKIOCSTATE: FDERRPRINT(FDEP_L1, FDEM_IOCT, (CE_CONT, "fd_ioctl fd unit %d: DKIOCSTATE\n", unit)); if (ddi_copyin((void *)arg, &state, sizeof (int), flag)) { rval = EFAULT; break; } rval = fd_check_media(dev, state); if (ddi_copyout(&fdp->d_media_state, (void *)arg, sizeof (int), flag)) rval = EFAULT; break; case FDIOGCHAR: if (ddi_copyout(fjp->fj_chars, (void *)arg, sizeof (struct fd_char), flag)) rval = EFAULT; break; case FDIOSCHAR: if (ddi_copyin((void *)arg, &cpy.fdchar, sizeof (struct fd_char), flag)) { rval = EFAULT; break; } switch (cpy.fdchar.fdc_transfer_rate) { case 417: if ((fdp->d_media & (1 << FMT_3M)) == 0) { cmn_err(CE_CONT, "fdioschar:Medium density not supported\n"); rval = EINVAL; break; } mutex_enter(&fjp->fj_lock); fjp->fj_attr->fda_rotatespd = 360; mutex_exit(&fjp->fj_lock); /* cpy.fdchar.fdc_transfer_rate = 500; */ /* FALLTHROUGH */ case 1000: case 500: case 300: case 250: mutex_enter(&fjp->fj_lock); *(fjp->fj_chars) = cpy.fdchar; fdp->d_curfdtype = -1; fjp->fj_flags &= ~FUNIT_CHAROK; mutex_exit(&fjp->fj_lock); break; default: FDERRPRINT(FDEP_L4, FDEM_IOCT, (CE_WARN, "fd_ioctl fd unit %d: FDIOSCHAR odd " "xfer rate %dkbs", unit, cpy.fdchar.fdc_transfer_rate)); rval = EINVAL; break; } break; /* * set all characteristics and geometry to the defaults */ case FDDEFGEOCHAR: mutex_enter(&fjp->fj_lock); fdp->d_curfdtype = fdp->d_deffdtype; *fjp->fj_chars = *defchar[fdp->d_curfdtype]; *fjp->fj_attr = fdtypes[fdp->d_curfdtype]; bcopy(fdparts[fdp->d_curfdtype], fdp->d_part, sizeof (struct partition) * NDKMAP); fjp->fj_flags &= ~FUNIT_CHAROK; mutex_exit(&fjp->fj_lock); break; case FDEJECT: /* eject disk */ case DKIOCEJECT: fjp->fj_flags &= ~(FUNIT_LABELOK | FUNIT_UNLABELED); rval = ENOSYS; break; case FDGETCHANGE: /* disk changed */ if (ddi_copyin((void *)arg, &cpy.temp, sizeof (int), flag)) { rval = EFAULT; break; } mutex_enter(&fjp->fj_lock); fjp->fj_ops->fco_select(fjp, unit, 1); if (fjp->fj_flags & FUNIT_CHANGED) cpy.temp |= FDGC_HISTORY; else cpy.temp &= ~FDGC_HISTORY; fjp->fj_flags &= ~FUNIT_CHANGED; if (fjp->fj_ops->fco_getchng(fjp, unit)) { cpy.temp |= FDGC_DETECTED; fjp->fj_ops->fco_resetchng(fjp, unit); /* * check diskette again only if it was removed */ if (fjp->fj_ops->fco_getchng(fjp, unit)) { /* * no diskette is present */ cpy.temp |= FDGC_CURRENT; if (fjp->fj_flags & FUNIT_CHGDET) /* * again no diskette; not a new change */ cpy.temp ^= FDGC_DETECTED; else fjp->fj_flags |= FUNIT_CHGDET; } else { /* * a new diskette is present */ cpy.temp &= ~FDGC_CURRENT; fjp->fj_flags &= ~FUNIT_CHGDET; } } else { cpy.temp &= ~(FDGC_DETECTED | FDGC_CURRENT); fjp->fj_flags &= ~FUNIT_CHGDET; } /* * also get state of write protection */ if (fjp->fj_flags & FUNIT_WPROT) { cpy.temp |= FDGC_CURWPROT; } else { cpy.temp &= ~FDGC_CURWPROT; } fjp->fj_ops->fco_select(fjp, unit, 0); mutex_exit(&fjp->fj_lock); if (ddi_copyout(&cpy.temp, (void *)arg, sizeof (int), flag)) rval = EFAULT; break; case FDGETDRIVECHAR: if (ddi_copyout(fjp->fj_drive, (void *)arg, sizeof (struct fd_drive), flag)) rval = EFAULT; break; case FDSETDRIVECHAR: if (ddi_copyin((void *)arg, &cpy.drvchar, sizeof (struct fd_drive), flag)) { rval = EFAULT; break; } mutex_enter(&fjp->fj_lock); *(fjp->fj_drive) = cpy.drvchar; fdp->d_curfdtype = -1; fjp->fj_flags &= ~FUNIT_CHAROK; mutex_exit(&fjp->fj_lock); break; case DKIOCREMOVABLE: { int i = 1; /* no brainer: floppies are always removable */ if (ddi_copyout(&i, (void *)arg, sizeof (int), flag)) { rval = EFAULT; } break; } case DKIOCGMEDIAINFO: rval = fd_get_media_info(fjp, (caddr_t)arg, flag); break; case FDIOCMD: { struct fd_cmd fc; int cyl, head, spc, spt; #ifdef _MULTI_DATAMODEL switch (ddi_model_convert_from(flag & FMODELS)) { case DDI_MODEL_ILP32: { struct fd_cmd32 fc32; if (ddi_copyin((void *)arg, &fc32, sizeof (fc32), flag)) { rval = EFAULT; break; } fc.fdc_cmd = fc32.fdc_cmd; fc.fdc_flags = fc32.fdc_flags; fc.fdc_blkno = fc32.fdc_blkno; fc.fdc_secnt = fc32.fdc_secnt; fc.fdc_bufaddr = (caddr_t)(uintptr_t)fc32.fdc_bufaddr; fc.fdc_buflen = fc32.fdc_buflen; break; } case DDI_MODEL_NONE: #endif /* _MULTI_DATAMODEL */ if (ddi_copyin((void *)arg, &fc, sizeof (fc), flag)) { rval = EFAULT; break; } #ifdef _MULTI_DATAMODEL break; } #endif /* _MULTI_DATAMODEL */ if (rval != 0) break; if (fc.fdc_cmd == FDCMD_READ || fc.fdc_cmd == FDCMD_WRITE) { auto struct iovec aiov; auto struct uio auio; struct uio *uio = &auio; spc = (fc.fdc_cmd == FDCMD_READ)? B_READ: B_WRITE; bzero(&auio, sizeof (struct uio)); bzero(&aiov, sizeof (struct iovec)); aiov.iov_base = fc.fdc_bufaddr; aiov.iov_len = (uint_t)fc.fdc_secnt * fjp->fj_chars->fdc_sec_size; uio->uio_iov = &aiov; uio->uio_iovcnt = 1; uio->uio_resid = aiov.iov_len; uio->uio_segflg = UIO_USERSPACE; rval = physio(fd_strategy, (struct buf *)0, dev, spc, minphys, uio); break; } else if (fc.fdc_cmd == FDCMD_FORMAT_TRACK) { spt = fjp->fj_chars->fdc_secptrack; /* sec/trk */ spc = fjp->fj_chars->fdc_nhead * spt; /* sec/cyl */ cyl = fc.fdc_blkno / spc; head = (fc.fdc_blkno % spc) / spt; if ((cyl | head) == 0) fjp->fj_flags &= ~(FUNIT_LABELOK | FUNIT_UNLABELED); FDERRPRINT(FDEP_L0, FDEM_FORM, (CE_CONT, "fd_format cyl %d, hd %d\n", cyl, head)); fjp->fj_ops->fco_select(fjp, unit, 1); rval = fjp->fj_ops->fco_format(fjp, unit, cyl, head, (int)fc.fdc_flags); fjp->fj_ops->fco_select(fjp, unit, 0); break; } FDERRPRINT(FDEP_L4, FDEM_IOCT, (CE_WARN, "fd_ioctl fd unit %d: FDIOCSCMD not yet complete", unit)); rval = EINVAL; break; } case FDRAW: rval = fd_rawioctl(fjp, unit, (caddr_t)arg, flag); break; default: FDERRPRINT(FDEP_L4, FDEM_IOCT, (CE_WARN, "fd_ioctl fd unit %d: invalid ioctl 0x%x", unit, cmd)); rval = ENOTTY; break; } return (rval); } static void fd_build_user_vtoc(struct fcu_obj *fjp, struct fdisk *fdp, struct vtoc *vtocp) { struct partition *vpart; int i; int xblk; /* * Return vtoc structure fields in the provided VTOC area, addressed * by *vtocp. * */ bzero(vtocp, sizeof (struct vtoc)); bcopy(fdp->d_vtoc_bootinfo, vtocp->v_bootinfo, sizeof (vtocp->v_bootinfo)); vtocp->v_sanity = VTOC_SANE; vtocp->v_version = fdp->d_vtoc_version; bcopy(fdp->d_vtoc_volume, vtocp->v_volume, LEN_DKL_VVOL); if (fjp->fj_flags & FUNIT_LABELOK) { vtocp->v_sectorsz = DEV_BSIZE; xblk = 1; } else { vtocp->v_sectorsz = fjp->fj_chars->fdc_sec_size; xblk = vtocp->v_sectorsz / DEV_BSIZE; } vtocp->v_nparts = 3; /* <= NDKMAP; */ /* * Copy partitioning information. */ bcopy(fdp->d_part, vtocp->v_part, sizeof (struct partition) * NDKMAP); for (i = NDKMAP, vpart = vtocp->v_part; i && (xblk > 1); i--, vpart++) { /* correct partition info if sector size > 512 bytes */ vpart->p_start /= xblk; vpart->p_size /= xblk; } bcopy(fdp->d_vtoc_timestamp, vtocp->timestamp, sizeof (fdp->d_vtoc_timestamp)); bcopy(fdp->d_vtoc_asciilabel, vtocp->v_asciilabel, LEN_DKL_ASCII); } static int fd_build_label_vtoc(struct fcu_obj *fjp, struct fdisk *fdp, struct vtoc *vtocp, struct dk_label *labelp) { struct partition *vpart; int i; int nblks; int ncyl; ushort_t sum, *sp; /* * Sanity-check the vtoc */ if (vtocp->v_sanity != VTOC_SANE || vtocp->v_nparts > NDKMAP || vtocp->v_nparts <= 0) { FDERRPRINT(FDEP_L3, FDEM_IOCT, (CE_WARN, "fd_build_label: sanity check on vtoc failed")); return (EINVAL); } /* * before copying the vtoc, the partition information in it should be * checked against the information the driver already has on the * diskette. */ nblks = (fjp->fj_chars->fdc_nhead * fjp->fj_chars->fdc_secptrack * fjp->fj_chars->fdc_sec_size) / DEV_BSIZE; if (nblks == 0 || fjp->fj_chars->fdc_ncyl == 0) return (EFAULT); vpart = vtocp->v_part; /* * Check the partition information in the vtoc. The starting sectors * must lie along cylinder boundaries. (NDKMAP entries are checked * to ensure that the unused entries are set to 0 if vtoc->v_nparts * is less than NDKMAP) */ for (i = NDKMAP; i; i--) { if ((vpart->p_start % nblks) != 0) { return (EINVAL); } ncyl = vpart->p_start / nblks; ncyl += vpart->p_size / nblks; if ((vpart->p_size % nblks) != 0) ncyl++; if (ncyl > (long)fjp->fj_chars->fdc_ncyl) { return (EINVAL); } vpart++; } bcopy(vtocp->v_bootinfo, fdp->d_vtoc_bootinfo, sizeof (vtocp->v_bootinfo)); fdp->d_vtoc_version = vtocp->v_version; bcopy(vtocp->v_volume, fdp->d_vtoc_volume, LEN_DKL_VVOL); /* * Copy partitioning information. */ bcopy(vtocp->v_part, fdp->d_part, sizeof (struct partition) * NDKMAP); bcopy(vtocp->timestamp, fdp->d_vtoc_timestamp, sizeof (fdp->d_vtoc_timestamp)); bcopy(vtocp->v_asciilabel, fdp->d_vtoc_asciilabel, LEN_DKL_ASCII); /* * construct the diskette label in supplied buffer */ /* Put appropriate vtoc structure fields into the disk label */ labelp->dkl_vtoc.v_bootinfo[0] = (uint32_t)vtocp->v_bootinfo[0]; labelp->dkl_vtoc.v_bootinfo[1] = (uint32_t)vtocp->v_bootinfo[1]; labelp->dkl_vtoc.v_bootinfo[2] = (uint32_t)vtocp->v_bootinfo[2]; labelp->dkl_vtoc.v_sanity = vtocp->v_sanity; labelp->dkl_vtoc.v_version = vtocp->v_version; bcopy(vtocp->v_volume, labelp->dkl_vtoc.v_volume, LEN_DKL_VVOL); labelp->dkl_vtoc.v_nparts = vtocp->v_nparts; bcopy(vtocp->v_reserved, labelp->dkl_vtoc.v_reserved, sizeof (labelp->dkl_vtoc.v_reserved)); for (i = 0; i < (int)vtocp->v_nparts; i++) { labelp->dkl_vtoc.v_part[i].p_tag = vtocp->v_part[i].p_tag; labelp->dkl_vtoc.v_part[i].p_flag = vtocp->v_part[i].p_flag; labelp->dkl_vtoc.v_part[i].p_start = vtocp->v_part[i].p_start; labelp->dkl_vtoc.v_part[i].p_size = vtocp->v_part[i].p_size; } for (i = 0; i < NDKMAP; i++) { labelp->dkl_vtoc.v_timestamp[i] = vtocp->timestamp[i]; } bcopy(vtocp->v_asciilabel, labelp->dkl_asciilabel, LEN_DKL_ASCII); labelp->dkl_pcyl = fjp->fj_chars->fdc_ncyl; labelp->dkl_ncyl = fjp->fj_chars->fdc_ncyl; labelp->dkl_nhead = fjp->fj_chars->fdc_nhead; /* * The fdc_secptrack field of the fd_char structure is the number * of sectors per track where the sectors are fdc_sec_size. * The dkl_nsect field of the dk_label structure is the number of * DEV_BSIZE (512) byte sectors per track. */ labelp->dkl_nsect = (fjp->fj_chars->fdc_secptrack * fjp->fj_chars->fdc_sec_size) / DEV_BSIZE; labelp->dkl_intrlv = fjp->fj_attr->fda_intrlv; labelp->dkl_rpm = fjp->fj_attr->fda_rotatespd; labelp->dkl_read_reinstruct = (int)(labelp->dkl_nsect * labelp->dkl_rpm * 4) / 60000; labelp->dkl_write_reinstruct = labelp->dkl_read_reinstruct; labelp->dkl_magic = DKL_MAGIC; sum = 0; labelp->dkl_cksum = 0; sp = (ushort_t *)labelp; while (sp < &(labelp->dkl_cksum)) { sum ^= *sp++; } labelp->dkl_cksum = sum; return (0); } static int fd_rawioctl(struct fcu_obj *fjp, int unit, caddr_t arg, int mode) { struct fd_raw fdr; char *arg_result = NULL; int flag = B_READ; int rval = 0; caddr_t uaddr; uint_t ucount; FDERRPRINT(FDEP_L1, FDEM_RAWI, (CE_CONT, "fd_rawioctl: cmd[0]=0x%x\n", fdr.fdr_cmd[0])); if (fjp->fj_chars->fdc_medium != 3 && fjp->fj_chars->fdc_medium != 5) { cmn_err(CE_CONT, "fd_rawioctl: Medium density not supported\n"); return (ENXIO); } #ifdef _MULTI_DATAMODEL switch (ddi_model_convert_from(mode & FMODELS)) { case DDI_MODEL_ILP32: { struct fd_raw32 fdr32; if (ddi_copyin(arg, &fdr32, sizeof (fdr32), mode)) return (EFAULT); bcopy(fdr32.fdr_cmd, fdr.fdr_cmd, sizeof (fdr.fdr_cmd)); fdr.fdr_cnum = fdr32.fdr_cnum; fdr.fdr_nbytes = fdr32.fdr_nbytes; fdr.fdr_addr = (caddr_t)(uintptr_t)fdr32.fdr_addr; arg_result = ((struct fd_raw32 *)arg)->fdr_result; break; } case DDI_MODEL_NONE: #endif /* ! _MULTI_DATAMODEL */ if (ddi_copyin(arg, &fdr, sizeof (fdr), mode)) return (EFAULT); arg_result = ((struct fd_raw *)arg)->fdr_result; #ifdef _MULTI_DATAMODEL break; } #endif /* _MULTI_DATAMODEL */ /* * copy user address & nbytes from raw_req so that we can * put kernel address in req structure */ uaddr = fdr.fdr_addr; ucount = (uint_t)fdr.fdr_nbytes; unit &= 3; switch (fdr.fdr_cmd[0] & 0x0f) { case FDRAW_FORMAT: ucount += 16; fdr.fdr_addr = kmem_zalloc(ucount, KM_SLEEP); if (ddi_copyin(uaddr, fdr.fdr_addr, (size_t)fdr.fdr_nbytes, mode)) { kmem_free(fdr.fdr_addr, ucount); return (EFAULT); } if ((*fdr.fdr_addr | fdr.fdr_addr[1]) == 0) fjp->fj_flags &= ~(FUNIT_LABELOK | FUNIT_UNLABELED); flag = B_WRITE; fdr.fdr_cmd[1] = (fdr.fdr_cmd[1] & ~3) | unit; break; case FDRAW_WRCMD: case FDRAW_WRITEDEL: flag = B_WRITE; /* FALLTHROUGH */ case FDRAW_RDCMD: case FDRAW_READDEL: case FDRAW_READTRACK: if (ucount) { /* * In SunOS 4.X, we used to as_fault things in. * We really cannot do this in 5.0/SVr4. Unless * someone really believes that speed is of the * essence here, it is just much simpler to do * this in kernel space and use copyin/copyout. */ fdr.fdr_addr = kmem_alloc((size_t)ucount, KM_SLEEP); if (flag == B_WRITE) { if (ddi_copyin(uaddr, fdr.fdr_addr, ucount, mode)) { kmem_free(fdr.fdr_addr, ucount); return (EFAULT); } } } else return (EINVAL); fdr.fdr_cmd[1] = (fdr.fdr_cmd[1] & ~3) | unit; break; case FDRAW_READID: case FDRAW_REZERO: case FDRAW_SEEK: case FDRAW_SENSE_DRV: ucount = 0; fdr.fdr_cmd[1] = (fdr.fdr_cmd[1] & ~3) | unit; break; case FDRAW_SPECIFY: fdr.fdr_cmd[2] &= 0xfe; /* keep NoDMA bit clear */ /* FALLTHROUGH */ case FDRAW_SENSE_INT: ucount = 0; break; default: return (EINVAL); } /* * Note that we ignore any error returns from controller * This is the way the driver has been, and it may be * that the raw ioctl senders simply don't want to * see any errors returned in this fashion. */ fjp->fj_ops->fco_select(fjp, unit, 1); rval = fjp->fj_ops->fco_rwioctl(fjp, unit, (caddr_t)&fdr); if (ucount && flag == B_READ && rval == 0) { if (ddi_copyout(fdr.fdr_addr, uaddr, ucount, mode)) { rval = EFAULT; } } if (ddi_copyout(fdr.fdr_result, arg_result, sizeof (fdr.fdr_cmd), mode)) rval = EFAULT; fjp->fj_ops->fco_select(fjp, unit, 0); if (ucount) kmem_free(fdr.fdr_addr, ucount); return (rval); } /* * property operation routine. return the number of blocks for the partition * in question or forward the request to the property facilities. */ static int fd_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, int mod_flags, char *name, caddr_t valuep, int *lengthp) { struct fcu_obj *fjp = NULL; struct fdisk *fdp = NULL; uint64_t nblocks64; FDERRPRINT(FDEP_L1, FDEM_PROP, (CE_CONT, "fd_prop_op: dip %p %s\n", (void *)dip, name)); /* * Our dynamic properties are all device specific and size oriented. * Requests issued under conditions where size is valid are passed * to ddi_prop_op_nblocks with the size information, otherwise the * request is passed to ddi_prop_op. */ if (dev == DDI_DEV_T_ANY) { pass: return (ddi_prop_op(dev, dip, prop_op, mod_flags, name, valuep, lengthp)); } else { /* * Ignoring return value because success is checked by * verifying fjp and fdp and returned unit value is not used. */ (void) fd_getdrive(dev, &fjp, &fdp); if (!fjp || !fdp) goto pass; /* get nblocks value */ nblocks64 = (ulong_t)fdp->d_part[PARTITION(dev)].p_size; return (ddi_prop_op_nblocks(dev, dip, prop_op, mod_flags, name, valuep, lengthp, nblocks64)); } } static void fd_media_watch(void *arg) { struct fcu_obj *fjp; struct fdisk *fdp; #ifdef DEBUG int unit; #define DEBUG_ASSIGN unit= #else #define DEBUG_ASSIGN (void) #endif DEBUG_ASSIGN fd_getdrive((dev_t)arg, &fjp, &fdp); /* * Ignoring return in non DEBUG mode because device exist. * Returned unit value is not used. */ FDERRPRINT(FDEP_L0, FDEM_IOCT, (CE_CONT, "fd_media_watch unit %d\n", unit)); /* * fd_get_media_state() cannot be called from this timeout function * because the floppy drive has to be selected first, and that could * force this function to sleep (while waiting for the select * semaphore). * Instead, just wakeup up driver. */ mutex_enter(&fjp->fj_lock); cv_broadcast(&fdp->d_statecv); mutex_exit(&fjp->fj_lock); } enum dkio_state fd_get_media_state(struct fcu_obj *fjp, int unit) { enum dkio_state state; if (fjp->fj_ops->fco_getchng(fjp, unit)) { /* recheck disk only if DSKCHG "high" */ fjp->fj_ops->fco_resetchng(fjp, unit); if (fjp->fj_ops->fco_getchng(fjp, unit)) { if (fjp->fj_flags & FUNIT_CHGDET) { /* * again no diskette; not a new change */ state = DKIO_NONE; } else { /* * a new change; diskette was ejected */ fjp->fj_flags |= FUNIT_CHGDET; state = DKIO_EJECTED; } } else { fjp->fj_flags &= ~FUNIT_CHGDET; state = DKIO_INSERTED; } } else { fjp->fj_flags &= ~FUNIT_CHGDET; state = DKIO_INSERTED; } FDERRPRINT(FDEP_L0, FDEM_IOCT, (CE_CONT, "fd_get_media_state unit %d: state %x\n", unit, state)); return (state); } static int fd_check_media(dev_t dev, enum dkio_state state) { struct fcu_obj *fjp; struct fdisk *fdp; int unit; int err; unit = fd_getdrive(dev, &fjp, &fdp); mutex_enter(&fjp->fj_lock); fjp->fj_ops->fco_select(fjp, unit, 1); fdp->d_media_state = fd_get_media_state(fjp, unit); fdp->d_media_timeout = drv_usectohz(fd_check_media_time); while (fdp->d_media_state == state) { /* release the controller and drive */ fjp->fj_ops->fco_select(fjp, unit, 0); /* turn on timer */ fdp->d_media_timeout_id = timeout(fd_media_watch, (void *)dev, fdp->d_media_timeout); if (cv_wait_sig(&fdp->d_statecv, &fjp->fj_lock) == 0) { fdp->d_media_timeout = 0; mutex_exit(&fjp->fj_lock); return (EINTR); } fjp->fj_ops->fco_select(fjp, unit, 1); fdp->d_media_state = fd_get_media_state(fjp, unit); } if (fdp->d_media_state == DKIO_INSERTED) { err = fdgetlabel(fjp, unit); if (err) { fjp->fj_ops->fco_select(fjp, unit, 0); mutex_exit(&fjp->fj_lock); return (EIO); } } fjp->fj_ops->fco_select(fjp, unit, 0); mutex_exit(&fjp->fj_lock); return (0); } /* * fd_get_media_info : * Collects medium information for * DKIOCGMEDIAINFO ioctl. */ static int fd_get_media_info(struct fcu_obj *fjp, caddr_t buf, int flag) { struct dk_minfo media_info; int err = 0; media_info.dki_media_type = DK_FLOPPY; media_info.dki_lbsize = fjp->fj_chars->fdc_sec_size; media_info.dki_capacity = fjp->fj_chars->fdc_ncyl * fjp->fj_chars->fdc_secptrack * fjp->fj_chars->fdc_nhead; if (ddi_copyout(&media_info, buf, sizeof (struct dk_minfo), flag)) err = EFAULT; return (err); }
25.407979
79
0.653244
[ "geometry", "3d" ]
aae3b10096bb320373e4fb1546b384ff5dc41a3e
905
h
C
packages/wasmcsg/src/cpp/polygon.h
avalero/bitbloq-junior
981d8731760018d91d91ac76617e3f65742ce440
[ "MIT" ]
3
2019-04-16T08:10:33.000Z
2019-08-05T16:57:05.000Z
packages/wasmcsg/src/cpp/polygon.h
avalero/bitbloq
981d8731760018d91d91ac76617e3f65742ce440
[ "MIT" ]
null
null
null
packages/wasmcsg/src/cpp/polygon.h
avalero/bitbloq
981d8731760018d91d91ac76617e3f65742ce440
[ "MIT" ]
null
null
null
#ifndef POLYGON_H #define POLYGON_H #include <vector> #include "vertex.h" using namespace std; class Polygon { public: Polygon(const vector<Vertex> &_vertices); Polygon(const Polygon & p); Polygon(); Polygon &calculateProperties(); Polygon clone() const; Polygon & flip(); char classifyVertex(const Vertex & vertex) const; char classifySide(const Polygon & polygon) const; void splitPolygon(const Polygon & polygon, vector<Polygon> & coplanar_front , vector<Polygon> & coplanar_back, vector<Polygon> & front, vector<Polygon> & back); vector<Vertex> vertices; Vertex normal; double w; static const double EPSILON; static const char COPLANAR; static const char FRONT; static const char BACK; static const char SPANNING; }; #endif // POLYGON_H
22.625
56
0.630939
[ "vector" ]