text
stringlengths
4
6.14k
/** * SerialCommand - A Wiring/Arduino library to tokenize and parse commands * received over a serial port. * * Copyright (C) 2012 Stefan Rado * Copyright (C) 2011 Steven Cogswell <steven.cogswell@gmail.com> * http://husks.wordpress.com * * Version 20120522 * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SerialCommand_h #define SerialCommand_h #if defined(WIRING) && WIRING >= 100 #include <Wiring.h> #elif defined(ARDUINO) && ARDUINO >= 100 #include <Arduino.h> #else #include <WProgram.h> #endif #include <string.h> // Size of the input buffer in bytes (maximum length of one command plus arguments) #define SERIALCOMMAND_BUFFER 32 // Maximum length of a command including the terminating null #define SERIALCOMMAND_MAXCOMMANDLENGTH 4 // Uncomment the next line to run the library in debug mode (verbose messages) //#define SERIALCOMMAND_DEBUG class SerialCommand { public: SerialCommand(); // Constructor void addCommand(const char *command, void(*function)()); // Add a command to the processing dictionary. void setDefaultHandler(void (*function)(const char *)); // A handler to call when no valid command received. void readSerial(); // Main entry point. void clearBuffer(); // Clears the input buffer. char *next(); // Returns pointer to next token found in command buffer (for getting arguments to commands). private: // Command/handler dictionary struct SerialCommandCallback { char command[SERIALCOMMAND_MAXCOMMANDLENGTH + 1]; void (*function)(); }; // Data structure to hold Command/Handler function key-value pairs SerialCommandCallback *commandList; // Actual definition for command/handler array uint8_t commandCount; // Pointer to the default handler function void (*defaultHandler)(const char *); char delim[2]; // null-terminated list of character to be used as delimeters for tokenizing (default " ") char term; // Character that signals end of command (default '\n') char buffer[SERIALCOMMAND_BUFFER + 1]; // Buffer of stored characters while waiting for terminator character uint8_t bufPos; // Current position in the buffer char *last; // State variable used by strtok_r during processing }; #endif //SerialCommand_h
/* -*-objc-*- NSCollectionView.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Doug Simons (doug.simons@testplant.com) Frank LeGrand (frank.legrand@testplant.com) Date: February 2013 This file is part of the GNUstep GUI Library. 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 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; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/> or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSCollectionView #define _GNUstep_H_NSCollectionView #import <AppKit/NSNibDeclarations.h> #import <GNUstepBase/GSVersionMacros.h> #import <AppKit/NSView.h> #import <AppKit/NSDragging.h> @class NSCollectionViewItem; @class NSCollectionView; enum { NSCollectionViewDropOn = 0, NSCollectionViewDropBefore = 1, }; typedef NSInteger NSCollectionViewDropOperation; @protocol NSCollectionViewDelegate <NSObject> - (NSImage *)collectionView:(NSCollectionView *)collectionView draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset; - (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pasteboard; - (BOOL)collectionView:(NSCollectionView *)collectionView canDragItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event; - (NSDragOperation)collectionView:(NSCollectionView *)collectionView validateDrop:(id < NSDraggingInfo >)draggingInfo proposedIndex:(NSInteger *)proposedDropIndex dropOperation:(NSCollectionViewDropOperation *)proposedDropOperation; - (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id < NSDraggingInfo >)draggingInfo index:(NSInteger)index dropOperation:(NSCollectionViewDropOperation)dropOperation; - (NSArray *)collectionView:(NSCollectionView *)collectionView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropURL forDraggedItemsAtIndexes:(NSIndexSet *)indexes; @end @interface NSCollectionView : NSView { NSArray *_content; IBOutlet NSCollectionViewItem *itemPrototype; NSMutableArray *_items; BOOL _allowsMultipleSelection; BOOL _isSelectable; NSIndexSet *_selectionIndexes; NSArray *_backgroundColors; IBOutlet id <NSCollectionViewDelegate> delegate; NSSize _itemSize; NSSize _maxItemSize; NSSize _minItemSize; float _tileWidth; float _verticalMargin; float _horizontalMargin; NSUInteger _maxNumberOfColumns; NSUInteger _maxNumberOfRows; long _numberOfColumns; NSDragOperation _draggingSourceOperationMaskForLocal; NSDragOperation _draggingSourceOperationMaskForRemote; NSUInteger _draggingOnRow; NSUInteger _draggingOnIndex; } - (BOOL) allowsMultipleSelection; - (void) setAllowsMultipleSelection: (BOOL)flag; - (NSArray *) backgroundColors; - (void) setBackgroundColors: (NSArray *)colors; - (NSArray *)content; - (void)setContent:(NSArray *)content; - (id < NSCollectionViewDelegate >) delegate; - (void) setDelegate: (id < NSCollectionViewDelegate >)aDelegate; - (NSCollectionViewItem *) itemPrototype; - (void) setItemPrototype: (NSCollectionViewItem *)prototype; - (NSSize) maxItemSize; - (void) setMaxItemSize: (NSSize)size; - (NSUInteger) maxNumberOfColumns; - (void) setMaxNumberOfColumns: (NSUInteger)number; - (NSUInteger) maxNumberOfRows; - (void) setMaxNumberOfRows: (NSUInteger)number; - (NSSize) minItemSize; - (void) setMinItemSize: (NSSize)size; - (BOOL) isSelectable; - (void) setSelectable: (BOOL)flag; - (NSIndexSet *) selectionIndexes; - (void) setSelectionIndexes: (NSIndexSet *)indexes; - (NSRect) frameForItemAtIndex: (NSUInteger)index; - (NSCollectionViewItem *) itemAtIndex: (NSUInteger)index; - (NSCollectionViewItem *) newItemForRepresentedObject:(id)object; - (void) tile; - (void) setDraggingSourceOperationMask: (NSDragOperation)dragOperationMask forLocal: (BOOL)localDestination; - (NSImage *) draggingImageForItemsAtIndexes: (NSIndexSet *)indexes withEvent: (NSEvent *)event offset: (NSPointPointer)dragImageOffset; @end #endif /* _GNUstep_H_NSCollectionView */
/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** 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 <QHash> #include <QPointer> #include <QVector> #include <coreplugin/core_global.h> #include <utils/id.h> #include <utils/theme/theme.h> QT_BEGIN_NAMESPACE class QAbstractScrollArea; class QScrollBar; QT_END_NAMESPACE namespace Core { struct CORE_EXPORT Highlight { enum Priority { Invalid = -1, LowPriority = 0, NormalPriority = 1, HighPriority = 2, HighestPriority = 3 }; Highlight(Utils::Id category, int position, Utils::Theme::Color color, Priority priority); Highlight() = default; Utils::Id category; int position = -1; Utils::Theme::Color color = Utils::Theme::TextColorNormal; Priority priority = Invalid; }; class HighlightScrollBarOverlay; class CORE_EXPORT HighlightScrollBarController { public: HighlightScrollBarController() = default; ~HighlightScrollBarController(); QScrollBar *scrollBar() const; QAbstractScrollArea *scrollArea() const; void setScrollArea(QAbstractScrollArea *scrollArea); double lineHeight() const; void setLineHeight(double lineHeight); double visibleRange() const; void setVisibleRange(double visibleRange); double margin() const; void setMargin(double margin); QHash<Utils::Id, QVector<Highlight>> highlights() const; void addHighlight(Highlight highlight); void removeHighlights(Utils::Id id); void removeAllHighlights(); private: QHash<Utils::Id, QVector<Highlight> > m_highlights; double m_lineHeight = 0.0; double m_visibleRange = 0.0; // in pixels double m_margin = 0.0; // in pixels QAbstractScrollArea *m_scrollArea = nullptr; QPointer<HighlightScrollBarOverlay> m_overlay; }; } // namespace Core
/* * Vortex OpenSplice * * This software and documentation are Copyright 2006 to TO_YEAR ADLINK * Technology Limited, its affiliated companies and licensors. 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. * */ #include "cpp_io.h" #include "if.h" extern void do_line (void) { char c; outputc('#'); while ((c = Get()) != '\n') { outputc(c); } }
/* Free Download Manager Copyright (c) 2003-2014 FreeDownloadManager.ORG */ #if !defined(AFX_FLOATINGWNDSTHREAD_H__5AFA0C0A_F6EB_4F13_A252_7A2B10C0A64F__INCLUDED_) #define AFX_FLOATINGWNDSTHREAD_H__5AFA0C0A_F6EB_4F13_A252_7A2B10C0A64F__INCLUDED_ #include "FloatingWnd.h" #include "FloatingInfoWnd.h" #if _MSC_VER > 1000 #pragma once #endif class CFloatingWndsThread : public CWinThread { DECLARE_DYNCREATE(CFloatingWndsThread) protected: CFloatingWndsThread(); public: public: CFloatingInfoWnd m_wndFloatingInfo; CFloatingWnd m_wndFloating; //{{AFX_VIRTUAL(CFloatingWndsThread) public: virtual BOOL InitInstance(); virtual int ExitInstance(); //}}AFX_VIRTUAL protected: virtual ~CFloatingWndsThread(); //{{AFX_MSG(CFloatingWndsThread) //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} #endif
// Copyright CERN and copyright holders of ALICE O2. This software is // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // // See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// /// \file Definitions.h /// \brief /// #ifndef TRACKINGITSU_INCLUDE_CADEFINITIONS_H_ #define TRACKINGITSU_INCLUDE_CADEFINITIONS_H_ // #define _ALLOW_DEBUG_TREES_ITS_ // to allow debug (vertexer only) #ifndef __OPENCL__ #include <array> #endif //#define CA_DEBUG #ifdef CA_DEBUG #define CA_DEBUGGER(x) x #else #define CA_DEBUGGER(x) \ do { \ } while (0) #ifndef NDEBUG #define NDEBUG 1 #endif #endif #if defined(CUDA_ENABLED) #define TRACKINGITSU_GPU_MODE true #else #define TRACKINGITSU_GPU_MODE false #endif #if defined(__CUDACC__) #define TRACKINGITSU_GPU_COMPILING #endif #if defined(__CUDA_ARCH__) #define TRACKINGITSU_GPU_DEVICE #endif #if defined(__CUDACC__) #define GPU_HOST __host__ #define GPU_DEVICE __device__ #define GPU_HOST_DEVICE __host__ __device__ #define GPU_GLOBAL __global__ #define GPU_SHARED __shared__ #define GPU_SYNC __syncthreads() #define MATH_CEIL ceil #include "ITStrackingCUDA/Array.h" template <typename T, std::size_t Size> using GPUArray = o2::its::GPU::Array<T, Size>; typedef cudaStream_t GPUStream; #else #define GPU_HOST #define GPU_DEVICE #define GPU_HOST_DEVICE #define GPU_GLOBAL #define GPU_SHARED #define GPU_SYNC #define MATH_CEIL std::ceil #ifndef __VECTOR_TYPES_H__ #include "GPUCommonDef.h" #endif #ifndef __OPENCL__ template <typename T, size_t Size> using GPUArray = std::array<T, Size>; #else #include "ITStrackingCUDA/Array.h" template <typename T, size_t Size> using GPUArray = o2::its::GPU::Array<T, Size>; #endif typedef struct _dummyStream { } GPUStream; #endif #endif /* TRACKINGITSU_INCLUDE_CADEFINITIONS_H_ */
/* Copyright (C) CFEngine AS This file is part of CFEngine 3 - written and maintained by CFEngine AS. 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; version 3. 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 To the extent this program is licensed as part of the Enterprise versions of CFEngine, the applicable Commercial Open Source License (COSL) may apply to this file if you as a licensee so wish it. See included file COSL.txt. */ #ifndef CFENGINE_PROTOTYPES3_H #define CFENGINE_PROTOTYPES3_H #include <cf3.defs.h> #include <compiler.h> #include <enterprise_extension.h> #include <set.h> bool BootstrapAllowed(void); /* Versions */ const char *Version(void); const char *NameVersion(void); /* cfparse.y */ void yyerror(const char *s); /* agent.c */ PromiseResult ScheduleAgentOperations(EvalContext *ctx, const Bundle *bp); /* Only for agent.c */ void ConnectionsInit(void); void ConnectionsCleanup(void); /* client_protocol.c */ void SetSkipIdentify(bool enabled); /* enterprise_stubs.c */ ENTERPRISE_VOID_FUNC_1ARG_DECLARE(void, Nova_Initialize, EvalContext *, ctx); ENTERPRISE_FUNC_1ARG_DECLARE(int, CfSessionKeySize, char, c); ENTERPRISE_FUNC_0ARG_DECLARE(char, CfEnterpriseOptions); ENTERPRISE_FUNC_1ARG_DECLARE(const EVP_CIPHER *, CfengineCipher, char, type); ENTERPRISE_VOID_FUNC_1ARG_DECLARE(void, EnterpriseContext, EvalContext *, ctx); ENTERPRISE_FUNC_0ARG_DECLARE(const char *, GetConsolePrefix); ENTERPRISE_VOID_FUNC_1ARG_DECLARE(void, LoadSlowlyVaryingObservations, EvalContext *, ctx); ENTERPRISE_FUNC_6ARG_DECLARE(char *, GetRemoteScalar, EvalContext *, ctx, char *, proto, char *, handle, char *, server, int, encrypted, char *, rcv); ENTERPRISE_VOID_FUNC_2ARG_DECLARE(void, LogTotalCompliance, const char *, version, int, background_tasks); #if defined(__MINGW32__) ENTERPRISE_FUNC_4ARG_DECLARE(int, GetRegistryValue, const char *, key, char *, name, char *, buf, int, bufSz); #endif ENTERPRISE_FUNC_6ARG_DECLARE(void *, CfLDAPValue, char *, uri, char *, dn, char *, filter, char *, name, char *, scope, char *, sec); ENTERPRISE_FUNC_6ARG_DECLARE(void *, CfLDAPList, char *, uri, char *, dn, char *, filter, char *, name, char *, scope, char *, sec); ENTERPRISE_FUNC_8ARG_DECLARE(void *, CfLDAPArray, EvalContext *, ctx, const Bundle *, caller, char *, array, char *, uri, char *, dn, char *, filter, char *, scope, char *, sec); ENTERPRISE_FUNC_8ARG_DECLARE(void *, CfRegLDAP, EvalContext *, ctx, char *, uri, char *, dn, char *, filter, char *, name, char *, scope, char *, regex, char *, sec); ENTERPRISE_VOID_FUNC_3ARG_DECLARE(void, CacheUnreliableValue, char *, caller, char *, handle, char *, buffer); ENTERPRISE_FUNC_3ARG_DECLARE(int, RetrieveUnreliableValue, char *, caller, char *, handle, char *, buffer); ENTERPRISE_VOID_FUNC_2ARG_DECLARE(void, TranslatePath, char *, new, const char *, old); ENTERPRISE_VOID_FUNC_4ARG_DECLARE(void, TrackValue, char *, date, double, kept, double, repaired, double, notkept); ENTERPRISE_FUNC_4ARG_DECLARE(bool, ListHostsWithClass, EvalContext *, ctx, Rlist **, return_list, char *, class_name, char *, return_format); ENTERPRISE_VOID_FUNC_3ARG_DECLARE(void, GetObservable, int, i, char *, name, char *, desc); ENTERPRISE_VOID_FUNC_1ARG_DECLARE(void, SetMeasurementPromises, Item **, classlist); ENTERPRISE_VOID_FUNC_2ARG_DECLARE(void, CheckAndSetHAState, const char *, workdir, EvalContext *, ctx); ENTERPRISE_VOID_FUNC_0ARG_DECLARE(void, ReloadHAConfig); ENTERPRISE_VOID_FUNC_2ARG_DECLARE(void, Nova_ClassHistoryAddContextName, const StringSet *, list, const char *, context_name); ENTERPRISE_VOID_FUNC_2ARG_DECLARE(void, Nova_ClassHistoryEnable, StringSet **, list, bool, enable); /* manual.c */ void TexinfoManual(EvalContext *ctx, const char *source_dir, const char *output_file); /* modes.c */ int ParseModeString(const char *modestring, mode_t *plusmask, mode_t *minusmask); /* patches.c */ int IsPrivileged(void); char *cf_strtimestamp_local(const time_t time, char *buf); char *cf_strtimestamp_utc(const time_t time, char *buf); int cf_closesocket(int sd); #if !defined(__MINGW32__) #define OpenNetwork() /* noop */ #define CloseNetwork() /* noop */ #else void OpenNetwork(void); void CloseNetwork(void); #endif int LinkOrCopy(const char *from, const char *to, int sym); int ExclusiveLockFile(int fd); int ExclusiveUnlockFile(int fd); /* storage_tools.c */ off_t GetDiskUsage(char *file, CfSize type); /* verify_reports.c */ PromiseResult VerifyReportPromise(EvalContext *ctx, const Promise *pp); /* cf-key */ ENTERPRISE_FUNC_1ARG_DECLARE(bool, LicenseInstall, char *, path_source); /* cf-serverd */ ENTERPRISE_FUNC_0ARG_DECLARE(size_t, EnterpriseGetMaxCfHubProcesses); #endif
/* * databits_uic.c * * Copyright (C) 2014 Marcos Vives Del Sol <socram8888@gmail.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 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 <stdio.h> #include "databits.h" #include "uic_codes.h" /* * UIC-751-3 Ground-train decoder */ unsigned int databits_decode_uic(char *output, unsigned long long input, unsigned int type) { int written; if (!output) { return 0; } unsigned int code = (unsigned int) bit_reverse(bit_window(input, 24, 8), 8); written = sprintf(output, "Train ID: %X%X%X%X%X%X - Message: %02X (%s)\n", (unsigned int) bit_window(input, 0, 4), (unsigned int) bit_window(input, 4, 4), (unsigned int) bit_window(input, 8, 4), (unsigned int) bit_window(input, 12, 4), (unsigned int) bit_window(input, 16, 4), (unsigned int) bit_window(input, 20, 4), code, uic_message_meaning(code, type) ); return written; } unsigned int databits_decode_uic_ground(char *output, unsigned int outputSize, unsigned long long input, unsigned int inputSize) { return databits_decode_uic(output, input, UIC_TYPE_GROUNDTRAIN); } unsigned int databits_decode_uic_train(char *output, unsigned int outputSize, unsigned long long input, unsigned int inputSize) { return databits_decode_uic(output, input, UIC_TYPE_TRAINGROUND); }
/* * 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. * * Written (W) 2006 Mikio L. Braun * Written (W) 1999-2009 Soeren Sonnenburg * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society */ #ifndef _KERNELRIDGEREGRESSION_H__ #define _KERNELRIDGEREGRESSION_H__ #include <shogun/lib/config.h> #include <shogun/regression/Regression.h> #include <shogun/kernel/Kernel.h> #include <shogun/machine/KernelMachine.h> namespace shogun { /** @brief Class KernelRidgeRegression implements Kernel Ridge Regression - a regularized least square * method for classification and regression. * * It is similar to support vector machines (cf. CSVM). However in contrast to * SVMs a different objective is optimized that leads to a dense solution (thus * not only a few support vectors are active in the end but all training * examples). This makes it only applicable to rather few (a couple of * thousand) training examples. In case a linear kernel is used RR is closely * related to Fishers Linear Discriminant (cf. LDA). * * Internally (for linear kernels) it is solved via minimizing the following system * * \f[ * \frac{1}{2}\left(\sum_{i=1}^N(y_i-{\bf w}\cdot {\bf x}_i)^2 + \tau||{\bf w}||^2\right) * \f] * * which boils down to solving a linear system * * \f[ * {\bf w} = \left(\tau {\bf I}+ \sum_{i=1}^N{\bf x}_i{\bf x}_i^T\right)^{-1}\left(\sum_{i=1}^N y_i{\bf x}_i\right) * \f] * * and in the kernel case * \f[ * {\bf \alpha}=\left({\bf K}+\tau{\bf I}\right)^{-1}{\bf y} * \f] * where K is the kernel matrix and y the vector of labels. The expressed * solution can again be written as a linear combination of kernels (cf. * CKernelMachine) with bias \f$b=0\f$. */ class CKernelRidgeRegression : public CKernelMachine { public: /** problem type */ MACHINE_PROBLEM_TYPE(PT_REGRESSION); /** default constructor */ CKernelRidgeRegression(); /** constructor * * @param tau regularization constant tau * @param k kernel * @param lab labels */ CKernelRidgeRegression(float64_t tau, CKernel* k, CLabels* lab); /** default destructor */ virtual ~CKernelRidgeRegression() {} /** set regularization constant * * @param tau new tau */ inline void set_tau(float64_t tau) { m_tau = tau; }; /** set convergence precision for gauss seidel method * * @param epsilon new epsilon */ inline void set_epsilon(float64_t epsilon) { m_epsilon = epsilon; } /** load regression from file * * @param srcfile file to load from * @return if loading was successful */ virtual bool load(FILE* srcfile); /** save regression to file * * @param dstfile file to save to * @return if saving was successful */ virtual bool save(FILE* dstfile); /** get classifier type * * @return classifier type KernelRidgeRegression */ virtual EMachineType get_classifier_type() { return CT_KERNELRIDGEREGRESSION; } /** @return object name */ virtual const char* get_name() const { return "KernelRidgeRegression"; } protected: /** Train regression * * @param data training data (parameter can be avoided if distance or * kernel-based regressors are used and distance/kernels are * initialized with train data) * * @return whether training was successful */ virtual bool train_machine(CFeatures* data=NULL); /** Train regression using Cholesky decomposition. * Assumes that m_alpha is already allocated. * * * @return boolean to indicate success */ bool solve_krr_system(); private: void init(); private: /** regularization parameter tau */ float64_t m_tau; /** epsilon constant */ float64_t m_epsilon; }; } #endif // _KERNELRIDGEREGRESSION_H__
#ifndef _CAMERA_INFO_OV9726RAW_H #define _CAMERA_INFO_OV9726RAW_H /******************************************************************************* * Configuration ********************************************************************************/ #define SENSOR_ID OV9726_SENSOR_ID #define SENSOR_DRVNAME SENSOR_DRVNAME_0V9726_RAW #define INCLUDE_FILENAME_ISP_REGS_PARAM "camera_isp_regs_ov9726raw.h" #define INCLUDE_FILENAME_ISP_PCA_PARAM "camera_isp_pca_ov9726raw.h" /******************************************************************************* * ********************************************************************************/ #if defined(ISP_SUPPORT) #define OV9726RAW_CAMERA_AUTO_DSC CAM_AUTO_DSC #define OV9726RAW_CAMERA_PORTRAIT CAM_PORTRAIT #define OV9726RAW_CAMERA_LANDSCAPE CAM_LANDSCAPE #define OV9726RAW_CAMERA_SPORT CAM_SPORT #define OV9726RAW_CAMERA_FLOWER CAM_FLOWER #define OV9726RAW_CAMERA_NIGHTSCENE CAM_NIGHTSCENE #define OV9726RAW_CAMERA_DOCUMENT CAM_DOCUMENT #define OV9726RAW_CAMERA_ISO_ANTI_HAND_SHAKE CAM_ISO_ANTI_HAND_SHAKE #define OV9726RAW_CAMERA_ISO100 CAM_ISO100 #define OV9726RAW_CAMERA_ISO200 CAM_ISO200 #define OV9726RAW_CAMERA_ISO400 CAM_ISO400 #define OV9726RAW_CAMERA_ISO800 CAM_ISO800 #define OV9726RAW_CAMERA_ISO1600 CAM_ISO1600 #define OV9726RAW_CAMERA_VIDEO_AUTO CAM_VIDEO_AUTO #define OV9726RAW_CAMERA_VIDEO_NIGHT CAM_VIDEO_NIGHT #define OV9726RAW_CAMERA_NO_OF_SCENE_MODE CAM_NO_OF_SCENE_MODE #endif #endif
/** * || ____ _ __ * +------+ / __ )(_) /_______________ _____ ___ * | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ * +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ * || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ * * Crazyflie control firmware * * Copyright (C) 2011-2012 Bitcraze AB * * 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, in version 3. * * 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/>. * * filter.h - Filtering functions */ #ifndef FILTER_H_ #define FILTER_H_ #include <stdint.h> #include "math.h" #define IIR_SHIFT 8 int16_t iirLPFilterSingle(int32_t in, int32_t attenuation, int32_t* filt); typedef struct { float a1; float a2; float b0; float b1; float b2; float delay_element_1; float delay_element_2; } lpf2pData; void lpf2pInit(lpf2pData* lpfData, float sample_freq, float cutoff_freq); void lpf2pSetCutoffFreq(lpf2pData* lpfData, float sample_freq, float cutoff_freq); float lpf2pApply(lpf2pData* lpfData, float sample); float lpf2pReset(lpf2pData* lpfData, float sample); /** Second order low pass filter structure. * * using biquad filter with bilinear z transform * * http://en.wikipedia.org/wiki/Digital_biquad_filter * http://www.earlevel.com/main/2003/03/02/the-bilinear-z-transform * * Laplace continious form: * * 1 * H(s) = ------------------- * s^2/w^2 + s/w*Q + 1 * * * Polynomial discrete form: * * b0 + b1 z^-1 + b2 z^-2 * H(z) = ---------------------- * a0 + a1 z^-1 + a2 z^-2 * * with: * a0 = 1 * a1 = 2*(K^2 - 1) / (K^2 + K/Q + 1) * a2 = (K^2 - K/Q + 1) / (K^2 + K/Q + 1) * b0 = K^2 / (K^2 + K/Q + 1) * b1 = 2*b0 * b2 = b0 * K = tan(pi*Fc/Fs) ~ pi*Fc/Fs = Ts/(2*tau) * Fc: cutting frequency * Fs: sampling frequency * Ts: sampling period * tau: time constant (tau = 1/(2*pi*Fc)) * Q: gain at cutoff frequency * * Note that b[0]=b[2], so we don't need to save b[2] */ struct SecondOrderLowPass { float a[2]; ///< denominator gains float b[2]; ///< numerator gains float i[2]; ///< input history float o[2]; ///< output history }; /** Init second order low pass filter. * * @param filter second order low pass filter structure * @param tau time constant of the second order low pass filter * @param Q Q value of the second order low pass filter * @param sample_time sampling period of the signal * @param value initial value of the filter */ static inline void init_second_order_low_pass(struct SecondOrderLowPass *filter, float tau, float Q, float sample_time, float value) { float K = tanf(sample_time / (2.0f * tau)); float poly = K * K + K / Q + 1.0f; filter->a[0] = 2.0f * (K * K - 1.0f) / poly; filter->a[1] = (K * K - K / Q + 1.0f) / poly; filter->b[0] = K * K / poly; filter->b[1] = 2.0f * filter->b[0]; filter->i[0] = filter->i[1] = filter->o[0] = filter->o[1] = value; } /** Update second order low pass filter state with a new value. * * @param filter second order low pass filter structure * @param value new input value of the filter * @return new filtered value */ static inline float update_second_order_low_pass(struct SecondOrderLowPass *filter, float value) { float out = filter->b[0] * value + filter->b[1] * filter->i[0] + filter->b[0] * filter->i[1] - filter->a[0] * filter->o[0] - filter->a[1] * filter->o[1]; filter->i[1] = filter->i[0]; filter->i[0] = value; filter->o[1] = filter->o[0]; filter->o[0] = out; return out; } /** Get current value of the second order low pass filter. * * @param filter second order low pass filter structure * @return current value of the filter */ static inline float get_second_order_low_pass(struct SecondOrderLowPass *filter) { return filter->o[0]; } struct SecondOrderLowPass_int { int32_t a[2]; ///< denominator gains int32_t b[2]; ///< numerator gains int32_t i[2]; ///< input history int32_t o[2]; ///< output history int32_t loop_gain; ///< loop gain }; /** Second order Butterworth low pass filter. */ typedef struct SecondOrderLowPass Butterworth2LowPass; /** Init a second order Butterworth filter. * * based on the generic second order filter * with Q = 0.7071 = 1/sqrt(2) * * http://en.wikipedia.org/wiki/Butterworth_filter * * @param filter second order Butterworth low pass filter structure * @param tau time constant of the second order low pass filter * @param sample_time sampling period of the signal * @param value initial value of the filter */ static inline void init_butterworth_2_low_pass(Butterworth2LowPass *filter, float tau, float sample_time, float value) { init_second_order_low_pass((struct SecondOrderLowPass *)filter, tau, 0.7071, sample_time, value); } /** Update second order Butterworth low pass filter state with a new value. * * @param filter second order Butterworth low pass filter structure * @param value new input value of the filter * @return new filtered value */ static inline float update_butterworth_2_low_pass(Butterworth2LowPass *filter, float value) { return update_second_order_low_pass((struct SecondOrderLowPass *)filter, value); } /** Get current value of the second order Butterworth low pass filter. * * @param filter second order Butterworth low pass filter structure * @return current value of the filter */ static inline float get_butterworth_2_low_pass(Butterworth2LowPass *filter) { return filter->o[0]; } #endif //FILTER_H_
#ifndef _ROS_driver_base_ConfigString_h #define _ROS_driver_base_ConfigString_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" namespace driver_base { class ConfigString : public ros::Msg { public: char * name; char * value; virtual int serialize(unsigned char *outbuffer) const { int offset = 0; uint32_t * length_name = (uint32_t *)(outbuffer + offset); *length_name = strlen( (const char*) this->name); offset += 4; memcpy(outbuffer + offset, this->name, *length_name); offset += *length_name; uint32_t * length_value = (uint32_t *)(outbuffer + offset); *length_value = strlen( (const char*) this->value); offset += 4; memcpy(outbuffer + offset, this->value, *length_value); offset += *length_value; return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; uint32_t length_name = *(uint32_t *)(inbuffer + offset); offset += 4; for(unsigned int k= offset; k< offset+length_name; ++k){ inbuffer[k-1]=inbuffer[k]; } inbuffer[offset+length_name-1]=0; this->name = (char *)(inbuffer + offset-1); offset += length_name; uint32_t length_value = *(uint32_t *)(inbuffer + offset); offset += 4; for(unsigned int k= offset; k< offset+length_value; ++k){ inbuffer[k-1]=inbuffer[k]; } inbuffer[offset+length_value-1]=0; this->value = (char *)(inbuffer + offset-1); offset += length_value; return offset; } const char * getType(){ return "driver_base/ConfigString"; }; const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; }; } #endif
/* ** ClanLib SDK ** Copyright (c) 1997-2011 The ClanLib Team ** ** This software is provided 'as-is', without any express or implied ** warranty. In no event will the authors be held liable for any damages ** arising from the use of this software. ** ** Permission is granted to anyone to use this software for any purpose, ** including commercial applications, and to alter it and redistribute it ** freely, subject to the following restrictions: ** ** 1. The origin of this software must not be misrepresented; you must not ** claim that you wrote the original software. If you use this software ** in a product, an acknowledgment in the product documentation would be ** appreciated but is not required. ** 2. Altered source versions must be plainly marked as such, and must not be ** misrepresented as being the original software. ** 3. This notice may not be removed or altered from any source distribution. ** ** Note: Some of the libraries ClanLib may link to may have additional ** requirements or restrictions. ** ** File Author(s): ** ** Magnus Norddahl */ /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing /// \{ #pragma once #include "api_sound.h" #include "../Core/System/sharedptr.h" #include "soundbuffer_session.h" class CL_ResourceManager; class CL_SoundOutput; class CL_SoundProvider; class CL_SoundBuffer_Session; class CL_SoundFilter; class CL_SoundBuffer_Impl; class CL_IODevice; class CL_VirtualDirectory; /// \brief Sample interface in ClanLib. /// /// <p>The CL_SoundBuffer class represents a sample in ClanLib. It can /// either be static or streamed. The soundbuffer gets its sample data from /// a soundprovider, that is passed during construction.</p> /// \xmlonly !group=Sound/Audio Mixing! !header=sound.h! \endxmlonly class CL_API_SOUND CL_SoundBuffer { /// \name Construction /// \{ public: /// \brief Construct a null instance CL_SoundBuffer(); /// \brief Construct sound buffer. /** <p>A sound buffer can be constructed either as static or streamed. If the sound buffer is loaded from resources, the buffer type is determined by the resource option 'stream' associated with the resource.</p> - <p>CL_SoundBuffer's internals are reference counted, so the copy constructor will create a new soundbuffer object which shares the same buffer as the original one. This means that if the copy is modified, the original is affected as well.</p> - <p>If <i>delete_provider</i> is true, the provider will be deleted when the soundbuffer is deleted.</p>*/ CL_SoundBuffer( const CL_String &res_id, CL_ResourceManager *manager); CL_SoundBuffer( CL_SoundProvider *provider); CL_SoundBuffer( const CL_String &fullname, bool streamed = false, const CL_String &format = ""); CL_SoundBuffer( const CL_String &filename, bool streamed, const CL_VirtualDirectory &directory, const CL_String &type = ""); CL_SoundBuffer( CL_IODevice &file, bool streamed, const CL_String &type); virtual ~CL_SoundBuffer(); /// \} /// \name Attributes /// \{ public: /// \brief Returns the sound provider to be used for playback. CL_SoundProvider *get_provider() const; /// \brief Returns the start/default volume used when the buffer is played. float get_volume() const; /// \brief Returns the default panning position when the buffer is played. float get_pan() const; /// \brief Returns true if this object is invalid. bool is_null() const { return !impl; } /// \brief Throw an exception if this object is invalid. void throw_if_null() const; /// \} /// \name Operations /// \{ public: /// \brief Sets the volume of the sound buffer in a relative measure (0->1) /** <p>A value of 0 will effectively mute the sound (although it will still be sampled), and a value of 1 will set the volume to "max".</p> \param new_volume New volume of sound buffer. */ void set_volume(float new_volume); /// \brief Sets the panning of the sound buffer played in measures from -1 -> 1 /** <p>Setting the pan with a value of -1 will pan the sound buffer to the extreme left (left speaker only), 1 will pan the sound buffer to the extreme right (right speaker only).</p> \param new_pan New pan of the sound buffer played.*/ void set_pan(float new_pan); /// \brief Adds the sound filter to the sound buffer. /// /// \param filter Sound filter to pass sound through. void add_filter(CL_SoundFilter &filter); /// \brief Remove the sound filter from the sound buffer. void remove_filter(CL_SoundFilter &filter); /// \brief Plays the soundbuffer on the specified soundcard. /// /// \param looping looping /// \param output Sound output to be used - NULL means use the current selected sound output (CL_Sound::get_selected_output(). /// /// \return The playback session. CL_SoundBuffer_Session play(bool looping = false, CL_SoundOutput *output = 0); /// \brief Prepares the soundbuffer for playback on the specified soundcard. /// /// \param output Sound output to be used - NULL means use the current selected sound output (CL_Sound::get_selected_output(). /// /// \return The playback session. CL_SoundBuffer_Session prepare(bool looping = false, CL_SoundOutput *output = 0); /// \} /// \name Implementation /// \{ private: CL_SharedPtr<CL_SoundBuffer_Impl> impl; /// \} }; /// \}
/* * Copyright (C) 2010 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 AudioDSPKernel_h #define AudioDSPKernel_h #include "AudioDSPKernelProcessor.h" namespace WebCore { // AudioDSPKernel does the processing for one channel of an AudioDSPKernelProcessor. class AudioDSPKernel { public: AudioDSPKernel(AudioDSPKernelProcessor* kernelProcessor) : m_kernelProcessor(kernelProcessor) , m_sampleRate(kernelProcessor->sampleRate()) { } AudioDSPKernel(float sampleRate) : m_kernelProcessor(0) , m_sampleRate(sampleRate) { } virtual ~AudioDSPKernel() { }; // Subclasses must override process() to do the processing and reset() to reset DSP state. virtual void process(const float* source, float* destination, size_t framesToProcess) = 0; virtual void reset() = 0; float sampleRate() const { return m_sampleRate; } double nyquist() const { return 0.5 * sampleRate(); } AudioDSPKernelProcessor* processor() { return m_kernelProcessor; } const AudioDSPKernelProcessor* processor() const { return m_kernelProcessor; } protected: AudioDSPKernelProcessor* m_kernelProcessor; float m_sampleRate; }; } // namespace WebCore #endif // AudioDSPKernel_h
/* -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*- ******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * THIS IS UNPUBLISHED SOURCE CODE OF create3000. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 1999, 2016 Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the Titania Project. * * Titania is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * Titania 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with Titania. If not, see <http://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ #ifndef __TITANIA_X3D_PARSER_VRML1_NODES_NAVIGATION_INFO_H__ #define __TITANIA_X3D_PARSER_VRML1_NODES_NAVIGATION_INFO_H__ #include "VRML1Node.h" namespace titania { namespace X3D { namespace VRML1 { class NavigationInfo : public VRML1Node { public: /// @name Construction NavigationInfo (X3D::X3DExecutionContext* const executionContext); /// @name Common members virtual const Component & getComponent () const final override { return component; } virtual const std::string & getTypeName () const final override { return typeName; } virtual const std::string & getContainerField () const final override { return containerField; } /// @name Fields MFString & type () { return *fields .type; } const MFString & type () const { return *fields .type; } SFFloat & speed () { return *fields .speed; } const SFFloat & speed () const { return *fields .speed; } SFFloat & collisionRadius () { return *fields .collisionRadius; } const SFFloat & collisionRadius () const { return *fields .collisionRadius; } SFBool & headlight () { return *fields .headlight; } const SFBool & headlight () const { return *fields .headlight; } /// @name Operations virtual void convert (Converter* const converter) final override; /// @name Desstruction virtual ~NavigationInfo () final override; private: /// @name Construction virtual X3D::X3DBaseNode* create (X3D::X3DExecutionContext* const) const final override; /// @name Static members static const Component component; static const std::string typeName; static const std::string containerField; /// @name Members struct Fields { Fields (); X3D::MFString* const type; X3D::SFFloat* const speed; X3D::SFFloat* const collisionRadius; X3D::SFBool* const headlight; }; Fields fields; }; } // VRML1 } // X3D } // titania #endif
/* (c) 2008 Jan Dlabal <dlabaljan@gmail.com> */ /* */ /* This file is part of FunghOS. */ /* */ /* Funghos 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 */ /* any later version. */ /* */ /* FunghOS 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 FunghOS. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TIMER_H #define TIMER_H extern unsigned int timer_ticks; extern unsigned int timer_sec; extern unsigned int timer_min; extern unsigned int timer_hrs; #endif
// Copyright 2011 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_IA32_LITHIUM_GAP_RESOLVER_IA32_H_ #define V8_IA32_LITHIUM_GAP_RESOLVER_IA32_H_ #include "v8.h" #include "lithium.h" namespace v8 { namespace internal { class LCodeGen; class LGapResolver; class LGapResolver V8_FINAL BASE_EMBEDDED { public: explicit LGapResolver(LCodeGen* owner); // Resolve a set of parallel moves, emitting assembler instructions. void Resolve(LParallelMove* parallel_move); private: // Build the initial list of moves. void BuildInitialMoveList(LParallelMove* parallel_move); // Perform the move at the moves_ index in question (possibly requiring // other moves to satisfy dependencies). void PerformMove(int index); // Emit any code necessary at the end of a gap move. void Finish(); // Add or delete a move from the move graph without emitting any code. // Used to build up the graph and remove trivial moves. void AddMove(LMoveOperands move); void RemoveMove(int index); // Report the count of uses of operand as a source in a not-yet-performed // move. Used to rebuild use counts. int CountSourceUses(LOperand* operand); // Emit a move and remove it from the move graph. void EmitMove(int index); // Execute a move by emitting a swap of two operands. The move from // source to destination is removed from the move graph. void EmitSwap(int index); // Ensure that the given operand is not spilled. void EnsureRestored(LOperand* operand); // Return a register that can be used as a temp register, spilling // something if necessary. Register EnsureTempRegister(); // Return a known free register different from the given one (which could // be no_reg---returning any free register), or no_reg if there is no such // register. Register GetFreeRegisterNot(Register reg); // Verify that the state is the initial one, ready to resolve a single // parallel move. bool HasBeenReset(); // Verify the move list before performing moves. void Verify(); LCodeGen* cgen_; // List of moves not yet resolved. ZoneList<LMoveOperands> moves_; // Source and destination use counts for the general purpose registers. int source_uses_[Register::kMaxNumAllocatableRegisters]; int destination_uses_[Register::kMaxNumAllocatableRegisters]; // If we had to spill on demand, the currently spilled register's // allocation index. int spilled_register_; }; } } // namespace v8::internal #endif // V8_IA32_LITHIUM_GAP_RESOLVER_IA32_H_
/** ****************************************************************************** * @file usb_desc.h * @author MCD Application Team * @version V4.0.0 * @date 21-January-2013 * @brief Descriptor Header for Virtual COM Port Device ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __USB_DESC_H #define __USB_DESC_H /* Includes ------------------------------------------------------------------*/ #include "platform.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported define -----------------------------------------------------------*/ #define USB_DEVICE_DESCRIPTOR_TYPE 0x01 #define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02 #define USB_STRING_DESCRIPTOR_TYPE 0x03 #define USB_INTERFACE_DESCRIPTOR_TYPE 0x04 #define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05 #define VIRTUAL_COM_PORT_DATA_SIZE 64 #define VIRTUAL_COM_PORT_INT_SIZE 8 #define VIRTUAL_COM_PORT_SIZ_DEVICE_DESC 18 #define VIRTUAL_COM_PORT_SIZ_CONFIG_DESC 67 #define STANDARD_ENDPOINT_DESC_SIZE 0x09 /* Exported functions ------------------------------------------------------- */ extern const uint8_t Virtual_Com_Port_DeviceDescriptor[VIRTUAL_COM_PORT_SIZ_DEVICE_DESC]; extern const uint8_t Virtual_Com_Port_ConfigDescriptor[VIRTUAL_COM_PORT_SIZ_CONFIG_DESC]; #define USBD_MANUFACTURER_STRING "RaceFlight" #ifndef USBD_PRODUCT_STRING #define USBD_PRODUCT_STRING "STM32 Virtual ComPort" #endif /* USBD_PRODUCT_STRING */ #ifndef USBD_SERIALNUMBER_STRING // start of STM32 flash #define USBD_SERIALNUMBER_STRING "0x8000000" #endif /* USBD_SERIALNUMBER_STRING */ #endif /* __USB_DESC_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* ide-modelines-file-settings.h * * Copyright © 2015 Christian Hergert <christian@hergert.me> * * 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 #include "files/ide-file-settings.h" G_BEGIN_DECLS #define IDE_TYPE_MODELINES_FILE_SETTINGS (ide_modelines_file_settings_get_type()) G_DECLARE_FINAL_TYPE (IdeModelinesFileSettings, ide_modelines_file_settings, IDE, MODELINES_FILE_SETTINGS, IdeFileSettings) G_END_DECLS
//*************************************************************************** // // Copyright (c) 1999 - 2006 Intel Corporation // // 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. // //*************************************************************************** /** @file IFXMemory.h This module defines a memory abstraction layer. It's used to funnel memory related services (allocation, deallocation and reallocation) through a common point that can be controlled for tracking or porting purposes. It also overloads the default C++ new, new[], delete and delete[] operators so that the memory abstraction layer is used. @todo Clarify NULL and 0 argument handling. Delete must accept NULL. Free should also, but it may not be supported everywhere it is not clear if new of array size 0 is absolutely permitted malloc(0) should be valid, but it may not be supported everywhere These issues should be clarified and implemented. */ #ifndef IFXMemory_h #define IFXMemory_h //*************************************************************************** // Includes //*************************************************************************** #include "IFXDataTypes.h" #include "IFXDebug.h" #include "IFXResult.h" //*************************************************************************** // Classes, structures and types //*************************************************************************** extern "C" { typedef void* ( IFXAllocateFunction )( size_t byteCount ); typedef void ( IFXDeallocateFunction )( void* pMemory ); typedef void* ( IFXReallocateFunction )( void* pMemory, size_t byteCount ); } //*************************************************************************** // Global function prototypes //*************************************************************************** //--------------------------------------------------------------------------- /** This function is used to allocate a block of memory. If successful, a pointer to the memory block is returned. Otherwise, enough memory isn't available and NULL is returned. */ extern "C" void* IFXAPI IFXAllocate( size_t byteCount ); //--------------------------------------------------------------------------- /** This function is used to deallocate a block of memory previously allocated with the IFXDeallocate function. */ extern "C" void IFXAPI IFXDeallocate( void* pMemory ); //--------------------------------------------------------------------------- /** This function is used to reallocate a block of memory previously allocated by the IFXAllocate function using the new byte count. If successful, a pointer to the reallocated memory block is returned. It may not be the same pointer passed to the function, however the contents of the memory block will mirror the original memory block (they will be truncated if a smaller block is requested or undefined after the original data ends if a larger block is requested). Otherwise, enough memory isn't available and NULL is returned. */ extern "C" void* IFXAPI IFXReallocate( void* pMemory, size_t byteCount ); //--------------------------------------------------------------------------- /** This function is used to get pointers to the three main memory functions. Specify NULL for any function pointer that is not desired. IFX_OK is always returned. */ extern "C" IFXRESULT IFXAPI IFXGetMemoryFunctions( IFXAllocateFunction** ppAllocateFunction, IFXDeallocateFunction** ppDeallocateFunction, IFXReallocateFunction** ppReallocateFunction ); //--------------------------------------------------------------------------- /** This function is used to replace the three main memory functions. Specify NULL for all three function pointers to restore the default functions. Upon success, IFX_OK is returned. Otherwise, IFX_E_INVALID_POINTER is returned. */ extern "C" IFXRESULT IFXAPI IFXSetMemoryFunctions( IFXAllocateFunction* pAllocateFunction, IFXDeallocateFunction* pDeallocateFunction, IFXReallocateFunction* pReallocateFunction ); #endif
/* mirror.h -- mirror module; Copyright (C) 2015, 2016, 2017 Bruno Félix Rezende Ribeiro <oitofelix@gnu.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 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MININIM_MIRROR_H #define MININIM_MIRROR_H /* dungeon cga */ #define DC_MIRROR "data/mirror/dc.png" /* palace cga */ #define PC_MIRROR "data/mirror/pc.png" /* dungeon ega */ #define DE_MIRROR "data/mirror/de.png" /* palace ega */ #define PE_MIRROR "data/mirror/pe.png" /* dungeon vga */ #define DV_MIRROR "data/mirror/dv.png" /* palace vga */ #define PV_MIRROR "data/mirror/pv.png" /* variables */ extern struct mirror *mirror; extern size_t mirror_nmemb; /* functions */ void load_mirror (void); void unload_mirror (void); void draw_mirror (ALLEGRO_BITMAP *bitmap, struct pos *p, enum em em, enum vm vm); void draw_mirror_fg (ALLEGRO_BITMAP *bitmap, struct pos *p, struct frame *f, enum em em, enum vm vm); void draw_floor_reflex (ALLEGRO_BITMAP *bitmap, struct pos *p, enum em em, enum vm vm); struct coord *floor_reflex_coord (struct pos *p, struct coord *c); struct coord *mirror_coord (struct pos *p, struct coord *c); struct coord *mirror_reflex_coord (struct pos *p, struct coord *c); #endif /* MININIM_MIRROR_H */
// // CCLatestViewController.h // CoCode // // Created by wuxueqian on 15/10/31. // Copyright (c) 2015年 wuxueqian. All rights reserved. // #import "SCPullRefreshViewController.h" @interface CCNewestViewController : SCPullRefreshViewController @end
/* * Copyright (C) 2004-2012 Free Software Foundation, Inc. * * Author: Simon Josefsson * * This file is part of GnuTLS. * * GnuTLS 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. * * GnuTLS 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 GnuTLS; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include "utils.h" #include <gnutls/openssl.h> void doit (void) { MD5_CTX c; unsigned char md[MD5_DIGEST_LENGTH]; if (gnutls_global_init () != 0) fail ("gnutls_global_init\n"); if (!gnutls_check_version (GNUTLS_VERSION)) success ("gnutls_check_version ERROR\n"); MD5_Init (&c); MD5_Update (&c, "abc", 3); MD5_Final (&(md[0]), &c); if (memcmp (md, "\x90\x01\x50\x98\x3c\xd2\x4f\xb0" "\xd6\x96\x3f\x7d\x28\xe1\x7f\x72", sizeof (md)) != 0) { hexprint (md, sizeof (md)); fail ("MD5 failure\n"); } else if (debug) success ("MD5 OK\n"); gnutls_global_deinit (); }
/************************************************************************************//** * \file Source\cop.h * \brief Bootloader watchdog module header file. * \ingroup Core * \internal *---------------------------------------------------------------------------------------- * C O P Y R I G H T *---------------------------------------------------------------------------------------- * Copyright (c) 2011 by Feaser http://www.feaser.com All rights reserved * *---------------------------------------------------------------------------------------- * L I C E N S E *---------------------------------------------------------------------------------------- * This file is part of OpenBLT. OpenBLT 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. * * OpenBLT 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 OpenBLT. * If not, see <http://www.gnu.org/licenses/>. * * A special exception to the GPL is included to allow you to distribute a combined work * that includes OpenBLT without being obliged to provide the source code for any * proprietary components. The exception text is included at the bottom of the license * file <license.html>. * * \endinternal ****************************************************************************************/ #ifndef COP_H #define COP_H /**************************************************************************************** * Function prototypes ****************************************************************************************/ void CopInit(void); void CopService(void); #endif /* COP_H */ /*********************************** end of cop.h **************************************/
/* * tclHash.h -- * * This header file declares the facilities provided by the * Tcl hash table procedures. * * Copyright 1991 Regents of the University of California * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies. The University of California * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without * express or implied warranty. * * $Header: /sprite/src/lib/tcl/RCS/tclHash.h,v 1.3 91/08/27 11:36:04 ouster Exp $ SPRITE (Berkeley) */ #ifndef _TCLHASH #define _TCLHASH #ifndef _TCL #include <tcl.h> #endif /* * Structure definition for an entry in a hash table. No-one outside * Tcl should access any of these fields directly; use the macros * defined below. */ typedef struct Tcl_HashEntry { struct Tcl_HashEntry *nextPtr; /* Pointer to next entry in this * hash bucket, or NULL for end of * chain. */ struct Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */ struct Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to * first entry in this entry's chain: * used for deleting the entry. */ ClientData clientData; /* Application stores something here * with Tcl_SetHashValue. */ union { /* Key has one of these forms: */ char *oneWordValue; /* One-word value for key. */ int words[1]; /* Multiple integer words for key. * The actual size will be as large * as necessary for this table's * keys. */ char string[4]; /* String for key. The actual size * will be as large as needed to hold * the key. */ } key; /* MUST BE LAST FIELD IN RECORD!! */ } Tcl_HashEntry; /* * Structure definition for a hash table. Must be in tcl.h so clients * can allocate space for these structures, but clients should never * access any fields in this structure. */ #define TCL_SMALL_HASH_TABLE 4 typedef struct Tcl_HashTable { Tcl_HashEntry **buckets; /* Pointer to bucket array. Each * element points to first entry in * bucket's hash chain, or NULL. */ Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; /* Bucket array used for small tables * (to avoid mallocs and frees). */ int numBuckets; /* Total number of buckets allocated * at **bucketPtr. */ int numEntries; /* Total number of entries present * in table. */ int rebuildSize; /* Enlarge table when numEntries gets * to be this large. */ int downShift; /* Shift count used in hashing * function. Designed to use high- * order bits of randomized keys. */ int mask; /* Mask value used in hashing * function. */ int keyType; /* Type of keys used in this table. * It's either TCL_STRING_KEYS, * TCL_ONE_WORD_KEYS, or an integer * giving the number of ints in a */ Tcl_HashEntry *(*findProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr, char *key)); Tcl_HashEntry *(*createProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr, char *key, int *newPtr)); } Tcl_HashTable; /* * Structure definition for information used to keep track of searches * through hash tables: */ typedef struct Tcl_HashSearch { Tcl_HashTable *tablePtr; /* Table being searched. */ int nextIndex; /* Index of next bucket to be * enumerated after present one. */ Tcl_HashEntry *nextEntryPtr; /* Next entry to be enumerated in the * the current bucket. */ } Tcl_HashSearch; /* * Acceptable key types for hash tables: */ #define TCL_STRING_KEYS 0 #define TCL_ONE_WORD_KEYS 1 /* * Macros for clients to use to access fields of hash entries: */ #define Tcl_GetHashValue(h) ((h)->clientData) #define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value)) #define Tcl_GetHashKey(tablePtr, h) \ ((char *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS) ? (h)->key.oneWordValue \ : (h)->key.string)) /* * Macros to use for clients to use to invoke find and create procedures * for hash tables: */ #define Tcl_FindHashEntry(tablePtr, key) \ (*((tablePtr)->findProc))(tablePtr, key) #define Tcl_CreateHashEntry(tablePtr, key, newPtr) \ (*((tablePtr)->createProc))(tablePtr, key, newPtr) /* * Exported procedures: */ extern void Tcl_DeleteHashEntry _ANSI_ARGS_(( Tcl_HashEntry *entryPtr)); extern void Tcl_DeleteHashTable _ANSI_ARGS_(( Tcl_HashTable *tablePtr)); extern Tcl_HashEntry * Tcl_FirstHashEntry _ANSI_ARGS_(( Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr)); extern char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable *tablePtr)); extern void Tcl_InitHashTable _ANSI_ARGS_((Tcl_HashTable *tablePtr, int keyType)); extern Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_(( Tcl_HashSearch *searchPtr)); #endif /* _TCLHASH */
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #ifndef ICLIENTNETWORKABLE_H #define ICLIENTNETWORKABLE_H #ifdef _WIN32 #pragma once #endif #include "iclientunknown.h" #include "tier1/bitbuf.h" class IClientEntity; class ClientClass; enum ShouldTransmitState_t { SHOULDTRANSMIT_START=0, // The entity is starting to be transmitted (maybe it entered the PVS). SHOULDTRANSMIT_END // Called when the entity isn't being transmitted by the server. // This signals a good time to hide the entity until next time // the server wants to transmit its state. }; // NOTE: All of these are commented out; NotifyShouldTransmit actually // has all these in them. Left it as an enum in case we want to go back though enum DataUpdateType_t { DATA_UPDATE_CREATED = 0, // indicates it was created +and+ entered the pvs // DATA_UPDATE_ENTERED_PVS, DATA_UPDATE_DATATABLE_CHANGED, // DATA_UPDATE_LEFT_PVS, // DATA_UPDATE_DESTROYED, // FIXME: Could enable this, but it's a little worrying // since it changes a bunch of existing code }; abstract_class IClientNetworkable { public: // Gets at the containing class... virtual IClientUnknown* GetIClientUnknown() = 0; // Called by the engine when the server deletes the entity. virtual void Release() = 0; // Supplied automatically by the IMPLEMENT_CLIENTCLASS macros. virtual ClientClass* GetClientClass() = 0; // This tells the entity what the server says for ShouldTransmit on this entity. // Note: This used to be EntityEnteredPVS/EntityRemainedInPVS/EntityLeftPVS. virtual void NotifyShouldTransmit( ShouldTransmitState_t state ) = 0; // // NOTE FOR ENTITY WRITERS: // // In 90% of the cases, you should hook OnPreDataChanged/OnDataChanged instead of // PreDataUpdate/PostDataUpdate. // // The DataChanged events are only called once per frame whereas Pre/PostDataUpdate // are called once per packet (and sometimes multiple times per frame). // // OnDataChanged is called during simulation where entity origins are correct and // attachments can be used. whereas PostDataUpdate is called while parsing packets // so attachments and other entity origins may not be valid yet. // virtual void OnPreDataChanged( DataUpdateType_t updateType ) = 0; virtual void OnDataChanged( DataUpdateType_t updateType ) = 0; // Called when data is being updated across the network. // Only low-level entities should need to know about these. virtual void PreDataUpdate( DataUpdateType_t updateType ) = 0; virtual void PostDataUpdate( DataUpdateType_t updateType ) = 0; // Objects become dormant on the client if they leave the PVS on the server. virtual bool IsDormant( void ) = 0; // Ent Index is the server handle used to reference this entity. // If the index is < 0, that indicates the entity is not known to the server virtual int entindex( void ) const = 0; // Server to client entity message received virtual void ReceiveMessage( int classID, bf_read &msg ) = 0; // Get the base pointer to the networked data that GetClientClass->m_pRecvTable starts at. // (This is usually just the "this" pointer). virtual void* GetDataTableBasePtr() = 0; // Tells the entity that it's about to be destroyed due to the client receiving // an uncompressed update that's caused it to destroy all entities & recreate them. virtual void SetDestroyedOnRecreateEntities( void ) = 0; virtual void OnDataUnchangedInPVS() = 0; }; #endif // ICLIENTNETWORKABLE_H
/************************************************************************** * Otter Browser: Web browser controlled by the user, not vice-versa. * Copyright (C) 2015 Michal Dutkiewicz aka Emdek <michal@emdek.pl> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ #ifndef OTTER_MENUBARWIDGET_H #define OTTER_MENUBARWIDGET_H #include <QtWidgets/QMenuBar> namespace Otter { class MainWindow; class ToolBarWidget; class MenuBarWidget : public QMenuBar { Q_OBJECT public: explicit MenuBarWidget(MainWindow *parent); protected: void changeEvent(QEvent *event); void resizeEvent(QResizeEvent *event); void contextMenuEvent(QContextMenuEvent *event); void setup(); protected slots: void toolBarModified(int identifier); void updateSize(); private: MainWindow *m_mainWindow; ToolBarWidget *m_leftToolBar; ToolBarWidget *m_rightToolBar; }; } #endif
/* * Copyright (c) 2015-2016, 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 nor the names of its contributors may be used * to endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef __BOARD_ARM_DEF_H__ #define __BOARD_ARM_DEF_H__ #include <v2m_def.h> /* * Required platform porting definitions common to all ARM * development platforms */ /* Size of cacheable stacks */ #if IMAGE_BL1 #if TRUSTED_BOARD_BOOT # define PLATFORM_STACK_SIZE 0x1000 #else # define PLATFORM_STACK_SIZE 0x440 #endif #elif IMAGE_BL2 # if TRUSTED_BOARD_BOOT # define PLATFORM_STACK_SIZE 0x1000 # else # define PLATFORM_STACK_SIZE 0x400 # endif #elif IMAGE_BL2U # define PLATFORM_STACK_SIZE 0x200 #elif IMAGE_BL31 # define PLATFORM_STACK_SIZE 0x400 #elif IMAGE_BL32 # define PLATFORM_STACK_SIZE 0x440 #endif /* * The constants below are not optimised for memory usage. Platforms that wish * to optimise these constants should set `ARM_BOARD_OPTIMISE_MEM` to 1 and * provide there own values. */ #if !ARM_BOARD_OPTIMISE_MEM /* * PLAT_ARM_MMAP_ENTRIES depends on the number of entries in the * plat_arm_mmap array defined for each BL stage. * * Provide relatively optimised values for the runtime images (BL31 and BL32). * Optimisation is less important for the other, transient boot images so a * common, maximum value is used across these images. */ #if IMAGE_BL31 || IMAGE_BL32 # define PLAT_ARM_MMAP_ENTRIES 6 # define MAX_XLAT_TABLES 4 #else # define PLAT_ARM_MMAP_ENTRIES 10 # define MAX_XLAT_TABLES 5 #endif /* * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size * plus a little space for growth. */ #define PLAT_ARM_MAX_BL1_RW_SIZE 0xA000 /* * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a * little space for growth. */ #if TRUSTED_BOARD_BOOT # define PLAT_ARM_MAX_BL2_SIZE 0x1D000 #else # define PLAT_ARM_MAX_BL2_SIZE 0xF000 #endif /* * PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a * little space for growth. */ #define PLAT_ARM_MAX_BL31_SIZE 0x1D000 #endif /* ARM_BOARD_OPTIMISE_MEM */ #define MAX_IO_DEVICES 3 #define MAX_IO_HANDLES 4 #define PLAT_ARM_TRUSTED_SRAM_SIZE 0x00040000 /* 256 KB */ #define PLAT_ARM_FIP_BASE V2M_FLASH0_BASE #define PLAT_ARM_FIP_MAX_SIZE V2M_FLASH0_SIZE #define PLAT_ARM_NVM_BASE V2M_FLASH0_BASE #define PLAT_ARM_NVM_SIZE V2M_FLASH0_SIZE #endif /* __BOARD_ARM_DEF_H__ */
/******************************************************************************* * Copyright (c) 2008-2010 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and/or associated documentation files (the * "Materials"), to deal in the Materials without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Materials, and to * permit persons to whom the Materials are 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 Materials. * * THE MATERIALS ARE 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 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. ******************************************************************************/ /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ #ifndef __OPENCL_H #define __OPENCL_H #ifdef __cplusplus extern "C" { #endif #ifdef __APPLE__ #include <OpenCL/cl.h> #include <OpenCL/cl_gl.h> //#include <OpenCL/cl_gl_ext.h> //#include <OpenCL/cl_ext.h> #else #include <CL/cl.h> #include <CL/cl_gl.h> //#include <CL/cl_gl_ext.h> //#include <CL/cl_ext.h> #endif #ifdef __cplusplus } #endif #endif /* __OPENCL_H */
/* * Vortex OpenSplice * * This software and documentation are Copyright 2006 to TO_YEAR ADLINK * Technology Limited, its affiliated companies and licensors. 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. * */ #include "cpp_malloc.h" #include "cpp_io.h" #include "if.h" #include "expr.h" extern void do_eval (void) { char c; char temp[64]; int i; if (! in_false_if()) { c = getnonspace(); if (c != '(') { err_head(); fprintf(stderr, "@eval must have ()s\n"); Push(c); return ; } os_sprintf(temp, "%d", eval_expr(0, 1)); for (i = strlen(temp) - 1;i >= 0;i--) { Push(temp[i]); } } }
/** * This file is part of a demo that shows how to use RT2D, a 2D OpenGL framework. * * - Copyright 2017 Rik Teerling <rik@onandoffables.com> * - Initial commit */ #ifndef SCENE06A_H #define SCENE06A_H #include <vector> #include <rt2d/timer.h> #include "superscene.h" struct HexField : Entity { virtual void update(float deltaTime) { // empty }; void setupHexGrid(const std::string& filename, int u, int v, size_t width, size_t height, int r) { //deleteSpritebatch(); cols = width; rows = height; radius = r; float xmult = 0.75f; float ymult = sin(60*DEG_TO_RAD); float uvwidth = 1.0f / u; float uvheight = 1.0f / v; RGBAColor color = RGBAColor(0,0,255,255); // blue for (size_t y = 0; y < rows; y++) { for (size_t x = 0; x < cols; x++) { Sprite* s = new Sprite(); s->setupCircleSprite(filename, radius/2, 6); s->uvdim = Point2(uvwidth, uvheight); s->filter(0); s->wrap(0); s->useCulling(1); s->spriteposition.x = x * radius * xmult; if (x%2==0) { s->spriteposition.y = y * radius * ymult; } else { s->spriteposition.y = y * radius * ymult + (ymult*radius/2); } s->spriteposition += Point2(radius, radius); s->color = color; color = Color::rotate(color, 1.0f/cols); int n = u*v; s->frame(rand()%n); s->uvoffset += Point2(-0.375f, -0.375f); // compensate for circle UV's _spritebatch.push_back(s); } } } size_t findnearest(Point2 pos) { size_t n = 0; float shortest = 100000.0f; size_t counter = 0; for (size_t y = 0; y < rows; y++) { for (size_t x = 0; x < cols; x++) { Vector2 p = Vector2(_spritebatch[counter]->spriteposition, pos); float d = p.getLength(); if (d < shortest) { shortest = d; n = counter; } counter++; } } return n; } size_t cols; size_t rows; int radius; }; class Scene06a: public SuperScene { public: Scene06a(); virtual ~Scene06a(); virtual void update(float deltaTime); private: HexField* hexfield; }; #endif /* SCENE06A_H */
#pragma once #include <QObject> #include <QFileInfo> class FileIconProvider : public QObject { Q_OBJECT public: FileIconProvider(QObject *parent); ~FileIconProvider(); QIcon getIcon(QFileInfo fileInfo) const; private: #ifdef Q_OS_WIN QIcon FileIconProvider::getWinIcon(const QFileInfo &fileInfo) const; #endif };
#ifndef _AMAP_H /* AMAP - Application MAPper Copyright (c) 2003-2005 van Hauser and DJ RevMoon * * 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 */ #define AMAP_PROGRAM "amap" #define AMAP_VERSION "5.4" #define AMAP_YEAR "2011" #define AMAP_AUTHOR "van Hauser" #define AMAP_EMAIL "vh@thc.org" #define AMAP_RESOURCE "www.thc.org/thc-amap" #ifndef AMAP_PREFIX #ifdef PREFIX #warning "PREFIX definition found, installing to this prefix directory location" #define AMAP_PREFIX PREFIX #else #define AMAP_PREFIX "/usr/local" #endif #endif #define AMAP_BUFSIZE 1024 // standard buffer size #define AMAP_BUFSIZE_BIG 65536 // big standard buffer size #define AMAP_REGEX_OPTIONS ( PCRE_MULTILINE | PCRE_CASELESS | PCRE_DOTALL ) /* web update feature */ #define AMAP_WEBBUFLEN 1024 #define AMAP_MAXTOKENLEN 64 /* connection and task definitions */ #define AMAP_MAX_CONNECT_RETRIES 3 // connect() retries #define AMAP_CONNECT_TIME 5 // seconds to wait for connect #define AMAP_RESPONSE_TIME 5 // seconds to wait for response #define AMAP_MAX_TASKS 256 // maximum parallel tasks #define AMAP_DEFAULT_TASKS 32 // default parallel tasks #define AMAP_MAX_ID_LENGTH 32 #define AMAP_UFO "unidentified" /* file definitions */ #define AMAP_DEFAULT_FILENAME "appdefs" // default filename #define AMAP_FILETYPE_RESPONSES ".resp" // default extension #define AMAP_FILETYPE_TRIGGERS ".trig" // default extension #define AMAP_FILETYPE_RPC ".rpc" // default extension /* scan modes */ #define AMAP_SCANMODE_DEFAULT 1 #define AMAP_SCANMODE_SSL 2 #define AMAP_SCANMODE_RPC 3 /* ip protocols */ #define AMAP_PROTO_TCP 1 #define AMAP_PROTO_UDP 2 #define AMAP_PROTO_BOTH 3 /* connect states */ #define AMAP_CONNECT_NULL 0 #define AMAP_CONNECT_INPROGRESS 1 #define AMAP_CONNECT_READY 2 #define AMAP_CONNECT_ACTIVE 3 #define AMAP_CONNECT_REUSABLE 4 #define AMAP_CONNECT_RETRY 5 /* all the important structures */ typedef struct { char *only_send_trigger; FILE *logfile; int tasks; unsigned char timeout_connect; unsigned char timeout_response; char max_connect_retries; char do_scan_ssl; char do_scan_rpc; char verbose; char quiet; char banner; char banner_only; char portscanner; char update; char machine_readable; char harmful; char one_is_enough; char dump_unidentified; char dump_all; char ipv6; /* for lib package moved here */ char *file_nmap; char *file_log; char *filename; int cmd_proto; } amap_struct_options; typedef struct { unsigned short int port; struct amap_struct_portlist *next; } amap_struct_portlist; typedef struct { char *id; amap_struct_portlist *ports; char ip_prot; char harmful; char *trigger; int trigger_length; struct amap_struct_triggers *next; } amap_struct_triggers; typedef struct { char *trigger; struct amap_struct_triggerptr *next; } amap_struct_triggerptr; typedef struct { char *id; amap_struct_triggerptr *triggerptr; char ip_prot; int min_length; int max_length; pcre *pattern; pcre_extra *hints; struct amap_struct_responses *next; } amap_struct_responses; typedef struct { char *id; struct amap_struct_identifications *next; } amap_struct_identifications; typedef struct { unsigned short int port; char ip_prot; char ssl; char rpc; char skip; int unknown_response_length; char *unknown_response; amap_struct_identifications *ids; struct amap_struct_ports *next; } amap_struct_ports; typedef struct { char *target; amap_struct_ports *ports; struct amap_struct_targets *next; } amap_struct_targets; typedef struct { int running; int tasks; char scanmode; } amap_struct_scaninfo; typedef struct { char active; char ssl_enabled; char retry; unsigned char response[AMAP_BUFSIZE + 1]; int socket; int response_length; int sockaddr_len; time_t timer; struct sockaddr *sockaddr; #ifdef OPENSSL SSL *ssl_socket; #endif amap_struct_targets *target; amap_struct_ports *port; amap_struct_triggers *trigger; } amap_struct_coms; #define _AMAP_H #endif
/* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.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. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** ** $Id$ **/ /* 2-step huffman table HCB_8 */ /* 1st step: 5 bits * 2^5 = 32 entries * * Used to find offset into 2nd step table and number of extra bits to get */ static hcb hcb8_1[] ICONST_ATTR = { /* 3 bit codeword */ { /* 00000 */ 0, 0 }, { /* */ 0, 0 }, { /* */ 0, 0 }, { /* */ 0, 0 }, /* 4 bit codewords */ { /* 00100 */ 1, 0 }, { /* */ 1, 0 }, { /* 00110 */ 2, 0 }, { /* */ 2, 0 }, { /* 01000 */ 3, 0 }, { /* */ 3, 0 }, { /* 01010 */ 4, 0 }, { /* */ 4, 0 }, { /* 01100 */ 5, 0 }, { /* */ 5, 0 }, /* 5 bit codewords */ { /* 01110 */ 6, 0 }, { /* 01111 */ 7, 0 }, { /* 10000 */ 8, 0 }, { /* 10001 */ 9, 0 }, { /* 10010 */ 10, 0 }, { /* 10011 */ 11, 0 }, { /* 10100 */ 12, 0 }, /* 6 bit codewords */ { /* 10101 */ 13, 1 }, { /* 10110 */ 15, 1 }, { /* 10111 */ 17, 1 }, { /* 11000 */ 19, 1 }, { /* 11001 */ 21, 1 }, /* 7 bit codewords */ { /* 11010 */ 23, 2 }, { /* 11011 */ 27, 2 }, { /* 11100 */ 31, 2 }, /* 7/8 bit codewords */ { /* 11101 */ 35, 3 }, /* 8 bit codewords */ { /* 11110 */ 43, 3 }, /* 8/9/10 bit codewords */ { /* 11111 */ 51, 5 } }; /* 2nd step table * * Gives size of codeword and actual data (x,y,v,w) */ static hcb_2_pair hcb8_2[] ICONST_ATTR = { /* 3 bit codeword */ { 3, 1, 1 }, /* 4 bit codewords */ { 4, 2, 1 }, { 4, 1, 0 }, { 4, 1, 2 }, { 4, 0, 1 }, { 4, 2, 2 }, /* 5 bit codewords */ { 5, 0, 0 }, { 5, 2, 0 }, { 5, 0, 2 }, { 5, 3, 1 }, { 5, 1, 3 }, { 5, 3, 2 }, { 5, 2, 3 }, /* 6 bit codewords */ { 6, 3, 3 }, { 6, 4, 1 }, { 6, 1, 4 }, { 6, 4, 2 }, { 6, 2, 4 }, { 6, 3, 0 }, { 6, 0, 3 }, { 6, 4, 3 }, { 6, 3, 4 }, { 6, 5, 2 }, /* 7 bit codewords */ { 7, 5, 1 }, { 7, 2, 5 }, { 7, 1, 5 }, { 7, 5, 3 }, { 7, 3, 5 }, { 7, 4, 4 }, { 7, 5, 4 }, { 7, 0, 4 }, { 7, 4, 5 }, { 7, 4, 0 }, { 7, 2, 6 }, { 7, 6, 2 }, /* 7/8 bit codewords */ { 7, 6, 1 }, { 7, 6, 1 }, { 7, 1, 6 }, { 7, 1, 6 }, { 8, 3, 6 }, { 8, 6, 3 }, { 8, 5, 5 }, { 8, 5, 0 }, /* 8 bit codewords */ { 8, 6, 4 }, { 8, 0, 5 }, { 8, 4, 6 }, { 8, 7, 1 }, { 8, 7, 2 }, { 8, 2, 7 }, { 8, 6, 5 }, { 8, 7, 3 }, /* 8/9/10 bit codewords */ { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 }, { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 }, { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 }, { 9, 6, 6 }, { 9, 6, 6 }, { 9, 7, 4 }, { 9, 7, 4 }, { 9, 6, 0 }, { 9, 6, 0 }, { 9, 4, 7 }, { 9, 4, 7 }, { 9, 0, 6 }, { 9, 0, 6 }, { 9, 7, 5 }, { 9, 7, 5 }, { 9, 7, 6 }, { 9, 7, 6 }, { 9, 6, 7 }, { 9, 6, 7 }, { 10, 5, 7 }, { 10, 7, 0 }, { 10, 0, 7 }, { 10, 7, 7 } };
/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** 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. ** ** BSD License Usage ** Alternatively, you may use this file under the terms of the BSD license ** as follows: ** ** "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 Qt Company Ltd 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." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef SQLCONVERSATIONMODEL_H #define SQLCONVERSATIONMODEL_H #include <QSqlTableModel> class SqlConversationModel : public QSqlTableModel { Q_OBJECT Q_PROPERTY(QString recipient READ recipient WRITE setRecipient NOTIFY recipientChanged) public: SqlConversationModel(QObject *parent = 0); QString recipient() const; void setRecipient(const QString &recipient); QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; Q_INVOKABLE void sendMessage(const QString &recipient, const QString &message); signals: void recipientChanged(); private: QString m_recipient; }; #endif // SQLCONVERSATIONMODEL_H
/* ide-modelines-file-settings.c * * Copyright © 2015 Christian Hergert <christian@hergert.me> * * 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/>. */ #define G_LOG_DOMAIN "ide-modelines-file-settings" #include <glib/gi18n.h> #include "ide-context.h" #include "buffers/ide-buffer-manager.h" #include "buffers/ide-buffer.h" #include "modelines/ide-modelines-file-settings.h" #include "modelines/modeline-parser.h" struct _IdeModelinesFileSettings { IdeFileSettings parent_instance; }; G_DEFINE_TYPE (IdeModelinesFileSettings, ide_modelines_file_settings, IDE_TYPE_FILE_SETTINGS) static void buffer_loaded_cb (IdeModelinesFileSettings *self, IdeBuffer *buffer, IdeBufferManager *buffer_manager) { IdeFile *our_file; IdeFile *buffer_file; g_assert (IDE_IS_MODELINES_FILE_SETTINGS (self)); g_assert (IDE_IS_BUFFER (buffer)); g_assert (IDE_IS_BUFFER_MANAGER (buffer_manager)); if ((buffer_file = ide_buffer_get_file (buffer)) && (our_file = ide_file_settings_get_file (IDE_FILE_SETTINGS (self))) && ide_file_equal (buffer_file, our_file)) { modeline_parser_apply_modeline (GTK_TEXT_BUFFER (buffer), IDE_FILE_SETTINGS (self)); } } static void buffer_saved_cb (IdeModelinesFileSettings *self, IdeBuffer *buffer, IdeBufferManager *buffer_manager) { IdeFile *our_file; IdeFile *buffer_file; g_assert (IDE_IS_MODELINES_FILE_SETTINGS (self)); g_assert (IDE_IS_BUFFER (buffer)); g_assert (IDE_IS_BUFFER_MANAGER (buffer_manager)); if ((buffer_file = ide_buffer_get_file (buffer)) && (our_file = ide_file_settings_get_file (IDE_FILE_SETTINGS (self))) && ide_file_equal (buffer_file, our_file)) { modeline_parser_apply_modeline (GTK_TEXT_BUFFER (buffer), IDE_FILE_SETTINGS (self)); } } static void ide_modelines_file_settings_constructed (GObject *object) { IdeModelinesFileSettings *self = (IdeModelinesFileSettings *)object; IdeBufferManager *buffer_manager; IdeContext *context; G_OBJECT_CLASS (ide_modelines_file_settings_parent_class)->constructed (object); context = ide_object_get_context (IDE_OBJECT (self)); buffer_manager = ide_context_get_buffer_manager (context); g_signal_connect_object (buffer_manager, "buffer-loaded", G_CALLBACK (buffer_loaded_cb), self, G_CONNECT_SWAPPED); g_signal_connect_object (buffer_manager, "buffer-saved", G_CALLBACK (buffer_saved_cb), self, G_CONNECT_SWAPPED); } static void ide_modelines_file_settings_class_init (IdeModelinesFileSettingsClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->constructed = ide_modelines_file_settings_constructed; } static void ide_modelines_file_settings_init (IdeModelinesFileSettings *self) { }
/* * This file is part of Cleanflight and Betaflight. * * Cleanflight and Betaflight are free software. You can redistribute * this software and/or modify this software 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. * * Cleanflight and Betaflight are distributed in the hope that they * will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software. * * If not, see <http://www.gnu.org/licenses/>. */ #pragma once #if defined(KAKUTEF4V2) #define TARGET_BOARD_IDENTIFIER "KTV2" #define USBD_PRODUCT_STRING "KakuteF4-V2" #elif defined(FLYWOOF405) #define TARGET_BOARD_IDENTIFIER "FWF4" #define USBD_PRODUCT_STRING "FLYWOOF405" #else #define TARGET_BOARD_IDENTIFIER "KTV1" #define USBD_PRODUCT_STRING "KakuteF4-V1" #endif #define USE_TARGET_CONFIG #if defined(FLYWOOF405) #define LED0_PIN PC14 #else #define LED0_PIN PB5 #define LED1_PIN PB4 #define LED2_PIN PB6 #endif #define USE_BEEPER #if defined(FLYWOOF405) //define camera control #define CAMERA_CONTROL_PIN PA9 #define BEEPER_PIN PC13 #else #define BEEPER_PIN PC9 #endif #define BEEPER_INVERTED #define INVERTER_PIN_UART3 PB15 // ICM20689 interrupt #define USE_EXTI #define USE_GYRO_EXTI #define GYRO_1_EXTI_PIN PC5 //#define DEBUG_MPU_DATA_READY_INTERRUPT #define USE_MPU_DATA_READY_SIGNAL #define ENSURE_MPU_DATA_READY_IS_LOW #define GYRO_1_CS_PIN PC4 #define GYRO_1_SPI_INSTANCE SPI1 #define ACC_1_ALIGN CW270_DEG #define GYRO_1_ALIGN CW270_DEG #define USE_ACC #define USE_ACC_SPI_ICM20689 #define USE_GYRO #define USE_GYRO_SPI_ICM20689 #if defined(FLYWOOF405) //------MPU6000 #define USE_GYRO_SPI_MPU6000 #define USE_ACC_SPI_MPU6000 #endif #if defined(KAKUTEF4V2) || defined(FLYWOOF405) // There is invertor on RXD3(PB11), so PB10/PB11 can't be used as I2C2. #define USE_I2C //No other I2C pins are fanned out, So V1 don't support I2C peripherals. #define USE_I2C_DEVICE_1 #define I2C_DEVICE (I2CDEV_1) #define I2C1_SCL PB8 // SCL pad #define I2C1_SDA PB9 // SDA pad #define BARO_I2C_INSTANCE I2C_DEVICE #define MAG_I2C_INSTANCE I2C_DEVICE #define USE_MAG #define USE_MAG_HMC5883 //External, connect to I2C1 #define USE_MAG_QMC5883 #define USE_MAG_LIS3MDL #define MAG_HMC5883_ALIGN CW180_DEG #define USE_BARO #define USE_BARO_MS5611 //External, connect to I2C1 #define USE_BARO_BMP280 //onboard #endif #define USE_MAX7456 #define MAX7456_SPI_INSTANCE SPI3 #define MAX7456_SPI_CS_PIN PB14 #define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) #define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST) #define FLASH_CS_PIN PB3 #define FLASH_SPI_INSTANCE SPI3 #define USE_FLASHFS #define USE_FLASH_M25P16 #define USE_VCP #define USB_DETECT_PIN PA8 #define USE_USB_DETECT #define USE_UART1 #define UART1_RX_PIN PA10 #if defined (FLYWOOF405) #define UART1_TX_PIN PB6 //SCL/UART1_TX/TIM4_CH1 #else #define UART1_TX_PIN PA9 #endif #define USE_UART3 #define UART3_RX_PIN PB11 #define UART3_TX_PIN PB10 #define USE_UART6 #define UART6_RX_PIN PC7 #define UART6_TX_PIN PC6 #if defined (KAKUTEF4V2) || defined(FLYWOOF405) // Uart4 and Uart5 are fanned out on v2 #define USE_UART4 // Uart4 can be used for GPS or RunCam Split #define UART4_RX_PIN PA1 #define UART4_TX_PIN PA0 #define USE_UART5 //Uart5 can be used for ESC sensor #define UART5_RX_PIN PD2 #define UART5_TX_PIN NONE #define USE_SOFTSERIAL1 //M1~M4 and LedTrip can be redefined as Softserial #define SERIAL_PORT_COUNT 7 //vcp, uart1, uart3, uart4, uart5, uart6, softSerial1 #else #define USE_SOFTSERIAL1 #define USE_SOFTSERIAL2 #define SERIAL_PORT_COUNT 6 //vcp, uart1, uart3,, uart6, softSerial1, softSerial2 #endif #define USE_ESCSERIAL #if defined(FLYWOOF405) #define ESCSERIAL_TIMER_TX_PIN PB8 #else #define ESCSERIAL_TIMER_TX_PIN PC7 // (HARDARE=0,PPM) #endif #define USE_SPI #define USE_SPI_DEVICE_1 //ICM20689 #define SPI1_NSS_PIN PC4 #define SPI1_SCK_PIN PA5 #define SPI1_MISO_PIN PA6 #define SPI1_MOSI_PIN PA7 #define USE_SPI_DEVICE_3 //dataflash #define SPI3_NSS_PIN PB3 #define SPI3_SCK_PIN PC10 #define SPI3_MISO_PIN PC11 #define SPI3_MOSI_PIN PC12 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC #define USE_ADC #define ADC1_DMA_STREAM DMA2_Stream0 #define VBAT_ADC_PIN PC3 #define CURRENT_METER_ADC_PIN PC2 #define RSSI_ADC_PIN PC1 #define DEFAULT_FEATURES ( FEATURE_TELEMETRY | FEATURE_OSD ) #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define SERIALRX_PROVIDER SERIALRX_SBUS #define SERIALRX_UART SERIAL_PORT_USART3 #define USE_SERIAL_4WAY_BLHELI_INTERFACE #define TARGET_IO_PORTA 0xffff #define TARGET_IO_PORTB 0xffff #define TARGET_IO_PORTC 0xffff #define TARGET_IO_PORTD (BIT(2)) #if defined (KAKUTEF4V2) #define USABLE_TIMER_CHANNEL_COUNT 6 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(8)) #elif defined(FLYWOOF405) #define USABLE_TIMER_CHANNEL_COUNT 11 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(4)| TIM_N(8)) #else #define USABLE_TIMER_CHANNEL_COUNT 8 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8)) #endif
/********** Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ /* */ /* loop through all the devices and * allocate parameter #s to design parameters */ #include "spice.h" #include <stdio.h> #include "util.h" #include "cktdefs.h" #include "capdefs.h" #include "trandefs.h" #include "sperror.h" #include "suffix.h" int CAPsSetup(info,inModel) register SENstruct *info; GENmodel *inModel; { register CAPmodel *model = (CAPmodel*)inModel; register CAPinstance *here; /* loop through all the capacitor models */ for( ; model != NULL; model = model->CAPnextModel ) { /* loop through all the instances of the model */ for (here = model->CAPinstances; here != NULL ; here=here->CAPnextInstance) { if(here->CAPsenParmNo){ here->CAPsenParmNo = ++(info->SENparms); } } } return(OK); }
/** * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * * Copyright (C) 2012-2022 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MAP_MAPDEFINES_H #define MAP_MAPDEFINES_H #include "common/mmo.h" // packet versions #define MAX_NPC_PER_MAP 512 #define AREA_SIZE (battle->bc->area_size) #define CHAT_AREA_SIZE (battle->bc->chat_area_size) #define DEAD_AREA_SIZE (battle->bc->dead_area_size) #define DAMAGELOG_SIZE 30 #define LOOTITEM_SIZE 10 #define MAX_MOBSKILL 50 #ifndef MAX_MOB_LIST_PER_MAP #ifdef RENEWAL #define MAX_MOB_LIST_PER_MAP 100 #else #define MAX_MOB_LIST_PER_MAP 115 #endif #endif #define MAX_EVENTQUEUE 2 #define MAX_EVENTTIMER 32 #define NATURAL_HEAL_INTERVAL 500 #define MIN_FLOORITEM 2 #define MAX_FLOORITEM START_ACCOUNT_NUM #define MAX_IGNORE_LIST 20 // official is 14 #define MAX_VENDING 12 #define MAX_MAP_SIZE (512*512) // Wasn't there something like this already? Can't find it.. [Shinryo] #define BLOCK_SIZE 8 #define block_free_max 1048576 #define BL_LIST_MAX 1048576 // The following system marks a different job ID system used by the map server, // which makes a lot more sense than the normal one. [Skotlex] // These marks the "level" of the job. #define JOBL_2_1 0x0100 #define JOBL_2_2 0x0200 #define JOBL_2 0x0300 // JOBL_2_1 | JOBL_2_2 #define JOBL_UPPER 0x1000 #define JOBL_BABY 0x2000 #define JOBL_THIRD 0x4000 // For filtering and quick checking. #define MAPID_BASEMASK 0x00ff #define MAPID_UPPERMASK 0x0fff #define MAPID_THIRDMASK (JOBL_THIRD|MAPID_UPPERMASK) // Max size for inputs to Vending text prompts #define MESSAGE_SIZE (79 + 1) // Max size for inputs to Graffiti, Talkie Box text prompts #if PACKETVER_MAIN_NUM >= 20190904 || PACKETVER_RE_NUM >= 20190904 || PACKETVER_ZERO_NUM >= 20190828 #define TALKBOX_MESSAGE_SIZE 21 #else #define TALKBOX_MESSAGE_SIZE (79 + 1) #endif // String length you can write in the 'talking box' #define CHATBOX_SIZE (70 + 1) // Chatroom-related string sizes #define CHATROOM_TITLE_SIZE (36 + 1) #define CHATROOM_PASS_SIZE (8 + 1) // Max allowed chat text length #define CHAT_SIZE_MAX (255 + 1) // 24 for npc name + 24 for label + 2 for a "::" and 1 for EOS #define EVENT_NAME_LENGTH ( NAME_LENGTH * 2 + 3 ) #define DEFAULT_AUTOSAVE_INTERVAL (5*60*1000) // Specifies maps where players may hit each other #define map_flag_vs(m) ( \ map->list[m].flag.pvp \ || map->list[m].flag.gvg_dungeon \ || map->list[m].flag.gvg \ || ((map->agit_flag || map->agit2_flag) && map->list[m].flag.gvg_castle) \ || map->list[m].flag.battleground \ || map->list[m].flag.cvc \ ) // Specifies maps that have special GvG/WoE restrictions #define map_flag_gvg(m) (map->list[m].flag.gvg || ((map->agit_flag || map->agit2_flag) && map->list[m].flag.gvg_castle)) // Specifies if the map is tagged as GvG/WoE (regardless of map->agit_flag status) #define map_flag_gvg2(m) (map->list[m].flag.gvg || map->list[m].flag.gvg_castle) // No Kill Steal Protection #define map_flag_ks(m) (map->list[m].flag.town || map->list[m].flag.pvp || map->list[m].flag.gvg || map->list[m].flag.battleground) // No ViewID #define map_no_view(m, view) (map->list[m].flag.noviewid & (view)) // For common mapforeach calls. Since pets cannot be affected, they aren't included here yet. #define BL_CHAR (BL_PC|BL_MOB|BL_HOM|BL_MER|BL_ELEM) #define MAP_ZONE_NAME_LENGTH 60 #define MAP_ZONE_ALL_NAME "All" #define MAP_ZONE_NORMAL_NAME "Normal" #define MAP_ZONE_PVP_NAME "PvP" #define MAP_ZONE_GVG_NAME "GvG" #define MAP_ZONE_BG_NAME "Battlegrounds" #define MAP_ZONE_CVC_NAME "CvC" #define MAP_ZONE_PK_NAME "PK Mode" #define MAP_ZONE_MAPFLAG_LENGTH 65 #endif /* MAP_MAPDEFINES_H */
/* * This file is part of LibCSS. * Licensed under the MIT License, * http://www.opensource.org/licenses/mit-license.php * Copyright 2008 John-Mark Bell <jmb@netsurf-browser.org> */ #ifndef libcss_fpmath_h_ #define libcss_fpmath_h_ #ifndef WIN32 #include <stdbool.h> #include <stdint.h> #else typedef char int8_t; typedef short int16_t; typedef int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __cplusplus typedef int bool; #define false (bool)0 #define true (bool)1 #endif #endif /* 22:10 fixed point math */ typedef int32_t css_fixed; /* Add two fixed point values */ #define FADD(a, b) ((a) + (b)) /* Subtract two fixed point values */ #define FSUB(a, b) ((a) - (b)) /* Multiply two fixed point values */ #define FMUL(a, b) ((((int64_t) (a)) * ((int64_t) (b))) >> 10) /* Divide two fixed point values */ #define FDIV(a, b) ((((int64_t) (a)) << 10) / (b)) /* Add an integer to a fixed point value */ #define FADDI(a, b) ((a) + ((b) << 10)) /* Subtract an integer from a fixed point value */ #define FSUBI(a, b) ((a) - ((b) << 10)) /* Multiply a fixed point value by an integer */ #define FMULI(a, b) ((a) * (b)) /* Divide a fixed point value by an integer */ #define FDIVI(a, b) ((a) / (b)) /* Convert a floating point value to fixed point */ #define FLTTOFIX(a) ((css_fixed) ((a) * (float) (1 << 10))) /* Convert a fixed point value to floating point */ #define FIXTOFLT(a) ((float) (a) / (float) (1 << 10)) /* Convert an integer to a fixed point value */ #define INTTOFIX(a) ((a) << 10) /* Convert a fixed point value to an integer */ #define FIXTOINT(a) ((a) >> 10) /* Useful values */ #define F_PI_2 0x00000648 /* 1.5708 (PI/2) */ #define F_PI 0x00000c91 /* 3.1415 (PI) */ #define F_3PI_2 0x000012d9 /* 4.7124 (3PI/2) */ #define F_2PI 0x00001922 /* 6.2831 (2 PI) */ #define F_90 0x00016800 /* 90 */ #define F_180 0x0002d000 /* 180 */ #define F_270 0x00043800 /* 270 */ #define F_360 0x0005a000 /* 360 */ #define F_100 0x00019000 /* 100 */ #define F_200 0x00032000 /* 200 */ #define F_300 0x0004b000 /* 300 */ #define F_400 0x00064000 /* 400 */ #endif
// ======================================================================== // // Copyright 2009-2014 Intel Corporation // // // // Licensed under the Apache License, Version 2.0 (the "License"); // // you may not use this file except in compliance with the License. // // You may obtain a copy of the License at // // // // http://www.apache.org/licenses/LICENSE-2.0 // // // // Unless required by applicable law or agreed to in writing, software // // distributed under the License is distributed on an "AS IS" BASIS, // // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // // limitations under the License. // // ======================================================================== // #pragma once #include "common/scene_user_geometry.h" #include "common/ray4.h" namespace embree { namespace isa { struct FastInstanceIntersector4 { static void intersect(sseb* valid, const Instance* instance, Ray4& ray, size_t item); static void occluded (sseb* valid, const Instance* instance, Ray4& ray, size_t item); }; } }
/* * Copyright (C) 1994-2016 Altair Engineering, Inc. * For more information, contact Altair at www.altair.com. * * This file is part of the PBS Professional ("PBS Pro") software. * * Open Source License Information: * * PBS Pro is free software. You can redistribute it and/or modify it under the * terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. * * Commercial License Information: * * The PBS Pro software is licensed under the terms of the GNU Affero General * Public License agreement ("AGPL"), except where a separate commercial license * agreement for PBS Pro version 14 or later has been executed in writing with Altair. * * Altair’s dual-license business model allows companies, individuals, and * organizations to create proprietary derivative works of PBS Pro and distribute * them - whether embedded or bundled with other software - under a commercial * license agreement. * * Use of Altair’s trademarks, including but not limited to "PBS™", * "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's * trademark licensing policies. * */ /** * @file disrui.c * * @par Synopsis: * unsigned disrui(int stream, int *value) * * Gets a Data-is-Strings unsigned integer from <stream>, converts it into * an unsigned int, and returns it. * * This format for character strings representing unsigned integers can * best be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next character; if it is a plus sign, go to step (4); if it * is a minus sign, post an error. * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * *<retval> gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the <stream> character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include <pbs_config.h> /* the master config generated by configure */ #include <assert.h> #include <stddef.h> #include "dis.h" #include "dis_.h" #undef disrui /** * @brief * Gets a Data-is-Strings signed integer from <stream>, converts it * into an unsigned int, and returns it * * @param[in] stream - pointer to data stream * @param[out] retval - return value * * @return short * @retval converted value success * @retval 0 error * */ unsigned disrui(int stream, int *retval) { int locret; int negate; unsigned value; assert(disr_commit != NULL); locret = disrsi_(stream, &negate, &value, 1, 0); if (locret != DIS_SUCCESS) { value = 0; } else if (negate) { value = 0; locret = DIS_BADSIGN; } *retval = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; return (value); }
#ifndef __OpenViBE_AcquisitionServer_CDriverTMSiRefa32B_H__ #define __OpenViBE_AcquisitionServer_CDriverTMSiRefa32B_H__ #include "../ovasIDriver.h" #include "../ovasCHeader.h" #include "../ovas_base.h" #if defined OVAS_OS_Windows #include "ovasCConfigurationTMSIRefa32B.h" #define RTLOADER "RTINST.Dll" #include <gtk/gtk.h> // Get Signal info #define SIGNAL_NAME 40 #define MAX_BUFFER_SIZE 0xFFFFFFFF namespace OpenViBEAcquisitionServer { class CDriverTMSiRefa32B : virtual public OpenViBEAcquisitionServer::IDriver { public: CDriverTMSiRefa32B(OpenViBEAcquisitionServer::IDriverContext& rDriverContext); ~CDriverTMSiRefa32B(void); virtual void release(void); virtual const char* getName(void); virtual OpenViBE::boolean isFlagSet( const OpenViBEAcquisitionServer::EDriverFlag eFlag) const { return eFlag==DriverFlag_IsUnstable; } virtual OpenViBE::boolean initialize( const OpenViBE::uint32 ui32SampleCountPerSentBlock, OpenViBEAcquisitionServer::IDriverCallback& rCallback); virtual OpenViBE::boolean uninitialize(void); virtual OpenViBE::boolean start(void); virtual OpenViBE::boolean stop(void); virtual OpenViBE::boolean loop(void); virtual OpenViBE::boolean isConfigurable(void); virtual OpenViBE::boolean configure(void); virtual const OpenViBEAcquisitionServer::IHeader* getHeader(void) { return &m_oHeader; } virtual OpenViBE::boolean CDriverTMSiRefa32B::measureMode(OpenViBE::uint32 mode,OpenViBE::uint32 info ); protected: OpenViBEAcquisitionServer::IDriverCallback* m_pCallback; OpenViBEAcquisitionServer::CHeader m_oHeader; OpenViBE::uint32 m_ui32SampleCountPerSentBlock; OpenViBE::float32 *m_pSample; OpenViBE::boolean m_bValid; OpenViBE::uint32 m_ui32SampleIndex; OpenViBE::uint32 m_ui32TotalSampleReceived; OpenViBE::CStimulationSet m_oStimulationSet; OpenViBE::boolean refreshDevicePath(void); OpenViBE::boolean m_bCheckImpedance; OpenViBE::int32 m_i32NumOfTriggerChannel; OpenViBE::uint32 m_ui32LastTriggerValue; //----------- TYPE --------------------- //constants used by set chantype #define EXG (ULONG) 0x0001 #define AUX (ULONG) 0x0002 #define DEVICE_FEATURE_TYPE 0x0303 //------------ MODE --------------------- #define DEVICE_FEATURE_MODE 0x0302 //--------------- RTC ---------------------- #define DEVICE_FEATURE_RTC 0x0301 //---------- HIGHPASS ------------------ #define DEVICE_FEATURE_HIGHPASS 0x0401 //------------- LOWPASS ---------------- #define DEVICE_FEATURE_LOWPASS 0x0402 //--------------- GAIN ------------------ #define DEVICE_FEATURE_GAIN 0x0403 //--------------- OFFSET ------------------- #define DEVICE_FEATURE_OFFSET 0x0404 //------------------ IO ---------------------- #define DEVICE_FEATURE_IO 0x0500 //----------------- MEMORY ---------------------- #define DEVICE_FEATURE_MEMORY 0x0501 //------------------- STORAGE --------------------- #define DEVICE_FEATURE_STORAGE 0x0502 //------------------ CORRECTION -------------------- #define DEVICE_FEATURE_CORRECTION 0x0503 //--------------------- ID --------------------------- #define DEVICE_FEATURE_ID 0x0504 #define MEASURE_MODE_NORMAL ((ULONG)0x0) #define MEASURE_MODE_IMPEDANCE ((ULONG)0x1) #define MEASURE_MODE_CALIBRATION ((ULONG)0x2) #define MEASURE_MODE_IMPEDANCE_EX ((ULONG)0x3) #define MEASURE_MODE_CALIBRATION_EX ((ULONG)0x4) //for MEASURE_MODE_IMPEDANCE #define IC_OHM_002 0 // 2K Impedance limit #define IC_OHM_005 1 // 5K Impedance limit #define IC_OHM_010 2 // 10K Impedance limit #define IC_OHM_020 3 // 20K Impedance limit #define IC_OHM_050 4 // 50K Impedance limit #define IC_OHM_100 5 // 100K Impedance limit //for MEASURE_MODE_CALIBRATION #define IC_VOLT_050 0 //50 uV t-t Calibration voltage #define IC_VOLT_100 1 //100 uV t-t #define IC_VOLT_200 2 //200 uV t-t #define IC_VOLT_500 3 //500 uV t-t }; }; #endif // OVAS_OS_Windows #endif // __OpenViBE_AcquisitionServer_CDriverTMSiRefa32B_H__
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtTest module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QTESTXUNITSTREAMER_H #define QTESTXUNITSTREAMER_H #include <QtTest/qtestbasicstreamer.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Test) class QTestLogger; class QTestXunitStreamer: public QTestBasicStreamer { public: QTestXunitStreamer(); ~QTestXunitStreamer(); void formatStart(const QTestElement *element, QTestCharBuffer *formatted) const; void formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const; void formatAfterAttributes(const QTestElement *element, QTestCharBuffer *formatted) const; void formatAttributes(const QTestElement *element, const QTestElementAttribute *attribute, QTestCharBuffer *formatted) const; void output(QTestElement *element) const; void outputElements(QTestElement *element, bool isChildElement = false) const; private: void displayXunitXmlHeader() const; static void indentForElement(const QTestElement* element, char* buf, int size); }; QT_END_NAMESPACE QT_END_HEADER #endif
/** * SFCGAL * * Copyright (C) 2012-2013 Oslandia <infos@oslandia.com> * Copyright (C) 2012-2013 IGN (http://www.ign.fr) * * 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; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SFCGAL_ALGORITHM_NORMAL_H_ #define _SFCGAL_ALGORITHM_NORMAL_H_ #include <SFCGAL/config.h> #include <SFCGAL/Polygon.h> namespace SFCGAL { namespace algorithm { /** * Returns the 3D normal to 3 consecutive points. */ template < typename Kernel > CGAL::Vector_3< Kernel > normal3D( const CGAL::Point_3< Kernel >& a, const CGAL::Point_3< Kernel >& b, const CGAL::Point_3< Kernel >& c ) { // bc ^ ba return CGAL::cross_product( c - b, a - b ) ; } /** * Returns the 3D normal to a ring (supposed to be planar and closed). * @warning exact allows to avoid double rounding at the end of the computation */ template < typename Kernel > CGAL::Vector_3< Kernel > normal3D( const LineString& ls, bool exact = true ) { // Newell's formula typename Kernel::FT nx, ny, nz; nx = ny = nz = 0.0; for ( size_t i = 0; i < ls.numPoints(); ++i ) { const Point& pi = ls.pointN( i ); const Point& pj = ls.pointN( ( i+1 ) % ls.numPoints() ); typename Kernel::FT zi = pi.z() ; typename Kernel::FT zj = pj.z() ; nx += ( pi.y() - pj.y() ) * ( zi + zj ); ny += ( zi - zj ) * ( pi.x() + pj.x() ); nz += ( pi.x() - pj.x() ) * ( pi.y() + pj.y() ); } if ( exact ) { return CGAL::Vector_3<Kernel>( nx, ny, nz ); } else { return CGAL::Vector_3<Kernel>( CGAL::to_double( nx ), CGAL::to_double( ny ), CGAL::to_double( nz ) ); } } /** * Returns the 3D normal to a polygon (supposed to be planar). * @warning exact allows to avoid double rounding at the end of the computation */ template < typename Kernel > CGAL::Vector_3< Kernel > normal3D( const Polygon& polygon, bool exact = true ) { return normal3D< Kernel >( polygon.exteriorRing(), exact ); } }//algorithm }//SFCGAL #endif
// The libMesh Finite Element Library. // Copyright (C) 2002-2020 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner // 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef LIBMESH_LIBMESH_BASE_H #define LIBMESH_LIBMESH_BASE_H #include "libmesh/id_types.h" namespace libMesh { /** * \returns The number of processors libMesh was initialized with. */ processor_id_type global_n_processors(); /** * \returns The index of the local processor with respect to the * original MPI pool libMesh was initialized with. */ processor_id_type global_processor_id(); /** * \returns The maximum number of threads used in the simulation. */ unsigned int n_threads(); /** * Namespaces don't provide private data, * so let's take the data we would like * private and put it in an obnoxious * namespace. At least that way it is a * pain to use, thus discouraging errors. */ namespace libMeshPrivateData { #ifdef LIBMESH_HAVE_MPI /** * Total number of processors used. */ extern processor_id_type _n_processors; /** * The local processor id. */ extern processor_id_type _processor_id; #endif /** * Total number of threads possible. */ extern int _n_threads; } } // ------------------------------------------------------------ // libMesh inline member functions inline libMesh::processor_id_type libMesh::global_n_processors() { #ifdef LIBMESH_HAVE_MPI return libMeshPrivateData::_n_processors; #else return 1; #endif } inline libMesh::processor_id_type libMesh::global_processor_id() { #ifdef LIBMESH_HAVE_MPI return libMeshPrivateData::_processor_id; #else return 0; #endif } inline unsigned int libMesh::n_threads() { return static_cast<unsigned int>(libMeshPrivateData::_n_threads); } // We now put everything we can into a separate libMesh namespace; // code which forward declares libMesh classes or which specializes // libMesh templates may want to know whether it is compiling under // such conditions, to be backward compatible with older libMesh // versions: #define LIBMESH_USE_SEPARATE_NAMESPACE 1 // Unless configured otherwise, we import all of namespace libMesh, // for backwards compatibility with pre-namespaced codes. #ifndef LIBMESH_REQUIRE_SEPARATE_NAMESPACE using namespace libMesh; #endif #endif // LIBMESH_LIBMESH_BASE_H
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** No Commercial Usage ** ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** 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, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** **************************************************************************/ #ifndef COMPLETIONWIDGET_H #define COMPLETIONWIDGET_H #include <QtGui/QListView> #include <QtCore/QPointer> #include <QtCore/QTimer> namespace TextEditor { class CompletionItem; class ITextEditor; class CompletionSupport; namespace Internal { class AutoCompletionModel; class CompletionListView; class CompletionInfoFrame; /* The completion widget is responsible for showing a list of possible completions. It is only used by the CompletionSupport. */ class CompletionWidget : public QFrame { Q_OBJECT public: CompletionWidget(CompletionSupport *support, ITextEditor *editor); ~CompletionWidget(); void setCompletionItems(const QList<TextEditor::CompletionItem> &completionitems); void showCompletions(int startPos); QChar typedChar() const; CompletionItem currentCompletionItem() const; void setCurrentIndex(int index); bool explicitlySelected() const; signals: void itemSelected(const TextEditor::CompletionItem &item); void completionListClosed(); public slots: void closeList(const QModelIndex &index = QModelIndex()); private: void updatePositionAndSize(int startPos); private: CompletionSupport *m_support; ITextEditor *m_editor; CompletionListView *m_completionListView; }; class CompletionListView : public QListView { Q_OBJECT public: ~CompletionListView(); CompletionItem currentCompletionItem() const; bool explicitlySelected() const; signals: void itemSelected(const TextEditor::CompletionItem &item); void completionListClosed(); protected: bool event(QEvent *e); void currentChanged(const QModelIndex &current, const QModelIndex &previous); private: friend class CompletionWidget; CompletionListView(CompletionSupport *support, ITextEditor *editor, CompletionWidget *completionWidget); void setCompletionItems(const QList<TextEditor::CompletionItem> &completionitems); void keyboardSearch(const QString &search); void closeList(const QModelIndex &index); private slots: void maybeShowInfoTip(); private: bool m_blockFocusOut; ITextEditor *m_editor; QWidget *m_editorWidget; CompletionWidget *m_completionWidget; AutoCompletionModel *m_model; CompletionSupport *m_support; QPointer<CompletionInfoFrame> m_infoFrame; QTimer m_infoTimer; QChar m_typedChar; bool m_explicitlySelected; }; } // namespace Internal } // namespace TextEditor #endif // COMPLETIONWIDGET_H
/* * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. * * 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 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 * */ #ifndef BooleanPrototype_h #define BooleanPrototype_h #include "BooleanObject.h" namespace JSC { class BooleanPrototype : public BooleanObject { public: typedef BooleanObject Base; static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) { BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure); prototype->finishCreation(exec, globalObject); return prototype; } static const ClassInfo s_info; static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) { return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); } protected: void finishCreation(ExecState*, JSGlobalObject*); static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags; private: BooleanPrototype(ExecState*, Structure*); static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); }; } // namespace JSC #endif // BooleanPrototype_h
/* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <stdio.h> #include "internal/cryptlib.h" #include <openssl/x509.h> #include <openssl/objects.h> #include <openssl/evp.h> #include <openssl/ui.h> #ifndef BUFSIZ # define BUFSIZ 256 #endif /* should be init to zeros. */ static char prompt_string[80]; void EVP_set_pw_prompt(const char *prompt) { if (prompt == NULL) prompt_string[0] = '\0'; else { strncpy(prompt_string, prompt, 79); prompt_string[79] = '\0'; } } char *EVP_get_pw_prompt(void) { if (prompt_string[0] == '\0') return NULL; else return prompt_string; } /* * For historical reasons, the standard function for reading passwords is in * the DES library -- if someone ever wants to disable DES, this function * will fail */ int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) { return EVP_read_pw_string_min(buf, 0, len, prompt, verify); } int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, int verify) { int ret = -1; char buff[BUFSIZ]; UI *ui; if ((prompt == NULL) && (prompt_string[0] != '\0')) prompt = prompt_string; ui = UI_new(); if (ui == NULL) return ret; if (UI_add_input_string(ui, prompt, 0, buf, min, (len >= BUFSIZ) ? BUFSIZ - 1 : len) < 0 || (verify && UI_add_verify_string(ui, prompt, 0, buff, min, (len >= BUFSIZ) ? BUFSIZ - 1 : len, buf) < 0)) goto end; ret = UI_process(ui); OPENSSL_cleanse(buff, BUFSIZ); end: UI_free(ui); return ret; } int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, const unsigned char *salt, const unsigned char *data, int datal, int count, unsigned char *key, unsigned char *iv) { EVP_MD_CTX *c; unsigned char md_buf[EVP_MAX_MD_SIZE]; int niv, nkey, addmd = 0; unsigned int mds = 0, i; int rv = 0; nkey = EVP_CIPHER_key_length(type); niv = EVP_CIPHER_iv_length(type); OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH); OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH); if (data == NULL) return nkey; c = EVP_MD_CTX_new(); if (c == NULL) goto err; for (;;) { if (!EVP_DigestInit_ex(c, md, NULL)) goto err; if (addmd++) if (!EVP_DigestUpdate(c, &(md_buf[0]), mds)) goto err; if (!EVP_DigestUpdate(c, data, datal)) goto err; if (salt != NULL) if (!EVP_DigestUpdate(c, salt, PKCS5_SALT_LEN)) goto err; if (!EVP_DigestFinal_ex(c, &(md_buf[0]), &mds)) goto err; for (i = 1; i < (unsigned int)count; i++) { if (!EVP_DigestInit_ex(c, md, NULL)) goto err; if (!EVP_DigestUpdate(c, &(md_buf[0]), mds)) goto err; if (!EVP_DigestFinal_ex(c, &(md_buf[0]), &mds)) goto err; } i = 0; if (nkey) { for (;;) { if (nkey == 0) break; if (i == mds) break; if (key != NULL) *(key++) = md_buf[i]; nkey--; i++; } } if (niv && (i != mds)) { for (;;) { if (niv == 0) break; if (i == mds) break; if (iv != NULL) *(iv++) = md_buf[i]; niv--; i++; } } if ((nkey == 0) && (niv == 0)) break; } rv = EVP_CIPHER_key_length(type); err: EVP_MD_CTX_free(c); OPENSSL_cleanse(md_buf, sizeof(md_buf)); return rv; }
/* * Siren Depayloader Gst Element * * @author: Youness Alaoui <kakaroto@kakaroto.homelinux.net> * * 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; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <string.h> #include <stdlib.h> #include <gst/rtp/gstrtpbuffer.h> #include "gstrtpsirendepay.h" static GstStaticPadTemplate gst_rtp_siren_depay_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("application/x-rtp, " "media = (string) \"audio\", " "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", " "clock-rate = (int) 16000, " "encoding-name = (string) \"SIREN\", " "dct-length = (int) 320") ); static GstStaticPadTemplate gst_rtp_siren_depay_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-siren, " "dct-length = (int) 320") ); static GstBuffer *gst_rtp_siren_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf); static gboolean gst_rtp_siren_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps); G_DEFINE_TYPE (GstRTPSirenDepay, gst_rtp_siren_depay, GST_TYPE_RTP_BASE_DEPAYLOAD); static void gst_rtp_siren_depay_class_init (GstRTPSirenDepayClass * klass) { GstElementClass *gstelement_class; GstRTPBaseDepayloadClass *gstrtpbasedepayload_class; gstelement_class = (GstElementClass *) klass; gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass; gstrtpbasedepayload_class->process = gst_rtp_siren_depay_process; gstrtpbasedepayload_class->set_caps = gst_rtp_siren_depay_setcaps; gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_rtp_siren_depay_src_template)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_rtp_siren_depay_sink_template)); gst_element_class_set_static_metadata (gstelement_class, "RTP Siren packet depayloader", "Codec/Depayloader/Network/RTP", "Extracts Siren audio from RTP packets", "Philippe Kalaf <philippe.kalaf@collabora.co.uk>"); } static void gst_rtp_siren_depay_init (GstRTPSirenDepay * rtpsirendepay) { } static gboolean gst_rtp_siren_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) { GstCaps *srccaps; gboolean ret; srccaps = gst_caps_new_simple ("audio/x-siren", "dct-length", G_TYPE_INT, 320, NULL); ret = gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (depayload), srccaps); GST_DEBUG ("set caps on source: %" GST_PTR_FORMAT " (ret=%d)", srccaps, ret); gst_caps_unref (srccaps); /* always fixed clock rate of 16000 */ depayload->clock_rate = 16000; return ret; } static GstBuffer * gst_rtp_siren_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) { GstBuffer *outbuf; GstRTPBuffer rtp = { NULL }; gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp); outbuf = gst_rtp_buffer_get_payload_buffer (&rtp); gst_rtp_buffer_unmap (&rtp); return outbuf; } gboolean gst_rtp_siren_depay_plugin_init (GstPlugin * plugin) { return gst_element_register (plugin, "rtpsirendepay", GST_RANK_SECONDARY, GST_TYPE_RTP_SIREN_DEPAY); }
/* * common.h * * Created on: 05.10.2011 * Author: Oliver */ #ifndef COMMON_H_ #define COMMON_H_ #include <string.h> #include <stdint.h> #define BITSET(var,pos) ((var) & (1<<(pos))) #define HTONS(a) ((((uint16_t) (a) >> 8) & 0xff) | ((((uint16_t) (a)) & 0xff) << 8)) #define HTONL(a) ((((uint32_t) (a) & 0xff000000) >> 24) | \ (((uint32_t) (a) & 0x00ff0000) >> 8) | \ (((uint32_t) (a) & 0x0000ff00) << 8) | \ (((uint32_t) (a) & 0x000000ff) << 24)) #define NTOHS HTONS #define NTOHL HTONL #define CMP_IPV6_ADDR(a, b) (memcmp(a, b, 16)) uint16_t csum(uint16_t sum, uint8_t *buf, uint16_t len); void printArrayRange(uint8_t *array, uint16_t len, char *str); #endif /* COMMON_H_ */
/* * (C) Copyright 2014 Kurento (http://kurento.org/) * * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 2.1 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-2.1.html * * 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. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <gst/check/gstcheck.h> #include <gst/gst.h> #define KMS_ELEMENT_PAD_TYPE_VIDEO 2 GstElement *pipeline; GMainLoop *loop; GstElement *hubport1, *hubport2, *hubport3; static gboolean quit_main_loop_idle (gpointer data) { GMainLoop *loop = data; g_main_loop_quit (loop); return FALSE; } static void handoff_cb (GstElement * object, GstBuffer * arg0, GstPad * arg1, gpointer user_data) { g_idle_add (quit_main_loop_idle, user_data); } static void srcpad_added (GstElement * hubport, GstPad * new_pad, gpointer user_data) { gchar *padname, *expected_name; GstPad *sinkpad; GstElement *fakesink; GstElement *videosrc; GST_INFO_OBJECT (hubport, "Pad added %" GST_PTR_FORMAT, new_pad); padname = gst_pad_get_name (new_pad); fail_if (padname == NULL); if (g_strcmp0 (padname, "sink_video") == 0) { videosrc = gst_element_factory_make ("videotestsrc", NULL); sinkpad = gst_element_get_static_pad (videosrc, "src"); gst_bin_add (GST_BIN (pipeline), videosrc); fail_if (gst_pad_link (sinkpad, new_pad) != GST_PAD_LINK_OK); gst_element_sync_state_with_parent (videosrc); g_object_unref (sinkpad); goto end; } expected_name = *(gchar **) user_data; if (g_strcmp0 (padname, expected_name) != 0) { goto end; } fakesink = gst_element_factory_make ("fakesink", NULL); g_object_set (G_OBJECT (fakesink), "async", FALSE, "sync", FALSE, "signal-handoffs", TRUE, NULL); g_signal_connect (fakesink, "handoff", G_CALLBACK (handoff_cb), loop); gst_bin_add (GST_BIN (pipeline), fakesink); sinkpad = gst_element_get_static_pad (fakesink, "sink"); fail_if (gst_pad_link (new_pad, sinkpad) != GST_PAD_LINK_OK); gst_element_sync_state_with_parent (fakesink); g_object_unref (sinkpad); end: g_free (padname); } GST_START_TEST (connection) { gint handlerId1, handlerId2, handlerId3; gint signalId1, signalId2, signalId3; gchar *padname1, *padname2, *padname3; GstElement *mixer = gst_element_factory_make ("dispatcher", NULL); gboolean connected; hubport1 = gst_element_factory_make ("hubport", NULL); hubport2 = gst_element_factory_make ("hubport", NULL); hubport3 = gst_element_factory_make ("hubport", NULL); loop = g_main_loop_new (NULL, FALSE); pipeline = gst_pipeline_new ("pipeline"); gst_bin_add_many (GST_BIN (pipeline), hubport1, hubport2, hubport3, mixer, NULL); signalId1 = g_signal_connect (hubport1, "pad-added", G_CALLBACK (srcpad_added), &padname1); signalId2 = g_signal_connect (hubport2, "pad-added", G_CALLBACK (srcpad_added), &padname2); signalId3 = g_signal_connect (hubport3, "pad-added", G_CALLBACK (srcpad_added), &padname3); g_signal_emit_by_name (hubport1, "request-new-srcpad", KMS_ELEMENT_PAD_TYPE_VIDEO, NULL, &padname1); fail_if (padname1 == NULL); g_signal_emit_by_name (hubport2, "request-new-srcpad", KMS_ELEMENT_PAD_TYPE_VIDEO, NULL, &padname2); fail_if (padname2 == NULL); g_signal_emit_by_name (hubport3, "request-new-srcpad", KMS_ELEMENT_PAD_TYPE_VIDEO, NULL, &padname3); fail_if (padname3 == NULL); gst_element_set_state (pipeline, GST_STATE_PLAYING); g_signal_emit_by_name (mixer, "handle-port", hubport1, &handlerId1); g_signal_emit_by_name (mixer, "handle-port", hubport2, &handlerId2); g_signal_emit_by_name (mixer, "handle-port", hubport3, &handlerId3); g_signal_emit_by_name (G_OBJECT (mixer), "connect", handlerId1, handlerId2, &connected); fail_if (connected == FALSE); g_signal_emit_by_name (G_OBJECT (mixer), "connect", handlerId3, handlerId1, &connected); fail_if (connected == FALSE); g_signal_emit_by_name (G_OBJECT (mixer), "connect", handlerId3, handlerId3, &connected); fail_if (connected == FALSE); g_main_loop_run (loop); g_signal_emit_by_name (mixer, "unhandle-port", handlerId1); g_signal_emit_by_name (mixer, "unhandle-port", handlerId2); g_signal_emit_by_name (mixer, "unhandle-port", handlerId3); g_signal_handler_disconnect (hubport1, signalId1); g_signal_handler_disconnect (hubport2, signalId2); g_signal_handler_disconnect (hubport3, signalId3); g_free (padname1); g_free (padname2); g_free (padname3); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (GST_OBJECT (pipeline)); g_main_loop_unref (loop); } GST_END_TEST /* * End of test cases */ static Suite * dispatcher_suite (void) { Suite *s = suite_create ("dispatcher"); TCase *tc_chain = tcase_create ("element"); suite_add_tcase (s, tc_chain); tcase_add_test (tc_chain, connection); return s; } GST_CHECK_MAIN (dispatcher);
#include "igraph.h" #include "ruby.h" #include "cIGraph.h" /* call-seq: * graph.minimum_spanning_tree_unweighted() -> IGraph * * Calculates one minimum spanning tree of an unweighted graph. * * If the graph has more minimum spanning trees (this is always the case, * except if it is a forest) this implementation returns only the same one. * * Directed graphs are considered as undirected for this computation. * * If the graph is not connected then its minimum spanning forest is returned. * This is the set of the minimum spanning trees of each component. */ VALUE cIGraph_minimum_spanning_tree_unweighted(VALUE self){ igraph_t *graph; igraph_t *n_graph = malloc(sizeof(igraph_t)); VALUE n_graph_obj; Data_Get_Struct(self, igraph_t, graph); igraph_minimum_spanning_tree_unweighted(graph,n_graph); n_graph_obj = Data_Wrap_Struct(cIGraph, cIGraph_mark, cIGraph_free, n_graph); return n_graph_obj; } /* call-seq: * graph.minimum_spanning_tree_prim(weights) -> IGraph * * Calculates one minimum spanning tree of a weighted graph. * * This function uses Prim's method for carrying out the computation, see * Prim, R.C.: Shortest connection networks and some generalizations, Bell * System Technical Journal, Vol. 36, 1957, 1389--1401. * * If the graph has more than one minimum spanning tree, the current * implementation returns always the same one. * * Directed graphs are considered as undirected for this computation. * * If the graph is not connected then its minimum spanning forest is returned. * This is the set of the minimum spanning trees of each component. * * The weights Array must contain the weights of the the edges. in the same * order as the simple edge iterator visits them. */ VALUE cIGraph_minimum_spanning_tree_prim(VALUE self, VALUE weights){ igraph_t *graph; igraph_t *n_graph = malloc(sizeof(igraph_t)); VALUE n_graph_obj; igraph_vector_t weights_vec; int i; igraph_vector_init(&weights_vec,RARRAY_LEN(weights)); Data_Get_Struct(self, igraph_t, graph); for(i=0;i<RARRAY_LEN(weights);i++){ VECTOR(weights_vec)[i] = NUM2DBL(RARRAY_PTR(weights)[i]); } igraph_minimum_spanning_tree_prim(graph,n_graph,&weights_vec); n_graph_obj = Data_Wrap_Struct(cIGraph, cIGraph_mark, cIGraph_free, n_graph); igraph_vector_destroy(&weights_vec); return n_graph_obj; }
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2001-2002 Vivid Solutions Inc. * Copyright (C) 2005-2006 Refractions Research Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * ********************************************************************** * * Last port: planargraph/GraphComponent.java rev. 1.7 (JTS-1.7) * **********************************************************************/ #ifndef GEOS_PLANARGRAPH_GRAPHCOMPONENT_H #define GEOS_PLANARGRAPH_GRAPHCOMPONENT_H #include <geos/export.h> namespace geos { namespace planargraph { // geos.planargraph /** * \brief The base class for all graph component classes. * * Maintains flags of use in generic graph algorithms. * Provides two flags: * * - <b>marked</b> - typically this is used to indicate a state that * persists for the course of the graph's lifetime. For instance, * it can be used to indicate that a component has been logically * deleted from the graph. * - <b>visited</b> - this is used to indicate that a component has been * processed or visited by an single graph algorithm. For instance, * a breadth-first traversal of the graph might use this to indicate * that a node has already been traversed. * The visited flag may be set and cleared many times during the * lifetime of a graph. * */ class GEOS_DLL GraphComponent { protected: /// Variable holding ''marked'' status bool isMarkedVar; /// Variable holding ''visited'' status bool isVisitedVar; public: GraphComponent() : isMarkedVar(false), isVisitedVar(false) {} virtual ~GraphComponent() {} /** \brief * Tests if a component has been visited during the course * of a graph algorithm. * * @return <code>true</code> if the component has been visited */ virtual bool isVisited() const { return isVisitedVar; } /** \brief * Sets the visited flag for this component. * @param isVisited the desired value of the visited flag */ virtual void setVisited(bool isVisited) { isVisitedVar=isVisited; } /** \brief * Sets the Visited state for the elements of a container, * from start to end iterator. * * @param start the start element * @param end one past the last element * @param visited the state to set the visited flag to */ template <typename T> static void setVisited(T start, T end, bool visited) { for(T i=start; i!=end; ++i) { (*i)->setVisited(visited); } } /** \brief * Sets the Visited state for the values of each map * container element, from start to end iterator. * * @param start the start element * @param end one past the last element * @param visited the state to set the visited flag to */ template <typename T> static void setVisitedMap(T start, T end, bool visited) { for(T i=start; i!=end; ++i) { i->second->setVisited(visited); } } /** \brief * Sets the Marked state for the elements of a container, * from start to end iterator. * * @param start the start element * @param end one past the last element * @param marked the state to set the marked flag to */ template <typename T> static void setMarked(T start, T end, bool marked) { for(T i=start; i!=end; ++i) { (*i)->setMarked(marked); } } /** \brief * Sets the Marked state for the values of each map * container element, from start to end iterator. * * @param start the start element * @param end one past the last element * @param marked the state to set the visited flag to */ template <typename T> static void setMarkedMap(T start, T end, bool marked) { for(T i=start; i!=end; ++i) { i->second->setMarked(marked); } } /** \brief * Tests if a component has been marked at some point * during the processing involving this graph. * @return <code>true</code> if the component has been marked */ virtual bool isMarked() const { return isMarkedVar; } /** \brief * Sets the marked flag for this component. * @param isMarked the desired value of the marked flag */ virtual void setMarked(bool isMarked) { isMarkedVar=isMarked; } }; // For backward compatibility //typedef GraphComponent planarGraphComponent; } // namespace geos::planargraph } // namespace geos #endif // GEOS_PLANARGRAPH_GRAPHCOMPONENT_H /********************************************************************** * $Log$ * Revision 1.1 2006/03/21 21:42:54 strk * planargraph.h header split, planargraph:: classes renamed to match JTS symbols * **********************************************************************/
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** 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://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. ** ****************************************************************************/ #ifndef ABSTRACTROPERTY_H #define ABSTRACTROPERTY_H #include <QVariant> #include <QWeakPointer> #include <QSharedPointer> #include "corelib_global.h" QT_BEGIN_NAMESPACE class QTextStream; QT_END_NAMESPACE namespace QmlDesigner { namespace Internal { class InternalNode; class InternalProperty; typedef QSharedPointer<InternalNode> InternalNodePointer; typedef QSharedPointer<InternalProperty> InternalPropertyPointer; typedef QWeakPointer<InternalNode> InternalNodeWeakPointer; } class Model; class ModelNode; class AbstractView; class CORESHARED_EXPORT VariantProperty; class CORESHARED_EXPORT NodeListProperty; class CORESHARED_EXPORT NodeAbstractProperty; class CORESHARED_EXPORT BindingProperty; class CORESHARED_EXPORT NodeProperty; class QmlObjectNode; namespace Internal { class InternalNode; class ModelPrivate; } class CORESHARED_EXPORT AbstractProperty { friend class QmlDesigner::ModelNode; friend class QmlDesigner::Internal::ModelPrivate; friend CORESHARED_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2); friend CORESHARED_EXPORT bool operator !=(const AbstractProperty &property1, const AbstractProperty &property2); friend CORESHARED_EXPORT uint qHash(const AbstractProperty& property); public: AbstractProperty(); ~AbstractProperty(); AbstractProperty(const AbstractProperty &other); AbstractProperty& operator=(const AbstractProperty &other); AbstractProperty(const AbstractProperty &property, AbstractView *view); QString name() const; bool isValid() const; ModelNode parentModelNode() const; QmlObjectNode parentQmlObjectNode() const; bool isDefaultProperty() const; VariantProperty toVariantProperty() const; NodeListProperty toNodeListProperty() const; NodeAbstractProperty toNodeAbstractProperty() const; BindingProperty toBindingProperty() const; NodeProperty toNodeProperty() const; bool isVariantProperty() const; bool isNodeListProperty() const; bool isNodeAbstractProperty() const; bool isBindingProperty() const; bool isNodeProperty() const; bool isDynamic() const; QString dynamicTypeName() const; protected: AbstractProperty(const QString &propertyName, const Internal::InternalNodePointer &internalNode, Model* model, AbstractView *view); AbstractProperty(const Internal::InternalPropertyPointer &property, Model* model, AbstractView *view); Internal::InternalNodePointer internalNode() const; Model *model() const; AbstractView *view() const; private: QString m_propertyName; Internal::InternalNodePointer m_internalNode; QWeakPointer<Model> m_model; QWeakPointer<AbstractView> m_view; }; CORESHARED_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2); CORESHARED_EXPORT bool operator !=(const AbstractProperty &property1, const AbstractProperty &property2); CORESHARED_EXPORT uint qHash(const AbstractProperty& property); CORESHARED_EXPORT QTextStream& operator<<(QTextStream &stream, const AbstractProperty &property); CORESHARED_EXPORT QDebug operator<<(QDebug debug, const AbstractProperty &AbstractProperty); } #endif //ABSTRACTPROPERTY_H
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** No Commercial Usage ** ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** 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, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** **************************************************************************/ #ifndef NODEINSTANCESERVERPROXY_H #define NODEINSTANCESERVERPROXY_H #include "nodeinstanceserverinterface.h" #include <QDataStream> #include <QWeakPointer> #include <QProcess> QT_BEGIN_NAMESPACE class QLocalServer; class QLocalSocket; class QProcess; QT_END_NAMESPACE namespace QmlDesigner { class NodeInstanceClientInterface; class NodeInstanceView; class NodeInstanceClientProxy; class NodeInstanceServerProxy : public NodeInstanceServerInterface { Q_OBJECT public: explicit NodeInstanceServerProxy(NodeInstanceView *nodeInstanceView, RunModus runModus = NormalModus); ~NodeInstanceServerProxy(); void createInstances(const CreateInstancesCommand &command); void changeFileUrl(const ChangeFileUrlCommand &command); void createScene(const CreateSceneCommand &command); void clearScene(const ClearSceneCommand &command); void removeInstances(const RemoveInstancesCommand &command); void removeProperties(const RemovePropertiesCommand &command); void changePropertyBindings(const ChangeBindingsCommand &command); void changePropertyValues(const ChangeValuesCommand &command); void reparentInstances(const ReparentInstancesCommand &command); void changeIds(const ChangeIdsCommand &command); void changeState(const ChangeStateCommand &command); void addImport(const AddImportCommand &command); void completeComponent(const CompleteComponentCommand &command); protected: void writeCommand(const QVariant &command); void dispatchCommand(const QVariant &command); NodeInstanceClientInterface *nodeInstanceClient() const; signals: void processCrashed(); private slots: void processFinished(int exitCode, QProcess::ExitStatus exitStatus); void readFirstDataStream(); void readSecondDataStream(); void readThirdDataStream(); private: QWeakPointer<QLocalServer> m_localServer; QWeakPointer<QLocalSocket> m_firstSocket; QWeakPointer<QLocalSocket> m_secondSocket; QWeakPointer<QLocalSocket> m_thirdSocket; QWeakPointer<NodeInstanceView> m_nodeInstanceView; QWeakPointer<QProcess> m_qmlPuppetEditorProcess; QWeakPointer<QProcess> m_qmlPuppetPreviewProcess; QWeakPointer<QProcess> m_qmlPuppetRenderProcess; quint32 m_firstBlockSize; quint32 m_secondBlockSize; quint32 m_thirdBlockSize; RunModus m_runModus; int m_synchronizeId; }; } // namespace QmlDesigner #endif // NODEINSTANCESERVERPROXY_H
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** ** GNU Lesser General Public License Usage ** ** 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, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** **************************************************************************/ #ifndef HELPPLUGIN_H #define HELPPLUGIN_H #include <extensionsystem/iplugin.h> #include <QMap> #include <QStringList> QT_FORWARD_DECLARE_CLASS(QAction) QT_FORWARD_DECLARE_CLASS(QComboBox) QT_FORWARD_DECLARE_CLASS(QMenu) QT_FORWARD_DECLARE_CLASS(QToolButton) QT_FORWARD_DECLARE_CLASS(QUrl) namespace Core { class IMode; class MiniSplitter; class SideBar; class SideBarItem; } // Core namespace Utils { class StyledBar; } // Utils namespace Help { namespace Internal { class CentralWidget; class DocSettingsPage; class ExternalHelpWindow; class FilterSettingsPage; class GeneralSettingsPage; class HelpMode; class HelpViewer; class LocalHelpManager; class OpenPagesManager; class SearchWidget; class HelpPlugin : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Help.json") public: HelpPlugin(); virtual ~HelpPlugin(); bool initialize(const QStringList &arguments, QString *errorMessage); void extensionsInitialized(); ShutdownFlag aboutToShutdown(); private slots: void showExternalWindow(); void modeChanged(Core::IMode *mode, Core::IMode *old); void activateContext(); void activateIndex(); void activateContents(); void activateSearch(); void activateOpenPages(); void activateBookmarks(); void addBookmark(); void updateFilterComboBox(); void filterDocumentation(const QString &customFilter); void switchToHelpMode(); void switchToHelpMode(const QUrl &source); void slotHideRightPane(); void showHideSidebar(); void updateSideBarSource(); void updateSideBarSource(const QUrl &newUrl); void fontChanged(); void contextHelpOptionChanged(); void updateCloseButton(); void setupHelpEngineIfNeeded(); void highlightSearchTerms(); void handleHelpRequest(const QUrl &url); void slotAboutToShowBackMenu(); void slotAboutToShowNextMenu(); void slotOpenActionUrl(QAction *action); void slotOpenSupportPage(); void slotReportBug(); void openFindToolBar(); void scaleRightPaneUp(); void scaleRightPaneDown(); void resetRightPaneScale(); private: void setupUi(); void resetFilter(); void activateHelpMode(); Utils::StyledBar *createWidgetToolBar(); Utils::StyledBar *createIconToolBar(bool external); HelpViewer* viewerForContextMode(); void createRightPaneContextViewer(); void doSetupIfNeeded(); int contextHelpOption() const; void connectExternalHelpWindow(); void setupNavigationMenus(QAction *back, QAction *next, QWidget *parent); private: HelpMode *m_mode; CentralWidget *m_centralWidget; QWidget *m_rightPaneSideBarWidget; HelpViewer *m_helpViewerForSideBar; Core::SideBarItem *m_contentItem; Core::SideBarItem *m_indexItem; Core::SideBarItem *m_searchItem; Core::SideBarItem *m_bookmarkItem; Core::SideBarItem *m_openPagesItem; DocSettingsPage *m_docSettingsPage; FilterSettingsPage *m_filterSettingsPage; GeneralSettingsPage *m_generalSettingsPage; QComboBox *m_filterComboBox; Core::SideBar *m_sideBar; bool m_firstModeChange; LocalHelpManager *m_helpManager; OpenPagesManager *m_openPagesManager; Core::MiniSplitter *m_splitter; QToolButton *m_closeButton; QString m_oldAttrValue; QString m_styleProperty; QString m_idFromContext; Core::IMode* m_oldMode; bool m_connectWindow; ExternalHelpWindow *m_externalWindow; QMenu *m_backMenu; QMenu *m_nextMenu; Utils::StyledBar *m_internalHelpBar; Utils::StyledBar *m_externalHelpBar; }; } // namespace Internal } // namespace Help #endif // HELPPLUGIN_H
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "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 Nokia Corporation and its Subsidiary(-ies) 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." ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <QtOpenGL> #include <QImage> #include <QTimeLine> #include <QSvgRenderer> class GLWidget : public QGLWidget { Q_OBJECT public: GLWidget(QWidget *parent); ~GLWidget(); void saveGLState(); void restoreGLState(); void paintEvent(QPaintEvent *); void mousePressEvent(QMouseEvent *); void mouseDoubleClickEvent(QMouseEvent *); void mouseMoveEvent(QMouseEvent *); void timerEvent(QTimerEvent *); void wheelEvent(QWheelEvent *); public slots: void animate(qreal); void animFinished(); void draw(); private: QPoint anchor; float scale; float rot_x, rot_y, rot_z; GLuint tile_list; GLfloat *wave; QImage logo; QTimeLine *anim; QSvgRenderer *svg_renderer; QGLFramebufferObject *render_fbo; QGLFramebufferObject *texture_fbo; };
/* ============================================================================ Name : QAppKeyCheck.h Author : 腾讯SOSO地图API Version : 1.0 Copyright : 腾讯 Description : QAppKeyCheck,QAppKeyCheckDelegate declaration ============================================================================ */ #import <Foundation/Foundation.h> #import "QTypes.h" /** *QAppKeyCheckDelegate:app key 验证的代理 *Author:ksnowlv **/ @protocol QAppKeyCheckDelegate <NSObject> /** *通知APPKey验证的结果 *@param errCode 见QErrorCode定义 */ -(void)notifyAppKeyCheckResult:(QErrorCode)errCode; @end /** *QAppKeyCheck:app key 验证 *Author:ksnowlv **/ @interface QAppKeyCheck : NSObject /** *启动APPKey验证 *@param key 申请的有效key *@param delegate 代理 */ -(BOOL)start:(NSString*)key withDelegate:(id<QAppKeyCheckDelegate>)delegate; /** *停止或取消APPKey验证 */ -(void)stop; @end
#include <assert.h> #include <string.h> #include "kmp.h" int main(int argc, char *argv[]) { size_t table[32]; size_t rc; char *key = "12345678901234567890"; char *str = "this is a test"; rc = kmp(key, table, strlen(key), str, strlen(str)); assert(rc == strlen(str)); return 0; }
// ftpd is a server implementation based on the following: // - RFC 959 (https://tools.ietf.org/html/rfc959) // - RFC 3659 (https://tools.ietf.org/html/rfc3659) // - suggested implementation details from https://cr.yp.to/ftp/filesystem.html // // The MIT License (MIT) // // Copyright (C) 2020 Michael Theall // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #pragma once #ifndef CLASSIC namespace imgui { namespace ctru { /// \brief Initialize 3ds platform bool init (); /// \brief Prepare 3ds for a new frame void newFrame (); } } #endif
// // SVProgressHUD+Tips.h // WeiBo // // Created by wbs on 17/3/14. // Copyright © 2017年 xiaomaolv. All rights reserved. // #import "SVProgressHUD.h" @interface SVProgressHUD (Tips) // 以下常有方法默认加到窗口上,默认SVProgressHUDAnimationTypeFlat样式 + (void)showLoading; + (void)showLoadingTips:(NSString *)message; + (void)showSuccessTips:(NSString *)message; + (void)showErrorTips:(NSString *)message; + (void)dismissTips; @end
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include <assert.h> #include "os/mynewt.h" #include "testutil/testutil.h" #include "testutil_priv.h" const char *tu_suite_name = 0; int tu_suite_failed = 0; struct ts_testsuite_list g_ts_suites; /* * tu_suite_register must be called for each test_suite that's to * be run from a list rather than explicitly called. * See mynewtsanity. */ int tu_suite_register(tu_testsuite_fn_t* ts, const char *name) { struct ts_suite *tsp; tsp = (struct ts_suite *)os_malloc(sizeof(*tsp)); if (!tsp) { return -1; } tsp->ts_name = name; tsp->ts_test = ts; SLIST_INSERT_HEAD(&g_ts_suites, tsp, ts_next); return 0; } static void tu_suite_set_name(const char *name) { tu_config.ts_suite_name = name; } /** * Configures a callback that gets executed at the start of each test * case in the current suite. This is useful when there are some * checks that should be performed at the end of each test * (e.g., verify no memory leaks). This callback is cleared when the * current suite completes. * * @param cb - The callback to execute at the end of each test case. * @param cb_arg - An optional argument that gets passed to the * callback. */ void tu_suite_set_pre_test_cb(tu_pre_test_fn_t *cb, void *cb_arg) { tu_config.pre_test_cb = cb; tu_config.pre_test_arg = cb_arg; } void tu_suite_pre_test(void) { if (tu_config.pre_test_cb != NULL) { tu_config.pre_test_cb(tu_config.pre_test_arg); } } void tu_suite_complete(void) { tu_suite_set_pre_test_cb(NULL, NULL); } void tu_suite_init(const char *name) { tu_suite_failed = 0; tu_suite_set_name(name); }
// // AQCycleView.h // AQCycleViewDemo // // Created by Allen on 16/3/12. // Copyright © 2017年 Allen. All rights reserved. // #import <UIKit/UIKit.h> @class AQCycleView; @protocol AQCycleViewDelegate <NSObject> - (void)cycleView:(AQCycleView *)cycleView didSelectItemAtIndexPath:(NSIndexPath *)indexPath; @end @interface AQCycleView : UIView /** 代理属性 */ @property (nonatomic, weak) id<AQCycleViewDelegate> delegate; /** 手动添加本地图片数组 */ @property (nonatomic, strong) NSArray *localImageArray; /** 手动添加网络图片数组 */ @property (nonatomic, strong) NSArray *webImageArray; /** 是否无限循环,默认为YES */ @property (nonatomic, assign) BOOL isInfinite; /** 是否自动滚动,默认为YES */ @property (nonatomic, assign) BOOL isAutoScroll; /** 快捷添加本地图片轮播,默认为无限轮播 @param frame 轮播的Frame @param localImageArray 本地图片的数组 @return 返回view实例 */ + (instancetype)cycleViewWithFrame:(CGRect)frame localImageArray:(NSArray *)localImageArray; /** 快捷添加网络图片轮播,默认为无限轮播 @param frame 轮播的Frame @param webImageArray 网络图片的数组 @return 返回view实例 */ + (instancetype)cycleViewWithFrame:(CGRect)frame webImgaeArray:(NSArray *)webImageArray; @end
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/opsworks/OpsWorks_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/opsworks/model/App.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace OpsWorks { namespace Model { /** * <p>Contains the response to a <code>DescribeApps</code> request.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAppsResult">AWS * API Reference</a></p> */ class AWS_OPSWORKS_API DescribeAppsResult { public: DescribeAppsResult(); DescribeAppsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DescribeAppsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>An array of <code>App</code> objects that describe the specified apps. </p> */ inline const Aws::Vector<App>& GetApps() const{ return m_apps; } /** * <p>An array of <code>App</code> objects that describe the specified apps. </p> */ inline void SetApps(const Aws::Vector<App>& value) { m_apps = value; } /** * <p>An array of <code>App</code> objects that describe the specified apps. </p> */ inline void SetApps(Aws::Vector<App>&& value) { m_apps = std::move(value); } /** * <p>An array of <code>App</code> objects that describe the specified apps. </p> */ inline DescribeAppsResult& WithApps(const Aws::Vector<App>& value) { SetApps(value); return *this;} /** * <p>An array of <code>App</code> objects that describe the specified apps. </p> */ inline DescribeAppsResult& WithApps(Aws::Vector<App>&& value) { SetApps(std::move(value)); return *this;} /** * <p>An array of <code>App</code> objects that describe the specified apps. </p> */ inline DescribeAppsResult& AddApps(const App& value) { m_apps.push_back(value); return *this; } /** * <p>An array of <code>App</code> objects that describe the specified apps. </p> */ inline DescribeAppsResult& AddApps(App&& value) { m_apps.push_back(std::move(value)); return *this; } private: Aws::Vector<App> m_apps; }; } // namespace Model } // namespace OpsWorks } // namespace Aws
/* * Copyright (c) 2020 Intel Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr.h> #include <ztest.h> #include <pm/pm.h> /* Last state has not declared a minimum residency, so it should be * set the default 0 value */ static struct pm_state_info infos[] = {{PM_STATE_SUSPEND_TO_IDLE, 0, 10000, 100}, {PM_STATE_SUSPEND_TO_RAM, 0, 50000, 500}, {PM_STATE_STANDBY, 0, 0}}; static enum pm_state states[] = {PM_STATE_SUSPEND_TO_IDLE, PM_STATE_SUSPEND_TO_RAM, PM_STATE_STANDBY}; static enum pm_state wrong_states[] = {PM_STATE_SUSPEND_TO_DISK, PM_STATE_SUSPEND_TO_RAM, PM_STATE_SUSPEND_TO_RAM}; void test_power_states(void) { enum pm_state dts_states[] = PM_STATE_DT_ITEMS_LIST(DT_NODELABEL(power_states)); struct pm_state_info dts_infos[] = PM_STATE_INFO_DT_ITEMS_LIST(DT_NODELABEL(power_states)); uint32_t dts_states_len = PM_STATE_DT_ITEMS_LEN(DT_NODELABEL(power_states)); zassert_true(ARRAY_SIZE(states) == dts_states_len, "Invalid number of pm states"); zassert_true(memcmp(infos, dts_infos, sizeof(dts_infos)) == 0, "Invalid pm_state_info array"); zassert_true(memcmp(states, dts_states, sizeof(dts_states)) == 0, "Invalid pm-states array"); zassert_false(memcmp(wrong_states, dts_states, sizeof(dts_states)) == 0, "Invalid pm-states array"); } void test_main(void) { ztest_test_suite(power_states_test, ztest_1cpu_unit_test(test_power_states)); ztest_run_test_suite(power_states_test); }
/* mongo-sync-cursor.c - libmongo-client cursor API on top of Sync * Copyright 2011, 2012 Gergely Nagy <algernon@balabit.hu> * * 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. */ /** @file src/mongo-sync-cursor.c * MongoDB Cursor API implementation. */ #include "config.h" #include "mongo.h" #include "libmongo-private.h" #include <errno.h> mongo_sync_cursor * mongo_sync_cursor_new (mongo_sync_connection *conn, const gchar *ns, mongo_packet *packet) { mongo_sync_cursor *c; if (!conn) { errno = ENOTCONN; return NULL; } if (!ns || !packet) { errno = EINVAL; return NULL; } c = g_new0 (mongo_sync_cursor, 1); c->conn = conn; c->ns = g_strdup (ns); c->results = packet; c->offset = -1; mongo_wire_reply_packet_get_header (c->results, &c->ph); return c; } gboolean mongo_sync_cursor_next (mongo_sync_cursor *cursor) { if (!cursor) { errno = EINVAL; return FALSE; } errno = 0; if (cursor->offset >= cursor->ph.returned - 1) { gint32 ret = cursor->ph.returned; gint64 cid = cursor->ph.cursor_id; mongo_wire_packet_free (cursor->results); cursor->offset = -1; cursor->results = mongo_sync_cmd_get_more (cursor->conn, cursor->ns, ret, cid); if (!cursor->results) return FALSE; mongo_wire_reply_packet_get_header (cursor->results, &cursor->ph); } cursor->offset++; return TRUE; } void mongo_sync_cursor_free (mongo_sync_cursor *cursor) { if (!cursor) { errno = ENOTCONN; return; } errno = 0; mongo_sync_cmd_kill_cursors (cursor->conn, 1, cursor->ph.cursor_id); g_free (cursor->ns); mongo_wire_packet_free (cursor->results); g_free (cursor); } bson * mongo_sync_cursor_get_data (mongo_sync_cursor *cursor) { bson *r; if (!cursor) { errno = EINVAL; return NULL; } if (!mongo_wire_reply_packet_get_nth_document (cursor->results, cursor->offset + 1, &r)) { errno = ERANGE; return NULL; } bson_finish (r); return r; }
// // Copyright 2018 ZetaSQL Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #ifndef UTIL_TIME_PROTOUTIL_H_ #define UTIL_TIME_PROTOUTIL_H_ #include "google/protobuf/timestamp.pb.h" #include "absl/status/status.h" #include "absl/time/time.h" #include "zetasql/base/statusor.h" namespace zetasql_base { // Encodes an absl::Time as a google::protobuf::Timestamp, following the // encoding rules specified at (broken link) // Returns an error if the given absl::Time is beyond the range allowed by the // protobuf. Otherwise, truncates toward infinite past with nanosecond precision // and returns the google::protobuf::Timestamp. // // See also: (broken link) // // Note: absl::InfiniteFuture/absl::InfinitePast() cannot be encoded because // they are not representable in the protobuf. absl::Status EncodeGoogleApiProto(absl::Time t, google::protobuf::Timestamp* proto); // Decodes the given protobuf and returns an absl::Time, or returns an error // status if the argument is invalid according to // (broken link) StatusOr<absl::Time> DecodeGoogleApiProto( const google::protobuf::Timestamp& proto); } // namespace zetasql_base #endif // UTIL_TIME_PROTOUTIL_H_
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/glacier/Glacier_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace Glacier { namespace Model { /** * <p>Represents a vault's notification configuration.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/glacier-2012-06-01/VaultNotificationConfig">AWS * API Reference</a></p> */ class AWS_GLACIER_API VaultNotificationConfig { public: VaultNotificationConfig(); VaultNotificationConfig(const Aws::Utils::Json::JsonValue& jsonValue); VaultNotificationConfig& operator=(const Aws::Utils::Json::JsonValue& jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource * Name (ARN).</p> */ inline const Aws::String& GetSNSTopic() const{ return m_sNSTopic; } /** * <p>The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource * Name (ARN).</p> */ inline void SetSNSTopic(const Aws::String& value) { m_sNSTopicHasBeenSet = true; m_sNSTopic = value; } /** * <p>The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource * Name (ARN).</p> */ inline void SetSNSTopic(Aws::String&& value) { m_sNSTopicHasBeenSet = true; m_sNSTopic = std::move(value); } /** * <p>The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource * Name (ARN).</p> */ inline void SetSNSTopic(const char* value) { m_sNSTopicHasBeenSet = true; m_sNSTopic.assign(value); } /** * <p>The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource * Name (ARN).</p> */ inline VaultNotificationConfig& WithSNSTopic(const Aws::String& value) { SetSNSTopic(value); return *this;} /** * <p>The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource * Name (ARN).</p> */ inline VaultNotificationConfig& WithSNSTopic(Aws::String&& value) { SetSNSTopic(std::move(value)); return *this;} /** * <p>The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource * Name (ARN).</p> */ inline VaultNotificationConfig& WithSNSTopic(const char* value) { SetSNSTopic(value); return *this;} /** * <p>A list of one or more events for which Amazon Glacier will send a * notification to the specified Amazon SNS topic.</p> */ inline const Aws::Vector<Aws::String>& GetEvents() const{ return m_events; } /** * <p>A list of one or more events for which Amazon Glacier will send a * notification to the specified Amazon SNS topic.</p> */ inline void SetEvents(const Aws::Vector<Aws::String>& value) { m_eventsHasBeenSet = true; m_events = value; } /** * <p>A list of one or more events for which Amazon Glacier will send a * notification to the specified Amazon SNS topic.</p> */ inline void SetEvents(Aws::Vector<Aws::String>&& value) { m_eventsHasBeenSet = true; m_events = std::move(value); } /** * <p>A list of one or more events for which Amazon Glacier will send a * notification to the specified Amazon SNS topic.</p> */ inline VaultNotificationConfig& WithEvents(const Aws::Vector<Aws::String>& value) { SetEvents(value); return *this;} /** * <p>A list of one or more events for which Amazon Glacier will send a * notification to the specified Amazon SNS topic.</p> */ inline VaultNotificationConfig& WithEvents(Aws::Vector<Aws::String>&& value) { SetEvents(std::move(value)); return *this;} /** * <p>A list of one or more events for which Amazon Glacier will send a * notification to the specified Amazon SNS topic.</p> */ inline VaultNotificationConfig& AddEvents(const Aws::String& value) { m_eventsHasBeenSet = true; m_events.push_back(value); return *this; } /** * <p>A list of one or more events for which Amazon Glacier will send a * notification to the specified Amazon SNS topic.</p> */ inline VaultNotificationConfig& AddEvents(Aws::String&& value) { m_eventsHasBeenSet = true; m_events.push_back(std::move(value)); return *this; } /** * <p>A list of one or more events for which Amazon Glacier will send a * notification to the specified Amazon SNS topic.</p> */ inline VaultNotificationConfig& AddEvents(const char* value) { m_eventsHasBeenSet = true; m_events.push_back(value); return *this; } private: Aws::String m_sNSTopic; bool m_sNSTopicHasBeenSet; Aws::Vector<Aws::String> m_events; bool m_eventsHasBeenSet; }; } // namespace Model } // namespace Glacier } // namespace Aws
/** * \file RMF/internal/SharedData.h * \brief Handle read/write of Model data from/to files. * * Copyright 2007-2022 IMP Inventors. All rights reserved. * */ #ifndef RMF_INTERNAL_SHARED_DATA_DATA_IMPL_H #define RMF_INTERNAL_SHARED_DATA_DATA_IMPL_H #include "RMF/config.h" #include "RMF/Key.h" #include "RMF/types.h" #include "RMF/names.h" #include "RMF/enums.h" #include "RMF/NodeID.h" #include "RMF/FrameID.h" #include "RMF/infrastructure_macros.h" #include "SharedDataUserData.h" #include "SharedDataPath.h" #include <boost/cstdint.hpp> #include <algorithm> #include <boost/shared_ptr.hpp> RMF_ENABLE_WARNINGS namespace RMF { namespace internal { template <class Traits> struct Get {}; #define RMF_GETTER(lcname, Ucname, PassValue, ReturnValue, PassValues, \ ReturnValues) \ template <class Table> \ struct Get<Table, Ucname##Traits> { \ static typename Table::Ucname##Data &get(Table &t) { \ return t.lcname##_data; \ } \ static typename const Table::Ucname##Data &get(const Table &t) { \ return t.lcname##_data; \ } \ }; RMF_FOREACH_TYPE(RMF_GETTER); template <class Traits> inline std::vector<ID<Traits> > SharedData::get_keys_impl( Category category, const KeyTypeInfo &data) const { std::vector<ID<Traits> > ret; for (auto np; data.from_name) { ret.push_back(ID<Traits>(np.second)); } return ret; } template <class Traits> inline ID<Traits> SharedData::get_key_impl(Category category, std::string name, KeyTypeInfo &data) { auto it = data.from_name.find(name); if (it == data.from_name.end()) { int index = data.from_name.size(); data.from_name[name] = index; data.to_name[index] = name; return ID<Traits>(index); } else { return ID<Traits>(it->second); } } template <class Traits> inline Traits::Type SharedData::get_current_value(NodeID node, ID<Traits> k) const { return current_nodes_data_.find(node)->second.lcname##_data.find(k)->second; } /** Return a value or the null value.*/ template <class Traits> inline Traits::Type SharedData::get_static_value(NodeID node, ID<Traits> k) const { return static_nodes_data_.find(node)->second.lcname##_data.find(k)->second; } template <class Traits> inline Traits::Type SharedData::get_current_frame_value(ID<Traits> k) const { return get_current_value(NodeID(), k); } template <class Traits> inline Traits::Type SharedData::get_static_frame_value(ID<Traits> k) const { return get_static_value(NodeID(), k); } template <class Traits> inline void SharedData::set_current_value(NodeID node, ID<Traits> k, Ucname##Traits::Type v) { current_nodes_data_[node].lcname##_data[k] = v; } template <class Traits> inline void SharedData::set_static_value(NodeID node, ID<Traits> k, Ucname##Traits::Type v) { static_nodes_data_[node].lcname##_data[k] = v; } /** for frames */ template <class Traits> inline void SharedData::set_current_frame_value(ID<Traits> k, Traits::Type v) { set_current_value(NodeID(), k, v); } template <class Traits> inline void SharedData::set_static_frame_value(ID<Ucname##Traits> k, Ucname##Traits::Type v) { set_static_value(NodeID(), k, v); } template <class Traits> inline std::vector<ID<Ucname##Traits> > SharedData::get_##lcname##_keys( Category category) { return get_keys_impl<Ucname##Traits>(category, key_infos_.lcname##_keys); } template <class Traits> inline Category SharedData::get_category(ID<Ucname##Traits> k) const { return key_infos_.lcname##_keys[k.get_index()].category; } template <class Traits> inline ID<Ucname##Traits> SharedData::get_##lcname##_key(Category category, std::string name) { return get_key_impl<Ucname##Traits>(category, name, key_infos_.lcname##_keys); } template <class Traits> inline std::string SharedData::get_name(ID<Ucname##Traits> k) const { return key_infos_.lcname##_keys[k.get_index()].name; } inline std::string SharedData::get_category_name(Category kc) const { return category_infos_[kc.get_index()].name; } } // namespace internal } /* namespace RMF */ RMF_DISABLE_WARNINGS #endif /* RMF_INTERNAL_SHARED_DATA_DATA_IMPL_H */
//===- ControlFlowInterfaces.h - ControlFlow Interfaces ---------*- 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 // //===----------------------------------------------------------------------===// // // This file contains the definitions of the branch interfaces defined in // `ControlFlowInterfaces.td`. // //===----------------------------------------------------------------------===// #ifndef MLIR_INTERFACES_CONTROLFLOWINTERFACES_H #define MLIR_INTERFACES_CONTROLFLOWINTERFACES_H #include "mlir/IR/OpDefinition.h" namespace mlir { class BranchOpInterface; class RegionBranchOpInterface; //===----------------------------------------------------------------------===// // BranchOpInterface //===----------------------------------------------------------------------===// namespace detail { /// Return the `BlockArgument` corresponding to operand `operandIndex` in some /// successor if `operandIndex` is within the range of `operands`, or None if /// `operandIndex` isn't a successor operand index. Optional<BlockArgument> getBranchSuccessorArgument(Optional<OperandRange> operands, unsigned operandIndex, Block *successor); /// Verify that the given operands match those of the given successor block. LogicalResult verifyBranchSuccessorOperands(Operation *op, unsigned succNo, Optional<OperandRange> operands); } // namespace detail //===----------------------------------------------------------------------===// // RegionBranchOpInterface //===----------------------------------------------------------------------===// namespace detail { /// Verify that types match along control flow edges described the given op. LogicalResult verifyTypesAlongControlFlowEdges(Operation *op); } // namespace detail /// This class represents a successor of a region. A region successor can either /// be another region, or the parent operation. If the successor is a region, /// this class represents the destination region, as well as a set of arguments /// from that region that will be populated by values from the current region. /// If the successor is the parent operation, this class represents an optional /// set of results that will be populated by values from the current region. /// /// This interface assumes that the values from the current region that are used /// to populate the successor inputs are the operands of the return-like /// terminator operations in the blocks within this region. class RegionSuccessor { public: /// Initialize a successor that branches to another region of the parent /// operation. RegionSuccessor(Region *region, Block::BlockArgListType regionInputs = {}) : region(region), inputs(regionInputs) {} /// Initialize a successor that branches back to/out of the parent operation. RegionSuccessor(Optional<Operation::result_range> results = {}) : region(nullptr), inputs(results ? ValueRange(*results) : ValueRange()) { } /// Return the given region successor. Returns nullptr if the successor is the /// parent operation. Region *getSuccessor() const { return region; } /// Return true if the successor is the parent operation. bool isParent() const { return region == nullptr; } /// Return the inputs to the successor that are remapped by the exit values of /// the current region. ValueRange getSuccessorInputs() const { return inputs; } private: Region *region; ValueRange inputs; }; //===----------------------------------------------------------------------===// // ControlFlow Traits //===----------------------------------------------------------------------===// namespace OpTrait { /// This trait indicates that a terminator operation is "return-like". This /// means that it exits its current region and forwards its operands as "exit" /// values to the parent region. Operations with this trait are not permitted to /// contain successors or produce results. template <typename ConcreteType> struct ReturnLike : public TraitBase<ConcreteType, ReturnLike> { static LogicalResult verifyTrait(Operation *op) { static_assert(ConcreteType::template hasTrait<IsTerminator>(), "expected operation to be a terminator"); static_assert(ConcreteType::template hasTrait<ZeroResult>(), "expected operation to have zero results"); static_assert(ConcreteType::template hasTrait<ZeroSuccessor>(), "expected operation to have zero successors"); return success(); } }; } // namespace OpTrait } // end namespace mlir //===----------------------------------------------------------------------===// // ControlFlow Interfaces //===----------------------------------------------------------------------===// /// Include the generated interface declarations. #include "mlir/Interfaces/ControlFlowInterfaces.h.inc" #endif // MLIR_INTERFACES_CONTROLFLOWINTERFACES_H
// Copyright (c) 2019 PaddlePaddle Authors. 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. #pragma once #include <map> #include <memory> #include <string> #include <unordered_map> #include <vector> #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wall" #include "lite/api/cxx_api.h" #include "lite/api/paddle_api.h" #include "lite/api/paddle_place.h" #include "lite/api/paddle_use_passes.h" #pragma GCC diagnostic pop namespace paddle { namespace inference { namespace lite { struct EngineConfig { std::string model; std::string param; std::vector<paddle::lite_api::Place> valid_places; std::vector<std::string> neglected_passes; lite_api::LiteModelType model_type{lite_api::LiteModelType::kProtobuf}; bool model_from_memory{true}; // TODO(wilber): now only works for xpu, lite gpu can support device_id or // not? int device_id = 0; // for xpu size_t xpu_l3_workspace_size; bool locked = false; bool autotune = true; std::string autotune_file = ""; std::string precision = "int16"; bool adaptive_seqlen = false; // for x86 or arm int cpu_math_library_num_threads{1}; // for cuda bool use_multi_stream{false}; // for nnadapter or npu. std::string nnadapter_model_cache_dir; std::vector<std::string> nnadapter_device_names; std::string nnadapter_context_properties; std::string nnadapter_subgraph_partition_config_buffer; std::string nnadapter_subgraph_partition_config_path; std::vector<std::string> nnadapter_model_cache_token; std::vector<std::vector<char>> nnadapter_model_cache_buffer; }; class EngineManager { public: bool Empty() const; bool Has(const std::string& name) const; paddle::lite_api::PaddlePredictor* Get(const std::string& name) const; paddle::lite_api::PaddlePredictor* Create(const std::string& name, const EngineConfig& cfg); void DeleteAll(); private: std::unordered_map<std::string, std::shared_ptr<paddle::lite_api::PaddlePredictor>> engines_; }; } // namespace lite } // namespace inference } // namespace paddle
/* ---------------------------------------------------------------------------- */ /* Atmel Microcontroller Software Support */ /* SAM Software Package License */ /* ---------------------------------------------------------------------------- */ /* Copyright (c) 2014, Atmel Corporation */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following condition is met: */ /* */ /* - Redistributions of source code must retain the above copyright notice, */ /* this list of conditions and the disclaimer below. */ /* */ /* Atmel's name may not be used to endorse or promote products derived from */ /* this software without specific prior written permission. */ /* */ /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ /* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMG53_EFC_INSTANCE_ #define _SAMG53_EFC_INSTANCE_ /* ========== Register definition for EFC peripheral ========== */ #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) #define REG_EFC_FMR (0x400E0A00U) /**< \brief (EFC) EEFC Flash Mode Register */ #define REG_EFC_FCR (0x400E0A04U) /**< \brief (EFC) EEFC Flash Command Register */ #define REG_EFC_FSR (0x400E0A08U) /**< \brief (EFC) EEFC Flash Status Register */ #define REG_EFC_FRR (0x400E0A0CU) /**< \brief (EFC) EEFC Flash Result Register */ #else #define REG_EFC_FMR (*(__IO uint32_t*)0x400E0A00U) /**< \brief (EFC) EEFC Flash Mode Register */ #define REG_EFC_FCR (*(__O uint32_t*)0x400E0A04U) /**< \brief (EFC) EEFC Flash Command Register */ #define REG_EFC_FSR (*(__I uint32_t*)0x400E0A08U) /**< \brief (EFC) EEFC Flash Status Register */ #define REG_EFC_FRR (*(__I uint32_t*)0x400E0A0CU) /**< \brief (EFC) EEFC Flash Result Register */ #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #endif /* _SAMG53_EFC_INSTANCE_ */
/* Copyright 2013-2014 IBM Corp. * * 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 <skiboot.h> #include <opal.h> #include <mem_region.h> #include <device.h> #include <timebase.h> #include <time-utils.h> #include <lock.h> /* timebase when tm_offset was assigned */ static unsigned long tb_synctime; /* * Absolute time that was last assigned. * Current rtc value is calculated from this. */ static struct tm tm_offset; /* protects tm_offset & tb_synctime */ static struct lock emulation_lock; static int64_t fake_rtc_write(uint32_t ymd, uint64_t hmsm) { lock(&emulation_lock); datetime_to_tm(ymd, hmsm, &tm_offset); tb_synctime = mftb(); unlock(&emulation_lock); return OPAL_SUCCESS; } static int64_t fake_rtc_read(uint32_t *ymd, uint64_t *hmsm) { time_t sec; struct tm tm_calculated; if (!ymd || !hmsm) return OPAL_PARAMETER; /* Compute the emulated clock value */ lock(&emulation_lock); sec = tb_to_secs(mftb() - tb_synctime) + mktime(&tm_offset); gmtime_r(&sec, &tm_calculated); tm_to_datetime(&tm_calculated, ymd, hmsm); unlock(&emulation_lock); return OPAL_SUCCESS; } void fake_rtc_init(void) { struct mem_region *rtc_region = NULL; uint32_t *rtc = NULL, *fake_ymd; uint64_t *fake_hmsm; struct dt_node *np; /* Read initial values from reserved memory */ rtc_region = find_mem_region("ibm,fake-rtc"); /* Should we register anyway? */ if (!rtc_region) { prlog(PR_TRACE, "No initial RTC value found\n"); return; } init_lock(&emulation_lock); /* Fetch the initial rtc values */ rtc = (uint32_t *) rtc_region->start; fake_ymd = rtc; fake_hmsm = ((uint64_t *) &rtc[1]); fake_rtc_write(*fake_ymd, *fake_hmsm); /* Register opal calls */ opal_register(OPAL_RTC_READ, fake_rtc_read, 2); opal_register(OPAL_RTC_WRITE, fake_rtc_write, 2); /* add the fake rtc dt node */ np = dt_new(opal_node, "rtc"); dt_add_property_strings(np, "compatible", "ibm,opal-rtc"); prlog(PR_TRACE, "Init fake RTC to Date:%d-%d-%d Time:%d-%d-%d\n", tm_offset.tm_mon, tm_offset.tm_mday, tm_offset.tm_year, tm_offset.tm_hour, tm_offset.tm_min, tm_offset.tm_sec); }
/* Copyright 2018-present Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #import <UIKit/UIKit.h> @interface BidirectionalViewController : UIViewController @end
#include <stdio.h> int binary_search(int *array, int left, int right, int value); int main() { int array[] = {1, 3, 5, 6, 7, 9, 11, 20, 33, 58, 89}; int size = sizeof(array)/ sizeof(array[0]); int idx_ret = binary_search(array, 0, size-1, 11); if (idx_ret == -1) { printf("not found!\n"); } else { printf("index = %d\n", idx_ret); } return 0; } int binary_search(int *array, int left, int right, int value) { if (left > right) { // value not found return -1; } int mid = left + (right - left) / 2; if (array[mid] == value) { return mid; } else if( array[mid] < value) { return binary_search(array, mid + 1, right, value); } else { return binary_search(array, left, mid - 1, value); } }
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_ValueType3507792607.h" // System.Array struct Il2CppArray; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Array/InternalEnumerator`1<System.Array> struct InternalEnumerator_1_t393253905 { public: // System.Array System.Array/InternalEnumerator`1::array Il2CppArray * ___array_0; // System.Int32 System.Array/InternalEnumerator`1::idx int32_t ___idx_1; public: inline static int32_t get_offset_of_array_0() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t393253905, ___array_0)); } inline Il2CppArray * get_array_0() const { return ___array_0; } inline Il2CppArray ** get_address_of_array_0() { return &___array_0; } inline void set_array_0(Il2CppArray * value) { ___array_0 = value; Il2CppCodeGenWriteBarrier(&___array_0, value); } inline static int32_t get_offset_of_idx_1() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t393253905, ___idx_1)); } inline int32_t get_idx_1() const { return ___idx_1; } inline int32_t* get_address_of_idx_1() { return &___idx_1; } inline void set_idx_1(int32_t value) { ___idx_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
/** * Copyright (c) 2009 Alex Fajkowski, Apparent Logic LLC * * 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. */ #if defined(USE_TI_UIIOSCOVERFLOWVIEW) || defined(USE_TI_UICOVERFLOWVIEW) #import <UIKit/UIKit.h> // MealtimerNoXML modification note: // using categories with static libraries don't seem to work // right on device with iphone - probably a symbol issue // turn this into a static function (from what was a category to UIImage // originally) UIImage* AddImageReflection(UIImage *src, CGFloat reflectionFraction); #endif
// Copyright (c) Attack Pattern LLC. 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 #import "SimulatedDevice.h" extern NSString *bloodPressureChanged; typedef enum { mmHg, kPa } PressureUnits; @interface BloodPressureDevice : SimulatedDevice @property (nonatomic) PressureUnits pressureUnits; @property (nonatomic) float systolicBloodPressure; @property (nonatomic) float diastolicBloodPressure; @property (nonatomic) float arterialBloodPressure; @property (nonatomic) BOOL includePulseRate; @property (nonatomic) int pulseRateBeatsPerMinute; @end
/* Copyright (c) 2005-2020 Intel Corporation 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. */ #define MAX_THREADS 1024 #define NUM_OF_BINS 30 #define ThreadCommonCounters NUM_OF_BINS enum counter_type { allocBlockNew = 0, allocBlockPublic, allocBumpPtrUsed, allocFreeListUsed, allocPrivatized, examineEmptyEnough, examineNotEmpty, freeRestoreBumpPtr, freeByOtherThread, freeToActiveBlock, freeToInactiveBlock, freeBlockPublic, freeBlockBack, MaxCounters }; enum common_counter_type { allocNewLargeObj = 0, allocCachedLargeObj, cacheLargeObj, freeLargeObj, lockPublicFreeList, freeToOtherThread }; #if COLLECT_STATISTICS /* Statistics reporting callback registered via a static object dtor on Posix or DLL_PROCESS_DETACH on Windows. */ static bool reportAllocationStatistics; struct bin_counters { int counter[MaxCounters]; }; static bin_counters statistic[MAX_THREADS][NUM_OF_BINS+1]; //zero-initialized; static inline int STAT_increment(int thread, int bin, int ctr) { return reportAllocationStatistics && thread < MAX_THREADS ? ++(statistic[thread][bin].counter[ctr]) : 0; } static inline void initStatisticsCollection() { #if defined(MALLOCENV_COLLECT_STATISTICS) if (NULL != getenv(MALLOCENV_COLLECT_STATISTICS)) reportAllocationStatistics = true; #endif } #else #define STAT_increment(a,b,c) ((void)0) #endif /* COLLECT_STATISTICS */ #if COLLECT_STATISTICS static inline void STAT_print(int thread) { if (!reportAllocationStatistics) return; char filename[100]; #if USE_PTHREAD sprintf(filename, "stat_ScalableMalloc_proc%04d_thr%04d.log", getpid(), thread); #else sprintf(filename, "stat_ScalableMalloc_thr%04d.log", thread); #endif FILE* outfile = fopen(filename, "w"); for(int i=0; i<NUM_OF_BINS; ++i) { bin_counters& ctrs = statistic[thread][i]; fprintf(outfile, "Thr%04d Bin%02d", thread, i); fprintf(outfile, ": allocNewBlocks %5d", ctrs.counter[allocBlockNew]); fprintf(outfile, ", allocPublicBlocks %5d", ctrs.counter[allocBlockPublic]); fprintf(outfile, ", restoreBumpPtr %5d", ctrs.counter[freeRestoreBumpPtr]); fprintf(outfile, ", privatizeCalled %10d", ctrs.counter[allocPrivatized]); fprintf(outfile, ", emptyEnough %10d", ctrs.counter[examineEmptyEnough]); fprintf(outfile, ", notEmptyEnough %10d", ctrs.counter[examineNotEmpty]); fprintf(outfile, ", freeBlocksPublic %5d", ctrs.counter[freeBlockPublic]); fprintf(outfile, ", freeBlocksBack %5d", ctrs.counter[freeBlockBack]); fprintf(outfile, "\n"); } for(int i=0; i<NUM_OF_BINS; ++i) { bin_counters& ctrs = statistic[thread][i]; fprintf(outfile, "Thr%04d Bin%02d", thread, i); fprintf(outfile, ": allocBumpPtr %10d", ctrs.counter[allocBumpPtrUsed]); fprintf(outfile, ", allocFreeList %10d", ctrs.counter[allocFreeListUsed]); fprintf(outfile, ", freeToActiveBlk %10d", ctrs.counter[freeToActiveBlock]); fprintf(outfile, ", freeToInactive %10d", ctrs.counter[freeToInactiveBlock]); fprintf(outfile, ", freedByOther %10d", ctrs.counter[freeByOtherThread]); fprintf(outfile, "\n"); } bin_counters& ctrs = statistic[thread][ThreadCommonCounters]; fprintf(outfile, "Thr%04d common counters", thread); fprintf(outfile, ": allocNewLargeObject %5d", ctrs.counter[allocNewLargeObj]); fprintf(outfile, ": allocCachedLargeObject %5d", ctrs.counter[allocCachedLargeObj]); fprintf(outfile, ", cacheLargeObject %5d", ctrs.counter[cacheLargeObj]); fprintf(outfile, ", freeLargeObject %5d", ctrs.counter[freeLargeObj]); fprintf(outfile, ", lockPublicFreeList %5d", ctrs.counter[lockPublicFreeList]); fprintf(outfile, ", freeToOtherThread %10d", ctrs.counter[freeToOtherThread]); fprintf(outfile, "\n"); fclose(outfile); } #endif
/* Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. Contributed by Richard Henderson <rth@redhat.com>. This file is part of the GNU OpenMP Library (libgomp). Libgomp 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. Libgomp 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #ifndef OMP_H #define OMP_H 1 #ifndef _LIBGOMP_OMP_LOCK_DEFINED #define _LIBGOMP_OMP_LOCK_DEFINED 1 /* These two structures get edited by the libgomp build process to reflect the shape of the two types. Their internals are private to the library. */ typedef struct { unsigned char _x[4] __attribute__((__aligned__(4))); } omp_lock_t; typedef struct { unsigned char _x[8 + sizeof (void *)] __attribute__((__aligned__(sizeof (void *)))); } omp_nest_lock_t; #endif typedef enum omp_sched_t { omp_sched_static = 1, omp_sched_dynamic = 2, omp_sched_guided = 3, omp_sched_auto = 4 } omp_sched_t; #ifdef __cplusplus extern "C" { # define __GOMP_NOTHROW throw () #else # define __GOMP_NOTHROW __attribute__((__nothrow__)) #endif extern void omp_set_num_threads (int) __GOMP_NOTHROW; extern int omp_get_num_threads (void) __GOMP_NOTHROW; extern int omp_get_max_threads (void) __GOMP_NOTHROW; extern int omp_get_thread_num (void) __GOMP_NOTHROW; extern int omp_get_num_procs (void) __GOMP_NOTHROW; extern int omp_in_parallel (void) __GOMP_NOTHROW; extern void omp_set_dynamic (int) __GOMP_NOTHROW; extern int omp_get_dynamic (void) __GOMP_NOTHROW; extern void omp_set_nested (int) __GOMP_NOTHROW; extern int omp_get_nested (void) __GOMP_NOTHROW; extern void omp_init_lock (omp_lock_t *) __GOMP_NOTHROW; extern void omp_destroy_lock (omp_lock_t *) __GOMP_NOTHROW; extern void omp_set_lock (omp_lock_t *) __GOMP_NOTHROW; extern void omp_unset_lock (omp_lock_t *) __GOMP_NOTHROW; extern int omp_test_lock (omp_lock_t *) __GOMP_NOTHROW; extern void omp_init_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; extern void omp_destroy_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; extern void omp_set_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; extern void omp_unset_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; extern int omp_test_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW; extern double omp_get_wtime (void) __GOMP_NOTHROW; extern double omp_get_wtick (void) __GOMP_NOTHROW; void omp_set_schedule (omp_sched_t, int) __GOMP_NOTHROW; void omp_get_schedule (omp_sched_t *, int *) __GOMP_NOTHROW; int omp_get_thread_limit (void) __GOMP_NOTHROW; void omp_set_max_active_levels (int) __GOMP_NOTHROW; int omp_get_max_active_levels (void) __GOMP_NOTHROW; int omp_get_level (void) __GOMP_NOTHROW; int omp_get_ancestor_thread_num (int) __GOMP_NOTHROW; int omp_get_team_size (int) __GOMP_NOTHROW; int omp_get_active_level (void) __GOMP_NOTHROW; int omp_in_final (void) __GOMP_NOTHROW; #ifdef __cplusplus } #endif #endif /* OMP_H */
#pragma once #include "envoy/http/header_map.h" #include "common/singleton/const_singleton.h" #include "extensions/filters/common/ratelimit/ratelimit.h" namespace Envoy { namespace Extensions { namespace HttpFilters { namespace RateLimitFilter { class XRateLimitHeaderValues { public: const Http::LowerCaseString XRateLimitLimit{"x-ratelimit-limit"}; const Http::LowerCaseString XRateLimitRemaining{"x-ratelimit-remaining"}; const Http::LowerCaseString XRateLimitReset{"x-ratelimit-reset"}; struct { const std::string Window{"w"}; const std::string Name{"name"}; } QuotaPolicyKeys; }; using XRateLimitHeaders = ConstSingleton<XRateLimitHeaderValues>; class XRateLimitHeaderUtils { public: static Http::ResponseHeaderMapPtr create(Filters::Common::RateLimit::DescriptorStatusListPtr&& descriptor_statuses); private: static uint32_t convertRateLimitUnit(envoy::service::ratelimit::v3::RateLimitResponse::RateLimit::Unit unit); }; } // namespace RateLimitFilter } // namespace HttpFilters } // namespace Extensions } // namespace Envoy
#pragma once // Generates hash from UNICODE_STRING. Using SDBM hashing algorithm. UINT32 GetHash(__in UNICODE_STRING *pStr); /* Sends access request to client application. pAccessData must be allocated with ExAllocatePoolWithTag or similar function. It will be freed by function. */ NTSTATUS ApRequestAccess(__in PACCESS_DATA pAccessData); // Determines is specified path is under protect. PAP_PROTECTED_ENTRY ApIsUnderProtect(__in PRTL_GENERIC_TABLE pGenericTable, __in UNICODE_STRING *pName); // Converts NTSTATUS to it's string representation. Used with DbgPrintStatus macro. PCHAR Status2String(__in NTSTATUS status);
/*------------------------------------------------------------------------- * * cdbsrlz.c * Serialize a PostgreSQL sequential plan tree. * * Portions Copyright (c) 2004-2008, Greenplum inc * Portions Copyright (c) 2012-Present Pivotal Software, Inc. * * * IDENTIFICATION * src/backend/cdb/cdbsrlz.c * *------------------------------------------------------------------------- */ #include "postgres.h" #include "cdb/cdbplan.h" #include "cdb/cdbsrlz.h" #include <math.h> #include "miscadmin.h" #include "nodes/print.h" #include "optimizer/clauses.h" #include "regex/regex.h" #include "utils/guc.h" #include "utils/memaccounting.h" #include "utils/zlib_wrapper.h" static char *compress_string(const char *src, int uncompressed_size, int *size); static char *uncompress_string(const char *src, int size, int *uncompressed_len); /* * This is used by dispatcher to serialize Plan and Query Trees for * dispatching to qExecs. * The returned string is palloc'ed in the current memory context. */ char * serializeNode(Node *node, int *size, int *uncompressed_size_out) { char *pszNode; char *sNode; int uncompressed_size; Assert(node != NULL); Assert(size != NULL); START_MEMORY_ACCOUNT(MemoryAccounting_CreateAccount(0, MEMORY_OWNER_TYPE_Serializer)); { pszNode = nodeToBinaryStringFast(node, &uncompressed_size); Assert(pszNode != NULL); if (NULL != uncompressed_size_out) { *uncompressed_size_out = uncompressed_size; } sNode = compress_string(pszNode, uncompressed_size, size); pfree(pszNode); } END_MEMORY_ACCOUNT(); return sNode; } /* * This is used on the qExecs to deserialize serialized Plan and Query Trees * received from the dispatcher. * The returned node is palloc'ed in the current memory context. */ Node * deserializeNode(const char *strNode, int size) { char *sNode; Node *node; int uncompressed_len; Assert(strNode != NULL); START_MEMORY_ACCOUNT(MemoryAccounting_CreateAccount(0, MEMORY_OWNER_TYPE_Deserializer)); { sNode = uncompress_string(strNode, size, &uncompressed_len); Assert(sNode != NULL); node = readNodeFromBinaryString(sNode, uncompressed_len); pfree(sNode); } END_MEMORY_ACCOUNT(); return node; } /* * Compress a (binary) string using zlib. * * returns the compressed data and the size of the compressed data. */ static char * compress_string(const char *src, int uncompressed_size, int *size) { int level = 3; unsigned long compressed_size; int status; Bytef *result; Assert(size != NULL); if (src == NULL) { *size = 0; return NULL; } compressed_size = gp_compressBound(uncompressed_size); /* worst case */ result = palloc(compressed_size + sizeof(int)); memcpy(result, &uncompressed_size, sizeof(int)); /* save the original length */ status = gp_compress2(result + sizeof(int), &compressed_size, (Bytef *)src, uncompressed_size, level); if (status != Z_OK) elog(ERROR,"Compression failed: %s (errno=%d) uncompressed len %d, compressed %d", zError(status), status, uncompressed_size, (int)compressed_size); *size = compressed_size + sizeof(int); return (char *)result; } /* * Uncompress the binary string */ static char * uncompress_string(const char *src, int size, int *uncompressed_len) { Bytef *result; unsigned long resultlen; int status; *uncompressed_len = 0; if (src == NULL) return NULL; Assert(size >= sizeof(int)); memcpy(uncompressed_len, src, sizeof(int)); resultlen = *uncompressed_len; result = palloc(resultlen); status = gp_uncompress(result, &resultlen, (Bytef *)(src + sizeof(int)), size - sizeof(int)); if (status != Z_OK) elog(ERROR,"Uncompress failed: %s (errno=%d compressed len %d, uncompressed %d)", zError(status), status, size, *uncompressed_len); return (char *)result; }
#pragma once #include <stdint.h> #include "object-internals.h" #include "vm/Thread.h" #include "il2cpp-config.h" struct Il2CppString; struct Il2CppThread; struct mscorlib_System_Globalization_CultureInfo; struct Il2CppDelegate; struct mscorlib_System_Threading_Thread; namespace il2cpp { namespace icalls { namespace mscorlib { namespace System { namespace Threading { class LIBIL2CPP_CODEGEN_API Thread { public: static int32_t GetDomainID (); static Il2CppThread * CurrentThread_internal (); static void ResetAbort_internal (); static void MemoryBarrier_ (); static void SpinWait_nop (); static void Abort_internal (Il2CppThread* thisPtr, Il2CppObject* stateInfo); static void ClrState (Il2CppThread* thisPtr, il2cpp::vm::ThreadState clr); static void FreeLocalSlotValues (int32_t slot, bool use_thread_local); static Il2CppObject* GetAbortExceptionState (void* /* System.Threading.Thread */ self); static mscorlib_System_Globalization_CultureInfo * GetCachedCurrentCulture (Il2CppThread* thisPtr); static mscorlib_System_Globalization_CultureInfo* GetCachedCurrentUICulture (Il2CppThread* thisPtr); static Il2CppString* GetName_internal (Il2CppThread* thisPtr); static void SetName_internal (Il2CppThread* thisPtr, Il2CppString* name); static int32_t GetNewManagedId_internal(); #if !NET_4_0 static Il2CppArray * GetSerializedCurrentCulture (Il2CppThread* thisPtr); static Il2CppArray* GetSerializedCurrentUICulture (Il2CppThread* thisPtr); #endif static il2cpp::vm::ThreadState GetState (Il2CppThread * thisPtr); static void Interrupt_internal (Il2CppThread* thisPtr); static bool Join_internal (Il2CppThread * thisPtr, int32_t ms, void* thread); static void Resume_internal (void* /* System.Threading.Thread */ self); static void SetCachedCurrentCulture (Il2CppThread *thisPtr,Il2CppObject* culture); static void SetCachedCurrentUICulture (Il2CppThread* thisPtr, Il2CppObject* culture); #if !NET_4_0 static void SetSerializedCurrentCulture (Il2CppThread* thisPtr, Il2CppArray* culture); static void SetSerializedCurrentUICulture (Il2CppThread* thisPtr, Il2CppArray* culture); #endif static void SetState (Il2CppThread * thisPtr, il2cpp::vm::ThreadState state); static void Sleep_internal (int32_t milliseconds); static void Suspend_internal (void* /* System.Threading.Thread */ self); static void Thread_init (Il2CppThread* thisPtr); static Il2CppIntPtr Thread_internal (Il2CppThread* thisPtr, Il2CppDelegate * start); static int8_t VolatileReadInt8 (volatile void* address); static int16_t VolatileReadInt16 (volatile void* address); static int32_t VolatileReadInt32 (volatile void* address); static int64_t VolatileReadInt64 (volatile void* address); static float VolatileReadFloat (volatile void* address); static double VolatileReadDouble (volatile void* address); static void* VolatileReadPtr (volatile void* address); static Il2CppIntPtr VolatileReadIntPtr(volatile void* address); static void VolatileWriteInt8 (volatile void* address, int8_t value); static void VolatileWriteInt16 (volatile void* address, int16_t value); static void VolatileWriteInt32 (volatile void* address, int32_t value); static void VolatileWriteInt64 (volatile void* address, int64_t value); static void VolatileWriteFloat (volatile void* address, float value); static void VolatileWriteDouble (volatile void* address, double value); static void VolatileWritePtr (volatile void* address, void* value); static void VolatileWriteIntPtr (volatile void* address, Il2CppIntPtr value); #if !NET_4_0 static void Thread_free_internal (Il2CppThread* thisPtr, Il2CppIntPtr handle); #endif #if NET_4_0 static Il2CppArray* ByteArrayToCurrentDomain(Il2CppArray* arr); static Il2CppArray* ByteArrayToRootDomain(Il2CppArray* arr); static bool YieldInternal(); static bool JoinInternal(Il2CppThread* _this, int32_t millisecondsTimeout); static int32_t GetPriorityNative(Il2CppThread* _this); static int32_t SystemMaxStackStize(); static Il2CppString* GetName_internal40(Il2CppInternalThread* thread); static Il2CppInternalThread* CurrentInternalThread_internal(); static int32_t GetState40(Il2CppInternalThread* thread); static void Abort_internal40(Il2CppInternalThread* thread, Il2CppObject* stateInfo); static void ClrState40(Il2CppInternalThread* thread, il2cpp::vm::ThreadState clr); static void ConstructInternalThread(Il2CppThread* _this); static void GetStackTraces(Il2CppArray** threads, Il2CppArray** stack_frames); static void InterruptInternal(Il2CppThread* _this); static void ResetAbortNative(Il2CppObject* _this); static void ResumeInternal(Il2CppObject* _this); static void SetName_internal40(Il2CppInternalThread* thread, Il2CppString* name); static void SetPriorityNative(Il2CppThread* _this, int32_t priority); static void SetState40(Il2CppInternalThread* thread, vm::ThreadState set); static void SleepInternal(int32_t millisecondsTimeout); static void SuspendInternal(Il2CppObject* _this); #endif }; } /* namespace Threading */ } /* namespace System */ } /* namespace mscorlib */ } /* namespace icalls */ } /* namespace il2cpp */
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/rekognition/Rekognition_EXPORTS.h> #include <aws/rekognition/RekognitionRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Rekognition { namespace Model { /** */ class AWS_REKOGNITION_API ListTagsForResourceRequest : public RekognitionRequest { public: ListTagsForResourceRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "ListTagsForResource"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p> Amazon Resource Name (ARN) of the model, collection, or stream processor * that contains the tags that you want a list of. </p> */ inline const Aws::String& GetResourceArn() const{ return m_resourceArn; } /** * <p> Amazon Resource Name (ARN) of the model, collection, or stream processor * that contains the tags that you want a list of. </p> */ inline bool ResourceArnHasBeenSet() const { return m_resourceArnHasBeenSet; } /** * <p> Amazon Resource Name (ARN) of the model, collection, or stream processor * that contains the tags that you want a list of. </p> */ inline void SetResourceArn(const Aws::String& value) { m_resourceArnHasBeenSet = true; m_resourceArn = value; } /** * <p> Amazon Resource Name (ARN) of the model, collection, or stream processor * that contains the tags that you want a list of. </p> */ inline void SetResourceArn(Aws::String&& value) { m_resourceArnHasBeenSet = true; m_resourceArn = std::move(value); } /** * <p> Amazon Resource Name (ARN) of the model, collection, or stream processor * that contains the tags that you want a list of. </p> */ inline void SetResourceArn(const char* value) { m_resourceArnHasBeenSet = true; m_resourceArn.assign(value); } /** * <p> Amazon Resource Name (ARN) of the model, collection, or stream processor * that contains the tags that you want a list of. </p> */ inline ListTagsForResourceRequest& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;} /** * <p> Amazon Resource Name (ARN) of the model, collection, or stream processor * that contains the tags that you want a list of. </p> */ inline ListTagsForResourceRequest& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;} /** * <p> Amazon Resource Name (ARN) of the model, collection, or stream processor * that contains the tags that you want a list of. </p> */ inline ListTagsForResourceRequest& WithResourceArn(const char* value) { SetResourceArn(value); return *this;} private: Aws::String m_resourceArn; bool m_resourceArnHasBeenSet; }; } // namespace Model } // namespace Rekognition } // namespace Aws
/* +---------------------------------------------------------------------------+ | PHP Driver for MongoDB | +---------------------------------------------------------------------------+ | Copyright 2013-2015 MongoDB, 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. | +---------------------------------------------------------------------------+ | Copyright (c) 2014-2015 MongoDB, Inc. | +---------------------------------------------------------------------------+ */ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* External libs */ #include <bson.h> #include <mongoc.h> /* PHP Core stuff */ #include <php.h> #include <php_ini.h> #include <ext/standard/info.h> #include <Zend/zend_interfaces.h> #include <ext/spl/spl_iterators.h> /* Our Compatability header */ #include "phongo_compat.h" /* Our stuffz */ #include "php_phongo.h" #include "php_bson.h" PHONGO_API zend_class_entry *php_phongo_serializable_ce; /* {{{ BSON\Serializable */ ZEND_BEGIN_ARG_INFO_EX(ai_serializable_bsonserialize, 0, 0, 0) ZEND_END_ARG_INFO(); static zend_function_entry php_phongo_serializable_me[] = { ZEND_ABSTRACT_ME(Serializable, bsonSerialize, ai_serializable_bsonserialize) PHP_FE_END }; /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(Serializable) { zend_class_entry ce; (void)type;(void)module_number; INIT_NS_CLASS_ENTRY(ce, BSON_NAMESPACE, "Serializable", php_phongo_serializable_me); php_phongo_serializable_ce = zend_register_internal_interface(&ce TSRMLS_CC); zend_class_implements(php_phongo_serializable_ce TSRMLS_CC, 1, php_phongo_type_ce); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */
// The MIT License (MIT) // // Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). // // 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. #ifndef OPENSSL_HEADER_CURVE25519_INTERNAL_H #define OPENSSL_HEADER_CURVE25519_INTERNAL_H #if defined(__cplusplus) extern "C" { #endif #include <openssl_grpc/base.h> #include "../../crypto/internal.h" #if defined(OPENSSL_ARM) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_APPLE) #define BORINGSSL_X25519_NEON // x25519_NEON is defined in asm/x25519-arm.S. void x25519_NEON(uint8_t out[32], const uint8_t scalar[32], const uint8_t point[32]); #endif #if defined(BORINGSSL_HAS_UINT128) #define BORINGSSL_CURVE25519_64BIT #endif #if defined(BORINGSSL_CURVE25519_64BIT) // fe means field element. Here the field is \Z/(2^255-19). An element t, // entries t[0]...t[4], represents the integer t[0]+2^51 t[1]+2^102 t[2]+2^153 // t[3]+2^204 t[4]. // fe limbs are bounded by 1.125*2^51. // Multiplication and carrying produce fe from fe_loose. typedef struct fe { uint64_t v[5]; } fe; // fe_loose limbs are bounded by 3.375*2^51. // Addition and subtraction produce fe_loose from (fe, fe). typedef struct fe_loose { uint64_t v[5]; } fe_loose; #else // fe means field element. Here the field is \Z/(2^255-19). An element t, // entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 // t[3]+2^102 t[4]+...+2^230 t[9]. // fe limbs are bounded by 1.125*2^26,1.125*2^25,1.125*2^26,1.125*2^25,etc. // Multiplication and carrying produce fe from fe_loose. typedef struct fe { uint32_t v[10]; } fe; // fe_loose limbs are bounded by 3.375*2^26,3.375*2^25,3.375*2^26,3.375*2^25,etc. // Addition and subtraction produce fe_loose from (fe, fe). typedef struct fe_loose { uint32_t v[10]; } fe_loose; #endif // ge means group element. // // Here the group is the set of pairs (x,y) of field elements (see fe.h) // satisfying -x^2 + y^2 = 1 + d x^2y^2 // where d = -121665/121666. // // Representations: // ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z // ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT // ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T // ge_precomp (Duif): (y+x,y-x,2dxy) typedef struct { fe X; fe Y; fe Z; } ge_p2; typedef struct { fe X; fe Y; fe Z; fe T; } ge_p3; typedef struct { fe_loose X; fe_loose Y; fe_loose Z; fe_loose T; } ge_p1p1; typedef struct { fe_loose yplusx; fe_loose yminusx; fe_loose xy2d; } ge_precomp; typedef struct { fe_loose YplusX; fe_loose YminusX; fe_loose Z; fe_loose T2d; } ge_cached; void x25519_ge_tobytes(uint8_t s[32], const ge_p2 *h); int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s); void x25519_ge_p3_to_cached(ge_cached *r, const ge_p3 *p); void x25519_ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p); void x25519_ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p); void x25519_ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); void x25519_ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); void x25519_ge_scalarmult_small_precomp( ge_p3 *h, const uint8_t a[32], const uint8_t precomp_table[15 * 2 * 32]); void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]); void x25519_ge_scalarmult(ge_p2 *r, const uint8_t *scalar, const ge_p3 *A); void x25519_sc_reduce(uint8_t s[64]); enum spake2_state_t { spake2_state_init = 0, spake2_state_msg_generated, spake2_state_key_generated, }; struct spake2_ctx_st { uint8_t private_key[32]; uint8_t my_msg[32]; uint8_t password_scalar[32]; uint8_t password_hash[64]; uint8_t *my_name; size_t my_name_len; uint8_t *their_name; size_t their_name_len; enum spake2_role_t my_role; enum spake2_state_t state; char disable_password_scalar_hack; }; #if defined(__cplusplus) } // extern C #endif #endif // OPENSSL_HEADER_CURVE25519_INTERNAL_H
/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MPEG2_TS_EXTRACTOR_H_ #define MPEG2_TS_EXTRACTOR_H_ #include <media/stagefright/foundation/ABase.h> #include <media/stagefright/MediaExtractor.h> #include <utils/threads.h> #include <utils/Vector.h> namespace android { struct AMessage; struct AnotherPacketSource; struct ATSParser; struct DataSource; struct MPEG2TSSource; struct String8; struct MPEG2TSExtractor : public MediaExtractor { MPEG2TSExtractor(const sp<DataSource> &source); virtual size_t countTracks(); virtual sp<MediaSource> getTrack(size_t index); virtual sp<MetaData> getTrackMetaData(size_t index, uint32_t flags); virtual sp<MetaData> getMetaData(); virtual uint32_t flags() const; private: friend struct MPEG2TSSource; mutable Mutex mLock; sp<DataSource> mDataSource; sp<ATSParser> mParser; Vector<sp<AnotherPacketSource> > mSourceImpls; off64_t mOffset; void init(); status_t feedMore(); DISALLOW_EVIL_CONSTRUCTORS(MPEG2TSExtractor); }; bool SniffMPEG2TS( const sp<DataSource> &source, String8 *mimeType, float *confidence, sp<AMessage> *); } // namespace android #endif // MPEG2_TS_EXTRACTOR_H_
/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Copyright (c) 2011 The FreeBSD Foundation * All rights reserved. * Portions of this software were developed by David Chisnall * under sponsorship from the FreeBSD Foundation. * * 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. * 4. Neither the name of the 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 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. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD: soc2013/dpl/head/lib/libc/locale/wcstol.c 228034 2011-11-20 14:45:42Z theraven $"); #include <ctype.h> #include <errno.h> #include <limits.h> #include <wchar.h> #include <wctype.h> #include "xlocale_private.h" /* * Convert a string to a long integer. */ long wcstol_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base, locale_t locale) { const wchar_t *s; unsigned long acc; wchar_t c; unsigned long cutoff; int neg, any, cutlim; FIX_LOCALE(locale); /* * See strtol for comments as to the logic used. */ s = nptr; do { c = *s++; } while (iswspace_l(c, locale)); if (c == '-') { neg = 1; c = *s++; } else { neg = 0; if (c == L'+') c = *s++; } if ((base == 0 || base == 16) && c == L'0' && (*s == L'x' || *s == L'X')) { c = s[1]; s += 2; base = 16; } if (base == 0) base = c == L'0' ? 8 : 10; acc = any = 0; if (base < 2 || base > 36) goto noconv; cutoff = neg ? (unsigned long)-(LONG_MIN + LONG_MAX) + LONG_MAX : LONG_MAX; cutlim = cutoff % base; cutoff /= base; for ( ; ; c = *s++) { #ifdef notyet if (iswdigit_l(c, locale)) c = digittoint_l(c, locale); else #endif if (c >= L'0' && c <= L'9') c -= L'0'; else if (c >= L'A' && c <= L'Z') c -= L'A' - 10; else if (c >= L'a' && c <= L'z') c -= L'a' - 10; else break; if (c >= base) break; if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; acc *= base; acc += c; } } if (any < 0) { acc = neg ? LONG_MIN : LONG_MAX; errno = ERANGE; } else if (!any) { noconv: errno = EINVAL; } else if (neg) acc = -acc; if (endptr != NULL) *endptr = (wchar_t *)(any ? s - 1 : nptr); return (acc); } long wcstol(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base) { return wcstol_l(nptr, endptr, base, __get_locale()); }
/*- * Copyright (c) 2005-2008 David Schultz <das@FreeBSD.ORG> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD: soc2013/dpl/head/lib/msun/src/s_cargl.c 183757 2008-10-09 02:25:18Z peter $"); #include <complex.h> #include <math.h> long double cargl(long double complex z) { return (atan2l(cimagl(z), creall(z))); }
// // CRConnection.h // Criollo // // Created by Cătălin Stan on 10/23/15. // Copyright © 2015 Cătălin Stan. All rights reserved. // #import "CRTypes.h" @class CRConnection, GCDAsyncSocket, CRServer, CRRequest, CRResponse; NS_ASSUME_NONNULL_BEGIN @protocol CRConnectionDelegate <NSObject> - (void)connection:(CRConnection *)connection didReceiveRequest:(CRRequest *)request response:(CRResponse *)response; - (void)connection:(CRConnection *)connection didFinishRequest:(CRRequest *)request response:(CRResponse *)response; @end @interface CRConnection : NSObject @property (nonatomic, weak, nullable) id<CRConnectionDelegate> delegate; @property (nonatomic, readonly) NSString* remoteAddress; @property (nonatomic, readonly) NSUInteger remotePort; @property (nonatomic, readonly) NSString* localAddress; @property (nonatomic, readonly) NSUInteger localPort; @end NS_ASSUME_NONNULL_END
#ifndef _GOJIRA_HASHMAP_H #define _GOJIRA_HASHMAP_H #include <gojira/libs/list.h> typedef struct hashmap { list_head_t *buckets; unsigned nbuckets; } hashmap_t; hashmap_t *hashmap_create( unsigned n ); void hashmap_free( hashmap_t *map ); void *hashmap_add( hashmap_t *map, unsigned hash, void *val ); void *hashmap_get( hashmap_t *map, unsigned hash ); void hashmap_remove( hashmap_t *map, unsigned hash ); unsigned hash_string( const char *str ); unsigned hash_string_accum( const char *str, unsigned hash ); #endif
/* * Copyright (c) 2013-2015, Roland Bock * 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. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef SQLPP11_DATA_TYPES_NO_VALUE_DATA_TYPE_H #define SQLPP11_DATA_TYPES_NO_VALUE_DATA_TYPE_H #include <sqlpp11/type_traits.h> namespace sqlpp { struct no_value_t { using _traits = make_traits<no_value_t>; using _cpp_value_type = void; template <typename T> using _is_valid_operand = wrong_t<T>; }; } // namespace sqlpp #endif
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // ////////////////////////////////////////////////////////////////////////// // //%///////////////////////////////////////////////////////////////////////// #include "CIMFixtureBase.h" class UNIX_MediaPresentFixture : public CIMFixtureBase { public: UNIX_MediaPresentFixture(); ~UNIX_MediaPresentFixture(); virtual void Run(); };
/* ************************************************************* Encoder driver function definitions - by James Nugen ************************************************************ */ long readEncoder(int i); void resetEncoder(int i); void resetEncoders();
///////////////////////////////////////////////////////////////////////////// // Name: samples/docview/docview.h // Purpose: Document/view demo // Author: Julian Smart // Modified by: Vadim Zeitlin: merge with the MDI version and general cleanup // Created: 04/01/98 // Copyright: (c) 1998 Julian Smart // (c) 2008 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SAMPLES_DOCVIEW_DOCVIEW_H_ #define _WX_SAMPLES_DOCVIEW_DOCVIEW_H_ #include "wx/docview.h" #include "wx/vector.h" class MyCanvas; // Define a new application class MyApp : public wxApp { public: // this sample can be launched in several different ways: enum Mode { #if wxUSE_MDI_ARCHITECTURE Mode_MDI, // MDI mode: multiple documents, single top level window #endif // wxUSE_MDI_ARCHITECTURE Mode_SDI, // SDI mode: multiple documents, multiple top level windows Mode_Single // single document mode (and hence single top level window) }; MyApp(); // override some wxApp virtual methods virtual bool OnInit() wxOVERRIDE; virtual int OnExit() wxOVERRIDE; virtual void OnInitCmdLine(wxCmdLineParser& parser) wxOVERRIDE; virtual bool OnCmdLineParsed(wxCmdLineParser& parser) wxOVERRIDE; #ifdef __WXMAC__ virtual void MacNewFile() wxOVERRIDE; #endif // __WXMAC__ // our specific methods Mode GetMode() const { return m_mode; } wxFrame *CreateChildFrame(wxView *view, bool isCanvas); // these accessors should only be called in single document mode, otherwise // the pointers are NULL and an assert is triggered MyCanvas *GetMainWindowCanvas() const { wxASSERT(m_canvas); return m_canvas; } wxMenu *GetMainWindowEditMenu() const { wxASSERT(m_menuEdit); return m_menuEdit; } private: // append the standard document-oriented menu commands to this menu void AppendDocumentFileCommands(wxMenu *menu, bool supportsPrinting); // create the edit menu for drawing documents wxMenu *CreateDrawingEditMenu(); // create and associate with the given frame the menu bar containing the // given file and edit (possibly NULL) menus as well as the standard help // one void CreateMenuBarForFrame(wxFrame *frame, wxMenu *file, wxMenu *edit); // show the about box: as we can have different frames it's more // convenient, even if somewhat less usual, to handle this in the // application object itself void OnAbout(wxCommandEvent& event); // contains the file names given on the command line, possibly empty wxVector<wxString> m_filesFromCmdLine; // the currently used mode Mode m_mode; // only used if m_mode == Mode_Single MyCanvas *m_canvas; wxMenu *m_menuEdit; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(MyApp); }; wxDECLARE_APP(MyApp); #endif // _WX_SAMPLES_DOCVIEW_DOCVIEW_H_
/* * Repast for High Performance Computing (Repast HPC) * * Copyright (c) 2010 Argonne National Laboratory * 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 Argonne National Laboratory 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 TRUSTEES 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. * * * logger.h * * Created on: * Author: nick */ #ifndef LOGGER_H_ #define LOGGER_H_ #include <string> #include <vector> #include <map> #define MAX_CONFIG_FILE_SIZE 16384 typedef enum _LogLevel {DEBUG, INFO, WARN, ERROR, FATAL} LOG_LEVEL; class Appender { public: Appender(const std::string name); virtual void write(const std::string& line) = 0; virtual void close() {} const std::string& name() const { return _name; } virtual ~Appender() = 0; protected: const std::string _name; }; class Logger { public: Logger(const std::string, LOG_LEVEL, int proc_id); void log(LOG_LEVEL, const std::string msg); void close(); void add_appender(Appender *appender); private: const std::string name; const LOG_LEVEL level; int proc_id; std::vector<Appender*> appenders; void format_msg(LOG_LEVEL level, const std::string& msg, std::string& to_format); }; class AppenderBuilder { public: AppenderBuilder(const std::string name); std::string name; std::string file_name; long max_size; int max_idx; Appender* build(); }; class Log4CL; class Log4CLConfigurator { private: void error_warn(); std::string error; int line, proc_id; std::map<std::string, AppenderBuilder*> app_map; std::map<std::string, Logger*> logger_map; // key: logger name, value: vector of appenders names for // that logger std::map<std::string, std::vector<std::string>*> logger_app_map; int parse_level(const std::string& str) const; void create_root_logger(const std::string& value); void create_logger(const std::string& key, const std::string& value); void create_named_logger(const std::string& name, const std::string& value); void create_appender(const std::string& key, const std::string& value); void create_appender_file(const std::string& key, const std::string& value); void create_appender_size(const std::string& key, const std::string& value); void create_appender_bidx(const std::string& key, const std::string& value); Log4CL* create_log4cl(); AppenderBuilder* get_appender_builder(const std::string& key); public: Log4CLConfigurator(); Log4CL* configure(const std::string& config_file, int proc_id, boost::mpi::communicator* comm = 0, int maxConfigFileSize = MAX_CONFIG_FILE_SIZE); }; class Log4CL { friend class Log4CLConfigurator; public: ~Log4CL(); static Log4CL* instance(); static void configure(int, const std::string&, boost::mpi::communicator* comm = 0, int maxConfigFileSize = MAX_CONFIG_FILE_SIZE); static void configure(int); Logger& get_logger(std::string logger_name); void close(); protected: Log4CL(int); private: static Log4CL *_instance; std::map<std::string, Logger*> logger_map; std::vector<Appender *> appenders; int proc_id; }; #endif /* LOGGER_H_ */
//===-- HostInfoPosix.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef lldb_Host_posix_HostInfoPosix_h_ #define lldb_Host_posix_HostInfoPosix_h_ #include "lldb/Host/HostInfoBase.h" #include "lldb/Utility/FileSpec.h" namespace lldb_private { class HostInfoPosix : public HostInfoBase { friend class HostInfoBase; public: static size_t GetPageSize(); static bool GetHostname(std::string &s); static const char *LookupUserName(uint32_t uid, std::string &user_name); static const char *LookupGroupName(uint32_t gid, std::string &group_name); static uint32_t GetUserID(); static uint32_t GetGroupID(); static uint32_t GetEffectiveUserID(); static uint32_t GetEffectiveGroupID(); static FileSpec GetDefaultShell(); static bool GetEnvironmentVar(const std::string &var_name, std::string &var); static bool ComputePathRelativeToLibrary(FileSpec &file_spec, llvm::StringRef dir); protected: static bool ComputeSupportExeDirectory(FileSpec &file_spec); static bool ComputeHeaderDirectory(FileSpec &file_spec); }; } #endif
// 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 UI_OZONE_PLATFORM_DRM_GPU_DRM_SURFACE_H_ #define UI_OZONE_PLATFORM_DRM_GPU_DRM_SURFACE_H_ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/skia_util.h" #include "ui/gfx/swap_result.h" #include "ui/ozone/ozone_export.h" #include "ui/ozone/public/surface_ozone_canvas.h" class SkImage; class SkSurface; namespace ui { class DrmBuffer; class DrmWindow; class HardwareDisplayController; class OZONE_EXPORT DrmSurface : public SurfaceOzoneCanvas { public: DrmSurface(DrmWindow* window_delegate); ~DrmSurface() override; // SurfaceOzoneCanvas: skia::RefPtr<SkSurface> GetSurface() override; void ResizeCanvas(const gfx::Size& viewport_size) override; void PresentCanvas(const gfx::Rect& damage) override; scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override; private: void SchedulePageFlip(); // Callback for SchedulePageFlip(). This will signal when the page flip event // has completed. void OnPageFlip(gfx::SwapResult result); DrmWindow* window_delegate_; // The actual buffers used for painting. scoped_refptr<DrmBuffer> front_buffer_; scoped_refptr<DrmBuffer> back_buffer_; skia::RefPtr<SkSurface> surface_; gfx::Rect last_damage_; // Keep track of the requested image and damage for the last presentation. // This will be used to update the scanout buffers once the previous page flip // events completes. skia::RefPtr<SkImage> pending_image_; gfx::Rect pending_image_damage_; bool pending_pageflip_ = false; base::WeakPtrFactory<DrmSurface> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(DrmSurface); }; } // namespace ui #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_SURFACE_H_