text
stringlengths
4
6.14k
// Created file "Lib\src\Uuid\oledbdat" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(DBSCHEMA_REFERENTIAL_CONSTRAINTS, 0xc8b52219, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
#define IDS_APP_TITLE 103 #define IDS_APP_CLASS 104 #define IDI_RIBBONAPP 107 #define IDI_SMALL 108
#pragma once #include <QObject> #include <QMap> #include <QString> class Interface : public QObject { Q_OBJECT public: Interface(QObject * parent = 0); virtual ~Interface(); virtual const QString & name() const = 0; virtual int connectInterface(Interface * other); virtual bool disconnectInterface(Interface * other); protected: virtual QMap<QString, const char *> declaredSignals() const = 0; virtual QMap<QString, const char *> declaredSlots() const = 0; };
/* * QuarkPlayer, a Phonon media player * Copyright (C) 2008-2009 Tanguy Krotoff <tkrotoff@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MAINWINDOWEXPORT_H #define MAINWINDOWEXPORT_H #include <QtCore/QtGlobal> #ifdef QT_STATICPLUGIN //This library is a static plugin #define MAINWINDOW_API #else #ifdef BUILD_MAINWINDOW //We are building this library #define MAINWINDOW_API Q_DECL_EXPORT #else //We are using this library #define MAINWINDOW_API Q_DECL_IMPORT #endif #endif #endif //MAINWINDOWEXPORT_H
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** 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 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. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef ABSTRACTTESTSUITE_H #define ABSTRACTTESTSUITE_H #include <QtCore/qobject.h> #include <QtCore/qbytearray.h> #include <QtCore/qdir.h> #include <QtCore/qscopedpointer.h> #include <QtCore/qstring.h> #include <QtCore/qstringlist.h> #include <QtCore/qvector.h> #include <QtCore/qtextstream.h> QT_FORWARD_DECLARE_CLASS(QMetaObjectBuilder) namespace TestConfig { enum Mode { Skip, ExpectFail }; } // For receiving callbacks from the config parser. class TestConfigClientInterface { public: virtual ~TestConfigClientInterface() {} virtual void configData(TestConfig::Mode mode, const QStringList &parts) = 0; virtual void configError(const QString &path, const QString &message, int lineNumber) = 0; }; class AbstractTestSuite : public QObject, public TestConfigClientInterface { // No Q_OBJECT macro, we implement the meta-object ourselves. public: AbstractTestSuite(const QByteArray &className, const QString &defaultTestsPath, const QString &defaultConfigPath); virtual ~AbstractTestSuite(); virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **argv); static QString readFile(const QString &); static QString escape(const QString &); protected: enum DataFunctionCreation { DontCreateDataFunction, CreateDataFunction }; void addTestFunction(const QString &, DataFunctionCreation = DontCreateDataFunction); void finalizeMetaObject(); virtual void initTestCase(); virtual void cleanupTestCase(); virtual void writeSkipConfigFile(QTextStream &) = 0; virtual void writeExpectFailConfigFile(QTextStream &) = 0; virtual void runTestFunction(int index) = 0; virtual void configError(const QString &path, const QString &message, int lineNumber); QDir testsDir; bool shouldGenerateExpectedFailures; private: static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); void addPrivateSlot(const QByteArray &signature); QMetaObject *dynamicMetaObject; QScopedPointer<QMetaObjectBuilder> metaBuilder; QString skipConfigPath, expectFailConfigPath; private: void createSkipConfigFile(); void createExpectFailConfigFile(); }; #endif
/**************************************************************************** * KONOHA COPYRIGHT, LICENSE NOTICE, AND DISCRIMER * * Copyright (c) 2010- Konoha Team konohaken@googlegroups.com * All rights reserved. * * You may choose one of the following two licenses when you use konoha. * See www.konohaware.org/license.html for further information. * * (1) GNU Lesser General Public License 3.0 (with KONOHA_UNDER_LGPL3) * (2) Konoha Software Foundation License 1.0 * * 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. * ****************************************************************************/ // ************************************************************************** // LIST OF CONTRIBUTERS // kimio - Kimio Kuramitsu, Yokohama National University, Japan // yukkiwakka - Yuuki Wakamatsu, Yokohama National University, Japan // ************************************************************************** #define K_INTERNAL #include <konoha1.h> #ifdef __cplusplus extern "C" { #endif /* ======================================================================== */ // [private functions] typedef struct { kcontext_t *ctx; kthread_t thread; kFunc *func; kArray *args; } Thread_t; static void *spawn_start(void *v) { Thread_t *t = (Thread_t *)v; kcontext_t *ctx = t->ctx; KONOHA_BEGIN(ctx); // set ExceptionHandler //kExceptionHandler* hdr = new_(ExceptionHandler); //ctx->esp[0].hdr = hdr; //ctx->esp++; // set args ksfp_t *sfp = ctx->esp; int i, argc = knh_Array_size(t->args); for(i=0; i<argc; i++) { kObject *o = knh_Array_n(t->args, i); switch(O_cid(o)) { case CLASS_Int: sfp[K_CALLDELTA + i + 1].ivalue = N_toint(o); break; case CLASS_Float: sfp[K_CALLDELTA + i + 1].fvalue = N_tofloat(o); break; case CLASS_Boolean: sfp[K_CALLDELTA + i + 1].bvalue = N_tobool(o); break; default: KNH_SETv(ctx, sfp[K_CALLDELTA + i + 1].o, o); } } knh_Func_invoke(ctx, t->func, sfp, argc); //int jump = knh_setjmp(DP(hdr)->jmpbuf); //if(jump == 0) { // hdr->espidx = (ctx->esp - ctx->stack); // hdr->parentNC = ctx->ehdrNC; // ((kcontext_t*)ctx)->ehdrNC = hdr; // knh_Func_invoke(ctx, t->func, sfp, argc); //} else { // /* catch exception */ // hdr = ctx->ehdrNC; // ((kcontext_t*)ctx)->ehdrNC = hdr->parentNC; //} //kthread_detach(ctx, t->thread); //KNH_FREE(ctx, t, sizeof(Thread_t)); KNH_SYSLOCK(ctx); ctx->ctxobjNC = NULL; ctx->wshare->threadCounter--; KONOHA_END(ctx); if(ctx->share->gcStopCounter != 0) { kthread_cond_signal(ctx->share->start_cond); }else if(ctx->share->threadCounter == 1) { kthread_cond_signal(ctx->share->close_cond); } KNH_SYSUNLOCK(ctx); return NULL; } static void Mutex_init(CTX ctx, kRawPtr *po) { po->rawptr = NULL; } static void Mutex_free(CTX ctx, kRawPtr *po) { if(po->rawptr != NULL) { knh_mutex_free(ctx, (kmutex_t *)po->rawptr); po->rawptr = NULL; } } /* ======================================================================== */ // [KMETHODS] //## @Native Thread Thread.spawn(dynamic f, dynamic[] args) KMETHOD Thread_spawn(CTX ctx, ksfp_t *sfp _RIX) { kFunc *f = sfp[1].fo; kArray *args = sfp[2].a; if(IS_NOTNULL(((kObject *)f))) { Thread_t *t = (Thread_t *)KNH_MALLOC(ctx, sizeof(Thread_t)); kcontext_t *newCtx = new_ThreadContext(WCTX(ctx)); t->ctx = newCtx; t->func = f; t->args = args; kthread_create(ctx, &(t->thread), NULL, spawn_start, t); RETURN_(new_ReturnRawPtr(ctx, sfp, t)); } } //## @Native void Thread.join(); KMETHOD Thread_join(CTX ctx, ksfp_t *sfp _RIX) { Thread_t *t = RawPtr_to(Thread_t *, sfp[0]); void *v; KNH_SYSLOCK(ctx); ctx->wshare->stopCounter++; if(ctx->share->gcStopCounter != 0) { kthread_cond_signal(ctx->share->start_cond); } KNH_SYSUNLOCK(ctx); kthread_join(ctx, t->thread, &v); KNH_SYSLOCK(ctx); ctx->wshare->stopCounter--; KNH_SYSUNLOCK(ctx); RETURNvoid_(); } //## @Native void Object.synchronized()(dynamic f, dynamic[] args) KMETHOD Object_synchronized(CTX ctx, ksfp_t *sfp _RIX) { // TODO RETURNvoid_(); } //## @Native Mutex Mutex.new() KMETHOD Mutex_new(CTX ctx, ksfp_t *sfp _RIX) { kRawPtr *p = sfp[0].p; p->rawptr = (void *)knh_mutex_malloc(ctx); RETURN_(p); } //## @Native void Mutex.lock() KMETHOD Mutex_lock(CTX ctx, ksfp_t *sfp _RIX) { kmutex_t *m = RawPtr_to(kmutex_t *, sfp[0]); KNH_SYSLOCK(ctx); ctx->wshare->stopCounter++; if(ctx->share->gcStopCounter != 0) { kthread_cond_signal(ctx->share->start_cond); } KNH_SYSUNLOCK(ctx); knh_mutex_lock(m); KNH_SYSLOCK(ctx); ctx->wshare->stopCounter--; KNH_SYSUNLOCK(ctx); RETURNvoid_(); } //## @Native void Mutex.unlock() KMETHOD Mutex_unlock(CTX ctx, ksfp_t *sfp _RIX) { kmutex_t *m = RawPtr_to(kmutex_t *, sfp[0]); knh_mutex_unlock(m); RETURNvoid_(); } /* ======================================================================== */ // [DEFAPI] DEFAPI(void) defThread(CTX ctx, kclass_t cid, kclassdef_t *cdef) { cdef->name = "Thread"; } DEFAPI(void) defMutex(CTX ctx, kclass_t cid, kclassdef_t *cdef) { cdef->name = "Mutex"; cdef->init = Mutex_init; cdef->free = Mutex_free; } #ifdef _SETUP DEFAPI(const knh_PackageDef_t*) init(CTX ctx, knh_LoaderAPI_t *kapi) { RETURN_PKGINFO("konoha.thread"); } #endif /* _SETUP */ #ifdef __cplusplus } #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTAPPLICATIONSRESPONSE_H #define QTAWS_LISTAPPLICATIONSRESPONSE_H #include "kinesisanalyticsresponse.h" #include "listapplicationsrequest.h" namespace QtAws { namespace KinesisAnalytics { class ListApplicationsResponsePrivate; class QTAWSKINESISANALYTICS_EXPORT ListApplicationsResponse : public KinesisAnalyticsResponse { Q_OBJECT public: ListApplicationsResponse(const ListApplicationsRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const ListApplicationsRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(ListApplicationsResponse) Q_DISABLE_COPY(ListApplicationsResponse) }; } // namespace KinesisAnalytics } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_REBALANCESLOTSINGLOBALREPLICATIONGROUPREQUEST_H #define QTAWS_REBALANCESLOTSINGLOBALREPLICATIONGROUPREQUEST_H #include "elasticacherequest.h" namespace QtAws { namespace ElastiCache { class RebalanceSlotsInGlobalReplicationGroupRequestPrivate; class QTAWSELASTICACHE_EXPORT RebalanceSlotsInGlobalReplicationGroupRequest : public ElastiCacheRequest { public: RebalanceSlotsInGlobalReplicationGroupRequest(const RebalanceSlotsInGlobalReplicationGroupRequest &other); RebalanceSlotsInGlobalReplicationGroupRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(RebalanceSlotsInGlobalReplicationGroupRequest) }; } // namespace ElastiCache } // namespace QtAws #endif
/*---------------------------------------------------------------------- * Purpose: * Get Modules IOCTL. * * Copyright: * 2008-2009, Johannes Passing (passing at users.sourceforge.net) * * This file is part of cfix. * * cfix is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * cfix 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 cfix. If not, see <http://www.gnu.org/licenses/>. */ #include <cfix.h> #include <cfixkrio.h> #include <stdlib.h> #include "util.h" void ListModulesInvalidRequestSize() { HANDLE Dev; DWORD Cb; ULONG Req; CFIXKR_IOCTL_GET_MODULES Res; CFIX_ASSERT_EQUALS_DWORD( ERROR_SUCCESS, LoadReflector() ); __try { Dev = CreateFile( L"\\\\.\\Cfixkr", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); CFIX_ASSERT( Dev != INVALID_HANDLE_VALUE ); CFIX_ASSERT( ! DeviceIoControl( Dev, CFIXKR_IOCTL_GET_TEST_MODULES, &Req, sizeof( ULONG ), // should be 0. &Res, sizeof( CFIXKR_IOCTL_GET_MODULES ), &Cb, NULL ) ); CFIX_ASSERT_EQUALS_DWORD( ERROR_INVALID_PARAMETER, GetLastError() ); CFIX_ASSERT( CloseHandle( Dev ) ); } __finally { UnloadDriver( L"cfixkr" ); } } void ListModulesInvalidResponseSize() { HANDLE Dev; DWORD Cb; ULONG Res; CFIX_ASSERT_EQUALS_DWORD( ERROR_SUCCESS, LoadReflector() ); __try { Dev = CreateFile( L"\\\\.\\Cfixkr", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); CFIX_ASSERT( Dev != INVALID_HANDLE_VALUE ); CFIX_ASSERT( ! DeviceIoControl( Dev, CFIXKR_IOCTL_GET_TEST_MODULES, NULL, 0, &Res, sizeof( ULONG ), // too small &Cb, NULL ) ); CFIX_ASSERT_EQUALS_DWORD( ERROR_INVALID_PARAMETER, GetLastError() ); CFIX_ASSERT( CloseHandle( Dev ) ); } __finally { UnloadDriver( L"cfixkr" ); } } void ListModulesExpectEmptyResponse() { HANDLE Dev; DWORD Cb; CFIXKR_IOCTL_GET_MODULES Res; CFIX_ASSERT_EQUALS_DWORD( ERROR_SUCCESS, LoadReflector() ); __try { Dev = CreateFile( L"\\\\.\\Cfixkr", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); CFIX_ASSERT( Dev != INVALID_HANDLE_VALUE ); CFIX_ASSERT( DeviceIoControl( Dev, CFIXKR_IOCTL_GET_TEST_MODULES, NULL, 0, &Res, sizeof( CFIXKR_IOCTL_GET_MODULES ), &Cb, NULL ) ); CFIX_ASSERT( CloseHandle( Dev ) ); CFIX_ASSERT( Cb == sizeof( ULONG ) ); CFIX_ASSERT( Res.Count == 0 ); } __finally { UnloadDriver( L"cfixkr" ); } } void ListModulesExpectOneResponse() { HANDLE Dev; DWORD Cb; CFIXKR_IOCTL_GET_MODULES Res; CFIX_ASSERT_EQUALS_DWORD( ERROR_SUCCESS, LoadReflector() ); CFIX_ASSERT_EQUALS_DWORD( ERROR_SUCCESS, LoadDriver( L"testklib1", L"testklib1.sys" ) ); __try { Dev = CreateFile( L"\\\\.\\Cfixkr", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); CFIX_ASSERT( Dev != INVALID_HANDLE_VALUE ); CFIX_ASSERT( DeviceIoControl( Dev, CFIXKR_IOCTL_GET_TEST_MODULES, NULL, 0, &Res, sizeof( CFIXKR_IOCTL_GET_MODULES ), &Cb, NULL ) ); CFIX_ASSERT( CloseHandle( Dev ) ); CFIX_ASSERT_EQUALS_DWORD( sizeof( CFIXKR_IOCTL_GET_MODULES ), Cb ); CFIX_ASSERT( Res.Count == 1 ); CFIX_ASSERT( Res.DriverLoadAddress[ 0 ] & 0x80000000 ); CFIX_ASSERT( ( Res.DriverLoadAddress[ 0 ] & 0x00000FFF ) == 0 ); } __finally { UnloadDriver( L"cfixkr" ); UnloadDriver( L"testklib1" ); } } void ListModulesExpectOverflow() { HANDLE Dev; DWORD Cb; CFIXKR_IOCTL_GET_MODULES Res; CFIX_ASSERT_EQUALS_DWORD( ERROR_SUCCESS, LoadReflector() ); CFIX_ASSERT_EQUALS_DWORD( ERROR_SUCCESS, LoadDriver( L"testklib1", L"testklib1.sys" ) ); CFIX_ASSERT_EQUALS_DWORD( ERROR_SUCCESS, LoadDriver( L"testklib2", L"testklib2.sys" ) ); __try { Dev = CreateFile( L"\\\\.\\Cfixkr", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); CFIX_ASSERT( Dev != INVALID_HANDLE_VALUE ); CFIX_ASSERT( ! DeviceIoControl( Dev, CFIXKR_IOCTL_GET_TEST_MODULES, NULL, 0, &Res, sizeof( Res ), &Cb, NULL ) ); CFIX_ASSERT_EQUALS_DWORD( ERROR_MORE_DATA, GetLastError() ); CFIX_ASSERT( CloseHandle( Dev ) ); CFIX_ASSERT_EQUALS_DWORD( sizeof( Res ), Cb ); CFIX_ASSERT_EQUALS_DWORD( 2, Res.Count ); CFIX_ASSERT( Res.DriverLoadAddress[ 0 ] & 0x80000000 ); CFIX_ASSERT( ( Res.DriverLoadAddress[ 0 ] & 0x00000FFF ) == 0 ); } __finally { UnloadDriver( L"cfixkr" ); UnloadDriver( L"testklib1" ); UnloadDriver( L"testklib2" ); } } CFIX_BEGIN_FIXTURE( GetModulesIoctl ) CFIX_FIXTURE_ENTRY( ListModulesInvalidRequestSize ) CFIX_FIXTURE_ENTRY( ListModulesInvalidResponseSize ) CFIX_FIXTURE_ENTRY( ListModulesExpectEmptyResponse ) CFIX_FIXTURE_ENTRY( ListModulesExpectOneResponse ) CFIX_FIXTURE_ENTRY( ListModulesExpectOverflow ) CFIX_END_FIXTURE()
/* -*- C++ -*- */ #ifndef SITES_H #define SITES_H #include "itype.h" #include "Dirs.h" #include "Site.h" #include "T2Constants.h" #include "T2Types.h" namespace MFM { struct Sites { OurT2Site * getSiteArray() { return &mTheSites[0][0]; } OurT2Site& get(UPoint at) { MFM_API_ASSERT_ARG(at.BoundedAbove(UPoint(T2TILE_WIDTH-1,T2TILE_HEIGHT-1))); return mTheSites[at.GetY()][at.GetX()]; } const OurT2Site& get(UPoint at) const { MFM_API_ASSERT_ARG(at.BoundedAbove(UPoint(T2TILE_WIDTH-1,T2TILE_HEIGHT-1))); return mTheSites[at.GetY()][at.GetX()]; } Sites() ; private: typedef OurT2Site OurT2Sites[T2TILE_HEIGHT][T2TILE_WIDTH]; OurT2Sites mTheSites; }; } #endif /* SITES_H */
/* This file is part of whistler * * Copyright (C) 2007-2008 Sebastian Dröge <slomo@upb.de> * * Whistler is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * Whistler 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 Lesser General Public * License along with Whistler. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __WHS_UTILS_H__ #define __WHS_UTILS_H__ #include <glib.h> G_BEGIN_DECLS inline static gfloat GFLOAT_SWAP_LE_BE(gfloat in) { union { guint32 i; gfloat f; } u; u.f = in; u.i = GUINT32_SWAP_LE_BE (u.i); return u.f; } G_GNUC_CONST inline static gdouble GDOUBLE_SWAP_LE_BE(gdouble in) { union { guint64 i; gdouble d; } u; u.d = in; u.i = GUINT64_SWAP_LE_BE (u.i); return u.d; } G_GNUC_CONST #if G_BYTE_ORDER == G_LITTLE_ENDIAN #define GFLOAT_TO_LE(val) ((gfloat) (val)) #define GFLOAT_TO_BE(val) (GFLOAT_SWAP_LE_BE (val)) #define GDOUBLE_TO_LE(val) ((gdouble) (val)) #define GDOUBLE_TO_BE(val) (GDOUBLE_SWAP_LE_BE (val)) #elif G_BYTE_ORDER == G_BIG_ENDIAN #define GFLOAT_TO_LE(val) (GFLOAT_SWAP_LE_BE (val)) #define GFLOAT_TO_BE(val) ((gfloat) (val)) #define GDOUBLE_TO_LE(val) (GDOUBLE_SWAP_LE_BE (val)) #define GDOUBLE_TO_BE(val) ((gdouble) (val)) #else /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */ #error unknown ENDIAN type #endif /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */ #define GFLOAT_FROM_LE(val) (GFLOAT_TO_LE (val)) #define GFLOAT_FROM_BE(val) (GFLOAT_TO_BE (val)) #define GDOUBLE_FROM_LE(val) (GDOUBLE_TO_LE (val)) #define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val)) G_END_DECLS #endif /* __WHS_UTILS_H__ */
// Created file "Lib\src\Uuid\X64\propkeys" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_ItemName, 0x6b8da074, 0x3b5c, 0x43bc, 0x88, 0x6f, 0x0a, 0x2c, 0xdc, 0xe0, 0x0b, 0x6f);
// // OrderItem.h // MRROrders // // Created by iotek IOTEK on 15-3-27. // Copyright (c) 2015年 __MyCompanyName__. All rights reserved. // #import <Foundation/Foundation.h> @interface OrderItem : NSObject{ @public NSString* name; } -(id) initWithName:(NSString*) itemName; @end
/* * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc. * * This file is part of Jam - see jam.c for Copyright information. */ /* This file is ALSO: * Copyright 2001-2004 David Abrahams. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) */ # include "jam.h" # include "lists.h" # include "search.h" # include "timestamp.h" # include "pathsys.h" # include "variable.h" # include "newstr.h" # include "compile.h" # include "strings.h" # include "hash.h" # include <string.h> typedef struct _binding { char* binding; char* target; } BINDING; static struct hash *explicit_bindings = 0; void call_bind_rule( char* target_, char* boundname_ ) { LIST* bind_rule = var_get( "BINDRULE" ); if( bind_rule ) { /* No guarantee that target is an allocated string, so be on the * safe side */ char* target = copystr( target_ ); /* Likewise, don't rely on implementation details of newstr.c: allocate * a copy of boundname */ char* boundname = copystr( boundname_ ); if( boundname && target ) { /* Prepare the argument list */ FRAME frame[1]; frame_init( frame ); /* First argument is the target name */ lol_add( frame->args, list_new( L0, target ) ); lol_add( frame->args, list_new( L0, boundname ) ); if( lol_get( frame->args, 1 ) ) evaluate_rule( bind_rule->string, frame ); /* Clean up */ frame_free( frame ); } else { if( boundname ) freestr( boundname ); if( target ) freestr( target ); } } } /* * search.c - find a target along $(SEARCH) or $(LOCATE) * First, check if LOCATE is set. If so, use it to determine * the location of target and return, regardless of whether anything * exists on that location. * * Second, examine all directories in SEARCH. If there's file already * or there's another target with the same name which was placed * to this location via LOCATE setting, stop and return the location. * In case of previous target, return it's name via the third argument. * * This bevahiour allow to handle dependency on generated files. If * caller does not expect that target is generated, 0 can be passed as * the third argument. */ char * search( char *target, time_t *time, char **another_target ) { PATHNAME f[1]; LIST *varlist; string buf[1]; int found = 0; /* Will be set to 1 if target location is specified via LOCATE. */ int explicitly_located = 0; char *boundname = 0; if( another_target ) *another_target = 0; if (! explicit_bindings ) explicit_bindings = hashinit( sizeof(BINDING), "explicitly specified locations"); string_new( buf ); /* Parse the filename */ path_parse( target, f ); f->f_grist.ptr = 0; f->f_grist.len = 0; if( varlist = var_get( "LOCATE" ) ) { f->f_root.ptr = varlist->string; f->f_root.len = strlen( varlist->string ); path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "locate %s: %s\n", target, buf->value ); explicitly_located = 1; timestamp( buf->value, time ); found = 1; } else if( varlist = var_get( "SEARCH" ) ) { while( varlist ) { BINDING b, *ba = &b; f->f_root.ptr = varlist->string; f->f_root.len = strlen( varlist->string ); string_truncate( buf, 0 ); path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "search %s: %s\n", target, buf->value ); timestamp( buf->value, time ); b.binding = buf->value; if( hashcheck( explicit_bindings, (HASHDATA**)&ba ) ) { if( DEBUG_SEARCH ) printf(" search %s: found explicitly located target %s\n", target, ba->target); if( another_target ) *another_target = ba->target; found = 1; break; } else if( *time ) { found = 1; break; } varlist = list_next( varlist ); } } if (!found) { /* Look for the obvious */ /* This is a questionable move. Should we look in the */ /* obvious place if SEARCH is set? */ f->f_root.ptr = 0; f->f_root.len = 0; string_truncate( buf, 0 ); path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "search %s: %s\n", target, buf->value ); timestamp( buf->value, time ); } boundname = newstr( buf->value ); string_free( buf ); if (explicitly_located) { BINDING b, *ba = &b; b.binding = boundname; b.target = target; /* CONSIDER: we probably should issue a warning is another file is explicitly bound to the same location. This might break compatibility, though. */ hashenter(explicit_bindings, (HASHDATA**)&ba); } /* prepare a call to BINDRULE if the variable is set */ call_bind_rule( target, boundname ); return boundname; }
/* A Bison parser, made by GNU Bison 2.4.2. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 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/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NAME = 258, COMMA = 259, COLON = 260, SEMICOLON = 261 }; #endif /* Tokens. */ #define NAME 258 #define COMMA 259 #define COLON 260 #define SEMICOLON 261 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 1685 of yacc.c */ #line 20 "syntax_hlowfn_final.yy" char* str; /* Line 1685 of yacc.c */ #line 69 "syntax_hlowfn_final.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE hlowfn_final_lval;
/***************************************************************************** * Copyright (C) 2008-2013 Ana-Maria Visan, Kapil Arya, and Gene Cooperman * * amvisan@cs.neu.edu, kapil@cs.neu.edu, and gene@ccs.neu.edu * * * * This file is part of the PTRACE plugin of DMTCP (DMTCP:plugin/ptrace). * * * * DMTCP:mtcp is free software: you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * * DMTCP:plugin/ptrace 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 DMTCP:dmtcp/src. If not, see * * <http://www.gnu.org/licenses/>. * *****************************************************************************/ #ifndef PTRACE_H #define PTRACE_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "dmtcp.h" #ifndef EXTERNC # ifdef __cplusplus # define EXTERNC extern "C" # else # define EXTERNC # endif #endif #define LIB_PRIVATE __attribute__ ((visibility ("hidden"))) #define _real_wait4 NEXT_FNC(wait4) #define _real_open NEXT_FNC(open) #define _real_lseek NEXT_FNC(lseek) #define _real_unlink NEXT_FNC(unlink) #define _real_dup2 NEXT_FNC(dup2) #define _real_mmap NEXT_FNC(mmap) #define _real_ptrace(request, pid, addr, data) \ NEXT_FNC(ptrace)((enum __ptrace_request) request, pid, addr, data) #define GETTID() (int)syscall(SYS_gettid) #define TGKILL(pid, tid, sig) (int)syscall(SYS_tgkill, pid, tid, sig) typedef enum PtraceProcState { PTRACE_PROC_INVALID = -1, PTRACE_PROC_UNDEFINED = 'u', PTRACE_PROC_STOPPED = 'T', PTRACE_PROC_TRACING_STOP = 'P', PTRACE_PROC_RUNNING = 'R', PTRACE_PROC_SLEEPING = 'S' } PtraceProcState; pid_t ptrace_ckpt_thread_tid(); void ptrace_process_pre_suspend_user_thread(); void ptrace_process_thread_creation(pid_t clone_id); void ptrace_process_resume_user_thread(int isRestart); #endif
#include <stdio.h> #include <string.h> #include "sharemem.h" int shm_id,msg_id; void terminate_handler() { msgctl(msg_id,IPC_RMID,NULL); shmctl(shm_id,IPC_RMID,NULL); exit(0); } void initial_writer() { key_t msg_key,shm_key; /* generate share keys */ shm_key = ftok(fileshm, PROJID); msg_key = ftok(filemsg, PROJID); if(shm_key == -1 || msg_key == -1) { perror ("ftok"); exit(0); } /* create shared memory tunnel */ shm_id = shmget(shm_key, MEMORYSIZE * (sizeof(Data)), IPC_CREAT | IPC_EXCL | 0600); if(shm_id == -1) { perror("shmget error"); exit(0); } /* create message queue */ msg_id = msgget(msg_key, IPC_CREAT | IPC_EXCL | 0600); if(msg_id == -1) { perror("msgget error"); exit(0); } } void writer_function(uint32_t head, uint32_t tail, Data *p_map) { /* write data to ring buffer */ FILE *pFile; pFile = fopen ("memtrace_gem","r+"); while( fscanf(pFile,"%u %x %u", &(p_map+tail)->cpuid, &(p_map+tail)->addr, &(p_map+tail)->index) == 3 ) { /* check buffer is full or not */ while (1) { head = (p_map + MEMORYSIZE - 2)->index; if( (tail + 1 + OFFSET) > MEMORYSIZE - 2 ) { if( head > OFFSET) break; } else { if( tail == head || head - tail < OFFSET ) break; } } /* move tail pointer to next address */ tail = (tail + 1) % (MEMORYSIZE - 2); (p_map + MEMORYSIZE - 1)->index = tail; } fclose(pFile); } int main(int argc, char** argv) { signal(SIGINT, terminate_handler); signal(SIGTERM, terminate_handler); initial_writer(); uint32_t head, tail; Data *p_map; tail = 0; head = 0; /* initial share memory pointers */ p_map = (Data*)shmat( shm_id, NULL, 0); (p_map + MEMORYSIZE - 2)->cpuid = head; (p_map + MEMORYSIZE - 1)->cpuid = tail; printf("write start\n"); writer_function( head, tail, p_map); printf("write finish\n"); /* send terminate signal to reader */ Signal signal; signal.type = TERMINATE; signal.signal = -1; if(msgsnd(msg_id, &signal, sizeof(signal), 0) < 0) { perror("msgsnd"); return(1); } printf("transfer finished\n"); /* receive finish signal from reader */ msgrcv(msg_id, &signal, sizeof(signal), FINISH, 0); printf("finish signal receive\n"); return 0 ; }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_ATTACHVOLUMERESPONSE_P_H #define QTAWS_ATTACHVOLUMERESPONSE_P_H #include "storagegatewayresponse_p.h" namespace QtAws { namespace StorageGateway { class AttachVolumeResponse; class AttachVolumeResponsePrivate : public StorageGatewayResponsePrivate { public: explicit AttachVolumeResponsePrivate(AttachVolumeResponse * const q); void parseAttachVolumeResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(AttachVolumeResponse) Q_DISABLE_COPY(AttachVolumeResponsePrivate) }; } // namespace StorageGateway } // namespace QtAws #endif
// // Created by banamir on 04.06.15. // #ifndef THERMECH_FEM_LINKEDPROPERTY_H #define THERMECH_FEM_LINKEDPROPERTY_H #include "material.h" #include "state.h" namespace material { class LinkedProperty : AbstractProperty { public: Value getValue(State); }; } #endif //THERMECH_FEM_LINKEDPROPERTY_H
#include "List.h" #include "memory.h" #define CSSOM_LIST_DEFINE(T, suffix) \ struct _CSSOM_ListItem_##suffix { \ T value; \ struct _CSSOM_ListItem_##suffix *prev; \ struct _CSSOM_ListItem_##suffix *next; \ }; \ \ \ \ static struct _CSSOM_ListItem_##suffix* ListItem_##suffix##_alloc(void) { \ struct _CSSOM_ListItem_##suffix *item; \ \ item = (struct _CSSOM_ListItem_##suffix*)CSSOM_malloc( \ sizeof(struct _CSSOM_ListItem_##suffix)); \ if (item == NULL) return NULL; \ \ item->next = NULL; \ item->prev = NULL; \ \ return item; \ } \ \ \ \ static void ListItem_##suffix##_free( \ struct _CSSOM_ListItem_##suffix *item) \ { \ CSSOM_free(item); \ } \ \ \ \ static void ListItem_##suffix##_freeAll( \ struct _CSSOM_ListItem_##suffix *item) \ { \ struct _CSSOM_ListItem_##suffix *next; \ \ for (; item != NULL; item = next) { \ next = item->next; \ ListItem_##suffix##_free(item); \ } \ } \ \ \ \ struct _CSSOM_List_##suffix { \ struct _CSSOM_ListItem_##suffix *head; \ struct _CSSOM_ListItem_##suffix *tail; \ size_t size; \ }; \ \ \ \ CSSOM_List_##suffix* CSSOM_List_##suffix##_alloc(void) { \ CSSOM_List_##suffix *list; \ struct _CSSOM_ListItem_##suffix *item; \ \ item = ListItem_##suffix##_alloc(); \ if (item == NULL) return NULL; \ \ list = (CSSOM_List_##suffix*)CSSOM_malloc( \ sizeof(CSSOM_List_##suffix)); \ if (list == NULL) { \ ListItem_##suffix##_free(item); \ return NULL; \ } \ \ list->head = item; \ list->tail = item; \ list->size = 0; \ \ return list; \ } \ \ \ \ void CSSOM_List_##suffix##_free(CSSOM_List_##suffix *list) { \ ListItem_##suffix##_freeAll(list->head); \ CSSOM_free(list); \ } \ \ \ \ CSSOM_ListIter_##suffix CSSOM_List_##suffix##_append( \ CSSOM_List_##suffix *list, T value) \ { \ struct _CSSOM_ListItem_##suffix *item; \ \ item = ListItem_##suffix##_alloc(); \ if (item == NULL) return CSSOM_List_##suffix##_end(list); \ \ item->value = value; \ item->prev = list->tail; \ list->tail->next = item; \ list->tail = item; \ ++list->size; \ \ return (CSSOM_ListIter_##suffix)item; \ } \ \ \ \ CSSOM_ListIter_##suffix CSSOM_List_##suffix##_insert( \ CSSOM_List_##suffix *list, CSSOM_ListIter_##suffix position, T value) \ { \ struct _CSSOM_ListItem_##suffix *item; \ struct _CSSOM_ListItem_##suffix *at; \ \ if (position == CSSOM_List_##suffix##_end(list)) \ return CSSOM_List_##suffix##_append(list, value); \ \ at = (struct _CSSOM_ListItem_##suffix*)position; \ item = ListItem_##suffix##_alloc(); \ if (item == NULL) return CSSOM_List_##suffix##_end(list); \ \ item->value = value; \ at->prev->next = item; \ item->prev = at->prev; \ at->prev = item; \ item->next = at; \ ++list->size; \ \ return (CSSOM_ListIter_##suffix)item; \ } \ \ \ \ CSSOM_ListIter_##suffix CSSOM_List_##suffix##_erase( \ CSSOM_List_##suffix *list, CSSOM_ListIter_##suffix position) \ { \ struct _CSSOM_ListItem_##suffix *item; \ struct _CSSOM_ListItem_##suffix *at; \ \ at = (struct _CSSOM_ListItem_##suffix*)position; \ item = at->next; \ \ at->prev->next = item; \ if (item != NULL) item->prev = at->prev; \ ListItem_##suffix##_free(at); \ --list->size; \ \ return (CSSOM_ListIter_##suffix)item; \ } \ \ \ \ CSSOM_ListIter_##suffix CSSOM_List_##suffix##_begin( \ CSSOM_List_##suffix *list) \ { \ return (CSSOM_ListIter_##suffix)list->head->next; \ } \ \ \ \ CSSOM_ListIter_##suffix CSSOM_List_##suffix##_end( \ CSSOM_List_##suffix *list) \ { \ return (CSSOM_ListIter_##suffix)list->tail->next; \ } \ \ \ \ CSSOM_ListConstIter_##suffix CSSOM_List_##suffix##_cbegin( \ const CSSOM_List_##suffix *list) \ { \ return (CSSOM_ListConstIter_##suffix)list->head->next; \ } \ \ \ \ CSSOM_ListConstIter_##suffix CSSOM_List_##suffix##_cend( \ const CSSOM_List_##suffix *list) \ { \ return (CSSOM_ListConstIter_##suffix)list->tail->next; \ } \ \ \ \ size_t CSSOM_List_##suffix##_size(const CSSOM_List_##suffix *list) { \ return list->size; \ } \ \ \ \ CSSOM_ListIter_##suffix CSSOM_ListIter_##suffix##_next( \ CSSOM_ListIter_##suffix iter) \ { \ return (CSSOM_ListIter_##suffix) \ ((struct _CSSOM_ListItem_##suffix*)iter)->next; \ } \ \ \ \ CSSOM_ListConstIter_##suffix CSSOM_ListConstIter_##suffix##_next( \ CSSOM_ListConstIter_##suffix iter) \ { \ return (CSSOM_ListConstIter_##suffix) \ ((const struct _CSSOM_ListItem_##suffix*)iter)->next; \ }
// Created file "Lib\src\PortableDeviceGuids\X64\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(WPD_PROPERTY_NULL, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
/* mgm-kuznyechik-meta.c Multilinear Galois Mode, https://tools.ietf.org/id/draft-smyshlyaev-mgm-11.html Copyright (C) 2019 Dmitry Eremin-Solenikov This file is part of GNU Nettle. GNU Nettle 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. GNU Nettle 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 copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/. */ #if HAVE_CONFIG_H # include "config.h" #endif #include "nettle-meta.h" #include "mgm.h" const struct nettle_aead nettle_mgm_kuznyechik = { "mgm_kuznyechik", sizeof(struct mgm_kuznyechik_ctx), MGM_BLOCK_SIZE, KUZNYECHIK_KEY_SIZE, MGM_IV_SIZE, MGM_DIGEST_SIZE, (nettle_set_key_func *) mgm_kuznyechik_set_key, (nettle_set_key_func *) mgm_kuznyechik_set_key, (nettle_set_key_func *) mgm_kuznyechik_set_iv, (nettle_hash_update_func *) mgm_kuznyechik_update, (nettle_crypt_func *) mgm_kuznyechik_encrypt, (nettle_crypt_func *) mgm_kuznyechik_decrypt, (nettle_hash_digest_func *) mgm_kuznyechik_digest, };
#ifndef _ADAFRUIT_GFX_H #define _ADAFRUIT_GFX_H #if ARDUINO >= 100 #include "Arduino.h" #include "Print.h" #else #include "WProgram.h" #endif #define swap(a, b) { int16_t t = a; a = b; b = t; } class Adafruit_GFX : public Print { public: Adafruit_GFX(int16_t w, int16_t h); // Constructor // This MUST be defined by the subclass: virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0; // These MAY be overridden by the subclass to provide device-specific // optimized code. Otherwise 'generic' versions are used. virtual void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); virtual void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); virtual void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); virtual void fillScreen(uint16_t color); virtual void invertDisplay(boolean i); // These exist only with Adafruit_GFX (no subclass overrides) void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color); void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color); void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color); void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color); void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color); void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color); void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color); void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg); void drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color); void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size); void setCursor(int16_t x, int16_t y); void setTextColor(uint16_t c); void setTextColor(uint16_t c, uint16_t bg); void setTextSize(uint8_t s); void setTextWrap(boolean w); void setRotation(uint8_t r); #if ARDUINO >= 100 virtual size_t write(uint8_t); #else virtual void write(uint8_t); #endif int16_t height(void) const; int16_t width(void) const; uint8_t getRotation(void) const; protected: const int16_t WIDTH, HEIGHT; // This is the 'raw' display w/h - never changes int16_t _width, _height, // Display w/h as modified by current rotation cursor_x, cursor_y; uint16_t textcolor, textbgcolor; uint8_t textsize, rotation; boolean wrap; // If set, 'wrap' text at right edge of display }; #endif // _ADAFRUIT_GFX_H
// // AppDelegate.h // 09-scrollView内部空间悬停 // // Created by yhp on 16/7/3. // Copyright © 2016年 YouHuaPei. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#include <X11/Xlib.h> void getMoveCoords(Display* dpy,Window window,int* resX,int*resY); void moveMouse(Display* dpy, Window window,int x, int y);
#ifndef _core_json_Null #define _core_json_Null ::core_json::Null namespace core_json { struct Null { }; } #endif
// // Created by michael on 22.03.16. // #pragma once #include "../WorldEntity.h" namespace weave { struct DeadCivilization : public WorldEntity { static const std::string Type; static const std::string PlanetMarker; const std::string Name; DeadCivilization(); explicit DeadCivilization(std::string name); std::string ToString() const noexcept override; std::string GetType() const noexcept override; private: DeadCivilization(ID id, std::string name); // serialization friend class cereal::access; template<class Archive> void serialize(Archive &archive) { archive(cereal::make_nvp("id", GetId()), CEREAL_NVP(Name)); } template<class Archive> static void load_and_construct(Archive &ar, cereal::construct<DeadCivilization> &construct) { ID id; std::string Name; ar(cereal::make_nvp("id", id), CEREAL_NVP(Name)); construct(id, Name); } }; } CEREAL_REGISTER_TYPE(weave::DeadCivilization);
#pragma once #include "Unit_ViewDialog.h" #include "afxwin.h" #include "Include.h" // CUnitTool ´ëÈ­ »óÀÚÀÔ´Ï´Ù. class CUnitView; class CUnitTool : public CDialog { DECLARE_DYNAMIC(CUnitTool) public: CUnitTool(CWnd* pParent = NULL); // Ç¥ÁØ »ý¼ºÀÚÀÔ´Ï´Ù. virtual ~CUnitTool(); // ´ëÈ­ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù. enum { IDD = IDD_UNITTOOL }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Áö¿øÀÔ´Ï´Ù. DECLARE_MESSAGE_MAP() private: CUnitView* m_pUnitView; // ºäâ Æ÷ÀÎÅÍ private: CUnit_ViewDialog m_ViewDialog; public: CListBox m_ListBox; list<IMGPATH*> m_ImgPathlist; wstring m_wstrCurSelName; VTXTEX* m_pVtxTex; public: void SetUnitView(CUnitView* _pUnitView); void SetVtxTex(VTXTEX* pVtxTex); VTXTEX* GetVtxTex(); wstring GetCurSelectName(); public: void Release(void); public: virtual BOOL OnInitDialog(); afx_msg void OnClose(); afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); afx_msg void OnDropFiles(HDROP hDropInfo); afx_msg void OnLbnSelchangeList1(); };
#ifndef CONNECTIONWINDOW_H #define CONNECTIONWINDOW_H #include <QMainWindow> #include <QWidget> #include <stdio.h> #include <iostream> #include <QObject> #include <QLineEdit> #include <QPushButton> #include <QVBoxLayout> #include <QLabel> class ConnectionWindow : public QMainWindow { Q_OBJECT public: //Constructor ConnectionWindow(QWidget *parent=0); //Destructor ~ConnectionWindow(); private: //Connection part void createConnectionPart(); private slots: //Send IDs void sendIDConnection(); //Create account void createAccount(); private: //Window's size float sizeInW; float sizeInH; //Main Layout QVBoxLayout *mainLayout; //Connection part QLabel *askUserID; QLabel *askUserPass; QLineEdit *editUserID; QLineEdit *editUserPass; QPushButton *sendUserID; QPushButton *addNewUser; QLabel *isUserKnown; QHBoxLayout *layoutP1; QHBoxLayout *layoutP2; }; #endif // CONNECTIONWINDOW_H
// // TRTStatsViewController.h // TorTest // // Created by David Chiles on 9/24/14. // Copyright (c) 2014 David Chiles. All rights reserved. // #import <UIKit/UIKit.h> @interface TRTStatsViewController : UIViewController @end
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #if defined(USE_TI_UIIPHONETABLEVIEWSEPARATORSTYLE) || defined(USE_TI_UIIPHONELISTVIEWSEPARATORSTYLE) #import "TiProxy.h" @interface TiUIiPhoneTableViewSeparatorStyleProxy : TiProxy { } @property(nonatomic,readonly) NSNumber *NONE; @property(nonatomic,readonly) NSNumber *SINGLE_LINE; @end #endif
/* * 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/acm-pca/ACMPCA_EXPORTS.h> #include <aws/core/AmazonSerializableWebServiceRequest.h> #include <aws/core/utils/UnreferencedParam.h> #include <aws/core/http/HttpRequest.h> namespace Aws { namespace ACMPCA { class AWS_ACMPCA_API ACMPCARequest : public Aws::AmazonSerializableWebServiceRequest { public: virtual ~ACMPCARequest () {} virtual Aws::String SerializePayload() const override = 0; void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); } inline Aws::Http::HeaderValueCollection GetHeaders() const override { auto headers = GetRequestSpecificHeaders(); if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0)) { headers.insert(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_JSON_CONTENT_TYPE_1_1 )); } return headers; } protected: virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); } }; } // namespace ACMPCA } // namespace Aws
#pragma once #include "KeyCord.h" #include "AttributedString.h" class Control; class Mode { protected: KeyCords m_cords; std::shared_ptr<Control> m_control; std::vector<int> m_current_cord; KeyCord m_empty; protected: KeyCord::insert_func m_insert; public: Mode(const KeyCords& keys, std::shared_ptr<Control> control, KeyCord::insert_func insert); KeyCord::cord_func get_key(); virtual std::vector<std::shared_ptr<AttributedString>> syntax_highlight(std::vector<std::shared_ptr<AttributedString>> rows); };
/* * Copyright (c) 1991, 1992, 1993 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 name of * Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of 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 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. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include "glut_wrap.h" static void Init(void) { glShadeModel(GL_FLAT); glClearColor(0.0, 0.0, 0.0, 0.0); glClearStencil(0); glStencilMask(1); glEnable(GL_STENCIL_TEST); } static void Reshape(int width, int height) { glViewport(0, 0, (GLint)width, (GLint)height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-5.0, 5.0, -5.0, 5.0, -5.0, 5.0); glMatrixMode(GL_MODELVIEW); } static void Key(unsigned char key, int x, int y) { switch (key) { case 27: exit(1); } } static void Draw(void) { glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); glStencilFunc(GL_ALWAYS, 1, 1); glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); glColor3ub(200, 0, 0); glBegin(GL_POLYGON); glVertex3i(-4, -4, 0); glVertex3i( 4, -4, 0); glVertex3i( 0, 4, 0); glEnd(); glStencilFunc(GL_EQUAL, 1, 1); glStencilOp(GL_INCR, GL_KEEP, GL_DECR); glColor3ub(0, 200, 0); glBegin(GL_POLYGON); glVertex3i(3, 3, 0); glVertex3i(-3, 3, 0); glVertex3i(-3, -3, 0); glVertex3i(3, -3, 0); glEnd(); glStencilFunc(GL_EQUAL, 1, 1); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); glColor3ub(0, 0, 200); glBegin(GL_POLYGON); glVertex3i(3, 3, 0); glVertex3i(-3, 3, 0); glVertex3i(-3, -3, 0); glVertex3i(3, -3, 0); glEnd(); glFlush(); } static GLenum Args(int argc, char **argv) { GLint i; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-dr") == 0) { } else { printf("%s (Bad option).\n", argv[i]); return GL_FALSE; } } return GL_TRUE; } int main(int argc, char **argv) { GLenum type; glutInit(&argc, argv); if (Args(argc, argv) == GL_FALSE) { exit(1); } glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300); type = GLUT_RGB | GLUT_SINGLE | GLUT_STENCIL; glutInitDisplayMode(type); if (glutCreateWindow("Stencil Test") == GL_FALSE) { exit(1); } Init(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Draw); glutMainLoop(); return 0; }
// // JAImagePickerController.h // Shortcuts // // Created by Javier Azuara on 1/5/14. // Copyright (c) 2014 Javier Azuara. All rights reserved. // #import <UIKit/UIKit.h> @class JAImagePickerController; @protocol JAImagePickerControllerDelegate <NSObject> - (void)controller:(JAImagePickerController *)controller didSelectPhoto:(UIImage *)photo; @end @interface JAImagePickerController : UICollectionViewController @property (nonatomic, weak) id<JAImagePickerControllerDelegate> delegate; @property (nonatomic) BOOL savePhotoInCameraRoll; + (instancetype) imagePickerController; @end
// // properties.h // YCSB-C // // Created by Jinglei Ren on 12/9/14. // Copyright (c) 2014 Jinglei Ren <jinglei@ren.systems>. // #ifndef YCSB_C_PROPERTIES_H_ #define YCSB_C_PROPERTIES_H_ #include <string> #include <map> #include <fstream> #include <cassert> #include "utils.h" namespace utils { class Properties { public: std::string GetProperty(const std::string &key, const std::string &default_value = std::string()) const; const std::string &operator[](const std::string &key) const; const std::map<std::string, std::string> &properties() const; void SetProperty(const std::string &key, const std::string &value); bool Load(std::ifstream &input); private: std::map<std::string, std::string> properties_; }; inline std::string Properties::GetProperty(const std::string &key, const std::string &default_value) const { std::map<std::string, std::string>::const_iterator it = properties_.find(key); if (properties_.end() == it) { return default_value; } else return it->second; } inline const std::string &Properties::operator[](const std::string &key) const { return properties_.at(key); } inline const std::map<std::string, std::string> &Properties::properties() const { return properties_; } inline void Properties::SetProperty(const std::string &key, const std::string &value) { properties_[key] = value; } inline bool Properties::Load(std::ifstream &input) { if (!input.is_open()) throw utils::Exception("File not open!"); while (!input.eof() && !input.bad()) { std::string line; std::getline(input, line); if (line[0] == '#') continue; size_t pos = line.find_first_of('='); if (pos == std::string::npos) continue; SetProperty(Trim(line.substr(0, pos)), Trim(line.substr(pos + 1))); } return true; } } // utils #endif // YCSB_C_PROPERTIES_H_
#ifndef TYPES_H #define TYPES_H #include <stdint.h> typedef float float32_t; typedef double float64_t; #endif
/** * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. */ #pragma once #include "cpu/vision.h" #ifdef WITH_CUDA #include "cuda/vision.h" #endif std::tuple<at::Tensor, at::Tensor> ROIPool_forward(const at::Tensor& input, const at::Tensor& rois, const float spatial_scale, const int pooled_height, const int pooled_width) { if (input.type().is_cuda()) { #ifdef WITH_CUDA return ROIPool_forward_cuda(input, rois, spatial_scale, pooled_height, pooled_width); #else AT_ERROR("Not compiled with GPU support"); #endif } AT_ERROR("Not implemented on the CPU"); } at::Tensor ROIPool_backward(const at::Tensor& grad, const at::Tensor& input, const at::Tensor& rois, const at::Tensor& argmax, const float spatial_scale, const int pooled_height, const int pooled_width, const int batch_size, const int channels, const int height, const int width) { if (grad.type().is_cuda()) { #ifdef WITH_CUDA return ROIPool_backward_cuda(grad, input, rois, argmax, spatial_scale, pooled_height, pooled_width, batch_size, channels, height, width); #else AT_ERROR("Not compiled with GPU support"); #endif } AT_ERROR("Not implemented on the CPU"); }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "sysdep.h" #include "hsearch.h" typedef struct entryb { ENTRY *entry; struct entryb *next; } ENTRYB; static ENTRYB **entries; static size_t htsize; /* * Gotten from GNU libc-2.0 */ int searchIsPrime(unsigned candidate) { /* No even number and none less than 10 will be passed here. */ unsigned int divn = 3; unsigned int sq = divn * divn; while (sq < candidate && candidate % divn != 0) { ++divn; sq += 4 * divn; ++divn; } return candidate % divn != 0; } unsigned searchNextPrime(unsigned long seed) { /* Make it definitely odd. */ seed |= 1; while (!searchIsPrime (seed)) seed += 2; return seed; } int hhash(char *key) { int r = 0; char *k = key; while (*k != '\0') { r += *k; k++; } return (r % htsize); } int hcreate(size_t mekments) { unsigned int i; htsize = searchNextPrime(mekments); entries = (ENTRYB **)malloc(htsize * sizeof(ENTRYB *)); for (i=0; i<htsize; i++) { entries[i] = (ENTRYB *)malloc(sizeof(ENTRYB)); entries[i]->entry = NULL; entries[i]->next = NULL; } return 0; } /*****************************************************/ /* There are two actions for hsearch, FIND and ENTER */ /* For FIND, we just compare the item.key, if we got */ /* the entry, we just return it. For ENTER, we need */ /* to compare both the key and the data, if both the */ /* key and data are the same, we do not need to add */ /* it in. For ENTER, the data can not be NULL, but */ /* for FIND, the data can be NULL */ /*****************************************************/ ENTRY *hsearch(ENTRY item, ACTION action) { int r; ENTRYB *result; /* key should not be NULL */ if (item.key == NULL) return NULL; r = hhash(item.key); result = entries[r]; if (result->entry != NULL) { if (!strcmp(result->entry->key, item.key)) { if (action != ENTER) return (result->entry); else if (result->entry->data != NULL && \ item.data != NULL && \ !strcmp(result->entry->data, item.data)) return (result->entry); } } if (action == ENTER) { if (result->entry != NULL) return result->entry; else { result->entry = (ENTRY *)malloc(sizeof(ENTRY)); result->next = (ENTRYB *)malloc(sizeof(ENTRYB)); result->next->entry = NULL; result->next->next = NULL; result->entry->key = strdup(item.key); // result->entry->data = strdup(item.data); result->entry->data = item.data; /* fixed by Akira 12/27/01 */ return result->entry; } } else { return result->entry; } } void hdestroy(void) { unsigned int i; ENTRYB *e, *p; for (i=0; i<htsize; i++) { e = entries[i]; while (e->entry != NULL) { p = e; e = e->next; free(p->entry->key); // free(p->entry->data); /* fixed by Akira 12/27/01 */ free(p->entry); free(p); } free(e); } } /* main() { ENTRY t, *r; hcreate(100); t.key = strdup("wxt"); t.data = strdup("123455"); r = hsearch(t, ENTER); t.key = strdup("fas"); t.data = strdup("12das3455"); r = hsearch(t, ENTER); t.key = strdup("asas"); t.data = strdup("123fda455"); r = hsearch(t, ENTER); t.key = strdup("dda"); t.data = strdup("12dda3455"); r = hsearch(t, ENTER); t.key = strdup("asas"); t.data = strdup("123fda455"); r = hsearch(t, FIND); printf("%s, %s\n", r->key, r->data); t.key = strdup("ddad"); t.data = strdup("12dda3455"); r = hsearch(t, FIND); if (r == NULL) printf("Not find.\n"); hdestroy(); return 0; } */
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/mwaa/MWAA_EXPORTS.h> #include <aws/mwaa/MWAARequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSMap.h> #include <utility> namespace Aws { namespace MWAA { namespace Model { /** */ class AWS_MWAA_API TagResourceRequest : public MWAARequest { public: TagResourceRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "TagResource"; } Aws::String SerializePayload() const override; /** * <p>The tag resource ARN of the MWAA environments.</p> */ inline const Aws::String& GetResourceArn() const{ return m_resourceArn; } /** * <p>The tag resource ARN of the MWAA environments.</p> */ inline bool ResourceArnHasBeenSet() const { return m_resourceArnHasBeenSet; } /** * <p>The tag resource ARN of the MWAA environments.</p> */ inline void SetResourceArn(const Aws::String& value) { m_resourceArnHasBeenSet = true; m_resourceArn = value; } /** * <p>The tag resource ARN of the MWAA environments.</p> */ inline void SetResourceArn(Aws::String&& value) { m_resourceArnHasBeenSet = true; m_resourceArn = std::move(value); } /** * <p>The tag resource ARN of the MWAA environments.</p> */ inline void SetResourceArn(const char* value) { m_resourceArnHasBeenSet = true; m_resourceArn.assign(value); } /** * <p>The tag resource ARN of the MWAA environments.</p> */ inline TagResourceRequest& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;} /** * <p>The tag resource ARN of the MWAA environments.</p> */ inline TagResourceRequest& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;} /** * <p>The tag resource ARN of the MWAA environments.</p> */ inline TagResourceRequest& WithResourceArn(const char* value) { SetResourceArn(value); return *this;} /** * <p>The tag resource tag of the MWAA environments.</p> */ inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tagsHasBeenSet = true; m_tags = value; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;} /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;} /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& AddTags(const Aws::String& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& AddTags(Aws::String&& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& AddTags(const Aws::String& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& AddTags(Aws::String&& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), std::move(value)); return *this; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& AddTags(const char* key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& AddTags(Aws::String&& key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; } /** * <p>The tag resource tag of the MWAA environments.</p> */ inline TagResourceRequest& AddTags(const char* key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; } private: Aws::String m_resourceArn; bool m_resourceArnHasBeenSet; Aws::Map<Aws::String, Aws::String> m_tags; bool m_tagsHasBeenSet; }; } // namespace Model } // namespace MWAA } // namespace Aws
// // TCProfileRequestButton.h // TrueSDK // // Created by Guven Iscan on 23/12/2016. // Copyright © 2016 True Software Scandinavia AB. All rights reserved. // #import <UIKit/UIKit.h> /*! * @typedef TCButtonStyle * @brief A list of available button styles. Default is TCButtonStyleBlue. * @constant TCButtonStyleCustom Custom Style * @constant TCButtonStyleBlue The entire button is blue but the image and text are white * @constant TCButtonStyleWhite The entire button is white but the image and text are blue */ typedef NSString *TCButtonStyle NS_STRING_ENUM; static TCButtonStyle const TCButtonStyleCustom = @""; static TCButtonStyle const TCButtonStyleWhite = @"white"; static TCButtonStyle const TCButtonStyleBlue = @"blue"; /*! * @typedef TCButtonCornersStyle * @brief A list of available button corners styles. Default is TCButtonCornersStyleRounded. * @constant TCButtonCornersStyleRounded The corners of the button are rounded (radius = 6.0) * @constant TCButtonCornersStyleFlat The corners of the button are flat (radius = 0.0) */ typedef NSString *TCButtonCornersStyle NS_STRING_ENUM; static TCButtonCornersStyle const TCButtonCornersStyleRounded = @"rounded"; static TCButtonCornersStyle const TCButtonCornersStyleFlat = @"flat"; /*! * @header TCProfileRequestButton.h * @brief Out-of-the box TrueSDK button which automatically sends True Profile Request when pressed by the user */ IB_DESIGNABLE @interface TCProfileRequestButton : UIButton /*! * @discussion Use TCButtonStyle enum values. Default value is TCButtonStyleCustom. * NSString is used instead of TCButtonStyle so it can be set from IB. * If a value is set out of the allowed range the default value is applied. */ @property(nonatomic) IBInspectable NSString *buttonStyle; /*! * @discussion Use TCButtonCornersStyle enum values. Default value is TCButtonCornersStyleRounded. * NSString is used instead of TCButtonCornersStyle so it can be set from IB. * If a value is set out of the allowed range the default value is applied. */ @property(nonatomic) IBInspectable NSString *buttonCornersStyle; /*! * @brief Returns an icon image with Truecaller logo * @param buttonStyle A string enum with predefined button styles * @return Image specified by button style (or nil for custom style) */ + (UIImage *)buttonIconImageForType:(TCButtonStyle)buttonStyle; /*! * @brief Returns the color for the given style * @param buttonStyle A string enum with predefined button styles * @return Background Color specified by button style (or nil for custom style) */ + (UIColor *)backgroundColorForType:(TCButtonStyle)buttonStyle; /*! * @brief Returns the text color for the given style * @param buttonStyle A string enum with predefined button styles * @return Text Color specified by button style (or nil for custom style) */ + (UIColor *)textColorForType:(TCButtonStyle)buttonStyle; @end
// Copyright 2021 Google LLC // // 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 TINK_HYBRID_INTERNAL_HPKE_TEST_UTIL_H_ #define TINK_HYBRID_INTERNAL_HPKE_TEST_UTIL_H_ #include <string> #include "absl/strings/escaping.h" #include "tink/util/statusor.h" #include "proto/hpke.pb.h" namespace crypto { namespace tink { namespace internal { struct HpkeTestParams { std::string recipient_public_key; // pkRm std::string seed_for_testing; // skEm std::string application_info; // info std::string plaintext; // pt std::string associated_data; // aad std::string ciphertext; // ct std::string recipient_private_key; // skRm std::string encapsulated_key; // enc explicit HpkeTestParams(const absl::string_view* test_vector) : recipient_public_key(absl::HexStringToBytes(test_vector[0])), seed_for_testing(absl::HexStringToBytes(test_vector[1])), application_info(absl::HexStringToBytes(test_vector[2])), plaintext(absl::HexStringToBytes(test_vector[3])), associated_data(absl::HexStringToBytes(test_vector[4])), ciphertext(absl::HexStringToBytes(test_vector[5])), recipient_private_key(absl::HexStringToBytes(test_vector[6])), encapsulated_key(absl::HexStringToBytes(test_vector[7])) {} }; // Returns an HpkeTestParams struct for the following HPKE parameters: // DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM. HpkeTestParams DefaultHpkeTestParams(); // Creates an HpkeTestParams struct for the specified HpkeParams protobuf. util::StatusOr<HpkeTestParams> CreateHpkeTestParams( const google::crypto::tink::HpkeParams& params); // Creates an HpkeParams protobuf from `kem`, `kdf`, and `aead`. google::crypto::tink::HpkeParams CreateHpkeParams( const google::crypto::tink::HpkeKem& kem, const google::crypto::tink::HpkeKdf& kdf, const google::crypto::tink::HpkeAead& aead); // Creates an HpkePublicKey proto from the specified HpkeParams protobuf and // the `raw_key_bytes`. google::crypto::tink::HpkePublicKey CreateHpkePublicKey( const google::crypto::tink::HpkeParams& params, const std::string& raw_key_bytes); // Creates an HpkePrivateKey proto from the specified HpkeParams protobuf and // the `raw_key_bytes`. Note that the key material for the embedded // HpkePublicKey `public_key` field will be empty. google::crypto::tink::HpkePrivateKey CreateHpkePrivateKey( const google::crypto::tink::HpkeParams& params, const std::string& raw_key_bytes); } // namespace internal } // namespace tink } // namespace crypto #endif // TINK_HYBRID_INTERNAL_HPKE_TEST_UTIL_H_
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2013 EMC Corp. // // @filename: // CPhysicalLeftAntiSemiHashJoinNotIn.h // // @doc: // Left anti semi hash join operator with NotIn semantics //--------------------------------------------------------------------------- #ifndef GPOPT_CPhysicalLeftAntiSemiHashJoinNotIn_H #define GPOPT_CPhysicalLeftAntiSemiHashJoinNotIn_H #include "gpos/base.h" #include "gpopt/operators/CPhysicalLeftAntiSemiHashJoin.h" namespace gpopt { //--------------------------------------------------------------------------- // @class: // CPhysicalLeftAntiSemiHashJoinNotIn // // @doc: // Left anti semi hash join operator with NotIn semantics // //--------------------------------------------------------------------------- class CPhysicalLeftAntiSemiHashJoinNotIn : public CPhysicalLeftAntiSemiHashJoin { private: // private copy ctor CPhysicalLeftAntiSemiHashJoinNotIn(const CPhysicalLeftAntiSemiHashJoinNotIn &); public: // ctor CPhysicalLeftAntiSemiHashJoinNotIn(IMemoryPool *pmp, DrgPexpr *pdrgpexprOuterKeys, DrgPexpr *pdrgpexprInnerKeys); // ident accessors virtual EOperatorId Eopid() const { return EopPhysicalLeftAntiSemiHashJoinNotIn; } // return a string for operator name virtual const CHAR *SzId() const { return "CPhysicalLeftAntiSemiHashJoinNotIn"; } //------------------------------------------------------------------------------------- // Required Plan Properties //------------------------------------------------------------------------------------- // compute required distribution of the n-th child virtual CDistributionSpec *PdsRequired ( IMemoryPool *pmp, CExpressionHandle &exprhdl, CDistributionSpec *pdsRequired, ULONG ulChildIndex, DrgPdp *pdrgpdpCtxt, ULONG ulOptReq ) const; //------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------- // conversion function static CPhysicalLeftAntiSemiHashJoinNotIn *PopConvert ( COperator *pop ) { GPOS_ASSERT(EopPhysicalLeftAntiSemiHashJoinNotIn == pop->Eopid()); return dynamic_cast<CPhysicalLeftAntiSemiHashJoinNotIn*>(pop); } }; // class CPhysicalLeftAntiSemiHashJoinNotIn } #endif // !GPOPT_CPhysicalLeftAntiSemiHashJoinNotIn_H // EOF
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2011 by Felicidades, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ // TODO: Migrate to GCD sockets (GCDAsyncSocket). This will resolve a number of really ugly issues: // * Lower thread counts // * Explicit synchronization (no more conditions, flags, or race conditons!) // * Maybe even synchronize with the context itself (when TIMOB-6990 complete) #ifdef USE_TI_NETWORKSOCKET #import <Foundation/Foundation.h> #import "TiStreamProxy.h" #import "AsyncSocket.h" #import "TiNetworkSocketProxy.h" // Used to determine the type of processing typedef enum { TO_BUFFER = 1, TO_STREAM, TO_CALLBACK, } ReadDestination; @interface TiNetworkSocketTCPProxy : TiStreamProxy<AsyncSocketDelegate, TiStreamInternal> { AsyncSocket* socket; SocketState internalState; NSCondition* listening; NSThread* socketThread; // We have to have an explicit "host" property because of some 'fun' undocumented KVO // behavior - it turns out that KVO 'getters' also look for '-(type)_key' signature // selectors. TiProxy has a '_host' function. NSString* host; // We offer synchronous I/O. The underlying socket implementation is asynchronous. // So we need to ensure our own synchronicity by signaling a condition when operations // complete. NSCondition* ioCondition; NSUInteger readDataLength; NSError* socketError; // In order to put the accepted socket on the right run loop, and make sure it's constructed // properly, we need THESE as well... NSMutableDictionary* acceptArgs; NSRunLoop* acceptRunLoop; BOOL accepting; // And, last but not least, in order to make sure that socket run loops are configured AND ACTIVE before performing any work on them, // we need to be able to signal that they're NSCondition* readyCondition; BOOL socketReady; // Information used to hash callbacks and asynch ops to tags. int asynchTagCount; NSMutableDictionary* operationInfo; KrollCallback* connected; KrollCallback* accepted; KrollCallback* closed; KrollCallback* error; } // Properties: // -- Stored on TiProxy dynprops -- // int port // ---- @property (nonatomic, readwrite, retain) NSString* host; @property (nonatomic, readonly) NSNumber* state; // Req's local processing @property (nonatomic, readwrite, retain) KrollCallback* connected; @property (nonatomic, readwrite, retain) KrollCallback* accepted; @property (nonatomic, readwrite, retain) KrollCallback* closed; @property (nonatomic, readwrite, retain) KrollCallback* error; // Public API -(void)connect:(id)_void; -(void)listen:(id)arg; // arg[0]: int maxAcceptQueueSize : queue size -(void)accept:(id)arg; // arg[0]: Object params : callbacks for created socket -(void)close:(id)_void; @end #endif
// ======================================== // Copyright 2013 David Turnbull AE9RB // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ======================================== #include "`$INSTANCE_NAME`_api.h" #include <device.h> void `$INSTANCE_NAME`_Start2(uint8 dma) { uint8 td; `$INSTANCE_NAME`_Set(`$INSTANCE_NAME`_DEFAULT); td = CyDmaTdAllocate(); CyDmaTdSetConfiguration(td, 1, td, 0); CyDmaTdSetAddress(td, LO16((uint32)`$INSTANCE_NAME`_PLL_P__STATUS_REG), LO16((uint32)&FASTCLK_PLL_P)); CyDmaChSetInitialTd(dma, td); CyDmaChEnable(dma, 1); } void `$INSTANCE_NAME`_Set(uint16 frac) { CY_SET_REG8(`$INSTANCE_NAME`_FRAC_HI__CONTROL_REG, frac >> 8); CY_SET_REG8(`$INSTANCE_NAME`_FRAC_LO__CONTROL_REG, frac & 0xFF); }
// Copyright 2022 Google LLC // // 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 // // https://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. // Generated by the Codegen C++ plugin. // If you make any local changes, they will be lost. // source: google/cloud/notebooks/v1/managed_service.proto #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_INTERNAL_MANAGED_NOTEBOOK_RETRY_TRAITS_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_INTERNAL_MANAGED_NOTEBOOK_RETRY_TRAITS_H #include "google/cloud/status.h" #include "google/cloud/version.h" namespace google { namespace cloud { namespace notebooks_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN /// Define the gRPC status code semantics for retrying requests. struct ManagedNotebookServiceRetryTraits { static inline bool IsPermanentFailure(google::cloud::Status const& status) { return status.code() != StatusCode::kOk && status.code() != StatusCode::kUnavailable; } }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_internal } // namespace cloud } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_INTERNAL_MANAGED_NOTEBOOK_RETRY_TRAITS_H
#include <memory> #include <vulkan/vulkan.h> class vert { VkDescriptorSetLayout descriptorSetLayout; VkDeviceMemory* mem; VkDevice* dev; VkDescriptorSetLayout layout; public: void config(VkDevice& device, VkPipelineLayoutCreateInfo& info, VkDeviceMemory& memory) { dev = &device; mem = &memory; VkDescriptorSetLayoutBinding binding = {}; binding.binding = 0; binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; binding.descriptorCount = 1; binding.stageFlags = VK_SHADER_STAGE_VERTEX_BIT; binding.pImmutableSamplers = nullptr; VkDescriptorSetLayoutCreateInfo layout_info = {}; layout_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; layout_info.bindingCount = 1; layout_info.pBindings = &binding; vkCreateDescriptorSetLayout(device, &layout_info, nullptr, &layout); info.setLayoutCount = 1; info.pSetLayouts = &layout; } template <typename T> void set(const T& item) { uint8_t* data; vkMapMemory(*dev, *mem, 0, sizeof(mvp) + sizeof(mvp2), 0, &data); memcpy((void*)data, &item.mvp, sizeof(item.mvp)); data += sizeof(item.mvp); memcpy((void*)data, &item.mvp2, sizeof(item.mvp2)); data += sizeof(item.mvp2); vkUnmapMemory(*dev, *mem); } void config(VkMemoryAllocateInfo& info) { info.allocationSize = 128; } };
#ifndef GRAPH_H #define GRAPH_H #include "graph_global.h" #include <QObject> template<typename T>class QVector; class QPoint; class QString; class QTextStream; class Primitive; class Base; class Arrow; #include "node.h" class GRAPHSHARED_EXPORT Graph : public QObject { Q_OBJECT public: explicit Graph(QObject* parent = 0); ~Graph(); void editNode(Node* target, Node::NodeType newType, QString* expression); void removeNode(Node *node); const QVector<Node*>* nodes(); void removeArrow(Arrow* arrow); const QVector<Arrow*>* arrows(); bool hasStartNode(); Node* startNode(); bool hasEndNode(); Node* endNode(); void saveToStream(QTextStream& stream); bool loadFromStream(QTextStream& stream, QVector<Base*>* bases); unsigned internalNodeIndex(Node* node); private: QVector<Node*>* mNodes; QVector<Arrow*>* mArrows; Node* mStart; Node* mEnd; public slots: void addNode(Node* newNode, QPoint* position); void addArrow(Node* from, Node* to, QString* expression = nullptr); signals: void contentModified(); }; #endif // GRAPH_H
/* MIT License * * Copyright (c) 2016-2020 INRIA, CMU and Microsoft Corporation * * 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 __Hacl_Poly1305_32_H #define __Hacl_Poly1305_32_H #if defined(__cplusplus) extern "C" { #endif #include "evercrypt_targetconfig.h" #include "libintvector.h" #include "kremlin/internal/types.h" #include "kremlin/lowstar_endianness.h" #include <string.h> #include "kremlin/internal/target.h" #include "Hacl_Kremlib.h" /* SNIPPET_START: Hacl_Poly1305_32_blocklen */ extern uint32_t Hacl_Poly1305_32_blocklen; /* SNIPPET_END: Hacl_Poly1305_32_blocklen */ /* SNIPPET_START: Hacl_Poly1305_32_poly1305_ctx */ typedef uint64_t *Hacl_Poly1305_32_poly1305_ctx; /* SNIPPET_END: Hacl_Poly1305_32_poly1305_ctx */ /* SNIPPET_START: Hacl_Poly1305_32_poly1305_init */ void Hacl_Poly1305_32_poly1305_init(uint64_t *ctx, uint8_t *key); /* SNIPPET_END: Hacl_Poly1305_32_poly1305_init */ /* SNIPPET_START: Hacl_Poly1305_32_poly1305_update1 */ void Hacl_Poly1305_32_poly1305_update1(uint64_t *ctx, uint8_t *text); /* SNIPPET_END: Hacl_Poly1305_32_poly1305_update1 */ /* SNIPPET_START: Hacl_Poly1305_32_poly1305_update */ void Hacl_Poly1305_32_poly1305_update(uint64_t *ctx, uint32_t len, uint8_t *text); /* SNIPPET_END: Hacl_Poly1305_32_poly1305_update */ /* SNIPPET_START: Hacl_Poly1305_32_poly1305_finish */ void Hacl_Poly1305_32_poly1305_finish(uint8_t *tag, uint8_t *key, uint64_t *ctx); /* SNIPPET_END: Hacl_Poly1305_32_poly1305_finish */ /* SNIPPET_START: Hacl_Poly1305_32_poly1305_mac */ void Hacl_Poly1305_32_poly1305_mac(uint8_t *tag, uint32_t len, uint8_t *text, uint8_t *key); /* SNIPPET_END: Hacl_Poly1305_32_poly1305_mac */ #if defined(__cplusplus) } #endif #define __Hacl_Poly1305_32_H_DEFINED #endif
// // AppDelegate.h // SimpleKeyChain // // Created by Mihui on 6/16/16. // Copyright © 2016 IBM. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// Copyright 2017 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /////////////////////////////////////////////////////////////////////////////// #ifndef TINK_SIGNATURE_ECDSA_VERIFY_KEY_MANAGER_H_ #define TINK_SIGNATURE_ECDSA_VERIFY_KEY_MANAGER_H_ #include <string> #include "absl/memory/memory.h" #include "absl/strings/str_cat.h" #include "tink/core/key_type_manager.h" #include "tink/public_key_verify.h" #include "tink/util/constants.h" #include "tink/util/errors.h" #include "tink/util/protobuf_helper.h" #include "tink/util/status.h" #include "tink/util/statusor.h" #include "proto/ecdsa.pb.h" namespace crypto { namespace tink { class EcdsaVerifyKeyManager : public KeyTypeManager<google::crypto::tink::EcdsaPublicKey, void, List<PublicKeyVerify>> { public: class PublicKeyVerifyFactory : public PrimitiveFactory<PublicKeyVerify> { crypto::tink::util::StatusOr<std::unique_ptr<PublicKeyVerify>> Create( const google::crypto::tink::EcdsaPublicKey& ecdsa_public_key) const override; }; EcdsaVerifyKeyManager() : KeyTypeManager(absl::make_unique<PublicKeyVerifyFactory>()) {} uint32_t get_version() const override { return 0; } google::crypto::tink::KeyData::KeyMaterialType key_material_type() const override { return google::crypto::tink::KeyData::ASYMMETRIC_PUBLIC; } const std::string& get_key_type() const override { return key_type_; } crypto::tink::util::Status ValidateKey( const google::crypto::tink::EcdsaPublicKey& key) const override; crypto::tink::util::Status ValidateParams( const google::crypto::tink::EcdsaParams& params) const; internal::FipsCompatibility FipsStatus() const override { return internal::FipsCompatibility::kRequiresBoringCrypto; } private: const std::string key_type_ = absl::StrCat( kTypeGoogleapisCom, google::crypto::tink::EcdsaPublicKey().GetTypeName()); }; } // namespace tink } // namespace crypto #endif // TINK_SIGNATURE_ECDSA_VERIFY_KEY_MANAGER_H_
/* Copyright 2016 Robert Elder Software 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. */ /*GETS_REPLACED_WITH_INCLUDES*/ struct regex_matcher_state{ unsigned int * next_occupied_list; /* Describes whether a node is in the 'next' list of things to compute */ unsigned int * current_occupied_list; /* Describes whether a node is in the 'current' list of things to compute */ struct regex_computation_node ** next_list; /* The list of things to compute for the next character */ struct regex_computation_node ** current_list; /* The list of things to compute for the current character */ struct regex_compiler_state ** compiler_states;/* All the states of the compiled regexes */ unsigned int num_compiled_regexes; /* Total number of regexes this matcher is trying to match */ unsigned int num_unique_matches_found; /* Number of unique regex matches we've found so far. */ unsigned int next_current_list_index; /* The index of the next node in the list for the current characte */ unsigned int next_next_list_index; /* The index of the next node in the list for the next characte */ struct regex_match * possible_matches; /* An array of all possible matches */ struct regex_match ** actual_matches; /* An array of pointers to things that have actually matched */ unsigned int * num_optimized_possible_matches; /* Used as an optimization of pre-computed possible matches based on the first character */ unsigned int ** optimized_match_ids; /* Use for optimization */ };
/* * 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/sagemaker/SageMaker_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace SageMaker { namespace Model { enum class RootAccess { NOT_SET, Enabled, Disabled }; namespace RootAccessMapper { AWS_SAGEMAKER_API RootAccess GetRootAccessForName(const Aws::String& name); AWS_SAGEMAKER_API Aws::String GetNameForRootAccess(RootAccess value); } // namespace RootAccessMapper } // namespace Model } // namespace SageMaker } // namespace Aws
/** * ex0803.c * write a simple implementation of fseek. * the implementation of fseek is in simio.h. * here is the test driver */ #include <stdio.h> #include "simio.h" /* main program */ int main( int argc, char **argv ) { /* copy second file on the middle of first one */ if ( argc != 3 ) { printf( "missing inputs\n" ); return 0; } File *in, *out; if ( (out = fileopen( *++argv, "w" )) == NULL || (in = fileopen( *++argv, "r" )) == NULL ) { printf( "error open file\n" ); return 0; } /* position the pointer of first file into its middle */ fileseek( in, 0L, 2 ); //lseek( in->fd, 6, 0 ); char ch; while ( (ch = filegetc( in )) != EOF ) { fileputc( ch, out ); } /* the print the first file for preview */ fileclose( in ); fileclose( out ); in = fileopen( *--argv, "r" ); while ( (ch = filegetc( in )) != EOF ) { putchar( ch ); } fileclose( in ); return 0; }
/* * 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. */ /** * @file * These are the functions that a JIT built as a DLL may call. */ #ifndef _JIT_IMPORT_RT_H #define _JIT_IMPORT_RT_H //#include <stdlib.h> #include "open/types.h" #ifdef __cplusplus extern "C" { #endif /** * Begin root set enumeration functions. * * Enumerate a root entry. The argument is a pointer to the memory * location that contains a managed reference. The GC may update * this location if the object pointed to has been moved during * collection. */ VMEXPORT void vm_enumerate_root_reference(Managed_Object_Handle *ref, Boolean is_pinned); // Enumerate a weak root entry. The argument is a pointer to the memory // location that contains a managed reference. The GC may update // this location if the object pointed to has been moved during // collection. VMEXPORT void vm_enumerate_weak_root_reference(Managed_Object_Handle *ref, Boolean is_pinned); /** * Resembles vm_enumerate_root_reference(), but is passed the * address of a slot containing a compressed reference. */ VMEXPORT void vm_enumerate_compressed_root_reference(uint32 *ref, Boolean is_pinned); /** * Like vm_enumerate_root_reference(), but the first argument * points to a location that contains a pointer to an inside of an object. */ VMEXPORT void vm_enumerate_root_interior_pointer(void **slot, int offset, Boolean is_pinned); /** * The JIT enumerates a managed pointer. The pointer can be declared as * pinned. The pointer can point to the managed heap or any other area * where data can be stored: stack or static fields. It is the responsibility * of the runtime system to ignore pointers that are not in the managed heap. */ VMEXPORT void vm_enumerate_root_pointer(void **ptr, Boolean is_pinned); /** * End root set enumeration functions. */ /** * Enumerates alive references for owned monitor calculation. */ VMEXPORT void vm_check_if_monitor(void **reference, void **base_reference, uint32 *compressed_reference, int slotOffset, Boolean pinned, int type); #ifdef __cplusplus } #endif #endif // _JIT_IMPORT_RT_H
/** * Copyright 2012 Batis Degryll Ludo * @file Bouncer.h * @since 2017-03-07 * @date 2017-05-09 * @author Batis Degryll Ludo * @brief This define an avatar of an entity that can bounce with multiple normals. */ #ifndef ZBE_ENTITIES_AVATARS_BOUNCER_H_ #define ZBE_ENTITIES_AVATARS_BOUNCER_H_ #include "ZBE/core/tools/math/Vector.h" #include "ZBE/entities/avatars/Movable.h" #include "ZBE/core/system/system.h" namespace zbe { /** \brief This define an avatar of an entity that can bounce with multiple normals. */ template <unsigned s> class Bouncer : virtual public Movable<s> { public: using Base = Movable<s>;//!< inheritance info /** \brief Virtual destructor. */ virtual ~Bouncer() {} /** \brief Adds a normal to current bounce measurement * \param normal Normal value to add */ virtual void addNormal(const Vector<s>& normal) = 0; /** \brief Return the current normal sum. * \return The current normal sum. */ virtual Vector<s> getNormalSum() = 0; /** \brief Tells if there is normals added. * \return True if there is normals added. */ virtual bool hasNormals() = 0; /** \brief Clean the current normal measurement. */ virtual void clearNormals() = 0; }; } // namespace zbe #endif // ZBE_ENTITIES_AVATARS_BOUNCER_H_
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #pragma once #include <functional> #include "src/api_proxy/service_control/request_info.h" namespace espv2 { namespace envoy { namespace http_filters { namespace service_control { // The function to be called when check call is completed. using CheckDoneFunc = std::function<void( const ::google::protobuf::util::Status& status, const ::espv2::api_proxy::service_control::CheckResponseInfo&)>; // The function to be called when allocateQuota call is completed. using QuotaDoneFunc = std::function<void( const ::google::protobuf::util::Status& status, const ::espv2::api_proxy::service_control::QuotaResponseInfo&)>; // The function to cancel a on-going request. using CancelFunc = std::function<void()>; } // namespace service_control } // namespace http_filters } // namespace envoy } // namespace espv2
/* * * Copyright (C) 2011, 2015 Cisco Systems, Inc. * Copyright (C) 2015 CBA research group, Technical University of Catalonia. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include "vxlan-gpe.h" #include "../../lib/oor_log.h" #include "../../lib/packets.h" void vxlan_gpe_data_hdr_init(vxlan_gpe_hdr_t *vhdr, uint32_t vni, vxlan_gpe_nprot_t np) { memset (vhdr,0,sizeof(vxlan_gpe_hdr_t)); vhdr->vni_flag = 1; pkt_add_uint32_in_3bytes (vhdr->vni, vni); vhdr->next_prot_flag = 1; vhdr->next_proto = np; } void * vxlan_gpe_data_push_hdr(lbuf_t *b, uint32_t vni, vxlan_gpe_nprot_t next_prot) { vxlan_gpe_hdr_t *vhdr; vhdr = lbuf_push_uninit(b, sizeof(vxlan_gpe_hdr_t)); vxlan_gpe_data_hdr_init(vhdr, vni, next_prot); return(vhdr); } void * vxlan_gpe_data_encap(lbuf_t *b, int lp, int rp, lisp_addr_t *la, lisp_addr_t *ra, uint32_t vni) { int ttl = 0, tos = 0; vxlan_gpe_nprot_t next_prot; /* read ttl and tos */ ip_hdr_ttl_and_tos(lbuf_data(b), &ttl, &tos); switch (lisp_addr_ip_afi(la)){ case AF_INET: next_prot = NP_IPv4; break; case AF_INET6: next_prot = NP_IPv6; break; default: OOR_LOG(LDBG_1, "vxlan_gpe_data_encap: Next protocol not supported"); return (NULL); } /* push vxlan-gpe data hdr */ vxlan_gpe_data_push_hdr(b, vni, next_prot); /* push outer UDP and IP */ pkt_push_udp_and_ip(b, lp, rp, lisp_addr_ip(la), lisp_addr_ip(ra)); ip_hdr_set_ttl_and_tos(lbuf_data(b), ttl, tos); return(lbuf_data(b)); } void * vxlan_gpe_data_pull_hdr(lbuf_t *b) { void *dt = lbuf_pull(b, sizeof(vxlan_gpe_hdr_t)); return(dt); } uint32_t vxlan_gpe_hdr_get_vni(vxlan_gpe_hdr_t *hdr) { return (pkt_get_uint32_from_3bytes(hdr->vni)); }
// // DFTeacherCoursesViewController.h // dafan // // Created by iMac on 14-8-14. // Copyright (c) 2014年 com. All rights reserved. // #import "SYTableViewController.h" #import "DFTeacherItem.h" @interface DFTeacherCoursesViewController : SYTableViewController - (id) initWithTeacherId:(NSInteger)teacherId; @property(nonatomic, strong) DFTeacherItem* defaultTeacherItem; @end
/* SPC5 HAL - Copyright (C) 2013 STMicroelectronics Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "hal.h" #if HAL_USE_PAL || defined(__DOXYGEN__) /* Initial setup of all defined pads, the list is terminated by a {-1, 0, 0}.*/ static const spc_siu_init_t spc_siu_init[] = { {PCR(PORT_B, PB_LIN0_TDX), PAL_HIGH, PAL_MODE_OUTPUT_ALTERNATE(1)}, {PCR(PORT_B, PB_LIN0_RDX), PAL_HIGH, PAL_MODE_INPUT}, {PCR(PORT_E, PE_BUTTON1), PAL_LOW, PAL_MODE_INPUT}, {PCR(PORT_E, PE_BUTTON2), PAL_LOW, PAL_MODE_INPUT}, {PCR(PORT_E, PE_BUTTON3), PAL_LOW, PAL_MODE_INPUT}, {PCR(PORT_E, PE_BUTTON4), PAL_LOW, PAL_MODE_INPUT}, {PCR(PORT_E, PE_LED1), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, {PCR(PORT_E, PE_LED2), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, {PCR(PORT_E, PE_LED3), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, {PCR(PORT_E, PE_LED4), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, {-1, 0, 0} }; /* Initialization array for the PSMI registers.*/ static const uint8_t spc_padsels_init[SPC5_SIUL_NUM_PADSELS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /** * @brief PAL setup. */ const PALConfig pal_default_config = { PAL_MODE_UNCONNECTED, spc_siu_init, spc_padsels_init }; #endif /* * Early initialization code. * This initialization must be performed just after stack setup and before * any other initialization. */ void __early_init(void) { spc_clock_init(); } /* * Board-specific initialization code. */ void boardInit(void) { }
// // UIImageView+TXExtension.h // BSBDJ // // Created by TimXu on 10/13/15. // Copyright © 2015 TimXu. All rights reserved. // #import <UIKit/UIKit.h> @interface UIImageView (TXExtension) - (void)setHeaderWithURL:(NSString *)url; - (void)setCircleHeaderWithURL:(NSString *)url; - (void)setRectHeaderWithURL:(NSString *)url; @end
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Array struct Il2CppArray; #include "mscorlib_System_Object837106420.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Array/SimpleEnumerator struct SimpleEnumerator_t3207148342 : public Il2CppObject { public: // System.Array System.Array/SimpleEnumerator::enumeratee Il2CppArray * ___enumeratee_0; // System.Int32 System.Array/SimpleEnumerator::currentpos int32_t ___currentpos_1; // System.Int32 System.Array/SimpleEnumerator::length int32_t ___length_2; public: inline static int32_t get_offset_of_enumeratee_0() { return static_cast<int32_t>(offsetof(SimpleEnumerator_t3207148342, ___enumeratee_0)); } inline Il2CppArray * get_enumeratee_0() const { return ___enumeratee_0; } inline Il2CppArray ** get_address_of_enumeratee_0() { return &___enumeratee_0; } inline void set_enumeratee_0(Il2CppArray * value) { ___enumeratee_0 = value; Il2CppCodeGenWriteBarrier(&___enumeratee_0, value); } inline static int32_t get_offset_of_currentpos_1() { return static_cast<int32_t>(offsetof(SimpleEnumerator_t3207148342, ___currentpos_1)); } inline int32_t get_currentpos_1() const { return ___currentpos_1; } inline int32_t* get_address_of_currentpos_1() { return &___currentpos_1; } inline void set_currentpos_1(int32_t value) { ___currentpos_1 = value; } inline static int32_t get_offset_of_length_2() { return static_cast<int32_t>(offsetof(SimpleEnumerator_t3207148342, ___length_2)); } inline int32_t get_length_2() const { return ___length_2; } inline int32_t* get_address_of_length_2() { return &___length_2; } inline void set_length_2(int32_t value) { ___length_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
/** * Appcelerator Titanium Mobile * Copyright (c) 2010 by NeoChat, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import "TiBase.h" #import "TiUIViewProxy.h" #ifdef USE_TI_UIIOSADVIEW @interface TiUIiOSAdViewProxy : TiUIViewProxy { } // Need these for sanity checking and constants, so they // must be class-available rather than instance-available +(NSString*)portraitSize; +(NSString*)landscapeSize; #pragma mark internal -(void)fireLoad:(id)unused; @end #endif
// // MenuItem.h // Text // // Created by huxingqin on 2016/11/22. // Copyright © 2016年 huxingqin. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, MenuItemHighlightedType) { MenuItemHighlightedTypeDefault = 0, MenuItemHighlightedTypeWhiteAndFront = 1 }; @interface MenuItem : UIView @property (nonatomic, weak, readonly) UIImageView *imageView; @property (nonatomic, weak, readonly) UILabel *label; @property (nonatomic, readonly) CGSize titleSize; @property (nonatomic) MenuItemHighlightedType highlightedType; - (void)setMenuTitle:(NSString *)title font:(UIFont *)font; - (void)setMenuImage:(UIImage *)image; - (void)setMenuClickBlock:(void (^)(NSInteger tag))block; @end
/* * Copyright (c) 2015-2016 Spotify AB. * * 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. */ #import "SPTDataLoaderResponse.h" @class SPTDataLoaderRequest; /** * A private delegate API for the objects in the SPTDataLoader library to use */ @interface SPTDataLoaderResponse (Private) /** * The error that the request generated */ @property (nonatomic, strong, readwrite) NSError *error; /** * Allows private consumers to alter the data for the response */ @property (nonatomic, strong, readwrite) NSData *body; /** * Allows private consumers to alter the request time for the response */ @property (nonatomic, assign, readwrite) NSTimeInterval requestTime; /** * Class constructor * @param request The request object making up the response * @param response The URL response received from the session */ + (instancetype)dataLoaderResponseWithRequest:(SPTDataLoaderRequest *)request response:(NSURLResponse *)response; /** * Whether we should retry the current request based on the current response data */ - (BOOL)shouldRetry; @end
#pragma once #include "inventory_item_object.h" struct SBoneProtections; class CCustomOutfit : public CInventoryItemObject { private: typedef CInventoryItemObject inherited; public: CCustomOutfit(); virtual ~CCustomOutfit(); virtual void Load(LPCSTR section); //óìåíüøåííàÿ âåðñèÿ õèòà, äëÿ âûçîâà, êîãäà êîñòþì íàäåò íà ïåðñîíàæà virtual void Hit(float P, ALife::EHitType hit_type); //êîýôôèöèåíòû íà êîòîðûå äîìíîæàåòñÿ õèò //ïðè ñîîòâåòñòâóþùåì òèïå âîçäåéñòâèÿ //åñëè íà ïåðñîíàæå íàäåò êîñòþì float GetHitTypeProtection(ALife::EHitType hit_type, s16 element); float GetDefHitTypeProtection(ALife::EHitType hit_type); float GetBoneArmor(s16 element); float HitThroughArmor(float hit_power, s16 element, float ap, bool& add_wound, ALife::EHitType hit_type); virtual void OnMoveToSlot(const SInvItemPlace& prev); virtual void OnMoveToRuck(const SInvItemPlace& previous_place); virtual void OnH_A_Chield(); protected: HitImmunity::HitTypeSVec m_HitTypeProtection; shared_str m_ActorVisual; shared_str m_full_icon_name; SBoneProtections* m_boneProtection; protected: u32 m_ef_equipment_type; u32 m_artefact_count; public: float m_fPowerLoss; float m_additional_weight; float m_additional_weight2; float m_fHealthRestoreSpeed; float m_fRadiationRestoreSpeed; float m_fSatietyRestoreSpeed; float m_fPowerRestoreSpeed; float m_fBleedingRestoreSpeed; shared_str m_BonesProtectionSect; shared_str m_NightVisionSect; bool bIsHelmetAvaliable; virtual u32 ef_equipment_type() const; virtual BOOL BonePassBullet(int boneID); const shared_str& GetFullIconName() const { return m_full_icon_name; } u32 get_artefact_count() const { return m_artefact_count; } virtual BOOL net_Spawn(CSE_Abstract* DC); virtual void net_Export(NET_Packet& P); virtual void net_Import(NET_Packet& P); void ApplySkinModel(CActor* pActor, bool bDress, bool bHUDOnly); void ReloadBonesProtection(); void AddBonesProtection(LPCSTR bones_section); protected: virtual bool install_upgrade_impl(LPCSTR section, bool test); };
/** * Copyright 2017 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. * ************************************************************************** */ #ifdef __cplusplus #import "objc/TINKMac.h" #import <Foundation/Foundation.h> #include "tink/mac.h" NS_ASSUME_NONNULL_BEGIN /** * This interface is internal-only. Use TINKMacFactory to get an instance that conforms to * TINKMac. */ @interface TINKMacInternal : NSObject <TINKMac> - (instancetype)init NS_UNAVAILABLE; - (nullable instancetype)initWithCCMac:(std::unique_ptr<crypto::tink::Mac>)ccMac NS_DESIGNATED_INITIALIZER; - (nullable crypto::tink::Mac *)ccMac; @end NS_ASSUME_NONNULL_END #endif // __cplusplus
/****************************************************************************** * Copyright 2017 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ /** * @file * @brief Define move sequence predictor */ #ifndef MODULES_PREDICTION_PREDICTOR_MOVE_SEQUENCE_MOVE_SEQUENCE_PREDICTOR_H_ #define MODULES_PREDICTION_PREDICTOR_MOVE_SEQUENCE_MOVE_SEQUENCE_PREDICTOR_H_ #include <array> #include <string> #include <vector> #include <utility> #include "Eigen/Dense" #include "gtest/gtest.h" #include "modules/common/macro.h" #include "modules/common/math/kalman_filter.h" #include "modules/common/proto/pnc_point.pb.h" #include "modules/prediction/predictor/sequence/sequence_predictor.h" #include "modules/prediction/proto/lane_graph.pb.h" namespace apollo { namespace prediction { class MoveSequencePredictor : public SequencePredictor { public: /** * @brief Constructor */ MoveSequencePredictor() = default; /** * @brief Destructor */ virtual ~MoveSequencePredictor() = default; /** * @brief Make prediction * @param Obstacle pointer */ void Predict(Obstacle* obstacle) override; FRIEND_TEST(MoveSequencePredictorTest, Polynomial); FRIEND_TEST(MoveSequencePredictorTest, Utils); private: void DrawMoveSequenceTrajectoryPoints( const Obstacle& obstacle, const LaneSequence& lane_sequence, const double total_time, const double period, std::vector<apollo::common::TrajectoryPoint>* points); bool GetLongitudinalPolynomial( const Obstacle& obstacle, const LaneSequence& lane_sequence, std::pair<double, double>* lon_end_state, std::array<double, 5>* coefficients); bool GetLateralPolynomial(const Obstacle& obstacle, const LaneSequence& lane_sequence, const double time_to_end_state, std::array<double, 6>* coefficients); double ComputeTimeToLatEndConditionByVelocity( const Obstacle& obstacle, const LaneSequence& lane_sequence); std::pair<double, double> ComputeLonEndState( const std::array<double, 3>& init_s, const LaneSequence& lane_sequence); void GenerateCandidateTimes(std::vector<double>* candidate_times); }; } // namespace prediction } // namespace apollo #endif // MODULES_PREDICTION_PREDICTOR_MOVE_SEQUENCE_MOVE_SEQUENCE_PREDICTOR_H_
///////////////////////////////////////////////////////////////////////////// // Copyright (c) 2009-2011 Alan Wright. All rights reserved. // Distributable under the terms of either the Apache License (Version 2.0) // or the GNU Lesser General Public License. ///////////////////////////////////////////////////////////////////////////// #ifndef BYTEFIELDSOURCE_H #define BYTEFIELDSOURCE_H #include "FieldCacheSource.h" namespace Lucene { /// Obtains byte field values from the {@link FieldCache} using getBytes() and makes those values available /// as other numeric types, casting as needed. /// /// @see FieldCacheSource for requirements on the field. /// /// NOTE: with the switch in 2.9 to segment-based searching, if {@link #getValues} is invoked with a composite /// (multi-segment) reader, this can easily cause double RAM usage for the values in the FieldCache. It's /// best to switch your application to pass only atomic (single segment) readers to this API. Alternatively, /// for a short-term fix, you could wrap your ValueSource using {@link MultiValueSource}, which costs more CPU /// per lookup but will not consume double the FieldCache RAM. class LPPAPI ByteFieldSource : public FieldCacheSource { public: /// Create a cached byte field source with a specific string-to-byte parser. ByteFieldSource(const String& field, ByteParserPtr parser = ByteParserPtr()); virtual ~ByteFieldSource(); LUCENE_CLASS(ByteFieldSource); protected: ByteParserPtr parser; public: virtual String description(); virtual DocValuesPtr getCachedFieldValues(FieldCachePtr cache, const String& field, IndexReaderPtr reader); virtual bool cachedFieldSourceEquals(FieldCacheSourcePtr other); virtual int32_t cachedFieldSourceHashCode(); }; } #endif
// // Copyright (c) 2014 Limit Point Systems, 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. // // Interface for class dof_tuple_schema_ids_record #ifndef DOF_TUPLE_SCHEMA_IDS_RECORD_H #define DOF_TUPLE_SCHEMA_IDS_RECORD_H #ifndef SHEAF_DLL_SPEC_H #include "SheafSystem/sheaf_dll_spec.h" #endif #ifndef ATTRIBUTES_RECORD_H #include "SheafSystem/attributes_record.h" #endif namespace sheaf { /// /// A wrapper/adapter for the dof tuple schema ids record. /// Intended for transferring index-id map data /// between the kernel and the i/o subsystem. /// /// class SHEAF_DLL_SPEC dof_tuple_schema_ids_record : public attributes_record { public: // ============================================================================= // ANY FACET // ============================================================================= // CANONICAL MEMBERS /// /// Virtual constructor; /// makes a new instance of /// the same type as this /// virtual dof_tuple_schema_ids_record* clone() const; /// /// Class invariant. /// virtual bool invariant() const; /// /// Conformance test; true if other conforms to this /// virtual bool is_ancestor_of(const any* other) const; // ============================================================================= // DOF_TUPLE_SCHEMA_IDS_RECORD FACET // ============================================================================= /// /// Creates an instance with type map xtype_map /// dof_tuple_schema_ids_record(poset_scaffold& xscaffold); /// /// Copy constructor /// /// dof_tuple_schema_ids_record(const dof_tuple_schema_ids_record& xother); /// /// Destructor /// virtual ~dof_tuple_schema_ids_record(); protected: /// /// Initializes the poset from the internal buffer. /// void transfer_internal_buffer_to_poset(); /// /// Initializes the internal buffer from the poset. /// void transfer_poset_to_internal_buffer(); }; } // namespace sheaf #endif // ifndef DOF_TUPLE_SCHEMA_IDS_RECORD_H
#ifndef __SSH_EXCEPTION_H__ #define __SSH_EXCEPTION_H__ #include "Vars.h" #include "Poco/Exception.h" namespace SubutaiLauncher { POCO_DECLARE_EXCEPTION(Subutai_API, SSHException, Poco::Exception) } #endif
/** * Appcelerator Titanium Mobile * Copyright (c) 2010 by Dinner_Bell, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import "TiBase.h" #ifdef USE_TI_MAP #import <MapKit/MapKit.h> @interface TiMapRouteAnnotation : NSObject<MKAnnotation> { @private // points that make up the route. NSMutableArray* points; // computed span of the route MKCoordinateSpan span; // computed center of the route. CLLocationCoordinate2D center; // color of the line that will be rendered. UIColor* lineColor; // id of the route we can use for indexing. NSString* routeID; // the width of the line CGFloat width; } @property (readonly) MKCoordinateRegion region; @property (nonatomic, assign) CGFloat width; @property (nonatomic, retain) UIColor* lineColor; @property (nonatomic, retain) NSMutableArray* points; @property (nonatomic, retain) NSString* routeID; -(id) initWithPoints:(NSArray*) points; @end #endif
/* * Copyright 2014-2016 CyberVision, 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. */ #include <mbedtls/pk.h> #include <mbedtls/entropy.h> #include <mbedtls/ctr_drbg.h> #include <mbedtls/md.h> #include <kaa_error.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #ifndef KAA_AES_RSA_H_ #define KAA_AES_RSA_H_ #define KAA_SESSION_KEY_LENGTH 16 /** * @brief generate AES key * * @param[out] key Generated AES key * @param[in] bytes Size of the AES key */ int init_aes_key(unsigned char *key, size_t bytes); /** * @brief encrypt or decrypt with AES key * * @param[in] mode Mode of encryption * @param[in] input Pointer to input data * @param[in] input_size Size of input data * @param[out] output Pointer to output data * @param[in] key Pointer to AES key */ kaa_error_t aes_encrypt_decrypt(int mode, const uint8_t *input, size_t input_size, uint8_t *output, const uint8_t *key); /** * @brief create RSA signature * * @param[in] pk Pointer to a pk structure * @param[in] input Pointer to input data * @param[in] input_size Size of input data * @param[out] output Pointer to RSA signature * @param[out] output_size Size of RSA signature */ int rsa_sign(mbedtls_pk_context *pk, const uint8_t *input, size_t input_size, uint8_t *output, size_t *output_size); #endif /* KAA_AES_RSA_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. */ #if !defined(harmonyglob_h) #define harmonyglob_h #include "vmi.h" extern void *LUNI_HARMONY_ID_CACHE; #define HARMONY_ID_CACHE LUNI_HARMONY_ID_CACHE typedef struct LUNIJniIDCache { jfieldID FID_java_io_RandomAccessFile_fd; jfieldID FID_java_io_FileDescriptor_descriptor; jfieldID FID_java_io_FileInputStream_fd; jfieldID FID_java_io_FileOutputStream_fd; jfieldID FID_org_apache_harmony_luni_internal_process_ProcessInputStream_handle; jfieldID FID_org_apache_harmony_luni_internal_process_ProcessInputStream_fd; jfieldID FID_org_apache_harmony_luni_internal_process_ProcessOutputStream_handle; jfieldID FID_org_apache_harmony_luni_internal_process_ProcessOutputStream_fd; jfieldID FID_org_apache_harmony_luni_internal_process_SystemProcess_handle; jfieldID FID_java_net_SocketImpl_address; jfieldID FID_java_net_SocketImpl_port; jfieldID FID_java_net_DatagramPacket_length; jfieldID FID_java_net_DatagramPacket_address; jfieldID FID_java_net_DatagramPacket_port; jfieldID FID_java_lang_ClassLoader_vmRef; jfieldID FID_com_ibm_oti_vm_MemorySpace; /* Used by ObjectStreamClass */ jmethodID MID_java_lang_reflect_Field_getSignature; jmethodID MID_java_lang_reflect_Method_getSignature; jmethodID MID_java_lang_reflect_Constructor_getSignature; /* Used by shared net helpers */ jmethodID MID_java_lang_Boolean_init; jmethodID MID_java_lang_Byte_init; jmethodID MID_java_lang_Integer_init; jmethodID MID_java_net_InetAddress_init_byteArray; jmethodID MID_java_net_InetAddress_init_byteArrayLjava_lang_String; jmethodID MID_java_lang_Thread_yield; jmethodID MID_java_net_InetAddress_getByAddress_Ljava_lang_String_byteArray; jmethodID MID_java_net_InetAddress_getByAddress_byteArray; jmethodID MID_java_net_InetAddress_preferIPv6Addresses; jmethodID MID_java_net_Socket_preferIPv4Stack; jclass CLS_java_lang_Boolean; jclass CLS_java_lang_Byte; jclass CLS_java_lang_Integer; jclass CLS_java_lang_Thread; jclass CLS_java_net_InetAddress; jclass CLS_java_net_Socket; jfieldID FID_java_lang_Boolean_value; jfieldID FID_java_lang_Byte_value; jfieldID FID_java_lang_Integer_value; jfieldID FID_java_net_InetAddress_address; jclass CLS_array_of_byte; /* comm connection port lists */ char **realPortArray; char **synthPortArray; int portListLen; /* HARMONY support for IPv6 */ jboolean harmony_supports_ipv6; /* additional IDs for luni and nio */ jclass CLS_java_lang_Long; jclass CLS_java_net_Inet6Address; jfieldID FID_java_lang_Long_value; jmethodID MID_java_net_InetAddress_init; } LUNIJniIDCache; #define JniIDCache LUNIJniIDCache /* Now that the module-specific defines are in place, include the shared file */ #include "libglob.h" /* all UNIX platforms */ #if defined(LINUX) #include "hysignal.h" #endif /* UNIX */ #endif /* harmonyglob_h */
#ifndef _VB_CODEC_H_ #define _VB_CODEC_H_ #include <Codec.h> class VBCodec : public Codec { public: VBCodec(bool delta) : Codec(delta) {} virtual void encode(ostream &out, size_t val) const; virtual size_t bytes(size_t val) const; virtual size_t decode(istream &in) const; virtual void encode(FILE *fp, size_t val) const; virtual size_t decode(FILE *fp) const; virtual ~VBCodec() {} }; #endif
// // YR_DailyCollectionCell.h // Artand // // Created by dllo on 16/9/3. // Copyright © 2016年 kaleidoscope. All rights reserved. // #import "YR_BaseTableViewCell.h" @interface YR_DailyCollectionCell : YR_BaseTableViewCell @property (weak, nonatomic) IBOutlet UIImageView *dailyCollectionImageView; @end
/** @file * Copyright (c) 2016-2018, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. **/ #include "val/include/sbsa_avs_val.h" #include "val/include/sbsa_avs_pe.h" #include "val/include/val_interface.h" #define TEST_NUM (AVS_PE_TEST_NUM_BASE + 19) #define TEST_DESC "Check for RAS extension " static void payload() { uint64_t data = 0; uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); if (g_sbsa_level < 4) { val_set_status(index, RESULT_SKIP(g_sbsa_level, TEST_NUM, 01)); return ; } /* Read ID_AA64PFR0_EL1[31:28] For RAS Extensions */ data = VAL_EXTRACT_BITS(val_pe_reg_read(ID_AA64PFR0_EL1), 28, 31); if (data == 0x0) val_set_status(index, RESULT_FAIL(g_sbsa_level, TEST_NUM, 01)); else val_set_status(index, RESULT_PASS(g_sbsa_level, TEST_NUM, 01)); } uint32_t c019_entry(uint32_t num_pe) { uint32_t status = AVS_STATUS_FAIL; status = val_initialize_test(TEST_NUM, TEST_DESC, num_pe, g_sbsa_level); /* This check is when user is forcing us to skip this test */ if (status != AVS_STATUS_SKIP) val_run_test_payload(TEST_NUM, num_pe, payload, 0); /* get the result from all PE and check for failure */ status = val_check_for_error(TEST_NUM, num_pe); val_report_status(0, SBSA_AVS_END(g_sbsa_level, TEST_NUM)); return status; }
/* Copyright (c) 2011, Siemens Corporate Research a Division of Siemens Corporation All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // ivWin.h #pragma once using namespace System; class ivThreadWnd; namespace Renderer { public ref class ivChildWindow { public: ivChildWindow(); virtual ~ivChildWindow(); // window virtual bool create(IntPtr parent, String^ instance); virtual void destroy(); virtual void show(bool visible); // loads Inventor extension libraries virtual bool loadLibraries(String^ libs); // loads scene graph (call after window is created) virtual bool loadGraph(String^ graph); // generic parameter interfaces virtual String^ get(String^ param); virtual bool set(String^ param, String^ value); private: ivThreadWnd *mWindow; }; }
// Copyright 2018 Google LLC // Copyright 2018-present Open Networking Foundation // SPDX-License-Identifier: Apache-2.0 #ifndef STRATUM_HAL_LIB_PHAL_ONLP_ONLP_LED_DATASOURCE_H_ #define STRATUM_HAL_LIB_PHAL_ONLP_ONLP_LED_DATASOURCE_H_ #include <memory> #include <string> #include "absl/memory/memory.h" #include "stratum/glue/integral_types.h" #include "stratum/glue/status/status.h" #include "stratum/glue/status/statusor.h" #include "stratum/hal/lib/common/common.pb.h" #include "stratum/hal/lib/phal/datasource.h" #include "stratum/hal/lib/phal/onlp/onlp_wrapper.h" #include "stratum/hal/lib/phal/phal.pb.h" #include "stratum/lib/macros.h" namespace stratum { namespace hal { namespace phal { namespace onlp { class OnlpLedDataSource : public DataSource { // Makes a shared_ptr to an LedDataSource which manages an ONLP LED object. // Returns error if the OID object is not of the correct type or not present. public: // OnlpLedDataSource does not take ownership of onlp_interface. We expect // onlp_interface remains valid during OnlpLedDataSource's lifetime. static ::util::StatusOr<std::shared_ptr<OnlpLedDataSource>> Make( int led_id, OnlpInterface* onlp_interface, CachePolicy* cache_policy); // Function to set LED mode. ::util::Status SetLedMode(LedMode value); // Function to set LED character. ::util::Status SetLedCharacter(int32 val); // Accessors for managed attributes. ManagedAttribute* GetLedId() { return &led_id_; } ManagedAttribute* GetLedDesc() { return &led_desc_; } ManagedAttribute* GetLedHardwareState() { return &led_hw_state_; } ManagedAttribute* GetLedMode() { return &led_mode_; } ManagedAttribute* GetLedChar() { return &led_char_; } // Led Capabilities ManagedAttribute* GetCapOff() { return &led_cap_off_; } ManagedAttribute* GetCapAuto() { return &led_cap_auto_; } ManagedAttribute* GetCapAutoBlinking() { return &led_cap_auto_blinking_; } ManagedAttribute* GetCapChar() { return &led_cap_char_; } ManagedAttribute* GetCapRed() { return &led_cap_red_; } ManagedAttribute* GetCapRedBlinking() { return &led_cap_red_blinking_; } ManagedAttribute* GetCapOrange() { return &led_cap_orange_; } ManagedAttribute* GetCapOrangeBlinking() { return &led_cap_orange_blinking_; } ManagedAttribute* GetCapYellow() { return &led_cap_yellow_; } ManagedAttribute* GetCapYellowBlinking() { return &led_cap_yellow_blinking_; } ManagedAttribute* GetCapGreen() { return &led_cap_green_; } ManagedAttribute* GetCapGreenBlinking() { return &led_cap_green_blinking_; } ManagedAttribute* GetCapBlue() { return &led_cap_blue_; } ManagedAttribute* GetCapBlueBlinking() { return &led_cap_blue_blinking_; } ManagedAttribute* GetCapPurple() { return &led_cap_purple_; } ManagedAttribute* GetCapPurpleBlinking() { return &led_cap_purple_blinking_; } private: OnlpLedDataSource(int led_id, OnlpInterface* onlp_interface, CachePolicy* cache_policy, const LedInfo& led_info); static ::util::Status ValidateOnlpLedInfo(OnlpOid led_oid, OnlpInterface* onlp_interface) { return onlp_interface->GetOidInfo(led_oid).status(); } ::util::Status UpdateValues() override; OnlpOid led_oid_; // We do not own ONLP stub object. ONLP stub is created on PHAL creation and // destroyed when PHAL deconstruct. Do not delete onlp_stub_. OnlpInterface* onlp_stub_; // A list of managed attributes. // Hardware Info. TypedAttribute<int> led_id_{this}; TypedAttribute<std::string> led_desc_{this}; EnumAttribute led_hw_state_{HwState_descriptor(), this}; TypedAttribute<int32> led_char_{this}; // Led Mode EnumAttribute led_mode_{LedMode_descriptor(), this}; // Led Capabilities TypedAttribute<bool> led_cap_off_{this}; TypedAttribute<bool> led_cap_auto_{this}; TypedAttribute<bool> led_cap_auto_blinking_{this}; TypedAttribute<bool> led_cap_char_{this}; TypedAttribute<bool> led_cap_red_{this}; TypedAttribute<bool> led_cap_red_blinking_{this}; TypedAttribute<bool> led_cap_orange_{this}; TypedAttribute<bool> led_cap_orange_blinking_{this}; TypedAttribute<bool> led_cap_yellow_{this}; TypedAttribute<bool> led_cap_yellow_blinking_{this}; TypedAttribute<bool> led_cap_green_{this}; TypedAttribute<bool> led_cap_green_blinking_{this}; TypedAttribute<bool> led_cap_blue_{this}; TypedAttribute<bool> led_cap_blue_blinking_{this}; TypedAttribute<bool> led_cap_purple_{this}; TypedAttribute<bool> led_cap_purple_blinking_{this}; }; } // namespace onlp } // namespace phal } // namespace hal } // namespace stratum #endif // STRATUM_HAL_LIB_PHAL_ONLP_ONLP_LED_DATASOURCE_H_
/** * Definition of TLS transaction descriptor. * * @author Aleksandar Dragojevic aleksandar.dragojevic@epfl.ch * */ #ifndef WLPDSTM_CURRENT_TRANSACTION_H_ #define WLPDSTM_CURRENT_TRANSACTION_H_ #ifdef SWISSTM #include "../stm/transaction.h" namespace wlpdstm { typedef TransactionImpl Transaction; } #elif defined DYNAMIC #include "../dynamic/transaction.h" namespace wlpdstm { typedef TransactionImpl Transaction; } #else #include "profiled_transaction.h" #endif /* SWISSTM */ #include "../common/tls.h" namespace wlpdstm { // A shortcut used for accessing transaction in progress. class CurrentTransaction : public Tls<Transaction, true, true> { public: static void TxStart(int lexical_tx_id = NO_LEXICAL_TX) { Tls<Transaction, true, true>::Get()->TxStart(lexical_tx_id); } static LONG_JMP_BUF *GetLongJmpBuf() { return &Tls<Transaction, true, true>::Get()->start_buf; } static void TxCommit() { Tls<Transaction, true, true>::Get()->TxCommit(); } static void TxRestart() { Tls<Transaction, true, true>::Get()->TxRestart(); } static void TxAbort() { Tls<Transaction, true, true>::Get()->TxAbort(); } static void WriteWord(Word *address, Word value) { Tls<Transaction, true, true>::Get()->WriteWord(address, value); } #ifdef SUPPORT_LOCAL_WRITES static void WriteWordLocal(Word *address, Word value) { Tls<Transaction, true, true>::Get()->WriteWordLocal(address, value); } #endif /* SUPPORT_LOCAL_WRITES */ static Word ReadWord(Word *address) { return Tls<Transaction, true, true>::Get()->ReadWord(address); } static void *TxMalloc(size_t size) { return Tls<Transaction, true, true>::Get()->TxMalloc(size); } static void TxFree(void *address, size_t size) { return Tls<Transaction, true, true>::Get()->TxFree(address, size); } static void ThreadShutdown() { Tls<Transaction, true, true>::Get()->ThreadShutdown(); } }; } #endif /* WLPDSTM_CURRENT_TRANSACTION_H_ */
//****************************************************************************************** // File: EX_RGB_NeoPixelBus.h // Authors: Allan (vseven) based on EX_Switch_Dim by Dan G Ogorchock // // Summary: EX_RGB_NeoPixelBus is a class which implements the SmartThings "Color Control", "Switch", and "Switch Level" device capabilities. // It inherits from the st::Executor class. // // Create an instance of this class in your sketch's global variable section // For Example: st::EX_RGB_NeoPixelBus executor1("rgbSwitch1", PIXEL_COUNT, PIN_RGB); // // st::EX_RGB_NeoPixelBus() constructor requires the following arguments // - String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name. // - uint16_t pixelCount - REQUIRED - the number of programmable pixels in the RGB strip // - uint8_t pinRGB - REQUIRED - the pin to use for data writes // // Change History: // // Date Who What // ---- --- ---- // 2016-04-30 Dan Ogorchock Original Creation // 2018-08-14 Dan Ogorchock Modified to avoid compiler errors on ESP32 since it currently does not support "analogWrite()" // 2017-08-30 Dan Ogorchock Modified comment section above to comply with new Parent/Child Device Handler requirements // 2017-10-06 Allan (vseven) Modified original code from EX_Switch_Dim to be used for RGB lighting // 2020-08-01 Allan (vseven) Modified the EX_RGB_Dim for use with addressable LED strips using the NeoPixelBus library // //****************************************************************************************** #ifndef ST_EX_RGB_NeoPixelBus #define ST_EX_RGB_NeoPixelBus #include "Executor.h" #include <NeoPixelBus.h> namespace st { template<typename T_COLOR_FEATURE, typename T_METHOD> class EX_RGB_NeoPixelBus: public Executor { private: bool m_bCurrentState; //HIGH or LOW String m_sCurrentHEX; //HEX value of color currently set void writeCommandToOutput(); //function to update the Arduino Digital Output Pin // NeoPixelBus object. Modify for the correct parameter list: https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBus-object NeoPixelBus<T_COLOR_FEATURE, T_METHOD> m_nStrip; public: //constructor - called in your sketch's global variable declaration section EX_RGB_NeoPixelBus<T_COLOR_FEATURE, T_METHOD>(const __FlashStringHelper *name, uint16_t pixelCount, uint8_t pinRGB); //destructor virtual ~EX_RGB_NeoPixelBus(); //initialization routine virtual void init(); //SmartThings Shield data handler (receives command to turn "on" or "off" the switch along with HEX value for LEDs) virtual void beSmart(const String &str); //called periodically to ensure state of the switch is up to date in the SmartThings Cloud (in case an event is missed) virtual void refresh(); //gets virtual bool getStatus() const { return m_bCurrentState; } //whether the switch is HIGH or LOW virtual String getHEX() const { return m_sCurrentHEX; } // color value in HEX //sets }; } #endif
/** @file @author Alexander Sherikov @copyright 2017 Alexander Sherikov. Licensed under the Apache License, Version 2.0. (see LICENSE or http://www.apache.org/licenses/LICENSE-2.0) @brief */ #pragma once namespace qpmad { class ConstraintStatus { public: enum Status { UNDEFINED = 0, INCONSISTENT = 1, EQUALITY = 2, INACTIVE = 3, ACTIVE_LOWER_BOUND = 4, ACTIVE_UPPER_BOUND = 5 }; }; } // namespace qpmad
// // IDLCollectionViewCell.h // iDroidLayout // // Created by Jose Rojas on 3/31/15. // Copyright (c) 2015 Jose Rojas. // #import <UIKit/UIKit.h> #import "IDLLayoutBridge.h" @class IDLLayoutInflater; @interface IDLCollectionViewCell : UICollectionViewCell @property (weak, nonatomic, readonly) IDLLayoutBridge *layoutBridge; @property (strong, nonatomic) NSURL *layoutURL; - (void) setLayoutResource: (NSString *)resource; - (void) setLayoutResource: (NSString *)resource inflater: (IDLLayoutInflater *) inflater; - (void) setLayoutURL: (NSURL *)url inflater: (IDLLayoutInflater *) inflater; @end
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, // copy, modify, and distribute this software in source code or binary form for use // in connection with the web services and APIs provided by Facebook. // // As with any software that integrates with the Facebook platform, your use of // this software is subject to the Facebook Developer Principles and Policies // [http://developers.facebook.com/policy/]. This copyright notice shall be // included in all copies or substantial portions of the software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #import "TargetConditionals.h" #if !TARGET_OS_TV #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(EventBindingManager) @interface FBSDKEventBindingManager : NSObject - (instancetype)initWithJSON:(NSDictionary*)dict; - (void)updateBindings:(NSArray *)bindings; + (NSArray *)parseArray:(NSArray *)array; @end NS_ASSUME_NONNULL_END #endif
// Copyright 2020 Google LLC // // 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. // Contains functions used to symbolically evaluate P4 conditionals and their // branches. #ifndef P4_SYMBOLIC_SYMBOLIC_CONDITIONAL_H_ #define P4_SYMBOLIC_SYMBOLIC_CONDITIONAL_H_ #include "gutil/status.h" #include "p4_symbolic/ir/ir.pb.h" #include "p4_symbolic/symbolic/control.h" #include "p4_symbolic/symbolic/symbolic.h" #include "p4_symbolic/symbolic/values.h" #include "z3++.h" namespace p4_symbolic { namespace symbolic { namespace conditional { gutil::StatusOr<SymbolicTrace> EvaluateConditional( const Dataplane data_plane, const ir::Conditional &table, SymbolicPerPacketState *state, values::P4RuntimeTranslator *translator, const z3::expr &guard); } // namespace conditional } // namespace symbolic } // namespace p4_symbolic #endif // P4_SYMBOLIC_SYMBOLIC_CONDITIONAL_H_
// For conditions of distribution and use, see copyright notice in license.txt #pragma once #include "IComponent.h" #include "IAttribute.h" #include "OgreModuleFwd.h" #include "AssetReference.h" #include "AssetRefListener.h" class IModule; /// Particle system. /** <table class="header"> <tr> <td> <h2>ParticleSystem</h2> <b>Attributes</b>: <ul> <li>AssetReference: particleRef <div>Particle resource asset reference.</div> <li>bool: castShadows <div>does particles cast shadows (mostly useless).</div> <li>float: renderingDistance <div>Particles rendering distance.</div> </ul> <b>Exposes the following scriptable functions:</b> <ul> <li>"CreateParticleSystem": Create a new particle system. System name will be same as component name. <li>"DeleteParticleSystem": Delete excisting particle system. </ul> <b>Reacts on the following actions:</b> <ul> <li>... </ul> </td> </tr> Does not emit any actions. <b>Depends on the component Placeable</b>. </table> */ class EC_ParticleSystem : public IComponent { Q_OBJECT COMPONENT_NAME("EC_ParticleSystem", 27) public: /// Do not directly allocate new components using operator new, but use the factory-based SceneAPI::CreateComponent functions instead. explicit EC_ParticleSystem(Scene* scene); ~EC_ParticleSystem(); /// Particle asset reference Q_PROPERTY(AssetReference particleRef READ getparticleRef WRITE setparticleRef); DEFINE_QPROPERTY_ATTRIBUTE(AssetReference, particleRef); /// Does particles cast shadows (mostly useless). Q_PROPERTY(bool castShadows READ getcastShadows WRITE setcastShadows); DEFINE_QPROPERTY_ATTRIBUTE(bool, castShadows); /// Particles rendering distance. Q_PROPERTY(float renderingDistance READ getrenderingDistance WRITE setrenderingDistance); DEFINE_QPROPERTY_ATTRIBUTE(float, renderingDistance); public slots: /// Create a new particle system. Does not delete the old void CreateParticleSystem(const QString &systemName); /// Delete all current particle systems. void DeleteParticleSystems(); private slots: void OnAttributeUpdated(IAttribute *attribute); void OnParticleAssetLoaded(AssetPtr asset); void OnParticleAssetFailed(IAssetTransfer* transfer, QString reason); void EntitySet(); void OnComponentRemoved(IComponent *component, AttributeChange::Type change); private: ComponentPtr FindPlaceable() const; std::vector<Ogre::ParticleSystem*> particleSystems_; OgreWorldWeakPtr world_; /// Asset ref listener for the particle asset AssetRefListenerPtr particleAsset_; };
// // TOAudioFilePlayer.h // FilePlayerTest // // Created by Tobias Ottenweller on 21.08.12. // Copyright (c) 2012 Tobias Ottenweller. All rights reserved. // #import <Foundation/Foundation.h> #import <AudioToolbox/AudioToolbox.h> @interface TOAudioFilePlayer : NSObject { AUGraph graph; AudioUnit filePlayerUnit; AUNode filePlayerNode; AudioUnit rioUnit; AUNode rioNode; AudioFileID audioFile; } @property (strong, nonatomic) NSURL *audioFileURL; /** Length of the audio file in seconds. */ @property (readonly, nonatomic) double fileDuration; /** Start in seconds of the region of the file selected. */ @property (assign, nonatomic) double regionStart; /** Number of seconds that should be played back. */ @property (assign, nonatomic) double regionDuration; /** Number of times the audio file should be replayed. 0: no looping. -1: endless looping */ @property (assign, nonatomic) UInt32 loopCount; /** Seconds before the selected file region begins to play. Count starts at the beginning of the document. */ @property (assign, nonatomic) double startTime; /** Apply the changes made. */ - (BOOL)applyChanges:(NSError *__autoreleasing *)error; @end
// // Copyright 2018 WebAssembly Community Group participants // // 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 WASP_BASE_WASM_TYPES_H_ #define WASP_BASE_WASM_TYPES_H_ #include <iosfwd> #include <vector> #include "wasp/base/absl_hash_value_macros.h" #include "wasp/base/at.h" #include "wasp/base/operator_eq_ne_macros.h" #include "wasp/base/types.h" namespace wasp { enum class Opcode : u32 { #define WASP_V(prefix, val, Name, str, ...) Name, #define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__) #define WASP_PREFIX_V(...) WASP_V(__VA_ARGS__) #include "wasp/base/inc/opcode.inc" #undef WASP_V #undef WASP_FEATURE_V #undef WASP_PREFIX_V }; enum class PackedType : u8 { #define WASP_V(val, Name, str) Name = val, #define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str) #include "wasp/base/inc/packed_type.inc" #undef WASP_V #undef WASP_FEATURE_V }; enum class NumericType : u8 { #define WASP_V(val, Name, str) Name = val, #define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str) #include "wasp/base/inc/numeric_type.inc" #undef WASP_V #undef WASP_FEATURE_V }; enum class ReferenceKind : u8 { #define WASP_V(val, Name, str) Name = val, #define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str) #include "wasp/base/inc/reference_kind.inc" #undef WASP_V #undef WASP_FEATURE_V }; enum class HeapKind : u8 { #define WASP_V(val, Name, str) Name = val, #define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str) #include "wasp/base/inc/heap_kind.inc" #undef WASP_V #undef WASP_FEATURE_V }; enum class ExternalKind : u8 { #define WASP_V(val, Name, str) Name = val, #define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str) #include "wasp/base/inc/external_kind.inc" #undef WASP_V #undef WASP_FEATURE_V }; enum class EventAttribute : u8 { #define WASP_V(val, Name, str) Name = val, #include "wasp/base/inc/event_attribute.inc" #undef WASP_V }; enum class Mutability : u8 { #define WASP_V(val, Name, str) Name = val, #include "wasp/base/inc/mutability.inc" #undef WASP_V }; enum class SegmentType { Active, Passive, Declared, }; enum class Shared { No, Yes, }; enum class Null { No, Yes, }; enum class IndexType { I32, I64, }; struct Limits { explicit Limits(At<u32> min); explicit Limits(At<u32> min, OptAt<u32> max); explicit Limits(At<u32> min, OptAt<u32> max, At<Shared>); explicit Limits(At<u32> min, OptAt<u32> max, At<Shared>, At<IndexType>); At<u32> min; OptAt<u32> max; At<Shared> shared; At<IndexType> index_type; }; struct MemoryType { At<Limits> limits; }; using ShuffleImmediate = std::array<u8, 16>; #define WASP_BASE_WASM_ENUMS(WASP_V) \ WASP_V(Opcode) \ WASP_V(PackedType) \ WASP_V(NumericType) \ WASP_V(ReferenceKind) \ WASP_V(HeapKind) \ WASP_V(ExternalKind) \ WASP_V(EventAttribute) \ WASP_V(Mutability) \ WASP_V(SegmentType) \ WASP_V(Shared) \ WASP_V(Null) \ WASP_V(IndexType) #define WASP_BASE_WASM_STRUCTS(WASP_V) \ WASP_V(Limits, 3, min, max, shared) \ WASP_V(MemoryType, 1, limits) #define WASP_BASE_WASM_CONTAINERS(WASP_V) \ WASP_V(ShuffleImmediate) WASP_BASE_WASM_STRUCTS(WASP_DECLARE_OPERATOR_EQ_NE) WASP_BASE_WASM_CONTAINERS(WASP_DECLARE_OPERATOR_EQ_NE) WASP_BASE_WASM_STRUCTS(WASP_ABSL_HASH_VALUE_VARGS) WASP_BASE_WASM_CONTAINERS(WASP_ABSL_HASH_VALUE_CONTAINER) } // namespace wasp #endif // WASP_BASE_WASM_TYPES_H_
/* * Copyright © 2011 Michael Willekes * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ #import <UIKit/UIKit.h> @class FormManager; @class Form; @class Record; @class FormDetailViewController; @interface QuestionsViewController : UITableViewController { FormDetailViewController *formDetails; // Parent Controller NSString *formTitle; // Passed-in from FormDetailController Record *record; // Passed-in from FormDetailController NSArray *questions; // List of this record's questions } @property (nonatomic, copy) NSString *formTitle; @property (nonatomic, retain) Record *record; @property (nonatomic, retain) FormDetailViewController *formDetails; // Set the current record to complete - (void)done; // Edit a Complete or Submitted record - (void)edit; @end
#pragma once #include <Windows.h> #include "AllDef.h" namespace SSDK { class Color { public: // constructors Color() { *((int *)this) = 0; } Color(uint8_t r, uint8_t g, uint8_t b) { SetColor(r, g, b, 255); } Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { SetColor(r, g, b, a); } void SetColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 0) { _color[0] = (uint8_t)r; _color[1] = (uint8_t)g; _color[2] = (uint8_t)b; _color[3] = (uint8_t)a; } void GetColor(uint8_t &r, uint8_t &g, uint8_t &b, uint8_t &a) const { r = _color[0]; g = _color[1]; b = _color[2]; a = _color[3]; } static Color FromARGB(unsigned long color) { int a = (color & 0xFF000000) >> 24; int r = (color & 0x00FF0000) >> 16; int g = (color & 0x0000FF00) >> 8; int b = (color & 0x000000FF); return Color(r, g, b, a); } void SetARGB(unsigned long color) { int a = (color & 0xFF000000) >> 24; int r = (color & 0x00FF0000) >> 16; int g = (color & 0x0000FF00) >> 8; int b = (color & 0x000000FF); SetColor(r, g, b, a); } DWORD GetARGB() const { int a = (_color[3]) >> 24; int r = (_color[0]) >> 16; int g = (_color[1]) >> 8; int b = (_color[2]); return a | r | g | b; } uint8_t &operator[](int index) { return _color[index]; } const uint8_t &operator[](int index) const { return _color[index]; } bool operator == (const Color &rhs) const { return (*((int *)this) == *((int *)&rhs)); } bool operator != (const Color &rhs) const { return !(operator==(rhs)); } int r() { return _color[0]; } int g() { return _color[1]; } int b() { return _color[2]; } int a() { return _color[3]; } int GetR() { return _color[0]; } int GetG() { return _color[1]; } int GetB() { return _color[2]; } int GetA() { return _color[3]; } void SetR(uint8_t _i) { _color[0] = _i; } void SetG(uint8_t _i) { _color[1] = _i; } void SetB(uint8_t _i) { _color[2] = _i; } void SetA(uint8_t _i) { _color[3] = _i; } float* base() { float clr[3]; clr[0] = (float)_color[0] / 255.f; clr[1] = (float)_color[1] / 255.f; clr[2] = (float)_color[2] / 255.f; return clr; } float rBase() { return (float)_color[0] / 255.f; } float gBase() { return (float)_color[1] / 255.f; } float bBase() { return (float)_color[2] / 255.f; } float aBase() { return (float)_color[3] / 255.f; } Color &operator=(const Color &rhs) { *(int*)(&_color[0]) = *(int*)&rhs._color[0]; return *this; } Color operator+(const Color &rhs) const { int red = _color[0] + rhs._color[0]; int green = _color[1] + rhs._color[1]; int blue = _color[2] + rhs._color[2]; int alpha = _color[3] + rhs._color[3]; red = red > 255 ? 255 : red; green = green > 255 ? 255 : green; blue = blue > 255 ? 255 : blue; alpha = alpha > 255 ? 255 : alpha; return Color(red, green, blue, alpha); } Color operator-(const Color &rhs) const { int red = _color[0] - rhs._color[0]; int green = _color[1] - rhs._color[1]; int blue = _color[2] - rhs._color[2]; int alpha = _color[3] - rhs._color[3]; red = red < 0 ? 0 : red; green = green < 0 ? 0 : green; blue = blue < 0 ? 0 : blue; alpha = alpha < 0 ? 0 : alpha; return Color(red, green, blue, alpha); } operator const uint8_t*() { return (uint8_t*)(&_color[0]); } private: uint8_t _color[4]; }; }
#import <UIKit/UIKit.h> #import "UIView+INSNibLoading.h" FOUNDATION_EXPORT double INSNibLoadingVersionNumber; FOUNDATION_EXPORT const unsigned char INSNibLoadingVersionString[];
// Copyright 2019 Google LLC // Copyright 2019-present Open Networking Foundation // SPDX-License-Identifier: Apache-2.0 #ifndef STRATUM_TESTING_TESTS_BCM_SIM_TEST_FIXTURE_H_ #define STRATUM_TESTING_TESTS_BCM_SIM_TEST_FIXTURE_H_ #include <memory> #include "gmock/gmock.h" #include "gtest/gtest.h" #include "p4/v1/p4runtime.pb.h" #include "stratum/hal/lib/bcm/bcm_acl_manager.h" #include "stratum/hal/lib/bcm/bcm_chassis_manager.h" #include "stratum/hal/lib/bcm/bcm_l2_manager.h" #include "stratum/hal/lib/bcm/bcm_l3_manager.h" #include "stratum/hal/lib/bcm/bcm_node.h" #include "stratum/hal/lib/bcm/bcm_packetio_manager.h" #include "stratum/hal/lib/bcm/bcm_sdk_sim.h" #include "stratum/hal/lib/bcm/bcm_serdes_db_manager.h" #include "stratum/hal/lib/bcm/bcm_switch.h" #include "stratum/hal/lib/bcm/bcm_table_manager.h" #include "stratum/hal/lib/bcm/bcm_tunnel_manager.h" #include "stratum/hal/lib/common/common.pb.h" #include "stratum/hal/lib/p4/p4_table_mapper.h" #include "stratum/hal/lib/phal/phal_sim.h" #include "stratum/lib/utils.h" namespace stratum { namespace hal { namespace bcm { class BcmSimTestFixture : public testing::Test { protected: BcmSimTestFixture() {} ~BcmSimTestFixture() override {} void SetUp() override; void TearDown() override; // The fix node Id and unit for the node tested by this class. This class // only tests one node with ID 1 and unit 0. static constexpr uint64 kNodeId = 1; static constexpr int kUnit = 0; ChassisConfig chassis_config_; ::p4::v1::ForwardingPipelineConfig forwarding_pipeline_config_; ::p4::v1::WriteRequest write_request_; std::unique_ptr<BcmAclManager> bcm_acl_manager_; std::unique_ptr<BcmChassisManager> bcm_chassis_manager_; std::unique_ptr<BcmL2Manager> bcm_l2_manager_; std::unique_ptr<BcmL3Manager> bcm_l3_manager_; std::unique_ptr<BcmNode> bcm_node_; std::unique_ptr<BcmPacketioManager> bcm_packetio_manager_; std::unique_ptr<BcmSdkSim> bcm_sdk_sim_; std::unique_ptr<BcmSerdesDbManager> bcm_serdes_db_manager_; std::unique_ptr<BcmSwitch> bcm_switch_; std::unique_ptr<BcmTableManager> bcm_table_manager_; std::unique_ptr<BcmTunnelManager> bcm_tunnel_manager_; std::unique_ptr<P4TableMapper> p4_table_mapper_; std::unique_ptr<PhalSim> phal_sim_; }; } // namespace bcm } // namespace hal } // namespace stratum #endif // STRATUM_TESTING_TESTS_BCM_SIM_TEST_FIXTURE_H_
/* Copyright 2011; All Rights Reserved * Please see http://www.coactionos.com/license.html for * licensing information. */ /*! \addtogroup TIME * @{ */ /*! \file */ #include <sys/time.h> #include <time.h> #include <errno.h> #include <unistd.h> #include <fcntl.h> #include "hwpl.h" #include "dev/rtc.h" #include "../sched/sched_flags.h" extern struct timeval time_of_day_offset HWPL_SYS_MEM; /*! \details This function gets the current time of day using * the real time clock. The time is written to \a tp. In * this implementation \a tzp is not used. * * \return Zero * */ int gettimeofday(struct timeval * tp, void * tzp); static int gettimeofday_rtc(struct timeval * ptimeval); static void gettimeofday_sched(struct timeval * ptimeval); int _gettimeofday(struct timeval * ptimeval, void * ptimezone){ if ( gettimeofday_rtc(ptimeval) < 0 ){ gettimeofday_sched(ptimeval); } return 0; } void gettimeofday_sched(struct timeval * ptimeval){ struct sched_timeval tv; div_t d; struct timeval tmp; hwpl_core_privcall((core_privcall_t)sched_priv_get_realtime, &tv); //Convert the sched_timeval to a timeval struct d = div(tv.tv_usec, 1000000); tmp.tv_sec = tv.tv_sec * SCHED_TIMEVAL_SECONDS + d.quot; tmp.tv_usec = d.rem; //add the offset ptimeval->tv_sec = tmp.tv_sec + time_of_day_offset.tv_sec; ptimeval->tv_usec = tmp.tv_usec + time_of_day_offset.tv_usec; if ( ptimeval->tv_usec >= 1000000 ){ ptimeval->tv_usec -= 1000000; ptimeval->tv_sec++; } return; } int gettimeofday_rtc(struct timeval * ptimeval){ int fd; struct tm cal_time; fd = open("/dev/rtc", O_RDWR); if ( fd < 0 ){ return -1; } if ( ioctl(fd, I_RTC_GET, &cal_time) < 0){ close(fd); return -1; } ptimeval->tv_sec = mktime(&cal_time); ptimeval->tv_usec = 0; close(fd); return 0; } /*! @} */
#include <assert.h> #include <string.h> #include "buffer.h" #include "MKL25Z4.h" #include "core_cm0plus.h" #include "core_cmFunc.h" #include "freedom.h" #define NEXT_INDEX(x) ((x + 1) & (2 * RING_BUF_SIZE - 1)) int is_empty(struct ring_buffer *buffer) { return buffer->head == buffer->tail; } static int is_full(struct ring_buffer *buffer) { return buffer->tail == (buffer->head ^ RING_BUF_SIZE); } void init_ring_buffer(struct ring_buffer *buffer) { memset(buffer, 0, sizeof(buffer)); } int add_bytes(struct ring_buffer *buffer, const uint8_t * source, int count) { const uint8_t *data = source; while (count--) { // diable and enable interrupts each time around the loop to // minimise the amount of time with ints disabled __disable_irq(); if (is_full(buffer)) { __enable_irq(); break; } buffer->data[buffer->head & (RING_BUF_SIZE - 1)] = *data++; buffer->head = NEXT_INDEX(buffer->head); __enable_irq(); } return data - source; } int get_bytes(struct ring_buffer *buffer, uint8_t * dest, int count) { uint8_t *data = dest; while (count--) { __disable_irq(); // no point continuing if buffer is empty if (is_empty(buffer)) { __enable_irq(); break; } *data++ = buffer->data[buffer->tail & (RING_BUF_SIZE - 1)]; buffer->tail = NEXT_INDEX(buffer->tail); __enable_irq(); } return data - dest; } int get_byte(struct ring_buffer *buffer, uint8_t * byte) { return get_bytes(buffer, byte, 1); }
// Copyright 2016 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 TEST_CCTEST_INTERPRETER_BYTECODE_EXPECTATIONS_PRINTER_H_ #define TEST_CCTEST_INTERPRETER_BYTECODE_EXPECTATIONS_PRINTER_H_ #include <iostream> #include <string> #include <vector> #include "src/interpreter/bytecodes.h" #include "src/objects.h" namespace v8 { class Isolate; namespace internal { class BytecodeArray; class SourcePositionTableIterator; namespace interpreter { class BytecodeArrayIterator; class BytecodeExpectationsPrinter final { public: explicit BytecodeExpectationsPrinter(v8::Isolate* i) : isolate_(i), module_(false), wrap_(true), top_level_(false), print_callee_(false), oneshot_opt_(false), test_function_name_(kDefaultTopFunctionName) {} void PrintExpectation(std::ostream& stream, // NOLINT const std::string& snippet) const; void set_module(bool module) { module_ = module; } bool module() const { return module_; } void set_wrap(bool wrap) { wrap_ = wrap; } bool wrap() const { return wrap_; } void set_top_level(bool top_level) { top_level_ = top_level; } bool top_level() const { return top_level_; } void set_print_callee(bool print_callee) { print_callee_ = print_callee; } bool print_callee() { return print_callee_; } void set_oneshot_opt(bool oneshot_opt) { oneshot_opt_ = oneshot_opt; } bool oneshot_opt() { return oneshot_opt_; } void set_test_function_name(const std::string& test_function_name) { test_function_name_ = test_function_name; } std::string test_function_name() const { return test_function_name_; } private: void PrintEscapedString(std::ostream& stream, // NOLINT const std::string& string) const; void PrintBytecodeOperand(std::ostream& stream, // NOLINT const BytecodeArrayIterator& bytecode_iterator, const Bytecode& bytecode, int op_index, int parameter_count) const; void PrintBytecode(std::ostream& stream, // NOLINT const BytecodeArrayIterator& bytecode_iterator, int parameter_count) const; void PrintSourcePosition(std::ostream& stream, // NOLINT SourcePositionTableIterator& source_iterator, int bytecode_offset) const; void PrintV8String(std::ostream& stream, // NOLINT i::String* string) const; void PrintConstant(std::ostream& stream, // NOLINT i::Handle<i::Object> constant) const; void PrintFrameSize(std::ostream& stream, // NOLINT i::Handle<i::BytecodeArray> bytecode_array) const; void PrintBytecodeSequence(std::ostream& stream, // NOLINT i::Handle<i::BytecodeArray> bytecode_array) const; void PrintConstantPool(std::ostream& stream, // NOLINT i::FixedArray* constant_pool) const; void PrintCodeSnippet(std::ostream& stream, // NOLINT const std::string& body) const; void PrintBytecodeArray(std::ostream& stream, // NOLINT i::Handle<i::BytecodeArray> bytecode_array) const; void PrintHandlers(std::ostream& stream, // NOLINT i::Handle<i::BytecodeArray> bytecode_array) const; v8::Local<v8::String> V8StringFromUTF8(const char* data) const; std::string WrapCodeInFunction(const char* function_name, const std::string& function_body) const; v8::Local<v8::Script> CompileScript(const char* program) const; v8::Local<v8::Module> CompileModule(const char* program) const; void Run(v8::Local<v8::Script> script) const; i::Handle<i::BytecodeArray> GetBytecodeArrayForGlobal( const char* global_name) const; i::Handle<v8::internal::BytecodeArray> GetBytecodeArrayForModule( v8::Local<v8::Module> module) const; i::Handle<v8::internal::BytecodeArray> GetBytecodeArrayForScript( v8::Local<v8::Script> script) const; i::Handle<i::BytecodeArray> GetBytecodeArrayOfCallee( const char* source_code) const; i::Isolate* i_isolate() const { return reinterpret_cast<i::Isolate*>(isolate_); } v8::Isolate* isolate_; bool module_; bool wrap_; bool top_level_; bool print_callee_; bool oneshot_opt_; std::string test_function_name_; static const char* const kDefaultTopFunctionName; static const char* const kIndent; }; } // namespace interpreter } // namespace internal } // namespace v8 #endif // TEST_CCTEST_INTERPRETER_BYTECODE_EXPECTATIONS_PRINTER_H_
/**************************************************************************** * Copyright 2017 Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) * * * * 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 __USE_COMMUNICATION_FRAME_INTERFACE_H__ #define __USE_COMMUNICATION_FRAME_INTERFACE_H__ /*============================ INCLUDES ======================================*/ #include "..\..\memory\block\block.h" /*============================ MACROS ========================================*/ /*============================ MACROFIED FUNCTIONS ===========================*/ /*============================ TYPES =========================================*/ //! \brief prototype for frame parser typedef uint_fast16_t frame_parser_t(mem_block_t tMemory, uint_fast16_t hwSize); typedef block_t *frame_block_parser_t(block_t *ptBlock, void *pTag); /*============================ GLOBAL VARIABLES ==============================*/ /*============================ LOCAL VARIABLES ===============================*/ /*============================ PROTOTYPES ====================================*/ /*============================ INCLUDES ======================================*/ #endif
/* * Xtensa Special Register symbolic names */ /* $Id: //depot/rel/Eaglenest/Xtensa/SWConfig/hal/specreg.h.tpp#1 $ */ /* Customer ID=11657; Build=0x5fe96; Copyright (c) 1998-2002 Tensilica Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef XTENSA_SPECREG_H #define XTENSA_SPECREG_H /* Include these special register bitfield definitions, for historical reasons: */ #include <xtensa/corebits.h> /* Special registers: */ #define LBEG 0 #define LEND 1 #define LCOUNT 2 #define SAR 3 #define BR 4 #define SCOMPARE1 12 #define ACCLO 16 #define ACCHI 17 #define MR_0 32 #define MR_1 33 #define MR_2 34 #define MR_3 35 #define WINDOWBASE 72 #define WINDOWSTART 73 #define IBREAKENABLE 96 #define MEMCTL 97 #define ATOMCTL 99 #define DDR 104 #define IBREAKA_0 128 #define IBREAKA_1 129 #define DBREAKA_0 144 #define DBREAKA_1 145 #define DBREAKC_0 160 #define DBREAKC_1 161 #define CONFIGID0 176 #define EPC_1 177 #define EPC_2 178 #define EPC_3 179 #define EPC_4 180 #define EPC_5 181 #define EPC_6 182 #define EPC_7 183 #define DEPC 192 #define EPS_2 194 #define EPS_3 195 #define EPS_4 196 #define EPS_5 197 #define EPS_6 198 #define EPS_7 199 #define CONFIGID1 208 #define EXCSAVE_1 209 #define EXCSAVE_2 210 #define EXCSAVE_3 211 #define EXCSAVE_4 212 #define EXCSAVE_5 213 #define EXCSAVE_6 214 #define EXCSAVE_7 215 #define CPENABLE 224 #define INTERRUPT 226 #define INTENABLE 228 #define PS 230 #define VECBASE 231 #define EXCCAUSE 232 #define DEBUGCAUSE 233 #define CCOUNT 234 #define PRID 235 #define ICOUNT 236 #define ICOUNTLEVEL 237 #define EXCVADDR 238 #define CCOMPARE_0 240 #define CCOMPARE_1 241 #define CCOMPARE_2 242 #define MISC_REG_0 244 #define MISC_REG_1 245 #define MISC_REG_2 246 #define MISC_REG_3 247 /* Special cases (bases of special register series): */ #define MR 32 #define IBREAKA 128 #define DBREAKA 144 #define DBREAKC 160 #define EPC 176 #define EPS 192 #define EXCSAVE 208 #define CCOMPARE 240 /* Special names for read-only and write-only interrupt registers: */ #define INTREAD 226 #define INTSET 226 #define INTCLEAR 227 #endif /* XTENSA_SPECREG_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. */ #import <Cocoa/Cocoa.h> #import <Cordova/CDVViewController.h> @interface AppDelegate : NSObject <NSApplicationDelegate> { } @property (nonatomic, strong) IBOutlet CDVViewController* viewController; - (void)createViewController: (NSString*) startPage; - (void)destroyViewController; @end
// // TopicDetailModel.h // WYnewsss // // Created by lanou on 16/4/20. // Copyright © 2016年 lanou. All rights reserved. // #import "BaseModel.h" #import "TopicQuestionModel.h" #import "TopicAnswerModel.h" @interface TopicDetailModel : BaseModel /**提问者*/ @property (nonatomic, strong) TopicQuestionModel *question; /**回答者*/ @property (nonatomic, strong) TopicAnswerModel *answer; /* 行高 */ @property (nonatomic, assign) CGFloat totalHeight; @end
#pragma once #include <stddef.h> #include <cstdint> #include <vector> namespace pmlc::util::math { inline uint64_t NearestPo2(uint64_t x) { uint64_t po2 = 1; while (po2 < x) { po2 *= 2; } return po2; } inline uint64_t IsPo2(uint64_t x) { return x == NearestPo2(x); } // ceil(x/y) template <typename X, typename Y> inline constexpr auto RoundUp(X x, Y y) -> decltype((x + y - 1) / y) { return (x + y - 1) / y; } inline constexpr size_t Align(size_t count, size_t alignment) { return ((count + alignment - 1) / alignment) * alignment; } inline int64_t Sign(int64_t a) { return (a == 0 ? 0 : (a < 0 ? -1 : 1)); } struct Seive { // First factor for each number. We leave 0 + 1 in the list to make things // easier to read std::vector<uint64_t> first_factor; std::vector<uint64_t> primes; explicit Seive(uint64_t size); }; // Reeturn the first prime factor of a number uint64_t FirstFactor(uint64_t in); // Return the full factorization of a number std::vector<uint64_t> Factor(uint64_t in); // Return the number of factors a number has uint64_t NumFactors(uint64_t in); // Check if a number is prime bool IsPrime(uint64_t in); } // namespace pmlc::util::math