text
stringlengths
4
6.14k
#ifndef SETUPASSISTANT_H #define SETUPASSISTANT_H #include <QtGui/QWidget> #include <QtCore/QStateMachine> #include <QtCore/QState> #include <QtCore/QSignalTransition> #include <QtCore/QPropertyAnimation> #include <QtGui/QDesktopWidget> #include "WelcomeView.h" #include "LicenseReader.h" #include "DownloadSetup.h" #include "FinishSetup.h" class SetupAssistant : public QWidget { Q_OBJECT public: SetupAssistant(QWidget *parent = 0); void showAnimated(); private: QDesktopWidget *desktopWidget; WelcomeView *welcomeView; LicenseReader *licenseReader; DownloadSetup *downloadSetup; FinishSetup *finishSetup; QStateMachine *stateMachine; QState *welcomeState; QState *licenseReaderState; QState *downloadSetupState; QState *finishState; QSignalTransition *transition1; QSignalTransition *transition2; QSignalTransition *transition3; private slots: void saveSettings(); signals: void setupFinished(); }; #endif
#pragma once namespace UEFI { extern const wchar_t UEFI_GUID[]; }
#include <stdint.h> #include <ps4/kernel/protection.h> struct auditinfo_addr { /* 4 ai_auid; 8 ai_mask; 24 ai_termid; 4 ai_asid; 8 ai_flags;r */ char useless[184]; }; struct ucred { uint32_t useless1; uint32_t cr_uid; // effective user id uint32_t cr_ruid; // real user id uint32_t useless2; uint32_t useless3; uint32_t cr_rgid; // real group id uint32_t useless4; void *useless5; void *useless6; void *cr_prison; // jail(2) void *useless7; uint32_t useless8; void *useless9[2]; void *useless10; struct auditinfo_addr useless11; uint32_t *cr_groups; // groups uint32_t useless12; }; struct proc { char useless[64]; struct ucred *p_ucred; }; struct thread { void *useless; struct proc *td_proc; }; struct fileops { void *fo_read; void *fo_write; void *fo_truncate; void *fo_ioctl; void *fo_poll; void *fo_kqfilter; void *fo_stat; void *fo_close; void *fo_chmod; void *fo_chown; int fo_flags; /* DFLAG_* below */ }; int jailbreak(struct thread *td, void *uap) { struct ucred *cred; ps4KernelProtectionAllDisable(); // Version Spoof - Thanks to zecoxao *(uint64_t *)0xFFFFFFFF8323A4E0 = 0x9990001; //*(uint32_t *)0xFFFFFFFF827C7B36 = 0x09990001; // Enable Process Syscall *(uint16_t *)0xFFFFFFFF82616465 = 0x9090; *(uint16_t *)0xFFFFFFFF82616471 = 0x9090; // Disable Process ASLR - Thanks to ZiL0G80 *(uint16_t *)0xFFFFFFFF82649C9C = 0x63EB; *(uint64_t *)0xFFFFFFFF8323A4E0 = 0x9990001; // Déactive la vérifiaction de l'act *(uint64_t *)0xFFFFFFFF827C8F40 = 0xB800000000C39090; // Déactive la vérification du keystone *(uint64_t *)0xFFFFFFFF827B12F0 = 0xB800000000C39090; ps4KernelProtectionAllEnable(); // Resolve creds cred = td->td_proc->p_ucred; // Escalate process to root cred->cr_uid = 0; cred->cr_ruid = 0; cred->cr_rgid = 0; cred->cr_groups[0] = 0; void *td_ucred = *(void **)(((char *)td) + 304); // p_ucred == td_ucred // sceSblACMgrIsSystemUcred uint64_t *sonyCred = (uint64_t *)(((char *)td_ucred) + 96); *sonyCred = 0xffffffffffffffffULL; // sceSblACMgrGetDeviceAccessType uint64_t *sceProcType = (uint64_t *)(((char *)td_ucred) + 88); *sceProcType = 0x3801000000000013ULL; // Max access // sceSblACMgrHasSceProcessCapability uint64_t *sceProcCap = (uint64_t *)(((char *)td_ucred) + 104); *sceProcCap = 0xffffffffffffffffULL; // Sce Process ((uint64_t *)0xFFFFFFFF832CC2E8ULL)[0] = 0x123456; //priv_check_cred bypass with suser_enabled=true ((uint64_t *)0xFFFFFFFF8323DA18ULL)[0] = 0; // bypass priv_check // Jailbreak ;) cred->cr_prison = (void *)0xFFFFFFFF83237250ULL; //&prison0 // Break out of the sandbox void *td_fdp = *(void **)(((char *)td->td_proc) + 72); uint64_t *td_fdp_fd_rdir = (uint64_t *)(((char *)td_fdp) + 24); uint64_t *td_fdp_fd_jdir = (uint64_t *)(((char *)td_fdp) + 32); uint64_t *rootvnode = (uint64_t *)0xFFFFFFFF832EF920ULL; *td_fdp_fd_rdir = *rootvnode; *td_fdp_fd_jdir = *rootvnode; return 0; }
/* * This file is part of jacklistener - jack state monitor * Copyright (C) 2012 Maxim A. Mikityanskiy - <maxtram95@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <stdbool.h> bool handle_device_event(int evdevfd);
#pragma once #ifndef ENGINE_RENDERER_POSTPROCESS_HDR_H #define ENGINE_RENDERER_POSTPROCESS_HDR_H #include <serenity/system/TypeDefs.h> #include <serenity/system/Macros.h> class ShaderProgram; class Shader; class Viewport; class HDRAlgorithm { public: enum Type : uint8_t { None = 0, Reinhard, Filmic, Exposure, Uncharted, }; BUILD_ENUM_CLASS_MEMBERS(HDRAlgorithm, Type) }; #include <serenity/resources/Handle.h> #include <string> namespace Engine::priv { class GBuffer; class RenderModule; class HDR final { private: Handle m_Vertex_Shader; Handle m_Fragment_Shader; Handle m_Shader_Program; std::string m_GLSL_frag_code; void internal_init_fragment_code(); public: HDRAlgorithm m_Algorithm = HDRAlgorithm::Uncharted; float m_Exposure = 3.0f; static bool init(); void pass(GBuffer&, const Viewport&, uint32_t outTexture, uint32_t outTexture2, bool godRays, float godRaysFactor, const RenderModule&); static HDR STATIC_HDR; }; }; namespace Engine::Renderer::hdr { [[nodiscard]] inline float getExposure() noexcept { return Engine::priv::HDR::STATIC_HDR.m_Exposure; } inline void setExposure(float exposure) noexcept { Engine::priv::HDR::STATIC_HDR.m_Exposure = exposure; } inline void setAlgorithm(HDRAlgorithm algorithm) noexcept { Engine::priv::HDR::STATIC_HDR.m_Algorithm = algorithm; } [[nodiscard]] inline HDRAlgorithm getAlgorithm() noexcept { return Engine::priv::HDR::STATIC_HDR.m_Algorithm; } }; #endif
/* * This file is protected by Copyright. Please refer to the COPYRIGHT file * distributed with this source distribution. * * This file is part of GNUHAWK. * * GNUHAWK is free software: you can redistribute it and/or modify is 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. * * GNUHAWK is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see http://www.gnu.org/licenses/. */ #ifndef rs_decoder_GH_BLOCK_H #define rs_decoder_GH_BLOCK_H #include <gr_component.h> #include <atsc_rs_decoder.h> typedef GHComponent< atsc_rs_decoder > GnuHawkBlock; #endif
// // vidConferenceEvent.h // vidcon // // Created by Tyler Dodge on 4/24/12. // // #import <Foundation/Foundation.h> #import "vidSpeakerModel.h" #define EVENT_NAME_KEY @"name" #define EVENT_START_KEY @"start" #define EVENT_END_KEY @"end" #define EVENT_SPEAKER_KEY @"speaker" #define EVENT_DESCRIPTION_KEY @"details" #define EVENT_LOCATION_KEY @"location" @interface vidConferenceEvent : NSObject @property (strong, nonatomic) NSNumber * uid; @property (strong, nonatomic) NSDate * start; @property (strong, nonatomic) NSDate * end; @property (strong, nonatomic) NSString * name; @property (strong, nonatomic) vidSpeaker * speaker; @property (strong, nonatomic) NSString * room; @property (strong, nonatomic) NSString * details; @property (nonatomic) int verticalIndex; //index set by conference guide to prevent overlapping -(BOOL)isInRangeStartingAt:(NSDate *)start EndingAt:(NSDate *)end; -(vidConferenceEvent *)initWithName:(NSString *)name startingAt:(NSDate *)start endingAt:(NSDate *)end; -(vidConferenceEvent *)initWithDictionary:(NSDictionary *)dictionary; @end
/* * Copyright (C) 2011 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. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS 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 LayerTreeHostCAWin_h #define LayerTreeHostCAWin_h #include "HeaderDetection.h" #if HAVE(WKQCA) #include "CoalescedWindowGeometriesUpdater.h" #include "LayerTreeHostCA.h" #include <WebCore/AbstractCACFLayerTreeHost.h> #include <wtf/HashSet.h> #include <wtf/RetainPtr.h> typedef struct _WKCACFView* WKCACFViewRef; namespace WebKit { class WKCACFViewWindow; class LayerTreeHostCAWin : public LayerTreeHostCA, private WebCore::AbstractCACFLayerTreeHost { public: static bool supportsAcceleratedCompositing(); static PassRefPtr<LayerTreeHostCAWin> create(WebPage*); virtual ~LayerTreeHostCAWin(); private: explicit LayerTreeHostCAWin(WebPage*); static void contextDidChangeCallback(WKCACFViewRef, void* info); void contextDidChange(); // LayerTreeHost virtual void invalidate(); virtual void forceRepaint(); virtual void sizeDidChange(const WebCore::IntSize& newSize); virtual void scheduleLayerFlush(); virtual void setLayerFlushSchedulingEnabled(bool); virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&); // LayerTreeHostCA virtual void platformInitialize(LayerTreeContext&); virtual void setRootCompositingLayer(WebCore::GraphicsLayer*); // AbstractCACFLayerTreeHost virtual WebCore::PlatformCALayer* rootLayer() const; virtual void addPendingAnimatedLayer(PassRefPtr<WebCore::PlatformCALayer>); virtual void layerTreeDidChange(); virtual void flushPendingLayerChangesNow(); OwnPtr<WKCACFViewWindow> m_window; RetainPtr<WKCACFViewRef> m_view; HashSet<RefPtr<WebCore::PlatformCALayer> > m_pendingAnimatedLayers; bool m_isFlushingLayerChanges; CoalescedWindowGeometriesUpdater m_geometriesUpdater; }; } // namespace WebKit #endif // HAVE(WKQCA) #endif // LayerTreeHostCAWin_h
/*! \file Vector.h * \brief Header file for Vector.cc. */ /* Copyright (c) 2006 John David Weaver * All Rights Reserved. */ #if !defined(_WIP3DMATH_UNITVECTOR_VECTOR_VECTOR_H_) #define _WIP3DMATH_UNITVECTOR_VECTOR_VECTOR_H_ namespace wip3dmath { //! Vector class. /*! Provides a datatype representing a position and movement in 3-space. */ class Point; class UnitVector; class Vector : public UnitVector { public: Vector() : UnitVector() {} Vector(const Point &); Vector(double, double, double); Vector(double, const UnitVector &vec); Vector(const Vector &); Vector(const UnitVector &vec); Point get(void) const; void set(const Point &); double length(void); Vector& operator+= (double w); Vector& operator-= (double w); Vector operator+ (double w); Vector operator- (double w); // Vector& operator+= (const Vector &vec); Vector& operator-= (const Vector &vec); Vector operator+ (const Vector &vec); Vector operator- (const Vector &vec); Vector& operator*= (const double w); Vector operator* (const double w); Vector operator* (const Vector& other) const; double dot(const Vector& other) const; /* I/O methods */ friend std::ostream& operator<< (std::ostream&, Vector); }; } // namespace wip3dmath #endif /* !defined(_WIP3DMATH_POINT_POINT3D_VECTOR_VECTOR_H_) */
#ifndef ENEMY_H #define ENEMY_H #include <QAction> #include <cmath> #include <QFormLayout> #include <QLineEdit> #include <QApplication> #include <iostream> #include <QGraphicsPixmapItem> #include <QPalette> #include <QPixmap> #include <QSize> #include "thing.h" /** Enemy thing. Floats like butterfly, stings like a rhinoceros.....or a bee. */ class Enemy : public Thing { public: Enemy(int, int); float getX(); float getY(); int randomNum; int getLives(); void decrease(); void move(); int moveX; float fy, fvy; }; #endif
#ifndef NEOGPS_LOCATION_H #define NEOGPS_LOCATION_H #include <Arduino.h> #include "NeoGPS_cfg.h" //------------------------------------------------------ // @file Location.h // @version 3.0 // // @section License // Copyright (C) 2016, SlashDevin // // 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. // class NMEAGPS; namespace NeoGPS { class Location_t { public: CONST_CLASS_DATA float LOC_SCALE = 1.0e-7; Location_t() {} Location_t( int32_t lat, int32_t lon ) : _lat(lat / LOC_SCALE), _lon(lon / LOC_SCALE) {} Location_t( float lat, float lon ) : _lat(lat/ LOC_SCALE), _lon(lon / LOC_SCALE) {} Location_t( double lat, double lon ) : _lat(lat / LOC_SCALE), _lon(lon / LOC_SCALE) {} int32_t lat() const { return _lat; }; void lat( int32_t l ) { _lat = l; }; float latF() const { return ((float) lat()) * LOC_SCALE; }; void latF( float v ) { _lat = v * LOC_SCALE; }; int32_t lon() const { return _lon; }; void lon( int32_t l ) { _lon = l; }; float lonF() const { return ((float) lon()) * LOC_SCALE; }; void lonF( float v ) { _lon = v * LOC_SCALE; }; void init() { _lat = _lon = 0; }; CONST_CLASS_DATA float EARTH_RADIUS_KM = 6371.0088; CONST_CLASS_DATA float RAD_PER_DEG = PI / 180.0; CONST_CLASS_DATA float DEG_PER_RAD = 180.0 / PI; CONST_CLASS_DATA float MI_PER_KM = 0.621371; //----------------------------------- // Distance calculations static float DistanceKm( const Location_t & p1, const Location_t & p2 ) { return DistanceRadians( p1, p2 ) * EARTH_RADIUS_KM; } float DistanceKm( const Location_t & p2 ) { return DistanceKm( *this, p2 ); } static float DistanceMiles( const Location_t & p1, const Location_t & p2 ) { return DistanceRadians( p1, p2 ) * EARTH_RADIUS_KM * MI_PER_KM; } float DistanceMiles( const Location_t & p2 ) { return DistanceMiles( *this, p2 ); } static float DistanceRadians( const Location_t & p1, const Location_t & p2 ); float DistanceRadians( const Location_t & p2 ) { return DistanceRadians( *this, p2 ); } static float EquirectDistanceRadians ( const Location_t & p1, const Location_t & p2 ); float EquirectDistanceRadians( const Location_t & p2 ) { return EquirectDistanceRadians( *this, p2 ); } static float EquirectDistanceKm( const Location_t & p1, const Location_t & p2 ) { return EquirectDistanceRadians( p1, p2 ) * EARTH_RADIUS_KM; } float EquirectDistanceKm( const Location_t & p2 ) const { return EquirectDistanceKm( *this, p2 ); } static float EquirectDistanceMiles( const Location_t & p1, const Location_t & p2 ) { return EquirectDistanceRadians( p1, p2 ) * EARTH_RADIUS_KM * MI_PER_KM; } float EquirectDistanceMiles( const Location_t & p2 ) const { return EquirectDistanceMiles( *this, p2 ); } //----------------------------------- // Bearing calculations static float BearingTo( const Location_t & p1, const Location_t & p2 ); // radians float BearingTo( const Location_t & p2 ) const // radians { return BearingTo( *this, p2 ); } static float BearingToDegrees( const Location_t & p1, const Location_t & p2 ) { return BearingTo( p1, p2 ) * DEG_PER_RAD; } float BearingToDegrees( const Location_t & p2 ) const // radians { return BearingToDegrees( *this, p2 ); } //----------------------------------- // Offset a location (note distance is in radians, not degrees) void OffsetBy( float distR, float bearingR ); //private: //--------------------------------------- friend class NMEAGPS; // This does not work?!? int32_t _lat; // degrees * 1e7, negative is South int32_t _lon; // degrees * 1e7, negative is West } NEOGPS_PACKED; } // NeoGPS #endif
/* * Copyright (c) 2015, EURECOM (www.eurecom.fr) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those * of the authors and should not be interpreted as representing official policies, * either expressed or implied, of the FreeBSD Project. */ MESSAGE_DEF(UDP_INIT, MESSAGE_PRIORITY_MED, udp_init_t, udp_init) MESSAGE_DEF(UDP_DATA_REQ, MESSAGE_PRIORITY_MED, udp_data_req_t, udp_data_req) MESSAGE_DEF(UDP_DATA_IND, MESSAGE_PRIORITY_MED, udp_data_ind_t, udp_data_ind)
// 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 http://mozilla.org/MPL/2.0/ #import <UIKit/UIKit.h> @interface BMAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 2003 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Roy Yokoyama <yokoyama@netscape.com> (original author) * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #pragma once #include "DotNETEmbed.h" using namespace System; namespace Mozilla { namespace Embedding { // Static public __gc class ProfileManager { public: // XXX: These should be in an enum! static UInt32 SHUTDOWN_PERSIST = 1; static UInt32 SHUTDOWN_CLEANSE = 2; __property static Int32 get_ProfileCount(); static String *GetProfileList()[]; static bool ProfileExists(String *aProfileName); __property static String* get_CurrentProfile(); __property static void set_CurrentProfile(String* aCurrentProfile); static void ShutDownCurrentProfile(UInt32 shutDownType); static void CreateNewProfile(String* aProfileName, String *aNativeProfileDir, String* aLangcode, bool useExistingDir); static void RenameProfile(String* aOldName, String* aNewName); static void DeleteProfile(String* aName, bool aCanDeleteFiles); static void CloneProfile(String* aProfileName); private: static nsIProfile *sProfileService = 0; // [OWNER] static void EnsureProfileService(); }; // class ProfileManager } // namespace Embedding }
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the Mozilla icon channel for gnome. * * The Initial Developer of the Original Code is * Christian Biesinger <cbiesinger@web.de>. * Portions created by the Initial Developer are Copyright (C) 2004 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef nsIconChannel_h_ #define nsIconChannel_h_ #include "nsIChannel.h" #include "nsIStreamListener.h" #include "nsIURI.h" #include "nsIIconURI.h" #include "nsCOMPtr.h" /** * This class is the gnome implementation of nsIconChannel. It basically asks * gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for * that file to which all calls will be proxied. */ class nsIconChannel : public nsIChannel { public: NS_DECL_ISUPPORTS NS_FORWARD_NSIREQUEST(mRealChannel->) NS_FORWARD_NSICHANNEL(mRealChannel->) nsIconChannel() {} ~nsIconChannel() {} static void Shutdown(); /** * Called by nsIconProtocolHandler after it creates this channel. * Must be called before calling any other function on this object. * If this method fails, no other function must be called on this object. */ NS_HIDDEN_(nsresult) Init(nsIURI* aURI); private: /** * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html). * Will always be non-null after a successful Init. */ nsCOMPtr<nsIChannel> mRealChannel; /** * Called by Init if we need to use the gnomeui library. */ nsresult InitWithGnome(nsIMozIconURI *aURI); }; #endif
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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 http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_dom_power_WakeLock_h #define mozilla_dom_power_WakeLock_h #include "nsCOMPtr.h" #include "nsIDOMEventListener.h" #include "nsIObserver.h" #include "nsString.h" #include "nsWeakReference.h" #include "nsWrapperCache.h" #include "mozilla/ErrorResult.h" class nsPIDOMWindowInner; namespace mozilla { namespace dom { class ContentParent; class WakeLock final : public nsIDOMEventListener , public nsWrapperCache , public nsIObserver , public nsSupportsWeakReference { public: NS_DECL_NSIDOMEVENTLISTENER NS_DECL_NSIOBSERVER NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(WakeLock, nsIDOMEventListener) // Note: WakeLock lives for the lifetime of the document in order to avoid // exposing GC behavior to pages. This means that // |var foo = navigator.requestWakeLock('cpu'); foo = null;| // doesn't unlock the 'cpu' resource. WakeLock(); // Initialize this wake lock on behalf of the given window. Null windows are // allowed; a lock without an associated window is always considered // invisible. nsresult Init(const nsAString &aTopic, nsPIDOMWindowInner* aWindow); // Initialize this wake lock on behalf of the given process. If the process // dies, the lock is released. A wake lock initialized via this method is // always considered visible. nsresult Init(const nsAString &aTopic, ContentParent* aContentParent); // WebIDL methods nsPIDOMWindowInner* GetParentObject() const; virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; void GetTopic(nsAString& aTopic); void Unlock(ErrorResult& aRv); private: virtual ~WakeLock(); void DoUnlock(); void DoLock(); void AttachEventListener(); void DetachEventListener(); bool mLocked; bool mHidden; // The ID of the ContentParent on behalf of whom we acquired this lock, or // CONTENT_PROCESS_UNKNOWN_ID if this lock was acquired on behalf of the // current process. uint64_t mContentParentID; nsString mTopic; // window that this was created for. Weak reference. nsWeakPtr mWindow; }; } // namespace dom } // namespace mozilla #endif // mozilla_dom_power_WakeLock_h
#ifndef _STRUCTS_H #define _STRUCTS_H #include "common.h" //ºôÎüµÆ²ÎÊý typedef struct { uint_8 is_start; //ÊÇ·ñ¿ªÊ¼ºôÎü±êÖ¾£¬0Ϊδ¿ªÊ¼£¬1Ϊ¿ªÊ¼ float duty; //Õ¼¿Õ±È uint_8 dir; //±ä»¯·½Ïò£¬0Ϊ±ä°µ£¬1Ϊ±äÁÁ float radio; //ÿ´Î±ä»¯µÄÕ¼¿Õ±È´óС } BreatheLightParams, *BreatheLightParamsPtr; //ʱ¼ä±êÖ¾²ÎÊý typedef struct { uint_8 f_50ms; uint_8 f_1s; } TimeFlag, *TimeFlagPtr; //ʱ¼ä¼ÆÊýÆ÷²ÎÊý typedef struct { uint_8 c_50ms; uint_8 c_1s; } TimeCounter, *TimeCounterPtr; //ÏûÏ¢¶ÓÁÐ typedef struct { uint_8 msg[16]; //´æ´¢ÏûÏ¢µÄÊý×é uint_16 front; //¶ÓÊ×ϱê uint_16 rear; //¶Óβϱê } MsgQueue, *MsgQueuePtr; #endif
/* * Embedded Radio Tracker * * Copyright (C) 2017 Mikael Nousiainen * * 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 http://mozilla.org/MPL/2.0/. */ #ifndef __ERT_SERVER_SESSION_WEBSOCKET_H #define __ERT_SERVER_SESSION_WEBSOCKET_H #include "ert-server-session.h" #define ERT_SERVER_WEBSOCKET_PROTOCOL_DATA_LOGGER "ert-data-logger" int ws_send_message_init(ert_server_session *session, struct lws *wsi, uint32_t data_length, unsigned char *data); int ws_send_message_continue(ert_server_session *session, struct lws *wsi); #endif
// // bs_dnscache.h // MobileCross // // Created by super on 2017/8/1. // Copyright © 2017年 Rex. All rights reserved. // #ifndef bs_dnscache_h #define bs_dnscache_h #include "bs_type.h" typedef struct bs_dns { struct bs_dns *next; struct in_addr *in_addr_ip; struct in6_addr *in_addr_ip6; char *hostname; } bs_dns; bs_dns* dns_cache_lookup(const char *hostname); void dns_cache_store(struct in_addr in_addr_ip, const char *hostname); void dns_cache_ipv6_store(struct in6_addr in_addr_ip, const char *hostname); void dns_cache_remove(const char *hostname); void dns_cache_clear(); #endif /* bs_dnscache_h */
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2018 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kernel/user.h> #include <kotaka/paths/system.h> #include <kotaka/privilege.h> inherit SECOND_AUTO; inherit conn LIB_CONN; inherit user LIB_USER; void disconnect(); static void create() { user::create(); conn::create("telnet"); } /* helpers */ static void self_destruct() { destruct_object(this_object()); } static void self_disconnect() { user::disconnect(); } /* LIB_CONN hooks */ static void timeout() { ::timeout(allocate(DRIVER->query_tls_size())); } int login(string str) { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); connection(previous_object()); return conn::receive_message(nil, str); } void logout(int quit) { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); /* LIB_CONN will self destruct if quit is false */ close(nil, quit); if (quit) { destruct_object(this_object()); } } int receive_message(string str) { int newmode; string err; ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); return conn::receive_message(nil, str); } int message_done() { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); conn::message_done(nil); return MODE_NOCHANGE; } void receive_datagram(string packet) { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); conn::receive_datagram(nil, packet); } /* LIB_USER hooks */ int message(string str) { ACCESS_CHECK(previous_object() == query_user() || calling_object() == this_object()); return user::message(str); } void disconnect() { ACCESS_CHECK(previous_object() == query_user() || calling_object() == this_object()); user::disconnect(); } void datagram_challenge(string str) { ACCESS_CHECK(previous_object() == query_user() || calling_object() == this_object()); user::datagram_challenge(str); } int datagram(string str) { ACCESS_CHECK(previous_object() == query_user() || calling_object() == this_object()); return user::datagram(str); } void set_mode(int new_mode) { object conn; ACCESS_CHECK(previous_program() == LIB_CONN || SYSTEM() || calling_object() == this_object()); if (!this_object() || !query_conn() || new_mode == MODE_NOCHANGE) { return; } /* we have to do it this way because set_mode is also called to handle return values for hooks in the user object */ /* this can happen more than once in a connection chain, so we need to intercept disconnects and do them */ /* in a 0 callout to avoid double destruction */ /* since network events are asynchronous anyway we aren't causing any actual harm */ if (new_mode == MODE_DISCONNECT) { query_conn()->set_mode(MODE_BLOCK); conn::close(nil, 1); call_out("self_disconnect", 0); return; } query_conn()->set_mode(new_mode); }
/* * Copyright (C) 2014-2017 Fanout, Inc. * * This file is part of Pushpin. * * $FANOUT_BEGIN_LICENSE:AGPL$ * * Pushpin is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) * any later version. * * Pushpin is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for * more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Alternatively, Pushpin may be used under the terms of a commercial license, * where the commercial license agreement is provided with the software or * contained in a written agreement between you and Fanout. For further * information use the contact form at <https://fanout.io/enterprise/>. * * $FANOUT_END_LICENSE$ */ #ifndef PROXYUTIL_H #define PROXYUTIL_H #include <QByteArray> #include <QList> #include <QHostAddress> #include "packet/httprequestdata.h" #include "domainmap.h" #include "xffrule.h" class InspectData; namespace ProxyUtil { bool checkTrustedClient(const char *logprefix, void *object, const HttpRequestData &requestData, const QByteArray &defaultUpstreamKey); void manipulateRequestHeaders(const char *logprefix, void *object, HttpRequestData *requestData, bool trustedClient, const DomainMap::Entry &entry, const QByteArray &sigIss, const QByteArray &sigKey, bool acceptXForwardedProtocol, bool useXForwardedProto, bool useXForwardedProtocol, const XffRule &xffTrustedRule, const XffRule &xffRule, const QList<QByteArray> &origHeadersNeedMark, const QHostAddress &peerAddress, const InspectData &idata, bool gripEnabled, bool intReq); void applyHost(QUrl *url, const QString &host); void applyHostHeader(HttpHeaders *headers, const QUrl &uri); QString targetToString(const DomainMap::Target &target); QHostAddress getLogicalAddress(const HttpHeaders &headers, const XffRule &xffRule, const QHostAddress &peerAddress); } #endif
// utf16_be.c - Oniguruma (regular expression library) // Copyright (c) 2002-2020 K.Kosako All rights reserved. // #include "regint.h" #pragma hdrstop static int init(void) { #ifdef USE_CALLOUT int id; char * name; uint args[4]; OnigValue opts[4]; OnigEncoding enc = ONIG_ENCODING_UTF16_BE; name = "\000F\000A\000I\000L\000\000"; BC0_P(name, fail); name = "\000M\000I\000S\000M\000A\000T\000C\000H\000\000"; BC0_P(name, mismatch); name = "\000M\000A\000X\000\000"; args[0] = ONIG_TYPE_TAG | ONIG_TYPE_LONG; args[1] = ONIG_TYPE_CHAR; opts[0].c = 'X'; BC_B_O(name, max, 2, args, 1, opts); name = "\000E\000R\000R\000O\000R\000\000"; args[0] = ONIG_TYPE_LONG; opts[0].l = ONIG_ABORT; BC_P_O(name, error, 1, args, 1, opts); name = "\000C\000O\000U\000N\000T\000\000"; args[0] = ONIG_TYPE_CHAR; opts[0].c = '>'; BC_B_O(name, count, 1, args, 1, opts); name = "\000T\000O\000T\000A\000L\000_\000C\000O\000U\000N\000T\000\000"; args[0] = ONIG_TYPE_CHAR; opts[0].c = '>'; BC_B_O(name, total_count, 1, args, 1, opts); name = "\000C\000M\000P\000\000"; args[0] = ONIG_TYPE_TAG | ONIG_TYPE_LONG; args[1] = ONIG_TYPE_STRING; args[2] = ONIG_TYPE_TAG | ONIG_TYPE_LONG; BC_P(name, cmp, 3, args); #endif /* USE_CALLOUT */ return ONIG_NORMAL; } static const int EncLen_UTF16[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; static int utf16be_mbc_enc_len(const uchar * p) { return EncLen_UTF16[*p]; } static int is_valid_mbc_string(const uchar * s, const uchar * end) { while(s < end) { int len = utf16be_mbc_enc_len(s); if(len == 4) { if(s + 2 >= end) return FALSE; if(!UTF16_IS_SURROGATE_SECOND(*(s+2))) return FALSE; } else if(UTF16_IS_SURROGATE_SECOND(*s)) return FALSE; s += len; } if(s != end) return FALSE; else return TRUE; } static int utf16be_is_mbc_newline(const uchar * p, const uchar * end) { if(p + 1 < end) { if(*(p+1) == NEWLINE_CODE && *p == 0x00) return 1; #ifdef USE_UNICODE_ALL_LINE_TERMINATORS if(( #ifndef USE_CRNL_AS_LINE_TERMINATOR *(p+1) == 0x0d || #endif *(p+1) == 0x85) && *p == 0x00) return 1; if(*p == 0x20 && (*(p+1) == 0x29 || *(p+1) == 0x28)) return 1; #endif } return 0; } static OnigCodePoint utf16be_mbc_to_code(const uchar * p, const uchar * end ARG_UNUSED) { OnigCodePoint code; if(UTF16_IS_SURROGATE_FIRST(*p)) { code = ((((p[0] - 0xd8) << 2) + ((p[1] & 0xc0) >> 6) + 1) << 16) + ((((p[1] & 0x3f) << 2) + (p[2] - 0xdc)) << 8) + p[3]; } else { code = p[0] * 256 + p[1]; } return code; } static int utf16be_code_to_mbclen(OnigCodePoint code) { if(code > 0xffff) { if(code > 0x10ffff) return ONIGERR_INVALID_CODE_POINT_VALUE; else return 4; } else { return 2; } } static int utf16be_code_to_mbc(OnigCodePoint code, uchar * buf) { uchar * p = buf; if(code > 0xffff) { uint plane, high; plane = (code >> 16) - 1; *p++ = (plane >> 2) + 0xd8; high = (code & 0xff00) >> 8; *p++ = ((plane & 0x03) << 6) + (high >> 2); *p++ = (high & 0x03) + 0xdc; *p = (uchar)(code & 0xff); return 4; } else { *p++ = (uchar)((code & 0xff00) >> 8); *p = (uchar)(code & 0xff); return 2; } } static int utf16be_mbc_case_fold(OnigCaseFoldType flag, const uchar ** pp, const uchar * end, uchar * fold) { const uchar * p = *pp; if(ONIGENC_IS_ASCII_CODE(*(p+1)) && *p == 0) { p++; #ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI if((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) { if(*p == 0x49) { *fold++ = 0x01; *fold = 0x31; (*pp) += 2; return 2; } } #endif *fold++ = 0; *fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); *pp += 2; return 2; } else return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF16_BE, flag, pp, end, fold); } static uchar * utf16be_left_adjust_char_head(const uchar * start, const uchar * s) { if(s <= start) return (uchar *)s; if((s - start) % 2 == 1) { s--; } if(UTF16_IS_SURROGATE_SECOND(*s) && s > start + 1 && UTF16_IS_SURROGATE_FIRST(*(s-2))) s -= 2; return (uchar *)s; } static int utf16be_get_case_fold_codes_by_str(OnigCaseFoldType flag, const uchar * p, const uchar * end, OnigCaseFoldCodeItem items[]) { return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF16_BE, flag, p, end, items); } OnigEncodingType OnigEncodingUTF16_BE = { utf16be_mbc_enc_len, "UTF-16BE", /* name */ 4, /* max enc length */ 2, /* min enc length */ utf16be_is_mbc_newline, utf16be_mbc_to_code, utf16be_code_to_mbclen, utf16be_code_to_mbc, utf16be_mbc_case_fold, onigenc_unicode_apply_all_case_fold, utf16be_get_case_fold_codes_by_str, onigenc_unicode_property_name_to_ctype, onigenc_unicode_is_code_ctype, onigenc_utf16_32_get_ctype_code_range, utf16be_left_adjust_char_head, onigenc_always_false_is_allowed_reverse_match, init, 0, /* is_initialized */ is_valid_mbc_string, ENC_FLAG_UNICODE|ENC_FLAG_SKIP_OFFSET_2, 0, 0 };
/* Copyright (c) 2014-2019 AscEmu Team <http://www.ascemu.org> This file is released under the MIT license. See README-MIT for more information. */ #pragma once enum CreatureEntry { // CelebrasTheCursedAI CN_CELEBRAS_THE_CURESE = 12225, // LordVyletongueAI CN_LORD_VYLETONGUE = 12236, // MeshlokTheHarvesterAI CN_MESHLOCK_THE_HARVESTER = 12237, // PrincessTheradrasAI CN_PRINCESS_THERADRAS = 12201, // RazorlashAI CN_RAZORLASH = 12258, // TinkererGizlockAI CN_TRINKERER_GIZLOCK = 13601, // NoxxionAI CN_NOXXION = 13282 }; enum CreatureSpells { }; enum CreatureSay { };
/** ****************************************************************************** * @file USB_Host/MTP_Standalone/Inc/main.h * @author MCD Application Team * @version V1.3.3 * @date 29-January-2016 * @brief Header for main.c module ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 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 __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ #include "stdio.h" #include "usbh_core.h" #include "usbh_mtp.h" #include "stm324xg_eval_io.h" #include "stm324xg_eval_audio.h" #include "lcd_log.h" /* Exported types ------------------------------------------------------------*/ typedef enum { MTP_DEMO_IDLE = 0, MTP_DEMO_WAIT, MTP_DEMO_EXPLORE, MTP_DEMO_PLAYBACK, MTP_REENUMERATE, }MTP_Demo_State; typedef struct _DemoStateMachine { __IO MTP_Demo_State state; __IO uint8_t select; }MTP_DEMO_StateMachine; typedef struct AUDIO_Info_t { uint32_t ChunkID; /* 0 */ uint32_t FileSize; /* 4 */ uint32_t FileFormat; /* 8 */ uint32_t SubChunk1ID; /* 12 */ uint32_t SubChunk1Size; /* 16 */ uint16_t AudioFormat; /* 20 */ uint16_t NbrChannels; /* 22 */ uint32_t SampleRate; /* 24 */ uint32_t ByteRate; /* 28 */ uint16_t BlockAlign; /* 32 */ uint16_t BitPerSample; /* 34 */ uint32_t SubChunk2ID; /* 36 */ uint32_t SubChunk2Size; /* 40 */ }WAV_InfoTypedef; typedef enum { AUDIO_DEMO_IDLE = 0, AUDIO_DEMO_WAIT, AUDIO_DEMO_EXPLORE, AUDIO_DEMO_PLAYBACK, AUDIO_REENUMERATE }AUDIO_Demo_State; typedef enum { APPLICATION_IDLE = 0, APPLICATION_START, APPLICATION_READY, APPLICATION_DISCONNECT, }MTP_ApplicationTypeDef; typedef enum { AUDIO_STATE_IDLE = 0, AUDIO_STATE_WAIT, AUDIO_STATE_INIT, AUDIO_STATE_CONFIG, AUDIO_STATE_PLAY, AUDIO_STATE_NEXT, AUDIO_STATE_PREVIOUS, AUDIO_STATE_FORWARD, AUDIO_STATE_BACKWARD, AUDIO_STATE_STOP, AUDIO_STATE_PAUSE, AUDIO_STATE_RESUME, AUDIO_STATE_VOLUME_UP, AUDIO_STATE_VOLUME_DOWN, }AUDIO_PLAYBACK_StateTypeDef; typedef enum { AUDIO_ERROR_NONE = 0, AUDIO_ERROR_IO, AUDIO_ERROR_EOF, }AUDIO_ErrorTypeDef; typedef enum { MTP_ERROR_NONE = 0, MTP_ERROR_IO, MTP_ERROR_INVALID_VALUE, }MTP_ErrorTypeDef; typedef enum { MTP_SELECT_MENU = 0, MTP_PLAYBACK_CONTROL , }MTP_DEMO_SelectMode; extern USBH_HandleTypeDef hUSBHost; extern MTP_ApplicationTypeDef Appli_state; extern AUDIO_PLAYBACK_StateTypeDef audio_state; /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void Toggle_Leds(void); void MTP_MenuInit(void); void MTP_MenuProcess(void); void AUDIO_PlaybackProbeKey(JOYState_TypeDef state); uint8_t MTP_ExploreWavFile(void); uint8_t MTP_GetData(uint32_t file_idx, uint32_t offset, uint32_t maxbytes, uint8_t *object, uint32_t *len); uint8_t MTP_GetWavObjectName(uint16_t object_index, uint8_t *filename); uint8_t MTP_Init(void); uint16_t MTP_GetWavObjectNumber(void); AUDIO_ErrorTypeDef AUDIO_Init(void); AUDIO_ErrorTypeDef AUDIO_Start(uint8_t idx); AUDIO_ErrorTypeDef AUDIO_Process(void); AUDIO_ErrorTypeDef AUDIO_Stop(void); #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/**************************************************************** * * * Copyright 2001, 2013 Fidelity Information Services, Inc * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ #include "mdef.h" #include "gtm_string.h" #include <rtnhdr.h> #include "stack_frame.h" #include "gtm_caseconv.h" #include "stringpool.h" #include "view.h" #include "rtn_src_chksum.h" GBLREF rtn_tabent *rtn_names, *rtn_names_end; /* * Returns name of next (alphabetical) routine currently ZLINK'd. * If no such routine, returns null string. */ void view_routines(mval *dst, mident_fixed *name) { mident rname; rtn_tabent *mid; boolean_t found; rname.len = INTCAST(mid_len(name)); /* convert from mident_fixed to mident */ rname.addr = &name->c[0]; found = find_rtn_tabent(&mid, &rname); if (found) mid++; /* want the *next* routine */ /* Skip over all routines that are not created by the user. These routines include * the dummy null routine, $FGNXEC (created for DALs) and $FGNFNC (created for Call-ins) * which are guaranteed to sort before any valid M routine */ while ((mid <= rtn_names_end) && ((0 == mid->rt_name.len) || ('%' > mid->rt_name.addr[0]))) mid++; if (mid > rtn_names_end) dst->str.len = 0; else { dst->str.addr = mid->rt_name.addr; dst->str.len = mid->rt_name.len; s2pool(&dst->str); } } /* * Returns checksum of routine <name>. * If name is not ZLINK'd, returns null string. */ void view_routines_checksum(mval *dst, mident_fixed *name) { mident rname; rtn_tabent *mid; boolean_t found; char buf[MAX_ROUTINE_CHECKSUM_DIGITS]; rname.len = INTCAST(mid_len(name)); /* convert from mident_fixed to mident */ rname.addr = &name->c[0]; found = find_rtn_tabent(&mid, &rname); /* Ignore the dummy null routine, $FGNXEC (created for DALs) and $FGNFNC (created for Call-ins) */ if (!found || ((0 == mid->rt_name.len) || ('%' > mid->rt_name.addr[0]))) dst->str.len = 0; else { dst->str.addr = &buf[0]; dst->str.len = append_checksum((unsigned char *)&buf[0], mid->rt_adr); s2pool(&dst->str); } }
/* Copyright 2017 Chris Young <cygitmail@gmail.com> * * This file is part of C++ Network Library with libev. * * C++ Network Library with libev is free software: you can redistribute * it and/or modify it under the terms of the GNU Affero General Public * License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * C++ Network Library with libev distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public * License along with C++ Network Library with libev. If not, see * <http://www.gnu.org/licenses/>. */ #ifndef N_SOCKS5_H #define N_SOCKS5_H #include "../Handle.h" #include "../NetworkType.h" #include "../Observer.h" #include "../Protocol.h" #include "../TCPClient.h" #include "../TCPForwadDeclare.h" #include "../TCPObject.h" #include "Forward.h" #include "Socks5TCPClient.h" #include "libev/ev++.h" namespace Network { namespace Protocol { class Socks5State; class Socks5 : public ProtocolBase, public Observer, public TCPObject { public: // definition static constexpr unsigned char Version = 0x05; static constexpr int Timeout = 30; static constexpr size_t ForwardBufferSize = 1024; // clang-format off enum SupportMethod { SM_NoAuthentication = 0x00, SM_GSSAPI = 0x01, SM_UsernamePassword = 0x02, SM_NoAcceptable = 0xFF }; enum Request { RQ_Connect = 0x01, RQ_Bind = 0x02, RQ_UDPAssociate = 0x03 }; enum Reply { RP_Succeeded = 0x00, RP_ServerFailure = 0x01, RP_NotAllowedByRuleset = 0x02, RP_NetworkUnreachable = 0x03, RP_HostUnreachable = 0x04, RP_ConnectionRefused = 0x05, RP_TTLExpired = 0x06, RP_UnsupportedCommond = 0x07, RP_UnsupportedAddressType = 0x08 }; enum AddressType { AT_IPV4 = 0x01, AT_Domain = 0x03, AT_IPV6 = 0x04 }; // clang-format on Socks5(_Base::TCPConnection* conn); virtual ~Socks5(); // Server side virtual void Init(server_tag*) override; virtual void ProcessRead(const Buffer& buffer, size_t readBytes, server_tag*) override; virtual int PrepareWrite(Buffer& buffer, server_tag*) override; virtual void ProcessWrote(const Buffer& buffer, size_t wroteBytes, server_tag*) override; // Own method Handle<Socks5TCPClient> mForwardClient; typename Socks5TCPClient::connection_type* mForwardConnection; void ChangeState(Socks5State* newState); void RequestSend() const; void CloseConnection() const; bool ResizeReadBuffer(size_t newSize); bool ResizeWriteBuffer(size_t newSize); void Update(Subject* obj, int revents) override; void CreateForwardClient(); void DeleteForwardClient(ev::timer& w, int revents); void StartTimeoutTimer(); void TimeoutHandler(ev::timer& w, int revents); bool ResizeForwardBuffer(size_t newSize); std::uint32_t StateIndicator() const { return mStateIndicator; } Socks5& SetStateIndicator(std::uint32_t indicator) { mStateIndicator = indicator; return *this; } unsigned char NumMethods() const { return mNumMethods; } Socks5& SetNumMethods(char newVal) { auto val = static_cast<unsigned char>(newVal); mNumMethods = val; return *this; } Socks5::SupportMethod Method() const { return mSelectedMethod; } Socks5& SetMethod(char method) { mSelectedMethod = static_cast<SupportMethod>(method); return *this; } char Command() const { return mCommand; } Socks5& SetCommand(char c) { mCommand = c; return *this; } char AddrType() const { return mAddrType; } Socks5& SetAddrType(char at) { mAddrType = at; return *this; } std::string DstAddress() const { return mDstAddress; } Socks5& SetDstAddress(const std::string& s) { mDstAddress = s; return *this; } PortType DstPort() const { return mDstPort; } Socks5& SetDstPort(PortType p) { mDstPort = p; return *this; } int DomainLength() const { return mDomainLength; } Socks5& SetDomainLength(char c) { mDomainLength = static_cast<unsigned char>(c); } // Client side // virtual void Init(client_tag*) override; // virtual void ProcessRead(const Buffer& buffer, size_t readBytes, // client_tag*) override; // virtual int PrepareWrite(Buffer& buffer, client_tag*) override; // virtual void ProcessWrote(const Buffer& buffer, size_t wroteBytes, // client_tag*) override; protected: ev::timer mTimeOutWatcher; ev::timer mClientDeleteTimer; Socks5State* mState; std::uint32_t mStateIndicator; unsigned char mNumMethods; Socks5::SupportMethod mSelectedMethod; char mCommand; char mAddrType; std::string mDstAddress; PortType mDstPort; int mDomainLength; }; } // End of namespace Protocol } // End of namespace Network #endif
/** LICENSE * Copyright (c) 2014-2015 Genome Research Ltd. * * Author: Cancer Genome Project cgpit@sanger.ac.uk * * This file is part of CaVEMan. * * CaVEMan is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * 1. The usage of a range of years within a copyright statement contained within * this distribution should be interpreted as being equivalent to a list of years * including the first and last year specified and all consecutive years between * them. For example, a copyright statement that reads ‘Copyright (c) 2005, 2007- * 2009, 2011-2012’ should be interpreted as being identical to a statement that * reads ‘Copyright (c) 2005, 2007, 2008, 2009, 2011, 2012’ and a copyright * statement that reads ‘Copyright (c) 2005-2012’ should be interpreted as being * identical to a statement that reads ‘Copyright (c) 2005, 2006, 2007, 2008, * 2009, 2010, 2011, 2012’." * */ #include "minunit.h" #include <cn_access.h> char *norm_cn_file = "testData/wc.cave.cn"; char *tum_cn_file = "testData/mc.cave.cn"; char *zeroes_cn_file = "testData/zeroes.cave.cn"; char *zeroes_cn_bed = "testData/zeroes.cave.cn.bed"; char *test_cn_access_get_copy_number_for_location(){ int is_normal = 1; char *chr = "10"; int pos = 17335160; int exp_norm = 2; int exp_tum = 4; int res = cn_access_get_copy_number_for_location(norm_cn_file,chr,pos,is_normal); mu_assert(res!=-1,"Problem opening normal cn file file for reading."); mu_assert(res==exp_norm,"Wrong copy number found using normal file."); is_normal = 0; clear_copy_number_store(); res = cn_access_get_copy_number_for_location(tum_cn_file,chr,pos,is_normal); mu_assert(res!=-1,"Problem opening tumour cn file file for reading."); mu_assert(res==exp_tum,"Wrong copy number found using tumour file."); clear_copy_number_store(); //Test outside the boundary of the file to assert 0 is returned. pos = 999999999; res = cn_access_get_copy_number_for_location(tum_cn_file,chr,pos,is_normal); mu_assert(res!=-1,"Problem opening normal cn file file for reading."); mu_assert(res==0,"Wrong copy number found using boundary outside the file."); clear_copy_number_store(); //Try with no cn file set it should still work char* null_file = NULL; res = cn_access_get_copy_number_for_location(null_file,chr,pos,is_normal); mu_assert(res!=-1,"Problem providing no cn file file for reading."); mu_assert(res==0,"Wrong copy number found using non existant file."); clear_copy_number_store(); is_normal = 1; res = cn_access_get_copy_number_for_location(null_file,chr,pos,is_normal); mu_assert(res!=-1,"Problem providing no cn file file for reading."); mu_assert(res==0,"Wrong copy number found using non existant file."); return NULL; } char *test_cn_access_get_copy_number_for_location_zeroes(){ int is_normal = 1; char *chr = "1"; int pos = 61735; int exp_cn = 0; int res = cn_access_get_copy_number_for_location(zeroes_cn_file,chr,pos,is_normal); mu_assert(res!=-1,"Problem reading normal cn file file for reading."); mu_assert(res==exp_cn,"Wrong copy number found using zeroes file."); clear_copy_number_store(); return NULL; } char *test_cn_access_get_copy_number_for_location_bed(){ int is_normal = 1; char *chr = "1"; int pos = 61734; int exp_cn = 4; int res = cn_access_get_copy_number_for_location(zeroes_cn_file,chr,pos,is_normal); mu_assert(res!=-1,"Problem reading normal cn file file for reading."); mu_assert(res==exp_cn,"Wrong copy number found using zeroes file."); clear_copy_number_store(); exp_cn = 0; res = cn_access_get_copy_number_for_location(zeroes_cn_bed,chr,pos,is_normal); mu_assert(res!=-1,"Problem reading normal cn file file for reading."); mu_assert(res==exp_cn,"Wrong copy number found using zeroes file."); clear_copy_number_store(); return NULL; } char *test_cn_access_get_mean_cn_for_range(){ int exp_mean = 3; int start = 114629220; int stop = 152555165; char *chr = "1"; int got = cn_access_get_mean_cn_for_range(tum_cn_file,chr,start,stop,1); mu_assert(got==exp_mean,"Test tumour mean cn 3"); got=0; got = cn_access_get_mean_cn_for_range(tum_cn_file,chr,start,stop,0); mu_assert(got==exp_mean,"Test normal mean cn 3"); chr = "4"; start = 34779055; stop = 34824724; got = cn_access_get_mean_cn_for_range(tum_cn_file,chr,start,stop,0); mu_assert(got==exp_mean, "Test normal mean cn 2"); exp_mean = 2; return NULL; } char *all_tests() { mu_suite_start(); mu_run_test(test_cn_access_get_copy_number_for_location); mu_run_test(test_cn_access_get_copy_number_for_location_zeroes); mu_run_test(test_cn_access_get_mean_cn_for_range); return NULL; } RUN_TESTS(all_tests);
#endif // #ifndef SEEN_STG_H
/**************************************************************** * * * Copyright 2001, 2011 Fidelity Information Services, Inc * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ #include "mdef.h" #include "gtm_unistd.h" #ifdef VMS #include <lckdef.h> #include <psldef.h> #endif #include "gdsroot.h" #include "gtm_facility.h" #include "fileinfo.h" #include "gdsbt.h" #include "gdsfhead.h" #include "error.h" #include "filestruct.h" #include "io.h" #include "iosp.h" #include "jnl.h" #include "util.h" GBLREF gd_region *gv_cur_region; GBLREF int4 exi_condition; GBLREF boolean_t created_core; GBLREF boolean_t dont_want_core; static const unsigned short zero_fid[3]; error_def(ERR_ASSERT); error_def(ERR_GTMASSERT); error_def(ERR_GTMASSERT2); error_def(ERR_GTMCHECK); error_def(ERR_GVRUNDOWN); error_def(ERR_MEMORY); error_def(ERR_OUTOFSPACE); error_def(ERR_STACKOFLOW); error_def(ERR_VMSMEMORY); CONDITION_HANDLER(lastchance2) { int4 actual_exi_condition; actual_exi_condition = exi_condition; PRN_ERROR; dec_err(VARLSTCNT(1) ERR_GVRUNDOWN); ESTABLISH(lastchance3); io_rundown(NORMAL_RUNDOWN); REVERT; if (DUMPABLE && !SUPPRESS_DUMP) DUMP_CORE; PROCDIE(actual_exi_condition); }
/* * Copyright (C) 2019 ML!PA Consulting GmbH * * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup cpu_sam0_common * @ingroup drivers_periph_timer * @{ * * @file timer.c * @brief Low-level timer driver implementation * * @author Benjamin Valentin <benjamin.valentin@ml-pa.com> * * @} */ #include <stdlib.h> #include <stdio.h> #include "board.h" #include "cpu.h" #include "periph/timer.h" #include "periph_conf.h" #define ENABLE_DEBUG (0) #include "debug.h" /** * @brief Timer state memory */ static timer_isr_ctx_t config[TIMER_NUMOF]; static inline TcCount32 *dev(tim_t tim) { return &timer_config[tim].dev->COUNT32; } static inline TcCount16 *dev16(tim_t tim) { return &timer_config[tim].dev->COUNT16; } static inline TcCount8 *dev8(tim_t tim) { return &timer_config[tim].dev->COUNT8; } static inline void wait_synchronization(tim_t tim) { #if defined(TC_SYNCBUSY_MASK) /* SYNCBUSY is a register */ while ((dev(tim)->SYNCBUSY.reg & TC_SYNCBUSY_MASK) != 0) {} #elif defined(TC_STATUS_SYNCBUSY) /* SYNCBUSY is a bit */ while ((dev(tim)->STATUS.reg & TC_STATUS_SYNCBUSY) != 0) {} #else #error Unsupported device #endif } /* enable timer interrupts */ static inline void _irq_enable(tim_t tim) { NVIC_EnableIRQ(timer_config[tim].irq); } /** * @brief Setup the given timer */ int timer_init(tim_t tim, unsigned long freq, timer_cb_t cb, void *arg) { const tc32_conf_t *cfg = &timer_config[tim]; /* make sure given device is valid */ if (tim >= TIMER_NUMOF) { return -1; } /* at the moment, the timer can only run at 1MHz */ if (freq != 1000000ul) { return -1; } /* make sure the timer is not running */ timer_stop(tim); #ifdef MCLK GCLK->PCHCTRL[cfg->gclk_id].reg = cfg->gclk_src | GCLK_PCHCTRL_CHEN; *cfg->mclk |= cfg->mclk_mask; #else GCLK->CLKCTRL.reg = GCLK_CLKCTRL_CLKEN | cfg->gclk_src | cfg->gclk_ctrl; PM->APBCMASK.reg |= cfg->pm_mask; #endif /* reset the timer */ dev(tim)->CTRLA.bit.SWRST = 1; while (dev(tim)->CTRLA.bit.SWRST) {} dev(tim)->CTRLA.reg = cfg->flags #ifdef TC_CTRLA_WAVEGEN_NFRQ | TC_CTRLA_WAVEGEN_NFRQ #endif | cfg->prescaler | TC_CTRLA_PRESCSYNC_RESYNC; #ifdef TC_WAVE_WAVEGEN_NFRQ dev(tim)->WAVE.reg = TC_WAVE_WAVEGEN_NFRQ; #endif wait_synchronization(tim); dev(tim)->INTENCLR.reg = TC_INTENCLR_MASK; /* save callback */ config[tim].cb = cb; config[tim].arg = arg; timer_start(tim); /* enable interrupts for given timer */ _irq_enable(tim); return 0; } static void _set_cc(tim_t tim, int cc, unsigned int value) { const uint16_t flags = timer_config[tim].flags; if (flags & TC_CTRLA_MODE_COUNT32) { dev(tim)->CC[cc].reg = value; return; } if (flags & TC_CTRLA_MODE_COUNT8) { dev8(tim)->CC[cc].reg = value; return; } /* 16 bit is the default */ dev16(tim)->CC[cc].reg = value; } int timer_set_absolute(tim_t tim, int channel, unsigned int value) { DEBUG("Setting timer %i channel %i to %i\n", tim, channel, value); /* set timeout value */ switch (channel) { case 0: dev(tim)->INTFLAG.reg = TC_INTFLAG_MC0; _set_cc(tim, 0, value); dev(tim)->INTENSET.bit.MC0 = 1; break; case 1: dev(tim)->INTFLAG.reg = TC_INTFLAG_MC1; _set_cc(tim, 1, value); dev(tim)->INTENSET.bit.MC1 = 1; break; default: return -1; } return 1; } int timer_clear(tim_t tim, int channel) { switch (channel) { case 0: dev(tim)->INTFLAG.reg = TC_INTFLAG_MC0; dev(tim)->INTENCLR.bit.MC0 = 1; break; case 1: dev(tim)->INTFLAG.reg = TC_INTFLAG_MC1; dev(tim)->INTENCLR.bit.MC1 = 1; break; default: return -1; } return 1; } unsigned int timer_read(tim_t tim) { /* WORKAROUND to prevent being stuck there if timer not init */ if (!dev(tim)->CTRLA.bit.ENABLE) { return 0; } /* request syncronisation */ #ifdef TC_CTRLBSET_CMD_READSYNC_Val dev(tim)->CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_READSYNC_Val; #else dev(tim)->READREQ.reg = TC_READREQ_RREQ | TC_READREQ_ADDR(0x10); #endif wait_synchronization(tim); return dev(tim)->COUNT.reg; } void timer_stop(tim_t tim) { dev(tim)->CTRLA.bit.ENABLE = 0; } void timer_start(tim_t tim) { dev(tim)->CTRLA.bit.ENABLE = 1; } static inline void timer_isr(tim_t tim) { TcCount32 *tc = dev(tim); uint8_t status = tc->INTFLAG.reg; /* Acknowledge all interrupts */ tc->INTFLAG.reg = status; if ((status & TC_INTFLAG_MC0) && tc->INTENSET.bit.MC0) { tc->INTENCLR.reg = TC_INTENCLR_MC0; if (config[tim].cb) { config[tim].cb(config[tim].arg, 0); } } if ((status & TC_INTFLAG_MC1) && tc->INTENSET.bit.MC1) { tc->INTENCLR.reg = TC_INTENCLR_MC1; if (config[tim].cb) { config[tim].cb(config[tim].arg, 1); } } } #ifdef TIMER_0_ISR void TIMER_0_ISR(void) { timer_isr(0); cortexm_isr_end(); } #endif #ifdef TIMER_1_ISR void TIMER_1_ISR(void) { timer_isr(1); cortexm_isr_end(); } #endif #ifdef TIMER_2_ISR void TIMER_2_ISR(void) { timer_isr(2); cortexm_isr_end(); } #endif #ifdef TIMER_3_ISR void TIMER_3_ISR(void) { timer_isr(3); cortexm_isr_end(); } #endif
/************************************************************************** * EVB900A-V1¿ª·¢°åʵÑé³ÌÐò * * °æ±¾£º (C) Copyright 2010,SC.etc,DCL,CHM All Rights reserved. * * ÍøÕ¾£º mcuep.taobao.com * * ÓÊÏ䣺 dcl0@sina.com * * ×÷Õߣº DCL,CHM * À´Ô´£º ˼´´µç×Ó Xa' STrong ELECTRONICS CO.,LTD * *¡¾°æÈ¨¡¿Copyright(A) ˼´´µç×Ó mcuep.taobao.com All Rights Reserved * *¡¾ÉùÃ÷¡¿´Ë³ÌÐò½öÓÃÓÚѧϰÓë²Î¿¼£¬ÒýÓÃÇë×¢Ã÷°æÈ¨ºÍ×÷ÕßÐÅÏ¢£¡ * *************************************************************************/ //DS18B20¶ÁζȳÌÐò£¬¹Òµ¥¸öоƬ¡£ //ÕâÀïÒÔ11.0592M¾§ÌåΪÀý£¬²»Í¬µÄ¾§ÌåËÙ¶È¿ÉÄÜÐèÒªµ÷ÕûÑÓʱµÄʱ¼ä //sbit DQ =P1^0; ¸ù¾Ýʵ¼ÊÇé¿ö¶¨Òå¶Ë¿Ú #include "C8051F340.H" //µ÷ÓÃÍ·Îļþ£¨µ¥Æ¬»úÄÚ²¿µÄ¼Ä´æÆ÷¶¨Òå£ #include "intrins.h" #include "math.h" sbit DQ = P3^7;//18B20-1 bit isExternPower; //sbit B20-DQ1 = P4^7;//18B20-1 //sbit B20-DQ2 = P4^6;//18B20-1 /*****************ÑÓʱ**********/ void DS18B20_1us(unsigned int us) //Ô¼1us ---¾§Õñ48MHZ { while (us) { _nop_(); _nop_(); _nop_(); _nop_(); _nop_();_nop_();_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();_nop_(); --us; } } /*****************¸´Î»**********/ unsigned char Init_DS18B20(void) { unsigned char i,presence; Clr_DQ(); // pull DQ line low DS18B20_1us(467); Set_DQ(); // allow line to return high DS18B20_1us(15); DS18B20_1us(200); presence = DQ; // Èç¹û=0Ôò³õʼ»¯³É¹¦ =1Ôò³õʼ»¯Ê§°Ü for (i=0;i<30;i++) //240us DS18B20_1us(15); return(presence); // 0=presence, 1 = no part } /*******Ïò 1-WIRE ×ÜÏßÉÏдһ¸ö×Ö½Ú**********/ void write_byte(unsigned char dat) { unsigned char i; EA=0; Set_DQ(); DS18B20_1us(1); DS18B20_1us(10); for (i=8; i>0; i--) // writes byte, one bit at a time { Clr_DQ(); // pull DQ low to start timeslot DS18B20_1us(15); if((dat&0x01)==1){Set_DQ();} DS18B20_1us(50); // hold value for remainder of timeslot Set_DQ(); dat>>=1; DS18B20_1us(1); } EA=1; } /*******´Ó 1-wire ×ÜÏßÉ϶Áȡһ¸ö×Ö½Ú**********/ unsigned char read_byte(void) { unsigned char i; unsigned char value = 0; EA=0; Set_DQ(); DS18B20_1us(1); for (i=8;i>0;i--) { Clr_DQ(); // ¸øÂö³åÐźŠDS18B20_1us(5); Set_DQ(); // ¸øÂö³åÐźŠDS18B20_1us(1); value>>=1; if((DQ)==0x80)value|=0x80; DS18B20_1us(60); // wait for rest of timeslot } EA=1; return(value); } /****************************************************** º¯Êý¹¦ÄÜ£ºÆô¶¯Î¶Èת»» *******************************************************/ void Convert_T() { unsigned char pre=1; while(pre==1) { pre=Init_DS18B20(); //DS18B20¸´Î» } write_byte(0xCC); //Ìø¹ý¶ÁÐòºÅÁкŵIJÙ×÷ write_byte(0x44); //дÈë44HÃüÁÆô¶¯Î¶Èת»» } /****************************************************** º¯Êý¹¦ÄÜ£ºµçÔ´¹¤×÷·½Ê½ *******************************************************/ bit Read_Power_Supply() { write_byte(0xB4); DS18B20_1us(100); //·¢¶ÁÈ¡µçÔ´¹¤×÷·½Ê½Ö¸Áî if(DQ){ isExternPower=1; //ÊÇÍⲿµçÔ´¹©µç }else{ isExternPower=0; //ÊǼÄÉúµçÔ´ } return isExternPower; } /****************************************************** º¯Êý¹¦ÄÜ£ºÌø¹ýROM±àÂëÖ¸Áî *******************************************************/ void Skip_ROM() { unsigned char pre=1; while(pre==1) { pre=Init_DS18B20(); //DS18B20¸´Î» } write_byte(0xCC); //ÓÉÓÚÔÚ±¾ÊµÑéÖÐÖ»ÓÃÒ»¸ö18B20,ËùÒÔ²»ÐèÒª¹ØÓÚROMµÄÖ¸Áµ÷ÓôËÖ¸Áî£¬Ìø¹ýROMµÄÏà¹Ø²Ù×÷ } /*******¶ÁȡζÈ**********/ unsigned int Read_Temperature(void) { unsigned char a=0; unsigned char b=0; float temper=0; Convert_T(); // Skip ROM and Start Conversion Skip_ROM(); //Skip ROM-->Ìø¹ý¶ÁÐòºÅÁкŵIJÙ×÷ÇÒÆô¶¯Î¶Èת»» write_byte(0xBE); // Read Scratch Pad-->¶ÁȡζȼĴæÆ÷µÈ£¨¹²¿É¶Á9¸ö¼Ä´æÆ÷£© ǰÁ½¸ö¾ÍÊÇÎÂ¶È a = read_byte(); //¶ÁµÍλ b = read_byte(); //¶Á¸ßλ temper=a+b*256; if (temper==0xFFFF) return 0xFFFF; if (temper>0x8000) { temper=-temper; return (0x8000+temper*5/8); } else return (temper*5/8); }
//////////////////////////////////////////////////////////////// // // Copyright (C) 2005 Affymetrix, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License (version 2) 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 // //////////////////////////////////////////////////////////////// /** * @file MAS5Engine.h * @author Alan Williams * @date Wed Apr 15 15:29:23 PDT 2009 * * @brief Core routines for running MAS5 */ #ifndef _MAS5ENGINE_H_ #define _MAS5ENGINE_H_ #include "mas5-stat/workflow/MAS5Workflow.h" // #include "util/BaseEngine.h" // #include <cstring> #include <string> #include <vector> // class MAS5Engine : public BaseEngine { public: virtual std::string getEngineName() { return MAS5Engine::EngineName(); } static const std::string EngineName() { return "MAS5Engine"; } /** * Constructor */ MAS5Engine(); /** * Destructor */ ~MAS5Engine(); /*! A class to register the summary engine. */ class Reg : public EngineReg { public: /*! Constructor - register the summary engine. */ Reg() : EngineReg(MAS5Engine::EngineName()) { } /*! Creates an object. * @return The object. */ BaseEngine *MakeObject() { return new MAS5Engine; } }; /*! The one and only registration object. */ static Reg reg; /*! Converts the type to the summary engine type. * @param chip The pointer to the base engine object. * @return The summary engine type or NULL if not compatible. */ static MAS5Engine * FromBase(BaseEngine *engine); private: /** * Do the analysis * Will call Verbose::out() and Err::errAbort(). */ void runImp(); void defineOptions(); void defineStates(); void checkOptionsImp(); private: MAS5Workflow m_Mas5; }; #endif /* _MAS5ENGINE_H_ */
/* -*-c++-*- IfcPlusPlus - www.ifcplusplus.com - Copyright (C) 2011 Fabian Gerold * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * 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 * OpenSceneGraph Public License for more details. */ #pragma once #include <vector> #include <map> #include <sstream> #include <string> #include "ifcpp/model/shared_ptr.h" #include "ifcpp/model/IfcPPObject.h" #include "ifcpp/model/IfcPPGlobal.h" #include "IfcDerivedMeasureValue.h" // TYPE IfcMonetaryMeasure = REAL; class IFCPP_EXPORT IfcMonetaryMeasure : public IfcDerivedMeasureValue { public: IfcMonetaryMeasure(); IfcMonetaryMeasure( double value ); ~IfcMonetaryMeasure(); virtual const char* className() const { return "IfcMonetaryMeasure"; } virtual shared_ptr<IfcPPObject> getDeepCopy( IfcPPCopyOptions& options ); virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const; static shared_ptr<IfcMonetaryMeasure> createObjectFromSTEP( const std::wstring& arg ); double m_value; };
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QWSSHAREDMEMORY_P_H #define QWSSHAREDMEMORY_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <qplatformdefs.h> QT_BEGIN_NAMESPACE #if !defined(QT_NO_QWS_MULTIPROCESS) class QWSSharedMemory { public: QWSSharedMemory(); ~QWSSharedMemory(); bool create(int size); bool attach(int id); void detach(); int id() const { return shmId; } void *address() const { return shmBase; } int size() const; private: int shmId; void *shmBase; mutable int shmSize; #ifdef QT_POSIX_IPC int hand; #endif }; #endif // QT_NO_QWS_MULTIPROCESS QT_END_NAMESPACE #endif // QWSSHAREDMEMORY_P_H
/******************************************************************** * Description: emcglb.c * Globals initialized to values in emccfg.h * * Derived from a work by Fred Proctor & Will Shackleford * * Author: * License: GPL Version 2 * System: Linux * * Copyright (c) 2004 All rights reserved. * * Last change: ********************************************************************/ #include <string.h> /* strcpy() */ #include "emcglb.h" /* these decls */ #include "emccfg.h" /* their initial values */ #include "emcpos.h" /* EmcPose */ char EMC_INIFILE[LINELEN] = DEFAULT_EMC_INIFILE; char EMC_NMLFILE[LINELEN] = DEFAULT_EMC_NMLFILE; char RS274NGC_STARTUP_CODE[LINELEN] = DEFAULT_RS274NGC_STARTUP_CODE; int EMC_DEBUG = 0; /* initially no debug messages */ double EMC_TASK_CYCLE_TIME = DEFAULT_EMC_TASK_CYCLE_TIME; double EMC_IO_CYCLE_TIME = DEFAULT_EMC_IO_CYCLE_TIME; int EMC_TASK_INTERP_MAX_LEN = DEFAULT_EMC_TASK_INTERP_MAX_LEN; char TOOL_TABLE_FILE[LINELEN] = DEFAULT_TOOL_TABLE_FILE; EmcPose TOOL_CHANGE_POSITION; /* no defaults */ unsigned char HAVE_TOOL_CHANGE_POSITION = 0; /* default is 'not there' */ EmcPose TOOL_HOLDER_CLEAR; /* no defaults */ unsigned char HAVE_TOOL_HOLDER_CLEAR; /* default is 'not there' */ int taskplanopen = 0; void emcInitGlobals() { }
/* This file is part of CanFestival, a library implementing CanOpen Stack. Copyright (C): Edouard TISSERANT and Francis DUPIN See COPYING file for copyrights details. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __KERNEL__ #include <unistd.h> #include <stdio.h> #include <stdlib.h> #else #include <linux/module.h> #endif #ifndef NOT_USE_DYNAMIC_LOADING #define DLL_CALL(funcname) (* funcname##_driver) #define FCT_PTR_INIT =NULL #define DLSYM(name)\ *(void **) (&name##_driver) = dlsym(handle, #name"_driver");\ if ((error = dlerror()) != NULL) {\ fprintf (stderr, "%s\n", error);\ UnLoadCanDriver(handle);\ return NULL;\ } #else /*NOT_USE_DYNAMIC_LOADING*/ /*Function call is direct*/ #define DLL_CALL(funcname) funcname##_driver #endif /*NOT_USE_DYNAMIC_LOADING*/ #include "data.h" #include "canfestival.h" #include "timers_driver.h" #define MAX_NB_CAN_PORTS 16 /** CAN port structure */ typedef struct { char used; /**< flag indicating CAN port usage, will be used to abort Receiver task*/ CAN_HANDLE fd; /**< CAN port file descriptor*/ TASK_HANDLE receiveTask; /**< CAN Receiver task*/ CO_Data* d; /**< CAN object data*/ } CANPort; #include "can_driver.h" /*Declares the funtion pointers for dll binding or simple protos*/ /*UNS8 DLL_CALL(canReceive)(CAN_HANDLE, Message *); UNS8 DLL_CALL(canSend)(CAN_HANDLE, Message *); CAN_HANDLE DLL_CALL(canOpen)(s_BOARD *); int DLL_CALL(canClose)(CAN_HANDLE); */ CANPort canports[MAX_NB_CAN_PORTS] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,}}; #ifndef NOT_USE_DYNAMIC_LOADING /*UnLoads the dll*/ UNS8 UnLoadCanDriver(LIB_HANDLE handle) { if(handle!=NULL) { dlclose(handle); handle=NULL; return 0; } return -1; } /** * Loads the dll and get funcs ptr * * @param driver_name String containing driver's dynamic library name * @return Library handle */ LIB_HANDLE LoadCanDriver(const char* driver_name) { LIB_HANDLE handle = NULL; char *error; if(handle==NULL) { handle = dlopen(driver_name, RTLD_LAZY); } if (!handle) { fprintf (stderr, "%s\n", dlerror()); return NULL; } /*Get function ptr*/ DLSYM(canReceive) DLSYM(canSend) DLSYM(canOpen) DLSYM(canChangeBaudRate) DLSYM(canClose) return handle; } #endif /*Not needed -- canReceiveLoop calls _canReceive directly *//* UNS8 canReceive(CAN_PORT port, Message *m) { return DLL_CALL(canReceive)(port->fd, Message *m); } */ /** * CAN send routine * @param port CAN port * @param m CAN message * @return success or error */ UNS8 canSend(CAN_PORT port, Message *m) { if(port){ UNS8 res; //LeaveMutex(); res = DLL_CALL(canSend)(((CANPort*)port)->fd, m); //EnterMutex(); return res; // OK } return 1; // NOT OK } /** * CAN Receiver Task * @param port CAN port */ void canReceiveLoop(CAN_PORT port) { Message m; while (((CANPort*)port)->used) { if (DLL_CALL(canReceive)(((CANPort*)port)->fd, &m) != 0) break; EnterMutex(); canDispatch(((CANPort*)port)->d, &m); LeaveMutex(); } } /** * CAN open routine * @param board device name and baudrate * @param d CAN object data * @return valid CAN_PORT pointer or NULL */ CAN_PORT canOpen(s_BOARD *board, CO_Data * d) { int i; for(i=0; i < MAX_NB_CAN_PORTS; i++) { if(!canports[i].used) break; } #ifndef NOT_USE_DYNAMIC_LOADING if (&DLL_CALL(canOpen)==NULL) { fprintf(stderr,"CanOpen : Can Driver dll not loaded\n"); return NULL; } #endif CAN_HANDLE fd0 = DLL_CALL(canOpen)(board); if(fd0){ canports[i].used = 1; canports[i].fd = fd0; canports[i].d = d; d->canHandle = (CAN_PORT)&canports[i]; CreateReceiveTask(&(canports[i]), &canports[i].receiveTask, &canReceiveLoop); return (CAN_PORT)&canports[i]; }else{ MSG("CanOpen : Cannot open board {busname='%s',baudrate='%s'}\n",board->busname, board->baudrate); return NULL; } } /** * CAN close routine * @param d CAN object data * @return success or error */ int canClose(CO_Data * d) { UNS8 res; ((CANPort*)d->canHandle)->used = 0; CANPort* tmp = (CANPort*)d->canHandle; d->canHandle = NULL; // close CAN port res = DLL_CALL(canClose)(tmp->fd); // kill receiver task WaitReceiveTaskEnd(&tmp->receiveTask); return res; } /** * CAN change baudrate routine * @param port CAN port * @param baud baudrate * @return success or error */ UNS8 canChangeBaudRate(CAN_PORT port, char* baud) { if(port){ UNS8 res; //LeaveMutex(); res = DLL_CALL(canChangeBaudRate)(((CANPort*)port)->fd, baud); //EnterMutex(); return res; // OK } return 1; // NOT OK } #ifdef __KERNEL__ EXPORT_SYMBOL (canOpen); EXPORT_SYMBOL (canClose); EXPORT_SYMBOL (canSend); EXPORT_SYMBOL (canChangeBaudRate); #endif
/* Copyright (C) 2011 Bastien Nocera The Gnome 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. The Gnome 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 the Gnome 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. Authors: Bastien Nocera <hadess@hadess.net> */ #ifndef GEOCODE_REVERSE_H #define GEOCODE_REVERSE_H #include <glib.h> #include <gio/gio.h> G_BEGIN_DECLS GType geocode_reverse_get_type (void) G_GNUC_CONST; #define GEOCODE_TYPE_REVERSE (geocode_reverse_get_type ()) #define GEOCODE_REVERSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEOCODE_TYPE_REVERSE, GeocodeReverse)) #define GEOCODE_IS_REVERSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEOCODE_TYPE_REVERSE)) #define GEOCODE_REVERSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEOCODE_TYPE_REVERSE, GeocodeReverseClass)) #define GEOCODE_IS_REVERSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEOCODE_TYPE_REVERSE)) #define GEOCODE_REVERSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEOCODE_TYPE_REVERSE, GeocodeReverseClass)) /** * GeocodeReverse: * * All the fields in the #GeocodeReverse structure are private and should never be accessed directly. **/ typedef struct _GeocodeReverse GeocodeReverse; typedef struct _GeocodeReverseClass GeocodeReverseClass; typedef struct _GeocodeReversePrivate GeocodeReversePrivate; struct _GeocodeReverse { /* <private> */ GObject parent_instance; GeocodeReversePrivate *priv; }; /** * GeocodeReverseClass: * * All the fields in the #GeocodeReverseClass structure are private and should never be accessed directly. **/ struct _GeocodeReverseClass { /* <private> */ GObjectClass parent_class; }; GeocodeReverse *geocode_reverse_new_for_location (GeocodeLocation *location); void geocode_reverse_resolve_async (GeocodeReverse *object, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GHashTable *geocode_reverse_resolve_finish (GeocodeReverse *object, GAsyncResult *res, GError **error); GHashTable *geocode_reverse_resolve (GeocodeReverse *object, GError **error); G_END_DECLS #endif /* GEOCODE_REVERSE_H */
/* * Copyright (C) 2017 Fundacion Inria Chile * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @{ * @ingroup net * @file * @brief Implementation of OpenThread random platform abstraction * * @author Jose Ignacio Alamos <jialamos@uc.cl> * @} */ #include <stdint.h> #include "openthread/platform/random.h" #include "periph/cpuid.h" #include "random.h" #ifdef MODULE_CC2538_RF #define SOC_ADC_ADCCON1_RCTRL0 0x00000004 //ADCCON1 RCTRL bit 0 #define SOC_ADC_ADCCON1_RCTRL1 0x00000008 //ADCCON1 RCTRL bit 1 #define SYS_CTRL_RCGCRFC_RFC0 0x00000001 #define RFCORE_XREG_FRMCTRL0_INFINITY_RX 0x00000008 #define RFCORE_SFR_RFST_INSTR_RXON 0xE3 // Instruction set RX on #define RFCORE_XREG_RSSISTAT_RSSI_VALID 0x00000001 // RSSI value is valid. #define RFCORE_XREG_RFRND_IRND 0x00000001 #endif #define ENABLE_DEBUG (0) #include "debug.h" /* init random */ //void ot_random_init(void) //{ //#ifdef CPUID_LEN // char cpu_id[CPUID_LEN]; // cpuid_get(cpu_id); // uint32_t seed = 0; // for (unsigned i = 0; i < CPUID_LEN; i++) { // seed += cpu_id[i]; // } // random_init(seed); //#else // #error "CPU not supported (current CPU doesn't provide CPUID, required for entropy)" //#endif //} ///* OpenThread will call this to get a random number */ //uint32_t otPlatRandomGet(void) //{ // uint32_t rand_val = random_uint32(); // // DEBUG("otPlatRandomGet: %i\n", (int) rand_val); // return rand_val; //} #ifdef MODULE_CC2538_RF static void generateRandom(uint8_t *aOutput, uint16_t aOutputLength) { SOC_ADC_ADCCON1 &= ~(SOC_ADC_ADCCON1_RCTRL1 | SOC_ADC_ADCCON1_RCTRL0); SYS_CTRL_RCGCRFC = SYS_CTRL_RCGCRFC_RFC0; while((SYS_CTRL_RCGCRFC) != SYS_CTRL_RCGCRFC_RFC0); RFCORE_XREG_FRMCTRL0 = RFCORE_XREG_FRMCTRL0_INFINITY_RX; //instruction set RX on RFCORE_SFR_RFST = ISRXON; while(!RFCORE_XREG_RSSISTAT & RFCORE_XREG_RSSISTAT_RSSI_VALID); for(uint16_t index = 0; index < aOutputLength; index++) { aOutput[index] = 0; for(uint8_t offset = 0; offset < 8 * sizeof(uint8_t); offset++) { aOutput[index] <<= 1; aOutput[index] |= (RFCORE_XREG_RFRND & RFCORE_XREG_RFRND_IRND); } } DEBUG("generating random number...\n"); //RX OFF RFCORE_SFR_RFST = ISRFOFF; } void ot_random_init(void) { uint16_t seed = 0; while (seed == 0x0000 || seed == 0x8883) { generateRandom((uint8_t *)&seed, sizeof(seed)); } SOC_ADC_RNDL = (seed >> 8) & 0xff; SOC_ADC_RNDL = seed & 0xff; } /* OpenThread will call this to get a random number */ uint32_t otPlatRandomGet(void) { uint32_t rand_val = 0; SOC_ADC_ADCCON1 |= SOC_ADC_ADCCON1_RCTRL0; rand_val = SOC_ADC_RNDL | ( SOC_ADC_RNDH << 8); SOC_ADC_ADCCON1 |= SOC_ADC_ADCCON1_RCTRL0; rand_val |= (SOC_ADC_RNDL | (SOC_ADC_RNDH << 8 ) << 16); DEBUG("otPlatRandomGet: %i\n", (int) rand_val); return rand_val; } #endif
/** @file vbox_driver.c * Core driver methods for managing VirtualBox VM's */ /* * Copyright (C) 2010-2014 Red Hat, Inc. * Copyright (C) 2008-2009 Sun Microsystems, Inc. * * This file is part of a free software library; you can redistribute * it and/or modify it under the terms of the GNU Lesser General * Public License version 2.1 as published by the Free Software * Foundation and shipped in the "COPYING.LESSER" file with this library. * The library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY of any kind. * * Sun LGPL Disclaimer: For the avoidance of doubt, except that if * any license choice other than GPL or LGPL is available it will * apply instead, Sun elects to use only the Lesser General Public * License version 2.1 (LGPLv2) at this time for any software where * a choice of LGPL license versions is made available with the * language indicating that LGPLv2 or any later version may be used, * or where a choice of which version of the LGPL is applied is * otherwise unspecified. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * Clara, CA 95054 USA or visit http://www.sun.com if you need * additional information or have any questions. */ #include <config.h> #include <unistd.h> #include "internal.h" #include "datatypes.h" #include "virlog.h" #include "vbox_driver.h" #include "vbox_glue.h" #include "virerror.h" #include "virutil.h" #include "domain_event.h" #include "domain_conf.h" #include "vbox_get_driver.h" #define VIR_FROM_THIS VIR_FROM_VBOX VIR_LOG_INIT("vbox.vbox_driver"); #if defined(VBOX_DRIVER) static virDrvOpenStatus dummyConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { uid_t uid = geteuid(); virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); if (conn->uri == NULL || conn->uri->scheme == NULL || STRNEQ(conn->uri->scheme, "vbox") || conn->uri->server != NULL) return VIR_DRV_OPEN_DECLINED; if (conn->uri->path == NULL || STREQ(conn->uri->path, "")) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no VirtualBox driver path specified (try vbox:///session)")); return VIR_DRV_OPEN_ERROR; } if (uid != 0) { if (STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown driver path '%s' specified (try vbox:///session)"), conn->uri->path); return VIR_DRV_OPEN_ERROR; } } else { /* root */ if (STRNEQ(conn->uri->path, "/system") && STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown driver path '%s' specified (try vbox:///system)"), conn->uri->path); return VIR_DRV_OPEN_ERROR; } } virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unable to initialize VirtualBox driver API")); return VIR_DRV_OPEN_ERROR; } static virHypervisorDriver vboxDriverDummy = { "VBOX", .connectOpen = dummyConnectOpen, /* 0.6.3 */ }; static virConnectDriver vboxConnectDriver; int vboxRegister(void) { uint32_t uVersion; if (VBoxCGlueInit(&uVersion) == 0) vboxConnectDriver.hypervisorDriver = vboxGetHypervisorDriver(uVersion); if (vboxConnectDriver.hypervisorDriver) { vboxConnectDriver.networkDriver = vboxGetNetworkDriver(uVersion); vboxConnectDriver.storageDriver = vboxGetStorageDriver(uVersion); } else { vboxConnectDriver.hypervisorDriver = &vboxDriverDummy; } if (virRegisterConnectDriver(&vboxConnectDriver, false) < 0) return -1; return 0; } #endif
#ifndef DEGU_DEGU_PARSER_SYMBOL_H #define DEGU_DEGU_PARSER_SYMBOL_H // Standard #include "string" // degu-common #include "degu-common/include/types.h" #include "degu-common/include/source_err.h" namespace Degu { namespace Parser { class Parser { public: bool has_input; std::string input; Parser(); void give_input(std::string); Common::SourceErr do_parse(); }; } } #endif
/* Copyright (C) 1995-2001 Activision, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /*--------------------------------------------------------------------------- Code to check whether a Greenleaf connection to a peer is working properly. $Log: gnlframp.c $ Revision 1.2 1997/01/31 02:49:21 dkegel Switched to ddprint.h (for drivers) Revision 1.1 1996/12/13 23:25:42 jgraebner Initial revision Revision 1.5 1996/07/01 22:43:09 dkegel Improved error message if ramp was unsuccessful. Revision 1.4 1996/07/01 20:51:05 dkegel 1. Read all 256 bytes of ramp, even if there's a newline before it. 2. Send and check sessionID to make sure it's not the same as ours. (Which happens when cable not attached.) Revision 1.3 1996/07/01 19:15:22 dkegel Ignore last newline leftover from modem commands if present. Revision 1.2 1996/06/30 21:37:47 dkegel Be paranoid about overrunning buffers. Revision 1.1 1996/06/30 21:16:34 dkegel Initial revision ---------------------------------------------------------------------------*/ #ifdef _WINDOWS #include <windows.h> #define sleep(x) Sleep((x) * 1000) #endif #include <string.h> #include <stdio.h> #define DEBUG_MODULE !FALSE #include "ddprint.h" #include "gnlframp.h" extern void fdprint(char *msg); /*--------------------------------------------------------------------------- Send a ramp and our ID to the other system, get their ramp and ID. print any differences in the ramp to both DPRINT and fdprint. If session ID's are the same, print warning to both DPRINT and fdprint. ---------------------------------------------------------------------------*/ void exchange_ramp(PORT *port, long sessionID) { // See if data is getting through to the other side. unsigned char ibuf[256], obuf[256]; char message[256]; long theirID; int i; // Generate ramp and send it. for (i=0; i<sizeof(obuf); i++) obuf[i] = i; WriteBuffer(port, obuf, sizeof(obuf)); // Send sessionID. WriteBuffer(port, (char *)&sessionID, sizeof(sessionID)); // Let other side do the same, and let data percolate. sleep(1); if (SpaceUsedInTXBuffer(port) > 0) { sprintf(message, "Warning: %d bytes left in output buffer after 1 second\r\n",SpaceUsedInTXBuffer(port)); fdprint(message); DPRINT((message)); } // Skip newline if present // Read the other side's ramp. ReadBuffer(port, ibuf, 1); if (ibuf[0] == '\n') { fdprint("skipping newline\r\n"); DPRINT(("skipping newline\n")); ReadBuffer(port, ibuf, sizeof(obuf)); } else { ReadBuffer(port, ibuf+1, sizeof(obuf)-1); // kludge port->count++; } sprintf(message, "Sent %d byte ramp, read %d bytes.\r\n", sizeof(obuf), port->count); fdprint(message); DPRINT((message)); if (port->count < 10) { fdprint("\r\nError: Ramp not received. Check to make sure the cable is connected,\r\n" "that you have selected the right comm port on both computers,\r\n" "and that both players ran netmech with -Ktest.\r\n\r\n"); return; } // Find first byte that differs, print rest out. for (i=0; (i<port->count) && (ibuf[i] == obuf[i]) && (i < sizeof(obuf)); i++) ; if (i < port->count) { sprintf(message, "Error in received ramp starting at byte %d:\r\n", i); fdprint(message); DPRINT((message)); while ((i < port->count) && (i < sizeof(ibuf))) { if (!(i % 16)) { fdprint("\r\n"); DPRINT(("\n")); } sprintf(message, "%2.2x ", ibuf[i]); fdprint(message); DPRINT((message)); i++; } fdprint("\r\n"); DPRINT(("\n")); } if (i < sizeof(obuf)) { fdprint("Input ramp ends early.\r\n"); DPRINT(("Input ramp ends early.\n")); } // Get their ID ReadBuffer(port, (char *)&theirID, sizeof(theirID)); sprintf(message, "Trying to read their sessionID; read %d bytes, theirID=%x.\r\n", port->count, theirID); fdprint(message); DPRINT((message)); if (theirID == sessionID) { sprintf(message, "Error: Their sessionID same as ours! Looks like there's no serial\r\n" "cable or modem attached!! Please check your cables.\r\n"); fdprint(message); DPRINT((message)); } }
// @(#)root/graf2d:$Id$ // Author: Timur Pocheptsov 19/03/2012 /************************************************************************* * Copyright (C) 1995-2012, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_FontCache #define ROOT_FontCache #include <string> #include <vector> #include <list> #include <map> #include <ApplicationServices/ApplicationServices.h> #ifndef ROOT_XLFDParser #include "XLFDParser.h" #endif #ifndef ROOT_GuiTypes #include "GuiTypes.h" #endif ////////////////////////////////////////////////////////////////// // // // FontCache class: // // ROOT's GUI relies on TVirtualX to create and use fonts, // // fonts are referenced by integer identifiers. // // // ////////////////////////////////////////////////////////////////// namespace ROOT { namespace MacOSX { namespace Details { class FontCache { public: enum Details { nPadFonts = 15 }; FontCache(); FontStruct_t LoadFont(const X11::XLFDName &xlfd); void UnloadFont(FontStruct_t font); char **ListFonts(const X11::XLFDName &xlfd, int maxNames, int &count); void FreeFontNames(char **fontList); unsigned GetTextWidth(FontStruct_t font, const char *text, int nChars); void GetFontProperties(FontStruct_t font, int &maxAscent, int &maxDescent); //Select the existing font or create a new one and select it. CTFontRef SelectFont(Font_t fontIndex, Float_t fontSize); //Typographical bounds (whatever it means), //for the current selected font and text. void GetTextBounds(UInt_t &w, UInt_t &h, const char *text)const; // double GetAscent()const; double GetDescent()const; double GetLeading()const; private: //We have "two symbolic" fonts, both of them use the same symbol.ttf (index 11), //but the second one (index CTFontRef SelectSymbolFont(Float_t fontSize, unsigned fontIndex); typedef Util::CFStrongReference<CTFontRef> CTFontGuard_t; //These are fonts for GUI. Weird map, as I can see now. std::map<CTFontRef, CTFontGuard_t> fLoadedFonts; typedef std::map<CTFontRef, CTFontGuard_t>::iterator font_iterator; typedef std::map<CTFontRef, CTFontGuard_t>::const_iterator const_font_iterator; //Fonts for TPad's graphics. typedef std::map<UInt_t, CTFontGuard_t> FontMap_t; typedef FontMap_t::iterator font_map_iterator; typedef FontMap_t::const_iterator const_font_map_iterator; FontMap_t fFonts[nPadFonts]; CTFontRef fSelectedFont; //FontList can be requested by TGCocoa::ListFonts, //the return value is char **, and later it's freed by //TGCocoa::FreeFontNames, again using char **. //In my case, I have to somehow map char ** to two //data sets - char ** itself + real strings, whose //addresses are in char **. //fList, after it's filled and returned by TGCocoa, //is immutable, so later I can find this FontList //comparing char ** and &fList[0]. struct FontList { std::vector<char *> fList; std::vector<char> fStringData; }; std::list<FontList> fFontLists;//list of "lists" of fonts :) FontList fDummyList; typedef std::map<std::string, std::string> PSNameMap_t; PSNameMap_t fXLFDtoPostscriptNames; FontCache(const FontCache &rhs); FontCache &operator = (const FontCache &rhs); bool fSymbolFontRegistered; }; } } } #endif
/* * Copyright (C) 2008 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * * Author: David Zeuthen <davidz@redhat.com> */ #if !defined (_POLKIT_COMPILATION) && !defined(_POLKIT_INSIDE_POLKIT_H) #error "Only <polkit/polkit.h> can be included directly, this file may disappear or change contents." #endif #ifndef __POLKIT_UNIX_PROCESS_H #define __POLKIT_UNIX_PROCESS_H #include <unistd.h> #include <sys/types.h> #include <glib-object.h> #include <gio/gio.h> #include <polkit/polkittypes.h> G_BEGIN_DECLS #define POLKIT_TYPE_UNIX_PROCESS (polkit_unix_process_get_type()) #define POLKIT_UNIX_PROCESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), POLKIT_TYPE_UNIX_PROCESS, PolkitUnixProcess)) #define POLKIT_UNIX_PROCESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), POLKIT_TYPE_UNIX_PROCESS, PolkitUnixProcessClass)) #define POLKIT_UNIX_PROCESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), POLKIT_TYPE_UNIX_PROCESS, PolkitUnixProcessClass)) #define POLKIT_IS_UNIX_PROCESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_TYPE_UNIX_PROCESS)) #define POLKIT_IS_UNIX_PROCESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), POLKIT_TYPE_UNIX_PROCESS)) #if 0 typedef struct _PolkitUnixProcess PolkitUnixProcess; #endif typedef struct _PolkitUnixProcessClass PolkitUnixProcessClass; GType polkit_unix_process_get_type (void) G_GNUC_CONST; PolkitSubject *polkit_unix_process_new (gint pid); PolkitSubject *polkit_unix_process_new_full (gint pid, guint64 start_time); PolkitSubject *polkit_unix_process_new_for_owner (gint pid, guint64 start_time, gint uid); gint polkit_unix_process_get_pid (PolkitUnixProcess *process); guint64 polkit_unix_process_get_start_time (PolkitUnixProcess *process); gint polkit_unix_process_get_uid (PolkitUnixProcess *process); void polkit_unix_process_set_pid (PolkitUnixProcess *process, gint pid); void polkit_unix_process_set_uid (PolkitUnixProcess *process, gint uid); void polkit_unix_process_set_start_time (PolkitUnixProcess *process, guint64 start_time); gint polkit_unix_process_get_owner (PolkitUnixProcess *process, GError **error) G_GNUC_DEPRECATED_FOR (polkit_unix_process_get_uid); G_END_DECLS #endif /* __POLKIT_UNIX_PROCESS_H */
/* Xmega USART Drivers Header Uses atmel application note drivers Daniel Sidlauskas Miller Make sure to link usart_driver.c when compiling Functions more explained in source file */ #include "avr_compiler.h" #include "usart_driver.h" void uartInit(USART_data_t * title,USART_t * interface, unsigned int baudrate); void sendstring(USART_data_t * uart, char *buffer); void sendchar(USART_data_t * uart, char buffer);
/* * GtkMaskedEntry widget for GTK+ * Copyright (C) 2005-2011 Andrea Zagli <azagli@libero.it> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GTK_MASKED_ENTRY_H__ #define __GTK_MASKED_ENTRY_H__ #include <gtk/gtk.h> G_BEGIN_DECLS #define GTK_TYPE_MASKED_ENTRY (gtk_masked_entry_get_type ()) #define GTK_MASKED_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntry)) #define GTK_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntryClass)) #define GTK_IS_MASKED_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MASKED_ENTRY)) #define GTK_IS_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MASKED_ENTRY)) #define GTK_MASKED_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntryClass)) typedef struct _GtkMaskedEntry GtkMaskedEntry; typedef struct _GtkMaskedEntryClass GtkMaskedEntryClass; struct _GtkMaskedEntry { GtkEntry entry; }; struct _GtkMaskedEntryClass { GtkEntryClass parent_class; }; GType gtk_masked_entry_get_type (void) G_GNUC_CONST; GtkWidget *gtk_masked_entry_new (void); GtkWidget *gtk_masked_entry_new_with_mask (const gchar *mask); void gtk_masked_entry_set_mask (GtkMaskedEntry *masked_entry, const gchar *mask); G_CONST_RETURN gchar *gtk_masked_entry_get_mask (GtkMaskedEntry *masked_entry); G_CONST_RETURN gchar *gtk_masked_entry_get_text (GtkMaskedEntry *masked_entry); G_END_DECLS #endif /* __GTK_MASKED_ENTRY_H__ */
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef SINGLEVARIABLE_H #define SINGLEVARIABLE_H #include "Kernel.h" //Forward Declarations class SingleVariable; template<> InputParameters validParams<SingleVariable>(); class SingleVariable : public Kernel { public: SingleVariable(const InputParameters & parameters); protected: virtual Real computeQpResidual(); virtual Real computeQpJacobian(); virtual Real computeQpOffDiagJacobian(unsigned int jvar); private: Real _coeff; std::vector<unsigned int> _vars; std::vector<const VariableValue *> _v_vals; }; #endif
/* Copyright (C) 2009 Red Hat, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _H_GLZ_ENCODER #define _H_GLZ_ENCODER /* Manging the lz encoding using a dictionary that is shared among encoders */ #include <common/lz_common.h> #include "red-common.h" #include "glz-encoder-dict.h" struct GlzEncoderUsrContext { SPICE_GNUC_PRINTF(2, 3) void (*error)(GlzEncoderUsrContext *usr, const char *fmt, ...); SPICE_GNUC_PRINTF(2, 3) void (*warn)(GlzEncoderUsrContext *usr, const char *fmt, ...); SPICE_GNUC_PRINTF(2, 3) void (*info)(GlzEncoderUsrContext *usr, const char *fmt, ...); void *(*malloc)(GlzEncoderUsrContext *usr, int size); void (*free)(GlzEncoderUsrContext *usr, void *ptr); // get the next chunk of the image which is entered to the dictionary. If the image is down to // top, return it from the last line to the first one (stride should always be positive) int (*more_lines)(GlzEncoderUsrContext *usr, uint8_t **lines); // get the next chunk of the compressed buffer.return number of bytes in the chunk. int (*more_space)(GlzEncoderUsrContext *usr, uint8_t **io_ptr); // called when an image is removed from the dictionary, due to the window size limit void (*free_image)(GlzEncoderUsrContext *usr, GlzUsrImageContext *image); }; typedef void GlzEncoderContext; GlzEncoderContext *glz_encoder_create(uint8_t id, GlzEncDictContext *dictionary, GlzEncoderUsrContext *usr); void glz_encoder_destroy(GlzEncoderContext *opaque_encoder); /* assumes width is in pixels and stride is in bytes usr_context : when an image is released from the window due to capacity overflow, usr_context is given as a parameter to the free_image callback. o_enc_dict_context: if glz_enc_dictionary_remove_image is called, it should be called with the o_enc_dict_context that is associated with the image. return: the number of bytes in the compressed data and sets o_enc_dict_context NOTE : currently supports only rgb images in which width*bytes_per_pixel = stride OR palette images in which stride equals the min number of bytes to hold a line. The stride should be > 0 */ int glz_encode(GlzEncoderContext *opaque_encoder, LzImageType type, int width, int height, int top_down, uint8_t *lines, unsigned int num_lines, int stride, uint8_t *io_ptr, unsigned int num_io_bytes, GlzUsrImageContext *usr_context, GlzEncDictImageContext **o_enc_dict_context); #endif // _H_GLZ_ENCODER
#include "mpg123.h" int audio_open(struct audio_info_struct *ai) { fprintf(stderr,"No audio device support compiled into this binary (use -s).\n"); return -1; } int audio_reset_parameters(struct audio_info_struct *ai) { return 0; } int audio_rate_best_match(struct audio_info_struct *ai) { return 0; } int audio_set_rate(struct audio_info_struct *ai) { return 0; } int audio_set_channels(struct audio_info_struct *ai) { return 0; } int audio_set_format(struct audio_info_struct *ai) { return 0; } int audio_get_formats(struct audio_info_struct *ai) { return AUDIO_FORMAT_SIGNED_16; } int audio_play_samples(struct audio_info_struct *ai,unsigned char *buf,int len) { return len; } int audio_close(struct audio_info_struct *ai) { return 0; }
/* * port_serial.h * * Created on: 17.10.2016 * Author: ak */ #ifndef MCU_SRC_PORT_STM32_L1_INCLUDE_PORT_SERIAL_H_ #define MCU_SRC_PORT_STM32_L1_INCLUDE_PORT_SERIAL_H_ #include <stdint.h> #include <stdbool.h> void portSerialInit(int baud); void portSerialPutChar(uint8_t c); void portSerialPutString(char *s); bool portSerialGetChar(uint8_t *c); #endif /* MCU_SRC_PORT_STM32_L1_INCLUDE_PORT_SERIAL_H_ */
/*************************************************************************** copyright : (C) 2002 - 2008 by Scott Wheeler email : wheeler@kde.org ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License version * * 2.1 as published by the Free Software Foundation. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301 USA * * * * Alternatively, this file is available under the Mozilla Public * * License Version 1.1. You may obtain a copy of the License at * * http://www.mozilla.org/MPL/ * ***************************************************************************/ #ifndef TAGLIB_ID3V2SYNCHDATA_H #define TAGLIB_ID3V2SYNCHDATA_H #include "../../toolkit/tbytevector.h" #include "../../toolkit/taglib.h" namespace TagLib { namespace ID3v2 { //! A few functions for ID3v2 synch safe integer conversion /*! * In the ID3v2.4 standard most integer values are encoded as "synch safe" * integers which are encoded in such a way that they will not give false * MPEG syncs and confuse MPEG decoders. This namespace provides some * methods for converting to and from these values to ByteVectors for * things rendering and parsing ID3v2 data. */ namespace SynchData { /*! * This returns the unsigned integer value of \a data where \a data is a * ByteVector that contains a \e synchsafe integer (Structure, * <a href="id3v2-structure.html#6.2">6.2</a>). The default \a length of * 4 is used if another value is not specified. */ TAGLIB_EXPORT uint toUInt(const ByteVector &data); /*! * Returns a 4 byte (32 bit) synchsafe integer based on \a value. */ TAGLIB_EXPORT ByteVector fromUInt(uint value); /*! * Convert the data from unsynchronized data to its original format. */ TAGLIB_EXPORT ByteVector decode(const ByteVector &input); } } } #endif
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Messaging Framework. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef IPCSERVER_H #define IPCSERVER_H #include <QtNetwork/qabstractsocket.h> class SymbianIpcServerPrivate; class SymbianIpcSocket; class SymbianIpcServer : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(SymbianIpcServer) public: SymbianIpcServer(QObject *parent = 0); ~SymbianIpcServer(); virtual bool hasPendingConnections() const; virtual SymbianIpcSocket *nextPendingConnection(); bool listen(const QString &name); protected: virtual void incomingConnection(quintptr socketDescriptor); Q_SIGNALS: void newConnection(); private: Q_DISABLE_COPY(SymbianIpcServer) }; #endif // IPCSERVER_H // End of File
/* * This file is part of KDevelop * * Copyright 2008-2010 Alexander Dymo <adymo@kdevelop.org> * * This program 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 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 RUBY_SIMPLEPARSEJOB_H #define RUBY_SIMPLEPARSEJOB_H #include <kurl.h> #include <language/backgroundparser/parsejob.h> class RubyLanguageSupport; namespace Ruby { class Parser; class SimpleParseJob : public KDevelop::ParseJob { Q_OBJECT public: enum { Resheduled = KDevelop::TopDUContext::LastFeature }; SimpleParseJob( const KDevelop::IndexedString &url, RubyLanguageSupport* parent ); virtual ~SimpleParseJob(); RubyLanguageSupport* ruby() const; bool wasReadFromDisk() const; protected: virtual void run(); private: void parse(const QString &c); Parser *m_parser; bool m_readFromDisk; }; } // end of namespace ruby #endif
/* * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef SVGRadialGradientElement_h #define SVGRadialGradientElement_h #if ENABLE(SVG) #include "SVGAnimatedLength.h" #include "SVGGradientElement.h" #include "SVGNames.h" namespace WebCore { struct RadialGradientAttributes; class SVGRadialGradientElement FINAL : public SVGGradientElement { public: static PassRefPtr<SVGRadialGradientElement> create(const QualifiedName&, Document*); bool collectGradientAttributes(RadialGradientAttributes&); private: SVGRadialGradientElement(const QualifiedName&, Document*); bool isSupportedAttribute(const QualifiedName&); virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; virtual void svgAttributeChanged(const QualifiedName&); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual bool selfHasRelativeLengths() const; BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGRadialGradientElement) DECLARE_ANIMATED_LENGTH(Cx, cx) DECLARE_ANIMATED_LENGTH(Cy, cy) DECLARE_ANIMATED_LENGTH(R, r) DECLARE_ANIMATED_LENGTH(Fx, fx) DECLARE_ANIMATED_LENGTH(Fy, fy) DECLARE_ANIMATED_LENGTH(Fr, fr) END_DECLARE_ANIMATED_PROPERTIES }; inline SVGRadialGradientElement* toSVGRadialGradientElement(Node* node) { ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(SVGNames::radialGradientTag)); return static_cast<SVGRadialGradientElement*>(node); } } // namespace WebCore #endif // ENABLE(SVG) #endif
/* * StarPU * Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (see AUTHORS file) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 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 Lesser General Public License in COPYING.LGPL for more details. */ #include <stdio.h> #include <unistd.h> #include <errno.h> #include <starpu.h> #include <stdlib.h> #define NLOOPS 128 #define VECTORSIZE 1024 static unsigned *A; starpu_data_handle A_handle, B_handle; static unsigned var = 0; #ifdef STARPU_USE_CUDA extern void cuda_f(void *descr[], __attribute__ ((unused)) void *_args); #endif static void cpu_f(void *descr[], __attribute__ ((unused)) void *_args) { unsigned *v = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]); unsigned *tmp = (unsigned *)STARPU_VECTOR_GET_PTR(descr[1]); unsigned nx = STARPU_VECTOR_GET_NX(descr[0]); size_t elemsize = STARPU_VECTOR_GET_ELEMSIZE(descr[0]); memcpy(tmp, v, nx*elemsize); unsigned i; for (i = 0; i < nx; i++) { v[i] = tmp[i] + 1; } } static starpu_codelet cl_f = { .where = STARPU_CPU|STARPU_CUDA, .cpu_func = cpu_f, #ifdef STARPU_USE_CUDA .cuda_func = cuda_f, #endif .nbuffers = 2 }; int main(int argc, char **argv) { starpu_init(NULL); A = calloc(VECTORSIZE, sizeof(unsigned)); starpu_vector_data_register(&A_handle, 0, (uintptr_t)A, VECTORSIZE, sizeof(unsigned)); starpu_vector_data_register(&B_handle, -1, (uintptr_t)NULL, VECTORSIZE, sizeof(unsigned)); unsigned loop; for (loop = 0; loop < NLOOPS; loop++) { struct starpu_task *task_f = starpu_task_create(); task_f->cl = &cl_f; task_f->buffers[0].handle = A_handle; task_f->buffers[0].mode = STARPU_RW; task_f->buffers[1].handle = B_handle; task_f->buffers[1].mode = STARPU_SCRATCH; int ret = starpu_task_submit(task_f, NULL); if (ret == -ENODEV) goto enodev; } starpu_task_wait_for_all(); /* Make sure that data A is in main memory */ starpu_data_acquire(A_handle, STARPU_R); /* Check result */ unsigned i; for (i = 0; i < VECTORSIZE; i++) { STARPU_ASSERT(A[i] == NLOOPS); } starpu_data_release(A_handle); starpu_shutdown(); return 0; enodev: /* No one can execute that task, this is not a bug, just an incomplete * test :) */ return 0; }
/* Copyright (C) 2012, 2013 Fredrik Johansson This file is part of Arb. Arb is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include "arb_poly.h" int main() { slong iter; flint_rand_t state; flint_printf("tan_series...."); fflush(stdout); flint_randinit(state); for (iter = 0; iter < 2000 * arb_test_multiplier(); iter++) { slong m, n, qbits, rbits1, rbits2; fmpq_poly_t A; arb_poly_t a, b, c, d, e; qbits = 2 + n_randint(state, 200); rbits1 = 2 + n_randint(state, 200); rbits2 = 2 + n_randint(state, 200); m = 1 + n_randint(state, 50); n = 1 + n_randint(state, 50); fmpq_poly_init(A); arb_poly_init(a); arb_poly_init(b); arb_poly_init(c); arb_poly_init(d); arb_poly_init(e); fmpq_poly_randtest(A, state, m, qbits); arb_poly_set_fmpq_poly(a, A, rbits1); arb_poly_randtest(b, state, 1 + n_randint(state, 50), rbits1, 5); arb_poly_tan_series(b, a, n, rbits2); /* check tan(x) = 2*tan(x/2)/(1-tan(x/2)^2) */ arb_poly_scalar_mul_2exp_si(c, a, -1); arb_poly_tan_series(c, c, n, rbits2); arb_poly_mullow(d, c, c, n, rbits2); arb_poly_one(e); arb_poly_sub(e, e, d, rbits2); arb_poly_div_series(c, c, e, n, rbits2); arb_poly_scalar_mul_2exp_si(c, c, 1); if (!arb_poly_overlaps(b, c)) { flint_printf("FAIL\n\n"); flint_printf("bits2 = %wd\n", rbits2); flint_printf("A = "); fmpq_poly_print(A); flint_printf("\n\n"); flint_printf("a = "); arb_poly_printd(a, 15); flint_printf("\n\n"); flint_printf("b = "); arb_poly_printd(b, 15); flint_printf("\n\n"); flint_printf("c = "); arb_poly_printd(c, 15); flint_printf("\n\n"); abort(); } arb_poly_tan_series(a, a, n, rbits2); if (!arb_poly_equal(a, b)) { flint_printf("FAIL (aliasing)\n\n"); abort(); } fmpq_poly_clear(A); arb_poly_clear(a); arb_poly_clear(b); arb_poly_clear(c); arb_poly_clear(d); arb_poly_clear(e); } flint_randclear(state); flint_cleanup(); flint_printf("PASS\n"); return EXIT_SUCCESS; }
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /**************************************************************************** ** ** Copyright (c) 2007-2008, 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: ** ** * Redistributions of source code must retain the above copyright notice, ** this list of conditions and the following disclaimer. ** ** * Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and/or other materials provided with the distribution. ** ** * Neither the name of Apple, Inc. nor the names of its contributors ** may be used to endorse or promote products derived from this software ** without specific prior written permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of qapplication_*.cpp, qwidget*.cpp, qcolor_x11.cpp, qfiledialog.cpp // and many other. This header file may change from version to version // without notice, or even be removed. // // We mean it. // #include "qmacdefines_mac.h" #ifdef QT_MAC_USE_COCOA #import <Cocoa/Cocoa.h> QT_FORWARD_DECLARE_CLASS(QApplicationPrivate); @class QT_MANGLE_NAMESPACE(QCocoaMenuLoader); #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 @protocol NSApplicationDelegate <NSObject> - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; - (void)applicationDidFinishLaunching:(NSNotification *)aNotification; - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames; - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender; - (void)applicationDidBecomeActive:(NSNotification *)notification; - (void)applicationDidResignActive:(NSNotification *)notification; @end #endif @interface QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) : NSObject <NSApplicationDelegate> { bool startedQuit; QApplicationPrivate *qtPrivate; NSMenu *dockMenu; QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader; NSObject <NSApplicationDelegate> *reflectionDelegate; bool inLaunch; } + (QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate)*)sharedDelegate; - (void)setDockMenu:(NSMenu *)newMenu; - (void)setQtPrivate:(QApplicationPrivate *)value; - (QApplicationPrivate *)qAppPrivate; - (void)setMenuLoader:(QT_MANGLE_NAMESPACE(QCocoaMenuLoader)*)menuLoader; - (QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *)menuLoader; - (void)setReflectionDelegate:(NSObject <NSApplicationDelegate> *)oldDelegate; - (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent; @end #endif
int trim(char s[]){ int n; for (n = strlen(s)-1; n >= 0; n--) if (s[n] != ' ' && s[n] != '\t' && s[n] != '\n' break; s[n+1] = '\0'; return n; }
/* Egueb * Copyright (C) 2011 - 2013 Jorge Luis Zapata * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. * If not, see <http://www.gnu.org/licenses/>. */ #ifndef _EGUEB_SVG_ATTR_SPREAD_METHOD_PRIVATE_H_ #define _EGUEB_SVG_ATTR_SPREAD_METHOD_PRIVATE_H_ Egueb_Dom_Node * egueb_svg_attr_spread_method_new(Egueb_Dom_String *name, const Egueb_Svg_Spread_Method def, Eina_Bool animatable, Eina_Bool stylable, Eina_Bool inheritable); #endif
/*************************************************************************** * Copyright (C) 2009 by Erik Sohns * * erik.sohns@web.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., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef TEST_I_EVENTHANDLER_H #define TEST_I_EVENTHANDLER_H #include <map> #include "ace/Global_Macros.h" #include "common_inotify.h" #include "test_i_stream_common.h" #include "test_i_message.h" #include "test_i_session_message.h" class Test_I_EventHandler : public Test_I_ISessionNotify_t , public Test_I_ISessionNotify_2_t { public: Test_I_EventHandler ( #if defined (GUI_SUPPORT) struct Test_I_URLStreamLoad_UI_CBData*); // UI state #else ); #endif // GUI_SUPPORT inline virtual ~Test_I_EventHandler () {} // implement Stream_ISessionDataNotify_T virtual void start (Stream_SessionId_t, // session id const struct Test_I_URLStreamLoad_SessionData&); // session data virtual void notify (Stream_SessionId_t, const enum Stream_SessionMessageType&); virtual void end (Stream_SessionId_t); // session id virtual void notify (Stream_SessionId_t, // session id const Test_I_Message&); // (protocol) message virtual void notify (Stream_SessionId_t, // session id const Test_I_SessionMessage&); // session message // implement Stream_ISessionDataNotify_2_T virtual void start (Stream_SessionId_t, // session id const struct Test_I_URLStreamLoad_SessionData_2&); // session data virtual void notify (Stream_SessionId_t, // session id const Test_I_SessionMessage_2&); // session message private: #if defined (GUI_SUPPORT) ACE_UNIMPLEMENTED_FUNC (Test_I_EventHandler ()) #endif // GUI_SUPPORT ACE_UNIMPLEMENTED_FUNC (Test_I_EventHandler (const Test_I_EventHandler&)) ACE_UNIMPLEMENTED_FUNC (Test_I_EventHandler& operator= (const Test_I_EventHandler&)) typedef std::map<unsigned int, struct Test_I_URLStreamLoad_SessionData*> SESSION_DATA_MAP_T; typedef SESSION_DATA_MAP_T::iterator SESSION_DATA_MAP_ITERATOR_T; typedef std::map<unsigned int, struct Test_I_URLStreamLoad_SessionData_2*> SESSION_DATA_MAP_2_T; typedef SESSION_DATA_MAP_2_T::iterator SESSION_DATA_MAP_ITERATOR_2_T; #if defined (GUI_SUPPORT) struct Test_I_URLStreamLoad_UI_CBData* CBData_; #endif // GUI_SUPPORT SESSION_DATA_MAP_T sessionDataMap_; SESSION_DATA_MAP_2_T sessionDataMap2_; }; #endif
TEST () { GeglBuffer *buffer2, *buffer; GeglRectangle bound = {0, 0, 20, 20}; GeglRectangle dest = {2, 2, 8, 8}; float *blank = g_malloc0 (100000); gchar *temp = g_malloc0 (100000); test_start (); buffer2 = gegl_buffer_new (&bound, babl_format ("Y float")); buffer = gegl_buffer_new (&bound, babl_format ("Y float")); vgrad (buffer2); #if 1 blank[0] = 0.1; blank[1] = 0.3; blank[2] = 0.7; blank[3] = 1.0; blank[4] = 0.1; blank[5] = 0.3; blank[6] = 0.8; blank[7] = 1.0; blank[8] = 0.1; blank[9] = 0.3; blank[10] = 0.7; blank[11] = 1.0; blank[12] = 0.1; blank[13] = 0.3; blank[14] = 0.7; blank[15] = 1.0; #endif gegl_buffer_set (buffer2, &dest, 1, babl_format ("Y float"), blank, GEGL_AUTO_ROWSTRIDE); print_buffer (buffer2); gegl_buffer_get (buffer2, &bound, 0.5, babl_format ("Y float"), temp, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE); gegl_buffer_set (buffer, &bound, 0, babl_format ("Y float"), temp, GEGL_AUTO_ROWSTRIDE); print_buffer (buffer); gegl_buffer_get (buffer2, &bound, 0.25, babl_format ("Y float"), temp, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE); gegl_buffer_set (buffer, &bound, 0, babl_format ("Y float"), temp, GEGL_AUTO_ROWSTRIDE); print_buffer (buffer); g_object_unref (buffer); g_object_unref (buffer2); g_free (blank); g_free (temp); test_end (); }
/* * Copyright 2013 Kurt Van Dijck <kurt@vandijck-laurijssen.be> * * This file is part of libenumif. * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _libenumif_h_ #define _libenumif_h_ #ifdef __cplusplus extern "C" { #endif struct enumif { unsigned int if_index; int if_type; int if_flags; int if_state; char if_name[32]; /* this is stupid, we should use IFNAMSIZ instead */ }; /* allocate an array of enumif structures, with 1 extra with if_index=0 */ extern struct enumif *enumif(void); /* string representations */ extern const char *if_flagsstr(int if_flags); extern const char *if_statestr(int if_state); extern const char *if_typestr(int if_type); /* string decoding */ extern int if_strtype(const char *type); extern int if_strflags(const char *flags); extern int if_strstate(const char *state); /* * cleanup enumif resources. * This is called automatically on program shutdown. * It is exported if a program wants to free resources * during operation */ extern void enumif_cleanup(void); #ifdef __cplusplus } #endif #endif
// Created file "Lib\src\Uuid\X64\i_activdbg" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IDebugDocumentHelper32, 0x51973c26, 0xcb0c, 0x11d0, 0xb5, 0xc9, 0x00, 0xa0, 0x24, 0x4a, 0x0e, 0x7a);
int f(auto void){ auto int x; return 0; } int main(void){ return 0; }
// Created file "Lib\src\sensorsapi\sensorsapi" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(SENSOR_DATA_TYPE_TIMESTAMP, 0xdb5e0cf2, 0xcf1f, 0x4c18, 0xb4, 0x6c, 0xd8, 0x60, 0x11, 0xd6, 0x21, 0x50);
/* * OS Abstraction Layer * * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * $Id: osl.h 431503 2013-10-23 21:42:47Z $ */ #ifndef _osl_h_ #define _osl_h_ typedef struct osl_info osl_t; typedef struct osl_dmainfo osldma_t; #define OSL_PKTTAG_SZ 32 typedef void (*pktfree_cb_fn_t)(void *ctx, void *pkt, unsigned int status); typedef unsigned int (*osl_rreg_fn_t)(void *ctx, volatile void *reg, unsigned int size); typedef void (*osl_wreg_fn_t)(void *ctx, volatile void *reg, unsigned int val, unsigned int size); #ifdef __mips__ #define PREF_LOAD 0 #define PREF_STORE 1 #define PREF_LOAD_STREAMED 4 #define PREF_STORE_STREAMED 5 #define PREF_LOAD_RETAINED 6 #define PREF_STORE_RETAINED 7 #define PREF_WBACK_INV 25 #define PREF_PREPARE4STORE 30 #define MAKE_PREFETCH_FN(hint) \ static inline void prefetch_##hint(const void *addr) \ { \ __asm__ __volatile__(\ " .set mips4 \n" \ " pref %0, (%1) \n" \ " .set mips0 \n" \ : \ : "i" (hint), "r" (addr)); \ } #define MAKE_PREFETCH_RANGE_FN(hint) \ static inline void prefetch_range_##hint(const void *addr, int len) \ { \ int size = len; \ while (size > 0) { \ prefetch_##hint(addr); \ size -= 32; \ } \ } MAKE_PREFETCH_FN(PREF_LOAD) MAKE_PREFETCH_RANGE_FN(PREF_LOAD) MAKE_PREFETCH_FN(PREF_STORE) MAKE_PREFETCH_RANGE_FN(PREF_STORE) MAKE_PREFETCH_FN(PREF_LOAD_STREAMED) MAKE_PREFETCH_RANGE_FN(PREF_LOAD_STREAMED) MAKE_PREFETCH_FN(PREF_STORE_STREAMED) MAKE_PREFETCH_RANGE_FN(PREF_STORE_STREAMED) MAKE_PREFETCH_FN(PREF_LOAD_RETAINED) MAKE_PREFETCH_RANGE_FN(PREF_LOAD_RETAINED) MAKE_PREFETCH_FN(PREF_STORE_RETAINED) MAKE_PREFETCH_RANGE_FN(PREF_STORE_RETAINED) #endif #include <linux_osl.h> #ifndef PKTDBG_TRACE #define PKTDBG_TRACE(osh, pkt, bit) #endif #define PKTCTFMAP(osh, p) #define SET_REG(osh, r, mask, val) W_REG((osh), (r), ((R_REG((osh), r) & ~(mask)) | (val))) #ifndef AND_REG #define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v)) #endif #ifndef OR_REG #define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v)) #endif #if !defined(OSL_SYSUPTIME) #define OSL_SYSUPTIME() (0) #define OSL_SYSUPTIME_SUPPORT FALSE #else #define OSL_SYSUPTIME_SUPPORT TRUE #endif #if !defined(PKTC_DONGLE) #define PKTCGETATTR(s) (0) #define PKTCSETATTR(skb, f, p, b) #define PKTCCLRATTR(skb) #define PKTCCNT(skb) (1) #define PKTCLEN(skb) PKTLEN(NULL, skb) #define PKTCGETFLAGS(skb) (0) #define PKTCSETFLAGS(skb, f) #define PKTCCLRFLAGS(skb) #define PKTCFLAGS(skb) (0) #define PKTCSETCNT(skb, c) #define PKTCINCRCNT(skb) #define PKTCADDCNT(skb, c) #define PKTCSETLEN(skb, l) #define PKTCADDLEN(skb, l) #define PKTCSETFLAG(skb, fb) #define PKTCCLRFLAG(skb, fb) #define PKTCLINK(skb) NULL #define PKTSETCLINK(skb, x) #define FOREACH_CHAINED_PKT(skb, nskb) \ for ((nskb) = NULL; (skb) != NULL; (skb) = (nskb)) #define PKTCFREE PKTFREE #endif #define PKTSETCHAINED(osh, skb) #define PKTCLRCHAINED(osh, skb) #define PKTISCHAINED(skb) (FALSE) #endif
// Created file "Lib\src\Uuid\rtccore_i" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IRTCParticipantStateChangeEvent, 0x09bcb597, 0xf0fa, 0x48f9, 0xb4, 0x20, 0x46, 0x8c, 0xea, 0x7f, 0xde, 0x04);
// Created file "Lib\src\Uuid\wincodec_uuid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_WICPixelFormat128bpp8Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2b);
/** Copyright (C) Atiyah Elsheikh (Atiyah.Elsheikh@ait.ac.at,a.m.g.Elsheikh@gmail.com) 2014,2015 AIT Austrian Institute of Technology GmbH This file is part of the software blackboxParadisEO blackboxParadisEO is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. blackboxParadisEO 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 blackboxParadisEO. If not, see <http://www.gnu.org/licenses/> */ #ifndef _SimpleObj_h #define _SimpleObj_h #include "../eoObjFunc.h" /** * \file SimpleObj.h * \class SimpleObj * A simple objective function as a benchmark function for real valued optimization */ class SimpleObj: public RSRRMVOF { protected: virtual double eval(const std::vector<double>& _arg) { double sum = 0; for (unsigned i = 0; i < _arg.size(); i++) { sum += 2 * _arg[i] * _arg[i]; } return sum; } }; #endif
/* * skinny.c * * Copyright (C) 2013 Remy Mudingay <mudingay@ill.fr> * * This module is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This module 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. * If not, see <http://www.gnu.org/licenses/>. * */ #include "ndpi_protocol_ids.h" #ifdef NDPI_PROTOCOL_SKINNY #define NDPI_CURRENT_PROTO NDPI_PROTOCOL_SKINNY #include "ndpi_api.h" static void ndpi_int_skinny_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKINNY, NDPI_PROTOCOL_UNKNOWN); } void ndpi_search_skinny(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; u_int16_t dport = 0, sport = 0; const char pattern_9_bytes[9] = { 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; const char pattern_8_bytes[8] = { 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; const char keypadmsg_8_bytes[8] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; const char selectmsg_8_bytes[8] = { 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; NDPI_LOG_DBG(ndpi_struct, "search for SKINNY\n"); if(packet->tcp != NULL) { sport = ntohs(packet->tcp->source), dport = ntohs(packet->tcp->dest); NDPI_LOG_DBG2(ndpi_struct, "calculating SKINNY over tcp\n"); if (dport == 2000 && ((packet->payload_packet_len == 24 && memcmp(&packet->payload[0], keypadmsg_8_bytes, 8) == 0) || ((packet->payload_packet_len == 64) && memcmp(&packet->payload[0], pattern_8_bytes, 8) == 0))) { NDPI_LOG_INFO(ndpi_struct, "found skinny\n"); ndpi_int_skinny_add_connection(ndpi_struct, flow); } else if (sport == 2000 && ((packet->payload_packet_len == 28 && memcmp(&packet->payload[0], selectmsg_8_bytes, 8) == 0 ) || (packet->payload_packet_len == 44 && memcmp(&packet->payload[0], pattern_9_bytes, 9) == 0))) { NDPI_LOG_INFO(ndpi_struct, "found skinny\n"); ndpi_int_skinny_add_connection(ndpi_struct, flow); } } else { NDPI_EXCLUDE_PROTO(ndpi_struct, flow); } } void init_skinny_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) { ndpi_set_bitmask_protocol_detection("CiscoSkinny", ndpi_struct, detection_bitmask, *id, NDPI_PROTOCOL_SKINNY, ndpi_search_skinny, NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK); *id += 1; } #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_UPDATEDOCUMENTREQUEST_P_H #define QTAWS_UPDATEDOCUMENTREQUEST_P_H #include "ssmrequest_p.h" #include "updatedocumentrequest.h" namespace QtAws { namespace SSM { class UpdateDocumentRequest; class UpdateDocumentRequestPrivate : public SsmRequestPrivate { public: UpdateDocumentRequestPrivate(const SsmRequest::Action action, UpdateDocumentRequest * const q); UpdateDocumentRequestPrivate(const UpdateDocumentRequestPrivate &other, UpdateDocumentRequest * const q); private: Q_DECLARE_PUBLIC(UpdateDocumentRequest) }; } // namespace SSM } // namespace QtAws #endif
/*! * \file abstractmodelcomponentinfo.h * \author Caleb Amoa Buahin <caleb.buahin@gmail.com> * \version 1.0.0 * \description * \license * This file and its associated files, and libraries are free software. * You can redistribute it and/or modify it under the terms of the * Lesser GNU Lesser General Public License as published by the Free Software Foundation; * either version 3 of the License, or (at your option) any later version. * This file and its associated files 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 <http://www.gnu.org/licenses/> for details) * \copyright Copyright 2014-2018, Caleb Buahin, All rights reserved. * \date 2014-2018 * \pre * \bug * \warning * \todo */ #ifndef MODELCOMPONENTINFO_H #define MODELCOMPONENTINFO_H #include "hydrocouplesdk.h" #include "componentinfo.h" class AbstractAdaptedOutputFactory; /*! * \brief The ModelComponentInfo class. */ class HYDROCOUPLESDK_EXPORT AbstractModelComponentInfo : public ComponentInfo, public virtual HydroCouple::IModelComponentInfo { Q_OBJECT Q_INTERFACES(HydroCouple::IModelComponentInfo) Q_PROPERTY(QList<HydroCouple::IAdaptedOutputFactory*> AdaptedOutputFactories READ adaptedOutputFactories NOTIFY propertyChanged) public: AbstractModelComponentInfo(QObject* parent = nullptr); virtual ~AbstractModelComponentInfo() override; QList<HydroCouple::IAdaptedOutputFactory*> adaptedOutputFactories() const override final; signals: void propertyChanged(const QString &propertyName) override; protected: QHash<QString,AbstractAdaptedOutputFactory*> adaptedOutputFactoriesInternal() const; void addAdaptedOutputFactory(AbstractAdaptedOutputFactory* adaptedOutputFactory); bool removeAdaptedOutputFactory(AbstractAdaptedOutputFactory* adaptedOutputFactory); void clearAdaptedOutputFactories(); private: QHash<QString, AbstractAdaptedOutputFactory*> m_adaptedOutputFactories; }; Q_DECLARE_METATYPE(AbstractModelComponentInfo*) #endif // MODELCOMPONENTINFO_H
/* ================================================================================ This software is released under the LGPL-3.0 license: http://www.opensource.org/licenses/lgpl-3.0.html Copyright (c) 2012, Jose Esteve. http://www.joesfer.com This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 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 ================================================================================ */ ////////////////////////////////////////////////////////////////////////// // Note: the List class is based on code from the idLib, which is released // under GPL license. Since I'm releasing my code under LGPL license, I may // have to remove it or change it at some point due to license incompatibilities. ////////////////////////////////////////////////////////////////////////// #pragma once #include <stdlib.h> #include <assert.h> #include <algorithm> #include <memory/standardAllocator.h> namespace CoreLib { template< typename T > inline int ListSortCompare( const T *a, const T *b ) { return *a - *b; } ////////////////////////////////////////////////////////////////////////// // class List // // Similar to std::vector, but allowing for more efficient element removal // copy and granularity control. ////////////////////////////////////////////////////////////////////////// template< typename T, class Allocator = CoreLib::Memory::StandardAllocator<T> > class List { public: typedef const T ConstType; typedef T Type; typedef Type* Iterator; typedef ConstType* ConstIterator; typedef int cmp_t( const T *, const T * ); explicit List( size_t granularity = DEFAULT_GRANULARITY ); List( const List& other); ~List(); size_t size() const; // number of elements in the list size_t capacity() const; // total number of elements that can be stored without resizing the list bool empty() const; void clear(); // clears the list and storage void resize( size_t newNum, bool resizeCapacity = true ); // set number of elements in list and resize to exactly this number if necessary void preAllocate( size_t newCapacity ); // makes sure the list has capacity for newSize number of elements, without changing the current element count void setGranularity( size_t granularity ); size_t getGranularity() const; List& operator=( const List& other ); Type& operator[]( int index ); ConstType& operator[]( int index ) const; Type& operator[]( size_t index ); ConstType& operator[]( size_t index ) const; Type& operator[]( unsigned int index ); ConstType& operator[]( unsigned int index ) const; Type& append(); // returns reference to a new data element at the end of the list int append( ConstType& obj ); // append element int append( const List &other ); // append list int addUnique( ConstType& obj ); // add unique element int findIndex( ConstType& obj ) const; // find the index for the given element bool removeFast( ConstType& obj ); // remove the element, move the last element into its spot bool removeIndexFast( size_t i ); // remove i-th element, move the last element into its spot void sort( cmp_t *compare = ListSortCompare<T> ); // sort the list void swap( List &other ); // swap the contents of the lists Iterator begin(); // return list[ 0 ] Iterator end(); // return list[ numElements ] (one past end) ConstIterator begin() const; // return list[ 0 ] ConstIterator end() const; // return list[ numElements ] (one past end) private: void setSize(size_t numElem); private: size_t numElements; size_t allocedSize; size_t granularity; Type * list; const static size_t DEFAULT_GRANULARITY = 16; }; #include "list.inl" }
// Created file "Lib\src\Uuid\X64\functiondiscovery" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_PUBSVCS_SCOPE, 0x2ae2b567, 0xeecb, 0x4a3e, 0xb7, 0x53, 0x54, 0xc7, 0x25, 0x49, 0x43, 0x66);
// Created file "Lib\src\ehstorguids\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_Devices_Status2, 0xd08dd4c0, 0x3a9e, 0x462e, 0x82, 0x90, 0x7b, 0x63, 0x6b, 0x25, 0x76, 0xb9);
#pragma once #ifndef DblHWEAPON_H #define DblHWEAPON_H #include "Onehand_Weapon.h" class Twohand_Weapon : public Onehand_Weapon { public: Twohand_Weapon(); Twohand_Weapon(std::string name, int type, int dmg, int color) : Onehand_Weapon(name, type, dmg, color){}; ~Twohand_Weapon(); }; #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWSCONNECTGLOBAL_H #define QTAWSCONNECTGLOBAL_H // Export declaration macros. #if defined(QTAWS_SHARED) || !defined(QTAWS_STATIC) # ifdef QTAWS_STATIC # error "Both QTAWS_SHARED and QTAWS_STATIC defined." # endif # if defined QTAWSCONNECT_LIBRARY # define QTAWSCONNECT_EXPORT Q_DECL_EXPORT # else # define QTAWSCONNECT_EXPORT Q_DECL_IMPORT # endif #else # define QTAWSCONNECT_EXPORT #endif #endif // QTAWSCONNECTGLOBAL_H
/**** * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development. * Created 2015 by Skurydin Alexey * http://github.com/SmingHub/Sming * All files of the Sming Core are provided under the LGPL v3 license. * * ChunkedStream.h * * @author Slavey Karadzhov <slaff@attachix.com> * ****/ #pragma once #include <Data/StreamTransformer.h> /** * @brief Read-only stream to obtain data using HTTP chunked encoding * * Used where total length of stream is not known in advance * * @ingroup stream data */ class ChunkedStream : public StreamTransformer { public: ChunkedStream(IDataSourceStream* stream, size_t resultSize = 512); protected: size_t transform(const uint8_t* source, size_t sourceLength, uint8_t* target, size_t targetLength) override; };
/**************************************************************************** ** ** Copyright (C) 2012-2014 Andrey Bogdanov ** ** This file is part of the BeQtNetwork module of the BeQt library. ** ** BeQt is free software: you can redistribute it and/or modify it under ** the terms of the GNU Lesser General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** BeQt 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 BeQt. If not, see <http://www.gnu.org/licenses/>. ** ****************************************************************************/ #ifndef BGENERICSERVER_P_H #define BGENERICSERVER_P_H class BGenericSocket; #include "bgenericserver.h" #include <BeQtCore/private/bbaseobject_p.h> #include <QLocalServer> #include <QObject> #include <QPointer> #include <QQueue> #include <QTcpServer> /*============================================================================ ================================ BLocalServer ================================ ============================================================================*/ class B_NETWORK_EXPORT BLocalServer : public QLocalServer { Q_OBJECT public: explicit BLocalServer(QObject *parent = 0); ~BLocalServer(); protected: void incomingConnection(quintptr socketDescriptor); Q_SIGNALS: void newConnection(int socketDescriptor); }; /*============================================================================ ================================ BTcpServer ================================== ============================================================================*/ class B_NETWORK_EXPORT BTcpServer : public QTcpServer { Q_OBJECT public: explicit BTcpServer(QObject *parent = 0); ~BTcpServer(); protected: void incomingConnection(int handle); Q_SIGNALS: void newConnection(int socketDescriptor); }; /*============================================================================ ================================ BGenericServerPrivate ======================= ============================================================================*/ class B_NETWORK_EXPORT BGenericServerPrivate : public BBaseObjectPrivate { Q_OBJECT B_DECLARE_PUBLIC(BGenericServer) public: QPointer<QLocalServer> lserver; int maxPending; BGenericServer::ServerType type; QQueue<BGenericSocket *> socketQueue; QPointer<QTcpServer> tserver; public: explicit BGenericServerPrivate(BGenericServer *q); ~BGenericServerPrivate(); public: void init(); public Q_SLOTS: void newConnection(int socketDescriptor); private: Q_DISABLE_COPY(BGenericServerPrivate) }; #endif // BGENERICSERVER_P_H
// Wire3D by Roman Rath (antibyte@gmail.com) // http://wire3d.googlecode.com // Copyright(c) 2009-2014. All rights reserved. // // The Wire3D source code is supplied under the terms of the LGPL and // may not be copied or disclosed except in accordance with the terms of // that agreement. #pragma once #ifndef WIRENODESWITCH_H #define WIRENODESWITCH_H #include "WireNode.h" namespace Wire { class NodeSwitch: public Node { WIRE_DECLARE_RTTI; public: NodeSwitch(); virtual ~NodeSwitch(); enum { SN_INVALID_CHILD = -1 }; inline void SetActiveChild(Int activeChild); inline Int GetActiveChild() const; inline void DisableAllChildren(); protected: // culling virtual void GetVisibleSet(Culler& rCuller, Bool noCull); Int mActiveChild; }; typedef Pointer<NodeSwitch> NodeSwitchPtr; #include "WireNodeSwitch.inl" } #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATEGROUPCERTIFICATEAUTHORITYRESPONSE_H #define QTAWS_CREATEGROUPCERTIFICATEAUTHORITYRESPONSE_H #include "greengrassresponse.h" #include "creategroupcertificateauthorityrequest.h" namespace QtAws { namespace Greengrass { class CreateGroupCertificateAuthorityResponsePrivate; class QTAWSGREENGRASS_EXPORT CreateGroupCertificateAuthorityResponse : public GreengrassResponse { Q_OBJECT public: CreateGroupCertificateAuthorityResponse(const CreateGroupCertificateAuthorityRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const CreateGroupCertificateAuthorityRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(CreateGroupCertificateAuthorityResponse) Q_DISABLE_COPY(CreateGroupCertificateAuthorityResponse) }; } // namespace Greengrass } // namespace QtAws #endif
// Created file "Lib\src\mfuuid\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(MFPKEY_MULTICHANNEL_CHANNEL_MASK, 0x58bdaf8c, 0x3224, 0x4692, 0x86, 0xd0, 0x44, 0xd6, 0x5c, 0x5b, 0xf8, 0x2b);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBEALARMSREQUEST_H #define QTAWS_DESCRIBEALARMSREQUEST_H #include "cloudwatchrequest.h" namespace QtAws { namespace CloudWatch { class DescribeAlarmsRequestPrivate; class QTAWSCLOUDWATCH_EXPORT DescribeAlarmsRequest : public CloudWatchRequest { public: DescribeAlarmsRequest(const DescribeAlarmsRequest &other); DescribeAlarmsRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DescribeAlarmsRequest) }; } // namespace CloudWatch } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATEINSTANCEREQUEST_P_H #define QTAWS_CREATEINSTANCEREQUEST_P_H #include "connectrequest_p.h" #include "createinstancerequest.h" namespace QtAws { namespace Connect { class CreateInstanceRequest; class CreateInstanceRequestPrivate : public ConnectRequestPrivate { public: CreateInstanceRequestPrivate(const ConnectRequest::Action action, CreateInstanceRequest * const q); CreateInstanceRequestPrivate(const CreateInstanceRequestPrivate &other, CreateInstanceRequest * const q); private: Q_DECLARE_PUBLIC(CreateInstanceRequest) }; } // namespace Connect } // namespace QtAws #endif
/* * CryptoMiniSat * * Copyright (c) 2009-2015, Mate Soos. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation * version 2.0 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef SUBSUMEIMPLICIT_H #define SUBSUMEIMPLICIT_H #include <vector> #include "clause.h" #include "constants.h" #include "solvertypes.h" #include "cloffset.h" #include "watcharray.h" namespace CMSat { using std::vector; class Solver; class Clause; class SubsumeImplicit { public: SubsumeImplicit(Solver* solver); void subsume_implicit(bool check_stats = true); struct Stats { void clear() { *this = Stats(); } Stats operator+=(const Stats& other); void print_short(const Solver* solver) const; void print() const; double time_used = 0.0; uint64_t numCalled = 0; uint64_t time_out = 0; uint64_t remBins = 0; uint64_t remTris = 0; uint64_t stampTriRem = 0; uint64_t cacheTriRem = 0; uint64_t numWatchesLooked = 0; }; Stats get_stats() const; private: Solver* solver; int64_t timeAvailable; Lit lastLit2; Lit lastLit3; Watched* lastBin; bool lastRed; vector<Lit> tmplits; Stats runStats; Stats globalStats; void clear() { lastLit2 = lit_Undef; lastLit3 = lit_Undef; lastBin = NULL; lastRed = false; } //ImplSubsumeData impl_subs_dat; void try_subsume_tri( const Lit lit , Watched* i , Watched*& j , const bool doStamp ); void try_subsume_bin( const Lit lit , Watched* i , Watched*& j ); }; } //end namespace #endif //SUBSUMEIMPLICIT_H
/* * The DIVERSE Toolkit * Copyright (C) 2000 - 2003 Virginia Tech * * This software, the DIVERSE Toolkit library, is free software; you can * redistribute it and/or modify it under the terms of the GNU Lesser * General Public License (LGPL) 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 software, in the top level source directory in * a file named "COPYING.LGPL"; if not, see it at: * http://www.gnu.org/copyleft/lesser.html or write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA. * */ // Since we do not want to make a new dtkSharedMem object for each // request we need to keep a list of all the dtkSharedMem objects used. // This assumes that the DTK server is a single thread. #define RESPONSE_BUF_SIZE ((size_t) 2048) struct sharedMemList { dtkSharedMem *sharedMem; struct sharedMemList *next; }; class DTKSERVERAPI ServerRespond { public: ServerRespond(void); ~ServerRespond(void); // writing to the a shared memory file from the network. char *writeSharedMem(size_t *size_out,char request_type, void *data, size_t size, const char *name, int byte_order, const char *fromClientAddr); char *loadService(size_t *size_out, const char *file, const char *name, const char *arg); char *loadConfig(size_t *size_out, const char *config_file, const char* path, const char* cwd, const char* svc_path, const char* cal_path, const char* cal_conf_path); char *unloadService(size_t *size_out, const char *name); char *resetService(size_t *size_out, const char *name); char *checkService(size_t *size_out, const char *name); // (0) from client to server char *connectServer(size_t *size_out, const char *serverAddressPort, const char *fromClientAddr); // (1) from server to server char *connectServerFail(size_t *size_out, const char *addressPort, const char *fromClientAddr); // (2) from server to server back to client reply. char *connectServer(size_t *size_out, const char *addressPort, const char *fromClientAddr, const char *errorStr); // Remotename refers to name on other system. // (0) From client to server char *connectSharedMem(size_t *size_out, const char *name, const char *addressPort, const char *remoteName, const char *fromClientAddrPort); // (1) From server to server char *connectSharedMem(size_t *size_out, size_t seg_size, const char *name, const char *addressPort, const char *remoteName, const char *fromClientAddrPort); // (2) From server to server with reply to client. char *connectSharedMem(size_t *size_out, const char *name, const char *addressPort, const char *remoteName, const char *fromClientAddrPort, const char *errorStr); char *sharedMemWriteList(size_t *size_out, const char *segName); // This is the one thread safe method in this class. int removeAddressFromWroteLists(const char *addr); private: // get sharedMem from a local list, so we don't make // many copies of dtkSharedMems. dtkSharedMem *getSharedMem(size_t size, const char *name); dtkSharedMem *getSharedMem(const char *name); struct sharedMemList *shmList; char *fail(size_t *size, const char *s=NULL, ...); char *success(size_t *size, const char *s=NULL, ...); // just a buffer for the string response char response[RESPONSE_BUF_SIZE+2]; char *response1; // points to reponse[1] ServerMutex removeAddressFromWroteListsMutex; };
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_STOPTEXTTRANSLATIONJOBREQUEST_H #define QTAWS_STOPTEXTTRANSLATIONJOBREQUEST_H #include "translaterequest.h" namespace QtAws { namespace Translate { class StopTextTranslationJobRequestPrivate; class QTAWSTRANSLATE_EXPORT StopTextTranslationJobRequest : public TranslateRequest { public: StopTextTranslationJobRequest(const StopTextTranslationJobRequest &other); StopTextTranslationJobRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(StopTextTranslationJobRequest) }; } // namespace Translate } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_UPDATESERVERRESPONSE_P_H #define QTAWS_UPDATESERVERRESPONSE_P_H #include "opsworkscmresponse_p.h" namespace QtAws { namespace OpsWorksCM { class UpdateServerResponse; class UpdateServerResponsePrivate : public OpsWorksCMResponsePrivate { public: explicit UpdateServerResponsePrivate(UpdateServerResponse * const q); void parseUpdateServerResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(UpdateServerResponse) Q_DISABLE_COPY(UpdateServerResponsePrivate) }; } // namespace OpsWorksCM } // namespace QtAws #endif
/* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 2012 Anthony Green Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for IA-64. 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 LIBFFI_TARGET_H #define LIBFFI_TARGET_H #ifndef LIBFFI_H #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." #endif #ifndef LIBFFI_ASM typedef unsigned long long ffi_arg; typedef signed long long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_UNIX, /* Linux and all Unix variants use the same conventions */ FFI_LAST_ABI, FFI_DEFAULT_ABI = FFI_UNIX } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_TRAMPOLINE_SIZE 24 /* Really the following struct, which */ /* can be interpreted as a C function */ /* descriptor: */ #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DELETEEVENTSUBSCRIPTIONREQUEST_H #define QTAWS_DELETEEVENTSUBSCRIPTIONREQUEST_H #include "rdsrequest.h" namespace QtAws { namespace RDS { class DeleteEventSubscriptionRequestPrivate; class QTAWSRDS_EXPORT DeleteEventSubscriptionRequest : public RdsRequest { public: DeleteEventSubscriptionRequest(const DeleteEventSubscriptionRequest &other); DeleteEventSubscriptionRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DeleteEventSubscriptionRequest) }; } // namespace RDS } // namespace QtAws #endif
/* Compute mass action function, in case we have chemical reactions proper */ template <int dim> std::vector<double> Functionals<dim>::MassAction(Tensor<1, alphadim>& prev_alpha, double dt) const { // Set the law of mass action for each species std::vector<double> A(alphadim,0); std::vector<double> B(alphadim,0); //B[0] = Kfb[1]*prev_alpha[1] - Kfb[0]*prev_alpha[0]; //B[1] = Kfb[0]*prev_alpha[0] - Kfb[1]*prev_alpha[1]; //std::cout << "B[0] = " << B[0] << std::endl; //std::cout << "B[1] = " << B[1] << std::endl; /* A[0] = 1.0/dt * ( std::exp(- Kfb[0] * dt) * (prev_alpha[0] - prev_alpha[1]/(Keq) ) + prev_alpha[1]/(Keq) - prev_alpha[0]); */ /* A[1] = 1.0/dt * ( std::exp(- Kfb[2] * dt) * (prev_alpha[1] - (prev_alpha[0] * Keq ) ) + (prev_alpha[0] * Keq ) - prev_alpha[1]); */ //std::cout << "first= " << A[0] << std::endl; //std::cout << "second= " << A[1] << std::endl; std::vector<double> ReactionQuotient_f(num_reactions,1.0); std::vector<double> ReactionQuotient_b(num_reactions,1.0); for(unsigned int j=0;j<num_reactions;j++) { for(unsigned int i=0;i<alphadim;i++) { ReactionQuotient_f[j] *= std::pow(prev_alpha[i],nu_f(j,i)); ReactionQuotient_b[j] *= std::pow(prev_alpha[i],nu_b(j,i)); } } for(unsigned int i=0;i<alphadim;i++) { for(unsigned int j=0;j<num_reactions;j++) { A[i] = A[i] + MM[i] * ( nu_b(j,i) - nu_f(j,i) ) * ( Kfb[2*j]*ReactionQuotient_f[j] - Kfb[(2*j)+1]*ReactionQuotient_b[j] ); //std::cout << "A[i] = " << A[i] << std::endl; } } return A; }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_PUTEMAILIDENTITYMAILFROMATTRIBUTESREQUEST_P_H #define QTAWS_PUTEMAILIDENTITYMAILFROMATTRIBUTESREQUEST_P_H #include "sesv2request_p.h" #include "putemailidentitymailfromattributesrequest.h" namespace QtAws { namespace SESV2 { class PutEmailIdentityMailFromAttributesRequest; class PutEmailIdentityMailFromAttributesRequestPrivate : public Sesv2RequestPrivate { public: PutEmailIdentityMailFromAttributesRequestPrivate(const Sesv2Request::Action action, PutEmailIdentityMailFromAttributesRequest * const q); PutEmailIdentityMailFromAttributesRequestPrivate(const PutEmailIdentityMailFromAttributesRequestPrivate &other, PutEmailIdentityMailFromAttributesRequest * const q); private: Q_DECLARE_PUBLIC(PutEmailIdentityMailFromAttributesRequest) }; } // namespace SESV2 } // namespace QtAws #endif
// Created file "Lib\src\ksuser\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(KSNODETYPE_MUX, 0x2ceaf780, 0xc556, 0x11d0, 0x8a, 0x2b, 0x00, 0xa0, 0xc9, 0x25, 0x5a, 0xc1);
/***************************************************************************** Copyright (c) 2010, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ****************************************************************************** * Contents: Native high-level C interface to LAPACK function dormrz * Author: Intel Corporation * Generated October, 2010 *****************************************************************************/ #include "lapacke.h" #include "lapacke_utils.h" lapack_int LAPACKE_dormrz( int matrix_order, char side, char trans, lapack_int m, lapack_int n, lapack_int k, lapack_int l, const double* a, lapack_int lda, const double* tau, double* c, lapack_int ldc ) { lapack_int info = 0; lapack_int lwork = -1; double* work = NULL; double work_query; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_dormrz", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_dge_nancheck( matrix_order, k, m, a, lda ) ) { return -8; } if( LAPACKE_dge_nancheck( matrix_order, m, n, c, ldc ) ) { return -11; } if( LAPACKE_d_nancheck( k, tau, 1 ) ) { return -10; } #endif /* Query optimal working array(s) size */ info = LAPACKE_dormrz_work( matrix_order, side, trans, m, n, k, l, a, lda, tau, c, ldc, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (double*)LAPACKE_malloc( sizeof(double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_dormrz_work( matrix_order, side, trans, m, n, k, l, a, lda, tau, c, ldc, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_dormrz", info ); } return info; }
/************************************************************************** * * Copyright (C) 2012 Steve Karg <skarg@users.sourceforge.net> * * 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 BIP_H #define BIP_H #include <stdbool.h> #include <stdint.h> #include <stddef.h> #include "bacdef.h" #include "npdu.h" //#include "net.h" /* specific defines for BACnet/IP over Ethernet */ #define MAX_HEADER (1 + 1 + 2) #define MAX_MPDU (MAX_HEADER+MAX_PDU) #define BVLL_TYPE_BACNET_IP (0x81) extern bool BIP_Debug; #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* note: define init, set_interface, and cleanup in your port */ /* on Linux, ifname is eth0, ath0, arc0, and others. on Windows, ifname is the dotted ip address of the interface */ bool bip_init( char *ifname); void bip_set_interface( char *ifname); void bip_cleanup( void); /* Convert uint8_t IPv4 to uint32*/ uint32_t convertBIP_Address2uint32(uint8_t* bip_address); void convertUint32Address_2_uint8Address(uint32_t ip, uint8_t * address); /* common BACnet/IP functions */ void bip_set_socket( uint8_t sock_fd); uint8_t bip_socket( void); bool bip_valid( void); void bip_get_broadcast_address( BACNET_ADDRESS * dest); /* destination address */ void bip_get_my_address( BACNET_ADDRESS * my_address); /* function to send a packet out the BACnet/IP socket */ /* returns zero on success, non-zero on failure */ int bip_send_pdu( BACNET_ADDRESS * dest, /* destination address */ BACNET_NPDU_DATA * npdu_data, /* network information */ uint8_t * pdu, /* any data to be sent - may be null */ unsigned pdu_len); /* number of bytes of data */ /* receives a BACnet/IP packet */ /* returns the number of octets in the PDU, or zero on failure */ uint16_t bip_receive( BACNET_ADDRESS * src, /* source address */ uint8_t * pdu, /* PDU data */ uint16_t max_pdu, /* amount of space available in the PDU */ unsigned timeout); /* milliseconds to wait for a packet */ /* use network byte order for setting */ void bip_set_port( uint16_t port); /* returns network byte order */ uint16_t bip_get_port( void); /* use network byte order for setting */ void bip_set_addr( uint8_t * net_address); /* returns network byte order */ uint8_t* bip_get_addr( void); /* use network byte order for setting */ void bip_set_broadcast_addr( uint8_t* net_address); /* returns network byte order */ uint8_t* bip_get_broadcast_addr( void); /* gets an IP address by name, where name can be a string that is an IP address in dotted form, or a name that is a domain name returns 0 if not found, or an IP address in network byte order */ long bip_getaddrbyname( const char *host_name); #ifdef __cplusplus } #endif /* __cplusplus */ /** @defgroup DLBIP BACnet/IP DataLink Network Layer * @ingroup DataLink * Implementation of the Network Layer using BACnet/IP as the transport, as * described in Annex J. * The functions described here fulfill the roles defined generically at the * DataLink level by serving as the implementation of the function templates. * */ #endif
#include "stm32f4xx.h" static void init(void) { GPIO_InitTypeDef GPIO_InitStructure; // Clock Enable RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE); // Config PG13 als Digital-Ausgang GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz; GPIO_Init(GPIOG, &GPIO_InitStructure); } void SysTick_Handler(void) { static int i = 0; if (i > 999) { i = 0; GPIO_ToggleBits(GPIOG, GPIO_Pin_13); } else i++; } int main(void) { SystemInit(); SystemCoreClockUpdate(); init(); SysTick_Config(SystemCoreClock / 1000); // 1kHz Systick while(1) { } }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DISCOVERINPUTSCHEMAREQUEST_P_H #define QTAWS_DISCOVERINPUTSCHEMAREQUEST_P_H #include "kinesisanalyticsrequest_p.h" #include "discoverinputschemarequest.h" namespace QtAws { namespace KinesisAnalytics { class DiscoverInputSchemaRequest; class DiscoverInputSchemaRequestPrivate : public KinesisAnalyticsRequestPrivate { public: DiscoverInputSchemaRequestPrivate(const KinesisAnalyticsRequest::Action action, DiscoverInputSchemaRequest * const q); DiscoverInputSchemaRequestPrivate(const DiscoverInputSchemaRequestPrivate &other, DiscoverInputSchemaRequest * const q); private: Q_DECLARE_PUBLIC(DiscoverInputSchemaRequest) }; } // namespace KinesisAnalytics } // namespace QtAws #endif
// Created file "Lib\src\amstrmid\X64\strmiids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(CODECAPI_AVEncDDSurroundDownMixLevel, 0x7b20d6e5, 0x0bcf, 0x4273, 0xa4, 0x87, 0x50, 0x6b, 0x04, 0x79, 0x97, 0xe9);
#import "FBSceneHostManager.h" @interface FBWindowContextHostManager : FBSceneHostManager @end
#define state GPIOR0 #define current_byte GPIOR1 #define sregstore GPIOR2 #define UART_PORT PORTA #define UART_DDR DDRA #define UART_TX PA7 #define NONE 0 #define START 1 #define STOP 10
/* * Project: Smarttrack * Author: uran * Description: AT Proto * History: * 12.08.14 create */ #ifndef __AT_PROTO_H__ #define __AT_PROTO_H__ /* Parameters */ // 0 - limitless timeout #define AT_DEFAULT_TIMEOUT 0 #define ATCR 0x0D #define ATLF 0x0A /* Hardware implementation base function (level 0 (AL))*/ /* * Write data * return: size write data */ unsigned int atWrite(const char* buffer, unsigned int size, const unsigned int timeout ); /* * Reader response binary * return: size response data */ unsigned int atRead(char* buffer, unsigned int size, const unsigned int timeout ); /*NRD */ //unsigned int atNumResponse(); /* AT Base function (level 1)*/ typedef enum { AT_DATA = 0, AT_OK = 1, AT_CME_ERROR = 2, AT_CMS_ERROR = 3, AT_TIMEOUT = 4, AT_ERROR = 5, AT_ABNORMAL = 6, AT_STATE_IP_INIT, AT_STATE_IP_START, AT_STATE_IP_CONFIG, AT_STATE_IP_GPRSACT, AT_STATE_IP_STATUS, AT_STATE_IP_TCP_CONNECTING, AT_STATE_IP_CONNECT, AT_STATE_IP_TCP_CLOSING, AT_STATE_IP_TCP_CLOSED, AT_STATE_IP_PDP_DEACT } AT_RESPONSE; /* * Write command to UART: * with terminate string * cmd<CR> * return true if success */ AT_RESPONSE atCommand(const char* cmd); /* * Reader response without * omitted <CR><LF> * return: AT_RESPONSE enum */ AT_RESPONSE atReponse(char* response, unsigned int* psize, const unsigned int timeout ); /* AT API (level 2)*/ AT_RESPONSE atExchange(const char* cmd, char* response, unsigned int* psize, const unsigned int timeout); /* AT API (level 3)*/ /* * Test command on implementations * Using: atExtTest("+FTPEXTPUT"); * return true if command exists and response if exists */ AT_RESPONSE atExtTest(const char* cmd, char* response, unsigned int size, const unsigned int timeout); AT_RESPONSE atExtRead(const char* cmd, char* response,unsigned int size, const unsigned int timeout); AT_RESPONSE atExtWrite(const char* cmd, const char* value, const unsigned int timeout); AT_RESPONSE atExtExec(const char* cmd, char* response, unsigned int size, const unsigned int timeout); AT_RESPONSE atSend(char* data, unsigned int size, const unsigned int timeout); AT_RESPONSE atRecv(char* data, unsigned int* size, const unsigned int timeout); #endif // !__AT_PROTO_H__