text
stringlengths
4
6.14k
/** @file Implementation of Ipmi Library for SMM. Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include <PiSmm.h> #include <Protocol/IpmiProtocol.h> #include <Library/IpmiLib.h> #include <Library/SmmServicesTableLib.h> #include <Library/DebugLib.h> IPMI_PROTOCOL *mIpmiProtocol = NULL; /** This service enables submitting commands via Ipmi. @param[in] NetFunction Net function of the command. @param[in] Command IPMI Command. @param[in] RequestData Command Request Data. @param[in] RequestDataSize Size of Command Request Data. @param[out] ResponseData Command Response Data. The completion code is the first byte of response data. @param[in, out] ResponseDataSize Size of Command Response Data. @retval EFI_SUCCESS The command byte stream was successfully submit to the device and a response was successfully received. @retval EFI_NOT_FOUND The command was not successfully sent to the device or a response was not successfully received from the device. @retval EFI_NOT_READY Ipmi Device is not ready for Ipmi command access. @retval EFI_DEVICE_ERROR Ipmi Device hardware error. @retval EFI_TIMEOUT The command time out. @retval EFI_UNSUPPORTED The command was not successfully sent to the device. @retval EFI_OUT_OF_RESOURCES The resource allcation is out of resource or data size error. **/ EFI_STATUS EFIAPI IpmiSubmitCommand ( IN UINT8 NetFunction, IN UINT8 Command, IN UINT8 *RequestData, IN UINT32 RequestDataSize, OUT UINT8 *ResponseData, IN OUT UINT32 *ResponseDataSize ) { EFI_STATUS Status; if (mIpmiProtocol == NULL) { Status = gSmst->SmmLocateProtocol ( &gSmmIpmiProtocolGuid, NULL, (VOID **) &mIpmiProtocol ); if (EFI_ERROR (Status)) { // // Smm Ipmi Protocol is not installed. So, IPMI device is not present. // DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand for SMM Status - %r\n", Status)); return EFI_NOT_FOUND; } } Status = mIpmiProtocol->IpmiSubmitCommand ( mIpmiProtocol, NetFunction, Command, RequestData, RequestDataSize, ResponseData, ResponseDataSize ); if (EFI_ERROR (Status)) { return Status; } return EFI_SUCCESS; }
#ifndef FDO_XMLCLASSMAPPINGCOLLECTION #define FDO_XMLCLASSMAPPINGCOLLECTION // // Copyright (C) 2004-2006 Autodesk, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of version 2.1 of the GNU Lesser // General Public License as published by the Free Software Foundation. // // 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 // #ifdef _WIN32 #pragma once #endif #include <FdoStd.h> #include <Fdo/Xml/ClassMapping.h> /// \brief /// FdoXmlClassMappingCollection is a collection of Fdo-GML Class Mapping objects. class FdoXmlClassMappingCollection : public FdoPhysicalElementMappingCollection<FdoXmlClassMapping> { public: /// \brief /// Constructs an empty Class mapping collection. /// /// \param parent /// Input the parent FdoXmlSchemaMapping. /// /// \return /// Returns FdoXmlClassMappingCollection /// FDO_API static FdoXmlClassMappingCollection* Create(FdoPhysicalElementMapping* parent); protected: /// \cond DOXYGEN-IGNORE FdoXmlClassMappingCollection() : FdoPhysicalElementMappingCollection<FdoXmlClassMapping>() { } FdoXmlClassMappingCollection(FdoPhysicalElementMapping* parent) : FdoPhysicalElementMappingCollection<FdoXmlClassMapping>(parent) { } virtual void Dispose(); /// \endcond }; /// \ingroup (typedefs) /// \brief /// FdoXmlClassMappingsP is a FdoPtr on FdoXmlClassMappingCollection, provided for convenience. typedef FdoPtr<FdoXmlClassMappingCollection> FdoXmlClassMappingsP; #endif
#pragma once #include "BlockHandler.h" class cBlockEndPortalFrameHandler final : public cYawRotator<cBlockHandler, 0x03, E_META_END_PORTAL_FRAME_ZP, E_META_END_PORTAL_FRAME_XM, E_META_END_PORTAL_FRAME_ZM, E_META_END_PORTAL_FRAME_XP > { using Super = cYawRotator< cBlockHandler, 0x03, E_META_END_PORTAL_FRAME_ZP, E_META_END_PORTAL_FRAME_XM, E_META_END_PORTAL_FRAME_ZM, E_META_END_PORTAL_FRAME_XP >; public: using Super::Super; private: virtual void OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) const override { // E_META_END_PORTAL_FRAME_EYE is the bit which signifies the eye of ender is in it. // LOG("PortalPlaced, meta %d", a_BlockMeta); if ((a_BlockMeta & E_META_END_PORTAL_FRAME_EYE) == E_META_END_PORTAL_FRAME_EYE) { // LOG("Location is %d %d %d", a_BlockX, a_BlockY, a_BlockZ); // Direction is the first two bits, masked by 0x3 FindAndSetPortal(a_BlockPos, a_BlockMeta & 3, a_ChunkInterface, a_WorldInterface); } } /** Returns false if portal cannot be made, true if portal was made. */ static bool FindAndSetPortal(Vector3i a_FirstFrame, NIBBLETYPE a_Direction, cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface) { /* PORTAL FINDING ALGORITH ======================= - Get clicked base block - Check diagonally (clockwise) for another portal block - if exists, and has eye, Continue. Abort if any are facing the wrong direction. - if doesn't exist, check horizontally (the block to the left of this block). Abort if there is no horizontal block. - After a corner has been met, traverse the portal clockwise, ensuring valid portal frames connect the rectangle. - Track the NorthWest Corner, and the dimensions. - If dimensions are valid, create the portal. */ static_assert((E_META_END_PORTAL_FRAME_ZM - E_META_END_PORTAL_FRAME_XM) == 1, "Should be going clockwise"); const int MIN_PORTAL_WIDTH = 3; const int MAX_PORTAL_WIDTH = 4; // Directions to use for the clockwise traversal. static const Vector3i Left[] = { { 1, 0, 0}, // 0, South, left block is East / XP { 0, 0, 1}, // 1, West, left block is South / ZP {-1, 0, 0}, // 2, North, left block is West / XM { 0, 0, -1}, // 3, East, left block is North / ZM }; static const Vector3i LeftForward[] = { { 1, 0, 1}, // 0, South, left block is SouthEast / XP ZP {-1, 0, 1}, // 1, West, left block is SouthWest / XM ZP {-1, 0, -1}, // 2, North, left block is NorthWest / XM ZM { 1, 0, -1}, // 3, East, left block is NorthEast / XP ZM }; int EdgesComplete = -1; // We start search _before_ finding the first edge Vector3i NorthWestCorner; int EdgeWidth[4] = { 1, 1, 1, 1 }; NIBBLETYPE CurrentDirection = a_Direction; Vector3i CurrentPos = a_FirstFrame; // Scan clockwise until we have seen all 4 edges while (EdgesComplete < 4) { // Check if we are at a corner Vector3i NextPos = CurrentPos + LeftForward[CurrentDirection]; if (IsPortalFrame(a_ChunkInterface.GetBlock(NextPos))) { // We have found the corner, move clockwise to next edge if (CurrentDirection == E_META_END_PORTAL_FRAME_XP) { // We are on the NW (XM, ZM) Corner // Relative to the previous frame, the portal should appear to the right of this portal frame. NorthWestCorner = NextPos - Left[CurrentDirection]; } if (EdgesComplete == -1) { // Reset current width, we will revisit it last EdgeWidth[CurrentDirection] = 1; } // Rotate 90 degrees clockwise CurrentDirection = (CurrentDirection + 1) % 4; EdgesComplete++; } else { // We are not at a corner, keep walking the edge NextPos = CurrentPos + Left[CurrentDirection]; EdgeWidth[CurrentDirection]++; if (EdgeWidth[CurrentDirection] > MAX_PORTAL_WIDTH) { // Don't build a portal that is too long. return false; } } if (!IsValidFrameAtPos(a_ChunkInterface, NextPos, CurrentDirection)) { // Neither the edge nor the corner are valid portal blocks. return false; } CurrentPos = NextPos; } if ((EdgeWidth[0] != EdgeWidth[2]) || (EdgeWidth[1] != EdgeWidth[3])) { // Mismatched Portal Dimensions. return false; } if ((EdgeWidth[0] < MIN_PORTAL_WIDTH) || (EdgeWidth[1] < MIN_PORTAL_WIDTH)) { // Portal too small. return false; } // LOG("NW corner (low corner) %d %d %d", Corner.x, Corner.y, Corner.z); // LOG("%d by %d", Width[0], Width[1]); for (int i = 0; i < EdgeWidth[0]; i++) { for (int j = 0; j < EdgeWidth[1]; j++) { a_ChunkInterface.SetBlock(NorthWestCorner.x + i, NorthWestCorner.y, NorthWestCorner.z + j, E_BLOCK_END_PORTAL, 0); // TODO: Create block entity so portal doesn't become invisible on relog. } } return true; } /** Return true if this block is a portal frame, has an eye, and is facing the correct direction. */ static bool IsValidFrameAtPos(cChunkInterface & a_ChunkInterface, Vector3i a_BlockPos, NIBBLETYPE a_ShouldFace) { BLOCKTYPE BlockType; NIBBLETYPE BlockMeta; return ( a_ChunkInterface.GetBlockTypeMeta(a_BlockPos, BlockType, BlockMeta) && (BlockType == E_BLOCK_END_PORTAL_FRAME) && (BlockMeta == (a_ShouldFace | E_META_END_PORTAL_FRAME_EYE)) ); } /** Return true if this block is a portal frame. */ static bool IsPortalFrame(BLOCKTYPE BlockType) { return (BlockType == E_BLOCK_END_PORTAL_FRAME); } virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override { UNUSED(a_Meta); return 27; } };
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/appsync/AppSync_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace AppSync { namespace Model { enum class TypeDefinitionFormat { NOT_SET, SDL, JSON }; namespace TypeDefinitionFormatMapper { AWS_APPSYNC_API TypeDefinitionFormat GetTypeDefinitionFormatForName(const Aws::String& name); AWS_APPSYNC_API Aws::String GetNameForTypeDefinitionFormat(TypeDefinitionFormat value); } // namespace TypeDefinitionFormatMapper } // namespace Model } // namespace AppSync } // namespace Aws
#if defined(__cplusplus) extern "C" { #endif #if __ANDROID_API__ <= 9 int foo() __INTRODUCED_IN(9); #else int foo() __INTRODUCED_IN(10); #endif #if defined(__cplusplus) } #endif
/* * Copyright 2016 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 <openssl/evp.h> #include "utils/s2n_safety.h" DEFINE_POINTER_CLEANUP_FUNC(EVP_PKEY*, EVP_PKEY_free);
/* * * Copyright 2015 gRPC 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. * */ #include <grpc/support/alloc.h> #include <grpc/support/atm.h> #include <grpc/support/log.h> #include <grpc/support/port_platform.h> #include "src/core/lib/support/env.h" #include "src/core/lib/support/string.h" #include <stdio.h> #include <string.h> extern void gpr_default_log(gpr_log_func_args *args); static gpr_atm g_log_func = (gpr_atm)gpr_default_log; static gpr_atm g_min_severity_to_print = GPR_LOG_VERBOSITY_UNSET; const char *gpr_log_severity_string(gpr_log_severity severity) { switch (severity) { case GPR_LOG_SEVERITY_DEBUG: return "D"; case GPR_LOG_SEVERITY_INFO: return "I"; case GPR_LOG_SEVERITY_ERROR: return "E"; } GPR_UNREACHABLE_CODE(return "UNKNOWN"); } void gpr_log_message(const char *file, int line, gpr_log_severity severity, const char *message) { if ((gpr_atm)severity < gpr_atm_no_barrier_load(&g_min_severity_to_print)) { return; } gpr_log_func_args lfargs; memset(&lfargs, 0, sizeof(lfargs)); lfargs.file = file; lfargs.line = line; lfargs.severity = severity; lfargs.message = message; ((gpr_log_func)gpr_atm_no_barrier_load(&g_log_func))(&lfargs); } void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print) { gpr_atm_no_barrier_store(&g_min_severity_to_print, (gpr_atm)min_severity_to_print); } void gpr_log_verbosity_init() { char *verbosity = gpr_getenv("GRPC_VERBOSITY"); gpr_atm min_severity_to_print = GPR_LOG_SEVERITY_ERROR; if (verbosity != NULL) { if (gpr_stricmp(verbosity, "DEBUG") == 0) { min_severity_to_print = (gpr_atm)GPR_LOG_SEVERITY_DEBUG; } else if (gpr_stricmp(verbosity, "INFO") == 0) { min_severity_to_print = (gpr_atm)GPR_LOG_SEVERITY_INFO; } else if (gpr_stricmp(verbosity, "ERROR") == 0) { min_severity_to_print = (gpr_atm)GPR_LOG_SEVERITY_ERROR; } gpr_free(verbosity); } if ((gpr_atm_no_barrier_load(&g_min_severity_to_print)) == GPR_LOG_VERBOSITY_UNSET) { gpr_atm_no_barrier_store(&g_min_severity_to_print, min_severity_to_print); } } void gpr_set_log_function(gpr_log_func f) { gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)(f ? f : gpr_default_log)); }
/***************************************************************************\ ObjList.h Scott Randolph April 22, 1996 Manage the list of active objects to be drawn each frame for a given renderer. \***************************************************************************/ #ifndef _OBJLIST_H_ #define _OBJLIST_H_ #define _NUM_OBJECT_LISTS_ (5) #include "DrawObj.h" // This structure is used in the viewpoint sorting to move objects directly to the list // they should go to, instead of only allowing them to go up or down one level at a time struct TransportStr { DrawableObject *list[_NUM_OBJECT_LISTS_]; float bottom[_NUM_OBJECT_LISTS_]; float top[_NUM_OBJECT_LISTS_]; }; typedef struct UpdateCallBack { void(*fn)(void*, long, const Tpoint*, TransportStr*); void *self; struct UpdateCallBack *prev; struct UpdateCallBack *next; } UpdateCallBack; typedef struct SortCallBack { void(*fn)(void*); void *self; struct SortCallBack *prev; struct SortCallBack *next; } SortCallBack; class ObjectDisplayList { public: ObjectDisplayList(); ~ObjectDisplayList(); void Setup(void) {}; void Cleanup(void) {}; void InsertObject(DrawableObject *object); void RemoveObject(DrawableObject *object); void InsertUpdateCallbacks(UpdateCallBack*, SortCallBack*, void *self); void RemoveUpdateCallbacks(UpdateCallBack*, SortCallBack*, void *self); void UpdateMetrics(const Tpoint *pos); // do update without moving around in lists void UpdateMetrics(long listNo, const Tpoint *pos, TransportStr *transList); void SortForViewpoint(void); void ResetTraversal(void) { nextToDraw = head; }; float GetNextDrawDistance(void) { if (nextToDraw) return nextToDraw->distance; else return -1.0f; }; void DrawBeyond(float ringDistance, int LOD, RenderOTW *renderer); void DrawBeyond(float ringDistance, Render3D *renderer); DrawableObject* GetNearest(void) { return tail; }; DrawableObject* GetNext(void) { return nextToDraw; }; DrawableObject* GetNextAndAdvance(void) { DrawableObject *p = nextToDraw; if (nextToDraw) nextToDraw = nextToDraw->next; return p; }; void InsertionSortLink(DrawableObject **listhead, DrawableObject *listend); void QuickSortLink(DrawableObject **head, DrawableObject *end); // HANDLE WITH CARE... // COBRA - RED - This function is used from a list manager to ask the object to kill itself... // RemoveMe() would just remove the object from the List, KillMe() would deallocate it too void KillMe() { RemoveTheObject = KillTheObject = true; }; void RemoveMe() { RemoveTheObject = true; }; // This function just preloads all objects in the List withing a range // it exits when the list of ojects is fully loaded void PreLoad(class RenderOTW *renderer); protected: DrawableObject *head; DrawableObject *tail; DrawableObject *nextToDraw; UpdateCallBack *updateCBlist; SortCallBack *sortCBlist; bool KillTheObject, RemoveTheObject; }; #endif // _OBJLIST_H_
// Brian Goldman // Implementation of the Linkage Tree Genetic Algorithm // Designed to match the variant in the paper: // "Hierarchical problem solving with the linkage tree genetic algorithm" // by D. Thierens and P. A. N. Bosman #ifndef LTGA_H_ #define LTGA_H_ #include "Population.h" #include "Evaluation.h" #include "Util.h" #include "HillClimb.h" #include "Configuration.h" #include "Optimizer.h" #include <sstream> // Inherits and implements the Optimizer interface class LTGA : public Optimizer { public: LTGA(Random& _rand, shared_ptr<Evaluator> _evaluator, Configuration& _config); bool iterate() override; string finalize() override; create_optimizer(LTGA); private: size_t pop_size; // Configuration option to use only the winners of a binary tournament // during model building. Set by inverting "binary_insert" value bool disable_binary_insert; // Used to store the population and its entropy table Population pop; // Keeps track of the fitnesses of solutions std::unordered_map<vector<bool>, float> fitnesses; // Keeps track of the set of unique solutions in the population std::unordered_set<vector<bool>> pop_set; // Uses a binary tournament between individuals to determine which // solutions are part of the entropy calculations. All solutions are // always added to the next generation. void binary_insert(Random& rand, vector<vector<bool>> & solutions, Population& next_pop); void generation(); hill_climb::pointer hc; // Used for recording purposes shared_ptr<Evaluator> local_counter, cross_counter; std::ostringstream metadata; }; #endif /* LTGA_H_ */
/* * Copyright 2015 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #import "RTCPeerConnectionFactory.h" #include "api/peer_connection_interface.h" #include "api/scoped_refptr.h" NS_ASSUME_NONNULL_BEGIN @interface RTC_OBJC_TYPE (RTCPeerConnectionFactory) () /** * PeerConnectionFactoryInterface created and held by this * RTCPeerConnectionFactory object. This is needed to pass to the underlying * C++ APIs. */ @property(nonatomic, readonly) rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> nativeFactory; @end NS_ASSUME_NONNULL_END
extern zend_class_entry *ice_cli_websocket_client_ce; ZEPHIR_INIT_CLASS(Ice_Cli_Websocket_Client); PHP_METHOD(Ice_Cli_Websocket_Client, connect); PHP_METHOD(Ice_Cli_Websocket_Client, generateKey); PHP_METHOD(Ice_Cli_Websocket_Client, normalizeHeaders); PHP_METHOD(Ice_Cli_Websocket_Client, send); PHP_METHOD(Ice_Cli_Websocket_Client, run); PHP_METHOD(Ice_Cli_Websocket_Client, onMessage); PHP_METHOD(Ice_Cli_Websocket_Client, onTick); ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_cli_websocket_client_connect, 0, 0, 0) #if PHP_VERSION_ID >= 70200 ZEND_ARG_TYPE_INFO(0, address, IS_STRING, 0) #else ZEND_ARG_INFO(0, address) #endif ZEND_ARG_INFO(0, headers) ZEND_END_ARG_INFO() #if PHP_VERSION_ID >= 70200 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ice_cli_websocket_client_generatekey, 0, 0, IS_STRING, 0) #else ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ice_cli_websocket_client_generatekey, 0, 0, IS_STRING, NULL, 0) #endif ZEND_END_ARG_INFO() #if PHP_VERSION_ID >= 70200 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ice_cli_websocket_client_normalizeheaders, 0, 1, IS_ARRAY, 0) #else ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ice_cli_websocket_client_normalizeheaders, 0, 1, IS_ARRAY, NULL, 0) #endif ZEND_ARG_ARRAY_INFO(0, headers, 0) ZEND_END_ARG_INFO() #if PHP_VERSION_ID >= 70200 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ice_cli_websocket_client_send, 0, 1, _IS_BOOL, 0) #else ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ice_cli_websocket_client_send, 0, 1, _IS_BOOL, NULL, 0) #endif #if PHP_VERSION_ID >= 70200 ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) #else ZEND_ARG_INFO(0, data) #endif #if PHP_VERSION_ID >= 70200 ZEND_ARG_TYPE_INFO(0, opcode, IS_STRING, 0) #else ZEND_ARG_INFO(0, opcode) #endif ZEND_END_ARG_INFO() #if PHP_VERSION_ID >= 70100 #if PHP_VERSION_ID >= 70200 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ice_cli_websocket_client_run, 0, 0, IS_VOID, 0) #else ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ice_cli_websocket_client_run, 0, 0, IS_VOID, NULL, 0) #endif ZEND_END_ARG_INFO() #else #define arginfo_ice_cli_websocket_client_run NULL #endif ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_cli_websocket_client_onmessage, 0, 0, 1) ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_cli_websocket_client_ontick, 0, 0, 1) ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(ice_cli_websocket_client_method_entry) { PHP_ME(Ice_Cli_Websocket_Client, connect, arginfo_ice_cli_websocket_client_connect, ZEND_ACC_PUBLIC) PHP_ME(Ice_Cli_Websocket_Client, generateKey, arginfo_ice_cli_websocket_client_generatekey, ZEND_ACC_PROTECTED) PHP_ME(Ice_Cli_Websocket_Client, normalizeHeaders, arginfo_ice_cli_websocket_client_normalizeheaders, ZEND_ACC_PROTECTED) PHP_ME(Ice_Cli_Websocket_Client, send, arginfo_ice_cli_websocket_client_send, ZEND_ACC_PUBLIC) PHP_ME(Ice_Cli_Websocket_Client, run, arginfo_ice_cli_websocket_client_run, ZEND_ACC_PUBLIC) PHP_ME(Ice_Cli_Websocket_Client, onMessage, arginfo_ice_cli_websocket_client_onmessage, ZEND_ACC_PUBLIC) PHP_ME(Ice_Cli_Websocket_Client, onTick, arginfo_ice_cli_websocket_client_ontick, ZEND_ACC_PUBLIC) PHP_FE_END };
// Copyright (c) 2012 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 WEBKIT_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ #include "base/bind.h" #include "base/memory/ref_counted.h" #include "base/platform_file.h" #include "base/time.h" #include "webkit/blob/file_stream_reader.h" #include "webkit/blob/shareable_file_reference.h" #include "webkit/fileapi/file_system_url.h" #include "webkit/storage/webkit_storage_export.h" namespace base { class FilePath; class SequencedTaskRunner; } namespace webkit_blob { class LocalFileStreamReader; } namespace fileapi { class FileSystemContext; // TODO(kinaba,satorux): This generic implementation would work for any // filesystems but remote filesystem should implement its own reader // rather than relying on FileSystemOperation::GetSnapshotFile() which // may force downloading the entire contents for remote files. class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemFileStreamReader : public webkit_blob::FileStreamReader { public: // Creates a new FileReader for a filesystem URL |url| form |initial_offset|. // |expected_modification_time| specifies the expected last modification if // the value is non-null, the reader will check the underlying file's actual // modification time to see if the file has been modified, and if it does any // succeeding read operations should fail with ERR_UPLOAD_FILE_CHANGED error. FileSystemFileStreamReader(FileSystemContext* file_system_context, const FileSystemURL& url, int64 initial_offset, const base::Time& expected_modification_time); virtual ~FileSystemFileStreamReader(); // FileStreamReader overrides. virtual int Read(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback) OVERRIDE; virtual int64 GetLength( const net::Int64CompletionCallback& callback) OVERRIDE; private: int CreateSnapshot(const base::Closure& callback, const net::CompletionCallback& error_callback); void DidCreateSnapshot( const base::Closure& callback, const net::CompletionCallback& error_callback, base::PlatformFileError file_error, const base::PlatformFileInfo& file_info, const base::FilePath& platform_path, const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); scoped_refptr<FileSystemContext> file_system_context_; FileSystemURL url_; const int64 initial_offset_; const base::Time expected_modification_time_; scoped_ptr<webkit_blob::LocalFileStreamReader> local_file_reader_; scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_; bool has_pending_create_snapshot_; base::WeakPtrFactory<FileSystemFileStreamReader> weak_factory_; DISALLOW_COPY_AND_ASSIGN(FileSystemFileStreamReader); }; } // namespace fileapi #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_
/* * Copyright 2011-15 ARM Limited and Contributors. * 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 ARM Limited 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 ARM LIMITED 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 ARM LIMITED AND 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. */ /* * NE10 Library : math/NE10_divc.c */ #include "NE10_types.h" #include "macros.h" #include <assert.h> ne10_result_t ne10_divc_float_c (ne10_float32_t * dst, ne10_float32_t * src, const ne10_float32_t cst, ne10_uint32_t count) { NE10_XC_OPERATION_X_C ( dst[ itr ] = src[ itr ] / cst; ); } ne10_result_t ne10_divc_vec2f_c (ne10_vec2f_t * dst, ne10_vec2f_t * src, const ne10_vec2f_t * cst, ne10_uint32_t count) { NE10_XC_OPERATION_X_C ( dst[ itr ].x = src[ itr ].x / cst->x; dst[ itr ].y = src[ itr ].y / cst->y; ); } ne10_result_t ne10_divc_vec3f_c (ne10_vec3f_t * dst, ne10_vec3f_t * src, const ne10_vec3f_t * cst, ne10_uint32_t count) { NE10_XC_OPERATION_X_C ( dst[ itr ].x = src[ itr ].x / cst->x; dst[ itr ].y = src[ itr ].y / cst->y; dst[ itr ].z = src[ itr ].z / cst->z; ); } ne10_result_t ne10_divc_vec4f_c (ne10_vec4f_t * dst, ne10_vec4f_t * src, const ne10_vec4f_t * cst, ne10_uint32_t count) { NE10_XC_OPERATION_X_C ( dst[ itr ].x = src[ itr ].x / cst->x; dst[ itr ].y = src[ itr ].y / cst->y; dst[ itr ].z = src[ itr ].z / cst->z; dst[ itr ].w = src[ itr ].w / cst->w; ); }
/* Copyright (C) 2008 Vincent Penquerc'h. This file is part of the Kate codec library. Written by Vincent Penquerc'h. Use, distribution and reproduction of this library is governed by a BSD style source license included with this source in the file 'COPYING'. Please read these terms before distributing. */ #ifndef KATE_kstrings_h_GUARD #define KATE_kstrings_h_GUARD #include "kate/kate.h" extern const char *halign2text(kate_float d); extern const char *valign2text(kate_float d); extern const char *metric2text(kate_space_metric d); extern const char *metric2suffix(kate_space_metric d); extern const char *curve2text(kate_curve_type d); extern const char *semantics2text(kate_motion_semantics d); extern const char *mapping2text(kate_motion_mapping d); extern const char *directionality2text(kate_text_directionality d); extern const char *wrap2text(kate_wrap_mode w); extern const char *encoding2text(kate_text_encoding text_encoding); #endif
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins 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 MESSAGES_H #define MESSAGES_H #include <QString> #include <qpa/qplatformmenu.h> QT_BEGIN_NAMESPACE QString msgAboutQt(); QString qt_mac_applicationmenu_string(int type); QPlatformMenuItem::MenuRole detectMenuRole(const QString &caption); QT_END_NAMESPACE #endif // MESSAGES_H
/* * Copyright (C) 2009 Google 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 Google 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 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef WebSocketChannel_h #define WebSocketChannel_h #include "modules/ModulesExport.h" #include "platform/heap/Handle.h" #include "platform/v8_inspector/public/ConsoleTypes.h" #include "wtf/Forward.h" #include "wtf/Noncopyable.h" namespace blink { class BlobDataHandle; class DOMArrayBuffer; class ExecutionContext; class KURL; class WebSocketChannelClient; class MODULES_EXPORT WebSocketChannel : public GarbageCollectedFinalized<WebSocketChannel> { WTF_MAKE_NONCOPYABLE(WebSocketChannel); public: WebSocketChannel() { } static WebSocketChannel* create(ExecutionContext*, WebSocketChannelClient*); enum CloseEventCode { CloseEventCodeNotSpecified = -1, CloseEventCodeNormalClosure = 1000, CloseEventCodeGoingAway = 1001, CloseEventCodeProtocolError = 1002, CloseEventCodeUnsupportedData = 1003, CloseEventCodeFrameTooLarge = 1004, CloseEventCodeNoStatusRcvd = 1005, CloseEventCodeAbnormalClosure = 1006, CloseEventCodeInvalidFramePayloadData = 1007, CloseEventCodePolicyViolation = 1008, CloseEventCodeMessageTooBig = 1009, CloseEventCodeMandatoryExt = 1010, CloseEventCodeInternalError = 1011, CloseEventCodeTLSHandshake = 1015, CloseEventCodeMinimumUserDefined = 3000, CloseEventCodeMaximumUserDefined = 4999 }; virtual bool connect(const KURL&, const String& protocol) = 0; virtual void send(const CString&) = 0; virtual void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength) = 0; virtual void send(PassRefPtr<BlobDataHandle>) = 0; // For WorkerWebSocketChannel. virtual void sendTextAsCharVector(PassOwnPtr<Vector<char>>) = 0; virtual void sendBinaryAsCharVector(PassOwnPtr<Vector<char>>) = 0; // Do not call |send| after calling this method. virtual void close(int code, const String& reason) = 0; // Log the reason text and close the connection. Will call didClose(). // The MessageLevel parameter will be used for the level of the message // shown at the devtool console. // sourceURL and lineNumber parameters may be shown with the reason text // at the devtool console. // Even if sourceURL and lineNumber are specified, they may be ignored // and the "current" url and the line number in the sense of // JavaScript execution may be shown if this method is called in // a JS execution context. // You can specify String() and 0 for sourceURL and lineNumber // respectively, if you can't / needn't provide the information. virtual void fail(const String& reason, MessageLevel, const String& sourceURL, unsigned lineNumber) = 0; // Do not call any methods after calling this method. virtual void disconnect() = 0; // Will suppress didClose(). virtual ~WebSocketChannel() { } DEFINE_INLINE_VIRTUAL_TRACE() { } }; } // namespace blink #endif // WebSocketChannel_h
/* * This software is distributed under BSD 3-clause license (see LICENSE file). * * Authors: Soeren Sonnenburg, Yuyu Zhang */ #ifndef _CONSTKERNEL_H___ #define _CONSTKERNEL_H___ #include <shogun/lib/config.h> #include <shogun/mathematics/Math.h> #include <shogun/lib/common.h> #include <shogun/kernel/Kernel.h> #include <shogun/features/Features.h> namespace shogun { /** @brief The Constant Kernel returns a constant for all elements. * * A ``kernel'' that simply returns a single constant, i.e. * \f$k({\bf x}, {\bf x'})= c\f$ * */ class CConstKernel: public CKernel { public: /** default constructor */ CConstKernel(); /** constructor * * @param c constant c */ CConstKernel(float64_t c); /** constructor * * @param l features of left-hand side * @param r features of right-hand side * @param c constant c */ CConstKernel(CFeatures* l, CFeatures *r, float64_t c); virtual ~CConstKernel(); /** initialize kernel * * @param l features of left-hand side * @param r features of right-hand side * @return if initializing was successful */ virtual bool init(CFeatures* l, CFeatures* r); /** return what type of kernel we are * * @return kernel type CONST */ virtual EKernelType get_kernel_type() { return K_CONST; } /** return feature type the kernel can deal with * * @return feature type ANY */ virtual EFeatureType get_feature_type() { return F_ANY; } /** return feature class the kernel can deal with * * @return feature class ANY */ virtual EFeatureClass get_feature_class() { return C_ANY; } /** return the kernel's name * * @return name Const */ virtual const char* get_name() const { return "ConstKernel"; } protected: /** compute kernel function for features a and b * * @param row dummy row * @param col dummy col * @return computed kernel function (const value) */ virtual float64_t compute(int32_t row, int32_t col) { return const_value; } private: void init(); protected: /** const value */ float64_t const_value; }; } #endif /* _CONSTKERNEL_H__ */
#include <stdlib.h> #include <stdbool.h> #include <ft.h> /// SSL_CTX * ssl_ctx; /// struct addrinfo * resolve(const char * host, const char * port) { int rc; struct addrinfo hints; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = 0; hints.ai_protocol = 0; hints.ai_canonname = NULL; hints.ai_addr = NULL; hints.ai_next = NULL; struct addrinfo * res; rc = getaddrinfo(host, port, &hints, &res); if (rc != 0) { FT_ERROR("getaddrinfo failed: %s", gai_strerror(rc)); return NULL; } return res; } /// bool on_read(struct ft_stream * established_sock, struct ft_frame * frame) { if (frame->type == FT_FRAME_TYPE_RAW_DATA) { ft_frame_flip(frame); ft_frame_fwrite(frame, stdout); } ft_frame_return(frame); return true; } void on_error(struct ft_stream * established_sock) { FT_FATAL("Error on the socket"); exit(EXIT_FAILURE); } struct ft_stream_delegate stream_delegate = { .read = on_read, .error = on_error, }; /// int main(int argc, char const *argv[]) { bool ok; int rc; struct ft_context context; struct ft_stream sock; //ft_config.log_verbose = true; //ft_config.log_trace_mask |= FT_TRACE_ID_STREAM | FT_TRACE_ID_EVENT_LOOP; ft_initialise(); // Load nice OpenSSL error messages SSL_load_error_strings(); ERR_load_crypto_strings(); // Initialize context ok = ft_context_init(&context); if (!ok) return EXIT_FAILURE; // Initialize OpenSSL context ssl_ctx = SSL_CTX_new(SSLv23_client_method()); if (ssl_ctx == NULL) return EXIT_FAILURE; rc = SSL_CTX_load_verify_locations(ssl_ctx, "curl-ca-bundle.crt", NULL); if (rc != 1) return EXIT_FAILURE; struct addrinfo * target_addr; // Resolve target if (argc == 3) { FT_INFO("Target set to %s %s", argv[1], argv[2]); target_addr = resolve( argv[1], argv[2]); } else { FT_INFO("Target set to www.teskalabs.com 443"); target_addr = resolve("www.teskalabs.com", "443"); } if (target_addr == NULL) { FT_ERROR("Cannot resolve target"); return EXIT_FAILURE; } ok = ft_stream_connect(&sock, &stream_delegate, &context, target_addr); if (!ok) return EXIT_FAILURE; freeaddrinfo(target_addr); ft_stream_set_partial(&sock, true); ok = ft_stream_enable_ssl(&sock, ssl_ctx); if (!ok) return EXIT_FAILURE; // Configure SNI SSL_set_tlsext_host_name(sock.ssl, argv[1]); struct ft_frame * frame = ft_pool_borrow(&context.frame_pool, FT_FRAME_TYPE_RAW_DATA); if (frame == NULL) return EXIT_FAILURE; ft_frame_format_simple(frame); struct ft_vec * vec = ft_frame_get_vec(frame); if (vec == NULL) return EXIT_FAILURE; ok = ft_vec_sprintf(vec, "GET / HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n", argv[1]); if (!ok) return EXIT_FAILURE; ft_frame_flip(frame); ok = ft_stream_write(&sock, frame); if (!ok) return EXIT_FAILURE; ok = ft_stream_cntl(&sock, FT_STREAM_WRITE_SHUTDOWN); if (!ok) return EXIT_FAILURE; // Enter event loop ft_context_run(&context); // Finalize context ft_context_fini(&context); return EXIT_SUCCESS; }
//===--- IntegerTypesCheck.h - clang-tidy -----------------------*- 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 LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H #include "../ClangTidyCheck.h" #include <memory> namespace clang { class IdentifierTable; namespace tidy { namespace google { namespace runtime { /// Finds uses of `short`, `long` and `long long` and suggest replacing them /// with `u?intXX(_t)?`. /// /// Corresponding cpplint.py check: 'runtime/int'. class IntegerTypesCheck : public ClangTidyCheck { public: IntegerTypesCheck(StringRef Name, ClangTidyContext *Context); bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { return LangOpts.CPlusPlus && !LangOpts.ObjC; } void registerMatchers(ast_matchers::MatchFinder *Finder) override; void check(const ast_matchers::MatchFinder::MatchResult &Result) override; void storeOptions(ClangTidyOptions::OptionMap &Options) override; private: const std::string UnsignedTypePrefix; const std::string SignedTypePrefix; const std::string TypeSuffix; std::unique_ptr<IdentifierTable> IdentTable; }; } // namespace runtime } // namespace google } // namespace tidy } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H
// Copyright 2014 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 WebRTCOfferOptions_h #define WebRTCOfferOptions_h #include "WebCommon.h" #include "WebNonCopyable.h" #include "WebPrivatePtr.h" namespace blink { class RTCOfferOptions; class BLINK_PLATFORM_EXPORT WebRTCOfferOptions { public: WebRTCOfferOptions(int32_t offerToReceiveAudio, int32_t offerToReceiveVideo, bool voiceActivityDetection, bool iceRestart); WebRTCOfferOptions(const WebRTCOfferOptions& other) { assign(other); } ~WebRTCOfferOptions() { reset(); } WebRTCOfferOptions& operator=(const WebRTCOfferOptions& other) { assign(other); return *this; } void assign(const WebRTCOfferOptions&); void reset(); bool isNull() const { return m_private.isNull(); } int32_t offerToReceiveVideo() const; int32_t offerToReceiveAudio() const; bool voiceActivityDetection() const; bool iceRestart() const; #if INSIDE_BLINK WebRTCOfferOptions(RTCOfferOptions*); #endif private: WebPrivatePtr<RTCOfferOptions> m_private; }; } // namespace blink #endif // WebRTCOfferOptions_h
#include "newarc.h" class OperationDialog { private: string m_strPanelTitle; double m_dPercent; double m_dTotalPercent; string m_strTitle; string m_strSrcFileName; string m_strDestFileName; int m_nOperation; int m_nStage; bool m_bShowSingleFileProgress; public: OperationDialog(); void SetShowSingleFileProgress(bool bShow); void SetOperation(int nOperation, int nStage); void SetPercent(double dPercent, double dTotalPercent); void SetTitle(string strTitle); void SetSrcFileName(string strFileName); void SetDestFileName(string strFileName); void Show(); };
/** * @file * * Define a class that helps handle differences in wchar_t on different OSs */ /****************************************************************************** * * * Copyright (c) 2009-2011, 2014 AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #ifndef _QCC_UNICODE_H #define _QCC_UNICODE_H #include <qcc/platform.h> #if defined(QCC_OS_GROUP_POSIX) #include <qcc/posix/unicode.h> #elif defined(QCC_OS_GROUP_WINDOWS) #include <qcc/windows/unicode.h> #else #error No OS GROUP defined. #endif #endif
#ifndef _RANDOM_H #define _RANDOM_H #include "boost/shared_ptr.hpp" #include "boost/random.hpp" class Random{ public: typedef boost::shared_ptr< Random > randomPtr; typedef boost::mt19937 randomGeneratorType; static randomPtr Get(){ static randomPtr randomGen( new RandomGenerator() ); return randomGen; } void SetSeed(int seed){ randomGenerator.seed( seed ); } int Random( int lowerLimit, int upperLimit ){ boost::uniform_int<> distribution( lowerLimit, upperLimit ); boost::variate_generator< randomGeneratorType&, boost::uniform_int<> > LimitedInt( randomGenerator , distribution ); return LimitedInt(); } private: // prevent creation of more than one object of the LogManager class // use the Get() method to get a shared_ptr to the object Random(): randomGenerator() //initialize randomGenerator with default constructor {} RandomGenerator( const RandomGenerator& orig ){}; randomGeneratorType randomGenerator; }; #endif
#include "time64.h" int diag(const char, ...); void skip_all(const char *); int ok(const int, const char *, ...); int is_int(const int, const int, const char *, ...); int is_str(const char*, const char*, const char *, ...); int is_Int64(const Int64, const Int64, const char *, ...); int is_not_null(void *, const char *); int tm_ok(const struct TM *, const int, const int, const int, const int, const int, const int); int tm_is(const struct TM *, const struct TM *, const char *); struct TM make_tm( int, int, int, int, int, Year ); void done_testing(void);
/* -*- buffer-read-only: t -*- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! * This file is built by regen/unicode_constants.pl from Unicode data. * Any changes made here will be lost! */ #ifndef H_UNICODE_CONSTANTS /* Guard against nested #includes */ #define H_UNICODE_CONSTANTS 1 /* This file contains #defines for various Unicode code points. The values * the macros expand to are the native Unicode code point, or all or portions * of the UTF-8 encoding for the code point. In the former case, the macro * name has the suffix "_NATIVE"; otherwise, the suffix "_UTF8". * * The macros that have the suffix "_UTF8" may have further suffixes, as * follows: * "_FIRST_BYTE" if the value is just the first byte of the UTF-8 * representation; the value will be a numeric constant. * "_TAIL" if instead it represents all but the first byte. This, and * with no additional suffix are both string constants */ #define COMBINING_GRAVE_ACCENT_UTF8 "\xCC\x80" /* U+0300 */ #define COMBINING_ACUTE_ACCENT_UTF8 "\xCC\x81" /* U+0301 */ #define COMBINING_DIAERESIS_UTF8 "\xCC\x88" /* U+0308 */ #define GREEK_SMALL_LETTER_IOTA_UTF8 "\xCE\xB9" /* U+03B9 */ #define GREEK_SMALL_LETTER_UPSILON_UTF8 "\xCF\x85" /* U+03C5 */ #define HYPHEN_UTF8 "\xE2\x80\x90" /* U+2010 */ #define FIRST_SURROGATE_UTF8_FIRST_BYTE 0xED /* U+D800 */ #define DEL_NATIVE 0x7F /* U+007F */ #define LATIN_SMALL_LETTER_SHARP_S_NATIVE 0xDF /* U+00DF */ #define LATIN_SMALL_LETTER_A_WITH_RING_ABOVE_NATIVE 0xE5 /* U+00E5 */ #define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0xC5 /* U+00C5 */ #define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xFF /* U+00FF */ #define MICRO_SIGN_NATIVE 0xB5 /* U+00B5 */ #endif /* H_UNICODE_CONSTANTS */ /* ex: set ro: */
// // INKBrowserHandler.h // IntentKit // // Created by Michael Walker on 11/26/13. // Copyright (c) 2013 Mike Walker. All rights reserved. // #import "INKHandler.h" @class INKActivityPresenter; /** An instance of `INKBrowserHandler` opens http and https URLs in a third-party web browser. */ @interface INKBrowserHandler : INKHandler /** Opens a URL @param url A URL to open. Must have either `http:` or `https:` as its scheme. @return A `INKActivityPresenter` object to present. */ - (INKActivityPresenter *)openURL:(NSURL *)url; /** Opens a URL with a callback @param url A URL to open. Must have either `http:` or `https:` as its scheme. @param callback A URL to be opened by the third-party app when the action has been completed. @see openURL: @return A `INKActivityPresenter` object to present. */ - (INKActivityPresenter *)openURL:(NSURL *)url withCallback:(NSURL *)callback; @end
// // CardboardViewController.h // iosvr // #import <Foundation/Foundation.h> #import <GLKit/GLKit.h> typedef NS_ENUM(NSInteger, CBDEyeType) { CBDEyeTypeMonocular, CBDEyeTypeLeft, CBDEyeTypeRight, }; @interface CBDEye : NSObject @property (nonatomic) CBDEyeType type; - (GLKMatrix4)eyeViewMatrix; - (GLKMatrix4)perspectiveMatrixWithZNear:(float)zNear zFar:(float)zFar; @end @protocol CardboardStereoRendererDelegate <NSObject> - (void)setupRendererWithView:(GLKView *)glView; - (void)shutdownRendererWithView:(GLKView *)glView; - (void)renderViewDidChangeSize:(CGSize)size; - (void)prepareNewFrameWithHeadViewMatrix:(GLKMatrix4)headViewMatrix; - (void)drawEyeWithEye:(CBDEye *)eye; - (void)finishFrameWithViewportRect:(CGRect)viewPort; @optional - (void)magneticTriggerPressed; @end @interface CardboardViewController : GLKViewController @property (nonatomic) GLKView *view; @property (nonatomic, readonly) NSRecursiveLock *glLock; @property (nonatomic, unsafe_unretained) id <CardboardStereoRendererDelegate> stereoRendererDelegate; @property (nonatomic) BOOL vrModeEnabled; @property (nonatomic) BOOL distortionCorrectionEnabled; @property (nonatomic) BOOL vignetteEnabled; @property (nonatomic) BOOL chromaticAberrationCorrectionEnabled; @property (nonatomic) BOOL restoreGLStateEnabled; @property (nonatomic) BOOL neckModelEnabled; @end
#include <sdb.h> #include <assert.h> int main() { Sdb *s = sdb_new0 (); sdb_set (s, "key", "val", 0); sdb_expire_set (s, "key", 3, 0); sleep (1); assert (sdb_const_get (s, "key", 0) != NULL); sleep (3); assert (sdb_const_get (s, "key", 0) == NULL); sdb_free (s); return 0; }
// // ViewController.h // MJExtensionExample // // Created by MJ Lee on 15/11/8. // Copyright © 2015年 小码哥. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
/*------------------------------------------------------------------------ * (The MIT License) * * Copyright (c) 2008-2011 Rhomobile, Inc. * * 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. * * http://rhomobile.com *------------------------------------------------------------------------*/ #import <UIKit/UIKit.h> #import "RhoMainView.h" #import "RhoViewController.h" #import "api_generator/iphone/IMethodResult.h" @interface RhoUITabBarController : UITabBarController { int bkgColor; } @property (nonatomic,assign) int bkgColor; @end @interface RhoCustomTabBarItem : UITabBarItem { UIImage *customHighlightedImage; UIImage *customStdImage; } @property (nonatomic, retain) UIImage *customHighlightedImage; @property (nonatomic, retain) UIImage *customStdImage; @end @interface TabbedMainView : RhoViewController<RhoMainView> { UITabBarController *tabbar; NSArray *tabbarData; int tabindex; id<IMethodResult> on_change_tab_callback; CGRect rootFrame; } @property (nonatomic,retain) UITabBarController *tabbar; @property (nonatomic,retain) NSArray *tabbarData; @property (nonatomic,assign) int tabindex; @property (nonatomic,assign) id<IMethodResult> on_change_tab_callback; - (id)initWithMainView:(id<RhoMainView>)v parent:(UIWindow*)p bar_info:(NSDictionary*)bar_info; - (UIWebView*)getWebView:(int)tab_index; - (void)onViewWillActivate:(RhoViewController*)view; -(void)callCallback:(int)new_index; @end
/* * Misc ARM declarations * * Copyright (c) 2006 CodeSourcery. * Written by Paul Brook * * This code is licensed under the LGPL. * */ #ifndef ARM_MISC_H #define ARM_MISC_H #include "exec/memory.h" void tosa_machine_init(struct uc_struct *uc); void machvirt_machine_init(struct uc_struct *uc); // ARM64 void arm_cpu_register_types(void *opaque); void aarch64_cpu_register_types(void *opaque); #endif /* !ARM_MISC_H */
/* * This file is part of the DOM implementation for KDE. * * Copyright (C) 2007 Rob Buis <buis@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef SVGInlineTextBox_h #define SVGInlineTextBox_h #include "InlineTextBox.h" namespace WebCore { class SVGInlineTextBox : public InlineTextBox { public: SVGInlineTextBox(RenderObject* obj) : InlineTextBox(obj) {} virtual int selectionTop(); virtual int selectionHeight(); }; } // namespace WebCore #endif // SVGInlineTextBox_h
/* vvrtint5.c version 18 Nov 93 */ #include <stdio.h> #include <math.h> #include "grid5d.h" #include "want.h" extern int bug; int vvrtint5 (int ixv) { int i,j; /* index */ int hrzsiz; /* horizontal grid size = nrow * ncol */ int ixh; /* index for gridpoints on horizontal */ int ixp; /* index for pressure levels */ int ixz; /* index for height levels */ int kxz; /* index for the lowest z level to start a search */ float zlevs[NLEV]; /* height levels to interpolate to */ int nplevs; /* number of pressure levels available */ float pcol[NLEV]; /* for each gridpoint the column is put here */ float pvcol[NLEV]; /* variable on pressure surfaces */ float zvcol[NLEV]; /* variable on height surfaces, to be computed */ float logp[NLEV]; float logpv; static int once = 1; /* DEBUG */ if(bug>3) printf("in vvrtint5\n"); if(bug>3) fflush(NULL); /* DEBUG */ if (bug > 3) { once = 1; } else { once = 0; } nplevs = vs[ixv].num; for (ixp=0; ixp<nplevs; ixp++) {logp[ixp] = log((double)plevel[ixp]);} if (nplevs >= NLEV) {printf("vvrtint5: nplevs > NLEV %d > %d\n", nplevs, NLEV); return -1;} if (ig.nver >= NLEV) {printf("vvrtint5: ig.nver > NLEV %d > %d\n", ig.nver, NLEV); return -1;} for (i=0; i<ig.nver; i++) {zlevs[i] = ig.base + ig.incv * i;} hrzsiz = ig.nrow * ig.ncol; kxz = -1; for (ixh=0; ixh<hrzsiz; ixh++) { for (i=0; i<NLEV; i++) {zvcol[i] = 0;} for (i=ixh,j=0; i<hrzsiz*ig.nver; i=i+hrzsiz,j++) {pcol[j] = zgrid5d[i];} for (i=ixh,j=0; i<hrzsiz*nplevs; i=i+hrzsiz,j++) {pvcol[j] = grid5d[i];} kxz = -1; /* find any zlevs below lowest plevel */ for (ixz=0; ixz<ig.nver; ixz++) { if (plevel[0] > pcol[ixz]) break; kxz = ixz; /*zvcol[ixz] = pvcol[0] - (pcol[0]-zlevs[ixz]) * (pvcol[1]-pvcol[0]) / (pcol[1]-pcol[0]);*/ logpv = log((double)pcol[ixz]); zvcol[ixz] = pvcol[0] - (logp[0]-logpv) * (pvcol[0]-pvcol[1]) / (logp[0]-logp[1]); } /* find pcol's between plevel[0] and plevel[nplevs-1] */ kxz++; for (ixp=1; ixp<nplevs; ixp++) { for (ixz=kxz; ixz<ig.nver; ixz++) { if (plevel[ixp] > pcol[ixz]) continue; /*zvcol[ixz] = pvcol[ixp-1] - (pcol[ixp-1]-zlevs[ixz]) * ( (pvcol[ixp]-pvcol[ixp-1]) / (pcol[ixp]-pcol[ixp-1]) );*/ logpv = log((double)pcol[ixz]); zvcol[ixz] = pvcol[ixp] - (logp[ixp]-logpv) * (pvcol[ixp]-pvcol[ixp-1]) / (logp[ixp]-logp[ixp-1]); kxz++; } } /* find pcol's above plevel[nplevs-a] if any */ for (ixz=kxz; ixz<ig.nver; ixz++) { logpv = log((double)pcol[ixz]); zvcol[ixz] = pvcol[nplevs-1] - (logp[nplevs-1]-logpv) * (pvcol[nplevs-1]-pvcol[nplevs-2]) / (logp[nplevs-1]-logp[nplevs-2]); kxz++; } /* put zvcol into the column where pcol was taken from */ for (i=ixh,j=0; i<hrzsiz*ig.nver; i=i+hrzsiz,j++) {vgrid5d[i] = zvcol[j];} } if (once) { for(i=0;i<nplevs;i++) {printf("%6.0f ",plevel[i]);}printf("\n"); /*DEBUG*/ for(i=0;i<nplevs;i++) {printf("%6.0f ",pvcol[i]);}printf("\n"); /*DEBUG*/ for(i=0;i<ig.nver;i++){printf("%6.1f ",pcol[i]);}printf("\n"); /*DEBUG*/ for(i=0;i<ig.nver;i++){printf("%6.1f ",zvcol[i]);}printf("\n"); /*DEBUG*/ once = 0;} /* DEBUG */ if(bug>3) printf("exit vvrtint5\n"); if (bug>2) fflush(NULL); /* DEBUG */ return 0; }
#ifndef __AAA_YUV_TUNING_CUSTOM_H__ #define __AAA_YUV_TUNING_CUSTOM_H__ namespace NSYuvTuning { MUINT32 custom_GetFlashlightGain10X(MINT32 i4SensorDevId); MUINT32 custom_BurstFlashlightGain10X(MINT32 i4SensorDevId); MDOUBLE custom_GetYuvFlashlightThreshold(MINT32 i4SensorDevId); MINT32 custom_GetYuvFlashlightFrameCnt(MINT32 i4SensorDevId); MINT32 custom_GetYuvFlashlightDuty(MINT32 i4SensorDevId); MINT32 custom_GetYuvFlashlightStep(MINT32 i4SensorDevId); MINT32 custom_GetYuvFlashlightHighCurrentDuty(MINT32 i4SensorDevId); MINT32 custom_GetYuvFlashlightHighCurrentTimeout(MINT32 i4SensorDevId); MINT32 custom_GetYuvAfLampSupport(MINT32 i4SensorDevId); MINT32 custom_GetYuvPreflashAF(MINT32 i4SensorDevId); } #endif //__AAA_YUV_TUNING_CUSTOM_H__
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * 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. * */ #ifndef AMIGAOS_FILESYSTEM_H #define AMIGAOS_FILESYSTEM_H #ifdef __USE_INLINE__ #undef __USE_INLINE__ #endif #include <proto/exec.h> #include <proto/dos.h> #include <stdio.h> #ifndef USE_NEWLIB #include <strings.h> #endif #include "backends/fs/abstract-fs.h" /** * Implementation of the ScummVM file system API. * * Parts of this class are documented in the base interface class, AbstractFSNode. */ class AmigaOSFilesystemNode final : public AbstractFSNode { protected: /** * The main file lock. * If this is NULL but _bIsValid is true, then this Node references * the virtual filesystem root. */ BPTR _pFileLock; Common::String _sDisplayName; Common::String _sPath; bool _bIsDirectory; bool _bIsValid; uint32 _nProt; /** * Creates a list with all the volumes present in the root node. */ virtual AbstractFSList listVolumes() const; /** * True if this is the pseudo root filesystem. */ bool isRootNode() const { return _bIsValid && _bIsDirectory && _pFileLock == 0; } public: /** * Creates an AmigaOSFilesystemNode with the root node as path. */ AmigaOSFilesystemNode(); /** * Creates an AmigaOSFilesystemNode for a given path. * * @param path Common::String with the path the new node should point to. */ AmigaOSFilesystemNode(const Common::String &p); /** * Creates an AmigaOSFilesystemNode given its lock and display name. * * @param pLock BPTR to the lock. * @param pDisplayName name to be used for display, in case not supplied the FilePart() of the filename will be used. * * @note This shouldn't even be public as it's only internally, at best it should have been protected if not private. */ AmigaOSFilesystemNode(BPTR pLock, const char *pDisplayName = 0); /** * Copy constructor. * * @note Needed because it duplicates the file lock. */ AmigaOSFilesystemNode(const AmigaOSFilesystemNode &node); /** * Destructor. */ virtual ~AmigaOSFilesystemNode() override; virtual bool exists() const override; virtual Common::U32String getDisplayName() const override { return _sDisplayName; } virtual Common::String getName() const override { return _sDisplayName; } virtual Common::String getPath() const override { return _sPath; } virtual bool isDirectory() const override { return _bIsDirectory; } virtual bool isReadable() const override; virtual bool isWritable() const override; virtual AbstractFSNode *getChild(const Common::String &n) const override; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override; virtual AbstractFSNode *getParent() const override; virtual Common::SeekableReadStream *createReadStream() override; virtual Common::SeekableWriteStream *createWriteStream() override; virtual bool createDirectory() override; }; #endif
/* * Copyright (C) 2012 The Paparazzi Team * * This file is part of paparazzi. * * paparazzi 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, or (at your option) * any later version. * * paparazzi 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 paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "std.h" #include "mcu.h" #include "led.h" #include "mcu_periph/sys_time.h" #include "interrupt_hw.h" static inline void main_periodic_02( void ); static inline void main_periodic_03( void ); static inline void main_periodic_05( uint8_t id ); static inline void main_event( void ); int main(void) { mcu_init(); unsigned int tmr_02 = sys_time_register_timer(0.2, NULL); unsigned int tmr_03 = sys_time_register_timer(0.3, NULL); sys_time_register_timer(0.5, main_periodic_05); mcu_int_enable(); while(1) { if (sys_time_check_and_ack_timer(tmr_02)) main_periodic_02(); if (sys_time_check_and_ack_timer(tmr_03)) main_periodic_03(); main_event(); } return 0; } /* Called from main loop polling */ static inline void main_periodic_02( void ) { #ifdef LED_GREEN LED_TOGGLE(LED_GREEN); #endif } static inline void main_periodic_03( void ) { #ifdef LED_BLUE LED_TOGGLE(LED_BLUE); #endif } /* Called from the systime interrupt handler */ static inline void main_periodic_05( __attribute__((unused)) uint8_t id ) { #ifdef LED_RED LED_TOGGLE(LED_RED); #endif } static inline void main_event( void ) { }
#ifndef __FCEU_SDL_H #define __FCEU_SDL_H #if _SDL2 #include <SDL2/SDL.h> #else #include <SDL.h> #endif #include "main.h" #include "dface.h" #include "input.h" // I'm using this as a #define so the compiler can optimize the // modulo operation #define PERIODIC_SAVE_INTERVAL 5000 // milliseconds const int INVALID_STATE = 99; extern int noGui; extern int isloaded; extern int dendy; extern int pal_emulation; extern bool swapDuty; int LoadGame(const char *path); int CloseGame(void); void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count); uint64 FCEUD_GetTime(); #endif
#ifndef LINUX_HARDIRQ_H #define LINUX_HARDIRQ_H #include <linux/config.h> #include <linux/smp_lock.h> #include <asm/hardirq.h> #define __IRQ_MASK(x) ((1UL << (x))-1) #define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT) #define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT) #define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT) #define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT) #define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT) #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) #define hardirq_count() (preempt_count() & HARDIRQ_MASK) #define softirq_count() (preempt_count() & SOFTIRQ_MASK) #define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK)) /* * Are we doing bottom half or hardware interrupt processing? * Are we in a softirq context? Interrupt context? */ #define in_irq() (hardirq_count()) #define in_softirq() (softirq_count()) #define in_interrupt() (irq_count()) #ifdef CONFIG_PREEMPT # define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked()) # define preemptible() (preempt_count() == 0 && !irqs_disabled()) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) #else # define in_atomic() (preempt_count() != 0) # define preemptible() 0 # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET #endif #ifdef CONFIG_SMP extern void synchronize_irq(unsigned int irq); #else # define synchronize_irq(irq) barrier() #endif #endif /* LINUX_HARDIRQ_H */
#include "builtin.h" #include "cache.h" #include "transport.h" #include "remote.h" static const char ls_remote_usage[] = "git ls-remote [--heads] [--tags] [-u <exec> | --upload-pack <exec>]\n" " [-q|--quiet] [<repository> [<refs>...]]"; /* * Is there one among the list of patterns that match the tail part * of the path? */ static int tail_match(const char **pattern, const char *path) { const char *p; char pathbuf[PATH_MAX]; if (!pattern) return 1; /* no restriction */ if (snprintf(pathbuf, sizeof(pathbuf), "/%s", path) > sizeof(pathbuf)) return error("insanely long ref %.*s...", 20, path); while ((p = *(pattern++)) != NULL) { if (!fnmatch(p, pathbuf, 0)) return 1; } return 0; } int cmd_ls_remote(int argc, const char **argv, const char *prefix) { int i; const char *dest = NULL; int nongit; unsigned flags = 0; int quiet = 0; const char *uploadpack = NULL; const char **pattern = NULL; struct remote *remote; struct transport *transport; const struct ref *ref; setup_git_directory_gently(&nongit); for (i = 1; i < argc; i++) { const char *arg = argv[i]; if (*arg == '-') { if (!prefixcmp(arg, "--upload-pack=")) { uploadpack = arg + 14; continue; } if (!prefixcmp(arg, "--exec=")) { uploadpack = arg + 7; continue; } if (!strcmp("--tags", arg) || !strcmp("-t", arg)) { flags |= REF_TAGS; continue; } if (!strcmp("--heads", arg) || !strcmp("-h", arg)) { flags |= REF_HEADS; continue; } if (!strcmp("--refs", arg)) { flags |= REF_NORMAL; continue; } if (!strcmp("--quiet", arg) || !strcmp("-q", arg)) { quiet = 1; continue; } usage(ls_remote_usage); } dest = arg; i++; break; } if (argv[i]) { int j; pattern = xcalloc(sizeof(const char *), argc - i + 1); for (j = i; j < argc; j++) { int len = strlen(argv[j]); char *p = xmalloc(len + 3); sprintf(p, "*/%s", argv[j]); pattern[j - i] = p; } } remote = remote_get(dest); if (!remote) { if (dest) die("bad repository '%s'", dest); die("No remote configured to list refs from."); } if (!remote->url_nr) die("remote %s has no configured URL", dest); transport = transport_get(remote, NULL); if (uploadpack != NULL) transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack); ref = transport_get_remote_refs(transport); if (transport_disconnect(transport)) return 1; if (!dest && !quiet) fprintf(stderr, "From %s\n", *remote->url); for ( ; ref; ref = ref->next) { if (!check_ref_type(ref, flags)) continue; if (!tail_match(pattern, ref->name)) continue; printf("%s %s\n", sha1_to_hex(ref->old_sha1), ref->name); } return 0; }
/* Copyright (c) 2012, Code Aurora Forum. All rights reserved. * Copyright (c) 2012, LGE Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * 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. * */ #include <linux/init.h> #include <linux/platform_device.h> #include <mach/kgsl.h> #include <mach/msm_bus_board.h> #include <mach/board.h> #include <mach/msm_dcvs.h> #include <mach/socinfo.h> #include "devices.h" #include "board-gk.h" #ifdef CONFIG_MSM_DCVS static struct msm_dcvs_freq_entry grp3d_freq[] = { {0, 0, 333932}, {0, 0, 497532}, {0, 0, 707610}, {0, 0, 844545}, }; static struct msm_dcvs_core_info grp3d_core_info = { .freq_tbl = &grp3d_freq[0], .core_param = { .max_time_us = 100000, .num_freq = ARRAY_SIZE(grp3d_freq), }, .algo_param = { .slack_time_us = 39000, .disable_pc_threshold = 86000, .ss_window_size = 1000000, .ss_util_pct = 95, .em_max_util_pct = 97, .ss_iobusy_conv = 100, }, }; #endif /* CONFIG_MSM_DCVS */ #ifdef CONFIG_MSM_BUS_SCALING static struct msm_bus_vectors grp3d_init_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, { .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors grp3d_low_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(1000), }, { .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(1000), }, }; static struct msm_bus_vectors grp3d_nominal_low_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(2000), }, { .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(2000), }, }; static struct msm_bus_vectors grp3d_nominal_high_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(2656), }, { .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(2656), }, }; static struct msm_bus_vectors grp3d_max_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(4264), }, { .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(4264), }, }; static struct msm_bus_paths grp3d_bus_scale_usecases[] = { { ARRAY_SIZE(grp3d_init_vectors), grp3d_init_vectors, }, { ARRAY_SIZE(grp3d_low_vectors), grp3d_low_vectors, }, { ARRAY_SIZE(grp3d_nominal_low_vectors), grp3d_nominal_low_vectors, }, { ARRAY_SIZE(grp3d_nominal_high_vectors), grp3d_nominal_high_vectors, }, { ARRAY_SIZE(grp3d_max_vectors), grp3d_max_vectors, }, }; static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = { grp3d_bus_scale_usecases, ARRAY_SIZE(grp3d_bus_scale_usecases), .name = "grp3d", }; #endif static struct resource kgsl_3d0_resources[] = { { .name = KGSL_3D0_REG_MEMORY, .start = 0x04300000, /* GFX3D address */ .end = 0x0431ffff, .flags = IORESOURCE_MEM, }, { .name = KGSL_3D0_IRQ, .start = GFX3D_IRQ, .end = GFX3D_IRQ, .flags = IORESOURCE_IRQ, }, }; static const struct kgsl_iommu_ctx kgsl_3d0_iommu0_ctxs[] = { { "gfx3d_user", 0 }, { "gfx3d_priv", 1 }, }; static const struct kgsl_iommu_ctx kgsl_3d0_iommu1_ctxs[] = { { "gfx3d1_user", 0 }, { "gfx3d1_priv", 1 }, }; static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = { { .iommu_ctxs = kgsl_3d0_iommu0_ctxs, .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu0_ctxs), .physstart = 0x07C00000, .physend = 0x07C00000 + SZ_1M - 1, }, { .iommu_ctxs = kgsl_3d0_iommu1_ctxs, .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu1_ctxs), .physstart = 0x07D00000, .physend = 0x07D00000 + SZ_1M - 1, }, }; static struct kgsl_device_platform_data kgsl_3d0_pdata = { .pwrlevel = { { .gpu_freq = 400000000, .bus_freq = 4, .io_fraction = 0, }, { .gpu_freq = 320000000, .bus_freq = 3, .io_fraction = 33, }, { .gpu_freq = 200000000, .bus_freq = 2, .io_fraction = 100, }, { .gpu_freq = 128000000, .bus_freq = 1, .io_fraction = 100, }, { .gpu_freq = 27000000, .bus_freq = 0, }, }, .init_level = 1, .num_levels = 5, .set_grp_async = NULL, .idle_timeout = HZ/10, .nap_allowed = true, .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE, #ifdef CONFIG_MSM_BUS_SCALING .bus_scale_table = &grp3d_bus_scale_pdata, #endif .iommu_data = kgsl_3d0_iommu_data, .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data), #ifdef CONFIG_MSM_DCVS .core_info = &grp3d_core_info, #endif }; struct platform_device device_kgsl_3d0 = { .name = "kgsl-3d0", .id = 0, .num_resources = ARRAY_SIZE(kgsl_3d0_resources), .resource = kgsl_3d0_resources, .dev = { .platform_data = &kgsl_3d0_pdata, }, }; void __init apq8064_init_gpu(void) { unsigned int version = socinfo_get_version(); if (cpu_is_apq8064ab()) kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000; if (SOCINFO_VERSION_MAJOR(version) == 2) { kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 2); } else { if ((SOCINFO_VERSION_MAJOR(version) == 1) && (SOCINFO_VERSION_MINOR(version) == 1)) kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 1); else kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 0); } platform_device_register(&device_kgsl_3d0); }
// -*- C++ -*- /* Author: Emery Berger, http://www.cs.umass.edu/~emery Copyright (c) 2007-8 Emery Berger, University of Massachusetts Amherst. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * @file xdefines.h * @brief Some definitions which maybe modified in the future. * @author Emery Berger <http://www.cs.umass.edu/~emery> * @author Tongping Liu <http://www.cs.umass.edu/~tonyliu> * @author Charlie Curtsinger <http://www.cs.umass.edu/~charlie> */ #ifndef _XDEFINES_H_ #define _XDEFINES_H_ #include <sys/types.h> #include <syscall.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> #include "prof.h" typedef struct runtime_data { volatile unsigned long thread_index; struct runtime_stats stats; } runtime_data_t; extern runtime_data_t *global_data; class xdefines { public: enum { STACK_SIZE = 1024 * 1024 } ; // 1 * 1048576 }; //enum { PROTECTEDHEAP_SIZE = 1048576UL * 2048}; // FIX ME 512 }; #ifdef X86_32BIT enum { PROTECTEDHEAP_SIZE = 1048576UL * 1024}; // FIX ME 512 }; #else enum { PROTECTEDHEAP_SIZE = 1048576UL * 4096}; // FIX ME 512 }; #endif enum { PROTECTEDHEAP_CHUNK = 10485760 }; enum { MAX_GLOBALS_SIZE = 1048576UL * 40 }; enum { INTERNALHEAP_SIZE = 1048576UL * 100 }; // FIXME 10M enum { PageSize = 4096UL }; enum { PAGE_SIZE_MASK = (PageSize-1) }; enum { NUM_HEAPS = 32 }; // was 16 enum { LOCK_OWNER_BUDGET = 10 }; }; #endif
/* * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting * Copyright (c) 2004-2005 Atheros Communications, Inc. * Copyright (c) 2007 Jiri Slaby <jirislaby@gmail.com> * Copyright (c) 2009 Bob Copeland <me@bobcopeland.com> * * 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, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any * redistribution must be conditioned upon including a substantially * similar Disclaimer requirement for further binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * NO WARRANTY * 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 NONINFRINGEMENT, MERCHANTIBILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. * */ #include <linux/pci.h> #include "ath5k.h" #include "base.h" #define ATH_SDEVICE(subv,subd) \ .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \ .subvendor = (subv), .subdevice = (subd) #define ATH_LED(pin,polarity) .driver_data = (((pin) << 8) | (polarity)) #define ATH_PIN(data) ((data) >> 8) #define ATH_POLARITY(data) ((data) & 0xff) /* Devices we match on for LED config info (typically laptops) */ static const struct pci_device_id ath5k_led_devices[] = { /* AR5211 */ { PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5211), ATH_LED(0, 0) }, /* HP Compaq nc6xx, nc4000, nx6000 */ { ATH_SDEVICE(PCI_VENDOR_ID_COMPAQ, PCI_ANY_ID), ATH_LED(1, 1) }, /* Acer Aspire One A150 (maximlevitsky@gmail.com) */ { ATH_SDEVICE(PCI_VENDOR_ID_FOXCONN, 0xe008), ATH_LED(3, 0) }, /* Acer Ferrari 5000 (russ.dill@gmail.com) */ { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0422), ATH_LED(1, 1) }, /* E-machines E510 (tuliom@gmail.com) */ { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428), ATH_LED(3, 0) }, /* Acer Extensa 5620z (nekoreeve@gmail.com) */ { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105), ATH_LED(3, 0) }, /* Fukato Datacask Jupiter 1014a (mrb74@gmx.at) */ { ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) }, /* IBM ThinkPad AR5BXB6 (legovini@spiro.fisica.unipd.it) */ { ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) }, /* HP Compaq C700 (nitrousnrg@gmail.com) */ { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) }, /* IBM-specific AR5212 (all others) */ { PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_IBM), ATH_LED(0, 0) }, { } }; void ath5k_led_enable(struct ath5k_softc *sc) { if (test_bit(ATH_STAT_LEDSOFT, sc->status)) { ath5k_hw_set_gpio_output(sc->ah, sc->led_pin); ath5k_led_off(sc); } } static void ath5k_led_on(struct ath5k_softc *sc) { if (!test_bit(ATH_STAT_LEDSOFT, sc->status)) return; ath5k_hw_set_gpio(sc->ah, sc->led_pin, sc->led_on); } void ath5k_led_off(struct ath5k_softc *sc) { if (!test_bit(ATH_STAT_LEDSOFT, sc->status)) return; ath5k_hw_set_gpio(sc->ah, sc->led_pin, !sc->led_on); } static void ath5k_led_brightness_set(struct led_classdev *led_dev, enum led_brightness brightness) { struct ath5k_led *led = container_of(led_dev, struct ath5k_led, led_dev); if (brightness == LED_OFF) ath5k_led_off(led->sc); else ath5k_led_on(led->sc); } static int ath5k_register_led(struct ath5k_softc *sc, struct ath5k_led *led, const char *name, char *trigger) { int err; led->sc = sc; strncpy(led->name, name, sizeof(led->name)); led->led_dev.name = led->name; led->led_dev.default_trigger = trigger; led->led_dev.brightness_set = ath5k_led_brightness_set; err = led_classdev_register(&sc->pdev->dev, &led->led_dev); if (err) { ATH5K_WARN(sc, "could not register LED %s\n", name); led->sc = NULL; } return err; } static void ath5k_unregister_led(struct ath5k_led *led) { if (!led->sc) return; led_classdev_unregister(&led->led_dev); ath5k_led_off(led->sc); led->sc = NULL; } void ath5k_unregister_leds(struct ath5k_softc *sc) { ath5k_unregister_led(&sc->rx_led); ath5k_unregister_led(&sc->tx_led); } int ath5k_init_leds(struct ath5k_softc *sc) { int ret = 0; struct ieee80211_hw *hw = sc->hw; struct pci_dev *pdev = sc->pdev; char name[ATH5K_LED_MAX_NAME_LEN + 1]; const struct pci_device_id *match; match = pci_match_id(&ath5k_led_devices[0], pdev); if (match) { __set_bit(ATH_STAT_LEDSOFT, sc->status); sc->led_pin = ATH_PIN(match->driver_data); sc->led_on = ATH_POLARITY(match->driver_data); } if (!test_bit(ATH_STAT_LEDSOFT, sc->status)) goto out; ath5k_led_enable(sc); snprintf(name, sizeof(name), "ath5k-%s::rx", wiphy_name(hw->wiphy)); ret = ath5k_register_led(sc, &sc->rx_led, name, ieee80211_get_rx_led_name(hw)); if (ret) goto out; snprintf(name, sizeof(name), "ath5k-%s::tx", wiphy_name(hw->wiphy)); ret = ath5k_register_led(sc, &sc->tx_led, name, ieee80211_get_tx_led_name(hw)); out: return ret; }
/* wolfssl_demo.h * * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfSSL. * * wolfSSL 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. * * wolfSSL 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-1335, USA */ #ifndef WOLFSSL_DEMO_H_ #define WOLFSSL_DEMO_H_ #define FREQ 10000 /* Hz */ /* Enable wolfcrypt test */ /* can be enabled with benchmark test */ /* #define CRYPT_TEST */ /* Enable benchmark */ /* can be enabled with cyrpt test */ /* #define BENCHMARK */ /* Enable TLS client */ /* cannot enable with other definition */ /* #define TLS_CLIENT */ /* Enable TLS server */ /* cannot enable with other definition */ /* #define TLS_SERVER */ void wolfSSL_TLS_client_init(); void wolfSSL_TLS_client(); void wolfSSL_TLS_server_init(); void wolfSSL_TLS_server(); #endif /* WOLFSSL_DEMO_H_ */
#include <typedefs.h> #include <osl.h> #include <epivers.h> #include <bcmutils.h> #include <bcmendian.h> #include <dngl_stats.h> #include <dhd.h> #include <dhd_dbg.h> extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len); #ifdef CONFIG_CONTROL_PM extern bool g_PMcontrol; #endif void sec_dhd_config_pm(dhd_pub_t *dhd, uint power_mode) { #ifdef CONFIG_CONTROL_PM struct file *fp = NULL; char* filepath = "/data/.psm.info"; char iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Set PowerSave mode */ fp = filp_open(filepath, O_RDONLY, 0); if(IS_ERR(fp))// the file is not exist { /* Set PowerSave mode */ dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM, (char *)&power_mode, sizeof(power_mode)); fp = filp_open(filepath, O_RDWR | O_CREAT, 0666); if(IS_ERR(fp)||(fp==NULL)) { DHD_ERROR(("[WIFI] %s: File open error\n", filepath)); } else { char buffer[2] = {1}; if(fp->f_mode & FMODE_WRITE) { sprintf(buffer,"1\n"); fp->f_op->write(fp, (const char *)buffer, sizeof(buffer), &fp->f_pos); } } } else { char buffer[1] = {0}; kernel_read(fp, fp->f_pos, buffer, 1); if(strncmp(buffer, "1",1)==0) { /* Set PowerSave mode */ dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM, (char *)&power_mode, sizeof(power_mode)); } else { /*Disable Power save features for CERTIFICATION*/ power_mode = 0; g_PMcontrol = TRUE; dhd_roam = 1; /* Set PowerSave mode */ dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM, (char *)&power_mode, sizeof(power_mode)); /* Disable MPC */ bcm_mkiovar("mpc", (char *)&power_mode, 4, iovbuf, sizeof(iovbuf)); dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); fp = filp_open(filepath, O_RDWR | O_CREAT, 0666); if(IS_ERR(fp)||(fp==NULL)) { DHD_ERROR(("[WIFI] %s: File open error\n", filepath)); } else { char buffer[2] = {1}; if(fp->f_mode & FMODE_WRITE) { sprintf(buffer,"1\n"); fp->f_op->write(fp, (const char *)buffer, sizeof(buffer), &fp->f_pos); } } } } if(fp) filp_close(fp, NULL); #else /* Set PowerSave mode */ dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM, (char *)&power_mode, sizeof(power_mode)); #endif } #ifdef WRITE_MACADDR int dhd_write_macaddr(char *addr) { struct file *fp = NULL; char filepath[40] = {0}; char macbuffer[18]= {0}; int ret = 0; mm_segment_t oldfs= {0}; strcpy(filepath, "/data/.mac.info"); fp = filp_open(filepath, O_RDONLY, 0); if(IS_ERR(fp)) { /* File Doesn't Exist. Create and write mac addr.*/ fp = filp_open(filepath, O_RDWR | O_CREAT, 0666); if(IS_ERR(fp)) { fp = NULL; DHD_ERROR(("[WIFI] %s: File open error \n", filepath)); return -1; } oldfs = get_fs(); set_fs(get_ds()); sprintf(macbuffer,"%02X:%02X:%02X:%02X:%02X:%02X\n", addr[0],addr[1],addr[2],addr[3],addr[4],addr[5]); if(fp->f_mode & FMODE_WRITE) { ret = fp->f_op->write(fp, (const char *)macbuffer, sizeof(macbuffer), &fp->f_pos); DHD_INFO(("[WIFI] Mac address [%s] written into File:%s \n", macbuffer, filepath)); } set_fs(oldfs); } if(fp) filp_close(fp, NULL); return 0; } #endif /* WRITE_MACADDR */
/* * This file is part of the coreboot project. * * Copyright (C) 2004 Tyan Computer * Written by Yinghai Lu <yhlu@tyan.com> for Tyan Computer. * Copyright (C) 2006,2007 AMD * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD. * * 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. */ #include <console/console.h> #include <device/device.h> #include <device/smbus.h> #include <device/pci.h> #include <device/pci_ids.h> #include <device/pci_ops.h> #include <arch/io.h> #include <delay.h> #include "mcp55.h" static int phy_read(u8 *base, unsigned phy_addr, unsigned phy_reg) { u32 dword; unsigned loop = 0x100; write32(base + 0x190, 0x8000); /* Clear MDIO lock bit. */ mdelay(1); dword = read32(base + 0x190); if (dword & (1 << 15)) return -1; write32(base + 0x180, 1); write32(base + 0x190, (phy_addr << 5) | (phy_reg)); do { dword = read32(base + 0x190); if (--loop==0) return -4; } while ((dword & (1 << 15))); dword = read32(base + 0x180); if (dword & 1) return -3; dword = read32(base + 0x194); return dword; } static void phy_detect(u8 *base) { u32 dword; int i, val; unsigned id; dword = read32(base + 0x188); dword &= ~(1 << 20); write32(base + 0x188, dword); phy_read(base, 0, 1); for (i = 1; i <= 32; i++) { int phyaddr = i & 0x1f; val = phy_read(base, phyaddr, 1); if (val < 0) continue; if ((val & 0xffff) == 0xffff) continue; if ((val & 0xffff) == 0) continue; if (!(val & 1)) break; /* Ethernet PHY */ val = phy_read(base, phyaddr, 3); if (val < 0 || val == 0xffff) continue; id = val & 0xfc00; val = phy_read(base, phyaddr, 2); if (val < 0 || val == 0xffff) continue; id |= ((val & 0xffff) << 16); printk(BIOS_DEBUG, "MCP55 MAC PHY ID 0x%08x PHY ADDR %d\n", id, i); // if ((id == 0xe0180000) || (id == 0x0032cc00)) break; } if (i > 32) printk(BIOS_DEBUG, "MCP55 MAC PHY not found\n"); } static void nic_init(struct device *dev) { u8 *base; u32 mac_h = 0, mac_l = 0; int eeprom_valid = 0; struct southbridge_nvidia_mcp55_config *conf; static u32 nic_index = 0; struct resource *res; res = find_resource(dev, 0x10); if (!res) return; base = res2mmio(res, 0, 0); phy_detect(base); #define NvRegPhyInterface 0xC0 #define PHY_RGMII 0x10000000 write32(base + NvRegPhyInterface, PHY_RGMII); conf = dev->chip_info; if (conf->mac_eeprom_smbus != 0) { // read MAC address from EEPROM at first struct device *dev_eeprom; dev_eeprom = dev_find_slot_on_smbus(conf->mac_eeprom_smbus, conf->mac_eeprom_addr); if (dev_eeprom) { // if that is valid we will use that unsigned char dat[6]; int status; int i; for (i=0;i<6;i++) { status = smbus_read_byte(dev_eeprom, i); if (status < 0) break; dat[i] = status & 0xff; } if (status >= 0) { mac_l = 0; for (i=3;i>=0;i--) { mac_l <<= 8; mac_l += dat[i]; } if (mac_l != 0xffffffff) { mac_l += nic_index; mac_h = 0; for (i=5;i>=4;i--) { mac_h <<= 8; mac_h += dat[i]; } eeprom_valid = 1; } } } } // if that is invalid we will read that from romstrap if (!eeprom_valid) { u32 *mac_pos; mac_pos = (u32 *)0xffffffd0; // refer to romstrap.inc and romstrap.ld mac_l = read32(mac_pos) + nic_index; // overflow? mac_h = read32(mac_pos + 1); } #if 1 // set that into NIC MMIO #define NvRegMacAddrA 0xA8 #define NvRegMacAddrB 0xAC write32(base + NvRegMacAddrA, mac_l); write32(base + NvRegMacAddrB, mac_h); #else // set that into NIC pci_write_config32(dev, 0xa8, mac_l); pci_write_config32(dev, 0xac, mac_h); #endif nic_index++; } static struct device_operations nic_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = nic_init, .scan_bus = 0, // .enable = mcp55_enable, .ops_pci = &mcp55_pci_ops, }; static const struct pci_driver nic_driver __pci_driver = { .ops = &nic_ops, .vendor = PCI_VENDOR_ID_NVIDIA, .device = PCI_DEVICE_ID_NVIDIA_MCP55_NIC, }; static const struct pci_driver nic_bridge_driver __pci_driver = { .ops = &nic_ops, .vendor = PCI_VENDOR_ID_NVIDIA, .device = PCI_DEVICE_ID_NVIDIA_MCP55_NIC_BRIDGE, };
#ifndef __CLASSES_H__ #define __CLASSES_H__ #include <qobject.h> #ifdef CLASSES_MAKE_DLL #define CLASSES_EXPORT Q_DECL_EXPORT #else #define CLASSES_EXPORT Q_DECL_IMPORT #endif /** * \defgroup Classes Classes - auto-generated classes to access database tables * \details Classes are defined using the app @ref classmaker * All fields defined have mutators, and indexes have static methods to retrieve a @ref RecordList of @ref stone objects. * Additional methods for a database class can be defined in the base/ directory. */ CLASSES_EXPORT void classes_loader(); namespace Stone { class Schema; class Database; } using namespace Stone; CLASSES_EXPORT Schema * classesSchema(); CLASSES_EXPORT Database * classesDb(); #endif // CLASSES_H
#include "actuators.h" #include "armVIC.h" #include "generated/airframe.h" #include "sys_time.h" uint16_t servos_values[_4015_NB_CHANNELS]; #define PWMMR_SERV0 PWMMR5 #define PWMMR_SERV1 PWMMR2 #define PWMLER_LATCH_SERV0 PWMLER_LATCH5 #define PWMLER_LATCH_SERV1 PWMLER_LATCH2 #define PWMMCR_MRI_SERV0 PWMMCR_MR5I #define PWMMCR_MRI_SERV1 PWMMCR_MR2I #define PWMPCR_ENA_SERV0 PWMPCR_ENA5 #define PWMPCR_ENA_SERV1 PWMPCR_ENA2 #define PWMIR_MRI_SERV0 PWMIR_MR5I #define PWMIR_MRI_SERV1 PWMIR_MR2I void actuators_init ( void ) { /* PWM selected as IRQ */ VICIntSelect &= ~VIC_BIT(VIC_PWM); /* PWM interrupt enabled */ VICIntEnable = VIC_BIT(VIC_PWM); VICVectCntl3 = VIC_ENABLE | VIC_PWM; /* address of the ISR */ VICVectAddr3 = (uint32_t)PWM_ISR; /* PW5 pin (P0.21) used for PWM */ IO0DIR |= _BV(SERV1_CLOCK_PIN); IO1DIR |= _BV(SERV1_DATA_PIN) | _BV(SERV1_RESET_PIN); SERV1_CLOCK_PINSEL |= SERV1_CLOCK_PINSEL_VAL << SERV1_CLOCK_PINSEL_BIT; /* set match5 to go of a long time from now */ PWMMR0 = 0XFFFFFF; PWMMR_SERV1 = 0XFFF; /* commit above change */ PWMLER = PWMLER_LATCH0 | PWMLER_LATCH_SERV1; /* interrupt on PWMMR5 match */ PWMMCR = PWMMCR_MR0R | PWMMCR_MRI_SERV1; /* enable PWM5 ouptput */ PWMPCR = PWMPCR_ENA_SERV1; /* Prescaler */ PWMPR = PWM_PRESCALER-1; /* enable PWM timer counter and PWM mode */ PWMTCR = PWMTCR_COUNTER_ENABLE | PWMTCR_PWM_ENABLE; /* Load failsafe values */ /* Set all servos at their midpoints */ /* compulsory for unaffected servos */ uint8_t i; for( i=0 ; i < _4015_NB_CHANNELS ; i++ ) servos_values[i] = SERVOS_TICS_OF_USEC(1500); #ifdef SERVO_MOTOR servos_values[SERVO_MOTOR] = SERVOS_TICS_OF_USEC(SERVO_MOTOR_NEUTRAL); #endif #ifdef SERVO_MOTOR_LEFT servos_values[SERVO_MOTOR_LEFT] = SERVOS_TICS_OF_USEC(SERVO_MOTOR_LEFT_NEUTRAL); #endif #ifdef SERVO_MOTOR_RIGHT servos_values[SERVO_RIGHT_MOTOR] = SERVOS_TICS_OF_USEC(SERVO_MOTOR_RIGHT_NEUTRAL); #endif #ifdef SERVO_HATCH servos_values[SERVO_HATCH] = SERVOS_TICS_OF_USEC(SERVO_HATCH_NEUTRAL); #endif } #define SERVO_REFRESH_TICS SERVOS_TICS_OF_USEC(25000) static uint8_t servos_idx = 0; static uint32_t servos_delay; void PWM_ISR ( void ) { ISR_ENTRY(); // LED_TOGGLE(2); if (servos_idx == 0) { IO1CLR = _BV(SERV1_RESET_PIN); IO1SET = _BV(SERV1_DATA_PIN); PWMMR0 = servos_values[servos_idx]; servos_delay = SERVO_REFRESH_TICS - servos_values[servos_idx]; PWMLER = PWMLER_LATCH0; servos_idx++; } else if (servos_idx < _4015_NB_CHANNELS) { IO1CLR = _BV(SERV1_DATA_PIN); PWMMR0 = servos_values[servos_idx]; servos_delay -= servos_values[servos_idx]; PWMLER = PWMLER_LATCH0; servos_idx++; } else { IO1SET = _BV(SERV1_RESET_PIN); PWMMR0 = servos_delay; PWMLER = PWMLER_LATCH0; servos_idx = 0; } /* clear the interrupt */ PWMIR = PWMIR_MRI_SERV1; VICVectAddr = 0x00000000; ISR_EXIT(); }
/*-------------------------------------------------------------------------------------------------------*\ | Adium, Copyright (C) 2001-2005, Adam Iser (adamiser@mac.com | http://www.adiumx.com) | \---------------------------------------------------------------------------------------------------------/ | This program is free software; you can redistribute it and/or modify it under the terms of the GNU | General Public License as published by the Free Software Foundation; either version 2 of the License, | or (at your option) any later version. | | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even | the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | Public License for more details. | | You should have received a copy of the GNU General Public License along with this program; if not, | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \------------------------------------------------------------------------------------------------------ */ @interface NSGradient (AIGradientAdditions) /*! * @brief Create a gradient for a selected control * * Use the system selectedControl color to create a gradient. This gradient is appropriate * for a Tiger-style selected highlight. * * @return An autoreleased \c NSGradient for a selected control */ + (NSGradient*)selectedControlGradient; @end
/* mpfr_check -- Check if a floating-point number has not been corrupted. Copyright 2003, 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by the Arenaire and Cacao projects, INRIA. This file is part of the GNU MPFR Library. The GNU MPFR Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The GNU MPFR 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 the GNU MPFR Library; see the file COPYING.LESSER. If not, see http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mpfr-impl.h" /* * Check if x is a valid mpfr_t initializes by mpfr_init * Returns 0 if isn't valid */ int mpfr_check (mpfr_srcptr x) { mp_size_t s, i; mp_limb_t tmp; volatile mp_limb_t *xm; int rw; /* Check Sign */ if (MPFR_SIGN(x) != MPFR_SIGN_POS && MPFR_SIGN(x) != MPFR_SIGN_NEG) return 0; /* Check Precision */ if ( (MPFR_PREC(x) < MPFR_PREC_MIN) || (MPFR_PREC(x) > MPFR_PREC_MAX)) return 0; /* Check Mantissa */ xm = MPFR_MANT(x); if (!xm) return 0; /* Check size of mantissa */ s = MPFR_GET_ALLOC_SIZE(x); if (s<=0 || s > MP_SIZE_T_MAX || MPFR_PREC(x) > ((mpfr_prec_t)s*GMP_NUMB_BITS)) return 0; /* Acces all the mp_limb of the mantissa: may do a seg fault */ for(i = 0 ; i < s ; i++) tmp = xm[i]; /* Check if it isn't singular*/ if (MPFR_IS_PURE_FP(x)) { /* Check first mp_limb of mantissa (Must start with a 1 bit) */ if ( ((xm[MPFR_LIMB_SIZE(x)-1])>>(GMP_NUMB_BITS-1)) == 0) return 0; /* Check last mp_limb of mantissa */ rw = (MPFR_PREC(x) % GMP_NUMB_BITS); if (rw != 0) { tmp = MPFR_LIMB_MASK (GMP_NUMB_BITS - rw); if ((xm[0] & tmp) != 0) return 0; } /* Check exponent range */ if ((MPFR_EXP (x) < __gmpfr_emin) || (MPFR_EXP (x) > __gmpfr_emax)) return 0; } else { /* Singular value is zero, inf or nan */ MPFR_ASSERTD(MPFR_IS_ZERO(x) || MPFR_IS_NAN(x) || MPFR_IS_INF(x)); } return 1; }
/* Unwinding of DW_CFA_GNU_negative_offset_extended test program. Copyright 2007-2020 Free Software Foundation, Inc. This file is part of GDB. 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/>. */ #include <stdlib.h> /* i386-gnu-cfi-asm.S: */ extern void *gate (void *(*gate) (void *data), void *data); int main (void) { gate ((void *(*) (void *data)) abort, NULL); return 0; }
/* * Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * 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, see <http://www.gnu.org/licenses/>. */ /** \addtogroup u2w User to World Communication * @{ * \file WorldSocketMgr.h * \author Derex <derex101@gmail.com> */ #ifndef __WORLDSOCKETMGR_H #define __WORLDSOCKETMGR_H #include "SocketMgr.h" class WorldSocket; /// Manages all sockets connected to peers and network threads class TC_GAME_API WorldSocketMgr : public SocketMgr<WorldSocket> { typedef SocketMgr<WorldSocket> BaseSocketMgr; public: static WorldSocketMgr& Instance(); /// Start network, listen at address:port . bool StartWorldNetwork(Trinity::Asio::IoContext& ioContext, std::string const& bindIp, uint16 port, int networkThreads); /// Stops all network threads, It will wait for all running threads . void StopNetwork() override; void OnSocketOpen(tcp::socket&& sock, uint32 threadIndex) override; std::size_t GetApplicationSendBufferSize() const { return _socketApplicationSendBufferSize; } protected: WorldSocketMgr(); NetworkThread<WorldSocket>* CreateThreads() const override; private: int32 _socketSystemSendBufferSize; int32 _socketApplicationSendBufferSize; bool _tcpNoDelay; }; #define sWorldSocketMgr WorldSocketMgr::Instance() #endif /// @}
/**************************************************************************** * FileName : tcc353x_user_defines.h * Description : user defined **************************************************************************** * * TCC Version 1.0 * Copyright (c) Telechips Inc. * All rights reserved This source code contains confidential information of Telechips. Any unauthorized use without a written permission of Telechips including not limited to re- distribution in source or binary form is strictly prohibited. This source code is provided "AS IS" and nothing contained in this source code shall constitute any express or implied warranty of any kind, including without limitation, any warranty of merchantability, fitness for a particular purpose or non-infringement of any patent, copyright or other third party intellectual property right. No warranty is made, express or implied, regarding the information's accuracy, completeness, or performance. In no event shall Telechips be liable for any claim, damages or other liability arising from, out of or in connection with this source code or the use in the source code. This source code is provided subject to the terms of a Mutual Non-Disclosure Agreement between Telechips and Company. * ****************************************************************************/ #ifndef __TCC353X_USER_DEFINES_H__ #define __TCC353X_USER_DEFINES_H__ #if defined (_MODEL_TCC3535_) #define _TCC3535_ROM_MASK_VER_ #endif /* Remap Type, init PC */ #ifndef _USE_TMM_CSPI_ONLY_ /* normal case */ #define TCC353X_REMAP_TYPE 0x04 #if defined (_MODEL_TCC3535_) && defined (_TCC3535_ROM_MASK_VER_) #define TCC353X_INIT_PC_H 0x00 #define TCC353X_INIT_PC_L 0x00 #else #define TCC353X_INIT_PC_H 0xC0 #define TCC353X_INIT_PC_L 0x00 #endif #else /* tmm cspi only case */ #define TCC353X_REMAP_TYPE 0x03 #if defined (_MODEL_TCC3535_) && defined (_TCC3535_ROM_MASK_VER_) #define TCC353X_INIT_PC_H 0x00 #define TCC353X_INIT_PC_L 0x00 #else #define TCC353X_INIT_PC_H 0xC0 #define TCC353X_INIT_PC_L 0x00 #endif #endif /* out buffer config */ #ifndef _USE_TMM_CSPI_ONLY_ /* normal case */ #define TCC353X_BUFF_A_START 0x00018000 #define TCC353X_BUFF_A_END 0x00019f93 #define TCC353X_BUFF_B_START 0x00018000 #define TCC353X_BUFF_B_END 0x00019f93 #define TCC353X_BUFF_C_START 0x00018000 #define TCC353X_BUFF_C_END 0x00019f93 #define TCC353X_BUFF_D_START 0x00018000 #define TCC353X_BUFF_D_END 0x00019f93 #else /* tmm cspi only case */ #define TCC353X_BUFF_A_START 0x00010000 #define TCC353X_BUFF_A_END 0x00027F57 /* inside driver fix */ #define TCC353X_BUFF_B_START 0x00018000 #define TCC353X_BUFF_B_END 0x00019f93 #define TCC353X_BUFF_C_START 0x00018000 #define TCC353X_BUFF_C_END 0x00019f93 #define TCC353X_BUFF_D_START 0x00018000 #define TCC353X_BUFF_D_END 0x00019f93 #endif /* set stream threshold (using interrupt) */ #define TCC353X_STREAM_THRESHOLD_SPISLV (188*100) #define TCC353X_STREAM_THRESHOLD_SPISLV_WH \ (((TCC353X_STREAM_THRESHOLD_SPISLV>>2)>>8)&0xFF) #define TCC353X_STREAM_THRESHOLD_SPISLV_WL \ ((TCC353X_STREAM_THRESHOLD_SPISLV>>2)&0xFF) /* use large frame buffer for cspi only */ #ifdef _USE_TMM_CSPI_ONLY_ #define TCC353X_USE_STREAM_BUFFERING #endif #if defined (TCC353X_USE_STREAM_BUFFERING) /* about 400k : 200ms at 16QAM MAX */ #define TCC353X_STREAM_BUFFER_PKT (3840) #define TCC353X_STREAM_BUFFER_SIZE (188*TCC353X_STREAM_BUFFER_PKT) #else #define TCC353X_STREAM_BUFFER_SIZE (TCC353X_STREAM_THRESHOLD_SPISLV) #endif /* set stream threshold (not use interrupt) */ #define TCC353X_STREAM_THRESHOLD (188*8) #define TCC353X_STREAM_THRESHOLD_WH (((TCC353X_STREAM_THRESHOLD>>2)>>8)\ &0xFF) #define TCC353X_STREAM_THRESHOLD_WL ((TCC353X_STREAM_THRESHOLD>>2)&0xFF) /* driving strength for sts (GPIO 04~07) */ /* 0x00 : min , 0xF0 : max */ #define TCC353X_DRV_STR_GPIO_0x13_07_00 0x00 /* 0xF0 */ /* STS(TSIF) Clk polarity */ #define STS_CLK_POS 0x00 #define STS_CLK_NEG 0x80 #define STS_SYNC_ACT_LOW 0x40 #define STS_SYNC_ACT_HIGH 0x00 #define STS_FRM_ACT_LOW 0x20 #define STS_FRM_ACT_HIGH 0x00 /* #define STS_POLARITY (STS_CLK_POS|STS_SYNC_ACT_LOW|STS_FRM_ACT_LOW) */ #define STS_POLARITY (STS_CLK_POS|STS_SYNC_ACT_HIGH|STS_FRM_ACT_HIGH) /* set stream speed (DLR) */ #define TCC353X_DLR 0 // 60MHz //#define TCC353X_DLR 1 // 30MHz //#define TCC353X_DLR 2 // 20MHz #endif
/* * Copyright (C) 2012 Texas Instruments * Author: Jyri Sarha <jsarha@ti.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Gpio controlled clock implementation */ #include <linux/clk-provider.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/gpio.h> #include <linux/of_gpio.h> #include <linux/err.h> #include <linux/device.h> /** * DOC: basic gpio controlled clock which can be enabled and disabled * with gpio output * Traits of this clock: * prepare - clk_(un)prepare only ensures parent is (un)prepared * enable - clk_enable and clk_disable are functional & control gpio * rate - inherits rate from parent. No clk_set_rate support * parent - fixed parent. No clk_set_parent support */ #define to_clk_gpio(_hw) container_of(_hw, struct clk_gpio, hw) static int clk_gpio_enable(struct clk_hw *hw) { struct clk_gpio *gpio = to_clk_gpio(hw); int value = gpio->active_low ? 0 : 1; gpio_set_value(gpio->gpio, value); return 0; } static void clk_gpio_disable(struct clk_hw *hw) { struct clk_gpio *gpio = to_clk_gpio(hw); int value = gpio->active_low ? 1 : 0; gpio_set_value(gpio->gpio, value); } static int clk_gpio_is_enabled(struct clk_hw *hw) { struct clk_gpio *gpio = to_clk_gpio(hw); int value = gpio_get_value(gpio->gpio); return gpio->active_low ? !value : value; } const struct clk_ops clk_gpio_ops = { .enable = clk_gpio_enable, .disable = clk_gpio_disable, .is_enabled = clk_gpio_is_enabled, }; EXPORT_SYMBOL_GPL(clk_gpio_ops); /** * clk_register_gpio - register a gpip clock with the clock framework * @dev: device that is registering this clock * @name: name of this clock * @parent_name: name of this clock's parent * @flags: framework-specific flags for this clock * @gpio: gpio to control this clock * @active_low: gpio polarity */ struct clk *clk_register_gpio(struct device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int gpio, bool active_low) { struct clk_gpio *clk_gpio; struct clk *clk; struct clk_init_data init = { NULL }; unsigned long gpio_flags; int err; if (active_low) gpio_flags = GPIOF_OUT_INIT_LOW; else gpio_flags = GPIOF_OUT_INIT_HIGH; if (dev) err = devm_gpio_request_one(dev, gpio, gpio_flags, name); else err = gpio_request_one(gpio, gpio_flags, name); if (err) { pr_err("%s: %s: Error requesting clock control gpio %u\n", __func__, name, gpio); goto clk_register_gpio_err; } if (dev) clk_gpio = devm_kzalloc(dev, sizeof(struct clk_gpio), GFP_KERNEL); else clk_gpio = kzalloc(sizeof(struct clk_gpio), GFP_KERNEL); if (!clk_gpio) { pr_err("%s: %s: could not allocate gpio clk\n", __func__, name); goto clk_register_gpio_err; } init.name = name; init.ops = &clk_gpio_ops; init.flags = flags | CLK_IS_BASIC; init.parent_names = (parent_name ? &parent_name : NULL); init.num_parents = (parent_name ? 1 : 0); clk_gpio->gpio = gpio; clk_gpio->active_low = active_low; clk_gpio->hw.init = &init; clk = clk_register(dev, &clk_gpio->hw); if (!IS_ERR(clk)) return clk; err = PTR_ERR(clk); if (!dev) kfree(clk_gpio); clk_register_gpio_err: if (!dev) gpio_free(gpio); return ERR_PTR(err); } EXPORT_SYMBOL_GPL(clk_register_gpio); #ifdef CONFIG_OF /** * The clk_register_gpio has to be delayed, because the EPROBE_DEFER * can not be handled properly at of_clk_init() call time. */ struct clk_gpio_delayed_register_data { struct device_node *node; struct mutex lock; struct clk *clk; }; struct clk *of_clk_gpio_delayed_register_get(struct of_phandle_args *clkspec, void *_data) { struct clk_gpio_delayed_register_data *data = (struct clk_gpio_delayed_register_data *) _data; struct clk *clk; const char *clk_name = data->node->name; const char *parent_name; enum of_gpio_flags gpio_flags; int gpio; bool active_low; mutex_lock(&data->lock); if (data->clk) { mutex_unlock(&data->lock); return data->clk; } gpio = of_get_named_gpio_flags(data->node, "enable-gpios", 0, &gpio_flags); if (gpio < 0) { mutex_unlock(&data->lock); if (gpio != -EPROBE_DEFER) pr_err("%s: %s: Can't get 'enable-gpios' DT property\n", __func__, clk_name); return ERR_PTR(gpio); } active_low = gpio_flags & OF_GPIO_ACTIVE_LOW; parent_name = of_clk_get_parent_name(data->node, 0); clk = clk_register_gpio(NULL, clk_name, parent_name, 0, gpio, active_low); if (IS_ERR(clk)) { mutex_unlock(&data->lock); return clk; } data->clk = clk; mutex_unlock(&data->lock); return clk; } /** * of_gpio_clk_setup() - Setup function for gpio controlled clock */ void __init of_gpio_clk_setup(struct device_node *node) { struct clk_gpio_delayed_register_data *data; data = kzalloc(sizeof(struct clk_gpio_delayed_register_data), GFP_KERNEL); if (!data) { pr_err("%s: could not allocate gpio clk\n", __func__); return; } data->node = node; mutex_init(&data->lock); of_clk_add_provider(node, of_clk_gpio_delayed_register_get, data); } EXPORT_SYMBOL_GPL(of_gpio_clk_setup); CLK_OF_DECLARE(gpio_clk, "gpio-clock", of_gpio_clk_setup); #endif
/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.7 2000/12/07 20:26:02 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. Copyright (c) 2002-2012 Apple Computer, Inc. All Rights Reserved. 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, sub license, 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 (including the next paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Kevin E. Martin <martin@valinux.com> * Jens Owen <jens@valinux.com> * Rickard E. (Rik) Faith <faith@valinux.com> * Jeremy Huddleston <jeremyhu@apple.com> * */ #ifndef _APPLEDRI_H_ #define _APPLEDRI_H_ #include <X11/Xfuncproto.h> #define X_AppleDRIQueryVersion 0 #define X_AppleDRIQueryDirectRenderingCapable 1 #define X_AppleDRICreateSurface 2 #define X_AppleDRIDestroySurface 3 #define X_AppleDRIAuthConnection 4 #define X_AppleDRICreateSharedBuffer 5 #define X_AppleDRISwapBuffers 6 #define X_AppleDRICreatePixmap 7 #define X_AppleDRIDestroyPixmap 8 /* Requests up to and including 18 were used in a previous version */ /* Events */ #define AppleDRIObsoleteEvent1 0 #define AppleDRIObsoleteEvent2 1 #define AppleDRIObsoleteEvent3 2 #define AppleDRISurfaceNotify 3 #define AppleDRINumberEvents 4 /* Errors */ #define AppleDRIClientNotLocal 0 #define AppleDRIOperationNotSupported 1 #define AppleDRINumberErrors (AppleDRIOperationNotSupported + 1) /* Kinds of SurfaceNotify events: */ #define AppleDRISurfaceNotifyChanged 0 #define AppleDRISurfaceNotifyDestroyed 1 #ifndef _APPLEDRI_SERVER_ typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came frome a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* window of event */ Time time; /* server timestamp when event happened */ int kind; /* subtype of event */ int arg; } XAppleDRINotifyEvent; _XFUNCPROTOBEGIN Bool XAppleDRIQueryExtension(Display *dpy, int *event_base, int *error_base); Bool XAppleDRIQueryVersion(Display *dpy, int *majorVersion, int *minorVersion, int *patchVersion); Bool XAppleDRIQueryDirectRenderingCapable(Display *dpy, int screen, Bool *isCapable); void * XAppleDRISetSurfaceNotifyHandler(void (*fun)(Display *dpy, unsigned uid, int kind)); Bool XAppleDRIAuthConnection(Display *dpy, int screen, unsigned int magic); Bool XAppleDRICreateSurface(Display * dpy, int screen, Drawable drawable, unsigned int client_id, unsigned int key[2], unsigned int* uid); Bool XAppleDRIDestroySurface(Display *dpy, int screen, Drawable drawable); Bool XAppleDRISynchronizeSurfaces(Display *dpy); Bool XAppleDRICreateSharedBuffer(Display *dpy, int screen, Drawable drawable, Bool doubleSwap, char *path, size_t pathlen, int *width, int *height); Bool XAppleDRISwapBuffers(Display *dpy, int screen, Drawable drawable); Bool XAppleDRICreatePixmap(Display *dpy, int screen, Drawable drawable, int *width, int *height, int *pitch, int *bpp, size_t *size, char *bufname, size_t bufnamesize); Bool XAppleDRIDestroyPixmap(Display *dpy, Pixmap pixmap); _XFUNCPROTOEND #endif /* _APPLEDRI_SERVER_ */ #endif /* _APPLEDRI_H_ */
//{future header message} #ifndef __FvTerrainRenderable_H__ #define __FvTerrainRenderable_H__ #include "FvTerrain.h" #include "FvTerrainPage.h" #include <OgreRenderable.h> using namespace Ogre; typedef std::pair<FvUInt16,FvUInt16> TerrainRenderIndex; class FV_TERRAIN_API FvTerrainRenderable : public Renderable { public: enum { HEIGHT_BINDING = 0, MORPH_BINDING = 1, GRID_BINDING = 2 }; enum { CUSTOM_PARAM_INDEX_MORPH = 1 }; enum Neighbor { NORTH = 0, SOUTH = 1, EAST = 2, WEST = 3, NEIGHBORS = 4 }; enum { STITCH_NORTH_SHIFT = 0, STITCH_SOUTH_SHIFT = 8, STITCH_WEST_SHIFT = 16, STITCH_EAST_SHIFT = 24, STITCH_NORTH = 128 << STITCH_NORTH_SHIFT, STITCH_SOUTH = 128 << STITCH_SOUTH_SHIFT, STITCH_WEST = 128 << STITCH_WEST_SHIFT, STITCH_EAST = 128 << STITCH_EAST_SHIFT, }; FvTerrainRenderable(FvTerrainPage &kTerrainPage, FvUInt32 uiTitleX,FvUInt32 uiTitleY); ~FvTerrainRenderable(); static void Init(); static void Fini(); FvBoundingBox const &BoundingBox() const; FvVector3 const &Centre() const; float BoundingRadius() const; void SetLightMask(FvUInt32 uiLightMask); FvUInt32 GetLightMask(); const MaterialPtr& getMaterial(void) const; Technique *getTechnique(void) const; void getRenderOperation(RenderOperation &kOP); void getWorldTransforms(Matrix4 *pkXForm) const; Real getSquaredViewDepth(const Camera *pkCam) const; const LightList& getLights(void) const; bool getCastsShadows(void) const; void NotifyCameraPosition( const FvVector3 &kPos ); void SetNeighbor( Neighbor eNeighbor, FvTerrainRenderable *pkTitle ); FvTerrainRenderable *GetNeighbor( Neighbor eNeighbor ); FvUInt32 GetLodLevel(); Ogre::Renderable *GetWireBB(); protected: Ogre::HardwareVertexBufferSharedPtr &GetGridBuffer( FvUInt32 uiTitleX, FvUInt32 uiTitleY ) const; float LodHeight(FvUInt32 x, FvUInt32 y, FvUInt32 uiCurLodLevel, FvUInt32 uiLodLevel); FvTerrainRenderable *m_pkNeighbors[NEIGHBORS]; FvUInt32 m_uiTitleX; FvUInt32 m_uiTitleY; FvUInt32 m_uiTitleSize; FvUInt32 m_uiLodLevel; FvBoundingBox m_kBoundingBox; Ogre::WireBoundingBox m_kWireBB; FvVector3 m_kCentre; float m_fBoundingRadius; VertexData *m_pkVertexData; HardwareVertexBufferSharedPtr m_spHeight; FvUInt32 m_uiLightMask; mutable LightList m_kLightList; mutable FvUInt64 m_uiLightListUpdated; FvTerrainPage &m_kTerrainPage; FvTerrainPage::MaterialType m_eState; typedef std::vector<Ogre::HardwareVertexBufferSharedPtr> HeightVertexBuffers; HeightVertexBuffers m_kHeightVertexBuffers; typedef std::vector<Ogre::HardwareVertexBufferSharedPtr> GridVertexBuffers; typedef std::map<TerrainRenderIndex,GridVertexBuffers> GridVertexBufferMap; static GridVertexBufferMap *ms_pkGridVertexBufferMap; typedef std::map<FvUInt32, Ogre::IndexData*> IndexMap; typedef std::vector<IndexMap> LevelArray; class LevelIndexMap : public std::map<TerrainRenderIndex, LevelArray> { public: ~LevelIndexMap() { LevelIndexMap::iterator kIt = this->begin(); for(; kIt != this->end(); ++kIt) { LevelArray::iterator kArrayIt = kIt->second.begin(); for(; kArrayIt != kIt->second.end(); ++kArrayIt) { IndexMap::iterator kIndexIt = (*kArrayIt).begin(); for(; kIndexIt != (*kArrayIt).end(); ++kIndexIt) { OGRE_DELETE kIndexIt->second; } (*kArrayIt).clear(); } kIt->second.clear(); } this->clear(); } }; LevelArray &m_kLevelIndex; static LevelIndexMap *ms_pkLevelIndexMap; }; #include "FvTerrainRenderable.inl" #endif // __FvTerrainRenderable_H__
// Copyright 2012 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // // Misc. common utility functions // // Authors: Skal (pascal.massimino@gmail.com) // Urvang (urvang@google.com) #ifndef WEBP_UTILS_UTILS_H_ #define WEBP_UTILS_UTILS_H_ #include <assert.h> #include "../webp/types.h" #ifdef __cplusplus extern "C" { #endif //------------------------------------------------------------------------------ // Memory allocation // This is the maximum memory amount that libwebp will ever try to allocate. #define WEBP_MAX_ALLOCABLE_MEMORY (1ULL << 40) // size-checking safe malloc/calloc: verify that the requested size is not too // large, or return NULL. You don't need to call these for constructs like // malloc(sizeof(foo)), but only if there's picture-dependent size involved // somewhere (like: malloc(num_pixels * sizeof(*something))). That's why this // safe malloc() borrows the signature from calloc(), pointing at the dangerous // underlying multiply involved. WEBP_EXTERN(void*) WebPSafeMalloc(uint64_t nmemb, size_t size); // Note that WebPSafeCalloc() expects the second argument type to be 'size_t' // in order to favor the "calloc(num_foo, sizeof(foo))" pattern. WEBP_EXTERN(void*) WebPSafeCalloc(uint64_t nmemb, size_t size); // Companion deallocation function to the above allocations. WEBP_EXTERN(void) WebPSafeFree(void* const ptr); //------------------------------------------------------------------------------ // Reading/writing data. // Read 16, 24 or 32 bits stored in little-endian order. static WEBP_INLINE int GetLE16(const uint8_t* const data) { return (int)(data[0] << 0) | (data[1] << 8); } static WEBP_INLINE int GetLE24(const uint8_t* const data) { return GetLE16(data) | (data[2] << 16); } static WEBP_INLINE uint32_t GetLE32(const uint8_t* const data) { return (uint32_t)GetLE16(data) | (GetLE16(data + 2) << 16); } // Store 16, 24 or 32 bits in little-endian order. static WEBP_INLINE void PutLE16(uint8_t* const data, int val) { assert(val < (1 << 16)); data[0] = (val >> 0); data[1] = (val >> 8); } static WEBP_INLINE void PutLE24(uint8_t* const data, int val) { assert(val < (1 << 24)); PutLE16(data, val & 0xffff); data[2] = (val >> 16); } static WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) { PutLE16(data, (int)(val & 0xffff)); PutLE16(data + 2, (int)(val >> 16)); } // Returns (int)floor(log2(n)). n must be > 0. // use GNU builtins where available. #if defined(__GNUC__) && \ ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4) static WEBP_INLINE int BitsLog2Floor(uint32_t n) { return 31 ^ __builtin_clz(n); } #elif defined(_MSC_VER) && _MSC_VER > 1310 && \ (defined(_M_X64) || defined(_M_IX86)) #include <intrin.h> #pragma intrinsic(_BitScanReverse) static WEBP_INLINE int BitsLog2Floor(uint32_t n) { uint32_t first_set_bit; _BitScanReverse(&first_set_bit, n); return first_set_bit; } #else static WEBP_INLINE int BitsLog2Floor(uint32_t n) { int log = 0; uint32_t value = n; int i; for (i = 4; i >= 0; --i) { const int shift = (1 << i); const uint32_t x = value >> shift; if (x != 0) { value = x; log += shift; } } return log; } #endif //------------------------------------------------------------------------------ #ifdef __cplusplus } // extern "C" #endif #endif /* WEBP_UTILS_UTILS_H_ */
/**************************************************************************** ** ** Copyright (C) 2016 Jochen Becher ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** 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 The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once #include "typeregistry.h" #include "parameters.h" #include <QString> namespace qark { class Tag { public: explicit Tag(const QString &qualifiedName) : m_qualifiedName(qualifiedName) { } Tag(const QString &qualifiedName, const Parameters &parameters) : m_qualifiedName(qualifiedName), m_parameters(parameters) { } const QString &qualifiedName() const { return m_qualifiedName; } Parameters parameters() const { return m_parameters; } private: QString m_qualifiedName; Parameters m_parameters; }; template<class T> class Object : public Tag { public: Object(const QString &qualifiedName, T *object) : Tag(qualifiedName), m_object(object) { } Object(const QString &qualifiedName, T *object, const Parameters &parameters) : Tag(qualifiedName, parameters), m_object(object) { } T *object() const { return m_object; } private: T *m_object = nullptr; }; inline Tag tag(const QString &qualifiedName) { return Tag(qualifiedName); } inline Tag tag(const QString &qualifiedName, const Parameters &parameters) { return Tag(qualifiedName, parameters); } inline Tag tag(const char *qualifiedName) { return Tag(QLatin1String(qualifiedName)); } inline Tag tag(const char *qualifiedName, const Parameters &parameters) { return Tag(QLatin1String(qualifiedName), parameters); } template<class T> inline Object<T> tag(T &object) { return Object<T>(typeUid<T>(), &object); } template<class T> inline Object<T> tag(T &object, const Parameters &parameters) { return Object<T>(typeUid<T>(), &object, parameters); } template<class T> inline Object<T> tag(const QString &qualifiedName, T &object) { return Object<T>(qualifiedName, &object); } template<class T> inline Object<T> tag(const QString &qualifiedName, T &object, const Parameters &parameters) { return Object<T>(qualifiedName, &object, parameters); } class End { public: explicit End() { } explicit End(const Parameters &parameters) : m_parameters(parameters) { } Parameters parameters() const { return m_parameters; } private: Parameters m_parameters; }; inline End end() { return End(); } inline End end(const Parameters &parameters) { return End(parameters); } } // namespace qark
#include <aubio.h> int main (void) { aubio_filter_t * f; uint_t rates[] = { 8000, 16000, 22050, 44100, 96000, 192000}; uint_t nrates = 6; uint_t samplerate, i = 0; for ( samplerate = rates[i]; i < nrates ; i++ ) { f = new_aubio_filter_a_weighting (samplerate); del_aubio_filter (f); f = new_aubio_filter (7); aubio_filter_set_a_weighting (f, samplerate); del_aubio_filter (f); } // samplerate unknown f = new_aubio_filter_a_weighting (4200); if (!f) { //PRINT_MSG ("failed creating A-weighting filter with samplerate=4200Hz\n"); } // order to small f = new_aubio_filter (2); if (aubio_filter_set_a_weighting (f, samplerate) != 0) { //PRINT_MSG ("failed setting filter to A-weighting\n"); } del_aubio_filter (f); // order to big f = new_aubio_filter (12); if (aubio_filter_set_a_weighting (f, samplerate) != 0) { //PRINT_MSG ("failed setting filter to A-weighting\n"); } del_aubio_filter (f); return 0; }
///////////////////////////////////////////////////////////////////////////// // Name: wx/xtixml.h // Purpose: xml streaming runtime metadata information (extended class info) // Author: Stefan Csomor // Modified by: // Created: 27/07/03 // RCS-ID: $Id$ // Copyright: (c) 2003 Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XTIXMLH__ #define _WX_XTIXMLH__ #include "wx/defs.h" #if wxUSE_EXTENDED_RTTI #include "wx/string.h" #include "wx/xtistrm.h" class WXDLLIMPEXP_XML wxXmlNode; class WXDLLIMPEXP_BASE wxPropertyInfo; class WXDLLIMPEXP_BASE wxObject; class WXDLLIMPEXP_BASE wxClassInfo; class WXDLLIMPEXP_BASE wxAnyList; class WXDLLIMPEXP_BASE wxHandlerInfo; class WXDLLIMPEXP_BASE wxObjectWriterCallback; class WXDLLIMPEXP_XML wxObjectXmlWriter: public wxObjectWriter { public: wxObjectXmlWriter( wxXmlNode * parent ); virtual ~wxObjectXmlWriter(); // // streaming callbacks // // these callbacks really write out the values in the stream format // // // streaming callbacks // // these callbacks really write out the values in the stream format // begins writing out a new toplevel entry which has the indicated unique name virtual void DoBeginWriteTopLevelEntry( const wxString &name ); // ends writing out a new toplevel entry which has the indicated unique name virtual void DoEndWriteTopLevelEntry( const wxString &name ); // start of writing an object having the passed in ID virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID, const wxStringToAnyHashMap &metadata ); // end of writing an toplevel object name param is used for unique // identification within the container virtual void DoEndWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID ); // writes a simple property in the stream format virtual void DoWriteSimpleType( const wxAny &value ); // start of writing a complex property into the stream ( virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ); // end of writing a complex property into the stream virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ); virtual void DoBeginWriteElement(); virtual void DoEndWriteElement(); // insert an object reference to an already written object virtual void DoWriteRepeatedObject( int objectID ); // insert a null reference virtual void DoWriteNullObject(); // writes a delegate in the stream format virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo, const wxPropertyInfo *propInfo, const wxObject *eventSink, int sinkObjectID, const wxClassInfo* eventSinkClassInfo, const wxHandlerInfo* handlerIndo ); private: struct wxObjectXmlWriterInternal; wxObjectXmlWriterInternal* m_data; }; /* wxObjectXmlReader handles streaming in a class from XML */ class WXDLLIMPEXP_XML wxObjectXmlReader: public wxObjectReader { public: wxObjectXmlReader(wxXmlNode *parent) { m_parent = parent; } virtual ~wxObjectXmlReader() {} // Reads a component from XML. The return value is the root object ID, which can // then be used to ask the readercallback about that object virtual int ReadObject( const wxString &name, wxObjectReaderCallback *readercallback ); private: int ReadComponent(wxXmlNode *parent, wxObjectReaderCallback *callbacks); // read the content of this node (simple type) and return the corresponding value wxAny ReadValue(wxXmlNode *Node, const wxTypeInfo *type ); wxXmlNode * m_parent; }; #endif // wxUSE_EXTENDED_RTTI #endif
/* 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/>. */ #pragma once /* backend driver class for airspeed */ #include <AP_Common/AP_Common.h> #include <AP_HAL/AP_HAL.h> #include "AP_Airspeed.h" class AP_Airspeed_Backend { public: AP_Airspeed_Backend(AP_Airspeed &frontend, uint8_t instance); virtual ~AP_Airspeed_Backend(); // probe and initialise the sensor virtual bool init(void) = 0; // return the current differential_pressure in Pascal virtual bool get_differential_pressure(float &pressure) = 0; // return the current temperature in degrees C, if available virtual bool get_temperature(float &temperature) = 0; protected: int8_t get_pin(void) const; float get_psi_range(void) const; uint8_t get_bus(void) const; AP_Airspeed::pitot_tube_order get_tube_order(void) const { return AP_Airspeed::pitot_tube_order(frontend.param[instance].tube_order.get()); } // semaphore for access to shared frontend data HAL_Semaphore_Recursive sem; float get_airspeed_ratio(void) const { return frontend.get_airspeed_ratio(instance); } // some sensors use zero offsets void set_use_zero_offset(void) { frontend.state[instance].use_zero_offset = true; } // set to no zero cal, which makes sense for some sensors void set_skip_cal(void) { frontend.param[instance].skip_cal.set(1); } // set zero offset void set_offset(float ofs) { frontend.param[instance].offset.set(ofs); } private: AP_Airspeed &frontend; uint8_t instance; };
/* This file is part of VoltDB. * Copyright (C) 2008-2011 VoltDB Inc. * * VoltDB 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. * * VoltDB 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 VoltDB. If not, see <http://www.gnu.org/licenses/>. */ /* WARNING: THIS FILE IS AUTO-GENERATED DO NOT MODIFY THIS SOURCE ALL CHANGES MUST BE MADE IN THE CATALOG GENERATOR */ #ifndef CATALOG_COLUMN_H_ #define CATALOG_COLUMN_H_ #include <string> #include "catalogtype.h" #include "catalogmap.h" namespace catalog { class ConstraintRef; class MaterializedViewInfo; /** * A table column */ class Column : public CatalogType { friend class Catalog; friend class CatalogMap<Column>; protected: Column(Catalog * catalog, CatalogType * parent, const std::string &path, const std::string &name); int32_t m_index; int32_t m_type; int32_t m_size; bool m_nullable; std::string m_name; std::string m_defaultvalue; int32_t m_defaulttype; CatalogMap<ConstraintRef> m_constraints; CatalogType* m_matview; int32_t m_aggregatetype; CatalogType* m_matviewsource; virtual void update(); virtual CatalogType * addChild(const std::string &collectionName, const std::string &name); virtual CatalogType * getChild(const std::string &collectionName, const std::string &childName) const; virtual bool removeChild(const std::string &collectionName, const std::string &childName); public: ~Column(); /** GETTER: The column's order in the table */ int32_t index() const; /** GETTER: The type of the column (int/double/date/etc) */ int32_t type() const; /** GETTER: (currently unused) */ int32_t size() const; /** GETTER: Is the column nullable? */ bool nullable() const; /** GETTER: Name of column */ const std::string & name() const; /** GETTER: Default value of the column */ const std::string & defaultvalue() const; /** GETTER: Type of the default value of the column */ int32_t defaulttype() const; /** GETTER: Constraints that use this column */ const CatalogMap<ConstraintRef> & constraints() const; /** GETTER: If part of a materialized view, ref of view info */ const MaterializedViewInfo * matview() const; /** GETTER: If part of a materialized view, represents aggregate type */ int32_t aggregatetype() const; /** GETTER: If part of a materialized view, represents source column */ const Column * matviewsource() const; }; } // namespace catalog #endif // CATALOG_COLUMN_H_
/* * 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, see * <http://www.gnu.org/licenses/>. */ #pragma once #ifdef WITH_QEMU # include "capabilities.h" # include "virfilecache.h" # include "domain_conf.h" # include "qemu/qemu_capabilities.h" # include "qemu/qemu_conf.h" # define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" enum { GIC_NONE = 0, GIC_V2, GIC_V3, GIC_BOTH, }; typedef enum { HOST_OS_LINUX = 0, HOST_OS_MACOS, } testQemuHostOS; typedef enum { ARG_QEMU_CAPS = QEMU_CAPS_LAST + 1, ARG_GIC, ARG_MIGRATE_FROM, ARG_MIGRATE_FD, ARG_FLAGS, ARG_PARSEFLAGS, ARG_CAPS_ARCH, ARG_CAPS_VER, ARG_HOST_OS, ARG_END, } testQemuInfoArgName; typedef enum { FLAG_EXPECT_FAILURE = 1 << 0, FLAG_EXPECT_PARSE_ERROR = 1 << 1, FLAG_FIPS_HOST = 1 << 2, /* simulate host with FIPS mode enabled */ FLAG_REAL_CAPS = 1 << 3, FLAG_SKIP_LEGACY_CPUS = 1 << 4, FLAG_SLIRP_HELPER = 1 << 5, } testQemuInfoFlags; struct testQemuConf { GHashTable *capscache; GHashTable *capslatest; GHashTable *qapiSchemaCache; }; struct testQemuArgs { bool newargs; virQEMUCaps *fakeCaps; bool fakeCapsUsed; char *capsver; char *capsarch; int gic; testQemuHostOS hostOS; bool invalidarg; }; struct testQemuInfo { const char *name; char *infile; char *outfile; char *errfile; virQEMUCaps *qemuCaps; const char *migrateFrom; int migrateFd; unsigned int flags; unsigned int parseFlags; virArch arch; char *schemafile; struct testQemuArgs args; struct testQemuConf *conf; }; virCaps *testQemuCapsInit(void); virCaps *testQemuCapsInitMacOS(void); virDomainXMLOption *testQemuXMLConfInit(void); virQEMUCaps *qemuTestParseCapabilitiesArch(virArch arch, const char *capsFile); extern virCPUDef *cpuDefault; extern virCPUDef *cpuHaswell; extern virCPUDef *cpuPower8; extern virCPUDef *cpuPower9; void qemuTestSetHostArch(virQEMUDriver *driver, virArch arch); void qemuTestSetHostCPU(virQEMUDriver *driver, virArch arch, virCPUDef *cpu); int qemuTestDriverInit(virQEMUDriver *driver); void qemuTestDriverFree(virQEMUDriver *driver); int qemuTestCapsCacheInsert(virFileCache *cache, virQEMUCaps *caps); int qemuTestCapsCacheInsertMacOS(virFileCache *cache, virQEMUCaps *caps); int testQemuCapsSetGIC(virQEMUCaps *qemuCaps, int gic); char *testQemuGetLatestCapsForArch(const char *arch, const char *suffix); GHashTable *testQemuGetLatestCaps(void); typedef int (*testQemuCapsIterateCallback)(const char *inputDir, const char *prefix, const char *version, const char *archName, const char *suffix, void *opaque); int testQemuCapsIterate(const char *suffix, testQemuCapsIterateCallback callback, void *opaque); void testQemuInfoSetArgs(struct testQemuInfo *info, struct testQemuConf *conf, ...); int testQemuInfoInitArgs(struct testQemuInfo *info); void testQemuInfoClear(struct testQemuInfo *info); int testQemuPrepareHostBackendChardevOne(virDomainDeviceDef *dev, virDomainChrSourceDef *chardev, void *opaque); #endif
/* * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: * */ /** @file @internalComponent @released */ #ifndef __CDbSqlDumper_H__ #define __CDbSqlDumper_H__ #include <e32std.h> #include <e32def.h> #include <f32file.h> #include <badesca.h> #include <sqldb.h> #include <e32cmn.h> #include <e32base.h> /** Utility class used to provide table names and column names existing in the sql database. It is mapped to a specific sql schema. */ class CDbStructure : public CBase { public: CDbStructure(); ~CDbStructure(); void Init(); TBool NextTable(); const TDesC& TableName(); const TDesC& TableName(TInt aTablePosition); TBool NextColumn(TInt aTableIndex); const TDesC& Column(TInt aTableIndex); const TDesC& Column(TInt aTableIndex, TInt aColumnIndex); TBool IsLastColumn(TInt aTableIndex); TInt ColumnNo(const TInt aTableIndex); private: TInt iTablesIndex; TInt iNumTables; RArray<TInt> iColumnsIndex; RArray<TInt> iNumColumns; }; /** CDbSqlDumper class dumps the contents and columns of all tables in a given sql database in HTML format to a given location */ class CDbSqlDumper : public CBase { public: static CDbSqlDumper* NewLC(const TDesC& aDbName, const TDesC& aOutputDir); ~CDbSqlDumper(); void OutputDBContentsL(); private: void ConstructL(const TDesC& aDbName, const TDesC& aOutputDir); void OutputTableNameToFile(TInt aTableIndex); void OutputTableColHeadingsToFile(TInt aTableIndex); void OutputTableColDataToFileL(TInt aTableIndex); void OutputTableToFileL(TInt aTableIndex); void FieldHeaderColL(TInt aFieldIndex); void LongBinaryL(TInt aFieldIndex); void DumpStreamL(RReadStream& stream); void PrepareSQLStatementL(TInt aTableIndex); private: RFs iFsSession; RSqlDatabase iDatabase; RSqlStatement iSqlStatement; RPointerArray<TDesC> iTableNames; RFile iFile; HBufC8* iBuffer; CDbStructure* iDbStructure; }; #endif // __CDbSqlDumper_H__
/********************************************************* * Copyright (C) 2006 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of VMware Inc. nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission of VMware Inc. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * block.h -- * * Blocking operations for the vmblock driver. */ #ifndef __BLOCK_H__ #define __BLOCK_H__ #include "os.h" typedef struct BlockInfo * BlockHandle; /* * Global functions */ int BlockInit(void); void BlockCleanup(void); int BlockAddFileBlock(const char *filename, const os_blocker_id_t blocker); int BlockRemoveFileBlock(const char *filename, const os_blocker_id_t blocker); unsigned int BlockRemoveAllBlocks(const os_blocker_id_t blocker); int BlockWaitOnFile(const char *filename, BlockHandle cookie); BlockHandle BlockLookup(const char *filename, const os_blocker_id_t blocker); #ifdef VMX86_DEVEL void BlockListFileBlocks(void); #endif #endif /* __BLOCK_H__ */
/************************************************************************** ** ** Copyright (c) 2014 Brian McGillion ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** 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://www.qt.io/licensing. For further information ** use the contact form at http://www.qt.io/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 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** 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. ** ****************************************************************************/ #ifndef CLONEWIZARDPAGE_H #define CLONEWIZARDPAGE_H #include <vcsbase/basecheckoutwizardpage.h> namespace Mercurial { namespace Internal { class CloneWizardPage : public VcsBase::BaseCheckoutWizardPage { Q_OBJECT public: CloneWizardPage(QWidget *parent = 0); protected: QString directoryFromRepository(const QString &rrepository) const; }; } //namespace Internal } //namespace Mercurial #endif // CLONEWIZARDPAGE_H
/* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr.h> #include <board.h> #include <device.h> #include <gpio.h> /* Change this if you have an LED connected to a custom port */ #ifndef LED0_GPIO_CONTROLLER #define LED0_GPIO_CONTROLLER LED0_GPIO_PORT #endif #define LED_PORT LED0_GPIO_CONTROLLER /* Change this if you have an LED connected to a custom pin */ #define LED LED0_GPIO_PIN /* 1000 msec = 1 sec */ #define SLEEP_TIME 1000 void main(void) { int cnt = 0; struct device *dev; dev = device_get_binding(LED_PORT); /* Set LED pin as output */ gpio_pin_configure(dev, LED, GPIO_DIR_OUT); while (1) { /* Set pin to HIGH/LOW every 1 second */ gpio_pin_write(dev, LED, cnt % 2); cnt++; k_sleep(SLEEP_TIME); } }
/** * Modified MIT License * * Copyright 2015 OneSignal * * 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: * * 1. The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * 2. All copies of substantial portions of the Software may only be used in connection * with services provided by OneSignal. * * 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. */ @interface OneSignalHTTPClient : NSObject @property (readonly, nonatomic) NSURL *baseURL; - (id)initWithBaseURL:(NSURL *)url; - (NSMutableURLRequest*) requestWithMethod:(NSString*)method path:(NSString*)path; @end
/////////////////////////////////////////////////////////////////////// // File: colpartitionrid.h // Description: Class collecting code that acts on a BBGrid of ColPartitions. // Author: Ray Smith // Created: Mon Oct 05 08:42:01 PDT 2009 // // (C) Copyright 2009, Google 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 TESSERACT_TEXTORD_COLPARTITIONGRID_H__ #define TESSERACT_TEXTORD_COLPARTITIONGRID_H__ #include "bbgrid.h" #include "colpartition.h" namespace tesseract { class TabFind; // ColPartitionGrid is a BBGrid of ColPartition. // It collects functions that work on the grid. class ColPartitionGrid : public BBGrid<ColPartition, ColPartition_CLIST, ColPartition_C_IT> { public: ColPartitionGrid(); ColPartitionGrid(int gridsize, const ICOORD& bleft, const ICOORD& tright); ~ColPartitionGrid(); // Handles a click event in a display window. void HandleClick(int x, int y); // Finds all the ColPartitions in the grid that overlap with the given // box and returns them SortByBoxLeft(ed) and uniqued in the given list. // Any partition equal to not_this (may be NULL) is excluded. void FindOverlappingPartitions(const TBOX& box, const ColPartition* not_this, ColPartition_CLIST* parts); // Finds and returns the best candidate ColPartition to merge with part, // selected from the candidates list, based on the minimum increase in // pairwise overlap among all the partitions overlapped by the combined box. // If overlap_increase is not NULL then it returns the increase in overlap // that would result from the merge. // See colpartitiongrid.cpp for a diagram. ColPartition* BestMergeCandidate( const ColPartition* part, ColPartition_CLIST* candidates, bool debug, TessResultCallback2<bool, const ColPartition*, const ColPartition*>* confirm_cb, int* overlap_increase); // Improves the margins of the ColPartitions in the grid by calling // FindPartitionMargins on each. void GridFindMargins(ColPartitionSet** best_columns); // Improves the margins of the ColPartitions in the list by calling // FindPartitionMargins on each. void ListFindMargins(ColPartitionSet** best_columns, ColPartition_LIST* parts); // Finds and marks text partitions that represent figure captions. void FindFigureCaptions(); //////// Functions that manipulate ColPartitions in the grid /////// //////// to find chains of partner partitions of the same type. /////// // For every ColPartition in the grid, finds its upper and lower neighbours. void FindPartitionPartners(); // Finds the best partner in the given direction for the given partition. // Stores the result with AddPartner. void FindPartitionPartners(bool upper, ColPartition* part); // For every ColPartition with multiple partners in the grid, reduces the // number of partners to 0 or 1. If get_desperate is true, goes to more // desperate merge methods to merge flowing text before breaking partnerships. void RefinePartitionPartners(bool get_desperate); private: // Improves the margins of the ColPartition by searching for // neighbours that vertically overlap significantly. void FindPartitionMargins(ColPartitionSet* columns, ColPartition* part); // Starting at x, and going in the specified direction, upto x_limit, finds // the margin for the given y range by searching sideways, // and ignoring not_this. int FindMargin(int x, bool right_to_left, int x_limit, int y_bottom, int y_top, const ColPartition* not_this); }; } // namespace tesseract. #endif // TESSERACT_TEXTORD_COLPARTITIONGRID_H__
/* * Copyright (c) 2008-2010 Appcelerator, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef IRCClient_h #define IRCClient_h #ifdef OS_LINUX #include <unistd.h> #endif #include <kroll/kroll.h> #include <Poco/Thread.h> #include "IRC.h" namespace Titanium { class IRCClient : public StaticBoundObject { public: IRCClient(); virtual ~IRCClient(); private: static void Run(void*); static int Callback(char *cmd, char* params, irc_reply_data* data, void* conn, void* pd); void Connect(const ValueList& args, KValueRef result); void Disconnect(const ValueList& args, KValueRef result); void Send(const ValueList& args, KValueRef result); void SetNick(const ValueList& args, KValueRef result); void GetNick(const ValueList& args, KValueRef result); void Join(const ValueList& args, KValueRef result); void Unjoin(const ValueList& args, KValueRef result); void IsOp(const ValueList& args, KValueRef result); void IsVoice(const ValueList& args, KValueRef result); void GetUsers(const ValueList& args, KValueRef result); KObjectRef global; IRC irc; KMethodRef callback; Poco::Thread *thread; }; } // namespace Titanium #endif
/*========================================================================= * * Copyright Insight Software Consortium * * 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.txt * * 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 itkUnaryFunctorImageFilter_h #define itkUnaryFunctorImageFilter_h #include "itkMath.h" #include "itkInPlaceImageFilter.h" #include "itkImageRegionIteratorWithIndex.h" namespace itk { /** \class UnaryFunctorImageFilter * \brief Implements pixel-wise generic operation on one image. * * This class is parameterized over the type of the input image and * the type of the output image. It is also parameterized by the * operation to be applied, using a Functor style. * * UnaryFunctorImageFilter allows the output dimension of the filter * to be larger than the input dimension. Thus subclasses of the * UnaryFunctorImageFilter (like the CastImageFilter) can be used * to promote a 2D image to a 3D image, etc. * * \sa UnaryGeneratorImageFilter * \sa BinaryFunctorImageFilter TernaryFunctorImageFilter * * \ingroup IntensityImageFilters MultiThreaded * \ingroup ITKCommon * * \wiki * \wikiexample{ImageProcessing/UnaryFunctorImageFilter,Apply a custom operation to each pixel in an image} * \endwiki */ template< typename TInputImage, typename TOutputImage, typename TFunction > class ITK_TEMPLATE_EXPORT UnaryFunctorImageFilter:public InPlaceImageFilter< TInputImage, TOutputImage > { public: ITK_DISALLOW_COPY_AND_ASSIGN(UnaryFunctorImageFilter); /** Standard class type aliases. */ using Self = UnaryFunctorImageFilter; using Superclass = InPlaceImageFilter< TInputImage, TOutputImage >; using Pointer = SmartPointer< Self >; using ConstPointer = SmartPointer< const Self >; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(UnaryFunctorImageFilter, InPlaceImageFilter); /** Some type alias. */ using FunctorType = TFunction; using InputImageType = TInputImage; using InputImagePointer = typename InputImageType::ConstPointer; using InputImageRegionType = typename InputImageType::RegionType; using InputImagePixelType = typename InputImageType::PixelType; using OutputImageType = TOutputImage; using OutputImagePointer = typename OutputImageType::Pointer; using OutputImageRegionType = typename OutputImageType::RegionType; using OutputImagePixelType = typename OutputImageType::PixelType; /** Get the functor object. The functor is returned by reference. * (Functors do not have to derive from itk::LightObject, so they do * not necessarily have a reference count. So we cannot return a * SmartPointer.) */ FunctorType & GetFunctor() { return m_Functor; } const FunctorType & GetFunctor() const { return m_Functor; } /** Set the functor object. This replaces the current Functor with a * copy of the specified Functor. This allows the user to specify a * functor that has ivars set differently than the default functor. * This method requires an operator!=() be defined on the functor * (or the compiler's default implementation of operator!=() being * appropriate). */ void SetFunctor(const FunctorType & functor) { if ( m_Functor != functor ) { m_Functor = functor; this->Modified(); } } protected: UnaryFunctorImageFilter(); ~UnaryFunctorImageFilter() override = default; /** UnaryFunctorImageFilter can produce an image which is a different * resolution than its input image. As such, UnaryFunctorImageFilter * needs to provide an implementation for * GenerateOutputInformation() in order to inform the pipeline * execution model. The original documentation of this method is * below. * * \sa ProcessObject::GenerateOutputInformaton() */ void GenerateOutputInformation() override; /** UnaryFunctorImageFilter can be implemented as a multithreaded filter. * Therefore, this implementation provides a DynamicThreadedGenerateData() routine * which is called for each processing thread. The output image data is * allocated automatically by the superclass prior to calling * DynamicThreadedGenerateData(). DynamicThreadedGenerateData can only write to the * portion of the output image specified by the parameter * "outputRegionForThread" * * \sa ImageToImageFilter::ThreadedGenerateData(), * ImageToImageFilter::GenerateData() */ void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override; private: FunctorType m_Functor; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkUnaryFunctorImageFilter.hxx" #endif #endif
/** ****************************************************************************** * @file types.h * @brief Defines a number of general purpose data types. * @internal * @author ON Semiconductor * $Rev: 2074 $ * $Date: 2013-07-10 18:06:15 +0530 (Wed, 10 Jul 2013) $ ****************************************************************************** * @copyright (c) 2012 ON Semiconductor. All rights reserved. * ON Semiconductor is supplying this software for use with ON Semiconductor * processor based microcontrollers only. * * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. * ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. * @endinternal * * @ingroup util */ #ifndef _UTIL_TYPES_H_ #define _UTIL_TYPES_H_ #include "architecture.h" #include <stdint.h> #include <stdio.h> typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; typedef unsigned long long QWORD; typedef unsigned char boolean; #define True (1) #define False (0) #define Null NULL #endif /* _UTIL_TYPES_H_ */
/* * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2010-06-25 Bernard first version * 2011-08-08 lgnq modified for Loongson LS1B * 2019-12-04 Jiaxun Yang Adapt new MIPS generic code */ #include <rtthread.h> #include <rthw.h> #include <mips_fpu.h> #include "board.h" #include "drv_uart.h" #include "ls1b.h" #ifdef RT_USING_RTGUI #include <rtgui/rtgui.h> rt_device_t dc; extern void rt_hw_dc_init(void); #endif extern unsigned char __bss_end; /** * @addtogroup Loongson LS1B */ /*@{*/ /** * This function will initial sam7s64 board. */ void rt_hw_board_init(void) { /* init hardware interrupt */ rt_hw_exception_init(); /* init hardware interrupt */ rt_hw_interrupt_init(); #ifdef RT_USING_HEAP rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END); #endif #ifdef RT_USING_SERIAL /* init hardware UART device */ rt_hw_uart_init(); #endif #ifdef RT_USING_CONSOLE /* set console device */ rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif /* init operating system timer */ rt_hw_timer_init(); #ifdef RT_USING_FPU /* init hardware fpu */ rt_hw_fpu_init(); #endif #ifdef RT_USING_RTGUI rt_device_t dc; /* init Display Controller */ rt_hw_dc_init(); /* find Display Controller device */ dc = rt_device_find("dc"); /* set Display Controller device as rtgui graphic driver */ rtgui_graphic_set_device(dc); #endif #ifdef RT_USING_COMPONENTS_INIT rt_components_board_init(); #endif rt_kprintf("current sr: 0x%08x\n", read_c0_status()); } /*@}*/
// // RECommonFunctions.h // REFrostedViewController // // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) // // 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. // #import <Foundation/Foundation.h> #ifndef REUIKitIsFlatModeFunction #define REUIKitIsFlatModeFunction BOOL REUIKitIsFlatMode(); #endif
/* $NetBSD: ieeefp.h,v 1.3 2013/04/23 05:42:23 matt Exp $ */ /* * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995 * Public domain. */ #ifndef _AARCH64_IEEEFP_H_ #define _AARCH64_IEEEFP_H_ #include <LibConfig.h> #include <sys/featuretest.h> #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE) #include <machine/fenv.h> #if !defined(_ISOC99_SOURCE) /* Exception type (used by fpsetmask() et al.) */ typedef int fp_except; /* Bit defines for fp_except */ #define FP_X_INV FE_INVALID /* invalid operation exception */ #define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */ #define FP_X_OFL FE_OVERFLOW /* overflow exception */ #define FP_X_UFL FE_UNDERFLOW /* underflow exception */ #define FP_X_IMP FE_INEXACT /* imprecise (prec. loss; "inexact") */ /* Rounding modes */ typedef enum { FP_RN=FE_TONEAREST, /* round to nearest representable number */ FP_RP=FE_UPWARD, /* round toward positive infinity */ FP_RM=FE_DOWNWARD, /* round toward negative infinity */ FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */ } fp_rnd; #endif /* !_ISOC99_SOURCE */ #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */ #endif /* _AARCH64_IEEEFP_H_ */
/***************************************************************************** * Copyright (c) 2009, OpenJAUS.com * All rights reserved. * * This file is part of OpenJAUS. OpenJAUS is distributed under the BSD * license. See the LICENSE file for details. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the University of Florida 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 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ****************************************************************************/ // File Name: reportGlobalPoseMessage.h // // Written By: Danny Kent (jaus AT dannykent DOT com), Tom Galluzzo // // Version: 3.3.0b // // Date: 09/08/09 // // Description: This file defines the attributes of a ReportGlobalPoseMessage #ifndef REPORT_GLOBAL_POSE_MESSAGE_H #define REPORT_GLOBAL_POSE_MESSAGE_H #include "jaus.h" #ifndef JAUS_POSE_PV #define JAUS_POSE_PV #define JAUS_POSE_PV_LATITUDE_BIT 0 #define JAUS_POSE_PV_LONGITUDE_BIT 1 #define JAUS_POSE_PV_ELEVATION_BIT 2 #define JAUS_POSE_PV_POSITION_RMS_BIT 3 #define JAUS_POSE_PV_ROLL_BIT 4 #define JAUS_POSE_PV_PITCH_BIT 5 #define JAUS_POSE_PV_YAW_BIT 6 #define JAUS_POSE_PV_ATTITUDE_RMS_BIT 7 #define JAUS_POSE_PV_TIME_STAMP_BIT 8 #endif typedef struct { // Include all parameters from a JausMessage structure: // Header Properties struct { // Properties by bit fields #ifdef JAUS_BIG_ENDIAN JausUnsignedShort reserved:2; JausUnsignedShort version:6; JausUnsignedShort expFlag:1; JausUnsignedShort scFlag:1; JausUnsignedShort ackNak:2; JausUnsignedShort priority:4; #elif JAUS_LITTLE_ENDIAN JausUnsignedShort priority:4; JausUnsignedShort ackNak:2; JausUnsignedShort scFlag:1; JausUnsignedShort expFlag:1; JausUnsignedShort version:6; JausUnsignedShort reserved:2; #else #error "Please define system endianess (see jaus.h)" #endif }properties; JausUnsignedShort commandCode; JausAddress destination; JausAddress source; JausUnsignedInteger dataSize; JausUnsignedInteger dataFlag; JausUnsignedShort sequenceNumber; JausUnsignedShort presenceVector; JausDouble latitudeDegrees; // Scaled Int (-90, 90) JausDouble longitudeDegrees; // Scaled Int (-180, 180) JausDouble elevationMeters; // Scaled Int (-10000, 35000) JausDouble positionRmsMeters; // Scaled UInt (0, 100) JausDouble rollRadians; // Scaled Short (-JAUS_PI, JAUS_PI) JausDouble pitchRadians; // Scaled Short (-JAUS_PI, JAUS_PI) JausDouble yawRadians; // Scaled Short (-JAUS_PI, JAUS_PI) JausDouble attitudeRmsRadians; // Scaled Short (0, JAUS_PI) JausTime time; }ReportGlobalPoseMessageStruct; typedef ReportGlobalPoseMessageStruct* ReportGlobalPoseMessage; JAUS_EXPORT ReportGlobalPoseMessage reportGlobalPoseMessageCreate(void); JAUS_EXPORT void reportGlobalPoseMessageDestroy(ReportGlobalPoseMessage); JAUS_EXPORT JausBoolean reportGlobalPoseMessageFromBuffer(ReportGlobalPoseMessage message, unsigned char* buffer, unsigned int bufferSizeBytes); JAUS_EXPORT JausBoolean reportGlobalPoseMessageToBuffer(ReportGlobalPoseMessage message, unsigned char *buffer, unsigned int bufferSizeBytes); JAUS_EXPORT ReportGlobalPoseMessage reportGlobalPoseMessageFromJausMessage(JausMessage jausMessage); JAUS_EXPORT JausMessage reportGlobalPoseMessageToJausMessage(ReportGlobalPoseMessage message); JAUS_EXPORT unsigned int reportGlobalPoseMessageSize(ReportGlobalPoseMessage message); JAUS_EXPORT char* reportGlobalPoseMessageToString(ReportGlobalPoseMessage message); #endif // REPORT_GLOBAL_POSE_MESSAGE_H
/* * * Copyright 2015, Google 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 Google 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 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* This file is autogenerated from: templates/src/core/surface/version.c.template */ #include <grpc/grpc.h> const char *grpc_version_string(void) { return "0.10.0.0"; }
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2010, Rice University * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the Rice University 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 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /* Authors: Caleb Voss */ #ifndef OMPL_EXTENSION_MORSE_STATE_SPACE_ #define OMPL_EXTENSION_MORSE_STATE_SPACE_ #include "ompl/base/StateSpace.h" #include "ompl/extensions/morse/MorseEnvironment.h" namespace ompl { namespace base { /** \brief State space representing MORSE states */ class MorseStateSpace : public CompoundStateSpace { public: /** \brief MORSE State. This is a compound state that allows accessing the properties of the bodies the * state space is constructed for. */ class StateType : public CompoundStateSpace::StateType { public: StateType() : CompoundStateSpace::StateType() { } }; /** \brief Construct a state space representing MORSE states. This will be a compound state space with 4 components for each body in \e env.stateBodies_. The 4 subspaces constructed for each body are: position (R<sup>3</sup>), linear velocity (R<sup>3</sup>), angular velocity (R<sup>3</sup>) and orientation (SO(3)). Default bounds are set by calling setDefaultBounds(). \param env the environment to construct the state space for \param positionWeight the weight to pass to CompoundStateSpace::addSubspace() for position subspaces \param linVelWeight the weight to pass to CompoundStateSpace::addSubspace() for linear velocity subspaces \param angVelWeight the weight to pass to CompoundStateSpace::addSubspace() for angular velocity subspaces \param orientationWeight the weight to pass to CompoundStateSpace::addSubspace() for orientation subspaces */ MorseStateSpace(const MorseEnvironmentPtr &env, double positionWeight = 1.0, double linVelWeight = 0.5, double angVelWeight = 0.5, double orientationWeight = 1.0); virtual ~MorseStateSpace() { } /** \brief Get the MORSE environment this state space corresponds to */ const MorseEnvironmentPtr &getEnvironment() const { return env_; } /** \brief Get the number of bodies this state space represents */ unsigned int getNrBodies() const { return env_->rigidBodies_; } /** \brief Set the bounds given by the MorseEnvironment */ void setBounds(); /** \brief Set the bounds for each of the position subspaces */ void setPositionBounds(const RealVectorBounds &bounds); /** \brief Set the bounds for each of the linear velocity subspaces */ void setLinearVelocityBounds(const RealVectorBounds &bounds); /** \brief Set the bounds for each of the angular velocity subspaces */ void setAngularVelocityBounds(const RealVectorBounds &bounds); /** \brief Read the parameters of the MORSE bodies and store them in \e state. */ void readState(State *state) const; /** \brief Set the parameters of the MORSE bodies to be the ones read from \e state. */ void writeState(const State *state) const; /** \brief This function checks whether a state satisfies its bounds */ bool satisfiesBounds(const State *state) const; State *allocState() const; void freeState(State *state) const; void copyState(State *destination, const State *source) const; void interpolate(const State *from, const State *to, const double t, State *state) const; StateSamplerPtr allocDefaultStateSampler() const; StateSamplerPtr allocStateSampler() const; protected: /** \brief Representation of the MORSE parameters OMPL needs to plan */ MorseEnvironmentPtr env_; }; } } #endif
// // LEMSGViewController.h // LoveEye // // Created by Flynn on 15/7/18. // Copyright (c) 2015年 Fly. All rights reserved. // #import "LETViewController.h" @interface LEMSGViewController : LETViewController @end
#include "FLA_lapack2flame_return_defs.h" #include "FLA_f2c.h" int zhetd2_check(char *uplo, int *n, dcomplex *a, int *lda, double *d__, double *e, dcomplex *tau, int *info) { /* System generated locals */ int a_dim1, a_offset, i__1; logical upper; /* Parameter adjustments */ a_dim1 = *lda; a_offset = 1 + a_dim1; a -= a_offset; --d__; --e; --tau; /* Function Body */ *info = 0; upper = lsame_(uplo, "U"); if (! upper && ! lsame_(uplo, "L")) { *info = -1; } else if (*n < 0) { *info = -2; } else if (*lda < max(1,*n)) { *info = -4; } if (*info != 0) { i__1 = -(*info); xerbla_("ZHETD2", &i__1); return LAPACK_FAILURE; } /* Quick return if possible */ if (*n <= 0) { return LAPACK_QUICK_RETURN; } return LAPACK_SUCCESS; }
//**************************************************************************\ //* This file is property of and copyright by the ALICE Project *\ //* ALICE Experiment at CERN, All rights reserved. *\ //* *\ //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *\ //* for The ALICE HLT Project. *\ //* *\ //* Permission to use, copy, modify and distribute this software and its *\ //* documentation strictly for non-commercial purposes is hereby granted *\ //* without fee, provided that the above copyright notice appears in all *\ //* copies and that both the copyright notice and this permission notice *\ //* appear in the supporting documentation. The authors make no claims *\ //* about the suitability of this software for any purpose. It is *\ //* provided "as is" without express or implied warranty. *\ //************************************************************************** /// \file GPUTRDTrackPoint.h /// \brief This is a flat data structure for transporting TRD track points via network between the components /// \author Sergey Gorbunov, Ole Schmidt #ifndef GPUTRDTRACKPOINT_H #define GPUTRDTRACKPOINT_H struct GPUTRDTrackPoint { float fX[3]; short fVolumeId; }; struct GPUTRDTrackPointData { unsigned int fCount; // number of space points #if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC) GPUTRDTrackPoint fPoints[1]; // array of space points #else GPUTRDTrackPoint fPoints[0]; // array of space points #endif }; typedef struct GPUTRDTrackPointData GPUTRDTrackPointData; #endif // GPUTRDTRACKPOINT_H
#ifndef org_apache_lucene_codecs_lucene40_Lucene40TermVectorsReader_H #define org_apache_lucene_codecs_lucene40_Lucene40TermVectorsReader_H #include "org/apache/lucene/codecs/TermVectorsReader.h" namespace org { namespace apache { namespace lucene { namespace index { class SegmentInfo; class Fields; class FieldInfos; } namespace store { class Directory; class IOContext; } } } } namespace java { namespace lang { class Class; } namespace io { class IOException; } } template<class T> class JArray; namespace org { namespace apache { namespace lucene { namespace codecs { namespace lucene40 { class Lucene40TermVectorsReader : public ::org::apache::lucene::codecs::TermVectorsReader { public: enum { mid_init$_3589180f, mid_checkIntegrity_54c6a166, mid_clone_475a2624, mid_close_54c6a166, mid_get_ef1c9c73, mid_ramBytesUsed_54c6a17a, max_mid }; static ::java::lang::Class *class$; static jmethodID *mids$; static bool live$; static jclass initializeClass(bool); explicit Lucene40TermVectorsReader(jobject obj) : ::org::apache::lucene::codecs::TermVectorsReader(obj) { if (obj != NULL) env->getClass(initializeClass); } Lucene40TermVectorsReader(const Lucene40TermVectorsReader& obj) : ::org::apache::lucene::codecs::TermVectorsReader(obj) {} Lucene40TermVectorsReader(const ::org::apache::lucene::store::Directory &, const ::org::apache::lucene::index::SegmentInfo &, const ::org::apache::lucene::index::FieldInfos &, const ::org::apache::lucene::store::IOContext &); void checkIntegrity() const; ::org::apache::lucene::codecs::TermVectorsReader clone() const; void close() const; ::org::apache::lucene::index::Fields get(jint) const; jlong ramBytesUsed() const; }; } } } } } #include <Python.h> namespace org { namespace apache { namespace lucene { namespace codecs { namespace lucene40 { extern PyTypeObject PY_TYPE(Lucene40TermVectorsReader); class t_Lucene40TermVectorsReader { public: PyObject_HEAD Lucene40TermVectorsReader object; static PyObject *wrap_Object(const Lucene40TermVectorsReader&); static PyObject *wrap_jobject(const jobject&); static void install(PyObject *module); static void initialize(PyObject *module); }; } } } } } #endif
/*! @file @author Albert Semenov @date 08/2008 */ #ifndef DEMO_KEEPER_H_ #define DEMO_KEEPER_H_ #include "Base/BaseDemoManager.h" #include "GraphView.h" #include "AnimationGraph.h" #include "AnimationGraphFactory.h" #include "AnimationNodeFactory.h" #include "GraphNodeFactory.h" #include "OpenSaveFileDialog.h" #include "ContextMenu.h" namespace demo { class DemoKeeper : public base::BaseDemoManager { public: DemoKeeper(); private: virtual void createScene(); virtual void destroyScene(); virtual void setupResources(); void notifyFrameStarted(float _time); void createGrapView(); void notifyNodeClosed(wraps::BaseGraphView* _sender, wraps::BaseGraphNode* _node); void notifyConnectPoint(wraps::BaseGraphView* _sender, wraps::BaseGraphConnection* _from, wraps::BaseGraphConnection* _to); void notifyDisconnectPoint(wraps::BaseGraphView* _sender, wraps::BaseGraphConnection* _from, wraps::BaseGraphConnection* _to); void notifyInvalidateNode(BaseAnimationNode* _sender); void notifyMouseButtonReleased(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id); void notifyMenuCtrlAccept(wraps::ContextMenu* _sender, const std::string& _id); void SaveGraph(); void LoadGraph(); void ClearGraph(); void notifyEndDialog(tools::Dialog* _dialog, bool _result); void saveToFile(const std::string& _filename); void loadFromFile(const std::string& _filename); BaseAnimationNode* createNode(const std::string& _type, const std::string& _name); BaseAnimationNode* getNodeByName(const std::string& _name); void connectPoints(BaseAnimationNode* _node_from, BaseAnimationNode* _node_to, const std::string& _name_from, const std::string& _name_to); void disconnectPoints(BaseAnimationNode* _node_from, BaseAnimationNode* _node_to, const std::string& _name_from, const std::string& _name_to); private: GraphView* mGraphView; animation::AnimationGraphFactory mGraphFactory; animation::AnimationNodeFactory mNodeFactory; animation::AnimationGraph* mGraph; GraphNodeFactory mGraphNodeFactory; tools::OpenSaveFileDialog* mFileDialog; bool mFileDialogSave; wraps::ContextMenu* mContextMenu; typedef std::vector<BaseAnimationNode*> VectorBaseAnimationNode; VectorBaseAnimationNode mNodes; MyGUI::IntPoint mClickPosition; }; } // namespace demo #endif // DEMO_KEEPER_H_
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // //=============================================================================// #ifndef MACRO_TEXTURE_H #define MACRO_TEXTURE_H #ifdef _WIN32 #pragma once #endif #include "mathlib/vector.h" // The macro texture looks for a TGA file with the same name as the BSP file and in // the same directory. If it finds one, it maps this texture onto the world dimensions // (in the worldspawn entity) and masks all lightmaps with it. void InitMacroTexture( const char *pBSPFilename ); void ApplyMacroTextures( int iFace, const Vector &vWorldPos, Vector &outLuxel ); #endif // MACRO_TEXTURE_H
#ifndef org_apache_lucene_search_spans_TermSpans_H #define org_apache_lucene_search_spans_TermSpans_H #include "org/apache/lucene/search/spans/Spans.h" namespace org { namespace apache { namespace lucene { namespace index { class Term; class DocsAndPositionsEnum; } } } } namespace java { namespace lang { class Class; class String; } namespace util { class Collection; } namespace io { class IOException; } } template<class T> class JArray; namespace org { namespace apache { namespace lucene { namespace search { namespace spans { class TermSpans : public ::org::apache::lucene::search::spans::Spans { public: enum { mid_init$_33ebef71, mid_cost_54c6a17a, mid_doc_54c6a179, mid_end_54c6a179, mid_getPayload_2d2d7de4, mid_getPostings_548e5d87, mid_isPayloadAvailable_54c6a16a, mid_next_54c6a16a, mid_skipTo_39c7bd30, mid_start_54c6a179, mid_toString_14c7b5c5, max_mid }; static ::java::lang::Class *class$; static jmethodID *mids$; static bool live$; static jclass initializeClass(bool); explicit TermSpans(jobject obj) : ::org::apache::lucene::search::spans::Spans(obj) { if (obj != NULL) env->getClass(initializeClass); } TermSpans(const TermSpans& obj) : ::org::apache::lucene::search::spans::Spans(obj) {} static TermSpans *EMPTY_TERM_SPANS; TermSpans(const ::org::apache::lucene::index::DocsAndPositionsEnum &, const ::org::apache::lucene::index::Term &); jlong cost() const; jint doc() const; jint end() const; ::java::util::Collection getPayload() const; ::org::apache::lucene::index::DocsAndPositionsEnum getPostings() const; jboolean isPayloadAvailable() const; jboolean next() const; jboolean skipTo(jint) const; jint start() const; ::java::lang::String toString() const; }; } } } } } #include <Python.h> namespace org { namespace apache { namespace lucene { namespace search { namespace spans { extern PyTypeObject PY_TYPE(TermSpans); class t_TermSpans { public: PyObject_HEAD TermSpans object; static PyObject *wrap_Object(const TermSpans&); static PyObject *wrap_jobject(const jobject&); static void install(PyObject *module); static void initialize(PyObject *module); }; } } } } } #endif
/* * Copyright 2017 Google, Inc * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _ABI_MACH_ASPEED_AST2500_RESET_H_ #define _ABI_MACH_ASPEED_AST2500_RESET_H_ /* * The values are intentionally layed out as flags in * WDT reset parameter. */ #define AST_RESET_SOC 0 #define AST_RESET_CHIP 1 #define AST_RESET_CPU (1 << 1) #define AST_RESET_ARM (1 << 2) #define AST_RESET_COPROC (1 << 3) #define AST_RESET_SDRAM (1 << 4) #define AST_RESET_AHB (1 << 5) #define AST_RESET_I2C (1 << 6) #define AST_RESET_MAC1 (1 << 7) #define AST_RESET_MAC2 (1 << 8) #define AST_RESET_GCRT (1 << 9) #define AST_RESET_USB20 (1 << 10) #define AST_RESET_USB11_HOST (1 << 11) #define AST_RESET_USB11_HID (1 << 12) #define AST_RESET_VIDEO (1 << 13) #define AST_RESET_HAC (1 << 14) #define AST_RESET_LPC (1 << 15) #define AST_RESET_SDIO (1 << 16) #define AST_RESET_MIC (1 << 17) #define AST_RESET_CRT2D (1 << 18) #define AST_RESET_PWM (1 << 19) #define AST_RESET_PECI (1 << 20) #define AST_RESET_JTAG (1 << 21) #define AST_RESET_ADC (1 << 22) #define AST_RESET_GPIO (1 << 23) #define AST_RESET_MCTP (1 << 24) #define AST_RESET_XDMA (1 << 25) #define AST_RESET_SPI (1 << 26) #define AST_RESET_MISC (1 << 27) #endif /* _ABI_MACH_ASPEED_AST2500_RESET_H_ */
#ifndef BHV_FORCE_PASS_H #define BHV_FORCE_PASS_H #include <rcsc/player/player_object.h> #include <rcsc/player/soccer_action.h> #include <rcsc/player/world_model.h> #include <rcsc/geom/vector_2d.h> #include <rcsc/geom/angle_deg.h> #include <functional> #include <vector> /* class WorldModel; */ /* class PlayerObject; */ /*! \class Force_Pass \brief advanced pass planning & behavior. */ class Force_Pass : public rcsc::BodyAction { public: /*! \enum PassType \brief pass type id */ enum PassType { DIRECT = 1, LEAD = 2, THROUGH = 3 }; /*! \struct PassRoute \brief pass route information object, that contains type, receiver info, receive point and ball first speed. */ struct PassRoute { PassType type_; //!< pass type id const rcsc::PlayerObject * receiver_; //!< pointer to the receiver player rcsc::Vector2D receive_point_; //!< estimated receive point double first_speed_; //!< ball first speed bool one_step_kick_; //!< true if ball reaches first speed only by one kick. double score_; //!< evaluated value of this pass /*! \brief construct with all member variables \param type pass type id \param receiver pointer to the receiver player \param point pass receive point \param speed ball first speed \param one_step_kick true if ball reaches first speed only by one kick. */ PassRoute( PassType type, const rcsc::PlayerObject * receiver, const rcsc::Vector2D & point, const double & speed, const bool one_step_kick ) : type_( type ) , receiver_( receiver ) , receive_point_( point ) , first_speed_( speed ) , one_step_kick_( one_step_kick ) , score_( 0.0 ) { } }; /*! \class PassRouteScoreComp \brief function object to evaluate the pass */ class PassRouteScoreComp : public std::binary_function< PassRoute, PassRoute, bool > { public: /*! \brief compare operator \param lhs left hand side argument \param rhs right hand side argument \return compared result */ result_type operator()( const first_argument_type & lhs, const second_argument_type & rhs ) const { return lhs.score_ < rhs.score_; } }; private: //! cached calculated pass data static std::vector< PassRoute > S_cached_pass_route; public: /*! \brief accessible from global. */ Force_Pass() { } /*! \brief execute action \param agent pointer to the agent itself \return true if action is performed */ bool execute( rcsc::PlayerAgent * agent ); /*! \brief calculate best pass route \param world consr rerefence to the WorldModel \param target_point receive target point is stored to this \param first_speed ball first speed is stored to this \param receiver receiver number \return true if pass route is found. */ static bool get_best_pass( const rcsc::WorldModel & world, rcsc::Vector2D * target_point, double * first_speed, int * receiver ); static bool get_pass_to_player( const rcsc::WorldModel & world, int receiver ); private: static void create_routes( const rcsc::WorldModel & world ); static void create_routes_to_player( const rcsc::WorldModel & world, const rcsc::PlayerObject *teammate ); static void create_direct_pass( const rcsc::WorldModel & world, const rcsc::PlayerObject * teammates ); static void create_lead_pass( const rcsc::WorldModel & world, const rcsc::PlayerObject * teammates ); static void create_through_pass( const rcsc::WorldModel & world, const rcsc::PlayerObject * teammates ); static void create_forced_pass( const rcsc::WorldModel & world, const rcsc::PlayerObject * teammates ); static bool verify_direct_pass( const rcsc::WorldModel & world, const rcsc::PlayerObject * receiver, const rcsc::Vector2D & target_point, const double & target_dist, const rcsc::AngleDeg & target_angle, const double & first_speed ); static bool verify_through_pass( const rcsc::WorldModel & world, const rcsc::PlayerObject * receiver, const rcsc::Vector2D & receiver_pos, const rcsc::Vector2D & target_point, const double & target_dist, const rcsc::AngleDeg & target_angle, const double & first_speed, const double & reach_step ); static void evaluate_routes( const rcsc::WorldModel & world ); static bool can_kick_by_one_step( const rcsc::WorldModel & world, const double & first_speed, const rcsc::AngleDeg & target_angle ); }; #endif
/* * OpenKore C++ Standard Library * Copyright (C) 2006 VCL * * 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 Street, Fifth Floor, Boston, * MA 02110-1301 USA */ // This file is necessary because the concrete Socket implementation class // is used by the concrete ServerSocket implementation class. #ifndef _OSL_UNIX_SOCKET_H_ #define _OSL_UNIX_SOCKET_H_ #include <sys/types.h> #include <sys/socket.h> namespace OSL { namespace _Intern { class InStream; class OutStream; /** * @internal * An implementation of Socket for Unix. */ class UnixSocket: public Socket { private: int fd; InStream *in; OutStream *out; void construct(int fd); public: /** * Create a new UnixSocket. * * @param address The address of the server to connect to. * @param port The port of the server. * @pre address != NULL * @pre port > 0 * @throws SocketException */ UnixSocket(const char *address, unsigned short port); /** * Create a new UnixSocket with the specified file descriptor. * * @param fd A valid file descriptor. * @pre fd >= 0 * @throws SocketException */ UnixSocket(int fd); virtual ~UnixSocket(); virtual InputStream *getInputStream() const; virtual OutputStream *getOutputStream() const; }; } // namespace _Intern } // namespace OSL #endif /* _OSL_UNIX_SOCKET_H_ */
/* * Copyright © 2002 Jorn Baayen <jorn@nl.linux.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION) #error "Only <epiphany/epiphany.h> can be included directly." #endif #ifndef EPHY_BOOKMARKS_EDITOR_H #define EPHY_BOOKMARKS_EDITOR_H #include <gtk/gtk.h> #include "ephy-node-view.h" #include "ephy-bookmarks.h" G_BEGIN_DECLS #define EPHY_TYPE_BOOKMARKS_EDITOR (ephy_bookmarks_editor_get_type ()) #define EPHY_BOOKMARKS_EDITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_BOOKMARKS_EDITOR, EphyBookmarksEditor)) #define EPHY_BOOKMARKS_EDITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_BOOKMARKS_EDITOR, EphyBookmarksEditorClass)) #define EPHY_IS_BOOKMARKS_EDITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_BOOKMARKS_EDITOR)) #define EPHY_IS_BOOKMARKS_EDITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_BOOKMARKS_EDITOR)) #define EPHY_BOOKMARKS_EDITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_BOOKMARKS_EDITOR, EphyBookmarksEditorClass)) typedef struct _EphyBookmarksEditorPrivate EphyBookmarksEditorPrivate; typedef struct { GtkWindow parent; /*< private >*/ EphyBookmarksEditorPrivate *priv; } EphyBookmarksEditor; typedef struct { GtkDialogClass parent; } EphyBookmarksEditorClass; GType ephy_bookmarks_editor_get_type (void); GtkWidget *ephy_bookmarks_editor_new (EphyBookmarks *bookmarks); void ephy_bookmarks_editor_set_parent (EphyBookmarksEditor *ebe, GtkWidget *window); G_END_DECLS #endif /* EPHY_BOOKMARKS_EDITOR_H */
// license:BSD-3-Clause // copyright-holders:Phil Stroffolino /************************************************************************* Munch Mobile *************************************************************************/ class munchmo_state : public driver_device { public: munchmo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_sprite_xpos(*this, "sprite_xpos"), m_sprite_tile(*this, "sprite_tile"), m_sprite_attr(*this, "sprite_attr"), m_videoram(*this, "videoram"), m_status_vram(*this, "status_vram"), m_vreg(*this, "vreg"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"){ } /* memory pointers */ required_shared_ptr<UINT8> m_sprite_xpos; required_shared_ptr<UINT8> m_sprite_tile; required_shared_ptr<UINT8> m_sprite_attr; required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_status_vram; required_shared_ptr<UINT8> m_vreg; /* video-related */ std::unique_ptr<bitmap_ind16> m_tmpbitmap; int m_palette_bank; int m_flipscreen; /* misc */ int m_nmi_enable; /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; DECLARE_WRITE8_MEMBER(mnchmobl_nmi_enable_w); DECLARE_WRITE8_MEMBER(mnchmobl_soundlatch_w); DECLARE_WRITE8_MEMBER(sound_nmi_ack_w); DECLARE_WRITE8_MEMBER(mnchmobl_palette_bank_w); DECLARE_WRITE8_MEMBER(mnchmobl_flipscreen_w); DECLARE_READ8_MEMBER(munchmo_ay1reset_r); DECLARE_READ8_MEMBER(munchmo_ay2reset_r); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(munchmo); UINT32 screen_update_mnchmobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mnchmobl_vblank_irq); INTERRUPT_GEN_MEMBER(mnchmobl_sound_irq); void draw_status( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); };
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __gnu_xml_xpath_EqualityExpr__ #define __gnu_xml_xpath_EqualityExpr__ #pragma interface #include <gnu/xml/xpath/Expr.h> extern "Java" { namespace gnu { namespace xml { namespace xpath { class EqualityExpr; class Expr; } } } namespace javax { namespace xml { namespace namespace { class QName; } } } namespace org { namespace w3c { namespace dom { class Node; } } } } class gnu::xml::xpath::EqualityExpr : public ::gnu::xml::xpath::Expr { public: // actually package-private EqualityExpr(::gnu::xml::xpath::Expr *, ::gnu::xml::xpath::Expr *, jboolean); public: ::java::lang::Object * evaluate(::org::w3c::dom::Node *, jint, jint); private: jboolean evaluateImpl(::org::w3c::dom::Node *, jint, jint); public: ::gnu::xml::xpath::Expr * clone(::java::lang::Object *); jboolean references(::javax::xml::namespace::QName *); ::java::lang::String * toString(); public: // actually package-private ::gnu::xml::xpath::Expr * __attribute__((aligned(__alignof__( ::gnu::xml::xpath::Expr)))) lhs; ::gnu::xml::xpath::Expr * rhs; jboolean invert; public: static ::java::lang::Class class$; }; #endif // __gnu_xml_xpath_EqualityExpr__
#include "netinet/in.h" const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
/* */ /* */ /* */ /* */ /* */ /* */ /* Copyright (c) Telechips, Inc. */ /* */ /* */ /* */ #include <linux/module.h> #include <linux/delay.h> #include <linux/slab.h> #include "tcc353x_common.h" /* */ I08S Tcc353xDebugStr[1024]; /* */ I32S TcpalPrintLog(const I08S * _fmt, ...) { va_list ap; va_start(ap, _fmt); vsprintf(Tcc353xDebugStr, _fmt, ap); va_end(ap); printk(KERN_INFO"%s", Tcc353xDebugStr); return TCC353X_RETURN_SUCCESS; } I32S TcpalPrintErr(const I08S * _fmt, ...) { va_list ap; va_start(ap, _fmt); vsprintf(Tcc353xDebugStr, _fmt, ap); va_end(ap); printk(KERN_ERR"%s", Tcc353xDebugStr); return TCC353X_RETURN_SUCCESS; } I32S TcpalPrintStatus(const I08S * _fmt, ...) { va_list ap; va_start(ap, _fmt); vsprintf(Tcc353xDebugStr, _fmt, ap); va_end(ap); printk(KERN_DEBUG"%s", Tcc353xDebugStr); return TCC353X_RETURN_SUCCESS; } /* */ #define MAX_TIMECNT 0xFFFFFFFFFFFFFFFFLL TcpalTime_t TcpalGetCurrentTimeCount_ms(void) { TcpalTime_t tickcount = 0; struct timeval tv; do_gettimeofday(&tv); tickcount = (long long) tv.tv_sec * 1000 + tv.tv_usec / 1000; return tickcount; } TcpalTime_t TcpalGetTimeIntervalCount_ms(TcpalTime_t _startTimeCount) { TcpalTime_t count = 0; if (TcpalGetCurrentTimeCount_ms() >= _startTimeCount) count = TcpalGetCurrentTimeCount_ms() - _startTimeCount; else count = ((MAX_TIMECNT - _startTimeCount) + TcpalGetCurrentTimeCount_ms() + 1); return count; } /* */ void TcpalmSleep(I32S _ms) { msleep(_ms); } void TcpalmDelay(I32S _ms) { I32S i; for(i=0; i<_ms; i++) mdelay(1); } void TcpaluSleep(I32S _us) { // } /* */ void *TcpalMalloc(I32U _size) { void *ptr = NULL; if (!_size) ptr = NULL; else ptr = (void *)kmalloc(_size, GFP_KERNEL); return ptr; } I32S TcpalFree(void *_ptr) { I32S error; error = TCC353X_RETURN_SUCCESS; if (_ptr == NULL) { error = TCC353X_RETURN_FAIL_NULL_ACCESS; } else { kfree(_ptr); _ptr = NULL; } return TCC353X_RETURN_SUCCESS; } void *TcpalMemset(void *_dest, I32U _data, I32U _cnt) { void *ptr = NULL; if (_dest == NULL) ptr = NULL; else ptr = memset(_dest, _data, _cnt); return ptr; } void *TcpalMemcpy(void *_dest, const void *_src, I32U _cnt) { void *ptr = NULL; if ((_dest == NULL) || (_src == NULL)) ptr = NULL; else ptr = memcpy(_dest, _src, _cnt); return ptr; } /* */ #define MAX_MUTEX_POOL 15 static struct mutex MutexPool[MAX_MUTEX_POOL]; static I32U MutexAssignd[MAX_MUTEX_POOL] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; static I32S TcpalGetSemaphoreAddress(void) { I32S i; for(i=0; i<MAX_MUTEX_POOL; i++) { if(MutexAssignd[i] == 0) { MutexAssignd[i] = (I32U)(&MutexPool[i]); return i; } } return (-1); } static I32S TcpalFreeSemaphoreAddress(I32U _address) { I32S i; for(i=0; i<MAX_MUTEX_POOL; i++) { if(MutexAssignd[i] == _address) { MutexAssignd[i] = 0; return i; } } return (-1); } I32S TcpalCreateSemaphore(TcpalSemaphore_t * _semaphore, I08S * _name, I32U _initialCount) { struct mutex *lock; I32S index; index = TcpalGetSemaphoreAddress(); if(index<0) { TcpalPrintErr((I08S *)"######## Mutex Get Fail :%d \n", (int)index); return TCC353X_RETURN_FAIL; } lock = &MutexPool[index]; mutex_init(lock); TcpalPrintErr((I08S *)"######## MutexC %s [%d] \n", _name, (int)(lock)); *_semaphore = (TcpalSemaphore_t)lock; return TCC353X_RETURN_SUCCESS; } I32S TcpalDeleteSemaphore(TcpalSemaphore_t * _semaphore) { struct mutex *lock = (struct mutex*)*_semaphore; I32U address; I32S index; if(lock == NULL) return TCC353X_RETURN_FAIL; address = (I32U)(lock); index = TcpalFreeSemaphoreAddress(address); if(index < 0) { TcpalPrintErr((I08S *)"####### Mutex Delete Fail :%d \n", (int)index); return TCC353X_RETURN_FAIL; } TcpalPrintErr((I08S *)"######## MutexR [%d] \n", (int)(lock)); mutex_destroy(lock); *_semaphore = 0; return TCC353X_RETURN_SUCCESS; } I32S TcpalSemaphoreLock(TcpalSemaphore_t * _semaphore) { struct mutex *lock = (struct mutex*)*_semaphore; if(lock == NULL) { TcpalPrintErr((I08S *)"semaphore lock error\n"); return TCC353X_RETURN_FAIL; } mutex_lock(lock); return TCC353X_RETURN_SUCCESS; } I32S TcpalSemaphoreUnLock(TcpalSemaphore_t * _semaphore) { struct mutex *lock = (struct mutex*)*_semaphore; if(lock == NULL) { TcpalPrintErr((I08S *)"semaphore unlock error\n"); return TCC353X_RETURN_FAIL; } mutex_unlock(lock); return TCC353X_RETURN_SUCCESS; }
/* $Id: AudioAdapterImpl.h $ */ /** @file * * VirtualBox COM class implementation */ /* * Copyright (C) 2006-2011 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ #ifndef ____H_AUDIOADAPTER #define ____H_AUDIOADAPTER #include "VirtualBoxBase.h" namespace settings { struct AudioAdapter; } class ATL_NO_VTABLE AudioAdapter : public VirtualBoxBase, VBOX_SCRIPTABLE_IMPL(IAudioAdapter) { public: struct Data { Data(); BOOL mEnabled; AudioDriverType_T mAudioDriver; AudioControllerType_T mAudioController; }; VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(AudioAdapter, IAudioAdapter) DECLARE_NOT_AGGREGATABLE(AudioAdapter) DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(AudioAdapter) VBOX_DEFAULT_INTERFACE_ENTRIES(IAudioAdapter) END_COM_MAP() DECLARE_EMPTY_CTOR_DTOR (AudioAdapter) HRESULT FinalConstruct(); void FinalRelease(); // public initializer/uninitializer for internal purposes only HRESULT init(Machine *aParent); HRESULT init(Machine *aParent, AudioAdapter *aThat); HRESULT initCopy(Machine *aParent, AudioAdapter *aThat); void uninit(); STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled); STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled); STDMETHOD(COMGETTER(AudioDriver))(AudioDriverType_T *aAudioDriverType); STDMETHOD(COMSETTER(AudioDriver))(AudioDriverType_T aAudioDriverType); STDMETHOD(COMGETTER(AudioController))(AudioControllerType_T *aAudioControllerType); STDMETHOD(COMSETTER(AudioController))(AudioControllerType_T aAudioControllerType); // public methods only for internal purposes HRESULT loadSettings(const settings::AudioAdapter &data); HRESULT saveSettings(settings::AudioAdapter &data); void rollback(); void commit(); void copyFrom(AudioAdapter *aThat); private: Machine * const mParent; const ComObjPtr<AudioAdapter> mPeer; Backupable<Data> mData; }; #endif // ____H_AUDIOADAPTER /* vi: set tabstop=4 shiftwidth=4 expandtab: */
#ifndef _IQ_H_ #define IQ_H_ #include <QByteArray> #include "global.h" class OJN_EXPORT IQ { public: enum Iq_Types { Iq_Get, Iq_Set, Iq_Result, Iq_Unknown }; IQ(QByteArray const&); ~IQ() {}; bool IsValid() const; IQ::Iq_Types Type() const; QByteArray const& Content() const; QByteArray const& From() const; // %1 = id, %2 = from, %3 = to, %4 = result QByteArray Reply(Iq_Types type, QByteArray const&, QByteArray const& content); protected: Iq_Types fromString(QByteArray const&) const; QByteArray toString(IQ::Iq_Types type) const; bool isValid; QByteArray from; QByteArray to; Iq_Types type; QByteArray id; QByteArray content; }; inline bool IQ::IsValid() const { return isValid; } inline IQ::Iq_Types IQ::Type() const { return type; } inline QByteArray const& IQ::Content() const { return content; } inline QByteArray const& IQ::From() const { return from; } #endif
/* Special .init and .fini section support. ARM version. Copyright (C) 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C 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. In addition to the permissions in the GNU Lesser General Public License, the Free Software Foundation gives you unlimited permission to link the compiled version of this file with other programs, and to distribute those programs without any restriction coming from the use of this file. (The GNU Lesser General Public License restrictions do apply in other respects; for example, they cover modification of the file, and distribution when not linked into another program.) Note that people who make modified versions of this file are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. The GNU C 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 the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* Prevent this function from being inlined. Otherwise half of its constant pool will end up in crti and the other half in crtn. */ static void call_gmon_start (void) __attribute__((noinline)); #include <sysdeps/generic/initfini.c>
#ifndef __ASM_SH_BITOPS_H #define __ASM_SH_BITOPS_H #ifdef __KERNEL__ #ifndef _LINUX_BITOPS_H #error only <linux/bitops.h> can be included directly #endif #include <asm/system.h> /* For __swab32 */ #include <asm/byteorder.h> #ifdef CONFIG_GUSA_RB #include <asm/bitops-grb.h> #else #include <asm/bitops-irq.h> #endif /* * clear_bit() doesn't provide any barrier for the compiler. */ #define smp_mb__before_clear_bit() barrier() #define smp_mb__after_clear_bit() barrier() #include <asm-generic/bitops/non-atomic.h> #ifdef CONFIG_SUPERH32 static inline unsigned long ffz(unsigned long word) { unsigned long result; __asm__("1:\n\t" "shlr %1\n\t" "bt/s 1b\n\t" " add #1, %0" : "=r" (result), "=r" (word) : "0" (~0L), "1" (word) : "t"); return result; } /** * __ffs - find first bit in word. * @word: The word to search * * Undefined if no bit exists, so code should check against 0 first. */ static inline unsigned long __ffs(unsigned long word) { unsigned long result; __asm__("1:\n\t" "shlr %1\n\t" "bf/s 1b\n\t" " add #1, %0" : "=r" (result), "=r" (word) : "0" (~0L), "1" (word) : "t"); return result; } #else static inline unsigned long ffz(unsigned long word) { unsigned long result, __d2, __d3; __asm__("gettr tr0, %2\n\t" "pta $+32, tr0\n\t" "andi %1, 1, %3\n\t" "beq %3, r63, tr0\n\t" "pta $+4, tr0\n" "0:\n\t" "shlri.l %1, 1, %1\n\t" "addi %0, 1, %0\n\t" "andi %1, 1, %3\n\t" "beqi %3, 1, tr0\n" "1:\n\t" "ptabs %2, tr0\n\t" : "=r" (result), "=r" (word), "=r" (__d2), "=r" (__d3) : "0" (0L), "1" (word)); return result; } #include <asm-generic/bitops/__ffs.h> #endif #include <asm-generic/bitops/find.h> #include <asm-generic/bitops/ffs.h> #include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/lock.h> #include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/ext2-non-atomic.h> #include <asm-generic/bitops/ext2-atomic.h> #include <asm-generic/bitops/minix.h> #include <asm-generic/bitops/fls.h> #include <asm-generic/bitops/fls64.h> #endif /* __KERNEL__ */ #endif /* __ASM_SH_BITOPS_H */
/* crc16.h * Declaration of CRC-16 routines and table * * 2004 Richard van der Hoff <richardv@mxtelecom.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * 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. */ #ifndef __CRC16_H__ #define __CRC16_H__ #include "ws_symbol_export.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Calculate the CCITT/ITU/CRC-16 16-bit CRC (parameters for this CRC are: Polynomial: x^16 + x^12 + x^5 + 1 (0x1021); Start value 0xFFFF; XOR result with 0xFFFF; First bit is LSB) */ /** Compute CRC16 CCITT checksum of a buffer of data. @param buf The buffer containing the data. @param len The number of bytes to include in the computation. @return The CRC16 CCITT checksum. */ WS_DLL_PUBLIC guint16 crc16_ccitt(const guint8 *buf, guint len); /** Compute CRC16 X.25 CCITT checksum of a buffer of data. @param buf The buffer containing the data. @param len The number of bytes to include in the computation. @return The CRC16 X.25 CCITT checksum. */ WS_DLL_PUBLIC guint16 crc16_x25_ccitt(const guint8 *buf, guint len); /** Compute CRC16 CCITT checksum of a buffer of data. If computing the * checksum over multiple buffers and you want to feed the partial CRC16 * back in, remember to take the 1's complement of the partial CRC16 first. @param buf The buffer containing the data. @param len The number of bytes to include in the computation. @param seed The seed to use. @return The CRC16 CCITT checksum (using the given seed). */ WS_DLL_PUBLIC guint16 crc16_ccitt_seed(const guint8 *buf, guint len, guint16 seed); /** Calculates a CRC16 checksum for the given buffer with the polynom * 0x5935 using a precompiled CRC table * @param buf a pointer to a buffer of the given length * @param len the length of the given buffer * @param seed The seed to use. * @return the CRC16 checksum for the buffer */ WS_DLL_PUBLIC guint16 crc16_0x5935(const guint8 *buf, guint32 len, guint16 seed); /** Calculates a CRC16 checksum for the given buffer with the polynom * 0x755B using a precompiled CRC table * @param buf a pointer to a buffer of the given length * @param len the length of the given buffer * @param seed The seed to use. * @return the CRC16 checksum for the buffer */ WS_DLL_PUBLIC guint16 crc16_0x755B(const guint8 *buf, guint32 len, guint16 seed); /** Computes CRC16 checksum for the given data with the polynom 0x9949 using * precompiled CRC table * @param buf a pointer to a buffer of the given length * @param len the length of the given buffer * @param seed The seed to use. * @return the CRC16 checksum for the buffer */ WS_DLL_PUBLIC guint16 crc16_0x9949_seed(const guint8 *buf, guint len, guint16 seed); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* crc16.h */
/* Definitions for LM32 running Linux-based GNU systems using ELF Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2009 Free Software Foundation, Inc. Contributed by Philip Blundell <philb@gnu.org> This file is part of GCC. GCC 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, or (at your option) any later version. GCC 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 GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ /* elfos.h should have already been included. Now just override any conflicting definitions and add any extras. */ /* Run-time Target Specification. */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (LM32 GNU/Linux with ELF)", stderr); /* Do not assume anything about header files. */ #undef NO_IMPLICIT_EXTERN_C #define NO_IMPLICIT_EXTERN_C /* The GNU C++ standard library requires that these macros be defined. */ #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" /* Now we define the strings used to build the spec file. */ #undef LIB_SPEC #define LIB_SPEC \ "%{pthread:-lpthread} \ %{shared:-lc} \ %{!shared:-lc} " #define LIBGCC_SPEC "-lgcc" /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add the GNU/Linux magical crtbegin.o file (see crtstuff.c) which provides part of the support for getting C++ file-scope static object constructed before entering `main'. */ #undef STARTFILE_SPEC #define STARTFILE_SPEC \ "%{!shared: \ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ %{!p:%{profile:gcrt1.o%s} \ %{!profile:crt1.o%s}}}} \ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on the GNU/Linux magical crtend.o file (see crtstuff.c) which provides part of the support for getting C++ file-scope static object constructed before entering `main', followed by a normal GNU/Linux "finalizer" file, `crtn.o'. */ #undef ENDFILE_SPEC #define ENDFILE_SPEC \ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" #undef LINK_SPEC #define LINK_SPEC "%{h*} %{version:-v} \ %{b} %{Wl,*:%*} \ %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ %{rdynamic:-export-dynamic} \ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}" #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS() #define LINK_GCC_C_SEQUENCE_SPEC \ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" #undef CC1_SPEC #define CC1_SPEC "%{G*} %{!fno-PIC:-fPIC}"
/* $Id$ */ /** @file * IPRT - Ring-3 initialization. */ /* * Copyright (C) 2006-2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. * * The contents of this file may alternatively be used under the terms * of the Common Development and Distribution License Version 1.0 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the * VirtualBox OSE distribution, in which case the provisions of the * CDDL are applicable instead of those of the GPL. * * You may elect to license modified versions of this file under the * terms and conditions of either the GPL or the CDDL or both. */ #ifndef ___r3_init_h #define ___r3_init_h #include <iprt/types.h> DECLHIDDEN(int) rtR3InitNativeFirst(uint32_t fFlags); DECLHIDDEN(int) rtR3InitNativeFinal(uint32_t fFlags); DECLHIDDEN(void) rtR3InitNativeObtrusive(void); #endif
/*************************************************************************** * This file is part of the KDE project * * Copyright 2007 Will Stephenson <wstephenson@kde.org> * * Copyright (C) 2009 Ben Cooksley <bcooksley@kde.org> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef MENUITEM_H #define MENUITEM_H #include "systemsettingsview_export.h" #include <KDE/KService> class QString; class KCModuleInfo; template<typename T> class QList; /** * @brief Provides a specific item in the list of modules or categories * * This provides convienent access to the list of modules, providing information about them * such as name, module information and its service object.\n * This is created automatically by System Settings, and is shared among all plugins and so should not * be modified under any circumstances.\n * * System Settings creates it in a tree like manner, with categories containing subcategories and modules, * and subcategories repeating this.\n * * The service object must be set, unless it is the top level item, otherwise using applications * will crash when attempting to sort the children by weight * * @author Ben Cooksley <bcooksley@kde.org> * @author Will Stephenson <wstephenson@kde.org> */ class SYSTEMSETTINGSVIEW_EXPORT MenuItem { public: /** * Creates a MenuItem. * @note Will not provide keywords, name, or a module item until a service has been set. * * @param isMenu Specifies if it is a category or not. * @param parent The item it is parented to. Provide 0 for a top level item. */ MenuItem( bool isMenu, MenuItem * parent ); /** * Destroys a MenuItem, including all children, the service object and the module information. * * @warning Destroys the KService and KCModuleInfo objects provided by service() and item(). */ ~MenuItem(); /** * Sorts the children depending on the value of "X-KDE-Weight" in the desktop files of the * category or module. */ void sortChildrenByWeight(); /** * Provides the MenuItem for the child at the specified index. * * @param index The index of the child. * @returns The MenuItem object of the specified child. */ MenuItem * child( int index ); /** * Returns the list of keywords, which is used for searching the list of categories and modules. * * @note The parent items share all the keywords of their children. * @returns The list of keywords the item has. */ QStringList keywords(); /** * Returns the parent of this item. * * @returns The MenuItem object of this items parent. */ MenuItem *parent() const; /** * Provides a list of all the children of this item. * * @returns The list of children this has. */ QList<MenuItem*>& children() const; /** * Returns the service object of this item, which contains useful information about it. * * @returns The service object of this item if it has been set. */ KService::Ptr& service() const; /** * Provides the KDE control module information item, which can be used to load control modules * by the ModuleView. * * @returns The control module information object of the item, if the service object has been set. */ KCModuleInfo& item() const; /** * Convienence function which provides the name of the current item. * * @returns The name of the item, if the service object has been set. */ QString& name() const; /** * Convienence function which provides the System Settings category of the current item. * * @returns The category of the item, if the service object has been set. */ QString& category() const; /** * Provides the weight of the current item, as determined by its service. * If the service does not specify a weight, it is 100 * * @returns The weight of the service */ int weight(); /** * Provides information on which type the current item is. * * @returns true if it is a category. * @returns false if it is not a category. */ bool menu() const; /** * Sets the service object, which is used to provide the module information, name and keywords * Applications will crash if it is not set, unless it is the top level item. * * @param service The service object to store. */ void setService( const KService::Ptr& service ); private: class Private; Private *const d; }; Q_DECLARE_METATYPE( MenuItem * ) #endif