text
stringlengths
4
6.14k
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef CAFFE2_CORE_NET_SIMPLE_H_ #define CAFFE2_CORE_NET_SIMPLE_H_ #include <vector> #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include "caffe2/core/net.h" #include "caffe2/core/registry.h" #include "caffe2/core/tensor.h" #include "caffe2/core/workspace.h" #include "caffe2/proto/caffe2.pb.h" namespace caffe2 { // This is the very basic structure you need to run a network - all it // does is simply to run everything in sequence. If you want more fancy control // such as a DAG-like execution, check out other better net implementations. class SimpleNet : public NetBase { public: SimpleNet(const std::shared_ptr<const NetDef>& net_def, Workspace* ws); bool SupportsAsync() override { return false; } vector<float> TEST_Benchmark( const int warmup_runs, const int main_runs, const bool run_individual) override; /* * This returns a list of pointers to objects stored in unique_ptrs. * Used by Observers. * * Think carefully before using. */ vector<OperatorBase*> GetOperators() const override { vector<OperatorBase*> op_list; for (auto& op : operators_) { op_list.push_back(op.get()); } return op_list; } protected: bool DoRunAsync() override; vector<unique_ptr<OperatorBase>> operators_; DISABLE_COPY_AND_ASSIGN(SimpleNet); }; } // namespace caffe2 #endif // CAFFE2_CORE_NET_SIMPLE_H_
#include <ddraw.h> #include <d3d.h> #include <d3dxcore.h> #include <d3dxmath.h> #include "../include/grtypes.h" #include "../include/polylib.h" void AssignPmatrixToD3DXMATRIX(D3DXMATRIX *d, Pmatrix *s); void AssignD3DXMATRIXToPmatrix(Pmatrix *d, D3DXMATRIX *s); // The Scripts Pointer Array extern bool (*DXScriptArray[])(D3DVECTOR *pos, ObjectInstance*, DWORD*);
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICES_MANAGER_CLIENT_H_ #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICES_MANAGER_CLIENT_H_ #include <memory> #include "base/feature_list.h" #include "base/macros.h" #include "base/metrics/field_trial.h" #include "base/threading/thread_checker.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "components/metrics_services_manager/metrics_services_manager_client.h" class PrefService; namespace metrics { class EnabledStateProvider; class MetricsStateManager; } namespace version_info { enum class Channel; } // Provides a //chrome-specific implementation of MetricsServicesManagerClient. class ChromeMetricsServicesManagerClient : public metrics_services_manager::MetricsServicesManagerClient { public: explicit ChromeMetricsServicesManagerClient(PrefService* local_state); ~ChromeMetricsServicesManagerClient() override; // Unconditionally attempts to create a field trial to control client side // metrics/crash sampling to use as a fallback when one hasn't been // provided. This is expected to occur on first-run on platforms that don't // have first-run variations support. This should only be called when there is // no existing field trial controlling the sampling feature, and on the // correct platform. |channel| will affect the sampling rates that are // applied. Stable will be sampled at 10%, other channels at 99%. static void CreateFallbackSamplingTrial(version_info::Channel channel, base::FeatureList* feature_list); // Determines if this client is eligible to send metrics. If they are, and // there was user consent, then metrics and crashes would be reported. static bool IsClientInSample(); // Gets the sample rate for in-sample clients. If the sample rate is not // defined, returns false, and |rate| is unchanged, otherwise returns true, // and |rate| contains the sample rate. If the client isn't in-sample, the // sample rate is undefined. It is also undefined for clients that are not // eligible for sampling. static bool GetSamplingRatePerMille(int* rate); private: // This is defined as a member class to get access to // ChromeMetricsServiceAccessor through ChromeMetricsServicesManagerClient's // friendship. class ChromeEnabledStateProvider; // metrics_services_manager::MetricsServicesManagerClient: std::unique_ptr<rappor::RapporService> CreateRapporService() override; std::unique_ptr<variations::VariationsService> CreateVariationsService() override; std::unique_ptr<metrics::MetricsServiceClient> CreateMetricsServiceClient() override; std::unique_ptr<const base::FieldTrial::EntropyProvider> CreateEntropyProvider() override; net::URLRequestContextGetter* GetURLRequestContext() override; bool IsSafeBrowsingEnabled(const base::Closure& on_update_callback) override; bool IsMetricsReportingEnabled() override; bool OnlyDoMetricsRecording() override; #if defined(OS_WIN) // On Windows, the client controls whether Crashpad can upload crash reports. void UpdateRunningServices(bool may_record, bool may_upload) override; #endif // defined(OS_WIN) // Gets the MetricsStateManager, creating it if it has not already been // created. metrics::MetricsStateManager* GetMetricsStateManager(); // MetricsStateManager which is passed as a parameter to service constructors. std::unique_ptr<metrics::MetricsStateManager> metrics_state_manager_; // EnabledStateProvider to communicate if the client has consented to metrics // reporting, and if it's enabled. std::unique_ptr<metrics::EnabledStateProvider> enabled_state_provider_; // Ensures that all functions are called from the same thread. base::ThreadChecker thread_checker_; // Weak pointer to the local state prefs store. PrefService* local_state_; // Subscription to SafeBrowsing service state changes. std::unique_ptr<safe_browsing::SafeBrowsingService::StateSubscription> sb_state_subscription_; DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServicesManagerClient); }; #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICES_MANAGER_CLIENT_H_
/* main.c * * Copyright (C) 2006-2015 wolfSSL Inc. * * This file is part of wolfSSL. (formerly known as CyaSSL) * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * wolfSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <wolfssl/wolfcrypt/visibility.h> #include <wolfssl/wolfcrypt/logging.h> #include <RTL.h> #include <stdio.h> #include "wolfssl_MDK_ARM.h" /*----------------------------------------------------------------------------- * Initialize a Flash Memory Card *----------------------------------------------------------------------------*/ #if !defined(NO_FILESYSTEM) static void init_card (void) { U32 retv; while ((retv = finit (NULL)) != 0) { /* Wait until the Card is ready */ if (retv == 1) { printf ("\nSD/MMC Init Failed"); printf ("\nInsert Memory card and press key...\n"); } else { printf ("\nSD/MMC Card is Unformatted"); } } } #endif /*----------------------------------------------------------------------------- * TCP/IP tasks *----------------------------------------------------------------------------*/ #ifdef WOLFSSL_KEIL_TCP_NET __task void tcp_tick (void) { WOLFSSL_MSG("Time tick started.") ; #if defined (HAVE_KEIL_RTX) os_itv_set (10); #endif while (1) { #if defined (HAVE_KEIL_RTX) os_itv_wait (); #endif /* Timer tick every 100 ms */ timer_tick (); } } __task void tcp_poll (void) { WOLFSSL_MSG("TCP polling started.\n") ; while (1) { main_TcpNet (); #if defined (HAVE_KEIL_RTX) os_tsk_pass (); #endif } } #endif #if defined(HAVE_KEIL_RTX) && defined(WOLFSSL_MDK_SHELL) #define SHELL_STACKSIZE 1000 static unsigned char Shell_stack[SHELL_STACKSIZE] ; #endif #if defined(WOLFSSL_MDK_SHELL) extern void shell_main(void) ; #endif extern void time_main(int) ; extern void benchmark_test(void) ; extern void SER_Init(void) ; /*----------------------------------------------------------------------------- * mian entry *----------------------------------------------------------------------------*/ /*** This is the parent task entry ***/ void main_task (void) { #ifdef WOLFSSL_KEIL_TCP_NET init_TcpNet (); os_tsk_create (tcp_tick, 2); os_tsk_create (tcp_poll, 1); #endif #ifdef WOLFSSL_MDK_SHELL #ifdef HAVE_KEIL_RTX os_tsk_create_user(shell_main, 1, Shell_stack, SHELL_STACKSIZE) ; #else shell_main() ; #endif #else /************************************/ /*** USER APPLICATION HERE ***/ /************************************/ printf("USER LOGIC STARTED\n") ; #endif #ifdef HAVE_KEIL_RTX WOLFSSL_MSG("Terminating tcp_main\n") ; os_tsk_delete_self (); #endif } int myoptind = 0; char* myoptarg = NULL; #if defined(DEBUG_WOLFSSL) extern void wolfSSL_Debugging_ON(void) ; #endif /*** main entry ***/ extern void SystemInit(void); int main() { SystemInit(); #if !defined(NO_FILESYSTEM) init_card () ; /* initializing SD card */ #endif #if defined(DEBUG_WOLFSSL) printf("Turning ON Debug message\n") ; wolfSSL_Debugging_ON() ; #endif #ifdef HAVE_KEIL_RTX os_sys_init (main_task) ; #else main_task() ; #endif return 0 ; /* There should be no return here */ }
/* $Header: /cvs/bao-parsec/ext/splash2/apps/volrend/src/libtiff/prototypes.h,v 1.1.1.1 2012/03/29 17:22:40 uid42307 Exp $ */ /* * Copyright (c) 1991, 1992 Sam Leffler * Copyright (c) 1991, 1992 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #if USE_PROTOTYPES #define DECLARE1(f,t1,a1) f(t1 a1) #define DECLARE2(f,t1,a1,t2,a2) f(t1 a1, t2 a2) #define DECLARE3(f,t1,a1,t2,a2,t3,a3) f(t1 a1, t2 a2, t3 a3) #define DECLARE4(f,t1,a1,t2,a2,t3,a3,t4,a4)\ f(t1 a1, t2 a2, t3 a3, t4 a4) #define DECLARE5(f,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5)\ f(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) #define DECLARE6(f,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6)\ f(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) #define DECLARE1V(f,t1,a1) f(t1 a1 ...) #define DECLARE2V(f,t1,a1,t2,a2) f(t1 a1, t2 a2, ...) #define DECLARE3V(f,t1,a1,t2,a2,t3,a3) f(t1 a1, t2 a2, t3 a3, ...) #else #define DECLARE1(f,t1,a1) f(a1) t1 a1; #define DECLARE2(f,t1,a1,t2,a2) f(a1,a2) t1 a1; t2 a2; #define DECLARE3(f,t1,a1,t2,a2,t3,a3) f(a1, a2, a3) t1 a1; t2 a2; t3 a3; #define DECLARE4(f,t1,a1,t2,a2,t3,a3,t4,a4) \ f(a1, a2, a3, a4) t1 a1; t2 a2; t3 a3; t4 a4; #define DECLARE5(f,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5)\ f(a1, a2, a3, a4, a5) t1 a1; t2 a2; t3 a3; t4 a4; t5 a5; #define DECLARE6(f,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6)\ f(a1, a2, a3, a4, a5, a6) t1 a1; t2 a2; t3 a3; t4 a4; t5 a5; t6 a6; #if USE_VARARGS #define DECLARE1V(f,t1,a1) \ f(a1, va_alist) t1 a1; va_dcl #define DECLARE2V(f,t1,a1,t2,a2) \ f(a1, a2, va_alist) t1 a1; t2 a2; va_dcl #define DECLARE3V(f,t1,a1,t2,a2,t3,a3) \ f(a1, a2, a3, va_alist) t1 a1; t2 a2; t3 a3; va_dcl #else "Help, I don't know how to handle this case: !USE_PROTOTYPES and !USE_VARARGS?" #endif #endif
/* * The Biomechanical ToolKit * Copyright (c) 2009-2014, Arnaud Barré * 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(s) of the copyright holders nor the names * of its contributors may be used to endorse or promote products * derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef __btkANGFileIO_h #define __btkANGFileIO_h #include "btkAcquisitionFileIO.h" #include "btkException.h" namespace btk { class ANGFileIOException : public Exception { public: explicit ANGFileIOException(const std::string& msg) : Exception(msg) {}; virtual ~ANGFileIOException() throw() {}; }; class ANGFileIO : public AcquisitionFileIO { BTK_FILE_IO_SUPPORTED_EXTENSIONS("ANG"); BTK_FILE_IO_ONLY_READ_OPERATION; public: typedef btkSharedPtr<ANGFileIO> Pointer; typedef btkSharedPtr<const ANGFileIO> ConstPointer; static Pointer New() {return Pointer(new ANGFileIO());}; // ~ANGFileIO(); // Implicit. BTK_IO_EXPORT virtual bool CanReadFile(const std::string& filename); BTK_IO_EXPORT virtual void Read(const std::string& filename, Acquisition::Pointer output); protected: BTK_IO_EXPORT ANGFileIO(); private: ANGFileIO(const ANGFileIO& ); // Not implemented. ANGFileIO& operator=(const ANGFileIO& ); // Not implemented. struct AngleLabelConverter { AngleLabelConverter(std::string cl = "", std::string fl = "", std::string nd = "") : current(cl), future(fl), description(nd) {}; std::string current; std::string future; std::string description; }; }; }; #endif // __btkANGFileIO_h
#ifndef __ddPointCloudLCM_h #define __ddPointCloudLCM_h #include <QObject> #include "ddLCMThread.h" #include "ddLCMSubscriber.h" #include "ddAppConfigure.h" #include <string> #include <sstream> #include <vtkSmartPointer.h> #include <vtkPolyData.h> #include <vtkPointData.h> #include <vtkUnsignedIntArray.h> #include <vtkFloatArray.h> #include <lcm/lcm-cpp.hpp> #include <lcmtypes/bot_core/pointcloud2_t.hpp> #include <lcmtypes/bot_core/pointcloud_t.hpp> class DD_APP_EXPORT ddPointCloudLCM : public QObject { Q_OBJECT public: ddPointCloudLCM(QObject* parent=NULL); void init(ddLCMThread* lcmThread, const QString& botConfigFile); qint64 getPointCloudFromPointCloud(vtkPolyData* polyDataRender); protected slots: void onPointCloudFrame(const QByteArray& data, const QString& channel); void onPointCloud2Frame(const QByteArray& data, const QString& channel); protected: ddLCMThread* mLCM; vtkSmartPointer<vtkPolyData> mPolyData; int64_t mUtime; QMutex mPolyDataMutex; }; #endif
/* * Copyright (c) 2005-2012 by KoanLogic s.r.l. <http://www.koanlogic.com> * All rights reserved. * * This file is part of KLone, and as such it is subject to the license stated * in the LICENSE file which you have received as part of this distribution. * * $Id: ppc_nop.c,v 1.7 2007/11/09 22:06:26 tat Exp $ */ #include "klone_conf.h" #include <string.h> #include <klone/klog.h> #include <klone/context.h> #include <klone/server.h> #include <klone/ppc.h> #include <klone/ppc_cmd.h> #include <klone/server_ppc_cmd.h> #include "server_s.h" /* struct used for ppc command PPC_CMD_NOP */ struct ppc_nop_s { int dummy; }; typedef struct ppc_nop_s ppc_nop_t; /* client function */ int server_ppc_cmd_nop(server_t *s) { ppc_nop_t nop; nop_err_if(s == NULL); nop_err_if(s->ppc == NULL); memset(&nop, 0, sizeof(ppc_nop_t)); /* send the command request */ nop_err_if(ppc_write(s->ppc, ctx->pipc, PPC_CMD_NOP, (char*)&nop, sizeof(nop)) < 0); return 0; err: return ~0; } /* [parent] nop op */ int server_ppc_cb_nop(ppc_t *ppc, int fd, unsigned char cmd, char *data, size_t size, void *vso) { u_unused_args(ppc, fd, cmd, data, size, vso); u_dbg("ppc nop cmd callback"); return 0; }
// // APHDynamicMoodSurveyTask.h // Share the Journey // // Copyright (c) 2015, Sage Bionetworks. 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. // // 3. Neither the name of the copyright holder(s) nor the names of any contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. No license is granted to the trademarks of // the copyright holders even if such marks are included in this software. // // 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. // #import <ResearchKit/ResearchKit.h> @import APCAppCore; @interface APHDynamicMoodSurveyTask : ORKOrderedTask <ORKTask> @end
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IOS_CHROME_BROWSER_SIGNIN_CHROME_ACCOUNT_MANAGER_SERVICE_H_ #define IOS_CHROME_BROWSER_SIGNIN_CHROME_ACCOUNT_MANAGER_SERVICE_H_ #import <Foundation/Foundation.h> #include "base/scoped_observation.h" #include "base/strings/string_piece.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_change_registrar.h" #include "ios/chrome/browser/signin/constants.h" #import "ios/chrome/browser/signin/pattern_account_restriction.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity.h" #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" class PrefService; @class ResizedAvatarCache; // Service that provides Chrome identities. class ChromeAccountManagerService : public KeyedService, ios::ChromeIdentityService::Observer, ios::ChromeBrowserProvider::Observer { public: // Observer handling events related to the ChromeAccountManagerService. class Observer { public: Observer() {} Observer(const Observer&) = delete; Observer& operator=(const Observer&) = delete; virtual ~Observer() {} // Handles identity list changed events. // If |need_user_approval| is true, the user need to approve the new account // list (related to SignedInAccountsViewController). Notifications with no // account list update are possible, this has to be handled by the observer. virtual void OnIdentityListChanged(bool need_user_approval) {} // Called when the identity is updated. virtual void OnIdentityChanged(ChromeIdentity* identity) {} }; // Initializes the service. explicit ChromeAccountManagerService(PrefService* pref_service); ChromeAccountManagerService(const ChromeAccountManagerService&) = delete; ChromeAccountManagerService& operator=(const ChromeAccountManagerService&) = delete; ~ChromeAccountManagerService() override; // Returns true if there is at least one identity known by the service. bool HasIdentities() const; // Returns true if there is at least one restricted identity known by the // service. bool HasRestrictedIdentities() const; // Returns whether |identity| is valid and known by the service. bool IsValidIdentity(ChromeIdentity* identity) const; // Returns whether |email| is restricted. bool IsEmailRestricted(base::StringPiece email) const; // Returns the ChromeIdentity with gaia ID equals to |gaia_id| or nil if // no matching identity is found. There are two overloads to reduce the // need to convert between NSString* and std::string. ChromeIdentity* GetIdentityWithGaiaID(NSString* gaia_id) const; ChromeIdentity* GetIdentityWithGaiaID(base::StringPiece gaia_id) const; // Returns all ChromeIdentity objects, sorted by the ordering used in the // account manager, which is typically based on the keychain ordering of // accounts. NSArray<ChromeIdentity*>* GetAllIdentities() const; // Returns the first ChromeIdentity object. ChromeIdentity* GetDefaultIdentity() const; // Returns the identity avatar. If the avatar is not available, it is fetched // in background (a notification will be received when it will be available), // and the default avatar is returned (see |Observer::OnIdentityChanged()|). UIImage* GetIdentityAvatarWithIdentity(ChromeIdentity* identity, IdentityAvatarSize size); // KeyedService implementation. void Shutdown() override; // Adds and removes observers. void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); // ChromeIdentityServiceObserver implementation. void OnIdentityListChanged(bool need_user_approval) override; void OnProfileUpdate(ChromeIdentity* identity) override; void OnChromeIdentityServiceWillBeDestroyed() override; // ChromeBrowserProvider implementation. void OnChromeIdentityServiceDidChange( ios::ChromeIdentityService* new_service) override; void OnChromeBrowserProviderWillBeDestroyed() override; private: // Updates PatternAccountRestriction with the current pref_service_. If // pref_service_ is null, no identity will be filtered. void UpdateRestriction(); // Returns a ResizedAvatarCache based on |avatar_size|. ResizedAvatarCache* GetAvatarCacheForIdentityAvatarSize( IdentityAvatarSize avatar_size); // Used to retrieve restricted patterns. PrefService* pref_service_ = nullptr; // Used to filter ChromeIdentities. PatternAccountRestriction restriction_; // Used to listen pref change. PrefChangeRegistrar registrar_; base::ObserverList<Observer, true>::Unchecked observer_list_; base::ScopedObservation<ios::ChromeIdentityService, ios::ChromeIdentityService::Observer> identity_service_observation_{this}; base::ScopedObservation<ios::ChromeBrowserProvider, ios::ChromeBrowserProvider::Observer> browser_provider_observation_{this}; // ResizedAvatarCache for IdentityAvatarSize::TableViewIcon. ResizedAvatarCache* default_table_view_avatar_cache_; // ResizedAvatarCache for IdentityAvatarSize::SmallSize. ResizedAvatarCache* small_size_avatar_cache_; // ResizedAvatarCache for IdentityAvatarSize::DefaultLarge. ResizedAvatarCache* default_large_avatar_cache_; }; #endif // IOS_CHROME_BROWSER_SIGNIN_CHROME_ACCOUNT_MANAGER_SERVICE_H_
/* * Copyright (c) 2012, Klaus Pototzky * * 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. * 3) Neither the name of the FLENS development group nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef PLAYGROUND_CXXBLAS_INTRINSICS_CLASSES_BLANK_H #define PLAYGROUND_CXXBLAS_INTRINSICS_CLASSES_BLANK_H 1 #include <playground/cxxblas/intrinsics/includes.h> template <typename DataType, IntrinsicsLevel Level> class Intrinsics { }; #endif // PLAYGROUND_CXXBLAS_INTRINSICS_CLASSES_BLANK_H
/* Copyright 2013. The Regents of the University of California. * All rights reserved. Use of this source code is governed by * a BSD-style license which can be found in the LICENSE file. */ #include "misc/mri.h" struct linop_s; extern void noir_forw_coils(const struct linop_s* op, complex float* dst, const complex float* src); extern void noir_back_coils(const struct linop_s* op, complex float* dst, const complex float* src); struct noir_model_conf_s { unsigned int fft_flags; unsigned int cnstcoil_flags; unsigned int ptrn_flags; _Bool rvc; _Bool noncart; float a; float b; }; extern struct noir_model_conf_s noir_model_conf_defaults; struct nlop_s; struct noir_s { struct nlop_s* nlop; const struct linop_s* linop; struct noir_op_s* noir_op; }; extern struct noir_s noir_create2(const long dims[DIMS], const complex float* mask, const complex float* psf, const struct noir_model_conf_s* conf); extern struct noir_s noir_create(const long dims[DIMS], const complex float* mask, const complex float* psf, const struct noir_model_conf_s* conf); extern struct noir_s noir_create3(const long dims[DIMS], const complex float* mask, const complex float* psf, const struct noir_model_conf_s* conf); struct nlop_data_s; extern void noir_orthogonalize(struct noir_s* op, complex float* coils);
/* * ATokPtrImpl.h (formerly ATokPtr.cpp) * * This is #included in ATokBuffer.cpp for historical reasons. * It has been renamed because of problems with the .cpp extension * when used with IDE. * * * ANTLRToken MUST be defined before entry to this file. * * SOFTWARE RIGHTS * * We reserve no LEGAL rights to the Purdue Compiler Construction Tool * Set (PCCTS) -- PCCTS is in the public domain. An individual or * company may do whatever they wish with source code distributed with * PCCTS or the code generated by PCCTS, including the incorporation of * PCCTS, or its output, into commerical software. * * We encourage users to develop software with PCCTS. However, we do ask * that credit is given to us for developing PCCTS. By "credit", * we mean that if you incorporate our source code into one of your * programs (commercial product, research project, or otherwise) that you * acknowledge this fact somewhere in the documentation, research report, * etc... If you like PCCTS and have developed a nice tool with the * output, please mention that you developed it using PCCTS. In * addition, we ask that this header remain intact in our source code. * As long as these guidelines are kept, we expect to continue enhancing * this system and expect to make other tools available as they are * completed. * * ANTLR 1.33 * Written by Russell Quong June 30, 1995 * Adapted by Terence Parr to ANTLR stuff * Parr Research Corporation * with Purdue University and AHPCRC, University of Minnesota * 1989-2000 */ #include "pcctscfg.h" PCCTS_NAMESPACE_STD #include "ATokPtr.h" void ANTLRTokenPtr::ref() const { if (ptr_ != NULL) { ptr_->ref(); } } void ANTLRTokenPtr::deref() { if (ptr_ != NULL) { ptr_->deref(); if ( ptr_->nref()==0 ) { delete ptr_; ptr_ = NULL; } } } ANTLRTokenPtr::~ANTLRTokenPtr() { deref(); } // // 8-Apr-97 MR1 Make operator -> a const member function // as weall as some other member functions // ANTLRTokenPtr& ANTLRTokenPtr::operator = (const ANTLRTokenPtr & lhs) // MR1 { lhs.ref(); // protect against "xp = xp"; ie same underlying object deref(); ptr_ = lhs.ptr_; return *this; } ANTLRTokenPtr& ANTLRTokenPtr::operator = (ANTLRAbstractToken *addr) { if (addr != NULL) { addr->ref(); } deref(); ptr_ = addr; return *this; }
#ifndef _ORC_MMX_H_ #define _ORC_MMX_H_ #include <orc/orcx86.h> #include <orc/orcx86insn.h> ORC_BEGIN_DECLS typedef enum { ORC_TARGET_MMX_MMX = (1<<0), ORC_TARGET_MMX_MMXEXT = (1<<1), ORC_TARGET_MMX_3DNOW = (1<<2), ORC_TARGET_MMX_3DNOWEXT = (1<<3), ORC_TARGET_MMX_SSSE3 = (1<<4), ORC_TARGET_MMX_SSE4_1 = (1<<5), ORC_TARGET_MMX_SSE4_2 = (1<<6), ORC_TARGET_MMX_FRAME_POINTER = (1<<7), ORC_TARGET_MMX_SHORT_JUMPS = (1<<8), ORC_TARGET_MMX_64BIT = (1<<9) } OrcTargetMMXFlags; #ifdef ORC_ENABLE_UNSTABLE_API typedef enum { X86_MM0 = ORC_VEC_REG_BASE, X86_MM1, X86_MM2, X86_MM3, X86_MM4, X86_MM5, X86_MM6, X86_MM7 } OrcMMXRegister; #define ORC_MMX_SHUF(a,b,c,d) ((((a)&3)<<6)|(((b)&3)<<4)|(((c)&3)<<2)|(((d)&3)<<0)) const char * orc_x86_get_regname_mmx(int i); void orc_x86_emit_mov_memoffset_mmx (OrcCompiler *compiler, int size, int offset, int reg1, int reg2, int is_aligned); void orc_x86_emit_mov_memindex_mmx (OrcCompiler *compiler, int size, int offset, int reg1, int regindex, int shift, int reg2, int is_aligned); void orc_x86_emit_mov_mmx_memoffset (OrcCompiler *compiler, int size, int reg1, int offset, int reg2, int aligned, int uncached); #if 0 void orc_x86_emit_mov_mmx_reg_reg (OrcCompiler *compiler, int reg1, int reg2); void orc_x86_emit_mov_reg_mmx (OrcCompiler *compiler, int reg1, int reg2); void orc_x86_emit_mov_mmx_reg (OrcCompiler *compiler, int reg1, int reg2); void orc_mmx_emit_loadib (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadiw (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadil (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadpb (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadpw (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadpl (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadpq (OrcCompiler *p, int reg, int value); void orc_mmx_emit_660f (OrcCompiler *p, const char *insn_name, int code, int src, int dest); void orc_mmx_emit_f20f (OrcCompiler *p, const char *insn_name, int code, int src, int dest); void orc_mmx_emit_f30f (OrcCompiler *p, const char *insn_name, int code, int src, int dest); void orc_mmx_emit_0f (OrcCompiler *p, const char *insn_name, int code, int src, int dest); void orc_mmx_emit_pshufw (OrcCompiler *p, int shuf, int src, int dest); void orc_mmx_emit_palignr (OrcCompiler *p, int align, int src, int dest); void orc_mmx_emit_pinsrw_memoffset (OrcCompiler *p, int imm, int offset, int src, int dest); void orc_mmx_emit_pextrw_memoffset (OrcCompiler *p, int imm, int src, int offset, int dest); void orc_mmx_emit_shiftimm (OrcCompiler *p, const char *insn_name, int code, int modrm_code, int shift, int reg); #endif unsigned int orc_mmx_get_cpu_flags (void); void orc_mmx_load_constant (OrcCompiler *compiler, int reg, int size, orc_uint64 value); #endif ORC_END_DECLS #endif
// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_ #define INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_ #include <cstdint> #include <type_traits> #include "cppgc/source-location.h" #include "v8config.h" // NOLINT(build/include_directory) namespace cppgc { namespace internal { class PersistentRegion; // Tags to distinguish between strong and weak member types. class StrongMemberTag; class WeakMemberTag; class UntracedMemberTag; struct DijkstraWriteBarrierPolicy { static void InitializingBarrier(const void*, const void*) { // Since in initializing writes the source object is always white, having no // barrier doesn't break the tri-color invariant. } static void AssigningBarrier(const void*, const void*) { // TODO(chromium:1056170): Add actual implementation. } }; struct NoWriteBarrierPolicy { static void InitializingBarrier(const void*, const void*) {} static void AssigningBarrier(const void*, const void*) {} }; class V8_EXPORT EnabledCheckingPolicy { protected: EnabledCheckingPolicy(); void CheckPointer(const void* ptr); private: void* impl_; }; class DisabledCheckingPolicy { protected: void CheckPointer(const void* raw) {} }; #if V8_ENABLE_CHECKS using DefaultCheckingPolicy = EnabledCheckingPolicy; #else using DefaultCheckingPolicy = DisabledCheckingPolicy; #endif class KeepLocationPolicy { public: constexpr const SourceLocation& Location() const { return location_; } protected: constexpr explicit KeepLocationPolicy(const SourceLocation& location) : location_(location) {} // KeepLocationPolicy must not copy underlying source locations. KeepLocationPolicy(const KeepLocationPolicy&) = delete; KeepLocationPolicy& operator=(const KeepLocationPolicy&) = delete; // Location of the original moved from object should be preserved. KeepLocationPolicy(KeepLocationPolicy&&) = default; KeepLocationPolicy& operator=(KeepLocationPolicy&&) = default; private: SourceLocation location_; }; class IgnoreLocationPolicy { public: constexpr SourceLocation Location() const { return {}; } protected: constexpr explicit IgnoreLocationPolicy(const SourceLocation&) {} }; #if CPPGC_SUPPORTS_OBJECT_NAMES using DefaultLocationPolicy = KeepLocationPolicy; #else using DefaultLocationPolicy = IgnoreLocationPolicy; #endif struct StrongPersistentPolicy { using IsStrongPersistent = std::true_type; static V8_EXPORT PersistentRegion& GetPersistentRegion(void* object); }; struct WeakPersistentPolicy { using IsStrongPersistent = std::false_type; static V8_EXPORT PersistentRegion& GetPersistentRegion(void* object); }; // Persistent/Member forward declarations. template <typename T, typename WeaknessPolicy, typename LocationPolicy = DefaultLocationPolicy, typename CheckingPolicy = DefaultCheckingPolicy> class BasicPersistent; template <typename T, typename WeaknessTag, typename WriteBarrierPolicy, typename CheckingPolicy = DefaultCheckingPolicy> class BasicMember; // Special tag type used to denote some sentinel member. The semantics of the // sentinel is defined by the embedder. struct SentinelPointer { template <typename T> operator T*() const { // NOLINT static constexpr intptr_t kSentinelValue = -1; return reinterpret_cast<T*>(kSentinelValue); } // Hidden friends. friend bool operator==(SentinelPointer, SentinelPointer) { return true; } friend bool operator!=(SentinelPointer, SentinelPointer) { return false; } }; } // namespace internal constexpr internal::SentinelPointer kSentinelPointer; } // namespace cppgc #endif // INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_
#define KL_LOG KL_TEST #include <klog.h> #include <stdc.h> #include "../include/ktest.h" typedef struct strtol_test { const char *str; long value; long base; } strtol_test_t; strtol_test_t values[] = { {"123", 123, 10}, {"0xA23B", 41531, 16}, {"03417", 1807, 8}}; int test_strtol(void) { int max = sizeof(values) / sizeof(strtol_test_t); for (int i = 0; i < max; i++) if (values[i].value != strtol(values[i].str, (char **)NULL, values[i].base)) { klog("Mismatch for test %d: Expected: %ld, Actual: %ld", i, values[i].value, strtol(values[i].str, (char **)NULL, values[i].base)); return KTEST_FAILURE; } else { klog("Match for test %d: Expected: %ld, Actual: %ld", i, values[i].value, strtol(values[i].str, (char **)NULL, values[i].base)); } return KTEST_SUCCESS; } KTEST_ADD(strtol, test_strtol, 0);
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ #define MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ #include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" #include "components/clipboard/public/interfaces/clipboard.mojom.h" #include "mojo/application/public/cpp/application_delegate.h" #include "mojo/application/public/cpp/interface_factory_impl.h" #include "mojo/application/public/interfaces/content_handler.mojom.h" #include "mojo/common/weak_binding_set.h" namespace core_services { class ApplicationThread; // The CoreServices application is a singleton ServiceProvider. There is one // instance of the CoreServices ServiceProvider. class CoreServicesApplicationDelegate : public mojo::ApplicationDelegate, public mojo::InterfaceFactory<mojo::ContentHandler>, public mojo::ContentHandler { public: CoreServicesApplicationDelegate(); ~CoreServicesApplicationDelegate() override; void ApplicationThreadDestroyed(ApplicationThread* thread); private: // Overridden from mojo::ApplicationDelegate: void Initialize(mojo::ApplicationImpl* app) override; bool ConfigureIncomingConnection( mojo::ApplicationConnection* connection) override; void Quit() override; // Overridden from mojo::InterfaceFactory<mojo::ContentHandler>: void Create(mojo::ApplicationConnection* connection, mojo::InterfaceRequest<mojo::ContentHandler> request) override; // Overridden from mojo::ContentHandler: void StartApplication( mojo::InterfaceRequest<mojo::Application> request, mojo::URLResponsePtr response) override; // Bindings for all of our connections. mojo::WeakBindingSet<ContentHandler> handler_bindings_; ScopedVector<ApplicationThread> application_threads_; base::WeakPtrFactory<CoreServicesApplicationDelegate> weak_factory_; DISALLOW_COPY_AND_ASSIGN(CoreServicesApplicationDelegate); }; } // namespace core_services #endif // MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_
// RUN: %clang_builtins %s %librt -o %t && %run %t //===-- floatuntisf.c - Test __floatuntisf --------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file tests __floatuntisf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include <float.h> #include <stdio.h> #if defined(CRT_HAS_128BIT) && HAS_80_BIT_LONG_DOUBLE // Returns: convert a to a float, rounding toward even. // Assumption: float is a IEEE 32 bit floating point type // tu_int is a 128 bit integral type // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI float __floatuntisf(tu_int a); int test__floatuntisf(tu_int a, float expected) { float x = __floatuntisf(a); if (x != expected) { utwords at; at.all = a; printf("error in __floatuntisf(0x%.16llX%.16llX) = %a, expected %a\n", at.s.high, at.s.low, x, expected); } return x != expected; } COMPILE_TIME_ASSERT(sizeof(tu_int) == 2*sizeof(du_int)); COMPILE_TIME_ASSERT(sizeof(tu_int)*CHAR_BIT == 128); COMPILE_TIME_ASSERT(sizeof(float)*CHAR_BIT == 32); #endif int main() { #if defined(CRT_HAS_128BIT) && HAS_80_BIT_LONG_DOUBLE if (test__floatuntisf(0, 0.0F)) return 1; if (test__floatuntisf(1, 1.0F)) return 1; if (test__floatuntisf(2, 2.0F)) return 1; if (test__floatuntisf(20, 20.0F)) return 1; if (test__floatuntisf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62F)) return 1; if (test__floatuntisf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62F)) return 1; if (test__floatuntisf(make_ti(0x8000008000000000LL, 0), 0x1.000001p+127F)) return 1; if (test__floatuntisf(make_ti(0x8000000000000800LL, 0), 0x1.0p+127F)) return 1; if (test__floatuntisf(make_ti(0x8000010000000000LL, 0), 0x1.000002p+127F)) return 1; if (test__floatuntisf(make_ti(0x8000000000000000LL, 0), 0x1.000000p+127F)) return 1; if (test__floatuntisf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50F)) return 1; if (test__floatuntisf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50F)) return 1; if (test__floatuntisf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50F)) return 1; if (test__floatuntisf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50F)) return 1; if (test__floatuntisf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50F)) return 1; if (test__floatuntisf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50F)) return 1; if (test__floatuntisf(0xFFFFFFFFFFFFFFFELL, 0x1p+64F)) return 1; if (test__floatuntisf(0xFFFFFFFFFFFFFFFFLL, 0x1p+64F)) return 1; if (test__floatuntisf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EA000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EB000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EC000000LL, 0x1.FEDCBCp+50F)) return 1; if (test__floatuntisf(0x0007FB72E8000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E6000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E7000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E7FFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E4000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E4000000LL, 0x1.FEDCB8p+50F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCB90000000000001LL), 0x1.FEDCBAp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBA0000000000000LL), 0x1.FEDCBAp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBAFFFFFFFFFFFFFLL), 0x1.FEDCBAp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBB0000000000000LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBB0000000000001LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBBFFFFFFFFFFFFFLL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBC0000000000000LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBC0000000000001LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBD0000000000000LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBD0000000000001LL), 0x1.FEDCBEp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBDFFFFFFFFFFFFFLL), 0x1.FEDCBEp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBE0000000000000LL), 0x1.FEDCBEp+76F)) return 1; #else printf("skipped\n"); #endif return 0; }
#define MICROPY_BOARD_EARLY_INIT STM32L476DISC_board_early_init void STM32L476DISC_board_early_init(void); #define MICROPY_HW_BOARD_NAME "L476-DISCO" #define MICROPY_HW_MCU_NAME "STM32L476" #define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0) #define MICROPY_HW_HAS_SWITCH (1) #define MICROPY_HW_HAS_FLASH (1) #define MICROPY_HW_ENABLE_RNG (1) #define MICROPY_HW_ENABLE_RTC (1) #define MICROPY_HW_ENABLE_USB (1) // use external SPI flash for storage #define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024) #define MICROPY_HW_SPIFLASH_CS (pin_E11) #define MICROPY_HW_SPIFLASH_SCK (pin_E10) #define MICROPY_HW_SPIFLASH_MOSI (pin_E12) #define MICROPY_HW_SPIFLASH_MISO (pin_E13) // block device config for SPI flash extern const struct _mp_spiflash_config_t spiflash_config; extern struct _spi_bdev_t spi_bdev; #define MICROPY_HW_BDEV_IOCTL(op, arg) ( \ (op) == BDEV_IOCTL_NUM_BLOCKS ? (MICROPY_HW_SPIFLASH_SIZE_BITS / 8 / FLASH_BLOCK_SIZE) : \ (op) == BDEV_IOCTL_INIT ? spi_bdev_ioctl(&spi_bdev, (op), (uint32_t)&spiflash_config) : \ spi_bdev_ioctl(&spi_bdev, (op), (arg)) \ ) #define MICROPY_HW_BDEV_READBLOCKS(dest, bl, n) spi_bdev_readblocks(&spi_bdev, (dest), (bl), (n)) #define MICROPY_HW_BDEV_WRITEBLOCKS(src, bl, n) spi_bdev_writeblocks(&spi_bdev, (src), (bl), (n)) // MSI is used and is 4MHz #define MICROPY_HW_CLK_PLLM (1) #define MICROPY_HW_CLK_PLLN (40) #define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV7) #define MICROPY_HW_CLK_PLLR (RCC_PLLR_DIV2) #define MICROPY_HW_CLK_PLLQ (RCC_PLLQ_DIV2) #define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4 // USART config #define MICROPY_HW_UART2_TX (pin_D5) #define MICROPY_HW_UART2_RX (pin_D6) // USART 2 is connected to the virtual com port on the ST-LINK #define MICROPY_HW_UART_REPL PYB_UART_2 #define MICROPY_HW_UART_REPL_BAUD 115200 // I2C busses #define MICROPY_HW_I2C1_SCL (pin_B6) #define MICROPY_HW_I2C1_SDA (pin_B7) #define MICROPY_HW_I2C2_SCL (pin_B10) #define MICROPY_HW_I2C2_SDA (pin_B11) // SPI busses #define MICROPY_HW_SPI2_NSS (pin_D0) #define MICROPY_HW_SPI2_SCK (pin_D1) #define MICROPY_HW_SPI2_MISO (pin_D3) #define MICROPY_HW_SPI2_MOSI (pin_D4) // CAN busses #define MICROPY_HW_CAN1_TX (pin_B9) #define MICROPY_HW_CAN1_RX (pin_B8) // Joystick is pulled low. Pressing the button makes the input go high. #define MICROPY_HW_USRSW_PIN (pin_A0) #define MICROPY_HW_USRSW_PULL (GPIO_NOPULL) #define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING) #define MICROPY_HW_USRSW_PRESSED (1) // LEDs #define MICROPY_HW_LED1 (pin_B2) // red #define MICROPY_HW_LED2 (pin_E8) // green #define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin)) #define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin)) // USB config #define MICROPY_HW_USB_FS (1) // #define MICROPY_HW_USB_OTG_ID_PIN (pin_C12) // This is not the official ID Pin which should be PA10
/* * Vega Strike * Copyright (C) 2001-2002 Daniel Horn * * http://vegastrike.sourceforge.net/ * * 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 SPRITE_H #define SPRITE_H #include "gfxlib.h" #include "quaternion.h" #include "audio/Types.h" #include "audio/Source.h" namespace VSFileSystem { class VSFile; }; class Texture; class VSSprite { float xcenter; float ycenter; float widtho2; float heighto2; float maxs, maxt; float rotation; Texture *surface; bool isAnimation; //For private use only VSSprite() : surface( 0 ) {} public: //Construct a sprite out of a spritefile VSSprite( const char *file, enum FILTER texturefilter = BILINEAR, GFXBOOL force = GFXFALSE ); //Construct a sprite out of a preloaded texture //@Note will take ownership of 'surface' VSSprite( Texture *surface, float xcenter, float ycenter, float width, float height, float s = 0.f, float t = 0.f, bool isAnimation = false ); VSSprite( const VSSprite &source ); ~VSSprite(); //Return true if sprite was loaded successfully bool LoadSuccess() const; void Draw(); /** * Draw at specified coordinates given by 4 endpoints. * * @param ll lower-left corner * @param lr lower-right corner * @param ur upper-right corner * @param ul upper-left corner * @note Disregards sprite position but not maxs/maxt coordinates. */ void DrawHere( Vector &ll, Vector &lr, Vector &ur, Vector &ul ); //Add specified rotation to an already-rotated sprite void Rotate( const float &rad ) { rotation += rad; } void SetRotation( const float &rot ); void GetRotation( float &rot ); //Loads the sprite's texture from the given file //@deprecated Unused? void ReadTexture( VSFileSystem::VSFile *f ); void GetST( float &s, float &t ); void SetST( const float s, const float t ); void SetTime( double newtime ); void SetPosition( const float &x1, const float &y1 ); void GetPosition( float &x1, float &y1 ); void SetSize( float s1, float s2 ); void GetSize( float &x1, float &y1 ); void SetTimeSource( SharedPtr<Audio::Source> source ); void ClearTimeSource(); bool Done() const; void Reset(); SharedPtr<Audio::Source> GetTimeSource() const; //float &Rotation(){return rotation;}; Texture * getTexture() { return surface; } const Texture * getTexture() const { return surface; } }; #endif
#ifndef UTIL_H #define UTIL_H namespace util { int match(const char *argument, const char *option, const char **value); char *strdup(const char *str); } #endif
/* * rwlock6.c * * * -------------------------------------------------------------------------- * * Pthreads-embedded (PTE) - POSIX Threads Library for embedded systems * Copyright(C) 2008 Jason Schmidlapp * * Contact Email: jschmidlapp@users.sourceforge.net * * * Based upon Pthreads-win32 - POSIX Threads Library for Win32 * Copyright(C) 1998 John E. Bossom * Copyright(C) 1999,2005 Pthreads-win32 contributors * * Contact Email: rpj@callisto.canberra.edu.au * * The original list of contributors to the Pthreads-win32 project * is contained in the file CONTRIBUTORS.ptw32 included with the * source code distribution. The list can also be seen at the * following World Wide Web location: * http://sources.redhat.com/pthreads-win32/contributors.html * * 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 in the file COPYING.LIB; * if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * -------------------------------------------------------------------------- * * Check writer and reader locking * * Depends on API functions: * pthread_rwlock_rdlock() * pthread_rwlock_wrlock() * pthread_rwlock_unlock() */ #include "test.h" static pthread_rwlock_t rwlock1 = PTHREAD_RWLOCK_INITIALIZER; static int bankAccount = 0; static void * wrfunc(void * arg) { int ba; assert(pthread_rwlock_wrlock(&rwlock1) == 0); pte_osThreadSleep(2000); bankAccount += 10; ba = bankAccount; assert(pthread_rwlock_unlock(&rwlock1) == 0); return ((void *) ba); } static void * rdfunc(void * arg) { int ba; assert(pthread_rwlock_rdlock(&rwlock1) == 0); ba = bankAccount; assert(pthread_rwlock_unlock(&rwlock1) == 0); return ((void *) ba); } int pthread_test_rwlock6() { pthread_t wrt1; pthread_t wrt2; pthread_t rdt; int wr1Result = 0; int wr2Result = 0; int rdResult = 0; rwlock1 = PTHREAD_RWLOCK_INITIALIZER; bankAccount = 0; assert(pthread_create(&wrt1, NULL, wrfunc, NULL) == 0); pte_osThreadSleep(500); assert(pthread_create(&rdt, NULL, rdfunc, NULL) == 0); pte_osThreadSleep(500); assert(pthread_create(&wrt2, NULL, wrfunc, NULL) == 0); assert(pthread_join(wrt1, (void **) &wr1Result) == 0); assert(pthread_join(rdt, (void **) &rdResult) == 0); assert(pthread_join(wrt2, (void **) &wr2Result) == 0); assert(wr1Result == 10); assert(rdResult == 10); assert(wr2Result == 20); assert(pthread_rwlock_destroy(&rwlock1) == 0); return 0; }
// // SMNotificationMessage.h // SessionM // // Copyright © 2016 SessionM. All rights reserved. // #ifndef __SM_NOTIFICATION_MESSAGE__ #define __SM_NOTIFICATION_MESSAGE__ #import "SMMessage.h" NS_ASSUME_NONNULL_BEGIN /*! @class SMNotificationMessage @abstract Defines the data associated with a push notification or behavior notification message. @discussion Note: the developer can configure the following properties for each message through the SessionM Mobile Marketing Cloud portal. The @link //apple_ref/occ/cl/SMDefaultMessageView @/link class is provided for presenting notification messages (note: notification messages cannot be presented inside an activity feed). */ @interface SMNotificationMessage : SMMessage @end NS_ASSUME_NONNULL_END #endif /* __SM_NOTIFICATION_MESSAGE__ */
// Copyright (c) 2011-2016 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. #ifndef STORAGE_LEVELDB_UTIL_RANDOM_H_ #define STORAGE_LEVELDB_UTIL_RANDOM_H_ #include <stdint.h> namespace leveldb { // A very simple random number generator. Not especially good at // generating truly random bits, but good enough for our needs in this // package. class Random { private: uint32_t seed_; public: explicit Random(uint32_t s) : seed_(s & 0x7fffffffu) { // Avoid bad seeds. if (seed_ == 0 || seed_ == 2147483647L) { seed_ = 1; } } uint32_t Next() { static const uint32_t M = 2147483647L; // 2^31-1 static const uint64_t A = 16807; // bits 14, 8, 7, 5, 2, 1, 0 // We are computing // seed_ = (seed_ * A) % M, where M = 2^31-1 // // seed_ must not be zero or M, or else all subsequent computed values // will be zero or M respectively. For all other values, seed_ will end // up cycling through every number in [1,M-1] uint64_t product = seed_ * A; // Compute (product % M) using the fact that ((x << 31) % M) == x. seed_ = static_cast<uint32_t>((product >> 31) + (product & M)); // The first reduction may overflow by 1 bit, so we may need to // repeat. mod == M is not possible; using > allows the faster // sign-bit-based test. if (seed_ > M) { seed_ -= M; } return seed_; } // Returns a uniformly distributed value in the range [0..n-1] // REQUIRES: n > 0 uint32_t Uniform(int n) { return Next() % n; } // Randomly returns true ~"1/n" of the time, and false otherwise. // REQUIRES: n > 0 bool OneIn(int n) { return (Next() % n) == 0; } // Skewed: pick "base" uniformly from range [0,max_log] and then // return "base" random bits. The effect is to pick a number in the // range [0,2^max_log-1] with exponential bias towards smaller numbers. uint32_t Skewed(int max_log) { return Uniform(1 << Uniform(max_log + 1)); } }; } // namespace leveldb #endif // STORAGE_LEVELDB_UTIL_RANDOM_H_
// // Copyright (c) 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // @import Foundation; NS_ASSUME_NONNULL_BEGIN /** @var FUIAuthErrorDomain @brief The standard Firebase error domain. */ extern NSString *const FUIAuthErrorDomain; /** @bar FUIAuthErrorUserInfoProviderIDKey @brief The ID of the identity provider. */ extern NSString *const FUIAuthErrorUserInfoProviderIDKey; /** @var FUIAuthErrorCode @brief Error codes used by FUIAuth. */ typedef NS_ENUM(NSUInteger, FUIAuthErrorCode) { /** @var FUIAuthErrorCodeUserCancelledSignIn @brief Indicates the user cancelled a sign-in flow. */ FUIAuthErrorCodeUserCancelledSignIn = 1, /** @var FUIAuthErrorCodeProviderError @brief Indicates there's an error from the identity provider. The @c FUIAuthErrorUserInfoProviderIDKey field in the @c NError.userInfo dictionary will contain the ID of the identity provider. */ FUIAuthErrorCodeProviderError = 2, /** @var FUIAuthErrorCodeCantFindProvider @brief Indicates that @FUIAuth.providers doen't contain current provider (see NSError.userInfo key @c FUIAuthErrorUserInfoProviderIDKey). */ FUIAuthErrorCodeCantFindProvider = 3, }; NS_ASSUME_NONNULL_END
/* * Copyright (c) 2008, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Google, Inc. nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __DEV_GPIO_KEYPAD_H #define __DEV_GPIO_KEYPAD_H #include <sys/types.h> /* unset: drive active output low, set: drive active output high */ #define GPIOKPF_ACTIVE_HIGH (1U << 0) #define GPIOKPF_DRIVE_INACTIVE (1U << 1) struct gpio_keypad_info { /* size must be ninputs * noutputs */ const uint16_t *keymap; unsigned *input_gpios; unsigned *output_gpios; int ninputs; int noutputs; /* time to wait before reading inputs after driving each output */ time_t settle_time; time_t poll_time; unsigned flags; }; void gpio_keypad_init(struct gpio_keypad_info *kpinfo); #endif /* __DEV_GPIO_KEYPAD_H */
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2015 Google Inc. http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef HEIGHTFIELD_EXAMPLE_H #define HEIGHTFIELD_EXAMPLE_H class CommonExampleInterface* HeightfieldExampleCreateFunc(struct CommonExampleOptions& options); #endif //HEIGHTFIELD_EXAMPLE_H
// // FacebookConnectPlugin.h // GapFacebookConnect // // Created by Jesse MacFadyen on 11-04-22. // Copyright 2011 Nitobi. All rights reserved. // #import <Foundation/Foundation.h> #import "FBConnect.h" #ifdef PHONEGAP_FRAMEWORK #import <PhoneGap/PGPlugin.h> #import <PhoneGap/PluginResult.h> #else #import "PGPlugin.h" #import "PluginResult.h" #endif @interface FacebookConnectPlugin : PGPlugin < FBSessionDelegate, FBRequestDelegate, FBDialogDelegate > { } @property (nonatomic, retain) Facebook *facebook; @property (nonatomic, copy) NSString* loginCallbackId; - (NSDictionary*) responseObject; @end
// Copyright (C) 2012 GlavSoft LLC. // All rights reserved. // //------------------------------------------------------------------------- // This file is part of the TightVNC software. Please visit our Web site: // // http://www.tightvnc.com/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. //------------------------------------------------------------------------- // #ifndef _PSEUDO_DECODER_H_ #define _PSEUDO_DECODER_H_ #include "Decoder.h" class PseudoDecoder : public Decoder { public: PseudoDecoder(LogWriter *logWriter); virtual ~PseudoDecoder(); virtual bool isPseudo() const; }; #endif
/* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef MDSS_MS01_PANEL_H #define MDSS_MS01_PANEL_H #include "mdss_panel.h" #include "smart_mtp_ea8868.h" #include "smart_dimming.h" #define MAX_BRIGHTNESS_LEVEL 255 #define MID_BRIGHTNESS_LEVEL 143 #define LOW_BRIGHTNESS_LEVEL 20 #define DIM_BRIGHTNESS_LEVEL 30 #define BL_MIN_BRIGHTNESS 6 #define BL_MAX_BRIGHTNESS_LEVEL 192 #define BL_MID_BRIGHTNESS_LEVEL 94 #define BL_LOW_BRIGHTNESS_LEVEL 7 #define BL_DIM_BRIGHTNESS_LEVEL 13 #define BL_DEFAULT_BRIGHTNESS BL_MID_BRIGHTNESS_LEVEL #define USE_ACL #define USE_ELVSS enum mipi_samsung_cmd_list { PANEL_READY_TO_ON_FAST, PANEL_READY_TO_ON, PANEL_READY_TO_OFF, PANEL_ON, PANEL_OFF, PANEL_LATE_ON, PANEL_EARLY_OFF, PANEL_GAMMA_UPDATE, PANEL_ELVSS_UPDATE, PANEL_ACL_ON, PANEL_ACL_OFF, PANEL_ACL_UPDATE, MTP_READ_ENABLE, PANEL_BRIGHT_CTRL, }; enum { MIPI_RESUME_STATE, MIPI_SUSPEND_STATE, }; #define SmartDimming_CANDELA_UPPER_LIMIT (300) #define MTP_DATA_SIZE (24) #define MTP_DATA_SIZE_S6E63M0 (21) #define MTP_DATA_SIZE_EA8868 (21) #define ELVSS_DATA_SIZE (24) #define MTP_REGISTER (0xD3) #define ELVSS_REGISTER (0xD4) #define SmartDimming_GammaUpdate_Pos (1) struct display_status{ unsigned char auto_brightness; int bright_level; int siop_status; unsigned char acl_on; unsigned char gamma_mode; /* 1: 1.9 gamma, 0: 2.2 gamma */ unsigned char is_smart_dim_loaded; unsigned char is_elvss_loaded; }; struct mdss_samsung_driver_data{ struct dsi_buf samsung_tx_buf; struct msm_fb_data_type *mfd; struct dsi_buf samsung_rx_buf; struct mdss_panel_common_pdata *mdss_samsung_disp_pdata; struct mdss_panel_data *mpd; struct mutex lock; int bl_level; #if defined(CONFIG_LCD_CLASS_DEVICE) struct platform_device *msm_pdev; #endif #if defined(CONFIG_HAS_EARLYSUSPEND) struct early_suspend early_suspend; #endif struct display_status dstat; }; struct dsi_cmd_desc_LCD { int lux; char strID[8]; struct dsi_cmd_desc *cmd; }; enum { GAMMA_20CD, GAMMA_30CD, GAMMA_40CD, GAMMA_50CD, GAMMA_60CD, GAMMA_70CD, GAMMA_80CD, GAMMA_90CD, GAMMA_100CD, GAMMA_110CD, GAMMA_120CD, GAMMA_130CD, GAMMA_140CD, GAMMA_150CD, GAMMA_160CD, GAMMA_170CD, GAMMA_180CD, GAMMA_190CD, GAMMA_200CD, GAMMA_210CD, GAMMA_220CD, GAMMA_230CD, GAMMA_240CD, GAMMA_250CD, GAMMA_260CD, GAMMA_270CD, GAMMA_280CD, GAMMA_290CD, GAMMA_300CD, }; enum gamma_mode_list { GAMMA_2_2 = 0, GAMMA_1_9 = 1, GAMMA_SMART = 2, }; void mdnie_lite_tuning_init(struct mdss_samsung_driver_data* msd); void mdss_dsi_cmds_send(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_cmd_desc *cmds, int cnt,int flag); #endif
/* * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef SVGPolyElement_h #define SVGPolyElement_h #if ENABLE(SVG) #include "SVGAnimatedBoolean.h" #include "SVGExternalResourcesRequired.h" #include "SVGGraphicsElement.h" #include "SVGNames.h" #include "SVGPointList.h" namespace WebCore { class SVGPolyElement : public SVGGraphicsElement , public SVGExternalResourcesRequired { public: RefPtr<SVGListPropertyTearOff<SVGPointList> > points(); RefPtr<SVGListPropertyTearOff<SVGPointList> > animatedPoints(); SVGPointList& pointList() const { return m_points.value; } static const SVGPropertyInfo* pointsPropertyInfo(); protected: SVGPolyElement(const QualifiedName&, Document*); private: virtual bool isValid() const { return SVGTests::isValid(); } virtual bool supportsFocus() const OVERRIDE { return true; } bool isSupportedAttribute(const QualifiedName&); virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; virtual void svgAttributeChanged(const QualifiedName&); virtual bool supportsMarkers() const { return true; } // Custom 'points' property static void synchronizePoints(SVGElement* contextElement); static PassRefPtr<SVGAnimatedProperty> lookupOrCreatePointsWrapper(SVGElement* contextElement); BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPolyElement) DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired) END_DECLARE_ANIMATED_PROPERTIES protected: mutable SVGSynchronizableAnimatedProperty<SVGPointList> m_points; }; inline SVGPolyElement* toSVGPolyElement(SVGElement* element) { ASSERT_WITH_SECURITY_IMPLICATION(!element || element->hasTagName(SVGNames::polygonTag) || element->hasTagName(SVGNames::polylineTag)); return static_cast<SVGPolyElement*>(element); } } // namespace WebCore #endif // ENABLE(SVG) #endif
/* Copyright 2009 Gary Briggs This file is part of obdgpslogger. obdgpslogger 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. obdgpslogger 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 obdgpslogger. If not, see <http://www.gnu.org/licenses/>. */ /** \file \brief Test the obdconfig stuffs */ #include <stdio.h> #include <stdlib.h> #include "obdconfigfile.h" int main() { struct OBDGPSConfig *c; if(NULL == (c = obd_loadConfig(1))) { printf("Error in loadConfig\n"); exit(1); } else { printf("Successfully loaded config\n"); } struct obdservicecmd **cmds; int cmds_found = obd_configCmds(c->log_columns, &cmds); printf("Found %i cmds:\n", cmds_found); int i; for(i=0;NULL != cmds[i];i++) { printf(" [%02X] %s\n", cmds[i]->cmdid, cmds[i]->human_name); } obd_freeConfigCmds(cmds); printf("Freed commands\n"); obd_freeConfig(c); printf("Freed config\n"); return 0; }
/* { dg-do run } */ /* { dg-options "-O2 -mavx512vl -DAVX512VL" } */ /* { dg-require-effective-target avx512vl } */ #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 #include "avx512f-vpunpckhqdq-2.c" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 #include "avx512f-vpunpckhqdq-2.c"
#ifndef _ASM_KPROBES_H #define _ASM_KPROBES_H /* * Kernel Probes (KProbes) * include/asm-x86_64/kprobes.h * * 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. * * Copyright (C) IBM Corporation, 2002, 2004 * * 2004-Oct Prasanna S Panchamukhi <prasanna@in.ibm.com> and Jim Keniston * kenistoj@us.ibm.com adopted from i386. */ #include <linux/types.h> #include <linux/ptrace.h> struct pt_regs; typedef u8 kprobe_opcode_t; #define BREAKPOINT_INSTRUCTION 0xcc #define MAX_INSN_SIZE 15 #define MAX_STACK_SIZE 64 #define MIN_STACK_SIZE(ADDR) (((MAX_STACK_SIZE) < \ (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) \ ? (MAX_STACK_SIZE) \ : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) /* Architecture specific copy of original instruction*/ struct arch_specific_insn { /* copy of the original instruction */ kprobe_opcode_t *insn; }; /* trap3/1 are intr gates for kprobes. So, restore the status of IF, * if necessary, before executing the original int3/1 (trap) handler. */ static inline void restore_interrupts(struct pt_regs *regs) { if (regs->eflags & IF_MASK) local_irq_enable(); } extern int post_kprobe_handler(struct pt_regs *regs); extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); extern int kprobe_handler(struct pt_regs *regs); extern int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *data); #endif /* _ASM_KPROBES_H */
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. Copyright 2014 Lennart Poettering systemd 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. systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #include <errno.h> #include <getopt.h> #include <stdbool.h> #include <stddef.h> #include "log.h" #include "macro.h" #include "string-util.h" #include "verbs.h" int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) { const Verb *verb; const char *name; unsigned i; int left; assert(verbs); assert(verbs[0].dispatch); assert(argc >= 0); assert(argv); assert(argc >= optind); left = argc - optind; name = argv[optind]; for (i = 0;; i++) { bool found; /* At the end of the list? */ if (!verbs[i].dispatch) { if (name) log_error("Unknown operation %s.", name); else log_error("Requires operation parameter."); return -EINVAL; } if (name) found = streq(name, verbs[i].verb); else found = !!(verbs[i].flags & VERB_DEFAULT); if (found) { verb = &verbs[i]; break; } } assert(verb); if (!name) left = 1; if (verb->min_args != VERB_ANY && (unsigned) left < verb->min_args) { log_error("Too few arguments."); return -EINVAL; } if (verb->max_args != VERB_ANY && (unsigned) left > verb->max_args) { log_error("Too many arguments."); return -EINVAL; } if (name) return verb->dispatch(left, argv + optind, userdata); else { char* fake[2] = { (char*) verb->verb, NULL }; return verb->dispatch(1, fake, userdata); } }
/* GemRB - Infinity Engine Emulator * Copyright (C) 2007 The GemRB Project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef IMAGEWRITER_H #define IMAGEWRITER_H #include "Plugin.h" #include "Sprite2D.h" #include "System/DataStream.h" class GEM_EXPORT ImageWriter : public Plugin { public: ImageWriter(void); ~ImageWriter(void); /** Writes an Sprite2D to a stream and frees the sprite. */ virtual void PutImage(DataStream *output, Sprite2D *sprite) = 0; }; #endif
/**************************************************************************** ** ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met: ** http://www.fsf.org/licensing/licenses/info/GPLv2.html and ** http://www.gnu.org/copyleft/gpl.html. In addition, as a special ** exception, Nokia gives you certain additional rights. These rights ** are described in the Nokia Qt GPL Exception version 1.3, included in ** the file GPL_EXCEPTION.txt in this package. ** ** Qt for Windows(R) Licensees ** As a special exception, Nokia, as the sole copyright holder for Qt ** Designer, grants users of the Qt/Eclipse Integration plug-in the ** right for the Qt/Eclipse Integration to link to functionality ** provided by Qt Designer and its related libraries. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of Qt Designer. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #ifndef OBJECTINSPECTORMODEL_H #define OBJECTINSPECTORMODEL_H #include <QtGui/QStandardItemModel> #include <QtGui/QIcon> #include <QtCore/QModelIndex> #include <QtCore/QString> #include <QtCore/QList> #include <QtCore/QMultiMap> #include <QtCore/QPointer> QT_BEGIN_NAMESPACE class QDesignerFormWindowInterface; namespace qdesigner_internal { struct ObjectData { typedef QList<QStandardItem *> StandardItemList; ObjectData(QObject *parent = 0, QObject *object = 0); bool equals(const ObjectData & me) const; bool operator==(const ObjectData &e2) const { return equals(e2); } bool operator!=(const ObjectData &e2) const { return !equals(e2); } enum ChangedMask { ClassNameChanged = 1, ObjectNameChanged = 2, IconChanged = 4 }; unsigned compare(const ObjectData & me) const; void setItems(const StandardItemList &row) const; void setItemsDisplayData(const StandardItemList &row, unsigned mask) const; QObject *m_parent; QObject *m_object; QString m_className; QString m_objectName; QIcon m_icon; }; typedef QList<ObjectData> ObjectModel; // QStandardItemModel for ObjectInspector. Uses ObjectData/ObjectModel // internally for its updates. class ObjectInspectorModel : public QStandardItemModel { public: typedef QList<QStandardItem *> StandardItemList; enum { ObjectNameColumn, ClassNameColumn, NumColumns }; explicit ObjectInspectorModel(QObject *parent); enum UpdateResult { NoForm, Rebuilt, Updated }; UpdateResult update(QDesignerFormWindowInterface *fw); const QModelIndexList indexesOf(QObject *o) const { return m_objectIndexMultiMap.values(o); } QObject *objectAt(const QModelIndex &index) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); private: void rebuild(const ObjectModel &newModel); void updateItemContents(ObjectModel &oldModel, const ObjectModel &newModel); void clearItems(); StandardItemList rowAt(QModelIndex index) const; typedef QMultiMap<QObject *,QModelIndex> ObjectIndexMultiMap; ObjectIndexMultiMap m_objectIndexMultiMap; ObjectModel m_model; QPointer<QDesignerFormWindowInterface> m_formWindow; }; } // namespace qdesigner_internal #endif // OBJECTINSPECTORMODEL_H QT_END_NAMESPACE
/* Generated by convert_api.py on Thu May 13 17:59:41 2010 */ #ifndef __PYX_HAVE_API___hermes_common #define __PYX_HAVE_API___hermes_common // To avoid compilation warnings: #undef _XOPEN_SOURCE #undef _POSIX_C_SOURCE #include "Python.h" #include <complex> typedef ::std::complex<double> __pyx_t_double_complex; extern PyObject *(*c2numpy_int)(int *, int); extern PyObject *(*c2numpy_double)(double *, int); extern PyObject *(*c2py_CooMatrix)(struct CooMatrix *); extern PyObject *(*c2py_CSRMatrix)(struct CSRMatrix *); extern PyObject *(*c2py_CSCMatrix)(struct CSCMatrix *); extern PyObject *(*namespace_create)(void); extern void (*namespace_push)(PyObject *, const char*, PyObject *); extern void (*namespace_print)(PyObject *); extern PyObject *(*namespace_pull)(PyObject *, const char*); extern void (*cmd)(const char*); extern void (*set_verbose_cmd)(int); extern void (*insert_object)(const char*, PyObject *); extern PyObject *(*get_object)(const char*); extern PyObject *(*c2py_int)(int); extern int (*py2c_int)(PyObject *); extern char *(*py2c_str)(PyObject *); extern double (*py2c_double)(PyObject *); extern PyObject *(*c2numpy_int_inplace)(int *, int); extern PyObject *(*c2numpy_double_inplace)(double *, int); extern PyObject *(*c2numpy_double_complex_inplace)(__pyx_t_double_complex *, int); extern void (*numpy2c_int_inplace)(PyObject *, int **, int *); extern void (*numpy2c_double_inplace)(PyObject *, double **, int *); extern void (*numpy2c_double_complex_inplace)(PyObject *, __pyx_t_double_complex **, int *); extern void (*run_cmd)(const char*, PyObject *); extern int import__hermes_common(void); #endif
/* * ReactOS kernel * Copyright (C) 2003 ReactOS Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * PURPOSE: Log file functions * FILE: lib/syssetup/logfile.c * PROGRAMER: Eric Kohl */ /* INCLUDES *****************************************************************/ #include "precomp.h" /* GLOBALS ******************************************************************/ HANDLE hLogFile = NULL; /* FUNCTIONS ****************************************************************/ BOOL WINAPI InitializeSetupActionLog (BOOL bDeleteOldLogFile) { WCHAR szFileName[MAX_PATH]; GetWindowsDirectoryW(szFileName, MAX_PATH); if (szFileName[wcslen(szFileName)] != L'\\') { wcsncat(szFileName, L"\\", (sizeof(szFileName) / sizeof(szFileName[0])) - wcslen(szFileName)); } wcsncat(szFileName, L"setuplog.txt", (sizeof(szFileName) / sizeof(szFileName[0])) - wcslen(szFileName)); if (bDeleteOldLogFile) { SetFileAttributesW(szFileName, FILE_ATTRIBUTE_NORMAL); DeleteFileW(szFileName); } hLogFile = CreateFileW(szFileName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hLogFile == INVALID_HANDLE_VALUE) { hLogFile = NULL; return FALSE; } return TRUE; } VOID WINAPI TerminateSetupActionLog(VOID) { if (hLogFile != NULL) { CloseHandle (hLogFile); hLogFile = NULL; } } BOOL WINAPI SYSSETUP_LogItem(IN const LPSTR lpFileName, IN DWORD dwLineNumber, IN DWORD dwSeverity, IN LPWSTR lpMessageText) { LPCSTR lpSeverityString; LPSTR lpMessageString; DWORD dwMessageLength; DWORD dwMessageSize; DWORD dwWritten; CHAR Buffer[6]; CHAR TimeBuffer[30]; SYSTEMTIME stTime; /* Get the severity code string */ switch (dwSeverity) { case SYSSETUP_SEVERITY_INFORMATION: lpSeverityString = "Information : "; break; case SYSSETUP_SEVERITY_WARNING: lpSeverityString = "Warning : "; break; case SYSSETUP_SEVERITY_ERROR: lpSeverityString = "Error : "; break; case SYSSETUP_SEVERITY_FATAL_ERROR: lpSeverityString = "Fatal error : "; break; default: lpSeverityString = "Unknown : "; break; } /* Get length of the converted ansi string */ dwMessageLength = wcslen(lpMessageText) * sizeof(WCHAR); RtlUnicodeToMultiByteSize(&dwMessageSize, lpMessageText, dwMessageLength); /* Allocate message string buffer */ lpMessageString = (LPSTR) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwMessageSize); if (!lpMessageString) return FALSE; /* Convert unicode to ansi */ RtlUnicodeToMultiByteN(lpMessageString, dwMessageSize, NULL, lpMessageText, dwMessageLength); /* Set file pointer to the end of the file */ SetFilePointer(hLogFile, 0, NULL, FILE_END); /* Write Time/Date */ GetLocalTime(&stTime); snprintf(TimeBuffer, sizeof(TimeBuffer), "%02d/%02d/%02d %02d:%02d:%02d.%03d", stTime.wMonth, stTime.wDay, stTime.wYear, stTime.wHour, stTime.wMinute, stTime.wSecond, stTime.wMilliseconds); WriteFile(hLogFile, TimeBuffer, strlen(TimeBuffer), &dwWritten, NULL); /* Write comma */ WriteFile(hLogFile, ",", 1, &dwWritten, NULL); /* Write file name */ WriteFile(hLogFile, lpFileName, strlen(lpFileName), &dwWritten, NULL); /* Write comma */ WriteFile(hLogFile, ",", 1, &dwWritten, NULL); /* Write line number */ snprintf(Buffer, sizeof(Buffer), "%lu", dwLineNumber); WriteFile(hLogFile, Buffer, strlen(Buffer), &dwWritten, NULL); /* Write comma */ WriteFile(hLogFile, ",", 1, &dwWritten, NULL); /* Write severity code */ WriteFile(hLogFile, lpSeverityString, strlen(lpSeverityString), &dwWritten, NULL); /* Write message string */ WriteFile(hLogFile, lpMessageString, dwMessageSize, &dwWritten, NULL); /* Write newline */ WriteFile(hLogFile, "\r\n", 2, &dwWritten, NULL); HeapFree(GetProcessHeap(), 0, lpMessageString); return TRUE; } /* EOF */
/**************************************************************************************** * Copyright (c) 2010 Rainer Sigle <rainer.sigle@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, see <http://www.gnu.org/licenses/>. * ****************************************************************************************/ #ifndef AMAROK_TABS_ENGINE #define AMAROK_TABS_ENGINE #include "TabsInfo.h" #include "context/DataEngine.h" #include "core/meta/forward_declarations.h" #include "NetworkAccessManagerProxy.h" #include <QVariant> class KJob; using namespace Context; /** * This engine provides tab-data for the current song */ class TabsEngine : public DataEngine { Q_OBJECT Q_PROPERTY( QString artistName READ artistName WRITE setArtistName ) Q_PROPERTY( QString titleName READ titleName WRITE setTitleName ) Q_PROPERTY( bool fetchGuitarTabs READ fetchGuitar WRITE setFetchGuitar ) Q_PROPERTY( bool fetchBassTabs READ fetchBass WRITE setFetchBass ) public: TabsEngine( QObject* parent, const QList<QVariant>& args ); virtual ~TabsEngine(); QString artistName() const; void setArtistName( const QString &artistName ); QString titleName() const; void setTitleName( const QString &titleName ); bool fetchGuitar() const; void setFetchGuitar( const bool fetch ); bool fetchBass() const; void setFetchBass( const bool fetch ); QStringList sources() const; protected: bool sourceRequestEvent( const QString &name ); private slots: /** * handling of tab data search results from ultimateguitar.com */ void resultUltimateGuitarSearch( const KUrl &url, QByteArray data, NetworkAccessManagerProxy::Error e ); void resultUltimateGuitarTab( const KUrl &url, QByteArray data, NetworkAccessManagerProxy::Error e ); /** * This method will send the info to the applet and order them if every jobs are finished */ void resultFinalize(); /** * Prepare the calling of the requestTab method. * Launched when the track played on amarok has changed. */ void update(); private: /** * starts a new tab-search */ void requestTab( const QString &artist, const QString &title ); /** * starts a tab search at ultimateguitar.com */ void queryUltimateGuitar( const QString &artist, const QString &title ); /** * The currently playing track */ Meta::TrackPtr m_currentTrack; /** * Data strucuture which contains all tab-information for * the current song. After fetching this data will be send to the applet */ QList < TabsInfo * > m_tabs; /** * Set containing urls of active jobs */ QSet < const KUrl > m_urls; /** * Holds artist and title name of the current track */ QString m_titleName; QString m_artistName; /** * Controls whether guitar-tabs will be fetched */ bool m_fetchGuitar; /** * Controls whether bass-tabs will be fetched */ bool m_fetchBass; /** * Helper function which returns the intermediate string between two strings */ QString subStringBetween( const QString &src, const QString &from, const QString &to, bool lastIndexForFrom = false ); /** * returns a list of possible search criteria for the current artist */ QStringList defineArtistSearchCriteria( const QString &artist ); /** * returns a list of possible search criteria for the current title */ QStringList defineTitleSearchCriteria( const QString &title ); /** * checks if a tab-fetch job aborted with an error * returns true in case of error, false otherwise */ bool netReplyError( NetworkAccessManagerProxy::Error e ); int m_numAbortedUrls; }; Q_DECLARE_METATYPE ( TabsInfo * ) AMAROK_EXPORT_DATAENGINE( tabs, TabsEngine ) #endif
/* * Copyright (C) 2006 Apple Computer, 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE 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 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 SubresourceLoaderClient_h #define SubresourceLoaderClient_h namespace WebCore { class AuthenticationChallenge; class ResourceError; class ResourceRequest; class ResourceResponse; class SubresourceLoader; class SubresourceLoaderClient { public: virtual ~SubresourceLoaderClient() { } // request may be modified virtual void willSendRequest(SubresourceLoader*, ResourceRequest&, const ResourceResponse& redirectResponse) { } virtual void didReceiveResponse(SubresourceLoader*, const ResourceResponse&) { } virtual void didReceiveData(SubresourceLoader*, const char*, int) { } virtual void didFinishLoading(SubresourceLoader*) { } virtual void didFail(SubresourceLoader*, const ResourceError&) { } virtual void receivedCancellation(SubresourceLoader*, const AuthenticationChallenge&) { } }; } #endif
/* * music_event_out_proxy.h * * This file is part of NEST. * * Copyright (C) 2004 The NEST Initiative * * NEST 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. * * NEST 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 NEST. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef MUSIC_EVENT_OUT_PROXY_H #define MUSIC_EVENT_OUT_PROXY_H #include "config.h" #ifdef HAVE_MUSIC #include <vector> #include "nest.h" #include "event.h" #include "node.h" #include "exceptions.h" #include "music.hh" /* BeginDocumentation Name: music_event_out_proxy - Device to forward spikes to remote applications using MUSIC. Description: A music_event_out_proxy is used to send spikes to a remote application that also uses MUSIC. The music_event_out_proxy represents a complete MUSIC event output port. The channel on the port to which a source node forwards its events is determined during connection setup by using the parameter music_channel of the connection. The name of the port is set via SetStatus (see Parameters section below). Parameters: The following properties are available in the status dictionary: port_name - The name of the MUSIC output_port to forward events to (default: event_out) port_width - The width of the MUSIC input port published - A bool indicating if the port has been already published with MUSIC The parameter port_name can be set using SetStatus. Examples: /iaf_neuron Create /n Set /music_event_out_proxy Create /meop Set n meop << /music_channel 2 >> Connect Author: Moritz Helias, Jochen Martin Eppler FirstVersion: March 2009 Availability: Only when compiled with MUSIC SeeAlso: music_event_in_proxy, music_cont_in_proxy, music_message_in_proxy */ namespace nest { class music_event_out_proxy : public Node { public: music_event_out_proxy(); music_event_out_proxy(const music_event_out_proxy&); ~music_event_out_proxy(); bool has_proxies() const { return false; } bool local_receiver() const {return true;} bool one_node_per_process() const {return true;} /** * Import sets of overloaded virtual functions. * @see Technical Issues / Virtual Functions: Overriding, Overloading, and Hiding */ using Node::handle; using Node::handles_test_event; void handle(SpikeEvent &); port handles_test_event(SpikeEvent &, rport); void get_status(DictionaryDatum &) const; void set_status(const DictionaryDatum &) ; private: void init_state_(Node const&); void init_buffers_(); void calibrate(); void update(Time const &, const long_t, const long_t) {} // ------------------------------------------------------------ struct State_; struct Parameters_ { std::string port_name_; //!< the name of MUSIC port to connect to Parameters_(); //!< Sets default parameter values Parameters_(const Parameters_&); //!< Recalibrate all times void get(DictionaryDatum&) const; //!< Store current values in dictionary void set(const DictionaryDatum&, State_&); //!< Set values from dicitonary }; // ------------------------------------------------------------ struct State_ { bool published_; //!< indicates whether this node has been published already with MUSIC int port_width_; //!< the width of the MUSIC port State_(); //!< Sets default state value void get(DictionaryDatum&) const; //!< Store current values in dictionary void set(const DictionaryDatum&, const Parameters_&); //!< Set values from dicitonary }; // ------------------------------------------------------------ struct Variables_ { MUSIC::EventOutputPort *MP_; //!< The MUSIC event port for output of spikes std::vector<MUSIC::GlobalIndex> index_map_; MUSIC::PermutationIndex *music_perm_ind_; //!< The permutation index needed to map the ports of MUSIC. }; // ------------------------------------------------------------ Parameters_ P_; State_ S_; Variables_ V_; }; inline port music_event_out_proxy::handles_test_event(SpikeEvent&, rport receptor_type) { // receptor_type i is mapped to channel i of the MUSIC port so we // have to generate the index map here, that assigns the channel // number to the local index of this connection the local index // equals the number of connection if (!S_.published_) V_.index_map_.push_back(static_cast<int>(receptor_type)); else throw MUSICPortAlreadyPublished(get_name(), P_.port_name_); return receptor_type; } } // namespace #endif /* #ifndef MUSIC_EVENT_OUT_PROXY_H */ #endif
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS // clang-format off PairStyle(born/coul/wolf/omp,PairBornCoulWolfOMP); // clang-format on #else #ifndef LMP_PAIR_BORN_COUL_WOLF_OMP_H #define LMP_PAIR_BORN_COUL_WOLF_OMP_H #include "pair_born_coul_wolf.h" #include "thr_omp.h" namespace LAMMPS_NS { class PairBornCoulWolfOMP : public PairBornCoulWolf, public ThrOMP { public: PairBornCoulWolfOMP(class LAMMPS *); void compute(int, int) override; double memory_usage() override; private: template <int EVFLAG, int EFLAG, int NEWTON_PAIR> void eval(int ifrom, int ito, ThrData *const thr); }; } // namespace LAMMPS_NS #endif #endif
/** * Marlin 3D Printer Firmware * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * */ #pragma once #ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif #define WIFI_AP_TEXT "AP" #define WIFI_STA_TEXT "STA" extern void lv_draw_wifi_settings(void); extern void lv_clear_wifi_settings(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif
/* * Asterisk -- An open source telephony toolkit. * * Copyright (C) 1999 - 2005, Digium, Inc. * * Mark Spencer <markster@digium.com> * * See http://www.asterisk.org for more information about * the Asterisk project. Please do not directly contact * any of the maintainers of this project for assistance; * the project provides a web site, mailing lists and IRC * channels for your use. * * This program is free software, distributed under the terms of * the GNU General Public License Version 2. See the LICENSE file * at the top of the source tree. */ /*! \file * * \brief Digital Milliwatt Test * * \author Mark Spencer <markster@digium.com> * * \ingroup applications */ /*** MODULEINFO <support_level>core</support_level> ***/ #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361142 $") #include "asterisk/module.h" #include "asterisk/channel.h" #include "asterisk/pbx.h" #include "asterisk/indications.h" /*** DOCUMENTATION <application name="Milliwatt" language="en_US"> <synopsis> Generate a Constant 1004Hz tone at 0dbm (mu-law). </synopsis> <syntax> <parameter name="options"> <optionlist> <option name="o"> <para>Generate the tone at 1000Hz like previous version.</para> </option> </optionlist> </parameter> </syntax> <description> <para>Previous versions of this application generated the tone at 1000Hz. If for some reason you would prefer that behavior, supply the <literal>o</literal> option to get the old behavior.</para> </description> </application> ***/ static const char app[] = "Milliwatt"; static const char digital_milliwatt[] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} ; static void *milliwatt_alloc(struct ast_channel *chan, void *params) { return ast_calloc(1, sizeof(int)); } static void milliwatt_release(struct ast_channel *chan, void *data) { ast_free(data); return; } static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int samples) { unsigned char buf[AST_FRIENDLY_OFFSET + 640]; const int maxsamples = ARRAY_LEN(buf) - (AST_FRIENDLY_OFFSET / sizeof(buf[0])); int i, *indexp = (int *) data; struct ast_frame wf = { .frametype = AST_FRAME_VOICE, .subclass.codec = AST_FORMAT_ULAW, .offset = AST_FRIENDLY_OFFSET, .src = __FUNCTION__, }; wf.data.ptr = buf + AST_FRIENDLY_OFFSET; /* Instead of len, use samples, because channel.c generator_force * generate(chan, tmp, 0, 160) ignores len. In any case, len is * a multiple of samples, given by number of samples times bytes per * sample. In the case of ulaw, len = samples. for signed linear * len = 2 * samples */ if (samples > maxsamples) { ast_log(LOG_WARNING, "Only doing %d samples (%d requested)\n", maxsamples, samples); samples = maxsamples; } len = samples * sizeof (buf[0]); wf.datalen = len; wf.samples = samples; /* create a buffer containing the digital milliwatt pattern */ for (i = 0; i < len; i++) { buf[AST_FRIENDLY_OFFSET + i] = digital_milliwatt[(*indexp)++]; *indexp &= 7; } if (ast_write(chan,&wf) < 0) { ast_log(LOG_WARNING,"Failed to write frame to '%s': %s\n",chan->name,strerror(errno)); return -1; } return 0; } static struct ast_generator milliwattgen = { .alloc = milliwatt_alloc, .release = milliwatt_release, .generate = milliwatt_generate, }; static int old_milliwatt_exec(struct ast_channel *chan) { ast_set_write_format(chan, AST_FORMAT_ULAW); ast_set_read_format(chan, AST_FORMAT_ULAW); if (chan->_state != AST_STATE_UP) { ast_answer(chan); } if (ast_activate_generator(chan,&milliwattgen,"milliwatt") < 0) { ast_log(LOG_WARNING,"Failed to activate generator on '%s'\n",chan->name); return -1; } while (!ast_safe_sleep(chan, 10000)) ; ast_deactivate_generator(chan); return -1; } static int milliwatt_exec(struct ast_channel *chan, const char *data) { const char *options = data; int res = -1; if (!ast_strlen_zero(options) && strchr(options, 'o')) { return old_milliwatt_exec(chan); } res = ast_playtones_start(chan, 23255, "1004/1000", 0); while (!res) { res = ast_safe_sleep(chan, 10000); } return res; } static int unload_module(void) { return ast_unregister_application(app); } static int load_module(void) { return ast_register_application_xml(app, milliwatt_exec); } AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Digital Milliwatt (mu-law) Test Application");
/** @file * VBox Qt GUI - UINetworkCustomer class declaration. */ /* * Copyright (C) 2012 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ #ifndef __UINetworkCustomer_h__ #define __UINetworkCustomer_h__ /* Global includes: */ #include <QObject> /* Local includes: */ #include "UINetworkDefs.h" /* Forward declarations: */ class UINetworkReply; class QNetworkRequest; /* Interface to access UINetworkManager protected functionality: */ class UINetworkCustomer : public QObject { Q_OBJECT; public: /* Constructors: */ UINetworkCustomer(); UINetworkCustomer(QObject *pParent, bool fForceCall); /* Getters: */ bool isItForceCall() const { return m_fForceCall; } /* Network-reply progress handler: */ virtual void processNetworkReplyProgress(qint64 iReceived, qint64 iTotal) = 0; /* Network-reply cancel handler: */ virtual void processNetworkReplyCanceled(UINetworkReply *pReply) = 0; /* Network-reply finish handler: */ virtual void processNetworkReplyFinished(UINetworkReply *pReply) = 0; protected: /* Network-request wrapper: */ void createNetworkRequest(const QNetworkRequest &request, UINetworkRequestType type, const QString &strDescription); /* Network-request wrapper (set): */ void createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type, const QString &strDescription); private: /* Variables: */ bool m_fForceCall; }; #endif // __UINetworkCustomer_h__
/* This file is part of the KDE project Copyright (C) 2012 Paul Mendez <paulestebanms@gmail.com> 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 KPRANIMATIONSELECTORWIDGET_H #define KPRANIMATIONSELECTORWIDGET_H #include <QWidget> class QModelIndex; class QListWidget; class QListView; class KPrShapeAnimation; class QListWidgetItem; class KPrShapeAnimationDocker; class KPrPredefinedAnimationsLoader; class QToolButton; class KoViewItemContextBar; class QCheckBox; /** Widget used to select predefined animations. Holds three views: categories, animations and subtypes (optional). This widget is used to add a new animation or change the type of an existing animation */ class KPrAnimationSelectorWidget : public QWidget { Q_OBJECT public: explicit KPrAnimationSelectorWidget(KPrShapeAnimationDocker *docker, KPrPredefinedAnimationsLoader *animationsData, QWidget *parent = 0); ~KPrAnimationSelectorWidget(); /** * @brief Loads data from data model (call this method before use the widget) */ void init(); signals: /// this signal is emitted when an animation is hovered void requestPreviewAnimation(KPrShapeAnimation *animation); /// this signal is emitted when an animation is selected void requestAcceptAnimation(KPrShapeAnimation *animation); /// signal emitted if automatic preview checkbox state is changed void previousStateChanged(bool state); private slots: /** * @brief Request animation preview for the animation on index * * @param index of the animation to be displayed */ void automaticPreviewRequested(const QModelIndex &index); /** * @brief Request animation preview for current animation * (animation selected on collection view) * */ void automaticPreviewRequested(); /** * @brief Changes the current shape collection */ void activateShapeCollection(QListWidgetItem *item); /** * @brief Called if an animation was selected * * @param index of the animation selected */ void setAnimation(const QModelIndex& index); /** * @brief Automatic preview checkbox state has changed * * @param true if automatic preview is going to be enabled */ void setPreviewState(bool isEnable); private: /// load / save automatic preview checkbox state bool loadPreviewConfig(); void savePreviewConfig(); /// Create on hover buttons for animations view void createCollectionContextBar(); /// Create on hover buttons for subtype view void createSubTypeContextBar(); QListWidget *m_collectionChooser; QListView *m_collectionView; QListView *m_subTypeView; KPrShapeAnimationDocker *m_docker; KPrShapeAnimation *m_previewAnimation; bool m_showAutomaticPreview; KPrPredefinedAnimationsLoader *m_animationsData; KoViewItemContextBar *m_collectionContextBar; QToolButton *m_collectionPreviewButton; KoViewItemContextBar *m_subTypeContextBar; QToolButton *m_subTypePreviewButton; QCheckBox *m_previewCheckBox; }; #endif // KPRANIMATIONSELECTORWIDGET_H
/* -*- mode: c; c-basic-offset: 8 -*- */ /* PARISC LASI driver for the 53c700 chip * * Copyright (C) 2001 by James.Bottomley@HansenPartnership.com **----------------------------------------------------------------------------- ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ** **----------------------------------------------------------------------------- */ /* * Many thanks to Richard Hirst <rhirst@linuxcare.com> for patiently * debugging this driver on the parisc architecture and suggesting * many improvements and bug fixes. * * Thanks also go to Linuxcare Inc. for providing several PARISC * machines for me to debug the driver on. */ #ifndef __hppa__ #error "lasi700 only compiles on hppa architecture" #endif #include <linux/kernel.h> #include <linux/init.h> #include <linux/types.h> #include <linux/stat.h> #include <linux/mm.h> #include <linux/blk.h> #include <linux/sched.h> #include <linux/version.h> #include <linux/config.h> #include <linux/ioport.h> #include <asm/page.h> #include <asm/pgtable.h> #include <asm/irq.h> #include <asm/hardware.h> #include <asm/delay.h> #include <asm/gsc.h> #include <linux/module.h> #include "scsi.h" #include "hosts.h" #include "constants.h" #include "lasi700.h" #include "53c700.h" #ifdef MODULE char *lasi700; /* command line from insmod */ MODULE_AUTHOR("James Bottomley"); MODULE_DESCRIPTION("lasi700 SCSI Driver"); MODULE_LICENSE("GPL"); MODULE_PARM(lasi700, "s"); #endif #ifdef MODULE #define ARG_SEP ' ' #else #define ARG_SEP ',' #endif static unsigned long __initdata opt_base; static int __initdata opt_irq; static int __init param_setup(char *string) { char *pos = string, *next; while(pos != NULL && (next = strchr(pos, ':')) != NULL) { int val = (int)simple_strtoul(++next, NULL, 0); if(!strncmp(pos, "addr:", 5)) opt_base = val; else if(!strncmp(pos, "irq:", 4)) opt_irq = val; if((pos = strchr(pos, ARG_SEP)) != NULL) pos++; } return 1; } #ifndef MODULE __setup("lasi700=", param_setup); #endif static Scsi_Host_Template __initdata *host_tpnt = NULL; static int __initdata host_count = 0; static struct parisc_device_id lasi700_scsi_tbl[] = { LASI700_ID_TABLE, LASI710_ID_TABLE, { 0 } }; MODULE_DEVICE_TABLE(parisc, lasi700_scsi_tbl); static struct parisc_driver lasi700_driver = LASI700_DRIVER; static int __init lasi700_detect(Scsi_Host_Template *tpnt) { host_tpnt = tpnt; #ifdef MODULE if(lasi700) param_setup(lasi700); #endif register_parisc_driver(&lasi700_driver); return (host_count != 0); } static int __init lasi700_driver_callback(struct parisc_device *dev) { unsigned long base = dev->hpa + LASI_SCSI_CORE_OFFSET; char *driver_name; struct Scsi_Host *host; struct NCR_700_Host_Parameters *hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); if(dev->id.sversion == LASI_700_SVERSION) { driver_name = "lasi700"; } else { driver_name = "lasi710"; } if(hostdata == NULL) { printk(KERN_ERR "%s: Failed to allocate host data\n", driver_name); return 1; } memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters)); if(request_mem_region(base, 64, driver_name) == NULL) { printk(KERN_ERR "%s: Failed to claim memory region\n", driver_name); kfree(hostdata); return 1; } hostdata->base = base; hostdata->differential = 0; if(dev->id.sversion == LASI_700_SVERSION) { hostdata->clock = LASI700_CLOCK; hostdata->force_le_on_be = 1; } else { hostdata->clock = LASI710_CLOCK; hostdata->force_le_on_be = 0; hostdata->chip710 = 1; hostdata->dmode_extra = DMODE_FC2; } hostdata->pci_dev = ccio_get_fake(dev); if((host = NCR_700_detect(host_tpnt, hostdata)) == NULL) { kfree(hostdata); release_mem_region(host->base, 64); return 1; } host->irq = dev->irq; if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) { printk(KERN_ERR "%s: irq problem, detaching\n", driver_name); scsi_unregister(host); NCR_700_release(host); return 1; } host_count++; return 0; } static int lasi700_release(struct Scsi_Host *host) { struct D700_Host_Parameters *hostdata = (struct D700_Host_Parameters *)host->hostdata[0]; NCR_700_release(host); kfree(hostdata); free_irq(host->irq, host); release_mem_region(host->base, 64); unregister_parisc_driver(&lasi700_driver); return 1; } static Scsi_Host_Template driver_template = LASI700_SCSI; #include "scsi_module.c"
/* Measure strsep functions. Copyright (C) 2013-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #define TEST_MAIN #define TEST_NAME "strsep" #include "bench-string.h" char * simple_strsep (char **s1, char *s2) { char *begin; char *s; size_t j = 0; begin = *s1; s = begin; if (begin == NULL) return NULL; ssize_t s2len = strlen (s2); while (*s) { for (j = 0; j < s2len; j++) { if (*s == s2[j]) { s[0] = '\0'; *s1 = s + 1; return begin; } } s++; } *s1 = NULL; return begin; } char * oldstrsep (char **stringp, const char *delim) { char *begin, *end; begin = *stringp; if (begin == NULL) return NULL; /* A frequent case is when the delimiter string contains only one character. Here we don't need to call the expensive `strpbrk' function and instead work using `strchr'. */ if (delim[0] == '\0' || delim[1] == '\0') { char ch = delim[0]; if (ch == '\0') end = NULL; else { if (*begin == ch) end = begin; else if (*begin == '\0') end = NULL; else end = strchr (begin + 1, ch); } } else /* Find the end of the token. */ end = strpbrk (begin, delim); if (end) { /* Terminate the token and set *STRINGP past NUL character. */ *end++ = '\0'; *stringp = end; } else /* No more delimiters; this is the last token. */ *stringp = NULL; return begin; } typedef char *(*proto_t) (const char **, const char *); IMPL (simple_strsep, 0) IMPL (strsep, 1) IMPL (oldstrsep, 2) static void do_one_test (impl_t * impl, const char *s1, const char *s2) { size_t i, iters = INNER_LOOP_ITERS; timing_t start, stop, cur; TIMING_NOW (start); for (i = 0; i < iters; ++i) { const char *s1a = s1; CALL (impl, &s1a, s2); if (s1a != NULL) ((char*)s1a)[-1] = '1'; } TIMING_NOW (stop); TIMING_DIFF (cur, start, stop); TIMING_PRINT_MEAN ((double) cur, (double) iters); } static void do_test (size_t align1, size_t align2, size_t len1, size_t len2, int fail) { char *s2 = (char *) (buf2 + align2); /* Search for a delimiter in a string containing mostly '0', so don't use '0' as a delimiter. */ static const char d[] = "123456789abcdefg"; #define dl (sizeof (d) - 1) char *ss2 = s2; for (size_t l = len2; l > 0; l = l > dl ? l - dl : 0) { size_t t = l > dl ? dl : l; ss2 = mempcpy (ss2, d, t); } s2[len2] = '\0'; printf ("Length %4zd/%zd, alignment %2zd/%2zd, %s:", len1, len2, align1, align2, fail ? "fail" : "found"); FOR_EACH_IMPL (impl, 0) { char *s1 = (char *) (buf1 + align1); memset (s1, '0', len1); if (!fail) s1[len1 / 2] = '1'; s1[len1] = '\0'; do_one_test (impl, s1, s2); } putchar ('\n'); } static int test_main (void) { test_init (); printf ("%23s", ""); FOR_EACH_IMPL (impl, 0) printf ("\t%s", impl->name); putchar ('\n'); for (size_t klen = 2; klen < 32; ++klen) for (size_t hlen = 4 * klen; hlen < 8 * klen; hlen += klen) { do_test (0, 0, hlen, klen, 0); do_test (0, 0, hlen, klen, 1); do_test (0, 3, hlen, klen, 0); do_test (0, 3, hlen, klen, 1); do_test (0, 9, hlen, klen, 0); do_test (0, 9, hlen, klen, 1); do_test (0, 15, hlen, klen, 0); do_test (0, 15, hlen, klen, 1); do_test (3, 0, hlen, klen, 0); do_test (3, 0, hlen, klen, 1); do_test (3, 3, hlen, klen, 0); do_test (3, 3, hlen, klen, 1); do_test (3, 9, hlen, klen, 0); do_test (3, 9, hlen, klen, 1); do_test (3, 15, hlen, klen, 0); do_test (3, 15, hlen, klen, 1); do_test (9, 0, hlen, klen, 0); do_test (9, 0, hlen, klen, 1); do_test (9, 3, hlen, klen, 0); do_test (9, 3, hlen, klen, 1); do_test (9, 9, hlen, klen, 0); do_test (9, 9, hlen, klen, 1); do_test (9, 15, hlen, klen, 0); do_test (9, 15, hlen, klen, 1); do_test (15, 0, hlen, klen, 0); do_test (15, 0, hlen, klen, 1); do_test (15, 3, hlen, klen, 0); do_test (15, 3, hlen, klen, 1); do_test (15, 9, hlen, klen, 0); do_test (15, 9, hlen, klen, 1); do_test (15, 15, hlen, klen, 0); do_test (15, 15, hlen, klen, 1); } do_test (0, 0, page_size - 1, 16, 0); do_test (0, 0, page_size - 1, 16, 1); return ret; } #include <support/test-driver.c>
/* ** Copyright (C) 1998-2006 George Tzanetakis <gtzan@cs.uvic.ca> ** ** 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 MARSYAS_HWPSspectrum_H #define MARSYAS_HWPSspectrum_H #include <marsyas/system/MarSystem.h> #include "Series.h" namespace Marsyas { /** \class WHaSp \ingroup MarSystem \brief Calculate Wrapped Harmonically Spectrum (WHaSp) - \b mrs_natural/histSize [w] : set the discretization size when comparing HWPS spectrums (i.e. the histogram nr of bins). - \b mrs_natural/totalNumPeaks [w] : this control sets the total num of peaks at the input (should normally be linked with PeakConvert similar control) - \b mrs_natural/frameMaxNumPeaks [w] : this control sets the maximum num of peaks per frame at the input (should normally be linked with PeakConvert similar control) */ class WHaSp: public MarSystem { private: Series* HWPSnet_; realvec simMatrix_; MarControlPtr ctrl_histSize_; MarControlPtr ctrl_totalNumPeaks_; MarControlPtr ctrl_frameMaxNumPeaks_; void createSimMatrixNet(); void addControls(); void myUpdate(MarControlPtr sender); public: WHaSp(std::string name); WHaSp(const WHaSp& a); ~WHaSp(); MarSystem* clone() const; void myProcess(realvec& in, realvec& out); }; }//namespace Marsyas #endif
/* * ReactOS kernel * Copyright (C) 2003 ReactOS Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS winlogon * FILE: subsys/system/winlogon/setup.h * PURPOSE: Setup support functions * PROGRAMMER: Eric Kohl */ #pragma once DWORD GetSetupType (VOID); BOOL RunSetup (VOID); /* EOF */
/* * Synaptics DSX touchscreen driver * * Copyright (C) 2012 Synaptics Incorporated * * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com> * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _SYNAPTICS_DSX_H_ #define _SYNAPTICS_DSX_H_ #define PLATFORM_DRIVER_NAME "synaptics_dsx" #define I2C_DRIVER_NAME "synaptics_dsx_i2c" #define SPI_DRIVER_NAME "synaptics_dsx_spi" struct synaptics_dsx_cap_button_map { unsigned char nbuttons; unsigned int *map; }; #define SYN_CFG_BLK_UNIT (16) #define SYN_CONFIG_SIZE (128 * SYN_CFG_BLK_UNIT) struct synaptics_rmi4_config { uint32_t sensor_id; uint32_t eng_id; uint32_t pr_number; uint8_t cover_setting_size; uint8_t cover_setting[10]; uint8_t uncover_setting[10]; uint8_t glove_mode_setting[10]; uint16_t length; uint8_t config[SYN_CONFIG_SIZE]; uint8_t tp_lcm_src; const char *disp_panel; }; struct synaptics_dsx_board_data { bool x_flip; bool y_flip; bool swap_axes; int irq_gpio; int irq_on_state; int power_gpio; int power_gpio_1v8; int power_on_state; int reset_gpio; int reset_on_state; int switch_gpio; unsigned long irq_flags; unsigned short device_descriptor_addr; unsigned int panel_x; unsigned int panel_y; unsigned int power_delay_ms; unsigned int reset_delay_ms; unsigned int reset_active_ms; unsigned int byte_delay_us; unsigned int block_delay_us; const char *pwr_reg_name; const char *bus_reg_name; struct synaptics_dsx_cap_button_map *cap_button_map; uint32_t eng_id_mask; uint32_t eng_id; uint16_t tw_pin_mask; uint32_t display_width; uint32_t display_height; uint8_t update_feature; uint8_t support_glove; uint8_t support_cover; uint32_t hall_block_touch_time; int config_num; struct synaptics_rmi4_config *config_table; struct kobject *vk_obj; struct kobj_attribute *vk2Use; }; #endif
/* Software floating-point emulation. Return 1 iff a >= b, 0 otherwise. Copyright (C) 1997-2014 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). This file is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. In addition to the permissions in the GNU Lesser General Public License, the Free Software Foundation gives you unlimited permission to link the compiled version of this file into combinations with other programs, and to distribute those combinations without any restriction coming from the use of this file. (The Lesser General Public License restrictions do apply in other respects; for example, they cover modification of the file, and distribution when not linked into a combine executable.) This file 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 GCC; see the file COPYING.LIB. If not see <http://www.gnu.org/licenses/>. */ #include <soft-fp/soft-fp.h> #include <soft-fp/single.h> CMPtype __c6xabi_gef(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); CMPtype r; FP_UNPACK_RAW_S(A, a); FP_UNPACK_RAW_S(B, b); FP_CMP_S(r, A, B, -2, 2); FP_HANDLE_EXCEPTIONS; return r >= 0; }
/* Lepton EDA Schematic Capture * Copyright (C) 1998-2010 Ales Hvezda * Copyright (C) 1998-2014 gEDA Contributors * Copyright (C) 2017-2020 Lepton EDA Contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <config.h> #include <stdio.h> #include "gschem.h" /* window list */ GList *global_window_list = NULL; /* command line options */ int quiet_mode = FALSE; /* Hooks */ SCM complex_place_list_changed_hook;
/* Copyright (C) 2006 Free Software Foundation, Inc. * This program is free software; the Free Software Foundation * gives unlimited permission to copy, distribute and modify it. */ #include <config.h> #include <stdio.h> int main (void) { puts ("Hello World!"); puts ("This is " PACKAGE_STRING "."); return 0; }
/**************************************************************************** ** ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the qmake spec of the Qt Toolkit. ** ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met: ** http://www.fsf.org/licensing/licenses/info/GPLv2.html and ** http://www.gnu.org/copyleft/gpl.html. In addition, as a special ** exception, Nokia gives you certain additional rights. These rights ** are described in the Nokia Qt GPL Exception version 1.3, included in ** the file GPL_EXCEPTION.txt in this package. ** ** Qt for Windows(R) Licensees ** As a special exception, Nokia, as the sole copyright holder for Qt ** Designer, grants users of the Qt/Eclipse Integration plug-in the ** right for the Qt/Eclipse Integration to link to functionality ** provided by Qt Designer and its related libraries. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** ****************************************************************************/ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H #ifdef UNICODE #ifndef _UNICODE #define _UNICODE #endif #endif // Get Qt defines/settings #include "qglobal.h" #include <tchar.h> #include <io.h> #include <direct.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <sys/stat.h> #include <stdlib.h> #include <windows.h> #include <limits.h> #if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500) typedef enum { NameUnknown = 0, NameFullyQualifiedDN = 1, NameSamCompatible = 2, NameDisplay = 3, NameUniqueId = 6, NameCanonical = 7, NameUserPrincipal = 8, NameCanonicalEx = 9, NameServicePrincipal = 10, NameDnsDomain = 12 } EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT; #endif #define Q_FS_FAT #ifdef QT_LARGEFILE_SUPPORT #define QT_STATBUF struct _stati64 // non-ANSI defs #define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs #define QT_STAT ::_stati64 #define QT_FSTAT ::_fstati64 #else #define QT_STATBUF struct _stat // non-ANSI defs #define QT_STATBUF4TSTAT struct _stat // non-ANSI defs #define QT_STAT ::_stat #define QT_FSTAT ::_fstat #endif #define QT_STAT_REG _S_IFREG #define QT_STAT_DIR _S_IFDIR #define QT_STAT_MASK _S_IFMT #if defined(_S_IFLNK) # define QT_STAT_LNK _S_IFLNK #endif #define QT_FILENO _fileno #define QT_OPEN ::_open #define QT_CLOSE ::_close #ifdef QT_LARGEFILE_SUPPORT #define QT_LSEEK ::_lseeki64 #ifndef UNICODE #define QT_TSTAT ::_stati64 #else #define QT_TSTAT ::_wstati64 #endif #else #define QT_LSEEK ::_lseek #ifndef UNICODE #define QT_TSTAT ::_stat #else #define QT_TSTAT ::_wstat #endif #endif #define QT_READ ::_read #define QT_WRITE ::_write #define QT_ACCESS ::_access #define QT_GETCWD ::_getcwd #define QT_CHDIR ::_chdir #define QT_MKDIR ::_mkdir #define QT_RMDIR ::_rmdir #define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY _O_RDONLY #define QT_OPEN_WRONLY _O_WRONLY #define QT_OPEN_RDWR _O_RDWR #define QT_OPEN_CREAT _O_CREAT #define QT_OPEN_TRUNC _O_TRUNC #define QT_OPEN_APPEND _O_APPEND #if defined(O_TEXT) # define QT_OPEN_TEXT _O_TEXT # define QT_OPEN_BINARY _O_BINARY #endif #define QT_FOPEN ::fopen #ifdef QT_LARGEFILE_SUPPORT #define QT_FSEEK ::fseeko64 #define QT_FTELL ::ftello64 #else #define QT_FSEEK ::fseek #define QT_FTELL ::ftell #endif #define QT_FGETPOS ::fgetpos #define QT_FSETPOS ::fsetpos #define QT_FPOS_T fpos_t #ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T off64_t #else #define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int #define QT_VSNPRINTF ::_vsnprintf #define QT_SNPRINTF ::_snprintf # define F_OK 0 # define X_OK 1 # define W_OK 2 # define R_OK 4 #endif // QPLATFORMDEFS_H
/* -*- c++ -*- */ /* * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_BLOCKS_FILE_META_SOURCE_H #define INCLUDED_BLOCKS_FILE_META_SOURCE_H #include <gnuradio/blocks/api.h> #include <gnuradio/sync_block.h> namespace gr { namespace blocks { /*! * \brief Reads stream from file with meta-data headers. Headers * are parsed into tags. * \ingroup file_operators_blk * * \details * The information in the metadata headers includes: * * rx_rate (double): sample rate of data. * rx_time (uint64_t, double): time stamp of first sample in segment. * size (uint32_t): item size in bytes. * type (gr_file_types as int32_t): data type. * cplx (bool): Is data complex? * strt (uint64_t): Starting byte of data in this segment. * bytes (uint64_t): Size in bytes of data in this segment. * * Any item inside of the extra header dictionary is ready out and * made into a stream tag. */ class BLOCKS_API file_meta_source : virtual public sync_block { public: // gr::blocks::file_meta_source::sptr typedef boost::shared_ptr<file_meta_source> sptr; /*! * \brief Create a meta-data file source. * * \param filename (string): Name of file to write data to. * \param repeat (bool): Repeats file when EOF is found. * \param detached_header (bool): Set to true if header * info is stored in a separate file (usually named filename.hdr) * \param hdr_filename (string): Name of detached header file if used. * Defaults to 'filename.hdr' if detached_header is true but this * field is an empty string. */ static sptr make(const std::string &filename, bool repeat=false, bool detached_header=false, const std::string &hdr_filename=""); virtual bool open(const std::string &filename, const std::string &hdr_filename="") = 0; virtual void close() = 0; virtual void do_update() = 0; }; } /* namespace blocks */ } /* namespace gr */ #endif /* INCLUDED_BLOCKS_FILE_META_SOURCE_H */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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 nsIParserService_h__ #define nsIParserService_h__ #include "nsISupports.h" #include "nsStringGlue.h" #include "nsHTMLTags.h" #include "nsIElementObserver.h" class nsIParser; class nsIParserNode; #define NS_PARSERSERVICE_CONTRACTID "@mozilla.org/parser/parser-service;1" // {90a92e37-abd6-441b-9b39-4064d98e1ede} #define NS_IPARSERSERVICE_IID \ { 0x90a92e37, 0xabd6, 0x441b, { 0x9b, 0x39, 0x40, 0x64, 0xd9, 0x8e, 0x1e, 0xde } } class nsIParserService : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPARSERSERVICE_IID) /** * Looks up the nsHTMLTag enum value corresponding to the tag in aAtom. The * lookup happens case insensitively. * * @param aAtom The tag to look up. * * @return int32_t The nsHTMLTag enum value corresponding to the tag in aAtom * or eHTMLTag_userdefined if the tag does not correspond to * any of the tag nsHTMLTag enum values. */ virtual int32_t HTMLAtomTagToId(nsIAtom* aAtom) const = 0; /** * Looks up the nsHTMLTag enum value corresponding to the tag in aAtom. * * @param aAtom The tag to look up. * * @return int32_t The nsHTMLTag enum value corresponding to the tag in aAtom * or eHTMLTag_userdefined if the tag does not correspond to * any of the tag nsHTMLTag enum values. */ virtual int32_t HTMLCaseSensitiveAtomTagToId(nsIAtom* aAtom) const = 0; /** * Looks up the nsHTMLTag enum value corresponding to the tag in aTag. The * lookup happens case insensitively. * * @param aTag The tag to look up. * * @return int32_t The nsHTMLTag enum value corresponding to the tag in aTag * or eHTMLTag_userdefined if the tag does not correspond to * any of the tag nsHTMLTag enum values. */ virtual int32_t HTMLStringTagToId(const nsAString& aTag) const = 0; /** * Gets the tag corresponding to the nsHTMLTag enum value in aId. The * returned tag will be in lowercase. * * @param aId The nsHTMLTag enum value to get the tag for. * * @return const PRUnichar* The tag corresponding to the nsHTMLTag enum * value, or nullptr if the enum value doesn't * correspond to a tag (eHTMLTag_unknown, * eHTMLTag_userdefined, eHTMLTag_text, ...). */ virtual const PRUnichar *HTMLIdToStringTag(int32_t aId) const = 0; /** * Gets the tag corresponding to the nsHTMLTag enum value in aId. The * returned tag will be in lowercase. * * @param aId The nsHTMLTag enum value to get the tag for. * * @return nsIAtom* The tag corresponding to the nsHTMLTag enum value, or * nullptr if the enum value doesn't correspond to a tag * (eHTMLTag_unknown, eHTMLTag_userdefined, eHTMLTag_text, * ...). */ virtual nsIAtom *HTMLIdToAtomTag(int32_t aId) const = 0; NS_IMETHOD HTMLConvertEntityToUnicode(const nsAString& aEntity, int32_t* aUnicode) const = 0; NS_IMETHOD HTMLConvertUnicodeToEntity(int32_t aUnicode, nsCString& aEntity) const = 0; NS_IMETHOD IsContainer(int32_t aId, bool& aIsContainer) const = 0; NS_IMETHOD IsBlock(int32_t aId, bool& aIsBlock) const = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIParserService, NS_IPARSERSERVICE_IID) #endif // nsIParserService_h__
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "S1AP-IEs" * found in "/home/einstein/openairinterface5g/openair-cn/S1AP/MESSAGES/ASN1/R10.5/S1AP-IEs.asn" * `asn1c -gen-PER` */ #include "S1ap-MDTMode.h" static asn_per_constraints_t asn_PER_type_S1ap_MDTMode_constr_1 GCC_NOTUSED = { { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_TYPE_member_t asn_MBR_S1ap_MDTMode_1[] = { { ATF_NOFLAGS, 0, offsetof(struct S1ap_MDTMode, choice.immediateMDT), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_S1ap_ImmediateMDT, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "immediateMDT" }, { ATF_NOFLAGS, 0, offsetof(struct S1ap_MDTMode, choice.loggedMDT), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_S1ap_LoggedMDT, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "loggedMDT" }, }; static asn_TYPE_tag2member_t asn_MAP_S1ap_MDTMode_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* immediateMDT at 849 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* loggedMDT at 850 */ }; static asn_CHOICE_specifics_t asn_SPC_S1ap_MDTMode_specs_1 = { sizeof(struct S1ap_MDTMode), offsetof(struct S1ap_MDTMode, _asn_ctx), offsetof(struct S1ap_MDTMode, present), sizeof(((struct S1ap_MDTMode *)0)->present), asn_MAP_S1ap_MDTMode_tag2el_1, 2, /* Count of tags in the map */ 0, 2 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_S1ap_MDTMode = { "S1ap-MDTMode", "S1ap-MDTMode", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, CHOICE_decode_uper, CHOICE_encode_uper, CHOICE_decode_aper, CHOICE_encode_aper, CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ &asn_PER_type_S1ap_MDTMode_constr_1, asn_MBR_S1ap_MDTMode_1, 2, /* Elements count */ &asn_SPC_S1ap_MDTMode_specs_1 /* Additional specs */ };
/* t-mapstrings.c - Regression tests for mapstrings.c * Copyright (C) 2014 Werner Koch * * This file is part of GnuPG. * * This file is free software; you can redistribute it and/or modify * it under the terms of either * * - 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. * * or * * - 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. * * or both in parallel, as here. * * This file 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 <https://www.gnu.org/licenses/>. */ #include <config.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "t-support.h" #include "stringhelp.h" static void test_map_static_macro_string (void) { static struct { const char *string; const char *expected; const char *lastresult; } tests[] = { { "@GPG@ (@GNUPG@)", GPG_NAME " (" GNUPG_NAME ")" }, { "@GPG@(@GNUPG@)", GPG_NAME "(" GNUPG_NAME ")" }, { "@GPG@@GNUPG@", GPG_NAME GNUPG_NAME }, { " @GPG@@GNUPG@", " " GPG_NAME GNUPG_NAME }, { " @GPG@@GNUPG@ ", " " GPG_NAME GNUPG_NAME " " }, { " @GPG@GNUPG@ ", " " GPG_NAME "GNUPG@ " }, { " @ GPG@GNUPG@ ", " @ GPG" GNUPG_NAME " " }, { "--@GPGTAR@", "--" GPGTAR_NAME } }; int testno; const char *result; for (testno=0; testno < DIM(tests); testno++) { result = map_static_macro_string (tests[testno].string); if (!result) fail (testno); else if (strcmp (result, tests[testno].expected)) fail (testno); if (!tests[testno].lastresult) tests[testno].lastresult = result; } /* A second time to check that the same string is been returned. */ for (testno=0; testno < DIM(tests); testno++) { result = map_static_macro_string (tests[testno].string); if (!result) fail (testno); else if (strcmp (result, tests[testno].expected)) fail (testno); if (result != tests[testno].lastresult) fail (testno); } } int main (int argc, char **argv) { (void)argc; (void)argv; test_map_static_macro_string (); return 0; }
/* autofs.c - support auto-loading from fs.lst */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * * GRUB 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. * * GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>. */ #include <grub/mm.h> #include <grub/dl.h> #include <grub/env.h> #include <grub/misc.h> #include <grub/fs.h> #include <grub/normal.h> #include <grub/lib.h> /* This is used to store the names of filesystem modules for auto-loading. */ static grub_named_list_t fs_module_list; /* The auto-loading hook for filesystems. */ static int autoload_fs_module (void) { grub_named_list_t p; while ((p = fs_module_list) != NULL) { if (! grub_dl_get (p->name) && grub_dl_load (p->name)) return 1; if (grub_errno) grub_print_error (); fs_module_list = p->next; grub_free (p->name); grub_free (p); } return 0; } /* Read the file fs.lst for auto-loading. */ void read_fs_list (const char *prefix) { if (prefix) { char *filename; filename = grub_xasprintf ("%s/fs.lst", prefix); if (filename) { grub_file_t file; grub_fs_autoload_hook_t tmp_autoload_hook; /* This rules out the possibility that read_fs_list() is invoked recursively when we call grub_file_open() below. */ tmp_autoload_hook = grub_fs_autoload_hook; grub_fs_autoload_hook = NULL; file = grub_file_open (filename); if (file) { /* Override previous fs.lst. */ while (fs_module_list) { grub_named_list_t tmp; tmp = fs_module_list->next; grub_free (fs_module_list); fs_module_list = tmp; } while (1) { char *buf; char *p; char *q; grub_named_list_t fs_mod; buf = grub_getline (file); if (! buf) break; p = buf; q = buf + grub_strlen (buf) - 1; /* Ignore space. */ while (grub_isspace (*p)) p++; while (p < q && grub_isspace (*q)) *q-- = '\0'; /* If the line is empty, skip it. */ if (p >= q) continue; fs_mod = grub_malloc (sizeof (*fs_mod)); if (! fs_mod) continue; fs_mod->name = grub_strdup (p); if (! fs_mod->name) { grub_free (fs_mod); continue; } fs_mod->next = fs_module_list; fs_module_list = fs_mod; } grub_file_close (file); grub_fs_autoload_hook = tmp_autoload_hook; } grub_free (filename); } } /* Ignore errors. */ grub_errno = GRUB_ERR_NONE; /* Set the hook. */ grub_fs_autoload_hook = autoload_fs_module; }
/* This file is part of Akonadi Contact. Copyright (c) 2009 Tobias Koenig <tokoe@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 AKONADI_CONTACTVIEWERDIALOG_H #define AKONADI_CONTACTVIEWERDIALOG_H #include "akonadi-contact_export.h" #include <kdialog.h> class QUrl; namespace KABC { class Address; class PhoneNumber; } namespace Akonadi { class Item; class ContactViewer; /** * @short A dialog for displaying a contact in Akonadi. * * This dialog provides a way to show a contact from the * Akonadi storage. * * Example: * * @code * * using namespace Akonadi; * * const Item contact = ... * * ContactViewerDialog *dlg = new ContactViewerDialog( this ); * dlg->setContact( contact ); * dlg->show(); * * @endcode * * @author Tobias Koenig <tokoe@kde.org> * @since 4.4 */ class AKONADI_CONTACT_EXPORT ContactViewerDialog : public KDialog { Q_OBJECT public: /** * Creates a new contact viewer dialog. * * @param parent The parent widget of the dialog. */ explicit ContactViewerDialog( QWidget *parent = 0 ); /** * Destroys the contact viewer dialog. */ ~ContactViewerDialog(); /** * Returns the contact that is currently displayed. */ Akonadi::Item contact() const; /** * Returns the ContactViewer that is used by this dialog. */ ContactViewer *viewer() const; public Q_SLOTS: /** * Sets the @p contact that shall be displayed in the dialog. */ void setContact( const Akonadi::Item &contact ); private: //@cond PRIVATE class Private; Private* const d; //@endcond }; } #endif
#include "../../../src/common/hprotocolinfo.h"
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #include <stdbool.h> #include <stdint.h> #include <math.h> #include "platform.h" #ifdef SONAR #include "build/build_config.h" #include "common/maths.h" #include "common/utils.h" #include "config/feature.h" #include "config/parameter_group.h" #include "config/parameter_group_ids.h" #include "drivers/io.h" #include "fc/runtime_config.h" #include "sensors/sensors.h" #include "sensors/battery.h" #include "sensors/sonar.h" // Sonar measurements are in cm, a value of SONAR_OUT_OF_RANGE indicates sonar is not in range. // Inclination is adjusted by imu int16_t sonarMaxRangeCm; int16_t sonarMaxAltWithTiltCm; int16_t sonarCfAltCm; // Complimentary Filter altitude STATIC_UNIT_TESTED int16_t sonarMaxTiltDeciDegrees; float sonarMaxTiltCos; static int32_t calculatedAltitude; PG_REGISTER_WITH_RESET_TEMPLATE(sonarConfig_t, sonarConfig, PG_SONAR_CONFIG, 0); #ifndef SONAR_TRIGGER_PIN #define SONAR_TRIGGER_PIN NONE #endif #ifndef SONAR_ECHO_PIN #define SONAR_ECHO_PIN NONE #endif PG_RESET_TEMPLATE(sonarConfig_t, sonarConfig, .triggerTag = IO_TAG(SONAR_TRIGGER_PIN), .echoTag = IO_TAG(SONAR_ECHO_PIN) ); void sonarInit(const sonarConfig_t *sonarConfig) { sonarRange_t sonarRange; hcsr04_init(sonarConfig, &sonarRange); sensorsSet(SENSOR_SONAR); sonarMaxRangeCm = sonarRange.maxRangeCm; sonarCfAltCm = sonarMaxRangeCm / 2; sonarMaxTiltDeciDegrees = sonarRange.detectionConeExtendedDeciDegrees / 2; sonarMaxTiltCos = cos_approx(sonarMaxTiltDeciDegrees / 10.0f * RAD); sonarMaxAltWithTiltCm = sonarMaxRangeCm * sonarMaxTiltCos; calculatedAltitude = SONAR_OUT_OF_RANGE; } #define DISTANCE_SAMPLES_MEDIAN 5 static int32_t applySonarMedianFilter(int32_t newSonarReading) { static int32_t sonarFilterSamples[DISTANCE_SAMPLES_MEDIAN]; static int currentFilterSampleIndex = 0; static bool medianFilterReady = false; int nextSampleIndex; if (newSonarReading > SONAR_OUT_OF_RANGE) // only accept samples that are in range { nextSampleIndex = (currentFilterSampleIndex + 1); if (nextSampleIndex == DISTANCE_SAMPLES_MEDIAN) { nextSampleIndex = 0; medianFilterReady = true; } sonarFilterSamples[currentFilterSampleIndex] = newSonarReading; currentFilterSampleIndex = nextSampleIndex; } if (medianFilterReady) return quickMedianFilter5(sonarFilterSamples); else return newSonarReading; } void sonarUpdate(timeUs_t currentTimeUs) { UNUSED(currentTimeUs); hcsr04_start_reading(); } /** * Get the last distance measured by the sonar in centimeters. When the ground is too far away, SONAR_OUT_OF_RANGE is returned. */ int32_t sonarRead(void) { int32_t distance = hcsr04_get_distance(); if (distance > HCSR04_MAX_RANGE_CM) distance = SONAR_OUT_OF_RANGE; return applySonarMedianFilter(distance); } /** * Apply tilt correction to the given raw sonar reading in order to compensate for the tilt of the craft when estimating * the altitude. Returns the computed altitude in centimeters. * * When the ground is too far away or the tilt is too large, SONAR_OUT_OF_RANGE is returned. */ int32_t sonarCalculateAltitude(int32_t sonarDistance, float cosTiltAngle) { // calculate sonar altitude only if the ground is in the sonar cone if (cosTiltAngle <= sonarMaxTiltCos) calculatedAltitude = SONAR_OUT_OF_RANGE; else // altitude = distance * cos(tiltAngle), use approximation calculatedAltitude = sonarDistance * cosTiltAngle; return calculatedAltitude; } /** * Get the latest altitude that was computed by a call to sonarCalculateAltitude(), or SONAR_OUT_OF_RANGE if sonarCalculateAltitude * has never been called. */ int32_t sonarGetLatestAltitude(void) { return calculatedAltitude; } #endif
/* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" #include <nucleo_hal_bsp.h> #include <string.h> /* Private variables ---------------------------------------------------------*/ extern UART_HandleTypeDef huart2; ADC_HandleTypeDef hadc1; /* Private function prototypes -----------------------------------------------*/ static void MX_ADC1_Init(void); int main(void) { HAL_Init(); Nucleo_BSP_Init(); /* Initialize all configured peripherals */ MX_ADC1_Init(); HAL_ADC_Start(&hadc1); while (1) { char msg[20]; uint16_t rawValue; float temp; HAL_ADC_PollForConversion(&hadc1, HAL_MAX_DELAY); rawValue = HAL_ADC_GetValue(&hadc1); temp = ((float)rawValue) / 4095 * 3300; temp = ((temp - 760.0) / 2.5) + 25; sprintf(msg, "rawValue: %hu\r\n", rawValue); HAL_UART_Transmit(&huart2, (uint8_t*) msg, strlen(msg), HAL_MAX_DELAY); sprintf(msg, "Temperature: %f\r\n", temp); HAL_UART_Transmit(&huart2, (uint8_t*) msg, strlen(msg), HAL_MAX_DELAY); } } /* ADC1 init function */ void MX_ADC1_Init(void) { ADC_ChannelConfTypeDef sConfig; /* Enable ADC peripheral */ __HAL_RCC_ADC1_CLK_ENABLE(); /**Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.ScanConvMode = DISABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.NbrOfConversion = 1; hadc1.Init.DMAContinuousRequests = DISABLE; hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV; HAL_ADC_Init(&hadc1); /**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. */ sConfig.Channel = ADC_CHANNEL_TEMPSENSOR; sConfig.Rank = 1; sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES; HAL_ADC_ConfigChannel(&hadc1, &sConfig); } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t* file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * Unix SMB/CIFS implementation. * RPC Pipe client / server routines * Largely rewritten by Jeremy Allison 2005. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ #include "includes.h" #include "../librpc/gen_ndr/ndr_schannel.h" #include "../librpc/gen_ndr/ndr_netlogon.h" #include "../libcli/auth/schannel.h" #include "rpc_client/cli_netlogon.h" #include "rpc_client/cli_pipe.h" #include "librpc/rpc/dcerpc.h" #include "passdb.h" #include "libsmb/libsmb.h" #include "../libcli/smb/smbXcli_base.h" #include "libcli/auth/netlogon_creds_cli.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_CLI /**************************************************************************** Open a named pipe to an SMB server and bind using schannel (bind type 68). Fetch the session key ourselves using a temporary netlogon pipe. ****************************************************************************/ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, struct messaging_context *msg_ctx, const struct ndr_interface_table *table, enum dcerpc_transport_t transport, enum dcerpc_AuthLevel auth_level, const char *domain, struct rpc_pipe_client **presult, TALLOC_CTX *mem_ctx, struct netlogon_creds_cli_context **pcreds) { TALLOC_CTX *frame = talloc_stackframe(); const char *dc_name = smbXcli_conn_remote_name(cli->conn); struct rpc_pipe_client *result = NULL; NTSTATUS status; struct netlogon_creds_cli_context *netlogon_creds = NULL; struct netlogon_creds_CredentialState *creds = NULL; uint32_t netlogon_flags = 0; enum netr_SchannelType sec_chan_type = 0; const char *_account_name = NULL; const char *account_name = NULL; struct samr_Password current_nt_hash; struct samr_Password *previous_nt_hash = NULL; bool ok; ok = get_trust_pw_hash(domain, current_nt_hash.hash, &_account_name, &sec_chan_type); if (!ok) { TALLOC_FREE(frame); return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; } account_name = talloc_asprintf(frame, "%s$", _account_name); if (account_name == NULL) { SAFE_FREE(previous_nt_hash); TALLOC_FREE(frame); return NT_STATUS_NO_MEMORY; } status = rpccli_create_netlogon_creds(dc_name, domain, account_name, sec_chan_type, msg_ctx, frame, &netlogon_creds); if (!NT_STATUS_IS_OK(status)) { SAFE_FREE(previous_nt_hash); TALLOC_FREE(frame); return status; } status = rpccli_setup_netlogon_creds(cli, transport, netlogon_creds, false, /* force_reauth */ current_nt_hash, previous_nt_hash); SAFE_FREE(previous_nt_hash); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(frame); return status; } status = netlogon_creds_cli_get(netlogon_creds, frame, &creds); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(frame); return status; } netlogon_flags = creds->negotiate_flags; TALLOC_FREE(creds); if (!(netlogon_flags & NETLOGON_NEG_AUTHENTICATED_RPC)) { TALLOC_FREE(frame); return NT_STATUS_DOWNGRADE_DETECTED; } status = cli_rpc_pipe_open_schannel_with_key( cli, table, transport, domain, netlogon_creds, &result); if (NT_STATUS_IS_OK(status)) { *presult = result; if (pcreds != NULL) { *pcreds = talloc_move(mem_ctx, &netlogon_creds); } } TALLOC_FREE(frame); return status; }
#include "asf.h" #include "asf_endian.h" #include "detect_cr.h" #include <ctype.h> /* Helpful functions */ int firstRecordLen(char *ceosName) { FILE *f; struct HEADER h; f=FOPEN(ceosName,"rb"); /*Open file.*/ ASF_FREAD(&h,1,12,f); /*Read first CEOS header.*/ FCLOSE(f); /*Close file*/ return bigInt32(h.recsiz); /*put recsiz in proper endian format & return*/ } /* Default splash screen, the same for all the tools This function should be called first in the "we're good enough" part of command line parsing */ void print_splash_screen(int argc, char* argv[]) { char temp1[255]; char temp2[255]; int ii; sprintf(temp1, "\nCommand line:"); for (ii = 0; ii < argc; ii++) { sprintf(temp2, " %s",argv[ii]); strcat(temp1, temp2); } printf("%s\n", temp1); printf("Date: %s\n",date_time_stamp()); printf("PID: %i\n\n", (int)getpid()); } void print_progress(int current_line, int total_lines) { current_line++; if ((current_line%256==0) || (current_line==total_lines)) { printf("\rWrote %5d of %5d lines.", current_line, total_lines); fflush(NULL); if (current_line == total_lines) { printf("\n"); if (logflag) { sprintf(logbuf,"Wrote %5d of %5d lines.\n", current_line, total_lines); printLog(logbuf); } } } } /* Check to see if an option was supplied or not If it was found, return its argument number Otherwise, return FLAG_NOT_SET */ int checkForOption(char* key, int argc, char* argv[]) { int ii = 0; while(ii < argc) { if(strmatch(key, argv[ii])) return(ii); ++ii; } return(FLAG_NOT_SET); } /* Print an error message. This is just here for circumventing check_return. Also, it makes it possible to reformat all the error messages at once. */ void print_error(char *msg) { char tmp[256]; /* I made "ERROR:" red...Yay! :D */ printf("\n \033[31;1mERROR:\033[0m %s\n\n", msg); sprintf(tmp, "\n ERROR: %s\n\n", msg); printLog(tmp); exit(EXIT_FAILURE); } /* Check the return value of a function and display an error message if it's a bad return */ void check_return(int ret, char *msg) { if (ret != 0) print_error(msg); } void pixel_type_flag_looker(int *flag_count, char *flags_used, char *flagName) { if (*flag_count==0) strcat(flags_used, flagName); else if (*flag_count==1) strcat(strcat(flags_used, " and "), flagName); else if (*flag_count>1) strcat(strcat(flags_used, ", and "), flagName); else { char msg[256]; sprintf(msg, "Programmer error dealing with the %s flag.", flagName); print_error(msg); } (*flag_count)++; }
/* * Copyright (C) 2013, 2016 Internet Systems Consortium, Inc. ("ISC") * * 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 GENERIC_EUI64_109_H #define GENERIC_EUI64_109_H 1 typedef struct dns_rdata_eui64 { dns_rdatacommon_t common; unsigned char eui64[8]; } dns_rdata_eui64_t; #endif /* GENERIC_EUI64_10k_H */
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved. * * $Id$ */ #include "db_config.h" #include "db_int.h" static int __env_backup_alloc __P((DB_ENV *)); static int __env_backup_alloc(dbenv) DB_ENV *dbenv; { ENV *env; env = dbenv->env; if (env->backup_handle != NULL) return (0); return (__os_calloc(env, 1, sizeof(*env->backup_handle), &env->backup_handle)); } /* * __env_get_backup_config -- * * PUBLIC: int __env_get_backup_config __P((DB_ENV *, * PUBLIC: DB_BACKUP_CONFIG, u_int32_t*)); */ int __env_get_backup_config(dbenv, config, valuep) DB_ENV *dbenv; DB_BACKUP_CONFIG config; u_int32_t *valuep; { DB_BACKUP *backup; backup = dbenv->env->backup_handle; if (backup == NULL) return (EINVAL); switch (config) { case DB_BACKUP_WRITE_DIRECT: *valuep = F_ISSET(backup, BACKUP_WRITE_DIRECT); break; case DB_BACKUP_READ_COUNT: *valuep = backup->read_count; break; case DB_BACKUP_READ_SLEEP: *valuep = backup->read_sleep; break; case DB_BACKUP_SIZE: *valuep = backup->size; break; } return (0); } /* * __env_set_backup_config -- * * PUBLIC: int __env_set_backup_config __P((DB_ENV *, * PUBLIC: DB_BACKUP_CONFIG, u_int32_t)); */ int __env_set_backup_config(dbenv, config, value) DB_ENV *dbenv; DB_BACKUP_CONFIG config; u_int32_t value; { DB_BACKUP *backup; int ret; if ((ret = __env_backup_alloc(dbenv)) != 0) return (ret); backup = dbenv->env->backup_handle; switch (config) { case DB_BACKUP_WRITE_DIRECT: if (value == 0) F_CLR(backup, BACKUP_WRITE_DIRECT); else F_SET(backup, BACKUP_WRITE_DIRECT); break; case DB_BACKUP_READ_COUNT: backup->read_count = value; break; case DB_BACKUP_READ_SLEEP: backup->read_sleep = value; break; case DB_BACKUP_SIZE: backup->size = value; break; } return (0); } /* * __env_get_backup_callbacks -- * * PUBLIC: int __env_get_backup_callbacks __P((DB_ENV *, * PUBLIC: int (**)(DB_ENV *, const char *, const char *, void **), * PUBLIC: int (**)(DB_ENV *, * PUBLIC: u_int32_t, u_int32_t, u_int32_t, u_int8_t *, void *), * PUBLIC: int (**)(DB_ENV *, const char *, void *))); */ int __env_get_backup_callbacks(dbenv, openp, writep, closep) DB_ENV *dbenv; int (**openp)(DB_ENV *, const char *, const char *, void **); int (**writep)(DB_ENV *, u_int32_t, u_int32_t, u_int32_t, u_int8_t *, void *); int (**closep)(DB_ENV *, const char *, void *); { DB_BACKUP *backup; backup = dbenv->env->backup_handle; if (backup == NULL) return (EINVAL); *openp = backup->open; *writep = backup->write; *closep = backup->close; return (0); } /* * __env_set_backup_callbacks -- * * PUBLIC: int __env_set_backup_callbacks __P((DB_ENV *, * PUBLIC: int (*)(DB_ENV *, const char *, const char *, void **), * PUBLIC: int (*)(DB_ENV *, * PUBLIC: u_int32_t, u_int32_t, u_int32_t, u_int8_t *, void *), * PUBLIC: int (*)(DB_ENV *, const char *, void *))); */ int __env_set_backup_callbacks(dbenv, open_func, write_func, close_func) DB_ENV *dbenv; int (*open_func)(DB_ENV *, const char *, const char *, void **); int (*write_func)(DB_ENV *, u_int32_t, u_int32_t, u_int32_t, u_int8_t *, void *); int (*close_func)(DB_ENV *, const char *, void *); { DB_BACKUP *backup; int ret; if ((ret = __env_backup_alloc(dbenv)) != 0) return (ret); backup = dbenv->env->backup_handle; backup->open = open_func; backup->write = write_func; backup->close = close_func; return (0); }
/**************************************************************** * * * 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_string.h" #include "gtm_stdio.h" #include <rtnhdr.h> #include "srcline.h" #include "error.h" #include "op.h" #include "outofband.h" #ifdef GTM_TRIGGER # include "gtm_trigger_trc.h" #endif #define INFO_MSK(error) (error & ~SEV_MSK | INFO) GBLREF int4 outofband; GBLREF mident_fixed zlink_mname; error_def(ERR_FILENOTFND); error_def(ERR_TRIGNAMENF); error_def(ERR_TXTSRCMAT); error_def(ERR_ZPRTLABNOTFND); error_def(ERR_ZLINKFILE); error_def(ERR_ZLMODULE); void op_zprint(mval *rtn, mval *start_label, int start_int_exp, mval *end_label, int end_int_exp) /* contains label to be located or null string */ /* contains label offset or line number to reference */ /* contains routine to look in or null string */ /* NOTE: If only the first label is specified, the */ /* parser makes the second label the duplicate */ /* of the first. (not so vice versa) */ { mval print_line, null_str; mstr *src1, *src2; uint4 stat1, stat2; rhdtyp *rtn_vector; boolean_t is_trigger; MV_FORCE_STR(start_label); MV_FORCE_STR(end_label); MV_FORCE_STR(rtn); /* This first call to get_src_line() for our entry "locks-in" the source we will be extracting. If the rtn * in question in a trigger, it would be possible for the further get_src_line() calls we do to cause the * trigger to be reloaded making our earlier fetches irrelevant. After this first call, all following calls * to get_src_line() for this operation will tell get_src_line() to NOT verify or reload the triggers so * we get a consistent (if no longer current) view of the trigger. */ GTMTRIG_ONLY(IS_TRIGGER_RTN(&rtn->str, is_trigger)); GTMTRIG_ONLY(if (is_trigger) DBGTRIGR((stderr, "op_zprint: Performing zprint of a trigger\n"))); stat1 = get_src_line(rtn, start_label, start_int_exp, &src1, VERIFY); if (OBJMODMISS == stat1) { # ifdef GTM_TRIGGER if (is_trigger) rts_error(VARLSTCNT(4) ERR_TRIGNAMENF, 2, rtn->str.len, rtn->str.addr); # endif /* get_src_line did not find the object file to load */ rts_error(VARLSTCNT(8) ERR_ZLINKFILE, 2, rtn->str.len, rtn->str.addr, ERR_ZLMODULE, 2, mid_len(&zlink_mname), &zlink_mname.c[0]); } if (NULL == (rtn_vector = find_rtn_hdr(&rtn->str))) { # ifdef GTM_TRIGGER if (is_trigger) rts_error(VARLSTCNT(4) ERR_TRIGNAMENF, 2, rtn->str.len, rtn->str.addr); # endif GTMASSERT; /* If couldn't find module, should have returned OBJMODMISS */ } if (stat1 & LABELNOTFOUND) rts_error(VARLSTCNT(1) ERR_ZPRTLABNOTFND); if (stat1 & SRCNOTFND) rts_error(VARLSTCNT(4) ERR_FILENOTFND, 2, rtn_vector->src_full_name.len, rtn_vector->src_full_name.addr); if (stat1 & (SRCNOTAVAIL | AFTERLASTLINE)) return; if (stat1 & (ZEROLINE | NEGATIVELINE)) { null_str.mvtype = MV_STR; null_str.str.len = 0; stat1 = get_src_line(rtn, &null_str, 1, &src1, NOVERIFY); if (stat1 & AFTERLASTLINE) /* the "null" file */ return; } if (end_int_exp == 0 && (end_label->str.len == 0 || *end_label->str.addr == 0)) stat2 = AFTERLASTLINE; else if ((stat2 = get_src_line(rtn, end_label, end_int_exp, &src2, NOVERIFY)) & LABELNOTFOUND) rts_error(VARLSTCNT(1) ERR_ZPRTLABNOTFND); if (stat2 & (ZEROLINE | NEGATIVELINE)) return; if (stat2 & AFTERLASTLINE) { null_str.mvtype = MV_STR; null_str.str.len = 0; stat2 = get_src_line(rtn, &null_str, 1, &src2, NOVERIFY); /* number of lines less one for duplicated zero'th line and one due to termination condition being <= */ assert((INTPTR_T)src2 > 0); src2 += rtn_vector->lnrtab_len - 2; } if (stat1 & CHECKSUMFAIL) { rts_error(VARLSTCNT(1) INFO_MSK(ERR_TXTSRCMAT)); op_wteol(1); } print_line.mvtype = MV_STR; for ( ; src1 <= src2 ; src1++) { /* Note outofband check currently disabled. This routine (op_zprint) needs to be rewritten to provide * a TP wrapper (if not already in place) and to buffer the lines obtained from get_src_line() completely * before outputting anything because obtaining these source lines is subject to TP restarts when we are * accessing triggers. In addition, for the case of "normal" routine source fetches, an outofband could * invoke a job interrupt which could relink an entry point so an out-of-band interrupt of any kind means * the source fetches also need to be restarted. Until these issues are address, the outofband check * remains disabled (SE - 12/2010) */ /* if (outofband) outofband_action(FALSE); */ print_line.str.addr = src1->addr; print_line.str.len = src1->len; op_write(&print_line); op_wteol(1); } return; }
#ifndef acsnc_cdb_properties_H #define acsnc_cdb_properties_H /******************************************************************************* * ALMA - Atacama Large Millimiter Array * (c) UNSPECIFIED - FILL IN, 2005 * * 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 * * "@(#) $Id: acsncCDBProperties.h,v 1.8 2008/02/12 01:10:33 msekoran Exp $" * * who when what * -------- -------- ---------------------------------------------- * almadave 2005-04-24 created */ /** @file acsncCDBProperties.h * Header file for classes/functions designed to extract a channel's * quality of service and admin properties from the ACS CDB. */ #ifndef __cplusplus #error This is a C++ include file and cannot be used from plain C #endif #include <orbsvcs/CosNotificationC.h> #include <cdbDALC.h> #include <iostream> #include <string> #include <map> namespace nc { /** * Class which contains static methods used to discover whether or * not properties for ACS notification channels have been defined in * the ACS CDB. If these properties, are present this class turns * the pure XML records into CORBA properties. */ class CDBProperties { public: /** * Simple function which returns true if the given channel * has an entry in $ACS_CDB/CDB/MACI/EventChannels/ section * of the ACS configuration database. * @param channelName name of the channel we want to know about * @return true if an entry exists in the ACS CDB for this channel * and false otherwise. */ static bool cdbChannelConfigExists(const std::string& channelName); /** * Given a channel name that exists in the ACS CDB * ($ACS_CDB/CDB/MACI/Channels/channelName/channelName.xml), this * function returns the channels administrative properties in their CORBA * format. * @param channelName name of the channel found in $ACS_CDB/CDB/MACI/Channels * @return channel's admin properties */ static CosNotification::AdminProperties getCDBAdminProps(const std::string& channelName); /** * Given a channel name that exists in the ACS CDB * ($ACS_CDB/CDB/MACI/Channels/channelName/channelName.xml), this * function returns the channel's quality of service properties in their CORBA * format. * @param channelName name of the channel found in $ACS_CDB/CDB/MACI/Channels * @return channel's quality of service properties */ static CosNotification::QoSProperties getCDBQoSProps(const std::string& channelName); /** * The following was requested by H. Sommer and is needed for integrations. * It should be removed at some later date. */ static bool getIntegrationLogs(const std::string& channelName); typedef std::map<std::string, double> EventHandlerTimeoutMap; /** * The following returns a map where each key is the * name of an event and the value is the maximum amount of time * an event handler has to process the event before a warning * message is logged. * @param channelName - name of the channel */ static EventHandlerTimeoutMap getEventHandlerTimeoutMap(const std::string& channelName); /** * Helper function returns a reference to the ACS CDB. */ static CDB::DAL_ptr getCDB(); }; }; #endif /*!_H*/
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names ** of its contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef WINDOW_H #define WINDOW_H #include <QMainWindow> class QAction; class QTableWidget; class QTableWidgetItem; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(); public slots: void averageItems(); void sumItems(); private: void setupTableItems(); QAction *removeAction; QTableWidget *tableWidget; }; #endif
/* Teem: Tools to process and visualize scientific data and images . Copyright (C) 2010, 2009, 2008 Thomas Schultz Copyright (C) 2010, 2009, 2008 Gordon Kindlmann This 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. The terms of redistributing and/or modifying this software also include exceptions to the LGPL that facilitate static linking. 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 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TIJK_PRIVATE_HAS_BEEN_INCLUDED #define TIJK_PRIVATE_HAS_BEEN_INCLUDED /* macros to facilitate definition of new tensor types */ /* for unsymmetric tensors */ #define TIJK_TYPE_UNSYM(name, order, dim, num) \ tijk_type \ _tijk_##name = { \ #name, order, dim, num, \ NULL, NULL, NULL, NULL, \ _tijk_##name##_tsp_d, _tijk_##name##_tsp_f, \ _tijk_##name##_norm_d, _tijk_##name##_norm_f, \ _tijk_##name##_trans_d, _tijk_##name##_trans_f, \ _tijk_##name##_convert_d, _tijk_##name##_convert_f, \ _tijk_##name##_approx_d, _tijk_##name##_approx_f, \ NULL, NULL, NULL, NULL, \ NULL \ }; \ const tijk_type *const tijk_##name = &_tijk_##name; /* for partially symmetric and antisymmetric tensors */ #define TIJK_TYPE(name, order, dim, num) \ tijk_type \ _tijk_##name = { \ #name, order, dim, num, \ _tijk_##name##_mult, _tijk_##name##_unsym2uniq, \ _tijk_##name##_uniq2unsym, _tijk_##name##_uniq_idx, \ _tijk_##name##_tsp_d, _tijk_##name##_tsp_f, \ _tijk_##name##_norm_d, _tijk_##name##_norm_f, \ _tijk_##name##_trans_d, _tijk_##name##_trans_f, \ _tijk_##name##_convert_d, _tijk_##name##_convert_f, \ _tijk_##name##_approx_d, _tijk_##name##_approx_f, \ NULL, NULL, NULL, NULL, \ NULL \ }; \ const tijk_type *const tijk_##name = &_tijk_##name; /* for totally symmetric tensors */ #define TIJK_TYPE_SYM(name, order, dim, num) \ tijk_sym_fun \ _tijk_sym_fun_##name = { \ _tijk_##name##_s_form_d, _tijk_##name##_s_form_f, \ _tijk_##name##_mean_d, _tijk_##name##_mean_f, \ _tijk_##name##_var_d, _tijk_##name##_var_f, \ _tijk_##name##_v_form_d, _tijk_##name##_v_form_f, \ _tijk_##name##_m_form_d, _tijk_##name##_m_form_f, \ _tijk_##name##_grad_d, _tijk_##name##_grad_f, \ _tijk_##name##_hess_d, _tijk_##name##_hess_f, \ _tijk_##name##_make_rank1_d, _tijk_##name##_make_rank1_f, \ _tijk_##name##_make_iso_d, _tijk_##name##_make_iso_f \ }; \ tijk_type \ _tijk_##name = { \ #name, order, dim, num, \ _tijk_##name##_mult, _tijk_##name##_unsym2uniq, \ _tijk_##name##_uniq2unsym, _tijk_##name##_uniq_idx, \ _tijk_##name##_tsp_d, _tijk_##name##_tsp_f, \ _tijk_##name##_norm_d, _tijk_##name##_norm_f, \ _tijk_##name##_trans_d, _tijk_##name##_trans_f, \ _tijk_##name##_convert_d, _tijk_##name##_convert_f, \ _tijk_##name##_approx_d, _tijk_##name##_approx_f, \ NULL, NULL, NULL, NULL, \ &_tijk_sym_fun_##name \ }; \ const tijk_type *const tijk_##name = &_tijk_##name; #endif /* TIJK_PRIVATE_HAS_BEEN_INCLUDED */
/* Copyright (C) 2003 by Jorrit Tyberghein (C) 2003 by Frank Richter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __CS_WATER_H__ #define __CS_WATER_H__ #include "cstool/basetexfact.h" #include "csutil/strhash.h" #include "csutil/csstring.h" class csPtWaterType : public scfImplementationExt0<csPtWaterType, csBaseProctexType> { public: csPtWaterType (iBase *p); virtual csPtr<iTextureFactory> NewFactory(); }; class csPtWaterFactory : public scfImplementationExt0<csPtWaterFactory, csBaseTextureFactory> { public: csPtWaterFactory (iTextureType* p, iObjectRegistry* object_reg); virtual csPtr<iTextureWrapper> Generate (); }; class csPtWaterLoader : public scfImplementationExt0<csPtWaterLoader, csBaseProctexLoader> { csStringHash tokens; //#define CS_TOKEN_ITEM_FILE "plugins/proctex/standard/water.tok" //#include "cstool/tokenlist.h" public: csPtWaterLoader(iBase *p); virtual csPtr<iBase> Parse (iDocumentNode* node, iStreamSource*, iLoaderContext* ldr_context, iBase* context); virtual bool IsThreadSafe() { return true; } }; class csPtWaterSaver : public scfImplementationExt0<csPtWaterSaver, csBaseProctexSaver> { public: csPtWaterSaver(iBase *p); virtual bool WriteDown (iBase *obj, iDocumentNode* parent, iStreamSource*); }; #endif
/* * Cogl * * An object oriented GL/GLES Abstraction/Utility Layer * * Copyright (C) 2011 Intel Corporation. * * 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, see <http://www.gnu.org/licenses/>. * * */ #ifndef __COGL_WINSYS_EGL_WAYLAND_PRIVATE_H #define __COGL_WINSYS_EGL_WAYLAND_PRIVATE_H #include "cogl-winsys-private.h" const CoglWinsysVtable * _cogl_winsys_egl_wayland_get_vtable (void); #endif /* __COGL_WINSYS_EGL_WAYLAND_PRIVATE_H */
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://www.qt.io/licensing. For further information ** use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CHANGEOBJECTTYPEVISITOR_H #define CHANGEOBJECTTYPEVISITOR_H #include "qmlrewriter.h" namespace QmlDesigner { namespace Internal { class ChangeObjectTypeVisitor: public QMLRewriter { public: ChangeObjectTypeVisitor(QmlDesigner::TextModifier &modifier, quint32 nodeLocation, const QString &newType); protected: virtual bool visit(QmlJS::AST::UiObjectDefinition *ast); virtual bool visit(QmlJS::AST::UiObjectBinding *ast); private: void replaceType(QmlJS::AST::UiQualifiedId *typeId); private: quint32 m_nodeLocation; QString m_newType; }; } // namespace Internal } // namespace QmlDesigner #endif // CHANGEOBJECTTYPEVISITOR_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 ORIENTEDSUBDOMAINBOUNDINGBOX_H #define ORIENTEDSUBDOMAINBOUNDINGBOX_H // MOOSE includes #include "MooseEnum.h" #include "MeshModifier.h" #include "OrientedBoxInterface.h" // Forward declerations class OrientedSubdomainBoundingBox; template <> InputParameters validParams<OrientedSubdomainBoundingBox>(); /** * MeshModifier for defining a Subdomain inside or outside of a bounding box with arbitrary * orientation */ class OrientedSubdomainBoundingBox : public MeshModifier, public OrientedBoxInterface { public: /** * Class constructor * @param parameters The parameters object holding data for the class to use. */ OrientedSubdomainBoundingBox(const InputParameters & parameters); private: virtual void modify() override; /// ID location (inside of outside of box) const MooseEnum _location; /// Block ID to assign to the region const SubdomainID _block_id; }; #endif // ORIENTEDSUBDOMAINBOUNDINGBOX_H
/* * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: * */ #ifndef ECntRecoverDb1_H_ #define ECntRecoverDb1_H_ //Include the suite header #include "csuite.h" #include "ccntserver.h" #include "ccntipccodes.h" class CECntRecoverDb1Step: public CCapabilityTestStep { public: //Get the version of the server to be called TVersion Version() { return TVersion(KLockSrvMajorVersionNumber, KLockSrvMinorVersionNumber, KLockSrvBuildVersionNumber); } //Constructor called from the respective Suite.cpp from their "AddTestStep" function CECntRecoverDb1Step() ; //Always clean your mess ~CECntRecoverDb1Step() { tChildThread.Close(); } //This is the Function called from "doTestStepL" by the test Suite,and it creates an //child thread which internally calls the corresponding Exec_SendReceive_SERVERNAME fn. TVerdict MainThread(); //Here's where the connection and testing the message takes place TInt Exec_SendReceive(); }; #endif
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef SEARCHRESULTTREEITEMDELEGATE_H #define SEARCHRESULTTREEITEMDELEGATE_H #include <QItemDelegate> namespace Find { namespace Internal { class SearchResultTreeItemDelegate: public QItemDelegate { public: SearchResultTreeItemDelegate(QObject *parent = 0); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; private: int drawLineNumber(QPainter *painter, const QStyleOptionViewItemV3 &option, const QRect &rect, const QModelIndex &index) const; void drawText(QPainter *painter, const QStyleOptionViewItem &opt, const QRect &rect, const QModelIndex &index) const; static const int m_minimumLineNumberDigits = 6; }; } // namespace Internal } // namespace Find #endif // SEARCHRESULTTREEITEMDELEGATE_H
/* * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #define GETXXKEY_R_FUNC getgrgid_r #define GETXXKEY_R_PARSER __parsegrent #define GETXXKEY_R_ENTTYPE struct group #define GETXXKEY_R_TEST(ENT) ((ENT)->gr_gid == key) #define DO_GETXXKEY_R_KEYTYPE gid_t #define DO_GETXXKEY_R_PATHNAME _PATH_GROUP #include "pwd_grp.c"
/************************************************************\ * Copyright 2018 Lawrence Livermore National Security, LLC * (c.f. AUTHORS, NOTICE.LLNS, COPYING) * * This file is part of the Flux resource manager framework. * For details, see https://github.com/flux-framework. * * SPDX-License-Identifier: LGPL-3.0 \************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include <flux/core.h> #include "job.h" flux_future_t *flux_job_event_watch (flux_t *h, flux_jobid_t id, const char *path, int flags) { flux_future_t *f; const char *topic = "job-info.eventlog-watch"; int rpc_flags = FLUX_RPC_STREAMING; /* No flags supported yet */ if (!h || !path || flags) { errno = EINVAL; return NULL; } if (!(f = flux_rpc_pack (h, topic, FLUX_NODEID_ANY, rpc_flags, "{s:I s:s s:i}", "id", id, "path", path, "flags", flags))) return NULL; return f; } int flux_job_event_watch_get (flux_future_t *f, const char **event) { const char *s; if (flux_rpc_get_unpack (f, "{s:s}", "event", &s) < 0) return -1; if (event) *event = s; return 0; } int flux_job_event_watch_cancel (flux_future_t *f) { flux_future_t *f2; const char *topic = "job-info.eventlog-watch-cancel"; if (!f) { errno = EINVAL; return -1; } if (!(f2 = flux_rpc_pack (flux_future_get_flux (f), topic, FLUX_NODEID_ANY, FLUX_RPC_NORESPONSE, "{s:i}", "matchtag", (int)flux_rpc_get_matchtag (f)))) return -1; flux_future_destroy (f2); return 0; } /* * vi:tabstop=4 shiftwidth=4 expandtab */
/** @file MicroSecondDelay implementation of ACPI Timer. Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef __I2C_DELAY_PEI__ #define __I2C_DELAY_PEI__ #include "PiPei.h" /** Stalls the CPU for at least the given number of microseconds. Stalls the CPU for the number of microseconds specified by MicroSeconds. @param MicroSeconds The minimum number of microseconds to delay. @return MicroSeconds **/ EFI_STATUS EFIAPI MicroSecondDelay ( IN UINTN MicroSeconds ); #endif
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef _THRIFT_TRANSPORT_TPIPE_H_ #define _THRIFT_TRANSPORT_TPIPE_H_ 1 #include <thrift/transport/TTransport.h> #include <thrift/transport/TVirtualTransport.h> #ifndef _WIN32 #include <thrift/transport/TSocket.h> #endif #ifdef _WIN32 #include <thrift/windows/Sync.h> #endif #include <boost/noncopyable.hpp> #ifdef _WIN32 #include <thrift/windows/Sync.h> #endif namespace apache { namespace thrift { namespace transport { /** * Windows Pipes implementation of the TTransport interface. * Don't destroy a TPipe at global scope, as that will cause a thread join * during DLLMain. That also means that client objects using TPipe shouldn't be at global * scope. */ #ifdef _WIN32 class TPipeImpl; class TPipe : public TVirtualTransport<TPipe> { public: // Constructs a new pipe object. TPipe(); // Named pipe constructors - explicit TPipe(HANDLE Pipe); // HANDLE is a void* explicit TPipe(TAutoHandle& Pipe); // this ctor will clear out / move from Pipe // need a const char * overload so string literals don't go to the HANDLE overload explicit TPipe(const char* pipename); explicit TPipe(const std::string& pipename); // Anonymous pipe - TPipe(HANDLE PipeRd, HANDLE PipeWrt); // Destroys the pipe object, closing it if necessary. virtual ~TPipe(); // Returns whether the pipe is open & valid. bool isOpen() const override; // Checks whether more data is available in the pipe. bool peek() override; // Creates and opens the named/anonymous pipe. void open() override; // Shuts down communications on the pipe. void close() override; // Reads from the pipe. virtual uint32_t read(uint8_t* buf, uint32_t len); // Writes to the pipe. virtual void write(const uint8_t* buf, uint32_t len); // Accessors std::string getPipename(); void setPipename(const std::string& pipename); HANDLE getPipeHandle(); // doubles as the read handle for anon pipe void setPipeHandle(HANDLE pipehandle); HANDLE getWrtPipeHandle(); void setWrtPipeHandle(HANDLE pipehandle); long getConnTimeout(); void setConnTimeout(long seconds); // this function is intended to be used in generic / template situations, // so its name needs to be the same as TPipeServer's HANDLE getNativeWaitHandle(); private: std::shared_ptr<TPipeImpl> impl_; std::string pipename_; long TimeoutSeconds_; bool isAnonymous_; }; #else typedef TSocket TPipe; #endif } } } // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TPIPE_H_
/* * This file is part of the SSH Library * * Copyright (c) 2009 by Aris Adamantiadis * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CHANNELS_H_ #define CHANNELS_H_ #include "libssh/priv.h" /** @internal * Describes the different possible states in a * outgoing (client) channel request */ enum ssh_channel_request_state_e { /** No request has been made */ SSH_CHANNEL_REQ_STATE_NONE = 0, /** A request has been made and answer is pending */ SSH_CHANNEL_REQ_STATE_PENDING, /** A request has been replied and accepted */ SSH_CHANNEL_REQ_STATE_ACCEPTED, /** A request has been replied and refused */ SSH_CHANNEL_REQ_STATE_DENIED, /** A request has been replied and an error happend */ SSH_CHANNEL_REQ_STATE_ERROR }; enum ssh_channel_state_e { SSH_CHANNEL_STATE_NOT_OPEN = 0, SSH_CHANNEL_STATE_OPENING, SSH_CHANNEL_STATE_OPEN_DENIED, SSH_CHANNEL_STATE_OPEN, SSH_CHANNEL_STATE_CLOSED }; /* The channel has been closed by the remote side */ #define SSH_CHANNEL_FLAG_CLOSED_REMOTE 0x1 /* The channel has been freed by the calling program */ #define SSH_CHANNEL_FLAG_FREED_LOCAL 0x2 /* the channel has not yet been bound to a remote one */ #define SSH_CHANNEL_FLAG_NOT_BOUND 0x4 struct ssh_channel_struct { ssh_session session; /* SSH_SESSION pointer */ uint32_t local_channel; uint32_t local_window; int local_eof; uint32_t local_maxpacket; uint32_t remote_channel; uint32_t remote_window; int remote_eof; /* end of file received */ uint32_t remote_maxpacket; enum ssh_channel_state_e state; int delayed_close; int flags; ssh_buffer stdout_buffer; ssh_buffer stderr_buffer; void *userarg; int version; int exit_status; enum ssh_channel_request_state_e request_state; struct ssh_list *callbacks; /* list of ssh_channel_callbacks */ /* counters */ ssh_counter counter; }; SSH_PACKET_CALLBACK(ssh_packet_channel_open_conf); SSH_PACKET_CALLBACK(ssh_packet_channel_open_fail); SSH_PACKET_CALLBACK(ssh_packet_channel_success); SSH_PACKET_CALLBACK(ssh_packet_channel_failure); SSH_PACKET_CALLBACK(ssh_request_success); SSH_PACKET_CALLBACK(ssh_request_denied); SSH_PACKET_CALLBACK(channel_rcv_change_window); SSH_PACKET_CALLBACK(channel_rcv_eof); SSH_PACKET_CALLBACK(channel_rcv_close); SSH_PACKET_CALLBACK(channel_rcv_request); SSH_PACKET_CALLBACK(channel_rcv_data); ssh_channel ssh_channel_new(ssh_session session); int channel_default_bufferize(ssh_channel channel, void *data, int len, int is_stderr); int ssh_channel_flush(ssh_channel channel); uint32_t ssh_channel_new_id(ssh_session session); ssh_channel ssh_channel_from_local(ssh_session session, uint32_t id); void ssh_channel_do_free(ssh_channel channel); #ifdef WITH_SSH1 SSH_PACKET_CALLBACK(ssh_packet_data1); SSH_PACKET_CALLBACK(ssh_packet_close1); SSH_PACKET_CALLBACK(ssh_packet_exist_status1); /* channels1.c */ int ssh_channel_open_session1(ssh_channel channel); int ssh_channel_request_pty_size1(ssh_channel channel, const char *terminal, int cols, int rows); int ssh_channel_change_pty_size1(ssh_channel channel, int cols, int rows); int ssh_channel_request_shell1(ssh_channel channel); int ssh_channel_request_exec1(ssh_channel channel, const char *cmd); int ssh_channel_write1(ssh_channel channel, const void *data, int len); ssh_channel ssh_get_channel1(ssh_session session); #endif #endif /* CHANNELS_H_ */
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #ifndef KUDU_CODEGEN_COMPILATION_MANAGER_H #define KUDU_CODEGEN_COMPILATION_MANAGER_H #include <cstdint> #include "kudu/codegen/code_generator.h" #include "kudu/codegen/code_cache.h" #include "kudu/gutil/gscoped_ptr.h" #include "kudu/gutil/macros.h" #include "kudu/gutil/ref_counted.h" #include "kudu/gutil/singleton.h" #include "kudu/util/atomic.h" #include "kudu/util/status.h" namespace kudu { class MetricEntity; class Schema; class ThreadPool; namespace codegen { class RowProjector; // The compilation manager is a top-level class which manages the actual // delivery of a code generator's output by maintaining its own // threadpool and code cache. It accepts requests to compile various classes // (all the ones that the CodeGenerator offers) and attempts to retrieve a // cached copy. If no such copy exists, it adds a request to generate it. // // Class is thread safe. // // The compilation manager is available as a global singleton only because // it is intended to be used on a per-tablet-server basis. While in // certain unit tests (that don't depend on compilation performance), // there may be multiple TSs per processes, this will not occur in a // distributed enviornment, where each TS has its own process. // Furthermore, using a singleton ensures that lower-level classes which // depend on code generation need not depend on a top-level class which // instantiates them to provide a compilation manager. This avoids many // unnecessary dependencies on state and lifetime of top-level and // intermediary classes which should not be aware of the code generation's // use in the first place. class CompilationManager { public: // Waits for all async tasks to finish. ~CompilationManager(); static CompilationManager* GetSingleton() { return Singleton<CompilationManager>::get(); } // If a codegenned row projector with compatible schemas (see // codegen::JITSchemaPair::ProjectionsCompatible) is ready, // then it is written to 'out' and true is returned. // Otherwise, this enqueues a compilation task for the parameter // schemas in the CompilationManager's thread pool and returns // false. Upon any failure, false is returned. // Does not write to 'out' if false is returned. bool RequestRowProjector(const Schema* base_schema, const Schema* projection, gscoped_ptr<RowProjector>* out); // Waits for all asynchronous compilation tasks to finish. void Wait(); // Sets up a metric registry to observe the compilation manager's metrics. // This method is used instead of registering a counter with a given // registry because the CompilationManager is a singleton and there would // be lifetime issues if the manager was dependent on a single registry. Status StartInstrumentation(const scoped_refptr<MetricEntity>& metric_entity); private: friend class Singleton<CompilationManager>; CompilationManager(); static void Shutdown(); CodeGenerator generator_; CodeCache cache_; gscoped_ptr<ThreadPool> pool_; AtomicInt<int64_t> hit_counter_; AtomicInt<int64_t> query_counter_; static const int kThreadTimeoutMs = 100; DISALLOW_COPY_AND_ASSIGN(CompilationManager); }; } // namespace codegen } // namespace kudu #endif
#ifndef QPID_BUFFERREF_H #define QPID_BUFFERREF_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "qpid/RefCounted.h" #include <boost/intrusive_ptr.hpp> namespace qpid { /** Template for mutable or const buffer references */ template <class T> class BufferRefT { public: BufferRefT() : begin_(0), end_(0) {} BufferRefT(boost::intrusive_ptr<RefCounted> c, T* begin, T* end) : counter(c), begin_(begin), end_(end) {} template <class U> BufferRefT(const BufferRefT<U>& other) : counter(other.counter), begin_(other.begin_), end_(other.end_) {} T* begin() const { return begin_; } T* end() const { return end_; } /** Return a sub-buffer of the current buffer */ BufferRefT sub_buffer(T* begin, T* end) { assert(begin_ <= begin && begin <= end_); assert(begin_ <= end && end <= end_); assert(begin <= end); return BufferRefT(counter, begin, end); } private: boost::intrusive_ptr<RefCounted> counter; T* begin_; T* end_; }; /** * Reference to a mutable ref-counted buffer. */ typedef BufferRefT<char> BufferRef; /** * Reference to a const ref-counted buffer. */ typedef BufferRefT<const char> ConstBufferRef; } // namespace qpid #endif /*!QPID_BUFFERREF_H*/
/* $OpenBSD: umac128.c,v 1.2 2018/02/08 04:12:32 dtucker Exp $ */ #define UMAC_OUTPUT_LEN 16 #define umac_new umac128_new #define umac_update umac128_update #define umac_final umac128_final #define umac_delete umac128_delete #define umac_ctx umac128_ctx #include "umac.c"
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef QUANT_DECODE_OP_H_ #define QUANT_DECODE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor.h" #include "caffe2/core/typeid.h" namespace caffe2 { namespace { template <class CodebookT, class CodeT> void Decode( const TensorCPU& codebook, const TensorCPU& codes, /* optional */ const TensorCPU* const decoded_grad, TensorCPU* const output, bool resizeOnly) { CAFFE_ENFORCE(codebook.IsType<CodebookT>()); auto* cb_ptr = codebook.data<CodebookT>(); int cb_size = codebook.size(); CAFFE_ENFORCE(codes.IsType<CodeT>()); auto* code_ptr = codes.data<CodeT>(); if (decoded_grad == nullptr) { // Forward pass: decode and store codebook values in output. output->ResizeLike(codes); auto* out_ptr = output->mutable_data<CodebookT>(); if (resizeOnly) { return; } int sz = output->size(); for (int i = 0; i < sz; i++) { DCHECK_LE(*code_ptr, cb_size); *out_ptr++ = cb_ptr[*code_ptr++]; } } else { // Backward pass: decode and accumulate gradient w.r.t. codebook values. CAFFE_ENFORCE_EQ(codes.size(), decoded_grad->size()); auto* gradient_ptr = decoded_grad->data<CodebookT>(); auto* const gradient_end = gradient_ptr + decoded_grad->size(); CAFFE_ENFORCE_EQ(cb_size, output->size()); auto* out_ptr = output->mutable_data<CodebookT>(); while (gradient_ptr < gradient_end) { DCHECK_LE(*code_ptr, cb_size); out_ptr[*code_ptr++] += *gradient_ptr++; } } } #define REGISTER_DECODER(codebookType, codesType) \ { \ {TypeMeta::Id<codebookType>(), TypeMeta::Id<codesType>()}, \ [](const TensorCPU& codebook_, \ const TensorCPU& codes_, \ const TensorCPU* gradient_, \ TensorCPU* outDecoded_, \ bool resizeOnly_) { \ Decode<codebookType, codesType>( \ codebook_, codes_, gradient_, outDecoded_, resizeOnly_); \ } \ } inline void DecodeGeneral( const TensorCPU& codebook, const TensorCPU& codes, const TensorCPU* gradient, TensorCPU* outDecoded, bool resizeOnly) { const static std::map< std::pair<CaffeTypeId, CaffeTypeId>, std::function<void( const TensorCPU& codebook, const TensorCPU& codes, const TensorCPU* gradient, TensorCPU* outDecoded, bool resizeOnly)>> gDecoderMapper = {REGISTER_DECODER(float, uint8_t), REGISTER_DECODER(float, uint16_t), REGISTER_DECODER(float, int32_t)}; gDecoderMapper.at({codebook.meta().id(), codes.meta().id()})( codebook, codes, gradient, outDecoded, resizeOnly); } } // namespace // Decode tensors based on given codebook, // The codebook is generated by model_quantize.py enum class QuantDecodeRunTy { RUN_ALWAYS, RUN_ONCE, }; template <QuantDecodeRunTy QuantDecodeRun> class QuantDecodeOp final : public Operator<CPUContext> { public: USE_OPERATOR_FUNCTIONS(CPUContext); QuantDecodeOp(const OperatorDef& operator_def, Workspace* ws) : Operator<CPUContext>(operator_def, ws) {} ~QuantDecodeOp() {} bool RunOnDevice() override { CAFFE_ENFORCE_GT(InputSize(), 1); // first input is the codebook CAFFE_ENFORCE_EQ(InputSize(), OutputSize() + 1); const auto& codebook = Input(0); CAFFE_ENFORCE(codebook.template IsType<float>(), codebook.meta().name()); for (int i = 0; i < OutputSize(); i++) { auto& ci = Input(i + 1); auto* co = Output(i); DecodeGeneral( codebook, ci, nullptr, co, /*resizeOnly=*/QuantDecodeRun == QuantDecodeRunTy::RUN_ONCE && hasRun_); } hasRun_ = true; return true; } private: bool hasRun_{false}; }; class QuantDecodeGradientOp final : public Operator<CPUContext> { public: USE_OPERATOR_FUNCTIONS(CPUContext); QuantDecodeGradientOp(const OperatorDef& operator_def, Workspace* ws) : Operator<CPUContext>(operator_def, ws) {} ~QuantDecodeGradientOp() {} bool RunOnDevice() override { // Inputs: 1 codebook, n tensors of codes, and n corresponding gradients. CAFFE_ENFORCE(InputSize() >= 3 && InputSize() % 2 == 1); const int num_code_tensors = (InputSize() - 1) / 2; CAFFE_ENFORCE_EQ(OutputSize(), 1); const auto& codebook = Input(0); CAFFE_ENFORCE(codebook.template IsType<float>(), codebook.meta().name()); auto* gradient = Output(0); gradient->ResizeLike(codebook); auto* gradient_ptr = gradient->mutable_data<float>(); std::fill(gradient_ptr, gradient_ptr + gradient->size(), 0); for (int i = 0; i < num_code_tensors; i++) { auto& codes_i = Input(i + 1); auto& output_gradient_i = Input(i + num_code_tensors + 1); DecodeGeneral(codebook, codes_i, &output_gradient_i, gradient, false); } return true; } }; } // namespace caffe2 #endif // QUANT_DECODE_OP_H_
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/ds/DirectoryService_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace DirectoryService { namespace Model { enum class DirectoryStage { NOT_SET, Requested, Creating, Created, Active, Inoperable, Impaired, Restoring, RestoreFailed, Deleting, Deleted, Failed }; namespace DirectoryStageMapper { AWS_DIRECTORYSERVICE_API DirectoryStage GetDirectoryStageForName(const Aws::String& name); AWS_DIRECTORYSERVICE_API Aws::String GetNameForDirectoryStage(DirectoryStage value); } // namespace DirectoryStageMapper } // namespace Model } // namespace DirectoryService } // namespace Aws
// // MyCustomCellForSix.h // BYFCApp // // Created by zzs on 15/3/23. // Copyright (c) 2015年 PengLee. All rights reserved. // #import <UIKit/UIKit.h> @interface MyCustomCellForSix : UITableViewCell @property (weak, nonatomic) IBOutlet UIImageView *gou; @property (weak, nonatomic) IBOutlet UIImageView *zu; @property (weak, nonatomic) IBOutlet UILabel *name; @property (weak, nonatomic) IBOutlet UILabel *yixiang; @property (weak, nonatomic) IBOutlet UILabel *yixiangdu; @property (weak, nonatomic) IBOutlet UILabel *roomInfo; @property (weak, nonatomic) IBOutlet UILabel *yixiangPrice; @property (weak, nonatomic) IBOutlet UIImageView *jinglituijian; @property (weak, nonatomic) IBOutlet UIImageView *jixu; @property (weak, nonatomic) IBOutlet UIImageView *xuequfang; @property (weak, nonatomic) IBOutlet UIImageView *XX1; @property (weak, nonatomic) IBOutlet UIImageView *XX2; @property (weak, nonatomic) IBOutlet UIImageView *XX3; @property (weak, nonatomic) IBOutlet UIImageView *XX4; @property (weak, nonatomic) IBOutlet UIImageView *XX5; @property (weak, nonatomic) IBOutlet UIButton *xiaoqu; @property (weak, nonatomic) IBOutlet UIButton *pianqu; @property (weak, nonatomic) IBOutlet UIButton *genjin; @property (weak, nonatomic) IBOutlet UIButton *phoneBtn; - (IBAction)genjinBtn:(id)sender; - (IBAction)phoneBtn:(id)sender; - (IBAction)xiaoqu:(UIButton *)sender; - (IBAction)pianqu:(UIButton *)sender; @end
#include "../includes/MachDeps.h" #define UNIQUE_BITS (WORD_SIZE_IN_BITS - 8)
/* * Copyright (C) 2011, 2012, 2013 Citrix Systems * * 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. * 3. Neither the name of the project 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 PROJECT 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 PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __TURN_ULIB__ #define __TURN_ULIB__ #if !defined(TURN_LOG_FUNC) #define TURN_LOG_FUNC turn_log_func_default #endif #include "ns_turn_ioaddr.h" #ifdef __cplusplus extern "C" { #endif //////////////////////// LOG ////////////////////////// typedef enum { TURN_LOG_LEVEL_INFO = 0, TURN_LOG_LEVEL_CONTROL, TURN_LOG_LEVEL_WARNING, TURN_LOG_LEVEL_ERROR } TURN_LOG_LEVEL; #define TURN_VERBOSE_NONE (0) #define TURN_VERBOSE_NORMAL (1) #define TURN_VERBOSE_EXTRA (2) #define eve(v) ((v)==TURN_VERBOSE_EXTRA) void set_no_stdout_log(int val); void set_log_to_syslog(int val); void turn_log_func_default(TURN_LOG_LEVEL level, const s08bits* format, ...); void addr_debug_print(int verbose, const ioa_addr *addr, const s08bits* s); /* Log */ extern volatile int _log_time_value_set; extern volatile turn_time_t _log_time_value; void rtpprintf(const char *format, ...); int vrtpprintf(TURN_LOG_LEVEL level, const char *format, va_list args); void reset_rtpprintf(void); void set_logfile(const char *fn); void rollover_logfile(void); /////////////////////////////////////////////////////// #ifdef __cplusplus } #endif #endif //__TURN_ULIB__
// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the name Chromium Embedded // Framework nor the names of its contributors may be used to endorse // or promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool and should not edited // by hand. See the translator.README.txt file in the tools directory for // more information. // #ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ #pragma once #ifdef __cplusplus extern "C" { #endif #include "include/capi/cef_base_capi.h" /// // Launches the process specified via |command_line|. Returns true (1) upon // success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. // // Unix-specific notes: - All file descriptors open in the parent process will // be closed in the // child process except for stdin, stdout, and stderr. // - If the first argument on the command line does not contain a slash, // PATH will be searched. (See man execvp.) /// CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line); #ifdef __cplusplus } #endif #endif // CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
/* csrot.f -- translated by f2c (version 19991025). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "FLA_f2c.h" /* Subroutine */ int csrot_(integer *n, complex *cx, integer *incx, complex * cy, integer *incy, real *c__, real *s) { /* System generated locals */ integer i__1, i__2, i__3, i__4; complex q__1, q__2, q__3; /* Local variables */ integer i__; complex ctemp; integer ix, iy; /* applies a plane rotation, where the cos and sin (c and s) are real */ /* and the vectors cx and cy are complex. */ /* jack dongarra, linpack, 3/11/78. */ /* Parameter adjustments */ --cy; --cx; /* Function Body */ if (*n <= 0) { return 0; } if (*incx == 1 && *incy == 1) { goto L20; } /* code for unequal increments or equal increments not equal */ /* to 1 */ ix = 1; iy = 1; if (*incx < 0) { ix = (-(*n) + 1) * *incx + 1; } if (*incy < 0) { iy = (-(*n) + 1) * *incy + 1; } i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { i__2 = ix; q__2.r = *c__ * cx[i__2].r, q__2.i = *c__ * cx[i__2].i; i__3 = iy; q__3.r = *s * cy[i__3].r, q__3.i = *s * cy[i__3].i; q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; ctemp.r = q__1.r, ctemp.i = q__1.i; i__2 = iy; i__3 = iy; q__2.r = *c__ * cy[i__3].r, q__2.i = *c__ * cy[i__3].i; i__4 = ix; q__3.r = *s * cx[i__4].r, q__3.i = *s * cx[i__4].i; q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i; cy[i__2].r = q__1.r, cy[i__2].i = q__1.i; i__2 = ix; cx[i__2].r = ctemp.r, cx[i__2].i = ctemp.i; ix += *incx; iy += *incy; /* L10: */ } return 0; /* code for both increments equal to 1 */ L20: i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { i__2 = i__; q__2.r = *c__ * cx[i__2].r, q__2.i = *c__ * cx[i__2].i; i__3 = i__; q__3.r = *s * cy[i__3].r, q__3.i = *s * cy[i__3].i; q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; ctemp.r = q__1.r, ctemp.i = q__1.i; i__2 = i__; i__3 = i__; q__2.r = *c__ * cy[i__3].r, q__2.i = *c__ * cy[i__3].i; i__4 = i__; q__3.r = *s * cx[i__4].r, q__3.i = *s * cx[i__4].i; q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i; cy[i__2].r = q__1.r, cy[i__2].i = q__1.i; i__2 = i__; cx[i__2].r = ctemp.r, cx[i__2].i = ctemp.i; /* L30: */ } return 0; } /* csrot_ */
@import WMF.WMFLogging; @interface DDLog (WMFLogger) + (void)wmf_addLoggersForCurrentConfiguration; + (NSString *)wmf_currentLogFile; @end
/* Copyright (c) 2006, NIF File Format Library and Tools All rights reserved. Please see niflib.h for license. */ //-----------------------------------NOTICE----------------------------------// // Some of this file is automatically filled in by a Python script. Only // // add custom code in the designated areas or it will be overwritten during // // the next update. // //-----------------------------------NOTICE----------------------------------// #ifndef _BHKCONSTRAINT_H_ #define _BHKCONSTRAINT_H_ //--BEGIN FILE HEAD CUSTOM CODE--// //--END CUSTOM CODE--// #include "bhkSerializable.h" namespace Niflib { // Forward define of referenced NIF objects class bhkEntity; class bhkConstraint; typedef Ref<bhkConstraint> bhkConstraintRef; /*! Describes a physical constraint. */ class bhkConstraint : public bhkSerializable { public: /*! Constructor */ NIFLIB_API bhkConstraint(); /*! Destructor */ NIFLIB_API virtual ~bhkConstraint(); /*! * A constant value which uniquly identifies objects of this type. */ NIFLIB_API static const Type TYPE; /*! * A factory function used during file reading to create an instance of this type of object. * \return A pointer to a newly allocated instance of this type of object. */ NIFLIB_API static NiObject * Create(); /*! * Summarizes the information contained in this object in English. * \param[in] verbose Determines whether or not detailed information about large areas of data will be printed out. * \return A string containing a summary of the information within the object in English. This is the function that Niflyze calls to generate its analysis, so the output is the same. */ NIFLIB_API virtual string asString( bool verbose = false ) const; /*! * Used to determine the type of a particular instance of this object. * \return The type constant for the actual type of the object. */ NIFLIB_API virtual const Type & GetType() const; //--BEGIN MISC CUSTOM CODE--// /*! * Adds an entity to this bhkConstraint. */ NIFLIB_API void AddEntity( bhkEntity * obj ); /*! * Removes an entity from this bhkConstraint. */ NIFLIB_API void RemoveEntity( bhkEntity * obj ); /*! * Removes all entities from this bhkConstraint. */ NIFLIB_API void ClearEntities(); /*! * Retrieves all the entities attached to this bhkConstraint. */ NIFLIB_API vector< bhkEntity * > GetEntities() const; //--END CUSTOM CODE--// protected: /*! Number of bodies affected by this constraint. */ mutable unsigned int numEntities; /*! The entities affected by this constraint. */ vector<bhkEntity * > entities; /*! Usually 1. Higher values indicate higher priority of this constraint? */ unsigned int priority; public: /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ); /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info ) const; /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info ); /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const; /*! NIFLIB_HIDDEN function. For internal use only. */ NIFLIB_HIDDEN virtual list<NiObject *> GetPtrs() const; }; //--BEGIN FILE FOOT CUSTOM CODE--// //--END CUSTOM CODE--// } //End Niflib namespace #endif
#ifndef BACKENDS_NULL_H #define BACKENDS_NULL_H #include "backends/base.h" struct NullBackendFactory final : public BackendFactory { public: bool init() override; bool querySupport(BackendType type) override; std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; static BackendFactory &getFactory(); }; #endif /* BACKENDS_NULL_H */
/* * (C) Copyright 2009 * Marvell Semiconductor <www.marvell.com> * Written-by: Prafulla Wadaskar <prafulla@marvell.com> * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _KWCPU_H #define _KWCPU_H #include <asm/system.h> #ifndef __ASSEMBLY__ #define KWCPU_WIN_CTRL_DATA(size, target, attr, en) (en | (target << 4) \ | (attr << 8) | (kw_winctrl_calcsize(size) << 16)) #define KWGBE_PORT_SERIAL_CONTROL1_REG(_x) \ ((_x ? KW_EGIGA1_BASE : KW_EGIGA0_BASE) + 0x44c) #define KW_REG_PCIE_DEVID (KW_REG_PCIE_BASE + 0x00) #define KW_REG_PCIE_REVID (KW_REG_PCIE_BASE + 0x08) #define KW_REG_DEVICE_ID (KW_MPP_BASE + 0x34) #define KW_REG_SYSRST_CNT (KW_MPP_BASE + 0x50) #define SYSRST_CNT_1SEC_VAL (25*1000000) #define KW_REG_MPP_OUT_DRV_REG (KW_MPP_BASE + 0xE0) enum memory_bank { BANK0, BANK1, BANK2, BANK3 }; enum kwcpu_winen { KWCPU_WIN_DISABLE, KWCPU_WIN_ENABLE }; enum kwcpu_target { KWCPU_TARGET_RESERVED, KWCPU_TARGET_MEMORY, KWCPU_TARGET_1RESERVED, KWCPU_TARGET_SASRAM, KWCPU_TARGET_PCIE }; enum kwcpu_attrib { KWCPU_ATTR_SASRAM = 0x01, KWCPU_ATTR_DRAM_CS0 = 0x0e, KWCPU_ATTR_DRAM_CS1 = 0x0d, KWCPU_ATTR_DRAM_CS2 = 0x0b, KWCPU_ATTR_DRAM_CS3 = 0x07, KWCPU_ATTR_NANDFLASH = 0x2f, KWCPU_ATTR_SPIFLASH = 0x1e, KWCPU_ATTR_BOOTROM = 0x1d, KWCPU_ATTR_PCIE_IO = 0xe0, KWCPU_ATTR_PCIE_MEM = 0xe8 }; /* * Default Device Address MAP BAR values */ #define KW_DEFADR_PCI_MEM 0x90000000 #define KW_DEFADR_PCI_IO 0xC0000000 #define KW_DEFADR_PCI_IO_REMAP 0xC0000000 #define KW_DEFADR_SASRAM 0xC8010000 #define KW_DEFADR_NANDF 0xD8000000 #define KW_DEFADR_SPIF 0xE8000000 #define KW_DEFADR_BOOTROM 0xF8000000 /* * read feroceon/sheeva core extra feature register * using co-proc instruction */ static inline unsigned int readfr_extra_feature_reg(void) { unsigned int val; asm volatile ("mrc p15, 1, %0, c15, c1, 0 @ readfr exfr":"=r" (val)::"cc"); return val; } /* * write feroceon/sheeva core extra feature register * using co-proc instruction */ static inline void writefr_extra_feature_reg(unsigned int val) { asm volatile ("mcr p15, 1, %0, c15, c1, 0 @ writefr exfr"::"r" (val):"cc"); isb(); } /* * MBus-L to Mbus Bridge Registers * Ref: Datasheet sec:A.3 */ struct kwwin_registers { u32 ctrl; u32 base; u32 remap_lo; u32 remap_hi; }; /* * CPU control and status Registers * Ref: Datasheet sec:A.3.2 */ struct kwcpu_registers { u32 config; /*0x20100 */ u32 ctrl_stat; /*0x20104 */ u32 rstoutn_mask; /* 0x20108 */ u32 sys_soft_rst; /* 0x2010C */ u32 ahb_mbus_cause_irq; /* 0x20110 */ u32 ahb_mbus_mask_irq; /* 0x20114 */ u32 pad1[2]; u32 ftdll_config; /* 0x20120 */ u32 pad2; u32 l2_cfg; /* 0x20128 */ }; /* * GPIO Registers * Ref: Datasheet sec:A.19 */ struct kwgpio_registers { u32 dout; u32 oe; u32 blink_en; u32 din_pol; u32 din; u32 irq_cause; u32 irq_mask; u32 irq_level; }; /* * functions */ unsigned int mvebu_sdram_bar(enum memory_bank bank); unsigned int mvebu_sdram_bs(enum memory_bank bank); void mvebu_sdram_size_adjust(enum memory_bank bank); int kw_config_adr_windows(void); void mvebu_config_gpio(unsigned int gpp0_oe_val, unsigned int gpp1_oe_val, unsigned int gpp0_oe, unsigned int gpp1_oe); int kw_config_mpp(unsigned int mpp0_7, unsigned int mpp8_15, unsigned int mpp16_23, unsigned int mpp24_31, unsigned int mpp32_39, unsigned int mpp40_47, unsigned int mpp48_55); unsigned int kw_winctrl_calcsize(unsigned int sizeval); #endif /* __ASSEMBLY__ */ #endif /* _KWCPU_H */
//----------------------------------------------------------------------------- // Copyright (c) 2013 GarageGames, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- #ifndef _MEMSTREAM_H_ #define _MEMSTREAM_H_ //Includes #ifndef _STREAM_H_ #include "io/stream.h" #endif class MemStream : public Stream { typedef Stream Parent; protected: U32 const cm_bufferSize; void* m_pBufferBase; U32 m_instCaps; U32 m_currentPosition; public: MemStream(const U32 in_bufferSize, void* io_pBuffer, const bool in_allowRead = true, const bool in_allowWrite = true); ~MemStream(); // Mandatory overrides from Stream protected: bool _read(const U32 in_numBytes, void* out_pBuffer); bool _write(const U32 in_numBytes, const void* in_pBuffer); public: bool hasCapability(const Capability) const; U32 getPosition() const; bool setPosition(const U32 in_newPosition); // Mandatory overrides from Stream public: U32 getStreamSize(); }; #endif //_MEMSTREAM_H_
/************************************************************ * * Hyphenate CONFIDENTIAL * __________________ * Copyright (C) 2016 Hyphenate Inc. All rights reserved. * * NOTICE: All information contained herein is, and remains * the property of Hyphenate Inc. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Hyphenate Inc. */ #import <UIKit/UIKit.h> #import "IUserModel.h" #import "IModelCell.h" #import "EaseImageView.h" static CGFloat EaseUserCellMinHeight = 50; @protocol EaseUserCellDelegate; /** @brief 好友(用户)列表自定义UITableViewCell */ @interface EaseUserCell : UITableViewCell<IModelCell> @property (weak, nonatomic) id<EaseUserCellDelegate> delegate; /** @brief 头像 */ @property (strong, nonatomic) EaseImageView *avatarView; /** @brief 昵称(环信id) */ @property (strong, nonatomic) UILabel *titleLabel; /** @brief 用户model */ @property (strong, nonatomic) id<IUserModel> model; /** @brief 是否显示头像,默认为YES */ @property (nonatomic) BOOL showAvatar; /** @brief 当前cell在tabeleView的位置 */ @property (strong, nonatomic) NSIndexPath *indexPath; /** @brief titleLabel的字体 */ @property (nonatomic) UIFont *titleLabelFont UI_APPEARANCE_SELECTOR; /** @brief titleLabel的文字颜色 */ @property (nonatomic) UIColor *titleLabelColor UI_APPEARANCE_SELECTOR; @end /** @brief 好友(用户)列表自定义UITableViewCell */ @protocol EaseUserCellDelegate <NSObject> /*! @method @brief 选中的好友(用户)cell长按回调 @discussion @param indexPath 选中的cell所在位置 @result */ - (void)cellLongPressAtIndexPath:(NSIndexPath *)indexPath; @end