text
stringlengths
4
6.14k
/************************************************************************ * Senior Design Project - PEOS Virtual Repository * * Author : TASK4ONE * * Filename : vrepo.h * ************************************************************************/ /************************************************************************ * Description: Contains function declarations for vrepo.c * ************************************************************************/ void query_wait( char *toParse, void (*cback)(int, resultList *, void *), void *d ) ; void poll_vr( ) ;
// // BoxSDKTests.h // BoxSDKTests // // Created on 2/19/13. // Copyright (c) 2013 Box. All rights reserved. // #import <SenTestingKit/SenTestingKit.h> @class BoxSDK; @interface BoxSDKTests : SenTestCase { BoxSDK *SDK; } @end
#ifndef _MATCH_CSTRING_H #define _MATCH_CSTRING_H #include "ASTUtility.h" namespace ProgrammingLanguage { using namespace clang::ast_matchers; //a means array, p means pointer //match char* extern DeclarationMatcher charPointerMatcherPL; //match char[] extern DeclarationMatcher charArrayMatcherPL; //match char *array[] extern DeclarationMatcher arrayOfCharPointerMatcherPL; //match char **array extern DeclarationMatcher charPtrPtrMatcherPL; class CharPointerPrinter : public MatchFinder::MatchCallback { public: virtual void run(const MatchFinder::MatchResult &Result); }; } #endif
// // AppDelegate.h // RESTEasy // // Created by Alex on 11/22/14. // Copyright (c) 2014 Conditionally Convergent. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
//--------------------------------------------------------------------------- // Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, 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 DALLAS SEMICONDUCTOR 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. // // Except as contained in this notice, the name of Dallas Semiconductor // shall not be used except as stated in the Dallas Semiconductor // Branding Policy. //--------------------------------------------------------------------------- // // cnt1D.h - Header Module to read the DS2423 - counter. // // Version: 2.00 // // exportable functions defined in cnt1d.c SMALLINT ReadCounter(int,uchar *,int,ulong *); // family codes of devices #define COUNT_FAMILY 0x1D
// // LDAgreementsViewController.h // PLLivingDemo // // Created by TaoZeyu on 16/7/27. // Copyright © 2016年 com.pili-engineering. All rights reserved. // #import <UIKit/UIKit.h> @interface LDAgreementsViewController : UIViewController @end
// // JBChartTableCell.h // JBChartViewDemo // // Created by Terry Worona on 11/8/13. // Copyright (c) 2013 Jawbone. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, JBChartTableCellType){ JBChartTableCellTypeLineChart, JBChartTableCellTypeBarChart }; @interface JBChartTableCell : UITableViewCell @property (nonatomic, assign) JBChartTableCellType type; @end
/* ** xdup2.c for 42sh in /u/all/jorge_d/cu/svn/42shsvn/trunk/lib ** ** Made by dimitri jorge ** Login <jorge_d@epitech.net> ** ** Started on Sun May 23 16:06:44 2010 dimitri jorge ** Last update Sun May 23 16:06:45 2010 dimitri jorge */ #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include "lib.h" int xdup2(int oldd, int newd) { if (dup2(oldd, newd) == -1) { perror("Error in dup2() : "); return (-1); } return (EXIT_SUCCESS); }
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org Copyright (c) 2000-2013 Torus Knot Software Ltd 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 _ShaderProgramWriterGLSLES_ #define _ShaderProgramWriterGLSLES_ #include "OgreShaderProgramWriterManager.h" namespace Ogre { namespace RTShader { /** \addtogroup Core * @{ */ /** \addtogroup RTShader * @{ */ /** GLSL ES target language writer implementation. @see ProgramWriter. */ class GLSLESProgramWriter : public ProgramWriter { // Interface. public: /** Class constructor. */ GLSLESProgramWriter (); /** Class destructor */ virtual ~GLSLESProgramWriter (); /** @see ProgramWriter::writeSourceCode. */ virtual void writeSourceCode (std::ostream& os, Program* program); /** @see ProgramWriter::getTargetLanguage. */ virtual const String& getTargetLanguage () const { return TargetLanguage; } static String TargetLanguage; protected: typedef map<GpuConstantType, const char*>::type GpuConstTypeToStringMap; typedef map<Parameter::Semantic, const char*>::type ParamSemanticToStringMap; typedef map<Parameter::Content, const char*> ::type ParamContentToStringMap; typedef map<String, String>::type StringMap; typedef map<FunctionInvocation, String>::type FunctionMap; typedef vector<FunctionInvocation>::type FunctionVector; typedef FunctionMap::const_iterator FunctionMapIterator; typedef FunctionVector::const_iterator FunctionVectorIterator; typedef GpuConstTypeToStringMap::const_iterator GpuConstTypeToStringMapIterator; // Protected methods. protected: /** Initialize string maps. */ void initializeStringMaps (); /** Cache functions of a dependency */ virtual void cacheDependencyFunctions(const String & libName); /** Create a FunctionInvocation object from a string taken out of a shader library. */ FunctionInvocation *createInvocationFromString (const String & input); /** Write the program dependencies. */ void writeProgramDependencies (std::ostream& os, Program* program); /** Write a local parameter. */ void writeLocalParameter (std::ostream& os, ParameterPtr parameter); /** Write the input params of the function */ void writeInputParameters (std::ostream& os, Function* function, GpuProgramType gpuType); /** Write the output params of the function */ void writeOutParameters (std::ostream& os, Function* function, GpuProgramType gpuType); String processOperand(Operand op, GpuProgramType gpuType); /** Check if a string matches one of the GLSL ES basic types */ bool isBasicType(String &type); /** Search within a function body for non-builtin functions that a given function invocation depends on. */ void discoverFunctionDependencies(const FunctionInvocation &invoc, FunctionVector &depVector); // Attributes. protected: GpuConstTypeToStringMap mGpuConstTypeMap; // Map between GPU constant type to string value. ParamSemanticToStringMap mParamSemanticMap; // Map between parameter semantic to string value. StringMap mInputToGLStatesMap; // Map parameter name to a new parameter name (sometimes renaming is required to match names between vertex and fragment shader) FunctionMap mFunctionCacheMap; // Map function invocation to body. Used as a cache to reduce library file reads and for inlining StringMap mDefinesMap; // Map of #defines and the function library that contains them ParamContentToStringMap mContentToPerVertexAttributes; // Map parameter content to vertex attributes int mGLSLVersion; // Holds the current glsl es version StringVector mFragInputParams; // Holds the fragment input params StringMap mCachedFunctionLibraries; // Holds the cached function libraries }; /** GLSL ES program writer factory implementation. @see ProgramWriterFactory */ class ShaderProgramWriterGLSLESFactory : public ProgramWriterFactory { public: ShaderProgramWriterGLSLESFactory() { mLanguage = "glsles"; } virtual ~ShaderProgramWriterGLSLESFactory() {} /** @see ProgramWriterFactory::getTargetLanguage */ virtual const String& getTargetLanguage(void) const { return mLanguage; } /** @see ProgramWriterFactory::create */ virtual ProgramWriter* create(void) { return OGRE_NEW GLSLESProgramWriter(); } private: String mLanguage; }; /** @} */ /** @} */ } } #endif
#ifndef __KONSTRUKT_LUA_BINDINGS_IMAGE__ #define __KONSTRUKT_LUA_BINDINGS_IMAGE__ struct lua_State; struct Image; Image* GetImageFromLua( lua_State* l, int stackPosition ); Image* CheckImageFromLua( lua_State* l, int stackPosition ); void RegisterImageInLua(); #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 "UNIX_SecurityServiceForSystem.h" #define UNIX_PROVIDER UNIX_SecurityServiceForSystemProvider #define CLASS_IMPLEMENTATION UNIX_SecurityServiceForSystem #define CLASS_IMPLEMENTATION_NAME "UNIX_SecurityServiceForSystem" #define BASE_CLASS_NAME "CIM_SecurityServiceForSystem" #define NUMKEYS_CLASS_IMPLEMENTATION 0 #include "UNIXProviderBase.h" #undef UNIX_PROVIDER #undef CLASS_IMPLEMENTATION #undef CLASS_IMPLEMENTATION_NAME #undef BASE_CLASS_NAME #undef NUMKEYS_CLASS_IMPLEMENTATION
/****************************************************************************/ // Hardware: Grove - I2C Color Sensor // Arduino IDE: Arduino-1.6 // // Refactored version of the library by FrankieChu - www.seeedstudio.com // /******************************************************************************/ #ifndef GROVECOLORSENSOR #define GROVECOLORSENSOR #if defined(ARDUINO) && ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif #include "Registers.h" class GroveColorSensor { public: // Color Sensor LED Status int ledStatus; // Default constructor GroveColorSensor(); // Constructor with parameters GroveColorSensor( const int& triggerMode , const int& interruptSource , const int& interruptMode , const int& gainAndPrescaler , const int& sensorAddress); void readRGB(); void readRGB(int *red, int *green, int *blue); void calculateCoordinate(); void clearInterrupt(); private: // Set trigger mode. Including free mode, manually mode, single synchronization mode or so. void setTimingReg(); // Set interrupt source void setInterruptSourceReg(); // Set interrupt mode void setInterruptControlReg(); // Set gain value and pre-scaler value void setGain(); // Start ADC of the colour sensor void setEnableADC(); // Used for storing the colour data int readingdata_[8]; int green_; int red_; int blue_; int clear_; int triggerMode_; int interruptSource_; int interruptMode_; int gainAndPrescaler_; int sensorAddress_; }; #endif
// // TBActorOperation+Supervision.h // ActorKitSupervision // // Created by Julian Krumow on 15.12.15. // Copyright (c) 2015 Julian Krumow. All rights reserved. // #import <ActorKit/ActorKit.h> NS_ASSUME_NONNULL_BEGIN /** * This category extends TBActorOperation with methods specific to supervision. */ @interface TBActorOperation (Supervision) /** * Handles the crash of an invocation. Returns `YES` if the exception could be handled which means that: * * - the invocation target responds to the selector of the `supervisor` getter method * - the invocation target's `supervisor` property is not nil OR * - the invocation target pool's `supervisor` property is not nil * * @param exception The exceptioin to handle. * @param invocation The invocation which caused the crash. * * @return `YES` if the exception could be handled. */ - (BOOL)tbak_handleCrash:(NSException *)exception forInvocation:(NSInvocation *)invocation; @end NS_ASSUME_NONNULL_END
/*! \file $Id: WinRobotService.h 94 2011-10-08 15:36:05Z caoym $ * \author caoym * \brief CWinRobotService */ #pragma once #include "resource.h" #include "WinRobotCore_i.h" #include "sync/cslock.h" #include <map> #include "reference/IReference.h" //! manager WinRobot sessions /* run as a Windows service,while GetActiveConsoleSession is called ,create a child process on active console session(if the child process specified does not exist) */ class /*ATL_NO_VTABLE*/ CWinRobotService : public CComObjectRootEx<CComMultiThreadModel>, public CComCoClass<CWinRobotService, &CLSID_WinRobotService>, public IConnectionPointContainerImpl<CWinRobotService>, public IDispatchImpl<IWinRobotService, &IID_IWinRobotService, &LIBID_WinRobotCoreLib, /*wMajor =*/ 1, /*wMinor =*/ 0> { public: CWinRobotService() :m_hNewReg(0) ,m_hExit(0) { } DECLARE_REGISTRY_RESOURCEID(IDR_WINROBOTSERVICE) BEGIN_COM_MAP(CWinRobotService) COM_INTERFACE_ENTRY(IWinRobotService) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(IConnectionPointContainer) END_COM_MAP() BEGIN_CONNECTION_POINT_MAP(CWinRobotService) END_CONNECTION_POINT_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct(); void FinalRelease(); public: //! receive the session currently attached to the physical console STDMETHOD(GetActiveConsoleSession)(IUnknown** ppSession); //! register WinRobot session /*! called by WinRobotSession when it starts. \param sid session id \param pSession point to IWinRobotSession \param processid id of the WinRobotSession process */ STDMETHOD(RegSession)(ULONG sid, ULONG processid,IUnknown* pSession); private: struct SESSION { HANDLE m_hProcess; CComPtr<IWinRobotSession> pSession; SESSION(HANDLE hd = 0) :m_hProcess(hd){ } ~SESSION(){ if(m_hProcess){ CloseHandle(m_hProcess); } } bool IsOK() { if(m_hProcess == 0) return false; return WaitForSingleObject(m_hProcess,0) == WAIT_TIMEOUT; } }; typedef std::map<ULONG , CRefObj< CReference_T<SESSION> > > SESSIONS; CCrtSection m_csLock; // lock for GetActiveConsoleSession CCrtSection m_csLockSessions; //lock for m_sessions SESSIONS m_sessions; HANDLE m_hNewReg; //signed when new session registered HANDLE m_hExit;// signed when stop HANDLE CreateChildProcess(ULONG sid); }; OBJECT_ENTRY_AUTO(__uuidof(WinRobotService), CWinRobotService)
#include "RedBlackTree.c"
/* * Generated by class-dump 3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. */ #import "NSObject.h" @class NSString; @interface IDEInspectorTextEnumerationOption : NSObject { BOOL _hidden; NSString *_title; id _value; } - (void).cxx_destruct; - (id)initWithXMLElement:(id)arg1 targettingInspectorProperty:(id)arg2; @property(readonly, getter=isHidden) BOOL hidden; // @synthesize hidden=_hidden; @property(readonly) NSString *title; // @synthesize title=_title; @property(readonly) id value; // @synthesize value=_value; @end
// // UIViewController+ELNUtils.h // e-legion // // Created by Dmitry Nesterenko on 09.10.15. // Copyright © 2015 e-legion. All rights reserved. // @import UIKit; NS_ASSUME_NONNULL_BEGIN @interface UIViewController (ELNUtils) /** Adds self as child view controller with specified view block. You must layout and attach subviews by yourself in `viewLoadBlock`. */ - (void)eln_addChildViewController:(UIViewController *)viewController viewLoadBlock:(void (^ _Nullable)())viewLoadBlock; /// Removes self view controller from parent view controller in containment hierarchy. - (void)eln_removeFromParentViewController; /// Interactive transition selection cleaner for UITableView and UICollectionView instances. - (void)eln_clearSelectionOnViewWillAppearForView:(__kindof UIScrollView *)view; /// Interactive transition completion handler. - (void)eln_performTransitionCompletionHandlerWithBlock:(void (^)(BOOL cancelled))completion; - (CGFloat)eln_topLayoutGuideLength; @end NS_ASSUME_NONNULL_END
// Copyright (C) 2016-2021 Yixuan Qiu <yixuan.qiu@cos.name> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at https://mozilla.org/MPL/2.0/. #ifndef SPECTRA_DENSE_CHOLESKY_H #define SPECTRA_DENSE_CHOLESKY_H #include <Eigen/Core> #include <Eigen/Cholesky> #include <stdexcept> #include "../Util/CompInfo.h" namespace Spectra { /// /// \ingroup MatOp /// /// This class defines the operations related to Cholesky decomposition on a /// positive definite matrix, \f$B=LL'\f$, where \f$L\f$ is a lower triangular /// matrix. It is mainly used in the SymGEigsSolver generalized eigen solver /// in the Cholesky decomposition mode. /// /// \tparam Scalar_ The element type of the matrix, for example, /// `float`, `double`, and `long double`. /// \tparam Uplo Either `Eigen::Lower` or `Eigen::Upper`, indicating which /// triangular part of the matrix is used. /// \tparam Flags Either `Eigen::ColMajor` or `Eigen::RowMajor`, indicating /// the storage format of the input matrix. /// template <typename Scalar_, int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor> class DenseCholesky { public: /// /// Element type of the matrix. /// using Scalar = Scalar_; private: using Index = Eigen::Index; using Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Flags>; using Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>; using MapConstVec = Eigen::Map<const Vector>; using MapVec = Eigen::Map<Vector>; const Index m_n; Eigen::LLT<Matrix, Uplo> m_decomp; CompInfo m_info; // status of the decomposition public: /// /// Constructor to create the matrix operation object. /// /// \param mat An **Eigen** matrix object, whose type can be /// `Eigen::Matrix<Scalar, ...>` (e.g. `Eigen::MatrixXd` and /// `Eigen::MatrixXf`), or its mapped version /// (e.g. `Eigen::Map<Eigen::MatrixXd>`). /// template <typename Derived> DenseCholesky(const Eigen::MatrixBase<Derived>& mat) : m_n(mat.rows()), m_info(CompInfo::NotComputed) { static_assert( static_cast<int>(Derived::PlainObject::IsRowMajor) == static_cast<int>(Matrix::IsRowMajor), "DenseCholesky: the \"Flags\" template parameter does not match the input matrix (Eigen::ColMajor/Eigen::RowMajor)"); if (m_n != mat.cols()) throw std::invalid_argument("DenseCholesky: matrix must be square"); m_decomp.compute(mat); m_info = (m_decomp.info() == Eigen::Success) ? CompInfo::Successful : CompInfo::NumericalIssue; } /// /// Returns the number of rows of the underlying matrix. /// Index rows() const { return m_n; } /// /// Returns the number of columns of the underlying matrix. /// Index cols() const { return m_n; } /// /// Returns the status of the computation. /// The full list of enumeration values can be found in \ref Enumerations. /// CompInfo info() const { return m_info; } /// /// Performs the lower triangular solving operation \f$y=L^{-1}x\f$. /// /// \param x_in Pointer to the \f$x\f$ vector. /// \param y_out Pointer to the \f$y\f$ vector. /// // y_out = inv(L) * x_in void lower_triangular_solve(const Scalar* x_in, Scalar* y_out) const { MapConstVec x(x_in, m_n); MapVec y(y_out, m_n); y.noalias() = m_decomp.matrixL().solve(x); } /// /// Performs the upper triangular solving operation \f$y=(L')^{-1}x\f$. /// /// \param x_in Pointer to the \f$x\f$ vector. /// \param y_out Pointer to the \f$y\f$ vector. /// // y_out = inv(L') * x_in void upper_triangular_solve(const Scalar* x_in, Scalar* y_out) const { MapConstVec x(x_in, m_n); MapVec y(y_out, m_n); y.noalias() = m_decomp.matrixU().solve(x); } }; } // namespace Spectra #endif // SPECTRA_DENSE_CHOLESKY_H
#include <stdio.h> #include <stdlib.h> int is_prime(int n) { int c,i; i=2; c=1; while(i<n) { if (n%i==0) { c=0; } i++; } if (n<=0) { c=-1; } return c; } int main() { int n,c; scanf("%d",&n); c=is_prime(n); printf("%d\n",c); return 0; }
/** * \file * * \brief IO related functionality declaration. * * Copyright (C) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * 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 * EXPRESSLY AND SPECIFICALLY 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. * * \asf_license_stop * */ #ifndef _HAL_IO_INCLUDED #define _HAL_IO_INCLUDED /** * \addtogroup io HAL IO driver * * \section io_rev Revision History * - v1.0.0 Initial Release * *@{ */ #include <compiler.h> #ifdef __cplusplus extern "C" { #endif /** * \brief IO descriptor * * The IO descriptor forward declaration. */ struct io_descriptor; /** * \brief IO write function pointer type */ typedef int32_t (* io_write_t)(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length); /** * \brief IO read function pointer type */ typedef int32_t (* io_read_t)(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length); /** * \brief IO descriptor */ struct io_descriptor { io_write_t write; /*! The write function pointer. */ io_read_t read; /*! The read function pointer. */ }; /** * \brief IO write interface * * This function write up to \p length of bytes to a given IO descriptor, * It returns the number of bytes actually write. * * \param[in] descr An IO descriptor to write * \param[in] buf The buffer pointer to story the write data * \param[in] length number of bytes to write * * \return number of bytes written */ int32_t io_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length); /** * \brief IO read interface * * This function reads up to \p length bytes from a given IO descriptor, and * story it in the buffer pointed to by \p buf. It returns the number of bytes * actually read. * * \param[in] descr An IO descriptor to read * \param[in] buf The buffer pointer to story the read data * \param[in] length number of bytes to read * * \return number of bytes actually read */ int32_t io_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length); #ifdef __cplusplus } #endif /**@}*/ #endif /* _HAL_IO_INCLUDED */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to rpmMD5Init, call rpmMD5Update as * needed on buffers full of bytes, and then call rpmMD5Final, which * will fill a supplied 16-byte array with the digest. */ /* parts of this file are : * Written March 1993 by Branko Lankester * Modified June 1993 by Colin Plumb for altered md5.c. * Modified October 1995 by Erik Troan for RPM */ #ifndef __MONO_DIGEST_H__ #define __MONO_DIGEST_H__ #include <config.h> #include <glib.h> #include <mono/utils/mono-publib.h> G_BEGIN_DECLS #if HAVE_COMMONCRYPTO_COMMONDIGEST_H #include <CommonCrypto/CommonDigest.h> #define MonoSHA1Context CC_SHA1_CTX #define MonoMD5Context CC_MD5_CTX #else typedef struct { guint32 buf[4]; guint32 bits[2]; guchar in[64]; gint doByteReverse; } MonoMD5Context; #endif MONO_API void mono_md5_get_digest (const guchar *buffer, gint buffer_size, guchar digest[16]); /* use this one when speed is needed */ /* for use in provider code only */ MONO_API void mono_md5_get_digest_from_file (const gchar *filename, guchar digest[16]); /* raw routines */ MONO_API void mono_md5_init (MonoMD5Context *ctx); MONO_API void mono_md5_update (MonoMD5Context *ctx, const guchar *buf, guint32 len); MONO_API void mono_md5_final (MonoMD5Context *ctx, guchar digest[16]); #if !HAVE_COMMONCRYPTO_COMMONDIGEST_H typedef struct { guint32 state[5]; guint32 count[2]; unsigned char buffer[64]; } MonoSHA1Context; #endif MONO_API void mono_sha1_get_digest (const guchar *buffer, gint buffer_size, guchar digest [20]); MONO_API void mono_sha1_get_digest_from_file (const gchar *filename, guchar digest [20]); MONO_API void mono_sha1_init (MonoSHA1Context* context); MONO_API void mono_sha1_update (MonoSHA1Context* context, const guchar* data, guint32 len); MONO_API void mono_sha1_final (MonoSHA1Context* context, unsigned char digest[20]); MONO_API void mono_digest_get_public_token (guchar* token, const guchar *pubkey, guint32 len); G_END_DECLS #endif /* __MONO_DIGEST_H__ */
#include "plumber.h" int sporth_bal(sporth_stack *stack, void *ud) { plumber_data *pd = ud; SPFLOAT sig; SPFLOAT comp; SPFLOAT out; sp_bal *bal; switch(pd->mode) { case PLUMBER_CREATE: #ifdef DEBUG_MODE fprintf(stderr, "bal: Creating\n"); #endif sp_bal_create(&bal); plumber_add_ugen(pd, SPORTH_BAL, bal); if(sporth_check_args(stack, "ff") != SPORTH_OK) { fprintf(stderr,"Not enough arguments for bal\n"); stack->error++; return PLUMBER_NOTOK; } sig = sporth_stack_pop_float(stack); comp = sporth_stack_pop_float(stack); sporth_stack_push_float(stack, 0); break; case PLUMBER_INIT: #ifdef DEBUG_MODE fprintf(stderr, "bal: Initialising\n"); #endif sig = sporth_stack_pop_float(stack); comp = sporth_stack_pop_float(stack); bal = pd->last->ud; sp_bal_init(pd->sp, bal); sporth_stack_push_float(stack, 0); break; case PLUMBER_COMPUTE: sig = sporth_stack_pop_float(stack); comp = sporth_stack_pop_float(stack); bal = pd->last->ud; sp_bal_compute(pd->sp, bal, &sig, &comp, &out); sporth_stack_push_float(stack, out); break; case PLUMBER_DESTROY: bal = pd->last->ud; sp_bal_destroy(&bal); break; default: fprintf(stderr, "bal: Unknown mode!\n"); break; } return PLUMBER_OK; }
#ifndef RCR_GEOVIS_UPDATEABLE_H #define RCR_GEOVIS_UPDATEABLE_H namespace rcr { namespace geovis { // Use this interface when class instances must be constantly updated. // This is a workaround for the lack of (reliable) support of threading // on embedded architectures. class Updateable { public: // Do this every time in loop(); virtual void Update() = 0; virtual ~Updateable(); }; } // namespace geovis } // namespace rcr #endif // RCR_GEOVIS_UPDATEABLE_H
#include <stdio.h> #include <stdlib.h> #include <limits.h> typedef struct TreeNode{ int value; struct TreeNode *leftChild; struct TreeNode *rightChild; }*BinarySearchTree, TreeNode; BinarySearchTree makeEmpty(BinarySearchTree T); TreeNode* findValueInTree(int value, BinarySearchTree T); TreeNode* findMinInTree(BinarySearchTree T); TreeNode* findMaxInTree(BinarySearchTree T); TreeNode* insertValueIntoTree(int value, BinarySearchTree *T); BinarySearchTree deleteValueFromTree(int value, BinarySearchTree T);
/** * @file adin_mic_linux.c * * <JA> * @brief ¥Þ¥¤¥¯ÆþÎÏ (Linux) - ¥Ç¥Õ¥©¥ë¥È¥Ç¥Ð¥¤¥¹ * * ¥Þ¥¤¥¯ÆþÎϤΤ¿¤á¤ÎÄã¥ì¥Ù¥ë´Ø¿ô¤Ç¤¹¡¥ * ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÌÀ¼¨»ØÄꤷ¤Ê¤¤ (-input mic) ¾ì¹ç¤Ë¸Æ¤Ð¤ì¤Þ¤¹¡¥ * ALSA, PulesAudio, OSS, ESD ¤Î½ç¤ÇºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿¤â¤Î¤¬»ÈÍѤµ¤ì¤Þ¤¹¡¥ * ¤½¤ì¤¾¤ì¤Î API ¤òÌÀ¼¨Åª¤Ë»ØÄꤷ¤¿¤¤¾ì¹ç¤Ï "-input" ¤Ë¤½¤ì¤¾¤ì * "alsa", "oss", "pulseaudio", "esd" ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£ * </JA> * <EN> * @brief Microphone input on Linux - default device * * Low level I/O functions for microphone input on Linux. * This will be called when no device was explicitly specified ("-input mic"). * ALSA, PulseAudio, OSS, ESD will be chosen in this order at compilation time. * "-input alsa", "-input oss", "-input pulseaudio" or "-input esd" to * specify which API to use. * </EN> * * @author Akinobu LEE * @date Sun Feb 13 16:18:26 2005 * * $Revision: 1.8 $ * */ /* * Copyright (c) 1991-2012 Kawahara Lab., Kyoto University * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology * Copyright (c) 2005-2012 Julius project team, Nagoya Institute of Technology * All rights reserved */ #include <sent/stddefs.h> #include <sent/adin.h> /** * Device initialization: check device capability and open for recording. * * @param sfreq [in] required sampling frequency. * @param dummy [in] a dummy data * * @return TRUE on success, FALSE on failure. */ boolean adin_mic_standby(int sfreq, void *dummy) { #if defined(HAS_ALSA) return(adin_alsa_standby(sfreq, dummy)); #elif defined(HAS_OSS) return(adin_oss_standby(sfreq, dummy)); #elif defined(HAS_PULSEAUDIO) return(adin_pulseaudio_standby(sfreq, dummy)); #elif defined(HAS_ESD) return(adin_esd_standby(sfreq, dummy)); #else /* other than Linux */ jlog("Error: neither of pulseaudio/alsa/oss/esd device is available\n"); return FALSE; #endif } /** * Start recording. * * @param pathname [in] path name to open or NULL for default * * @return TRUE on success, FALSE on failure. */ boolean adin_mic_begin(char *pathname) { #if defined(HAS_ALSA) return(adin_alsa_begin(pathname)); #elif defined(HAS_OSS) return(adin_oss_begin(pathname)); #elif defined(HAS_PULSEAUDIO) return(adin_pulseaudio_begin(pathname)); #elif defined(HAS_ESD) return(adin_esd_begin(pathname)); #else /* other than Linux */ jlog("Error: neither of pulseaudio/alsa/oss/esd device is available\n"); return FALSE; #endif } /** * Stop recording. * * @return TRUE on success, FALSE on failure. */ boolean adin_mic_end() { #if defined(HAS_ALSA) return(adin_alsa_end()); #elif defined(HAS_OSS) return(adin_oss_end()); #elif defined(HAS_PULSEAUDIO) return(adin_pulseaudio_end()); #elif defined(HAS_ESD) return(adin_esd_end()); #else /* other than Linux */ jlog("Error: neither of pulseaudio/alsa/oss/esd device is available\n"); return FALSE; #endif } /** * @brief Read samples from device * * Try to read @a sampnum samples and returns actual number of recorded * samples currently available. This function will block until * at least one sample can be obtained. * * @param buf [out] samples obtained in this function * @param sampnum [in] wanted number of samples to be read * * @return actural number of read samples, -2 if an error occured. */ int adin_mic_read(SP16 *buf, int sampnum) { #if defined(HAS_ALSA) return(adin_alsa_read(buf, sampnum)); #elif defined(HAS_OSS) return(adin_oss_read(buf, sampnum)); #elif defined(HAS_PULSEAUDIO) return(adin_pulseaudio_read(buf, sampnum)); #elif defined(HAS_ESD) return(adin_esd_read(buf, sampnum)); #else /* other than Linux */ jlog("Error: neither of pulseaudio/alsa/oss/esd device is available\n"); return -2; #endif } /** * * Function to return current input source device name * * @return string of current input device name. * */ char * adin_mic_input_name() { #if defined(HAS_ALSA) return(adin_alsa_input_name()); #elif defined(HAS_OSS) return(adin_oss_input_name()); #elif defined(HAS_PULSEAUDIO) return(adin_pulseaudio_input_name()); #elif defined(HAS_ESD) return(adin_esd_input_name()); #else /* other than Linux */ return("Error: neither of pulseaudio/alsa/oss/esd device is available\n"); #endif }
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> #include "noise/module/Wrapper.h" namespace spotify { namespace json { template<> struct default_codec_t<noise::module::Wrapper<noise::module::Clamp>> { using ClampWrapper = noise::module::Wrapper<noise::module::Clamp>; static codec::object_t<ClampWrapper> codec(); }; } }
#pragma once #include "lpg_value.h" typedef struct generic_enum_instantiation { generic_enum_id generic; type *argument_types; value *arguments; size_t argument_count; enum_id instantiated; } generic_enum_instantiation; generic_enum_instantiation generic_enum_instantiation_create(generic_enum_id generic, type *argument_types, value *arguments, size_t argument_count, enum_id instantiated); void generic_enum_instantiation_free(generic_enum_instantiation const freed);
#ifndef GUIUTIL_H #define GUIUTIL_H #include <QString> #include <QObject> #include <QMessageBox> QT_BEGIN_NAMESPACE class QFont; class QLineEdit; class QWidget; class QDateTime; class QUrl; class QAbstractItemView; QT_END_NAMESPACE class SendCoinsRecipient; /** Utility functions used by the BusinessCoin Qt UI. */ namespace GUIUtil { // Create human-readable string from date QString dateTimeStr(const QDateTime &datetime); QString dateTimeStr(qint64 nTime); // Render BusinessCoin addresses in monospace font QFont bitcoinAddressFont(); // Set up widgets for address and amounts void setupAddressWidget(QLineEdit *widget, QWidget *parent); void setupAmountWidget(QLineEdit *widget, QWidget *parent); // Parse "businesscoin:" URI into recipient object, return true on succesful parsing // See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0 bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out); bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); // HTML escaping for rich text controls QString HtmlEscape(const QString& str, bool fMultiLine=false); QString HtmlEscape(const std::string& str, bool fMultiLine=false); /** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing is selected. @param[in] column Data column to extract from the model @param[in] role Data role to extract from the model @see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress */ void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole); /** Get save file name, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user. @param[in] parent Parent window (or 0) @param[in] caption Window caption (or empty, for default) @param[in] dir Starting directory (or empty, to default to documents directory) @param[in] filter Filter specification such as "Comma Separated Files (*.csv)" @param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0). Can be useful when choosing the save file format based on suffix. */ QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedSuffixOut=0); /** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking. @returns If called from the GUI thread, return a Qt::DirectConnection. If called from another thread, return a Qt::BlockingQueuedConnection. */ Qt::ConnectionType blockingGUIThreadConnection(); // Determine whether a widget is hidden behind other windows bool isObscured(QWidget *w); // Open debug.log void openDebugLogfile(); /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. */ class ToolTipToRichTextFilter : public QObject { Q_OBJECT public: explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0); protected: bool eventFilter(QObject *obj, QEvent *evt); private: int size_threshold; }; bool GetStartOnSystemStartup(); bool SetStartOnSystemStartup(bool fAutoStart); /** Help message for BusinessCoin-Qt, shown with --help. */ class HelpMessageBox : public QMessageBox { Q_OBJECT public: HelpMessageBox(QWidget *parent = 0); /** Show message box or print help message to standard output, based on operating system. */ void showOrPrint(); /** Print help message to console */ void printToConsole(); private: QString header; QString coreOptions; QString uiOptions; }; } // namespace GUIUtil #endif // GUIUTIL_H
/**************************************************************************** Copyright (c) 2010-2011 cocos2d-x.org Copyright (c) 2011 Ricardo Quesada Copyright (c) 2011 Zynga Inc. http://www.cocos2d-x.org 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 __CCSHADERCACHE_H__ #define __CCSHADERCACHE_H__ #include "CCDictionary.h" NS_CC_BEGIN class CCGLProgram; /** CCShaderCache Singleton that stores manages GL shaders @since v2.0 */ class CC_DLL CCShaderCache : public CCObject { public: CCShaderCache(); virtual ~CCShaderCache(); /** returns the shared instance */ static CCShaderCache* sharedShaderCache(); /** purges the cache. It releases the retained instance. */ static void purgeSharedShaderCache(); /** loads the default shaders */ void loadDefaultShaders(); /** reload the default shaders */ void reloadDefaultShaders(); /** returns a GL program for a given key */ CCGLProgram * programForKey(const char* key); /** adds a CCGLProgram to the cache for a given name */ void addProgram(CCGLProgram* program, const char* key); private: bool init(); void loadDefaultShader(CCGLProgram *program, int type); CCDictionary* m_pPrograms; }; NS_CC_END #endif /* __CCSHADERCACHE_H__ */
/***************************************************************************/ /* */ /* tterrors.h */ /* */ /* TrueType error codes (specification only). */ /* */ /* Copyright 2001-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the TrueType error enumeration */ /* constants. */ /* */ /*************************************************************************/ #ifndef __TTERRORS_H__ #define __TTERRORS_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #undef FT_ERR_PREFIX #define FT_ERR_PREFIX TT_Err_ #define FT_ERR_BASE FT_Mod_Err_TrueType #include FT_ERRORS_H #endif /* __TTERRORS_H__ */ /* END */
/* * trickle.c * * Copyright (c) 2002, 2003 Marius Aamodt Eriksen <marius@monkey.org> * All rights reserved. * * $Id: trickle.c,v 1.18 2004/02/13 06:13:05 marius Exp $ */ #include <sys/types.h> #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include <sys/param.h> #include <sys/stat.h> #ifdef HAVE_ERR_H #include <err.h> #endif /* HAVE_ERR_H */ #include <errno.h> #include <dlfcn.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include "util.h" size_t strlcat(char *, const char *, size_t); void usage(void); #ifdef HAVE___PROGNAME extern char *__progname; #else char *__progname; #endif #define LIBNAME "trickle-overload.so" int main(int argc, char **argv) { char *winsz = "200", verbosestr[16], *uplim = "10", *downlim = "10", *tsmooth = "3.0", *lsmooth = "20", *latency = "0"; int opt, verbose = 0, standalone = 0; char buf[MAXPATHLEN], sockname[MAXPATHLEN], *path, **pathp; struct stat sb; char *trypaths[] = { LIBNAME, LIBDIR "/" LIBNAME, NULL }; __progname = get_progname(argv[0]); sockname[0] = '\0'; while ((opt = getopt(argc, argv, "hvVsw:n:u:d:t:l:L:")) != -1) switch (opt) { case 'v': verbose++; break; case 'w': winsz = optarg; break; case 'u': uplim = optarg; break; case 'd': downlim = optarg; break; case 'V': errx(1, "version " VERSION); break; case 'n': strlcpy(sockname, optarg, sizeof(sockname)); break; case 't': tsmooth = optarg; break; case 'l': lsmooth = optarg; break; case 's': standalone = 1; break; case 'L': latency = optarg; break; case 'h': default: usage(); } argc -= optind; argv += optind; if (argc == 0) usage(); for (pathp = trypaths; *pathp != NULL; pathp++) if (lstat(*pathp, &sb) == 0) break; path = *pathp; if (path == NULL) errx(1, "Could not find overload object"); if (path[0] != '/') { if (getcwd(buf, sizeof(buf)) == NULL) errx(1, "getcwd"); strlcat(buf, "/", sizeof(buf)); strlcat(buf, path, sizeof(buf)); path = buf; } if (!standalone) { if (sockname[0] == '\0') strlcpy(sockname, "/tmp/.trickled.sock", sizeof(sockname)); if (stat(sockname, &sb) == -1 && (errno == EACCES || errno == ENOENT)) warn("Could not reach trickled, working independently"); } else strlcpy(sockname, "", sizeof(sockname)); snprintf(verbosestr, sizeof(verbosestr), "%d", verbose); setenv("TRICKLE_DOWNLOAD_LIMIT", downlim, 1); setenv("TRICKLE_UPLOAD_LIMIT", uplim, 1); setenv("TRICKLE_VERBOSE", verbosestr, 1); setenv("TRICKLE_WINDOW_SIZE", winsz, 1); setenv("TRICKLE_ARGV", argv[0], 1); setenv("TRICKLE_SOCKNAME", sockname, 1); setenv("TRICKLE_TSMOOTH", tsmooth, 1); setenv("TRICKLE_LSMOOTH", lsmooth, 1); /* setenv("TRICKLE_LATENCY", latency, 1); */ setenv("LD_PRELOAD", path, 1); execvp(argv[0], argv); err(1, "exec()"); /* NOTREACHED */ return (1); } void usage(void) { fprintf(stderr, "Usage: %s [-hvVs] [-d <rate>] [-u <rate>] [-w <length>] " "[-t <seconds>]\n" " %*c [-l <length>] [-n <path>] command ...\n" "\t-h Help (this)\n" "\t-v Increase verbosity level\n" "\t-V Print %s version\n" "\t-s Run trickle in standalone mode independent of trickled\n" "\t-d <rate> Set maximum cumulative download rate to <rate> KB/s\n" "\t-u <rate> Set maximum cumulative upload rate to <rate> KB/s\n" "\t-w <length> Set window length to <length> KB \n" "\t-t <seconds> Set default smoothing time to <seconds> s\n" "\t-l <length> Set default smoothing length to <length> KB\n" "\t-n <path> Use trickled socket name <path>\n" "\t-L <ms> Set latency to <ms> milliseconds\n", __progname, (int)strlen(__progname), ' ', __progname); exit(1); }
#pragma once #include <GLUL/Config.h> #include <GL/glew.h> #include <cstddef> namespace GL { class GLUL_API VertexAttrib { public: VertexAttrib(); VertexAttrib(GLuint index_, GLint size_, GLenum type_, GLsizei stride_, GLvoid* offset_); VertexAttrib(GLuint index_, GLint size_, GLenum type_, GLsizei stride_, std::size_t offset_); ~VertexAttrib(); void set(); public: GLuint index; GLint size; GLenum type; GLboolean normalized; GLsizei stride; GLvoid* offset; }; }
#include "machine.h" //! Second exemple de segment de texte. /*! * \note On voit ici l'intérêt de l'initialisation d'une union avec nommage * explicite des champs. */ Instruction text[] = { // type cop imm ind regcond operand //------------------------------------------------------------- {.instr_absolute = {PUSH, false, false, 0, 2 }}, // 0 {.instr_absolute = {PUSH, false, false, 0, 3 }}, // 1 {.instr_absolute = {CALL, false, false, NC, 10 }}, // 2 {.instr_immediate = {ADD, true, false, 15, 2 }}, // 3 {.instr_absolute = {STORE, false, false, 0, 1 }}, // 4 {.instr_generic = {HALT, }}, // 5 {.instr_generic = {NOP, }}, // 6 {.instr_generic = {NOP, }}, // 7 {.instr_generic = {NOP, }}, // 8 {.instr_generic = {NOP, }}, // 9 {.instr_indexed = {LOAD, false, true, 0, 15, +3 }}, // 10 {.instr_indexed = {LOAD, false, true, 1, 15, +2 }}, // 11 {.instr_immediate = {SUB, true, false, 1, 1 }}, // 12 {.instr_absolute = {BRANCH, false, false, LE, 17 }}, // 13 {.instr_indexed = {ADD, false, true, 0, 15, +3 }}, // 14 {.instr_immediate = {SUB, true, false, 1, 1 }}, // 15 {.instr_absolute = {BRANCH, false, false, NC, 13 }}, // 16 {.instr_generic = {RET, }}, // 17 }; //! Taille utile du programme const unsigned textsize = sizeof(text) / sizeof(Instruction); //! Premier exemple de segment de données initial Word data[20] = { 0, // 0 0, // 1: résultat 20, // 2: premier opérande 5, // 3: second opérande }; //! Fin de la zone de données utile const unsigned dataend = 10; //! Taille utile du segment de données const unsigned datasize = sizeof(data) / sizeof(Word);
/**************************************************************** * * Copyright 2013, Big Switch Networks, Inc. * * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html * * 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. * ****************************************************************/ /** * @defgroup AIM AIM - Architecture and Implementation Module * This module provides fundamental primitive structures for other modules. In general, each functional module tries to be both platform independent and provide a clean, self-contained and flexible interface with as few assumptions about deployment in a particular environment as possible. The AIM module provides portability infrastructure, common good-practice definitions, and fundamental primitives useful through the code to address common issues such as debug and output virtualization and configuration, logging. The AIM module cannot depend on any other module or any external package. * * @{ * * @defgroup aim-object AIM Object Management. * @defgroup aim-config Compile-Time Configuration * @defgroup aim-porting Porting Macros * @defgroup aim-printf Printf with Custom Datatypes * @defgroup aim-sparse Custom Datatype Parsing * @defgroup aim-pvs Virtualized Print Vectors * @{ * @defgroup aim-pvs-file File PVS * @defgroup aim-pvs-buffer Buffered String PVS * @defgroup aim-pvs-syslog Syslog PVS * @} * @defgroup aim-datatypes Custom Datatype Handling * @defgroup aim-valist Variable Argument Processing * @defgroup aim-string String Primitives * @defgroup aim-utils Generic Macros and Utilities * @defgroup aim-log Logging Support * @defgroup aim-rl Rate Limiters * @defgroup aim-list Inclusive Linked List Support * @defgroup aim-bitmap Bitmap Management * @defgroup aim-valgrind Valgrind Runtime Support * @defgroup aim-daemon Daemon and Supervisor Support * * * @} * */
/* RT-Thread config file */ #ifndef __RTTHREAD_CFG_H__ #define __RTTHREAD_CFG_H__ /* RT_NAME_MAX*/ #define RT_NAME_MAX 8 /* RT_ALIGN_SIZE*/ #define RT_ALIGN_SIZE 8 /* PRIORITY_MAX */ #define RT_THREAD_PRIORITY_MAX 32 /* Tick per Second */ #define RT_TICK_PER_SECOND 100 /* SECTION: RT_DEBUG */ /* Thread Debug */ #define RT_DEBUG #define RT_THREAD_DEBUG #define RT_USING_OVERFLOW_CHECK /* Using Hook */ #define RT_USING_HOOK /* Using Software Timer */ /* #define RT_USING_TIMER_SOFT */ #define RT_TIMER_THREAD_PRIO 4 #define RT_TIMER_THREAD_STACK_SIZE 512 #define RT_TIMER_TICK_PER_SECOND 10 /* SECTION: IPC */ /* Using Semaphore*/ #define RT_USING_SEMAPHORE /* Using Mutex */ #define RT_USING_MUTEX /* Using Event */ #define RT_USING_EVENT /* Using MailBox */ #define RT_USING_MAILBOX /* Using Message Queue */ #define RT_USING_MESSAGEQUEUE /* SECTION: Memory Management */ /* Using Memory Pool Management*/ #define RT_USING_MEMPOOL /* Using Dynamic Heap Management */ #define RT_USING_HEAP /* Using Small MM */ #define RT_USING_SMALL_MEM /* SECTION: Device System */ /* Using Device System */ #define RT_USING_DEVICE #define RT_USING_UART1 /* SECTION: Console options */ #define RT_USING_CONSOLE /* the buffer size of console*/ #define RT_CONSOLEBUF_SIZE 128 /* SECTION: finsh, a C-Express shell */ #define RT_USING_FINSH /* Using symbol table */ #define FINSH_USING_SYMTAB #define FINSH_USING_DESCRIPTION /* SECTION: device filesystem */ #define RT_USING_DFS #define RT_USING_DFS_ELMFAT /* Reentrancy (thread safe) of the FatFs module. */ #define RT_DFS_ELM_REENTRANT /* Number of volumes (logical drives) to be used. */ #define RT_DFS_ELM_DRIVES 2 /* #define RT_DFS_ELM_USE_LFN 1 */ #define RT_DFS_ELM_MAX_LFN 255 /* Maximum sector size to be handled. */ #define RT_DFS_ELM_MAX_SECTOR_SIZE 512 /* the max number of mounted filesystem */ #define DFS_FILESYSTEMS_MAX 2 /* the max number of opened files */ #define DFS_FD_MAX 4 /* SECTION: lwip, a lighwight TCP/IP protocol stack */ #define RT_USING_LWIP /* LwIP uses RT-Thread Memory Management */ #define RT_LWIP_USING_RT_MEM /* Enable ICMP protocol*/ #define RT_LWIP_ICMP /* Enable UDP protocol*/ #define RT_LWIP_UDP /* Enable TCP protocol*/ #define RT_LWIP_TCP /* Enable DNS */ #define RT_LWIP_DNS /* the number of simulatenously active TCP connections*/ #define RT_LWIP_TCP_PCB_NUM 5 /* ip address of target*/ #define RT_LWIP_IPADDR0 192 #define RT_LWIP_IPADDR1 168 #define RT_LWIP_IPADDR2 1 #define RT_LWIP_IPADDR3 30 /* gateway address of target*/ #define RT_LWIP_GWADDR0 192 #define RT_LWIP_GWADDR1 168 #define RT_LWIP_GWADDR2 1 #define RT_LWIP_GWADDR3 1 /* mask address of target*/ #define RT_LWIP_MSKADDR0 255 #define RT_LWIP_MSKADDR1 255 #define RT_LWIP_MSKADDR2 255 #define RT_LWIP_MSKADDR3 0 /* tcp thread options */ #define RT_LWIP_TCPTHREAD_PRIORITY 12 #define RT_LWIP_TCPTHREAD_MBOX_SIZE 4 #define RT_LWIP_TCPTHREAD_STACKSIZE 1024 /* ethernet if thread options */ #define RT_LWIP_ETHTHREAD_PRIORITY 15 #define RT_LWIP_ETHTHREAD_MBOX_SIZE 4 #define RT_LWIP_ETHTHREAD_STACKSIZE 512 /* TCP sender buffer space */ #define RT_LWIP_TCP_SND_BUF 8192 /* TCP receive window. */ #define RT_LWIP_TCP_WND 8192 #define CHECKSUM_CHECK_TCP 0 #define CHECKSUM_CHECK_IP 0 #define CHECKSUM_CHECK_UDP 0 #define CHECKSUM_GEN_TCP 0 #define CHECKSUM_GEN_IP 0 #define CHECKSUM_GEN_UDP 0 // <bool name="RT_USING_CMSIS_OS" description="Using CMSIS OS API" default="true" /> // #define RT_USING_CMSIS_OS // <bool name="RT_USING_RTT_CMSIS" description="Using CMSIS in RTT" default="true" /> #define RT_USING_RTT_CMSIS // <bool name="RT_USING_BSP_CMSIS" description="Using CMSIS in BSP" default="true" /> // #define RT_USING_BSP_CMSIS #endif
/* * Copyright 2007-2010 Analog Devices Inc. * * Licensed under the GPL-2 or later. */ #ifndef _MACH_BLACKFIN_H_ #define _MACH_BLACKFIN_H_ #include "bf548.h" #include "anomaly.h" #include <asm/def_LPBlackfin.h> #ifdef CONFIG_BF542 # include "defBF542.h" #endif #ifdef CONFIG_BF544 # include "defBF544.h" #endif #ifdef CONFIG_BF547 # include "defBF547.h" #endif #ifdef CONFIG_BF548 # include "defBF548.h" #endif #ifdef CONFIG_BF549 # include "defBF549.h" #endif #ifndef __ASSEMBLY__ # include <asm/cdef_LPBlackfin.h> # ifdef CONFIG_BF542 # include "cdefBF542.h" # endif # ifdef CONFIG_BF544 # include "cdefBF544.h" # endif # ifdef CONFIG_BF547 # include "cdefBF547.h" # endif # ifdef CONFIG_BF548 # include "cdefBF548.h" # endif # ifdef CONFIG_BF549 # include "cdefBF549.h" # endif #endif #endif
/********************************************************************\ * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 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, contact: * * * * Free Software Foundation Voice: +1-617-542-5942 * * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * * * \********************************************************************/ /** @file debug.h @brief Debug output routines @author Copyright (C) 2004 Philippe April <papril777@yahoo.com> */ #ifndef _DEBUG_H_ #define _DEBUG_H_ #include <syslog.h> #define DEBUGLEVEL_MIN 0 #define DEBUGLEVEL_MAX 3 /** @brief Used to output messages. *The messages will include the finlname and line number, and will be sent to syslog if so configured in the config file */ #define debug(...) _debug(__BASE_FILE__, __LINE__, __VA_ARGS__) /** @internal */ void _debug(const char filename[], int line, int level, const char *format, ...); #endif /* _DEBUG_H_ */
// // PBAddRemoteSheet.h // GitX // // Created by Nathan Kinsinger on 12/8/09. // Copyright 2009 Nathan Kinsinger. All rights reserved. // #import <Cocoa/Cocoa.h> @class PBGitRepository; @interface PBAddRemoteSheet : NSWindowController { PBGitRepository *repository; NSTextField *remoteName; NSTextField *remoteURL; NSTextField *errorMessage; NSOpenPanel *browseSheet; NSView *browseAccessoryView; NSString *remoteUrl; } + (void) beginAddRemoteSheetForRepository:(PBGitRepository *)repo withRemoteURL:(NSString*)url; - (IBAction) browseFolders:(id)sender; - (IBAction) addRemote:(id)sender; - (IBAction) orderOutAddRemoteSheet:(id)sender; - (IBAction) showHideHiddenFiles:(id)sender; @property(strong) PBGitRepository *repository; @property(strong) IBOutlet NSTextField *remoteName; @property(strong) IBOutlet NSTextField *remoteURL; @property(strong) IBOutlet NSTextField *errorMessage; @property(strong) NSOpenPanel *browseSheet; @property(strong) IBOutlet NSView *browseAccessoryView; @end
/** * @file * * @brief Locking and Unlocking a Mutex * @ingroup POSIXAPI */ /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ #if HAVE_CONFIG_H #include "config.h" #endif #include <errno.h> #include <pthread.h> #include <rtems/system.h> #include <rtems/score/coremutex.h> #include <rtems/score/watchdog.h> #if defined(RTEMS_MULTIPROCESSING) #include <rtems/score/mpci.h> #endif #include <rtems/posix/mutex.h> #include <rtems/posix/priority.h> #include <rtems/posix/time.h> /* * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 * * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */ int pthread_mutex_unlock( pthread_mutex_t *mutex ) { register POSIX_Mutex_Control *the_mutex; Objects_Locations location; CORE_mutex_Status status; the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { case OBJECTS_LOCAL: status = _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); return _POSIX_Mutex_Translate_core_mutex_return_code( status ); #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: #endif case OBJECTS_ERROR: break; } return EINVAL; }
/* * Adium is the legal property of its developers, whose names are listed in the copyright file included * with this source distribution. * * This program is free software; you can redistribute it and/or modify it under the terms of the GNU * General Public License as published by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. * * You should have received a copy of the GNU General Public License along with this program; if not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "AIAdvancedPreferencePane.h" #import "AIAccountMenu.h" @interface ESOTRPreferences : AIAdvancedPreferencePane <AIAccountMenuDelegate> { IBOutlet NSPopUpButton *popUp_accounts; IBOutlet NSButton *button_generate; IBOutlet NSTextField *textField_privateKey; IBOutlet NSTableView *tableView_fingerprints; IBOutlet NSButton *button_showFingerprint; BOOL viewIsOpen; NSMutableArray *fingerprintDictArray; AIAccountMenu *accountMenu; } - (IBAction)generate:(id)sender; - (IBAction)showFingerprint:(id)sender; - (void)updateFingerprintsList; - (void)updatePrivateKeyList; @end
/* * gedit-animated-overlay.h * This file is part of gedit * * Copyright (C) 2011 - Ignacio Casal Quinteiro * * gedit 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. * * gedit is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GEDIT_ANIMATED_OVERLAY_H__ #define __GEDIT_ANIMATED_OVERLAY_H__ #include <gtk/gtk.h> #include "gedit-animatable.h" #include "theatrics/gedit-theatrics-choreographer.h" G_BEGIN_DECLS #define GEDIT_TYPE_ANIMATED_OVERLAY (gedit_animated_overlay_get_type ()) #define GEDIT_ANIMATED_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_ANIMATED_OVERLAY, GeditAnimatedOverlay)) #define GEDIT_ANIMATED_OVERLAY_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_ANIMATED_OVERLAY, GeditAnimatedOverlay const)) #define GEDIT_ANIMATED_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_ANIMATED_OVERLAY, GeditAnimatedOverlayClass)) #define GEDIT_IS_ANIMATED_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_ANIMATED_OVERLAY)) #define GEDIT_IS_ANIMATED_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_ANIMATED_OVERLAY)) #define GEDIT_ANIMATED_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_ANIMATED_OVERLAY, GeditAnimatedOverlayClass)) typedef struct _GeditAnimatedOverlay GeditAnimatedOverlay; typedef struct _GeditAnimatedOverlayClass GeditAnimatedOverlayClass; typedef struct _GeditAnimatedOverlayPrivate GeditAnimatedOverlayPrivate; struct _GeditAnimatedOverlay { GtkOverlay parent; GeditAnimatedOverlayPrivate *priv; }; struct _GeditAnimatedOverlayClass { GtkOverlayClass parent_class; }; GType gedit_animated_overlay_get_type (void) G_GNUC_CONST; GtkWidget *gedit_animated_overlay_new (void); void gedit_animated_overlay_add_animated_overlay (GeditAnimatedOverlay *overlay, GeditAnimatable *animatable); G_END_DECLS #endif /* __GEDIT_ANIMATED_OVERLAY_H__ */
// // AMPTranslateView.h // AMPTranslate // // Created by Joe on 19/11/13. // Copyright (c) 2013 Bloop. All rights reserved. // #import <AMPluginFramework/AMPluginFramework.h> @interface AMPTranslateView : AMPView { NSPopUpButton *popUpBtnRender; } @end
#ifndef __LINUX_COMPILER_H #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead." #endif /* * Common definitions for all gcc versions go here. */ #define GCC_VERSION (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) /* Optimization barrier */ /* The "volatile" is due to gcc bugs */ #define barrier() __asm__ __volatile__("": : :"memory") /* * This version is i.e. to prevent dead stores elimination on @ptr * where gcc and llvm may behave differently when otherwise using * normal barrier(): while gcc behavior gets along with a normal * barrier(), llvm needs an explicit input variable to be assumed * clobbered. The issue is as follows: while the inline asm might * access any memory it wants, the compiler could have fit all of * @ptr into memory registers instead, and since @ptr never escaped * from that, it proofed that the inline asm wasn't touching any of * it. This version works well with both compilers, i.e. we're telling * the compiler that the inline asm absolutely may see the contents * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495 */ #define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory") /* * This macro obfuscates arithmetic on a variable address so that gcc * shouldn't recognize the original var, and make assumptions about it. * * This is needed because the C standard makes it undefined to do * pointer arithmetic on "objects" outside their boundaries and the * gcc optimizers assume this is the case. In particular they * assume such arithmetic does not wrap. * * A miscompilation has been observed because of this on PPC. * To work around it we hide the relationship of the pointer and the object * using this macro. * * Versions of the ppc64 compiler before 4.1 had a bug where use of * RELOC_HIDE could trash r30. The bug can be worked around by changing * the inline assembly constraint from =g to =r, in this particular * case either is valid. */ #define RELOC_HIDE(ptr, off) \ ({ unsigned long __ptr; \ __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ (typeof(ptr)) (__ptr + (off)); }) /* Make the optimizer believe the variable can be manipulated arbitrarily. */ #define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) #ifdef __CHECKER__ #define __must_be_array(arr) 0 #else /* &a[0] degrades to a pointer: a different type from an array */ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) #endif /* * Force always-inline if the user requests it so via the .config, * or if gcc is too old: */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) # define inline inline __attribute__((always_inline)) notrace # define __inline__ __inline__ __attribute__((always_inline)) notrace # define __inline __inline __attribute__((always_inline)) notrace #else /* A lot of inline functions can cause havoc with function tracing */ # define inline inline notrace # define __inline__ __inline__ notrace # define __inline __inline notrace #endif #define __deprecated __attribute__((deprecated)) #define __packed __attribute__((packed)) #define __weak __attribute__((weak)) #define __alias(symbol) __attribute__((alias(#symbol))) /* * it doesn't make sense on ARM (currently the only user of __naked) to trace * naked functions because then mcount is called without stack and frame pointer * being set up and there is no chance to restore the lr register to the value * before mcount was called. * * The asm() bodies of naked functions often depend on standard calling conventions, * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce * this, so we must do so ourselves. See GCC PR44290. */ #define __naked __attribute__((naked)) noinline __noclone notrace #define __noreturn __attribute__((noreturn)) /* * From the GCC manual: * * Many functions have no effects except the return value and their * return value depends only on the parameters and/or global * variables. Such a function can be subject to common subexpression * elimination and loop optimization just as an arithmetic operator * would be. * [...] */ #define __pure __attribute__((pure)) #define __aligned(x) __attribute__((aligned(x))) #define __printf(a, b) __attribute__((format(printf, a, b))) __nocapture(a, b) #define __scanf(a, b) __attribute__((format(scanf, a, b))) __nocapture(a, b) #define noinline __attribute__((noinline)) #define __attribute_const__ __attribute__((__const__)) #define __maybe_unused __attribute__((unused)) #define __always_unused __attribute__((unused)) #define __gcc_header(x) #x #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) #define gcc_header(x) _gcc_header(x) #include gcc_header(__GNUC__) #if !defined(__noclone) #define __noclone /* not needed */ #endif /* * A trick to suppress uninitialized variable warning without generating any * code */ #define uninitialized_var(x) x = x #define __always_inline inline __attribute__((always_inline))
/* * ircd-ratbox: A slightly useful ircd. * m_time.c: Sends the current time on the server. * * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center * Copyright (C) 1996-2002 Hybrid Development Team * Copyright (C) 2002-2005 ircd-ratbox development team * * 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 * * $Id: m_time.c 19287 2005-06-16 23:10:21Z leeh $ */ #include "stdinc.h" #include "client.h" #include "ircd.h" #include "numeric.h" #include "s_conf.h" #include "s_serv.h" #include "send.h" #include "msg.h" #include "parse.h" #include "modules.h" #include "packet.h" #include "sprintf_irc.h" static int m_time(struct Client *, struct Client *, int, const char **); static char *date(void); struct Message time_msgtab = { "TIME", 0, 0, 0, MFLG_SLOW, {mg_unreg, {m_time, 0}, {m_time, 2}, mg_ignore, mg_ignore, {m_time, 0}} }; mapi_clist_av1 time_clist[] = { &time_msgtab, NULL }; DECLARE_MODULE_AV1(time, NULL, NULL, time_clist, NULL, NULL, "$Revision: 19287 $"); static const char *months[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; static const char *weekdays[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; /* * m_time * parv[0] = sender prefix * parv[1] = servername */ static int m_time(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { /* this is not rate limited, so end the grace period */ if(MyClient(source_p) && !IsFloodDone(source_p)) flood_endgrace(source_p); if(hunt_server(client_p, source_p, ":%s TIME :%s", 1, parc, parv) == HUNTED_ISME) sendto_one_numeric(source_p, RPL_TIME, form_str(RPL_TIME), me.name, date()); return 0; } /* date() * * returns date in human readable form */ static char * date(void) { static char buf[80]; char plus; struct tm *lt; struct tm *gm; struct tm gmbuf; time_t lclock; int minswest; lclock = CurrentTime; gm = gmtime(&lclock); memcpy((void *) &gmbuf, (void *) gm, sizeof(gmbuf)); gm = &gmbuf; lt = localtime(&lclock); if(lt->tm_yday == gm->tm_yday) minswest = (gm->tm_hour - lt->tm_hour) * 60 + (gm->tm_min - lt->tm_min); else if(lt->tm_yday > gm->tm_yday && lt->tm_year == gm->tm_year) minswest = (gm->tm_hour - (lt->tm_hour + 24)) * 60; else minswest = ((gm->tm_hour + 24) - lt->tm_hour) * 60; plus = (minswest > 0) ? '-' : '+'; if(minswest < 0) minswest = -minswest; ircsprintf(buf, "%s %s %d %d -- %02u:%02u:%02u %c%02u:%02u", weekdays[lt->tm_wday], months[lt->tm_mon], lt->tm_mday, lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec, plus, minswest / 60, minswest % 60); return buf; }
// qjackctlPatchbayFile.h // /**************************************************************************** Copyright (C) 2003-2011, rncbc aka Rui Nuno Capela. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *****************************************************************************/ #ifndef __qjackctlPatchbayFile_h #define __qjackctlPatchbayFile_h #include "qjackctlPatchbayRack.h" // Patchbay XML definition. class qjackctlPatchbayFile { public: // Simple patchbay I/O methods. static bool load (qjackctlPatchbayRack *pPatchbay, const QString& sFilename); static bool save (qjackctlPatchbayRack *pPatchbay, const QString& sFilename); }; #endif // __qjackctlPatchbayFile_h // qjackctlPatchbayFile.h
/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them 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. * * These libraries and programs 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 Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: ActionFind.h /main/4 1995/10/26 14:59:41 rswiston $ */ /************************************<+>************************************* **************************************************************************** ** ** File: ActionFind.h ** ** Project: DT ** ** Description: Public include file for the ActionFind functions. ** ** (c) Copyright 1993, 1994 Hewlett-Packard Company ** (c) Copyright 1993, 1994 International Business Machines Corp. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc. ** (c) Copyright 1993, 1994 Novell, Inc. **************************************************************************** ************************************<+>*************************************/ #ifndef _Dt_ActionFind_h #define _Dt_ActionFind_h #include <X11/Xlib.h> #include <X11/Xresource.h> #include <Dt/ActionP.h> #include <Dt/DtsDb.h> #include <Dt/DtsMM.h> # ifdef __cplusplus extern "C" { # endif extern void _DtSortActionDb(void); extern ActionPtr _DtActionFindDBEntry( ActionRequest *reqp, DtShmBoson actQuark ); # ifdef __cplusplus } # endif #endif /* _Dt_ActionFind_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */
// _________ __ __ // / _____// |_____________ _/ |______ ____ __ __ ______ // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ | // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > // \/ \/ \//_____/ \/ // ______________________ ______________________ // T H E W A R B E G I N S // Stratagus - A free fantasy real time strategy game engine // /**@name action_patrol.h - The actions headerfile. */ // // (c) Copyright 1998-2012 by Lutz Sammer and Jimmy Salmon // // 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; only version 2 of the License. // // 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. // #ifndef __ACTION_PATROL_H__ #define __ACTION_PATROL_H__ #include "actions.h" //@{ class COrder_Patrol : public COrder { friend COrder *COrder::NewActionPatrol(const Vec2i &currentPos, const Vec2i &dest); public: COrder_Patrol() : COrder(UnitActionPatrol), WaitingCycle(0), Range(0) { goalPos.x = -1; goalPos.y = -1; } virtual COrder_Patrol *Clone() const { return new COrder_Patrol(*this); } virtual bool IsValid() const; virtual void Save(CFile &file, const CUnit &unit) const; virtual bool ParseSpecificData(lua_State *l, int &j, const char *value, const CUnit &unit); virtual void Execute(CUnit &unit); virtual PixelPos Show(const CViewport &vp, const PixelPos &lastScreenPos) const; virtual void UpdatePathFinderData(PathFinderInput &input); const Vec2i &GetWayPoint() const { return WayPoint; } virtual const Vec2i GetGoalPos() const; private: Vec2i WayPoint; /// position for patroling. unsigned int WaitingCycle; /// number of cycle pathfinder wait. int Range; Vec2i goalPos; }; //@} #endif // !__ACTION_PATROL_H__
/* Same. Just like SNAT, only try to make the connections * between client A and server B always have the same source ip. * * (C) 2000 Paul `Rusty' Russell * (C) 2001 Martin Josefsson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * 010320 Martin Josefsson <gandalf@wlug.westbo.se> * * copied ipt_BALANCE.c to ipt_SAME.c and changed a few things. * 010728 Martin Josefsson <gandalf@wlug.westbo.se> * * added --nodst to not include destination-ip in new source * calculations. * * added some more sanity-checks. * 010729 Martin Josefsson <gandalf@wlug.westbo.se> * * fixed a buggy if-statement in same_check(), should have * used ntohl() but didn't. * * added support for multiple ranges. IPT_SAME_MAX_RANGE is * defined in linux/include/linux/netfilter_ipv4/ipt_SAME.h * and is currently set to 10. * * added support for 1-address range, nice to have now that * we have multiple ranges. */ #include <linux/types.h> #include <linux/ip.h> #include <linux/timer.h> #include <linux/module.h> #include <linux/netfilter.h> #include <linux/netdevice.h> #include <linux/if.h> #include <linux/inetdevice.h> #include <net/protocol.h> #include <net/checksum.h> #include <linux/netfilter_ipv4.h> #include <linux/netfilter_ipv4/ip_nat_rule.h> #include <linux/netfilter_ipv4/ipt_SAME.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Martin Josefsson <gandalf@wlug.westbo.se>"); MODULE_DESCRIPTION("iptables special SNAT module for consistent sourceip"); #if 0 #define DEBUGP printk #else #define DEBUGP(format, args...) #endif static int same_check(const char *tablename, const void *e, void *targinfo, unsigned int targinfosize, unsigned int hook_mask) { unsigned int count, countess, rangeip, index = 0; struct ipt_same_info *mr = targinfo; mr->ipnum = 0; if (strcmp(tablename, "nat") != 0) { DEBUGP("same_check: bad table `%s'.\n", tablename); return 0; } if (targinfosize != IPT_ALIGN(sizeof(*mr))) { DEBUGP("same_check: size %u.\n", targinfosize); return 0; } if (hook_mask & ~(1 << NF_IP_PRE_ROUTING | 1 << NF_IP_POST_ROUTING)) { DEBUGP("same_check: bad hooks %x.\n", hook_mask); return 0; } if (mr->rangesize < 1) { DEBUGP("same_check: need at least one dest range.\n"); return 0; } if (mr->rangesize > IPT_SAME_MAX_RANGE) { DEBUGP("same_check: too many ranges specified, maximum " "is %u ranges\n", IPT_SAME_MAX_RANGE); return 0; } for (count = 0; count < mr->rangesize; count++) { if (ntohl(mr->range[count].min_ip) > ntohl(mr->range[count].max_ip)) { DEBUGP("same_check: min_ip is larger than max_ip in " "range `%u.%u.%u.%u-%u.%u.%u.%u'.\n", NIPQUAD(mr->range[count].min_ip), NIPQUAD(mr->range[count].max_ip)); return 0; } if (!(mr->range[count].flags & IP_NAT_RANGE_MAP_IPS)) { DEBUGP("same_check: bad MAP_IPS.\n"); return 0; } rangeip = (ntohl(mr->range[count].max_ip) - ntohl(mr->range[count].min_ip) + 1); mr->ipnum += rangeip; DEBUGP("same_check: range %u, ipnum = %u\n", count, rangeip); } DEBUGP("same_check: total ipaddresses = %u\n", mr->ipnum); mr->iparray = kmalloc((sizeof(u_int32_t) * mr->ipnum), GFP_KERNEL); if (!mr->iparray) { DEBUGP("same_check: Couldn't allocate %u bytes " "for %u ipaddresses!\n", (sizeof(u_int32_t) * mr->ipnum), mr->ipnum); return 0; } DEBUGP("same_check: Allocated %u bytes for %u ipaddresses.\n", (sizeof(u_int32_t) * mr->ipnum), mr->ipnum); for (count = 0; count < mr->rangesize; count++) { for (countess = ntohl(mr->range[count].min_ip); countess <= ntohl(mr->range[count].max_ip); countess++) { mr->iparray[index] = countess; DEBUGP("same_check: Added ipaddress `%u.%u.%u.%u' " "in index %u.\n", HIPQUAD(countess), index); index++; } } return 1; } static void same_destroy(void *targinfo, unsigned int targinfosize) { struct ipt_same_info *mr = targinfo; kfree(mr->iparray); DEBUGP("same_destroy: Deallocated %u bytes for %u ipaddresses.\n", (sizeof(u_int32_t) * mr->ipnum), mr->ipnum); } static unsigned int same_target(struct sk_buff **pskb, const struct net_device *in, const struct net_device *out, unsigned int hooknum, const void *targinfo, void *userinfo) { struct ip_conntrack *ct; enum ip_conntrack_info ctinfo; u_int32_t tmpip, aindex, new_ip; const struct ipt_same_info *same = targinfo; struct ip_nat_range newrange; const struct ip_conntrack_tuple *t; IP_NF_ASSERT(hooknum == NF_IP_PRE_ROUTING || hooknum == NF_IP_POST_ROUTING); ct = ip_conntrack_get(*pskb, &ctinfo); t = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; /* Base new source on real src ip and optionally dst ip, giving some hope for consistency across reboots. Here we calculate the index in same->iparray which holds the ipaddress we should use */ tmpip = ntohl(t->src.ip); if (!(same->info & IPT_SAME_NODST)) tmpip += ntohl(t->dst.ip); aindex = tmpip % same->ipnum; new_ip = htonl(same->iparray[aindex]); DEBUGP("ipt_SAME: src=%u.%u.%u.%u dst=%u.%u.%u.%u, " "new src=%u.%u.%u.%u\n", NIPQUAD(t->src.ip), NIPQUAD(t->dst.ip), NIPQUAD(new_ip)); /* Transfer from original range. */ newrange = ((struct ip_nat_range) { same->range[0].flags, new_ip, new_ip, /* FIXME: Use ports from correct range! */ same->range[0].min, same->range[0].max }); /* Hand modified range to generic setup. */ return ip_nat_setup_info(ct, &newrange, hooknum); } static struct ipt_target same_reg = { .name = "SAME", .target = same_target, .checkentry = same_check, .destroy = same_destroy, .me = THIS_MODULE, }; static int __init init(void) { return ipt_register_target(&same_reg); } static void __exit fini(void) { ipt_unregister_target(&same_reg); } module_init(init); module_exit(fini);
/* * This file is part of the coreboot project. * * Copyright (C) 2008-2009 coresystems GmbH * * 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 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <console/console.h> #include <delay.h> #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> #include <pc80/mc146818rtc.h> #include "i945.h" #define GDRST 0xc0 static void gma_func0_init(struct device *dev) { u32 reg32; /* Unconditionally reset graphics */ pci_write_config8(dev, GDRST, 1); udelay(50); pci_write_config8(dev, GDRST, 0); /* wait for device to finish */ while (pci_read_config8(dev, GDRST) & 1) { }; /* IGD needs to be Bus Master */ reg32 = pci_read_config32(dev, PCI_COMMAND); pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER); #if !CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT /* PCI Init, will run VBIOS */ pci_dev_init(dev); #endif #if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT /* This should probably run before post VBIOS init. */ printk(BIOS_SPEW, "Initializing VGA without OPROM.\n"); u32 iobase, mmiobase, physbase, graphics_base; iobase = dev->resource_list[1].base; mmiobase = dev->resource_list[0].base; physbase = pci_read_config32(dev, 0x5c) & ~0xf; graphics_base = dev->resource_list[2].base + 0x20000 ; int i915lightup(u32 physbase, u32 iobase, u32 mmiobase, u32 gfx); i915lightup(physbase, iobase, mmiobase, graphics_base); #endif } /* This doesn't reclaim stolen UMA memory, but IGD could still be reenabled later. */ static void gma_func0_disable(struct device *dev) { struct device *dev_host = dev_find_slot(0, PCI_DEVFN(0x0, 0)); pci_write_config16(dev, GCFC, 0xa00); pci_write_config16(dev_host, GGC, (1 << 1)); unsigned int reg32 = pci_read_config32(dev_host, DEVEN); reg32 &= ~(DEVEN_D2F0 | DEVEN_D2F1); pci_write_config32(dev_host, DEVEN, reg32); dev->enabled = 0; } static void gma_func1_init(struct device *dev) { u32 reg32; u8 val; /* IGD needs to be Bus Master, also enable IO accesss */ reg32 = pci_read_config32(dev, PCI_COMMAND); pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER | PCI_COMMAND_IO); if (!get_option(&val, "tft_brightness")) pci_write_config8(dev, 0xf4, val); else pci_write_config8(dev, 0xf4, 0xff); } static void gma_set_subsystem(device_t dev, unsigned vendor, unsigned device) { if (!vendor || !device) { pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, pci_read_config32(dev, PCI_VENDOR_ID)); } else { pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, ((device & 0xffff) << 16) | (vendor & 0xffff)); } } static struct pci_operations gma_pci_ops = { .set_subsystem = gma_set_subsystem, }; static struct device_operations gma_func0_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = gma_func0_init, .scan_bus = 0, .enable = 0, .disable = gma_func0_disable, .ops_pci = &gma_pci_ops, }; static struct device_operations gma_func1_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = gma_func1_init, .scan_bus = 0, .enable = 0, .ops_pci = &gma_pci_ops, }; static const struct pci_driver i945_gma_func0_driver __pci_driver = { .ops = &gma_func0_ops, .vendor = PCI_VENDOR_ID_INTEL, .device = 0x27a2, }; static const struct pci_driver i945_gma_func1_driver __pci_driver = { .ops = &gma_func1_ops, .vendor = PCI_VENDOR_ID_INTEL, .device = 0x27a6, };
/* * drivers/regulator/axp173-regulator.c * * Regulator driver for RICOH R5T619 power management chip. * * Copyright (C) 2012-2014 RICOH COMPANY,LTD * * Based on code * Copyright (C) 2011 NVIDIA Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ /*#define DEBUG 1*/ /*#define VERBOSE_DEBUG 1*/ #include <config.h> #include <common.h> #include <linux/err.h> #include <linux/list.h> #include <regulator.h> #include <ingenic_soft_i2c.h> #include <power/axp173.h> #define AXP173_I2C_ADDR 0x34 static struct i2c axp173_i2c; static struct i2c *i2c; int axp173_write_reg(u8 reg, u8 *val) { unsigned int ret; ret = i2c_write(i2c, AXP173_I2C_ADDR, reg, 1, val, 1); if(ret) { debug("axp173 write register error\n"); return -EIO; } return 0; } int axp173_read_reg(u8 reg, u8 *val, u32 len) { int ret; ret = i2c_read(i2c, AXP173_I2C_ADDR, reg, 1, val, len); if(ret) { debug("axp173 read register error\n"); return -EIO; } return 0; } int axp173_power_off(void) { int ret; uint8_t reg_val; ret = axp173_read_reg(AXP173_POWER_OFF, &reg_val,1); if (ret < 0) printf("Error in reading the POWEROFF_Reg\n"); reg_val |= (1 << 7); ret = axp173_write_reg(AXP173_POWER_OFF, &reg_val); if (ret < 0) printf("Error in writing the POWEROFF_Reg\n"); return 0; } int axp173_regulator_init(void) { int ret; axp173_i2c.scl = CONFIG_AXP173_I2C_SCL; axp173_i2c.sda = CONFIG_AXP173_I2C_SDA; i2c = &axp173_i2c; i2c_init(i2c); ret = i2c_probe(i2c, AXP173_I2C_ADDR); if(ret) { printf("probe axp173 error, i2c addr 0x%x\n", AXP173_I2C_ADDR); return -EIO; } return 0; }
/* * Copyright (C) 2012 Mark Hills <mark@pogo.org.uk> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2, as published by the Free Software Foundation. * * 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 version 2 for more details. * * You should have received a copy of the GNU General Public License * version 2 along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * */ #ifndef DEBUG_H #define DEBUG_H #include <stdio.h> #ifdef DEBUG #define debug(...) { \ fprintf(stderr, "%s:%d: ", __func__, __LINE__); \ fprintf(stderr, __VA_ARGS__); \ fputc('\n', stderr); \ } #define dassert(x) assert(x) #else #define debug(...) #define dassert(x) #endif #endif
/* * Copyright (c) 2009, Eric Forgeot * * Based on work by Jon Strait * * This source code is released for free distribution under the terms of the * GNU General Public License. * * This module contains functions for generating tags for Abc files. */ /* * INCLUDE FILES */ #include "general.h" /* must always come first */ #include <ctype.h> #include <string.h> #include "parse.h" #include "read.h" #include "vstring.h" #include "routines.h" #include "entry.h" /* * DATA DEFINITIONS */ static kindDefinition AbcKinds[] = { { true, 'm', "member", "sections" }, { true, 's', "struct", "header1"} }; /* * FUNCTION DEFINITIONS */ /* checks if str is all the same character */ /*static bool issame(const char *str) { char first = *str; while (*(++str)) { if (*str && *str != first) return false; } return true; }*/ static void makeAbcTag (const vString* const name, bool name_before) { tagEntryInfo e; initTagEntry (&e, vStringValue(name), 0); if (name_before) e.lineNumber--; /* we want the line before the underline chars */ makeTagEntry(&e); } /*static void makeAbcTag2 (const vString* const name, bool name_before) { tagEntryInfo e; initTagEntry (&e, vStringValue(name)); if (name_before) e.lineNumber--; e.kindName = "struct"; e.kind = 's'; makeTagEntry(&e); }*/ static void findAbcTags (void) { vString *name = vStringNew(); const unsigned char *line; while ((line = readLineFromInputFile()) != NULL) { /*int name_len = vStringLength(name);*/ /* underlines must be the same length or more */ /*if (name_len > 0 && (line[0] == '=' || line[0] == '-') && issame((const char*) line)) { makeAbcTag(name, true); }*/ /* if (line[1] == '%') { vStringClear(name); vStringCatS(name, (const char *) line); makeAbcTag(name, false); }*/ if (line[0] == 'T') { /*vStringClear(name);*/ vStringCatS(name, " / "); vStringCatS(name, (const char *) line); makeAbcTag(name, false); } else { vStringClear (name); if (! isspace(*line)) vStringCatS(name, (const char*) line); } } vStringDelete (name); } extern parserDefinition* AbcParser (void) { static const char *const patterns [] = { "*.abc", NULL }; static const char *const extensions [] = { "abc", NULL }; parserDefinition* const def = parserNew ("Abc"); def->kindTable = AbcKinds; def->kindCount = ARRAY_SIZE (AbcKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findAbcTags; return def; }
#ifndef _PERLDOC_H_ #define _PERLDOC_H_ #include <qobject.h> #include <kio/slavebase.h> class PerldocProtocol : public KIO::SlaveBase { public: PerldocProtocol(const QCString &pool, const QCString &app); virtual ~PerldocProtocol(); virtual void get(const KURL& url); virtual void stat(const KURL& url); virtual void mimetype(const KURL& url); virtual void listDir(const KURL& url); protected: void decodeURL(const KURL &url); void decodePath(QString path); QCString errorMessage(); }; #endif
/* * Copyright (C) 2012 Broadcom Corporation. * * 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 */ //xiangdong add for broadcom nfc #if 1//defined(TYQ_NFC_BCM_SUPPORT) #ifndef _BCM2079X_H #define _BCM2079X_H #define BCMNFC_MAGIC 0xFA /* * BCMNFC power control via ioctl * BCMNFC_POWER_CTL(0): power off * BCMNFC_POWER_CTL(1): power on * BCMNFC_WAKE_CTL(0): wake off * BCMNFC_WAKE_CTL(1): wake on */ #define BCMNFC_POWER_CTL _IO(BCMNFC_MAGIC, 0x01) #define BCMNFC_CHANGE_ADDR _IO(BCMNFC_MAGIC, 0x02) #define BCMNFC_READ_FULL_PACKET _IO(BCMNFC_MAGIC, 0x03) #define BCMNFC_SET_WAKE_ACTIVE_STATE _IO(BCMNFC_MAGIC, 0x04) #define BCMNFC_WAKE_CTL _IO(BCMNFC_MAGIC, 0x05) #define BCMNFC_READ_MULTI_PACKETS _IO(BCMNFC_MAGIC, 0x06) //#define NFC_BCM_INT_GPIO 106 struct bcm2079x_platform_data { unsigned int irq_gpio; unsigned int en_gpio; int wake_gpio; #if 1 unsigned int ven_gpio; unsigned int reg; const char *clk_src; unsigned int clk_src_gpio; #endif }; #endif #endif
// // BFAppDelegate.h // OpenShop // // Created by Jirka Apps // Copyright (c) 2015 Business Factory. All rights reserved. // @import UIKit; #import "BFTabBarController.h" NS_ASSUME_NONNULL_BEGIN /** * `BFAppDelegate` represents the aplication starting point. It implements `UIApplicationDelegate` * to manage the application lifecycle events. */ @interface BFAppDelegate : UIResponder <UIApplicationDelegate> /** * Application main window. */ @property (strong, nonatomic) UIWindow *window; @end NS_ASSUME_NONNULL_END
/** * * Copyright (C) 2009 Daniel-Constantin Mierla (asipto.com) * * This file is part of kamailio, a free SIP server. * * kamailio 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 * * kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _FMSG_H_ #define _FMSG_H_ #include "parser/msg_parser.h" int faked_msg_init(void); sip_msg_t* faked_msg_next(void); sip_msg_t* faked_msg_get_next(void); #endif
#ifndef ZM_VIDEOSTORE_H #define ZM_VIDEOSTORE_H #include "zm_config.h" #include "zm_define.h" #include "zm_ffmpeg.h" #include "zm_swscale.h" #include <memory> extern "C" { #include <libswresample/swresample.h> #include <libavutil/audio_fifo.h> #if HAVE_LIBAVUTIL_HWCONTEXT_H #include <libavutil/hwcontext.h> #endif } class Monitor; class ZMPacket; class PacketQueue; class VideoStore { private: struct CodecData { const AVCodecID codec_id; const char *codec_codec; const char *codec_name; const enum AVPixelFormat sw_pix_fmt; const enum AVPixelFormat hw_pix_fmt; #if HAVE_LIBAVUTIL_HWCONTEXT_H && LIBAVCODEC_VERSION_CHECK(57, 107, 0, 107, 0) const AVHWDeviceType hwdevice_type; #endif }; static struct CodecData codec_data[]; CodecData *chosen_codec_data; Monitor *monitor; AVOutputFormat *out_format; AVFormatContext *oc; AVStream *video_out_stream; AVStream *audio_out_stream; AVCodecContext *video_in_ctx; AVCodecContext *video_out_ctx; AVStream *video_in_stream; AVStream *audio_in_stream; const AVCodec *audio_in_codec; AVCodecContext *audio_in_ctx; // The following are used when encoding the audio stream to AAC AVCodec *audio_out_codec; AVCodecContext *audio_out_ctx; // Move this into the object so that we aren't constantly allocating/deallocating it on the stack AVPacket opkt; // we are transcoding AVFrame *video_in_frame; AVFrame *in_frame; AVFrame *out_frame; AVFrame *hw_frame; SWScale swscale; unsigned int packets_written; unsigned int frame_count; AVBufferRef *hw_device_ctx; SwrContext *resample_ctx; AVAudioFifo *fifo; uint8_t *converted_in_samples; const char *filename; const char *format; // These are for in int64_t video_first_pts; /* starting pts of first in frame/packet */ int64_t video_first_dts; int64_t audio_first_pts; int64_t audio_first_dts; int64_t video_last_pts; int64_t audio_last_pts; // These are for out, should start at zero. We assume they do not wrap because we just aren't going to save files that big. int64_t *next_dts; int64_t audio_next_pts; int max_stream_index; bool setup_resampler(); int write_packet(AVPacket *pkt, AVStream *stream); public: VideoStore( const char *filename_in, const char *format_in, AVStream *video_in_stream, AVCodecContext *video_in_ctx, AVStream *audio_in_stream, AVCodecContext *audio_in_ctx, Monitor * p_monitor); ~VideoStore(); bool open(); void write_video_packet(AVPacket &pkt); void write_audio_packet(AVPacket &pkt); int writeVideoFramePacket(const std::shared_ptr<ZMPacket> &pkt); int writeAudioFramePacket(const std::shared_ptr<ZMPacket> &pkt); int writePacket(const std::shared_ptr<ZMPacket> &pkt); int write_packets(PacketQueue &queue); void flush_codecs(); const char *get_codec() { if (chosen_codec_data) return chosen_codec_data->codec_codec; if (video_out_stream) return avcodec_get_name(video_out_stream->codecpar->codec_id); return ""; } }; #endif // ZM_VIDEOSTORE_H
#ifndef AKM09911_H #define AKM09911_H #include <linux/ioctl.h> #define AK09911_REG_WIA1 0x00 #define AK09911_REG_WIA2 0x01 #define AK09911_REG_INFO1 0x02 #define AK09911_REG_INFO2 0x03 #define AK09911_REG_ST1 0x10 #define AK09911_REG_HXL 0x11 #define AK09911_REG_HXH 0x12 #define AK09911_REG_HYL 0x13 #define AK09911_REG_HYH 0x14 #define AK09911_REG_HZL 0x15 #define AK09911_REG_HZH 0x16 #define AK09911_REG_TMPS 0x17 #define AK09911_REG_ST2 0x18 #define AK09911_REG_CNTL1 0x30 #define AK09911_REG_CNTL2 0x31 #define AK09911_REG_CNTL3 0x32 #define AK09911_FUSE_ASAX 0x60 #define AK09911_FUSE_ASAY 0x61 #define AK09911_FUSE_ASAZ 0x62 #define AK09911_MODE_SNG_MEASURE 0x01 #define AK09911_MODE_SELF_TEST 0x10 #define AK09911_MODE_FUSE_ACCESS 0x1F #define AK09911_MODE_POWERDOWN 0x00 #define AK09911_RESET_DATA 0x01 #define AK09911_REGS_SIZE 13 #define AK09911_WIA1_VALUE 0x48 #define AK09911_WIA2_VALUE 0x05 #define AKM_I2C_NAME "akm09911" #define AKM_MISCDEV_NAME "akm09911_dev" #define AKM_SYSCLS_NAME "compass" #define AKM_SYSDEV_NAME "akm09911" #define AKM_REG_MODE AK09911_REG_CNTL2 #define AKM_REG_RESET AK09911_REG_CNTL3 #define AKM_REG_STATUS AK09911_REG_ST1 #define AKM_MEASURE_TIME_US 10000 #define AKM_DRDY_IS_HIGH(x) ((x) & 0x01) #define AKM_SENSOR_INFO_SIZE 2 #define AKM_SENSOR_CONF_SIZE 3 #define AKM_SENSOR_DATA_SIZE 9 #define AKM_YPR_DATA_SIZE 16 #define AKM_RWBUF_SIZE 16 #define AKM_REGS_SIZE AK09911_REGS_SIZE #define AKM_REGS_1ST_ADDR AK09911_REG_WIA1 #define AKM_FUSE_1ST_ADDR AK09911_FUSE_ASAX #define AKM_MODE_SNG_MEASURE AK09911_MODE_SNG_MEASURE #define AKM_MODE_SELF_TEST AK09911_MODE_SELF_TEST #define AKM_MODE_FUSE_ACCESS AK09911_MODE_FUSE_ACCESS #define AKM_MODE_POWERDOWN AK09911_MODE_POWERDOWN #define AKM_RESET_DATA AK09911_RESET_DATA #define ACC_DATA_FLAG 0 #define MAG_DATA_FLAG 1 #define FUSION_DATA_FLAG 2 #define AKM_NUM_SENSORS 3 #define ACC_DATA_READY (1<<(ACC_DATA_FLAG)) #define MAG_DATA_READY (1<<(MAG_DATA_FLAG)) #define FUSION_DATA_READY (1<<(FUSION_DATA_FLAG)) #define AKMIO 0xA1 #define ECS_IOCTL_READ _IOWR(AKMIO, 0x01, char) #define ECS_IOCTL_WRITE _IOW(AKMIO, 0x02, char) #define ECS_IOCTL_RESET _IO(AKMIO, 0x03) #define ECS_IOCTL_SET_MODE _IOW(AKMIO, 0x10, char) #define ECS_IOCTL_SET_YPR _IOW(AKMIO, 0x11, int[AKM_YPR_DATA_SIZE]) #define ECS_IOCTL_GET_INFO _IOR(AKMIO, 0x20, unsigned char[AKM_SENSOR_INFO_SIZE]) #define ECS_IOCTL_GET_CONF _IOR(AKMIO, 0x21, unsigned char[AKM_SENSOR_CONF_SIZE]) #define ECS_IOCTL_GET_DATA _IOR(AKMIO, 0x22, unsigned char[AKM_SENSOR_DATA_SIZE]) #define ECS_IOCTL_GET_OPEN_STATUS _IOR(AKMIO, 0x23, int) #define ECS_IOCTL_GET_CLOSE_STATUS _IOR(AKMIO, 0x24, int) #define ECS_IOCTL_GET_DELAY _IOR(AKMIO, 0x25, long long int) #define ECS_IOCTL_GET_LAYOUT _IOR(AKMIO, 0x26, char) #define ECS_IOCTL_GET_ACCEL _IOR(AKMIO, 0x30, short[3]) struct akm09911_platform_data { char layout; int gpio_DRDY; int gpio_RSTN; }; #endif
namespace Map { class Vendig { public: short index; short amount; int value; DBMap vending_getdb(); void do_final_vending(); void do_init_vending(); void do_init_vending_autotrade(); void vending_reopen(Map::PC sd); void vending_closevending(Map::PC sd); bool vending_openvending(Map::PC sd, string message, char data, int count); void vending_vendinglistreq(Map::PC sd, int id); void vending_purchasereq(Map::PC sd, int aid, int uid, char data, int count); bool vending_search(Map::PC sd, int nameid); bool vending_searchall(Map::PC sd, Map::SearchStore s); }; }
/* * * Copyright (c) International Business Machines Corp., 2002 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* 01/02/2003 Port to LTP avenkat@us.ibm.com*/ /* 06/30/2001 Port to Linux nsharoff@us.ibm.com */ /* * NAME * mallopt * * CALLS * malloc(3x), mallopt(3x), mallinfo(3x). * * ALGORITHM * Set options, malloc memory, and check resource ussage. * * RESTRICTIONS */ #ifdef CONFIG_COLDFIRE #define __MALLOC_STANDARD__ #endif #include <errno.h> /* * NOTE: struct mallinfo is only exported via malloc.h (not stdlib.h), even * though it's an obsolete header for malloc(3). * * Inconsistencies rock. */ #include <malloc.h> #include <stdio.h> #include "test.h" #include "usctest.h" #include "safe_macros.h" #define FAILED 0 #define PASSED 1 int local_flag = PASSED; char *TCID = "mallopt01"; int block_number; FILE *temp; int TST_TOTAL = 1; extern int tst_COUNT; /* Test Case counter for tst_routines */ void printinfo(); #if !defined(UCLINUX) struct mallinfo info; int main(int argc, char *argv[]) { char *buf; tst_tmpdir(); buf = SAFE_MALLOC(NULL, 20480); /* * Check space usage. */ info = mallinfo(); if (info.uordblks < 20480) { printinfo(); tst_resm(TFAIL, "mallinfo failed: uordblks < 20K"); } if (info.smblks != 0) { printinfo(); tst_resm(TFAIL, "mallinfo failed: smblks != 0"); } free(buf); /* * Test mallopt's M_MXFAST and M_NLBLKS cmds. */ mallopt(M_MXFAST, 2048); mallopt(M_NLBLKS, 50); buf = SAFE_MALLOC(NULL, 1024); free(buf); unlink("core"); tst_rmdir(); tst_exit(); } void printinfo(void) { fprintf(stderr, "mallinfo structure:\n"); fprintf(stderr, "mallinfo.arena = %d\n", info.arena); fprintf(stderr, "mallinfo.ordblks = %d\n", info.ordblks); fprintf(stderr, "mallinfo.smblks = %d\n", info.smblks); fprintf(stderr, "mallinfo.hblkhd = %d\n", info.hblkhd); fprintf(stderr, "mallinfo.hblks = %d\n", info.hblks); fprintf(stderr, "mallinfo.usmblks = %d\n", info.usmblks); fprintf(stderr, "mallinfo.fsmblks = %d\n", info.fsmblks); fprintf(stderr, "mallinfo.uordblks = %d\n", info.uordblks); fprintf(stderr, "mallinfo.fordblks = %d\n", info.fordblks); fprintf(stderr, "mallinfo.keepcost = %d\n", info.keepcost); } #else int main(void) { tst_brkm(TCONF, NULL, "test is not available on uClinux"); } #endif /* if !defined(UCLINUX) */
// Maintainer: Max Howell <max.howell@methylblue.com>, (C) 2004 // Copyright: See COPYING file that comes with this distribution // // Description: a popupmenu to control various features of Pana // also provides Pana's helpMenu #ifndef PANA_ACTIONCLASSES_H #define PANA_ACTIONCLASSES_H #include "engineobserver.h" #include "prettypopupmenu.h" #include "sliderwidget.h" #include <kaction.h> #include <kactionclasses.h> #include <qguardedptr.h> class KActionCollection; class KHelpMenu; namespace Pana { class Menu : public PrettyPopupMenu { Q_OBJECT public: static Menu *instance(); static KPopupMenu *helpMenu( QWidget *parent = 0 ); enum MenuIds { ID_CONF_DECODER, ID_SHOW_VIS_SELECTOR, ID_SHOW_COVER_MANAGER, ID_CONFIGURE_EQUALIZER, ID_RESCAN_COLLECTION }; public slots: void slotActivated( int index ); private slots: void slotAboutToShow(); private: Menu(); static KHelpMenu *s_helpMenu; }; class MenuAction : public KAction { public: MenuAction( KActionCollection* ); virtual int plug( QWidget*, int index = -1 ); }; class PlayPauseAction : public KToggleAction, public EngineObserver { public: PlayPauseAction( KActionCollection* ); virtual void engineStateChanged( Engine::State, Engine::State = Engine::Empty ); }; class AnalyzerContainer : public QWidget { public: AnalyzerContainer( QWidget *parent ); protected: virtual void resizeEvent( QResizeEvent* ); virtual void mousePressEvent( QMouseEvent* ); virtual void contextMenuEvent( QContextMenuEvent* ); private: void changeAnalyzer(); QWidget *m_child; }; class AnalyzerAction : public KAction { public: AnalyzerAction( KActionCollection* ); virtual int plug( QWidget *, int index = -1 ); }; class VolumeAction : public KAction, public EngineObserver { public: VolumeAction( KActionCollection* ); virtual int plug( QWidget *, int index = -1 ); private: void engineVolumeChanged( int value ); QGuardedPtr<Pana::VolumeSlider> m_slider; }; class ToggleAction : public KToggleAction { public: ToggleAction( const QString &text, void ( *f ) ( bool ), KActionCollection* const ac, const char *name ); virtual void setChecked( bool b ); virtual void setEnabled( bool b ); private: void ( *m_function ) ( bool ); }; class SelectAction : public KSelectAction { public: SelectAction( const QString &text, void ( *f ) ( int ), KActionCollection* const ac, const char *name ); virtual void setCurrentItem( int n ); virtual void setEnabled( bool b ); virtual void setIcons( QStringList icons ); virtual QString currentText() const; QStringList icons() const; QString currentIcon() const; private: void ( *m_function ) ( int ); QStringList m_icons; }; class RandomAction : public SelectAction { public: RandomAction( KActionCollection *ac ); virtual void setCurrentItem( int n ); }; class FavorAction : public SelectAction { public: FavorAction( KActionCollection *ac ); }; class RepeatAction : public SelectAction { public: RepeatAction( KActionCollection *ac ); }; class BurnMenu : public KPopupMenu { Q_OBJECT public: enum MenuIds { CURRENT_PLAYLIST, SELECTED_TRACKS }; static KPopupMenu *instance(); private slots: void slotAboutToShow(); void slotActivated( int index ); private: BurnMenu(); }; class BurnMenuAction : public KAction { public: BurnMenuAction( KActionCollection* ); virtual int plug( QWidget*, int index = -1 ); }; class StopMenu : public KPopupMenu { Q_OBJECT public: enum MenuIds { NOW, AFTER_TRACK, AFTER_QUEUE }; static KPopupMenu *instance(); private slots: void slotAboutToShow(); void slotActivated( int index ); private: StopMenu(); }; class StopAction : public KAction { public: StopAction( KActionCollection* ); virtual int plug( QWidget*, int index = -1 ); }; } /* namespace Pana */ #endif /* PANA_ACTIONCLASSES_H */
/* * Network layer for MPlayer * by Bertrand BAUDET <bertrand_baudet@yahoo.com> * (C) 2001, MPlayer team. */ #ifndef MPLAYER_NETWORK_H #define MPLAYER_NETWORK_H #include <fcntl.h> #include <sys/time.h> #include <sys/types.h> #include "config.h" #if !HAVE_WINSOCK2_H #include <netdb.h> #include <netinet/in.h> #include <sys/socket.h> #include <arpa/inet.h> #endif #include "url.h" #include "http.h" #if !HAVE_CLOSESOCKET #define closesocket close #endif #if !HAVE_SOCKLEN_T typedef int socklen_t; #endif #define BUFFER_SIZE 2048 typedef struct { const char *mime_type; int demuxer_type; } mime_struct_t; typedef enum { streaming_stopped_e, streaming_playing_e } streaming_status; typedef struct streaming_control { URL_t *url; streaming_status status; int buffering; // boolean unsigned int prebuffer_size; char *buffer; unsigned int buffer_size; unsigned int buffer_pos; unsigned int bandwidth; // The downstream available int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl ); int (*streaming_seek)( int fd, off_t pos, struct streaming_control *stream_ctrl ); void *data; } streaming_ctrl_t; //int streaming_start( stream_t *stream, int *demuxer_type, URL_t *url ); streaming_ctrl_t *streaming_ctrl_new(void); int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size); int nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl ); int nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ); void streaming_ctrl_free( streaming_ctrl_t *streaming_ctrl ); int http_send_request(URL_t *url, off_t pos); HTTP_header_t *http_read_response(int fd); int http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry); URL_t* check4proxies(URL_t *url); #endif /* MPLAYER_NETWORK_H */
/* * Copyright (C) 2015 Hauke Petersen <mail@haukepetersen.de> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * @ingroup peta * @{ * * @file * @brief Global configuration options * * @author Hauke Petersen <mail@haukepetersen.de> */ #ifndef PETA_CONFIG_H #define PETA_CONFIG_H #include "periph/gpio.h" #include "periph/spi.h" #ifdef __cplusplus extern "C" { #endif /** * @brief Configure communication * @{ */ #define CONF_COMM_PAN (0x1593) #define CONF_COMM_ADDR {0x81, 0x95} #define CONF_COMM_CHAN (11U) #define CONF_COMM_MSGID (0xc5) #define CONF_COMM_SCALA_ADDR {0x61, 0x62} /** @} */ /** * @brief Sensor configuration * @{ */ #define CONF_SENSE_ADC (ADC_0) #define CONF_SENSE_CHAN (0) #define CONF_SENSE_RATE (10 * 1000) /** @} */ #ifdef __cplusplus } #endif #endif /* PETA_CONFIG_H*/ /** @} */
#ifndef __UM_SEGMENT_H #define __UM_SEGMENT_H extern int host_gdt_entry_tls_min; #define GDT_ENTRY_TLS_ENTRIES 3 #define GDT_ENTRY_TLS_MIN host_gdt_entry_tls_min #define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1) #endif
/* * linux/mm/page_io.c * * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds * * Swap reorganised 29.12.95, * Asynchronous swapping added 30.12.95. Stephen Tweedie * Removed race in async swapping. 14.4.1996. Bruno Haible * Add swap of shared pages through the page cache. 20.2.1998. Stephen Tweedie * Always use brw_page, life becomes simpler. 12 May 1998 Eric Biederman */ #include <linux/mm.h> #include <linux/kernel_stat.h> #include <linux/gfp.h> #include <linux/pagemap.h> #include <linux/swap.h> #include <linux/bio.h> #include <linux/swapops.h> #include <linux/writeback.h> #include <linux/frontswap.h> #include <linux/aio.h> #include <linux/blkdev.h> #include <asm/pgtable.h> static struct bio *get_swap_bio(gfp_t gfp_flags, struct page *page, bio_end_io_t end_io) { struct bio *bio; bio = bio_alloc(gfp_flags, 1); if (bio) { bio->bi_sector = map_swap_page(page, &bio->bi_bdev); bio->bi_sector <<= PAGE_SHIFT - 9; bio->bi_io_vec[0].bv_page = page; bio->bi_io_vec[0].bv_len = PAGE_SIZE; bio->bi_io_vec[0].bv_offset = 0; bio->bi_vcnt = 1; bio->bi_idx = 0; bio->bi_size = PAGE_SIZE; bio->bi_end_io = end_io; } return bio; } void end_swap_bio_write(struct bio *bio, int err) { const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); struct page *page = bio->bi_io_vec[0].bv_page; if (!uptodate) { SetPageError(page); /* * We failed to write the page out to swap-space. * Re-dirty the page in order to avoid it being reclaimed. * Also print a dire warning that things will go BAD (tm) * very quickly. * * Also clear PG_reclaim to avoid rotate_reclaimable_page() */ set_page_dirty(page); #ifndef CONFIG_VNSWAP printk(KERN_ALERT "Write-error on swap-device (%u:%u:%Lu)\n", imajor(bio->bi_bdev->bd_inode), iminor(bio->bi_bdev->bd_inode), (unsigned long long)bio->bi_sector); #endif ClearPageReclaim(page); } end_page_writeback(page); bio_put(bio); } void end_swap_bio_read(struct bio *bio, int err) { const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); struct page *page = bio->bi_io_vec[0].bv_page; if (!uptodate) { SetPageError(page); ClearPageUptodate(page); printk(KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n", imajor(bio->bi_bdev->bd_inode), iminor(bio->bi_bdev->bd_inode), (unsigned long long)bio->bi_sector); goto out; } SetPageUptodate(page); /* * There is no guarantee that the page is in swap cache - the software * suspend code (at least) uses end_swap_bio_read() against a non- * swapcache page. So we must check PG_swapcache before proceeding with * this optimization. */ if (likely(PageSwapCache(page))) { struct swap_info_struct *sis; sis = page_swap_info(page); if (sis->flags & SWP_BLKDEV) { /* * The swap subsystem performs lazy swap slot freeing, * expecting that the page will be swapped out again. * So we can avoid an unnecessary write if the page * isn't redirtied. * This is good for real swap storage because we can * reduce unnecessary I/O and enhance wear-leveling * if an SSD is used as the as swap device. * But if in-memory swap device (eg zram) is used, * this causes a duplicated copy between uncompressed * data in VM-owned memory and compressed data in * zram-owned memory. So let's free zram-owned memory * and make the VM-owned decompressed page *dirty*, * so the page should be swapped out somewhere again if * we again wish to reclaim it. */ struct gendisk *disk = sis->bdev->bd_disk; if (disk->fops->swap_slot_free_notify) { swp_entry_t entry; unsigned long offset; entry.val = page_private(page); offset = swp_offset(entry); SetPageDirty(page); disk->fops->swap_slot_free_notify(sis->bdev, offset); } } } out: unlock_page(page); bio_put(bio); } int __swap_writepage(struct page *page, struct writeback_control *wbc, void (*end_write_func)(struct bio *, int)); /* * We may have stale swap cache pages in memory: notice * them here and get rid of the unnecessary final write. */ int swap_writepage(struct page *page, struct writeback_control *wbc) { int ret = 0; if (try_to_free_swap(page)) { unlock_page(page); goto out; } if (frontswap_store(page) == 0) { set_page_writeback(page); unlock_page(page); end_page_writeback(page); goto out; } ret = __swap_writepage(page, wbc, end_swap_bio_write); out: return ret; } int __swap_writepage(struct page *page, struct writeback_control *wbc, void (*end_write_func)(struct bio *, int)) { struct bio *bio; int ret = 0, rw = WRITE; bio = get_swap_bio(GFP_NOIO, page, end_write_func); if (bio == NULL) { set_page_dirty(page); unlock_page(page); ret = -ENOMEM; goto out; } if (wbc->sync_mode == WB_SYNC_ALL) rw |= REQ_SYNC; count_vm_event(PSWPOUT); set_page_writeback(page); unlock_page(page); submit_bio(rw, bio); out: return ret; } int swap_readpage(struct page *page) { struct bio *bio; int ret = 0; VM_BUG_ON(!PageLocked(page)); VM_BUG_ON(PageUptodate(page)); if (frontswap_load(page) == 0) { SetPageUptodate(page); unlock_page(page); goto out; } bio = get_swap_bio(GFP_KERNEL, page, end_swap_bio_read); if (bio == NULL) { unlock_page(page); ret = -ENOMEM; goto out; } count_vm_event(PSWPIN); submit_bio(READ, bio); out: return ret; }
/* * Copyright (C) 2016-2017 Team Kodi * http://kodi.tv * * 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, 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; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #pragma once #include "addons/Resource.h" #include <memory> namespace ADDON { class CGameResource : public CResource { public: CGameResource(CAddonInfo addonInfo); virtual ~CGameResource() = default; static std::unique_ptr<CGameResource> FromExtension(CAddonInfo addonInfo, const cp_extension_t* ext); // implementation of CResource virtual bool IsAllowed(const std::string& file) const override { return true; } }; }
/* * This file is part of the coreboot project. * * Copyright (C) 2010 Advanced Micro Devices, Inc. * * 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 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <console/console.h> #include <device/device.h> #include <device/pci.h> #include <arch/io.h> #include <cpu/x86/msr.h> #include <cpu/amd/mtrr.h> #include <device/pci_def.h> #include "southbridge/amd/sb700/sb700.h" #include "southbridge/amd/sb700/smbus.h" void set_pcie_dereset(void); void set_pcie_reset(void); u8 is_dev3_present(void); /* * Mahogany uses GPIO 6 as PCIe slot reset, GPIO4 as GFX slot reset. We need to * pull it up before training the slot. ***/ void set_pcie_dereset() { u16 word; device_t sm_dev; /* GPIO 6 reset PCIe slot, GPIO 4 reset GFX PCIe */ sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0)); word = pci_read_config16(sm_dev, 0xA8); word |= (1 << 0) | (1 << 2); /* Set Gpio6,4 as output */ word &= ~((1 << 8) | (1 << 10)); pci_write_config16(sm_dev, 0xA8, word); } void set_pcie_reset() { u16 word; device_t sm_dev; /* GPIO 6 reset PCIe slot, GPIO 4 reset GFX PCIe */ sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0)); word = pci_read_config16(sm_dev, 0xA8); word &= ~((1 << 0) | (1 << 2)); /* Set Gpio6,4 as output */ word &= ~((1 << 8) | (1 << 10)); pci_write_config16(sm_dev, 0xA8, word); } #if 0 /* not tested yet */ /******************************************************** * mahogany uses SB700 GPIO9 to detect IDE_DMA66. * IDE_DMA66 is routed to GPIO 9. So we read Gpio 9 to * get the cable type, 40 pin or 80 pin? ********************************************************/ static void get_ide_dma66(void) { u8 byte; /*u32 sm_dev, ide_dev; */ device_t sm_dev, ide_dev; sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0)); byte = pci_read_config8(sm_dev, 0xA9); byte |= (1 << 5); /* Set Gpio9 as input */ pci_write_config8(sm_dev, 0xA9, byte); ide_dev = dev_find_slot(0, PCI_DEVFN(0x14, 1)); byte = pci_read_config8(ide_dev, 0x56); byte &= ~(7 << 0); if ((1 << 5) & pci_read_config8(sm_dev, 0xAA)) byte |= 2 << 0; /* mode 2 */ else byte |= 5 << 0; /* mode 5 */ pci_write_config8(ide_dev, 0x56, byte); } #endif /* get_ide_dma66 */ u8 is_dev3_present(void) { return 0; } /************************************************* * enable the dedicated function in mahogany board. * This function called early than rs780_enable. *************************************************/ static void mainboard_enable(device_t dev) { printk(BIOS_INFO, "Mainboard MAHOGANY Enable. dev=0x%p\n", dev); set_pcie_dereset(); /* get_ide_dma66(); */ } struct chip_operations mainboard_ops = { .enable_dev = mainboard_enable, };
/* * 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. */ /** * @author Intel, Mikhail Y. Fursov */ #ifndef _COMPILATION_CONTEXT_H_ #define _COMPILATION_CONTEXT_H_ #include <assert.h> namespace Jitrino { class MemoryManager; class CompilationInterface; class JITInstanceContext; class ProfilingInterface; class IRManager; class SessionAction; class LogStreams; class HPipeline; class InliningContext; #ifdef _IPF_ #else namespace Ia32{ class IRManager; } #endif class CompilationContext { public: // Context of the current compilation // Exists only during a compilation of method // This class uses destructor and must not be created on MemoryManager CompilationContext(MemoryManager& mm, CompilationInterface* ci, JITInstanceContext* jit); ~CompilationContext(); CompilationInterface* getVMCompilationInterface() const {return compilationInterface;} MemoryManager& getCompilationLevelMemoryManager() const {return mm;} JITInstanceContext* getCurrentJITContext() const {return jitContext;} ProfilingInterface* getProfilingInterface() const; bool hasDynamicProfileToUse() const; bool isCompilationFailed() const {return compilationFailed;} void setCompilationFailed(bool f) {compilationFailed = f;} bool isCompilationFinished() const {return compilationFinished;} void setCompilationFinished(bool f) {compilationFinished = f;} IRManager* getHIRManager() const {return hirm;} void setHIRManager(IRManager* irm) {hirm = irm;} SessionAction* getCurrentSessionAction() const {return currentSessionAction;} void setCurrentSessionAction(SessionAction* sa) {currentSessionAction = sa;} void setCurrentSessionNum(int num) {currentSessionNum = num;} int getCurrentSessionNum() const {return currentSessionNum;} void setCurrentLogs(LogStreams* lsp) {currentLogStreams = lsp;} LogStreams* getCurrentLogs() const {return currentLogStreams;} void setPipeline(HPipeline* pipe) {pipeline = pipe;} HPipeline* getPipeline () const {return pipeline;} void setInliningContext(InliningContext* c) {inliningContext = c;} InliningContext* getInliningContext() const {return inliningContext;} static CompilationContext* getCurrentContext(); #ifdef _IPF_ #else Ia32::IRManager* getLIRManager() const {return lirm;} void setLIRManager(Ia32::IRManager* irm) {lirm = irm;} #endif private: MemoryManager& mm; CompilationInterface* compilationInterface; bool compilationFailed; bool compilationFinished; JITInstanceContext* jitContext; IRManager* hirm; #ifdef _IPF_ #else Ia32::IRManager* lirm; #endif SessionAction* currentSessionAction; int currentSessionNum; LogStreams* currentLogStreams; HPipeline* pipeline; InliningContext* inliningContext; void init(); void initCompilationMode(); public: int stageId; }; }//namespace #endif
/*************************************************************************** * Copyright (c) 1999-2010, Broadcom Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * 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. * * Module Description: * DO NOT EDIT THIS FILE DIRECTLY * * This module was generated magically with RDB from a source description * file. You must edit the source file for changes to be made to this file. * * * Date: Generated on Mon May 17 03:36:55 2010 * MD5 Checksum 48de0819069cffb1a27afe66f66cd920 * * Compiled with: RDB Utility combo_header.pl * RDB Parser 3.0 * unknown unknown * Perl Interpreter 5.008008 * Operating System linux * * Revision History: * * $brcm_Log: $ * ***************************************************************************/ #ifndef BCHP_IRQ1_H__ #define BCHP_IRQ1_H__ /*************************************************************************** *IRQ1 - Level 2 PCI Interrupt Enable/Status ***************************************************************************/ #define BCHP_IRQ1_IRQEN 0x00406788 /* Interrupt Enable */ #define BCHP_IRQ1_IRQSTAT 0x0040678c /* Interrupt Status */ #endif /* #ifndef BCHP_IRQ1_H__ */ /* End of File */
/** * \file sha512.h * * \brief SHA-384 and SHA-512 cryptographic hash function * * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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. * * This file is part of mbed TLS (https://tls.mbed.org) */ #ifndef MBEDTLS_SHA512_H #define MBEDTLS_SHA512_H #if !defined(MBEDTLS_CONFIG_FILE) #include "config.h" #else #include MBEDTLS_CONFIG_FILE #endif #include <stddef.h> #if !defined(MBEDTLS_SHA512_ALT) // Regular implementation // #ifdef __cplusplus extern "C" { #endif /** * \brief SHA-512 context structure */ typedef struct { uint64_t total[2]; /*!< number of bytes processed */ uint64_t state[8]; /*!< intermediate digest state */ unsigned char buffer[128]; /*!< data block being processed */ int is384; /*!< 0 => SHA-512, else SHA-384 */ } mbedtls_sha512_context; /** * \brief Initialize SHA-512 context * * \param ctx SHA-512 context to be initialized */ void mbedtls_sha512_init( mbedtls_sha512_context *ctx ); /** * \brief Clear SHA-512 context * * \param ctx SHA-512 context to be cleared */ void mbedtls_sha512_free( mbedtls_sha512_context *ctx ); /** * \brief Clone (the state of) a SHA-512 context * * \param dst The destination context * \param src The context to be cloned */ void mbedtls_sha512_clone( mbedtls_sha512_context *dst, const mbedtls_sha512_context *src ); /** * \brief SHA-512 context setup * * \param ctx context to be initialized * \param is384 0 = use SHA512, 1 = use SHA384 */ void mbedtls_sha512_starts( mbedtls_sha512_context *ctx, int is384 ); /** * \brief SHA-512 process buffer * * \param ctx SHA-512 context * \param input buffer holding the data * \param ilen length of the input data */ void mbedtls_sha512_update( mbedtls_sha512_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief SHA-512 final digest * * \param ctx SHA-512 context * \param output SHA-384/512 checksum result */ void mbedtls_sha512_finish( mbedtls_sha512_context *ctx, unsigned char output[64] ); #ifdef __cplusplus } #endif #else /* MBEDTLS_SHA512_ALT */ #include "sha512_alt.h" #endif /* MBEDTLS_SHA512_ALT */ #ifdef __cplusplus extern "C" { #endif /** * \brief Output = SHA-512( input buffer ) * * \param input buffer holding the data * \param ilen length of the input data * \param output SHA-384/512 checksum result * \param is384 0 = use SHA512, 1 = use SHA384 */ void mbedtls_sha512( const unsigned char *input, size_t ilen, unsigned char output[64], int is384 ); /** * \brief Checkup routine * * \return 0 if successful, or 1 if the test failed */ int mbedtls_sha512_self_test( int verbose ); /* Internal use */ void mbedtls_sha512_process( mbedtls_sha512_context *ctx, const unsigned char data[128] ); #ifdef __cplusplus } #endif #endif /* mbedtls_sha512.h */
/* * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> * Copyright (C) 2007 Eric Seidel <eric@webkit.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #pragma once #include "SVGAnimatedBoolean.h" #include "SVGExternalResourcesRequired.h" #include "SVGGraphicsElement.h" #include "SVGURIReference.h" namespace WebCore { class SVGAElement final : public SVGGraphicsElement, public SVGURIReference, public SVGExternalResourcesRequired { public: static Ref<SVGAElement> create(const QualifiedName&, Document&); private: SVGAElement(const QualifiedName&, Document&); bool isValid() const final { return SVGTests::isValid(); } String title() const final; String target() const final { return svgTarget(); } void parseAttribute(const QualifiedName&, const AtomicString&) final; void svgAttributeChanged(const QualifiedName&) final; RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; bool childShouldCreateRenderer(const Node&) const final; void defaultEventHandler(Event&) final; bool supportsFocus() const final; bool isMouseFocusable() const final; bool isKeyboardFocusable(KeyboardEvent&) const final; bool isFocusable() const final; bool isURLAttribute(const Attribute&) const final; bool canStartSelection() const final; int tabIndex() const final; bool willRespondToMouseClickEvents() final; BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAElement) // This declaration used to define a non-virtual "String& target() const" method, that clashes with "virtual String Element::target() const". // That's why it has been renamed to "svgTarget", the CodeGenerators take care of calling svgTargetAnimated() instead of targetAnimated(), see CodeGenerator.pm. DECLARE_ANIMATED_STRING(SVGTarget, svgTarget) DECLARE_ANIMATED_STRING_OVERRIDE(Href, href) DECLARE_ANIMATED_BOOLEAN_OVERRIDE(ExternalResourcesRequired, externalResourcesRequired) END_DECLARE_ANIMATED_PROPERTIES }; } // namespace WebCore
/* * Copyright (c) 2000, Red Hat, Inc. * * 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. * * A copy of the GNU General Public License can be found at * http://www.gnu.org/ * * Written by DJ Delorie <dj@cygnus.com> * */ #ifndef SETUP_NIO_IE5_H #define SETUP_NIO_IE5_H #include <wininet.h> class NetIO_IE5:public NetIO { HINTERNET connection; public: NetIO_IE5 (char const *url); ~NetIO_IE5 (); virtual int ok (); virtual int read (char *buf, int nbytes); void flush_io (); }; #endif /* SETUP_NIO_IE5_H */
/********************************************************************** * * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful but, except * as otherwise stated in writing, without any warranty; without even the * implied warranty of merchantability or fitness for a particular purpose. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * * The full GNU General Public License is included in this distribution in * the file called "COPYING". * * Contact Information: * Imagination Technologies Ltd. <gpl-support@imgtec.com> * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK * ******************************************************************************/ #ifndef __SGXINFOKM_H__ #define __SGXINFOKM_H__ #include "sgxdefs.h" #include "device.h" #include "sysconfig.h" #include "sgxscript.h" #include "sgxinfo.h" #define SGX_HOSTPORT_PRESENT 0x00000001UL #define PVRSRV_USSE_EDM_POWMAN_IDLE_REQUEST (1UL << 0) #define PVRSRV_USSE_EDM_POWMAN_POWEROFF_REQUEST (1UL << 1) #define PVRSRV_USSE_EDM_POWMAN_IDLE_COMPLETE (1UL << 2) #define PVRSRV_USSE_EDM_POWMAN_POWEROFF_COMPLETE (1UL << 3) #define PVRSRV_USSE_EDM_POWMAN_POWEROFF_RESTART_IMMEDIATE (1UL << 4) #define PVRSRV_USSE_EDM_POWMAN_NO_WORK (1UL << 5) #define PVRSRV_USSE_EDM_INTERRUPT_HWR (1UL << 0) #define PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER (1UL << 1) #define PVRSRV_USSE_EDM_RESMAN_CLEANUP_RT_REQUEST 0x01UL #define PVRSRV_USSE_EDM_RESMAN_CLEANUP_RC_REQUEST 0x02UL #define PVRSRV_USSE_EDM_RESMAN_CLEANUP_TC_REQUEST 0x04UL #define PVRSRV_USSE_EDM_RESMAN_CLEANUP_2DC_REQUEST 0x08UL #define PVRSRV_USSE_EDM_RESMAN_CLEANUP_COMPLETE 0x10UL #define PVRSRV_USSE_EDM_RESMAN_CLEANUP_INVALPD 0x20UL #define PVRSRV_USSE_EDM_RESMAN_CLEANUP_INVALPT 0x40UL struct PVRSRV_SGX_CCB_INFO; struct PVRSRV_SGXDEV_INFO { enum PVRSRV_DEVICE_TYPE eDeviceType; enum PVRSRV_DEVICE_CLASS eDeviceClass; u8 ui8VersionMajor; u8 ui8VersionMinor; u32 ui32CoreConfig; u32 ui32CoreFlags; void __iomem *pvRegsBaseKM; void *hRegMapping; struct IMG_SYS_PHYADDR sRegsPhysBase; u32 ui32RegSize; u32 ui32CoreClockSpeed; u32 ui32uKernelTimerClock; void *psStubPBDescListKM; struct IMG_DEV_PHYADDR sKernelPDDevPAddr; void *pvDeviceMemoryHeap; struct PVRSRV_KERNEL_MEM_INFO *psKernelCCBMemInfo; struct PVRSRV_SGX_KERNEL_CCB *psKernelCCB; struct PVRSRV_SGX_CCB_INFO *psKernelCCBInfo; struct PVRSRV_KERNEL_MEM_INFO *psKernelCCBCtlMemInfo; struct PVRSRV_SGX_CCB_CTL *psKernelCCBCtl; struct PVRSRV_KERNEL_MEM_INFO *psKernelCCBEventKickerMemInfo; u32 *pui32KernelCCBEventKicker; u32 ui32TAKickAddress; u32 ui32TexLoadKickAddress; u32 ui32VideoHandlerAddress; u32 ui32KickTACounter; u32 ui32KickTARenderCounter; struct PVRSRV_KERNEL_MEM_INFO *psKernelHWPerfCBMemInfo; struct PVRSRV_SGXDEV_DIFF_INFO sDiffInfo; u32 ui32HWGroupRequested; u32 ui32HWReset; u32 ui32ClientRefCount; u32 ui32CacheControl; void *pvMMUContextList; IMG_BOOL bForcePTOff; u32 ui32EDMTaskReg0; u32 ui32EDMTaskReg1; u32 ui32ClkGateCtl; u32 ui32ClkGateCtl2; u32 ui32ClkGateStatusMask; struct SGX_INIT_SCRIPTS sScripts; void *hBIFResetPDOSMemHandle; struct IMG_DEV_PHYADDR sBIFResetPDDevPAddr; struct IMG_DEV_PHYADDR sBIFResetPTDevPAddr; struct IMG_DEV_PHYADDR sBIFResetPageDevPAddr; u32 *pui32BIFResetPD; u32 *pui32BIFResetPT; void *hTimer; u32 ui32TimeStamp; u32 ui32NumResets; struct PVRSRV_KERNEL_MEM_INFO *psKernelSGXHostCtlMemInfo; struct PVRSRV_SGX_HOST_CTL *psSGXHostCtl; u32 ui32Flags; #if defined(PDUMP) struct PVRSRV_SGX_PDUMP_CONTEXT sPDContext; #endif u32 asSGXDevData[SGX_MAX_DEV_DATA]; }; struct SGX_TIMING_INFORMATION { u32 ui32CoreClockSpeed; u32 ui32HWRecoveryFreq; u32 ui32ActivePowManLatencyms; u32 ui32uKernelFreq; }; struct SGX_DEVICE_MAP { u32 ui32Flags; struct IMG_SYS_PHYADDR sRegsSysPBase; struct IMG_CPU_PHYADDR sRegsCpuPBase; void __iomem *pvRegsCpuVBase; u32 ui32RegsSize; struct IMG_SYS_PHYADDR sSPSysPBase; struct IMG_CPU_PHYADDR sSPCpuPBase; void *pvSPCpuVBase; u32 ui32SPSize; struct IMG_SYS_PHYADDR sLocalMemSysPBase; struct IMG_DEV_PHYADDR sLocalMemDevPBase; struct IMG_CPU_PHYADDR sLocalMemCpuPBase; u32 ui32LocalMemSize; u32 ui32IRQ; }; struct PVRSRV_STUB_PBDESC; struct PVRSRV_STUB_PBDESC { u32 ui32RefCount; u32 ui32TotalPBSize; struct PVRSRV_KERNEL_MEM_INFO *psSharedPBDescKernelMemInfo; struct PVRSRV_KERNEL_MEM_INFO *psHWPBDescKernelMemInfo; struct PVRSRV_KERNEL_MEM_INFO **ppsSubKernelMemInfos; u32 ui32SubKernelMemInfosCount; void *hDevCookie; struct PVRSRV_KERNEL_MEM_INFO *psBlockKernelMemInfo; struct PVRSRV_STUB_PBDESC *psNext; }; struct PVRSRV_SGX_CCB_INFO { struct PVRSRV_KERNEL_MEM_INFO *psCCBMemInfo; struct PVRSRV_KERNEL_MEM_INFO *psCCBCtlMemInfo; struct PVRSRV_SGX_COMMAND *psCommands; u32 *pui32WriteOffset; volatile u32 *pui32ReadOffset; #if defined(PDUMP) u32 ui32CCBDumpWOff; #endif }; enum PVRSRV_ERROR SGXRegisterDevice(struct PVRSRV_DEVICE_NODE *psDeviceNode); void SysGetSGXTimingInformation(struct SGX_TIMING_INFORMATION *psSGXTimingInfo); void SGXReset(struct PVRSRV_SGXDEV_INFO *psDevInfo, u32 ui32PDUMPFlags); #endif
#ifndef mcfqspi_h #define mcfqspi_h #include <linux/config.h> #define QSPIIOCS_DOUT_HIZ 1 /* QMR[DOHIE] set hi-z dout between transfers */ #define QSPIIOCS_BITS 2 /* QMR[BITS] set transfer size */ #define QSPIIOCG_BITS 3 /* QMR[BITS] get transfer size */ #define QSPIIOCS_CPOL 4 /* QMR[CPOL] set SCK inactive state */ #define QSPIIOCS_CPHA 5 /* QMR[CPHA] set SCK phase, 1=rising edge */ #define QSPIIOCS_BAUD 6 /* QMR[BAUD] set SCK baud rate divider */ #define QSPIIOCS_QCD 7 /* QDLYR[QCD] set start delay */ #define QSPIIOCS_DTL 8 /* QDLYR[DTL] set after delay */ #define QSPIIOCS_CONT 9 /* continuous CS asserted during transfer */ #define QSPIIOCS_READDATA 10 /* set data send during read */ typedef struct qspi_read_data { unsigned int length; unsigned char buf[32]; /* data to send during read */ int loop : 1; } qspi_read_data; #endif
// // NSFileManager+Verification.h // Sparkle // // Created by Andy Matuschak on 3/16/06. // Copyright 2006 Andy Matuschak. All rights reserved. // #import <Cocoa/Cocoa.h> // For the paranoid folks! @interface NSFileManager (SUVerification) - (BOOL)validatePath:(NSString *)path withMD5Hash:(NSString *)hash; - (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString; @end
/* * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, * P1003.1b-1993, p. 162 * * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id: aio_return.c,v 1.2.2.1 2010/08/09 07:37:18 ralf Exp $ */ #if HAVE_CONFIG_H #include "config.h" #endif #include <aio.h> #include <errno.h> #include <rtems/system.h> #include <rtems/seterr.h> ssize_t aio_return( const struct aiocb *aiocbp __attribute__((unused)) ) { rtems_set_errno_and_return_minus_one( ENOSYS ); }
/** * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * * 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/>. * */ /** * Minitronics v1.0/1.1 pin assignments */ #ifndef __AVR_ATmega1281__ #error "Oops! Make sure you have 'Minitronics' selected from the 'Tools -> Boards' menu." #endif #define BOARD_NAME "Minitronics v1.0 / v1.1" #define LARGE_FLASH true #define X_STEP_PIN 48 #define X_DIR_PIN 47 #define X_ENABLE_PIN 49 #define X_MIN_PIN 5 #define X_MAX_PIN 2 #define Y_STEP_PIN 39 // A6 #define Y_DIR_PIN 40 // A0 #define Y_ENABLE_PIN 38 #define Y_MIN_PIN 2 #define Y_MAX_PIN 15 #define Z_STEP_PIN 42 // A2 #define Z_DIR_PIN 43 // A6 #define Z_ENABLE_PIN 41 // A1 #define Z_MIN_PIN 6 #define Z_MAX_PIN -1 #define E0_STEP_PIN 45 #define E0_DIR_PIN 44 #define E0_ENABLE_PIN 27 #define E1_STEP_PIN 36 #define E1_DIR_PIN 35 #define E1_ENABLE_PIN 37 #define E2_STEP_PIN -1 #define E2_DIR_PIN -1 #define E2_ENABLE_PIN -1 #define SDSS 16 #define LED_PIN 46 #define FAN_PIN 9 #define TEMP_0_PIN 7 // ANALOG NUMBERING #define TEMP_1_PIN 6 // ANALOG NUMBERING #define TEMP_BED_PIN 6 // ANALOG NUMBERING #define HEATER_0_PIN 7 // EXTRUDER 1 #define HEATER_1_PIN 8 // EXTRUDER 2 #define HEATER_BED_PIN 3 // BED #define BEEPER_PIN -1 #define LCD_PINS_RS -1 #define LCD_PINS_ENABLE -1 #define LCD_PINS_D4 -1 #define LCD_PINS_D5 -1 #define LCD_PINS_D6 -1 #define LCD_PINS_D7 -1 // Buttons are directly attached using keypad #define BTN_EN1 -1 #define BTN_EN2 -1 #define BTN_ENC -1 // the click #define BLEN_C 2 #define BLEN_B 1 #define BLEN_A 0
/* * Copyright 2008, Freescale Semiconductor, Inc * Andy Fleming * * Copyright 2013 Google Inc. All rights reserved. * Copyright 2017 Intel Corporation * * MultiMediaCard (MMC), eMMC and Secure Digital (SD) erase support code. * This code is controller independent. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include "sd_mmc.h" #include "storage.h" uint64_t storage_block_erase(struct storage_media *media, uint64_t start, uint64_t count) { struct mmc_command cmd; struct sd_mmc_ctrlr *ctrlr = media->ctrlr; if (storage_block_setup(media, start, count, 0) == 0) return 0; cmd.cmdidx = MMC_CMD_ERASE_GROUP_START; cmd.resp_type = CARD_RSP_R1; cmd.cmdarg = start; cmd.flags = 0; if (ctrlr->send_cmd(ctrlr, &cmd, NULL)) return 0; cmd.cmdidx = MMC_CMD_ERASE_GROUP_END; cmd.cmdarg = start + count - 1; cmd.resp_type = CARD_RSP_R1; cmd.flags = 0; if (ctrlr->send_cmd(ctrlr, &cmd, NULL)) return 0; cmd.cmdidx = MMC_CMD_ERASE; cmd.cmdarg = MMC_TRIM_ARG; /* just unmap blocks */ cmd.resp_type = CARD_RSP_R1; cmd.flags = 0; if (ctrlr->send_cmd(ctrlr, &cmd, NULL)) return 0; size_t erase_blocks; /* * Timeout for TRIM operation on one erase group is defined as: * TRIM timeout = 300ms x TRIM_MULT * * This timeout is expressed in units of 100us to sd_mmc_send_status. * * Hence, timeout_per_erase_block = TRIM timeout * 1000us/100us; */ size_t timeout_per_erase_block = (media->trim_mult * 300) * 10; int err = 0; erase_blocks = ALIGN_UP(count, media->erase_blocks) / media->erase_blocks; while (erase_blocks) { /* * To avoid overflow of timeout value, loop in calls to * sd_mmc_send_status for erase_blocks number of times. */ err = sd_mmc_send_status(media, timeout_per_erase_block); /* Send status successful, erase action complete. */ if (err == 0) break; erase_blocks--; } /* Total timeout done. Still status not successful. */ if (err) { sd_mmc_error("TRIM operation not successful within timeout.\n"); return 0; } return count; }
#include "mfbmap.h" #include "../../../mfb/mfbcmap.c"
/** ****************************************************************************** * @file usbd_cdc_if_template.h * @author MCD Application Team * @version V2.3.0 * @date 04-November-2014 * @brief Header for usbd_cdc_if_template.c file. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2014 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 __USBD_CDC_IF_TEMPLATE_H #define __USBD_CDC_IF_TEMPLATE_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "usbd_cdc.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ extern USBD_CDC_ItfTypeDef USBD_CDC_Template_fops; /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #ifdef __cplusplus } #endif #endif /* __USBD_CDC_IF_TEMPLATE_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/*********************************************************************************** * * * Voreen - The Volume Rendering Engine * * * * Copyright (C) 2005-2013 University of Muenster, Germany. * * Visualization and Computer Graphics Group <http://viscg.uni-muenster.de> * * For a list of authors please refer to the file "CREDITS.txt". * * * * This file is part of the Voreen software package. Voreen is free software: * * you can redistribute it and/or modify it under the terms of the GNU General * * Public License version 2 as published by the Free Software Foundation. * * * * Voreen 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 in the file * * "LICENSE.txt" along with this file. If not, see <http://www.gnu.org/licenses/>. * * * * For non-commercial academic use see the license exception specified in the file * * "LICENSE-academic.txt". To get information about commercial licensing please * * contact the authors. * * * ***********************************************************************************/ #ifndef VRN_SQUAREIMAGEFILTER_H #define VRN_SQUAREIMAGEFILTER_H #include "modules/itk/processors/itkprocessor.h" #include "voreen/core/processors/volumeprocessor.h" #include "voreen/core/ports/volumeport.h" #include "voreen/core/ports/geometryport.h" #include <string> #include "voreen/core/properties/boolproperty.h" namespace voreen { class VolumeBase; class SquareImageFilterITK : public ITKProcessor { public: SquareImageFilterITK(); virtual Processor* create() const; virtual std::string getCategory() const { return "Volume Processing/Filtering/ImageIntensity"; } virtual std::string getClassName() const { return "SquareImageFilterITK"; } virtual CodeState getCodeState() const { return CODE_STATE_STABLE; } protected: virtual void setDescriptions() { setDescription("<a href=\"http://www.itk.org/Doxygen/html/classitk_1_1SquareImageFilter.html\">Go to ITK-Doxygen-Description</a>"); } template<class T> void squareImageFilterITK(); virtual void process(); private: VolumePort inport1_; VolumePort outport1_; BoolProperty enableProcessing_; static const std::string loggerCat_; }; } #endif
/* * Copyright (C) 2009, 2013 Apple 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: * 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 APPLE INC. ``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 APPLE INC. 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 SerializedScriptValue_h #define SerializedScriptValue_h #include "ScriptState.h" #include <bindings/ScriptValue.h> #include <heap/Strong.h> #include <runtime/ArrayBuffer.h> #include <runtime/JSCJSValue.h> #include <wtf/Forward.h> #include <wtf/RefCounted.h> #include <wtf/text/WTFString.h> typedef const struct OpaqueJSContext* JSContextRef; typedef const struct OpaqueJSValue* JSValueRef; namespace WebCore { class MessagePort; typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray; typedef Vector<RefPtr<JSC::ArrayBuffer>, 1> ArrayBufferArray; enum SerializationReturnCode { SuccessfullyCompleted, StackOverflowError, InterruptedExecutionError, ValidationError, ExistingExceptionError, DataCloneError, UnspecifiedError }; enum SerializationErrorMode { NonThrowing, Throwing }; class SharedBuffer; class SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue> { public: WEBCORE_EXPORT static RefPtr<SerializedScriptValue> create(JSC::ExecState*, JSC::JSValue, MessagePortArray*, ArrayBufferArray*, SerializationErrorMode = Throwing); WEBCORE_EXPORT static RefPtr<SerializedScriptValue> create(const String&); static Ref<SerializedScriptValue> adopt(Vector<uint8_t>&& buffer) { return adoptRef(*new SerializedScriptValue(WTFMove(buffer))); } static Ref<SerializedScriptValue> nullValue(); WEBCORE_EXPORT JSC::JSValue deserialize(JSC::ExecState*, JSC::JSGlobalObject*, MessagePortArray*, SerializationErrorMode = Throwing); static uint32_t wireFormatVersion(); String toString(); // API implementation helpers. These don't expose special behavior for ArrayBuffers or MessagePorts. WEBCORE_EXPORT static RefPtr<SerializedScriptValue> create(JSContextRef, JSValueRef, JSValueRef* exception); WEBCORE_EXPORT JSValueRef deserialize(JSContextRef, JSValueRef* exception); const Vector<uint8_t>& data() const { return m_data; } bool hasBlobURLs() const { return !m_blobURLs.isEmpty(); } void blobURLs(Vector<String>&) const; static Ref<SerializedScriptValue> createFromWireBytes(Vector<uint8_t>&& data) { return adoptRef(*new SerializedScriptValue(WTFMove(data))); } const Vector<uint8_t>& toWireBytes() const { return m_data; } WEBCORE_EXPORT ~SerializedScriptValue(); private: typedef Vector<JSC::ArrayBufferContents> ArrayBufferContentsArray; static void maybeThrowExceptionIfSerializationFailed(JSC::ExecState*, SerializationReturnCode); static bool serializationDidCompleteSuccessfully(SerializationReturnCode); static std::unique_ptr<ArrayBufferContentsArray> transferArrayBuffers(JSC::ExecState*, ArrayBufferArray&, SerializationReturnCode&); void addBlobURL(const String&); WEBCORE_EXPORT SerializedScriptValue(Vector<unsigned char>&&); SerializedScriptValue(Vector<unsigned char>&&, const Vector<String>& blobURLs); SerializedScriptValue(Vector<unsigned char>&&, const Vector<String>& blobURLs, std::unique_ptr<ArrayBufferContentsArray>&&); Vector<unsigned char> m_data; std::unique_ptr<ArrayBufferContentsArray> m_arrayBufferContentsArray; Vector<Vector<uint16_t>> m_blobURLs; }; } #endif // SerializedScriptValue_h
/* libSoX effect: Output audio to a file (c) 2008 robs@users.sourceforge.net * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "sox_i.h" typedef struct {sox_format_t * file;} priv_t; static int getopts(sox_effect_t * effp, int argc, char * * argv) { priv_t * p = (priv_t *)effp->priv; if (argc != 1 || !(p->file = (sox_format_t *)argv[0]) || p->file->mode != 'w') return SOX_EOF; return SOX_SUCCESS; } static int flow(sox_effect_t *effp, sox_sample_t const * ibuf, sox_sample_t * obuf, size_t * isamp, size_t * osamp) { priv_t * p = (priv_t *)effp->priv; /* Write out *isamp samples */ size_t len = sox_write(p->file, ibuf, *isamp); /* len is the number of samples that were actually written out; if this is * different to *isamp, then something has gone wrong--most often, it's * out of disc space */ if (len != *isamp) { lsx_fail("%s: %s", p->file->filename, p->file->sox_errstr); return SOX_EOF; } /* Outputting is the last `effect' in the effect chain so always passes * 0 samples on to the next effect (as there isn't one!) */ (void)obuf, *osamp = 0; return SOX_SUCCESS; /* All samples output successfully */ } sox_effect_handler_t const * sox_output_effect_fn(void) { static sox_effect_handler_t handler = { "output", NULL, SOX_EFF_MCHAN | SOX_EFF_DEPRECATED, getopts, NULL, flow, NULL, NULL, NULL, sizeof(priv_t) }; return &handler; }
/* * Copyright (C) 2013, 2014 Apple 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: * 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 APPLE INC. ``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 APPLE INC. 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. */ #pragma once #if ENABLE(VIDEO_TRACK) #include "Color.h" #include "VTTCue.h" namespace WebCore { class GenericCueData; // A "generic" cue is a non-WebVTT cue, so it is not positioned/sized with the WebVTT logic. class TextTrackCueGeneric final : public VTTCue { public: static Ref<TextTrackCueGeneric> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content) { return adoptRef(*new TextTrackCueGeneric(context, start, end, content)); } ExceptionOr<void> setLine(double) final; ExceptionOr<void> setPosition(double) final; bool useDefaultPosition() const { return m_useDefaultPosition; } double baseFontSizeRelativeToVideoHeight() const { return m_baseFontSizeRelativeToVideoHeight; } void setBaseFontSizeRelativeToVideoHeight(double size) { m_baseFontSizeRelativeToVideoHeight = size; } double fontSizeMultiplier() const { return m_fontSizeMultiplier; } void setFontSizeMultiplier(double size) { m_fontSizeMultiplier = size; } const String& fontName() const { return m_fontName; } void setFontName(const String& name) { m_fontName = name; } const Color& foregroundColor() const { return m_foregroundColor; } void setForegroundColor(const Color& color) { m_foregroundColor = color; } const Color& backgroundColor() const { return m_backgroundColor; } void setBackgroundColor(const Color& color) { m_backgroundColor = color; } const Color& highlightColor() const { return m_highlightColor; } void setHighlightColor(const Color& color) { m_highlightColor = color; } void setFontSize(int, const IntSize&, bool important) final; private: TextTrackCueGeneric(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const String&); bool isOrderedBefore(const TextTrackCue*) const final; bool isPositionedAbove(const TextTrackCue*) const final; Ref<VTTCueBox> createDisplayTree() final; bool isEqual(const TextTrackCue&, CueMatchRules) const final; bool cueContentsMatch(const TextTrackCue&) const final; bool doesExtendCue(const TextTrackCue&) const final; CueType cueType() const final { return Generic; } Color m_foregroundColor; Color m_backgroundColor; Color m_highlightColor; double m_baseFontSizeRelativeToVideoHeight { 0 }; double m_fontSizeMultiplier { 0 }; String m_fontName; bool m_useDefaultPosition { true }; }; } // namespace WebCore #endif
#ifndef LANGCOMPARE_H #define LANGCOMPARE_H #include "LangFile.h" class LangCompare { private: LangFile& reference; LangFile& compare; void Compare(); public: LangCompare(LangFile& reference, LangFile& compare); ~LangCompare(); protected: }; #endif
/* * Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.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., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #ifndef __ZLFILEIMAGE_H__ #define __ZLFILEIMAGE_H__ #include "ZLStreamImage.h" class ZLFileImage : public ZLStreamImage { public: ZLFileImage(const std::string &mimeType, const std::string &path, size_t offset, size_t size = 0); protected: shared_ptr<ZLInputStream> inputStream() const; private: std::string myPath; }; inline ZLFileImage::ZLFileImage(const std::string &mimeType, const std::string &path, size_t offset, size_t size) : ZLStreamImage(mimeType, offset, size), myPath(path) {} #endif /* __ZLFILEIMAGE_H__ */
/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README * * GRUB -- GRand Unified Bootloader * Copyright (C) 2000, 2001 Free Software Foundation, Inc. * * (C) Copyright 2003 Sysgo Real-Time Solutions, AG <www.elinos.com> * Pavel Bartusek <pba@sysgo.de> */ /* An implementation for the ReiserFS filesystem ported from GRUB. * Some parts of this code (mainly the structures and defines) are * from the original reiser fs code, as found in the linux kernel. */ #define SECTOR_SIZE 0x200 #define SECTOR_BITS 9 /* Error codes */ typedef enum { ERR_NONE = 0, ERR_BAD_FILENAME, ERR_BAD_FILETYPE, ERR_BAD_GZIP_DATA, ERR_BAD_GZIP_HEADER, ERR_BAD_PART_TABLE, ERR_BAD_VERSION, ERR_BELOW_1MB, ERR_BOOT_COMMAND, ERR_BOOT_FAILURE, ERR_BOOT_FEATURES, ERR_DEV_FORMAT, ERR_DEV_VALUES, ERR_EXEC_FORMAT, ERR_FILELENGTH, ERR_FILE_NOT_FOUND, ERR_FSYS_CORRUPT, ERR_FSYS_MOUNT, ERR_GEOM, ERR_NEED_LX_KERNEL, ERR_NEED_MB_KERNEL, ERR_NO_DISK, ERR_NO_PART, ERR_NUMBER_PARSING, ERR_OUTSIDE_PART, ERR_READ, ERR_SYMLINK_LOOP, ERR_UNRECOGNIZED, ERR_WONT_FIT, ERR_WRITE, ERR_BAD_ARGUMENT, ERR_UNALIGNED, ERR_PRIVILEGED, ERR_DEV_NEED_INIT, ERR_NO_DISK_SPACE, ERR_NUMBER_OVERFLOW, MAX_ERR_NUM } reiserfs_error_t; void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info); extern int reiserfs_ls (char *dirname); extern int reiserfs_open (char *filename); extern int reiserfs_read (char *buf, unsigned len); extern int reiserfs_mount (unsigned part_length);
/** * This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS. * * 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 */ #ifndef TRANSPORTS_H #define TRANSPORTS_H #include "GameObject.h" #include <map> #include <set> #include <string> class Transport : public GameObject { public: explicit Transport(); bool Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint8 animprogress, uint16 dynamicHighValue); bool GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids); void Update(uint32 update_diff, uint32 p_time) override; bool AddPassenger(Player* passenger); bool RemovePassenger(Player* passenger); typedef std::set<Player*> PlayerSet; PlayerSet const& GetPassengers() const { return m_passengers; } private: struct WayPoint { WayPoint() : mapid(0), x(0), y(0), z(0), teleport(false) {} WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport, uint32 _arrivalEventID = 0, uint32 _departureEventID = 0) : mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport), arrivalEventID(_arrivalEventID), departureEventID(_departureEventID) { } uint32 mapid; float x; float y; float z; bool teleport; uint32 arrivalEventID; uint32 departureEventID; }; typedef std::map<uint32, WayPoint> WayPointMap; WayPointMap::const_iterator m_curr; WayPointMap::const_iterator m_next; uint32 m_pathTime; uint32 m_timer; PlayerSet m_passengers; public: WayPointMap m_WayPoints; uint32 m_nextNodeTime; uint32 m_period; private: void TeleportTransport(uint32 newMapid, float x, float y, float z); void UpdateForMap(Map const* map); void DoEventIfAny(WayPointMap::value_type const& node, bool departure); void MoveToNextWayPoint(); // move m_next/m_cur to next points }; #endif
/* Copyright (c) 2012, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/init.h> #include <linux/platform_device.h> #include <linux/msm_kgsl.h> #include <mach/msm_bus_board.h> #include <mach/board.h> #include <mach/socinfo.h> #include <mach/msm_iomap.h> #include "../devices.h" #include "../board-8930.h" #ifdef CONFIG_MACH_K2_WL #include "../board-k2_wl.h" #elif defined CONFIG_MACH_K2_CL #include "../board-k2_cl.h" #elif defined CONFIG_MACH_K2_PLC_CL #include "../board-k2_plc_cl.h" #endif #ifdef CONFIG_MSM_BUS_SCALING static struct msm_bus_vectors grp3d_init_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors grp3d_low_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(1000), }, }; static struct msm_bus_vectors grp3d_nominal_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(2656), }, }; static struct msm_bus_vectors grp3d_max_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(4264), }, }; static struct msm_bus_paths grp3d_bus_scale_usecases[] = { { ARRAY_SIZE(grp3d_init_vectors), grp3d_init_vectors, }, { ARRAY_SIZE(grp3d_low_vectors), grp3d_low_vectors, }, { ARRAY_SIZE(grp3d_nominal_vectors), grp3d_nominal_vectors, }, { ARRAY_SIZE(grp3d_max_vectors), grp3d_max_vectors, }, }; static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = { grp3d_bus_scale_usecases, ARRAY_SIZE(grp3d_bus_scale_usecases), .name = "grp3d", }; #endif static struct resource kgsl_3d0_resources[] = { { .name = KGSL_3D0_REG_MEMORY, .start = 0x04300000, /* GFX3D address */ .end = 0x0431ffff, .flags = IORESOURCE_MEM, }, { .name = KGSL_3D0_IRQ, .start = GFX3D_IRQ, .end = GFX3D_IRQ, .flags = IORESOURCE_IRQ, }, }; static const struct kgsl_iommu_ctx kgsl_3d0_iommu0_ctxs[] = { { "gfx3d_user", 0 }, { "gfx3d_priv", 1 }, }; static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = { { .iommu_ctxs = kgsl_3d0_iommu0_ctxs, .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu0_ctxs), .physstart = 0x07C00000, .physend = 0x07C00000 + SZ_1M - 1, }, }; static struct kgsl_device_platform_data kgsl_3d0_pdata = { .pwrlevel = { { .gpu_freq = 400000000, .bus_freq = 3, .io_fraction = 0, }, { .gpu_freq = 320000000, .bus_freq = 2, .io_fraction = 33, }, { .gpu_freq = 192000000, .bus_freq = 1, .io_fraction = 100, }, { .gpu_freq = 27000000, .bus_freq = 0, }, }, .init_level = 2, .num_levels = 4, .set_grp_async = NULL, .idle_timeout = HZ/12, .nap_allowed = true, .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE, #ifdef CONFIG_MSM_BUS_SCALING .bus_scale_table = &grp3d_bus_scale_pdata, #endif .iommu_data = kgsl_3d0_iommu_data, .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data), .snapshot_address = MSM_GPU_SNAP_SHOT_3D0_PHYS, }; static struct platform_device device_kgsl_3d0 = { .name = "kgsl-3d0", .id = 0, .num_resources = ARRAY_SIZE(kgsl_3d0_resources), .resource = kgsl_3d0_resources, .dev = { .platform_data = &kgsl_3d0_pdata, }, }; void k2_init_gpu(void) { // if (cpu_is_msm8930aa()) // kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000; platform_device_register(&device_kgsl_3d0); }
/* $Id: mpnotification-r0drv-solaris.c $ */ /** @file * IPRT - Multiprocessor Event Notifications, Ring-0 Driver, Solaris. */ /* * Copyright (C) 2008-2015 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. * * The contents of this file may alternatively be used under the terms * of the Common Development and Distribution License Version 1.0 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the * VirtualBox OSE distribution, in which case the provisions of the * CDDL are applicable instead of those of the GPL. * * You may elect to license modified versions of this file under the * terms and conditions of either the GPL or the CDDL or both. */ /******************************************************************************* * Header Files * *******************************************************************************/ #include "the-solaris-kernel.h" #include "internal/iprt.h" #include <iprt/err.h> #include <iprt/mp.h> #include <iprt/cpuset.h> #include <iprt/string.h> #include <iprt/thread.h> #include "r0drv/mp-r0drv.h" /******************************************************************************* * Global Variables * *******************************************************************************/ /** Whether CPUs are being watched or not. */ static volatile bool g_fSolCpuWatch = false; /** Set of online cpus that is maintained by the MP callback. * This avoids locking issues querying the set from the kernel as well as * eliminating any uncertainty regarding the online status during the * callback. */ RTCPUSET g_rtMpSolCpuSet; /** * Internal solaris representation for watching CPUs. */ typedef struct RTMPSOLWATCHCPUS { /** Function pointer to Mp worker. */ PFNRTMPWORKER pfnWorker; /** Argument to pass to the Mp worker. */ void *pvArg; } RTMPSOLWATCHCPUS; typedef RTMPSOLWATCHCPUS *PRTMPSOLWATCHCPUS; /** * Solaris callback function for Mp event notification. * * @returns Solaris error code. * @param CpuState The current event/state of the CPU. * @param iCpu Which CPU is this event for. * @param pvArg Ignored. * * @remarks This function assumes index == RTCPUID. * We may -not- be firing on the CPU going online/offline and called * with preemption enabled. */ static int rtMpNotificationCpuEvent(cpu_setup_t CpuState, int iCpu, void *pvArg) { RTMPEVENT enmMpEvent; /* * Update our CPU set structures first regardless of whether we've been * scheduled on the right CPU or not, this is just atomic accounting. */ if (CpuState == CPU_ON) { enmMpEvent = RTMPEVENT_ONLINE; RTCpuSetAdd(&g_rtMpSolCpuSet, iCpu); } else if (CpuState == CPU_OFF) { enmMpEvent = RTMPEVENT_OFFLINE; RTCpuSetDel(&g_rtMpSolCpuSet, iCpu); } else return 0; rtMpNotificationDoCallbacks(enmMpEvent, iCpu); NOREF(pvArg); return 0; } DECLHIDDEN(int) rtR0MpNotificationNativeInit(void) { if (ASMAtomicReadBool(&g_fSolCpuWatch) == true) return VERR_WRONG_ORDER; /* * Register the callback building the online cpu set as we do so. */ RTCpuSetEmpty(&g_rtMpSolCpuSet); mutex_enter(&cpu_lock); register_cpu_setup_func(rtMpNotificationCpuEvent, NULL /* pvArg */); for (int i = 0; i < (int)RTMpGetCount(); ++i) if (cpu_is_online(cpu[i])) rtMpNotificationCpuEvent(CPU_ON, i, NULL /* pvArg */); ASMAtomicWriteBool(&g_fSolCpuWatch, true); mutex_exit(&cpu_lock); return VINF_SUCCESS; } DECLHIDDEN(void) rtR0MpNotificationNativeTerm(void) { if (ASMAtomicReadBool(&g_fSolCpuWatch) == true) { mutex_enter(&cpu_lock); unregister_cpu_setup_func(rtMpNotificationCpuEvent, NULL /* pvArg */); ASMAtomicWriteBool(&g_fSolCpuWatch, false); mutex_exit(&cpu_lock); } }
#ifndef __DTYPE__DREAM2 #define __DTYPE__DREAM2 #include "dreamCompileConfig.h" typedef unsigned char u8; typedef unsigned short u16; typedef short s16; typedef char c8; typedef char s8; typedef int s32; typedef unsigned int u32; typedef float f32; typedef double f64; #ifdef USE_GNUCX64 typedef unsigned long u64; typedef long s64; #else typedef unsigned long long u64; typedef long long s64; #endif #ifdef USE_UNICODE typedef wchar_t fschar_t; #define _DREAM_TEXT(s) L##s #define _DREAM_WCHAR_FILESYSTEM #else typedef char fschar_t; #define _DREAM_TEXT(s) s #endif #define MAKE_DREAM_ID(c0, c1, c2, c3) \ ((u32)(u8)(c0) | ((u32)(u8)(c1) << 8) | \ ((u32)(u8)(c2) << 16) | ((u32)(u8)(c3) << 24 )) #endif
// // PlaylistEntry.h // Cog // // Created by Vincent Spader on 3/14/05. // Copyright 2005 Vincent Spader All rights reserved. // #import <Cocoa/Cocoa.h> @interface PlaylistEntry : NSObject { int index; int shuffleIndex; BOOL current; BOOL removed; BOOL stopAfter; BOOL queued; int queuePosition; BOOL error; NSString *errorMessage; NSURL *URL; NSString *artist; NSString *album; NSString *title; NSString *genre; NSNumber *year; NSNumber *track; NSImage *albumArt; long long totalFrames; int bitrate; int channels; int bitsPerSample; float sampleRate; NSString *endian; BOOL seekable; BOOL metadataLoaded; } + (NSSet *)keyPathsForValuesAffectingDisplay; + (NSSet *)keyPathsForValuesAffectingLength; + (NSSet *)keyPathsForValuesAffectingPath; + (NSSet *)keyPathsForValuesAffectingFilename; + (NSSet *)keyPathsForValuesAffectingStatus; + (NSSet *)keyPathsForValuesAffectingStatusMessage; @property(readonly) NSString *display; @property(retain, readonly) NSNumber *length; @property(readonly) NSString *path; @property(readonly) NSString *filename; @property int index; @property int shuffleIndex; @property(readonly) NSString *status; @property(readonly) NSString *statusMessage; @property BOOL current; @property BOOL removed; @property BOOL stopAfter; @property BOOL queued; @property int queuePosition; @property BOOL error; @property(retain) NSString *errorMessage; @property(retain) NSURL *URL; @property(retain) NSString *artist; @property(retain) NSString *album; @property(nonatomic, retain, getter=title, setter=setTitle:) NSString *title; @property(retain) NSString *genre; @property(retain) NSNumber *year; @property(retain) NSNumber *track; @property(retain) NSImage *albumArt; @property long long totalFrames; @property int bitrate; @property int channels; @property int bitsPerSample; @property float sampleRate; @property(retain) NSString *endian; @property BOOL seekable; @property BOOL metadataLoaded; - (void)setMetadata:(NSDictionary *)metadata; @end
// // Widget.h // allAddonsExample // // Created by André Perrotta on 6/15/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #ifndef MARSYAS_WIDGET_H #define MARSYAS_WIDGET_H //#include "ofMain.h" FIXME: is this really necessary namespace Marsyas { class GraphicalEnvironment; class Widget { protected: GraphicalEnvironment* env_; int x_; int y_; int width_; int height_; bool state_; bool dragLock_; bool isMouseOver_; double widthForMouse_; double heightForMouse_; double xForMouse_; double yForMouse_; public: Widget(); Widget(int x0, int y0, int w, int h, GraphicalEnvironment* env); virtual ~Widget(); virtual void setup(int x0, int y0, int w, int h, GraphicalEnvironment* env); virtual void update() = 0; virtual void draw() = 0; virtual void updatePosition(int x0, int y0); virtual void updatePosition(int x0, int y0, double zx, double zy, int ox, int oy); virtual void updatePosition(int x0, int y0, int w0, int h0); virtual void updatePosition(int x0, int y0, int w0, int h0, double zx, double zy, int ox, int oy); virtual void toggleState(); //Mouse methods virtual bool mouseOver(); virtual bool mousePressed(); virtual bool mouseDragged(); virtual bool mouseReleased(); virtual void updateValuesForMouse(double zoomX, double zoomY, int offsetX, int offsetY); //getters int getX(); int getY(); int getWidth(); int getHeight(); bool getState(); GraphicalEnvironment *getEnvironment(); //setters void setEnv(GraphicalEnvironment* env); void setX(int x); void setY(int y); void setWidth(int w); void setHeight(int h); void setState(bool st); }; } #endif
#ifndef __DIGI_DOC_PKCS11_H__ #define __DIGI_DOC_PKCS11_H__ //================================================== // FILE: DigiDocPKCS11.h // PROJECT: Digi Doc // DESCRIPTION: Digi Doc functions for signing using PKCS#11 API // AUTHOR: Veiko Sinivee, S|E|B IT Partner Estonia //================================================== // Copyright (C) AS Sertifitseerimiskeskus // 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. // GNU Lesser General Public Licence is available at // http://www.gnu.org/copyleft/lesser.html //==========< HISTORY >============================= // 13.01.2004 Veiko Sinivee // Creation //================================================== #include <libdigidoc/DigiDocDefs.h> #ifdef __cplusplus extern "C" { #endif #ifdef WIN32 #include <windows.h> #define LIBHANDLE HANDLE #include "pkcs11/cryptoki.h" #else #include <dlfcn.h> // Linux .so loading interface #define LIBHANDLE void* #include "pkcs11/pkcs11.h" #endif #include <libdigidoc/DigiDocLib.h> #include <openssl/ocsp.h> EXP_OPTION LIBHANDLE initPKCS11Library(const char* libName); EXP_OPTION void closePKCS11Library(LIBHANDLE pLibrary, CK_SESSION_HANDLE hSession); EXP_OPTION int calculateSignatureWithEstID(SignedDoc* pSigDoc, SignatureInfo* pSigInfo, int slot, const char* passwd); EXP_OPTION CK_RV GetSlotIds(CK_SLOT_ID_PTR pSlotids, CK_ULONG_PTR pLen); EXP_OPTION CK_RV GetTokenInfo(CK_TOKEN_INFO_PTR pTokInfo, CK_SLOT_ID id); int loadAndTestDriver(const char* driver, LIBHANDLE* pLibrary, CK_SLOT_ID* slotids, int slots, CK_ULONG slot); EXP_OPTION CK_RV getDriverInfo(CK_INFO_PTR pInfo); EXP_OPTION CK_RV GetSlotInfo(CK_SLOT_INFO_PTR pSlotInfo, CK_SLOT_ID id); //============================================================ // Decrypts RSA encrypted data with the private key // slot - number of the slot for decryption key. On ID card allways 0 // pin - corresponding pin for the key. On ID card - PIN1 // encData - encrypted data // encLen - length of encrypted data // decData - buffer for decrypted data // encLen - length of buffer. Will be modified by amount of decrypted data // return error code or ERR_OK //============================================================ EXP_OPTION int decryptWithEstID(int slot, const char* pin, const char* encData, int encLen, char* decData, int *decLen); //============================================================ // Locates and reads users certificate from smartcard // slot - number of the slot for decryption key. On ID card allways 0 // ppCert - address for newly allocated certificate pointer // return error code or ERR_OK //============================================================ EXP_OPTION int findUsersCertificate(int slot, X509** ppCert); #ifdef __cplusplus } #endif #endif // __DIGI_DOC_PKCS11_H__
#ifndef _BASTET_RABM_INTERFACE_H_ #define _BASTET_RABM_INTERFACE_H_ /***************************************************************************** 1 ÆäËûÍ·Îļþ°üº¬ *****************************************************************************/ #include "vos.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif #pragma pack(4) /***************************************************************************** 2 ºê¶¨Òå *****************************************************************************/ /***************************************************************************** 3 ö¾Ù¶¨Òå *****************************************************************************/ /***************************************************************************** ½á¹¹Ãû³Æ : BASTET_RABM_MSG_ID_ENUM ЭÒé±í¸ñ : ASN.1 ÃèÊö : ½á¹¹ËµÃ÷ : BASTETºÍRABMÖ®¼äµÄÔ­Óï *****************************************************************************/ enum BASTET_RABM_MSG_ID_ENUM { ID_BASTET_RABM_SET_RELEASE_RRC_REQ = 0x0000, /* _H2ASN_MsgChoice BASTETRABM_RRC_REL_REQ_STRU */ ID_BASTET_RABM_MSG_BUTT }; typedef VOS_UINT32 BASTET_RABM_MSG_ID_ENUM_UINT32; /***************************************************************************** 4 È«¾Ö±äÁ¿ÉùÃ÷ *****************************************************************************/ /***************************************************************************** 5 ÏûϢͷ¶¨Òå *****************************************************************************/ /***************************************************************************** 6 ÏûÏ¢¶¨Òå *****************************************************************************/ /***************************************************************************** 7 STRUCT¶¨Òå *****************************************************************************/ /***************************************************************************** ½á¹¹Ãû : BASTETRABM_RRC_REL_REQ_STRU ЭÒé±í¸ñ : ASN.1ÃèÊö : ½á¹¹ËµÃ÷ : Ô­ÓïBASTETRABM_RRC_REL_REQ_STRUµÄ½á¹¹Ìå *****************************************************************************/ typedef struct { MSG_HEADER_STRU stMsgHeader; /*_H2ASN_Skip*/ } BASTETRABM_RRC_REL_REQ_STRU; /***************************************************************************** 8 UNION¶¨Òå *****************************************************************************/ /***************************************************************************** 9 OTHERS¶¨Òå *****************************************************************************/ /***************************************************************************** H2ASN¶¥¼¶ÏûÏ¢½á¹¹¶¨Òå *****************************************************************************/ typedef struct { BASTET_RABM_MSG_ID_ENUM_UINT32 enMsgID; /*_H2ASN_MsgChoice_Export BASTET_RABM_MSG_ID_ENUM_UINT32*/ VOS_UINT8 aucMsgBlock[4]; /*************************************************************************** _H2ASN_MsgChoice_When_Comment BASTET_RABM_MSG_ID_ENUM_UINT32 ****************************************************************************/ }Bastet_Rabm_MSG_DATA; /*_H2ASN_Length UINT32*/ typedef struct { VOS_MSG_HEADER Bastet_Rabm_MSG_DATA stMsgData; }BastetRabmInterface_MSG; /***************************************************************************** 10 º¯ÊýÉùÃ÷ *****************************************************************************/ VOS_UINT8 RABM_GetRbId(VOS_UINT8 ucRabId); #if (VOS_OS_VER == VOS_WIN32) #pragma pack() #else #pragma pack(0) #endif #ifdef __cplusplus #if __cplusplus } #endif #endif #endif
#ifndef _GSMTAP_H #define _GSMTAP_H /* gsmtap header, pseudo-header in front of the actua GSM payload */ /* GSMTAP is a generic header format for GSM protocol captures, * it uses the IANA-assigned UDP port number 4729 and carries * payload in various formats of GSM interfaces such as Um MAC * blocks or Um bursts. * * Example programs generating GSMTAP data are airprobe * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/) */ #include <stdint.h> #define GSMTAP_VERSION 0x02 #define GSMTAP_TYPE_UM 0x01 #define GSMTAP_TYPE_ABIS 0x02 #define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */ #define GSMTAP_TYPE_SIM 0x04 #define GSMTAP_TYPE_TETRA_I1 0x05 /* tetra air interface */ #define GSMTAP_TYPE_TETRA_I1_BURST 0x06 /* tetra air interface */ /* sub-types for TYPE_UM_BURST */ #define GSMTAP_BURST_UNKNOWN 0x00 #define GSMTAP_BURST_FCCH 0x01 #define GSMTAP_BURST_PARTIAL_SCH 0x02 #define GSMTAP_BURST_SCH 0x03 #define GSMTAP_BURST_CTS_SCH 0x04 #define GSMTAP_BURST_COMPACT_SCH 0x05 #define GSMTAP_BURST_NORMAL 0x06 #define GSMTAP_BURST_DUMMY 0x07 #define GSMTAP_BURST_ACCESS 0x08 #define GSMTAP_BURST_NONE 0x09 /* sub-types for TYPE_UM */ #define GSMTAP_CHANNEL_UNKNOWN 0x00 #define GSMTAP_CHANNEL_BCCH 0x01 #define GSMTAP_CHANNEL_CCCH 0x02 #define GSMTAP_CHANNEL_RACH 0x03 #define GSMTAP_CHANNEL_AGCH 0x04 #define GSMTAP_CHANNEL_PCH 0x05 #define GSMTAP_CHANNEL_SDCCH 0x06 #define GSMTAP_CHANNEL_SDCCH4 0x07 #define GSMTAP_CHANNEL_SDCCH8 0x08 #define GSMTAP_CHANNEL_TCH_F 0x09 #define GSMTAP_CHANNEL_TCH_H 0x0a #define GSMTAP_CHANNEL_ACCH 0x80 /* sub-types for TYPE_TETRA_AIR */ #define GSMTAP_TETRA_BSCH 0x01 #define GSMTAP_TETRA_AACH 0x02 #define GSMTAP_TETRA_SCH_HU 0x03 #define GSMTAP_TETRA_SCH_HD 0x04 #define GSMTAP_TETRA_SCH_F 0x05 #define GSMTAP_TETRA_BNCH 0x06 #define GSMTAP_TETRA_STCH 0x07 #define GSMTAP_TETRA_TCH_F 0x08 /* flags for the ARFCN */ #define GSMTAP_ARFCN_F_PCS 0x8000 #define GSMTAP_ARFCN_F_UPLINK 0x4000 #define GSMTAP_ARFCN_MASK 0x3fff /* IANA-assigned well-known UDP port for GSMTAP messages */ #define GSMTAP_UDP_PORT 4729 struct gsmtap_hdr { uint8_t version; /* version, set to 0x01 currently */ uint8_t hdr_len; /* length in number of 32bit words */ uint8_t type; /* see GSMTAP_TYPE_* */ uint8_t timeslot; /* timeslot (0..7 on Um) */ uint16_t arfcn; /* ARFCN (frequency) */ int8_t signal_dbm; /* signal level in dBm */ int8_t snr_db; /* signal/noise ratio in dB */ uint32_t frame_number; /* GSM Frame Number (FN) */ uint8_t sub_type; /* Type of burst/channel, see above */ uint8_t antenna_nr; /* Antenna Number */ uint8_t sub_slot; /* sub-slot within timeslot */ uint8_t res; /* reserved for future use (RFU) */ } __attribute__((packed)); #endif /* _GSMTAP_H */
/* * LibSylph -- E-Mail client library * Copyright (C) 1999-2006 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __POP_H__ #define __POP_H__ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <glib.h> #include <time.h> #include "session.h" #include "prefs_account.h" typedef struct _Pop3MsgInfo Pop3MsgInfo; typedef struct _Pop3Session Pop3Session; #define POP3_SESSION(obj) ((Pop3Session *)obj) typedef enum { POP3_READY, POP3_GREETING, POP3_STLS, POP3_GETAUTH_USER, POP3_GETAUTH_PASS, POP3_GETAUTH_APOP, POP3_GETRANGE_STAT, POP3_GETRANGE_LAST, POP3_GETRANGE_UIDL, POP3_GETRANGE_UIDL_RECV, POP3_GETSIZE_LIST, POP3_GETSIZE_LIST_RECV, POP3_RETR, POP3_RETR_RECV, POP3_DELETE, POP3_LOGOUT, POP3_DONE, POP3_ERROR, N_POP3_STATE } Pop3State; typedef enum { PS_SUCCESS = 0, /* command successful */ PS_NOMAIL = 1, /* no mail available */ PS_SOCKET = 2, /* socket I/O woes */ PS_AUTHFAIL = 3, /* user authorization failed */ PS_PROTOCOL = 4, /* protocol violation */ PS_SYNTAX = 5, /* command-line syntax error */ PS_IOERR = 6, /* file I/O error */ PS_ERROR = 7, /* protocol error */ PS_EXCLUDE = 8, /* client-side exclusion error */ PS_LOCKBUSY = 9, /* server responded lock busy */ PS_SMTP = 10, /* SMTP error */ PS_DNS = 11, /* fatal DNS error */ PS_BSMTP = 12, /* output batch could not be opened */ PS_MAXFETCH = 13, /* poll ended by fetch limit */ PS_NOTSUPPORTED = 14, /* command not supported */ /* leave space for more codes */ PS_CONTINUE = 128 /* more responses may follow */ } Pop3ErrorValue; typedef enum { RECV_TIME_NONE = 0, RECV_TIME_RECEIVED = 1, RECV_TIME_KEEP = 2, RECV_TIME_DELETE = 3 } RecvTime; typedef enum { DROP_OK = 0, DROP_DONT_RECEIVE = 1, DROP_DELETE = 2, DROP_ERROR = -1 } Pop3DropValue; struct _Pop3MsgInfo { gint size; gchar *uidl; time_t recv_time; guint received : 1; guint deleted : 1; }; struct _Pop3Session { Session session; Pop3State state; PrefsAccount *ac_prefs; gchar *greeting; gchar *user; gchar *pass; gint count; gint64 total_bytes; gint cur_msg; gint cur_total_num; gint64 cur_total_bytes; gint64 cur_total_recv_bytes; gint skipped_num; Pop3MsgInfo *msg; GHashTable *uidl_table; gboolean auth_only; gboolean new_msg_exist; gboolean uidl_is_valid; time_t current_time; Pop3ErrorValue error_val; gchar *error_msg; gpointer data; /* virtual method to drop message */ gint (*drop_message) (Pop3Session *session, const gchar *file); }; #define POPBUFSIZE 512 /* #define IDLEN 128 */ #define IDLEN POPBUFSIZE Session *pop3_session_new (PrefsAccount *account); GHashTable *pop3_get_uidl_table (PrefsAccount *account); gint pop3_write_uidl_list (Pop3Session *session); #endif /* __POP_H__ */
// Copyright (C) 2014. Ben Pruitt & Nick Conway; Wyss Institute // See LICENSE for full GPLv2 license. // # // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // # // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // # // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. /* primer3_py_helpers.h ~~~~~~~~~~~~~~~~~~~~ This file declares helper functions that facilitate interaction between Python C API code and primer3 native C code. */ #include <libprimer3.h> /* Set the primer3 global settings according to the key: value pairs in * p3_settings_dict. This almost exactly mirrors the primer3 documentation, * with the exception being that any file IO related keys are ignored: * P3_FILE_FLAG * PRIMER_EXPLAIN_FLAG * PRIMER_MISPRIMING_LIBRARY * PRIMER_INTERNAL_MISHYB_LIBRARY * PRIMER_THERMODYNAMIC_PARAMETERS_PATH */ int pdh_setGlobals(p3_global_settings *pa, PyObject *p3_settings_dict); /* Create a sequence library from a dictionary of key: value pairs in * createSeqLib (key = seq name, value = seq) */ seq_lib* pdh_createSeqLib(PyObject *seq_dict); /* Copy sequence args as per primer3 docs / code. Also requires a * p3_global_settings pointer to set appropriate flags based on input. */ int pdh_setSeqArgs(PyObject *sa_dict, seq_args *sa); /* Parse the primer3 output to a dictionary. The dictionary will have * a flat structure much like a BoulderIO output file, with the field * names as keys and their respective values as values. */ PyObject* pdh_outputToDict(const p3_global_settings *pa, const seq_args *sa, const p3retval *retval);
#define SERIALNUM "20060102_1"
/* * drivers/i2c/busses/i2c-vr41xx.c * * The NEC VR41XX series does not have an I2C controller, but some boards, such * as the NEC CMB-VR4133, use GPIO pins to create an I2C bus. * * Author: Wade Farnsworth <wfarnsworth@mvista.com> * * Copyright (c) 2006 MontaVista Software Inc. * * This is based on i2c-ixp4xx.c by Deepak Saxena <dsaxena@plexity.net> * Copyright (c) 2003-2004 MontaVista Software Inc. * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ #include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/device.h> #include <linux/module.h> #include <linux/i2c.h> #include <linux/i2c-algo-bit.h> #include <linux/delay.h> #include <asm/vr41xx/giu.h> static inline int vr41xx_scl_pin(void *data) { return ((struct vr41xx_i2c_pins*)data)->scl_pin; } static inline int vr41xx_sda_pin(void *data) { return ((struct vr41xx_i2c_pins*)data)->sda_pin; } static void vr41xx_bit_setscl(void *data, int val) { vr41xx_gpio_set_pin(vr41xx_scl_pin(data), val ? GPIO_DATA_HIGH : GPIO_DATA_LOW); } static void vr41xx_bit_setsda(void *data, int val) { vr41xx_gpio_set_direction(vr41xx_sda_pin(data), GPIO_OUTPUT); if (val) { vr41xx_gpio_set_pin(vr41xx_sda_pin(data), GPIO_DATA_HIGH); vr41xx_gpio_set_direction(vr41xx_sda_pin(data), GPIO_INPUT); } else vr41xx_gpio_set_pin(vr41xx_sda_pin(data), GPIO_DATA_LOW); } static int vr41xx_bit_getsda(void *data) { return vr41xx_gpio_get_pin(vr41xx_sda_pin(data)); } struct vr41xx_i2c_data { struct vr41xx_i2c_pins *gpio_pins; struct i2c_adapter adapter; struct i2c_algo_bit_data algo_data; }; static int vr41xx_i2c_remove(struct device *dev) { struct platform_device *plat_dev = to_platform_device(dev); struct vr41xx_i2c_data *drv_data = dev_get_drvdata(&plat_dev->dev); dev_set_drvdata(&plat_dev->dev, NULL); i2c_bit_del_bus(&drv_data->adapter); kfree(drv_data); return 0; } static int vr41xx_i2c_probe(struct device *dev) { int err; struct platform_device *plat_dev = to_platform_device(dev); struct vr41xx_i2c_pins *gpio = plat_dev->dev.platform_data; struct vr41xx_i2c_data *drv_data = kmalloc(sizeof(struct vr41xx_i2c_data), GFP_KERNEL); if(!drv_data) return -ENOMEM; memset(drv_data, 0, sizeof(struct vr41xx_i2c_data)); drv_data->gpio_pins = gpio; /* * We could make a lot of these structures static, but * certain platforms may have multiple GPIO-based I2C * buses for various device domains, so we need per-device * algo_data->data. */ drv_data->algo_data.data = gpio; drv_data->algo_data.setsda = vr41xx_bit_setsda; drv_data->algo_data.setscl = vr41xx_bit_setscl; drv_data->algo_data.getsda = vr41xx_bit_getsda; drv_data->algo_data.udelay = 40; drv_data->algo_data.mdelay = 40; drv_data->algo_data.timeout = 400; drv_data->adapter.id = I2C_HW_B_VR41XX, drv_data->adapter.algo_data = &drv_data->algo_data, drv_data->adapter.dev.parent = &plat_dev->dev; vr41xx_gpio_set_direction(gpio->scl_pin, GPIO_OUTPUT); vr41xx_gpio_set_pin(gpio->scl_pin, GPIO_DATA_HIGH); vr41xx_gpio_set_direction(gpio->sda_pin, GPIO_OUTPUT); vr41xx_gpio_set_pin(gpio->sda_pin, GPIO_DATA_HIGH); if ((err = i2c_bit_add_bus(&drv_data->adapter) != 0)) { printk(KERN_ERR "ERROR: Could not install %s\n", dev->bus_id); kfree(drv_data); return err; } dev_set_drvdata(&plat_dev->dev, drv_data); return 0; } static struct device_driver vr41xx_i2c_driver = { .name = "VR41XX-I2C", .bus = &platform_bus_type, .probe = vr41xx_i2c_probe, .remove = vr41xx_i2c_remove, }; static int __init vr41xx_i2c_init(void) { return driver_register(&vr41xx_i2c_driver); } static void __exit vr41xx_i2c_exit(void) { driver_unregister(&vr41xx_i2c_driver); } module_init(vr41xx_i2c_init); module_exit(vr41xx_i2c_exit); MODULE_DESCRIPTION("GPIO-based I2C adapter for VR41xx systems"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Wade Farnsworth <wfarnsworth@mvista.com>");